637 lines
2.0 MiB
637 lines
2.0 MiB
var qpe=Object.defineProperty;var cq=e=>{throw TypeError(e)};var Gpe=(e,t,n)=>t in e?qpe(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n;var Be=(e,t,n)=>Gpe(e,typeof t!="symbol"?t+"":t,n),d3=(e,t,n)=>t.has(e)||cq("Cannot "+n);var P=(e,t,n)=>(d3(e,t,"read from private field"),n?n.call(e):t.get(e)),G=(e,t,n)=>t.has(e)?cq("Cannot add the same private member more than once"):t instanceof WeakSet?t.add(e):t.set(e,n),V=(e,t,n,r)=>(d3(e,t,"write to private field"),r?r.call(e,n):t.set(e,n),n),K=(e,t,n)=>(d3(e,t,"access private method"),n);var Ui=(e,t,n,r)=>({set _(s){V(e,t,s,n)},get _(){return P(e,t,r)}});function AX(e,t){for(var n=0;n<t.length;n++){const r=t[n];if(typeof r!="string"&&!Array.isArray(r)){for(const s in r)if(s!=="default"&&!(s in e)){const i=Object.getOwnPropertyDescriptor(r,s);i&&Object.defineProperty(e,s,i.get?i:{enumerable:!0,get:()=>r[s]})}}}return Object.freeze(Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}))}(function(){const t=document.createElement("link").relList;if(t&&t.supports&&t.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 xr=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function Al(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}function Kpe(e){if(e.__esModule)return e;var t=e.default;if(typeof t=="function"){var n=function r(){return this instanceof r?Reflect.construct(t,arguments,this.constructor):t.apply(this,arguments)};n.prototype=t.prototype}else n={};return Object.defineProperty(n,"__esModule",{value:!0}),Object.keys(e).forEach(function(r){var s=Object.getOwnPropertyDescriptor(e,r);Object.defineProperty(n,r,s.get?s:{enumerable:!0,get:function(){return e[r]}})}),n}var RX={exports:{}},Uk={},PX={exports:{}},ln={};/**
|
||
* @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 AA=Symbol.for("react.element"),Ype=Symbol.for("react.portal"),Xpe=Symbol.for("react.fragment"),Qpe=Symbol.for("react.strict_mode"),Zpe=Symbol.for("react.profiler"),Jpe=Symbol.for("react.provider"),eme=Symbol.for("react.context"),tme=Symbol.for("react.forward_ref"),nme=Symbol.for("react.suspense"),rme=Symbol.for("react.memo"),sme=Symbol.for("react.lazy"),uq=Symbol.iterator;function ime(e){return e===null||typeof e!="object"?null:(e=uq&&e[uq]||e["@@iterator"],typeof e=="function"?e:null)}var NX={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},TX=Object.assign,kX={};function Ex(e,t,n){this.props=e,this.context=t,this.refs=kX,this.updater=n||NX}Ex.prototype.isReactComponent={};Ex.prototype.setState=function(e,t){if(typeof e!="object"&&typeof e!="function"&&e!=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,e,t,"setState")};Ex.prototype.forceUpdate=function(e){this.updater.enqueueForceUpdate(this,e,"forceUpdate")};function DX(){}DX.prototype=Ex.prototype;function EV(e,t,n){this.props=e,this.context=t,this.refs=kX,this.updater=n||NX}var AV=EV.prototype=new DX;AV.constructor=EV;TX(AV,Ex.prototype);AV.isPureReactComponent=!0;var dq=Array.isArray,OX=Object.prototype.hasOwnProperty,RV={current:null},MX={key:!0,ref:!0,__self:!0,__source:!0};function IX(e,t,n){var r,s={},i=null,o=null;if(t!=null)for(r in t.ref!==void 0&&(o=t.ref),t.key!==void 0&&(i=""+t.key),t)OX.call(t,r)&&!MX.hasOwnProperty(r)&&(s[r]=t[r]);var a=arguments.length-2;if(a===1)s.children=n;else if(1<a){for(var c=Array(a),d=0;d<a;d++)c[d]=arguments[d+2];s.children=c}if(e&&e.defaultProps)for(r in a=e.defaultProps,a)s[r]===void 0&&(s[r]=a[r]);return{$$typeof:AA,type:e,key:i,ref:o,props:s,_owner:RV.current}}function ome(e,t){return{$$typeof:AA,type:e.type,key:t,ref:e.ref,props:e.props,_owner:e._owner}}function PV(e){return typeof e=="object"&&e!==null&&e.$$typeof===AA}function ame(e){var t={"=":"=0",":":"=2"};return"$"+e.replace(/[=:]/g,function(n){return t[n]})}var fq=/\/+/g;function f3(e,t){return typeof e=="object"&&e!==null&&e.key!=null?ame(""+e.key):t.toString(36)}function jP(e,t,n,r,s){var i=typeof e;(i==="undefined"||i==="boolean")&&(e=null);var o=!1;if(e===null)o=!0;else switch(i){case"string":case"number":o=!0;break;case"object":switch(e.$$typeof){case AA:case Ype:o=!0}}if(o)return o=e,s=s(o),e=r===""?"."+f3(o,0):r,dq(s)?(n="",e!=null&&(n=e.replace(fq,"$&/")+"/"),jP(s,t,n,"",function(d){return d})):s!=null&&(PV(s)&&(s=ome(s,n+(!s.key||o&&o.key===s.key?"":(""+s.key).replace(fq,"$&/")+"/")+e)),t.push(s)),1;if(o=0,r=r===""?".":r+":",dq(e))for(var a=0;a<e.length;a++){i=e[a];var c=r+f3(i,a);o+=jP(i,t,n,c,s)}else if(c=ime(e),typeof c=="function")for(e=c.call(e),a=0;!(i=e.next()).done;)i=i.value,c=r+f3(i,a++),o+=jP(i,t,n,c,s);else if(i==="object")throw t=String(e),Error("Objects are not valid as a React child (found: "+(t==="[object Object]"?"object with keys {"+Object.keys(e).join(", ")+"}":t)+"). If you meant to render a collection of children, use an array instead.");return o}function kR(e,t,n){if(e==null)return e;var r=[],s=0;return jP(e,r,"","",function(i){return t.call(n,i,s++)}),r}function lme(e){if(e._status===-1){var t=e._result;t=t(),t.then(function(n){(e._status===0||e._status===-1)&&(e._status=1,e._result=n)},function(n){(e._status===0||e._status===-1)&&(e._status=2,e._result=n)}),e._status===-1&&(e._status=0,e._result=t)}if(e._status===1)return e._result.default;throw e._result}var Oo={current:null},$P={transition:null},cme={ReactCurrentDispatcher:Oo,ReactCurrentBatchConfig:$P,ReactCurrentOwner:RV};function LX(){throw Error("act(...) is not supported in production builds of React.")}ln.Children={map:kR,forEach:function(e,t,n){kR(e,function(){t.apply(this,arguments)},n)},count:function(e){var t=0;return kR(e,function(){t++}),t},toArray:function(e){return kR(e,function(t){return t})||[]},only:function(e){if(!PV(e))throw Error("React.Children.only expected to receive a single React element child.");return e}};ln.Component=Ex;ln.Fragment=Xpe;ln.Profiler=Zpe;ln.PureComponent=EV;ln.StrictMode=Qpe;ln.Suspense=nme;ln.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED=cme;ln.act=LX;ln.cloneElement=function(e,t,n){if(e==null)throw Error("React.cloneElement(...): The argument must be a React element, but you passed "+e+".");var r=TX({},e.props),s=e.key,i=e.ref,o=e._owner;if(t!=null){if(t.ref!==void 0&&(i=t.ref,o=RV.current),t.key!==void 0&&(s=""+t.key),e.type&&e.type.defaultProps)var a=e.type.defaultProps;for(c in t)OX.call(t,c)&&!MX.hasOwnProperty(c)&&(r[c]=t[c]===void 0&&a!==void 0?a[c]:t[c])}var c=arguments.length-2;if(c===1)r.children=n;else if(1<c){a=Array(c);for(var d=0;d<c;d++)a[d]=arguments[d+2];r.children=a}return{$$typeof:AA,type:e.type,key:s,ref:i,props:r,_owner:o}};ln.createContext=function(e){return e={$$typeof:eme,_currentValue:e,_currentValue2:e,_threadCount:0,Provider:null,Consumer:null,_defaultValue:null,_globalName:null},e.Provider={$$typeof:Jpe,_context:e},e.Consumer=e};ln.createElement=IX;ln.createFactory=function(e){var t=IX.bind(null,e);return t.type=e,t};ln.createRef=function(){return{current:null}};ln.forwardRef=function(e){return{$$typeof:tme,render:e}};ln.isValidElement=PV;ln.lazy=function(e){return{$$typeof:sme,_payload:{_status:-1,_result:e},_init:lme}};ln.memo=function(e,t){return{$$typeof:rme,type:e,compare:t===void 0?null:t}};ln.startTransition=function(e){var t=$P.transition;$P.transition={};try{e()}finally{$P.transition=t}};ln.unstable_act=LX;ln.useCallback=function(e,t){return Oo.current.useCallback(e,t)};ln.useContext=function(e){return Oo.current.useContext(e)};ln.useDebugValue=function(){};ln.useDeferredValue=function(e){return Oo.current.useDeferredValue(e)};ln.useEffect=function(e,t){return Oo.current.useEffect(e,t)};ln.useId=function(){return Oo.current.useId()};ln.useImperativeHandle=function(e,t,n){return Oo.current.useImperativeHandle(e,t,n)};ln.useInsertionEffect=function(e,t){return Oo.current.useInsertionEffect(e,t)};ln.useLayoutEffect=function(e,t){return Oo.current.useLayoutEffect(e,t)};ln.useMemo=function(e,t){return Oo.current.useMemo(e,t)};ln.useReducer=function(e,t,n){return Oo.current.useReducer(e,t,n)};ln.useRef=function(e){return Oo.current.useRef(e)};ln.useState=function(e){return Oo.current.useState(e)};ln.useSyncExternalStore=function(e,t,n){return Oo.current.useSyncExternalStore(e,t,n)};ln.useTransition=function(){return Oo.current.useTransition()};ln.version="18.3.1";PX.exports=ln;var C=PX.exports;const fe=Al(C),Tv=AX({__proto__:null,default:fe},[C]);/**
|
||
* @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 ume=C,dme=Symbol.for("react.element"),fme=Symbol.for("react.fragment"),hme=Object.prototype.hasOwnProperty,pme=ume.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,mme={key:!0,ref:!0,__self:!0,__source:!0};function jX(e,t,n){var r,s={},i=null,o=null;n!==void 0&&(i=""+n),t.key!==void 0&&(i=""+t.key),t.ref!==void 0&&(o=t.ref);for(r in t)hme.call(t,r)&&!mme.hasOwnProperty(r)&&(s[r]=t[r]);if(e&&e.defaultProps)for(r in t=e.defaultProps,t)s[r]===void 0&&(s[r]=t[r]);return{$$typeof:dme,type:e,key:i,ref:o,props:s,_owner:pme.current}}Uk.Fragment=fme;Uk.jsx=jX;Uk.jsxs=jX;RX.exports=Uk;var _=RX.exports,Rz={},$X={exports:{}},el={},FX={exports:{}},zX={};/**
|
||
* @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(e){function t(H,se){var he=H.length;H.push(se);e:for(;0<he;){var re=he-1>>>1,J=H[re];if(0<s(J,se))H[re]=se,H[he]=J,he=re;else break e}}function n(H){return H.length===0?null:H[0]}function r(H){if(H.length===0)return null;var se=H[0],he=H.pop();if(he!==se){H[0]=he;e:for(var re=0,J=H.length,te=J>>>1;re<te;){var ae=2*(re+1)-1,be=H[ae],xe=ae+1,ve=H[xe];if(0>s(be,he))xe<J&&0>s(ve,be)?(H[re]=ve,H[xe]=he,re=xe):(H[re]=be,H[ae]=he,re=ae);else if(xe<J&&0>s(ve,he))H[re]=ve,H[xe]=he,re=xe;else break e}}return se}function s(H,se){var he=H.sortIndex-se.sortIndex;return he!==0?he:H.id-se.id}if(typeof performance=="object"&&typeof performance.now=="function"){var i=performance;e.unstable_now=function(){return i.now()}}else{var o=Date,a=o.now();e.unstable_now=function(){return o.now()-a}}var c=[],d=[],h=1,u=null,f=3,g=!1,v=!1,m=!1,x=typeof setTimeout=="function"?setTimeout:null,y=typeof clearTimeout=="function"?clearTimeout:null,b=typeof setImmediate<"u"?setImmediate:null;typeof navigator<"u"&&navigator.scheduling!==void 0&&navigator.scheduling.isInputPending!==void 0&&navigator.scheduling.isInputPending.bind(navigator.scheduling);function w(H){for(var se=n(d);se!==null;){if(se.callback===null)r(d);else if(se.startTime<=H)r(d),se.sortIndex=se.expirationTime,t(c,se);else break;se=n(d)}}function E(H){if(m=!1,w(H),!v)if(n(c)!==null)v=!0,Z(R);else{var se=n(d);se!==null&&Y(E,se.startTime-H)}}function R(H,se){v=!1,m&&(m=!1,y(A),A=-1),g=!0;var he=f;try{for(w(se),u=n(c);u!==null&&(!(u.expirationTime>se)||H&&!I());){var re=u.callback;if(typeof re=="function"){u.callback=null,f=u.priorityLevel;var J=re(u.expirationTime<=se);se=e.unstable_now(),typeof J=="function"?u.callback=J:u===n(c)&&r(c),w(se)}else r(c);u=n(c)}if(u!==null)var te=!0;else{var ae=n(d);ae!==null&&Y(E,ae.startTime-se),te=!1}return te}finally{u=null,f=he,g=!1}}var T=!1,N=null,A=-1,D=5,O=-1;function I(){return!(e.unstable_now()-O<D)}function $(){if(N!==null){var H=e.unstable_now();O=H;var se=!0;try{se=N(!0,H)}finally{se?F():(T=!1,N=null)}}else T=!1}var F;if(typeof b=="function")F=function(){b($)};else if(typeof MessageChannel<"u"){var B=new MessageChannel,W=B.port2;B.port1.onmessage=$,F=function(){W.postMessage(null)}}else F=function(){x($,0)};function Z(H){N=H,T||(T=!0,F())}function Y(H,se){A=x(function(){H(e.unstable_now())},se)}e.unstable_IdlePriority=5,e.unstable_ImmediatePriority=1,e.unstable_LowPriority=4,e.unstable_NormalPriority=3,e.unstable_Profiling=null,e.unstable_UserBlockingPriority=2,e.unstable_cancelCallback=function(H){H.callback=null},e.unstable_continueExecution=function(){v||g||(v=!0,Z(R))},e.unstable_forceFrameRate=function(H){0>H||125<H?console.error("forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported"):D=0<H?Math.floor(1e3/H):5},e.unstable_getCurrentPriorityLevel=function(){return f},e.unstable_getFirstCallbackNode=function(){return n(c)},e.unstable_next=function(H){switch(f){case 1:case 2:case 3:var se=3;break;default:se=f}var he=f;f=se;try{return H()}finally{f=he}},e.unstable_pauseExecution=function(){},e.unstable_requestPaint=function(){},e.unstable_runWithPriority=function(H,se){switch(H){case 1:case 2:case 3:case 4:case 5:break;default:H=3}var he=f;f=H;try{return se()}finally{f=he}},e.unstable_scheduleCallback=function(H,se,he){var re=e.unstable_now();switch(typeof he=="object"&&he!==null?(he=he.delay,he=typeof he=="number"&&0<he?re+he:re):he=re,H){case 1:var J=-1;break;case 2:J=250;break;case 5:J=1073741823;break;case 4:J=1e4;break;default:J=5e3}return J=he+J,H={id:h++,callback:se,priorityLevel:H,startTime:he,expirationTime:J,sortIndex:-1},he>re?(H.sortIndex=he,t(d,H),n(c)===null&&H===n(d)&&(m?(y(A),A=-1):m=!0,Y(E,he-re))):(H.sortIndex=J,t(c,H),v||g||(v=!0,Z(R))),H},e.unstable_shouldYield=I,e.unstable_wrapCallback=function(H){var se=f;return function(){var he=f;f=se;try{return H.apply(this,arguments)}finally{f=he}}}})(zX);FX.exports=zX;var gme=FX.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 vme=C,Qa=gme;function Ve(e){for(var t="https://reactjs.org/docs/error-decoder.html?invariant="+e,n=1;n<arguments.length;n++)t+="&args[]="+encodeURIComponent(arguments[n]);return"Minified React error #"+e+"; visit "+t+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}var BX=new Set,J1={};function sy(e,t){Q0(e,t),Q0(e+"Capture",t)}function Q0(e,t){for(J1[e]=t,e=0;e<t.length;e++)BX.add(t[e])}var Df=!(typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),Pz=Object.prototype.hasOwnProperty,yme=/^[: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]*$/,hq={},pq={};function bme(e){return Pz.call(pq,e)?!0:Pz.call(hq,e)?!1:yme.test(e)?pq[e]=!0:(hq[e]=!0,!1)}function xme(e,t,n,r){if(n!==null&&n.type===0)return!1;switch(typeof t){case"function":case"symbol":return!0;case"boolean":return r?!1:n!==null?!n.acceptsBooleans:(e=e.toLowerCase().slice(0,5),e!=="data-"&&e!=="aria-");default:return!1}}function _me(e,t,n,r){if(t===null||typeof t>"u"||xme(e,t,n,r))return!0;if(r)return!1;if(n!==null)switch(n.type){case 3:return!t;case 4:return t===!1;case 5:return isNaN(t);case 6:return isNaN(t)||1>t}return!1}function Mo(e,t,n,r,s,i,o){this.acceptsBooleans=t===2||t===3||t===4,this.attributeName=r,this.attributeNamespace=s,this.mustUseProperty=n,this.propertyName=e,this.type=t,this.sanitizeURL=i,this.removeEmptyString=o}var Fi={};"children dangerouslySetInnerHTML defaultValue defaultChecked innerHTML suppressContentEditableWarning suppressHydrationWarning style".split(" ").forEach(function(e){Fi[e]=new Mo(e,0,!1,e,null,!1,!1)});[["acceptCharset","accept-charset"],["className","class"],["htmlFor","for"],["httpEquiv","http-equiv"]].forEach(function(e){var t=e[0];Fi[t]=new Mo(t,1,!1,e[1],null,!1,!1)});["contentEditable","draggable","spellCheck","value"].forEach(function(e){Fi[e]=new Mo(e,2,!1,e.toLowerCase(),null,!1,!1)});["autoReverse","externalResourcesRequired","focusable","preserveAlpha"].forEach(function(e){Fi[e]=new Mo(e,2,!1,e,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(e){Fi[e]=new Mo(e,3,!1,e.toLowerCase(),null,!1,!1)});["checked","multiple","muted","selected"].forEach(function(e){Fi[e]=new Mo(e,3,!0,e,null,!1,!1)});["capture","download"].forEach(function(e){Fi[e]=new Mo(e,4,!1,e,null,!1,!1)});["cols","rows","size","span"].forEach(function(e){Fi[e]=new Mo(e,6,!1,e,null,!1,!1)});["rowSpan","start"].forEach(function(e){Fi[e]=new Mo(e,5,!1,e.toLowerCase(),null,!1,!1)});var NV=/[\-:]([a-z])/g;function TV(e){return e[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(e){var t=e.replace(NV,TV);Fi[t]=new Mo(t,1,!1,e,null,!1,!1)});"xlink:actuate xlink:arcrole xlink:role xlink:show xlink:title xlink:type".split(" ").forEach(function(e){var t=e.replace(NV,TV);Fi[t]=new Mo(t,1,!1,e,"http://www.w3.org/1999/xlink",!1,!1)});["xml:base","xml:lang","xml:space"].forEach(function(e){var t=e.replace(NV,TV);Fi[t]=new Mo(t,1,!1,e,"http://www.w3.org/XML/1998/namespace",!1,!1)});["tabIndex","crossOrigin"].forEach(function(e){Fi[e]=new Mo(e,1,!1,e.toLowerCase(),null,!1,!1)});Fi.xlinkHref=new Mo("xlinkHref",1,!1,"xlink:href","http://www.w3.org/1999/xlink",!0,!1);["src","href","action","formAction"].forEach(function(e){Fi[e]=new Mo(e,1,!1,e.toLowerCase(),null,!0,!0)});function kV(e,t,n,r){var s=Fi.hasOwnProperty(t)?Fi[t]:null;(s!==null?s.type!==0:r||!(2<t.length)||t[0]!=="o"&&t[0]!=="O"||t[1]!=="n"&&t[1]!=="N")&&(_me(t,n,s,r)&&(n=null),r||s===null?bme(t)&&(n===null?e.removeAttribute(t):e.setAttribute(t,""+n)):s.mustUseProperty?e[s.propertyName]=n===null?s.type===3?!1:"":n:(t=s.attributeName,r=s.attributeNamespace,n===null?e.removeAttribute(t):(s=s.type,n=s===3||s===4&&n===!0?"":""+n,r?e.setAttributeNS(r,t,n):e.setAttribute(t,n))))}var Bf=vme.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED,DR=Symbol.for("react.element"),sb=Symbol.for("react.portal"),ib=Symbol.for("react.fragment"),DV=Symbol.for("react.strict_mode"),Nz=Symbol.for("react.profiler"),UX=Symbol.for("react.provider"),VX=Symbol.for("react.context"),OV=Symbol.for("react.forward_ref"),Tz=Symbol.for("react.suspense"),kz=Symbol.for("react.suspense_list"),MV=Symbol.for("react.memo"),lh=Symbol.for("react.lazy"),HX=Symbol.for("react.offscreen"),mq=Symbol.iterator;function ES(e){return e===null||typeof e!="object"?null:(e=mq&&e[mq]||e["@@iterator"],typeof e=="function"?e:null)}var is=Object.assign,h3;function r1(e){if(h3===void 0)try{throw Error()}catch(n){var t=n.stack.trim().match(/\n( *(at )?)/);h3=t&&t[1]||""}return`
|
||
`+h3+e}var p3=!1;function m3(e,t){if(!e||p3)return"";p3=!0;var n=Error.prepareStackTrace;Error.prepareStackTrace=void 0;try{if(t)if(t=function(){throw Error()},Object.defineProperty(t.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(t,[])}catch(d){var r=d}Reflect.construct(e,[],t)}else{try{t.call()}catch(d){r=d}e.call(t.prototype)}else{try{throw Error()}catch(d){r=d}e()}}catch(d){if(d&&r&&typeof d.stack=="string"){for(var s=d.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 e.displayName&&c.includes("<anonymous>")&&(c=c.replace("<anonymous>",e.displayName)),c}while(1<=o&&0<=a);break}}}finally{p3=!1,Error.prepareStackTrace=n}return(e=e?e.displayName||e.name:"")?r1(e):""}function wme(e){switch(e.tag){case 5:return r1(e.type);case 16:return r1("Lazy");case 13:return r1("Suspense");case 19:return r1("SuspenseList");case 0:case 2:case 15:return e=m3(e.type,!1),e;case 11:return e=m3(e.type.render,!1),e;case 1:return e=m3(e.type,!0),e;default:return""}}function Dz(e){if(e==null)return null;if(typeof e=="function")return e.displayName||e.name||null;if(typeof e=="string")return e;switch(e){case ib:return"Fragment";case sb:return"Portal";case Nz:return"Profiler";case DV:return"StrictMode";case Tz:return"Suspense";case kz:return"SuspenseList"}if(typeof e=="object")switch(e.$$typeof){case VX:return(e.displayName||"Context")+".Consumer";case UX:return(e._context.displayName||"Context")+".Provider";case OV:var t=e.render;return e=e.displayName,e||(e=t.displayName||t.name||"",e=e!==""?"ForwardRef("+e+")":"ForwardRef"),e;case MV:return t=e.displayName||null,t!==null?t:Dz(e.type)||"Memo";case lh:t=e._payload,e=e._init;try{return Dz(e(t))}catch{}}return null}function Sme(e){var t=e.type;switch(e.tag){case 24:return"Cache";case 9:return(t.displayName||"Context")+".Consumer";case 10:return(t._context.displayName||"Context")+".Provider";case 18:return"DehydratedFragment";case 11:return e=t.render,e=e.displayName||e.name||"",t.displayName||(e!==""?"ForwardRef("+e+")":"ForwardRef");case 7:return"Fragment";case 5:return t;case 4:return"Portal";case 3:return"Root";case 6:return"Text";case 16:return Dz(t);case 8:return t===DV?"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 t=="function")return t.displayName||t.name||null;if(typeof t=="string")return t}return null}function fp(e){switch(typeof e){case"boolean":case"number":case"string":case"undefined":return e;case"object":return e;default:return""}}function WX(e){var t=e.type;return(e=e.nodeName)&&e.toLowerCase()==="input"&&(t==="checkbox"||t==="radio")}function Cme(e){var t=WX(e)?"checked":"value",n=Object.getOwnPropertyDescriptor(e.constructor.prototype,t),r=""+e[t];if(!e.hasOwnProperty(t)&&typeof n<"u"&&typeof n.get=="function"&&typeof n.set=="function"){var s=n.get,i=n.set;return Object.defineProperty(e,t,{configurable:!0,get:function(){return s.call(this)},set:function(o){r=""+o,i.call(this,o)}}),Object.defineProperty(e,t,{enumerable:n.enumerable}),{getValue:function(){return r},setValue:function(o){r=""+o},stopTracking:function(){e._valueTracker=null,delete e[t]}}}}function OR(e){e._valueTracker||(e._valueTracker=Cme(e))}function qX(e){if(!e)return!1;var t=e._valueTracker;if(!t)return!0;var n=t.getValue(),r="";return e&&(r=WX(e)?e.checked?"true":"false":e.value),e=r,e!==n?(t.setValue(e),!0):!1}function BN(e){if(e=e||(typeof document<"u"?document:void 0),typeof e>"u")return null;try{return e.activeElement||e.body}catch{return e.body}}function Oz(e,t){var n=t.checked;return is({},t,{defaultChecked:void 0,defaultValue:void 0,value:void 0,checked:n??e._wrapperState.initialChecked})}function gq(e,t){var n=t.defaultValue==null?"":t.defaultValue,r=t.checked!=null?t.checked:t.defaultChecked;n=fp(t.value!=null?t.value:n),e._wrapperState={initialChecked:r,initialValue:n,controlled:t.type==="checkbox"||t.type==="radio"?t.checked!=null:t.value!=null}}function GX(e,t){t=t.checked,t!=null&&kV(e,"checked",t,!1)}function Mz(e,t){GX(e,t);var n=fp(t.value),r=t.type;if(n!=null)r==="number"?(n===0&&e.value===""||e.value!=n)&&(e.value=""+n):e.value!==""+n&&(e.value=""+n);else if(r==="submit"||r==="reset"){e.removeAttribute("value");return}t.hasOwnProperty("value")?Iz(e,t.type,n):t.hasOwnProperty("defaultValue")&&Iz(e,t.type,fp(t.defaultValue)),t.checked==null&&t.defaultChecked!=null&&(e.defaultChecked=!!t.defaultChecked)}function vq(e,t,n){if(t.hasOwnProperty("value")||t.hasOwnProperty("defaultValue")){var r=t.type;if(!(r!=="submit"&&r!=="reset"||t.value!==void 0&&t.value!==null))return;t=""+e._wrapperState.initialValue,n||t===e.value||(e.value=t),e.defaultValue=t}n=e.name,n!==""&&(e.name=""),e.defaultChecked=!!e._wrapperState.initialChecked,n!==""&&(e.name=n)}function Iz(e,t,n){(t!=="number"||BN(e.ownerDocument)!==e)&&(n==null?e.defaultValue=""+e._wrapperState.initialValue:e.defaultValue!==""+n&&(e.defaultValue=""+n))}var s1=Array.isArray;function xb(e,t,n,r){if(e=e.options,t){t={};for(var s=0;s<n.length;s++)t["$"+n[s]]=!0;for(n=0;n<e.length;n++)s=t.hasOwnProperty("$"+e[n].value),e[n].selected!==s&&(e[n].selected=s),s&&r&&(e[n].defaultSelected=!0)}else{for(n=""+fp(n),t=null,s=0;s<e.length;s++){if(e[s].value===n){e[s].selected=!0,r&&(e[s].defaultSelected=!0);return}t!==null||e[s].disabled||(t=e[s])}t!==null&&(t.selected=!0)}}function Lz(e,t){if(t.dangerouslySetInnerHTML!=null)throw Error(Ve(91));return is({},t,{value:void 0,defaultValue:void 0,children:""+e._wrapperState.initialValue})}function yq(e,t){var n=t.value;if(n==null){if(n=t.children,t=t.defaultValue,n!=null){if(t!=null)throw Error(Ve(92));if(s1(n)){if(1<n.length)throw Error(Ve(93));n=n[0]}t=n}t==null&&(t=""),n=t}e._wrapperState={initialValue:fp(n)}}function KX(e,t){var n=fp(t.value),r=fp(t.defaultValue);n!=null&&(n=""+n,n!==e.value&&(e.value=n),t.defaultValue==null&&e.defaultValue!==n&&(e.defaultValue=n)),r!=null&&(e.defaultValue=""+r)}function bq(e){var t=e.textContent;t===e._wrapperState.initialValue&&t!==""&&t!==null&&(e.value=t)}function YX(e){switch(e){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 jz(e,t){return e==null||e==="http://www.w3.org/1999/xhtml"?YX(t):e==="http://www.w3.org/2000/svg"&&t==="foreignObject"?"http://www.w3.org/1999/xhtml":e}var MR,XX=function(e){return typeof MSApp<"u"&&MSApp.execUnsafeLocalFunction?function(t,n,r,s){MSApp.execUnsafeLocalFunction(function(){return e(t,n,r,s)})}:e}(function(e,t){if(e.namespaceURI!=="http://www.w3.org/2000/svg"||"innerHTML"in e)e.innerHTML=t;else{for(MR=MR||document.createElement("div"),MR.innerHTML="<svg>"+t.valueOf().toString()+"</svg>",t=MR.firstChild;e.firstChild;)e.removeChild(e.firstChild);for(;t.firstChild;)e.appendChild(t.firstChild)}});function eC(e,t){if(t){var n=e.firstChild;if(n&&n===e.lastChild&&n.nodeType===3){n.nodeValue=t;return}}e.textContent=t}var T1={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},Eme=["Webkit","ms","Moz","O"];Object.keys(T1).forEach(function(e){Eme.forEach(function(t){t=t+e.charAt(0).toUpperCase()+e.substring(1),T1[t]=T1[e]})});function QX(e,t,n){return t==null||typeof t=="boolean"||t===""?"":n||typeof t!="number"||t===0||T1.hasOwnProperty(e)&&T1[e]?(""+t).trim():t+"px"}function ZX(e,t){e=e.style;for(var n in t)if(t.hasOwnProperty(n)){var r=n.indexOf("--")===0,s=QX(n,t[n],r);n==="float"&&(n="cssFloat"),r?e.setProperty(n,s):e[n]=s}}var Ame=is({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 $z(e,t){if(t){if(Ame[e]&&(t.children!=null||t.dangerouslySetInnerHTML!=null))throw Error(Ve(137,e));if(t.dangerouslySetInnerHTML!=null){if(t.children!=null)throw Error(Ve(60));if(typeof t.dangerouslySetInnerHTML!="object"||!("__html"in t.dangerouslySetInnerHTML))throw Error(Ve(61))}if(t.style!=null&&typeof t.style!="object")throw Error(Ve(62))}}function Fz(e,t){if(e.indexOf("-")===-1)return typeof t.is=="string";switch(e){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 zz=null;function IV(e){return e=e.target||e.srcElement||window,e.correspondingUseElement&&(e=e.correspondingUseElement),e.nodeType===3?e.parentNode:e}var Bz=null,_b=null,wb=null;function xq(e){if(e=NA(e)){if(typeof Bz!="function")throw Error(Ve(280));var t=e.stateNode;t&&(t=Gk(t),Bz(e.stateNode,e.type,t))}}function JX(e){_b?wb?wb.push(e):wb=[e]:_b=e}function eQ(){if(_b){var e=_b,t=wb;if(wb=_b=null,xq(e),t)for(e=0;e<t.length;e++)xq(t[e])}}function tQ(e,t){return e(t)}function nQ(){}var g3=!1;function rQ(e,t,n){if(g3)return e(t,n);g3=!0;try{return tQ(e,t,n)}finally{g3=!1,(_b!==null||wb!==null)&&(nQ(),eQ())}}function tC(e,t){var n=e.stateNode;if(n===null)return null;var r=Gk(n);if(r===null)return null;n=r[t];e:switch(t){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)||(e=e.type,r=!(e==="button"||e==="input"||e==="select"||e==="textarea")),e=!r;break e;default:e=!1}if(e)return null;if(n&&typeof n!="function")throw Error(Ve(231,t,typeof n));return n}var Uz=!1;if(Df)try{var AS={};Object.defineProperty(AS,"passive",{get:function(){Uz=!0}}),window.addEventListener("test",AS,AS),window.removeEventListener("test",AS,AS)}catch{Uz=!1}function Rme(e,t,n,r,s,i,o,a,c){var d=Array.prototype.slice.call(arguments,3);try{t.apply(n,d)}catch(h){this.onError(h)}}var k1=!1,UN=null,VN=!1,Vz=null,Pme={onError:function(e){k1=!0,UN=e}};function Nme(e,t,n,r,s,i,o,a,c){k1=!1,UN=null,Rme.apply(Pme,arguments)}function Tme(e,t,n,r,s,i,o,a,c){if(Nme.apply(this,arguments),k1){if(k1){var d=UN;k1=!1,UN=null}else throw Error(Ve(198));VN||(VN=!0,Vz=d)}}function iy(e){var t=e,n=e;if(e.alternate)for(;t.return;)t=t.return;else{e=t;do t=e,t.flags&4098&&(n=t.return),e=t.return;while(e)}return t.tag===3?n:null}function sQ(e){if(e.tag===13){var t=e.memoizedState;if(t===null&&(e=e.alternate,e!==null&&(t=e.memoizedState)),t!==null)return t.dehydrated}return null}function _q(e){if(iy(e)!==e)throw Error(Ve(188))}function kme(e){var t=e.alternate;if(!t){if(t=iy(e),t===null)throw Error(Ve(188));return t!==e?null:e}for(var n=e,r=t;;){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 _q(s),e;if(i===r)return _q(s),t;i=i.sibling}throw Error(Ve(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(Ve(189))}}if(n.alternate!==r)throw Error(Ve(190))}if(n.tag!==3)throw Error(Ve(188));return n.stateNode.current===n?e:t}function iQ(e){return e=kme(e),e!==null?oQ(e):null}function oQ(e){if(e.tag===5||e.tag===6)return e;for(e=e.child;e!==null;){var t=oQ(e);if(t!==null)return t;e=e.sibling}return null}var aQ=Qa.unstable_scheduleCallback,wq=Qa.unstable_cancelCallback,Dme=Qa.unstable_shouldYield,Ome=Qa.unstable_requestPaint,_s=Qa.unstable_now,Mme=Qa.unstable_getCurrentPriorityLevel,LV=Qa.unstable_ImmediatePriority,lQ=Qa.unstable_UserBlockingPriority,HN=Qa.unstable_NormalPriority,Ime=Qa.unstable_LowPriority,cQ=Qa.unstable_IdlePriority,Vk=null,_u=null;function Lme(e){if(_u&&typeof _u.onCommitFiberRoot=="function")try{_u.onCommitFiberRoot(Vk,e,void 0,(e.current.flags&128)===128)}catch{}}var bc=Math.clz32?Math.clz32:Fme,jme=Math.log,$me=Math.LN2;function Fme(e){return e>>>=0,e===0?32:31-(jme(e)/$me|0)|0}var IR=64,LR=4194304;function i1(e){switch(e&-e){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 e&4194240;case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:return e&130023424;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 1073741824;default:return e}}function WN(e,t){var n=e.pendingLanes;if(n===0)return 0;var r=0,s=e.suspendedLanes,i=e.pingedLanes,o=n&268435455;if(o!==0){var a=o&~s;a!==0?r=i1(a):(i&=o,i!==0&&(r=i1(i)))}else o=n&~s,o!==0?r=i1(o):i!==0&&(r=i1(i));if(r===0)return 0;if(t!==0&&t!==r&&!(t&s)&&(s=r&-r,i=t&-t,s>=i||s===16&&(i&4194240)!==0))return t;if(r&4&&(r|=n&16),t=e.entangledLanes,t!==0)for(e=e.entanglements,t&=r;0<t;)n=31-bc(t),s=1<<n,r|=e[n],t&=~s;return r}function zme(e,t){switch(e){case 1:case 2:case 4:return t+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 t+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 Bme(e,t){for(var n=e.suspendedLanes,r=e.pingedLanes,s=e.expirationTimes,i=e.pendingLanes;0<i;){var o=31-bc(i),a=1<<o,c=s[o];c===-1?(!(a&n)||a&r)&&(s[o]=zme(a,t)):c<=t&&(e.expiredLanes|=a),i&=~a}}function Hz(e){return e=e.pendingLanes&-1073741825,e!==0?e:e&1073741824?1073741824:0}function uQ(){var e=IR;return IR<<=1,!(IR&4194240)&&(IR=64),e}function v3(e){for(var t=[],n=0;31>n;n++)t.push(e);return t}function RA(e,t,n){e.pendingLanes|=t,t!==536870912&&(e.suspendedLanes=0,e.pingedLanes=0),e=e.eventTimes,t=31-bc(t),e[t]=n}function Ume(e,t){var n=e.pendingLanes&~t;e.pendingLanes=t,e.suspendedLanes=0,e.pingedLanes=0,e.expiredLanes&=t,e.mutableReadLanes&=t,e.entangledLanes&=t,t=e.entanglements;var r=e.eventTimes;for(e=e.expirationTimes;0<n;){var s=31-bc(n),i=1<<s;t[s]=0,r[s]=-1,e[s]=-1,n&=~i}}function jV(e,t){var n=e.entangledLanes|=t;for(e=e.entanglements;n;){var r=31-bc(n),s=1<<r;s&t|e[r]&t&&(e[r]|=t),n&=~s}}var rr=0;function dQ(e){return e&=-e,1<e?4<e?e&268435455?16:536870912:4:1}var fQ,$V,hQ,pQ,mQ,Wz=!1,jR=[],ep=null,tp=null,np=null,nC=new Map,rC=new Map,ph=[],Vme="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 Sq(e,t){switch(e){case"focusin":case"focusout":ep=null;break;case"dragenter":case"dragleave":tp=null;break;case"mouseover":case"mouseout":np=null;break;case"pointerover":case"pointerout":nC.delete(t.pointerId);break;case"gotpointercapture":case"lostpointercapture":rC.delete(t.pointerId)}}function RS(e,t,n,r,s,i){return e===null||e.nativeEvent!==i?(e={blockedOn:t,domEventName:n,eventSystemFlags:r,nativeEvent:i,targetContainers:[s]},t!==null&&(t=NA(t),t!==null&&$V(t)),e):(e.eventSystemFlags|=r,t=e.targetContainers,s!==null&&t.indexOf(s)===-1&&t.push(s),e)}function Hme(e,t,n,r,s){switch(t){case"focusin":return ep=RS(ep,e,t,n,r,s),!0;case"dragenter":return tp=RS(tp,e,t,n,r,s),!0;case"mouseover":return np=RS(np,e,t,n,r,s),!0;case"pointerover":var i=s.pointerId;return nC.set(i,RS(nC.get(i)||null,e,t,n,r,s)),!0;case"gotpointercapture":return i=s.pointerId,rC.set(i,RS(rC.get(i)||null,e,t,n,r,s)),!0}return!1}function gQ(e){var t=cg(e.target);if(t!==null){var n=iy(t);if(n!==null){if(t=n.tag,t===13){if(t=sQ(n),t!==null){e.blockedOn=t,mQ(e.priority,function(){hQ(n)});return}}else if(t===3&&n.stateNode.current.memoizedState.isDehydrated){e.blockedOn=n.tag===3?n.stateNode.containerInfo:null;return}}}e.blockedOn=null}function FP(e){if(e.blockedOn!==null)return!1;for(var t=e.targetContainers;0<t.length;){var n=qz(e.domEventName,e.eventSystemFlags,t[0],e.nativeEvent);if(n===null){n=e.nativeEvent;var r=new n.constructor(n.type,n);zz=r,n.target.dispatchEvent(r),zz=null}else return t=NA(n),t!==null&&$V(t),e.blockedOn=n,!1;t.shift()}return!0}function Cq(e,t,n){FP(e)&&n.delete(t)}function Wme(){Wz=!1,ep!==null&&FP(ep)&&(ep=null),tp!==null&&FP(tp)&&(tp=null),np!==null&&FP(np)&&(np=null),nC.forEach(Cq),rC.forEach(Cq)}function PS(e,t){e.blockedOn===t&&(e.blockedOn=null,Wz||(Wz=!0,Qa.unstable_scheduleCallback(Qa.unstable_NormalPriority,Wme)))}function sC(e){function t(s){return PS(s,e)}if(0<jR.length){PS(jR[0],e);for(var n=1;n<jR.length;n++){var r=jR[n];r.blockedOn===e&&(r.blockedOn=null)}}for(ep!==null&&PS(ep,e),tp!==null&&PS(tp,e),np!==null&&PS(np,e),nC.forEach(t),rC.forEach(t),n=0;n<ph.length;n++)r=ph[n],r.blockedOn===e&&(r.blockedOn=null);for(;0<ph.length&&(n=ph[0],n.blockedOn===null);)gQ(n),n.blockedOn===null&&ph.shift()}var Sb=Bf.ReactCurrentBatchConfig,qN=!0;function qme(e,t,n,r){var s=rr,i=Sb.transition;Sb.transition=null;try{rr=1,FV(e,t,n,r)}finally{rr=s,Sb.transition=i}}function Gme(e,t,n,r){var s=rr,i=Sb.transition;Sb.transition=null;try{rr=4,FV(e,t,n,r)}finally{rr=s,Sb.transition=i}}function FV(e,t,n,r){if(qN){var s=qz(e,t,n,r);if(s===null)R3(e,t,r,GN,n),Sq(e,r);else if(Hme(s,e,t,n,r))r.stopPropagation();else if(Sq(e,r),t&4&&-1<Vme.indexOf(e)){for(;s!==null;){var i=NA(s);if(i!==null&&fQ(i),i=qz(e,t,n,r),i===null&&R3(e,t,r,GN,n),i===s)break;s=i}s!==null&&r.stopPropagation()}else R3(e,t,r,null,n)}}var GN=null;function qz(e,t,n,r){if(GN=null,e=IV(r),e=cg(e),e!==null)if(t=iy(e),t===null)e=null;else if(n=t.tag,n===13){if(e=sQ(t),e!==null)return e;e=null}else if(n===3){if(t.stateNode.current.memoizedState.isDehydrated)return t.tag===3?t.stateNode.containerInfo:null;e=null}else t!==e&&(e=null);return GN=e,null}function vQ(e){switch(e){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(Mme()){case LV:return 1;case lQ:return 4;case HN:case Ime:return 16;case cQ:return 536870912;default:return 16}default:return 16}}var Xh=null,zV=null,zP=null;function yQ(){if(zP)return zP;var e,t=zV,n=t.length,r,s="value"in Xh?Xh.value:Xh.textContent,i=s.length;for(e=0;e<n&&t[e]===s[e];e++);var o=n-e;for(r=1;r<=o&&t[n-r]===s[i-r];r++);return zP=s.slice(e,1<r?1-r:void 0)}function BP(e){var t=e.keyCode;return"charCode"in e?(e=e.charCode,e===0&&t===13&&(e=13)):e=t,e===10&&(e=13),32<=e||e===13?e:0}function $R(){return!0}function Eq(){return!1}function tl(e){function t(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 e)e.hasOwnProperty(a)&&(n=e[a],this[a]=n?n(i):i[a]);return this.isDefaultPrevented=(i.defaultPrevented!=null?i.defaultPrevented:i.returnValue===!1)?$R:Eq,this.isPropagationStopped=Eq,this}return is(t.prototype,{preventDefault:function(){this.defaultPrevented=!0;var n=this.nativeEvent;n&&(n.preventDefault?n.preventDefault():typeof n.returnValue!="unknown"&&(n.returnValue=!1),this.isDefaultPrevented=$R)},stopPropagation:function(){var n=this.nativeEvent;n&&(n.stopPropagation?n.stopPropagation():typeof n.cancelBubble!="unknown"&&(n.cancelBubble=!0),this.isPropagationStopped=$R)},persist:function(){},isPersistent:$R}),t}var Ax={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(e){return e.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},BV=tl(Ax),PA=is({},Ax,{view:0,detail:0}),Kme=tl(PA),y3,b3,NS,Hk=is({},PA,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:UV,button:0,buttons:0,relatedTarget:function(e){return e.relatedTarget===void 0?e.fromElement===e.srcElement?e.toElement:e.fromElement:e.relatedTarget},movementX:function(e){return"movementX"in e?e.movementX:(e!==NS&&(NS&&e.type==="mousemove"?(y3=e.screenX-NS.screenX,b3=e.screenY-NS.screenY):b3=y3=0,NS=e),y3)},movementY:function(e){return"movementY"in e?e.movementY:b3}}),Aq=tl(Hk),Yme=is({},Hk,{dataTransfer:0}),Xme=tl(Yme),Qme=is({},PA,{relatedTarget:0}),x3=tl(Qme),Zme=is({},Ax,{animationName:0,elapsedTime:0,pseudoElement:0}),Jme=tl(Zme),ege=is({},Ax,{clipboardData:function(e){return"clipboardData"in e?e.clipboardData:window.clipboardData}}),tge=tl(ege),nge=is({},Ax,{data:0}),Rq=tl(nge),rge={Esc:"Escape",Spacebar:" ",Left:"ArrowLeft",Up:"ArrowUp",Right:"ArrowRight",Down:"ArrowDown",Del:"Delete",Win:"OS",Menu:"ContextMenu",Apps:"ContextMenu",Scroll:"ScrollLock",MozPrintableKey:"Unidentified"},sge={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"},ige={Alt:"altKey",Control:"ctrlKey",Meta:"metaKey",Shift:"shiftKey"};function oge(e){var t=this.nativeEvent;return t.getModifierState?t.getModifierState(e):(e=ige[e])?!!t[e]:!1}function UV(){return oge}var age=is({},PA,{key:function(e){if(e.key){var t=rge[e.key]||e.key;if(t!=="Unidentified")return t}return e.type==="keypress"?(e=BP(e),e===13?"Enter":String.fromCharCode(e)):e.type==="keydown"||e.type==="keyup"?sge[e.keyCode]||"Unidentified":""},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:UV,charCode:function(e){return e.type==="keypress"?BP(e):0},keyCode:function(e){return e.type==="keydown"||e.type==="keyup"?e.keyCode:0},which:function(e){return e.type==="keypress"?BP(e):e.type==="keydown"||e.type==="keyup"?e.keyCode:0}}),lge=tl(age),cge=is({},Hk,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0}),Pq=tl(cge),uge=is({},PA,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:UV}),dge=tl(uge),fge=is({},Ax,{propertyName:0,elapsedTime:0,pseudoElement:0}),hge=tl(fge),pge=is({},Hk,{deltaX:function(e){return"deltaX"in e?e.deltaX:"wheelDeltaX"in e?-e.wheelDeltaX:0},deltaY:function(e){return"deltaY"in e?e.deltaY:"wheelDeltaY"in e?-e.wheelDeltaY:"wheelDelta"in e?-e.wheelDelta:0},deltaZ:0,deltaMode:0}),mge=tl(pge),gge=[9,13,27,32],VV=Df&&"CompositionEvent"in window,D1=null;Df&&"documentMode"in document&&(D1=document.documentMode);var vge=Df&&"TextEvent"in window&&!D1,bQ=Df&&(!VV||D1&&8<D1&&11>=D1),Nq=" ",Tq=!1;function xQ(e,t){switch(e){case"keyup":return gge.indexOf(t.keyCode)!==-1;case"keydown":return t.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function _Q(e){return e=e.detail,typeof e=="object"&&"data"in e?e.data:null}var ob=!1;function yge(e,t){switch(e){case"compositionend":return _Q(t);case"keypress":return t.which!==32?null:(Tq=!0,Nq);case"textInput":return e=t.data,e===Nq&&Tq?null:e;default:return null}}function bge(e,t){if(ob)return e==="compositionend"||!VV&&xQ(e,t)?(e=yQ(),zP=zV=Xh=null,ob=!1,e):null;switch(e){case"paste":return null;case"keypress":if(!(t.ctrlKey||t.altKey||t.metaKey)||t.ctrlKey&&t.altKey){if(t.char&&1<t.char.length)return t.char;if(t.which)return String.fromCharCode(t.which)}return null;case"compositionend":return bQ&&t.locale!=="ko"?null:t.data;default:return null}}var xge={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 kq(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return t==="input"?!!xge[e.type]:t==="textarea"}function wQ(e,t,n,r){JX(r),t=KN(t,"onChange"),0<t.length&&(n=new BV("onChange","change",null,n,r),e.push({event:n,listeners:t}))}var O1=null,iC=null;function _ge(e){OQ(e,0)}function Wk(e){var t=cb(e);if(qX(t))return e}function wge(e,t){if(e==="change")return t}var SQ=!1;if(Df){var _3;if(Df){var w3="oninput"in document;if(!w3){var Dq=document.createElement("div");Dq.setAttribute("oninput","return;"),w3=typeof Dq.oninput=="function"}_3=w3}else _3=!1;SQ=_3&&(!document.documentMode||9<document.documentMode)}function Oq(){O1&&(O1.detachEvent("onpropertychange",CQ),iC=O1=null)}function CQ(e){if(e.propertyName==="value"&&Wk(iC)){var t=[];wQ(t,iC,e,IV(e)),rQ(_ge,t)}}function Sge(e,t,n){e==="focusin"?(Oq(),O1=t,iC=n,O1.attachEvent("onpropertychange",CQ)):e==="focusout"&&Oq()}function Cge(e){if(e==="selectionchange"||e==="keyup"||e==="keydown")return Wk(iC)}function Ege(e,t){if(e==="click")return Wk(t)}function Age(e,t){if(e==="input"||e==="change")return Wk(t)}function Rge(e,t){return e===t&&(e!==0||1/e===1/t)||e!==e&&t!==t}var Sc=typeof Object.is=="function"?Object.is:Rge;function oC(e,t){if(Sc(e,t))return!0;if(typeof e!="object"||e===null||typeof t!="object"||t===null)return!1;var n=Object.keys(e),r=Object.keys(t);if(n.length!==r.length)return!1;for(r=0;r<n.length;r++){var s=n[r];if(!Pz.call(t,s)||!Sc(e[s],t[s]))return!1}return!0}function Mq(e){for(;e&&e.firstChild;)e=e.firstChild;return e}function Iq(e,t){var n=Mq(e);e=0;for(var r;n;){if(n.nodeType===3){if(r=e+n.textContent.length,e<=t&&r>=t)return{node:n,offset:t-e};e=r}e:{for(;n;){if(n.nextSibling){n=n.nextSibling;break e}n=n.parentNode}n=void 0}n=Mq(n)}}function EQ(e,t){return e&&t?e===t?!0:e&&e.nodeType===3?!1:t&&t.nodeType===3?EQ(e,t.parentNode):"contains"in e?e.contains(t):e.compareDocumentPosition?!!(e.compareDocumentPosition(t)&16):!1:!1}function AQ(){for(var e=window,t=BN();t instanceof e.HTMLIFrameElement;){try{var n=typeof t.contentWindow.location.href=="string"}catch{n=!1}if(n)e=t.contentWindow;else break;t=BN(e.document)}return t}function HV(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return t&&(t==="input"&&(e.type==="text"||e.type==="search"||e.type==="tel"||e.type==="url"||e.type==="password")||t==="textarea"||e.contentEditable==="true")}function Pge(e){var t=AQ(),n=e.focusedElem,r=e.selectionRange;if(t!==n&&n&&n.ownerDocument&&EQ(n.ownerDocument.documentElement,n)){if(r!==null&&HV(n)){if(t=r.start,e=r.end,e===void 0&&(e=t),"selectionStart"in n)n.selectionStart=t,n.selectionEnd=Math.min(e,n.value.length);else if(e=(t=n.ownerDocument||document)&&t.defaultView||window,e.getSelection){e=e.getSelection();var s=n.textContent.length,i=Math.min(r.start,s);r=r.end===void 0?i:Math.min(r.end,s),!e.extend&&i>r&&(s=r,r=i,i=s),s=Iq(n,i);var o=Iq(n,r);s&&o&&(e.rangeCount!==1||e.anchorNode!==s.node||e.anchorOffset!==s.offset||e.focusNode!==o.node||e.focusOffset!==o.offset)&&(t=t.createRange(),t.setStart(s.node,s.offset),e.removeAllRanges(),i>r?(e.addRange(t),e.extend(o.node,o.offset)):(t.setEnd(o.node,o.offset),e.addRange(t)))}}for(t=[],e=n;e=e.parentNode;)e.nodeType===1&&t.push({element:e,left:e.scrollLeft,top:e.scrollTop});for(typeof n.focus=="function"&&n.focus(),n=0;n<t.length;n++)e=t[n],e.element.scrollLeft=e.left,e.element.scrollTop=e.top}}var Nge=Df&&"documentMode"in document&&11>=document.documentMode,ab=null,Gz=null,M1=null,Kz=!1;function Lq(e,t,n){var r=n.window===n?n.document:n.nodeType===9?n:n.ownerDocument;Kz||ab==null||ab!==BN(r)||(r=ab,"selectionStart"in r&&HV(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}),M1&&oC(M1,r)||(M1=r,r=KN(Gz,"onSelect"),0<r.length&&(t=new BV("onSelect","select",null,t,n),e.push({event:t,listeners:r}),t.target=ab)))}function FR(e,t){var n={};return n[e.toLowerCase()]=t.toLowerCase(),n["Webkit"+e]="webkit"+t,n["Moz"+e]="moz"+t,n}var lb={animationend:FR("Animation","AnimationEnd"),animationiteration:FR("Animation","AnimationIteration"),animationstart:FR("Animation","AnimationStart"),transitionend:FR("Transition","TransitionEnd")},S3={},RQ={};Df&&(RQ=document.createElement("div").style,"AnimationEvent"in window||(delete lb.animationend.animation,delete lb.animationiteration.animation,delete lb.animationstart.animation),"TransitionEvent"in window||delete lb.transitionend.transition);function qk(e){if(S3[e])return S3[e];if(!lb[e])return e;var t=lb[e],n;for(n in t)if(t.hasOwnProperty(n)&&n in RQ)return S3[e]=t[n];return e}var PQ=qk("animationend"),NQ=qk("animationiteration"),TQ=qk("animationstart"),kQ=qk("transitionend"),DQ=new Map,jq="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 Ep(e,t){DQ.set(e,t),sy(t,[e])}for(var C3=0;C3<jq.length;C3++){var E3=jq[C3],Tge=E3.toLowerCase(),kge=E3[0].toUpperCase()+E3.slice(1);Ep(Tge,"on"+kge)}Ep(PQ,"onAnimationEnd");Ep(NQ,"onAnimationIteration");Ep(TQ,"onAnimationStart");Ep("dblclick","onDoubleClick");Ep("focusin","onFocus");Ep("focusout","onBlur");Ep(kQ,"onTransitionEnd");Q0("onMouseEnter",["mouseout","mouseover"]);Q0("onMouseLeave",["mouseout","mouseover"]);Q0("onPointerEnter",["pointerout","pointerover"]);Q0("onPointerLeave",["pointerout","pointerover"]);sy("onChange","change click focusin focusout input keydown keyup selectionchange".split(" "));sy("onSelect","focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange".split(" "));sy("onBeforeInput",["compositionend","keypress","textInput","paste"]);sy("onCompositionEnd","compositionend focusout keydown keypress keyup mousedown".split(" "));sy("onCompositionStart","compositionstart focusout keydown keypress keyup mousedown".split(" "));sy("onCompositionUpdate","compositionupdate focusout keydown keypress keyup mousedown".split(" "));var o1="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(" "),Dge=new Set("cancel close invalid load scroll toggle".split(" ").concat(o1));function $q(e,t,n){var r=e.type||"unknown-event";e.currentTarget=n,Tme(r,t,void 0,e),e.currentTarget=null}function OQ(e,t){t=(t&4)!==0;for(var n=0;n<e.length;n++){var r=e[n],s=r.event;r=r.listeners;e:{var i=void 0;if(t)for(var o=r.length-1;0<=o;o--){var a=r[o],c=a.instance,d=a.currentTarget;if(a=a.listener,c!==i&&s.isPropagationStopped())break e;$q(s,a,d),i=c}else for(o=0;o<r.length;o++){if(a=r[o],c=a.instance,d=a.currentTarget,a=a.listener,c!==i&&s.isPropagationStopped())break e;$q(s,a,d),i=c}}}if(VN)throw e=Vz,VN=!1,Vz=null,e}function Fr(e,t){var n=t[Jz];n===void 0&&(n=t[Jz]=new Set);var r=e+"__bubble";n.has(r)||(MQ(t,e,2,!1),n.add(r))}function A3(e,t,n){var r=0;t&&(r|=4),MQ(n,e,r,t)}var zR="_reactListening"+Math.random().toString(36).slice(2);function aC(e){if(!e[zR]){e[zR]=!0,BX.forEach(function(n){n!=="selectionchange"&&(Dge.has(n)||A3(n,!1,e),A3(n,!0,e))});var t=e.nodeType===9?e:e.ownerDocument;t===null||t[zR]||(t[zR]=!0,A3("selectionchange",!1,t))}}function MQ(e,t,n,r){switch(vQ(t)){case 1:var s=qme;break;case 4:s=Gme;break;default:s=FV}n=s.bind(null,t,n,e),s=void 0,!Uz||t!=="touchstart"&&t!=="touchmove"&&t!=="wheel"||(s=!0),r?s!==void 0?e.addEventListener(t,n,{capture:!0,passive:s}):e.addEventListener(t,n,!0):s!==void 0?e.addEventListener(t,n,{passive:s}):e.addEventListener(t,n,!1)}function R3(e,t,n,r,s){var i=r;if(!(t&1)&&!(t&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=cg(a),o===null)return;if(c=o.tag,c===5||c===6){r=i=o;continue e}a=a.parentNode}}r=r.return}rQ(function(){var d=i,h=IV(n),u=[];e:{var f=DQ.get(e);if(f!==void 0){var g=BV,v=e;switch(e){case"keypress":if(BP(n)===0)break e;case"keydown":case"keyup":g=lge;break;case"focusin":v="focus",g=x3;break;case"focusout":v="blur",g=x3;break;case"beforeblur":case"afterblur":g=x3;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":g=Aq;break;case"drag":case"dragend":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"dragstart":case"drop":g=Xme;break;case"touchcancel":case"touchend":case"touchmove":case"touchstart":g=dge;break;case PQ:case NQ:case TQ:g=Jme;break;case kQ:g=hge;break;case"scroll":g=Kme;break;case"wheel":g=mge;break;case"copy":case"cut":case"paste":g=tge;break;case"gotpointercapture":case"lostpointercapture":case"pointercancel":case"pointerdown":case"pointermove":case"pointerout":case"pointerover":case"pointerup":g=Pq}var m=(t&4)!==0,x=!m&&e==="scroll",y=m?f!==null?f+"Capture":null:f;m=[];for(var b=d,w;b!==null;){w=b;var E=w.stateNode;if(w.tag===5&&E!==null&&(w=E,y!==null&&(E=tC(b,y),E!=null&&m.push(lC(b,E,w)))),x)break;b=b.return}0<m.length&&(f=new g(f,v,null,n,h),u.push({event:f,listeners:m}))}}if(!(t&7)){e:{if(f=e==="mouseover"||e==="pointerover",g=e==="mouseout"||e==="pointerout",f&&n!==zz&&(v=n.relatedTarget||n.fromElement)&&(cg(v)||v[Of]))break e;if((g||f)&&(f=h.window===h?h:(f=h.ownerDocument)?f.defaultView||f.parentWindow:window,g?(v=n.relatedTarget||n.toElement,g=d,v=v?cg(v):null,v!==null&&(x=iy(v),v!==x||v.tag!==5&&v.tag!==6)&&(v=null)):(g=null,v=d),g!==v)){if(m=Aq,E="onMouseLeave",y="onMouseEnter",b="mouse",(e==="pointerout"||e==="pointerover")&&(m=Pq,E="onPointerLeave",y="onPointerEnter",b="pointer"),x=g==null?f:cb(g),w=v==null?f:cb(v),f=new m(E,b+"leave",g,n,h),f.target=x,f.relatedTarget=w,E=null,cg(h)===d&&(m=new m(y,b+"enter",v,n,h),m.target=w,m.relatedTarget=x,E=m),x=E,g&&v)t:{for(m=g,y=v,b=0,w=m;w;w=Py(w))b++;for(w=0,E=y;E;E=Py(E))w++;for(;0<b-w;)m=Py(m),b--;for(;0<w-b;)y=Py(y),w--;for(;b--;){if(m===y||y!==null&&m===y.alternate)break t;m=Py(m),y=Py(y)}m=null}else m=null;g!==null&&Fq(u,f,g,m,!1),v!==null&&x!==null&&Fq(u,x,v,m,!0)}}e:{if(f=d?cb(d):window,g=f.nodeName&&f.nodeName.toLowerCase(),g==="select"||g==="input"&&f.type==="file")var R=wge;else if(kq(f))if(SQ)R=Age;else{R=Cge;var T=Sge}else(g=f.nodeName)&&g.toLowerCase()==="input"&&(f.type==="checkbox"||f.type==="radio")&&(R=Ege);if(R&&(R=R(e,d))){wQ(u,R,n,h);break e}T&&T(e,f,d),e==="focusout"&&(T=f._wrapperState)&&T.controlled&&f.type==="number"&&Iz(f,"number",f.value)}switch(T=d?cb(d):window,e){case"focusin":(kq(T)||T.contentEditable==="true")&&(ab=T,Gz=d,M1=null);break;case"focusout":M1=Gz=ab=null;break;case"mousedown":Kz=!0;break;case"contextmenu":case"mouseup":case"dragend":Kz=!1,Lq(u,n,h);break;case"selectionchange":if(Nge)break;case"keydown":case"keyup":Lq(u,n,h)}var N;if(VV)e:{switch(e){case"compositionstart":var A="onCompositionStart";break e;case"compositionend":A="onCompositionEnd";break e;case"compositionupdate":A="onCompositionUpdate";break e}A=void 0}else ob?xQ(e,n)&&(A="onCompositionEnd"):e==="keydown"&&n.keyCode===229&&(A="onCompositionStart");A&&(bQ&&n.locale!=="ko"&&(ob||A!=="onCompositionStart"?A==="onCompositionEnd"&&ob&&(N=yQ()):(Xh=h,zV="value"in Xh?Xh.value:Xh.textContent,ob=!0)),T=KN(d,A),0<T.length&&(A=new Rq(A,e,null,n,h),u.push({event:A,listeners:T}),N?A.data=N:(N=_Q(n),N!==null&&(A.data=N)))),(N=vge?yge(e,n):bge(e,n))&&(d=KN(d,"onBeforeInput"),0<d.length&&(h=new Rq("onBeforeInput","beforeinput",null,n,h),u.push({event:h,listeners:d}),h.data=N))}OQ(u,t)})}function lC(e,t,n){return{instance:e,listener:t,currentTarget:n}}function KN(e,t){for(var n=t+"Capture",r=[];e!==null;){var s=e,i=s.stateNode;s.tag===5&&i!==null&&(s=i,i=tC(e,n),i!=null&&r.unshift(lC(e,i,s)),i=tC(e,t),i!=null&&r.push(lC(e,i,s))),e=e.return}return r}function Py(e){if(e===null)return null;do e=e.return;while(e&&e.tag!==5);return e||null}function Fq(e,t,n,r,s){for(var i=t._reactName,o=[];n!==null&&n!==r;){var a=n,c=a.alternate,d=a.stateNode;if(c!==null&&c===r)break;a.tag===5&&d!==null&&(a=d,s?(c=tC(n,i),c!=null&&o.unshift(lC(n,c,a))):s||(c=tC(n,i),c!=null&&o.push(lC(n,c,a)))),n=n.return}o.length!==0&&e.push({event:t,listeners:o})}var Oge=/\r\n?/g,Mge=/\u0000|\uFFFD/g;function zq(e){return(typeof e=="string"?e:""+e).replace(Oge,`
|
||
`).replace(Mge,"")}function BR(e,t,n){if(t=zq(t),zq(e)!==t&&n)throw Error(Ve(425))}function YN(){}var Yz=null,Xz=null;function Qz(e,t){return e==="textarea"||e==="noscript"||typeof t.children=="string"||typeof t.children=="number"||typeof t.dangerouslySetInnerHTML=="object"&&t.dangerouslySetInnerHTML!==null&&t.dangerouslySetInnerHTML.__html!=null}var Zz=typeof setTimeout=="function"?setTimeout:void 0,Ige=typeof clearTimeout=="function"?clearTimeout:void 0,Bq=typeof Promise=="function"?Promise:void 0,Lge=typeof queueMicrotask=="function"?queueMicrotask:typeof Bq<"u"?function(e){return Bq.resolve(null).then(e).catch(jge)}:Zz;function jge(e){setTimeout(function(){throw e})}function P3(e,t){var n=t,r=0;do{var s=n.nextSibling;if(e.removeChild(n),s&&s.nodeType===8)if(n=s.data,n==="/$"){if(r===0){e.removeChild(s),sC(t);return}r--}else n!=="$"&&n!=="$?"&&n!=="$!"||r++;n=s}while(n);sC(t)}function rp(e){for(;e!=null;e=e.nextSibling){var t=e.nodeType;if(t===1||t===3)break;if(t===8){if(t=e.data,t==="$"||t==="$!"||t==="$?")break;if(t==="/$")return null}}return e}function Uq(e){e=e.previousSibling;for(var t=0;e;){if(e.nodeType===8){var n=e.data;if(n==="$"||n==="$!"||n==="$?"){if(t===0)return e;t--}else n==="/$"&&t++}e=e.previousSibling}return null}var Rx=Math.random().toString(36).slice(2),hu="__reactFiber$"+Rx,cC="__reactProps$"+Rx,Of="__reactContainer$"+Rx,Jz="__reactEvents$"+Rx,$ge="__reactListeners$"+Rx,Fge="__reactHandles$"+Rx;function cg(e){var t=e[hu];if(t)return t;for(var n=e.parentNode;n;){if(t=n[Of]||n[hu]){if(n=t.alternate,t.child!==null||n!==null&&n.child!==null)for(e=Uq(e);e!==null;){if(n=e[hu])return n;e=Uq(e)}return t}e=n,n=e.parentNode}return null}function NA(e){return e=e[hu]||e[Of],!e||e.tag!==5&&e.tag!==6&&e.tag!==13&&e.tag!==3?null:e}function cb(e){if(e.tag===5||e.tag===6)return e.stateNode;throw Error(Ve(33))}function Gk(e){return e[cC]||null}var eB=[],ub=-1;function Ap(e){return{current:e}}function Ur(e){0>ub||(e.current=eB[ub],eB[ub]=null,ub--)}function Ar(e,t){ub++,eB[ub]=e.current,e.current=t}var hp={},so=Ap(hp),ta=Ap(!1),kv=hp;function Z0(e,t){var n=e.type.contextTypes;if(!n)return hp;var r=e.stateNode;if(r&&r.__reactInternalMemoizedUnmaskedChildContext===t)return r.__reactInternalMemoizedMaskedChildContext;var s={},i;for(i in n)s[i]=t[i];return r&&(e=e.stateNode,e.__reactInternalMemoizedUnmaskedChildContext=t,e.__reactInternalMemoizedMaskedChildContext=s),s}function na(e){return e=e.childContextTypes,e!=null}function XN(){Ur(ta),Ur(so)}function Vq(e,t,n){if(so.current!==hp)throw Error(Ve(168));Ar(so,t),Ar(ta,n)}function IQ(e,t,n){var r=e.stateNode;if(t=t.childContextTypes,typeof r.getChildContext!="function")return n;r=r.getChildContext();for(var s in r)if(!(s in t))throw Error(Ve(108,Sme(e)||"Unknown",s));return is({},n,r)}function QN(e){return e=(e=e.stateNode)&&e.__reactInternalMemoizedMergedChildContext||hp,kv=so.current,Ar(so,e),Ar(ta,ta.current),!0}function Hq(e,t,n){var r=e.stateNode;if(!r)throw Error(Ve(169));n?(e=IQ(e,t,kv),r.__reactInternalMemoizedMergedChildContext=e,Ur(ta),Ur(so),Ar(so,e)):Ur(ta),Ar(ta,n)}var Vd=null,Kk=!1,N3=!1;function LQ(e){Vd===null?Vd=[e]:Vd.push(e)}function zge(e){Kk=!0,LQ(e)}function Rp(){if(!N3&&Vd!==null){N3=!0;var e=0,t=rr;try{var n=Vd;for(rr=1;e<n.length;e++){var r=n[e];do r=r(!0);while(r!==null)}Vd=null,Kk=!1}catch(s){throw Vd!==null&&(Vd=Vd.slice(e+1)),aQ(LV,Rp),s}finally{rr=t,N3=!1}}return null}var db=[],fb=0,ZN=null,JN=0,pl=[],ml=0,Dv=null,xf=1,_f="";function Jm(e,t){db[fb++]=JN,db[fb++]=ZN,ZN=e,JN=t}function jQ(e,t,n){pl[ml++]=xf,pl[ml++]=_f,pl[ml++]=Dv,Dv=e;var r=xf;e=_f;var s=32-bc(r)-1;r&=~(1<<s),n+=1;var i=32-bc(t)+s;if(30<i){var o=s-s%5;i=(r&(1<<o)-1).toString(32),r>>=o,s-=o,xf=1<<32-bc(t)+s|n<<s|r,_f=i+e}else xf=1<<i|n<<s|r,_f=e}function WV(e){e.return!==null&&(Jm(e,1),jQ(e,1,0))}function qV(e){for(;e===ZN;)ZN=db[--fb],db[fb]=null,JN=db[--fb],db[fb]=null;for(;e===Dv;)Dv=pl[--ml],pl[ml]=null,_f=pl[--ml],pl[ml]=null,xf=pl[--ml],pl[ml]=null}var Ga=null,qa=null,Gr=!1,hc=null;function $Q(e,t){var n=bl(5,null,null,0);n.elementType="DELETED",n.stateNode=t,n.return=e,t=e.deletions,t===null?(e.deletions=[n],e.flags|=16):t.push(n)}function Wq(e,t){switch(e.tag){case 5:var n=e.type;return t=t.nodeType!==1||n.toLowerCase()!==t.nodeName.toLowerCase()?null:t,t!==null?(e.stateNode=t,Ga=e,qa=rp(t.firstChild),!0):!1;case 6:return t=e.pendingProps===""||t.nodeType!==3?null:t,t!==null?(e.stateNode=t,Ga=e,qa=null,!0):!1;case 13:return t=t.nodeType!==8?null:t,t!==null?(n=Dv!==null?{id:xf,overflow:_f}:null,e.memoizedState={dehydrated:t,treeContext:n,retryLane:1073741824},n=bl(18,null,null,0),n.stateNode=t,n.return=e,e.child=n,Ga=e,qa=null,!0):!1;default:return!1}}function tB(e){return(e.mode&1)!==0&&(e.flags&128)===0}function nB(e){if(Gr){var t=qa;if(t){var n=t;if(!Wq(e,t)){if(tB(e))throw Error(Ve(418));t=rp(n.nextSibling);var r=Ga;t&&Wq(e,t)?$Q(r,n):(e.flags=e.flags&-4097|2,Gr=!1,Ga=e)}}else{if(tB(e))throw Error(Ve(418));e.flags=e.flags&-4097|2,Gr=!1,Ga=e}}}function qq(e){for(e=e.return;e!==null&&e.tag!==5&&e.tag!==3&&e.tag!==13;)e=e.return;Ga=e}function UR(e){if(e!==Ga)return!1;if(!Gr)return qq(e),Gr=!0,!1;var t;if((t=e.tag!==3)&&!(t=e.tag!==5)&&(t=e.type,t=t!=="head"&&t!=="body"&&!Qz(e.type,e.memoizedProps)),t&&(t=qa)){if(tB(e))throw FQ(),Error(Ve(418));for(;t;)$Q(e,t),t=rp(t.nextSibling)}if(qq(e),e.tag===13){if(e=e.memoizedState,e=e!==null?e.dehydrated:null,!e)throw Error(Ve(317));e:{for(e=e.nextSibling,t=0;e;){if(e.nodeType===8){var n=e.data;if(n==="/$"){if(t===0){qa=rp(e.nextSibling);break e}t--}else n!=="$"&&n!=="$!"&&n!=="$?"||t++}e=e.nextSibling}qa=null}}else qa=Ga?rp(e.stateNode.nextSibling):null;return!0}function FQ(){for(var e=qa;e;)e=rp(e.nextSibling)}function J0(){qa=Ga=null,Gr=!1}function GV(e){hc===null?hc=[e]:hc.push(e)}var Bge=Bf.ReactCurrentBatchConfig;function TS(e,t,n){if(e=n.ref,e!==null&&typeof e!="function"&&typeof e!="object"){if(n._owner){if(n=n._owner,n){if(n.tag!==1)throw Error(Ve(309));var r=n.stateNode}if(!r)throw Error(Ve(147,e));var s=r,i=""+e;return t!==null&&t.ref!==null&&typeof t.ref=="function"&&t.ref._stringRef===i?t.ref:(t=function(o){var a=s.refs;o===null?delete a[i]:a[i]=o},t._stringRef=i,t)}if(typeof e!="string")throw Error(Ve(284));if(!n._owner)throw Error(Ve(290,e))}return e}function VR(e,t){throw e=Object.prototype.toString.call(t),Error(Ve(31,e==="[object Object]"?"object with keys {"+Object.keys(t).join(", ")+"}":e))}function Gq(e){var t=e._init;return t(e._payload)}function zQ(e){function t(y,b){if(e){var w=y.deletions;w===null?(y.deletions=[b],y.flags|=16):w.push(b)}}function n(y,b){if(!e)return null;for(;b!==null;)t(y,b),b=b.sibling;return null}function r(y,b){for(y=new Map;b!==null;)b.key!==null?y.set(b.key,b):y.set(b.index,b),b=b.sibling;return y}function s(y,b){return y=ap(y,b),y.index=0,y.sibling=null,y}function i(y,b,w){return y.index=w,e?(w=y.alternate,w!==null?(w=w.index,w<b?(y.flags|=2,b):w):(y.flags|=2,b)):(y.flags|=1048576,b)}function o(y){return e&&y.alternate===null&&(y.flags|=2),y}function a(y,b,w,E){return b===null||b.tag!==6?(b=L3(w,y.mode,E),b.return=y,b):(b=s(b,w),b.return=y,b)}function c(y,b,w,E){var R=w.type;return R===ib?h(y,b,w.props.children,E,w.key):b!==null&&(b.elementType===R||typeof R=="object"&&R!==null&&R.$$typeof===lh&&Gq(R)===b.type)?(E=s(b,w.props),E.ref=TS(y,b,w),E.return=y,E):(E=KP(w.type,w.key,w.props,null,y.mode,E),E.ref=TS(y,b,w),E.return=y,E)}function d(y,b,w,E){return b===null||b.tag!==4||b.stateNode.containerInfo!==w.containerInfo||b.stateNode.implementation!==w.implementation?(b=j3(w,y.mode,E),b.return=y,b):(b=s(b,w.children||[]),b.return=y,b)}function h(y,b,w,E,R){return b===null||b.tag!==7?(b=Sv(w,y.mode,E,R),b.return=y,b):(b=s(b,w),b.return=y,b)}function u(y,b,w){if(typeof b=="string"&&b!==""||typeof b=="number")return b=L3(""+b,y.mode,w),b.return=y,b;if(typeof b=="object"&&b!==null){switch(b.$$typeof){case DR:return w=KP(b.type,b.key,b.props,null,y.mode,w),w.ref=TS(y,null,b),w.return=y,w;case sb:return b=j3(b,y.mode,w),b.return=y,b;case lh:var E=b._init;return u(y,E(b._payload),w)}if(s1(b)||ES(b))return b=Sv(b,y.mode,w,null),b.return=y,b;VR(y,b)}return null}function f(y,b,w,E){var R=b!==null?b.key:null;if(typeof w=="string"&&w!==""||typeof w=="number")return R!==null?null:a(y,b,""+w,E);if(typeof w=="object"&&w!==null){switch(w.$$typeof){case DR:return w.key===R?c(y,b,w,E):null;case sb:return w.key===R?d(y,b,w,E):null;case lh:return R=w._init,f(y,b,R(w._payload),E)}if(s1(w)||ES(w))return R!==null?null:h(y,b,w,E,null);VR(y,w)}return null}function g(y,b,w,E,R){if(typeof E=="string"&&E!==""||typeof E=="number")return y=y.get(w)||null,a(b,y,""+E,R);if(typeof E=="object"&&E!==null){switch(E.$$typeof){case DR:return y=y.get(E.key===null?w:E.key)||null,c(b,y,E,R);case sb:return y=y.get(E.key===null?w:E.key)||null,d(b,y,E,R);case lh:var T=E._init;return g(y,b,w,T(E._payload),R)}if(s1(E)||ES(E))return y=y.get(w)||null,h(b,y,E,R,null);VR(b,E)}return null}function v(y,b,w,E){for(var R=null,T=null,N=b,A=b=0,D=null;N!==null&&A<w.length;A++){N.index>A?(D=N,N=null):D=N.sibling;var O=f(y,N,w[A],E);if(O===null){N===null&&(N=D);break}e&&N&&O.alternate===null&&t(y,N),b=i(O,b,A),T===null?R=O:T.sibling=O,T=O,N=D}if(A===w.length)return n(y,N),Gr&&Jm(y,A),R;if(N===null){for(;A<w.length;A++)N=u(y,w[A],E),N!==null&&(b=i(N,b,A),T===null?R=N:T.sibling=N,T=N);return Gr&&Jm(y,A),R}for(N=r(y,N);A<w.length;A++)D=g(N,y,A,w[A],E),D!==null&&(e&&D.alternate!==null&&N.delete(D.key===null?A:D.key),b=i(D,b,A),T===null?R=D:T.sibling=D,T=D);return e&&N.forEach(function(I){return t(y,I)}),Gr&&Jm(y,A),R}function m(y,b,w,E){var R=ES(w);if(typeof R!="function")throw Error(Ve(150));if(w=R.call(w),w==null)throw Error(Ve(151));for(var T=R=null,N=b,A=b=0,D=null,O=w.next();N!==null&&!O.done;A++,O=w.next()){N.index>A?(D=N,N=null):D=N.sibling;var I=f(y,N,O.value,E);if(I===null){N===null&&(N=D);break}e&&N&&I.alternate===null&&t(y,N),b=i(I,b,A),T===null?R=I:T.sibling=I,T=I,N=D}if(O.done)return n(y,N),Gr&&Jm(y,A),R;if(N===null){for(;!O.done;A++,O=w.next())O=u(y,O.value,E),O!==null&&(b=i(O,b,A),T===null?R=O:T.sibling=O,T=O);return Gr&&Jm(y,A),R}for(N=r(y,N);!O.done;A++,O=w.next())O=g(N,y,A,O.value,E),O!==null&&(e&&O.alternate!==null&&N.delete(O.key===null?A:O.key),b=i(O,b,A),T===null?R=O:T.sibling=O,T=O);return e&&N.forEach(function($){return t(y,$)}),Gr&&Jm(y,A),R}function x(y,b,w,E){if(typeof w=="object"&&w!==null&&w.type===ib&&w.key===null&&(w=w.props.children),typeof w=="object"&&w!==null){switch(w.$$typeof){case DR:e:{for(var R=w.key,T=b;T!==null;){if(T.key===R){if(R=w.type,R===ib){if(T.tag===7){n(y,T.sibling),b=s(T,w.props.children),b.return=y,y=b;break e}}else if(T.elementType===R||typeof R=="object"&&R!==null&&R.$$typeof===lh&&Gq(R)===T.type){n(y,T.sibling),b=s(T,w.props),b.ref=TS(y,T,w),b.return=y,y=b;break e}n(y,T);break}else t(y,T);T=T.sibling}w.type===ib?(b=Sv(w.props.children,y.mode,E,w.key),b.return=y,y=b):(E=KP(w.type,w.key,w.props,null,y.mode,E),E.ref=TS(y,b,w),E.return=y,y=E)}return o(y);case sb:e:{for(T=w.key;b!==null;){if(b.key===T)if(b.tag===4&&b.stateNode.containerInfo===w.containerInfo&&b.stateNode.implementation===w.implementation){n(y,b.sibling),b=s(b,w.children||[]),b.return=y,y=b;break e}else{n(y,b);break}else t(y,b);b=b.sibling}b=j3(w,y.mode,E),b.return=y,y=b}return o(y);case lh:return T=w._init,x(y,b,T(w._payload),E)}if(s1(w))return v(y,b,w,E);if(ES(w))return m(y,b,w,E);VR(y,w)}return typeof w=="string"&&w!==""||typeof w=="number"?(w=""+w,b!==null&&b.tag===6?(n(y,b.sibling),b=s(b,w),b.return=y,y=b):(n(y,b),b=L3(w,y.mode,E),b.return=y,y=b),o(y)):n(y,b)}return x}var ex=zQ(!0),BQ=zQ(!1),eT=Ap(null),tT=null,hb=null,KV=null;function YV(){KV=hb=tT=null}function XV(e){var t=eT.current;Ur(eT),e._currentValue=t}function rB(e,t,n){for(;e!==null;){var r=e.alternate;if((e.childLanes&t)!==t?(e.childLanes|=t,r!==null&&(r.childLanes|=t)):r!==null&&(r.childLanes&t)!==t&&(r.childLanes|=t),e===n)break;e=e.return}}function Cb(e,t){tT=e,KV=hb=null,e=e.dependencies,e!==null&&e.firstContext!==null&&(e.lanes&t&&(Xo=!0),e.firstContext=null)}function Sl(e){var t=e._currentValue;if(KV!==e)if(e={context:e,memoizedValue:t,next:null},hb===null){if(tT===null)throw Error(Ve(308));hb=e,tT.dependencies={lanes:0,firstContext:e}}else hb=hb.next=e;return t}var ug=null;function QV(e){ug===null?ug=[e]:ug.push(e)}function UQ(e,t,n,r){var s=t.interleaved;return s===null?(n.next=n,QV(t)):(n.next=s.next,s.next=n),t.interleaved=n,Mf(e,r)}function Mf(e,t){e.lanes|=t;var n=e.alternate;for(n!==null&&(n.lanes|=t),n=e,e=e.return;e!==null;)e.childLanes|=t,n=e.alternate,n!==null&&(n.childLanes|=t),n=e,e=e.return;return n.tag===3?n.stateNode:null}var ch=!1;function ZV(e){e.updateQueue={baseState:e.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,interleaved:null,lanes:0},effects:null}}function VQ(e,t){e=e.updateQueue,t.updateQueue===e&&(t.updateQueue={baseState:e.baseState,firstBaseUpdate:e.firstBaseUpdate,lastBaseUpdate:e.lastBaseUpdate,shared:e.shared,effects:e.effects})}function Sf(e,t){return{eventTime:e,lane:t,tag:0,payload:null,callback:null,next:null}}function sp(e,t,n){var r=e.updateQueue;if(r===null)return null;if(r=r.shared,Rn&2){var s=r.pending;return s===null?t.next=t:(t.next=s.next,s.next=t),r.pending=t,Mf(e,n)}return s=r.interleaved,s===null?(t.next=t,QV(r)):(t.next=s.next,s.next=t),r.interleaved=t,Mf(e,n)}function UP(e,t,n){if(t=t.updateQueue,t!==null&&(t=t.shared,(n&4194240)!==0)){var r=t.lanes;r&=e.pendingLanes,n|=r,t.lanes=n,jV(e,n)}}function Kq(e,t){var n=e.updateQueue,r=e.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=t:i=i.next=t}else s=i=t;n={baseState:r.baseState,firstBaseUpdate:s,lastBaseUpdate:i,shared:r.shared,effects:r.effects},e.updateQueue=n;return}e=n.lastBaseUpdate,e===null?n.firstBaseUpdate=t:e.next=t,n.lastBaseUpdate=t}function nT(e,t,n,r){var s=e.updateQueue;ch=!1;var i=s.firstBaseUpdate,o=s.lastBaseUpdate,a=s.shared.pending;if(a!==null){s.shared.pending=null;var c=a,d=c.next;c.next=null,o===null?i=d:o.next=d,o=c;var h=e.alternate;h!==null&&(h=h.updateQueue,a=h.lastBaseUpdate,a!==o&&(a===null?h.firstBaseUpdate=d:a.next=d,h.lastBaseUpdate=c))}if(i!==null){var u=s.baseState;o=0,h=d=c=null,a=i;do{var f=a.lane,g=a.eventTime;if((r&f)===f){h!==null&&(h=h.next={eventTime:g,lane:0,tag:a.tag,payload:a.payload,callback:a.callback,next:null});e:{var v=e,m=a;switch(f=t,g=n,m.tag){case 1:if(v=m.payload,typeof v=="function"){u=v.call(g,u,f);break e}u=v;break e;case 3:v.flags=v.flags&-65537|128;case 0:if(v=m.payload,f=typeof v=="function"?v.call(g,u,f):v,f==null)break e;u=is({},u,f);break e;case 2:ch=!0}}a.callback!==null&&a.lane!==0&&(e.flags|=64,f=s.effects,f===null?s.effects=[a]:f.push(a))}else g={eventTime:g,lane:f,tag:a.tag,payload:a.payload,callback:a.callback,next:null},h===null?(d=h=g,c=u):h=h.next=g,o|=f;if(a=a.next,a===null){if(a=s.shared.pending,a===null)break;f=a,a=f.next,f.next=null,s.lastBaseUpdate=f,s.shared.pending=null}}while(!0);if(h===null&&(c=u),s.baseState=c,s.firstBaseUpdate=d,s.lastBaseUpdate=h,t=s.shared.interleaved,t!==null){s=t;do o|=s.lane,s=s.next;while(s!==t)}else i===null&&(s.shared.lanes=0);Mv|=o,e.lanes=o,e.memoizedState=u}}function Yq(e,t,n){if(e=t.effects,t.effects=null,e!==null)for(t=0;t<e.length;t++){var r=e[t],s=r.callback;if(s!==null){if(r.callback=null,r=n,typeof s!="function")throw Error(Ve(191,s));s.call(r)}}}var TA={},wu=Ap(TA),uC=Ap(TA),dC=Ap(TA);function dg(e){if(e===TA)throw Error(Ve(174));return e}function JV(e,t){switch(Ar(dC,t),Ar(uC,e),Ar(wu,TA),e=t.nodeType,e){case 9:case 11:t=(t=t.documentElement)?t.namespaceURI:jz(null,"");break;default:e=e===8?t.parentNode:t,t=e.namespaceURI||null,e=e.tagName,t=jz(t,e)}Ur(wu),Ar(wu,t)}function tx(){Ur(wu),Ur(uC),Ur(dC)}function HQ(e){dg(dC.current);var t=dg(wu.current),n=jz(t,e.type);t!==n&&(Ar(uC,e),Ar(wu,n))}function eH(e){uC.current===e&&(Ur(wu),Ur(uC))}var rs=Ap(0);function rT(e){for(var t=e;t!==null;){if(t.tag===13){var n=t.memoizedState;if(n!==null&&(n=n.dehydrated,n===null||n.data==="$?"||n.data==="$!"))return t}else if(t.tag===19&&t.memoizedProps.revealOrder!==void 0){if(t.flags&128)return t}else if(t.child!==null){t.child.return=t,t=t.child;continue}if(t===e)break;for(;t.sibling===null;){if(t.return===null||t.return===e)return null;t=t.return}t.sibling.return=t.return,t=t.sibling}return null}var T3=[];function tH(){for(var e=0;e<T3.length;e++)T3[e]._workInProgressVersionPrimary=null;T3.length=0}var VP=Bf.ReactCurrentDispatcher,k3=Bf.ReactCurrentBatchConfig,Ov=0,ss=null,Js=null,li=null,sT=!1,I1=!1,fC=0,Uge=0;function Vi(){throw Error(Ve(321))}function nH(e,t){if(t===null)return!1;for(var n=0;n<t.length&&n<e.length;n++)if(!Sc(e[n],t[n]))return!1;return!0}function rH(e,t,n,r,s,i){if(Ov=i,ss=t,t.memoizedState=null,t.updateQueue=null,t.lanes=0,VP.current=e===null||e.memoizedState===null?qge:Gge,e=n(r,s),I1){i=0;do{if(I1=!1,fC=0,25<=i)throw Error(Ve(301));i+=1,li=Js=null,t.updateQueue=null,VP.current=Kge,e=n(r,s)}while(I1)}if(VP.current=iT,t=Js!==null&&Js.next!==null,Ov=0,li=Js=ss=null,sT=!1,t)throw Error(Ve(300));return e}function sH(){var e=fC!==0;return fC=0,e}function Vc(){var e={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return li===null?ss.memoizedState=li=e:li=li.next=e,li}function Cl(){if(Js===null){var e=ss.alternate;e=e!==null?e.memoizedState:null}else e=Js.next;var t=li===null?ss.memoizedState:li.next;if(t!==null)li=t,Js=e;else{if(e===null)throw Error(Ve(310));Js=e,e={memoizedState:Js.memoizedState,baseState:Js.baseState,baseQueue:Js.baseQueue,queue:Js.queue,next:null},li===null?ss.memoizedState=li=e:li=li.next=e}return li}function hC(e,t){return typeof t=="function"?t(e):t}function D3(e){var t=Cl(),n=t.queue;if(n===null)throw Error(Ve(311));n.lastRenderedReducer=e;var r=Js,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,d=i;do{var h=d.lane;if((Ov&h)===h)c!==null&&(c=c.next={lane:0,action:d.action,hasEagerState:d.hasEagerState,eagerState:d.eagerState,next:null}),r=d.hasEagerState?d.eagerState:e(r,d.action);else{var u={lane:h,action:d.action,hasEagerState:d.hasEagerState,eagerState:d.eagerState,next:null};c===null?(a=c=u,o=r):c=c.next=u,ss.lanes|=h,Mv|=h}d=d.next}while(d!==null&&d!==i);c===null?o=r:c.next=a,Sc(r,t.memoizedState)||(Xo=!0),t.memoizedState=r,t.baseState=o,t.baseQueue=c,n.lastRenderedState=r}if(e=n.interleaved,e!==null){s=e;do i=s.lane,ss.lanes|=i,Mv|=i,s=s.next;while(s!==e)}else s===null&&(n.lanes=0);return[t.memoizedState,n.dispatch]}function O3(e){var t=Cl(),n=t.queue;if(n===null)throw Error(Ve(311));n.lastRenderedReducer=e;var r=n.dispatch,s=n.pending,i=t.memoizedState;if(s!==null){n.pending=null;var o=s=s.next;do i=e(i,o.action),o=o.next;while(o!==s);Sc(i,t.memoizedState)||(Xo=!0),t.memoizedState=i,t.baseQueue===null&&(t.baseState=i),n.lastRenderedState=i}return[i,r]}function WQ(){}function qQ(e,t){var n=ss,r=Cl(),s=t(),i=!Sc(r.memoizedState,s);if(i&&(r.memoizedState=s,Xo=!0),r=r.queue,iH(YQ.bind(null,n,r,e),[e]),r.getSnapshot!==t||i||li!==null&&li.memoizedState.tag&1){if(n.flags|=2048,pC(9,KQ.bind(null,n,r,s,t),void 0,null),fi===null)throw Error(Ve(349));Ov&30||GQ(n,t,s)}return s}function GQ(e,t,n){e.flags|=16384,e={getSnapshot:t,value:n},t=ss.updateQueue,t===null?(t={lastEffect:null,stores:null},ss.updateQueue=t,t.stores=[e]):(n=t.stores,n===null?t.stores=[e]:n.push(e))}function KQ(e,t,n,r){t.value=n,t.getSnapshot=r,XQ(t)&&QQ(e)}function YQ(e,t,n){return n(function(){XQ(t)&&QQ(e)})}function XQ(e){var t=e.getSnapshot;e=e.value;try{var n=t();return!Sc(e,n)}catch{return!0}}function QQ(e){var t=Mf(e,1);t!==null&&xc(t,e,1,-1)}function Xq(e){var t=Vc();return typeof e=="function"&&(e=e()),t.memoizedState=t.baseState=e,e={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:hC,lastRenderedState:e},t.queue=e,e=e.dispatch=Wge.bind(null,ss,e),[t.memoizedState,e]}function pC(e,t,n,r){return e={tag:e,create:t,destroy:n,deps:r,next:null},t=ss.updateQueue,t===null?(t={lastEffect:null,stores:null},ss.updateQueue=t,t.lastEffect=e.next=e):(n=t.lastEffect,n===null?t.lastEffect=e.next=e:(r=n.next,n.next=e,e.next=r,t.lastEffect=e)),e}function ZQ(){return Cl().memoizedState}function HP(e,t,n,r){var s=Vc();ss.flags|=e,s.memoizedState=pC(1|t,n,void 0,r===void 0?null:r)}function Yk(e,t,n,r){var s=Cl();r=r===void 0?null:r;var i=void 0;if(Js!==null){var o=Js.memoizedState;if(i=o.destroy,r!==null&&nH(r,o.deps)){s.memoizedState=pC(t,n,i,r);return}}ss.flags|=e,s.memoizedState=pC(1|t,n,i,r)}function Qq(e,t){return HP(8390656,8,e,t)}function iH(e,t){return Yk(2048,8,e,t)}function JQ(e,t){return Yk(4,2,e,t)}function eZ(e,t){return Yk(4,4,e,t)}function tZ(e,t){if(typeof t=="function")return e=e(),t(e),function(){t(null)};if(t!=null)return e=e(),t.current=e,function(){t.current=null}}function nZ(e,t,n){return n=n!=null?n.concat([e]):null,Yk(4,4,tZ.bind(null,t,e),n)}function oH(){}function rZ(e,t){var n=Cl();t=t===void 0?null:t;var r=n.memoizedState;return r!==null&&t!==null&&nH(t,r[1])?r[0]:(n.memoizedState=[e,t],e)}function sZ(e,t){var n=Cl();t=t===void 0?null:t;var r=n.memoizedState;return r!==null&&t!==null&&nH(t,r[1])?r[0]:(e=e(),n.memoizedState=[e,t],e)}function iZ(e,t,n){return Ov&21?(Sc(n,t)||(n=uQ(),ss.lanes|=n,Mv|=n,e.baseState=!0),t):(e.baseState&&(e.baseState=!1,Xo=!0),e.memoizedState=n)}function Vge(e,t){var n=rr;rr=n!==0&&4>n?n:4,e(!0);var r=k3.transition;k3.transition={};try{e(!1),t()}finally{rr=n,k3.transition=r}}function oZ(){return Cl().memoizedState}function Hge(e,t,n){var r=op(e);if(n={lane:r,action:n,hasEagerState:!1,eagerState:null,next:null},aZ(e))lZ(t,n);else if(n=UQ(e,t,n,r),n!==null){var s=To();xc(n,e,r,s),cZ(n,t,r)}}function Wge(e,t,n){var r=op(e),s={lane:r,action:n,hasEagerState:!1,eagerState:null,next:null};if(aZ(e))lZ(t,s);else{var i=e.alternate;if(e.lanes===0&&(i===null||i.lanes===0)&&(i=t.lastRenderedReducer,i!==null))try{var o=t.lastRenderedState,a=i(o,n);if(s.hasEagerState=!0,s.eagerState=a,Sc(a,o)){var c=t.interleaved;c===null?(s.next=s,QV(t)):(s.next=c.next,c.next=s),t.interleaved=s;return}}catch{}finally{}n=UQ(e,t,s,r),n!==null&&(s=To(),xc(n,e,r,s),cZ(n,t,r))}}function aZ(e){var t=e.alternate;return e===ss||t!==null&&t===ss}function lZ(e,t){I1=sT=!0;var n=e.pending;n===null?t.next=t:(t.next=n.next,n.next=t),e.pending=t}function cZ(e,t,n){if(n&4194240){var r=t.lanes;r&=e.pendingLanes,n|=r,t.lanes=n,jV(e,n)}}var iT={readContext:Sl,useCallback:Vi,useContext:Vi,useEffect:Vi,useImperativeHandle:Vi,useInsertionEffect:Vi,useLayoutEffect:Vi,useMemo:Vi,useReducer:Vi,useRef:Vi,useState:Vi,useDebugValue:Vi,useDeferredValue:Vi,useTransition:Vi,useMutableSource:Vi,useSyncExternalStore:Vi,useId:Vi,unstable_isNewReconciler:!1},qge={readContext:Sl,useCallback:function(e,t){return Vc().memoizedState=[e,t===void 0?null:t],e},useContext:Sl,useEffect:Qq,useImperativeHandle:function(e,t,n){return n=n!=null?n.concat([e]):null,HP(4194308,4,tZ.bind(null,t,e),n)},useLayoutEffect:function(e,t){return HP(4194308,4,e,t)},useInsertionEffect:function(e,t){return HP(4,2,e,t)},useMemo:function(e,t){var n=Vc();return t=t===void 0?null:t,e=e(),n.memoizedState=[e,t],e},useReducer:function(e,t,n){var r=Vc();return t=n!==void 0?n(t):t,r.memoizedState=r.baseState=t,e={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:e,lastRenderedState:t},r.queue=e,e=e.dispatch=Hge.bind(null,ss,e),[r.memoizedState,e]},useRef:function(e){var t=Vc();return e={current:e},t.memoizedState=e},useState:Xq,useDebugValue:oH,useDeferredValue:function(e){return Vc().memoizedState=e},useTransition:function(){var e=Xq(!1),t=e[0];return e=Vge.bind(null,e[1]),Vc().memoizedState=e,[t,e]},useMutableSource:function(){},useSyncExternalStore:function(e,t,n){var r=ss,s=Vc();if(Gr){if(n===void 0)throw Error(Ve(407));n=n()}else{if(n=t(),fi===null)throw Error(Ve(349));Ov&30||GQ(r,t,n)}s.memoizedState=n;var i={value:n,getSnapshot:t};return s.queue=i,Qq(YQ.bind(null,r,i,e),[e]),r.flags|=2048,pC(9,KQ.bind(null,r,i,n,t),void 0,null),n},useId:function(){var e=Vc(),t=fi.identifierPrefix;if(Gr){var n=_f,r=xf;n=(r&~(1<<32-bc(r)-1)).toString(32)+n,t=":"+t+"R"+n,n=fC++,0<n&&(t+="H"+n.toString(32)),t+=":"}else n=Uge++,t=":"+t+"r"+n.toString(32)+":";return e.memoizedState=t},unstable_isNewReconciler:!1},Gge={readContext:Sl,useCallback:rZ,useContext:Sl,useEffect:iH,useImperativeHandle:nZ,useInsertionEffect:JQ,useLayoutEffect:eZ,useMemo:sZ,useReducer:D3,useRef:ZQ,useState:function(){return D3(hC)},useDebugValue:oH,useDeferredValue:function(e){var t=Cl();return iZ(t,Js.memoizedState,e)},useTransition:function(){var e=D3(hC)[0],t=Cl().memoizedState;return[e,t]},useMutableSource:WQ,useSyncExternalStore:qQ,useId:oZ,unstable_isNewReconciler:!1},Kge={readContext:Sl,useCallback:rZ,useContext:Sl,useEffect:iH,useImperativeHandle:nZ,useInsertionEffect:JQ,useLayoutEffect:eZ,useMemo:sZ,useReducer:O3,useRef:ZQ,useState:function(){return O3(hC)},useDebugValue:oH,useDeferredValue:function(e){var t=Cl();return Js===null?t.memoizedState=e:iZ(t,Js.memoizedState,e)},useTransition:function(){var e=O3(hC)[0],t=Cl().memoizedState;return[e,t]},useMutableSource:WQ,useSyncExternalStore:qQ,useId:oZ,unstable_isNewReconciler:!1};function Kl(e,t){if(e&&e.defaultProps){t=is({},t),e=e.defaultProps;for(var n in e)t[n]===void 0&&(t[n]=e[n]);return t}return t}function sB(e,t,n,r){t=e.memoizedState,n=n(r,t),n=n==null?t:is({},t,n),e.memoizedState=n,e.lanes===0&&(e.updateQueue.baseState=n)}var Xk={isMounted:function(e){return(e=e._reactInternals)?iy(e)===e:!1},enqueueSetState:function(e,t,n){e=e._reactInternals;var r=To(),s=op(e),i=Sf(r,s);i.payload=t,n!=null&&(i.callback=n),t=sp(e,i,s),t!==null&&(xc(t,e,s,r),UP(t,e,s))},enqueueReplaceState:function(e,t,n){e=e._reactInternals;var r=To(),s=op(e),i=Sf(r,s);i.tag=1,i.payload=t,n!=null&&(i.callback=n),t=sp(e,i,s),t!==null&&(xc(t,e,s,r),UP(t,e,s))},enqueueForceUpdate:function(e,t){e=e._reactInternals;var n=To(),r=op(e),s=Sf(n,r);s.tag=2,t!=null&&(s.callback=t),t=sp(e,s,r),t!==null&&(xc(t,e,r,n),UP(t,e,r))}};function Zq(e,t,n,r,s,i,o){return e=e.stateNode,typeof e.shouldComponentUpdate=="function"?e.shouldComponentUpdate(r,i,o):t.prototype&&t.prototype.isPureReactComponent?!oC(n,r)||!oC(s,i):!0}function uZ(e,t,n){var r=!1,s=hp,i=t.contextType;return typeof i=="object"&&i!==null?i=Sl(i):(s=na(t)?kv:so.current,r=t.contextTypes,i=(r=r!=null)?Z0(e,s):hp),t=new t(n,i),e.memoizedState=t.state!==null&&t.state!==void 0?t.state:null,t.updater=Xk,e.stateNode=t,t._reactInternals=e,r&&(e=e.stateNode,e.__reactInternalMemoizedUnmaskedChildContext=s,e.__reactInternalMemoizedMaskedChildContext=i),t}function Jq(e,t,n,r){e=t.state,typeof t.componentWillReceiveProps=="function"&&t.componentWillReceiveProps(n,r),typeof t.UNSAFE_componentWillReceiveProps=="function"&&t.UNSAFE_componentWillReceiveProps(n,r),t.state!==e&&Xk.enqueueReplaceState(t,t.state,null)}function iB(e,t,n,r){var s=e.stateNode;s.props=n,s.state=e.memoizedState,s.refs={},ZV(e);var i=t.contextType;typeof i=="object"&&i!==null?s.context=Sl(i):(i=na(t)?kv:so.current,s.context=Z0(e,i)),s.state=e.memoizedState,i=t.getDerivedStateFromProps,typeof i=="function"&&(sB(e,t,i,n),s.state=e.memoizedState),typeof t.getDerivedStateFromProps=="function"||typeof s.getSnapshotBeforeUpdate=="function"||typeof s.UNSAFE_componentWillMount!="function"&&typeof s.componentWillMount!="function"||(t=s.state,typeof s.componentWillMount=="function"&&s.componentWillMount(),typeof s.UNSAFE_componentWillMount=="function"&&s.UNSAFE_componentWillMount(),t!==s.state&&Xk.enqueueReplaceState(s,s.state,null),nT(e,n,s,r),s.state=e.memoizedState),typeof s.componentDidMount=="function"&&(e.flags|=4194308)}function nx(e,t){try{var n="",r=t;do n+=wme(r),r=r.return;while(r);var s=n}catch(i){s=`
|
||
Error generating stack: `+i.message+`
|
||
`+i.stack}return{value:e,source:t,stack:s,digest:null}}function M3(e,t,n){return{value:e,source:null,stack:n??null,digest:t??null}}function oB(e,t){try{console.error(t.value)}catch(n){setTimeout(function(){throw n})}}var Yge=typeof WeakMap=="function"?WeakMap:Map;function dZ(e,t,n){n=Sf(-1,n),n.tag=3,n.payload={element:null};var r=t.value;return n.callback=function(){aT||(aT=!0,gB=r),oB(e,t)},n}function fZ(e,t,n){n=Sf(-1,n),n.tag=3;var r=e.type.getDerivedStateFromError;if(typeof r=="function"){var s=t.value;n.payload=function(){return r(s)},n.callback=function(){oB(e,t)}}var i=e.stateNode;return i!==null&&typeof i.componentDidCatch=="function"&&(n.callback=function(){oB(e,t),typeof r!="function"&&(ip===null?ip=new Set([this]):ip.add(this));var o=t.stack;this.componentDidCatch(t.value,{componentStack:o!==null?o:""})}),n}function eG(e,t,n){var r=e.pingCache;if(r===null){r=e.pingCache=new Yge;var s=new Set;r.set(t,s)}else s=r.get(t),s===void 0&&(s=new Set,r.set(t,s));s.has(n)||(s.add(n),e=cve.bind(null,e,t,n),t.then(e,e))}function tG(e){do{var t;if((t=e.tag===13)&&(t=e.memoizedState,t=t!==null?t.dehydrated!==null:!0),t)return e;e=e.return}while(e!==null);return null}function nG(e,t,n,r,s){return e.mode&1?(e.flags|=65536,e.lanes=s,e):(e===t?e.flags|=65536:(e.flags|=128,n.flags|=131072,n.flags&=-52805,n.tag===1&&(n.alternate===null?n.tag=17:(t=Sf(-1,1),t.tag=2,sp(n,t,1))),n.lanes|=1),e)}var Xge=Bf.ReactCurrentOwner,Xo=!1;function So(e,t,n,r){t.child=e===null?BQ(t,null,n,r):ex(t,e.child,n,r)}function rG(e,t,n,r,s){n=n.render;var i=t.ref;return Cb(t,s),r=rH(e,t,n,r,i,s),n=sH(),e!==null&&!Xo?(t.updateQueue=e.updateQueue,t.flags&=-2053,e.lanes&=~s,If(e,t,s)):(Gr&&n&&WV(t),t.flags|=1,So(e,t,r,s),t.child)}function sG(e,t,n,r,s){if(e===null){var i=n.type;return typeof i=="function"&&!pH(i)&&i.defaultProps===void 0&&n.compare===null&&n.defaultProps===void 0?(t.tag=15,t.type=i,hZ(e,t,i,r,s)):(e=KP(n.type,null,r,t,t.mode,s),e.ref=t.ref,e.return=t,t.child=e)}if(i=e.child,!(e.lanes&s)){var o=i.memoizedProps;if(n=n.compare,n=n!==null?n:oC,n(o,r)&&e.ref===t.ref)return If(e,t,s)}return t.flags|=1,e=ap(i,r),e.ref=t.ref,e.return=t,t.child=e}function hZ(e,t,n,r,s){if(e!==null){var i=e.memoizedProps;if(oC(i,r)&&e.ref===t.ref)if(Xo=!1,t.pendingProps=r=i,(e.lanes&s)!==0)e.flags&131072&&(Xo=!0);else return t.lanes=e.lanes,If(e,t,s)}return aB(e,t,n,r,s)}function pZ(e,t,n){var r=t.pendingProps,s=r.children,i=e!==null?e.memoizedState:null;if(r.mode==="hidden")if(!(t.mode&1))t.memoizedState={baseLanes:0,cachePool:null,transitions:null},Ar(mb,za),za|=n;else{if(!(n&1073741824))return e=i!==null?i.baseLanes|n:n,t.lanes=t.childLanes=1073741824,t.memoizedState={baseLanes:e,cachePool:null,transitions:null},t.updateQueue=null,Ar(mb,za),za|=e,null;t.memoizedState={baseLanes:0,cachePool:null,transitions:null},r=i!==null?i.baseLanes:n,Ar(mb,za),za|=r}else i!==null?(r=i.baseLanes|n,t.memoizedState=null):r=n,Ar(mb,za),za|=r;return So(e,t,s,n),t.child}function mZ(e,t){var n=t.ref;(e===null&&n!==null||e!==null&&e.ref!==n)&&(t.flags|=512,t.flags|=2097152)}function aB(e,t,n,r,s){var i=na(n)?kv:so.current;return i=Z0(t,i),Cb(t,s),n=rH(e,t,n,r,i,s),r=sH(),e!==null&&!Xo?(t.updateQueue=e.updateQueue,t.flags&=-2053,e.lanes&=~s,If(e,t,s)):(Gr&&r&&WV(t),t.flags|=1,So(e,t,n,s),t.child)}function iG(e,t,n,r,s){if(na(n)){var i=!0;QN(t)}else i=!1;if(Cb(t,s),t.stateNode===null)WP(e,t),uZ(t,n,r),iB(t,n,r,s),r=!0;else if(e===null){var o=t.stateNode,a=t.memoizedProps;o.props=a;var c=o.context,d=n.contextType;typeof d=="object"&&d!==null?d=Sl(d):(d=na(n)?kv:so.current,d=Z0(t,d));var h=n.getDerivedStateFromProps,u=typeof h=="function"||typeof o.getSnapshotBeforeUpdate=="function";u||typeof o.UNSAFE_componentWillReceiveProps!="function"&&typeof o.componentWillReceiveProps!="function"||(a!==r||c!==d)&&Jq(t,o,r,d),ch=!1;var f=t.memoizedState;o.state=f,nT(t,r,o,s),c=t.memoizedState,a!==r||f!==c||ta.current||ch?(typeof h=="function"&&(sB(t,n,h,r),c=t.memoizedState),(a=ch||Zq(t,n,a,r,f,c,d))?(u||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"&&(t.flags|=4194308)):(typeof o.componentDidMount=="function"&&(t.flags|=4194308),t.memoizedProps=r,t.memoizedState=c),o.props=r,o.state=c,o.context=d,r=a):(typeof o.componentDidMount=="function"&&(t.flags|=4194308),r=!1)}else{o=t.stateNode,VQ(e,t),a=t.memoizedProps,d=t.type===t.elementType?a:Kl(t.type,a),o.props=d,u=t.pendingProps,f=o.context,c=n.contextType,typeof c=="object"&&c!==null?c=Sl(c):(c=na(n)?kv:so.current,c=Z0(t,c));var g=n.getDerivedStateFromProps;(h=typeof g=="function"||typeof o.getSnapshotBeforeUpdate=="function")||typeof o.UNSAFE_componentWillReceiveProps!="function"&&typeof o.componentWillReceiveProps!="function"||(a!==u||f!==c)&&Jq(t,o,r,c),ch=!1,f=t.memoizedState,o.state=f,nT(t,r,o,s);var v=t.memoizedState;a!==u||f!==v||ta.current||ch?(typeof g=="function"&&(sB(t,n,g,r),v=t.memoizedState),(d=ch||Zq(t,n,d,r,f,v,c)||!1)?(h||typeof o.UNSAFE_componentWillUpdate!="function"&&typeof o.componentWillUpdate!="function"||(typeof o.componentWillUpdate=="function"&&o.componentWillUpdate(r,v,c),typeof o.UNSAFE_componentWillUpdate=="function"&&o.UNSAFE_componentWillUpdate(r,v,c)),typeof o.componentDidUpdate=="function"&&(t.flags|=4),typeof o.getSnapshotBeforeUpdate=="function"&&(t.flags|=1024)):(typeof o.componentDidUpdate!="function"||a===e.memoizedProps&&f===e.memoizedState||(t.flags|=4),typeof o.getSnapshotBeforeUpdate!="function"||a===e.memoizedProps&&f===e.memoizedState||(t.flags|=1024),t.memoizedProps=r,t.memoizedState=v),o.props=r,o.state=v,o.context=c,r=d):(typeof o.componentDidUpdate!="function"||a===e.memoizedProps&&f===e.memoizedState||(t.flags|=4),typeof o.getSnapshotBeforeUpdate!="function"||a===e.memoizedProps&&f===e.memoizedState||(t.flags|=1024),r=!1)}return lB(e,t,n,r,i,s)}function lB(e,t,n,r,s,i){mZ(e,t);var o=(t.flags&128)!==0;if(!r&&!o)return s&&Hq(t,n,!1),If(e,t,i);r=t.stateNode,Xge.current=t;var a=o&&typeof n.getDerivedStateFromError!="function"?null:r.render();return t.flags|=1,e!==null&&o?(t.child=ex(t,e.child,null,i),t.child=ex(t,null,a,i)):So(e,t,a,i),t.memoizedState=r.state,s&&Hq(t,n,!0),t.child}function gZ(e){var t=e.stateNode;t.pendingContext?Vq(e,t.pendingContext,t.pendingContext!==t.context):t.context&&Vq(e,t.context,!1),JV(e,t.containerInfo)}function oG(e,t,n,r,s){return J0(),GV(s),t.flags|=256,So(e,t,n,r),t.child}var cB={dehydrated:null,treeContext:null,retryLane:0};function uB(e){return{baseLanes:e,cachePool:null,transitions:null}}function vZ(e,t,n){var r=t.pendingProps,s=rs.current,i=!1,o=(t.flags&128)!==0,a;if((a=o)||(a=e!==null&&e.memoizedState===null?!1:(s&2)!==0),a?(i=!0,t.flags&=-129):(e===null||e.memoizedState!==null)&&(s|=1),Ar(rs,s&1),e===null)return nB(t),e=t.memoizedState,e!==null&&(e=e.dehydrated,e!==null)?(t.mode&1?e.data==="$!"?t.lanes=8:t.lanes=1073741824:t.lanes=1,null):(o=r.children,e=r.fallback,i?(r=t.mode,i=t.child,o={mode:"hidden",children:o},!(r&1)&&i!==null?(i.childLanes=0,i.pendingProps=o):i=Jk(o,r,0,null),e=Sv(e,r,n,null),i.return=t,e.return=t,i.sibling=e,t.child=i,t.child.memoizedState=uB(n),t.memoizedState=cB,e):aH(t,o));if(s=e.memoizedState,s!==null&&(a=s.dehydrated,a!==null))return Qge(e,t,o,r,a,s,n);if(i){i=r.fallback,o=t.mode,s=e.child,a=s.sibling;var c={mode:"hidden",children:r.children};return!(o&1)&&t.child!==s?(r=t.child,r.childLanes=0,r.pendingProps=c,t.deletions=null):(r=ap(s,c),r.subtreeFlags=s.subtreeFlags&14680064),a!==null?i=ap(a,i):(i=Sv(i,o,n,null),i.flags|=2),i.return=t,r.return=t,r.sibling=i,t.child=r,r=i,i=t.child,o=e.child.memoizedState,o=o===null?uB(n):{baseLanes:o.baseLanes|n,cachePool:null,transitions:o.transitions},i.memoizedState=o,i.childLanes=e.childLanes&~n,t.memoizedState=cB,r}return i=e.child,e=i.sibling,r=ap(i,{mode:"visible",children:r.children}),!(t.mode&1)&&(r.lanes=n),r.return=t,r.sibling=null,e!==null&&(n=t.deletions,n===null?(t.deletions=[e],t.flags|=16):n.push(e)),t.child=r,t.memoizedState=null,r}function aH(e,t){return t=Jk({mode:"visible",children:t},e.mode,0,null),t.return=e,e.child=t}function HR(e,t,n,r){return r!==null&&GV(r),ex(t,e.child,null,n),e=aH(t,t.pendingProps.children),e.flags|=2,t.memoizedState=null,e}function Qge(e,t,n,r,s,i,o){if(n)return t.flags&256?(t.flags&=-257,r=M3(Error(Ve(422))),HR(e,t,o,r)):t.memoizedState!==null?(t.child=e.child,t.flags|=128,null):(i=r.fallback,s=t.mode,r=Jk({mode:"visible",children:r.children},s,0,null),i=Sv(i,s,o,null),i.flags|=2,r.return=t,i.return=t,r.sibling=i,t.child=r,t.mode&1&&ex(t,e.child,null,o),t.child.memoizedState=uB(o),t.memoizedState=cB,i);if(!(t.mode&1))return HR(e,t,o,null);if(s.data==="$!"){if(r=s.nextSibling&&s.nextSibling.dataset,r)var a=r.dgst;return r=a,i=Error(Ve(419)),r=M3(i,r,void 0),HR(e,t,o,r)}if(a=(o&e.childLanes)!==0,Xo||a){if(r=fi,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,Mf(e,s),xc(r,e,s,-1))}return hH(),r=M3(Error(Ve(421))),HR(e,t,o,r)}return s.data==="$?"?(t.flags|=128,t.child=e.child,t=uve.bind(null,e),s._reactRetry=t,null):(e=i.treeContext,qa=rp(s.nextSibling),Ga=t,Gr=!0,hc=null,e!==null&&(pl[ml++]=xf,pl[ml++]=_f,pl[ml++]=Dv,xf=e.id,_f=e.overflow,Dv=t),t=aH(t,r.children),t.flags|=4096,t)}function aG(e,t,n){e.lanes|=t;var r=e.alternate;r!==null&&(r.lanes|=t),rB(e.return,t,n)}function I3(e,t,n,r,s){var i=e.memoizedState;i===null?e.memoizedState={isBackwards:t,rendering:null,renderingStartTime:0,last:r,tail:n,tailMode:s}:(i.isBackwards=t,i.rendering=null,i.renderingStartTime=0,i.last=r,i.tail=n,i.tailMode=s)}function yZ(e,t,n){var r=t.pendingProps,s=r.revealOrder,i=r.tail;if(So(e,t,r.children,n),r=rs.current,r&2)r=r&1|2,t.flags|=128;else{if(e!==null&&e.flags&128)e:for(e=t.child;e!==null;){if(e.tag===13)e.memoizedState!==null&&aG(e,n,t);else if(e.tag===19)aG(e,n,t);else if(e.child!==null){e.child.return=e,e=e.child;continue}if(e===t)break e;for(;e.sibling===null;){if(e.return===null||e.return===t)break e;e=e.return}e.sibling.return=e.return,e=e.sibling}r&=1}if(Ar(rs,r),!(t.mode&1))t.memoizedState=null;else switch(s){case"forwards":for(n=t.child,s=null;n!==null;)e=n.alternate,e!==null&&rT(e)===null&&(s=n),n=n.sibling;n=s,n===null?(s=t.child,t.child=null):(s=n.sibling,n.sibling=null),I3(t,!1,s,n,i);break;case"backwards":for(n=null,s=t.child,t.child=null;s!==null;){if(e=s.alternate,e!==null&&rT(e)===null){t.child=s;break}e=s.sibling,s.sibling=n,n=s,s=e}I3(t,!0,n,null,i);break;case"together":I3(t,!1,null,null,void 0);break;default:t.memoizedState=null}return t.child}function WP(e,t){!(t.mode&1)&&e!==null&&(e.alternate=null,t.alternate=null,t.flags|=2)}function If(e,t,n){if(e!==null&&(t.dependencies=e.dependencies),Mv|=t.lanes,!(n&t.childLanes))return null;if(e!==null&&t.child!==e.child)throw Error(Ve(153));if(t.child!==null){for(e=t.child,n=ap(e,e.pendingProps),t.child=n,n.return=t;e.sibling!==null;)e=e.sibling,n=n.sibling=ap(e,e.pendingProps),n.return=t;n.sibling=null}return t.child}function Zge(e,t,n){switch(t.tag){case 3:gZ(t),J0();break;case 5:HQ(t);break;case 1:na(t.type)&&QN(t);break;case 4:JV(t,t.stateNode.containerInfo);break;case 10:var r=t.type._context,s=t.memoizedProps.value;Ar(eT,r._currentValue),r._currentValue=s;break;case 13:if(r=t.memoizedState,r!==null)return r.dehydrated!==null?(Ar(rs,rs.current&1),t.flags|=128,null):n&t.child.childLanes?vZ(e,t,n):(Ar(rs,rs.current&1),e=If(e,t,n),e!==null?e.sibling:null);Ar(rs,rs.current&1);break;case 19:if(r=(n&t.childLanes)!==0,e.flags&128){if(r)return yZ(e,t,n);t.flags|=128}if(s=t.memoizedState,s!==null&&(s.rendering=null,s.tail=null,s.lastEffect=null),Ar(rs,rs.current),r)break;return null;case 22:case 23:return t.lanes=0,pZ(e,t,n)}return If(e,t,n)}var bZ,dB,xZ,_Z;bZ=function(e,t){for(var n=t.child;n!==null;){if(n.tag===5||n.tag===6)e.appendChild(n.stateNode);else if(n.tag!==4&&n.child!==null){n.child.return=n,n=n.child;continue}if(n===t)break;for(;n.sibling===null;){if(n.return===null||n.return===t)return;n=n.return}n.sibling.return=n.return,n=n.sibling}};dB=function(){};xZ=function(e,t,n,r){var s=e.memoizedProps;if(s!==r){e=t.stateNode,dg(wu.current);var i=null;switch(n){case"input":s=Oz(e,s),r=Oz(e,r),i=[];break;case"select":s=is({},s,{value:void 0}),r=is({},r,{value:void 0}),i=[];break;case"textarea":s=Lz(e,s),r=Lz(e,r),i=[];break;default:typeof s.onClick!="function"&&typeof r.onClick=="function"&&(e.onclick=YN)}$z(n,r);var o;n=null;for(d in s)if(!r.hasOwnProperty(d)&&s.hasOwnProperty(d)&&s[d]!=null)if(d==="style"){var a=s[d];for(o in a)a.hasOwnProperty(o)&&(n||(n={}),n[o]="")}else d!=="dangerouslySetInnerHTML"&&d!=="children"&&d!=="suppressContentEditableWarning"&&d!=="suppressHydrationWarning"&&d!=="autoFocus"&&(J1.hasOwnProperty(d)?i||(i=[]):(i=i||[]).push(d,null));for(d in r){var c=r[d];if(a=s!=null?s[d]:void 0,r.hasOwnProperty(d)&&c!==a&&(c!=null||a!=null))if(d==="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(d,n)),n=c;else d==="dangerouslySetInnerHTML"?(c=c?c.__html:void 0,a=a?a.__html:void 0,c!=null&&a!==c&&(i=i||[]).push(d,c)):d==="children"?typeof c!="string"&&typeof c!="number"||(i=i||[]).push(d,""+c):d!=="suppressContentEditableWarning"&&d!=="suppressHydrationWarning"&&(J1.hasOwnProperty(d)?(c!=null&&d==="onScroll"&&Fr("scroll",e),i||a===c||(i=[])):(i=i||[]).push(d,c))}n&&(i=i||[]).push("style",n);var d=i;(t.updateQueue=d)&&(t.flags|=4)}};_Z=function(e,t,n,r){n!==r&&(t.flags|=4)};function kS(e,t){if(!Gr)switch(e.tailMode){case"hidden":t=e.tail;for(var n=null;t!==null;)t.alternate!==null&&(n=t),t=t.sibling;n===null?e.tail=null:n.sibling=null;break;case"collapsed":n=e.tail;for(var r=null;n!==null;)n.alternate!==null&&(r=n),n=n.sibling;r===null?t||e.tail===null?e.tail=null:e.tail.sibling=null:r.sibling=null}}function Hi(e){var t=e.alternate!==null&&e.alternate.child===e.child,n=0,r=0;if(t)for(var s=e.child;s!==null;)n|=s.lanes|s.childLanes,r|=s.subtreeFlags&14680064,r|=s.flags&14680064,s.return=e,s=s.sibling;else for(s=e.child;s!==null;)n|=s.lanes|s.childLanes,r|=s.subtreeFlags,r|=s.flags,s.return=e,s=s.sibling;return e.subtreeFlags|=r,e.childLanes=n,t}function Jge(e,t,n){var r=t.pendingProps;switch(qV(t),t.tag){case 2:case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return Hi(t),null;case 1:return na(t.type)&&XN(),Hi(t),null;case 3:return r=t.stateNode,tx(),Ur(ta),Ur(so),tH(),r.pendingContext&&(r.context=r.pendingContext,r.pendingContext=null),(e===null||e.child===null)&&(UR(t)?t.flags|=4:e===null||e.memoizedState.isDehydrated&&!(t.flags&256)||(t.flags|=1024,hc!==null&&(bB(hc),hc=null))),dB(e,t),Hi(t),null;case 5:eH(t);var s=dg(dC.current);if(n=t.type,e!==null&&t.stateNode!=null)xZ(e,t,n,r,s),e.ref!==t.ref&&(t.flags|=512,t.flags|=2097152);else{if(!r){if(t.stateNode===null)throw Error(Ve(166));return Hi(t),null}if(e=dg(wu.current),UR(t)){r=t.stateNode,n=t.type;var i=t.memoizedProps;switch(r[hu]=t,r[cC]=i,e=(t.mode&1)!==0,n){case"dialog":Fr("cancel",r),Fr("close",r);break;case"iframe":case"object":case"embed":Fr("load",r);break;case"video":case"audio":for(s=0;s<o1.length;s++)Fr(o1[s],r);break;case"source":Fr("error",r);break;case"img":case"image":case"link":Fr("error",r),Fr("load",r);break;case"details":Fr("toggle",r);break;case"input":gq(r,i),Fr("invalid",r);break;case"select":r._wrapperState={wasMultiple:!!i.multiple},Fr("invalid",r);break;case"textarea":yq(r,i),Fr("invalid",r)}$z(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&&BR(r.textContent,a,e),s=["children",a]):typeof a=="number"&&r.textContent!==""+a&&(i.suppressHydrationWarning!==!0&&BR(r.textContent,a,e),s=["children",""+a]):J1.hasOwnProperty(o)&&a!=null&&o==="onScroll"&&Fr("scroll",r)}switch(n){case"input":OR(r),vq(r,i,!0);break;case"textarea":OR(r),bq(r);break;case"select":case"option":break;default:typeof i.onClick=="function"&&(r.onclick=YN)}r=s,t.updateQueue=r,r!==null&&(t.flags|=4)}else{o=s.nodeType===9?s:s.ownerDocument,e==="http://www.w3.org/1999/xhtml"&&(e=YX(n)),e==="http://www.w3.org/1999/xhtml"?n==="script"?(e=o.createElement("div"),e.innerHTML="<script><\/script>",e=e.removeChild(e.firstChild)):typeof r.is=="string"?e=o.createElement(n,{is:r.is}):(e=o.createElement(n),n==="select"&&(o=e,r.multiple?o.multiple=!0:r.size&&(o.size=r.size))):e=o.createElementNS(e,n),e[hu]=t,e[cC]=r,bZ(e,t,!1,!1),t.stateNode=e;e:{switch(o=Fz(n,r),n){case"dialog":Fr("cancel",e),Fr("close",e),s=r;break;case"iframe":case"object":case"embed":Fr("load",e),s=r;break;case"video":case"audio":for(s=0;s<o1.length;s++)Fr(o1[s],e);s=r;break;case"source":Fr("error",e),s=r;break;case"img":case"image":case"link":Fr("error",e),Fr("load",e),s=r;break;case"details":Fr("toggle",e),s=r;break;case"input":gq(e,r),s=Oz(e,r),Fr("invalid",e);break;case"option":s=r;break;case"select":e._wrapperState={wasMultiple:!!r.multiple},s=is({},r,{value:void 0}),Fr("invalid",e);break;case"textarea":yq(e,r),s=Lz(e,r),Fr("invalid",e);break;default:s=r}$z(n,s),a=s;for(i in a)if(a.hasOwnProperty(i)){var c=a[i];i==="style"?ZX(e,c):i==="dangerouslySetInnerHTML"?(c=c?c.__html:void 0,c!=null&&XX(e,c)):i==="children"?typeof c=="string"?(n!=="textarea"||c!=="")&&eC(e,c):typeof c=="number"&&eC(e,""+c):i!=="suppressContentEditableWarning"&&i!=="suppressHydrationWarning"&&i!=="autoFocus"&&(J1.hasOwnProperty(i)?c!=null&&i==="onScroll"&&Fr("scroll",e):c!=null&&kV(e,i,c,o))}switch(n){case"input":OR(e),vq(e,r,!1);break;case"textarea":OR(e),bq(e);break;case"option":r.value!=null&&e.setAttribute("value",""+fp(r.value));break;case"select":e.multiple=!!r.multiple,i=r.value,i!=null?xb(e,!!r.multiple,i,!1):r.defaultValue!=null&&xb(e,!!r.multiple,r.defaultValue,!0);break;default:typeof s.onClick=="function"&&(e.onclick=YN)}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&&(t.flags|=4)}t.ref!==null&&(t.flags|=512,t.flags|=2097152)}return Hi(t),null;case 6:if(e&&t.stateNode!=null)_Z(e,t,e.memoizedProps,r);else{if(typeof r!="string"&&t.stateNode===null)throw Error(Ve(166));if(n=dg(dC.current),dg(wu.current),UR(t)){if(r=t.stateNode,n=t.memoizedProps,r[hu]=t,(i=r.nodeValue!==n)&&(e=Ga,e!==null))switch(e.tag){case 3:BR(r.nodeValue,n,(e.mode&1)!==0);break;case 5:e.memoizedProps.suppressHydrationWarning!==!0&&BR(r.nodeValue,n,(e.mode&1)!==0)}i&&(t.flags|=4)}else r=(n.nodeType===9?n:n.ownerDocument).createTextNode(r),r[hu]=t,t.stateNode=r}return Hi(t),null;case 13:if(Ur(rs),r=t.memoizedState,e===null||e.memoizedState!==null&&e.memoizedState.dehydrated!==null){if(Gr&&qa!==null&&t.mode&1&&!(t.flags&128))FQ(),J0(),t.flags|=98560,i=!1;else if(i=UR(t),r!==null&&r.dehydrated!==null){if(e===null){if(!i)throw Error(Ve(318));if(i=t.memoizedState,i=i!==null?i.dehydrated:null,!i)throw Error(Ve(317));i[hu]=t}else J0(),!(t.flags&128)&&(t.memoizedState=null),t.flags|=4;Hi(t),i=!1}else hc!==null&&(bB(hc),hc=null),i=!0;if(!i)return t.flags&65536?t:null}return t.flags&128?(t.lanes=n,t):(r=r!==null,r!==(e!==null&&e.memoizedState!==null)&&r&&(t.child.flags|=8192,t.mode&1&&(e===null||rs.current&1?ri===0&&(ri=3):hH())),t.updateQueue!==null&&(t.flags|=4),Hi(t),null);case 4:return tx(),dB(e,t),e===null&&aC(t.stateNode.containerInfo),Hi(t),null;case 10:return XV(t.type._context),Hi(t),null;case 17:return na(t.type)&&XN(),Hi(t),null;case 19:if(Ur(rs),i=t.memoizedState,i===null)return Hi(t),null;if(r=(t.flags&128)!==0,o=i.rendering,o===null)if(r)kS(i,!1);else{if(ri!==0||e!==null&&e.flags&128)for(e=t.child;e!==null;){if(o=rT(e),o!==null){for(t.flags|=128,kS(i,!1),r=o.updateQueue,r!==null&&(t.updateQueue=r,t.flags|=4),t.subtreeFlags=0,r=n,n=t.child;n!==null;)i=n,e=r,i.flags&=14680066,o=i.alternate,o===null?(i.childLanes=0,i.lanes=e,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,e=o.dependencies,i.dependencies=e===null?null:{lanes:e.lanes,firstContext:e.firstContext}),n=n.sibling;return Ar(rs,rs.current&1|2),t.child}e=e.sibling}i.tail!==null&&_s()>rx&&(t.flags|=128,r=!0,kS(i,!1),t.lanes=4194304)}else{if(!r)if(e=rT(o),e!==null){if(t.flags|=128,r=!0,n=e.updateQueue,n!==null&&(t.updateQueue=n,t.flags|=4),kS(i,!0),i.tail===null&&i.tailMode==="hidden"&&!o.alternate&&!Gr)return Hi(t),null}else 2*_s()-i.renderingStartTime>rx&&n!==1073741824&&(t.flags|=128,r=!0,kS(i,!1),t.lanes=4194304);i.isBackwards?(o.sibling=t.child,t.child=o):(n=i.last,n!==null?n.sibling=o:t.child=o,i.last=o)}return i.tail!==null?(t=i.tail,i.rendering=t,i.tail=t.sibling,i.renderingStartTime=_s(),t.sibling=null,n=rs.current,Ar(rs,r?n&1|2:n&1),t):(Hi(t),null);case 22:case 23:return fH(),r=t.memoizedState!==null,e!==null&&e.memoizedState!==null!==r&&(t.flags|=8192),r&&t.mode&1?za&1073741824&&(Hi(t),t.subtreeFlags&6&&(t.flags|=8192)):Hi(t),null;case 24:return null;case 25:return null}throw Error(Ve(156,t.tag))}function eve(e,t){switch(qV(t),t.tag){case 1:return na(t.type)&&XN(),e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 3:return tx(),Ur(ta),Ur(so),tH(),e=t.flags,e&65536&&!(e&128)?(t.flags=e&-65537|128,t):null;case 5:return eH(t),null;case 13:if(Ur(rs),e=t.memoizedState,e!==null&&e.dehydrated!==null){if(t.alternate===null)throw Error(Ve(340));J0()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 19:return Ur(rs),null;case 4:return tx(),null;case 10:return XV(t.type._context),null;case 22:case 23:return fH(),null;case 24:return null;default:return null}}var WR=!1,eo=!1,tve=typeof WeakSet=="function"?WeakSet:Set,ct=null;function pb(e,t){var n=e.ref;if(n!==null)if(typeof n=="function")try{n(null)}catch(r){ds(e,t,r)}else n.current=null}function fB(e,t,n){try{n()}catch(r){ds(e,t,r)}}var lG=!1;function nve(e,t){if(Yz=qN,e=AQ(),HV(e)){if("selectionStart"in e)var n={start:e.selectionStart,end:e.selectionEnd};else e:{n=(n=e.ownerDocument)&&n.defaultView||window;var r=n.getSelection&&n.getSelection();if(r&&r.rangeCount!==0){n=r.anchorNode;var s=r.anchorOffset,i=r.focusNode;r=r.focusOffset;try{n.nodeType,i.nodeType}catch{n=null;break e}var o=0,a=-1,c=-1,d=0,h=0,u=e,f=null;t:for(;;){for(var g;u!==n||s!==0&&u.nodeType!==3||(a=o+s),u!==i||r!==0&&u.nodeType!==3||(c=o+r),u.nodeType===3&&(o+=u.nodeValue.length),(g=u.firstChild)!==null;)f=u,u=g;for(;;){if(u===e)break t;if(f===n&&++d===s&&(a=o),f===i&&++h===r&&(c=o),(g=u.nextSibling)!==null)break;u=f,f=u.parentNode}u=g}n=a===-1||c===-1?null:{start:a,end:c}}else n=null}n=n||{start:0,end:0}}else n=null;for(Xz={focusedElem:e,selectionRange:n},qN=!1,ct=t;ct!==null;)if(t=ct,e=t.child,(t.subtreeFlags&1028)!==0&&e!==null)e.return=t,ct=e;else for(;ct!==null;){t=ct;try{var v=t.alternate;if(t.flags&1024)switch(t.tag){case 0:case 11:case 15:break;case 1:if(v!==null){var m=v.memoizedProps,x=v.memoizedState,y=t.stateNode,b=y.getSnapshotBeforeUpdate(t.elementType===t.type?m:Kl(t.type,m),x);y.__reactInternalSnapshotBeforeUpdate=b}break;case 3:var w=t.stateNode.containerInfo;w.nodeType===1?w.textContent="":w.nodeType===9&&w.documentElement&&w.removeChild(w.documentElement);break;case 5:case 6:case 4:case 17:break;default:throw Error(Ve(163))}}catch(E){ds(t,t.return,E)}if(e=t.sibling,e!==null){e.return=t.return,ct=e;break}ct=t.return}return v=lG,lG=!1,v}function L1(e,t,n){var r=t.updateQueue;if(r=r!==null?r.lastEffect:null,r!==null){var s=r=r.next;do{if((s.tag&e)===e){var i=s.destroy;s.destroy=void 0,i!==void 0&&fB(t,n,i)}s=s.next}while(s!==r)}}function Qk(e,t){if(t=t.updateQueue,t=t!==null?t.lastEffect:null,t!==null){var n=t=t.next;do{if((n.tag&e)===e){var r=n.create;n.destroy=r()}n=n.next}while(n!==t)}}function hB(e){var t=e.ref;if(t!==null){var n=e.stateNode;switch(e.tag){case 5:e=n;break;default:e=n}typeof t=="function"?t(e):t.current=e}}function wZ(e){var t=e.alternate;t!==null&&(e.alternate=null,wZ(t)),e.child=null,e.deletions=null,e.sibling=null,e.tag===5&&(t=e.stateNode,t!==null&&(delete t[hu],delete t[cC],delete t[Jz],delete t[$ge],delete t[Fge])),e.stateNode=null,e.return=null,e.dependencies=null,e.memoizedProps=null,e.memoizedState=null,e.pendingProps=null,e.stateNode=null,e.updateQueue=null}function SZ(e){return e.tag===5||e.tag===3||e.tag===4}function cG(e){e:for(;;){for(;e.sibling===null;){if(e.return===null||SZ(e.return))return null;e=e.return}for(e.sibling.return=e.return,e=e.sibling;e.tag!==5&&e.tag!==6&&e.tag!==18;){if(e.flags&2||e.child===null||e.tag===4)continue e;e.child.return=e,e=e.child}if(!(e.flags&2))return e.stateNode}}function pB(e,t,n){var r=e.tag;if(r===5||r===6)e=e.stateNode,t?n.nodeType===8?n.parentNode.insertBefore(e,t):n.insertBefore(e,t):(n.nodeType===8?(t=n.parentNode,t.insertBefore(e,n)):(t=n,t.appendChild(e)),n=n._reactRootContainer,n!=null||t.onclick!==null||(t.onclick=YN));else if(r!==4&&(e=e.child,e!==null))for(pB(e,t,n),e=e.sibling;e!==null;)pB(e,t,n),e=e.sibling}function mB(e,t,n){var r=e.tag;if(r===5||r===6)e=e.stateNode,t?n.insertBefore(e,t):n.appendChild(e);else if(r!==4&&(e=e.child,e!==null))for(mB(e,t,n),e=e.sibling;e!==null;)mB(e,t,n),e=e.sibling}var ki=null,dc=!1;function Yf(e,t,n){for(n=n.child;n!==null;)CZ(e,t,n),n=n.sibling}function CZ(e,t,n){if(_u&&typeof _u.onCommitFiberUnmount=="function")try{_u.onCommitFiberUnmount(Vk,n)}catch{}switch(n.tag){case 5:eo||pb(n,t);case 6:var r=ki,s=dc;ki=null,Yf(e,t,n),ki=r,dc=s,ki!==null&&(dc?(e=ki,n=n.stateNode,e.nodeType===8?e.parentNode.removeChild(n):e.removeChild(n)):ki.removeChild(n.stateNode));break;case 18:ki!==null&&(dc?(e=ki,n=n.stateNode,e.nodeType===8?P3(e.parentNode,n):e.nodeType===1&&P3(e,n),sC(e)):P3(ki,n.stateNode));break;case 4:r=ki,s=dc,ki=n.stateNode.containerInfo,dc=!0,Yf(e,t,n),ki=r,dc=s;break;case 0:case 11:case 14:case 15:if(!eo&&(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)&&fB(n,t,o),s=s.next}while(s!==r)}Yf(e,t,n);break;case 1:if(!eo&&(pb(n,t),r=n.stateNode,typeof r.componentWillUnmount=="function"))try{r.props=n.memoizedProps,r.state=n.memoizedState,r.componentWillUnmount()}catch(a){ds(n,t,a)}Yf(e,t,n);break;case 21:Yf(e,t,n);break;case 22:n.mode&1?(eo=(r=eo)||n.memoizedState!==null,Yf(e,t,n),eo=r):Yf(e,t,n);break;default:Yf(e,t,n)}}function uG(e){var t=e.updateQueue;if(t!==null){e.updateQueue=null;var n=e.stateNode;n===null&&(n=e.stateNode=new tve),t.forEach(function(r){var s=dve.bind(null,e,r);n.has(r)||(n.add(r),r.then(s,s))})}}function ql(e,t){var n=t.deletions;if(n!==null)for(var r=0;r<n.length;r++){var s=n[r];try{var i=e,o=t,a=o;e:for(;a!==null;){switch(a.tag){case 5:ki=a.stateNode,dc=!1;break e;case 3:ki=a.stateNode.containerInfo,dc=!0;break e;case 4:ki=a.stateNode.containerInfo,dc=!0;break e}a=a.return}if(ki===null)throw Error(Ve(160));CZ(i,o,s),ki=null,dc=!1;var c=s.alternate;c!==null&&(c.return=null),s.return=null}catch(d){ds(s,t,d)}}if(t.subtreeFlags&12854)for(t=t.child;t!==null;)EZ(t,e),t=t.sibling}function EZ(e,t){var n=e.alternate,r=e.flags;switch(e.tag){case 0:case 11:case 14:case 15:if(ql(t,e),zc(e),r&4){try{L1(3,e,e.return),Qk(3,e)}catch(m){ds(e,e.return,m)}try{L1(5,e,e.return)}catch(m){ds(e,e.return,m)}}break;case 1:ql(t,e),zc(e),r&512&&n!==null&&pb(n,n.return);break;case 5:if(ql(t,e),zc(e),r&512&&n!==null&&pb(n,n.return),e.flags&32){var s=e.stateNode;try{eC(s,"")}catch(m){ds(e,e.return,m)}}if(r&4&&(s=e.stateNode,s!=null)){var i=e.memoizedProps,o=n!==null?n.memoizedProps:i,a=e.type,c=e.updateQueue;if(e.updateQueue=null,c!==null)try{a==="input"&&i.type==="radio"&&i.name!=null&&GX(s,i),Fz(a,o);var d=Fz(a,i);for(o=0;o<c.length;o+=2){var h=c[o],u=c[o+1];h==="style"?ZX(s,u):h==="dangerouslySetInnerHTML"?XX(s,u):h==="children"?eC(s,u):kV(s,h,u,d)}switch(a){case"input":Mz(s,i);break;case"textarea":KX(s,i);break;case"select":var f=s._wrapperState.wasMultiple;s._wrapperState.wasMultiple=!!i.multiple;var g=i.value;g!=null?xb(s,!!i.multiple,g,!1):f!==!!i.multiple&&(i.defaultValue!=null?xb(s,!!i.multiple,i.defaultValue,!0):xb(s,!!i.multiple,i.multiple?[]:"",!1))}s[cC]=i}catch(m){ds(e,e.return,m)}}break;case 6:if(ql(t,e),zc(e),r&4){if(e.stateNode===null)throw Error(Ve(162));s=e.stateNode,i=e.memoizedProps;try{s.nodeValue=i}catch(m){ds(e,e.return,m)}}break;case 3:if(ql(t,e),zc(e),r&4&&n!==null&&n.memoizedState.isDehydrated)try{sC(t.containerInfo)}catch(m){ds(e,e.return,m)}break;case 4:ql(t,e),zc(e);break;case 13:ql(t,e),zc(e),s=e.child,s.flags&8192&&(i=s.memoizedState!==null,s.stateNode.isHidden=i,!i||s.alternate!==null&&s.alternate.memoizedState!==null||(uH=_s())),r&4&&uG(e);break;case 22:if(h=n!==null&&n.memoizedState!==null,e.mode&1?(eo=(d=eo)||h,ql(t,e),eo=d):ql(t,e),zc(e),r&8192){if(d=e.memoizedState!==null,(e.stateNode.isHidden=d)&&!h&&e.mode&1)for(ct=e,h=e.child;h!==null;){for(u=ct=h;ct!==null;){switch(f=ct,g=f.child,f.tag){case 0:case 11:case 14:case 15:L1(4,f,f.return);break;case 1:pb(f,f.return);var v=f.stateNode;if(typeof v.componentWillUnmount=="function"){r=f,n=f.return;try{t=r,v.props=t.memoizedProps,v.state=t.memoizedState,v.componentWillUnmount()}catch(m){ds(r,n,m)}}break;case 5:pb(f,f.return);break;case 22:if(f.memoizedState!==null){fG(u);continue}}g!==null?(g.return=f,ct=g):fG(u)}h=h.sibling}e:for(h=null,u=e;;){if(u.tag===5){if(h===null){h=u;try{s=u.stateNode,d?(i=s.style,typeof i.setProperty=="function"?i.setProperty("display","none","important"):i.display="none"):(a=u.stateNode,c=u.memoizedProps.style,o=c!=null&&c.hasOwnProperty("display")?c.display:null,a.style.display=QX("display",o))}catch(m){ds(e,e.return,m)}}}else if(u.tag===6){if(h===null)try{u.stateNode.nodeValue=d?"":u.memoizedProps}catch(m){ds(e,e.return,m)}}else if((u.tag!==22&&u.tag!==23||u.memoizedState===null||u===e)&&u.child!==null){u.child.return=u,u=u.child;continue}if(u===e)break e;for(;u.sibling===null;){if(u.return===null||u.return===e)break e;h===u&&(h=null),u=u.return}h===u&&(h=null),u.sibling.return=u.return,u=u.sibling}}break;case 19:ql(t,e),zc(e),r&4&&uG(e);break;case 21:break;default:ql(t,e),zc(e)}}function zc(e){var t=e.flags;if(t&2){try{e:{for(var n=e.return;n!==null;){if(SZ(n)){var r=n;break e}n=n.return}throw Error(Ve(160))}switch(r.tag){case 5:var s=r.stateNode;r.flags&32&&(eC(s,""),r.flags&=-33);var i=cG(e);mB(e,i,s);break;case 3:case 4:var o=r.stateNode.containerInfo,a=cG(e);pB(e,a,o);break;default:throw Error(Ve(161))}}catch(c){ds(e,e.return,c)}e.flags&=-3}t&4096&&(e.flags&=-4097)}function rve(e,t,n){ct=e,AZ(e)}function AZ(e,t,n){for(var r=(e.mode&1)!==0;ct!==null;){var s=ct,i=s.child;if(s.tag===22&&r){var o=s.memoizedState!==null||WR;if(!o){var a=s.alternate,c=a!==null&&a.memoizedState!==null||eo;a=WR;var d=eo;if(WR=o,(eo=c)&&!d)for(ct=s;ct!==null;)o=ct,c=o.child,o.tag===22&&o.memoizedState!==null?hG(s):c!==null?(c.return=o,ct=c):hG(s);for(;i!==null;)ct=i,AZ(i),i=i.sibling;ct=s,WR=a,eo=d}dG(e)}else s.subtreeFlags&8772&&i!==null?(i.return=s,ct=i):dG(e)}}function dG(e){for(;ct!==null;){var t=ct;if(t.flags&8772){var n=t.alternate;try{if(t.flags&8772)switch(t.tag){case 0:case 11:case 15:eo||Qk(5,t);break;case 1:var r=t.stateNode;if(t.flags&4&&!eo)if(n===null)r.componentDidMount();else{var s=t.elementType===t.type?n.memoizedProps:Kl(t.type,n.memoizedProps);r.componentDidUpdate(s,n.memoizedState,r.__reactInternalSnapshotBeforeUpdate)}var i=t.updateQueue;i!==null&&Yq(t,i,r);break;case 3:var o=t.updateQueue;if(o!==null){if(n=null,t.child!==null)switch(t.child.tag){case 5:n=t.child.stateNode;break;case 1:n=t.child.stateNode}Yq(t,o,n)}break;case 5:var a=t.stateNode;if(n===null&&t.flags&4){n=a;var c=t.memoizedProps;switch(t.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(t.memoizedState===null){var d=t.alternate;if(d!==null){var h=d.memoizedState;if(h!==null){var u=h.dehydrated;u!==null&&sC(u)}}}break;case 19:case 17:case 21:case 22:case 23:case 25:break;default:throw Error(Ve(163))}eo||t.flags&512&&hB(t)}catch(f){ds(t,t.return,f)}}if(t===e){ct=null;break}if(n=t.sibling,n!==null){n.return=t.return,ct=n;break}ct=t.return}}function fG(e){for(;ct!==null;){var t=ct;if(t===e){ct=null;break}var n=t.sibling;if(n!==null){n.return=t.return,ct=n;break}ct=t.return}}function hG(e){for(;ct!==null;){var t=ct;try{switch(t.tag){case 0:case 11:case 15:var n=t.return;try{Qk(4,t)}catch(c){ds(t,n,c)}break;case 1:var r=t.stateNode;if(typeof r.componentDidMount=="function"){var s=t.return;try{r.componentDidMount()}catch(c){ds(t,s,c)}}var i=t.return;try{hB(t)}catch(c){ds(t,i,c)}break;case 5:var o=t.return;try{hB(t)}catch(c){ds(t,o,c)}}}catch(c){ds(t,t.return,c)}if(t===e){ct=null;break}var a=t.sibling;if(a!==null){a.return=t.return,ct=a;break}ct=t.return}}var sve=Math.ceil,oT=Bf.ReactCurrentDispatcher,lH=Bf.ReactCurrentOwner,xl=Bf.ReactCurrentBatchConfig,Rn=0,fi=null,Ds=null,ji=0,za=0,mb=Ap(0),ri=0,mC=null,Mv=0,Zk=0,cH=0,j1=null,Yo=null,uH=0,rx=1/0,jd=null,aT=!1,gB=null,ip=null,qR=!1,Qh=null,lT=0,$1=0,vB=null,qP=-1,GP=0;function To(){return Rn&6?_s():qP!==-1?qP:qP=_s()}function op(e){return e.mode&1?Rn&2&&ji!==0?ji&-ji:Bge.transition!==null?(GP===0&&(GP=uQ()),GP):(e=rr,e!==0||(e=window.event,e=e===void 0?16:vQ(e.type)),e):1}function xc(e,t,n,r){if(50<$1)throw $1=0,vB=null,Error(Ve(185));RA(e,n,r),(!(Rn&2)||e!==fi)&&(e===fi&&(!(Rn&2)&&(Zk|=n),ri===4&&mh(e,ji)),ra(e,r),n===1&&Rn===0&&!(t.mode&1)&&(rx=_s()+500,Kk&&Rp()))}function ra(e,t){var n=e.callbackNode;Bme(e,t);var r=WN(e,e===fi?ji:0);if(r===0)n!==null&&wq(n),e.callbackNode=null,e.callbackPriority=0;else if(t=r&-r,e.callbackPriority!==t){if(n!=null&&wq(n),t===1)e.tag===0?zge(pG.bind(null,e)):LQ(pG.bind(null,e)),Lge(function(){!(Rn&6)&&Rp()}),n=null;else{switch(dQ(r)){case 1:n=LV;break;case 4:n=lQ;break;case 16:n=HN;break;case 536870912:n=cQ;break;default:n=HN}n=MZ(n,RZ.bind(null,e))}e.callbackPriority=t,e.callbackNode=n}}function RZ(e,t){if(qP=-1,GP=0,Rn&6)throw Error(Ve(327));var n=e.callbackNode;if(Eb()&&e.callbackNode!==n)return null;var r=WN(e,e===fi?ji:0);if(r===0)return null;if(r&30||r&e.expiredLanes||t)t=cT(e,r);else{t=r;var s=Rn;Rn|=2;var i=NZ();(fi!==e||ji!==t)&&(jd=null,rx=_s()+500,wv(e,t));do try{ave();break}catch(a){PZ(e,a)}while(!0);YV(),oT.current=i,Rn=s,Ds!==null?t=0:(fi=null,ji=0,t=ri)}if(t!==0){if(t===2&&(s=Hz(e),s!==0&&(r=s,t=yB(e,s))),t===1)throw n=mC,wv(e,0),mh(e,r),ra(e,_s()),n;if(t===6)mh(e,r);else{if(s=e.current.alternate,!(r&30)&&!ive(s)&&(t=cT(e,r),t===2&&(i=Hz(e),i!==0&&(r=i,t=yB(e,i))),t===1))throw n=mC,wv(e,0),mh(e,r),ra(e,_s()),n;switch(e.finishedWork=s,e.finishedLanes=r,t){case 0:case 1:throw Error(Ve(345));case 2:eg(e,Yo,jd);break;case 3:if(mh(e,r),(r&130023424)===r&&(t=uH+500-_s(),10<t)){if(WN(e,0)!==0)break;if(s=e.suspendedLanes,(s&r)!==r){To(),e.pingedLanes|=e.suspendedLanes&s;break}e.timeoutHandle=Zz(eg.bind(null,e,Yo,jd),t);break}eg(e,Yo,jd);break;case 4:if(mh(e,r),(r&4194240)===r)break;for(t=e.eventTimes,s=-1;0<r;){var o=31-bc(r);i=1<<o,o=t[o],o>s&&(s=o),r&=~i}if(r=s,r=_s()-r,r=(120>r?120:480>r?480:1080>r?1080:1920>r?1920:3e3>r?3e3:4320>r?4320:1960*sve(r/1960))-r,10<r){e.timeoutHandle=Zz(eg.bind(null,e,Yo,jd),r);break}eg(e,Yo,jd);break;case 5:eg(e,Yo,jd);break;default:throw Error(Ve(329))}}}return ra(e,_s()),e.callbackNode===n?RZ.bind(null,e):null}function yB(e,t){var n=j1;return e.current.memoizedState.isDehydrated&&(wv(e,t).flags|=256),e=cT(e,t),e!==2&&(t=Yo,Yo=n,t!==null&&bB(t)),e}function bB(e){Yo===null?Yo=e:Yo.push.apply(Yo,e)}function ive(e){for(var t=e;;){if(t.flags&16384){var n=t.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(!Sc(i(),s))return!1}catch{return!1}}}if(n=t.child,t.subtreeFlags&16384&&n!==null)n.return=t,t=n;else{if(t===e)break;for(;t.sibling===null;){if(t.return===null||t.return===e)return!0;t=t.return}t.sibling.return=t.return,t=t.sibling}}return!0}function mh(e,t){for(t&=~cH,t&=~Zk,e.suspendedLanes|=t,e.pingedLanes&=~t,e=e.expirationTimes;0<t;){var n=31-bc(t),r=1<<n;e[n]=-1,t&=~r}}function pG(e){if(Rn&6)throw Error(Ve(327));Eb();var t=WN(e,0);if(!(t&1))return ra(e,_s()),null;var n=cT(e,t);if(e.tag!==0&&n===2){var r=Hz(e);r!==0&&(t=r,n=yB(e,r))}if(n===1)throw n=mC,wv(e,0),mh(e,t),ra(e,_s()),n;if(n===6)throw Error(Ve(345));return e.finishedWork=e.current.alternate,e.finishedLanes=t,eg(e,Yo,jd),ra(e,_s()),null}function dH(e,t){var n=Rn;Rn|=1;try{return e(t)}finally{Rn=n,Rn===0&&(rx=_s()+500,Kk&&Rp())}}function Iv(e){Qh!==null&&Qh.tag===0&&!(Rn&6)&&Eb();var t=Rn;Rn|=1;var n=xl.transition,r=rr;try{if(xl.transition=null,rr=1,e)return e()}finally{rr=r,xl.transition=n,Rn=t,!(Rn&6)&&Rp()}}function fH(){za=mb.current,Ur(mb)}function wv(e,t){e.finishedWork=null,e.finishedLanes=0;var n=e.timeoutHandle;if(n!==-1&&(e.timeoutHandle=-1,Ige(n)),Ds!==null)for(n=Ds.return;n!==null;){var r=n;switch(qV(r),r.tag){case 1:r=r.type.childContextTypes,r!=null&&XN();break;case 3:tx(),Ur(ta),Ur(so),tH();break;case 5:eH(r);break;case 4:tx();break;case 13:Ur(rs);break;case 19:Ur(rs);break;case 10:XV(r.type._context);break;case 22:case 23:fH()}n=n.return}if(fi=e,Ds=e=ap(e.current,null),ji=za=t,ri=0,mC=null,cH=Zk=Mv=0,Yo=j1=null,ug!==null){for(t=0;t<ug.length;t++)if(n=ug[t],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}ug=null}return e}function PZ(e,t){do{var n=Ds;try{if(YV(),VP.current=iT,sT){for(var r=ss.memoizedState;r!==null;){var s=r.queue;s!==null&&(s.pending=null),r=r.next}sT=!1}if(Ov=0,li=Js=ss=null,I1=!1,fC=0,lH.current=null,n===null||n.return===null){ri=1,mC=t,Ds=null;break}e:{var i=e,o=n.return,a=n,c=t;if(t=ji,a.flags|=32768,c!==null&&typeof c=="object"&&typeof c.then=="function"){var d=c,h=a,u=h.tag;if(!(h.mode&1)&&(u===0||u===11||u===15)){var f=h.alternate;f?(h.updateQueue=f.updateQueue,h.memoizedState=f.memoizedState,h.lanes=f.lanes):(h.updateQueue=null,h.memoizedState=null)}var g=tG(o);if(g!==null){g.flags&=-257,nG(g,o,a,i,t),g.mode&1&&eG(i,d,t),t=g,c=d;var v=t.updateQueue;if(v===null){var m=new Set;m.add(c),t.updateQueue=m}else v.add(c);break e}else{if(!(t&1)){eG(i,d,t),hH();break e}c=Error(Ve(426))}}else if(Gr&&a.mode&1){var x=tG(o);if(x!==null){!(x.flags&65536)&&(x.flags|=256),nG(x,o,a,i,t),GV(nx(c,a));break e}}i=c=nx(c,a),ri!==4&&(ri=2),j1===null?j1=[i]:j1.push(i),i=o;do{switch(i.tag){case 3:i.flags|=65536,t&=-t,i.lanes|=t;var y=dZ(i,c,t);Kq(i,y);break e;case 1:a=c;var b=i.type,w=i.stateNode;if(!(i.flags&128)&&(typeof b.getDerivedStateFromError=="function"||w!==null&&typeof w.componentDidCatch=="function"&&(ip===null||!ip.has(w)))){i.flags|=65536,t&=-t,i.lanes|=t;var E=fZ(i,a,t);Kq(i,E);break e}}i=i.return}while(i!==null)}kZ(n)}catch(R){t=R,Ds===n&&n!==null&&(Ds=n=n.return);continue}break}while(!0)}function NZ(){var e=oT.current;return oT.current=iT,e===null?iT:e}function hH(){(ri===0||ri===3||ri===2)&&(ri=4),fi===null||!(Mv&268435455)&&!(Zk&268435455)||mh(fi,ji)}function cT(e,t){var n=Rn;Rn|=2;var r=NZ();(fi!==e||ji!==t)&&(jd=null,wv(e,t));do try{ove();break}catch(s){PZ(e,s)}while(!0);if(YV(),Rn=n,oT.current=r,Ds!==null)throw Error(Ve(261));return fi=null,ji=0,ri}function ove(){for(;Ds!==null;)TZ(Ds)}function ave(){for(;Ds!==null&&!Dme();)TZ(Ds)}function TZ(e){var t=OZ(e.alternate,e,za);e.memoizedProps=e.pendingProps,t===null?kZ(e):Ds=t,lH.current=null}function kZ(e){var t=e;do{var n=t.alternate;if(e=t.return,t.flags&32768){if(n=eve(n,t),n!==null){n.flags&=32767,Ds=n;return}if(e!==null)e.flags|=32768,e.subtreeFlags=0,e.deletions=null;else{ri=6,Ds=null;return}}else if(n=Jge(n,t,za),n!==null){Ds=n;return}if(t=t.sibling,t!==null){Ds=t;return}Ds=t=e}while(t!==null);ri===0&&(ri=5)}function eg(e,t,n){var r=rr,s=xl.transition;try{xl.transition=null,rr=1,lve(e,t,n,r)}finally{xl.transition=s,rr=r}return null}function lve(e,t,n,r){do Eb();while(Qh!==null);if(Rn&6)throw Error(Ve(327));n=e.finishedWork;var s=e.finishedLanes;if(n===null)return null;if(e.finishedWork=null,e.finishedLanes=0,n===e.current)throw Error(Ve(177));e.callbackNode=null,e.callbackPriority=0;var i=n.lanes|n.childLanes;if(Ume(e,i),e===fi&&(Ds=fi=null,ji=0),!(n.subtreeFlags&2064)&&!(n.flags&2064)||qR||(qR=!0,MZ(HN,function(){return Eb(),null})),i=(n.flags&15990)!==0,n.subtreeFlags&15990||i){i=xl.transition,xl.transition=null;var o=rr;rr=1;var a=Rn;Rn|=4,lH.current=null,nve(e,n),EZ(n,e),Pge(Xz),qN=!!Yz,Xz=Yz=null,e.current=n,rve(n),Ome(),Rn=a,rr=o,xl.transition=i}else e.current=n;if(qR&&(qR=!1,Qh=e,lT=s),i=e.pendingLanes,i===0&&(ip=null),Lme(n.stateNode),ra(e,_s()),t!==null)for(r=e.onRecoverableError,n=0;n<t.length;n++)s=t[n],r(s.value,{componentStack:s.stack,digest:s.digest});if(aT)throw aT=!1,e=gB,gB=null,e;return lT&1&&e.tag!==0&&Eb(),i=e.pendingLanes,i&1?e===vB?$1++:($1=0,vB=e):$1=0,Rp(),null}function Eb(){if(Qh!==null){var e=dQ(lT),t=xl.transition,n=rr;try{if(xl.transition=null,rr=16>e?16:e,Qh===null)var r=!1;else{if(e=Qh,Qh=null,lT=0,Rn&6)throw Error(Ve(331));var s=Rn;for(Rn|=4,ct=e.current;ct!==null;){var i=ct,o=i.child;if(ct.flags&16){var a=i.deletions;if(a!==null){for(var c=0;c<a.length;c++){var d=a[c];for(ct=d;ct!==null;){var h=ct;switch(h.tag){case 0:case 11:case 15:L1(8,h,i)}var u=h.child;if(u!==null)u.return=h,ct=u;else for(;ct!==null;){h=ct;var f=h.sibling,g=h.return;if(wZ(h),h===d){ct=null;break}if(f!==null){f.return=g,ct=f;break}ct=g}}}var v=i.alternate;if(v!==null){var m=v.child;if(m!==null){v.child=null;do{var x=m.sibling;m.sibling=null,m=x}while(m!==null)}}ct=i}}if(i.subtreeFlags&2064&&o!==null)o.return=i,ct=o;else e:for(;ct!==null;){if(i=ct,i.flags&2048)switch(i.tag){case 0:case 11:case 15:L1(9,i,i.return)}var y=i.sibling;if(y!==null){y.return=i.return,ct=y;break e}ct=i.return}}var b=e.current;for(ct=b;ct!==null;){o=ct;var w=o.child;if(o.subtreeFlags&2064&&w!==null)w.return=o,ct=w;else e:for(o=b;ct!==null;){if(a=ct,a.flags&2048)try{switch(a.tag){case 0:case 11:case 15:Qk(9,a)}}catch(R){ds(a,a.return,R)}if(a===o){ct=null;break e}var E=a.sibling;if(E!==null){E.return=a.return,ct=E;break e}ct=a.return}}if(Rn=s,Rp(),_u&&typeof _u.onPostCommitFiberRoot=="function")try{_u.onPostCommitFiberRoot(Vk,e)}catch{}r=!0}return r}finally{rr=n,xl.transition=t}}return!1}function mG(e,t,n){t=nx(n,t),t=dZ(e,t,1),e=sp(e,t,1),t=To(),e!==null&&(RA(e,1,t),ra(e,t))}function ds(e,t,n){if(e.tag===3)mG(e,e,n);else for(;t!==null;){if(t.tag===3){mG(t,e,n);break}else if(t.tag===1){var r=t.stateNode;if(typeof t.type.getDerivedStateFromError=="function"||typeof r.componentDidCatch=="function"&&(ip===null||!ip.has(r))){e=nx(n,e),e=fZ(t,e,1),t=sp(t,e,1),e=To(),t!==null&&(RA(t,1,e),ra(t,e));break}}t=t.return}}function cve(e,t,n){var r=e.pingCache;r!==null&&r.delete(t),t=To(),e.pingedLanes|=e.suspendedLanes&n,fi===e&&(ji&n)===n&&(ri===4||ri===3&&(ji&130023424)===ji&&500>_s()-uH?wv(e,0):cH|=n),ra(e,t)}function DZ(e,t){t===0&&(e.mode&1?(t=LR,LR<<=1,!(LR&130023424)&&(LR=4194304)):t=1);var n=To();e=Mf(e,t),e!==null&&(RA(e,t,n),ra(e,n))}function uve(e){var t=e.memoizedState,n=0;t!==null&&(n=t.retryLane),DZ(e,n)}function dve(e,t){var n=0;switch(e.tag){case 13:var r=e.stateNode,s=e.memoizedState;s!==null&&(n=s.retryLane);break;case 19:r=e.stateNode;break;default:throw Error(Ve(314))}r!==null&&r.delete(t),DZ(e,n)}var OZ;OZ=function(e,t,n){if(e!==null)if(e.memoizedProps!==t.pendingProps||ta.current)Xo=!0;else{if(!(e.lanes&n)&&!(t.flags&128))return Xo=!1,Zge(e,t,n);Xo=!!(e.flags&131072)}else Xo=!1,Gr&&t.flags&1048576&&jQ(t,JN,t.index);switch(t.lanes=0,t.tag){case 2:var r=t.type;WP(e,t),e=t.pendingProps;var s=Z0(t,so.current);Cb(t,n),s=rH(null,t,r,e,s,n);var i=sH();return t.flags|=1,typeof s=="object"&&s!==null&&typeof s.render=="function"&&s.$$typeof===void 0?(t.tag=1,t.memoizedState=null,t.updateQueue=null,na(r)?(i=!0,QN(t)):i=!1,t.memoizedState=s.state!==null&&s.state!==void 0?s.state:null,ZV(t),s.updater=Xk,t.stateNode=s,s._reactInternals=t,iB(t,r,e,n),t=lB(null,t,r,!0,i,n)):(t.tag=0,Gr&&i&&WV(t),So(null,t,s,n),t=t.child),t;case 16:r=t.elementType;e:{switch(WP(e,t),e=t.pendingProps,s=r._init,r=s(r._payload),t.type=r,s=t.tag=hve(r),e=Kl(r,e),s){case 0:t=aB(null,t,r,e,n);break e;case 1:t=iG(null,t,r,e,n);break e;case 11:t=rG(null,t,r,e,n);break e;case 14:t=sG(null,t,r,Kl(r.type,e),n);break e}throw Error(Ve(306,r,""))}return t;case 0:return r=t.type,s=t.pendingProps,s=t.elementType===r?s:Kl(r,s),aB(e,t,r,s,n);case 1:return r=t.type,s=t.pendingProps,s=t.elementType===r?s:Kl(r,s),iG(e,t,r,s,n);case 3:e:{if(gZ(t),e===null)throw Error(Ve(387));r=t.pendingProps,i=t.memoizedState,s=i.element,VQ(e,t),nT(t,r,null,n);var o=t.memoizedState;if(r=o.element,i.isDehydrated)if(i={element:r,isDehydrated:!1,cache:o.cache,pendingSuspenseBoundaries:o.pendingSuspenseBoundaries,transitions:o.transitions},t.updateQueue.baseState=i,t.memoizedState=i,t.flags&256){s=nx(Error(Ve(423)),t),t=oG(e,t,r,n,s);break e}else if(r!==s){s=nx(Error(Ve(424)),t),t=oG(e,t,r,n,s);break e}else for(qa=rp(t.stateNode.containerInfo.firstChild),Ga=t,Gr=!0,hc=null,n=BQ(t,null,r,n),t.child=n;n;)n.flags=n.flags&-3|4096,n=n.sibling;else{if(J0(),r===s){t=If(e,t,n);break e}So(e,t,r,n)}t=t.child}return t;case 5:return HQ(t),e===null&&nB(t),r=t.type,s=t.pendingProps,i=e!==null?e.memoizedProps:null,o=s.children,Qz(r,s)?o=null:i!==null&&Qz(r,i)&&(t.flags|=32),mZ(e,t),So(e,t,o,n),t.child;case 6:return e===null&&nB(t),null;case 13:return vZ(e,t,n);case 4:return JV(t,t.stateNode.containerInfo),r=t.pendingProps,e===null?t.child=ex(t,null,r,n):So(e,t,r,n),t.child;case 11:return r=t.type,s=t.pendingProps,s=t.elementType===r?s:Kl(r,s),rG(e,t,r,s,n);case 7:return So(e,t,t.pendingProps,n),t.child;case 8:return So(e,t,t.pendingProps.children,n),t.child;case 12:return So(e,t,t.pendingProps.children,n),t.child;case 10:e:{if(r=t.type._context,s=t.pendingProps,i=t.memoizedProps,o=s.value,Ar(eT,r._currentValue),r._currentValue=o,i!==null)if(Sc(i.value,o)){if(i.children===s.children&&!ta.current){t=If(e,t,n);break e}}else for(i=t.child,i!==null&&(i.return=t);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=Sf(-1,n&-n),c.tag=2;var d=i.updateQueue;if(d!==null){d=d.shared;var h=d.pending;h===null?c.next=c:(c.next=h.next,h.next=c),d.pending=c}}i.lanes|=n,c=i.alternate,c!==null&&(c.lanes|=n),rB(i.return,n,t),a.lanes|=n;break}c=c.next}}else if(i.tag===10)o=i.type===t.type?null:i.child;else if(i.tag===18){if(o=i.return,o===null)throw Error(Ve(341));o.lanes|=n,a=o.alternate,a!==null&&(a.lanes|=n),rB(o,n,t),o=i.sibling}else o=i.child;if(o!==null)o.return=i;else for(o=i;o!==null;){if(o===t){o=null;break}if(i=o.sibling,i!==null){i.return=o.return,o=i;break}o=o.return}i=o}So(e,t,s.children,n),t=t.child}return t;case 9:return s=t.type,r=t.pendingProps.children,Cb(t,n),s=Sl(s),r=r(s),t.flags|=1,So(e,t,r,n),t.child;case 14:return r=t.type,s=Kl(r,t.pendingProps),s=Kl(r.type,s),sG(e,t,r,s,n);case 15:return hZ(e,t,t.type,t.pendingProps,n);case 17:return r=t.type,s=t.pendingProps,s=t.elementType===r?s:Kl(r,s),WP(e,t),t.tag=1,na(r)?(e=!0,QN(t)):e=!1,Cb(t,n),uZ(t,r,s),iB(t,r,s,n),lB(null,t,r,!0,e,n);case 19:return yZ(e,t,n);case 22:return pZ(e,t,n)}throw Error(Ve(156,t.tag))};function MZ(e,t){return aQ(e,t)}function fve(e,t,n,r){this.tag=e,this.key=n,this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null,this.index=0,this.ref=null,this.pendingProps=t,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 bl(e,t,n,r){return new fve(e,t,n,r)}function pH(e){return e=e.prototype,!(!e||!e.isReactComponent)}function hve(e){if(typeof e=="function")return pH(e)?1:0;if(e!=null){if(e=e.$$typeof,e===OV)return 11;if(e===MV)return 14}return 2}function ap(e,t){var n=e.alternate;return n===null?(n=bl(e.tag,t,e.key,e.mode),n.elementType=e.elementType,n.type=e.type,n.stateNode=e.stateNode,n.alternate=e,e.alternate=n):(n.pendingProps=t,n.type=e.type,n.flags=0,n.subtreeFlags=0,n.deletions=null),n.flags=e.flags&14680064,n.childLanes=e.childLanes,n.lanes=e.lanes,n.child=e.child,n.memoizedProps=e.memoizedProps,n.memoizedState=e.memoizedState,n.updateQueue=e.updateQueue,t=e.dependencies,n.dependencies=t===null?null:{lanes:t.lanes,firstContext:t.firstContext},n.sibling=e.sibling,n.index=e.index,n.ref=e.ref,n}function KP(e,t,n,r,s,i){var o=2;if(r=e,typeof e=="function")pH(e)&&(o=1);else if(typeof e=="string")o=5;else e:switch(e){case ib:return Sv(n.children,s,i,t);case DV:o=8,s|=8;break;case Nz:return e=bl(12,n,t,s|2),e.elementType=Nz,e.lanes=i,e;case Tz:return e=bl(13,n,t,s),e.elementType=Tz,e.lanes=i,e;case kz:return e=bl(19,n,t,s),e.elementType=kz,e.lanes=i,e;case HX:return Jk(n,s,i,t);default:if(typeof e=="object"&&e!==null)switch(e.$$typeof){case UX:o=10;break e;case VX:o=9;break e;case OV:o=11;break e;case MV:o=14;break e;case lh:o=16,r=null;break e}throw Error(Ve(130,e==null?e:typeof e,""))}return t=bl(o,n,t,s),t.elementType=e,t.type=r,t.lanes=i,t}function Sv(e,t,n,r){return e=bl(7,e,r,t),e.lanes=n,e}function Jk(e,t,n,r){return e=bl(22,e,r,t),e.elementType=HX,e.lanes=n,e.stateNode={isHidden:!1},e}function L3(e,t,n){return e=bl(6,e,null,t),e.lanes=n,e}function j3(e,t,n){return t=bl(4,e.children!==null?e.children:[],e.key,t),t.lanes=n,t.stateNode={containerInfo:e.containerInfo,pendingChildren:null,implementation:e.implementation},t}function pve(e,t,n,r,s){this.tag=t,this.containerInfo=e,this.finishedWork=this.pingCache=this.current=this.pendingChildren=null,this.timeoutHandle=-1,this.callbackNode=this.pendingContext=this.context=null,this.callbackPriority=0,this.eventTimes=v3(0),this.expirationTimes=v3(-1),this.entangledLanes=this.finishedLanes=this.mutableReadLanes=this.expiredLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=v3(0),this.identifierPrefix=r,this.onRecoverableError=s,this.mutableSourceEagerHydrationData=null}function mH(e,t,n,r,s,i,o,a,c){return e=new pve(e,t,n,a,c),t===1?(t=1,i===!0&&(t|=8)):t=0,i=bl(3,null,null,t),e.current=i,i.stateNode=e,i.memoizedState={element:r,isDehydrated:n,cache:null,transitions:null,pendingSuspenseBoundaries:null},ZV(i),e}function mve(e,t,n){var r=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:sb,key:r==null?null:""+r,children:e,containerInfo:t,implementation:n}}function IZ(e){if(!e)return hp;e=e._reactInternals;e:{if(iy(e)!==e||e.tag!==1)throw Error(Ve(170));var t=e;do{switch(t.tag){case 3:t=t.stateNode.context;break e;case 1:if(na(t.type)){t=t.stateNode.__reactInternalMemoizedMergedChildContext;break e}}t=t.return}while(t!==null);throw Error(Ve(171))}if(e.tag===1){var n=e.type;if(na(n))return IQ(e,n,t)}return t}function LZ(e,t,n,r,s,i,o,a,c){return e=mH(n,r,!0,e,s,i,o,a,c),e.context=IZ(null),n=e.current,r=To(),s=op(n),i=Sf(r,s),i.callback=t??null,sp(n,i,s),e.current.lanes=s,RA(e,s,r),ra(e,r),e}function eD(e,t,n,r){var s=t.current,i=To(),o=op(s);return n=IZ(n),t.context===null?t.context=n:t.pendingContext=n,t=Sf(i,o),t.payload={element:e},r=r===void 0?null:r,r!==null&&(t.callback=r),e=sp(s,t,o),e!==null&&(xc(e,s,o,i),UP(e,s,o)),o}function uT(e){if(e=e.current,!e.child)return null;switch(e.child.tag){case 5:return e.child.stateNode;default:return e.child.stateNode}}function gG(e,t){if(e=e.memoizedState,e!==null&&e.dehydrated!==null){var n=e.retryLane;e.retryLane=n!==0&&n<t?n:t}}function gH(e,t){gG(e,t),(e=e.alternate)&&gG(e,t)}function gve(){return null}var jZ=typeof reportError=="function"?reportError:function(e){console.error(e)};function vH(e){this._internalRoot=e}tD.prototype.render=vH.prototype.render=function(e){var t=this._internalRoot;if(t===null)throw Error(Ve(409));eD(e,t,null,null)};tD.prototype.unmount=vH.prototype.unmount=function(){var e=this._internalRoot;if(e!==null){this._internalRoot=null;var t=e.containerInfo;Iv(function(){eD(null,e,null,null)}),t[Of]=null}};function tD(e){this._internalRoot=e}tD.prototype.unstable_scheduleHydration=function(e){if(e){var t=pQ();e={blockedOn:null,target:e,priority:t};for(var n=0;n<ph.length&&t!==0&&t<ph[n].priority;n++);ph.splice(n,0,e),n===0&&gQ(e)}};function yH(e){return!(!e||e.nodeType!==1&&e.nodeType!==9&&e.nodeType!==11)}function nD(e){return!(!e||e.nodeType!==1&&e.nodeType!==9&&e.nodeType!==11&&(e.nodeType!==8||e.nodeValue!==" react-mount-point-unstable "))}function vG(){}function vve(e,t,n,r,s){if(s){if(typeof r=="function"){var i=r;r=function(){var d=uT(o);i.call(d)}}var o=LZ(t,r,e,0,null,!1,!1,"",vG);return e._reactRootContainer=o,e[Of]=o.current,aC(e.nodeType===8?e.parentNode:e),Iv(),o}for(;s=e.lastChild;)e.removeChild(s);if(typeof r=="function"){var a=r;r=function(){var d=uT(c);a.call(d)}}var c=mH(e,0,!1,null,null,!1,!1,"",vG);return e._reactRootContainer=c,e[Of]=c.current,aC(e.nodeType===8?e.parentNode:e),Iv(function(){eD(t,c,n,r)}),c}function rD(e,t,n,r,s){var i=n._reactRootContainer;if(i){var o=i;if(typeof s=="function"){var a=s;s=function(){var c=uT(o);a.call(c)}}eD(t,o,e,s)}else o=vve(n,t,e,s,r);return uT(o)}fQ=function(e){switch(e.tag){case 3:var t=e.stateNode;if(t.current.memoizedState.isDehydrated){var n=i1(t.pendingLanes);n!==0&&(jV(t,n|1),ra(t,_s()),!(Rn&6)&&(rx=_s()+500,Rp()))}break;case 13:Iv(function(){var r=Mf(e,1);if(r!==null){var s=To();xc(r,e,1,s)}}),gH(e,1)}};$V=function(e){if(e.tag===13){var t=Mf(e,134217728);if(t!==null){var n=To();xc(t,e,134217728,n)}gH(e,134217728)}};hQ=function(e){if(e.tag===13){var t=op(e),n=Mf(e,t);if(n!==null){var r=To();xc(n,e,t,r)}gH(e,t)}};pQ=function(){return rr};mQ=function(e,t){var n=rr;try{return rr=e,t()}finally{rr=n}};Bz=function(e,t,n){switch(t){case"input":if(Mz(e,n),t=n.name,n.type==="radio"&&t!=null){for(n=e;n.parentNode;)n=n.parentNode;for(n=n.querySelectorAll("input[name="+JSON.stringify(""+t)+'][type="radio"]'),t=0;t<n.length;t++){var r=n[t];if(r!==e&&r.form===e.form){var s=Gk(r);if(!s)throw Error(Ve(90));qX(r),Mz(r,s)}}}break;case"textarea":KX(e,n);break;case"select":t=n.value,t!=null&&xb(e,!!n.multiple,t,!1)}};tQ=dH;nQ=Iv;var yve={usingClientEntryPoint:!1,Events:[NA,cb,Gk,JX,eQ,dH]},DS={findFiberByHostInstance:cg,bundleType:0,version:"18.3.1",rendererPackageName:"react-dom"},bve={bundleType:DS.bundleType,version:DS.version,rendererPackageName:DS.rendererPackageName,rendererConfig:DS.rendererConfig,overrideHookState:null,overrideHookStateDeletePath:null,overrideHookStateRenamePath:null,overrideProps:null,overridePropsDeletePath:null,overridePropsRenamePath:null,setErrorHandler:null,setSuspenseHandler:null,scheduleUpdate:null,currentDispatcherRef:Bf.ReactCurrentDispatcher,findHostInstanceByFiber:function(e){return e=iQ(e),e===null?null:e.stateNode},findFiberByHostInstance:DS.findFiberByHostInstance||gve,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 GR=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!GR.isDisabled&&GR.supportsFiber)try{Vk=GR.inject(bve),_u=GR}catch{}}el.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED=yve;el.createPortal=function(e,t){var n=2<arguments.length&&arguments[2]!==void 0?arguments[2]:null;if(!yH(t))throw Error(Ve(200));return mve(e,t,null,n)};el.createRoot=function(e,t){if(!yH(e))throw Error(Ve(299));var n=!1,r="",s=jZ;return t!=null&&(t.unstable_strictMode===!0&&(n=!0),t.identifierPrefix!==void 0&&(r=t.identifierPrefix),t.onRecoverableError!==void 0&&(s=t.onRecoverableError)),t=mH(e,1,!1,null,null,n,!1,r,s),e[Of]=t.current,aC(e.nodeType===8?e.parentNode:e),new vH(t)};el.findDOMNode=function(e){if(e==null)return null;if(e.nodeType===1)return e;var t=e._reactInternals;if(t===void 0)throw typeof e.render=="function"?Error(Ve(188)):(e=Object.keys(e).join(","),Error(Ve(268,e)));return e=iQ(t),e=e===null?null:e.stateNode,e};el.flushSync=function(e){return Iv(e)};el.hydrate=function(e,t,n){if(!nD(t))throw Error(Ve(200));return rD(null,e,t,!0,n)};el.hydrateRoot=function(e,t,n){if(!yH(e))throw Error(Ve(405));var r=n!=null&&n.hydratedSources||null,s=!1,i="",o=jZ;if(n!=null&&(n.unstable_strictMode===!0&&(s=!0),n.identifierPrefix!==void 0&&(i=n.identifierPrefix),n.onRecoverableError!==void 0&&(o=n.onRecoverableError)),t=LZ(t,null,e,1,n??null,s,!1,i,o),e[Of]=t.current,aC(e),r)for(e=0;e<r.length;e++)n=r[e],s=n._getVersion,s=s(n._source),t.mutableSourceEagerHydrationData==null?t.mutableSourceEagerHydrationData=[n,s]:t.mutableSourceEagerHydrationData.push(n,s);return new tD(t)};el.render=function(e,t,n){if(!nD(t))throw Error(Ve(200));return rD(null,e,t,!1,n)};el.unmountComponentAtNode=function(e){if(!nD(e))throw Error(Ve(40));return e._reactRootContainer?(Iv(function(){rD(null,null,e,!1,function(){e._reactRootContainer=null,e[Of]=null})}),!0):!1};el.unstable_batchedUpdates=dH;el.unstable_renderSubtreeIntoContainer=function(e,t,n,r){if(!nD(n))throw Error(Ve(200));if(e==null||e._reactInternals===void 0)throw Error(Ve(38));return rD(e,t,n,!1,r)};el.version="18.3.1-next-f1338f8080-20240426";function $Z(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE($Z)}catch(e){console.error(e)}}$Z(),$X.exports=el;var Li=$X.exports;const kA=Al(Li),xve=AX({__proto__:null,default:kA},[Li]);var yG=Li;Rz.createRoot=yG.createRoot,Rz.hydrateRoot=yG.hydrateRoot;const FZ=C.createContext({}),_ve=({children:e,authActions:t})=>{const n=i=>{var o;try{return Promise.resolve((o=t.login)==null?void 0:o.call(t,i))}catch(a){return console.error(a),Promise.reject(a)}},r=i=>{var o;try{return Promise.resolve((o=t.logout)==null?void 0:o.call(t,i))}catch(a){return console.error(a),Promise.reject(a)}},s=async()=>{var i;try{return Promise.resolve((i=t.check)==null?void 0:i.call(t))}catch(o){return console.error(o),Promise.reject(o)}};return _.jsx(FZ.Provider,{value:{...t,login:n,logout:r,check:s},children:e})},sD=()=>{const e=C.useContext(FZ);if(e===null)throw new Error("useAuth must be used within a AuthProvider");return e};var Px=class{constructor(){this.listeners=new Set,this.subscribe=this.subscribe.bind(this)}subscribe(e){return this.listeners.add(e),this.onSubscribe(),()=>{this.listeners.delete(e),this.onUnsubscribe()}}hasListeners(){return this.listeners.size>0}onSubscribe(){}onUnsubscribe(){}},Lv=typeof window>"u"||"Deno"in globalThis;function cl(){}function wve(e,t){return typeof e=="function"?e(t):e}function xB(e){return typeof e=="number"&&e>=0&&e!==1/0}function zZ(e,t){return Math.max(e+(t||0)-Date.now(),0)}function Ab(e,t){return typeof e=="function"?e(t):e}function pc(e,t){return typeof e=="function"?e(t):e}function bG(e,t){const{type:n="all",exact:r,fetchStatus:s,predicate:i,queryKey:o,stale:a}=e;if(o){if(r){if(t.queryHash!==bH(o,t.options))return!1}else if(!gC(t.queryKey,o))return!1}if(n!=="all"){const c=t.isActive();if(n==="active"&&!c||n==="inactive"&&c)return!1}return!(typeof a=="boolean"&&t.isStale()!==a||s&&s!==t.state.fetchStatus||i&&!i(t))}function xG(e,t){const{exact:n,status:r,predicate:s,mutationKey:i}=e;if(i){if(!t.options.mutationKey)return!1;if(n){if(jv(t.options.mutationKey)!==jv(i))return!1}else if(!gC(t.options.mutationKey,i))return!1}return!(r&&t.state.status!==r||s&&!s(t))}function bH(e,t){return((t==null?void 0:t.queryKeyHashFn)||jv)(e)}function jv(e){return JSON.stringify(e,(t,n)=>_B(n)?Object.keys(n).sort().reduce((r,s)=>(r[s]=n[s],r),{}):n)}function gC(e,t){return e===t?!0:typeof e!=typeof t?!1:e&&t&&typeof e=="object"&&typeof t=="object"?Object.keys(t).every(n=>gC(e[n],t[n])):!1}function BZ(e,t){if(e===t)return e;const n=_G(e)&&_G(t);if(n||_B(e)&&_B(t)){const r=n?e:Object.keys(e),s=r.length,i=n?t:Object.keys(t),o=i.length,a=n?[]:{};let c=0;for(let d=0;d<o;d++){const h=n?d:i[d];(!n&&r.includes(h)||n)&&e[h]===void 0&&t[h]===void 0?(a[h]=void 0,c++):(a[h]=BZ(e[h],t[h]),a[h]===e[h]&&e[h]!==void 0&&c++)}return s===o&&c===s?e:a}return t}function dT(e,t){if(!t||Object.keys(e).length!==Object.keys(t).length)return!1;for(const n in e)if(e[n]!==t[n])return!1;return!0}function _G(e){return Array.isArray(e)&&e.length===Object.keys(e).length}function _B(e){if(!wG(e))return!1;const t=e.constructor;if(t===void 0)return!0;const n=t.prototype;return!(!wG(n)||!n.hasOwnProperty("isPrototypeOf")||Object.getPrototypeOf(e)!==Object.prototype)}function wG(e){return Object.prototype.toString.call(e)==="[object Object]"}function Sve(e){return new Promise(t=>{setTimeout(t,e)})}function wB(e,t,n){return typeof n.structuralSharing=="function"?n.structuralSharing(e,t):n.structuralSharing!==!1?BZ(e,t):t}function UZ(e){return e}function Cve(e,t,n=0){const r=[...e,t];return n&&r.length>n?r.slice(1):r}function Eve(e,t,n=0){const r=[t,...e];return n&&r.length>n?r.slice(0,-1):r}var xH=Symbol();function VZ(e,t){return!e.queryFn&&(t!=null&&t.initialPromise)?()=>t.initialPromise:!e.queryFn||e.queryFn===xH?()=>Promise.reject(new Error(`Missing queryFn: '${e.queryHash}'`)):e.queryFn}var bg,xh,Vb,pX,Ave=(pX=class extends Px{constructor(){super();G(this,bg);G(this,xh);G(this,Vb);V(this,Vb,t=>{if(!Lv&&window.addEventListener){const n=()=>t();return window.addEventListener("visibilitychange",n,!1),()=>{window.removeEventListener("visibilitychange",n)}}})}onSubscribe(){P(this,xh)||this.setEventListener(P(this,Vb))}onUnsubscribe(){var t;this.hasListeners()||((t=P(this,xh))==null||t.call(this),V(this,xh,void 0))}setEventListener(t){var n;V(this,Vb,t),(n=P(this,xh))==null||n.call(this),V(this,xh,t(r=>{typeof r=="boolean"?this.setFocused(r):this.onFocus()}))}setFocused(t){P(this,bg)!==t&&(V(this,bg,t),this.onFocus())}onFocus(){const t=this.isFocused();this.listeners.forEach(n=>{n(t)})}isFocused(){var t;return typeof P(this,bg)=="boolean"?P(this,bg):((t=globalThis.document)==null?void 0:t.visibilityState)!=="hidden"}},bg=new WeakMap,xh=new WeakMap,Vb=new WeakMap,pX),_H=new Ave,Hb,_h,Wb,mX,Rve=(mX=class extends Px{constructor(){super();G(this,Hb,!0);G(this,_h);G(this,Wb);V(this,Wb,t=>{if(!Lv&&window.addEventListener){const n=()=>t(!0),r=()=>t(!1);return window.addEventListener("online",n,!1),window.addEventListener("offline",r,!1),()=>{window.removeEventListener("online",n),window.removeEventListener("offline",r)}}})}onSubscribe(){P(this,_h)||this.setEventListener(P(this,Wb))}onUnsubscribe(){var t;this.hasListeners()||((t=P(this,_h))==null||t.call(this),V(this,_h,void 0))}setEventListener(t){var n;V(this,Wb,t),(n=P(this,_h))==null||n.call(this),V(this,_h,t(this.setOnline.bind(this)))}setOnline(t){P(this,Hb)!==t&&(V(this,Hb,t),this.listeners.forEach(r=>{r(t)}))}isOnline(){return P(this,Hb)}},Hb=new WeakMap,_h=new WeakMap,Wb=new WeakMap,mX),fT=new Rve;function SB(){let e,t;const n=new Promise((s,i)=>{e=s,t=i});n.status="pending",n.catch(()=>{});function r(s){Object.assign(n,s),delete n.resolve,delete n.reject}return n.resolve=s=>{r({status:"fulfilled",value:s}),e(s)},n.reject=s=>{r({status:"rejected",reason:s}),t(s)},n}function Pve(e){return Math.min(1e3*2**e,3e4)}function HZ(e){return(e??"online")==="online"?fT.isOnline():!0}var WZ=class extends Error{constructor(e){super("CancelledError"),this.revert=e==null?void 0:e.revert,this.silent=e==null?void 0:e.silent}};function $3(e){return e instanceof WZ}function qZ(e){let t=!1,n=0,r=!1,s;const i=SB(),o=m=>{var x;r||(f(new WZ(m)),(x=e.abort)==null||x.call(e))},a=()=>{t=!0},c=()=>{t=!1},d=()=>_H.isFocused()&&(e.networkMode==="always"||fT.isOnline())&&e.canRun(),h=()=>HZ(e.networkMode)&&e.canRun(),u=m=>{var x;r||(r=!0,(x=e.onSuccess)==null||x.call(e,m),s==null||s(),i.resolve(m))},f=m=>{var x;r||(r=!0,(x=e.onError)==null||x.call(e,m),s==null||s(),i.reject(m))},g=()=>new Promise(m=>{var x;s=y=>{(r||d())&&m(y)},(x=e.onPause)==null||x.call(e)}).then(()=>{var m;s=void 0,r||(m=e.onContinue)==null||m.call(e)}),v=()=>{if(r)return;let m;const x=n===0?e.initialPromise:void 0;try{m=x??e.fn()}catch(y){m=Promise.reject(y)}Promise.resolve(m).then(u).catch(y=>{var T;if(r)return;const b=e.retry??(Lv?0:3),w=e.retryDelay??Pve,E=typeof w=="function"?w(n,y):w,R=b===!0||typeof b=="number"&&n<b||typeof b=="function"&&b(n,y);if(t||!R){f(y);return}n++,(T=e.onFail)==null||T.call(e,n,y),Sve(E).then(()=>d()?void 0:g()).then(()=>{t?f(y):v()})})};return{promise:i,cancel:o,continue:()=>(s==null||s(),i),cancelRetry:a,continueRetry:c,canStart:h,start:()=>(h()?v():g().then(v),i)}}var Nve=e=>setTimeout(e,0);function Tve(){let e=[],t=0,n=a=>{a()},r=a=>{a()},s=Nve;const i=a=>{t?e.push(a):s(()=>{n(a)})},o=()=>{const a=e;e=[],a.length&&s(()=>{r(()=>{a.forEach(c=>{n(c)})})})};return{batch:a=>{let c;t++;try{c=a()}finally{t--,t||o()}return c},batchCalls:a=>(...c)=>{i(()=>{a(...c)})},schedule:i,setNotifyFunction:a=>{n=a},setBatchNotifyFunction:a=>{r=a},setScheduler:a=>{s=a}}}var ti=Tve(),xg,gX,GZ=(gX=class{constructor(){G(this,xg)}destroy(){this.clearGcTimeout()}scheduleGc(){this.clearGcTimeout(),xB(this.gcTime)&&V(this,xg,setTimeout(()=>{this.optionalRemove()},this.gcTime))}updateGcTime(e){this.gcTime=Math.max(this.gcTime||0,e??(Lv?1/0:5*60*1e3))}clearGcTimeout(){P(this,xg)&&(clearTimeout(P(this,xg)),V(this,xg,void 0))}},xg=new WeakMap,gX),qb,Gb,sl,_g,Xi,HC,wg,Xl,Id,vX,kve=(vX=class extends GZ{constructor(t){super();G(this,Xl);G(this,qb);G(this,Gb);G(this,sl);G(this,_g);G(this,Xi);G(this,HC);G(this,wg);V(this,wg,!1),V(this,HC,t.defaultOptions),this.setOptions(t.options),this.observers=[],V(this,_g,t.client),V(this,sl,P(this,_g).getQueryCache()),this.queryKey=t.queryKey,this.queryHash=t.queryHash,V(this,qb,Dve(this.options)),this.state=t.state??P(this,qb),this.scheduleGc()}get meta(){return this.options.meta}get promise(){var t;return(t=P(this,Xi))==null?void 0:t.promise}setOptions(t){this.options={...P(this,HC),...t},this.updateGcTime(this.options.gcTime)}optionalRemove(){!this.observers.length&&this.state.fetchStatus==="idle"&&P(this,sl).remove(this)}setData(t,n){const r=wB(this.state.data,t,this.options);return K(this,Xl,Id).call(this,{data:r,type:"success",dataUpdatedAt:n==null?void 0:n.updatedAt,manual:n==null?void 0:n.manual}),r}setState(t,n){K(this,Xl,Id).call(this,{type:"setState",state:t,setStateOptions:n})}cancel(t){var r,s;const n=(r=P(this,Xi))==null?void 0:r.promise;return(s=P(this,Xi))==null||s.cancel(t),n?n.then(cl).catch(cl):Promise.resolve()}destroy(){super.destroy(),this.cancel({silent:!0})}reset(){this.destroy(),this.setState(P(this,qb))}isActive(){return this.observers.some(t=>pc(t.options.enabled,this)!==!1)}isDisabled(){return this.getObserversCount()>0?!this.isActive():this.options.queryFn===xH||this.state.dataUpdateCount+this.state.errorUpdateCount===0}isStale(){return this.state.isInvalidated?!0:this.getObserversCount()>0?this.observers.some(t=>t.getCurrentResult().isStale):this.state.data===void 0}isStaleByTime(t=0){return this.state.isInvalidated||this.state.data===void 0||!zZ(this.state.dataUpdatedAt,t)}onFocus(){var n;const t=this.observers.find(r=>r.shouldFetchOnWindowFocus());t==null||t.refetch({cancelRefetch:!1}),(n=P(this,Xi))==null||n.continue()}onOnline(){var n;const t=this.observers.find(r=>r.shouldFetchOnReconnect());t==null||t.refetch({cancelRefetch:!1}),(n=P(this,Xi))==null||n.continue()}addObserver(t){this.observers.includes(t)||(this.observers.push(t),this.clearGcTimeout(),P(this,sl).notify({type:"observerAdded",query:this,observer:t}))}removeObserver(t){this.observers.includes(t)&&(this.observers=this.observers.filter(n=>n!==t),this.observers.length||(P(this,Xi)&&(P(this,wg)?P(this,Xi).cancel({revert:!0}):P(this,Xi).cancelRetry()),this.scheduleGc()),P(this,sl).notify({type:"observerRemoved",query:this,observer:t}))}getObserversCount(){return this.observers.length}invalidate(){this.state.isInvalidated||K(this,Xl,Id).call(this,{type:"invalidate"})}fetch(t,n){var c,d,h;if(this.state.fetchStatus!=="idle"){if(this.state.data!==void 0&&(n!=null&&n.cancelRefetch))this.cancel({silent:!0});else if(P(this,Xi))return P(this,Xi).continueRetry(),P(this,Xi).promise}if(t&&this.setOptions(t),!this.options.queryFn){const u=this.observers.find(f=>f.options.queryFn);u&&this.setOptions(u.options)}const r=new AbortController,s=u=>{Object.defineProperty(u,"signal",{enumerable:!0,get:()=>(V(this,wg,!0),r.signal)})},i=()=>{const u=VZ(this.options,n),f={client:P(this,_g),queryKey:this.queryKey,meta:this.meta};return s(f),V(this,wg,!1),this.options.persister?this.options.persister(u,f,this):u(f)},o={fetchOptions:n,options:this.options,queryKey:this.queryKey,client:P(this,_g),state:this.state,fetchFn:i};s(o),(c=this.options.behavior)==null||c.onFetch(o,this),V(this,Gb,this.state),(this.state.fetchStatus==="idle"||this.state.fetchMeta!==((d=o.fetchOptions)==null?void 0:d.meta))&&K(this,Xl,Id).call(this,{type:"fetch",meta:(h=o.fetchOptions)==null?void 0:h.meta});const a=u=>{var f,g,v,m;$3(u)&&u.silent||K(this,Xl,Id).call(this,{type:"error",error:u}),$3(u)||((g=(f=P(this,sl).config).onError)==null||g.call(f,u,this),(m=(v=P(this,sl).config).onSettled)==null||m.call(v,this.state.data,u,this)),this.scheduleGc()};return V(this,Xi,qZ({initialPromise:n==null?void 0:n.initialPromise,fn:o.fetchFn,abort:r.abort.bind(r),onSuccess:u=>{var f,g,v,m;if(u===void 0){a(new Error(`${this.queryHash} data is undefined`));return}try{this.setData(u)}catch(x){a(x);return}(g=(f=P(this,sl).config).onSuccess)==null||g.call(f,u,this),(m=(v=P(this,sl).config).onSettled)==null||m.call(v,u,this.state.error,this),this.scheduleGc()},onError:a,onFail:(u,f)=>{K(this,Xl,Id).call(this,{type:"failed",failureCount:u,error:f})},onPause:()=>{K(this,Xl,Id).call(this,{type:"pause"})},onContinue:()=>{K(this,Xl,Id).call(this,{type:"continue"})},retry:o.options.retry,retryDelay:o.options.retryDelay,networkMode:o.options.networkMode,canRun:()=>!0})),P(this,Xi).start()}},qb=new WeakMap,Gb=new WeakMap,sl=new WeakMap,_g=new WeakMap,Xi=new WeakMap,HC=new WeakMap,wg=new WeakMap,Xl=new WeakSet,Id=function(t){const n=r=>{switch(t.type){case"failed":return{...r,fetchFailureCount:t.failureCount,fetchFailureReason:t.error};case"pause":return{...r,fetchStatus:"paused"};case"continue":return{...r,fetchStatus:"fetching"};case"fetch":return{...r,...KZ(r.data,this.options),fetchMeta:t.meta??null};case"success":return{...r,data:t.data,dataUpdateCount:r.dataUpdateCount+1,dataUpdatedAt:t.dataUpdatedAt??Date.now(),error:null,isInvalidated:!1,status:"success",...!t.manual&&{fetchStatus:"idle",fetchFailureCount:0,fetchFailureReason:null}};case"error":const s=t.error;return $3(s)&&s.revert&&P(this,Gb)?{...P(this,Gb),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,...t.state}}};this.state=n(this.state),ti.batch(()=>{this.observers.forEach(r=>{r.onQueryUpdate()}),P(this,sl).notify({query:this,type:"updated",action:t})})},vX);function KZ(e,t){return{fetchFailureCount:0,fetchFailureReason:null,fetchStatus:HZ(t.networkMode)?"fetching":"paused",...e===void 0&&{error:null,status:"pending"}}}function Dve(e){const t=typeof e.initialData=="function"?e.initialData():e.initialData,n=t!==void 0,r=n?typeof e.initialDataUpdatedAt=="function"?e.initialDataUpdatedAt():e.initialDataUpdatedAt:0;return{data:t,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 Wc,yX,Ove=(yX=class extends Px{constructor(t={}){super();G(this,Wc);this.config=t,V(this,Wc,new Map)}build(t,n,r){const s=n.queryKey,i=n.queryHash??bH(s,n);let o=this.get(i);return o||(o=new kve({client:t,queryKey:s,queryHash:i,options:t.defaultQueryOptions(n),state:r,defaultOptions:t.getQueryDefaults(s)}),this.add(o)),o}add(t){P(this,Wc).has(t.queryHash)||(P(this,Wc).set(t.queryHash,t),this.notify({type:"added",query:t}))}remove(t){const n=P(this,Wc).get(t.queryHash);n&&(t.destroy(),n===t&&P(this,Wc).delete(t.queryHash),this.notify({type:"removed",query:t}))}clear(){ti.batch(()=>{this.getAll().forEach(t=>{this.remove(t)})})}get(t){return P(this,Wc).get(t)}getAll(){return[...P(this,Wc).values()]}find(t){const n={exact:!0,...t};return this.getAll().find(r=>bG(n,r))}findAll(t={}){const n=this.getAll();return Object.keys(t).length>0?n.filter(r=>bG(t,r)):n}notify(t){ti.batch(()=>{this.listeners.forEach(n=>{n(t)})})}onFocus(){ti.batch(()=>{this.getAll().forEach(t=>{t.onFocus()})})}onOnline(){ti.batch(()=>{this.getAll().forEach(t=>{t.onOnline()})})}},Wc=new WeakMap,yX),qc,yo,Sg,Gc,eh,bX,Mve=(bX=class extends GZ{constructor(t){super();G(this,Gc);G(this,qc);G(this,yo);G(this,Sg);this.mutationId=t.mutationId,V(this,yo,t.mutationCache),V(this,qc,[]),this.state=t.state||YZ(),this.setOptions(t.options),this.scheduleGc()}setOptions(t){this.options=t,this.updateGcTime(this.options.gcTime)}get meta(){return this.options.meta}addObserver(t){P(this,qc).includes(t)||(P(this,qc).push(t),this.clearGcTimeout(),P(this,yo).notify({type:"observerAdded",mutation:this,observer:t}))}removeObserver(t){V(this,qc,P(this,qc).filter(n=>n!==t)),this.scheduleGc(),P(this,yo).notify({type:"observerRemoved",mutation:this,observer:t})}optionalRemove(){P(this,qc).length||(this.state.status==="pending"?this.scheduleGc():P(this,yo).remove(this))}continue(){var t;return((t=P(this,Sg))==null?void 0:t.continue())??this.execute(this.state.variables)}async execute(t){var s,i,o,a,c,d,h,u,f,g,v,m,x,y,b,w,E,R,T,N;V(this,Sg,qZ({fn:()=>this.options.mutationFn?this.options.mutationFn(t):Promise.reject(new Error("No mutationFn found")),onFail:(A,D)=>{K(this,Gc,eh).call(this,{type:"failed",failureCount:A,error:D})},onPause:()=>{K(this,Gc,eh).call(this,{type:"pause"})},onContinue:()=>{K(this,Gc,eh).call(this,{type:"continue"})},retry:this.options.retry??0,retryDelay:this.options.retryDelay,networkMode:this.options.networkMode,canRun:()=>P(this,yo).canRun(this)}));const n=this.state.status==="pending",r=!P(this,Sg).canStart();try{if(!n){K(this,Gc,eh).call(this,{type:"pending",variables:t,isPaused:r}),await((i=(s=P(this,yo).config).onMutate)==null?void 0:i.call(s,t,this));const D=await((a=(o=this.options).onMutate)==null?void 0:a.call(o,t));D!==this.state.context&&K(this,Gc,eh).call(this,{type:"pending",context:D,variables:t,isPaused:r})}const A=await P(this,Sg).start();return await((d=(c=P(this,yo).config).onSuccess)==null?void 0:d.call(c,A,t,this.state.context,this)),await((u=(h=this.options).onSuccess)==null?void 0:u.call(h,A,t,this.state.context)),await((g=(f=P(this,yo).config).onSettled)==null?void 0:g.call(f,A,null,this.state.variables,this.state.context,this)),await((m=(v=this.options).onSettled)==null?void 0:m.call(v,A,null,t,this.state.context)),K(this,Gc,eh).call(this,{type:"success",data:A}),A}catch(A){try{throw await((y=(x=P(this,yo).config).onError)==null?void 0:y.call(x,A,t,this.state.context,this)),await((w=(b=this.options).onError)==null?void 0:w.call(b,A,t,this.state.context)),await((R=(E=P(this,yo).config).onSettled)==null?void 0:R.call(E,void 0,A,this.state.variables,this.state.context,this)),await((N=(T=this.options).onSettled)==null?void 0:N.call(T,void 0,A,t,this.state.context)),A}finally{K(this,Gc,eh).call(this,{type:"error",error:A})}}finally{P(this,yo).runNext(this)}}},qc=new WeakMap,yo=new WeakMap,Sg=new WeakMap,Gc=new WeakSet,eh=function(t){const n=r=>{switch(t.type){case"failed":return{...r,failureCount:t.failureCount,failureReason:t.error};case"pause":return{...r,isPaused:!0};case"continue":return{...r,isPaused:!1};case"pending":return{...r,context:t.context,data:void 0,failureCount:0,failureReason:null,error:null,isPaused:t.isPaused,status:"pending",variables:t.variables,submittedAt:Date.now()};case"success":return{...r,data:t.data,failureCount:0,failureReason:null,error:null,status:"success",isPaused:!1};case"error":return{...r,data:void 0,error:t.error,failureCount:r.failureCount+1,failureReason:t.error,isPaused:!1,status:"error"}}};this.state=n(this.state),ti.batch(()=>{P(this,qc).forEach(r=>{r.onMutationUpdate(t)}),P(this,yo).notify({mutation:this,type:"updated",action:t})})},bX);function YZ(){return{context:void 0,data:void 0,error:null,failureCount:0,failureReason:null,isPaused:!1,status:"idle",variables:void 0,submittedAt:0}}var Wd,Ql,WC,xX,Ive=(xX=class extends Px{constructor(t={}){super();G(this,Wd);G(this,Ql);G(this,WC);this.config=t,V(this,Wd,new Set),V(this,Ql,new Map),V(this,WC,0)}build(t,n,r){const s=new Mve({mutationCache:this,mutationId:++Ui(this,WC)._,options:t.defaultMutationOptions(n),state:r});return this.add(s),s}add(t){P(this,Wd).add(t);const n=KR(t);if(typeof n=="string"){const r=P(this,Ql).get(n);r?r.push(t):P(this,Ql).set(n,[t])}this.notify({type:"added",mutation:t})}remove(t){if(P(this,Wd).delete(t)){const n=KR(t);if(typeof n=="string"){const r=P(this,Ql).get(n);if(r)if(r.length>1){const s=r.indexOf(t);s!==-1&&r.splice(s,1)}else r[0]===t&&P(this,Ql).delete(n)}}this.notify({type:"removed",mutation:t})}canRun(t){const n=KR(t);if(typeof n=="string"){const r=P(this,Ql).get(n),s=r==null?void 0:r.find(i=>i.state.status==="pending");return!s||s===t}else return!0}runNext(t){var r;const n=KR(t);if(typeof n=="string"){const s=(r=P(this,Ql).get(n))==null?void 0:r.find(i=>i!==t&&i.state.isPaused);return(s==null?void 0:s.continue())??Promise.resolve()}else return Promise.resolve()}clear(){ti.batch(()=>{P(this,Wd).forEach(t=>{this.notify({type:"removed",mutation:t})}),P(this,Wd).clear(),P(this,Ql).clear()})}getAll(){return Array.from(P(this,Wd))}find(t){const n={exact:!0,...t};return this.getAll().find(r=>xG(n,r))}findAll(t={}){return this.getAll().filter(n=>xG(t,n))}notify(t){ti.batch(()=>{this.listeners.forEach(n=>{n(t)})})}resumePausedMutations(){const t=this.getAll().filter(n=>n.state.isPaused);return ti.batch(()=>Promise.all(t.map(n=>n.continue().catch(cl))))}},Wd=new WeakMap,Ql=new WeakMap,WC=new WeakMap,xX);function KR(e){var t;return(t=e.options.scope)==null?void 0:t.id}function SG(e){return{onFetch:(t,n)=>{var h,u,f,g,v;const r=t.options,s=(f=(u=(h=t.fetchOptions)==null?void 0:h.meta)==null?void 0:u.fetchMore)==null?void 0:f.direction,i=((g=t.state.data)==null?void 0:g.pages)||[],o=((v=t.state.data)==null?void 0:v.pageParams)||[];let a={pages:[],pageParams:[]},c=0;const d=async()=>{let m=!1;const x=w=>{Object.defineProperty(w,"signal",{enumerable:!0,get:()=>(t.signal.aborted?m=!0:t.signal.addEventListener("abort",()=>{m=!0}),t.signal)})},y=VZ(t.options,t.fetchOptions),b=async(w,E,R)=>{if(m)return Promise.reject();if(E==null&&w.pages.length)return Promise.resolve(w);const T={client:t.client,queryKey:t.queryKey,pageParam:E,direction:R?"backward":"forward",meta:t.options.meta};x(T);const N=await y(T),{maxPages:A}=t.options,D=R?Eve:Cve;return{pages:D(w.pages,N,A),pageParams:D(w.pageParams,E,A)}};if(s&&i.length){const w=s==="backward",E=w?Lve:CG,R={pages:i,pageParams:o},T=E(r,R);a=await b(R,T,w)}else{const w=e??i.length;do{const E=c===0?o[0]??r.initialPageParam:CG(r,a);if(c>0&&E==null)break;a=await b(a,E),c++}while(c<w)}return a};t.options.persister?t.fetchFn=()=>{var m,x;return(x=(m=t.options).persister)==null?void 0:x.call(m,d,{client:t.client,queryKey:t.queryKey,meta:t.options.meta,signal:t.signal},n)}:t.fetchFn=d}}}function CG(e,{pages:t,pageParams:n}){const r=t.length-1;return t.length>0?e.getNextPageParam(t[r],t,n[r],n):void 0}function Lve(e,{pages:t,pageParams:n}){var r;return t.length>0?(r=e.getPreviousPageParam)==null?void 0:r.call(e,t[0],t,n[0],n):void 0}var cs,wh,Sh,Kb,Yb,Ch,Xb,Qb,_X,jve=(_X=class{constructor(e={}){G(this,cs);G(this,wh);G(this,Sh);G(this,Kb);G(this,Yb);G(this,Ch);G(this,Xb);G(this,Qb);V(this,cs,e.queryCache||new Ove),V(this,wh,e.mutationCache||new Ive),V(this,Sh,e.defaultOptions||{}),V(this,Kb,new Map),V(this,Yb,new Map),V(this,Ch,0)}mount(){Ui(this,Ch)._++,P(this,Ch)===1&&(V(this,Xb,_H.subscribe(async e=>{e&&(await this.resumePausedMutations(),P(this,cs).onFocus())})),V(this,Qb,fT.subscribe(async e=>{e&&(await this.resumePausedMutations(),P(this,cs).onOnline())})))}unmount(){var e,t;Ui(this,Ch)._--,P(this,Ch)===0&&((e=P(this,Xb))==null||e.call(this),V(this,Xb,void 0),(t=P(this,Qb))==null||t.call(this),V(this,Qb,void 0))}isFetching(e){return P(this,cs).findAll({...e,fetchStatus:"fetching"}).length}isMutating(e){return P(this,wh).findAll({...e,status:"pending"}).length}getQueryData(e){var n;const t=this.defaultQueryOptions({queryKey:e});return(n=P(this,cs).get(t.queryHash))==null?void 0:n.state.data}ensureQueryData(e){const t=this.defaultQueryOptions(e),n=P(this,cs).build(this,t),r=n.state.data;return r===void 0?this.fetchQuery(e):(e.revalidateIfStale&&n.isStaleByTime(Ab(t.staleTime,n))&&this.prefetchQuery(t),Promise.resolve(r))}getQueriesData(e){return P(this,cs).findAll(e).map(({queryKey:t,state:n})=>{const r=n.data;return[t,r]})}setQueryData(e,t,n){const r=this.defaultQueryOptions({queryKey:e}),s=P(this,cs).get(r.queryHash),i=s==null?void 0:s.state.data,o=wve(t,i);if(o!==void 0)return P(this,cs).build(this,r).setData(o,{...n,manual:!0})}setQueriesData(e,t,n){return ti.batch(()=>P(this,cs).findAll(e).map(({queryKey:r})=>[r,this.setQueryData(r,t,n)]))}getQueryState(e){var n;const t=this.defaultQueryOptions({queryKey:e});return(n=P(this,cs).get(t.queryHash))==null?void 0:n.state}removeQueries(e){const t=P(this,cs);ti.batch(()=>{t.findAll(e).forEach(n=>{t.remove(n)})})}resetQueries(e,t){const n=P(this,cs);return ti.batch(()=>(n.findAll(e).forEach(r=>{r.reset()}),this.refetchQueries({type:"active",...e},t)))}cancelQueries(e,t={}){const n={revert:!0,...t},r=ti.batch(()=>P(this,cs).findAll(e).map(s=>s.cancel(n)));return Promise.all(r).then(cl).catch(cl)}invalidateQueries(e,t={}){return ti.batch(()=>(P(this,cs).findAll(e).forEach(n=>{n.invalidate()}),(e==null?void 0:e.refetchType)==="none"?Promise.resolve():this.refetchQueries({...e,type:(e==null?void 0:e.refetchType)??(e==null?void 0:e.type)??"active"},t)))}refetchQueries(e,t={}){const n={...t,cancelRefetch:t.cancelRefetch??!0},r=ti.batch(()=>P(this,cs).findAll(e).filter(s=>!s.isDisabled()).map(s=>{let i=s.fetch(void 0,n);return n.throwOnError||(i=i.catch(cl)),s.state.fetchStatus==="paused"?Promise.resolve():i}));return Promise.all(r).then(cl)}fetchQuery(e){const t=this.defaultQueryOptions(e);t.retry===void 0&&(t.retry=!1);const n=P(this,cs).build(this,t);return n.isStaleByTime(Ab(t.staleTime,n))?n.fetch(t):Promise.resolve(n.state.data)}prefetchQuery(e){return this.fetchQuery(e).then(cl).catch(cl)}fetchInfiniteQuery(e){return e.behavior=SG(e.pages),this.fetchQuery(e)}prefetchInfiniteQuery(e){return this.fetchInfiniteQuery(e).then(cl).catch(cl)}ensureInfiniteQueryData(e){return e.behavior=SG(e.pages),this.ensureQueryData(e)}resumePausedMutations(){return fT.isOnline()?P(this,wh).resumePausedMutations():Promise.resolve()}getQueryCache(){return P(this,cs)}getMutationCache(){return P(this,wh)}getDefaultOptions(){return P(this,Sh)}setDefaultOptions(e){V(this,Sh,e)}setQueryDefaults(e,t){P(this,Kb).set(jv(e),{queryKey:e,defaultOptions:t})}getQueryDefaults(e){const t=[...P(this,Kb).values()],n={};return t.forEach(r=>{gC(e,r.queryKey)&&Object.assign(n,r.defaultOptions)}),n}setMutationDefaults(e,t){P(this,Yb).set(jv(e),{mutationKey:e,defaultOptions:t})}getMutationDefaults(e){const t=[...P(this,Yb).values()],n={};return t.forEach(r=>{gC(e,r.mutationKey)&&Object.assign(n,r.defaultOptions)}),n}defaultQueryOptions(e){if(e._defaulted)return e;const t={...P(this,Sh).queries,...this.getQueryDefaults(e.queryKey),...e,_defaulted:!0};return t.queryHash||(t.queryHash=bH(t.queryKey,t)),t.refetchOnReconnect===void 0&&(t.refetchOnReconnect=t.networkMode!=="always"),t.throwOnError===void 0&&(t.throwOnError=!!t.suspense),!t.networkMode&&t.persister&&(t.networkMode="offlineFirst"),t.queryFn===xH&&(t.enabled=!1),t}defaultMutationOptions(e){return e!=null&&e._defaulted?e:{...P(this,Sh).mutations,...(e==null?void 0:e.mutationKey)&&this.getMutationDefaults(e.mutationKey),...e,_defaulted:!0}}clear(){P(this,cs).clear(),P(this,wh).clear()}},cs=new WeakMap,wh=new WeakMap,Sh=new WeakMap,Kb=new WeakMap,Yb=new WeakMap,Ch=new WeakMap,Xb=new WeakMap,Qb=new WeakMap,_X),Bo,vn,qC,bo,Cg,Zb,Eh,Kc,GC,Jb,e0,Eg,Ag,Ah,t0,qn,a1,CB,EB,AB,RB,PB,NB,TB,XZ,wX,$ve=(wX=class extends Px{constructor(t,n){super();G(this,qn);G(this,Bo);G(this,vn);G(this,qC);G(this,bo);G(this,Cg);G(this,Zb);G(this,Eh);G(this,Kc);G(this,GC);G(this,Jb);G(this,e0);G(this,Eg);G(this,Ag);G(this,Ah);G(this,t0,new Set);this.options=n,V(this,Bo,t),V(this,Kc,null),V(this,Eh,SB()),this.options.experimental_prefetchInRender||P(this,Eh).reject(new Error("experimental_prefetchInRender feature flag is not enabled")),this.bindMethods(),this.setOptions(n)}bindMethods(){this.refetch=this.refetch.bind(this)}onSubscribe(){this.listeners.size===1&&(P(this,vn).addObserver(this),EG(P(this,vn),this.options)?K(this,qn,a1).call(this):this.updateResult(),K(this,qn,RB).call(this))}onUnsubscribe(){this.hasListeners()||this.destroy()}shouldFetchOnReconnect(){return kB(P(this,vn),this.options,this.options.refetchOnReconnect)}shouldFetchOnWindowFocus(){return kB(P(this,vn),this.options,this.options.refetchOnWindowFocus)}destroy(){this.listeners=new Set,K(this,qn,PB).call(this),K(this,qn,NB).call(this),P(this,vn).removeObserver(this)}setOptions(t){const n=this.options,r=P(this,vn);if(this.options=P(this,Bo).defaultQueryOptions(t),this.options.enabled!==void 0&&typeof this.options.enabled!="boolean"&&typeof this.options.enabled!="function"&&typeof pc(this.options.enabled,P(this,vn))!="boolean")throw new Error("Expected enabled to be a boolean or a callback that returns a boolean");K(this,qn,TB).call(this),P(this,vn).setOptions(this.options),n._defaulted&&!dT(this.options,n)&&P(this,Bo).getQueryCache().notify({type:"observerOptionsUpdated",query:P(this,vn),observer:this});const s=this.hasListeners();s&&AG(P(this,vn),r,this.options,n)&&K(this,qn,a1).call(this),this.updateResult(),s&&(P(this,vn)!==r||pc(this.options.enabled,P(this,vn))!==pc(n.enabled,P(this,vn))||Ab(this.options.staleTime,P(this,vn))!==Ab(n.staleTime,P(this,vn)))&&K(this,qn,CB).call(this);const i=K(this,qn,EB).call(this);s&&(P(this,vn)!==r||pc(this.options.enabled,P(this,vn))!==pc(n.enabled,P(this,vn))||i!==P(this,Ah))&&K(this,qn,AB).call(this,i)}getOptimisticResult(t){const n=P(this,Bo).getQueryCache().build(P(this,Bo),t),r=this.createResult(n,t);return zve(this,r)&&(V(this,bo,r),V(this,Zb,this.options),V(this,Cg,P(this,vn).state)),r}getCurrentResult(){return P(this,bo)}trackResult(t,n){const r={};return Object.keys(t).forEach(s=>{Object.defineProperty(r,s,{configurable:!1,enumerable:!0,get:()=>(this.trackProp(s),n==null||n(s),t[s])})}),r}trackProp(t){P(this,t0).add(t)}getCurrentQuery(){return P(this,vn)}refetch({...t}={}){return this.fetch({...t})}fetchOptimistic(t){const n=P(this,Bo).defaultQueryOptions(t),r=P(this,Bo).getQueryCache().build(P(this,Bo),n);return r.fetch().then(()=>this.createResult(r,n))}fetch(t){return K(this,qn,a1).call(this,{...t,cancelRefetch:t.cancelRefetch??!0}).then(()=>(this.updateResult(),P(this,bo)))}createResult(t,n){var A;const r=P(this,vn),s=this.options,i=P(this,bo),o=P(this,Cg),a=P(this,Zb),d=t!==r?t.state:P(this,qC),{state:h}=t;let u={...h},f=!1,g;if(n._optimisticResults){const D=this.hasListeners(),O=!D&&EG(t,n),I=D&&AG(t,r,n,s);(O||I)&&(u={...u,...KZ(h.data,t.options)}),n._optimisticResults==="isRestoring"&&(u.fetchStatus="idle")}let{error:v,errorUpdatedAt:m,status:x}=u;if(n.select&&u.data!==void 0)if(i&&u.data===(o==null?void 0:o.data)&&n.select===P(this,GC))g=P(this,Jb);else try{V(this,GC,n.select),g=n.select(u.data),g=wB(i==null?void 0:i.data,g,n),V(this,Jb,g),V(this,Kc,null)}catch(D){V(this,Kc,D)}else g=u.data;if(n.placeholderData!==void 0&&g===void 0&&x==="pending"){let D;if(i!=null&&i.isPlaceholderData&&n.placeholderData===(a==null?void 0:a.placeholderData))D=i.data;else if(D=typeof n.placeholderData=="function"?n.placeholderData((A=P(this,e0))==null?void 0:A.state.data,P(this,e0)):n.placeholderData,n.select&&D!==void 0)try{D=n.select(D),V(this,Kc,null)}catch(O){V(this,Kc,O)}D!==void 0&&(x="success",g=wB(i==null?void 0:i.data,D,n),f=!0)}P(this,Kc)&&(v=P(this,Kc),g=P(this,Jb),m=Date.now(),x="error");const y=u.fetchStatus==="fetching",b=x==="pending",w=x==="error",E=b&&y,R=g!==void 0,N={status:x,fetchStatus:u.fetchStatus,isPending:b,isSuccess:x==="success",isError:w,isInitialLoading:E,isLoading:E,data:g,dataUpdatedAt:u.dataUpdatedAt,error:v,errorUpdatedAt:m,failureCount:u.fetchFailureCount,failureReason:u.fetchFailureReason,errorUpdateCount:u.errorUpdateCount,isFetched:u.dataUpdateCount>0||u.errorUpdateCount>0,isFetchedAfterMount:u.dataUpdateCount>d.dataUpdateCount||u.errorUpdateCount>d.errorUpdateCount,isFetching:y,isRefetching:y&&!b,isLoadingError:w&&!R,isPaused:u.fetchStatus==="paused",isPlaceholderData:f,isRefetchError:w&&R,isStale:wH(t,n),refetch:this.refetch,promise:P(this,Eh)};if(this.options.experimental_prefetchInRender){const D=$=>{N.status==="error"?$.reject(N.error):N.data!==void 0&&$.resolve(N.data)},O=()=>{const $=V(this,Eh,N.promise=SB());D($)},I=P(this,Eh);switch(I.status){case"pending":t.queryHash===r.queryHash&&D(I);break;case"fulfilled":(N.status==="error"||N.data!==I.value)&&O();break;case"rejected":(N.status!=="error"||N.error!==I.reason)&&O();break}}return N}updateResult(){const t=P(this,bo),n=this.createResult(P(this,vn),this.options);if(V(this,Cg,P(this,vn).state),V(this,Zb,this.options),P(this,Cg).data!==void 0&&V(this,e0,P(this,vn)),dT(n,t))return;V(this,bo,n);const r=()=>{if(!t)return!0;const{notifyOnChangeProps:s}=this.options,i=typeof s=="function"?s():s;if(i==="all"||!i&&!P(this,t0).size)return!0;const o=new Set(i??P(this,t0));return this.options.throwOnError&&o.add("error"),Object.keys(P(this,bo)).some(a=>{const c=a;return P(this,bo)[c]!==t[c]&&o.has(c)})};K(this,qn,XZ).call(this,{listeners:r()})}onQueryUpdate(){this.updateResult(),this.hasListeners()&&K(this,qn,RB).call(this)}},Bo=new WeakMap,vn=new WeakMap,qC=new WeakMap,bo=new WeakMap,Cg=new WeakMap,Zb=new WeakMap,Eh=new WeakMap,Kc=new WeakMap,GC=new WeakMap,Jb=new WeakMap,e0=new WeakMap,Eg=new WeakMap,Ag=new WeakMap,Ah=new WeakMap,t0=new WeakMap,qn=new WeakSet,a1=function(t){K(this,qn,TB).call(this);let n=P(this,vn).fetch(this.options,t);return t!=null&&t.throwOnError||(n=n.catch(cl)),n},CB=function(){K(this,qn,PB).call(this);const t=Ab(this.options.staleTime,P(this,vn));if(Lv||P(this,bo).isStale||!xB(t))return;const r=zZ(P(this,bo).dataUpdatedAt,t)+1;V(this,Eg,setTimeout(()=>{P(this,bo).isStale||this.updateResult()},r))},EB=function(){return(typeof this.options.refetchInterval=="function"?this.options.refetchInterval(P(this,vn)):this.options.refetchInterval)??!1},AB=function(t){K(this,qn,NB).call(this),V(this,Ah,t),!(Lv||pc(this.options.enabled,P(this,vn))===!1||!xB(P(this,Ah))||P(this,Ah)===0)&&V(this,Ag,setInterval(()=>{(this.options.refetchIntervalInBackground||_H.isFocused())&&K(this,qn,a1).call(this)},P(this,Ah)))},RB=function(){K(this,qn,CB).call(this),K(this,qn,AB).call(this,K(this,qn,EB).call(this))},PB=function(){P(this,Eg)&&(clearTimeout(P(this,Eg)),V(this,Eg,void 0))},NB=function(){P(this,Ag)&&(clearInterval(P(this,Ag)),V(this,Ag,void 0))},TB=function(){const t=P(this,Bo).getQueryCache().build(P(this,Bo),this.options);if(t===P(this,vn))return;const n=P(this,vn);V(this,vn,t),V(this,qC,t.state),this.hasListeners()&&(n==null||n.removeObserver(this),t.addObserver(this))},XZ=function(t){ti.batch(()=>{t.listeners&&this.listeners.forEach(n=>{n(P(this,bo))}),P(this,Bo).getQueryCache().notify({query:P(this,vn),type:"observerResultsUpdated"})})},wX);function Fve(e,t){return pc(t.enabled,e)!==!1&&e.state.data===void 0&&!(e.state.status==="error"&&t.retryOnMount===!1)}function EG(e,t){return Fve(e,t)||e.state.data!==void 0&&kB(e,t,t.refetchOnMount)}function kB(e,t,n){if(pc(t.enabled,e)!==!1){const r=typeof n=="function"?n(e):n;return r==="always"||r!==!1&&wH(e,t)}return!1}function AG(e,t,n,r){return(e!==t||pc(r.enabled,e)===!1)&&(!n.suspense||e.state.status!=="error")&&wH(e,n)}function wH(e,t){return pc(t.enabled,e)!==!1&&e.isStaleByTime(Ab(t.staleTime,e))}function zve(e,t){return!dT(e.getCurrentResult(),t)}var Rh,Ph,Uo,qd,Nf,YP,DB,SX,Bve=(SX=class extends Px{constructor(n,r){super();G(this,Nf);G(this,Rh);G(this,Ph);G(this,Uo);G(this,qd);V(this,Rh,n),this.setOptions(r),this.bindMethods(),K(this,Nf,YP).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=P(this,Rh).defaultMutationOptions(n),dT(this.options,r)||P(this,Rh).getMutationCache().notify({type:"observerOptionsUpdated",mutation:P(this,Uo),observer:this}),r!=null&&r.mutationKey&&this.options.mutationKey&&jv(r.mutationKey)!==jv(this.options.mutationKey)?this.reset():((s=P(this,Uo))==null?void 0:s.state.status)==="pending"&&P(this,Uo).setOptions(this.options)}onUnsubscribe(){var n;this.hasListeners()||(n=P(this,Uo))==null||n.removeObserver(this)}onMutationUpdate(n){K(this,Nf,YP).call(this),K(this,Nf,DB).call(this,n)}getCurrentResult(){return P(this,Ph)}reset(){var n;(n=P(this,Uo))==null||n.removeObserver(this),V(this,Uo,void 0),K(this,Nf,YP).call(this),K(this,Nf,DB).call(this)}mutate(n,r){var s;return V(this,qd,r),(s=P(this,Uo))==null||s.removeObserver(this),V(this,Uo,P(this,Rh).getMutationCache().build(P(this,Rh),this.options)),P(this,Uo).addObserver(this),P(this,Uo).execute(n)}},Rh=new WeakMap,Ph=new WeakMap,Uo=new WeakMap,qd=new WeakMap,Nf=new WeakSet,YP=function(){var r;const n=((r=P(this,Uo))==null?void 0:r.state)??YZ();V(this,Ph,{...n,isPending:n.status==="pending",isSuccess:n.status==="success",isError:n.status==="error",isIdle:n.status==="idle",mutate:this.mutate,reset:this.reset})},DB=function(n){ti.batch(()=>{var r,s,i,o,a,c,d,h;if(P(this,qd)&&this.hasListeners()){const u=P(this,Ph).variables,f=P(this,Ph).context;(n==null?void 0:n.type)==="success"?((s=(r=P(this,qd)).onSuccess)==null||s.call(r,n.data,u,f),(o=(i=P(this,qd)).onSettled)==null||o.call(i,n.data,null,u,f)):(n==null?void 0:n.type)==="error"&&((c=(a=P(this,qd)).onError)==null||c.call(a,n.error,u,f),(h=(d=P(this,qd)).onSettled)==null||h.call(d,void 0,n.error,u,f))}this.listeners.forEach(u=>{u(P(this,Ph))})})},SX),QZ=C.createContext(void 0),pu=e=>{const t=C.useContext(QZ);if(!t)throw new Error("No QueryClient set, use QueryClientProvider to set one");return t},Uve=({client:e,children:t})=>(C.useEffect(()=>(e.mount(),()=>{e.unmount()}),[e]),_.jsx(QZ.Provider,{value:e,children:t})),ZZ=C.createContext(!1),Vve=()=>C.useContext(ZZ);ZZ.Provider;function Hve(){let e=!1;return{clearReset:()=>{e=!1},reset:()=>{e=!0},isReset:()=>e}}var Wve=C.createContext(Hve()),qve=()=>C.useContext(Wve);function JZ(e,t){return typeof e=="function"?e(...t):!!e}function OB(){}var Gve=(e,t)=>{(e.suspense||e.throwOnError||e.experimental_prefetchInRender)&&(t.isReset()||(e.retryOnMount=!1))},Kve=e=>{C.useEffect(()=>{e.clearReset()},[e])},Yve=({result:e,errorResetBoundary:t,throwOnError:n,query:r,suspense:s})=>e.isError&&!t.isReset()&&!e.isFetching&&r&&(s&&e.data===void 0||JZ(n,[e.error,r])),Xve=e=>{const t=e.staleTime;e.suspense&&(e.staleTime=typeof t=="function"?(...n)=>Math.max(t(...n),1e3):Math.max(t??1e3,1e3),typeof e.gcTime=="number"&&(e.gcTime=Math.max(e.gcTime,1e3)))},Qve=(e,t)=>e.isLoading&&e.isFetching&&!t,Zve=(e,t)=>(e==null?void 0:e.suspense)&&t.isPending,RG=(e,t,n)=>t.fetchOptimistic(e).catch(()=>{n.clearReset()});function Jve(e,t,n){var u,f,g,v,m;const r=pu(),s=Vve(),i=qve(),o=r.defaultQueryOptions(e);(f=(u=r.getDefaultOptions().queries)==null?void 0:u._experimental_beforeQuery)==null||f.call(u,o),o._optimisticResults=s?"isRestoring":"optimistic",Xve(o),Gve(o,i),Kve(i);const a=!r.getQueryCache().get(o.queryHash),[c]=C.useState(()=>new t(r,o)),d=c.getOptimisticResult(o),h=!s&&e.subscribed!==!1;if(C.useSyncExternalStore(C.useCallback(x=>{const y=h?c.subscribe(ti.batchCalls(x)):OB;return c.updateResult(),y},[c,h]),()=>c.getCurrentResult(),()=>c.getCurrentResult()),C.useEffect(()=>{c.setOptions(o)},[o,c]),Zve(o,d))throw RG(o,c,i);if(Yve({result:d,errorResetBoundary:i,throwOnError:o.throwOnError,query:r.getQueryCache().get(o.queryHash),suspense:o.suspense}))throw d.error;if((v=(g=r.getDefaultOptions().queries)==null?void 0:g._experimental_afterQuery)==null||v.call(g,o,d),o.experimental_prefetchInRender&&!Lv&&Qve(d,s)){const x=a?RG(o,c,i):(m=r.getQueryCache().get(o.queryHash))==null?void 0:m.promise;x==null||x.catch(OB).finally(()=>{c.updateResult()})}return o.notifyOnChangeProps?d:c.trackResult(d)}function iD(e,t){return Jve(e,$ve)}function mu(e,t){const n=pu(),[r]=C.useState(()=>new Bve(n,e));C.useEffect(()=>{r.setOptions(e)},[r,e]);const s=C.useSyncExternalStore(C.useCallback(o=>r.subscribe(ti.batchCalls(o)),[r]),()=>r.getCurrentResult(),()=>r.getCurrentResult()),i=C.useCallback((o,a)=>{r.mutate(o,a).catch(OB)},[r]);if(s.error&&JZ(r.options.throwOnError,[s.error]))throw s.error;return{...s,mutate:i,mutateAsync:s.mutate}}class El{constructor(t=[]){Be(this,"segments",[]);this.segments=t}key(){return this.segments}get(){return this.segments}}class Pp extends El{params(t){return new El([...this.segments,t])}}class eye extends El{id(t){return new Pp([...this.segments,t?String(t):void 0])}}class tye extends El{ids(...t){return new Pp([...this.segments,...t.length?[t.map(n=>String(n))]:[]])}}class nye extends El{action(t){if(["one","report"].includes(t))return new eye([...this.segments,t]);if(t==="many")return new tye([...this.segments,t]);if(["list","infinite"].includes(t))return new Pp([...this.segments,t]);throw new Error("Invalid action type")}}class rye extends El{resource(t){return new nye([...this.segments,t])}mutation(t){return new Pp([...t==="custom"?this.segments:[this.segments[0]],t])}}class sye extends El{action(t){return new Pp([...this.segments,t])}}class iye extends El{action(t){return new Pp([...this.segments,t])}}class oye extends El{resource(t){return new iye([...this.segments,t])}}class aye extends El{action(t){return new Pp([...this.segments,t])}}class lye extends El{resource(t){return new aye([...this.segments,t])}action(t){return new Pp([...this.segments,t])}}class cye extends El{data(t){return new rye(["data",t||"default"])}auth(){return new sye(["auth"])}access(){return new oye(["access"])}audit(){return new lye(["audit"])}}const uye=()=>new cye([]),Lf=()=>uye,SH=e=>{const t=Lf(),{getProfile:n}=sD();return iD({queryKey:t().auth().action("profile").get(),queryFn:n,...e})},dye=e=>{const t=Lf(),{check:n}=sD();return iD({queryKey:t().auth().action("check").get(),queryFn:n,retry:!1,...e})},fye=e=>{const t=Lf(),{login:n}=sD();return mu({mutationKey:t().auth().action("login").get(),mutationFn:n,...e})};function hye(e,t){const n=C.createContext(t);function r(i){const{children:o,...a}=i,c=C.useMemo(()=>a,Object.values(a));return _.jsx(n.Provider,{value:c,children:o})}function s(i){const o=C.useContext(n);if(o)return o;if(t!==void 0)return t;throw new Error(`\`${i}\` must be used within \`${e}\``)}return r.displayName=e+"Provider",[r,s]}function _r(e,t=[]){let n=[];function r(i,o){const a=C.createContext(o),c=n.length;n=[...n,o];function d(u){const{scope:f,children:g,...v}=u,m=(f==null?void 0:f[e][c])||a,x=C.useMemo(()=>v,Object.values(v));return _.jsx(m.Provider,{value:x,children:g})}function h(u,f){const g=(f==null?void 0:f[e][c])||a,v=C.useContext(g);if(v)return v;if(o!==void 0)return o;throw new Error(`\`${u}\` must be used within \`${i}\``)}return d.displayName=i+"Provider",[d,h]}const s=()=>{const i=n.map(o=>C.createContext(o));return function(a){const c=(a==null?void 0:a[e])||i;return C.useMemo(()=>({[`__scope${e}`]:{...a,[e]:c}}),[a,c])}};return s.scopeName=e,[r,pye(s,...t)]}function pye(...e){const t=e[0];if(e.length===1)return t;const n=()=>{const r=e.map(s=>({useScope:s(),scopeName:s.scopeName}));return function(i){const o=r.reduce((a,{useScope:c,scopeName:d})=>{const u=c(i)[`__scope${d}`];return{...a,...u}},{});return C.useMemo(()=>({[`__scope${t.scopeName}`]:o}),[o])}};return n.scopeName=t.scopeName,n}function mye(e,t){typeof e=="function"?e(t):e!=null&&(e.current=t)}function DA(...e){return t=>e.forEach(n=>mye(n,t))}function _t(...e){return C.useCallback(DA(...e),e)}var Cc=C.forwardRef((e,t)=>{const{children:n,...r}=e,s=C.Children.toArray(n),i=s.find(gye);if(i){const o=i.props.children,a=s.map(c=>c===i?C.Children.count(o)>1?C.Children.only(null):C.isValidElement(o)?o.props.children:null:c);return _.jsx(MB,{...r,ref:t,children:C.isValidElement(o)?C.cloneElement(o,void 0,a):null})}return _.jsx(MB,{...r,ref:t,children:n})});Cc.displayName="Slot";var MB=C.forwardRef((e,t)=>{const{children:n,...r}=e;if(C.isValidElement(n)){const s=yye(n);return C.cloneElement(n,{...vye(r,n.props),ref:t?DA(t,s):s})}return C.Children.count(n)>1?C.Children.only(null):null});MB.displayName="SlotClone";var CH=({children:e})=>_.jsx(_.Fragment,{children:e});function gye(e){return C.isValidElement(e)&&e.type===CH}function vye(e,t){const n={...t};for(const r in t){const s=e[r],i=t[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{...e,...n}}function yye(e){var r,s;let t=(r=Object.getOwnPropertyDescriptor(e.props,"ref"))==null?void 0:r.get,n=t&&"isReactWarning"in t&&t.isReactWarning;return n?e.ref:(t=(s=Object.getOwnPropertyDescriptor(e,"ref"))==null?void 0:s.get,n=t&&"isReactWarning"in t&&t.isReactWarning,n?e.props.ref:e.props.ref||e.ref)}function Uf(e){const t=e+"CollectionProvider",[n,r]=_r(t),[s,i]=n(t,{collectionRef:{current:null},itemMap:new Map}),o=g=>{const{scope:v,children:m}=g,x=fe.useRef(null),y=fe.useRef(new Map).current;return _.jsx(s,{scope:v,itemMap:y,collectionRef:x,children:m})};o.displayName=t;const a=e+"CollectionSlot",c=fe.forwardRef((g,v)=>{const{scope:m,children:x}=g,y=i(a,m),b=_t(v,y.collectionRef);return _.jsx(Cc,{ref:b,children:x})});c.displayName=a;const d=e+"CollectionItemSlot",h="data-radix-collection-item",u=fe.forwardRef((g,v)=>{const{scope:m,children:x,...y}=g,b=fe.useRef(null),w=_t(v,b),E=i(d,m);return fe.useEffect(()=>(E.itemMap.set(b,{ref:b,...y}),()=>void E.itemMap.delete(b))),_.jsx(Cc,{[h]:"",ref:w,children:x})});u.displayName=d;function f(g){const v=i(e+"CollectionConsumer",g);return fe.useCallback(()=>{const x=v.collectionRef.current;if(!x)return[];const y=Array.from(x.querySelectorAll(`[${h}]`));return Array.from(v.itemMap.values()).sort((E,R)=>y.indexOf(E.ref.current)-y.indexOf(R.ref.current))},[v.collectionRef,v.itemMap])}return[{Provider:o,Slot:c,ItemSlot:u},f,r]}function Ae(e,t,{checkForDefaultPrevented:n=!0}={}){return function(s){if(e==null||e(s),n===!1||!s.defaultPrevented)return t==null?void 0:t(s)}}function bn(e){const t=C.useRef(e);return C.useEffect(()=>{t.current=e}),C.useMemo(()=>(...n)=>{var r;return(r=t.current)==null?void 0:r.call(t,...n)},[])}function os({prop:e,defaultProp:t,onChange:n=()=>{}}){const[r,s]=bye({defaultProp:t,onChange:n}),i=e!==void 0,o=i?e:r,a=bn(n),c=C.useCallback(d=>{if(i){const u=typeof d=="function"?d(e):d;u!==e&&a(u)}else s(d)},[i,e,s,a]);return[o,c]}function bye({defaultProp:e,onChange:t}){const n=C.useState(e),[r]=n,s=C.useRef(r),i=bn(t);return C.useEffect(()=>{s.current!==r&&(i(r),s.current=r)},[r,s,i]),n}var xye=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","span","svg","ul"],He=xye.reduce((e,t)=>{const n=C.forwardRef((r,s)=>{const{asChild:i,...o}=r,a=i?Cc:t;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),_.jsx(a,{...o,ref:s})});return n.displayName=`Primitive.${t}`,{...e,[t]:n}},{});function vC(e,t){e&&Li.flushSync(()=>e.dispatchEvent(t))}var Rr=globalThis!=null&&globalThis.document?C.useLayoutEffect:()=>{};function _ye(e,t){return C.useReducer((n,r)=>t[n][r]??n,e)}var Vr=e=>{const{present:t,children:n}=e,r=wye(t),s=typeof n=="function"?n({present:r.isPresent}):C.Children.only(n),i=_t(r.ref,Sye(s));return typeof n=="function"||r.isPresent?C.cloneElement(s,{ref:i}):null};Vr.displayName="Presence";function wye(e){const[t,n]=C.useState(),r=C.useRef({}),s=C.useRef(e),i=C.useRef("none"),o=e?"mounted":"unmounted",[a,c]=_ye(o,{mounted:{UNMOUNT:"unmounted",ANIMATION_OUT:"unmountSuspended"},unmountSuspended:{MOUNT:"mounted",ANIMATION_END:"unmounted"},unmounted:{MOUNT:"mounted"}});return C.useEffect(()=>{const d=YR(r.current);i.current=a==="mounted"?d:"none"},[a]),Rr(()=>{const d=r.current,h=s.current;if(h!==e){const f=i.current,g=YR(d);e?c("MOUNT"):g==="none"||(d==null?void 0:d.display)==="none"?c("UNMOUNT"):c(h&&f!==g?"ANIMATION_OUT":"UNMOUNT"),s.current=e}},[e,c]),Rr(()=>{if(t){const d=u=>{const g=YR(r.current).includes(u.animationName);u.target===t&&g&&Li.flushSync(()=>c("ANIMATION_END"))},h=u=>{u.target===t&&(i.current=YR(r.current))};return t.addEventListener("animationstart",h),t.addEventListener("animationcancel",d),t.addEventListener("animationend",d),()=>{t.removeEventListener("animationstart",h),t.removeEventListener("animationcancel",d),t.removeEventListener("animationend",d)}}else c("ANIMATION_END")},[t,c]),{isPresent:["mounted","unmountSuspended"].includes(a),ref:C.useCallback(d=>{d&&(r.current=getComputedStyle(d)),n(d)},[])}}function YR(e){return(e==null?void 0:e.animationName)||"none"}function Sye(e){var r,s;let t=(r=Object.getOwnPropertyDescriptor(e.props,"ref"))==null?void 0:r.get,n=t&&"isReactWarning"in t&&t.isReactWarning;return n?e.ref:(t=(s=Object.getOwnPropertyDescriptor(e,"ref"))==null?void 0:s.get,n=t&&"isReactWarning"in t&&t.isReactWarning,n?e.props.ref:e.props.ref||e.ref)}var Cye=Tv.useId||(()=>{}),Eye=0;function si(e){const[t,n]=C.useState(Cye());return Rr(()=>{n(r=>r??String(Eye++))},[e]),t?`radix-${t}`:""}var EH="Collapsible",[Aye,eJ]=_r(EH),[Rye,AH]=Aye(EH),tJ=C.forwardRef((e,t)=>{const{__scopeCollapsible:n,open:r,defaultOpen:s,disabled:i,onOpenChange:o,...a}=e,[c=!1,d]=os({prop:r,defaultProp:s,onChange:o});return _.jsx(Rye,{scope:n,disabled:i,contentId:si(),open:c,onOpenToggle:C.useCallback(()=>d(h=>!h),[d]),children:_.jsx(He.div,{"data-state":PH(c),"data-disabled":i?"":void 0,...a,ref:t})})});tJ.displayName=EH;var nJ="CollapsibleTrigger",rJ=C.forwardRef((e,t)=>{const{__scopeCollapsible:n,...r}=e,s=AH(nJ,n);return _.jsx(He.button,{type:"button","aria-controls":s.contentId,"aria-expanded":s.open||!1,"data-state":PH(s.open),"data-disabled":s.disabled?"":void 0,disabled:s.disabled,...r,ref:t,onClick:Ae(e.onClick,s.onOpenToggle)})});rJ.displayName=nJ;var RH="CollapsibleContent",sJ=C.forwardRef((e,t)=>{const{forceMount:n,...r}=e,s=AH(RH,e.__scopeCollapsible);return _.jsx(Vr,{present:n||s.open,children:({present:i})=>_.jsx(Pye,{...r,ref:t,present:i})})});sJ.displayName=RH;var Pye=C.forwardRef((e,t)=>{const{__scopeCollapsible:n,present:r,children:s,...i}=e,o=AH(RH,n),[a,c]=C.useState(r),d=C.useRef(null),h=_t(t,d),u=C.useRef(0),f=u.current,g=C.useRef(0),v=g.current,m=o.open||a,x=C.useRef(m),y=C.useRef();return C.useEffect(()=>{const b=requestAnimationFrame(()=>x.current=!1);return()=>cancelAnimationFrame(b)},[]),Rr(()=>{const b=d.current;if(b){y.current=y.current||{transitionDuration:b.style.transitionDuration,animationName:b.style.animationName},b.style.transitionDuration="0s",b.style.animationName="none";const w=b.getBoundingClientRect();u.current=w.height,g.current=w.width,x.current||(b.style.transitionDuration=y.current.transitionDuration,b.style.animationName=y.current.animationName),c(r)}},[o.open,r]),_.jsx(He.div,{"data-state":PH(o.open),"data-disabled":o.disabled?"":void 0,id:o.contentId,hidden:!m,...i,ref:h,style:{"--radix-collapsible-content-height":f?`${f}px`:void 0,"--radix-collapsible-content-width":v?`${v}px`:void 0,...e.style},children:m&&s})});function PH(e){return e?"open":"closed"}var Nye=tJ,Tye=rJ,kye=sJ,Dye=C.createContext(void 0);function kc(e){const t=C.useContext(Dye);return e||t||"ltr"}var Vf="Accordion",Oye=["Home","End","ArrowDown","ArrowUp","ArrowLeft","ArrowRight"],[NH,Mye,Iye]=Uf(Vf),[oD,n7e]=_r(Vf,[Iye,eJ]),TH=eJ(),Lye=fe.forwardRef((e,t)=>{const{type:n,...r}=e,s=r,i=r;return _.jsx(NH.Provider,{scope:e.__scopeAccordion,children:n==="multiple"?_.jsx(zye,{...i,ref:t}):_.jsx(Fye,{...s,ref:t})})});Lye.displayName=Vf;var[iJ,jye]=oD(Vf),[oJ,$ye]=oD(Vf,{collapsible:!1}),Fye=fe.forwardRef((e,t)=>{const{value:n,defaultValue:r,onValueChange:s=()=>{},collapsible:i=!1,...o}=e,[a,c]=os({prop:n,defaultProp:r,onChange:s});return _.jsx(iJ,{scope:e.__scopeAccordion,value:a?[a]:[],onItemOpen:c,onItemClose:fe.useCallback(()=>i&&c(""),[i,c]),children:_.jsx(oJ,{scope:e.__scopeAccordion,collapsible:i,children:_.jsx(aJ,{...o,ref:t})})})}),zye=fe.forwardRef((e,t)=>{const{value:n,defaultValue:r,onValueChange:s=()=>{},...i}=e,[o=[],a]=os({prop:n,defaultProp:r,onChange:s}),c=fe.useCallback(h=>a((u=[])=>[...u,h]),[a]),d=fe.useCallback(h=>a((u=[])=>u.filter(f=>f!==h)),[a]);return _.jsx(iJ,{scope:e.__scopeAccordion,value:o,onItemOpen:c,onItemClose:d,children:_.jsx(oJ,{scope:e.__scopeAccordion,collapsible:!0,children:_.jsx(aJ,{...i,ref:t})})})}),[Bye,aD]=oD(Vf),aJ=fe.forwardRef((e,t)=>{const{__scopeAccordion:n,disabled:r,dir:s,orientation:i="vertical",...o}=e,a=fe.useRef(null),c=_t(a,t),d=Mye(n),u=kc(s)==="ltr",f=Ae(e.onKeyDown,g=>{var A;if(!Oye.includes(g.key))return;const v=g.target,m=d().filter(D=>{var O;return!((O=D.ref.current)!=null&&O.disabled)}),x=m.findIndex(D=>D.ref.current===v),y=m.length;if(x===-1)return;g.preventDefault();let b=x;const w=0,E=y-1,R=()=>{b=x+1,b>E&&(b=w)},T=()=>{b=x-1,b<w&&(b=E)};switch(g.key){case"Home":b=w;break;case"End":b=E;break;case"ArrowRight":i==="horizontal"&&(u?R():T());break;case"ArrowDown":i==="vertical"&&R();break;case"ArrowLeft":i==="horizontal"&&(u?T():R());break;case"ArrowUp":i==="vertical"&&T();break}const N=b%y;(A=m[N].ref.current)==null||A.focus()});return _.jsx(Bye,{scope:n,disabled:r,direction:s,orientation:i,children:_.jsx(NH.Slot,{scope:n,children:_.jsx(He.div,{...o,"data-orientation":i,ref:c,onKeyDown:r?void 0:f})})})}),hT="AccordionItem",[Uye,kH]=oD(hT),lJ=fe.forwardRef((e,t)=>{const{__scopeAccordion:n,value:r,...s}=e,i=aD(hT,n),o=jye(hT,n),a=TH(n),c=si(),d=r&&o.value.includes(r)||!1,h=i.disabled||e.disabled;return _.jsx(Uye,{scope:n,open:d,disabled:h,triggerId:c,children:_.jsx(Nye,{"data-orientation":i.orientation,"data-state":pJ(d),...a,...s,ref:t,disabled:h,open:d,onOpenChange:u=>{u?o.onItemOpen(r):o.onItemClose(r)}})})});lJ.displayName=hT;var cJ="AccordionHeader",uJ=fe.forwardRef((e,t)=>{const{__scopeAccordion:n,...r}=e,s=aD(Vf,n),i=kH(cJ,n);return _.jsx(He.h3,{"data-orientation":s.orientation,"data-state":pJ(i.open),"data-disabled":i.disabled?"":void 0,...r,ref:t})});uJ.displayName=cJ;var IB="AccordionTrigger",dJ=fe.forwardRef((e,t)=>{const{__scopeAccordion:n,...r}=e,s=aD(Vf,n),i=kH(IB,n),o=$ye(IB,n),a=TH(n);return _.jsx(NH.ItemSlot,{scope:n,children:_.jsx(Tye,{"aria-disabled":i.open&&!o.collapsible||void 0,"data-orientation":s.orientation,id:i.triggerId,...a,...r,ref:t})})});dJ.displayName=IB;var fJ="AccordionContent",hJ=fe.forwardRef((e,t)=>{const{__scopeAccordion:n,...r}=e,s=aD(Vf,n),i=kH(fJ,n),o=TH(n);return _.jsx(kye,{role:"region","aria-labelledby":i.triggerId,"data-orientation":s.orientation,...o,...r,ref:t,style:{"--radix-accordion-content-height":"var(--radix-collapsible-content-height)","--radix-accordion-content-width":"var(--radix-collapsible-content-width)",...e.style}})});hJ.displayName=fJ;function pJ(e){return e?"open":"closed"}var Vye=lJ,Hye=uJ,mJ=dJ,gJ=hJ;/**
|
||
* @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 Wye=e=>e.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase(),vJ=(...e)=>e.filter((t,n,r)=>!!t&&r.indexOf(t)===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 qye={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 Gye=C.forwardRef(({color:e="currentColor",size:t=24,strokeWidth:n=2,absoluteStrokeWidth:r,className:s="",children:i,iconNode:o,...a},c)=>C.createElement("svg",{ref:c,...qye,width:t,height:t,stroke:e,strokeWidth:r?Number(n)*24/Number(t):n,className:vJ("lucide",s),...a},[...o.map(([d,h])=>C.createElement(d,h)),...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 Wt=(e,t)=>{const n=C.forwardRef(({className:r,...s},i)=>C.createElement(Gye,{ref:i,iconNode:t,className:vJ(`lucide-${Wye(e)}`,r),...s}));return n.displayName=`${e}`,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 yJ=Wt("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 Kye=Wt("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 PG=Wt("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 NG=Wt("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 Yye=Wt("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 OA=Wt("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 Nx=Wt("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 lD=Wt("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 Tx=Wt("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 bJ=Wt("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 Xye=Wt("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 Qye=Wt("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 xJ=Wt("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 _J=Wt("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 Zye=Wt("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 Jye=Wt("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 ebe=Wt("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 cD=Wt("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 tbe=Wt("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 DH=Wt("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 wJ=Wt("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 nbe=Wt("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 SJ=Wt("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 rbe=Wt("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 sbe=Wt("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 CJ=Wt("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 ibe=Wt("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 obe=Wt("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 abe=Wt("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 lbe=Wt("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 cbe=Wt("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 ube=Wt("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 OH=Wt("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 MH=Wt("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 EJ=Wt("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 dbe=Wt("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 IH=Wt("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 fbe=Wt("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 hbe=Wt("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 pbe=Wt("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 AJ=Wt("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 RJ=Wt("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 sx=Wt("X",[["path",{d:"M18 6 6 18",key:"1bl5f8"}],["path",{d:"m6 6 12 12",key:"d8bk6v"}]]);function PJ(e){var t,n,r="";if(typeof e=="string"||typeof e=="number")r+=e;else if(typeof e=="object")if(Array.isArray(e)){var s=e.length;for(t=0;t<s;t++)e[t]&&(n=PJ(e[t]))&&(r&&(r+=" "),r+=n)}else for(n in e)e[n]&&(r&&(r+=" "),r+=n);return r}function oy(){for(var e,t,n=0,r="",s=arguments.length;n<s;n++)(e=arguments[n])&&(t=PJ(e))&&(r&&(r+=" "),r+=t);return r}const LH="-",mbe=e=>{const t=vbe(e),{conflictingClassGroups:n,conflictingClassGroupModifiers:r}=e;return{getClassGroupId:o=>{const a=o.split(LH);return a[0]===""&&a.length!==1&&a.shift(),NJ(a,t)||gbe(o)},getConflictingClassGroupIds:(o,a)=>{const c=n[o]||[];return a&&r[o]?[...c,...r[o]]:c}}},NJ=(e,t)=>{var o;if(e.length===0)return t.classGroupId;const n=e[0],r=t.nextPart.get(n),s=r?NJ(e.slice(1),r):void 0;if(s)return s;if(t.validators.length===0)return;const i=e.join(LH);return(o=t.validators.find(({validator:a})=>a(i)))==null?void 0:o.classGroupId},TG=/^\[(.+)\]$/,gbe=e=>{if(TG.test(e)){const t=TG.exec(e)[1],n=t==null?void 0:t.substring(0,t.indexOf(":"));if(n)return"arbitrary.."+n}},vbe=e=>{const{theme:t,prefix:n}=e,r={nextPart:new Map,validators:[]};return bbe(Object.entries(e.classGroups),n).forEach(([i,o])=>{LB(o,r,i,t)}),r},LB=(e,t,n,r)=>{e.forEach(s=>{if(typeof s=="string"){const i=s===""?t:kG(t,s);i.classGroupId=n;return}if(typeof s=="function"){if(ybe(s)){LB(s(r),t,n,r);return}t.validators.push({validator:s,classGroupId:n});return}Object.entries(s).forEach(([i,o])=>{LB(o,kG(t,i),n,r)})})},kG=(e,t)=>{let n=e;return t.split(LH).forEach(r=>{n.nextPart.has(r)||n.nextPart.set(r,{nextPart:new Map,validators:[]}),n=n.nextPart.get(r)}),n},ybe=e=>e.isThemeGetter,bbe=(e,t)=>t?e.map(([n,r])=>{const s=r.map(i=>typeof i=="string"?t+i:typeof i=="object"?Object.fromEntries(Object.entries(i).map(([o,a])=>[t+o,a])):i);return[n,s]}):e,xbe=e=>{if(e<1)return{get:()=>{},set:()=>{}};let t=0,n=new Map,r=new Map;const s=(i,o)=>{n.set(i,o),t++,t>e&&(t=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)}}},TJ="!",_be=e=>{const{separator:t,experimentalParseClassName:n}=e,r=t.length===1,s=t[0],i=t.length,o=a=>{const c=[];let d=0,h=0,u;for(let x=0;x<a.length;x++){let y=a[x];if(d===0){if(y===s&&(r||a.slice(x,x+i)===t)){c.push(a.slice(h,x)),h=x+i;continue}if(y==="/"){u=x;continue}}y==="["?d++:y==="]"&&d--}const f=c.length===0?a:a.substring(h),g=f.startsWith(TJ),v=g?f.substring(1):f,m=u&&u>h?u-h:void 0;return{modifiers:c,hasImportantModifier:g,baseClassName:v,maybePostfixModifierPosition:m}};return n?a=>n({className:a,parseClassName:o}):o},wbe=e=>{if(e.length<=1)return e;const t=[];let n=[];return e.forEach(r=>{r[0]==="["?(t.push(...n.sort(),r),n=[]):n.push(r)}),t.push(...n.sort()),t},Sbe=e=>({cache:xbe(e.cacheSize),parseClassName:_be(e),...mbe(e)}),Cbe=/\s+/,Ebe=(e,t)=>{const{parseClassName:n,getClassGroupId:r,getConflictingClassGroupIds:s}=t,i=[],o=e.trim().split(Cbe);let a="";for(let c=o.length-1;c>=0;c-=1){const d=o[c],{modifiers:h,hasImportantModifier:u,baseClassName:f,maybePostfixModifierPosition:g}=n(d);let v=!!g,m=r(v?f.substring(0,g):f);if(!m){if(!v){a=d+(a.length>0?" "+a:a);continue}if(m=r(f),!m){a=d+(a.length>0?" "+a:a);continue}v=!1}const x=wbe(h).join(":"),y=u?x+TJ:x,b=y+m;if(i.includes(b))continue;i.push(b);const w=s(m,v);for(let E=0;E<w.length;++E){const R=w[E];i.push(y+R)}a=d+(a.length>0?" "+a:a)}return a};function Abe(){let e=0,t,n,r="";for(;e<arguments.length;)(t=arguments[e++])&&(n=kJ(t))&&(r&&(r+=" "),r+=n);return r}const kJ=e=>{if(typeof e=="string")return e;let t,n="";for(let r=0;r<e.length;r++)e[r]&&(t=kJ(e[r]))&&(n&&(n+=" "),n+=t);return n};function Rbe(e,...t){let n,r,s,i=o;function o(c){const d=t.reduce((h,u)=>u(h),e());return n=Sbe(d),r=n.cache.get,s=n.cache.set,i=a,a(c)}function a(c){const d=r(c);if(d)return d;const h=Ebe(c,n);return s(c,h),h}return function(){return i(Abe.apply(null,arguments))}}const jr=e=>{const t=n=>n[e]||[];return t.isThemeGetter=!0,t},DJ=/^\[(?:([a-z-]+):)?(.+)\]$/i,Pbe=/^\d+\/\d+$/,Nbe=new Set(["px","full","screen"]),Tbe=/^(\d+(\.\d+)?)?(xs|sm|md|lg|xl)$/,kbe=/\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$/,Dbe=/^(rgba?|hsla?|hwb|(ok)?(lab|lch))\(.+\)$/,Obe=/^(inset_)?-?((\d+)?\.?(\d+)[a-z]+|0)_-?((\d+)?\.?(\d+)[a-z]+|0)/,Mbe=/^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\(.+\)$/,Nd=e=>Rb(e)||Nbe.has(e)||Pbe.test(e),Xf=e=>kx(e,"length",Ube),Rb=e=>!!e&&!Number.isNaN(Number(e)),F3=e=>kx(e,"number",Rb),OS=e=>!!e&&Number.isInteger(Number(e)),Ibe=e=>e.endsWith("%")&&Rb(e.slice(0,-1)),Kt=e=>DJ.test(e),Qf=e=>Tbe.test(e),Lbe=new Set(["length","size","percentage"]),jbe=e=>kx(e,Lbe,OJ),$be=e=>kx(e,"position",OJ),Fbe=new Set(["image","url"]),zbe=e=>kx(e,Fbe,Hbe),Bbe=e=>kx(e,"",Vbe),MS=()=>!0,kx=(e,t,n)=>{const r=DJ.exec(e);return r?r[1]?typeof t=="string"?r[1]===t:t.has(r[1]):n(r[2]):!1},Ube=e=>kbe.test(e)&&!Dbe.test(e),OJ=()=>!1,Vbe=e=>Obe.test(e),Hbe=e=>Mbe.test(e),Wbe=()=>{const e=jr("colors"),t=jr("spacing"),n=jr("blur"),r=jr("brightness"),s=jr("borderColor"),i=jr("borderRadius"),o=jr("borderSpacing"),a=jr("borderWidth"),c=jr("contrast"),d=jr("grayscale"),h=jr("hueRotate"),u=jr("invert"),f=jr("gap"),g=jr("gradientColorStops"),v=jr("gradientColorStopPositions"),m=jr("inset"),x=jr("margin"),y=jr("opacity"),b=jr("padding"),w=jr("saturate"),E=jr("scale"),R=jr("sepia"),T=jr("skew"),N=jr("space"),A=jr("translate"),D=()=>["auto","contain","none"],O=()=>["auto","hidden","clip","visible","scroll"],I=()=>["auto",Kt,t],$=()=>[Kt,t],F=()=>["",Nd,Xf],B=()=>["auto",Rb,Kt],W=()=>["bottom","center","left","left-bottom","left-top","right","right-bottom","right-top","top"],Z=()=>["solid","dashed","dotted","double","none"],Y=()=>["normal","multiply","screen","overlay","darken","lighten","color-dodge","color-burn","hard-light","soft-light","difference","exclusion","hue","saturation","color","luminosity"],H=()=>["start","end","center","between","around","evenly","stretch"],se=()=>["","0",Kt],he=()=>["auto","avoid","all","avoid-page","page","left","right","column"],re=()=>[Rb,Kt];return{cacheSize:500,separator:":",theme:{colors:[MS],spacing:[Nd,Xf],blur:["none","",Qf,Kt],brightness:re(),borderColor:[e],borderRadius:["none","","full",Qf,Kt],borderSpacing:$(),borderWidth:F(),contrast:re(),grayscale:se(),hueRotate:re(),invert:se(),gap:$(),gradientColorStops:[e],gradientColorStopPositions:[Ibe,Xf],inset:I(),margin:I(),opacity:re(),padding:$(),saturate:re(),scale:re(),sepia:se(),skew:re(),space:$(),translate:$()},classGroups:{aspect:[{aspect:["auto","square","video",Kt]}],container:["container"],columns:[{columns:[Qf]}],"break-after":[{"break-after":he()}],"break-before":[{"break-before":he()}],"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:[...W(),Kt]}],overflow:[{overflow:O()}],"overflow-x":[{"overflow-x":O()}],"overflow-y":[{"overflow-y":O()}],overscroll:[{overscroll:D()}],"overscroll-x":[{"overscroll-x":D()}],"overscroll-y":[{"overscroll-y":D()}],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",OS,Kt]}],basis:[{basis:I()}],"flex-direction":[{flex:["row","row-reverse","col","col-reverse"]}],"flex-wrap":[{flex:["wrap","wrap-reverse","nowrap"]}],flex:[{flex:["1","auto","initial","none",Kt]}],grow:[{grow:se()}],shrink:[{shrink:se()}],order:[{order:["first","last","none",OS,Kt]}],"grid-cols":[{"grid-cols":[MS]}],"col-start-end":[{col:["auto",{span:["full",OS,Kt]},Kt]}],"col-start":[{"col-start":B()}],"col-end":[{"col-end":B()}],"grid-rows":[{"grid-rows":[MS]}],"row-start-end":[{row:["auto",{span:[OS,Kt]},Kt]}],"row-start":[{"row-start":B()}],"row-end":[{"row-end":B()}],"grid-flow":[{"grid-flow":["row","col","dense","row-dense","col-dense"]}],"auto-cols":[{"auto-cols":["auto","min","max","fr",Kt]}],"auto-rows":[{"auto-rows":["auto","min","max","fr",Kt]}],gap:[{gap:[f]}],"gap-x":[{"gap-x":[f]}],"gap-y":[{"gap-y":[f]}],"justify-content":[{justify:["normal",...H()]}],"justify-items":[{"justify-items":["start","end","center","stretch"]}],"justify-self":[{"justify-self":["auto","start","end","center","stretch"]}],"align-content":[{content:["normal",...H(),"baseline"]}],"align-items":[{items:["start","end","center","baseline","stretch"]}],"align-self":[{self:["auto","start","end","center","stretch","baseline"]}],"place-content":[{"place-content":[...H(),"baseline"]}],"place-items":[{"place-items":["start","end","center","baseline","stretch"]}],"place-self":[{"place-self":["auto","start","end","center","stretch"]}],p:[{p:[b]}],px:[{px:[b]}],py:[{py:[b]}],ps:[{ps:[b]}],pe:[{pe:[b]}],pt:[{pt:[b]}],pr:[{pr:[b]}],pb:[{pb:[b]}],pl:[{pl:[b]}],m:[{m:[x]}],mx:[{mx:[x]}],my:[{my:[x]}],ms:[{ms:[x]}],me:[{me:[x]}],mt:[{mt:[x]}],mr:[{mr:[x]}],mb:[{mb:[x]}],ml:[{ml:[x]}],"space-x":[{"space-x":[N]}],"space-x-reverse":["space-x-reverse"],"space-y":[{"space-y":[N]}],"space-y-reverse":["space-y-reverse"],w:[{w:["auto","min","max","fit","svw","lvw","dvw",Kt,t]}],"min-w":[{"min-w":[Kt,t,"min","max","fit"]}],"max-w":[{"max-w":[Kt,t,"none","full","min","max","fit","prose",{screen:[Qf]},Qf]}],h:[{h:[Kt,t,"auto","min","max","fit","svh","lvh","dvh"]}],"min-h":[{"min-h":[Kt,t,"min","max","fit","svh","lvh","dvh"]}],"max-h":[{"max-h":[Kt,t,"min","max","fit","svh","lvh","dvh"]}],size:[{size:[Kt,t,"auto","min","max","fit"]}],"font-size":[{text:["base",Qf,Xf]}],"font-smoothing":["antialiased","subpixel-antialiased"],"font-style":["italic","not-italic"],"font-weight":[{font:["thin","extralight","light","normal","medium","semibold","bold","extrabold","black",F3]}],"font-family":[{font:[MS]}],"fvn-normal":["normal-nums"],"fvn-ordinal":["ordinal"],"fvn-slashed-zero":["slashed-zero"],"fvn-figure":["lining-nums","oldstyle-nums"],"fvn-spacing":["proportional-nums","tabular-nums"],"fvn-fraction":["diagonal-fractions","stacked-fractions"],tracking:[{tracking:["tighter","tight","normal","wide","wider","widest",Kt]}],"line-clamp":[{"line-clamp":["none",Rb,F3]}],leading:[{leading:["none","tight","snug","normal","relaxed","loose",Nd,Kt]}],"list-image":[{"list-image":["none",Kt]}],"list-style-type":[{list:["none","disc","decimal",Kt]}],"list-style-position":[{list:["inside","outside"]}],"placeholder-color":[{placeholder:[e]}],"placeholder-opacity":[{"placeholder-opacity":[y]}],"text-alignment":[{text:["left","center","right","justify","start","end"]}],"text-color":[{text:[e]}],"text-opacity":[{"text-opacity":[y]}],"text-decoration":["underline","overline","line-through","no-underline"],"text-decoration-style":[{decoration:[...Z(),"wavy"]}],"text-decoration-thickness":[{decoration:["auto","from-font",Nd,Xf]}],"underline-offset":[{"underline-offset":["auto",Nd,Kt]}],"text-decoration-color":[{decoration:[e]}],"text-transform":["uppercase","lowercase","capitalize","normal-case"],"text-overflow":["truncate","text-ellipsis","text-clip"],"text-wrap":[{text:["wrap","nowrap","balance","pretty"]}],indent:[{indent:$()}],"vertical-align":[{align:["baseline","top","middle","bottom","text-top","text-bottom","sub","super",Kt]}],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",Kt]}],"bg-attachment":[{bg:["fixed","local","scroll"]}],"bg-clip":[{"bg-clip":["border","padding","content","text"]}],"bg-opacity":[{"bg-opacity":[y]}],"bg-origin":[{"bg-origin":["border","padding","content"]}],"bg-position":[{bg:[...W(),$be]}],"bg-repeat":[{bg:["no-repeat",{repeat:["","x","y","round","space"]}]}],"bg-size":[{bg:["auto","cover","contain",jbe]}],"bg-image":[{bg:["none",{"gradient-to":["t","tr","r","br","b","bl","l","tl"]},zbe]}],"bg-color":[{bg:[e]}],"gradient-from-pos":[{from:[v]}],"gradient-via-pos":[{via:[v]}],"gradient-to-pos":[{to:[v]}],"gradient-from":[{from:[g]}],"gradient-via":[{via:[g]}],"gradient-to":[{to:[g]}],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":[y]}],"border-style":[{border:[...Z(),"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":[y]}],"divide-style":[{divide:Z()}],"border-color":[{border:[s]}],"border-color-x":[{"border-x":[s]}],"border-color-y":[{"border-y":[s]}],"border-color-s":[{"border-s":[s]}],"border-color-e":[{"border-e":[s]}],"border-color-t":[{"border-t":[s]}],"border-color-r":[{"border-r":[s]}],"border-color-b":[{"border-b":[s]}],"border-color-l":[{"border-l":[s]}],"divide-color":[{divide:[s]}],"outline-style":[{outline:["",...Z()]}],"outline-offset":[{"outline-offset":[Nd,Kt]}],"outline-w":[{outline:[Nd,Xf]}],"outline-color":[{outline:[e]}],"ring-w":[{ring:F()}],"ring-w-inset":["ring-inset"],"ring-color":[{ring:[e]}],"ring-opacity":[{"ring-opacity":[y]}],"ring-offset-w":[{"ring-offset":[Nd,Xf]}],"ring-offset-color":[{"ring-offset":[e]}],shadow:[{shadow:["","inner","none",Qf,Bbe]}],"shadow-color":[{shadow:[MS]}],opacity:[{opacity:[y]}],"mix-blend":[{"mix-blend":[...Y(),"plus-lighter","plus-darker"]}],"bg-blend":[{"bg-blend":Y()}],filter:[{filter:["","none"]}],blur:[{blur:[n]}],brightness:[{brightness:[r]}],contrast:[{contrast:[c]}],"drop-shadow":[{"drop-shadow":["","none",Qf,Kt]}],grayscale:[{grayscale:[d]}],"hue-rotate":[{"hue-rotate":[h]}],invert:[{invert:[u]}],saturate:[{saturate:[w]}],sepia:[{sepia:[R]}],"backdrop-filter":[{"backdrop-filter":["","none"]}],"backdrop-blur":[{"backdrop-blur":[n]}],"backdrop-brightness":[{"backdrop-brightness":[r]}],"backdrop-contrast":[{"backdrop-contrast":[c]}],"backdrop-grayscale":[{"backdrop-grayscale":[d]}],"backdrop-hue-rotate":[{"backdrop-hue-rotate":[h]}],"backdrop-invert":[{"backdrop-invert":[u]}],"backdrop-opacity":[{"backdrop-opacity":[y]}],"backdrop-saturate":[{"backdrop-saturate":[w]}],"backdrop-sepia":[{"backdrop-sepia":[R]}],"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",Kt]}],duration:[{duration:re()}],ease:[{ease:["linear","in","out","in-out",Kt]}],delay:[{delay:re()}],animate:[{animate:["none","spin","ping","pulse","bounce",Kt]}],transform:[{transform:["","gpu","none"]}],scale:[{scale:[E]}],"scale-x":[{"scale-x":[E]}],"scale-y":[{"scale-y":[E]}],rotate:[{rotate:[OS,Kt]}],"translate-x":[{"translate-x":[A]}],"translate-y":[{"translate-y":[A]}],"skew-x":[{"skew-x":[T]}],"skew-y":[{"skew-y":[T]}],"transform-origin":[{origin:["center","top","top-right","right","bottom-right","bottom","bottom-left","left","top-left",Kt]}],accent:[{accent:["auto",e]}],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",Kt]}],"caret-color":[{caret:[e]}],"pointer-events":[{"pointer-events":["none","auto"]}],resize:[{resize:["none","y","x",""]}],"scroll-behavior":[{scroll:["auto","smooth"]}],"scroll-m":[{"scroll-m":$()}],"scroll-mx":[{"scroll-mx":$()}],"scroll-my":[{"scroll-my":$()}],"scroll-ms":[{"scroll-ms":$()}],"scroll-me":[{"scroll-me":$()}],"scroll-mt":[{"scroll-mt":$()}],"scroll-mr":[{"scroll-mr":$()}],"scroll-mb":[{"scroll-mb":$()}],"scroll-ml":[{"scroll-ml":$()}],"scroll-p":[{"scroll-p":$()}],"scroll-px":[{"scroll-px":$()}],"scroll-py":[{"scroll-py":$()}],"scroll-ps":[{"scroll-ps":$()}],"scroll-pe":[{"scroll-pe":$()}],"scroll-pt":[{"scroll-pt":$()}],"scroll-pr":[{"scroll-pr":$()}],"scroll-pb":[{"scroll-pb":$()}],"scroll-pl":[{"scroll-pl":$()}],"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",Kt]}],fill:[{fill:[e,"none"]}],"stroke-w":[{stroke:[Nd,Xf,F3]}],stroke:[{stroke:[e,"none"]}],sr:["sr-only","not-sr-only"],"forced-color-adjust":[{"forced-color-adjust":["auto","none"]}]},conflictingClassGroups:{overflow:["overflow-x","overflow-y"],overscroll:["overscroll-x","overscroll-y"],inset:["inset-x","inset-y","start","end","top","right","bottom","left"],"inset-x":["right","left"],"inset-y":["top","bottom"],flex:["basis","grow","shrink"],gap:["gap-x","gap-y"],p:["px","py","ps","pe","pt","pr","pb","pl"],px:["pr","pl"],py:["pt","pb"],m:["mx","my","ms","me","mt","mr","mb","ml"],mx:["mr","ml"],my:["mt","mb"],size:["w","h"],"font-size":["leading"],"fvn-normal":["fvn-ordinal","fvn-slashed-zero","fvn-figure","fvn-spacing","fvn-fraction"],"fvn-ordinal":["fvn-normal"],"fvn-slashed-zero":["fvn-normal"],"fvn-figure":["fvn-normal"],"fvn-spacing":["fvn-normal"],"fvn-fraction":["fvn-normal"],"line-clamp":["display","overflow"],rounded:["rounded-s","rounded-e","rounded-t","rounded-r","rounded-b","rounded-l","rounded-ss","rounded-se","rounded-ee","rounded-es","rounded-tl","rounded-tr","rounded-br","rounded-bl"],"rounded-s":["rounded-ss","rounded-es"],"rounded-e":["rounded-se","rounded-ee"],"rounded-t":["rounded-tl","rounded-tr"],"rounded-r":["rounded-tr","rounded-br"],"rounded-b":["rounded-br","rounded-bl"],"rounded-l":["rounded-tl","rounded-bl"],"border-spacing":["border-spacing-x","border-spacing-y"],"border-w":["border-w-s","border-w-e","border-w-t","border-w-r","border-w-b","border-w-l"],"border-w-x":["border-w-r","border-w-l"],"border-w-y":["border-w-t","border-w-b"],"border-color":["border-color-s","border-color-e","border-color-t","border-color-r","border-color-b","border-color-l"],"border-color-x":["border-color-r","border-color-l"],"border-color-y":["border-color-t","border-color-b"],"scroll-m":["scroll-mx","scroll-my","scroll-ms","scroll-me","scroll-mt","scroll-mr","scroll-mb","scroll-ml"],"scroll-mx":["scroll-mr","scroll-ml"],"scroll-my":["scroll-mt","scroll-mb"],"scroll-p":["scroll-px","scroll-py","scroll-ps","scroll-pe","scroll-pt","scroll-pr","scroll-pb","scroll-pl"],"scroll-px":["scroll-pr","scroll-pl"],"scroll-py":["scroll-pt","scroll-pb"],touch:["touch-x","touch-y","touch-pz"],"touch-x":["touch"],"touch-y":["touch"],"touch-pz":["touch"]},conflictingClassGroupModifiers:{"font-size":["leading"]}}},qbe=Rbe(Wbe);function ge(...e){return qbe(oy(e))}const Gbe=C.forwardRef(({className:e,...t},n)=>_.jsx(Vye,{ref:n,className:ge("border-b",e),...t}));Gbe.displayName="AccordionItem";const Kbe=C.forwardRef(({className:e,children:t,...n},r)=>_.jsx(Hye,{className:"flex",children:_.jsxs(mJ,{ref:r,className:ge("flex flex-1 items-center justify-between py-4 font-medium transition-all hover:underline [&[data-state=open]>svg]:rotate-180",e),...n,children:[t,_.jsx(Nx,{className:"h-4 w-4 shrink-0 transition-transform duration-200"})]})}));Kbe.displayName=mJ.displayName;const Ybe=C.forwardRef(({className:e,children:t,...n},r)=>_.jsx(gJ,{ref:r,className:"overflow-hidden text-sm transition-all data-[state=closed]:animate-accordion-up data-[state=open]:animate-accordion-down",...n,children:_.jsx("div",{className:ge("pb-4 pt-0",e),children:t})}));Ybe.displayName=gJ.displayName;const DG=e=>typeof e=="boolean"?`${e}`:e===0?"0":e,OG=oy,Io=(e,t)=>n=>{var r;if((t==null?void 0:t.variants)==null)return OG(e,n==null?void 0:n.class,n==null?void 0:n.className);const{variants:s,defaultVariants:i}=t,o=Object.keys(s).map(d=>{const h=n==null?void 0:n[d],u=i==null?void 0:i[d];if(h===null)return null;const f=DG(h)||DG(u);return s[d][f]}),a=n&&Object.entries(n).reduce((d,h)=>{let[u,f]=h;return f===void 0||(d[u]=f),d},{}),c=t==null||(r=t.compoundVariants)===null||r===void 0?void 0:r.reduce((d,h)=>{let{class:u,className:f,...g}=h;return Object.entries(g).every(v=>{let[m,x]=v;return Array.isArray(x)?x.includes({...i,...a}[m]):{...i,...a}[m]===x})?[...d,u,f]:d},[]);return OG(e,o,c,n==null?void 0:n.class,n==null?void 0:n.className)},Xbe=Io("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"}}),jH=C.forwardRef(({className:e,variant:t,...n},r)=>_.jsx("div",{ref:r,role:"alert",className:ge(Xbe({variant:t}),e),...n}));jH.displayName="Alert";const $H=C.forwardRef(({className:e,...t},n)=>_.jsx("h5",{ref:n,className:ge("mb-1 font-medium leading-none tracking-tight",e),...t}));$H.displayName="AlertTitle";const FH=C.forwardRef(({className:e,...t},n)=>_.jsx("div",{ref:n,className:ge("text-sm [&_p]:leading-relaxed",e),...t}));FH.displayName="AlertDescription";function MJ(e,t=globalThis==null?void 0:globalThis.document){const n=bn(e);C.useEffect(()=>{const r=s=>{s.key==="Escape"&&n(s)};return t.addEventListener("keydown",r,{capture:!0}),()=>t.removeEventListener("keydown",r,{capture:!0})},[n,t])}var Qbe="DismissableLayer",jB="dismissableLayer.update",Zbe="dismissableLayer.pointerDownOutside",Jbe="dismissableLayer.focusOutside",MG,IJ=C.createContext({layers:new Set,layersWithOutsidePointerEventsDisabled:new Set,branches:new Set}),Hf=C.forwardRef((e,t)=>{const{disableOutsidePointerEvents:n=!1,onEscapeKeyDown:r,onPointerDownOutside:s,onFocusOutside:i,onInteractOutside:o,onDismiss:a,...c}=e,d=C.useContext(IJ),[h,u]=C.useState(null),f=(h==null?void 0:h.ownerDocument)??(globalThis==null?void 0:globalThis.document),[,g]=C.useState({}),v=_t(t,N=>u(N)),m=Array.from(d.layers),[x]=[...d.layersWithOutsidePointerEventsDisabled].slice(-1),y=m.indexOf(x),b=h?m.indexOf(h):-1,w=d.layersWithOutsidePointerEventsDisabled.size>0,E=b>=y,R=t0e(N=>{const A=N.target,D=[...d.branches].some(O=>O.contains(A));!E||D||(s==null||s(N),o==null||o(N),N.defaultPrevented||a==null||a())},f),T=n0e(N=>{const A=N.target;[...d.branches].some(O=>O.contains(A))||(i==null||i(N),o==null||o(N),N.defaultPrevented||a==null||a())},f);return MJ(N=>{b===d.layers.size-1&&(r==null||r(N),!N.defaultPrevented&&a&&(N.preventDefault(),a()))},f),C.useEffect(()=>{if(h)return n&&(d.layersWithOutsidePointerEventsDisabled.size===0&&(MG=f.body.style.pointerEvents,f.body.style.pointerEvents="none"),d.layersWithOutsidePointerEventsDisabled.add(h)),d.layers.add(h),IG(),()=>{n&&d.layersWithOutsidePointerEventsDisabled.size===1&&(f.body.style.pointerEvents=MG)}},[h,f,n,d]),C.useEffect(()=>()=>{h&&(d.layers.delete(h),d.layersWithOutsidePointerEventsDisabled.delete(h),IG())},[h,d]),C.useEffect(()=>{const N=()=>g({});return document.addEventListener(jB,N),()=>document.removeEventListener(jB,N)},[]),_.jsx(He.div,{...c,ref:v,style:{pointerEvents:w?E?"auto":"none":void 0,...e.style},onFocusCapture:Ae(e.onFocusCapture,T.onFocusCapture),onBlurCapture:Ae(e.onBlurCapture,T.onBlurCapture),onPointerDownCapture:Ae(e.onPointerDownCapture,R.onPointerDownCapture)})});Hf.displayName=Qbe;var e0e="DismissableLayerBranch",LJ=C.forwardRef((e,t)=>{const n=C.useContext(IJ),r=C.useRef(null),s=_t(t,r);return C.useEffect(()=>{const i=r.current;if(i)return n.branches.add(i),()=>{n.branches.delete(i)}},[n.branches]),_.jsx(He.div,{...e,ref:s})});LJ.displayName=e0e;function t0e(e,t=globalThis==null?void 0:globalThis.document){const n=bn(e),r=C.useRef(!1),s=C.useRef(()=>{});return C.useEffect(()=>{const i=a=>{if(a.target&&!r.current){let c=function(){jJ(Zbe,n,d,{discrete:!0})};const d={originalEvent:a};a.pointerType==="touch"?(t.removeEventListener("click",s.current),s.current=c,t.addEventListener("click",s.current,{once:!0})):c()}else t.removeEventListener("click",s.current);r.current=!1},o=window.setTimeout(()=>{t.addEventListener("pointerdown",i)},0);return()=>{window.clearTimeout(o),t.removeEventListener("pointerdown",i),t.removeEventListener("click",s.current)}},[t,n]),{onPointerDownCapture:()=>r.current=!0}}function n0e(e,t=globalThis==null?void 0:globalThis.document){const n=bn(e),r=C.useRef(!1);return C.useEffect(()=>{const s=i=>{i.target&&!r.current&&jJ(Jbe,n,{originalEvent:i},{discrete:!1})};return t.addEventListener("focusin",s),()=>t.removeEventListener("focusin",s)},[t,n]),{onFocusCapture:()=>r.current=!0,onBlurCapture:()=>r.current=!1}}function IG(){const e=new CustomEvent(jB);document.dispatchEvent(e)}function jJ(e,t,n,{discrete:r}){const s=n.originalEvent.target,i=new CustomEvent(e,{bubbles:!1,cancelable:!0,detail:n});t&&s.addEventListener(e,t,{once:!0}),r?vC(s,i):s.dispatchEvent(i)}var r0e=Hf,s0e=LJ,z3="focusScope.autoFocusOnMount",B3="focusScope.autoFocusOnUnmount",LG={bubbles:!1,cancelable:!0},i0e="FocusScope",MA=C.forwardRef((e,t)=>{const{loop:n=!1,trapped:r=!1,onMountAutoFocus:s,onUnmountAutoFocus:i,...o}=e,[a,c]=C.useState(null),d=bn(s),h=bn(i),u=C.useRef(null),f=_t(t,m=>c(m)),g=C.useRef({paused:!1,pause(){this.paused=!0},resume(){this.paused=!1}}).current;C.useEffect(()=>{if(r){let m=function(w){if(g.paused||!a)return;const E=w.target;a.contains(E)?u.current=E:th(u.current,{select:!0})},x=function(w){if(g.paused||!a)return;const E=w.relatedTarget;E!==null&&(a.contains(E)||th(u.current,{select:!0}))},y=function(w){if(document.activeElement===document.body)for(const R of w)R.removedNodes.length>0&&th(a)};document.addEventListener("focusin",m),document.addEventListener("focusout",x);const b=new MutationObserver(y);return a&&b.observe(a,{childList:!0,subtree:!0}),()=>{document.removeEventListener("focusin",m),document.removeEventListener("focusout",x),b.disconnect()}}},[r,a,g.paused]),C.useEffect(()=>{if(a){$G.add(g);const m=document.activeElement;if(!a.contains(m)){const y=new CustomEvent(z3,LG);a.addEventListener(z3,d),a.dispatchEvent(y),y.defaultPrevented||(o0e(d0e($J(a)),{select:!0}),document.activeElement===m&&th(a))}return()=>{a.removeEventListener(z3,d),setTimeout(()=>{const y=new CustomEvent(B3,LG);a.addEventListener(B3,h),a.dispatchEvent(y),y.defaultPrevented||th(m??document.body,{select:!0}),a.removeEventListener(B3,h),$G.remove(g)},0)}}},[a,d,h,g]);const v=C.useCallback(m=>{if(!n&&!r||g.paused)return;const x=m.key==="Tab"&&!m.altKey&&!m.ctrlKey&&!m.metaKey,y=document.activeElement;if(x&&y){const b=m.currentTarget,[w,E]=a0e(b);w&&E?!m.shiftKey&&y===E?(m.preventDefault(),n&&th(w,{select:!0})):m.shiftKey&&y===w&&(m.preventDefault(),n&&th(E,{select:!0})):y===b&&m.preventDefault()}},[n,r,g.paused]);return _.jsx(He.div,{tabIndex:-1,...o,ref:f,onKeyDown:v})});MA.displayName=i0e;function o0e(e,{select:t=!1}={}){const n=document.activeElement;for(const r of e)if(th(r,{select:t}),document.activeElement!==n)return}function a0e(e){const t=$J(e),n=jG(t,e),r=jG(t.reverse(),e);return[n,r]}function $J(e){const t=[],n=document.createTreeWalker(e,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();)t.push(n.currentNode);return t}function jG(e,t){for(const n of e)if(!l0e(n,{upTo:t}))return n}function l0e(e,{upTo:t}){if(getComputedStyle(e).visibility==="hidden")return!0;for(;e;){if(t!==void 0&&e===t)return!1;if(getComputedStyle(e).display==="none")return!0;e=e.parentElement}return!1}function c0e(e){return e instanceof HTMLInputElement&&"select"in e}function th(e,{select:t=!1}={}){if(e&&e.focus){const n=document.activeElement;e.focus({preventScroll:!0}),e!==n&&c0e(e)&&t&&e.select()}}var $G=u0e();function u0e(){let e=[];return{add(t){const n=e[0];t!==n&&(n==null||n.pause()),e=FG(e,t),e.unshift(t)},remove(t){var n;e=FG(e,t),(n=e[0])==null||n.resume()}}}function FG(e,t){const n=[...e],r=n.indexOf(t);return r!==-1&&n.splice(r,1),n}function d0e(e){return e.filter(t=>t.tagName!=="A")}var f0e="Portal",Dx=C.forwardRef((e,t)=>{var a;const{container:n,...r}=e,[s,i]=C.useState(!1);Rr(()=>i(!0),[]);const o=n||s&&((a=globalThis==null?void 0:globalThis.document)==null?void 0:a.body);return o?kA.createPortal(_.jsx(He.div,{...r,ref:t}),o):null});Dx.displayName=f0e;var U3=0;function uD(){C.useEffect(()=>{const e=document.querySelectorAll("[data-radix-focus-guard]");return document.body.insertAdjacentElement("afterbegin",e[0]??zG()),document.body.insertAdjacentElement("beforeend",e[1]??zG()),U3++,()=>{U3===1&&document.querySelectorAll("[data-radix-focus-guard]").forEach(t=>t.remove()),U3--}},[])}function zG(){const e=document.createElement("span");return e.setAttribute("data-radix-focus-guard",""),e.tabIndex=0,e.style.cssText="outline: none; opacity: 0; position: fixed; pointer-events: none",e}var fs=function(){return fs=Object.assign||function(t){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)&&(t[i]=n[i])}return t},fs.apply(this,arguments)};function dD(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&typeof Object.getOwnPropertySymbols=="function")for(var s=0,r=Object.getOwnPropertySymbols(e);s<r.length;s++)t.indexOf(r[s])<0&&Object.prototype.propertyIsEnumerable.call(e,r[s])&&(n[r[s]]=e[r[s]]);return n}function zH(e,t,n){if(n||arguments.length===2)for(var r=0,s=t.length,i;r<s;r++)(i||!(r in t))&&(i||(i=Array.prototype.slice.call(t,0,r)),i[r]=t[r]);return e.concat(i||Array.prototype.slice.call(t))}var Pb="right-scroll-bar-position",Nb="width-before-scroll-bar",h0e="with-scroll-bars-hidden",p0e="--removed-body-scroll-bar-size";function V3(e,t){return typeof e=="function"?e(t):e&&(e.current=t),e}function m0e(e,t){var n=C.useState(function(){return{value:e,callback:t,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=t,n.facade}var g0e=typeof window<"u"?C.useLayoutEffect:C.useEffect,BG=new WeakMap;function BH(e,t){var n=m0e(null,function(r){return e.forEach(function(s){return V3(s,r)})});return g0e(function(){var r=BG.get(n);if(r){var s=new Set(r),i=new Set(e),o=n.current;s.forEach(function(a){i.has(a)||V3(a,null)}),i.forEach(function(a){s.has(a)||V3(a,o)})}BG.set(n,e)},[e]),n}function v0e(e){return e}function y0e(e,t){t===void 0&&(t=v0e);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]:e},useMedium:function(i){var o=t(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 h=o;o=[],h.forEach(i)},d=function(){return Promise.resolve().then(c)};d(),n={push:function(h){o.push(h),d()},filter:function(h){return o=o.filter(h),n}}}};return s}function UH(e){e===void 0&&(e={});var t=y0e(null);return t.options=fs({async:!0,ssr:!1},e),t}var FJ=function(e){var t=e.sideCar,n=dD(e,["sideCar"]);if(!t)throw new Error("Sidecar: please provide `sideCar` property to import the right car");var r=t.read();if(!r)throw new Error("Sidecar medium not found");return C.createElement(r,fs({},n))};FJ.isSideCarExport=!0;function VH(e,t){return e.useMedium(t),FJ}var zJ=UH(),H3=function(){},fD=C.forwardRef(function(e,t){var n=C.useRef(null),r=C.useState({onScrollCapture:H3,onWheelCapture:H3,onTouchMoveCapture:H3}),s=r[0],i=r[1],o=e.forwardProps,a=e.children,c=e.className,d=e.removeScrollBar,h=e.enabled,u=e.shards,f=e.sideCar,g=e.noIsolation,v=e.inert,m=e.allowPinchZoom,x=e.as,y=x===void 0?"div":x,b=e.gapMode,w=dD(e,["forwardProps","children","className","removeScrollBar","enabled","shards","sideCar","noIsolation","inert","allowPinchZoom","as","gapMode"]),E=f,R=BH([n,t]),T=fs(fs({},w),s);return C.createElement(C.Fragment,null,h&&C.createElement(E,{sideCar:zJ,removeScrollBar:d,shards:u,noIsolation:g,inert:v,setCallbacks:i,allowPinchZoom:!!m,lockRef:n,gapMode:b}),o?C.cloneElement(C.Children.only(a),fs(fs({},T),{ref:R})):C.createElement(y,fs({},T,{className:c,ref:R}),a))});fD.defaultProps={enabled:!0,removeScrollBar:!0,inert:!1};fD.classNames={fullWidth:Nb,zeroRight:Pb};var b0e=function(){if(typeof __webpack_nonce__<"u")return __webpack_nonce__};function x0e(){if(!document)return null;var e=document.createElement("style");e.type="text/css";var t=b0e();return t&&e.setAttribute("nonce",t),e}function _0e(e,t){e.styleSheet?e.styleSheet.cssText=t:e.appendChild(document.createTextNode(t))}function w0e(e){var t=document.head||document.getElementsByTagName("head")[0];t.appendChild(e)}var S0e=function(){var e=0,t=null;return{add:function(n){e==0&&(t=x0e())&&(_0e(t,n),w0e(t)),e++},remove:function(){e--,!e&&t&&(t.parentNode&&t.parentNode.removeChild(t),t=null)}}},C0e=function(){var e=S0e();return function(t,n){C.useEffect(function(){return e.add(t),function(){e.remove()}},[t&&n])}},hD=function(){var e=C0e(),t=function(n){var r=n.styles,s=n.dynamic;return e(r,s),null};return t},E0e={left:0,top:0,right:0,gap:0},W3=function(e){return parseInt(e||"",10)||0},A0e=function(e){var t=window.getComputedStyle(document.body),n=t[e==="padding"?"paddingLeft":"marginLeft"],r=t[e==="padding"?"paddingTop":"marginTop"],s=t[e==="padding"?"paddingRight":"marginRight"];return[W3(n),W3(r),W3(s)]},R0e=function(e){if(e===void 0&&(e="margin"),typeof window>"u")return E0e;var t=A0e(e),n=document.documentElement.clientWidth,r=window.innerWidth;return{left:t[0],top:t[1],right:t[2],gap:Math.max(0,r-n+t[2]-t[0])}},P0e=hD(),Tb="data-scroll-locked",N0e=function(e,t,n,r){var s=e.left,i=e.top,o=e.right,a=e.gap;return n===void 0&&(n="margin"),`
|
||
.`.concat(h0e,` {
|
||
overflow: hidden `).concat(r,`;
|
||
padding-right: `).concat(a,"px ").concat(r,`;
|
||
}
|
||
body[`).concat(Tb,`] {
|
||
overflow: hidden `).concat(r,`;
|
||
overscroll-behavior: contain;
|
||
`).concat([t&&"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(Pb,` {
|
||
right: `).concat(a,"px ").concat(r,`;
|
||
}
|
||
|
||
.`).concat(Nb,` {
|
||
margin-right: `).concat(a,"px ").concat(r,`;
|
||
}
|
||
|
||
.`).concat(Pb," .").concat(Pb,` {
|
||
right: 0 `).concat(r,`;
|
||
}
|
||
|
||
.`).concat(Nb," .").concat(Nb,` {
|
||
margin-right: 0 `).concat(r,`;
|
||
}
|
||
|
||
body[`).concat(Tb,`] {
|
||
`).concat(p0e,": ").concat(a,`px;
|
||
}
|
||
`)},UG=function(){var e=parseInt(document.body.getAttribute(Tb)||"0",10);return isFinite(e)?e:0},T0e=function(){C.useEffect(function(){return document.body.setAttribute(Tb,(UG()+1).toString()),function(){var e=UG()-1;e<=0?document.body.removeAttribute(Tb):document.body.setAttribute(Tb,e.toString())}},[])},HH=function(e){var t=e.noRelative,n=e.noImportant,r=e.gapMode,s=r===void 0?"margin":r;T0e();var i=C.useMemo(function(){return R0e(s)},[s]);return C.createElement(P0e,{styles:N0e(i,!t,s,n?"":"!important")})},$B=!1;if(typeof window<"u")try{var XR=Object.defineProperty({},"passive",{get:function(){return $B=!0,!0}});window.addEventListener("test",XR,XR),window.removeEventListener("test",XR,XR)}catch{$B=!1}var Ny=$B?{passive:!1}:!1,k0e=function(e){return e.tagName==="TEXTAREA"},BJ=function(e,t){var n=window.getComputedStyle(e);return n[t]!=="hidden"&&!(n.overflowY===n.overflowX&&!k0e(e)&&n[t]==="visible")},D0e=function(e){return BJ(e,"overflowY")},O0e=function(e){return BJ(e,"overflowX")},VG=function(e,t){var n=t.ownerDocument,r=t;do{typeof ShadowRoot<"u"&&r instanceof ShadowRoot&&(r=r.host);var s=UJ(e,r);if(s){var i=VJ(e,r),o=i[1],a=i[2];if(o>a)return!0}r=r.parentNode}while(r&&r!==n.body);return!1},M0e=function(e){var t=e.scrollTop,n=e.scrollHeight,r=e.clientHeight;return[t,n,r]},I0e=function(e){var t=e.scrollLeft,n=e.scrollWidth,r=e.clientWidth;return[t,n,r]},UJ=function(e,t){return e==="v"?D0e(t):O0e(t)},VJ=function(e,t){return e==="v"?M0e(t):I0e(t)},L0e=function(e,t){return e==="h"&&t==="rtl"?-1:1},j0e=function(e,t,n,r,s){var i=L0e(e,window.getComputedStyle(t).direction),o=i*r,a=n.target,c=t.contains(a),d=!1,h=o>0,u=0,f=0;do{var g=VJ(e,a),v=g[0],m=g[1],x=g[2],y=m-x-i*v;(v||y)&&UJ(e,a)&&(u+=y,f+=v),a instanceof ShadowRoot?a=a.host:a=a.parentNode}while(!c&&a!==document.body||c&&(t.contains(a)||t===a));return(h&&Math.abs(u)<1||!h&&Math.abs(f)<1)&&(d=!0),d},QR=function(e){return"changedTouches"in e?[e.changedTouches[0].clientX,e.changedTouches[0].clientY]:[0,0]},HG=function(e){return[e.deltaX,e.deltaY]},WG=function(e){return e&&"current"in e?e.current:e},$0e=function(e,t){return e[0]===t[0]&&e[1]===t[1]},F0e=function(e){return`
|
||
.block-interactivity-`.concat(e,` {pointer-events: none;}
|
||
.allow-interactivity-`).concat(e,` {pointer-events: all;}
|
||
`)},z0e=0,Ty=[];function B0e(e){var t=C.useRef([]),n=C.useRef([0,0]),r=C.useRef(),s=C.useState(z0e++)[0],i=C.useState(hD)[0],o=C.useRef(e);C.useEffect(function(){o.current=e},[e]),C.useEffect(function(){if(e.inert){document.body.classList.add("block-interactivity-".concat(s));var m=zH([e.lockRef.current],(e.shards||[]).map(WG),!0).filter(Boolean);return m.forEach(function(x){return x.classList.add("allow-interactivity-".concat(s))}),function(){document.body.classList.remove("block-interactivity-".concat(s)),m.forEach(function(x){return x.classList.remove("allow-interactivity-".concat(s))})}}},[e.inert,e.lockRef.current,e.shards]);var a=C.useCallback(function(m,x){if("touches"in m&&m.touches.length===2)return!o.current.allowPinchZoom;var y=QR(m),b=n.current,w="deltaX"in m?m.deltaX:b[0]-y[0],E="deltaY"in m?m.deltaY:b[1]-y[1],R,T=m.target,N=Math.abs(w)>Math.abs(E)?"h":"v";if("touches"in m&&N==="h"&&T.type==="range")return!1;var A=VG(N,T);if(!A)return!0;if(A?R=N:(R=N==="v"?"h":"v",A=VG(N,T)),!A)return!1;if(!r.current&&"changedTouches"in m&&(w||E)&&(r.current=R),!R)return!0;var D=r.current||R;return j0e(D,x,m,D==="h"?w:E)},[]),c=C.useCallback(function(m){var x=m;if(!(!Ty.length||Ty[Ty.length-1]!==i)){var y="deltaY"in x?HG(x):QR(x),b=t.current.filter(function(R){return R.name===x.type&&(R.target===x.target||x.target===R.shadowParent)&&$0e(R.delta,y)})[0];if(b&&b.should){x.cancelable&&x.preventDefault();return}if(!b){var w=(o.current.shards||[]).map(WG).filter(Boolean).filter(function(R){return R.contains(x.target)}),E=w.length>0?a(x,w[0]):!o.current.noIsolation;E&&x.cancelable&&x.preventDefault()}}},[]),d=C.useCallback(function(m,x,y,b){var w={name:m,delta:x,target:y,should:b,shadowParent:U0e(y)};t.current.push(w),setTimeout(function(){t.current=t.current.filter(function(E){return E!==w})},1)},[]),h=C.useCallback(function(m){n.current=QR(m),r.current=void 0},[]),u=C.useCallback(function(m){d(m.type,HG(m),m.target,a(m,e.lockRef.current))},[]),f=C.useCallback(function(m){d(m.type,QR(m),m.target,a(m,e.lockRef.current))},[]);C.useEffect(function(){return Ty.push(i),e.setCallbacks({onScrollCapture:u,onWheelCapture:u,onTouchMoveCapture:f}),document.addEventListener("wheel",c,Ny),document.addEventListener("touchmove",c,Ny),document.addEventListener("touchstart",h,Ny),function(){Ty=Ty.filter(function(m){return m!==i}),document.removeEventListener("wheel",c,Ny),document.removeEventListener("touchmove",c,Ny),document.removeEventListener("touchstart",h,Ny)}},[]);var g=e.removeScrollBar,v=e.inert;return C.createElement(C.Fragment,null,v?C.createElement(i,{styles:F0e(s)}):null,g?C.createElement(HH,{gapMode:e.gapMode}):null)}function U0e(e){for(var t=null;e!==null;)e instanceof ShadowRoot&&(t=e.host,e=e.host),e=e.parentNode;return t}const V0e=VH(zJ,B0e);var IA=C.forwardRef(function(e,t){return C.createElement(fD,fs({},e,{ref:t,sideCar:V0e}))});IA.classNames=fD.classNames;var H0e=function(e){if(typeof document>"u")return null;var t=Array.isArray(e)?e[0]:e;return t.ownerDocument.body},ky=new WeakMap,ZR=new WeakMap,JR={},q3=0,HJ=function(e){return e&&(e.host||HJ(e.parentNode))},W0e=function(e,t){return t.map(function(n){if(e.contains(n))return n;var r=HJ(n);return r&&e.contains(r)?r:(console.error("aria-hidden",n,"in not contained inside",e,". Doing nothing"),null)}).filter(function(n){return!!n})},q0e=function(e,t,n,r){var s=W0e(t,Array.isArray(e)?e:[e]);JR[n]||(JR[n]=new WeakMap);var i=JR[n],o=[],a=new Set,c=new Set(s),d=function(u){!u||a.has(u)||(a.add(u),d(u.parentNode))};s.forEach(d);var h=function(u){!u||c.has(u)||Array.prototype.forEach.call(u.children,function(f){if(a.has(f))h(f);else try{var g=f.getAttribute(r),v=g!==null&&g!=="false",m=(ky.get(f)||0)+1,x=(i.get(f)||0)+1;ky.set(f,m),i.set(f,x),o.push(f),m===1&&v&&ZR.set(f,!0),x===1&&f.setAttribute(n,"true"),v||f.setAttribute(r,"true")}catch(y){console.error("aria-hidden: cannot operate on ",f,y)}})};return h(t),a.clear(),q3++,function(){o.forEach(function(u){var f=ky.get(u)-1,g=i.get(u)-1;ky.set(u,f),i.set(u,g),f||(ZR.has(u)||u.removeAttribute(r),ZR.delete(u)),g||u.removeAttribute(n)}),q3--,q3||(ky=new WeakMap,ky=new WeakMap,ZR=new WeakMap,JR={})}},Ox=function(e,t,n){n===void 0&&(n="data-aria-hidden");var r=Array.from(Array.isArray(e)?e:[e]),s=H0e(e);return s?(r.push.apply(r,Array.from(s.querySelectorAll("[aria-live]"))),q0e(r,s,n,"aria-hidden")):function(){return null}},WH="Dialog",[WJ,qJ]=_r(WH),[G0e,Dc]=WJ(WH),GJ=e=>{const{__scopeDialog:t,children:n,open:r,defaultOpen:s,onOpenChange:i,modal:o=!0}=e,a=C.useRef(null),c=C.useRef(null),[d=!1,h]=os({prop:r,defaultProp:s,onChange:i});return _.jsx(G0e,{scope:t,triggerRef:a,contentRef:c,contentId:si(),titleId:si(),descriptionId:si(),open:d,onOpenChange:h,onOpenToggle:C.useCallback(()=>h(u=>!u),[h]),modal:o,children:n})};GJ.displayName=WH;var KJ="DialogTrigger",YJ=C.forwardRef((e,t)=>{const{__scopeDialog:n,...r}=e,s=Dc(KJ,n),i=_t(t,s.triggerRef);return _.jsx(He.button,{type:"button","aria-haspopup":"dialog","aria-expanded":s.open,"aria-controls":s.contentId,"data-state":YH(s.open),...r,ref:i,onClick:Ae(e.onClick,s.onOpenToggle)})});YJ.displayName=KJ;var qH="DialogPortal",[K0e,XJ]=WJ(qH,{forceMount:void 0}),QJ=e=>{const{__scopeDialog:t,forceMount:n,children:r,container:s}=e,i=Dc(qH,t);return _.jsx(K0e,{scope:t,forceMount:n,children:C.Children.map(r,o=>_.jsx(Vr,{present:n||i.open,children:_.jsx(Dx,{asChild:!0,container:s,children:o})}))})};QJ.displayName=qH;var pT="DialogOverlay",ZJ=C.forwardRef((e,t)=>{const n=XJ(pT,e.__scopeDialog),{forceMount:r=n.forceMount,...s}=e,i=Dc(pT,e.__scopeDialog);return i.modal?_.jsx(Vr,{present:r||i.open,children:_.jsx(Y0e,{...s,ref:t})}):null});ZJ.displayName=pT;var Y0e=C.forwardRef((e,t)=>{const{__scopeDialog:n,...r}=e,s=Dc(pT,n);return _.jsx(IA,{as:Cc,allowPinchZoom:!0,shards:[s.contentRef],children:_.jsx(He.div,{"data-state":YH(s.open),...r,ref:t,style:{pointerEvents:"auto",...r.style}})})}),$v="DialogContent",JJ=C.forwardRef((e,t)=>{const n=XJ($v,e.__scopeDialog),{forceMount:r=n.forceMount,...s}=e,i=Dc($v,e.__scopeDialog);return _.jsx(Vr,{present:r||i.open,children:i.modal?_.jsx(X0e,{...s,ref:t}):_.jsx(Q0e,{...s,ref:t})})});JJ.displayName=$v;var X0e=C.forwardRef((e,t)=>{const n=Dc($v,e.__scopeDialog),r=C.useRef(null),s=_t(t,n.contentRef,r);return C.useEffect(()=>{const i=r.current;if(i)return Ox(i)},[]),_.jsx(eee,{...e,ref:s,trapFocus:n.open,disableOutsidePointerEvents:!0,onCloseAutoFocus:Ae(e.onCloseAutoFocus,i=>{var o;i.preventDefault(),(o=n.triggerRef.current)==null||o.focus()}),onPointerDownOutside:Ae(e.onPointerDownOutside,i=>{const o=i.detail.originalEvent,a=o.button===0&&o.ctrlKey===!0;(o.button===2||a)&&i.preventDefault()}),onFocusOutside:Ae(e.onFocusOutside,i=>i.preventDefault())})}),Q0e=C.forwardRef((e,t)=>{const n=Dc($v,e.__scopeDialog),r=C.useRef(!1),s=C.useRef(!1);return _.jsx(eee,{...e,ref:t,trapFocus:!1,disableOutsidePointerEvents:!1,onCloseAutoFocus:i=>{var o,a;(o=e.onCloseAutoFocus)==null||o.call(e,i),i.defaultPrevented||(r.current||(a=n.triggerRef.current)==null||a.focus(),i.preventDefault()),r.current=!1,s.current=!1},onInteractOutside:i=>{var c,d;(c=e.onInteractOutside)==null||c.call(e,i),i.defaultPrevented||(r.current=!0,i.detail.originalEvent.type==="pointerdown"&&(s.current=!0));const o=i.target;((d=n.triggerRef.current)==null?void 0:d.contains(o))&&i.preventDefault(),i.detail.originalEvent.type==="focusin"&&s.current&&i.preventDefault()}})}),eee=C.forwardRef((e,t)=>{const{__scopeDialog:n,trapFocus:r,onOpenAutoFocus:s,onCloseAutoFocus:i,...o}=e,a=Dc($v,n),c=C.useRef(null),d=_t(t,c);return uD(),_.jsxs(_.Fragment,{children:[_.jsx(MA,{asChild:!0,loop:!0,trapped:r,onMountAutoFocus:s,onUnmountAutoFocus:i,children:_.jsx(Hf,{role:"dialog",id:a.contentId,"aria-describedby":a.descriptionId,"aria-labelledby":a.titleId,"data-state":YH(a.open),...o,ref:d,onDismiss:()=>a.onOpenChange(!1)})}),_.jsxs(_.Fragment,{children:[_.jsx(J0e,{titleId:a.titleId}),_.jsx(txe,{contentRef:c,descriptionId:a.descriptionId})]})]})}),GH="DialogTitle",tee=C.forwardRef((e,t)=>{const{__scopeDialog:n,...r}=e,s=Dc(GH,n);return _.jsx(He.h2,{id:s.titleId,...r,ref:t})});tee.displayName=GH;var nee="DialogDescription",KH=C.forwardRef((e,t)=>{const{__scopeDialog:n,...r}=e,s=Dc(nee,n);return _.jsx(He.p,{id:s.descriptionId,...r,ref:t})});KH.displayName=nee;var ree="DialogClose",see=C.forwardRef((e,t)=>{const{__scopeDialog:n,...r}=e,s=Dc(ree,n);return _.jsx(He.button,{type:"button",...r,ref:t,onClick:Ae(e.onClick,()=>s.onOpenChange(!1))})});see.displayName=ree;function YH(e){return e?"open":"closed"}var iee="DialogTitleWarning",[Z0e,oee]=hye(iee,{contentName:$v,titleName:GH,docsSlug:"dialog"}),J0e=({titleId:e})=>{const t=oee(iee),n=`\`${t.contentName}\` requires a \`${t.titleName}\` for the component to be accessible for screen reader users.
|
||
|
||
If you want to hide the \`${t.titleName}\`, you can wrap it with our VisuallyHidden component.
|
||
|
||
For more information, see https://radix-ui.com/primitives/docs/components/${t.docsSlug}`;return C.useEffect(()=>{e&&(document.getElementById(e)||console.error(n))},[n,e]),null},exe="DialogDescriptionWarning",txe=({contentRef:e,descriptionId:t})=>{const r=`Warning: Missing \`Description\` or \`aria-describedby={undefined}\` for {${oee(exe).contentName}}.`;return C.useEffect(()=>{var i;const s=(i=e.current)==null?void 0:i.getAttribute("aria-describedby");t&&s&&(document.getElementById(t)||console.warn(r))},[r,e,t]),null},XH=GJ,QH=YJ,ZH=QJ,LA=ZJ,jA=JJ,$A=tee,FA=KH,zA=see,aee="AlertDialog",[nxe,r7e]=_r(aee,[qJ]),Wf=qJ(),lee=e=>{const{__scopeAlertDialog:t,...n}=e,r=Wf(t);return _.jsx(XH,{...r,...n,modal:!0})};lee.displayName=aee;var rxe="AlertDialogTrigger",cee=C.forwardRef((e,t)=>{const{__scopeAlertDialog:n,...r}=e,s=Wf(n);return _.jsx(QH,{...s,...r,ref:t})});cee.displayName=rxe;var sxe="AlertDialogPortal",uee=e=>{const{__scopeAlertDialog:t,...n}=e,r=Wf(t);return _.jsx(ZH,{...r,...n})};uee.displayName=sxe;var ixe="AlertDialogOverlay",dee=C.forwardRef((e,t)=>{const{__scopeAlertDialog:n,...r}=e,s=Wf(n);return _.jsx(LA,{...s,...r,ref:t})});dee.displayName=ixe;var kb="AlertDialogContent",[oxe,axe]=nxe(kb),fee=C.forwardRef((e,t)=>{const{__scopeAlertDialog:n,children:r,...s}=e,i=Wf(n),o=C.useRef(null),a=_t(t,o),c=C.useRef(null);return _.jsx(Z0e,{contentName:kb,titleName:hee,docsSlug:"alert-dialog",children:_.jsx(oxe,{scope:n,cancelRef:c,children:_.jsxs(jA,{role:"alertdialog",...i,...s,ref:a,onOpenAutoFocus:Ae(s.onOpenAutoFocus,d=>{var h;d.preventDefault(),(h=c.current)==null||h.focus({preventScroll:!0})}),onPointerDownOutside:d=>d.preventDefault(),onInteractOutside:d=>d.preventDefault(),children:[_.jsx(CH,{children:r}),_.jsx(cxe,{contentRef:o})]})})})});fee.displayName=kb;var hee="AlertDialogTitle",pee=C.forwardRef((e,t)=>{const{__scopeAlertDialog:n,...r}=e,s=Wf(n);return _.jsx($A,{...s,...r,ref:t})});pee.displayName=hee;var mee="AlertDialogDescription",gee=C.forwardRef((e,t)=>{const{__scopeAlertDialog:n,...r}=e,s=Wf(n);return _.jsx(FA,{...s,...r,ref:t})});gee.displayName=mee;var lxe="AlertDialogAction",vee=C.forwardRef((e,t)=>{const{__scopeAlertDialog:n,...r}=e,s=Wf(n);return _.jsx(zA,{...s,...r,ref:t})});vee.displayName=lxe;var yee="AlertDialogCancel",bee=C.forwardRef((e,t)=>{const{__scopeAlertDialog:n,...r}=e,{cancelRef:s}=axe(yee,n),i=Wf(n),o=_t(t,s);return _.jsx(zA,{...i,...r,ref:o})});bee.displayName=yee;var cxe=({contentRef:e})=>{const t=`\`${kb}\` requires a description for the component to be accessible for screen reader users.
|
||
|
||
You can add a description to the \`${kb}\` by passing a \`${mee}\` 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 \`${kb}\`. 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 C.useEffect(()=>{var r;document.getElementById((r=e.current)==null?void 0:r.getAttribute("aria-describedby"))||console.warn(t)},[t,e]),null},uxe=lee,dxe=cee,fxe=uee,xee=dee,_ee=fee,wee=vee,See=bee,Cee=pee,Eee=gee;const yC=Io("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"}}),at=C.forwardRef(({className:e,variant:t,size:n,asChild:r=!1,...s},i)=>{const o=r?Cc:"button";return _.jsx(o,{className:ge(yC({variant:t,size:n,className:e})),ref:i,...s})});at.displayName="Button";const JH=uxe,hxe=dxe,pxe=fxe,Aee=C.forwardRef(({className:e,...t},n)=>_.jsx(xee,{className:ge("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",e),...t,ref:n}));Aee.displayName=xee.displayName;const pD=C.forwardRef(({className:e,...t},n)=>_.jsxs(pxe,{children:[_.jsx(Aee,{}),_.jsx(_ee,{ref:n,className:ge("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",e),...t})]}));pD.displayName=_ee.displayName;const mD=({className:e,...t})=>_.jsx("div",{className:ge("flex flex-col space-y-2 text-center sm:text-left",e),...t});mD.displayName="AlertDialogHeader";const gD=({className:e,...t})=>_.jsx("div",{className:ge("flex flex-col-reverse sm:flex-row sm:justify-end sm:space-x-2",e),...t});gD.displayName="AlertDialogFooter";const vD=C.forwardRef(({className:e,...t},n)=>_.jsx(Cee,{ref:n,className:ge("text-lg font-semibold",e),...t}));vD.displayName=Cee.displayName;const yD=C.forwardRef(({className:e,...t},n)=>_.jsx(Eee,{ref:n,className:ge("text-sm text-muted-foreground",e),...t}));yD.displayName=Eee.displayName;const bD=C.forwardRef(({className:e,...t},n)=>_.jsx(wee,{ref:n,className:ge(yC(),e),...t}));bD.displayName=wee.displayName;const xD=C.forwardRef(({className:e,...t},n)=>_.jsx(See,{ref:n,className:ge(yC({variant:"outline"}),"mt-2 sm:mt-0",e),...t}));xD.displayName=See.displayName;const mxe=({textAreaRef:e,triggerAutoSize:t,maxHeight:n=Number.MAX_SAFE_INTEGER,minHeight:r=0})=>{const[s,i]=C.useState(!0);C.useEffect(()=>{if(e){s&&(e.style.minHeight=`${r+2}px`,n>r&&(e.style.maxHeight=`${n}px`),i(!1)),e.style.height=`${r+2}px`;const a=e.scrollHeight;a>n?e.style.height=`${n}px`:e.style.height=`${a+2}px`}},[e,t,s,n,r])},Ree=C.forwardRef(({maxHeight:e=Number.MAX_SAFE_INTEGER,minHeight:t=52,className:n,onChange:r,value:s,...i},o)=>{const a=C.useRef(null),[c,d]=C.useState("");return mxe({textAreaRef:a.current,triggerAutoSize:c,maxHeight:e,minHeight:t}),C.useImperativeHandle(o,()=>({textArea:a.current,focus:()=>{var h;return(h=a.current)==null?void 0:h.focus()},maxHeight:e,minHeight:t})),C.useEffect(()=>{(s||i!=null&&i.defaultValue)&&d(s)},[s||(i==null?void 0:i.defaultValue)]),_.jsx("textarea",{...i,value:s,ref:a,className:ge("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:h=>{d(h.target.value),r==null||r(h)}})});Ree.displayName="AutosizeTextarea";var e6="Avatar",[gxe,s7e]=_r(e6),[vxe,Pee]=gxe(e6),Nee=C.forwardRef((e,t)=>{const{__scopeAvatar:n,...r}=e,[s,i]=C.useState("idle");return _.jsx(vxe,{scope:n,imageLoadingStatus:s,onImageLoadingStatusChange:i,children:_.jsx(He.span,{...r,ref:t})})});Nee.displayName=e6;var Tee="AvatarImage",kee=C.forwardRef((e,t)=>{const{__scopeAvatar:n,src:r,onLoadingStatusChange:s=()=>{},...i}=e,o=Pee(Tee,n),a=yxe(r),c=bn(d=>{s(d),o.onImageLoadingStatusChange(d)});return Rr(()=>{a!=="idle"&&c(a)},[a,c]),a==="loaded"?_.jsx(He.img,{...i,ref:t,src:r}):null});kee.displayName=Tee;var Dee="AvatarFallback",Oee=C.forwardRef((e,t)=>{const{__scopeAvatar:n,delayMs:r,...s}=e,i=Pee(Dee,n),[o,a]=C.useState(r===void 0);return C.useEffect(()=>{if(r!==void 0){const c=window.setTimeout(()=>a(!0),r);return()=>window.clearTimeout(c)}},[r]),o&&i.imageLoadingStatus!=="loaded"?_.jsx(He.span,{...s,ref:t}):null});Oee.displayName=Dee;function yxe(e){const[t,n]=C.useState("idle");return Rr(()=>{if(!e){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=e,()=>{r=!1}},[e]),t}var Mee=Nee,Iee=kee,Lee=Oee;const bxe=C.forwardRef(({className:e,...t},n)=>_.jsx(Mee,{ref:n,className:ge("relative flex h-10 w-10 shrink-0 overflow-hidden rounded-full",e),...t}));bxe.displayName=Mee.displayName;const xxe=C.forwardRef(({className:e,...t},n)=>_.jsx(Iee,{ref:n,className:ge("aspect-square h-full w-full",e),...t}));xxe.displayName=Iee.displayName;const _xe=C.forwardRef(({className:e,...t},n)=>_.jsx(Lee,{ref:n,className:ge("flex h-full w-full items-center justify-center rounded-full bg-muted",e),...t}));_xe.displayName=Lee.displayName;const wxe=Io("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 _D({className:e,variant:t,...n}){return _.jsx("div",{className:ge(wxe({variant:t}),e),...n})}const Sxe=C.forwardRef(({...e},t)=>_.jsx("nav",{ref:t,"aria-label":"breadcrumb",...e}));Sxe.displayName="Breadcrumb";const Cxe=C.forwardRef(({className:e,...t},n)=>_.jsx("ol",{ref:n,className:ge("flex flex-wrap items-center gap-1.5 break-words text-sm text-muted-foreground sm:gap-2.5",e),...t}));Cxe.displayName="BreadcrumbList";const Exe=C.forwardRef(({className:e,...t},n)=>_.jsx("li",{ref:n,className:ge("inline-flex items-center gap-1.5",e),...t}));Exe.displayName="BreadcrumbItem";const Axe=C.forwardRef(({asChild:e,className:t,...n},r)=>{const s=e?Cc:"a";return _.jsx(s,{ref:r,className:ge("transition-colors hover:text-foreground",t),...n})});Axe.displayName="BreadcrumbLink";const Rxe=C.forwardRef(({className:e,...t},n)=>_.jsx("span",{ref:n,role:"link","aria-disabled":"true","aria-current":"page",className:ge("font-normal text-foreground",e),...t}));Rxe.displayName="BreadcrumbPage";function Pn(e){const t=Object.prototype.toString.call(e);return e instanceof Date||typeof e=="object"&&t==="[object Date]"?new e.constructor(+e):typeof e=="number"||t==="[object Number]"||typeof e=="string"||t==="[object String]"?new Date(e):new Date(NaN)}function Za(e,t){return e instanceof Date?new e.constructor(t):new Date(t)}function Co(e,t){const n=Pn(e);return isNaN(t)?Za(e,NaN):(t&&n.setDate(n.getDate()+t),n)}function Ec(e,t){const n=Pn(e);if(isNaN(t))return Za(e,NaN);if(!t)return n;const r=n.getDate(),s=Za(e,n.getTime());s.setMonth(n.getMonth()+t+1,0);const i=s.getDate();return r>=i?s:(n.setFullYear(s.getFullYear(),s.getMonth(),r),n)}const t6=6048e5,Pxe=864e5;let Nxe={};function BA(){return Nxe}function Ru(e,t){var a,c,d,h;const n=BA(),r=(t==null?void 0:t.weekStartsOn)??((c=(a=t==null?void 0:t.locale)==null?void 0:a.options)==null?void 0:c.weekStartsOn)??n.weekStartsOn??((h=(d=n.locale)==null?void 0:d.options)==null?void 0:h.weekStartsOn)??0,s=Pn(e),i=s.getDay(),o=(i<r?7:0)+i-r;return s.setDate(s.getDate()-o),s.setHours(0,0,0,0),s}function Fv(e){return Ru(e,{weekStartsOn:1})}function jee(e){const t=Pn(e),n=t.getFullYear(),r=Za(e,0);r.setFullYear(n+1,0,4),r.setHours(0,0,0,0);const s=Fv(r),i=Za(e,0);i.setFullYear(n,0,4),i.setHours(0,0,0,0);const o=Fv(i);return t.getTime()>=s.getTime()?n+1:t.getTime()>=o.getTime()?n:n-1}function ix(e){const t=Pn(e);return t.setHours(0,0,0,0),t}function mT(e){const t=Pn(e),n=new Date(Date.UTC(t.getFullYear(),t.getMonth(),t.getDate(),t.getHours(),t.getMinutes(),t.getSeconds(),t.getMilliseconds()));return n.setUTCFullYear(t.getFullYear()),+e-+n}function gu(e,t){const n=ix(e),r=ix(t),s=+n-mT(n),i=+r-mT(r);return Math.round((s-i)/Pxe)}function Txe(e){const t=jee(e),n=Za(e,0);return n.setFullYear(t,0,4),n.setHours(0,0,0,0),Fv(n)}function FB(e,t){const n=t*7;return Co(e,n)}function kxe(e,t){return Ec(e,t*12)}function Dxe(e){let t;return e.forEach(function(n){const r=Pn(n);(t===void 0||t<r||isNaN(Number(r)))&&(t=r)}),t||new Date(NaN)}function Oxe(e){let t;return e.forEach(n=>{const r=Pn(n);(!t||t>r||isNaN(+r))&&(t=r)}),t||new Date(NaN)}function Qo(e,t){const n=ix(e),r=ix(t);return+n==+r}function n6(e){return e instanceof Date||typeof e=="object"&&Object.prototype.toString.call(e)==="[object Date]"}function Mxe(e){if(!n6(e)&&typeof e!="number")return!1;const t=Pn(e);return!isNaN(Number(t))}function bC(e,t){const n=Pn(e),r=Pn(t),s=n.getFullYear()-r.getFullYear(),i=n.getMonth()-r.getMonth();return s*12+i}function Ixe(e,t,n){const r=Ru(e,n),s=Ru(t,n),i=+r-mT(r),o=+s-mT(s);return Math.round((i-o)/t6)}function r6(e){const t=Pn(e),n=t.getMonth();return t.setFullYear(t.getFullYear(),n+1,0),t.setHours(23,59,59,999),t}function sa(e){const t=Pn(e);return t.setDate(1),t.setHours(0,0,0,0),t}function $ee(e){const t=Pn(e),n=Za(e,0);return n.setFullYear(t.getFullYear(),0,1),n.setHours(0,0,0,0),n}function s6(e,t){var a,c,d,h;const n=BA(),r=(t==null?void 0:t.weekStartsOn)??((c=(a=t==null?void 0:t.locale)==null?void 0:a.options)==null?void 0:c.weekStartsOn)??n.weekStartsOn??((h=(d=n.locale)==null?void 0:d.options)==null?void 0:h.weekStartsOn)??0,s=Pn(e),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 Fee(e){return s6(e,{weekStartsOn:1})}const Lxe={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"}},jxe=(e,t,n)=>{let r;const s=Lxe[e];return typeof s=="string"?r=s:t===1?r=s.one:r=s.other.replace("{{count}}",t.toString()),n!=null&&n.addSuffix?n.comparison&&n.comparison>0?"in "+r:r+" ago":r};function G3(e){return(t={})=>{const n=t.width?String(t.width):e.defaultWidth;return e.formats[n]||e.formats[e.defaultWidth]}}const $xe={full:"EEEE, MMMM do, y",long:"MMMM do, y",medium:"MMM d, y",short:"MM/dd/yyyy"},Fxe={full:"h:mm:ss a zzzz",long:"h:mm:ss a z",medium:"h:mm:ss a",short:"h:mm a"},zxe={full:"{{date}} 'at' {{time}}",long:"{{date}} 'at' {{time}}",medium:"{{date}}, {{time}}",short:"{{date}}, {{time}}"},Bxe={date:G3({formats:$xe,defaultWidth:"full"}),time:G3({formats:Fxe,defaultWidth:"full"}),dateTime:G3({formats:zxe,defaultWidth:"full"})},Uxe={lastWeek:"'last' eeee 'at' p",yesterday:"'yesterday at' p",today:"'today at' p",tomorrow:"'tomorrow at' p",nextWeek:"eeee 'at' p",other:"P"},Vxe=(e,t,n,r)=>Uxe[e];function IS(e){return(t,n)=>{const r=n!=null&&n.context?String(n.context):"standalone";let s;if(r==="formatting"&&e.formattingValues){const o=e.defaultFormattingWidth||e.defaultWidth,a=n!=null&&n.width?String(n.width):o;s=e.formattingValues[a]||e.formattingValues[o]}else{const o=e.defaultWidth,a=n!=null&&n.width?String(n.width):e.defaultWidth;s=e.values[a]||e.values[o]}const i=e.argumentCallback?e.argumentCallback(t):t;return s[i]}}const Hxe={narrow:["B","A"],abbreviated:["BC","AD"],wide:["Before Christ","Anno Domini"]},Wxe={narrow:["1","2","3","4"],abbreviated:["Q1","Q2","Q3","Q4"],wide:["1st quarter","2nd quarter","3rd quarter","4th quarter"]},qxe={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"]},Gxe={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"]},Kxe={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"}},Yxe={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"}},Xxe=(e,t)=>{const n=Number(e),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"},Qxe={ordinalNumber:Xxe,era:IS({values:Hxe,defaultWidth:"wide"}),quarter:IS({values:Wxe,defaultWidth:"wide",argumentCallback:e=>e-1}),month:IS({values:qxe,defaultWidth:"wide"}),day:IS({values:Gxe,defaultWidth:"wide"}),dayPeriod:IS({values:Kxe,defaultWidth:"wide",formattingValues:Yxe,defaultFormattingWidth:"wide"})};function LS(e){return(t,n={})=>{const r=n.width,s=r&&e.matchPatterns[r]||e.matchPatterns[e.defaultMatchWidth],i=t.match(s);if(!i)return null;const o=i[0],a=r&&e.parsePatterns[r]||e.parsePatterns[e.defaultParseWidth],c=Array.isArray(a)?Jxe(a,u=>u.test(o)):Zxe(a,u=>u.test(o));let d;d=e.valueCallback?e.valueCallback(c):c,d=n.valueCallback?n.valueCallback(d):d;const h=t.slice(o.length);return{value:d,rest:h}}}function Zxe(e,t){for(const n in e)if(Object.prototype.hasOwnProperty.call(e,n)&&t(e[n]))return n}function Jxe(e,t){for(let n=0;n<e.length;n++)if(t(e[n]))return n}function e_e(e){return(t,n={})=>{const r=t.match(e.matchPattern);if(!r)return null;const s=r[0],i=t.match(e.parsePattern);if(!i)return null;let o=e.valueCallback?e.valueCallback(i[0]):i[0];o=n.valueCallback?n.valueCallback(o):o;const a=t.slice(s.length);return{value:o,rest:a}}}const t_e=/^(\d+)(th|st|nd|rd)?/i,n_e=/\d+/i,r_e={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},s_e={any:[/^b/i,/^(a|c)/i]},i_e={narrow:/^[1234]/i,abbreviated:/^q[1234]/i,wide:/^[1234](th|st|nd|rd)? quarter/i},o_e={any:[/1/i,/2/i,/3/i,/4/i]},a_e={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},l_e={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]},c_e={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},u_e={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]},d_e={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},f_e={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}},h_e={ordinalNumber:e_e({matchPattern:t_e,parsePattern:n_e,valueCallback:e=>parseInt(e,10)}),era:LS({matchPatterns:r_e,defaultMatchWidth:"wide",parsePatterns:s_e,defaultParseWidth:"any"}),quarter:LS({matchPatterns:i_e,defaultMatchWidth:"wide",parsePatterns:o_e,defaultParseWidth:"any",valueCallback:e=>e+1}),month:LS({matchPatterns:a_e,defaultMatchWidth:"wide",parsePatterns:l_e,defaultParseWidth:"any"}),day:LS({matchPatterns:c_e,defaultMatchWidth:"wide",parsePatterns:u_e,defaultParseWidth:"any"}),dayPeriod:LS({matchPatterns:d_e,defaultMatchWidth:"any",parsePatterns:f_e,defaultParseWidth:"any"})},zee={code:"en-US",formatDistance:jxe,formatLong:Bxe,formatRelative:Vxe,localize:Qxe,match:h_e,options:{weekStartsOn:0,firstWeekContainsDate:1}};function p_e(e){const t=Pn(e);return gu(t,$ee(t))+1}function Bee(e){const t=Pn(e),n=+Fv(t)-+Txe(t);return Math.round(n/t6)+1}function Uee(e,t){var h,u,f,g;const n=Pn(e),r=n.getFullYear(),s=BA(),i=(t==null?void 0:t.firstWeekContainsDate)??((u=(h=t==null?void 0:t.locale)==null?void 0:h.options)==null?void 0:u.firstWeekContainsDate)??s.firstWeekContainsDate??((g=(f=s.locale)==null?void 0:f.options)==null?void 0:g.firstWeekContainsDate)??1,o=Za(e,0);o.setFullYear(r+1,0,i),o.setHours(0,0,0,0);const a=Ru(o,t),c=Za(e,0);c.setFullYear(r,0,i),c.setHours(0,0,0,0);const d=Ru(c,t);return n.getTime()>=a.getTime()?r+1:n.getTime()>=d.getTime()?r:r-1}function m_e(e,t){var a,c,d,h;const n=BA(),r=(t==null?void 0:t.firstWeekContainsDate)??((c=(a=t==null?void 0:t.locale)==null?void 0:a.options)==null?void 0:c.firstWeekContainsDate)??n.firstWeekContainsDate??((h=(d=n.locale)==null?void 0:d.options)==null?void 0:h.firstWeekContainsDate)??1,s=Uee(e,t),i=Za(e,0);return i.setFullYear(s,0,r),i.setHours(0,0,0,0),Ru(i,t)}function Vee(e,t){const n=Pn(e),r=+Ru(n,t)-+m_e(n,t);return Math.round(r/t6)+1}function Jn(e,t){const n=e<0?"-":"",r=Math.abs(e).toString().padStart(t,"0");return n+r}const Zf={y(e,t){const n=e.getFullYear(),r=n>0?n:1-n;return Jn(t==="yy"?r%100:r,t.length)},M(e,t){const n=e.getMonth();return t==="M"?String(n+1):Jn(n+1,2)},d(e,t){return Jn(e.getDate(),t.length)},a(e,t){const n=e.getHours()/12>=1?"pm":"am";switch(t){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(e,t){return Jn(e.getHours()%12||12,t.length)},H(e,t){return Jn(e.getHours(),t.length)},m(e,t){return Jn(e.getMinutes(),t.length)},s(e,t){return Jn(e.getSeconds(),t.length)},S(e,t){const n=t.length,r=e.getMilliseconds(),s=Math.trunc(r*Math.pow(10,n-3));return Jn(s,t.length)}},Dy={midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},qG={G:function(e,t,n){const r=e.getFullYear()>0?1:0;switch(t){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(e,t,n){if(t==="yo"){const r=e.getFullYear(),s=r>0?r:1-r;return n.ordinalNumber(s,{unit:"year"})}return Zf.y(e,t)},Y:function(e,t,n,r){const s=Uee(e,r),i=s>0?s:1-s;if(t==="YY"){const o=i%100;return Jn(o,2)}return t==="Yo"?n.ordinalNumber(i,{unit:"year"}):Jn(i,t.length)},R:function(e,t){const n=jee(e);return Jn(n,t.length)},u:function(e,t){const n=e.getFullYear();return Jn(n,t.length)},Q:function(e,t,n){const r=Math.ceil((e.getMonth()+1)/3);switch(t){case"Q":return String(r);case"QQ":return Jn(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(e,t,n){const r=Math.ceil((e.getMonth()+1)/3);switch(t){case"q":return String(r);case"qq":return Jn(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(e,t,n){const r=e.getMonth();switch(t){case"M":case"MM":return Zf.M(e,t);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(e,t,n){const r=e.getMonth();switch(t){case"L":return String(r+1);case"LL":return Jn(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(e,t,n,r){const s=Vee(e,r);return t==="wo"?n.ordinalNumber(s,{unit:"week"}):Jn(s,t.length)},I:function(e,t,n){const r=Bee(e);return t==="Io"?n.ordinalNumber(r,{unit:"week"}):Jn(r,t.length)},d:function(e,t,n){return t==="do"?n.ordinalNumber(e.getDate(),{unit:"date"}):Zf.d(e,t)},D:function(e,t,n){const r=p_e(e);return t==="Do"?n.ordinalNumber(r,{unit:"dayOfYear"}):Jn(r,t.length)},E:function(e,t,n){const r=e.getDay();switch(t){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(e,t,n,r){const s=e.getDay(),i=(s-r.weekStartsOn+8)%7||7;switch(t){case"e":return String(i);case"ee":return Jn(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(e,t,n,r){const s=e.getDay(),i=(s-r.weekStartsOn+8)%7||7;switch(t){case"c":return String(i);case"cc":return Jn(i,t.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(e,t,n){const r=e.getDay(),s=r===0?7:r;switch(t){case"i":return String(s);case"ii":return Jn(s,t.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(e,t,n){const s=e.getHours()/12>=1?"pm":"am";switch(t){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(e,t,n){const r=e.getHours();let s;switch(r===12?s=Dy.noon:r===0?s=Dy.midnight:s=r/12>=1?"pm":"am",t){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(e,t,n){const r=e.getHours();let s;switch(r>=17?s=Dy.evening:r>=12?s=Dy.afternoon:r>=4?s=Dy.morning:s=Dy.night,t){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(e,t,n){if(t==="ho"){let r=e.getHours()%12;return r===0&&(r=12),n.ordinalNumber(r,{unit:"hour"})}return Zf.h(e,t)},H:function(e,t,n){return t==="Ho"?n.ordinalNumber(e.getHours(),{unit:"hour"}):Zf.H(e,t)},K:function(e,t,n){const r=e.getHours()%12;return t==="Ko"?n.ordinalNumber(r,{unit:"hour"}):Jn(r,t.length)},k:function(e,t,n){let r=e.getHours();return r===0&&(r=24),t==="ko"?n.ordinalNumber(r,{unit:"hour"}):Jn(r,t.length)},m:function(e,t,n){return t==="mo"?n.ordinalNumber(e.getMinutes(),{unit:"minute"}):Zf.m(e,t)},s:function(e,t,n){return t==="so"?n.ordinalNumber(e.getSeconds(),{unit:"second"}):Zf.s(e,t)},S:function(e,t){return Zf.S(e,t)},X:function(e,t,n){const r=e.getTimezoneOffset();if(r===0)return"Z";switch(t){case"X":return KG(r);case"XXXX":case"XX":return tg(r);case"XXXXX":case"XXX":default:return tg(r,":")}},x:function(e,t,n){const r=e.getTimezoneOffset();switch(t){case"x":return KG(r);case"xxxx":case"xx":return tg(r);case"xxxxx":case"xxx":default:return tg(r,":")}},O:function(e,t,n){const r=e.getTimezoneOffset();switch(t){case"O":case"OO":case"OOO":return"GMT"+GG(r,":");case"OOOO":default:return"GMT"+tg(r,":")}},z:function(e,t,n){const r=e.getTimezoneOffset();switch(t){case"z":case"zz":case"zzz":return"GMT"+GG(r,":");case"zzzz":default:return"GMT"+tg(r,":")}},t:function(e,t,n){const r=Math.trunc(e.getTime()/1e3);return Jn(r,t.length)},T:function(e,t,n){const r=e.getTime();return Jn(r,t.length)}};function GG(e,t=""){const n=e>0?"-":"+",r=Math.abs(e),s=Math.trunc(r/60),i=r%60;return i===0?n+String(s):n+String(s)+t+Jn(i,2)}function KG(e,t){return e%60===0?(e>0?"-":"+")+Jn(Math.abs(e)/60,2):tg(e,t)}function tg(e,t=""){const n=e>0?"-":"+",r=Math.abs(e),s=Jn(Math.trunc(r/60),2),i=Jn(r%60,2);return n+s+t+i}const YG=(e,t)=>{switch(e){case"P":return t.date({width:"short"});case"PP":return t.date({width:"medium"});case"PPP":return t.date({width:"long"});case"PPPP":default:return t.date({width:"full"})}},Hee=(e,t)=>{switch(e){case"p":return t.time({width:"short"});case"pp":return t.time({width:"medium"});case"ppp":return t.time({width:"long"});case"pppp":default:return t.time({width:"full"})}},g_e=(e,t)=>{const n=e.match(/(P+)(p+)?/)||[],r=n[1],s=n[2];if(!s)return YG(e,t);let i;switch(r){case"P":i=t.dateTime({width:"short"});break;case"PP":i=t.dateTime({width:"medium"});break;case"PPP":i=t.dateTime({width:"long"});break;case"PPPP":default:i=t.dateTime({width:"full"});break}return i.replace("{{date}}",YG(r,t)).replace("{{time}}",Hee(s,t))},v_e={p:Hee,P:g_e},y_e=/^D+$/,b_e=/^Y+$/,x_e=["D","DD","YY","YYYY"];function __e(e){return y_e.test(e)}function w_e(e){return b_e.test(e)}function S_e(e,t,n){const r=C_e(e,t,n);if(console.warn(r),x_e.includes(e))throw new RangeError(r)}function C_e(e,t,n){const r=e[0]==="Y"?"years":"days of the month";return`Use \`${e.toLowerCase()}\` instead of \`${e}\` (in \`${t}\`) for formatting ${r} to the input \`${n}\`; see: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md`}const E_e=/[yYQqMLwIdDecihHKkms]o|(\w)\1*|''|'(''|[^'])+('|$)|./g,A_e=/P+p+|P+|p+|''|'(''|[^'])+('|$)|./g,R_e=/^'([^]*?)'?$/,P_e=/''/g,N_e=/[a-zA-Z]/;function ay(e,t,n){var h,u,f,g,v,m,x,y;const r=BA(),s=(n==null?void 0:n.locale)??r.locale??zee,i=(n==null?void 0:n.firstWeekContainsDate)??((u=(h=n==null?void 0:n.locale)==null?void 0:h.options)==null?void 0:u.firstWeekContainsDate)??r.firstWeekContainsDate??((g=(f=r.locale)==null?void 0:f.options)==null?void 0:g.firstWeekContainsDate)??1,o=(n==null?void 0:n.weekStartsOn)??((m=(v=n==null?void 0:n.locale)==null?void 0:v.options)==null?void 0:m.weekStartsOn)??r.weekStartsOn??((y=(x=r.locale)==null?void 0:x.options)==null?void 0:y.weekStartsOn)??0,a=Pn(e);if(!Mxe(a))throw new RangeError("Invalid time value");let c=t.match(A_e).map(b=>{const w=b[0];if(w==="p"||w==="P"){const E=v_e[w];return E(b,s.formatLong)}return b}).join("").match(E_e).map(b=>{if(b==="''")return{isToken:!1,value:"'"};const w=b[0];if(w==="'")return{isToken:!1,value:T_e(b)};if(qG[w])return{isToken:!0,value:b};if(w.match(N_e))throw new RangeError("Format string contains an unescaped latin alphabet character `"+w+"`");return{isToken:!1,value:b}});s.localize.preprocessor&&(c=s.localize.preprocessor(a,c));const d={firstWeekContainsDate:i,weekStartsOn:o,locale:s};return c.map(b=>{if(!b.isToken)return b.value;const w=b.value;(!(n!=null&&n.useAdditionalWeekYearTokens)&&w_e(w)||!(n!=null&&n.useAdditionalDayOfYearTokens)&&__e(w))&&S_e(w,t,String(e));const E=qG[w[0]];return E(a,w,s.localize,d)}).join("")}function T_e(e){const t=e.match(R_e);return t?t[1].replace(P_e,"'"):e}function k_e(e){const t=Pn(e),n=t.getFullYear(),r=t.getMonth(),s=Za(e,0);return s.setFullYear(n,r+1,0),s.setHours(0,0,0,0),s.getDate()}function D_e(e){return Math.trunc(+Pn(e)/1e3)}function O_e(e){const t=Pn(e),n=t.getMonth();return t.setFullYear(t.getFullYear(),n+1,0),t.setHours(0,0,0,0),t}function M_e(e,t){return Ixe(O_e(e),sa(e),t)+1}function zB(e,t){const n=Pn(e),r=Pn(t);return n.getTime()>r.getTime()}function Wee(e,t){const n=Pn(e),r=Pn(t);return+n<+r}function i6(e,t){const n=Pn(e),r=Pn(t);return n.getFullYear()===r.getFullYear()&&n.getMonth()===r.getMonth()}function I_e(e,t){const n=Pn(e),r=Pn(t);return n.getFullYear()===r.getFullYear()}function K3(e,t){return Co(e,-t)}function Y3(e,t){const n=Pn(e),r=n.getFullYear(),s=n.getDate(),i=Za(e,0);i.setFullYear(r,t,15),i.setHours(0,0,0,0);const o=k_e(i);return n.setMonth(t,Math.min(s,o)),n}function XG(e,t){const n=Pn(e);return isNaN(+n)?Za(e,NaN):(n.setFullYear(t),n)}var Mt=function(){return Mt=Object.assign||function(t){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)&&(t[i]=n[i])}return t},Mt.apply(this,arguments)};function L_e(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&typeof Object.getOwnPropertySymbols=="function")for(var s=0,r=Object.getOwnPropertySymbols(e);s<r.length;s++)t.indexOf(r[s])<0&&Object.prototype.propertyIsEnumerable.call(e,r[s])&&(n[r[s]]=e[r[s]]);return n}function qee(e,t,n){for(var r=0,s=t.length,i;r<s;r++)(i||!(r in t))&&(i||(i=Array.prototype.slice.call(t,0,r)),i[r]=t[r]);return e.concat(i||Array.prototype.slice.call(t))}function UA(e){return e.mode==="multiple"}function VA(e){return e.mode==="range"}function wD(e){return e.mode==="single"}var j_e={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 $_e(e,t){return ay(e,"LLLL y",t)}function F_e(e,t){return ay(e,"d",t)}function z_e(e,t){return ay(e,"LLLL",t)}function B_e(e){return"".concat(e)}function U_e(e,t){return ay(e,"cccccc",t)}function V_e(e,t){return ay(e,"yyyy",t)}var H_e=Object.freeze({__proto__:null,formatCaption:$_e,formatDay:F_e,formatMonthCaption:z_e,formatWeekNumber:B_e,formatWeekdayName:U_e,formatYearCaption:V_e}),W_e=function(e,t,n){return ay(e,"do MMMM (EEEE)",n)},q_e=function(){return"Month: "},G_e=function(){return"Go to next month"},K_e=function(){return"Go to previous month"},Y_e=function(e,t){return ay(e,"cccc",t)},X_e=function(e){return"Week n. ".concat(e)},Q_e=function(){return"Year: "},Z_e=Object.freeze({__proto__:null,labelDay:W_e,labelMonthDropdown:q_e,labelNext:G_e,labelPrevious:K_e,labelWeekNumber:X_e,labelWeekday:Y_e,labelYearDropdown:Q_e});function J_e(){var e="buttons",t=j_e,n=zee,r={},s={},i=1,o={},a=new Date;return{captionLayout:e,classNames:t,formatters:H_e,labels:Z_e,locale:n,modifiersClassNames:r,modifiers:s,numberOfMonths:i,styles:o,today:a,mode:"default"}}function ewe(e){var t=e.fromYear,n=e.toYear,r=e.fromMonth,s=e.toMonth,i=e.fromDate,o=e.toDate;return r?i=sa(r):t&&(i=new Date(t,0,1)),s?o=r6(s):n&&(o=new Date(n,11,31)),{fromDate:i?ix(i):void 0,toDate:o?ix(o):void 0}}var Gee=C.createContext(void 0);function twe(e){var t,n=e.initialProps,r=J_e(),s=ewe(n),i=s.fromDate,o=s.toDate,a=(t=n.captionLayout)!==null&&t!==void 0?t:r.captionLayout;a!=="buttons"&&(!i||!o)&&(a="buttons");var c;(wD(n)||UA(n)||VA(n))&&(c=n.onSelect);var d=Mt(Mt(Mt({},r),n),{captionLayout:a,classNames:Mt(Mt({},r.classNames),n.classNames),components:Mt({},n.components),formatters:Mt(Mt({},r.formatters),n.formatters),fromDate:i,labels:Mt(Mt({},r.labels),n.labels),mode:n.mode||r.mode,modifiers:Mt(Mt({},r.modifiers),n.modifiers),modifiersClassNames:Mt(Mt({},r.modifiersClassNames),n.modifiersClassNames),onSelect:c,styles:Mt(Mt({},r.styles),n.styles),toDate:o});return _.jsx(Gee.Provider,{value:d,children:e.children})}function Pr(){var e=C.useContext(Gee);if(!e)throw new Error("useDayPicker must be used within a DayPickerProvider.");return e}function Kee(e){var t=Pr(),n=t.locale,r=t.classNames,s=t.styles,i=t.formatters.formatCaption;return _.jsx("div",{className:r.caption_label,style:s.caption_label,"aria-live":"polite",role:"presentation",id:e.id,children:i(e.displayMonth,{locale:n})})}function nwe(e){return _.jsx("svg",Mt({width:"8px",height:"8px",viewBox:"0 0 120 120","data-testid":"iconDropdown"},e,{children:_.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 Yee(e){var t,n,r=e.onChange,s=e.value,i=e.children,o=e.caption,a=e.className,c=e.style,d=Pr(),h=(n=(t=d.components)===null||t===void 0?void 0:t.IconDropdown)!==null&&n!==void 0?n:nwe;return _.jsxs("div",{className:a,style:c,children:[_.jsx("span",{className:d.classNames.vhidden,children:e["aria-label"]}),_.jsx("select",{name:e.name,"aria-label":e["aria-label"],className:d.classNames.dropdown,style:d.styles.dropdown,value:s,onChange:r,children:i}),_.jsxs("div",{className:d.classNames.caption_label,style:d.styles.caption_label,"aria-hidden":"true",children:[o,_.jsx(h,{className:d.classNames.dropdown_icon,style:d.styles.dropdown_icon})]})]})}function rwe(e){var t,n=Pr(),r=n.fromDate,s=n.toDate,i=n.styles,o=n.locale,a=n.formatters.formatMonthCaption,c=n.classNames,d=n.components,h=n.labels.labelMonthDropdown;if(!r)return _.jsx(_.Fragment,{});if(!s)return _.jsx(_.Fragment,{});var u=[];if(I_e(r,s))for(var f=sa(r),g=r.getMonth();g<=s.getMonth();g++)u.push(Y3(f,g));else for(var f=sa(new Date),g=0;g<=11;g++)u.push(Y3(f,g));var v=function(x){var y=Number(x.target.value),b=Y3(sa(e.displayMonth),y);e.onChange(b)},m=(t=d==null?void 0:d.Dropdown)!==null&&t!==void 0?t:Yee;return _.jsx(m,{name:"months","aria-label":h(),className:c.dropdown_month,style:i.dropdown_month,onChange:v,value:e.displayMonth.getMonth(),caption:a(e.displayMonth,{locale:o}),children:u.map(function(x){return _.jsx("option",{value:x.getMonth(),children:a(x,{locale:o})},x.getMonth())})})}function swe(e){var t,n=e.displayMonth,r=Pr(),s=r.fromDate,i=r.toDate,o=r.locale,a=r.styles,c=r.classNames,d=r.components,h=r.formatters.formatYearCaption,u=r.labels.labelYearDropdown,f=[];if(!s)return _.jsx(_.Fragment,{});if(!i)return _.jsx(_.Fragment,{});for(var g=s.getFullYear(),v=i.getFullYear(),m=g;m<=v;m++)f.push(XG($ee(new Date),m));var x=function(b){var w=XG(sa(n),Number(b.target.value));e.onChange(w)},y=(t=d==null?void 0:d.Dropdown)!==null&&t!==void 0?t:Yee;return _.jsx(y,{name:"years","aria-label":u(),className:c.dropdown_year,style:a.dropdown_year,onChange:x,value:n.getFullYear(),caption:h(n,{locale:o}),children:f.map(function(b){return _.jsx("option",{value:b.getFullYear(),children:h(b,{locale:o})},b.getFullYear())})})}function iwe(e,t){var n=C.useState(e),r=n[0],s=n[1],i=t===void 0?r:t;return[i,s]}function owe(e){var t=e.month,n=e.defaultMonth,r=e.today,s=t||n||r||new Date,i=e.toDate,o=e.fromDate,a=e.numberOfMonths,c=a===void 0?1:a;if(i&&bC(i,s)<0){var d=-1*(c-1);s=Ec(i,d)}return o&&bC(s,o)<0&&(s=o),sa(s)}function awe(){var e=Pr(),t=owe(e),n=iwe(t,e.month),r=n[0],s=n[1],i=function(o){var a;if(!e.disableNavigation){var c=sa(o);s(c),(a=e.onMonthChange)===null||a===void 0||a.call(e,c)}};return[r,i]}function lwe(e,t){for(var n=t.reverseMonths,r=t.numberOfMonths,s=sa(e),i=sa(Ec(s,r)),o=bC(i,s),a=[],c=0;c<o;c++){var d=Ec(s,c);a.push(d)}return n&&(a=a.reverse()),a}function cwe(e,t){if(!t.disableNavigation){var n=t.toDate,r=t.pagedNavigation,s=t.numberOfMonths,i=s===void 0?1:s,o=r?i:1,a=sa(e);if(!n)return Ec(a,o);var c=bC(n,e);if(!(c<i))return Ec(a,o)}}function uwe(e,t){if(!t.disableNavigation){var n=t.fromDate,r=t.pagedNavigation,s=t.numberOfMonths,i=s===void 0?1:s,o=r?i:1,a=sa(e);if(!n)return Ec(a,-o);var c=bC(a,n);if(!(c<=0))return Ec(a,-o)}}var Xee=C.createContext(void 0);function dwe(e){var t=Pr(),n=awe(),r=n[0],s=n[1],i=lwe(r,t),o=cwe(r,t),a=uwe(r,t),c=function(u){return i.some(function(f){return i6(u,f)})},d=function(u,f){c(u)||(f&&Wee(u,f)?s(Ec(u,1+t.numberOfMonths*-1)):s(u))},h={currentMonth:r,displayMonths:i,goToMonth:s,goToDate:d,previousMonth:a,nextMonth:o,isDateDisplayed:c};return _.jsx(Xee.Provider,{value:h,children:e.children})}function HA(){var e=C.useContext(Xee);if(!e)throw new Error("useNavigation must be used within a NavigationProvider");return e}function QG(e){var t,n=Pr(),r=n.classNames,s=n.styles,i=n.components,o=HA().goToMonth,a=function(h){o(Ec(h,e.displayIndex?-e.displayIndex:0))},c=(t=i==null?void 0:i.CaptionLabel)!==null&&t!==void 0?t:Kee,d=_.jsx(c,{id:e.id,displayMonth:e.displayMonth});return _.jsxs("div",{className:r.caption_dropdowns,style:s.caption_dropdowns,children:[_.jsx("div",{className:r.vhidden,children:d}),_.jsx(rwe,{onChange:a,displayMonth:e.displayMonth}),_.jsx(swe,{onChange:a,displayMonth:e.displayMonth})]})}function fwe(e){return _.jsx("svg",Mt({width:"16px",height:"16px",viewBox:"0 0 120 120"},e,{children:_.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 hwe(e){return _.jsx("svg",Mt({width:"16px",height:"16px",viewBox:"0 0 120 120"},e,{children:_.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 gT=C.forwardRef(function(e,t){var n=Pr(),r=n.classNames,s=n.styles,i=[r.button_reset,r.button];e.className&&i.push(e.className);var o=i.join(" "),a=Mt(Mt({},s.button_reset),s.button);return e.style&&Object.assign(a,e.style),_.jsx("button",Mt({},e,{ref:t,type:"button",className:o,style:a}))});function pwe(e){var t,n,r=Pr(),s=r.dir,i=r.locale,o=r.classNames,a=r.styles,c=r.labels,d=c.labelPrevious,h=c.labelNext,u=r.components;if(!e.nextMonth&&!e.previousMonth)return _.jsx(_.Fragment,{});var f=d(e.previousMonth,{locale:i}),g=[o.nav_button,o.nav_button_previous].join(" "),v=h(e.nextMonth,{locale:i}),m=[o.nav_button,o.nav_button_next].join(" "),x=(t=u==null?void 0:u.IconRight)!==null&&t!==void 0?t:hwe,y=(n=u==null?void 0:u.IconLeft)!==null&&n!==void 0?n:fwe;return _.jsxs("div",{className:o.nav,style:a.nav,children:[!e.hidePrevious&&_.jsx(gT,{name:"previous-month","aria-label":f,className:g,style:a.nav_button_previous,disabled:!e.previousMonth,onClick:e.onPreviousClick,children:s==="rtl"?_.jsx(x,{className:o.nav_icon,style:a.nav_icon}):_.jsx(y,{className:o.nav_icon,style:a.nav_icon})}),!e.hideNext&&_.jsx(gT,{name:"next-month","aria-label":v,className:m,style:a.nav_button_next,disabled:!e.nextMonth,onClick:e.onNextClick,children:s==="rtl"?_.jsx(y,{className:o.nav_icon,style:a.nav_icon}):_.jsx(x,{className:o.nav_icon,style:a.nav_icon})})]})}function ZG(e){var t=Pr().numberOfMonths,n=HA(),r=n.previousMonth,s=n.nextMonth,i=n.goToMonth,o=n.displayMonths,a=o.findIndex(function(v){return i6(e.displayMonth,v)}),c=a===0,d=a===o.length-1,h=t>1&&(c||!d),u=t>1&&(d||!c),f=function(){r&&i(r)},g=function(){s&&i(s)};return _.jsx(pwe,{displayMonth:e.displayMonth,hideNext:h,hidePrevious:u,nextMonth:s,previousMonth:r,onPreviousClick:f,onNextClick:g})}function mwe(e){var t,n=Pr(),r=n.classNames,s=n.disableNavigation,i=n.styles,o=n.captionLayout,a=n.components,c=(t=a==null?void 0:a.CaptionLabel)!==null&&t!==void 0?t:Kee,d;return s?d=_.jsx(c,{id:e.id,displayMonth:e.displayMonth}):o==="dropdown"?d=_.jsx(QG,{displayMonth:e.displayMonth,id:e.id}):o==="dropdown-buttons"?d=_.jsxs(_.Fragment,{children:[_.jsx(QG,{displayMonth:e.displayMonth,displayIndex:e.displayIndex,id:e.id}),_.jsx(ZG,{displayMonth:e.displayMonth,displayIndex:e.displayIndex,id:e.id})]}):d=_.jsxs(_.Fragment,{children:[_.jsx(c,{id:e.id,displayMonth:e.displayMonth,displayIndex:e.displayIndex}),_.jsx(ZG,{displayMonth:e.displayMonth,id:e.id})]}),_.jsx("div",{className:r.caption,style:i.caption,children:d})}function gwe(e){var t=Pr(),n=t.footer,r=t.styles,s=t.classNames.tfoot;return n?_.jsx("tfoot",{className:s,style:r.tfoot,children:_.jsx("tr",{children:_.jsx("td",{colSpan:8,children:n})})}):_.jsx(_.Fragment,{})}function vwe(e,t,n){for(var r=n?Fv(new Date):Ru(new Date,{locale:e,weekStartsOn:t}),s=[],i=0;i<7;i++){var o=Co(r,i);s.push(o)}return s}function ywe(){var e=Pr(),t=e.classNames,n=e.styles,r=e.showWeekNumber,s=e.locale,i=e.weekStartsOn,o=e.ISOWeek,a=e.formatters.formatWeekdayName,c=e.labels.labelWeekday,d=vwe(s,i,o);return _.jsxs("tr",{style:n.head_row,className:t.head_row,children:[r&&_.jsx("td",{style:n.head_cell,className:t.head_cell}),d.map(function(h,u){return _.jsx("th",{scope:"col",className:t.head_cell,style:n.head_cell,"aria-label":c(h,{locale:s}),children:a(h,{locale:s})},u)})]})}function bwe(){var e,t=Pr(),n=t.classNames,r=t.styles,s=t.components,i=(e=s==null?void 0:s.HeadRow)!==null&&e!==void 0?e:ywe;return _.jsx("thead",{style:r.head,className:n.head,children:_.jsx(i,{})})}function xwe(e){var t=Pr(),n=t.locale,r=t.formatters.formatDay;return _.jsx(_.Fragment,{children:r(e.date,{locale:n})})}var o6=C.createContext(void 0);function _we(e){if(!UA(e.initialProps)){var t={selected:void 0,modifiers:{disabled:[]}};return _.jsx(o6.Provider,{value:t,children:e.children})}return _.jsx(wwe,{initialProps:e.initialProps,children:e.children})}function wwe(e){var t=e.initialProps,n=e.children,r=t.selected,s=t.min,i=t.max,o=function(d,h,u){var f,g;(f=t.onDayClick)===null||f===void 0||f.call(t,d,h,u);var v=!!(h.selected&&s&&(r==null?void 0:r.length)===s);if(!v){var m=!!(!h.selected&&i&&(r==null?void 0:r.length)===i);if(!m){var x=r?qee([],r):[];if(h.selected){var y=x.findIndex(function(b){return Qo(d,b)});x.splice(y,1)}else x.push(d);(g=t.onSelect)===null||g===void 0||g.call(t,x,d,h,u)}}},a={disabled:[]};r&&a.disabled.push(function(d){var h=i&&r.length>i-1,u=r.some(function(f){return Qo(f,d)});return!!(h&&!u)});var c={selected:r,onDayClick:o,modifiers:a};return _.jsx(o6.Provider,{value:c,children:n})}function a6(){var e=C.useContext(o6);if(!e)throw new Error("useSelectMultiple must be used within a SelectMultipleProvider");return e}function Swe(e,t){var n=t||{},r=n.from,s=n.to;return r&&s?Qo(s,e)&&Qo(r,e)?void 0:Qo(s,e)?{from:s,to:void 0}:Qo(r,e)?void 0:zB(r,e)?{from:e,to:s}:{from:r,to:e}:s?zB(e,s)?{from:s,to:e}:{from:e,to:s}:r?Wee(e,r)?{from:e,to:r}:{from:r,to:e}:{from:e,to:void 0}}var l6=C.createContext(void 0);function Cwe(e){if(!VA(e.initialProps)){var t={selected:void 0,modifiers:{range_start:[],range_end:[],range_middle:[],disabled:[]}};return _.jsx(l6.Provider,{value:t,children:e.children})}return _.jsx(Ewe,{initialProps:e.initialProps,children:e.children})}function Ewe(e){var t=e.initialProps,n=e.children,r=t.selected,s=r||{},i=s.from,o=s.to,a=t.min,c=t.max,d=function(g,v,m){var x,y;(x=t.onDayClick)===null||x===void 0||x.call(t,g,v,m);var b=Swe(g,r);(y=t.onSelect)===null||y===void 0||y.call(t,b,g,v,m)},h={range_start:[],range_end:[],range_middle:[],disabled:[]};if(i?(h.range_start=[i],o?(h.range_end=[o],Qo(i,o)||(h.range_middle=[{after:i,before:o}])):h.range_end=[i]):o&&(h.range_start=[o],h.range_end=[o]),a&&(i&&!o&&h.disabled.push({after:K3(i,a-1),before:Co(i,a-1)}),i&&o&&h.disabled.push({after:i,before:Co(i,a-1)}),!i&&o&&h.disabled.push({after:K3(o,a-1),before:Co(o,a-1)})),c){if(i&&!o&&(h.disabled.push({before:Co(i,-c+1)}),h.disabled.push({after:Co(i,c-1)})),i&&o){var u=gu(o,i)+1,f=c-u;h.disabled.push({before:K3(i,f)}),h.disabled.push({after:Co(o,f)})}!i&&o&&(h.disabled.push({before:Co(o,-c+1)}),h.disabled.push({after:Co(o,c-1)}))}return _.jsx(l6.Provider,{value:{selected:r,onDayClick:d,modifiers:h},children:n})}function c6(){var e=C.useContext(l6);if(!e)throw new Error("useSelectRange must be used within a SelectRangeProvider");return e}function XP(e){return Array.isArray(e)?qee([],e):e!==void 0?[e]:[]}function Awe(e){var t={};return Object.entries(e).forEach(function(n){var r=n[0],s=n[1];t[r]=XP(s)}),t}var Ac;(function(e){e.Outside="outside",e.Disabled="disabled",e.Selected="selected",e.Hidden="hidden",e.Today="today",e.RangeStart="range_start",e.RangeEnd="range_end",e.RangeMiddle="range_middle"})(Ac||(Ac={}));var Rwe=Ac.Selected,Td=Ac.Disabled,Pwe=Ac.Hidden,Nwe=Ac.Today,X3=Ac.RangeEnd,Q3=Ac.RangeMiddle,Z3=Ac.RangeStart,Twe=Ac.Outside;function kwe(e,t,n){var r,s=(r={},r[Rwe]=XP(e.selected),r[Td]=XP(e.disabled),r[Pwe]=XP(e.hidden),r[Nwe]=[e.today],r[X3]=[],r[Q3]=[],r[Z3]=[],r[Twe]=[],r);return e.fromDate&&s[Td].push({before:e.fromDate}),e.toDate&&s[Td].push({after:e.toDate}),UA(e)?s[Td]=s[Td].concat(t.modifiers[Td]):VA(e)&&(s[Td]=s[Td].concat(n.modifiers[Td]),s[Z3]=n.modifiers[Z3],s[Q3]=n.modifiers[Q3],s[X3]=n.modifiers[X3]),s}var Qee=C.createContext(void 0);function Dwe(e){var t=Pr(),n=a6(),r=c6(),s=kwe(t,n,r),i=Awe(t.modifiers),o=Mt(Mt({},s),i);return _.jsx(Qee.Provider,{value:o,children:e.children})}function Zee(){var e=C.useContext(Qee);if(!e)throw new Error("useModifiers must be used within a ModifiersProvider");return e}function Owe(e){return!!(e&&typeof e=="object"&&"before"in e&&"after"in e)}function Mwe(e){return!!(e&&typeof e=="object"&&"from"in e)}function Iwe(e){return!!(e&&typeof e=="object"&&"after"in e)}function Lwe(e){return!!(e&&typeof e=="object"&&"before"in e)}function jwe(e){return!!(e&&typeof e=="object"&&"dayOfWeek"in e)}function $we(e,t){var n,r=t.from,s=t.to;if(r&&s){var i=gu(s,r)<0;i&&(n=[s,r],r=n[0],s=n[1]);var o=gu(e,r)>=0&&gu(s,e)>=0;return o}return s?Qo(s,e):r?Qo(r,e):!1}function Fwe(e){return n6(e)}function zwe(e){return Array.isArray(e)&&e.every(n6)}function Bwe(e,t){return t.some(function(n){if(typeof n=="boolean")return n;if(Fwe(n))return Qo(e,n);if(zwe(n))return n.includes(e);if(Mwe(n))return $we(e,n);if(jwe(n))return n.dayOfWeek.includes(e.getDay());if(Owe(n)){var r=gu(n.before,e),s=gu(n.after,e),i=r>0,o=s<0,a=zB(n.before,n.after);return a?o&&i:i||o}return Iwe(n)?gu(e,n.after)>0:Lwe(n)?gu(n.before,e)>0:typeof n=="function"?n(e):!1})}function u6(e,t,n){var r=Object.keys(t).reduce(function(i,o){var a=t[o];return Bwe(e,a)&&i.push(o),i},[]),s={};return r.forEach(function(i){return s[i]=!0}),n&&!i6(e,n)&&(s.outside=!0),s}function Uwe(e,t){for(var n=sa(e[0]),r=r6(e[e.length-1]),s,i,o=n;o<=r;){var a=u6(o,t),c=!a.disabled&&!a.hidden;if(!c){o=Co(o,1);continue}if(a.selected)return o;a.today&&!i&&(i=o),s||(s=o),o=Co(o,1)}return i||s}var Vwe=365;function Jee(e,t){var n=t.moveBy,r=t.direction,s=t.context,i=t.modifiers,o=t.retry,a=o===void 0?{count:0,lastFocused:e}:o,c=s.weekStartsOn,d=s.fromDate,h=s.toDate,u=s.locale,f={day:Co,week:FB,month:Ec,year:kxe,startOfWeek:function(x){return s.ISOWeek?Fv(x):Ru(x,{locale:u,weekStartsOn:c})},endOfWeek:function(x){return s.ISOWeek?Fee(x):s6(x,{locale:u,weekStartsOn:c})}},g=f[n](e,r==="after"?1:-1);r==="before"&&d?g=Dxe([d,g]):r==="after"&&h&&(g=Oxe([h,g]));var v=!0;if(i){var m=u6(g,i);v=!m.disabled&&!m.hidden}return v?g:a.count>Vwe?a.lastFocused:Jee(g,{moveBy:n,direction:r,context:s,modifiers:i,retry:Mt(Mt({},a),{count:a.count+1})})}var ete=C.createContext(void 0);function Hwe(e){var t=HA(),n=Zee(),r=C.useState(),s=r[0],i=r[1],o=C.useState(),a=o[0],c=o[1],d=Uwe(t.displayMonths,n),h=s??(a&&t.isDateDisplayed(a))?a:d,u=function(){c(s),i(void 0)},f=function(x){i(x)},g=Pr(),v=function(x,y){if(s){var b=Jee(s,{moveBy:x,direction:y,context:g,modifiers:n});Qo(s,b)||(t.goToDate(b,s),f(b))}},m={focusedDay:s,focusTarget:h,blur:u,focus:f,focusDayAfter:function(){return v("day","after")},focusDayBefore:function(){return v("day","before")},focusWeekAfter:function(){return v("week","after")},focusWeekBefore:function(){return v("week","before")},focusMonthBefore:function(){return v("month","before")},focusMonthAfter:function(){return v("month","after")},focusYearBefore:function(){return v("year","before")},focusYearAfter:function(){return v("year","after")},focusStartOfWeek:function(){return v("startOfWeek","before")},focusEndOfWeek:function(){return v("endOfWeek","after")}};return _.jsx(ete.Provider,{value:m,children:e.children})}function d6(){var e=C.useContext(ete);if(!e)throw new Error("useFocusContext must be used within a FocusProvider");return e}function Wwe(e,t){var n=Zee(),r=u6(e,n,t);return r}var f6=C.createContext(void 0);function qwe(e){if(!wD(e.initialProps)){var t={selected:void 0};return _.jsx(f6.Provider,{value:t,children:e.children})}return _.jsx(Gwe,{initialProps:e.initialProps,children:e.children})}function Gwe(e){var t=e.initialProps,n=e.children,r=function(i,o,a){var c,d,h;if((c=t.onDayClick)===null||c===void 0||c.call(t,i,o,a),o.selected&&!t.required){(d=t.onSelect)===null||d===void 0||d.call(t,void 0,i,o,a);return}(h=t.onSelect)===null||h===void 0||h.call(t,i,i,o,a)},s={selected:t.selected,onDayClick:r};return _.jsx(f6.Provider,{value:s,children:n})}function tte(){var e=C.useContext(f6);if(!e)throw new Error("useSelectSingle must be used within a SelectSingleProvider");return e}function Kwe(e,t){var n=Pr(),r=tte(),s=a6(),i=c6(),o=d6(),a=o.focusDayAfter,c=o.focusDayBefore,d=o.focusWeekAfter,h=o.focusWeekBefore,u=o.blur,f=o.focus,g=o.focusMonthBefore,v=o.focusMonthAfter,m=o.focusYearBefore,x=o.focusYearAfter,y=o.focusStartOfWeek,b=o.focusEndOfWeek,w=function(Y){var H,se,he,re;wD(n)?(H=r.onDayClick)===null||H===void 0||H.call(r,e,t,Y):UA(n)?(se=s.onDayClick)===null||se===void 0||se.call(s,e,t,Y):VA(n)?(he=i.onDayClick)===null||he===void 0||he.call(i,e,t,Y):(re=n.onDayClick)===null||re===void 0||re.call(n,e,t,Y)},E=function(Y){var H;f(e),(H=n.onDayFocus)===null||H===void 0||H.call(n,e,t,Y)},R=function(Y){var H;u(),(H=n.onDayBlur)===null||H===void 0||H.call(n,e,t,Y)},T=function(Y){var H;(H=n.onDayMouseEnter)===null||H===void 0||H.call(n,e,t,Y)},N=function(Y){var H;(H=n.onDayMouseLeave)===null||H===void 0||H.call(n,e,t,Y)},A=function(Y){var H;(H=n.onDayPointerEnter)===null||H===void 0||H.call(n,e,t,Y)},D=function(Y){var H;(H=n.onDayPointerLeave)===null||H===void 0||H.call(n,e,t,Y)},O=function(Y){var H;(H=n.onDayTouchCancel)===null||H===void 0||H.call(n,e,t,Y)},I=function(Y){var H;(H=n.onDayTouchEnd)===null||H===void 0||H.call(n,e,t,Y)},$=function(Y){var H;(H=n.onDayTouchMove)===null||H===void 0||H.call(n,e,t,Y)},F=function(Y){var H;(H=n.onDayTouchStart)===null||H===void 0||H.call(n,e,t,Y)},B=function(Y){var H;(H=n.onDayKeyUp)===null||H===void 0||H.call(n,e,t,Y)},W=function(Y){var H;switch(Y.key){case"ArrowLeft":Y.preventDefault(),Y.stopPropagation(),n.dir==="rtl"?a():c();break;case"ArrowRight":Y.preventDefault(),Y.stopPropagation(),n.dir==="rtl"?c():a();break;case"ArrowDown":Y.preventDefault(),Y.stopPropagation(),d();break;case"ArrowUp":Y.preventDefault(),Y.stopPropagation(),h();break;case"PageUp":Y.preventDefault(),Y.stopPropagation(),Y.shiftKey?m():g();break;case"PageDown":Y.preventDefault(),Y.stopPropagation(),Y.shiftKey?x():v();break;case"Home":Y.preventDefault(),Y.stopPropagation(),y();break;case"End":Y.preventDefault(),Y.stopPropagation(),b();break}(H=n.onDayKeyDown)===null||H===void 0||H.call(n,e,t,Y)},Z={onClick:w,onFocus:E,onBlur:R,onKeyDown:W,onKeyUp:B,onMouseEnter:T,onMouseLeave:N,onPointerEnter:A,onPointerLeave:D,onTouchCancel:O,onTouchEnd:I,onTouchMove:$,onTouchStart:F};return Z}function Ywe(){var e=Pr(),t=tte(),n=a6(),r=c6(),s=wD(e)?t.selected:UA(e)?n.selected:VA(e)?r.selected:void 0;return s}function Xwe(e){return Object.values(Ac).includes(e)}function Qwe(e,t){var n=[e.classNames.day];return Object.keys(t).forEach(function(r){var s=e.modifiersClassNames[r];if(s)n.push(s);else if(Xwe(r)){var i=e.classNames["day_".concat(r)];i&&n.push(i)}}),n}function Zwe(e,t){var n=Mt({},e.styles.day);return Object.keys(t).forEach(function(r){var s;n=Mt(Mt({},n),(s=e.modifiersStyles)===null||s===void 0?void 0:s[r])}),n}function Jwe(e,t,n){var r,s,i,o=Pr(),a=d6(),c=Wwe(e,t),d=Kwe(e,c),h=Ywe(),u=!!(o.onDayClick||o.mode!=="default");C.useEffect(function(){var T;c.outside||a.focusedDay&&u&&Qo(a.focusedDay,e)&&((T=n.current)===null||T===void 0||T.focus())},[a.focusedDay,e,n,u,c.outside]);var f=Qwe(o,c).join(" "),g=Zwe(o,c),v=!!(c.outside&&!o.showOutsideDays||c.hidden),m=(i=(s=o.components)===null||s===void 0?void 0:s.DayContent)!==null&&i!==void 0?i:xwe,x=_.jsx(m,{date:e,displayMonth:t,activeModifiers:c}),y={style:g,className:f,children:x,role:"gridcell"},b=a.focusTarget&&Qo(a.focusTarget,e)&&!c.outside,w=a.focusedDay&&Qo(a.focusedDay,e),E=Mt(Mt(Mt({},y),(r={disabled:c.disabled,role:"gridcell"},r["aria-selected"]=c.selected,r.tabIndex=w||b?0:-1,r)),d),R={isButton:u,isHidden:v,activeModifiers:c,selectedDays:h,buttonProps:E,divProps:y};return R}function eSe(e){var t=C.useRef(null),n=Jwe(e.date,e.displayMonth,t);return n.isHidden?_.jsx("div",{role:"gridcell"}):n.isButton?_.jsx(gT,Mt({name:"day",ref:t},n.buttonProps)):_.jsx("div",Mt({},n.divProps))}function tSe(e){var t=e.number,n=e.dates,r=Pr(),s=r.onWeekNumberClick,i=r.styles,o=r.classNames,a=r.locale,c=r.labels.labelWeekNumber,d=r.formatters.formatWeekNumber,h=d(Number(t),{locale:a});if(!s)return _.jsx("span",{className:o.weeknumber,style:i.weeknumber,children:h});var u=c(Number(t),{locale:a}),f=function(g){s(t,n,g)};return _.jsx(gT,{name:"week-number","aria-label":u,className:o.weeknumber,style:i.weeknumber,onClick:f,children:h})}function nSe(e){var t,n,r=Pr(),s=r.styles,i=r.classNames,o=r.showWeekNumber,a=r.components,c=(t=a==null?void 0:a.Day)!==null&&t!==void 0?t:eSe,d=(n=a==null?void 0:a.WeekNumber)!==null&&n!==void 0?n:tSe,h;return o&&(h=_.jsx("td",{className:i.cell,style:s.cell,children:_.jsx(d,{number:e.weekNumber,dates:e.dates})})),_.jsxs("tr",{className:i.row,style:s.row,children:[h,e.dates.map(function(u){return _.jsx("td",{className:i.cell,style:s.cell,role:"presentation",children:_.jsx(c,{displayMonth:e.displayMonth,date:u})},D_e(u))})]})}function JG(e,t,n){for(var r=n!=null&&n.ISOWeek?Fee(t):s6(t,n),s=n!=null&&n.ISOWeek?Fv(e):Ru(e,n),i=gu(r,s),o=[],a=0;a<=i;a++)o.push(Co(s,a));var c=o.reduce(function(d,h){var u=n!=null&&n.ISOWeek?Bee(h):Vee(h,n),f=d.find(function(g){return g.weekNumber===u});return f?(f.dates.push(h),d):(d.push({weekNumber:u,dates:[h]}),d)},[]);return c}function rSe(e,t){var n=JG(sa(e),r6(e),t);if(t!=null&&t.useFixedWeeks){var r=M_e(e,t);if(r<6){var s=n[n.length-1],i=s.dates[s.dates.length-1],o=FB(i,6-r),a=JG(FB(i,1),o,t);n.push.apply(n,a)}}return n}function sSe(e){var t,n,r,s=Pr(),i=s.locale,o=s.classNames,a=s.styles,c=s.hideHead,d=s.fixedWeeks,h=s.components,u=s.weekStartsOn,f=s.firstWeekContainsDate,g=s.ISOWeek,v=rSe(e.displayMonth,{useFixedWeeks:!!d,ISOWeek:g,locale:i,weekStartsOn:u,firstWeekContainsDate:f}),m=(t=h==null?void 0:h.Head)!==null&&t!==void 0?t:bwe,x=(n=h==null?void 0:h.Row)!==null&&n!==void 0?n:nSe,y=(r=h==null?void 0:h.Footer)!==null&&r!==void 0?r:gwe;return _.jsxs("table",{id:e.id,className:o.table,style:a.table,role:"grid","aria-labelledby":e["aria-labelledby"],children:[!c&&_.jsx(m,{}),_.jsx("tbody",{className:o.tbody,style:a.tbody,children:v.map(function(b){return _.jsx(x,{displayMonth:e.displayMonth,dates:b.dates,weekNumber:b.weekNumber},b.weekNumber)})}),_.jsx(y,{displayMonth:e.displayMonth})]})}function iSe(){return!!(typeof window<"u"&&window.document&&window.document.createElement)}var oSe=iSe()?C.useLayoutEffect:C.useEffect,J3=!1,aSe=0;function e9(){return"react-day-picker-".concat(++aSe)}function lSe(e){var t,n=e??(J3?e9():null),r=C.useState(n),s=r[0],i=r[1];return oSe(function(){s===null&&i(e9())},[]),C.useEffect(function(){J3===!1&&(J3=!0)},[]),(t=e??s)!==null&&t!==void 0?t:void 0}function cSe(e){var t,n,r=Pr(),s=r.dir,i=r.classNames,o=r.styles,a=r.components,c=HA().displayMonths,d=lSe(r.id?"".concat(r.id,"-").concat(e.displayIndex):void 0),h=r.id?"".concat(r.id,"-grid-").concat(e.displayIndex):void 0,u=[i.month],f=o.month,g=e.displayIndex===0,v=e.displayIndex===c.length-1,m=!g&&!v;s==="rtl"&&(t=[g,v],v=t[0],g=t[1]),g&&(u.push(i.caption_start),f=Mt(Mt({},f),o.caption_start)),v&&(u.push(i.caption_end),f=Mt(Mt({},f),o.caption_end)),m&&(u.push(i.caption_between),f=Mt(Mt({},f),o.caption_between));var x=(n=a==null?void 0:a.Caption)!==null&&n!==void 0?n:mwe;return _.jsxs("div",{className:u.join(" "),style:f,children:[_.jsx(x,{id:d,displayMonth:e.displayMonth,displayIndex:e.displayIndex}),_.jsx(sSe,{id:h,"aria-labelledby":d,displayMonth:e.displayMonth})]},e.displayIndex)}function uSe(e){var t=Pr(),n=t.classNames,r=t.styles;return _.jsx("div",{className:n.months,style:r.months,children:e.children})}function dSe(e){var t,n,r=e.initialProps,s=Pr(),i=d6(),o=HA(),a=C.useState(!1),c=a[0],d=a[1];C.useEffect(function(){s.initialFocus&&i.focusTarget&&(c||(i.focus(i.focusTarget),d(!0)))},[s.initialFocus,c,i.focus,i.focusTarget,i]);var h=[s.classNames.root,s.className];s.numberOfMonths>1&&h.push(s.classNames.multiple_months),s.showWeekNumber&&h.push(s.classNames.with_weeknumber);var u=Mt(Mt({},s.styles.root),s.style),f=Object.keys(r).filter(function(v){return v.startsWith("data-")}).reduce(function(v,m){var x;return Mt(Mt({},v),(x={},x[m]=r[m],x))},{}),g=(n=(t=r.components)===null||t===void 0?void 0:t.Months)!==null&&n!==void 0?n:uSe;return _.jsx("div",Mt({className:h.join(" "),style:u,dir:s.dir,id:s.id,nonce:r.nonce,title:r.title,lang:r.lang},f,{children:_.jsx(g,{children:o.displayMonths.map(function(v,m){return _.jsx(cSe,{displayIndex:m,displayMonth:v},m)})})}))}function fSe(e){var t=e.children,n=L_e(e,["children"]);return _.jsx(twe,{initialProps:n,children:_.jsx(dwe,{children:_.jsx(qwe,{initialProps:n,children:_.jsx(_we,{initialProps:n,children:_.jsx(Cwe,{initialProps:n,children:_.jsx(Dwe,{children:_.jsx(Hwe,{children:t})})})})})})})}function hSe(e){return _.jsx(fSe,Mt({},e,{children:_.jsx(dSe,{initialProps:e})}))}function nte({className:e,classNames:t,showOutsideDays:n=!0,...r}){return _.jsx(hSe,{showOutsideDays:n,className:ge("p-3",e),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:ge(yC({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:ge(yC({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",...t},components:{IconLeft:()=>_.jsx(lD,{className:"w-4 h-4"}),IconRight:()=>_.jsx(Tx,{className:"w-4 h-4"})},...r})}nte.displayName="Calendar";const bs=C.forwardRef(({className:e,...t},n)=>_.jsx("div",{ref:n,className:ge("rounded-md border bg-card text-card-foreground shadow",e),...t}));bs.displayName="Card";const Go=C.forwardRef(({className:e,...t},n)=>_.jsx("div",{ref:n,className:ge("flex flex-col space-y-1.5 p-6",e),...t}));Go.displayName="CardHeader";const ui=C.forwardRef(({className:e,...t},n)=>_.jsx("h3",{ref:n,className:ge("font-semibold leading-none tracking-tight",e),...t}));ui.displayName="CardTitle";const Di=C.forwardRef(({className:e,...t},n)=>_.jsx("p",{ref:n,className:ge("text-sm text-muted-foreground",e),...t}));Di.displayName="CardDescription";const xs=C.forwardRef(({className:e,...t},n)=>_.jsx("div",{ref:n,className:ge("p-6 pt-0",e),...t}));xs.displayName="CardContent";const fl=C.forwardRef(({className:e,...t},n)=>_.jsx("div",{ref:n,className:ge("flex items-center p-6 pt-0",e),...t}));fl.displayName="CardFooter";var pSe=Array.isArray,SD=pSe,mSe=typeof xr=="object"&&xr&&xr.Object===Object&&xr,gSe=mSe,vSe=gSe,ySe=typeof self=="object"&&self&&self.Object===Object&&self,bSe=vSe||ySe||Function("return this")(),CD=bSe,xSe=CD,_Se=xSe.Symbol,h6=_Se,t9=h6,rte=Object.prototype,wSe=rte.hasOwnProperty,SSe=rte.toString,jS=t9?t9.toStringTag:void 0;function CSe(e){var t=wSe.call(e,jS),n=e[jS];try{e[jS]=void 0;var r=!0}catch{}var s=SSe.call(e);return r&&(t?e[jS]=n:delete e[jS]),s}var ESe=CSe,ASe=Object.prototype,RSe=ASe.toString;function PSe(e){return RSe.call(e)}var NSe=PSe,n9=h6,TSe=ESe,kSe=NSe,DSe="[object Null]",OSe="[object Undefined]",r9=n9?n9.toStringTag:void 0;function MSe(e){return e==null?e===void 0?OSe:DSe:r9&&r9 in Object(e)?TSe(e):kSe(e)}var p6=MSe;function ISe(e){return e!=null&&typeof e=="object"}var ste=ISe,LSe=p6,jSe=ste,$Se="[object Symbol]";function FSe(e){return typeof e=="symbol"||jSe(e)&&LSe(e)==$Se}var ED=FSe,zSe=SD,BSe=ED,USe=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,VSe=/^\w*$/;function HSe(e,t){if(zSe(e))return!1;var n=typeof e;return n=="number"||n=="symbol"||n=="boolean"||e==null||BSe(e)?!0:VSe.test(e)||!USe.test(e)||t!=null&&e in Object(t)}var WSe=HSe;function qSe(e){var t=typeof e;return e!=null&&(t=="object"||t=="function")}var Mx=qSe;const GSe=Al(Mx);var KSe=p6,YSe=Mx,XSe="[object AsyncFunction]",QSe="[object Function]",ZSe="[object GeneratorFunction]",JSe="[object Proxy]";function e1e(e){if(!YSe(e))return!1;var t=KSe(e);return t==QSe||t==ZSe||t==XSe||t==JSe}var t1e=e1e,n1e=CD,r1e=n1e["__core-js_shared__"],s1e=r1e,e4=s1e,s9=function(){var e=/[^.]+$/.exec(e4&&e4.keys&&e4.keys.IE_PROTO||"");return e?"Symbol(src)_1."+e:""}();function i1e(e){return!!s9&&s9 in e}var o1e=i1e,a1e=Function.prototype,l1e=a1e.toString;function c1e(e){if(e!=null){try{return l1e.call(e)}catch{}try{return e+""}catch{}}return""}var u1e=c1e,d1e=t1e,f1e=o1e,h1e=Mx,p1e=u1e,m1e=/[\\^$.*+?()[\]{}|]/g,g1e=/^\[object .+?Constructor\]$/,v1e=Function.prototype,y1e=Object.prototype,b1e=v1e.toString,x1e=y1e.hasOwnProperty,_1e=RegExp("^"+b1e.call(x1e).replace(m1e,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$");function w1e(e){if(!h1e(e)||f1e(e))return!1;var t=d1e(e)?_1e:g1e;return t.test(p1e(e))}var S1e=w1e;function C1e(e,t){return e==null?void 0:e[t]}var E1e=C1e,A1e=S1e,R1e=E1e;function P1e(e,t){var n=R1e(e,t);return A1e(n)?n:void 0}var ite=P1e,N1e=ite,T1e=N1e(Object,"create"),AD=T1e,i9=AD;function k1e(){this.__data__=i9?i9(null):{},this.size=0}var D1e=k1e;function O1e(e){var t=this.has(e)&&delete this.__data__[e];return this.size-=t?1:0,t}var M1e=O1e,I1e=AD,L1e="__lodash_hash_undefined__",j1e=Object.prototype,$1e=j1e.hasOwnProperty;function F1e(e){var t=this.__data__;if(I1e){var n=t[e];return n===L1e?void 0:n}return $1e.call(t,e)?t[e]:void 0}var z1e=F1e,B1e=AD,U1e=Object.prototype,V1e=U1e.hasOwnProperty;function H1e(e){var t=this.__data__;return B1e?t[e]!==void 0:V1e.call(t,e)}var W1e=H1e,q1e=AD,G1e="__lodash_hash_undefined__";function K1e(e,t){var n=this.__data__;return this.size+=this.has(e)?0:1,n[e]=q1e&&t===void 0?G1e:t,this}var Y1e=K1e,X1e=D1e,Q1e=M1e,Z1e=z1e,J1e=W1e,eCe=Y1e;function Ix(e){var t=-1,n=e==null?0:e.length;for(this.clear();++t<n;){var r=e[t];this.set(r[0],r[1])}}Ix.prototype.clear=X1e;Ix.prototype.delete=Q1e;Ix.prototype.get=Z1e;Ix.prototype.has=J1e;Ix.prototype.set=eCe;var tCe=Ix;function nCe(){this.__data__=[],this.size=0}var rCe=nCe;function sCe(e,t){return e===t||e!==e&&t!==t}var iCe=sCe,oCe=iCe;function aCe(e,t){for(var n=e.length;n--;)if(oCe(e[n][0],t))return n;return-1}var RD=aCe,lCe=RD,cCe=Array.prototype,uCe=cCe.splice;function dCe(e){var t=this.__data__,n=lCe(t,e);if(n<0)return!1;var r=t.length-1;return n==r?t.pop():uCe.call(t,n,1),--this.size,!0}var fCe=dCe,hCe=RD;function pCe(e){var t=this.__data__,n=hCe(t,e);return n<0?void 0:t[n][1]}var mCe=pCe,gCe=RD;function vCe(e){return gCe(this.__data__,e)>-1}var yCe=vCe,bCe=RD;function xCe(e,t){var n=this.__data__,r=bCe(n,e);return r<0?(++this.size,n.push([e,t])):n[r][1]=t,this}var _Ce=xCe,wCe=rCe,SCe=fCe,CCe=mCe,ECe=yCe,ACe=_Ce;function Lx(e){var t=-1,n=e==null?0:e.length;for(this.clear();++t<n;){var r=e[t];this.set(r[0],r[1])}}Lx.prototype.clear=wCe;Lx.prototype.delete=SCe;Lx.prototype.get=CCe;Lx.prototype.has=ECe;Lx.prototype.set=ACe;var RCe=Lx,PCe=ite,NCe=CD,TCe=PCe(NCe,"Map"),kCe=TCe,o9=tCe,DCe=RCe,OCe=kCe;function MCe(){this.size=0,this.__data__={hash:new o9,map:new(OCe||DCe),string:new o9}}var ICe=MCe;function LCe(e){var t=typeof e;return t=="string"||t=="number"||t=="symbol"||t=="boolean"?e!=="__proto__":e===null}var jCe=LCe,$Ce=jCe;function FCe(e,t){var n=e.__data__;return $Ce(t)?n[typeof t=="string"?"string":"hash"]:n.map}var PD=FCe,zCe=PD;function BCe(e){var t=zCe(this,e).delete(e);return this.size-=t?1:0,t}var UCe=BCe,VCe=PD;function HCe(e){return VCe(this,e).get(e)}var WCe=HCe,qCe=PD;function GCe(e){return qCe(this,e).has(e)}var KCe=GCe,YCe=PD;function XCe(e,t){var n=YCe(this,e),r=n.size;return n.set(e,t),this.size+=n.size==r?0:1,this}var QCe=XCe,ZCe=ICe,JCe=UCe,eEe=WCe,tEe=KCe,nEe=QCe;function jx(e){var t=-1,n=e==null?0:e.length;for(this.clear();++t<n;){var r=e[t];this.set(r[0],r[1])}}jx.prototype.clear=ZCe;jx.prototype.delete=JCe;jx.prototype.get=eEe;jx.prototype.has=tEe;jx.prototype.set=nEe;var rEe=jx,ote=rEe,sEe="Expected a function";function m6(e,t){if(typeof e!="function"||t!=null&&typeof t!="function")throw new TypeError(sEe);var n=function(){var r=arguments,s=t?t.apply(this,r):r[0],i=n.cache;if(i.has(s))return i.get(s);var o=e.apply(this,r);return n.cache=i.set(s,o)||i,o};return n.cache=new(m6.Cache||ote),n}m6.Cache=ote;var iEe=m6,oEe=iEe,aEe=500;function lEe(e){var t=oEe(e,function(r){return n.size===aEe&&n.clear(),r}),n=t.cache;return t}var cEe=lEe,uEe=cEe,dEe=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,fEe=/\\(\\)?/g,hEe=uEe(function(e){var t=[];return e.charCodeAt(0)===46&&t.push(""),e.replace(dEe,function(n,r,s,i){t.push(s?i.replace(fEe,"$1"):r||n)}),t}),pEe=hEe;function mEe(e,t){for(var n=-1,r=e==null?0:e.length,s=Array(r);++n<r;)s[n]=t(e[n],n,e);return s}var gEe=mEe,a9=h6,vEe=gEe,yEe=SD,bEe=ED,l9=a9?a9.prototype:void 0,c9=l9?l9.toString:void 0;function ate(e){if(typeof e=="string")return e;if(yEe(e))return vEe(e,ate)+"";if(bEe(e))return c9?c9.call(e):"";var t=e+"";return t=="0"&&1/e==-1/0?"-0":t}var xEe=ate,_Ee=xEe;function wEe(e){return e==null?"":_Ee(e)}var SEe=wEe,CEe=SD,EEe=WSe,AEe=pEe,REe=SEe;function PEe(e,t){return CEe(e)?e:EEe(e,t)?[e]:AEe(REe(e))}var NEe=PEe,TEe=ED;function kEe(e){if(typeof e=="string"||TEe(e))return e;var t=e+"";return t=="0"&&1/e==-1/0?"-0":t}var DEe=kEe,OEe=NEe,MEe=DEe;function IEe(e,t){t=OEe(t,e);for(var n=0,r=t.length;e!=null&&n<r;)e=e[MEe(t[n++])];return n&&n==r?e:void 0}var LEe=IEe,jEe=LEe;function $Ee(e,t,n){var r=e==null?void 0:jEe(e,t);return r===void 0?n:r}var FEe=$Ee;const BB=Al(FEe);var zEe=p6,BEe=SD,UEe=ste,VEe="[object String]";function HEe(e){return typeof e=="string"||!BEe(e)&&UEe(e)&&zEe(e)==VEe}var WEe=HEe;const qEe=Al(WEe);var ur={};/**
|
||
* @license React
|
||
* react-is.production.min.js
|
||
*
|
||
* Copyright (c) Facebook, Inc. and its affiliates.
|
||
*
|
||
* This source code is licensed under the MIT license found in the
|
||
* LICENSE file in the root directory of this source tree.
|
||
*/var g6=Symbol.for("react.element"),v6=Symbol.for("react.portal"),ND=Symbol.for("react.fragment"),TD=Symbol.for("react.strict_mode"),kD=Symbol.for("react.profiler"),DD=Symbol.for("react.provider"),OD=Symbol.for("react.context"),GEe=Symbol.for("react.server_context"),MD=Symbol.for("react.forward_ref"),ID=Symbol.for("react.suspense"),LD=Symbol.for("react.suspense_list"),jD=Symbol.for("react.memo"),$D=Symbol.for("react.lazy"),KEe=Symbol.for("react.offscreen"),lte;lte=Symbol.for("react.module.reference");function Rl(e){if(typeof e=="object"&&e!==null){var t=e.$$typeof;switch(t){case g6:switch(e=e.type,e){case ND:case kD:case TD:case ID:case LD:return e;default:switch(e=e&&e.$$typeof,e){case GEe:case OD:case MD:case $D:case jD:case DD:return e;default:return t}}case v6:return t}}}ur.ContextConsumer=OD;ur.ContextProvider=DD;ur.Element=g6;ur.ForwardRef=MD;ur.Fragment=ND;ur.Lazy=$D;ur.Memo=jD;ur.Portal=v6;ur.Profiler=kD;ur.StrictMode=TD;ur.Suspense=ID;ur.SuspenseList=LD;ur.isAsyncMode=function(){return!1};ur.isConcurrentMode=function(){return!1};ur.isContextConsumer=function(e){return Rl(e)===OD};ur.isContextProvider=function(e){return Rl(e)===DD};ur.isElement=function(e){return typeof e=="object"&&e!==null&&e.$$typeof===g6};ur.isForwardRef=function(e){return Rl(e)===MD};ur.isFragment=function(e){return Rl(e)===ND};ur.isLazy=function(e){return Rl(e)===$D};ur.isMemo=function(e){return Rl(e)===jD};ur.isPortal=function(e){return Rl(e)===v6};ur.isProfiler=function(e){return Rl(e)===kD};ur.isStrictMode=function(e){return Rl(e)===TD};ur.isSuspense=function(e){return Rl(e)===ID};ur.isSuspenseList=function(e){return Rl(e)===LD};ur.isValidElementType=function(e){return typeof e=="string"||typeof e=="function"||e===ND||e===kD||e===TD||e===ID||e===LD||e===KEe||typeof e=="object"&&e!==null&&(e.$$typeof===$D||e.$$typeof===jD||e.$$typeof===DD||e.$$typeof===OD||e.$$typeof===MD||e.$$typeof===lte||e.getModuleId!==void 0)};ur.typeOf=Rl;var eP=function(t){return qEe(t)&&t.indexOf("%")===t.length-1},YEe=function(t){return typeof t=="string"?t:t?t.displayName||t.name||"Component":""},t4=function(t,n){for(var r=arguments.length,s=new Array(r>2?r-2:0),i=2;i<r;i++)s[i-2]=arguments[i]},XEe=CD,QEe=function(){return XEe.Date.now()},ZEe=QEe,JEe=/\s/;function eAe(e){for(var t=e.length;t--&&JEe.test(e.charAt(t)););return t}var tAe=eAe,nAe=tAe,rAe=/^\s+/;function sAe(e){return e&&e.slice(0,nAe(e)+1).replace(rAe,"")}var iAe=sAe,oAe=iAe,u9=Mx,aAe=ED,d9=NaN,lAe=/^[-+]0x[0-9a-f]+$/i,cAe=/^0b[01]+$/i,uAe=/^0o[0-7]+$/i,dAe=parseInt;function fAe(e){if(typeof e=="number")return e;if(aAe(e))return d9;if(u9(e)){var t=typeof e.valueOf=="function"?e.valueOf():e;e=u9(t)?t+"":t}if(typeof e!="string")return e===0?e:+e;e=oAe(e);var n=cAe.test(e);return n||uAe.test(e)?dAe(e.slice(2),n?2:8):lAe.test(e)?d9:+e}var hAe=fAe,pAe=Mx,n4=ZEe,f9=hAe,mAe="Expected a function",gAe=Math.max,vAe=Math.min;function yAe(e,t,n){var r,s,i,o,a,c,d=0,h=!1,u=!1,f=!0;if(typeof e!="function")throw new TypeError(mAe);t=f9(t)||0,pAe(n)&&(h=!!n.leading,u="maxWait"in n,i=u?gAe(f9(n.maxWait)||0,t):i,f="trailing"in n?!!n.trailing:f);function g(T){var N=r,A=s;return r=s=void 0,d=T,o=e.apply(A,N),o}function v(T){return d=T,a=setTimeout(y,t),h?g(T):o}function m(T){var N=T-c,A=T-d,D=t-N;return u?vAe(D,i-A):D}function x(T){var N=T-c,A=T-d;return c===void 0||N>=t||N<0||u&&A>=i}function y(){var T=n4();if(x(T))return b(T);a=setTimeout(y,m(T))}function b(T){return a=void 0,f&&r?g(T):(r=s=void 0,o)}function w(){a!==void 0&&clearTimeout(a),d=0,r=c=s=a=void 0}function E(){return a===void 0?o:b(n4())}function R(){var T=n4(),N=x(T);if(r=arguments,s=this,c=T,N){if(a===void 0)return v(c);if(u)return clearTimeout(a),a=setTimeout(y,t),g(c)}return a===void 0&&(a=setTimeout(y,t)),o}return R.cancel=w,R.flush=E,R}var bAe=yAe,xAe=bAe,_Ae=Mx,wAe="Expected a function";function SAe(e,t,n){var r=!0,s=!0;if(typeof e!="function")throw new TypeError(wAe);return _Ae(n)&&(r="leading"in n?!!n.leading:r,s="trailing"in n?!!n.trailing:s),xAe(e,t,{leading:r,maxWait:t,trailing:s})}var CAe=SAe;const EAe=Al(CAe);function xC(e){"@babel/helpers - typeof";return xC=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},xC(e)}function h9(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(s){return Object.getOwnPropertyDescriptor(e,s).enumerable})),n.push.apply(n,r)}return n}function tP(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?h9(Object(n),!0).forEach(function(r){AAe(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):h9(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function AAe(e,t,n){return t=RAe(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function RAe(e){var t=PAe(e,"string");return xC(t)=="symbol"?t:t+""}function PAe(e,t){if(xC(e)!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(xC(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function NAe(e,t){return OAe(e)||DAe(e,t)||kAe(e,t)||TAe()}function TAe(){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 kAe(e,t){if(e){if(typeof e=="string")return p9(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);if(n==="Object"&&e.constructor&&(n=e.constructor.name),n==="Map"||n==="Set")return Array.from(e);if(n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return p9(e,t)}}function p9(e,t){(t==null||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function DAe(e,t){var n=e==null?null:typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(n!=null){var r,s,i,o,a=[],c=!0,d=!1;try{if(i=(n=n.call(e)).next,t!==0)for(;!(c=(r=i.call(n)).done)&&(a.push(r.value),a.length!==t);c=!0);}catch(h){d=!0,s=h}finally{try{if(!c&&n.return!=null&&(o=n.return(),Object(o)!==o))return}finally{if(d)throw s}}return a}}function OAe(e){if(Array.isArray(e))return e}var MAe=C.forwardRef(function(e,t){var n=e.aspect,r=e.initialDimension,s=r===void 0?{width:-1,height:-1}:r,i=e.width,o=i===void 0?"100%":i,a=e.height,c=a===void 0?"100%":a,d=e.minWidth,h=d===void 0?0:d,u=e.minHeight,f=e.maxHeight,g=e.children,v=e.debounce,m=v===void 0?0:v,x=e.id,y=e.className,b=e.onResize,w=e.style,E=w===void 0?{}:w,R=C.useRef(null),T=C.useRef();T.current=b,C.useImperativeHandle(t,function(){return Object.defineProperty(R.current,"current",{get:function(){return console.warn("The usage of ref.current.current is deprecated and will no longer be supported."),R.current},configurable:!0})});var N=C.useState({containerWidth:s.width,containerHeight:s.height}),A=NAe(N,2),D=A[0],O=A[1],I=C.useCallback(function(F,B){O(function(W){var Z=Math.round(F),Y=Math.round(B);return W.containerWidth===Z&&W.containerHeight===Y?W:{containerWidth:Z,containerHeight:Y}})},[]);C.useEffect(function(){var F=function(se){var he,re=se[0].contentRect,J=re.width,te=re.height;I(J,te),(he=T.current)===null||he===void 0||he.call(T,J,te)};m>0&&(F=EAe(F,m,{trailing:!0,leading:!1}));var B=new ResizeObserver(F),W=R.current.getBoundingClientRect(),Z=W.width,Y=W.height;return I(Z,Y),B.observe(R.current),function(){B.disconnect()}},[I,m]);var $=C.useMemo(function(){var F=D.containerWidth,B=D.containerHeight;if(F<0||B<0)return null;t4(eP(o)||eP(c),`The width(%s) and height(%s) are both fixed numbers,
|
||
maybe you don't need to use a ResponsiveContainer.`,o,c),t4(!n||n>0,"The aspect(%s) must be greater than zero.",n);var W=eP(o)?F:o,Z=eP(c)?B:c;n&&n>0&&(W?Z=W/n:Z&&(W=Z*n),f&&Z>f&&(Z=f)),t4(W>0||Z>0,`The width(%s) and height(%s) of chart should be greater than 0,
|
||
please check the style of container, or the props width(%s) and height(%s),
|
||
or add a minWidth(%s) or minHeight(%s) or use aspect(%s) to control the
|
||
height and width.`,W,Z,o,c,h,u,n);var Y=!Array.isArray(g)&&YEe(g.type).endsWith("Chart");return fe.Children.map(g,function(H){return fe.isValidElement(H)?C.cloneElement(H,tP({width:W,height:Z},Y?{style:tP({height:"100%",width:"100%",maxHeight:Z,maxWidth:W},H.props.style)}:{})):H})},[n,g,c,f,u,h,D,o]);return fe.createElement("div",{id:x?"".concat(x):void 0,className:oy("recharts-responsive-container",y),style:tP(tP({},E),{},{width:o,height:c,minWidth:h,minHeight:u,maxHeight:f}),ref:R},$)}),IAe="Invariant failed";function yr(e,t){if(!e)throw new Error(IAe)}function UB(){return UB=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)({}).hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},UB.apply(null,arguments)}const LAe={light:"",dark:".dark"},cte=C.createContext(null);function ute(){const e=C.useContext(cte);if(!e)throw new Error("useChart must be used within a <ChartContainer />");return e}const jAe=C.forwardRef(({id:e,className:t,children:n,config:r,...s},i)=>{const o=C.useId(),a=`chart-${e||o.replace(/:/g,"")}`;return _.jsx(cte.Provider,{value:{config:r},children:_.jsxs("div",{"data-chart":a,ref:i,className:ge("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",t),...s,children:[_.jsx($Ae,{id:a,config:r}),_.jsx(MAe,{children:n})]})})});jAe.displayName="Chart";const $Ae=({id:e,config:t})=>{const n=Object.entries(t).filter(([r,s])=>s.theme||s.color);return n.length?_.jsx("style",{dangerouslySetInnerHTML:{__html:Object.entries(LAe).map(([r,s])=>`
|
||
${s} [data-chart=${e}] {
|
||
${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},FAe=C.forwardRef(({active:e,payload:t,className:n,indicator:r="dot",hideLabel:s=!1,hideIndicator:i=!1,label:o,labelFormatter:a,labelClassName:c,formatter:d,color:h,nameKey:u,labelKey:f},g)=>{const{config:v}=ute(),m=C.useMemo(()=>{var R;if(s||!(t!=null&&t.length))return null;const[y]=t,b=`${f||y.dataKey||y.name||"value"}`,w=VB(v,y,b),E=!f&&typeof o=="string"?((R=v[o])==null?void 0:R.label)||o:w==null?void 0:w.label;return a?_.jsx("div",{className:ge("font-medium",c),children:a(E,t)}):E?_.jsx("div",{className:ge("font-medium",c),children:E}):null},[o,a,t,s,c,v,f]);if(!e||!(t!=null&&t.length))return null;const x=t.length===1&&r!=="dot";return _.jsxs("div",{ref:g,className:ge("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:[x?null:m,_.jsx("div",{className:"grid gap-1.5",children:t.map((y,b)=>{const w=`${u||y.name||y.dataKey||"value"}`,E=VB(v,y,w),R=h||y.payload.fill||y.color;return _.jsx("div",{className:ge("flex w-full flex-wrap items-stretch gap-2 [&>svg]:h-2.5 [&>svg]:w-2.5 [&>svg]:text-muted-foreground",r==="dot"&&"items-center"),children:d&&(y==null?void 0:y.value)!==void 0&&y.name?d(y.value,y.name,y,b,y.payload):_.jsxs(_.Fragment,{children:[E!=null&&E.icon?_.jsx(E.icon,{}):!i&&_.jsx("div",{className:ge("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":x&&r==="dashed"}),style:{"--color-bg":R,"--color-border":R}}),_.jsxs("div",{className:ge("flex flex-1 justify-between leading-none",x?"items-end":"items-center"),children:[_.jsxs("div",{className:"grid gap-1.5",children:[x?m:null,_.jsx("span",{className:"text-muted-foreground",children:(E==null?void 0:E.label)||y.name})]}),y.value&&_.jsx("span",{className:"font-mono font-medium tabular-nums text-foreground",children:y.value.toLocaleString()})]})]})},y.dataKey)})})]})});FAe.displayName="ChartTooltip";const zAe=C.forwardRef(({className:e,hideIcon:t=!1,payload:n,verticalAlign:r="bottom",nameKey:s},i)=>{const{config:o}=ute();return n!=null&&n.length?_.jsx("div",{ref:i,className:ge("flex items-center justify-center gap-4",r==="top"?"pb-3":"pt-3",e),children:n.map(a=>{const c=`${s||a.dataKey||"value"}`,d=VB(o,a,c);return _.jsxs("div",{className:ge("flex items-center gap-1.5 [&>svg]:h-3 [&>svg]:w-3 [&>svg]:text-muted-foreground"),children:[d!=null&&d.icon&&!t?_.jsx(d.icon,{}):_.jsx("div",{className:"h-2 w-2 shrink-0 rounded-[2px]",style:{backgroundColor:a.color}}),d==null?void 0:d.label]},a.value)})}):null});zAe.displayName="ChartLegend";function VB(e,t,n){if(typeof t!="object"||t===null)return;const r="payload"in t&&typeof t.payload=="object"&&t.payload!==null?t.payload:void 0;let s=n;return n in t&&typeof t[n]=="string"?s=t[n]:r&&n in r&&typeof r[n]=="string"&&(s=r[n]),s in e?e[s]:e[n]}function $x(e){const t=C.useRef({value:e,previous:e});return C.useMemo(()=>(t.current.value!==e&&(t.current.previous=t.current.value,t.current.value=e),t.current.previous),[e])}function WA(e){const[t,n]=C.useState(void 0);return Rr(()=>{if(e){n({width:e.offsetWidth,height:e.offsetHeight});const r=new ResizeObserver(s=>{if(!Array.isArray(s)||!s.length)return;const i=s[0];let o,a;if("borderBoxSize"in i){const c=i.borderBoxSize,d=Array.isArray(c)?c[0]:c;o=d.inlineSize,a=d.blockSize}else o=e.offsetWidth,a=e.offsetHeight;n({width:o,height:a})});return r.observe(e,{box:"border-box"}),()=>r.unobserve(e)}else n(void 0)},[e]),t}var y6="Checkbox",[BAe,i7e]=_r(y6),[UAe,VAe]=BAe(y6),dte=C.forwardRef((e,t)=>{const{__scopeCheckbox:n,name:r,checked:s,defaultChecked:i,required:o,disabled:a,value:c="on",onCheckedChange:d,...h}=e,[u,f]=C.useState(null),g=_t(t,w=>f(w)),v=C.useRef(!1),m=u?!!u.closest("form"):!0,[x=!1,y]=os({prop:s,defaultProp:i,onChange:d}),b=C.useRef(x);return C.useEffect(()=>{const w=u==null?void 0:u.form;if(w){const E=()=>y(b.current);return w.addEventListener("reset",E),()=>w.removeEventListener("reset",E)}},[u,y]),_.jsxs(UAe,{scope:n,state:x,disabled:a,children:[_.jsx(He.button,{type:"button",role:"checkbox","aria-checked":Cv(x)?"mixed":x,"aria-required":o,"data-state":pte(x),"data-disabled":a?"":void 0,disabled:a,value:c,...h,ref:g,onKeyDown:Ae(e.onKeyDown,w=>{w.key==="Enter"&&w.preventDefault()}),onClick:Ae(e.onClick,w=>{y(E=>Cv(E)?!0:!E),m&&(v.current=w.isPropagationStopped(),v.current||w.stopPropagation())})}),m&&_.jsx(HAe,{control:u,bubbles:!v.current,name:r,value:c,checked:x,required:o,disabled:a,style:{transform:"translateX(-100%)"}})]})});dte.displayName=y6;var fte="CheckboxIndicator",hte=C.forwardRef((e,t)=>{const{__scopeCheckbox:n,forceMount:r,...s}=e,i=VAe(fte,n);return _.jsx(Vr,{present:r||Cv(i.state)||i.state===!0,children:_.jsx(He.span,{"data-state":pte(i.state),"data-disabled":i.disabled?"":void 0,...s,ref:t,style:{pointerEvents:"none",...e.style}})})});hte.displayName=fte;var HAe=e=>{const{control:t,checked:n,bubbles:r=!0,...s}=e,i=C.useRef(null),o=$x(n),a=WA(t);return C.useEffect(()=>{const c=i.current,d=window.HTMLInputElement.prototype,u=Object.getOwnPropertyDescriptor(d,"checked").set;if(o!==n&&u){const f=new Event("click",{bubbles:r});c.indeterminate=Cv(n),u.call(c,Cv(n)?!1:n),c.dispatchEvent(f)}},[o,n,r]),_.jsx("input",{type:"checkbox","aria-hidden":!0,defaultChecked:Cv(n)?!1:n,...s,tabIndex:-1,ref:i,style:{...e.style,...a,position:"absolute",pointerEvents:"none",opacity:0,margin:0}})};function Cv(e){return e==="indeterminate"}function pte(e){return Cv(e)?"indeterminate":e?"checked":"unchecked"}var mte=dte,WAe=hte;const _C=C.forwardRef(({className:e,...t},n)=>_.jsx(mte,{ref:n,className:ge("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",e),...t,children:_.jsx(WAe,{className:ge("flex items-center justify-center text-current"),children:_.jsx(OA,{className:"h-4 w-4"})})}));_C.displayName=mte.displayName;var m9=1,qAe=.9,GAe=.8,KAe=.17,r4=.1,s4=.999,YAe=.9999,XAe=.99,QAe=/[\\\/_+.#"@\[\(\{&]/,ZAe=/[\\\/_+.#"@\[\(\{&]/g,JAe=/[\s-]/,gte=/[\s-]/g;function HB(e,t,n,r,s,i,o){if(i===t.length)return s===e.length?m9:XAe;var a=`${s},${i}`;if(o[a]!==void 0)return o[a];for(var c=r.charAt(i),d=n.indexOf(c,s),h=0,u,f,g,v;d>=0;)u=HB(e,t,n,r,d+1,i+1,o),u>h&&(d===s?u*=m9:QAe.test(e.charAt(d-1))?(u*=GAe,g=e.slice(s,d-1).match(ZAe),g&&s>0&&(u*=Math.pow(s4,g.length))):JAe.test(e.charAt(d-1))?(u*=qAe,v=e.slice(s,d-1).match(gte),v&&s>0&&(u*=Math.pow(s4,v.length))):(u*=KAe,s>0&&(u*=Math.pow(s4,d-s))),e.charAt(d)!==t.charAt(i)&&(u*=YAe)),(u<r4&&n.charAt(d-1)===r.charAt(i+1)||r.charAt(i+1)===r.charAt(i)&&n.charAt(d-1)!==r.charAt(i))&&(f=HB(e,t,n,r,d+1,i+2,o),f*r4>u&&(u=f*r4)),u>h&&(h=u),d=n.indexOf(c,d+1);return o[a]=h,h}function g9(e){return e.toLowerCase().replace(gte," ")}function eRe(e,t,n){return e=n&&n.length>0?`${e+" "+n.join(" ")}`:e,HB(e,t,g9(e),g9(t),0,0,{})}function lp(e,t,{checkForDefaultPrevented:n=!0}={}){return function(s){if(e==null||e(s),n===!1||!s.defaultPrevented)return t==null?void 0:t(s)}}function v9(e,t){if(typeof e=="function")return e(t);e!=null&&(e.current=t)}function zv(...e){return t=>{let n=!1;const r=e.map(s=>{const i=v9(s,t);return!n&&typeof i=="function"&&(n=!0),i});if(n)return()=>{for(let s=0;s<r.length;s++){const i=r[s];typeof i=="function"?i():v9(e[s],null)}}}}function ly(...e){return C.useCallback(zv(...e),e)}function tRe(e,t){const n=C.createContext(t),r=i=>{const{children:o,...a}=i,c=C.useMemo(()=>a,Object.values(a));return _.jsx(n.Provider,{value:c,children:o})};r.displayName=e+"Provider";function s(i){const o=C.useContext(n);if(o)return o;if(t!==void 0)return t;throw new Error(`\`${i}\` must be used within \`${e}\``)}return[r,s]}function nRe(e,t=[]){let n=[];function r(i,o){const a=C.createContext(o),c=n.length;n=[...n,o];const d=u=>{var y;const{scope:f,children:g,...v}=u,m=((y=f==null?void 0:f[e])==null?void 0:y[c])||a,x=C.useMemo(()=>v,Object.values(v));return _.jsx(m.Provider,{value:x,children:g})};d.displayName=i+"Provider";function h(u,f){var m;const g=((m=f==null?void 0:f[e])==null?void 0:m[c])||a,v=C.useContext(g);if(v)return v;if(o!==void 0)return o;throw new Error(`\`${u}\` must be used within \`${i}\``)}return[d,h]}const s=()=>{const i=n.map(o=>C.createContext(o));return function(a){const c=(a==null?void 0:a[e])||i;return C.useMemo(()=>({[`__scope${e}`]:{...a,[e]:c}}),[a,c])}};return s.scopeName=e,[r,rRe(s,...t)]}function rRe(...e){const t=e[0];if(e.length===1)return t;const n=()=>{const r=e.map(s=>({useScope:s(),scopeName:s.scopeName}));return function(i){const o=r.reduce((a,{useScope:c,scopeName:d})=>{const u=c(i)[`__scope${d}`];return{...a,...u}},{});return C.useMemo(()=>({[`__scope${t.scopeName}`]:o}),[o])}};return n.scopeName=t.scopeName,n}const vT=globalThis!=null&&globalThis.document?C.useLayoutEffect:()=>{},sRe=Tv.useId||(()=>{});let iRe=0;function Cf(e){const[t,n]=C.useState(sRe());return vT(()=>{n(r=>r??String(iRe++))},[e]),t?`radix-${t}`:""}function Bv(e){const t=C.useRef(e);return C.useEffect(()=>{t.current=e}),C.useMemo(()=>(...n)=>{var r;return(r=t.current)===null||r===void 0?void 0:r.call(t,...n)},[])}function oRe({prop:e,defaultProp:t,onChange:n=()=>{}}){const[r,s]=aRe({defaultProp:t,onChange:n}),i=e!==void 0,o=i?e:r,a=Bv(n),c=C.useCallback(d=>{if(i){const u=typeof d=="function"?d(e):d;u!==e&&a(u)}else s(d)},[i,e,s,a]);return[o,c]}function aRe({defaultProp:e,onChange:t}){const n=C.useState(e),[r]=n,s=C.useRef(r),i=Bv(t);return C.useEffect(()=>{s.current!==r&&(i(r),s.current=r)},[r,s,i]),n}var b6=C.forwardRef((e,t)=>{const{children:n,...r}=e,s=C.Children.toArray(n),i=s.find(cRe);if(i){const o=i.props.children,a=s.map(c=>c===i?C.Children.count(o)>1?C.Children.only(null):C.isValidElement(o)?o.props.children:null:c);return _.jsx(WB,{...r,ref:t,children:C.isValidElement(o)?C.cloneElement(o,void 0,a):null})}return _.jsx(WB,{...r,ref:t,children:n})});b6.displayName="Slot";var WB=C.forwardRef((e,t)=>{const{children:n,...r}=e;if(C.isValidElement(n)){const s=dRe(n),i=uRe(r,n.props);return n.type!==C.Fragment&&(i.ref=t?zv(t,s):s),C.cloneElement(n,i)}return C.Children.count(n)>1?C.Children.only(null):null});WB.displayName="SlotClone";var lRe=({children:e})=>_.jsx(_.Fragment,{children:e});function cRe(e){return C.isValidElement(e)&&e.type===lRe}function uRe(e,t){const n={...t};for(const r in t){const s=e[r],i=t[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{...e,...n}}function dRe(e){var r,s;let t=(r=Object.getOwnPropertyDescriptor(e.props,"ref"))==null?void 0:r.get,n=t&&"isReactWarning"in t&&t.isReactWarning;return n?e.ref:(t=(s=Object.getOwnPropertyDescriptor(e,"ref"))==null?void 0:s.get,n=t&&"isReactWarning"in t&&t.isReactWarning,n?e.props.ref:e.props.ref||e.ref)}var fRe=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","span","svg","ul"],zi=fRe.reduce((e,t)=>{const n=C.forwardRef((r,s)=>{const{asChild:i,...o}=r,a=i?b6:t;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),_.jsx(a,{...o,ref:s})});return n.displayName=`Primitive.${t}`,{...e,[t]:n}},{});function hRe(e,t){e&&Li.flushSync(()=>e.dispatchEvent(t))}function pRe(e,t=globalThis==null?void 0:globalThis.document){const n=Bv(e);C.useEffect(()=>{const r=s=>{s.key==="Escape"&&n(s)};return t.addEventListener("keydown",r),()=>t.removeEventListener("keydown",r)},[n,t])}var mRe="DismissableLayer",qB="dismissableLayer.update",gRe="dismissableLayer.pointerDownOutside",vRe="dismissableLayer.focusOutside",y9,vte=C.createContext({layers:new Set,layersWithOutsidePointerEventsDisabled:new Set,branches:new Set}),yte=C.forwardRef((e,t)=>{const{disableOutsidePointerEvents:n=!1,onEscapeKeyDown:r,onPointerDownOutside:s,onFocusOutside:i,onInteractOutside:o,onDismiss:a,...c}=e,d=C.useContext(vte),[h,u]=C.useState(null),f=(h==null?void 0:h.ownerDocument)??(globalThis==null?void 0:globalThis.document),[,g]=C.useState({}),v=ly(t,N=>u(N)),m=Array.from(d.layers),[x]=[...d.layersWithOutsidePointerEventsDisabled].slice(-1),y=m.indexOf(x),b=h?m.indexOf(h):-1,w=d.layersWithOutsidePointerEventsDisabled.size>0,E=b>=y,R=xRe(N=>{const A=N.target,D=[...d.branches].some(O=>O.contains(A));!E||D||(s==null||s(N),o==null||o(N),N.defaultPrevented||a==null||a())},f),T=_Re(N=>{const A=N.target;[...d.branches].some(O=>O.contains(A))||(i==null||i(N),o==null||o(N),N.defaultPrevented||a==null||a())},f);return pRe(N=>{b===d.layers.size-1&&(r==null||r(N),!N.defaultPrevented&&a&&(N.preventDefault(),a()))},f),C.useEffect(()=>{if(h)return n&&(d.layersWithOutsidePointerEventsDisabled.size===0&&(y9=f.body.style.pointerEvents,f.body.style.pointerEvents="none"),d.layersWithOutsidePointerEventsDisabled.add(h)),d.layers.add(h),b9(),()=>{n&&d.layersWithOutsidePointerEventsDisabled.size===1&&(f.body.style.pointerEvents=y9)}},[h,f,n,d]),C.useEffect(()=>()=>{h&&(d.layers.delete(h),d.layersWithOutsidePointerEventsDisabled.delete(h),b9())},[h,d]),C.useEffect(()=>{const N=()=>g({});return document.addEventListener(qB,N),()=>document.removeEventListener(qB,N)},[]),_.jsx(zi.div,{...c,ref:v,style:{pointerEvents:w?E?"auto":"none":void 0,...e.style},onFocusCapture:lp(e.onFocusCapture,T.onFocusCapture),onBlurCapture:lp(e.onBlurCapture,T.onBlurCapture),onPointerDownCapture:lp(e.onPointerDownCapture,R.onPointerDownCapture)})});yte.displayName=mRe;var yRe="DismissableLayerBranch",bRe=C.forwardRef((e,t)=>{const n=C.useContext(vte),r=C.useRef(null),s=ly(t,r);return C.useEffect(()=>{const i=r.current;if(i)return n.branches.add(i),()=>{n.branches.delete(i)}},[n.branches]),_.jsx(zi.div,{...e,ref:s})});bRe.displayName=yRe;function xRe(e,t=globalThis==null?void 0:globalThis.document){const n=Bv(e),r=C.useRef(!1),s=C.useRef(()=>{});return C.useEffect(()=>{const i=a=>{if(a.target&&!r.current){let c=function(){bte(gRe,n,d,{discrete:!0})};const d={originalEvent:a};a.pointerType==="touch"?(t.removeEventListener("click",s.current),s.current=c,t.addEventListener("click",s.current,{once:!0})):c()}else t.removeEventListener("click",s.current);r.current=!1},o=window.setTimeout(()=>{t.addEventListener("pointerdown",i)},0);return()=>{window.clearTimeout(o),t.removeEventListener("pointerdown",i),t.removeEventListener("click",s.current)}},[t,n]),{onPointerDownCapture:()=>r.current=!0}}function _Re(e,t=globalThis==null?void 0:globalThis.document){const n=Bv(e),r=C.useRef(!1);return C.useEffect(()=>{const s=i=>{i.target&&!r.current&&bte(vRe,n,{originalEvent:i},{discrete:!1})};return t.addEventListener("focusin",s),()=>t.removeEventListener("focusin",s)},[t,n]),{onFocusCapture:()=>r.current=!0,onBlurCapture:()=>r.current=!1}}function b9(){const e=new CustomEvent(qB);document.dispatchEvent(e)}function bte(e,t,n,{discrete:r}){const s=n.originalEvent.target,i=new CustomEvent(e,{bubbles:!1,cancelable:!0,detail:n});t&&s.addEventListener(e,t,{once:!0}),r?hRe(s,i):s.dispatchEvent(i)}var i4="focusScope.autoFocusOnMount",o4="focusScope.autoFocusOnUnmount",x9={bubbles:!1,cancelable:!0},wRe="FocusScope",xte=C.forwardRef((e,t)=>{const{loop:n=!1,trapped:r=!1,onMountAutoFocus:s,onUnmountAutoFocus:i,...o}=e,[a,c]=C.useState(null),d=Bv(s),h=Bv(i),u=C.useRef(null),f=ly(t,m=>c(m)),g=C.useRef({paused:!1,pause(){this.paused=!0},resume(){this.paused=!1}}).current;C.useEffect(()=>{if(r){let m=function(w){if(g.paused||!a)return;const E=w.target;a.contains(E)?u.current=E:nh(u.current,{select:!0})},x=function(w){if(g.paused||!a)return;const E=w.relatedTarget;E!==null&&(a.contains(E)||nh(u.current,{select:!0}))},y=function(w){if(document.activeElement===document.body)for(const R of w)R.removedNodes.length>0&&nh(a)};document.addEventListener("focusin",m),document.addEventListener("focusout",x);const b=new MutationObserver(y);return a&&b.observe(a,{childList:!0,subtree:!0}),()=>{document.removeEventListener("focusin",m),document.removeEventListener("focusout",x),b.disconnect()}}},[r,a,g.paused]),C.useEffect(()=>{if(a){w9.add(g);const m=document.activeElement;if(!a.contains(m)){const y=new CustomEvent(i4,x9);a.addEventListener(i4,d),a.dispatchEvent(y),y.defaultPrevented||(SRe(PRe(_te(a)),{select:!0}),document.activeElement===m&&nh(a))}return()=>{a.removeEventListener(i4,d),setTimeout(()=>{const y=new CustomEvent(o4,x9);a.addEventListener(o4,h),a.dispatchEvent(y),y.defaultPrevented||nh(m??document.body,{select:!0}),a.removeEventListener(o4,h),w9.remove(g)},0)}}},[a,d,h,g]);const v=C.useCallback(m=>{if(!n&&!r||g.paused)return;const x=m.key==="Tab"&&!m.altKey&&!m.ctrlKey&&!m.metaKey,y=document.activeElement;if(x&&y){const b=m.currentTarget,[w,E]=CRe(b);w&&E?!m.shiftKey&&y===E?(m.preventDefault(),n&&nh(w,{select:!0})):m.shiftKey&&y===w&&(m.preventDefault(),n&&nh(E,{select:!0})):y===b&&m.preventDefault()}},[n,r,g.paused]);return _.jsx(zi.div,{tabIndex:-1,...o,ref:f,onKeyDown:v})});xte.displayName=wRe;function SRe(e,{select:t=!1}={}){const n=document.activeElement;for(const r of e)if(nh(r,{select:t}),document.activeElement!==n)return}function CRe(e){const t=_te(e),n=_9(t,e),r=_9(t.reverse(),e);return[n,r]}function _te(e){const t=[],n=document.createTreeWalker(e,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();)t.push(n.currentNode);return t}function _9(e,t){for(const n of e)if(!ERe(n,{upTo:t}))return n}function ERe(e,{upTo:t}){if(getComputedStyle(e).visibility==="hidden")return!0;for(;e;){if(t!==void 0&&e===t)return!1;if(getComputedStyle(e).display==="none")return!0;e=e.parentElement}return!1}function ARe(e){return e instanceof HTMLInputElement&&"select"in e}function nh(e,{select:t=!1}={}){if(e&&e.focus){const n=document.activeElement;e.focus({preventScroll:!0}),e!==n&&ARe(e)&&t&&e.select()}}var w9=RRe();function RRe(){let e=[];return{add(t){const n=e[0];t!==n&&(n==null||n.pause()),e=S9(e,t),e.unshift(t)},remove(t){var n;e=S9(e,t),(n=e[0])==null||n.resume()}}}function S9(e,t){const n=[...e],r=n.indexOf(t);return r!==-1&&n.splice(r,1),n}function PRe(e){return e.filter(t=>t.tagName!=="A")}var NRe="Portal",wte=C.forwardRef((e,t)=>{var a;const{container:n,...r}=e,[s,i]=C.useState(!1);vT(()=>i(!0),[]);const o=n||s&&((a=globalThis==null?void 0:globalThis.document)==null?void 0:a.body);return o?kA.createPortal(_.jsx(zi.div,{...r,ref:t}),o):null});wte.displayName=NRe;function TRe(e,t){return C.useReducer((n,r)=>t[n][r]??n,e)}var FD=e=>{const{present:t,children:n}=e,r=kRe(t),s=typeof n=="function"?n({present:r.isPresent}):C.Children.only(n),i=ly(r.ref,DRe(s));return typeof n=="function"||r.isPresent?C.cloneElement(s,{ref:i}):null};FD.displayName="Presence";function kRe(e){const[t,n]=C.useState(),r=C.useRef({}),s=C.useRef(e),i=C.useRef("none"),o=e?"mounted":"unmounted",[a,c]=TRe(o,{mounted:{UNMOUNT:"unmounted",ANIMATION_OUT:"unmountSuspended"},unmountSuspended:{MOUNT:"mounted",ANIMATION_END:"unmounted"},unmounted:{MOUNT:"mounted"}});return C.useEffect(()=>{const d=nP(r.current);i.current=a==="mounted"?d:"none"},[a]),vT(()=>{const d=r.current,h=s.current;if(h!==e){const f=i.current,g=nP(d);e?c("MOUNT"):g==="none"||(d==null?void 0:d.display)==="none"?c("UNMOUNT"):c(h&&f!==g?"ANIMATION_OUT":"UNMOUNT"),s.current=e}},[e,c]),vT(()=>{if(t){let d;const h=t.ownerDocument.defaultView??window,u=g=>{const m=nP(r.current).includes(g.animationName);if(g.target===t&&m&&(c("ANIMATION_END"),!s.current)){const x=t.style.animationFillMode;t.style.animationFillMode="forwards",d=h.setTimeout(()=>{t.style.animationFillMode==="forwards"&&(t.style.animationFillMode=x)})}},f=g=>{g.target===t&&(i.current=nP(r.current))};return t.addEventListener("animationstart",f),t.addEventListener("animationcancel",u),t.addEventListener("animationend",u),()=>{h.clearTimeout(d),t.removeEventListener("animationstart",f),t.removeEventListener("animationcancel",u),t.removeEventListener("animationend",u)}}else c("ANIMATION_END")},[t,c]),{isPresent:["mounted","unmountSuspended"].includes(a),ref:C.useCallback(d=>{d&&(r.current=getComputedStyle(d)),n(d)},[])}}function nP(e){return(e==null?void 0:e.animationName)||"none"}function DRe(e){var r,s;let t=(r=Object.getOwnPropertyDescriptor(e.props,"ref"))==null?void 0:r.get,n=t&&"isReactWarning"in t&&t.isReactWarning;return n?e.ref:(t=(s=Object.getOwnPropertyDescriptor(e,"ref"))==null?void 0:s.get,n=t&&"isReactWarning"in t&&t.isReactWarning,n?e.props.ref:e.props.ref||e.ref)}var a4=0;function ORe(){C.useEffect(()=>{const e=document.querySelectorAll("[data-radix-focus-guard]");return document.body.insertAdjacentElement("afterbegin",e[0]??C9()),document.body.insertAdjacentElement("beforeend",e[1]??C9()),a4++,()=>{a4===1&&document.querySelectorAll("[data-radix-focus-guard]").forEach(t=>t.remove()),a4--}},[])}function C9(){const e=document.createElement("span");return e.setAttribute("data-radix-focus-guard",""),e.tabIndex=0,e.style.outline="none",e.style.opacity="0",e.style.position="fixed",e.style.pointerEvents="none",e}var Ste=UH(),l4=function(){},zD=C.forwardRef(function(e,t){var n=C.useRef(null),r=C.useState({onScrollCapture:l4,onWheelCapture:l4,onTouchMoveCapture:l4}),s=r[0],i=r[1],o=e.forwardProps,a=e.children,c=e.className,d=e.removeScrollBar,h=e.enabled,u=e.shards,f=e.sideCar,g=e.noIsolation,v=e.inert,m=e.allowPinchZoom,x=e.as,y=x===void 0?"div":x,b=e.gapMode,w=dD(e,["forwardProps","children","className","removeScrollBar","enabled","shards","sideCar","noIsolation","inert","allowPinchZoom","as","gapMode"]),E=f,R=BH([n,t]),T=fs(fs({},w),s);return C.createElement(C.Fragment,null,h&&C.createElement(E,{sideCar:Ste,removeScrollBar:d,shards:u,noIsolation:g,inert:v,setCallbacks:i,allowPinchZoom:!!m,lockRef:n,gapMode:b}),o?C.cloneElement(C.Children.only(a),fs(fs({},T),{ref:R})):C.createElement(y,fs({},T,{className:c,ref:R}),a))});zD.defaultProps={enabled:!0,removeScrollBar:!0,inert:!1};zD.classNames={fullWidth:Nb,zeroRight:Pb};var GB=!1;if(typeof window<"u")try{var rP=Object.defineProperty({},"passive",{get:function(){return GB=!0,!0}});window.addEventListener("test",rP,rP),window.removeEventListener("test",rP,rP)}catch{GB=!1}var Oy=GB?{passive:!1}:!1,MRe=function(e){return e.tagName==="TEXTAREA"},Cte=function(e,t){if(!(e instanceof Element))return!1;var n=window.getComputedStyle(e);return n[t]!=="hidden"&&!(n.overflowY===n.overflowX&&!MRe(e)&&n[t]==="visible")},IRe=function(e){return Cte(e,"overflowY")},LRe=function(e){return Cte(e,"overflowX")},E9=function(e,t){var n=t.ownerDocument,r=t;do{typeof ShadowRoot<"u"&&r instanceof ShadowRoot&&(r=r.host);var s=Ete(e,r);if(s){var i=Ate(e,r),o=i[1],a=i[2];if(o>a)return!0}r=r.parentNode}while(r&&r!==n.body);return!1},jRe=function(e){var t=e.scrollTop,n=e.scrollHeight,r=e.clientHeight;return[t,n,r]},$Re=function(e){var t=e.scrollLeft,n=e.scrollWidth,r=e.clientWidth;return[t,n,r]},Ete=function(e,t){return e==="v"?IRe(t):LRe(t)},Ate=function(e,t){return e==="v"?jRe(t):$Re(t)},FRe=function(e,t){return e==="h"&&t==="rtl"?-1:1},zRe=function(e,t,n,r,s){var i=FRe(e,window.getComputedStyle(t).direction),o=i*r,a=n.target,c=t.contains(a),d=!1,h=o>0,u=0,f=0;do{var g=Ate(e,a),v=g[0],m=g[1],x=g[2],y=m-x-i*v;(v||y)&&Ete(e,a)&&(u+=y,f+=v),a instanceof ShadowRoot?a=a.host:a=a.parentNode}while(!c&&a!==document.body||c&&(t.contains(a)||t===a));return(h&&Math.abs(u)<1||!h&&Math.abs(f)<1)&&(d=!0),d},sP=function(e){return"changedTouches"in e?[e.changedTouches[0].clientX,e.changedTouches[0].clientY]:[0,0]},A9=function(e){return[e.deltaX,e.deltaY]},R9=function(e){return e&&"current"in e?e.current:e},BRe=function(e,t){return e[0]===t[0]&&e[1]===t[1]},URe=function(e){return`
|
||
.block-interactivity-`.concat(e,` {pointer-events: none;}
|
||
.allow-interactivity-`).concat(e,` {pointer-events: all;}
|
||
`)},VRe=0,My=[];function HRe(e){var t=C.useRef([]),n=C.useRef([0,0]),r=C.useRef(),s=C.useState(VRe++)[0],i=C.useState(hD)[0],o=C.useRef(e);C.useEffect(function(){o.current=e},[e]),C.useEffect(function(){if(e.inert){document.body.classList.add("block-interactivity-".concat(s));var m=zH([e.lockRef.current],(e.shards||[]).map(R9),!0).filter(Boolean);return m.forEach(function(x){return x.classList.add("allow-interactivity-".concat(s))}),function(){document.body.classList.remove("block-interactivity-".concat(s)),m.forEach(function(x){return x.classList.remove("allow-interactivity-".concat(s))})}}},[e.inert,e.lockRef.current,e.shards]);var a=C.useCallback(function(m,x){if("touches"in m&&m.touches.length===2||m.type==="wheel"&&m.ctrlKey)return!o.current.allowPinchZoom;var y=sP(m),b=n.current,w="deltaX"in m?m.deltaX:b[0]-y[0],E="deltaY"in m?m.deltaY:b[1]-y[1],R,T=m.target,N=Math.abs(w)>Math.abs(E)?"h":"v";if("touches"in m&&N==="h"&&T.type==="range")return!1;var A=E9(N,T);if(!A)return!0;if(A?R=N:(R=N==="v"?"h":"v",A=E9(N,T)),!A)return!1;if(!r.current&&"changedTouches"in m&&(w||E)&&(r.current=R),!R)return!0;var D=r.current||R;return zRe(D,x,m,D==="h"?w:E)},[]),c=C.useCallback(function(m){var x=m;if(!(!My.length||My[My.length-1]!==i)){var y="deltaY"in x?A9(x):sP(x),b=t.current.filter(function(R){return R.name===x.type&&(R.target===x.target||x.target===R.shadowParent)&&BRe(R.delta,y)})[0];if(b&&b.should){x.cancelable&&x.preventDefault();return}if(!b){var w=(o.current.shards||[]).map(R9).filter(Boolean).filter(function(R){return R.contains(x.target)}),E=w.length>0?a(x,w[0]):!o.current.noIsolation;E&&x.cancelable&&x.preventDefault()}}},[]),d=C.useCallback(function(m,x,y,b){var w={name:m,delta:x,target:y,should:b,shadowParent:WRe(y)};t.current.push(w),setTimeout(function(){t.current=t.current.filter(function(E){return E!==w})},1)},[]),h=C.useCallback(function(m){n.current=sP(m),r.current=void 0},[]),u=C.useCallback(function(m){d(m.type,A9(m),m.target,a(m,e.lockRef.current))},[]),f=C.useCallback(function(m){d(m.type,sP(m),m.target,a(m,e.lockRef.current))},[]);C.useEffect(function(){return My.push(i),e.setCallbacks({onScrollCapture:u,onWheelCapture:u,onTouchMoveCapture:f}),document.addEventListener("wheel",c,Oy),document.addEventListener("touchmove",c,Oy),document.addEventListener("touchstart",h,Oy),function(){My=My.filter(function(m){return m!==i}),document.removeEventListener("wheel",c,Oy),document.removeEventListener("touchmove",c,Oy),document.removeEventListener("touchstart",h,Oy)}},[]);var g=e.removeScrollBar,v=e.inert;return C.createElement(C.Fragment,null,v?C.createElement(i,{styles:URe(s)}):null,g?C.createElement(HH,{gapMode:e.gapMode}):null)}function WRe(e){for(var t=null;e!==null;)e instanceof ShadowRoot&&(t=e.host,e=e.host),e=e.parentNode;return t}const qRe=VH(Ste,HRe);var Rte=C.forwardRef(function(e,t){return C.createElement(zD,fs({},e,{ref:t,sideCar:qRe}))});Rte.classNames=zD.classNames;var x6="Dialog",[Pte,o7e]=nRe(x6),[GRe,Oc]=Pte(x6),Nte=e=>{const{__scopeDialog:t,children:n,open:r,defaultOpen:s,onOpenChange:i,modal:o=!0}=e,a=C.useRef(null),c=C.useRef(null),[d=!1,h]=oRe({prop:r,defaultProp:s,onChange:i});return _.jsx(GRe,{scope:t,triggerRef:a,contentRef:c,contentId:Cf(),titleId:Cf(),descriptionId:Cf(),open:d,onOpenChange:h,onOpenToggle:C.useCallback(()=>h(u=>!u),[h]),modal:o,children:n})};Nte.displayName=x6;var Tte="DialogTrigger",KRe=C.forwardRef((e,t)=>{const{__scopeDialog:n,...r}=e,s=Oc(Tte,n),i=ly(t,s.triggerRef);return _.jsx(zi.button,{type:"button","aria-haspopup":"dialog","aria-expanded":s.open,"aria-controls":s.contentId,"data-state":S6(s.open),...r,ref:i,onClick:lp(e.onClick,s.onOpenToggle)})});KRe.displayName=Tte;var _6="DialogPortal",[YRe,kte]=Pte(_6,{forceMount:void 0}),Dte=e=>{const{__scopeDialog:t,forceMount:n,children:r,container:s}=e,i=Oc(_6,t);return _.jsx(YRe,{scope:t,forceMount:n,children:C.Children.map(r,o=>_.jsx(FD,{present:n||i.open,children:_.jsx(wte,{asChild:!0,container:s,children:o})}))})};Dte.displayName=_6;var yT="DialogOverlay",Ote=C.forwardRef((e,t)=>{const n=kte(yT,e.__scopeDialog),{forceMount:r=n.forceMount,...s}=e,i=Oc(yT,e.__scopeDialog);return i.modal?_.jsx(FD,{present:r||i.open,children:_.jsx(XRe,{...s,ref:t})}):null});Ote.displayName=yT;var XRe=C.forwardRef((e,t)=>{const{__scopeDialog:n,...r}=e,s=Oc(yT,n);return _.jsx(Rte,{as:b6,allowPinchZoom:!0,shards:[s.contentRef],children:_.jsx(zi.div,{"data-state":S6(s.open),...r,ref:t,style:{pointerEvents:"auto",...r.style}})})}),Uv="DialogContent",Mte=C.forwardRef((e,t)=>{const n=kte(Uv,e.__scopeDialog),{forceMount:r=n.forceMount,...s}=e,i=Oc(Uv,e.__scopeDialog);return _.jsx(FD,{present:r||i.open,children:i.modal?_.jsx(QRe,{...s,ref:t}):_.jsx(ZRe,{...s,ref:t})})});Mte.displayName=Uv;var QRe=C.forwardRef((e,t)=>{const n=Oc(Uv,e.__scopeDialog),r=C.useRef(null),s=ly(t,n.contentRef,r);return C.useEffect(()=>{const i=r.current;if(i)return Ox(i)},[]),_.jsx(Ite,{...e,ref:s,trapFocus:n.open,disableOutsidePointerEvents:!0,onCloseAutoFocus:lp(e.onCloseAutoFocus,i=>{var o;i.preventDefault(),(o=n.triggerRef.current)==null||o.focus()}),onPointerDownOutside:lp(e.onPointerDownOutside,i=>{const o=i.detail.originalEvent,a=o.button===0&&o.ctrlKey===!0;(o.button===2||a)&&i.preventDefault()}),onFocusOutside:lp(e.onFocusOutside,i=>i.preventDefault())})}),ZRe=C.forwardRef((e,t)=>{const n=Oc(Uv,e.__scopeDialog),r=C.useRef(!1),s=C.useRef(!1);return _.jsx(Ite,{...e,ref:t,trapFocus:!1,disableOutsidePointerEvents:!1,onCloseAutoFocus:i=>{var o,a;(o=e.onCloseAutoFocus)==null||o.call(e,i),i.defaultPrevented||(r.current||(a=n.triggerRef.current)==null||a.focus(),i.preventDefault()),r.current=!1,s.current=!1},onInteractOutside:i=>{var c,d;(c=e.onInteractOutside)==null||c.call(e,i),i.defaultPrevented||(r.current=!0,i.detail.originalEvent.type==="pointerdown"&&(s.current=!0));const o=i.target;((d=n.triggerRef.current)==null?void 0:d.contains(o))&&i.preventDefault(),i.detail.originalEvent.type==="focusin"&&s.current&&i.preventDefault()}})}),Ite=C.forwardRef((e,t)=>{const{__scopeDialog:n,trapFocus:r,onOpenAutoFocus:s,onCloseAutoFocus:i,...o}=e,a=Oc(Uv,n),c=C.useRef(null),d=ly(t,c);return ORe(),_.jsxs(_.Fragment,{children:[_.jsx(xte,{asChild:!0,loop:!0,trapped:r,onMountAutoFocus:s,onUnmountAutoFocus:i,children:_.jsx(yte,{role:"dialog",id:a.contentId,"aria-describedby":a.descriptionId,"aria-labelledby":a.titleId,"data-state":S6(a.open),...o,ref:d,onDismiss:()=>a.onOpenChange(!1)})}),_.jsxs(_.Fragment,{children:[_.jsx(nPe,{titleId:a.titleId}),_.jsx(sPe,{contentRef:c,descriptionId:a.descriptionId})]})]})}),w6="DialogTitle",JRe=C.forwardRef((e,t)=>{const{__scopeDialog:n,...r}=e,s=Oc(w6,n);return _.jsx(zi.h2,{id:s.titleId,...r,ref:t})});JRe.displayName=w6;var Lte="DialogDescription",ePe=C.forwardRef((e,t)=>{const{__scopeDialog:n,...r}=e,s=Oc(Lte,n);return _.jsx(zi.p,{id:s.descriptionId,...r,ref:t})});ePe.displayName=Lte;var jte="DialogClose",tPe=C.forwardRef((e,t)=>{const{__scopeDialog:n,...r}=e,s=Oc(jte,n);return _.jsx(zi.button,{type:"button",...r,ref:t,onClick:lp(e.onClick,()=>s.onOpenChange(!1))})});tPe.displayName=jte;function S6(e){return e?"open":"closed"}var $te="DialogTitleWarning",[a7e,Fte]=tRe($te,{contentName:Uv,titleName:w6,docsSlug:"dialog"}),nPe=({titleId:e})=>{const t=Fte($te),n=`\`${t.contentName}\` requires a \`${t.titleName}\` for the component to be accessible for screen reader users.
|
||
|
||
If you want to hide the \`${t.titleName}\`, you can wrap it with our VisuallyHidden component.
|
||
|
||
For more information, see https://radix-ui.com/primitives/docs/components/${t.docsSlug}`;return C.useEffect(()=>{e&&(document.getElementById(e)||console.error(n))},[n,e]),null},rPe="DialogDescriptionWarning",sPe=({contentRef:e,descriptionId:t})=>{const r=`Warning: Missing \`Description\` or \`aria-describedby={undefined}\` for {${Fte(rPe).contentName}}.`;return C.useEffect(()=>{var i;const s=(i=e.current)==null?void 0:i.getAttribute("aria-describedby");t&&s&&(document.getElementById(t)||console.warn(r))},[r,e,t]),null},iPe=Nte,oPe=Dte,aPe=Ote,lPe=Mte,$S='[cmdk-group=""]',c4='[cmdk-group-items=""]',cPe='[cmdk-group-heading=""]',zte='[cmdk-item=""]',P9=`${zte}:not([aria-disabled="true"])`,KB="cmdk-item-select",Ky="data-value",uPe=(e,t,n)=>eRe(e,t,n),Bte=C.createContext(void 0),qA=()=>C.useContext(Bte),Ute=C.createContext(void 0),C6=()=>C.useContext(Ute),Vte=C.createContext(void 0),Hte=C.forwardRef((e,t)=>{let n=Yy(()=>{var J,te;return{search:"",value:(te=(J=e.value)!=null?J:e.defaultValue)!=null?te:"",selectedItemId:void 0,filtered:{count:0,items:new Map,groups:new Set}}}),r=Yy(()=>new Set),s=Yy(()=>new Map),i=Yy(()=>new Map),o=Yy(()=>new Set),a=Wte(e),{label:c,children:d,value:h,onValueChange:u,filter:f,shouldFilter:g,loop:v,disablePointerSelection:m=!1,vimBindings:x=!0,...y}=e,b=Cf(),w=Cf(),E=Cf(),R=C.useRef(null),T=_Pe();Vv(()=>{if(h!==void 0){let J=h.trim();n.current.value=J,N.emit()}},[h]),Vv(()=>{T(6,F)},[]);let N=C.useMemo(()=>({subscribe:J=>(o.current.add(J),()=>o.current.delete(J)),snapshot:()=>n.current,setState:(J,te,ae)=>{var be,xe,ve,Pe;if(!Object.is(n.current[J],te)){if(n.current[J]=te,J==="search")$(),O(),T(1,I);else if(J==="value"){if(document.activeElement.hasAttribute("cmdk-input")||document.activeElement.hasAttribute("cmdk-root")){let Oe=document.getElementById(E);Oe?Oe.focus():(be=document.getElementById(b))==null||be.focus()}if(T(7,()=>{var Oe;n.current.selectedItemId=(Oe=B())==null?void 0:Oe.id,N.emit()}),ae||T(5,F),((xe=a.current)==null?void 0:xe.value)!==void 0){let Oe=te??"";(Pe=(ve=a.current).onValueChange)==null||Pe.call(ve,Oe);return}}N.emit()}},emit:()=>{o.current.forEach(J=>J())}}),[]),A=C.useMemo(()=>({value:(J,te,ae)=>{var be;te!==((be=i.current.get(J))==null?void 0:be.value)&&(i.current.set(J,{value:te,keywords:ae}),n.current.filtered.items.set(J,D(te,ae)),T(2,()=>{O(),N.emit()}))},item:(J,te)=>(r.current.add(J),te&&(s.current.has(te)?s.current.get(te).add(J):s.current.set(te,new Set([J]))),T(3,()=>{$(),O(),n.current.value||I(),N.emit()}),()=>{i.current.delete(J),r.current.delete(J),n.current.filtered.items.delete(J);let ae=B();T(4,()=>{$(),(ae==null?void 0:ae.getAttribute("id"))===J&&I(),N.emit()})}),group:J=>(s.current.has(J)||s.current.set(J,new Set),()=>{i.current.delete(J),s.current.delete(J)}),filter:()=>a.current.shouldFilter,label:c||e["aria-label"],getDisablePointerSelection:()=>a.current.disablePointerSelection,listId:b,inputId:E,labelId:w,listInnerRef:R}),[]);function D(J,te){var ae,be;let xe=(be=(ae=a.current)==null?void 0:ae.filter)!=null?be:uPe;return J?xe(J,n.current.search,te):0}function O(){if(!n.current.search||a.current.shouldFilter===!1)return;let J=n.current.filtered.items,te=[];n.current.filtered.groups.forEach(be=>{let xe=s.current.get(be),ve=0;xe.forEach(Pe=>{let Oe=J.get(Pe);ve=Math.max(Oe,ve)}),te.push([be,ve])});let ae=R.current;W().sort((be,xe)=>{var ve,Pe;let Oe=be.getAttribute("id"),ke=xe.getAttribute("id");return((ve=J.get(ke))!=null?ve:0)-((Pe=J.get(Oe))!=null?Pe:0)}).forEach(be=>{let xe=be.closest(c4);xe?xe.appendChild(be.parentElement===xe?be:be.closest(`${c4} > *`)):ae.appendChild(be.parentElement===ae?be:be.closest(`${c4} > *`))}),te.sort((be,xe)=>xe[1]-be[1]).forEach(be=>{var xe;let ve=(xe=R.current)==null?void 0:xe.querySelector(`${$S}[${Ky}="${encodeURIComponent(be[0])}"]`);ve==null||ve.parentElement.appendChild(ve)})}function I(){let J=W().find(ae=>ae.getAttribute("aria-disabled")!=="true"),te=J==null?void 0:J.getAttribute(Ky);N.setState("value",te||void 0)}function $(){var J,te,ae,be;if(!n.current.search||a.current.shouldFilter===!1){n.current.filtered.count=r.current.size;return}n.current.filtered.groups=new Set;let xe=0;for(let ve of r.current){let Pe=(te=(J=i.current.get(ve))==null?void 0:J.value)!=null?te:"",Oe=(be=(ae=i.current.get(ve))==null?void 0:ae.keywords)!=null?be:[],ke=D(Pe,Oe);n.current.filtered.items.set(ve,ke),ke>0&&xe++}for(let[ve,Pe]of s.current)for(let Oe of Pe)if(n.current.filtered.items.get(Oe)>0){n.current.filtered.groups.add(ve);break}n.current.filtered.count=xe}function F(){var J,te,ae;let be=B();be&&(((J=be.parentElement)==null?void 0:J.firstChild)===be&&((ae=(te=be.closest($S))==null?void 0:te.querySelector(cPe))==null||ae.scrollIntoView({block:"nearest"})),be.scrollIntoView({block:"nearest"}))}function B(){var J;return(J=R.current)==null?void 0:J.querySelector(`${zte}[aria-selected="true"]`)}function W(){var J;return Array.from(((J=R.current)==null?void 0:J.querySelectorAll(P9))||[])}function Z(J){let te=W()[J];te&&N.setState("value",te.getAttribute(Ky))}function Y(J){var te;let ae=B(),be=W(),xe=be.findIndex(Pe=>Pe===ae),ve=be[xe+J];(te=a.current)!=null&&te.loop&&(ve=xe+J<0?be[be.length-1]:xe+J===be.length?be[0]:be[xe+J]),ve&&N.setState("value",ve.getAttribute(Ky))}function H(J){let te=B(),ae=te==null?void 0:te.closest($S),be;for(;ae&&!be;)ae=J>0?bPe(ae,$S):xPe(ae,$S),be=ae==null?void 0:ae.querySelector(P9);be?N.setState("value",be.getAttribute(Ky)):Y(J)}let se=()=>Z(W().length-1),he=J=>{J.preventDefault(),J.metaKey?se():J.altKey?H(1):Y(1)},re=J=>{J.preventDefault(),J.metaKey?Z(0):J.altKey?H(-1):Y(-1)};return C.createElement(zi.div,{ref:t,tabIndex:-1,...y,"cmdk-root":"",onKeyDown:J=>{var te;(te=y.onKeyDown)==null||te.call(y,J);let ae=J.nativeEvent.isComposing||J.keyCode===229;if(!(J.defaultPrevented||ae))switch(J.key){case"n":case"j":{x&&J.ctrlKey&&he(J);break}case"ArrowDown":{he(J);break}case"p":case"k":{x&&J.ctrlKey&&re(J);break}case"ArrowUp":{re(J);break}case"Home":{J.preventDefault(),Z(0);break}case"End":{J.preventDefault(),se();break}case"Enter":{J.preventDefault();let be=B();if(be){let xe=new Event(KB);be.dispatchEvent(xe)}}}}},C.createElement("label",{"cmdk-label":"",htmlFor:A.inputId,id:A.labelId,style:SPe},c),BD(e,J=>C.createElement(Ute.Provider,{value:N},C.createElement(Bte.Provider,{value:A},J))))}),dPe=C.forwardRef((e,t)=>{var n,r;let s=Cf(),i=C.useRef(null),o=C.useContext(Vte),a=qA(),c=Wte(e),d=(r=(n=c.current)==null?void 0:n.forceMount)!=null?r:o==null?void 0:o.forceMount;Vv(()=>{if(!d)return a.item(s,o==null?void 0:o.id)},[d]);let h=qte(s,i,[e.value,e.children,i],e.keywords),u=C6(),f=pp(T=>T.value&&T.value===h.current),g=pp(T=>d||a.filter()===!1?!0:T.search?T.filtered.items.get(s)>0:!0);C.useEffect(()=>{let T=i.current;if(!(!T||e.disabled))return T.addEventListener(KB,v),()=>T.removeEventListener(KB,v)},[g,e.onSelect,e.disabled]);function v(){var T,N;m(),(N=(T=c.current).onSelect)==null||N.call(T,h.current)}function m(){u.setState("value",h.current,!0)}if(!g)return null;let{disabled:x,value:y,onSelect:b,forceMount:w,keywords:E,...R}=e;return C.createElement(zi.div,{ref:zv(i,t),...R,id:s,"cmdk-item":"",role:"option","aria-disabled":!!x,"aria-selected":!!f,"data-disabled":!!x,"data-selected":!!f,onPointerMove:x||a.getDisablePointerSelection()?void 0:m,onClick:x?void 0:v},e.children)}),fPe=C.forwardRef((e,t)=>{let{heading:n,children:r,forceMount:s,...i}=e,o=Cf(),a=C.useRef(null),c=C.useRef(null),d=Cf(),h=qA(),u=pp(g=>s||h.filter()===!1?!0:g.search?g.filtered.groups.has(o):!0);Vv(()=>h.group(o),[]),qte(o,a,[e.value,e.heading,c]);let f=C.useMemo(()=>({id:o,forceMount:s}),[s]);return C.createElement(zi.div,{ref:zv(a,t),...i,"cmdk-group":"",role:"presentation",hidden:u?void 0:!0},n&&C.createElement("div",{ref:c,"cmdk-group-heading":"","aria-hidden":!0,id:d},n),BD(e,g=>C.createElement("div",{"cmdk-group-items":"",role:"group","aria-labelledby":n?d:void 0},C.createElement(Vte.Provider,{value:f},g))))}),hPe=C.forwardRef((e,t)=>{let{alwaysRender:n,...r}=e,s=C.useRef(null),i=pp(o=>!o.search);return!n&&!i?null:C.createElement(zi.div,{ref:zv(s,t),...r,"cmdk-separator":"",role:"separator"})}),pPe=C.forwardRef((e,t)=>{let{onValueChange:n,...r}=e,s=e.value!=null,i=C6(),o=pp(d=>d.search),a=pp(d=>d.selectedItemId),c=qA();return C.useEffect(()=>{e.value!=null&&i.setState("search",e.value)},[e.value]),C.createElement(zi.input,{ref:t,...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":a,id:c.inputId,type:"text",value:s?e.value:o,onChange:d=>{s||i.setState("search",d.target.value),n==null||n(d.target.value)}})}),mPe=C.forwardRef((e,t)=>{let{children:n,label:r="Suggestions",...s}=e,i=C.useRef(null),o=C.useRef(null),a=pp(d=>d.selectedItemId),c=qA();return C.useEffect(()=>{if(o.current&&i.current){let d=o.current,h=i.current,u,f=new ResizeObserver(()=>{u=requestAnimationFrame(()=>{let g=d.offsetHeight;h.style.setProperty("--cmdk-list-height",g.toFixed(1)+"px")})});return f.observe(d),()=>{cancelAnimationFrame(u),f.unobserve(d)}}},[]),C.createElement(zi.div,{ref:zv(i,t),...s,"cmdk-list":"",role:"listbox",tabIndex:-1,"aria-activedescendant":a,"aria-label":r,id:c.listId},BD(e,d=>C.createElement("div",{ref:zv(o,c.listInnerRef),"cmdk-list-sizer":""},d)))}),gPe=C.forwardRef((e,t)=>{let{open:n,onOpenChange:r,overlayClassName:s,contentClassName:i,container:o,...a}=e;return C.createElement(iPe,{open:n,onOpenChange:r},C.createElement(oPe,{container:o},C.createElement(aPe,{"cmdk-overlay":"",className:s}),C.createElement(lPe,{"aria-label":e.label,"cmdk-dialog":"",className:i},C.createElement(Hte,{ref:t,...a}))))}),vPe=C.forwardRef((e,t)=>pp(n=>n.filtered.count===0)?C.createElement(zi.div,{ref:t,...e,"cmdk-empty":"",role:"presentation"}):null),yPe=C.forwardRef((e,t)=>{let{progress:n,children:r,label:s="Loading...",...i}=e;return C.createElement(zi.div,{ref:t,...i,"cmdk-loading":"",role:"progressbar","aria-valuenow":n,"aria-valuemin":0,"aria-valuemax":100,"aria-label":s},BD(e,o=>C.createElement("div",{"aria-hidden":!0},o)))}),la=Object.assign(Hte,{List:mPe,Item:dPe,Input:pPe,Group:fPe,Separator:hPe,Dialog:gPe,Empty:vPe,Loading:yPe});function bPe(e,t){let n=e.nextElementSibling;for(;n;){if(n.matches(t))return n;n=n.nextElementSibling}}function xPe(e,t){let n=e.previousElementSibling;for(;n;){if(n.matches(t))return n;n=n.previousElementSibling}}function Wte(e){let t=C.useRef(e);return Vv(()=>{t.current=e}),t}var Vv=typeof window>"u"?C.useEffect:C.useLayoutEffect;function Yy(e){let t=C.useRef();return t.current===void 0&&(t.current=e()),t}function pp(e){let t=C6(),n=()=>e(t.snapshot());return C.useSyncExternalStore(t.subscribe,n,n)}function qte(e,t,n,r=[]){let s=C.useRef(),i=qA();return Vv(()=>{var o;let a=(()=>{var d;for(let h of n){if(typeof h=="string")return h.trim();if(typeof h=="object"&&"current"in h)return h.current?(d=h.current.textContent)==null?void 0:d.trim():s.current}})(),c=r.map(d=>d.trim());i.value(e,a,c),(o=t.current)==null||o.setAttribute(Ky,a),s.current=a}),s}var _Pe=()=>{let[e,t]=C.useState(),n=Yy(()=>new Map);return Vv(()=>{n.current.forEach(r=>r()),n.current=new Map},[e]),(r,s)=>{n.current.set(r,s),t({})}};function wPe(e){let t=e.type;return typeof t=="function"?t(e.props):"render"in t?t.render(e.props):e}function BD({asChild:e,children:t},n){return e&&C.isValidElement(t)?C.cloneElement(wPe(t),{ref:t.ref},n(t.props.children)):n(t)}var SPe={position:"absolute",width:"1px",height:"1px",padding:"0",margin:"-1px",overflow:"hidden",clip:"rect(0, 0, 0, 0)",whiteSpace:"nowrap",borderWidth:"0"};const Fx=XH,E6=QH,CPe=ZH,bT=zA,Gte=C.forwardRef(({className:e,...t},n)=>_.jsx(LA,{ref:n,className:ge("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",e),...t}));Gte.displayName=LA.displayName;const cy=C.forwardRef(({className:e,children:t,...n},r)=>_.jsxs(CPe,{children:[_.jsx(Gte,{}),_.jsxs(jA,{ref:r,className:ge("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",e),...n,children:[t,_.jsxs(zA,{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:[_.jsx(sx,{className:"h-4 w-4"}),_.jsx("span",{className:"sr-only",children:"Close"})]})]})]}));cy.displayName=jA.displayName;const uy=({className:e,...t})=>_.jsx("div",{className:ge("flex flex-col space-y-1.5 text-center sm:text-left",e),...t});uy.displayName="DialogHeader";const dy=({className:e,...t})=>_.jsx("div",{className:ge("flex flex-col-reverse sm:flex-row sm:justify-end sm:space-x-2",e),...t});dy.displayName="DialogFooter";const fy=C.forwardRef(({className:e,...t},n)=>_.jsx($A,{ref:n,className:ge("text-lg font-semibold leading-none tracking-tight",e),...t}));fy.displayName=$A.displayName;const GA=C.forwardRef(({className:e,...t},n)=>_.jsx(FA,{ref:n,className:ge("text-sm text-muted-foreground",e),...t}));GA.displayName=FA.displayName;const EPe=C.forwardRef(({className:e,...t},n)=>_.jsx(la,{ref:n,className:ge("flex h-full w-full flex-col overflow-hidden rounded-md bg-popover text-popover-foreground",e),...t}));EPe.displayName=la.displayName;const APe=C.forwardRef(({className:e,...t},n)=>_.jsxs("div",{className:"flex items-center px-3 border-b","cmdk-input-wrapper":"",children:[_.jsx(IH,{className:"w-4 h-4 mr-2 opacity-50 shrink-0"}),_.jsx(la.Input,{ref:n,className:ge("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",e),...t})]}));APe.displayName=la.Input.displayName;const RPe=C.forwardRef(({className:e,...t},n)=>_.jsx(la.List,{ref:n,className:ge("max-h-[300px] overflow-y-auto overflow-x-hidden",e),...t}));RPe.displayName=la.List.displayName;const PPe=C.forwardRef((e,t)=>_.jsx(la.Empty,{ref:t,className:"py-6 text-sm text-center",...e}));PPe.displayName=la.Empty.displayName;const NPe=C.forwardRef(({className:e,...t},n)=>_.jsx(la.Group,{ref:n,className:ge("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",e),...t}));NPe.displayName=la.Group.displayName;const TPe=C.forwardRef(({className:e,...t},n)=>_.jsx(la.Separator,{ref:n,className:ge("-mx-1 h-px bg-border",e),...t}));TPe.displayName=la.Separator.displayName;const kPe=C.forwardRef(({className:e,...t},n)=>_.jsx(la.Item,{ref:n,className:ge("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",e),...t}));kPe.displayName=la.Item.displayName;const DPe=["top","right","bottom","left"],vu=Math.min,Ha=Math.max,xT=Math.round,iP=Math.floor,mp=e=>({x:e,y:e}),OPe={left:"right",right:"left",bottom:"top",top:"bottom"},MPe={start:"end",end:"start"};function YB(e,t,n){return Ha(e,vu(t,n))}function jf(e,t){return typeof e=="function"?e(t):e}function $f(e){return e.split("-")[0]}function zx(e){return e.split("-")[1]}function A6(e){return e==="x"?"y":"x"}function R6(e){return e==="y"?"height":"width"}function gp(e){return["top","bottom"].includes($f(e))?"y":"x"}function P6(e){return A6(gp(e))}function IPe(e,t,n){n===void 0&&(n=!1);const r=zx(e),s=P6(e),i=R6(s);let o=s==="x"?r===(n?"end":"start")?"right":"left":r==="start"?"bottom":"top";return t.reference[i]>t.floating[i]&&(o=_T(o)),[o,_T(o)]}function LPe(e){const t=_T(e);return[XB(e),t,XB(t)]}function XB(e){return e.replace(/start|end/g,t=>MPe[t])}function jPe(e,t,n){const r=["left","right"],s=["right","left"],i=["top","bottom"],o=["bottom","top"];switch(e){case"top":case"bottom":return n?t?s:r:t?r:s;case"left":case"right":return t?i:o;default:return[]}}function $Pe(e,t,n,r){const s=zx(e);let i=jPe($f(e),n==="start",r);return s&&(i=i.map(o=>o+"-"+s),t&&(i=i.concat(i.map(XB)))),i}function _T(e){return e.replace(/left|right|bottom|top/g,t=>OPe[t])}function FPe(e){return{top:0,right:0,bottom:0,left:0,...e}}function Kte(e){return typeof e!="number"?FPe(e):{top:e,right:e,bottom:e,left:e}}function wT(e){const{x:t,y:n,width:r,height:s}=e;return{width:r,height:s,top:n,left:t,right:t+r,bottom:n+s,x:t,y:n}}function N9(e,t,n){let{reference:r,floating:s}=e;const i=gp(t),o=P6(t),a=R6(o),c=$f(t),d=i==="y",h=r.x+r.width/2-s.width/2,u=r.y+r.height/2-s.height/2,f=r[a]/2-s[a]/2;let g;switch(c){case"top":g={x:h,y:r.y-s.height};break;case"bottom":g={x:h,y:r.y+r.height};break;case"right":g={x:r.x+r.width,y:u};break;case"left":g={x:r.x-s.width,y:u};break;default:g={x:r.x,y:r.y}}switch(zx(t)){case"start":g[o]-=f*(n&&d?-1:1);break;case"end":g[o]+=f*(n&&d?-1:1);break}return g}const zPe=async(e,t,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(t));let d=await o.getElementRects({reference:e,floating:t,strategy:s}),{x:h,y:u}=N9(d,r,c),f=r,g={},v=0;for(let m=0;m<a.length;m++){const{name:x,fn:y}=a[m],{x:b,y:w,data:E,reset:R}=await y({x:h,y:u,initialPlacement:r,placement:f,strategy:s,middlewareData:g,rects:d,platform:o,elements:{reference:e,floating:t}});h=b??h,u=w??u,g={...g,[x]:{...g[x],...E}},R&&v<=50&&(v++,typeof R=="object"&&(R.placement&&(f=R.placement),R.rects&&(d=R.rects===!0?await o.getElementRects({reference:e,floating:t,strategy:s}):R.rects),{x:h,y:u}=N9(d,f,c)),m=-1)}return{x:h,y:u,placement:f,strategy:s,middlewareData:g}};async function wC(e,t){var n;t===void 0&&(t={});const{x:r,y:s,platform:i,rects:o,elements:a,strategy:c}=e,{boundary:d="clippingAncestors",rootBoundary:h="viewport",elementContext:u="floating",altBoundary:f=!1,padding:g=0}=jf(t,e),v=Kte(g),x=a[f?u==="floating"?"reference":"floating":u],y=wT(await i.getClippingRect({element:(n=await(i.isElement==null?void 0:i.isElement(x)))==null||n?x:x.contextElement||await(i.getDocumentElement==null?void 0:i.getDocumentElement(a.floating)),boundary:d,rootBoundary:h,strategy:c})),b=u==="floating"?{x:r,y:s,width:o.floating.width,height:o.floating.height}:o.reference,w=await(i.getOffsetParent==null?void 0:i.getOffsetParent(a.floating)),E=await(i.isElement==null?void 0:i.isElement(w))?await(i.getScale==null?void 0:i.getScale(w))||{x:1,y:1}:{x:1,y:1},R=wT(i.convertOffsetParentRelativeRectToViewportRelativeRect?await i.convertOffsetParentRelativeRectToViewportRelativeRect({elements:a,rect:b,offsetParent:w,strategy:c}):b);return{top:(y.top-R.top+v.top)/E.y,bottom:(R.bottom-y.bottom+v.bottom)/E.y,left:(y.left-R.left+v.left)/E.x,right:(R.right-y.right+v.right)/E.x}}const BPe=e=>({name:"arrow",options:e,async fn(t){const{x:n,y:r,placement:s,rects:i,platform:o,elements:a,middlewareData:c}=t,{element:d,padding:h=0}=jf(e,t)||{};if(d==null)return{};const u=Kte(h),f={x:n,y:r},g=P6(s),v=R6(g),m=await o.getDimensions(d),x=g==="y",y=x?"top":"left",b=x?"bottom":"right",w=x?"clientHeight":"clientWidth",E=i.reference[v]+i.reference[g]-f[g]-i.floating[v],R=f[g]-i.reference[g],T=await(o.getOffsetParent==null?void 0:o.getOffsetParent(d));let N=T?T[w]:0;(!N||!await(o.isElement==null?void 0:o.isElement(T)))&&(N=a.floating[w]||i.floating[v]);const A=E/2-R/2,D=N/2-m[v]/2-1,O=vu(u[y],D),I=vu(u[b],D),$=O,F=N-m[v]-I,B=N/2-m[v]/2+A,W=YB($,B,F),Z=!c.arrow&&zx(s)!=null&&B!==W&&i.reference[v]/2-(B<$?O:I)-m[v]/2<0,Y=Z?B<$?B-$:B-F:0;return{[g]:f[g]+Y,data:{[g]:W,centerOffset:B-W-Y,...Z&&{alignmentOffset:Y}},reset:Z}}}),UPe=function(e){return e===void 0&&(e={}),{name:"flip",options:e,async fn(t){var n,r;const{placement:s,middlewareData:i,rects:o,initialPlacement:a,platform:c,elements:d}=t,{mainAxis:h=!0,crossAxis:u=!0,fallbackPlacements:f,fallbackStrategy:g="bestFit",fallbackAxisSideDirection:v="none",flipAlignment:m=!0,...x}=jf(e,t);if((n=i.arrow)!=null&&n.alignmentOffset)return{};const y=$f(s),b=gp(a),w=$f(a)===a,E=await(c.isRTL==null?void 0:c.isRTL(d.floating)),R=f||(w||!m?[_T(a)]:LPe(a)),T=v!=="none";!f&&T&&R.push(...$Pe(a,m,v,E));const N=[a,...R],A=await wC(t,x),D=[];let O=((r=i.flip)==null?void 0:r.overflows)||[];if(h&&D.push(A[y]),u){const B=IPe(s,o,E);D.push(A[B[0]],A[B[1]])}if(O=[...O,{placement:s,overflows:D}],!D.every(B=>B<=0)){var I,$;const B=(((I=i.flip)==null?void 0:I.index)||0)+1,W=N[B];if(W)return{data:{index:B,overflows:O},reset:{placement:W}};let Z=($=O.filter(Y=>Y.overflows[0]<=0).sort((Y,H)=>Y.overflows[1]-H.overflows[1])[0])==null?void 0:$.placement;if(!Z)switch(g){case"bestFit":{var F;const Y=(F=O.filter(H=>{if(T){const se=gp(H.placement);return se===b||se==="y"}return!0}).map(H=>[H.placement,H.overflows.filter(se=>se>0).reduce((se,he)=>se+he,0)]).sort((H,se)=>H[1]-se[1])[0])==null?void 0:F[0];Y&&(Z=Y);break}case"initialPlacement":Z=a;break}if(s!==Z)return{reset:{placement:Z}}}return{}}}};function T9(e,t){return{top:e.top-t.height,right:e.right-t.width,bottom:e.bottom-t.height,left:e.left-t.width}}function k9(e){return DPe.some(t=>e[t]>=0)}const VPe=function(e){return e===void 0&&(e={}),{name:"hide",options:e,async fn(t){const{rects:n}=t,{strategy:r="referenceHidden",...s}=jf(e,t);switch(r){case"referenceHidden":{const i=await wC(t,{...s,elementContext:"reference"}),o=T9(i,n.reference);return{data:{referenceHiddenOffsets:o,referenceHidden:k9(o)}}}case"escaped":{const i=await wC(t,{...s,altBoundary:!0}),o=T9(i,n.floating);return{data:{escapedOffsets:o,escaped:k9(o)}}}default:return{}}}}};async function HPe(e,t){const{placement:n,platform:r,elements:s}=e,i=await(r.isRTL==null?void 0:r.isRTL(s.floating)),o=$f(n),a=zx(n),c=gp(n)==="y",d=["left","top"].includes(o)?-1:1,h=i&&c?-1:1,u=jf(t,e);let{mainAxis:f,crossAxis:g,alignmentAxis:v}=typeof u=="number"?{mainAxis:u,crossAxis:0,alignmentAxis:null}:{mainAxis:0,crossAxis:0,alignmentAxis:null,...u};return a&&typeof v=="number"&&(g=a==="end"?v*-1:v),c?{x:g*h,y:f*d}:{x:f*d,y:g*h}}const WPe=function(e){return e===void 0&&(e=0),{name:"offset",options:e,async fn(t){var n,r;const{x:s,y:i,placement:o,middlewareData:a}=t,c=await HPe(t,e);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}}}}},qPe=function(e){return e===void 0&&(e={}),{name:"shift",options:e,async fn(t){const{x:n,y:r,placement:s}=t,{mainAxis:i=!0,crossAxis:o=!1,limiter:a={fn:x=>{let{x:y,y:b}=x;return{x:y,y:b}}},...c}=jf(e,t),d={x:n,y:r},h=await wC(t,c),u=gp($f(s)),f=A6(u);let g=d[f],v=d[u];if(i){const x=f==="y"?"top":"left",y=f==="y"?"bottom":"right",b=g+h[x],w=g-h[y];g=YB(b,g,w)}if(o){const x=u==="y"?"top":"left",y=u==="y"?"bottom":"right",b=v+h[x],w=v-h[y];v=YB(b,v,w)}const m=a.fn({...t,[f]:g,[u]:v});return{...m,data:{x:m.x-n,y:m.y-r}}}}},GPe=function(e){return e===void 0&&(e={}),{options:e,fn(t){const{x:n,y:r,placement:s,rects:i,middlewareData:o}=t,{offset:a=0,mainAxis:c=!0,crossAxis:d=!0}=jf(e,t),h={x:n,y:r},u=gp(s),f=A6(u);let g=h[f],v=h[u];const m=jf(a,t),x=typeof m=="number"?{mainAxis:m,crossAxis:0}:{mainAxis:0,crossAxis:0,...m};if(c){const w=f==="y"?"height":"width",E=i.reference[f]-i.floating[w]+x.mainAxis,R=i.reference[f]+i.reference[w]-x.mainAxis;g<E?g=E:g>R&&(g=R)}if(d){var y,b;const w=f==="y"?"width":"height",E=["top","left"].includes($f(s)),R=i.reference[u]-i.floating[w]+(E&&((y=o.offset)==null?void 0:y[u])||0)+(E?0:x.crossAxis),T=i.reference[u]+i.reference[w]+(E?0:((b=o.offset)==null?void 0:b[u])||0)-(E?x.crossAxis:0);v<R?v=R:v>T&&(v=T)}return{[f]:g,[u]:v}}}},KPe=function(e){return e===void 0&&(e={}),{name:"size",options:e,async fn(t){const{placement:n,rects:r,platform:s,elements:i}=t,{apply:o=()=>{},...a}=jf(e,t),c=await wC(t,a),d=$f(n),h=zx(n),u=gp(n)==="y",{width:f,height:g}=r.floating;let v,m;d==="top"||d==="bottom"?(v=d,m=h===(await(s.isRTL==null?void 0:s.isRTL(i.floating))?"start":"end")?"left":"right"):(m=d,v=h==="end"?"top":"bottom");const x=g-c.top-c.bottom,y=f-c.left-c.right,b=vu(g-c[v],x),w=vu(f-c[m],y),E=!t.middlewareData.shift;let R=b,T=w;if(u?T=h||E?vu(w,y):y:R=h||E?vu(b,x):x,E&&!h){const A=Ha(c.left,0),D=Ha(c.right,0),O=Ha(c.top,0),I=Ha(c.bottom,0);u?T=f-2*(A!==0||D!==0?A+D:Ha(c.left,c.right)):R=g-2*(O!==0||I!==0?O+I:Ha(c.top,c.bottom))}await o({...t,availableWidth:T,availableHeight:R});const N=await s.getDimensions(i.floating);return f!==N.width||g!==N.height?{reset:{rects:!0}}:{}}}};function Bx(e){return Yte(e)?(e.nodeName||"").toLowerCase():"#document"}function Ka(e){var t;return(e==null||(t=e.ownerDocument)==null?void 0:t.defaultView)||window}function qf(e){var t;return(t=(Yte(e)?e.ownerDocument:e.document)||window.document)==null?void 0:t.documentElement}function Yte(e){return e instanceof Node||e instanceof Ka(e).Node}function Pu(e){return e instanceof Element||e instanceof Ka(e).Element}function Nu(e){return e instanceof HTMLElement||e instanceof Ka(e).HTMLElement}function D9(e){return typeof ShadowRoot>"u"?!1:e instanceof ShadowRoot||e instanceof Ka(e).ShadowRoot}function KA(e){const{overflow:t,overflowX:n,overflowY:r,display:s}=Rc(e);return/auto|scroll|overlay|hidden|clip/.test(t+r+n)&&!["inline","contents"].includes(s)}function YPe(e){return["table","td","th"].includes(Bx(e))}function UD(e){return[":popover-open",":modal"].some(t=>{try{return e.matches(t)}catch{return!1}})}function N6(e){const t=T6(),n=Rc(e);return n.transform!=="none"||n.perspective!=="none"||(n.containerType?n.containerType!=="normal":!1)||!t&&(n.backdropFilter?n.backdropFilter!=="none":!1)||!t&&(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 XPe(e){let t=vp(e);for(;Nu(t)&&!ox(t);){if(UD(t))return null;if(N6(t))return t;t=vp(t)}return null}function T6(){return typeof CSS>"u"||!CSS.supports?!1:CSS.supports("-webkit-backdrop-filter","none")}function ox(e){return["html","body","#document"].includes(Bx(e))}function Rc(e){return Ka(e).getComputedStyle(e)}function VD(e){return Pu(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.scrollX,scrollTop:e.scrollY}}function vp(e){if(Bx(e)==="html")return e;const t=e.assignedSlot||e.parentNode||D9(e)&&e.host||qf(e);return D9(t)?t.host:t}function Xte(e){const t=vp(e);return ox(t)?e.ownerDocument?e.ownerDocument.body:e.body:Nu(t)&&KA(t)?t:Xte(t)}function SC(e,t,n){var r;t===void 0&&(t=[]),n===void 0&&(n=!0);const s=Xte(e),i=s===((r=e.ownerDocument)==null?void 0:r.body),o=Ka(s);return i?t.concat(o,o.visualViewport||[],KA(s)?s:[],o.frameElement&&n?SC(o.frameElement):[]):t.concat(s,SC(s,[],n))}function Qte(e){const t=Rc(e);let n=parseFloat(t.width)||0,r=parseFloat(t.height)||0;const s=Nu(e),i=s?e.offsetWidth:n,o=s?e.offsetHeight:r,a=xT(n)!==i||xT(r)!==o;return a&&(n=i,r=o),{width:n,height:r,$:a}}function k6(e){return Pu(e)?e:e.contextElement}function Db(e){const t=k6(e);if(!Nu(t))return mp(1);const n=t.getBoundingClientRect(),{width:r,height:s,$:i}=Qte(t);let o=(i?xT(n.width):n.width)/r,a=(i?xT(n.height):n.height)/s;return(!o||!Number.isFinite(o))&&(o=1),(!a||!Number.isFinite(a))&&(a=1),{x:o,y:a}}const QPe=mp(0);function Zte(e){const t=Ka(e);return!T6()||!t.visualViewport?QPe:{x:t.visualViewport.offsetLeft,y:t.visualViewport.offsetTop}}function ZPe(e,t,n){return t===void 0&&(t=!1),!n||t&&n!==Ka(e)?!1:t}function Hv(e,t,n,r){t===void 0&&(t=!1),n===void 0&&(n=!1);const s=e.getBoundingClientRect(),i=k6(e);let o=mp(1);t&&(r?Pu(r)&&(o=Db(r)):o=Db(e));const a=ZPe(i,n,r)?Zte(i):mp(0);let c=(s.left+a.x)/o.x,d=(s.top+a.y)/o.y,h=s.width/o.x,u=s.height/o.y;if(i){const f=Ka(i),g=r&&Pu(r)?Ka(r):r;let v=f,m=v.frameElement;for(;m&&r&&g!==v;){const x=Db(m),y=m.getBoundingClientRect(),b=Rc(m),w=y.left+(m.clientLeft+parseFloat(b.paddingLeft))*x.x,E=y.top+(m.clientTop+parseFloat(b.paddingTop))*x.y;c*=x.x,d*=x.y,h*=x.x,u*=x.y,c+=w,d+=E,v=Ka(m),m=v.frameElement}}return wT({width:h,height:u,x:c,y:d})}function JPe(e){let{elements:t,rect:n,offsetParent:r,strategy:s}=e;const i=s==="fixed",o=qf(r),a=t?UD(t.floating):!1;if(r===o||a&&i)return n;let c={scrollLeft:0,scrollTop:0},d=mp(1);const h=mp(0),u=Nu(r);if((u||!u&&!i)&&((Bx(r)!=="body"||KA(o))&&(c=VD(r)),Nu(r))){const f=Hv(r);d=Db(r),h.x=f.x+r.clientLeft,h.y=f.y+r.clientTop}return{width:n.width*d.x,height:n.height*d.y,x:n.x*d.x-c.scrollLeft*d.x+h.x,y:n.y*d.y-c.scrollTop*d.y+h.y}}function eNe(e){return Array.from(e.getClientRects())}function Jte(e){return Hv(qf(e)).left+VD(e).scrollLeft}function tNe(e){const t=qf(e),n=VD(e),r=e.ownerDocument.body,s=Ha(t.scrollWidth,t.clientWidth,r.scrollWidth,r.clientWidth),i=Ha(t.scrollHeight,t.clientHeight,r.scrollHeight,r.clientHeight);let o=-n.scrollLeft+Jte(e);const a=-n.scrollTop;return Rc(r).direction==="rtl"&&(o+=Ha(t.clientWidth,r.clientWidth)-s),{width:s,height:i,x:o,y:a}}function nNe(e,t){const n=Ka(e),r=qf(e),s=n.visualViewport;let i=r.clientWidth,o=r.clientHeight,a=0,c=0;if(s){i=s.width,o=s.height;const d=T6();(!d||d&&t==="fixed")&&(a=s.offsetLeft,c=s.offsetTop)}return{width:i,height:o,x:a,y:c}}function rNe(e,t){const n=Hv(e,!0,t==="fixed"),r=n.top+e.clientTop,s=n.left+e.clientLeft,i=Nu(e)?Db(e):mp(1),o=e.clientWidth*i.x,a=e.clientHeight*i.y,c=s*i.x,d=r*i.y;return{width:o,height:a,x:c,y:d}}function O9(e,t,n){let r;if(t==="viewport")r=nNe(e,n);else if(t==="document")r=tNe(qf(e));else if(Pu(t))r=rNe(t,n);else{const s=Zte(e);r={...t,x:t.x-s.x,y:t.y-s.y}}return wT(r)}function ene(e,t){const n=vp(e);return n===t||!Pu(n)||ox(n)?!1:Rc(n).position==="fixed"||ene(n,t)}function sNe(e,t){const n=t.get(e);if(n)return n;let r=SC(e,[],!1).filter(a=>Pu(a)&&Bx(a)!=="body"),s=null;const i=Rc(e).position==="fixed";let o=i?vp(e):e;for(;Pu(o)&&!ox(o);){const a=Rc(o),c=N6(o);!c&&a.position==="fixed"&&(s=null),(i?!c&&!s:!c&&a.position==="static"&&!!s&&["absolute","fixed"].includes(s.position)||KA(o)&&!c&&ene(e,o))?r=r.filter(h=>h!==o):s=a,o=vp(o)}return t.set(e,r),r}function iNe(e){let{element:t,boundary:n,rootBoundary:r,strategy:s}=e;const o=[...n==="clippingAncestors"?UD(t)?[]:sNe(t,this._c):[].concat(n),r],a=o[0],c=o.reduce((d,h)=>{const u=O9(t,h,s);return d.top=Ha(u.top,d.top),d.right=vu(u.right,d.right),d.bottom=vu(u.bottom,d.bottom),d.left=Ha(u.left,d.left),d},O9(t,a,s));return{width:c.right-c.left,height:c.bottom-c.top,x:c.left,y:c.top}}function oNe(e){const{width:t,height:n}=Qte(e);return{width:t,height:n}}function aNe(e,t,n){const r=Nu(t),s=qf(t),i=n==="fixed",o=Hv(e,!0,i,t);let a={scrollLeft:0,scrollTop:0};const c=mp(0);if(r||!r&&!i)if((Bx(t)!=="body"||KA(s))&&(a=VD(t)),r){const u=Hv(t,!0,i,t);c.x=u.x+t.clientLeft,c.y=u.y+t.clientTop}else s&&(c.x=Jte(s));const d=o.left+a.scrollLeft-c.x,h=o.top+a.scrollTop-c.y;return{x:d,y:h,width:o.width,height:o.height}}function u4(e){return Rc(e).position==="static"}function M9(e,t){return!Nu(e)||Rc(e).position==="fixed"?null:t?t(e):e.offsetParent}function tne(e,t){const n=Ka(e);if(UD(e))return n;if(!Nu(e)){let s=vp(e);for(;s&&!ox(s);){if(Pu(s)&&!u4(s))return s;s=vp(s)}return n}let r=M9(e,t);for(;r&&YPe(r)&&u4(r);)r=M9(r,t);return r&&ox(r)&&u4(r)&&!N6(r)?n:r||XPe(e)||n}const lNe=async function(e){const t=this.getOffsetParent||tne,n=this.getDimensions,r=await n(e.floating);return{reference:aNe(e.reference,await t(e.floating),e.strategy),floating:{x:0,y:0,width:r.width,height:r.height}}};function cNe(e){return Rc(e).direction==="rtl"}const uNe={convertOffsetParentRelativeRectToViewportRelativeRect:JPe,getDocumentElement:qf,getClippingRect:iNe,getOffsetParent:tne,getElementRects:lNe,getClientRects:eNe,getDimensions:oNe,getScale:Db,isElement:Pu,isRTL:cNe};function dNe(e,t){let n=null,r;const s=qf(e);function i(){var a;clearTimeout(r),(a=n)==null||a.disconnect(),n=null}function o(a,c){a===void 0&&(a=!1),c===void 0&&(c=1),i();const{left:d,top:h,width:u,height:f}=e.getBoundingClientRect();if(a||t(),!u||!f)return;const g=iP(h),v=iP(s.clientWidth-(d+u)),m=iP(s.clientHeight-(h+f)),x=iP(d),b={rootMargin:-g+"px "+-v+"px "+-m+"px "+-x+"px",threshold:Ha(0,vu(1,c))||1};let w=!0;function E(R){const T=R[0].intersectionRatio;if(T!==c){if(!w)return o();T?o(!1,T):r=setTimeout(()=>{o(!1,1e-7)},1e3)}w=!1}try{n=new IntersectionObserver(E,{...b,root:s.ownerDocument})}catch{n=new IntersectionObserver(E,b)}n.observe(e)}return o(!0),i}function fNe(e,t,n,r){r===void 0&&(r={});const{ancestorScroll:s=!0,ancestorResize:i=!0,elementResize:o=typeof ResizeObserver=="function",layoutShift:a=typeof IntersectionObserver=="function",animationFrame:c=!1}=r,d=k6(e),h=s||i?[...d?SC(d):[],...SC(t)]:[];h.forEach(y=>{s&&y.addEventListener("scroll",n,{passive:!0}),i&&y.addEventListener("resize",n)});const u=d&&a?dNe(d,n):null;let f=-1,g=null;o&&(g=new ResizeObserver(y=>{let[b]=y;b&&b.target===d&&g&&(g.unobserve(t),cancelAnimationFrame(f),f=requestAnimationFrame(()=>{var w;(w=g)==null||w.observe(t)})),n()}),d&&!c&&g.observe(d),g.observe(t));let v,m=c?Hv(e):null;c&&x();function x(){const y=Hv(e);m&&(y.x!==m.x||y.y!==m.y||y.width!==m.width||y.height!==m.height)&&n(),m=y,v=requestAnimationFrame(x)}return n(),()=>{var y;h.forEach(b=>{s&&b.removeEventListener("scroll",n),i&&b.removeEventListener("resize",n)}),u==null||u(),(y=g)==null||y.disconnect(),g=null,c&&cancelAnimationFrame(v)}}const hNe=WPe,pNe=qPe,mNe=UPe,gNe=KPe,vNe=VPe,I9=BPe,yNe=GPe,bNe=(e,t,n)=>{const r=new Map,s={platform:uNe,...n},i={...s.platform,_c:r};return zPe(e,t,{...s,platform:i})};var QP=typeof document<"u"?C.useLayoutEffect:C.useEffect;function ST(e,t){if(e===t)return!0;if(typeof e!=typeof t)return!1;if(typeof e=="function"&&e.toString()===t.toString())return!0;let n,r,s;if(e&&t&&typeof e=="object"){if(Array.isArray(e)){if(n=e.length,n!==t.length)return!1;for(r=n;r--!==0;)if(!ST(e[r],t[r]))return!1;return!0}if(s=Object.keys(e),n=s.length,n!==Object.keys(t).length)return!1;for(r=n;r--!==0;)if(!{}.hasOwnProperty.call(t,s[r]))return!1;for(r=n;r--!==0;){const i=s[r];if(!(i==="_owner"&&e.$$typeof)&&!ST(e[i],t[i]))return!1}return!0}return e!==e&&t!==t}function nne(e){return typeof window>"u"?1:(e.ownerDocument.defaultView||window).devicePixelRatio||1}function L9(e,t){const n=nne(e);return Math.round(t*n)/n}function j9(e){const t=C.useRef(e);return QP(()=>{t.current=e}),t}function xNe(e){e===void 0&&(e={});const{placement:t="bottom",strategy:n="absolute",middleware:r=[],platform:s,elements:{reference:i,floating:o}={},transform:a=!0,whileElementsMounted:c,open:d}=e,[h,u]=C.useState({x:0,y:0,strategy:n,placement:t,middlewareData:{},isPositioned:!1}),[f,g]=C.useState(r);ST(f,r)||g(r);const[v,m]=C.useState(null),[x,y]=C.useState(null),b=C.useCallback(Y=>{Y!==T.current&&(T.current=Y,m(Y))},[]),w=C.useCallback(Y=>{Y!==N.current&&(N.current=Y,y(Y))},[]),E=i||v,R=o||x,T=C.useRef(null),N=C.useRef(null),A=C.useRef(h),D=c!=null,O=j9(c),I=j9(s),$=C.useCallback(()=>{if(!T.current||!N.current)return;const Y={placement:t,strategy:n,middleware:f};I.current&&(Y.platform=I.current),bNe(T.current,N.current,Y).then(H=>{const se={...H,isPositioned:!0};F.current&&!ST(A.current,se)&&(A.current=se,Li.flushSync(()=>{u(se)}))})},[f,t,n,I]);QP(()=>{d===!1&&A.current.isPositioned&&(A.current.isPositioned=!1,u(Y=>({...Y,isPositioned:!1})))},[d]);const F=C.useRef(!1);QP(()=>(F.current=!0,()=>{F.current=!1}),[]),QP(()=>{if(E&&(T.current=E),R&&(N.current=R),E&&R){if(O.current)return O.current(E,R,$);$()}},[E,R,$,O,D]);const B=C.useMemo(()=>({reference:T,floating:N,setReference:b,setFloating:w}),[b,w]),W=C.useMemo(()=>({reference:E,floating:R}),[E,R]),Z=C.useMemo(()=>{const Y={position:n,left:0,top:0};if(!W.floating)return Y;const H=L9(W.floating,h.x),se=L9(W.floating,h.y);return a?{...Y,transform:"translate("+H+"px, "+se+"px)",...nne(W.floating)>=1.5&&{willChange:"transform"}}:{position:n,left:H,top:se}},[n,a,W.floating,h.x,h.y]);return C.useMemo(()=>({...h,update:$,refs:B,elements:W,floatingStyles:Z}),[h,$,B,W,Z])}const _Ne=e=>{function t(n){return{}.hasOwnProperty.call(n,"current")}return{name:"arrow",options:e,fn(n){const{element:r,padding:s}=typeof e=="function"?e(n):e;return r&&t(r)?r.current!=null?I9({element:r.current,padding:s}).fn(n):{}:r?I9({element:r,padding:s}).fn(n):{}}}},wNe=(e,t)=>({...hNe(e),options:[e,t]}),SNe=(e,t)=>({...pNe(e),options:[e,t]}),CNe=(e,t)=>({...yNe(e),options:[e,t]}),ENe=(e,t)=>({...mNe(e),options:[e,t]}),ANe=(e,t)=>({...gNe(e),options:[e,t]}),RNe=(e,t)=>({...vNe(e),options:[e,t]}),PNe=(e,t)=>({..._Ne(e),options:[e,t]});var NNe="Arrow",rne=C.forwardRef((e,t)=>{const{children:n,width:r=10,height:s=5,...i}=e;return _.jsx(He.svg,{...i,ref:t,width:r,height:s,viewBox:"0 0 30 10",preserveAspectRatio:"none",children:e.asChild?n:_.jsx("polygon",{points:"0,0 30,0 15,10"})})});rne.displayName=NNe;var TNe=rne,D6="Popper",[sne,Iu]=_r(D6),[kNe,ine]=sne(D6),one=e=>{const{__scopePopper:t,children:n}=e,[r,s]=C.useState(null);return _.jsx(kNe,{scope:t,anchor:r,onAnchorChange:s,children:n})};one.displayName=D6;var ane="PopperAnchor",lne=C.forwardRef((e,t)=>{const{__scopePopper:n,virtualRef:r,...s}=e,i=ine(ane,n),o=C.useRef(null),a=_t(t,o);return C.useEffect(()=>{i.onAnchorChange((r==null?void 0:r.current)||o.current)}),r?null:_.jsx(He.div,{...s,ref:a})});lne.displayName=ane;var O6="PopperContent",[DNe,ONe]=sne(O6),cne=C.forwardRef((e,t)=>{var ve,Pe,Oe,ke,ze,$e;const{__scopePopper:n,side:r="bottom",sideOffset:s=0,align:i="center",alignOffset:o=0,arrowPadding:a=0,avoidCollisions:c=!0,collisionBoundary:d=[],collisionPadding:h=0,sticky:u="partial",hideWhenDetached:f=!1,updatePositionStrategy:g="optimized",onPlaced:v,...m}=e,x=ine(O6,n),[y,b]=C.useState(null),w=_t(t,Te=>b(Te)),[E,R]=C.useState(null),T=WA(E),N=(T==null?void 0:T.width)??0,A=(T==null?void 0:T.height)??0,D=r+(i!=="center"?"-"+i:""),O=typeof h=="number"?h:{top:0,right:0,bottom:0,left:0,...h},I=Array.isArray(d)?d:[d],$=I.length>0,F={padding:O,boundary:I.filter(INe),altBoundary:$},{refs:B,floatingStyles:W,placement:Z,isPositioned:Y,middlewareData:H}=xNe({strategy:"fixed",placement:D,whileElementsMounted:(...Te)=>fNe(...Te,{animationFrame:g==="always"}),elements:{reference:x.anchor},middleware:[wNe({mainAxis:s+A,alignmentAxis:o}),c&&SNe({mainAxis:!0,crossAxis:!1,limiter:u==="partial"?CNe():void 0,...F}),c&&ENe({...F}),ANe({...F,apply:({elements:Te,rects:Ue,availableWidth:wt,availableHeight:ut})=>{const{width:St,height:Nn}=Ue.reference,cn=Te.floating.style;cn.setProperty("--radix-popper-available-width",`${wt}px`),cn.setProperty("--radix-popper-available-height",`${ut}px`),cn.setProperty("--radix-popper-anchor-width",`${St}px`),cn.setProperty("--radix-popper-anchor-height",`${Nn}px`)}}),E&&PNe({element:E,padding:a}),LNe({arrowWidth:N,arrowHeight:A}),f&&RNe({strategy:"referenceHidden",...F})]}),[se,he]=fne(Z),re=bn(v);Rr(()=>{Y&&(re==null||re())},[Y,re]);const J=(ve=H.arrow)==null?void 0:ve.x,te=(Pe=H.arrow)==null?void 0:Pe.y,ae=((Oe=H.arrow)==null?void 0:Oe.centerOffset)!==0,[be,xe]=C.useState();return Rr(()=>{y&&xe(window.getComputedStyle(y).zIndex)},[y]),_.jsx("div",{ref:B.setFloating,"data-radix-popper-content-wrapper":"",style:{...W,transform:Y?W.transform:"translate(0, -200%)",minWidth:"max-content",zIndex:be,"--radix-popper-transform-origin":[(ke=H.transformOrigin)==null?void 0:ke.x,(ze=H.transformOrigin)==null?void 0:ze.y].join(" "),...(($e=H.hide)==null?void 0:$e.referenceHidden)&&{visibility:"hidden",pointerEvents:"none"}},dir:e.dir,children:_.jsx(DNe,{scope:n,placedSide:se,onArrowChange:R,arrowX:J,arrowY:te,shouldHideArrow:ae,children:_.jsx(He.div,{"data-side":se,"data-align":he,...m,ref:w,style:{...m.style,animation:Y?void 0:"none"}})})})});cne.displayName=O6;var une="PopperArrow",MNe={top:"bottom",right:"left",bottom:"top",left:"right"},dne=C.forwardRef(function(t,n){const{__scopePopper:r,...s}=t,i=ONe(une,r),o=MNe[i.placedSide];return _.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:_.jsx(TNe,{...s,ref:n,style:{...s.style,display:"block"}})})});dne.displayName=une;function INe(e){return e!==null}var LNe=e=>({name:"transformOrigin",options:e,fn(t){var x,y,b;const{placement:n,rects:r,middlewareData:s}=t,o=((x=s.arrow)==null?void 0:x.centerOffset)!==0,a=o?0:e.arrowWidth,c=o?0:e.arrowHeight,[d,h]=fne(n),u={start:"0%",center:"50%",end:"100%"}[h],f=(((y=s.arrow)==null?void 0:y.x)??0)+a/2,g=(((b=s.arrow)==null?void 0:b.y)??0)+c/2;let v="",m="";return d==="bottom"?(v=o?u:`${f}px`,m=`${-c}px`):d==="top"?(v=o?u:`${f}px`,m=`${r.floating.height+c}px`):d==="right"?(v=`${-c}px`,m=o?u:`${g}px`):d==="left"&&(v=`${r.floating.width+c}px`,m=o?u:`${g}px`),{data:{x:v,y:m}}}});function fne(e){const[t,n="center"]=e.split("-");return[t,n]}var HD=one,Ux=lne,YA=cne,XA=dne,d4="rovingFocusGroup.onEntryFocus",jNe={bubbles:!1,cancelable:!0},WD="RovingFocusGroup",[QB,hne,$Ne]=Uf(WD),[FNe,Lu]=_r(WD,[$Ne]),[zNe,BNe]=FNe(WD),pne=C.forwardRef((e,t)=>_.jsx(QB.Provider,{scope:e.__scopeRovingFocusGroup,children:_.jsx(QB.Slot,{scope:e.__scopeRovingFocusGroup,children:_.jsx(UNe,{...e,ref:t})})}));pne.displayName=WD;var UNe=C.forwardRef((e,t)=>{const{__scopeRovingFocusGroup:n,orientation:r,loop:s=!1,dir:i,currentTabStopId:o,defaultCurrentTabStopId:a,onCurrentTabStopIdChange:c,onEntryFocus:d,preventScrollOnEntryFocus:h=!1,...u}=e,f=C.useRef(null),g=_t(t,f),v=kc(i),[m=null,x]=os({prop:o,defaultProp:a,onChange:c}),[y,b]=C.useState(!1),w=bn(d),E=hne(n),R=C.useRef(!1),[T,N]=C.useState(0);return C.useEffect(()=>{const A=f.current;if(A)return A.addEventListener(d4,w),()=>A.removeEventListener(d4,w)},[w]),_.jsx(zNe,{scope:n,orientation:r,dir:v,loop:s,currentTabStopId:m,onItemFocus:C.useCallback(A=>x(A),[x]),onItemShiftTab:C.useCallback(()=>b(!0),[]),onFocusableItemAdd:C.useCallback(()=>N(A=>A+1),[]),onFocusableItemRemove:C.useCallback(()=>N(A=>A-1),[]),children:_.jsx(He.div,{tabIndex:y||T===0?-1:0,"data-orientation":r,...u,ref:g,style:{outline:"none",...e.style},onMouseDown:Ae(e.onMouseDown,()=>{R.current=!0}),onFocus:Ae(e.onFocus,A=>{const D=!R.current;if(A.target===A.currentTarget&&D&&!y){const O=new CustomEvent(d4,jNe);if(A.currentTarget.dispatchEvent(O),!O.defaultPrevented){const I=E().filter(Z=>Z.focusable),$=I.find(Z=>Z.active),F=I.find(Z=>Z.id===m),W=[$,F,...I].filter(Boolean).map(Z=>Z.ref.current);vne(W,h)}}R.current=!1}),onBlur:Ae(e.onBlur,()=>b(!1))})})}),mne="RovingFocusGroupItem",gne=C.forwardRef((e,t)=>{const{__scopeRovingFocusGroup:n,focusable:r=!0,active:s=!1,tabStopId:i,...o}=e,a=si(),c=i||a,d=BNe(mne,n),h=d.currentTabStopId===c,u=hne(n),{onFocusableItemAdd:f,onFocusableItemRemove:g}=d;return C.useEffect(()=>{if(r)return f(),()=>g()},[r,f,g]),_.jsx(QB.ItemSlot,{scope:n,id:c,focusable:r,active:s,children:_.jsx(He.span,{tabIndex:h?0:-1,"data-orientation":d.orientation,...o,ref:t,onMouseDown:Ae(e.onMouseDown,v=>{r?d.onItemFocus(c):v.preventDefault()}),onFocus:Ae(e.onFocus,()=>d.onItemFocus(c)),onKeyDown:Ae(e.onKeyDown,v=>{if(v.key==="Tab"&&v.shiftKey){d.onItemShiftTab();return}if(v.target!==v.currentTarget)return;const m=WNe(v,d.orientation,d.dir);if(m!==void 0){if(v.metaKey||v.ctrlKey||v.altKey||v.shiftKey)return;v.preventDefault();let y=u().filter(b=>b.focusable).map(b=>b.ref.current);if(m==="last")y.reverse();else if(m==="prev"||m==="next"){m==="prev"&&y.reverse();const b=y.indexOf(v.currentTarget);y=d.loop?qNe(y,b+1):y.slice(b+1)}setTimeout(()=>vne(y))}})})})});gne.displayName=mne;var VNe={ArrowLeft:"prev",ArrowUp:"prev",ArrowRight:"next",ArrowDown:"next",PageUp:"first",Home:"first",PageDown:"last",End:"last"};function HNe(e,t){return t!=="rtl"?e:e==="ArrowLeft"?"ArrowRight":e==="ArrowRight"?"ArrowLeft":e}function WNe(e,t,n){const r=HNe(e.key,n);if(!(t==="vertical"&&["ArrowLeft","ArrowRight"].includes(r))&&!(t==="horizontal"&&["ArrowUp","ArrowDown"].includes(r)))return VNe[r]}function vne(e,t=!1){const n=document.activeElement;for(const r of e)if(r===n||(r.focus({preventScroll:t}),document.activeElement!==n))return}function qNe(e,t){return e.map((n,r)=>e[(t+r)%e.length])}var QA=pne,ZA=gne,ZB=["Enter"," "],GNe=["ArrowDown","PageUp","Home"],yne=["ArrowUp","PageDown","End"],KNe=[...GNe,...yne],YNe={ltr:[...ZB,"ArrowRight"],rtl:[...ZB,"ArrowLeft"]},XNe={ltr:["ArrowLeft"],rtl:["ArrowRight"]},JA="Menu",[CC,QNe,ZNe]=Uf(JA),[hy,eR]=_r(JA,[ZNe,Iu,Lu]),qD=Iu(),bne=Lu(),[JNe,py]=hy(JA),[eTe,tR]=hy(JA),xne=e=>{const{__scopeMenu:t,open:n=!1,children:r,dir:s,onOpenChange:i,modal:o=!0}=e,a=qD(t),[c,d]=C.useState(null),h=C.useRef(!1),u=bn(i),f=kc(s);return C.useEffect(()=>{const g=()=>{h.current=!0,document.addEventListener("pointerdown",v,{capture:!0,once:!0}),document.addEventListener("pointermove",v,{capture:!0,once:!0})},v=()=>h.current=!1;return document.addEventListener("keydown",g,{capture:!0}),()=>{document.removeEventListener("keydown",g,{capture:!0}),document.removeEventListener("pointerdown",v,{capture:!0}),document.removeEventListener("pointermove",v,{capture:!0})}},[]),_.jsx(HD,{...a,children:_.jsx(JNe,{scope:t,open:n,onOpenChange:u,content:c,onContentChange:d,children:_.jsx(eTe,{scope:t,onClose:C.useCallback(()=>u(!1),[u]),isUsingKeyboardRef:h,dir:f,modal:o,children:r})})})};xne.displayName=JA;var tTe="MenuAnchor",M6=C.forwardRef((e,t)=>{const{__scopeMenu:n,...r}=e,s=qD(n);return _.jsx(Ux,{...s,...r,ref:t})});M6.displayName=tTe;var I6="MenuPortal",[nTe,_ne]=hy(I6,{forceMount:void 0}),wne=e=>{const{__scopeMenu:t,forceMount:n,children:r,container:s}=e,i=py(I6,t);return _.jsx(nTe,{scope:t,forceMount:n,children:_.jsx(Vr,{present:n||i.open,children:_.jsx(Dx,{asChild:!0,container:s,children:r})})})};wne.displayName=I6;var _l="MenuContent",[rTe,L6]=hy(_l),Sne=C.forwardRef((e,t)=>{const n=_ne(_l,e.__scopeMenu),{forceMount:r=n.forceMount,...s}=e,i=py(_l,e.__scopeMenu),o=tR(_l,e.__scopeMenu);return _.jsx(CC.Provider,{scope:e.__scopeMenu,children:_.jsx(Vr,{present:r||i.open,children:_.jsx(CC.Slot,{scope:e.__scopeMenu,children:o.modal?_.jsx(sTe,{...s,ref:t}):_.jsx(iTe,{...s,ref:t})})})})}),sTe=C.forwardRef((e,t)=>{const n=py(_l,e.__scopeMenu),r=C.useRef(null),s=_t(t,r);return C.useEffect(()=>{const i=r.current;if(i)return Ox(i)},[]),_.jsx(j6,{...e,ref:s,trapFocus:n.open,disableOutsidePointerEvents:n.open,disableOutsideScroll:!0,onFocusOutside:Ae(e.onFocusOutside,i=>i.preventDefault(),{checkForDefaultPrevented:!1}),onDismiss:()=>n.onOpenChange(!1)})}),iTe=C.forwardRef((e,t)=>{const n=py(_l,e.__scopeMenu);return _.jsx(j6,{...e,ref:t,trapFocus:!1,disableOutsidePointerEvents:!1,disableOutsideScroll:!1,onDismiss:()=>n.onOpenChange(!1)})}),j6=C.forwardRef((e,t)=>{const{__scopeMenu:n,loop:r=!1,trapFocus:s,onOpenAutoFocus:i,onCloseAutoFocus:o,disableOutsidePointerEvents:a,onEntryFocus:c,onEscapeKeyDown:d,onPointerDownOutside:h,onFocusOutside:u,onInteractOutside:f,onDismiss:g,disableOutsideScroll:v,...m}=e,x=py(_l,n),y=tR(_l,n),b=qD(n),w=bne(n),E=QNe(n),[R,T]=C.useState(null),N=C.useRef(null),A=_t(t,N,x.onContentChange),D=C.useRef(0),O=C.useRef(""),I=C.useRef(0),$=C.useRef(null),F=C.useRef("right"),B=C.useRef(0),W=v?IA:C.Fragment,Z=v?{as:Cc,allowPinchZoom:!0}:void 0,Y=se=>{var ve,Pe;const he=O.current+se,re=E().filter(Oe=>!Oe.disabled),J=document.activeElement,te=(ve=re.find(Oe=>Oe.ref.current===J))==null?void 0:ve.textValue,ae=re.map(Oe=>Oe.textValue),be=vTe(ae,he,te),xe=(Pe=re.find(Oe=>Oe.textValue===be))==null?void 0:Pe.ref.current;(function Oe(ke){O.current=ke,window.clearTimeout(D.current),ke!==""&&(D.current=window.setTimeout(()=>Oe(""),1e3))})(he),xe&&setTimeout(()=>xe.focus())};C.useEffect(()=>()=>window.clearTimeout(D.current),[]),uD();const H=C.useCallback(se=>{var re,J;return F.current===((re=$.current)==null?void 0:re.side)&&bTe(se,(J=$.current)==null?void 0:J.area)},[]);return _.jsx(rTe,{scope:n,searchRef:O,onItemEnter:C.useCallback(se=>{H(se)&&se.preventDefault()},[H]),onItemLeave:C.useCallback(se=>{var he;H(se)||((he=N.current)==null||he.focus(),T(null))},[H]),onTriggerLeave:C.useCallback(se=>{H(se)&&se.preventDefault()},[H]),pointerGraceTimerRef:I,onPointerGraceIntentChange:C.useCallback(se=>{$.current=se},[]),children:_.jsx(W,{...Z,children:_.jsx(MA,{asChild:!0,trapped:s,onMountAutoFocus:Ae(i,se=>{var he;se.preventDefault(),(he=N.current)==null||he.focus({preventScroll:!0})}),onUnmountAutoFocus:o,children:_.jsx(Hf,{asChild:!0,disableOutsidePointerEvents:a,onEscapeKeyDown:d,onPointerDownOutside:h,onFocusOutside:u,onInteractOutside:f,onDismiss:g,children:_.jsx(QA,{asChild:!0,...w,dir:y.dir,orientation:"vertical",loop:r,currentTabStopId:R,onCurrentTabStopIdChange:T,onEntryFocus:Ae(c,se=>{y.isUsingKeyboardRef.current||se.preventDefault()}),preventScrollOnEntryFocus:!0,children:_.jsx(YA,{role:"menu","aria-orientation":"vertical","data-state":Fne(x.open),"data-radix-menu-content":"",dir:y.dir,...b,...m,ref:A,style:{outline:"none",...m.style},onKeyDown:Ae(m.onKeyDown,se=>{const re=se.target.closest("[data-radix-menu-content]")===se.currentTarget,J=se.ctrlKey||se.altKey||se.metaKey,te=se.key.length===1;re&&(se.key==="Tab"&&se.preventDefault(),!J&&te&&Y(se.key));const ae=N.current;if(se.target!==ae||!KNe.includes(se.key))return;se.preventDefault();const xe=E().filter(ve=>!ve.disabled).map(ve=>ve.ref.current);yne.includes(se.key)&&xe.reverse(),mTe(xe)}),onBlur:Ae(e.onBlur,se=>{se.currentTarget.contains(se.target)||(window.clearTimeout(D.current),O.current="")}),onPointerMove:Ae(e.onPointerMove,EC(se=>{const he=se.target,re=B.current!==se.clientX;if(se.currentTarget.contains(he)&&re){const J=se.clientX>B.current?"right":"left";F.current=J,B.current=se.clientX}}))})})})})})})});Sne.displayName=_l;var oTe="MenuGroup",$6=C.forwardRef((e,t)=>{const{__scopeMenu:n,...r}=e;return _.jsx(He.div,{role:"group",...r,ref:t})});$6.displayName=oTe;var aTe="MenuLabel",Cne=C.forwardRef((e,t)=>{const{__scopeMenu:n,...r}=e;return _.jsx(He.div,{...r,ref:t})});Cne.displayName=aTe;var CT="MenuItem",$9="menu.itemSelect",GD=C.forwardRef((e,t)=>{const{disabled:n=!1,onSelect:r,...s}=e,i=C.useRef(null),o=tR(CT,e.__scopeMenu),a=L6(CT,e.__scopeMenu),c=_t(t,i),d=C.useRef(!1),h=()=>{const u=i.current;if(!n&&u){const f=new CustomEvent($9,{bubbles:!0,cancelable:!0});u.addEventListener($9,g=>r==null?void 0:r(g),{once:!0}),vC(u,f),f.defaultPrevented?d.current=!1:o.onClose()}};return _.jsx(Ene,{...s,ref:c,disabled:n,onClick:Ae(e.onClick,h),onPointerDown:u=>{var f;(f=e.onPointerDown)==null||f.call(e,u),d.current=!0},onPointerUp:Ae(e.onPointerUp,u=>{var f;d.current||(f=u.currentTarget)==null||f.click()}),onKeyDown:Ae(e.onKeyDown,u=>{const f=a.searchRef.current!=="";n||f&&u.key===" "||ZB.includes(u.key)&&(u.currentTarget.click(),u.preventDefault())})})});GD.displayName=CT;var Ene=C.forwardRef((e,t)=>{const{__scopeMenu:n,disabled:r=!1,textValue:s,...i}=e,o=L6(CT,n),a=bne(n),c=C.useRef(null),d=_t(t,c),[h,u]=C.useState(!1),[f,g]=C.useState("");return C.useEffect(()=>{const v=c.current;v&&g((v.textContent??"").trim())},[i.children]),_.jsx(CC.ItemSlot,{scope:n,disabled:r,textValue:s??f,children:_.jsx(ZA,{asChild:!0,...a,focusable:!r,children:_.jsx(He.div,{role:"menuitem","data-highlighted":h?"":void 0,"aria-disabled":r||void 0,"data-disabled":r?"":void 0,...i,ref:d,onPointerMove:Ae(e.onPointerMove,EC(v=>{r?o.onItemLeave(v):(o.onItemEnter(v),v.defaultPrevented||v.currentTarget.focus({preventScroll:!0}))})),onPointerLeave:Ae(e.onPointerLeave,EC(v=>o.onItemLeave(v))),onFocus:Ae(e.onFocus,()=>u(!0)),onBlur:Ae(e.onBlur,()=>u(!1))})})})}),lTe="MenuCheckboxItem",Ane=C.forwardRef((e,t)=>{const{checked:n=!1,onCheckedChange:r,...s}=e;return _.jsx(kne,{scope:e.__scopeMenu,checked:n,children:_.jsx(GD,{role:"menuitemcheckbox","aria-checked":ET(n)?"mixed":n,...s,ref:t,"data-state":z6(n),onSelect:Ae(s.onSelect,()=>r==null?void 0:r(ET(n)?!0:!n),{checkForDefaultPrevented:!1})})})});Ane.displayName=lTe;var Rne="MenuRadioGroup",[cTe,uTe]=hy(Rne,{value:void 0,onValueChange:()=>{}}),Pne=C.forwardRef((e,t)=>{const{value:n,onValueChange:r,...s}=e,i=bn(r);return _.jsx(cTe,{scope:e.__scopeMenu,value:n,onValueChange:i,children:_.jsx($6,{...s,ref:t})})});Pne.displayName=Rne;var Nne="MenuRadioItem",Tne=C.forwardRef((e,t)=>{const{value:n,...r}=e,s=uTe(Nne,e.__scopeMenu),i=n===s.value;return _.jsx(kne,{scope:e.__scopeMenu,checked:i,children:_.jsx(GD,{role:"menuitemradio","aria-checked":i,...r,ref:t,"data-state":z6(i),onSelect:Ae(r.onSelect,()=>{var o;return(o=s.onValueChange)==null?void 0:o.call(s,n)},{checkForDefaultPrevented:!1})})})});Tne.displayName=Nne;var F6="MenuItemIndicator",[kne,dTe]=hy(F6,{checked:!1}),Dne=C.forwardRef((e,t)=>{const{__scopeMenu:n,forceMount:r,...s}=e,i=dTe(F6,n);return _.jsx(Vr,{present:r||ET(i.checked)||i.checked===!0,children:_.jsx(He.span,{...s,ref:t,"data-state":z6(i.checked)})})});Dne.displayName=F6;var fTe="MenuSeparator",One=C.forwardRef((e,t)=>{const{__scopeMenu:n,...r}=e;return _.jsx(He.div,{role:"separator","aria-orientation":"horizontal",...r,ref:t})});One.displayName=fTe;var hTe="MenuArrow",Mne=C.forwardRef((e,t)=>{const{__scopeMenu:n,...r}=e,s=qD(n);return _.jsx(XA,{...s,...r,ref:t})});Mne.displayName=hTe;var pTe="MenuSub",[l7e,Ine]=hy(pTe),l1="MenuSubTrigger",Lne=C.forwardRef((e,t)=>{const n=py(l1,e.__scopeMenu),r=tR(l1,e.__scopeMenu),s=Ine(l1,e.__scopeMenu),i=L6(l1,e.__scopeMenu),o=C.useRef(null),{pointerGraceTimerRef:a,onPointerGraceIntentChange:c}=i,d={__scopeMenu:e.__scopeMenu},h=C.useCallback(()=>{o.current&&window.clearTimeout(o.current),o.current=null},[]);return C.useEffect(()=>h,[h]),C.useEffect(()=>{const u=a.current;return()=>{window.clearTimeout(u),c(null)}},[a,c]),_.jsx(M6,{asChild:!0,...d,children:_.jsx(Ene,{id:s.triggerId,"aria-haspopup":"menu","aria-expanded":n.open,"aria-controls":s.contentId,"data-state":Fne(n.open),...e,ref:DA(t,s.onTriggerChange),onClick:u=>{var f;(f=e.onClick)==null||f.call(e,u),!(e.disabled||u.defaultPrevented)&&(u.currentTarget.focus(),n.open||n.onOpenChange(!0))},onPointerMove:Ae(e.onPointerMove,EC(u=>{i.onItemEnter(u),!u.defaultPrevented&&!e.disabled&&!n.open&&!o.current&&(i.onPointerGraceIntentChange(null),o.current=window.setTimeout(()=>{n.onOpenChange(!0),h()},100))})),onPointerLeave:Ae(e.onPointerLeave,EC(u=>{var g,v;h();const f=(g=n.content)==null?void 0:g.getBoundingClientRect();if(f){const m=(v=n.content)==null?void 0:v.dataset.side,x=m==="right",y=x?-5:5,b=f[x?"left":"right"],w=f[x?"right":"left"];i.onPointerGraceIntentChange({area:[{x:u.clientX+y,y:u.clientY},{x:b,y:f.top},{x:w,y:f.top},{x:w,y:f.bottom},{x:b,y:f.bottom}],side:m}),window.clearTimeout(a.current),a.current=window.setTimeout(()=>i.onPointerGraceIntentChange(null),300)}else{if(i.onTriggerLeave(u),u.defaultPrevented)return;i.onPointerGraceIntentChange(null)}})),onKeyDown:Ae(e.onKeyDown,u=>{var g;const f=i.searchRef.current!=="";e.disabled||f&&u.key===" "||YNe[r.dir].includes(u.key)&&(n.onOpenChange(!0),(g=n.content)==null||g.focus(),u.preventDefault())})})})});Lne.displayName=l1;var jne="MenuSubContent",$ne=C.forwardRef((e,t)=>{const n=_ne(_l,e.__scopeMenu),{forceMount:r=n.forceMount,...s}=e,i=py(_l,e.__scopeMenu),o=tR(_l,e.__scopeMenu),a=Ine(jne,e.__scopeMenu),c=C.useRef(null),d=_t(t,c);return _.jsx(CC.Provider,{scope:e.__scopeMenu,children:_.jsx(Vr,{present:r||i.open,children:_.jsx(CC.Slot,{scope:e.__scopeMenu,children:_.jsx(j6,{id:a.contentId,"aria-labelledby":a.triggerId,...s,ref:d,align:"start",side:o.dir==="rtl"?"left":"right",disableOutsidePointerEvents:!1,disableOutsideScroll:!1,trapFocus:!1,onOpenAutoFocus:h=>{var u;o.isUsingKeyboardRef.current&&((u=c.current)==null||u.focus()),h.preventDefault()},onCloseAutoFocus:h=>h.preventDefault(),onFocusOutside:Ae(e.onFocusOutside,h=>{h.target!==a.trigger&&i.onOpenChange(!1)}),onEscapeKeyDown:Ae(e.onEscapeKeyDown,h=>{o.onClose(),h.preventDefault()}),onKeyDown:Ae(e.onKeyDown,h=>{var g;const u=h.currentTarget.contains(h.target),f=XNe[o.dir].includes(h.key);u&&f&&(i.onOpenChange(!1),(g=a.trigger)==null||g.focus(),h.preventDefault())})})})})})});$ne.displayName=jne;function Fne(e){return e?"open":"closed"}function ET(e){return e==="indeterminate"}function z6(e){return ET(e)?"indeterminate":e?"checked":"unchecked"}function mTe(e){const t=document.activeElement;for(const n of e)if(n===t||(n.focus(),document.activeElement!==t))return}function gTe(e,t){return e.map((n,r)=>e[(t+r)%e.length])}function vTe(e,t,n){const s=t.length>1&&Array.from(t).every(d=>d===t[0])?t[0]:t,i=n?e.indexOf(n):-1;let o=gTe(e,Math.max(i,0));s.length===1&&(o=o.filter(d=>d!==n));const c=o.find(d=>d.toLowerCase().startsWith(s.toLowerCase()));return c!==n?c:void 0}function yTe(e,t){const{x:n,y:r}=e;let s=!1;for(let i=0,o=t.length-1;i<t.length;o=i++){const a=t[i].x,c=t[i].y,d=t[o].x,h=t[o].y;c>r!=h>r&&n<(d-a)*(r-c)/(h-c)+a&&(s=!s)}return s}function bTe(e,t){if(!t)return!1;const n={x:e.clientX,y:e.clientY};return yTe(n,t)}function EC(e){return t=>t.pointerType==="mouse"?e(t):void 0}var xTe=xne,B6=M6,U6=wne,V6=Sne,H6=$6,W6=Cne,q6=GD,G6=Ane,K6=Pne,Y6=Tne,X6=Dne,Q6=One,Z6=Mne,J6=Lne,e8=$ne,zne="ContextMenu",[_Te,c7e]=_r(zne,[eR]),ca=eR(),[u7e,Bne]=_Te(zne),Une="ContextMenuTrigger",wTe=C.forwardRef((e,t)=>{const{__scopeContextMenu:n,disabled:r=!1,...s}=e,i=Bne(Une,n),o=ca(n),a=C.useRef({x:0,y:0}),c=C.useRef({getBoundingClientRect:()=>DOMRect.fromRect({width:0,height:0,...a.current})}),d=C.useRef(0),h=C.useCallback(()=>window.clearTimeout(d.current),[]),u=f=>{a.current={x:f.clientX,y:f.clientY},i.onOpenChange(!0)};return C.useEffect(()=>h,[h]),C.useEffect(()=>void(r&&h()),[r,h]),_.jsxs(_.Fragment,{children:[_.jsx(B6,{...o,virtualRef:c}),_.jsx(He.span,{"data-state":i.open?"open":"closed","data-disabled":r?"":void 0,...s,ref:t,style:{WebkitTouchCallout:"none",...e.style},onContextMenu:r?e.onContextMenu:Ae(e.onContextMenu,f=>{h(),u(f),f.preventDefault()}),onPointerDown:r?e.onPointerDown:Ae(e.onPointerDown,oP(f=>{h(),d.current=window.setTimeout(()=>u(f),700)})),onPointerMove:r?e.onPointerMove:Ae(e.onPointerMove,oP(h)),onPointerCancel:r?e.onPointerCancel:Ae(e.onPointerCancel,oP(h)),onPointerUp:r?e.onPointerUp:Ae(e.onPointerUp,oP(h))})]})});wTe.displayName=Une;var STe="ContextMenuPortal",Vne=e=>{const{__scopeContextMenu:t,...n}=e,r=ca(t);return _.jsx(U6,{...r,...n})};Vne.displayName=STe;var Hne="ContextMenuContent",Wne=C.forwardRef((e,t)=>{const{__scopeContextMenu:n,...r}=e,s=Bne(Hne,n),i=ca(n),o=C.useRef(!1);return _.jsx(V6,{...i,...r,ref:t,side:"right",sideOffset:2,align:"start",onCloseAutoFocus:a=>{var c;(c=e.onCloseAutoFocus)==null||c.call(e,a),!a.defaultPrevented&&o.current&&a.preventDefault(),o.current=!1},onInteractOutside:a=>{var c;(c=e.onInteractOutside)==null||c.call(e,a),!a.defaultPrevented&&!s.modal&&(o.current=!0)},style:{...e.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)"}})});Wne.displayName=Hne;var CTe="ContextMenuGroup",ETe=C.forwardRef((e,t)=>{const{__scopeContextMenu:n,...r}=e,s=ca(n);return _.jsx(H6,{...s,...r,ref:t})});ETe.displayName=CTe;var ATe="ContextMenuLabel",qne=C.forwardRef((e,t)=>{const{__scopeContextMenu:n,...r}=e,s=ca(n);return _.jsx(W6,{...s,...r,ref:t})});qne.displayName=ATe;var RTe="ContextMenuItem",Gne=C.forwardRef((e,t)=>{const{__scopeContextMenu:n,...r}=e,s=ca(n);return _.jsx(q6,{...s,...r,ref:t})});Gne.displayName=RTe;var PTe="ContextMenuCheckboxItem",Kne=C.forwardRef((e,t)=>{const{__scopeContextMenu:n,...r}=e,s=ca(n);return _.jsx(G6,{...s,...r,ref:t})});Kne.displayName=PTe;var NTe="ContextMenuRadioGroup",TTe=C.forwardRef((e,t)=>{const{__scopeContextMenu:n,...r}=e,s=ca(n);return _.jsx(K6,{...s,...r,ref:t})});TTe.displayName=NTe;var kTe="ContextMenuRadioItem",Yne=C.forwardRef((e,t)=>{const{__scopeContextMenu:n,...r}=e,s=ca(n);return _.jsx(Y6,{...s,...r,ref:t})});Yne.displayName=kTe;var DTe="ContextMenuItemIndicator",Xne=C.forwardRef((e,t)=>{const{__scopeContextMenu:n,...r}=e,s=ca(n);return _.jsx(X6,{...s,...r,ref:t})});Xne.displayName=DTe;var OTe="ContextMenuSeparator",Qne=C.forwardRef((e,t)=>{const{__scopeContextMenu:n,...r}=e,s=ca(n);return _.jsx(Q6,{...s,...r,ref:t})});Qne.displayName=OTe;var MTe="ContextMenuArrow",ITe=C.forwardRef((e,t)=>{const{__scopeContextMenu:n,...r}=e,s=ca(n);return _.jsx(Z6,{...s,...r,ref:t})});ITe.displayName=MTe;var LTe="ContextMenuSubTrigger",Zne=C.forwardRef((e,t)=>{const{__scopeContextMenu:n,...r}=e,s=ca(n);return _.jsx(J6,{...s,...r,ref:t})});Zne.displayName=LTe;var jTe="ContextMenuSubContent",Jne=C.forwardRef((e,t)=>{const{__scopeContextMenu:n,...r}=e,s=ca(n);return _.jsx(e8,{...s,...r,ref:t,style:{...e.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)"}})});Jne.displayName=jTe;function oP(e){return t=>t.pointerType!=="mouse"?e(t):void 0}var $Te=Vne,ere=Wne,tre=qne,nre=Gne,rre=Kne,sre=Yne,ire=Xne,ore=Qne,are=Zne,lre=Jne;const FTe=C.forwardRef(({className:e,inset:t,children:n,...r},s)=>_.jsxs(are,{ref:s,className:ge("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",t&&"pl-8",e),...r,children:[n,_.jsx(Tx,{className:"ml-auto h-4 w-4"})]}));FTe.displayName=are.displayName;const zTe=C.forwardRef(({className:e,...t},n)=>_.jsx(lre,{ref:n,className:ge("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",e),...t}));zTe.displayName=lre.displayName;const BTe=C.forwardRef(({className:e,...t},n)=>_.jsx($Te,{children:_.jsx(ere,{ref:n,className:ge("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",e),...t})}));BTe.displayName=ere.displayName;const UTe=C.forwardRef(({className:e,inset:t,...n},r)=>_.jsx(nre,{ref:r,className:ge("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",t&&"pl-8",e),...n}));UTe.displayName=nre.displayName;const VTe=C.forwardRef(({className:e,children:t,checked:n,...r},s)=>_.jsxs(rre,{ref:s,className:ge("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",e),checked:n,...r,children:[_.jsx("span",{className:"absolute left-2 flex h-3.5 w-3.5 items-center justify-center",children:_.jsx(ire,{children:_.jsx(OA,{className:"h-4 w-4"})})}),t]}));VTe.displayName=rre.displayName;const HTe=C.forwardRef(({className:e,children:t,...n},r)=>_.jsxs(sre,{ref:r,className:ge("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",e),...n,children:[_.jsx("span",{className:"absolute left-2 flex h-3.5 w-3.5 items-center justify-center",children:_.jsx(ire,{children:_.jsx(cD,{className:"h-2 w-2 fill-current"})})}),t]}));HTe.displayName=sre.displayName;const WTe=C.forwardRef(({className:e,inset:t,...n},r)=>_.jsx(tre,{ref:r,className:ge("px-2 py-1.5 text-sm font-semibold text-foreground",t&&"pl-8",e),...n}));WTe.displayName=tre.displayName;const qTe=C.forwardRef(({className:e,...t},n)=>_.jsx(ore,{ref:n,className:ge("-mx-1 my-1 h-px bg-border",e),...t}));qTe.displayName=ore.displayName;function cp(e,t,{checkForDefaultPrevented:n=!0}={}){return function(s){if(e==null||e(s),n===!1||!s.defaultPrevented)return t==null?void 0:t(s)}}function F9(e,t){if(typeof e=="function")return e(t);e!=null&&(e.current=t)}function cre(...e){return t=>{let n=!1;const r=e.map(s=>{const i=F9(s,t);return!n&&typeof i=="function"&&(n=!0),i});if(n)return()=>{for(let s=0;s<r.length;s++){const i=r[s];typeof i=="function"?i():F9(e[s],null)}}}}function my(...e){return C.useCallback(cre(...e),e)}function GTe(e,t){const n=C.createContext(t),r=i=>{const{children:o,...a}=i,c=C.useMemo(()=>a,Object.values(a));return _.jsx(n.Provider,{value:c,children:o})};r.displayName=e+"Provider";function s(i){const o=C.useContext(n);if(o)return o;if(t!==void 0)return t;throw new Error(`\`${i}\` must be used within \`${e}\``)}return[r,s]}function KTe(e,t=[]){let n=[];function r(i,o){const a=C.createContext(o),c=n.length;n=[...n,o];const d=u=>{var y;const{scope:f,children:g,...v}=u,m=((y=f==null?void 0:f[e])==null?void 0:y[c])||a,x=C.useMemo(()=>v,Object.values(v));return _.jsx(m.Provider,{value:x,children:g})};d.displayName=i+"Provider";function h(u,f){var m;const g=((m=f==null?void 0:f[e])==null?void 0:m[c])||a,v=C.useContext(g);if(v)return v;if(o!==void 0)return o;throw new Error(`\`${u}\` must be used within \`${i}\``)}return[d,h]}const s=()=>{const i=n.map(o=>C.createContext(o));return function(a){const c=(a==null?void 0:a[e])||i;return C.useMemo(()=>({[`__scope${e}`]:{...a,[e]:c}}),[a,c])}};return s.scopeName=e,[r,YTe(s,...t)]}function YTe(...e){const t=e[0];if(e.length===1)return t;const n=()=>{const r=e.map(s=>({useScope:s(),scopeName:s.scopeName}));return function(i){const o=r.reduce((a,{useScope:c,scopeName:d})=>{const u=c(i)[`__scope${d}`];return{...a,...u}},{});return C.useMemo(()=>({[`__scope${t.scopeName}`]:o}),[o])}};return n.scopeName=t.scopeName,n}var t8=C.forwardRef((e,t)=>{const{children:n,...r}=e,s=C.Children.toArray(n),i=s.find(QTe);if(i){const o=i.props.children,a=s.map(c=>c===i?C.Children.count(o)>1?C.Children.only(null):C.isValidElement(o)?o.props.children:null:c);return _.jsx(JB,{...r,ref:t,children:C.isValidElement(o)?C.cloneElement(o,void 0,a):null})}return _.jsx(JB,{...r,ref:t,children:n})});t8.displayName="Slot";var JB=C.forwardRef((e,t)=>{const{children:n,...r}=e;if(C.isValidElement(n)){const s=JTe(n),i=ZTe(r,n.props);return n.type!==C.Fragment&&(i.ref=t?cre(t,s):s),C.cloneElement(n,i)}return C.Children.count(n)>1?C.Children.only(null):null});JB.displayName="SlotClone";var XTe=({children:e})=>_.jsx(_.Fragment,{children:e});function QTe(e){return C.isValidElement(e)&&e.type===XTe}function ZTe(e,t){const n={...t};for(const r in t){const s=e[r],i=t[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{...e,...n}}function JTe(e){var r,s;let t=(r=Object.getOwnPropertyDescriptor(e.props,"ref"))==null?void 0:r.get,n=t&&"isReactWarning"in t&&t.isReactWarning;return n?e.ref:(t=(s=Object.getOwnPropertyDescriptor(e,"ref"))==null?void 0:s.get,n=t&&"isReactWarning"in t&&t.isReactWarning,n?e.props.ref:e.props.ref||e.ref)}var eke=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","span","svg","ul"],Gf=eke.reduce((e,t)=>{const n=C.forwardRef((r,s)=>{const{asChild:i,...o}=r,a=i?t8:t;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),_.jsx(a,{...o,ref:s})});return n.displayName=`Primitive.${t}`,{...e,[t]:n}},{});function tke(e,t){e&&Li.flushSync(()=>e.dispatchEvent(t))}var nke="DismissableLayer",eU="dismissableLayer.update",rke="dismissableLayer.pointerDownOutside",ske="dismissableLayer.focusOutside",z9,ure=C.createContext({layers:new Set,layersWithOutsidePointerEventsDisabled:new Set,branches:new Set}),dre=C.forwardRef((e,t)=>{const{disableOutsidePointerEvents:n=!1,onEscapeKeyDown:r,onPointerDownOutside:s,onFocusOutside:i,onInteractOutside:o,onDismiss:a,...c}=e,d=C.useContext(ure),[h,u]=C.useState(null),f=(h==null?void 0:h.ownerDocument)??(globalThis==null?void 0:globalThis.document),[,g]=C.useState({}),v=my(t,N=>u(N)),m=Array.from(d.layers),[x]=[...d.layersWithOutsidePointerEventsDisabled].slice(-1),y=m.indexOf(x),b=h?m.indexOf(h):-1,w=d.layersWithOutsidePointerEventsDisabled.size>0,E=b>=y,R=ake(N=>{const A=N.target,D=[...d.branches].some(O=>O.contains(A));!E||D||(s==null||s(N),o==null||o(N),N.defaultPrevented||a==null||a())},f),T=lke(N=>{const A=N.target;[...d.branches].some(O=>O.contains(A))||(i==null||i(N),o==null||o(N),N.defaultPrevented||a==null||a())},f);return MJ(N=>{b===d.layers.size-1&&(r==null||r(N),!N.defaultPrevented&&a&&(N.preventDefault(),a()))},f),C.useEffect(()=>{if(h)return n&&(d.layersWithOutsidePointerEventsDisabled.size===0&&(z9=f.body.style.pointerEvents,f.body.style.pointerEvents="none"),d.layersWithOutsidePointerEventsDisabled.add(h)),d.layers.add(h),B9(),()=>{n&&d.layersWithOutsidePointerEventsDisabled.size===1&&(f.body.style.pointerEvents=z9)}},[h,f,n,d]),C.useEffect(()=>()=>{h&&(d.layers.delete(h),d.layersWithOutsidePointerEventsDisabled.delete(h),B9())},[h,d]),C.useEffect(()=>{const N=()=>g({});return document.addEventListener(eU,N),()=>document.removeEventListener(eU,N)},[]),_.jsx(Gf.div,{...c,ref:v,style:{pointerEvents:w?E?"auto":"none":void 0,...e.style},onFocusCapture:cp(e.onFocusCapture,T.onFocusCapture),onBlurCapture:cp(e.onBlurCapture,T.onBlurCapture),onPointerDownCapture:cp(e.onPointerDownCapture,R.onPointerDownCapture)})});dre.displayName=nke;var ike="DismissableLayerBranch",oke=C.forwardRef((e,t)=>{const n=C.useContext(ure),r=C.useRef(null),s=my(t,r);return C.useEffect(()=>{const i=r.current;if(i)return n.branches.add(i),()=>{n.branches.delete(i)}},[n.branches]),_.jsx(Gf.div,{...e,ref:s})});oke.displayName=ike;function ake(e,t=globalThis==null?void 0:globalThis.document){const n=bn(e),r=C.useRef(!1),s=C.useRef(()=>{});return C.useEffect(()=>{const i=a=>{if(a.target&&!r.current){let c=function(){fre(rke,n,d,{discrete:!0})};const d={originalEvent:a};a.pointerType==="touch"?(t.removeEventListener("click",s.current),s.current=c,t.addEventListener("click",s.current,{once:!0})):c()}else t.removeEventListener("click",s.current);r.current=!1},o=window.setTimeout(()=>{t.addEventListener("pointerdown",i)},0);return()=>{window.clearTimeout(o),t.removeEventListener("pointerdown",i),t.removeEventListener("click",s.current)}},[t,n]),{onPointerDownCapture:()=>r.current=!0}}function lke(e,t=globalThis==null?void 0:globalThis.document){const n=bn(e),r=C.useRef(!1);return C.useEffect(()=>{const s=i=>{i.target&&!r.current&&fre(ske,n,{originalEvent:i},{discrete:!1})};return t.addEventListener("focusin",s),()=>t.removeEventListener("focusin",s)},[t,n]),{onFocusCapture:()=>r.current=!0,onBlurCapture:()=>r.current=!1}}function B9(){const e=new CustomEvent(eU);document.dispatchEvent(e)}function fre(e,t,n,{discrete:r}){const s=n.originalEvent.target,i=new CustomEvent(e,{bubbles:!1,cancelable:!0,detail:n});t&&s.addEventListener(e,t,{once:!0}),r?tke(s,i):s.dispatchEvent(i)}var f4="focusScope.autoFocusOnMount",h4="focusScope.autoFocusOnUnmount",U9={bubbles:!1,cancelable:!0},cke="FocusScope",hre=C.forwardRef((e,t)=>{const{loop:n=!1,trapped:r=!1,onMountAutoFocus:s,onUnmountAutoFocus:i,...o}=e,[a,c]=C.useState(null),d=bn(s),h=bn(i),u=C.useRef(null),f=my(t,m=>c(m)),g=C.useRef({paused:!1,pause(){this.paused=!0},resume(){this.paused=!1}}).current;C.useEffect(()=>{if(r){let m=function(w){if(g.paused||!a)return;const E=w.target;a.contains(E)?u.current=E:rh(u.current,{select:!0})},x=function(w){if(g.paused||!a)return;const E=w.relatedTarget;E!==null&&(a.contains(E)||rh(u.current,{select:!0}))},y=function(w){if(document.activeElement===document.body)for(const R of w)R.removedNodes.length>0&&rh(a)};document.addEventListener("focusin",m),document.addEventListener("focusout",x);const b=new MutationObserver(y);return a&&b.observe(a,{childList:!0,subtree:!0}),()=>{document.removeEventListener("focusin",m),document.removeEventListener("focusout",x),b.disconnect()}}},[r,a,g.paused]),C.useEffect(()=>{if(a){H9.add(g);const m=document.activeElement;if(!a.contains(m)){const y=new CustomEvent(f4,U9);a.addEventListener(f4,d),a.dispatchEvent(y),y.defaultPrevented||(uke(mke(pre(a)),{select:!0}),document.activeElement===m&&rh(a))}return()=>{a.removeEventListener(f4,d),setTimeout(()=>{const y=new CustomEvent(h4,U9);a.addEventListener(h4,h),a.dispatchEvent(y),y.defaultPrevented||rh(m??document.body,{select:!0}),a.removeEventListener(h4,h),H9.remove(g)},0)}}},[a,d,h,g]);const v=C.useCallback(m=>{if(!n&&!r||g.paused)return;const x=m.key==="Tab"&&!m.altKey&&!m.ctrlKey&&!m.metaKey,y=document.activeElement;if(x&&y){const b=m.currentTarget,[w,E]=dke(b);w&&E?!m.shiftKey&&y===E?(m.preventDefault(),n&&rh(w,{select:!0})):m.shiftKey&&y===w&&(m.preventDefault(),n&&rh(E,{select:!0})):y===b&&m.preventDefault()}},[n,r,g.paused]);return _.jsx(Gf.div,{tabIndex:-1,...o,ref:f,onKeyDown:v})});hre.displayName=cke;function uke(e,{select:t=!1}={}){const n=document.activeElement;for(const r of e)if(rh(r,{select:t}),document.activeElement!==n)return}function dke(e){const t=pre(e),n=V9(t,e),r=V9(t.reverse(),e);return[n,r]}function pre(e){const t=[],n=document.createTreeWalker(e,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();)t.push(n.currentNode);return t}function V9(e,t){for(const n of e)if(!fke(n,{upTo:t}))return n}function fke(e,{upTo:t}){if(getComputedStyle(e).visibility==="hidden")return!0;for(;e;){if(t!==void 0&&e===t)return!1;if(getComputedStyle(e).display==="none")return!0;e=e.parentElement}return!1}function hke(e){return e instanceof HTMLInputElement&&"select"in e}function rh(e,{select:t=!1}={}){if(e&&e.focus){const n=document.activeElement;e.focus({preventScroll:!0}),e!==n&&hke(e)&&t&&e.select()}}var H9=pke();function pke(){let e=[];return{add(t){const n=e[0];t!==n&&(n==null||n.pause()),e=W9(e,t),e.unshift(t)},remove(t){var n;e=W9(e,t),(n=e[0])==null||n.resume()}}}function W9(e,t){const n=[...e],r=n.indexOf(t);return r!==-1&&n.splice(r,1),n}function mke(e){return e.filter(t=>t.tagName!=="A")}var gke="Portal",mre=C.forwardRef((e,t)=>{var a;const{container:n,...r}=e,[s,i]=C.useState(!1);Rr(()=>i(!0),[]);const o=n||s&&((a=globalThis==null?void 0:globalThis.document)==null?void 0:a.body);return o?kA.createPortal(_.jsx(Gf.div,{...r,ref:t}),o):null});mre.displayName=gke;function vke(e,t){return C.useReducer((n,r)=>t[n][r]??n,e)}var KD=e=>{const{present:t,children:n}=e,r=yke(t),s=typeof n=="function"?n({present:r.isPresent}):C.Children.only(n),i=my(r.ref,bke(s));return typeof n=="function"||r.isPresent?C.cloneElement(s,{ref:i}):null};KD.displayName="Presence";function yke(e){const[t,n]=C.useState(),r=C.useRef({}),s=C.useRef(e),i=C.useRef("none"),o=e?"mounted":"unmounted",[a,c]=vke(o,{mounted:{UNMOUNT:"unmounted",ANIMATION_OUT:"unmountSuspended"},unmountSuspended:{MOUNT:"mounted",ANIMATION_END:"unmounted"},unmounted:{MOUNT:"mounted"}});return C.useEffect(()=>{const d=aP(r.current);i.current=a==="mounted"?d:"none"},[a]),Rr(()=>{const d=r.current,h=s.current;if(h!==e){const f=i.current,g=aP(d);e?c("MOUNT"):g==="none"||(d==null?void 0:d.display)==="none"?c("UNMOUNT"):c(h&&f!==g?"ANIMATION_OUT":"UNMOUNT"),s.current=e}},[e,c]),Rr(()=>{if(t){let d;const h=t.ownerDocument.defaultView??window,u=g=>{const m=aP(r.current).includes(g.animationName);if(g.target===t&&m&&(c("ANIMATION_END"),!s.current)){const x=t.style.animationFillMode;t.style.animationFillMode="forwards",d=h.setTimeout(()=>{t.style.animationFillMode==="forwards"&&(t.style.animationFillMode=x)})}},f=g=>{g.target===t&&(i.current=aP(r.current))};return t.addEventListener("animationstart",f),t.addEventListener("animationcancel",u),t.addEventListener("animationend",u),()=>{h.clearTimeout(d),t.removeEventListener("animationstart",f),t.removeEventListener("animationcancel",u),t.removeEventListener("animationend",u)}}else c("ANIMATION_END")},[t,c]),{isPresent:["mounted","unmountSuspended"].includes(a),ref:C.useCallback(d=>{d&&(r.current=getComputedStyle(d)),n(d)},[])}}function aP(e){return(e==null?void 0:e.animationName)||"none"}function bke(e){var r,s;let t=(r=Object.getOwnPropertyDescriptor(e.props,"ref"))==null?void 0:r.get,n=t&&"isReactWarning"in t&&t.isReactWarning;return n?e.ref:(t=(s=Object.getOwnPropertyDescriptor(e,"ref"))==null?void 0:s.get,n=t&&"isReactWarning"in t&&t.isReactWarning,n?e.props.ref:e.props.ref||e.ref)}var p4=0;function xke(){C.useEffect(()=>{const e=document.querySelectorAll("[data-radix-focus-guard]");return document.body.insertAdjacentElement("afterbegin",e[0]??q9()),document.body.insertAdjacentElement("beforeend",e[1]??q9()),p4++,()=>{p4===1&&document.querySelectorAll("[data-radix-focus-guard]").forEach(t=>t.remove()),p4--}},[])}function q9(){const e=document.createElement("span");return e.setAttribute("data-radix-focus-guard",""),e.tabIndex=0,e.style.outline="none",e.style.opacity="0",e.style.position="fixed",e.style.pointerEvents="none",e}var gre=UH(),m4=function(){},YD=C.forwardRef(function(e,t){var n=C.useRef(null),r=C.useState({onScrollCapture:m4,onWheelCapture:m4,onTouchMoveCapture:m4}),s=r[0],i=r[1],o=e.forwardProps,a=e.children,c=e.className,d=e.removeScrollBar,h=e.enabled,u=e.shards,f=e.sideCar,g=e.noIsolation,v=e.inert,m=e.allowPinchZoom,x=e.as,y=x===void 0?"div":x,b=e.gapMode,w=dD(e,["forwardProps","children","className","removeScrollBar","enabled","shards","sideCar","noIsolation","inert","allowPinchZoom","as","gapMode"]),E=f,R=BH([n,t]),T=fs(fs({},w),s);return C.createElement(C.Fragment,null,h&&C.createElement(E,{sideCar:gre,removeScrollBar:d,shards:u,noIsolation:g,inert:v,setCallbacks:i,allowPinchZoom:!!m,lockRef:n,gapMode:b}),o?C.cloneElement(C.Children.only(a),fs(fs({},T),{ref:R})):C.createElement(y,fs({},T,{className:c,ref:R}),a))});YD.defaultProps={enabled:!0,removeScrollBar:!0,inert:!1};YD.classNames={fullWidth:Nb,zeroRight:Pb};var tU=!1;if(typeof window<"u")try{var lP=Object.defineProperty({},"passive",{get:function(){return tU=!0,!0}});window.addEventListener("test",lP,lP),window.removeEventListener("test",lP,lP)}catch{tU=!1}var Iy=tU?{passive:!1}:!1,_ke=function(e){return e.tagName==="TEXTAREA"},vre=function(e,t){if(!(e instanceof Element))return!1;var n=window.getComputedStyle(e);return n[t]!=="hidden"&&!(n.overflowY===n.overflowX&&!_ke(e)&&n[t]==="visible")},wke=function(e){return vre(e,"overflowY")},Ske=function(e){return vre(e,"overflowX")},G9=function(e,t){var n=t.ownerDocument,r=t;do{typeof ShadowRoot<"u"&&r instanceof ShadowRoot&&(r=r.host);var s=yre(e,r);if(s){var i=bre(e,r),o=i[1],a=i[2];if(o>a)return!0}r=r.parentNode}while(r&&r!==n.body);return!1},Cke=function(e){var t=e.scrollTop,n=e.scrollHeight,r=e.clientHeight;return[t,n,r]},Eke=function(e){var t=e.scrollLeft,n=e.scrollWidth,r=e.clientWidth;return[t,n,r]},yre=function(e,t){return e==="v"?wke(t):Ske(t)},bre=function(e,t){return e==="v"?Cke(t):Eke(t)},Ake=function(e,t){return e==="h"&&t==="rtl"?-1:1},Rke=function(e,t,n,r,s){var i=Ake(e,window.getComputedStyle(t).direction),o=i*r,a=n.target,c=t.contains(a),d=!1,h=o>0,u=0,f=0;do{var g=bre(e,a),v=g[0],m=g[1],x=g[2],y=m-x-i*v;(v||y)&&yre(e,a)&&(u+=y,f+=v),a instanceof ShadowRoot?a=a.host:a=a.parentNode}while(!c&&a!==document.body||c&&(t.contains(a)||t===a));return(h&&Math.abs(u)<1||!h&&Math.abs(f)<1)&&(d=!0),d},cP=function(e){return"changedTouches"in e?[e.changedTouches[0].clientX,e.changedTouches[0].clientY]:[0,0]},K9=function(e){return[e.deltaX,e.deltaY]},Y9=function(e){return e&&"current"in e?e.current:e},Pke=function(e,t){return e[0]===t[0]&&e[1]===t[1]},Nke=function(e){return`
|
||
.block-interactivity-`.concat(e,` {pointer-events: none;}
|
||
.allow-interactivity-`).concat(e,` {pointer-events: all;}
|
||
`)},Tke=0,Ly=[];function kke(e){var t=C.useRef([]),n=C.useRef([0,0]),r=C.useRef(),s=C.useState(Tke++)[0],i=C.useState(hD)[0],o=C.useRef(e);C.useEffect(function(){o.current=e},[e]),C.useEffect(function(){if(e.inert){document.body.classList.add("block-interactivity-".concat(s));var m=zH([e.lockRef.current],(e.shards||[]).map(Y9),!0).filter(Boolean);return m.forEach(function(x){return x.classList.add("allow-interactivity-".concat(s))}),function(){document.body.classList.remove("block-interactivity-".concat(s)),m.forEach(function(x){return x.classList.remove("allow-interactivity-".concat(s))})}}},[e.inert,e.lockRef.current,e.shards]);var a=C.useCallback(function(m,x){if("touches"in m&&m.touches.length===2||m.type==="wheel"&&m.ctrlKey)return!o.current.allowPinchZoom;var y=cP(m),b=n.current,w="deltaX"in m?m.deltaX:b[0]-y[0],E="deltaY"in m?m.deltaY:b[1]-y[1],R,T=m.target,N=Math.abs(w)>Math.abs(E)?"h":"v";if("touches"in m&&N==="h"&&T.type==="range")return!1;var A=G9(N,T);if(!A)return!0;if(A?R=N:(R=N==="v"?"h":"v",A=G9(N,T)),!A)return!1;if(!r.current&&"changedTouches"in m&&(w||E)&&(r.current=R),!R)return!0;var D=r.current||R;return Rke(D,x,m,D==="h"?w:E)},[]),c=C.useCallback(function(m){var x=m;if(!(!Ly.length||Ly[Ly.length-1]!==i)){var y="deltaY"in x?K9(x):cP(x),b=t.current.filter(function(R){return R.name===x.type&&(R.target===x.target||x.target===R.shadowParent)&&Pke(R.delta,y)})[0];if(b&&b.should){x.cancelable&&x.preventDefault();return}if(!b){var w=(o.current.shards||[]).map(Y9).filter(Boolean).filter(function(R){return R.contains(x.target)}),E=w.length>0?a(x,w[0]):!o.current.noIsolation;E&&x.cancelable&&x.preventDefault()}}},[]),d=C.useCallback(function(m,x,y,b){var w={name:m,delta:x,target:y,should:b,shadowParent:Dke(y)};t.current.push(w),setTimeout(function(){t.current=t.current.filter(function(E){return E!==w})},1)},[]),h=C.useCallback(function(m){n.current=cP(m),r.current=void 0},[]),u=C.useCallback(function(m){d(m.type,K9(m),m.target,a(m,e.lockRef.current))},[]),f=C.useCallback(function(m){d(m.type,cP(m),m.target,a(m,e.lockRef.current))},[]);C.useEffect(function(){return Ly.push(i),e.setCallbacks({onScrollCapture:u,onWheelCapture:u,onTouchMoveCapture:f}),document.addEventListener("wheel",c,Iy),document.addEventListener("touchmove",c,Iy),document.addEventListener("touchstart",h,Iy),function(){Ly=Ly.filter(function(m){return m!==i}),document.removeEventListener("wheel",c,Iy),document.removeEventListener("touchmove",c,Iy),document.removeEventListener("touchstart",h,Iy)}},[]);var g=e.removeScrollBar,v=e.inert;return C.createElement(C.Fragment,null,v?C.createElement(i,{styles:Nke(s)}):null,g?C.createElement(HH,{gapMode:e.gapMode}):null)}function Dke(e){for(var t=null;e!==null;)e instanceof ShadowRoot&&(t=e.host,e=e.host),e=e.parentNode;return t}const Oke=VH(gre,kke);var xre=C.forwardRef(function(e,t){return C.createElement(YD,fs({},e,{ref:t,sideCar:Oke}))});xre.classNames=YD.classNames;var n8="Dialog",[_re,d7e]=KTe(n8),[Mke,Mc]=_re(n8),wre=e=>{const{__scopeDialog:t,children:n,open:r,defaultOpen:s,onOpenChange:i,modal:o=!0}=e,a=C.useRef(null),c=C.useRef(null),[d=!1,h]=os({prop:r,defaultProp:s,onChange:i});return _.jsx(Mke,{scope:t,triggerRef:a,contentRef:c,contentId:si(),titleId:si(),descriptionId:si(),open:d,onOpenChange:h,onOpenToggle:C.useCallback(()=>h(u=>!u),[h]),modal:o,children:n})};wre.displayName=n8;var Sre="DialogTrigger",Ike=C.forwardRef((e,t)=>{const{__scopeDialog:n,...r}=e,s=Mc(Sre,n),i=my(t,s.triggerRef);return _.jsx(Gf.button,{type:"button","aria-haspopup":"dialog","aria-expanded":s.open,"aria-controls":s.contentId,"data-state":i8(s.open),...r,ref:i,onClick:cp(e.onClick,s.onOpenToggle)})});Ike.displayName=Sre;var r8="DialogPortal",[Lke,Cre]=_re(r8,{forceMount:void 0}),Ere=e=>{const{__scopeDialog:t,forceMount:n,children:r,container:s}=e,i=Mc(r8,t);return _.jsx(Lke,{scope:t,forceMount:n,children:C.Children.map(r,o=>_.jsx(KD,{present:n||i.open,children:_.jsx(mre,{asChild:!0,container:s,children:o})}))})};Ere.displayName=r8;var AT="DialogOverlay",Are=C.forwardRef((e,t)=>{const n=Cre(AT,e.__scopeDialog),{forceMount:r=n.forceMount,...s}=e,i=Mc(AT,e.__scopeDialog);return i.modal?_.jsx(KD,{present:r||i.open,children:_.jsx(jke,{...s,ref:t})}):null});Are.displayName=AT;var jke=C.forwardRef((e,t)=>{const{__scopeDialog:n,...r}=e,s=Mc(AT,n);return _.jsx(xre,{as:t8,allowPinchZoom:!0,shards:[s.contentRef],children:_.jsx(Gf.div,{"data-state":i8(s.open),...r,ref:t,style:{pointerEvents:"auto",...r.style}})})}),Wv="DialogContent",Rre=C.forwardRef((e,t)=>{const n=Cre(Wv,e.__scopeDialog),{forceMount:r=n.forceMount,...s}=e,i=Mc(Wv,e.__scopeDialog);return _.jsx(KD,{present:r||i.open,children:i.modal?_.jsx($ke,{...s,ref:t}):_.jsx(Fke,{...s,ref:t})})});Rre.displayName=Wv;var $ke=C.forwardRef((e,t)=>{const n=Mc(Wv,e.__scopeDialog),r=C.useRef(null),s=my(t,n.contentRef,r);return C.useEffect(()=>{const i=r.current;if(i)return Ox(i)},[]),_.jsx(Pre,{...e,ref:s,trapFocus:n.open,disableOutsidePointerEvents:!0,onCloseAutoFocus:cp(e.onCloseAutoFocus,i=>{var o;i.preventDefault(),(o=n.triggerRef.current)==null||o.focus()}),onPointerDownOutside:cp(e.onPointerDownOutside,i=>{const o=i.detail.originalEvent,a=o.button===0&&o.ctrlKey===!0;(o.button===2||a)&&i.preventDefault()}),onFocusOutside:cp(e.onFocusOutside,i=>i.preventDefault())})}),Fke=C.forwardRef((e,t)=>{const n=Mc(Wv,e.__scopeDialog),r=C.useRef(!1),s=C.useRef(!1);return _.jsx(Pre,{...e,ref:t,trapFocus:!1,disableOutsidePointerEvents:!1,onCloseAutoFocus:i=>{var o,a;(o=e.onCloseAutoFocus)==null||o.call(e,i),i.defaultPrevented||(r.current||(a=n.triggerRef.current)==null||a.focus(),i.preventDefault()),r.current=!1,s.current=!1},onInteractOutside:i=>{var c,d;(c=e.onInteractOutside)==null||c.call(e,i),i.defaultPrevented||(r.current=!0,i.detail.originalEvent.type==="pointerdown"&&(s.current=!0));const o=i.target;((d=n.triggerRef.current)==null?void 0:d.contains(o))&&i.preventDefault(),i.detail.originalEvent.type==="focusin"&&s.current&&i.preventDefault()}})}),Pre=C.forwardRef((e,t)=>{const{__scopeDialog:n,trapFocus:r,onOpenAutoFocus:s,onCloseAutoFocus:i,...o}=e,a=Mc(Wv,n),c=C.useRef(null),d=my(t,c);return xke(),_.jsxs(_.Fragment,{children:[_.jsx(hre,{asChild:!0,loop:!0,trapped:r,onMountAutoFocus:s,onUnmountAutoFocus:i,children:_.jsx(dre,{role:"dialog",id:a.contentId,"aria-describedby":a.descriptionId,"aria-labelledby":a.titleId,"data-state":i8(a.open),...o,ref:d,onDismiss:()=>a.onOpenChange(!1)})}),_.jsxs(_.Fragment,{children:[_.jsx(zke,{titleId:a.titleId}),_.jsx(Uke,{contentRef:c,descriptionId:a.descriptionId})]})]})}),s8="DialogTitle",Nre=C.forwardRef((e,t)=>{const{__scopeDialog:n,...r}=e,s=Mc(s8,n);return _.jsx(Gf.h2,{id:s.titleId,...r,ref:t})});Nre.displayName=s8;var Tre="DialogDescription",kre=C.forwardRef((e,t)=>{const{__scopeDialog:n,...r}=e,s=Mc(Tre,n);return _.jsx(Gf.p,{id:s.descriptionId,...r,ref:t})});kre.displayName=Tre;var Dre="DialogClose",Ore=C.forwardRef((e,t)=>{const{__scopeDialog:n,...r}=e,s=Mc(Dre,n);return _.jsx(Gf.button,{type:"button",...r,ref:t,onClick:cp(e.onClick,()=>s.onOpenChange(!1))})});Ore.displayName=Dre;function i8(e){return e?"open":"closed"}var Mre="DialogTitleWarning",[f7e,Ire]=GTe(Mre,{contentName:Wv,titleName:s8,docsSlug:"dialog"}),zke=({titleId:e})=>{const t=Ire(Mre),n=`\`${t.contentName}\` requires a \`${t.titleName}\` for the component to be accessible for screen reader users.
|
||
|
||
If you want to hide the \`${t.titleName}\`, you can wrap it with our VisuallyHidden component.
|
||
|
||
For more information, see https://radix-ui.com/primitives/docs/components/${t.docsSlug}`;return C.useEffect(()=>{e&&(document.getElementById(e)||console.error(n))},[n,e]),null},Bke="DialogDescriptionWarning",Uke=({contentRef:e,descriptionId:t})=>{const r=`Warning: Missing \`Description\` or \`aria-describedby={undefined}\` for {${Ire(Bke).contentName}}.`;return C.useEffect(()=>{var i;const s=(i=e.current)==null?void 0:i.getAttribute("aria-describedby");t&&s&&(document.getElementById(t)||console.warn(r))},[r,e,t]),null},Vke=wre,Hke=Ere,Wke=Are,qke=Rre,Gke=Nre,Kke=kre,Yke=Ore;function Xke(e){if(typeof document>"u")return;let t=document.head||document.getElementsByTagName("head")[0],n=document.createElement("style");n.type="text/css",t.appendChild(n),n.styleSheet?n.styleSheet.cssText=e:n.appendChild(document.createTextNode(e))}const Lre=fe.createContext({drawerRef:{current:null},overlayRef:{current:null},onPress:()=>{},onRelease:()=>{},onDrag:()=>{},onNestedDrag:()=>{},onNestedOpenChange:()=>{},onNestedRelease:()=>{},openProp:void 0,dismissible:!1,isOpen:!1,isDragging:!1,keyboardIsOpen:{current:!1},snapPointsOffset:null,snapPoints:null,handleOnly:!1,modal:!1,shouldFade:!1,activeSnapPoint:null,onOpenChange:()=>{},setActiveSnapPoint:()=>{},closeDrawer:()=>{},direction:"bottom",shouldScaleBackground:!1,setBackgroundColorOnScale:!0,noBodyStyles:!1,container:null,autoFocus:!1}),nR=()=>{const e=fe.useContext(Lre);if(!e)throw new Error("useDrawerContext must be used within a Drawer.Root");return e};Xke(`[data-vaul-drawer]{touch-action:none;will-change:transform;transition:transform .5s cubic-bezier(.32, .72, 0, 1);animation-duration:.5s;animation-timing-function:cubic-bezier(0.32,0.72,0,1)}[data-vaul-drawer][data-vaul-snap-points=false][data-vaul-drawer-direction=bottom][data-state=open]{animation-name:slideFromBottom}[data-vaul-drawer][data-vaul-snap-points=false][data-vaul-drawer-direction=bottom][data-state=closed]{animation-name:slideToBottom}[data-vaul-drawer][data-vaul-snap-points=false][data-vaul-drawer-direction=top][data-state=open]{animation-name:slideFromTop}[data-vaul-drawer][data-vaul-snap-points=false][data-vaul-drawer-direction=top][data-state=closed]{animation-name:slideToTop}[data-vaul-drawer][data-vaul-snap-points=false][data-vaul-drawer-direction=left][data-state=open]{animation-name:slideFromLeft}[data-vaul-drawer][data-vaul-snap-points=false][data-vaul-drawer-direction=left][data-state=closed]{animation-name:slideToLeft}[data-vaul-drawer][data-vaul-snap-points=false][data-vaul-drawer-direction=right][data-state=open]{animation-name:slideFromRight}[data-vaul-drawer][data-vaul-snap-points=false][data-vaul-drawer-direction=right][data-state=closed]{animation-name:slideToRight}[data-vaul-drawer][data-vaul-snap-points=true][data-vaul-drawer-direction=bottom]{transform:translate3d(0,100%,0)}[data-vaul-drawer][data-vaul-snap-points=true][data-vaul-drawer-direction=top]{transform:translate3d(0,-100%,0)}[data-vaul-drawer][data-vaul-snap-points=true][data-vaul-drawer-direction=left]{transform:translate3d(-100%,0,0)}[data-vaul-drawer][data-vaul-snap-points=true][data-vaul-drawer-direction=right]{transform:translate3d(100%,0,0)}[data-vaul-drawer][data-vaul-delayed-snap-points=true][data-vaul-drawer-direction=top]{transform:translate3d(0,var(--snap-point-height,0),0)}[data-vaul-drawer][data-vaul-delayed-snap-points=true][data-vaul-drawer-direction=bottom]{transform:translate3d(0,var(--snap-point-height,0),0)}[data-vaul-drawer][data-vaul-delayed-snap-points=true][data-vaul-drawer-direction=left]{transform:translate3d(var(--snap-point-height,0),0,0)}[data-vaul-drawer][data-vaul-delayed-snap-points=true][data-vaul-drawer-direction=right]{transform:translate3d(var(--snap-point-height,0),0,0)}[data-vaul-overlay][data-vaul-snap-points=false]{animation-duration:.5s;animation-timing-function:cubic-bezier(0.32,0.72,0,1)}[data-vaul-overlay][data-vaul-snap-points=false][data-state=open]{animation-name:fadeIn}[data-vaul-overlay][data-state=closed]{animation-name:fadeOut}[data-vaul-overlay][data-vaul-snap-points=true]{opacity:0;transition:opacity .5s cubic-bezier(.32, .72, 0, 1)}[data-vaul-overlay][data-vaul-snap-points=true]{opacity:1}[data-vaul-drawer]:not([data-vaul-custom-container=true])::after{content:'';position:absolute;background:inherit;background-color:inherit}[data-vaul-drawer][data-vaul-drawer-direction=top]::after{top:initial;bottom:100%;left:0;right:0;height:200%}[data-vaul-drawer][data-vaul-drawer-direction=bottom]::after{top:100%;bottom:initial;left:0;right:0;height:200%}[data-vaul-drawer][data-vaul-drawer-direction=left]::after{left:initial;right:100%;top:0;bottom:0;width:200%}[data-vaul-drawer][data-vaul-drawer-direction=right]::after{left:100%;right:initial;top:0;bottom:0;width:200%}[data-vaul-overlay][data-vaul-snap-points=true]:not([data-vaul-snap-points-overlay=true]):not(
|
||
[data-state=closed]
|
||
){opacity:0}[data-vaul-overlay][data-vaul-snap-points-overlay=true]{opacity:1}[data-vaul-handle]{display:block;position:relative;opacity:.7;background:#e2e2e4;margin-left:auto;margin-right:auto;height:5px;width:32px;border-radius:1rem;touch-action:pan-y}[data-vaul-handle]:active,[data-vaul-handle]:hover{opacity:1}[data-vaul-handle-hitarea]{position:absolute;left:50%;top:50%;transform:translate(-50%,-50%);width:max(100%,2.75rem);height:max(100%,2.75rem);touch-action:inherit}@media (hover:hover) and (pointer:fine){[data-vaul-drawer]{user-select:none}}@media (pointer:fine){[data-vaul-handle-hitarea]:{width:100%;height:100%}}@keyframes fadeIn{from{opacity:0}to{opacity:1}}@keyframes fadeOut{to{opacity:0}}@keyframes slideFromBottom{from{transform:translate3d(0,100%,0)}to{transform:translate3d(0,0,0)}}@keyframes slideToBottom{to{transform:translate3d(0,100%,0)}}@keyframes slideFromTop{from{transform:translate3d(0,-100%,0)}to{transform:translate3d(0,0,0)}}@keyframes slideToTop{to{transform:translate3d(0,-100%,0)}}@keyframes slideFromLeft{from{transform:translate3d(-100%,0,0)}to{transform:translate3d(0,0,0)}}@keyframes slideToLeft{to{transform:translate3d(-100%,0,0)}}@keyframes slideFromRight{from{transform:translate3d(100%,0,0)}to{transform:translate3d(0,0,0)}}@keyframes slideToRight{to{transform:translate3d(100%,0,0)}}`);const Qke=24,Zke=typeof window<"u"?C.useLayoutEffect:C.useEffect;function X9(...e){return(...t)=>{for(let n of e)typeof n=="function"&&n(...t)}}function Jke(){return o8(/^Mac/)}function eDe(){return o8(/^iPhone/)}function Q9(){return/^((?!chrome|android).)*safari/i.test(navigator.userAgent)}function tDe(){return o8(/^iPad/)||Jke()&&navigator.maxTouchPoints>1}function jre(){return eDe()||tDe()}function o8(e){return typeof window<"u"&&window.navigator!=null?e.test(window.navigator.platform):void 0}const g4=typeof document<"u"&&window.visualViewport;function Z9(e){let t=window.getComputedStyle(e);return/(auto|scroll)/.test(t.overflow+t.overflowX+t.overflowY)}function $re(e){for(Z9(e)&&(e=e.parentElement);e&&!Z9(e);)e=e.parentElement;return e||document.scrollingElement||document.documentElement}const nDe=new Set(["checkbox","radio","range","color","file","image","button","submit","reset"]);let uP=0,v4;function rDe(e={}){let{isDisabled:t}=e;Zke(()=>{if(!t)return uP++,uP===1&&jre()&&(v4=sDe()),()=>{uP--,uP===0&&(v4==null||v4())}},[t])}function sDe(){let e,t=0,n=u=>{e=$re(u.target),!(e===document.documentElement&&e===document.body)&&(t=u.changedTouches[0].pageY)},r=u=>{if(!e||e===document.documentElement||e===document.body){u.preventDefault();return}let f=u.changedTouches[0].pageY,g=e.scrollTop,v=e.scrollHeight-e.clientHeight;v!==0&&((g<=0&&f>t||g>=v&&f<t)&&u.preventDefault(),t=f)},s=u=>{let f=u.target;nU(f)&&f!==document.activeElement&&(u.preventDefault(),f.style.transform="translateY(-2000px)",f.focus(),requestAnimationFrame(()=>{f.style.transform=""}))},i=u=>{let f=u.target;nU(f)&&(f.style.transform="translateY(-2000px)",requestAnimationFrame(()=>{f.style.transform="",g4&&(g4.height<window.innerHeight?requestAnimationFrame(()=>{J9(f)}):g4.addEventListener("resize",()=>J9(f),{once:!0}))}))},o=()=>{window.scrollTo(0,0)},a=window.pageXOffset,c=window.pageYOffset,d=X9(iDe(document.documentElement,"paddingRight",`${window.innerWidth-document.documentElement.clientWidth}px`));window.scrollTo(0,0);let h=X9(FS(document,"touchstart",n,{passive:!1,capture:!0}),FS(document,"touchmove",r,{passive:!1,capture:!0}),FS(document,"touchend",s,{passive:!1,capture:!0}),FS(document,"focus",i,!0),FS(window,"scroll",o));return()=>{d(),h(),window.scrollTo(a,c)}}function iDe(e,t,n){let r=e.style[t];return e.style[t]=n,()=>{e.style[t]=r}}function FS(e,t,n,r){return e.addEventListener(t,n,r),()=>{e.removeEventListener(t,n,r)}}function J9(e){let t=document.scrollingElement||document.documentElement;for(;e&&e!==t;){let n=$re(e);if(n!==document.documentElement&&n!==document.body&&n!==e){let r=n.getBoundingClientRect().top,s=e.getBoundingClientRect().top,i=e.getBoundingClientRect().bottom;const o=n.getBoundingClientRect().bottom+Qke;i>o&&(n.scrollTop+=s-r)}e=n.parentElement}}function nU(e){return e instanceof HTMLInputElement&&!nDe.has(e.type)||e instanceof HTMLTextAreaElement||e instanceof HTMLElement&&e.isContentEditable}function oDe(e,t){typeof e=="function"?e(t):e!=null&&(e.current=t)}function aDe(...e){return t=>e.forEach(n=>oDe(n,t))}function Fre(...e){return C.useCallback(aDe(...e),e)}const zre=new WeakMap;function Ys(e,t,n=!1){if(!e||!(e instanceof HTMLElement))return;let r={};Object.entries(t).forEach(([s,i])=>{if(s.startsWith("--")){e.style.setProperty(s,i);return}r[s]=e.style[s],e.style[s]=i}),!n&&zre.set(e,r)}function lDe(e,t){if(!e||!(e instanceof HTMLElement))return;let n=zre.get(e);n&&(e.style[t]=n[t])}const Xs=e=>{switch(e){case"top":case"bottom":return!0;case"left":case"right":return!1;default:return e}};function dP(e,t){if(!e)return null;const n=window.getComputedStyle(e),r=n.transform||n.webkitTransform||n.mozTransform;let s=r.match(/^matrix3d\((.+)\)$/);return s?parseFloat(s[1].split(", ")[Xs(t)?13:12]):(s=r.match(/^matrix\((.+)\)$/),s?parseFloat(s[1].split(", ")[Xs(t)?5:4]):null)}function cDe(e){return 8*(Math.log(e+1)-2)}function y4(e,t){if(!e)return()=>{};const n=e.style.cssText;return Object.assign(e.style,t),()=>{e.style.cssText=n}}function uDe(...e){return(...t)=>{for(const n of e)typeof n=="function"&&n(...t)}}const ns={DURATION:.5,EASE:[.32,.72,0,1]},Bre=.4,dDe=.25,fDe=100,Ure=8,fP=16,rU=26,b4="vaul-dragging";function Vre(e){const t=fe.useRef(e);return fe.useEffect(()=>{t.current=e}),fe.useMemo(()=>(...n)=>t.current==null?void 0:t.current.call(t,...n),[])}function hDe({defaultProp:e,onChange:t}){const n=fe.useState(e),[r]=n,s=fe.useRef(r),i=Vre(t);return fe.useEffect(()=>{s.current!==r&&(i(r),s.current=r)},[r,s,i]),n}function Hre({prop:e,defaultProp:t,onChange:n=()=>{}}){const[r,s]=hDe({defaultProp:t,onChange:n}),i=e!==void 0,o=i?e:r,a=Vre(n),c=fe.useCallback(d=>{if(i){const u=typeof d=="function"?d(e):d;u!==e&&a(u)}else s(d)},[i,e,s,a]);return[o,c]}function pDe({activeSnapPointProp:e,setActiveSnapPointProp:t,snapPoints:n,drawerRef:r,overlayRef:s,fadeFromIndex:i,onSnapPointChange:o,direction:a="bottom",container:c,snapToSequentialPoint:d}){const[h,u]=Hre({prop:e,defaultProp:n==null?void 0:n[0],onChange:t}),[f,g]=fe.useState(typeof window<"u"?{innerWidth:window.innerWidth,innerHeight:window.innerHeight}:void 0);fe.useEffect(()=>{function N(){g({innerWidth:window.innerWidth,innerHeight:window.innerHeight})}return window.addEventListener("resize",N),()=>window.removeEventListener("resize",N)},[]);const v=fe.useMemo(()=>h===(n==null?void 0:n[n.length-1])||null,[n,h]),m=fe.useMemo(()=>n==null?void 0:n.findIndex(N=>N===h),[n,h]),x=n&&n.length>0&&(i||i===0)&&!Number.isNaN(i)&&n[i]===h||!n,y=fe.useMemo(()=>{const N=c?{width:c.getBoundingClientRect().width,height:c.getBoundingClientRect().height}:typeof window<"u"?{width:window.innerWidth,height:window.innerHeight}:{width:0,height:0};var A;return(A=n==null?void 0:n.map(D=>{const O=typeof D=="string";let I=0;if(O&&(I=parseInt(D,10)),Xs(a)){const F=O?I:f?D*N.height:0;return f?a==="bottom"?N.height-F:-N.height+F:F}const $=O?I:f?D*N.width:0;return f?a==="right"?N.width-$:-N.width+$:$}))!=null?A:[]},[n,f,c]),b=fe.useMemo(()=>m!==null?y==null?void 0:y[m]:null,[y,m]),w=fe.useCallback(N=>{var A;const D=(A=y==null?void 0:y.findIndex(O=>O===N))!=null?A:null;o(D),Ys(r.current,{transition:`transform ${ns.DURATION}s cubic-bezier(${ns.EASE.join(",")})`,transform:Xs(a)?`translate3d(0, ${N}px, 0)`:`translate3d(${N}px, 0, 0)`}),y&&D!==y.length-1&&D!==i&&D<i?Ys(s.current,{transition:`opacity ${ns.DURATION}s cubic-bezier(${ns.EASE.join(",")})`,opacity:"0"}):Ys(s.current,{transition:`opacity ${ns.DURATION}s cubic-bezier(${ns.EASE.join(",")})`,opacity:"1"}),u(n==null?void 0:n[Math.max(D,0)])},[r.current,n,y,i,s,u]);fe.useEffect(()=>{if(h||e){var N;const A=(N=n==null?void 0:n.findIndex(D=>D===e||D===h))!=null?N:-1;y&&A!==-1&&typeof y[A]=="number"&&w(y[A])}},[h,e,n,y,w]);function E({draggedDistance:N,closeDrawer:A,velocity:D,dismissible:O}){if(i===void 0)return;const I=a==="bottom"||a==="right"?(b??0)-N:(b??0)+N,$=m===i-1,F=m===0,B=N>0;if($&&Ys(s.current,{transition:`opacity ${ns.DURATION}s cubic-bezier(${ns.EASE.join(",")})`}),!d&&D>2&&!B){O?A():w(y[0]);return}if(!d&&D>2&&B&&y&&n){w(y[n.length-1]);return}const W=y==null?void 0:y.reduce((Y,H)=>typeof Y!="number"||typeof H!="number"?Y:Math.abs(H-I)<Math.abs(Y-I)?H:Y),Z=Xs(a)?window.innerHeight:window.innerWidth;if(D>Bre&&Math.abs(N)<Z*.4){const Y=B?1:-1;if(Y>0&&v){w(y[n.length-1]);return}if(F&&Y<0&&O&&A(),m===null)return;w(y[m+Y]);return}w(W)}function R({draggedDistance:N}){if(b===null)return;const A=a==="bottom"||a==="right"?b-N:b+N;(a==="bottom"||a==="right")&&A<y[y.length-1]||(a==="top"||a==="left")&&A>y[y.length-1]||Ys(r.current,{transform:Xs(a)?`translate3d(0, ${A}px, 0)`:`translate3d(${A}px, 0, 0)`})}function T(N,A){if(!n||typeof m!="number"||!y||i===void 0)return null;const D=m===i-1;if(m>=i&&A)return 0;if(D&&!A)return 1;if(!x&&!D)return null;const I=D?m+1:m-1,$=D?y[I]-y[I-1]:y[I+1]-y[I],F=N/Math.abs($);return D?1-F:F}return{isLastSnapPoint:v,activeSnapPoint:h,shouldFade:x,getPercentageDragged:T,setActiveSnapPoint:u,activeSnapPointIndex:m,onRelease:E,onDrag:R,snapPointsOffset:y}}const mDe=()=>()=>{};function gDe(){const{direction:e,isOpen:t,shouldScaleBackground:n,setBackgroundColorOnScale:r,noBodyStyles:s}=nR(),i=fe.useRef(null),o=C.useMemo(()=>document.body.style.backgroundColor,[]);function a(){return(window.innerWidth-rU)/window.innerWidth}fe.useEffect(()=>{if(t&&n){i.current&&clearTimeout(i.current);const c=document.querySelector("[data-vaul-drawer-wrapper]")||document.querySelector("[vaul-drawer-wrapper]");if(!c)return;uDe(r&&!s?y4(document.body,{background:"black"}):mDe,y4(c,{transformOrigin:Xs(e)?"top":"left",transitionProperty:"transform, border-radius",transitionDuration:`${ns.DURATION}s`,transitionTimingFunction:`cubic-bezier(${ns.EASE.join(",")})`}));const d=y4(c,{borderRadius:`${Ure}px`,overflow:"hidden",...Xs(e)?{transform:`scale(${a()}) translate3d(0, calc(env(safe-area-inset-top) + 14px), 0)`}:{transform:`scale(${a()}) translate3d(calc(env(safe-area-inset-top) + 14px), 0, 0)`}});return()=>{d(),i.current=window.setTimeout(()=>{o?document.body.style.background=o:document.body.style.removeProperty("background")},ns.DURATION*1e3)}}},[t,n,o])}let zS=null;function vDe({isOpen:e,modal:t,nested:n,hasBeenOpened:r,preventScrollRestoration:s,noBodyStyles:i}){const[o,a]=fe.useState(()=>typeof window<"u"?window.location.href:""),c=fe.useRef(0),d=fe.useCallback(()=>{if(Q9()&&zS===null&&e&&!i){zS={position:document.body.style.position,top:document.body.style.top,left:document.body.style.left,height:document.body.style.height,right:"unset"};const{scrollX:u,innerHeight:f}=window;document.body.style.setProperty("position","fixed","important"),Object.assign(document.body.style,{top:`${-c.current}px`,left:`${-u}px`,right:"0px",height:"auto"}),window.setTimeout(()=>window.requestAnimationFrame(()=>{const g=f-window.innerHeight;g&&c.current>=f&&(document.body.style.top=`${-(c.current+g)}px`)}),300)}},[e]),h=fe.useCallback(()=>{if(Q9()&&zS!==null&&!i){const u=-parseInt(document.body.style.top,10),f=-parseInt(document.body.style.left,10);Object.assign(document.body.style,zS),window.requestAnimationFrame(()=>{if(s&&o!==window.location.href){a(window.location.href);return}window.scrollTo(f,u)}),zS=null}},[o]);return fe.useEffect(()=>{function u(){c.current=window.scrollY}return u(),window.addEventListener("scroll",u),()=>{window.removeEventListener("scroll",u)}},[]),fe.useEffect(()=>{n||!r||(e?(!window.matchMedia("(display-mode: standalone)").matches&&d(),t||window.setTimeout(()=>{h()},500)):h())},[e,r,o,t,n,d,h]),{restorePositionSetting:h}}function yDe({open:e,onOpenChange:t,children:n,onDrag:r,onRelease:s,snapPoints:i,shouldScaleBackground:o=!1,setBackgroundColorOnScale:a=!0,closeThreshold:c=dDe,scrollLockTimeout:d=fDe,dismissible:h=!0,handleOnly:u=!1,fadeFromIndex:f=i&&i.length-1,activeSnapPoint:g,setActiveSnapPoint:v,fixed:m,modal:x=!0,onClose:y,nested:b,noBodyStyles:w,direction:E="bottom",defaultOpen:R=!1,disablePreventScroll:T=!0,snapToSequentialPoint:N=!1,preventScrollRestoration:A=!1,repositionInputs:D=!0,onAnimationEnd:O,container:I,autoFocus:$=!1}){var F,B;const[W=!1,Z]=Hre({defaultProp:R,prop:e,onChange:Ze=>{t==null||t(Ze),!Ze&&!b&&we(),setTimeout(()=>{O==null||O(Ze)},ns.DURATION*1e3),Ze&&!x&&typeof window<"u"&&window.requestAnimationFrame(()=>{document.body.style.pointerEvents="auto"}),Ze||(document.body.style.pointerEvents="auto")}}),[Y,H]=fe.useState(!1),[se,he]=fe.useState(!1),[re,J]=fe.useState(!1),te=fe.useRef(null),ae=fe.useRef(null),be=fe.useRef(null),xe=fe.useRef(null),ve=fe.useRef(null),Pe=fe.useRef(!1),Oe=fe.useRef(null),ke=fe.useRef(0),ze=fe.useRef(!1),$e=fe.useRef(0),Te=fe.useRef(null),Ue=fe.useRef(((F=Te.current)==null?void 0:F.getBoundingClientRect().height)||0),wt=fe.useRef(((B=Te.current)==null?void 0:B.getBoundingClientRect().width)||0),ut=fe.useRef(0),St=fe.useCallback(Ze=>{i&&Ze===U.length-1&&(ae.current=new Date)},[]),{activeSnapPoint:Nn,activeSnapPointIndex:cn,setActiveSnapPoint:hn,onRelease:It,snapPointsOffset:U,onDrag:ee,shouldFade:ie,getPercentageDragged:_e}=pDe({snapPoints:i,activeSnapPointProp:g,setActiveSnapPointProp:v,drawerRef:Te,fadeFromIndex:f,overlayRef:te,onSnapPointChange:St,direction:E,container:I,snapToSequentialPoint:N});rDe({isDisabled:!W||se||!x||re||!Y||!D||!T});const{restorePositionSetting:we}=vDe({isOpen:W,modal:x,nested:b,hasBeenOpened:Y,preventScrollRestoration:A,noBodyStyles:w});function pe(){return(window.innerWidth-rU)/window.innerWidth}function Se(Ze){var Rt,Pt;!h&&!i||Te.current&&!Te.current.contains(Ze.target)||(Ue.current=((Rt=Te.current)==null?void 0:Rt.getBoundingClientRect().height)||0,wt.current=((Pt=Te.current)==null?void 0:Pt.getBoundingClientRect().width)||0,he(!0),be.current=new Date,jre()&&window.addEventListener("touchend",()=>Pe.current=!1,{once:!0}),Ze.target.setPointerCapture(Ze.pointerId),ke.current=Xs(E)?Ze.pageY:Ze.pageX)}function Fe(Ze,Rt){var Pt,Ut;let yt=Ze;const dn=(Pt=window.getSelection())==null?void 0:Pt.toString(),Gt=Te.current?dP(Te.current,E):null,Hn=new Date;if(yt.hasAttribute("data-vaul-no-drag")||yt.closest("[data-vaul-no-drag]"))return!1;if(E==="right"||E==="left")return!0;if(ae.current&&Hn.getTime()-ae.current.getTime()<500)return!1;if(Gt!==null&&(E==="bottom"?Gt>0:Gt<0))return!0;if(dn&&dn.length>0)return!1;if(Hn.getTime()-((Ut=ve.current)==null?void 0:Ut.getTime())<d&&Gt===0||Rt)return ve.current=Hn,!1;for(;yt;){if(yt.scrollHeight>yt.clientHeight){if(yt.scrollTop!==0)return ve.current=new Date,!1;if(yt.getAttribute("role")==="dialog")return!0}yt=yt.parentNode}return!0}function ft(Ze){if(Te.current&&se){const Rt=E==="bottom"||E==="right"?1:-1,Pt=(ke.current-(Xs(E)?Ze.pageY:Ze.pageX))*Rt,Ut=Pt>0,yt=i&&!h&&!Ut;if(yt&&cn===0)return;const dn=Math.abs(Pt),Gt=document.querySelector("[data-vaul-drawer-wrapper]"),Hn=E==="bottom"||E==="top"?Ue.current:wt.current;let In=dn/Hn;const Tn=_e(dn,Ut);if(Tn!==null&&(In=Tn),yt&&In>=1||!Pe.current&&!Fe(Ze.target,Ut))return;if(Te.current.classList.add(b4),Pe.current=!0,Ys(Te.current,{transition:"none"}),Ys(te.current,{transition:"none"}),i&&ee({draggedDistance:Pt}),Ut&&!i){const Kr=cDe(Pt),ir=Math.min(Kr*-1,0)*Rt;Ys(Te.current,{transform:Xs(E)?`translate3d(0, ${ir}px, 0)`:`translate3d(${ir}px, 0, 0)`});return}const sr=1-In;if((ie||f&&cn===f-1)&&(r==null||r(Ze,In),Ys(te.current,{opacity:`${sr}`,transition:"none"},!0)),Gt&&te.current&&o){const Kr=Math.min(pe()+In*(1-pe()),1),ir=8-In*8,de=Math.max(0,14-In*14);Ys(Gt,{borderRadius:`${ir}px`,transform:Xs(E)?`scale(${Kr}) translate3d(0, ${de}px, 0)`:`scale(${Kr}) translate3d(${de}px, 0, 0)`,transition:"none"},!0)}if(!i){const Kr=dn*Rt;Ys(Te.current,{transform:Xs(E)?`translate3d(0, ${Kr}px, 0)`:`translate3d(${Kr}px, 0, 0)`})}}}fe.useEffect(()=>{var Ze;function Rt(){if(!Te.current||!D)return;const Pt=document.activeElement;if(nU(Pt)||ze.current){var Ut;const yt=((Ut=window.visualViewport)==null?void 0:Ut.height)||0,dn=window.innerHeight;let Gt=dn-yt;const Hn=Te.current.getBoundingClientRect().height||0,In=Hn>dn*.8;ut.current||(ut.current=Hn);const Tn=Te.current.getBoundingClientRect().top;if(Math.abs($e.current-Gt)>60&&(ze.current=!ze.current),i&&i.length>0&&U&&cn){const sr=U[cn]||0;Gt+=sr}if($e.current=Gt,Hn>yt||ze.current){const sr=Te.current.getBoundingClientRect().height;let Kr=sr;sr>yt&&(Kr=yt-(In?Tn:rU)),m?Te.current.style.height=`${sr-Math.max(Gt,0)}px`:Te.current.style.height=`${Math.max(Kr,yt-Tn)}px`}else Te.current.style.height=`${ut.current}px`;i&&i.length>0&&!ze.current?Te.current.style.bottom="0px":Te.current.style.bottom=`${Math.max(Gt,0)}px`}}return(Ze=window.visualViewport)==null||Ze.addEventListener("resize",Rt),()=>{var Pt;return(Pt=window.visualViewport)==null?void 0:Pt.removeEventListener("resize",Rt)}},[cn,i,U]);function ht(Ze){Mn(),y==null||y(),Ze||Z(!1),setTimeout(()=>{i&&hn(i[0])},ns.DURATION*1e3)}function hs(){if(!Te.current)return;const Ze=document.querySelector("[data-vaul-drawer-wrapper]"),Rt=dP(Te.current,E);Ys(Te.current,{transform:"translate3d(0, 0, 0)",transition:`transform ${ns.DURATION}s cubic-bezier(${ns.EASE.join(",")})`}),Ys(te.current,{transition:`opacity ${ns.DURATION}s cubic-bezier(${ns.EASE.join(",")})`,opacity:"1"}),o&&Rt&&Rt>0&&W&&Ys(Ze,{borderRadius:`${Ure}px`,overflow:"hidden",...Xs(E)?{transform:`scale(${pe()}) translate3d(0, calc(env(safe-area-inset-top) + 14px), 0)`,transformOrigin:"top"}:{transform:`scale(${pe()}) translate3d(calc(env(safe-area-inset-top) + 14px), 0, 0)`,transformOrigin:"left"},transitionProperty:"transform, border-radius",transitionDuration:`${ns.DURATION}s`,transitionTimingFunction:`cubic-bezier(${ns.EASE.join(",")})`},!0)}function Mn(){!se||!Te.current||(Te.current.classList.remove(b4),Pe.current=!1,he(!1),xe.current=new Date)}function Hr(Ze){if(!se||!Te.current)return;Te.current.classList.remove(b4),Pe.current=!1,he(!1),xe.current=new Date;const Rt=dP(Te.current,E);if(!Fe(Ze.target,!1)||!Rt||Number.isNaN(Rt)||be.current===null)return;const Pt=xe.current.getTime()-be.current.getTime(),Ut=ke.current-(Xs(E)?Ze.pageY:Ze.pageX),yt=Math.abs(Ut)/Pt;if(yt>.05&&(J(!0),setTimeout(()=>{J(!1)},200)),i){It({draggedDistance:Ut*(E==="bottom"||E==="right"?1:-1),closeDrawer:ht,velocity:yt,dismissible:h}),s==null||s(Ze,!0);return}if(E==="bottom"||E==="right"?Ut>0:Ut<0){hs(),s==null||s(Ze,!0);return}if(yt>Bre){ht(),s==null||s(Ze,!1);return}var dn;const Gt=Math.min((dn=Te.current.getBoundingClientRect().height)!=null?dn:0,window.innerHeight);var Hn;const In=Math.min((Hn=Te.current.getBoundingClientRect().width)!=null?Hn:0,window.innerWidth),Tn=E==="left"||E==="right";if(Math.abs(Rt)>=(Tn?In:Gt)*c){ht(),s==null||s(Ze,!1);return}s==null||s(Ze,!0),hs()}fe.useEffect(()=>(W&&(Ys(document.documentElement,{scrollBehavior:"auto"}),ae.current=new Date),()=>{lDe(document.documentElement,"scrollBehavior")}),[W]);function Yt(Ze){const Rt=Ze?(window.innerWidth-fP)/window.innerWidth:1,Pt=Ze?-16:0;Oe.current&&window.clearTimeout(Oe.current),Ys(Te.current,{transition:`transform ${ns.DURATION}s cubic-bezier(${ns.EASE.join(",")})`,transform:`scale(${Rt}) translate3d(0, ${Pt}px, 0)`}),!Ze&&Te.current&&(Oe.current=setTimeout(()=>{const Ut=dP(Te.current,E);Ys(Te.current,{transition:"none",transform:Xs(E)?`translate3d(0, ${Ut}px, 0)`:`translate3d(${Ut}px, 0, 0)`})},500))}function un(Ze,Rt){if(Rt<0)return;const Pt=(window.innerWidth-fP)/window.innerWidth,Ut=Pt+Rt*(1-Pt),yt=-16+Rt*fP;Ys(Te.current,{transform:Xs(E)?`scale(${Ut}) translate3d(0, ${yt}px, 0)`:`scale(${Ut}) translate3d(${yt}px, 0, 0)`,transition:"none"})}function xn(Ze,Rt){const Pt=Xs(E)?window.innerHeight:window.innerWidth,Ut=Rt?(Pt-fP)/Pt:1,yt=Rt?-16:0;Rt&&Ys(Te.current,{transition:`transform ${ns.DURATION}s cubic-bezier(${ns.EASE.join(",")})`,transform:Xs(E)?`scale(${Ut}) translate3d(0, ${yt}px, 0)`:`scale(${Ut}) translate3d(${yt}px, 0, 0)`})}return fe.createElement(Vke,{defaultOpen:R,onOpenChange:Ze=>{!h&&!Ze||(Ze?H(!0):ht(!0),Z(Ze))},open:W},fe.createElement(Lre.Provider,{value:{activeSnapPoint:Nn,snapPoints:i,setActiveSnapPoint:hn,drawerRef:Te,overlayRef:te,onOpenChange:t,onPress:Se,onRelease:Hr,onDrag:ft,dismissible:h,handleOnly:u,isOpen:W,isDragging:se,shouldFade:ie,closeDrawer:ht,onNestedDrag:un,onNestedOpenChange:Yt,onNestedRelease:xn,keyboardIsOpen:ze,modal:x,snapPointsOffset:U,direction:E,shouldScaleBackground:o,setBackgroundColorOnScale:a,noBodyStyles:w,container:I,autoFocus:$}},n))}const Wre=fe.forwardRef(function({...e},t){const{overlayRef:n,snapPoints:r,onRelease:s,shouldFade:i,isOpen:o,modal:a}=nR(),c=Fre(t,n),d=r&&r.length>0;return a?fe.createElement(Wke,{onMouseUp:s,ref:c,"data-vaul-overlay":"","data-vaul-snap-points":o&&d?"true":"false","data-vaul-snap-points-overlay":o&&i?"true":"false",...e}):(typeof window<"u"&&window.requestAnimationFrame(()=>{document.body.style.pointerEvents="auto"}),null)});Wre.displayName="Drawer.Overlay";const qre=fe.forwardRef(function({onPointerDownOutside:e,style:t,onOpenAutoFocus:n,...r},s){const{drawerRef:i,onPress:o,onRelease:a,onDrag:c,keyboardIsOpen:d,snapPointsOffset:h,modal:u,isOpen:f,direction:g,snapPoints:v,container:m,handleOnly:x,autoFocus:y}=nR(),[b,w]=fe.useState(!1),E=Fre(s,i),R=fe.useRef(null),T=fe.useRef(null),N=fe.useRef(!1),A=v&&v.length>0;gDe();const D=(I,$,F=0)=>{if(N.current)return!0;const B=Math.abs(I.y),W=Math.abs(I.x),Z=W>B,Y=["bottom","right"].includes($)?1:-1;if($==="left"||$==="right"){if(!(I.x*Y<0)&&W>=0&&W<=F)return Z}else if(!(I.y*Y<0)&&B>=0&&B<=F)return!Z;return N.current=!0,!0};fe.useEffect(()=>{A&&window.requestAnimationFrame(()=>{w(!0)})},[]);function O(I){R.current=null,N.current=!1,a(I)}return fe.createElement(qke,{"data-vaul-drawer-direction":g,"data-vaul-drawer":"","data-vaul-delayed-snap-points":b?"true":"false","data-vaul-snap-points":f&&A?"true":"false","data-vaul-custom-container":m?"true":"false",...r,ref:E,style:h&&h.length>0?{"--snap-point-height":`${h[0]}px`,...t}:t,onPointerDown:I=>{x||(r.onPointerDown==null||r.onPointerDown.call(r,I),R.current={x:I.pageX,y:I.pageY},o(I))},onOpenAutoFocus:I=>{n==null||n(I),y||I.preventDefault()},onPointerDownOutside:I=>{if(e==null||e(I),!u||I.defaultPrevented){I.preventDefault();return}d.current&&(d.current=!1)},onFocusOutside:I=>{if(!u){I.preventDefault();return}},onPointerMove:I=>{if(T.current=I,x||(r.onPointerMove==null||r.onPointerMove.call(r,I),!R.current))return;const $=I.pageY-R.current.y,F=I.pageX-R.current.x,B=I.pointerType==="touch"?10:2;D({x:F,y:$},g,B)?c(I):(Math.abs(F)>B||Math.abs($)>B)&&(R.current=null)},onPointerUp:I=>{r.onPointerUp==null||r.onPointerUp.call(r,I),R.current=null,N.current=!1,a(I)},onPointerOut:I=>{r.onPointerOut==null||r.onPointerOut.call(r,I),O(T.current)},onContextMenu:I=>{r.onContextMenu==null||r.onContextMenu.call(r,I),O(T.current)}})});qre.displayName="Drawer.Content";const bDe=250,xDe=120,_De=fe.forwardRef(function({preventCycle:e=!1,children:t,...n},r){const{closeDrawer:s,isDragging:i,snapPoints:o,activeSnapPoint:a,setActiveSnapPoint:c,dismissible:d,handleOnly:h,isOpen:u,onPress:f,onDrag:g}=nR(),v=fe.useRef(null),m=fe.useRef(!1);function x(){if(m.current){w();return}window.setTimeout(()=>{y()},xDe)}function y(){if(i||e||m.current){w();return}if(w(),(!o||o.length===0)&&d){s();return}if(a===o[o.length-1]&&d){s();return}const R=o.findIndex(N=>N===a);if(R===-1)return;const T=o[R+1];c(T)}function b(){v.current=window.setTimeout(()=>{m.current=!0},bDe)}function w(){window.clearTimeout(v.current),m.current=!1}return fe.createElement("div",{onClick:x,onPointerCancel:w,onPointerDown:E=>{h&&f(E),b()},onPointerMove:E=>{h&&g(E)},ref:r,"data-vaul-drawer-visible":u?"true":"false","data-vaul-handle":"","aria-hidden":"true",...n},fe.createElement("span",{"data-vaul-handle-hitarea":"","aria-hidden":"true"},t))});_De.displayName="Drawer.Handle";function wDe(e){const t=nR(),{container:n=t.container,...r}=e;return fe.createElement(Hke,{container:n,...r})}const ju={Root:yDe,Content:qre,Overlay:Wre,Portal:wDe,Close:Yke,Title:Gke,Description:Kke},a8=({shouldScaleBackground:e=!0,...t})=>_.jsx(ju.Root,{shouldScaleBackground:e,...t});a8.displayName="Drawer";const SDe=ju.Portal,Gre=ju.Close,Kre=C.forwardRef(({className:e,...t},n)=>_.jsx(ju.Overlay,{ref:n,className:ge("fixed inset-0 z-50 bg-black/80",e),...t}));Kre.displayName=ju.Overlay.displayName;const l8=C.forwardRef(({className:e,children:t,...n},r)=>_.jsxs(SDe,{children:[_.jsx(Kre,{}),_.jsxs(ju.Content,{ref:r,className:ge("fixed inset-x-0 bottom-0 z-50 mt-24 flex h-auto flex-col rounded-t-[10px] border bg-background",e),...n,children:[_.jsx("div",{className:"mx-auto mt-4 h-2 w-[100px] rounded-full bg-muted"}),t]})]}));l8.displayName="DrawerContent";const c8=({className:e,...t})=>_.jsx("div",{className:ge("grid gap-1.5 p-4 text-center sm:text-left",e),...t});c8.displayName="DrawerHeader";const u8=({className:e,...t})=>_.jsx("div",{className:ge("mt-auto flex flex-col gap-2 p-4",e),...t});u8.displayName="DrawerFooter";const d8=C.forwardRef(({className:e,...t},n)=>_.jsx(ju.Title,{ref:n,className:ge("text-lg font-semibold leading-none tracking-tight",e),...t}));d8.displayName=ju.Title.displayName;const f8=C.forwardRef(({className:e,...t},n)=>_.jsx(ju.Description,{ref:n,className:ge("text-sm text-muted-foreground",e),...t}));f8.displayName=ju.Description.displayName;var h8="DropdownMenu",[CDe,h7e]=_r(h8,[eR]),Lo=eR(),[EDe,Yre]=CDe(h8),Xre=e=>{const{__scopeDropdownMenu:t,children:n,dir:r,open:s,defaultOpen:i,onOpenChange:o,modal:a=!0}=e,c=Lo(t),d=C.useRef(null),[h=!1,u]=os({prop:s,defaultProp:i,onChange:o});return _.jsx(EDe,{scope:t,triggerId:si(),triggerRef:d,contentId:si(),open:h,onOpenChange:u,onOpenToggle:C.useCallback(()=>u(f=>!f),[u]),modal:a,children:_.jsx(xTe,{...c,open:h,onOpenChange:u,dir:r,modal:a,children:n})})};Xre.displayName=h8;var Qre="DropdownMenuTrigger",Zre=C.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,disabled:r=!1,...s}=e,i=Yre(Qre,n),o=Lo(n);return _.jsx(B6,{asChild:!0,...o,children:_.jsx(He.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:DA(t,i.triggerRef),onPointerDown:Ae(e.onPointerDown,a=>{!r&&a.button===0&&a.ctrlKey===!1&&(i.onOpenToggle(),i.open||a.preventDefault())}),onKeyDown:Ae(e.onKeyDown,a=>{r||(["Enter"," "].includes(a.key)&&i.onOpenToggle(),a.key==="ArrowDown"&&i.onOpenChange(!0),["Enter"," ","ArrowDown"].includes(a.key)&&a.preventDefault())})})})});Zre.displayName=Qre;var ADe="DropdownMenuPortal",Jre=e=>{const{__scopeDropdownMenu:t,...n}=e,r=Lo(t);return _.jsx(U6,{...r,...n})};Jre.displayName=ADe;var ese="DropdownMenuContent",tse=C.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,s=Yre(ese,n),i=Lo(n),o=C.useRef(!1);return _.jsx(V6,{id:s.contentId,"aria-labelledby":s.triggerId,...i,...r,ref:t,onCloseAutoFocus:Ae(e.onCloseAutoFocus,a=>{var c;o.current||(c=s.triggerRef.current)==null||c.focus(),o.current=!1,a.preventDefault()}),onInteractOutside:Ae(e.onInteractOutside,a=>{const c=a.detail.originalEvent,d=c.button===0&&c.ctrlKey===!0,h=c.button===2||d;(!s.modal||h)&&(o.current=!0)}),style:{...e.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)"}})});tse.displayName=ese;var RDe="DropdownMenuGroup",nse=C.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,s=Lo(n);return _.jsx(H6,{...s,...r,ref:t})});nse.displayName=RDe;var PDe="DropdownMenuLabel",rse=C.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,s=Lo(n);return _.jsx(W6,{...s,...r,ref:t})});rse.displayName=PDe;var NDe="DropdownMenuItem",sse=C.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,s=Lo(n);return _.jsx(q6,{...s,...r,ref:t})});sse.displayName=NDe;var TDe="DropdownMenuCheckboxItem",ise=C.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,s=Lo(n);return _.jsx(G6,{...s,...r,ref:t})});ise.displayName=TDe;var kDe="DropdownMenuRadioGroup",DDe=C.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,s=Lo(n);return _.jsx(K6,{...s,...r,ref:t})});DDe.displayName=kDe;var ODe="DropdownMenuRadioItem",ose=C.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,s=Lo(n);return _.jsx(Y6,{...s,...r,ref:t})});ose.displayName=ODe;var MDe="DropdownMenuItemIndicator",ase=C.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,s=Lo(n);return _.jsx(X6,{...s,...r,ref:t})});ase.displayName=MDe;var IDe="DropdownMenuSeparator",lse=C.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,s=Lo(n);return _.jsx(Q6,{...s,...r,ref:t})});lse.displayName=IDe;var LDe="DropdownMenuArrow",jDe=C.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,s=Lo(n);return _.jsx(Z6,{...s,...r,ref:t})});jDe.displayName=LDe;var $De="DropdownMenuSubTrigger",cse=C.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,s=Lo(n);return _.jsx(J6,{...s,...r,ref:t})});cse.displayName=$De;var FDe="DropdownMenuSubContent",use=C.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,s=Lo(n);return _.jsx(e8,{...s,...r,ref:t,style:{...e.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)"}})});use.displayName=FDe;var zDe=Xre,BDe=Zre,UDe=Jre,dse=tse,VDe=nse,fse=rse,hse=sse,pse=ise,mse=ose,gse=ase,vse=lse,yse=cse,bse=use;const rR=zDe,sR=BDe,HDe=VDe,WDe=C.forwardRef(({className:e,inset:t,children:n,...r},s)=>_.jsxs(yse,{ref:s,className:ge("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",t&&"pl-8",e),...r,children:[n,_.jsx(Tx,{className:"w-4 h-4 ml-auto"})]}));WDe.displayName=yse.displayName;const qDe=C.forwardRef(({className:e,...t},n)=>_.jsx(bse,{ref:n,className:ge("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",e),...t}));qDe.displayName=bse.displayName;const Vx=C.forwardRef(({className:e,sideOffset:t=4,...n},r)=>_.jsx(UDe,{children:_.jsx(dse,{ref:r,sideOffset:t,className:ge("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",e),...n})}));Vx.displayName=dse.displayName;const up=C.forwardRef(({className:e,inset:t,...n},r)=>_.jsx(hse,{ref:r,className:ge("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",t&&"pl-8",e),...n}));up.displayName=hse.displayName;const xse=C.forwardRef(({className:e,children:t,checked:n,...r},s)=>_.jsxs(pse,{ref:s,className:ge("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",e),checked:n,...r,children:[_.jsx("span",{className:"absolute left-2 flex h-3.5 w-3.5 items-center justify-center",children:_.jsx(gse,{children:_.jsx(OA,{className:"w-4 h-4"})})}),t]}));xse.displayName=pse.displayName;const GDe=C.forwardRef(({className:e,children:t,...n},r)=>_.jsxs(mse,{ref:r,className:ge("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",e),...n,children:[_.jsx("span",{className:"absolute left-2 flex h-3.5 w-3.5 items-center justify-center",children:_.jsx(gse,{children:_.jsx(cD,{className:"w-2 h-2 fill-current"})})}),t]}));GDe.displayName=mse.displayName;const XD=C.forwardRef(({className:e,inset:t,...n},r)=>_.jsx(fse,{ref:r,className:ge("px-2 py-1.5 text-sm font-semibold",t&&"pl-8",e),...n}));XD.displayName=fse.displayName;const ax=C.forwardRef(({className:e,...t},n)=>_.jsx(vse,{ref:n,className:ge("-mx-1 my-1 h-px bg-muted",e),...t}));ax.displayName=vse.displayName;const _se=({className:e,...t})=>_.jsx("span",{className:ge("ml-auto text-xs tracking-widest opacity-60",e),...t});_se.displayName="DropdownMenuShortcut";var iR=e=>e.type==="checkbox",fg=e=>e instanceof Date,Eo=e=>e==null;const wse=e=>typeof e=="object";var ws=e=>!Eo(e)&&!Array.isArray(e)&&wse(e)&&!fg(e),Sse=e=>ws(e)&&e.target?iR(e.target)?e.target.checked:e.target.value:e,KDe=e=>e.substring(0,e.search(/\.\d+(\.|$)/))||e,Cse=(e,t)=>e.has(KDe(t)),YDe=e=>{const t=e.constructor&&e.constructor.prototype;return ws(t)&&t.hasOwnProperty("isPrototypeOf")},p8=typeof window<"u"&&typeof window.HTMLElement<"u"&&typeof document<"u";function ts(e){let t;const n=Array.isArray(e),r=typeof FileList<"u"?e instanceof FileList:!1;if(e instanceof Date)t=new Date(e);else if(e instanceof Set)t=new Set(e);else if(!(p8&&(e instanceof Blob||r))&&(n||ws(e)))if(t=n?[]:{},!n&&!YDe(e))t=e;else for(const s in e)e.hasOwnProperty(s)&&(t[s]=ts(e[s]));else return e;return t}var oR=e=>Array.isArray(e)?e.filter(Boolean):[],Br=e=>e===void 0,Ye=(e,t,n)=>{if(!t||!ws(e))return n;const r=oR(t.split(/[,[\].]+?/)).reduce((s,i)=>Eo(s)?s:s[i],e);return Br(r)||r===e?Br(e[t])?n:e[t]:r},Ua=e=>typeof e=="boolean",m8=e=>/^\w*$/.test(e),Ese=e=>oR(e.replace(/["|']|\]/g,"").split(/\.|\[/)),kn=(e,t,n)=>{let r=-1;const s=m8(t)?[t]:Ese(t),i=s.length,o=i-1;for(;++r<i;){const a=s[r];let c=n;if(r!==o){const d=e[a];c=ws(d)||Array.isArray(d)?d:isNaN(+s[r+1])?{}:[]}if(a==="__proto__"||a==="constructor"||a==="prototype")return;e[a]=c,e=e[a]}};const RT={BLUR:"blur",FOCUS_OUT:"focusout",CHANGE:"change"},gl={onBlur:"onBlur",onChange:"onChange",onSubmit:"onSubmit",onTouched:"onTouched",all:"all"},kd={max:"max",min:"min",maxLength:"maxLength",minLength:"minLength",pattern:"pattern",required:"required",validate:"validate"},Ase=fe.createContext(null),ua=()=>fe.useContext(Ase),XDe=e=>{const{children:t,...n}=e;return fe.createElement(Ase.Provider,{value:n},t)};var Rse=(e,t,n,r=!0)=>{const s={defaultValues:t._defaultValues};for(const i in e)Object.defineProperty(s,i,{get:()=>{const o=i;return t._proxyFormState[o]!==gl.all&&(t._proxyFormState[o]=!r||gl.all),n&&(n[o]=!0),e[o]}});return s};function Pse(e){const t=ua(),{control:n=t.control,disabled:r,name:s,exact:i}=e||{},[o,a]=fe.useState(n._formState),c=fe.useRef({isDirty:!1,isLoading:!1,dirtyFields:!1,touchedFields:!1,validatingFields:!1,isValidating:!1,isValid:!1,errors:!1}),d=fe.useRef(s);return d.current=s,fe.useEffect(()=>n._subscribe({name:d.current,formState:c.current,exact:i,callback:h=>{!r&&a({...n._formState,...h})}}),[n,r,i]),fe.useEffect(()=>{c.current.isValid&&n._setValid(!0)},[n]),fe.useMemo(()=>Rse(o,n,c.current,!1),[o,n])}var yu=e=>typeof e=="string",Nse=(e,t,n,r,s)=>yu(e)?(r&&t.watch.add(e),Ye(n,e,s)):Array.isArray(e)?e.map(i=>(r&&t.watch.add(i),Ye(n,i))):(r&&(t.watchAll=!0),n);function Tse(e){const t=ua(),{control:n=t.control,name:r,defaultValue:s,disabled:i,exact:o}=e||{},a=fe.useRef(r),c=fe.useRef(s);a.current=r,fe.useEffect(()=>n._subscribe({name:a.current,formState:{values:!0},exact:o,callback:u=>!i&&h(Nse(a.current,n._names,u.values||n._formValues,!1,c.current))}),[n,i,o]);const[d,h]=fe.useState(n._getWatch(r,s));return fe.useEffect(()=>n._removeUnmounted()),d}function QDe(e){const t=ua(),{name:n,disabled:r,control:s=t.control,shouldUnregister:i}=e,o=Cse(s._names.array,n),a=Tse({control:s,name:n,defaultValue:Ye(s._formValues,n,Ye(s._defaultValues,n,e.defaultValue)),exact:!0}),c=Pse({control:s,name:n,exact:!0}),d=fe.useRef(e),h=fe.useRef(s.register(n,{...e.rules,value:a,...Ua(e.disabled)?{disabled:e.disabled}:{}})),u=fe.useMemo(()=>Object.defineProperties({},{invalid:{enumerable:!0,get:()=>!!Ye(c.errors,n)},isDirty:{enumerable:!0,get:()=>!!Ye(c.dirtyFields,n)},isTouched:{enumerable:!0,get:()=>!!Ye(c.touchedFields,n)},isValidating:{enumerable:!0,get:()=>!!Ye(c.validatingFields,n)},error:{enumerable:!0,get:()=>Ye(c.errors,n)}}),[c,n]),f=fe.useCallback(x=>h.current.onChange({target:{value:Sse(x),name:n},type:RT.CHANGE}),[n]),g=fe.useCallback(()=>h.current.onBlur({target:{value:Ye(s._formValues,n),name:n},type:RT.BLUR}),[n,s._formValues]),v=fe.useCallback(x=>{const y=Ye(s._fields,n);y&&x&&(y._f.ref={focus:()=>x.focus(),select:()=>x.select(),setCustomValidity:b=>x.setCustomValidity(b),reportValidity:()=>x.reportValidity()})},[s._fields,n]),m=fe.useMemo(()=>({name:n,value:a,...Ua(r)||c.disabled?{disabled:c.disabled||r}:{},onChange:f,onBlur:g,ref:v}),[n,r,c.disabled,f,g,v,a]);return fe.useEffect(()=>{const x=s._options.shouldUnregister||i;s.register(n,{...d.current.rules,...Ua(d.current.disabled)?{disabled:d.current.disabled}:{}});const y=(b,w)=>{const E=Ye(s._fields,b);E&&E._f&&(E._f.mount=w)};if(y(n,!0),x){const b=ts(Ye(s._options.defaultValues,n));kn(s._defaultValues,n,b),Br(Ye(s._formValues,n))&&kn(s._formValues,n,b)}return!o&&s.register(n),()=>{(o?x&&!s._state.action:x)?s.unregister(n):y(n,!1)}},[n,s,o,i]),fe.useEffect(()=>{s._setDisabledField({disabled:r,name:n})},[r,n,s]),fe.useMemo(()=>({field:m,formState:c,fieldState:u}),[m,c,u])}const ZDe=e=>e.render(QDe(e));var kse=(e,t,n,r,s)=>t?{...n[e],types:{...n[e]&&n[e].types?n[e].types:{},[r]:s||!0}}:{},Zo=e=>Array.isArray(e)?e:[e],e7=()=>{let e=[];return{get observers(){return e},next:s=>{for(const i of e)i.next&&i.next(s)},subscribe:s=>(e.push(s),{unsubscribe:()=>{e=e.filter(i=>i!==s)}}),unsubscribe:()=>{e=[]}}},sU=e=>Eo(e)||!wse(e);function gh(e,t){if(sU(e)||sU(t))return e===t;if(fg(e)&&fg(t))return e.getTime()===t.getTime();const n=Object.keys(e),r=Object.keys(t);if(n.length!==r.length)return!1;for(const s of n){const i=e[s];if(!r.includes(s))return!1;if(s!=="ref"){const o=t[s];if(fg(i)&&fg(o)||ws(i)&&ws(o)||Array.isArray(i)&&Array.isArray(o)?!gh(i,o):i!==o)return!1}}return!0}var Ji=e=>ws(e)&&!Object.keys(e).length,g8=e=>e.type==="file",mc=e=>typeof e=="function",PT=e=>{if(!p8)return!1;const t=e?e.ownerDocument:0;return e instanceof(t&&t.defaultView?t.defaultView.HTMLElement:HTMLElement)},Dse=e=>e.type==="select-multiple",v8=e=>e.type==="radio",JDe=e=>v8(e)||iR(e),x4=e=>PT(e)&&e.isConnected;function eOe(e,t){const n=t.slice(0,-1).length;let r=0;for(;r<n;)e=Br(e)?r++:e[t[r++]];return e}function tOe(e){for(const t in e)if(e.hasOwnProperty(t)&&!Br(e[t]))return!1;return!0}function Ps(e,t){const n=Array.isArray(t)?t:m8(t)?[t]:Ese(t),r=n.length===1?e:eOe(e,n),s=n.length-1,i=n[s];return r&&delete r[i],s!==0&&(ws(r)&&Ji(r)||Array.isArray(r)&&tOe(r))&&Ps(e,n.slice(0,-1)),e}var Ose=e=>{for(const t in e)if(mc(e[t]))return!0;return!1};function NT(e,t={}){const n=Array.isArray(e);if(ws(e)||n)for(const r in e)Array.isArray(e[r])||ws(e[r])&&!Ose(e[r])?(t[r]=Array.isArray(e[r])?[]:{},NT(e[r],t[r])):Eo(e[r])||(t[r]=!0);return t}function Mse(e,t,n){const r=Array.isArray(e);if(ws(e)||r)for(const s in e)Array.isArray(e[s])||ws(e[s])&&!Ose(e[s])?Br(t)||sU(n[s])?n[s]=Array.isArray(e[s])?NT(e[s],[]):{...NT(e[s])}:Mse(e[s],Eo(t)?{}:t[s],n[s]):n[s]=!gh(e[s],t[s]);return n}var BS=(e,t)=>Mse(e,t,NT(t));const t7={value:!1,isValid:!1},n7={value:!0,isValid:!0};var Ise=e=>{if(Array.isArray(e)){if(e.length>1){const t=e.filter(n=>n&&n.checked&&!n.disabled).map(n=>n.value);return{value:t,isValid:!!t.length}}return e[0].checked&&!e[0].disabled?e[0].attributes&&!Br(e[0].attributes.value)?Br(e[0].value)||e[0].value===""?n7:{value:e[0].value,isValid:!0}:n7:t7}return t7},Lse=(e,{valueAsNumber:t,valueAsDate:n,setValueAs:r})=>Br(e)?e:t?e===""?NaN:e&&+e:n&&yu(e)?new Date(e):r?r(e):e;const r7={isValid:!1,value:null};var jse=e=>Array.isArray(e)?e.reduce((t,n)=>n&&n.checked&&!n.disabled?{isValid:!0,value:n.value}:t,r7):r7;function s7(e){const t=e.ref;return g8(t)?t.files:v8(t)?jse(e.refs).value:Dse(t)?[...t.selectedOptions].map(({value:n})=>n):iR(t)?Ise(e.refs).value:Lse(Br(t.value)?e.ref.value:t.value,e)}var nOe=(e,t,n,r)=>{const s={};for(const i of e){const o=Ye(t,i);o&&kn(s,i,o._f)}return{criteriaMode:n,names:[...e],fields:s,shouldUseNativeValidation:r}},TT=e=>e instanceof RegExp,US=e=>Br(e)?e:TT(e)?e.source:ws(e)?TT(e.value)?e.value.source:e.value:e,gb=e=>({isOnSubmit:!e||e===gl.onSubmit,isOnBlur:e===gl.onBlur,isOnChange:e===gl.onChange,isOnAll:e===gl.all,isOnTouch:e===gl.onTouched});const i7="AsyncFunction";var rOe=e=>!!e&&!!e.validate&&!!(mc(e.validate)&&e.validate.constructor.name===i7||ws(e.validate)&&Object.values(e.validate).find(t=>t.constructor.name===i7)),sOe=e=>e.mount&&(e.required||e.min||e.max||e.maxLength||e.minLength||e.pattern||e.validate),iU=(e,t,n)=>!n&&(t.watchAll||t.watch.has(e)||[...t.watch].some(r=>e.startsWith(r)&&/^\.\w+/.test(e.slice(r.length))));const Ob=(e,t,n,r)=>{for(const s of n||Object.keys(e)){const i=Ye(e,s);if(i){const{_f:o,...a}=i;if(o){if(o.refs&&o.refs[0]&&t(o.refs[0],s)&&!r)return!0;if(o.ref&&t(o.ref,o.name)&&!r)return!0;if(Ob(a,t))break}else if(ws(a)&&Ob(a,t))break}}};function o7(e,t,n){const r=Ye(e,n);if(r||m8(n))return{error:r,name:n};const s=n.split(".");for(;s.length;){const i=s.join("."),o=Ye(t,i),a=Ye(e,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 iOe=(e,t,n,r)=>{n(e);const{name:s,...i}=e;return Ji(i)||Object.keys(i).length>=Object.keys(t).length||Object.keys(i).find(o=>t[o]===(!r||gl.all))},oOe=(e,t,n)=>!e||!t||e===t||Zo(e).some(r=>r&&(n?r===t:r.startsWith(t)||t.startsWith(r))),aOe=(e,t,n,r,s)=>s.isOnAll?!1:!n&&s.isOnTouch?!(t||e):(n?r.isOnBlur:s.isOnBlur)?!e:(n?r.isOnChange:s.isOnChange)?e:!0,lOe=(e,t)=>!oR(Ye(e,t)).length&&Ps(e,t),$se=(e,t,n)=>{const r=Zo(Ye(e,n));return kn(r,"root",t[n]),kn(e,n,r),e},ZP=e=>yu(e);function a7(e,t,n="validate"){if(ZP(e)||Array.isArray(e)&&e.every(ZP)||Ua(e)&&!e)return{type:n,message:ZP(e)?e:"",ref:t}}var jy=e=>ws(e)&&!TT(e)?e:{value:e,message:""},oU=async(e,t,n,r,s,i)=>{const{ref:o,refs:a,required:c,maxLength:d,minLength:h,min:u,max:f,pattern:g,validate:v,name:m,valueAsNumber:x,mount:y}=e._f,b=Ye(n,m);if(!y||t.has(m))return{};const w=a?a[0]:o,E=$=>{s&&w.reportValidity&&(w.setCustomValidity(Ua($)?"":$||""),w.reportValidity())},R={},T=v8(o),N=iR(o),A=T||N,D=(x||g8(o))&&Br(o.value)&&Br(b)||PT(o)&&o.value===""||b===""||Array.isArray(b)&&!b.length,O=kse.bind(null,m,r,R),I=($,F,B,W=kd.maxLength,Z=kd.minLength)=>{const Y=$?F:B;R[m]={type:$?W:Z,message:Y,ref:o,...O($?W:Z,Y)}};if(i?!Array.isArray(b)||!b.length:c&&(!A&&(D||Eo(b))||Ua(b)&&!b||N&&!Ise(a).isValid||T&&!jse(a).isValid)){const{value:$,message:F}=ZP(c)?{value:!!c,message:c}:jy(c);if($&&(R[m]={type:kd.required,message:F,ref:w,...O(kd.required,F)},!r))return E(F),R}if(!D&&(!Eo(u)||!Eo(f))){let $,F;const B=jy(f),W=jy(u);if(!Eo(b)&&!isNaN(b)){const Z=o.valueAsNumber||b&&+b;Eo(B.value)||($=Z>B.value),Eo(W.value)||(F=Z<W.value)}else{const Z=o.valueAsDate||new Date(b),Y=he=>new Date(new Date().toDateString()+" "+he),H=o.type=="time",se=o.type=="week";yu(B.value)&&b&&($=H?Y(b)>Y(B.value):se?b>B.value:Z>new Date(B.value)),yu(W.value)&&b&&(F=H?Y(b)<Y(W.value):se?b<W.value:Z<new Date(W.value))}if(($||F)&&(I(!!$,B.message,W.message,kd.max,kd.min),!r))return E(R[m].message),R}if((d||h)&&!D&&(yu(b)||i&&Array.isArray(b))){const $=jy(d),F=jy(h),B=!Eo($.value)&&b.length>+$.value,W=!Eo(F.value)&&b.length<+F.value;if((B||W)&&(I(B,$.message,F.message),!r))return E(R[m].message),R}if(g&&!D&&yu(b)){const{value:$,message:F}=jy(g);if(TT($)&&!b.match($)&&(R[m]={type:kd.pattern,message:F,ref:o,...O(kd.pattern,F)},!r))return E(F),R}if(v){if(mc(v)){const $=await v(b,n),F=a7($,w);if(F&&(R[m]={...F,...O(kd.validate,F.message)},!r))return E(F.message),R}else if(ws(v)){let $={};for(const F in v){if(!Ji($)&&!r)break;const B=a7(await v[F](b,n),w,F);B&&($={...B,...O(F,B.message)},E(B.message),r&&(R[m]=$))}if(!Ji($)&&(R[m]={ref:w,...$},!r))return R}}return E(!0),R};const cOe={mode:gl.onSubmit,reValidateMode:gl.onChange,shouldFocusError:!0};function uOe(e={}){let t={...cOe,...e},n={submitCount:0,isDirty:!1,isLoading:mc(t.defaultValues),isValidating:!1,isSubmitted:!1,isSubmitting:!1,isSubmitSuccessful:!1,isValid:!1,touchedFields:{},dirtyFields:{},validatingFields:{},errors:t.errors||{},disabled:t.disabled||!1};const r={};let s=ws(t.defaultValues)||ws(t.values)?ts(t.values||t.defaultValues)||{}:{},i=t.shouldUnregister?{}:ts(s),o={action:!1,mount:!1,watch:!1},a={mount:new Set,disabled:new Set,unMount:new Set,array:new Set,watch:new Set},c,d=0;const h={isDirty:!1,dirtyFields:!1,validatingFields:!1,touchedFields:!1,isValidating:!1,isValid:!1,errors:!1};let u={...h};const f={array:e7(),state:e7()},g=gb(t.mode),v=gb(t.reValidateMode),m=t.criteriaMode===gl.all,x=U=>ee=>{clearTimeout(d),d=setTimeout(U,ee)},y=async U=>{if(!t.disabled&&(h.isValid||u.isValid||U)){const ee=t.resolver?Ji((await D()).errors):await I(r,!0);ee!==n.isValid&&f.state.next({isValid:ee})}},b=(U,ee)=>{!t.disabled&&(h.isValidating||h.validatingFields||u.isValidating||u.validatingFields)&&((U||Array.from(a.mount)).forEach(ie=>{ie&&(ee?kn(n.validatingFields,ie,ee):Ps(n.validatingFields,ie))}),f.state.next({validatingFields:n.validatingFields,isValidating:!Ji(n.validatingFields)}))},w=(U,ee=[],ie,_e,we=!0,pe=!0)=>{if(_e&&ie&&!t.disabled){if(o.action=!0,pe&&Array.isArray(Ye(r,U))){const Se=ie(Ye(r,U),_e.argA,_e.argB);we&&kn(r,U,Se)}if(pe&&Array.isArray(Ye(n.errors,U))){const Se=ie(Ye(n.errors,U),_e.argA,_e.argB);we&&kn(n.errors,U,Se),lOe(n.errors,U)}if((h.touchedFields||u.touchedFields)&&pe&&Array.isArray(Ye(n.touchedFields,U))){const Se=ie(Ye(n.touchedFields,U),_e.argA,_e.argB);we&&kn(n.touchedFields,U,Se)}(h.dirtyFields||u.dirtyFields)&&(n.dirtyFields=BS(s,i)),f.state.next({name:U,isDirty:F(U,ee),dirtyFields:n.dirtyFields,errors:n.errors,isValid:n.isValid})}else kn(i,U,ee)},E=(U,ee)=>{kn(n.errors,U,ee),f.state.next({errors:n.errors})},R=U=>{n.errors=U,f.state.next({errors:n.errors,isValid:!1})},T=(U,ee,ie,_e)=>{const we=Ye(r,U);if(we){const pe=Ye(i,U,Br(ie)?Ye(s,U):ie);Br(pe)||_e&&_e.defaultChecked||ee?kn(i,U,ee?pe:s7(we._f)):Z(U,pe),o.mount&&y()}},N=(U,ee,ie,_e,we)=>{let pe=!1,Se=!1;const Fe={name:U};if(!t.disabled){if(!ie||_e){(h.isDirty||u.isDirty)&&(Se=n.isDirty,n.isDirty=Fe.isDirty=F(),pe=Se!==Fe.isDirty);const ft=gh(Ye(s,U),ee);Se=!!Ye(n.dirtyFields,U),ft?Ps(n.dirtyFields,U):kn(n.dirtyFields,U,!0),Fe.dirtyFields=n.dirtyFields,pe=pe||(h.dirtyFields||u.dirtyFields)&&Se!==!ft}if(ie){const ft=Ye(n.touchedFields,U);ft||(kn(n.touchedFields,U,ie),Fe.touchedFields=n.touchedFields,pe=pe||(h.touchedFields||u.touchedFields)&&ft!==ie)}pe&&we&&f.state.next(Fe)}return pe?Fe:{}},A=(U,ee,ie,_e)=>{const we=Ye(n.errors,U),pe=(h.isValid||u.isValid)&&Ua(ee)&&n.isValid!==ee;if(t.delayError&&ie?(c=x(()=>E(U,ie)),c(t.delayError)):(clearTimeout(d),c=null,ie?kn(n.errors,U,ie):Ps(n.errors,U)),(ie?!gh(we,ie):we)||!Ji(_e)||pe){const Se={..._e,...pe&&Ua(ee)?{isValid:ee}:{},errors:n.errors,name:U};n={...n,...Se},f.state.next(Se)}},D=async U=>{b(U,!0);const ee=await t.resolver(i,t.context,nOe(U||a.mount,r,t.criteriaMode,t.shouldUseNativeValidation));return b(U),ee},O=async U=>{const{errors:ee}=await D(U);if(U)for(const ie of U){const _e=Ye(ee,ie);_e?kn(n.errors,ie,_e):Ps(n.errors,ie)}else n.errors=ee;return ee},I=async(U,ee,ie={valid:!0})=>{for(const _e in U){const we=U[_e];if(we){const{_f:pe,...Se}=we;if(pe){const Fe=a.array.has(pe.name),ft=we._f&&rOe(we._f);ft&&h.validatingFields&&b([_e],!0);const ht=await oU(we,a.disabled,i,m,t.shouldUseNativeValidation&&!ee,Fe);if(ft&&h.validatingFields&&b([_e]),ht[pe.name]&&(ie.valid=!1,ee))break;!ee&&(Ye(ht,pe.name)?Fe?$se(n.errors,ht,pe.name):kn(n.errors,pe.name,ht[pe.name]):Ps(n.errors,pe.name))}!Ji(Se)&&await I(Se,ee,ie)}}return ie.valid},$=()=>{for(const U of a.unMount){const ee=Ye(r,U);ee&&(ee._f.refs?ee._f.refs.every(ie=>!x4(ie)):!x4(ee._f.ref))&&Oe(U)}a.unMount=new Set},F=(U,ee)=>!t.disabled&&(U&&ee&&kn(i,U,ee),!gh(J(),s)),B=(U,ee,ie)=>Nse(U,a,{...o.mount?i:Br(ee)?s:yu(U)?{[U]:ee}:ee},ie,ee),W=U=>oR(Ye(o.mount?i:s,U,t.shouldUnregister?Ye(s,U,[]):[])),Z=(U,ee,ie={})=>{const _e=Ye(r,U);let we=ee;if(_e){const pe=_e._f;pe&&(!pe.disabled&&kn(i,U,Lse(ee,pe)),we=PT(pe.ref)&&Eo(ee)?"":ee,Dse(pe.ref)?[...pe.ref.options].forEach(Se=>Se.selected=we.includes(Se.value)):pe.refs?iR(pe.ref)?pe.refs.length>1?pe.refs.forEach(Se=>(!Se.defaultChecked||!Se.disabled)&&(Se.checked=Array.isArray(we)?!!we.find(Fe=>Fe===Se.value):we===Se.value)):pe.refs[0]&&(pe.refs[0].checked=!!we):pe.refs.forEach(Se=>Se.checked=Se.value===we):g8(pe.ref)?pe.ref.value="":(pe.ref.value=we,pe.ref.type||f.state.next({name:U,values:ts(i)})))}(ie.shouldDirty||ie.shouldTouch)&&N(U,we,ie.shouldTouch,ie.shouldDirty,!0),ie.shouldValidate&&re(U)},Y=(U,ee,ie)=>{for(const _e in ee){const we=ee[_e],pe=`${U}.${_e}`,Se=Ye(r,pe);(a.array.has(U)||ws(we)||Se&&!Se._f)&&!fg(we)?Y(pe,we,ie):Z(pe,we,ie)}},H=(U,ee,ie={})=>{const _e=Ye(r,U),we=a.array.has(U),pe=ts(ee);kn(i,U,pe),we?(f.array.next({name:U,values:ts(i)}),(h.isDirty||h.dirtyFields||u.isDirty||u.dirtyFields)&&ie.shouldDirty&&f.state.next({name:U,dirtyFields:BS(s,i),isDirty:F(U,pe)})):_e&&!_e._f&&!Eo(pe)?Y(U,pe,ie):Z(U,pe,ie),iU(U,a)&&f.state.next({...n}),f.state.next({name:o.mount?U:void 0,values:ts(i)})},se=async U=>{o.mount=!0;const ee=U.target;let ie=ee.name,_e=!0;const we=Ye(r,ie),pe=Se=>{_e=Number.isNaN(Se)||fg(Se)&&isNaN(Se.getTime())||gh(Se,Ye(i,ie,Se))};if(we){let Se,Fe;const ft=ee.type?s7(we._f):Sse(U),ht=U.type===RT.BLUR||U.type===RT.FOCUS_OUT,hs=!sOe(we._f)&&!t.resolver&&!Ye(n.errors,ie)&&!we._f.deps||aOe(ht,Ye(n.touchedFields,ie),n.isSubmitted,v,g),Mn=iU(ie,a,ht);kn(i,ie,ft),ht?(we._f.onBlur&&we._f.onBlur(U),c&&c(0)):we._f.onChange&&we._f.onChange(U);const Hr=N(ie,ft,ht),Yt=!Ji(Hr)||Mn;if(!ht&&f.state.next({name:ie,type:U.type,values:ts(i)}),hs)return(h.isValid||u.isValid)&&(t.mode==="onBlur"?ht&&y():ht||y()),Yt&&f.state.next({name:ie,...Mn?{}:Hr});if(!ht&&Mn&&f.state.next({...n}),t.resolver){const{errors:un}=await D([ie]);if(pe(ft),_e){const xn=o7(n.errors,r,ie),Ze=o7(un,r,xn.name||ie);Se=Ze.error,ie=Ze.name,Fe=Ji(un)}}else b([ie],!0),Se=(await oU(we,a.disabled,i,m,t.shouldUseNativeValidation))[ie],b([ie]),pe(ft),_e&&(Se?Fe=!1:(h.isValid||u.isValid)&&(Fe=await I(r,!0)));_e&&(we._f.deps&&re(we._f.deps),A(ie,Fe,Se,Hr))}},he=(U,ee)=>{if(Ye(n.errors,ee)&&U.focus)return U.focus(),1},re=async(U,ee={})=>{let ie,_e;const we=Zo(U);if(t.resolver){const pe=await O(Br(U)?U:we);ie=Ji(pe),_e=U?!we.some(Se=>Ye(pe,Se)):ie}else U?(_e=(await Promise.all(we.map(async pe=>{const Se=Ye(r,pe);return await I(Se&&Se._f?{[pe]:Se}:Se)}))).every(Boolean),!(!_e&&!n.isValid)&&y()):_e=ie=await I(r);return f.state.next({...!yu(U)||(h.isValid||u.isValid)&&ie!==n.isValid?{}:{name:U},...t.resolver||!U?{isValid:ie}:{},errors:n.errors}),ee.shouldFocus&&!_e&&Ob(r,he,U?we:a.mount),_e},J=U=>{const ee={...o.mount?i:s};return Br(U)?ee:yu(U)?Ye(ee,U):U.map(ie=>Ye(ee,ie))},te=(U,ee)=>({invalid:!!Ye((ee||n).errors,U),isDirty:!!Ye((ee||n).dirtyFields,U),error:Ye((ee||n).errors,U),isValidating:!!Ye(n.validatingFields,U),isTouched:!!Ye((ee||n).touchedFields,U)}),ae=U=>{U&&Zo(U).forEach(ee=>Ps(n.errors,ee)),f.state.next({errors:U?n.errors:{}})},be=(U,ee,ie)=>{const _e=(Ye(r,U,{_f:{}})._f||{}).ref,we=Ye(n.errors,U)||{},{ref:pe,message:Se,type:Fe,...ft}=we;kn(n.errors,U,{...ft,...ee,ref:_e}),f.state.next({name:U,errors:n.errors,isValid:!1}),ie&&ie.shouldFocus&&_e&&_e.focus&&_e.focus()},xe=(U,ee)=>mc(U)?f.state.subscribe({next:ie=>U(B(void 0,ee),ie)}):B(U,ee,!0),ve=U=>f.state.subscribe({next:ee=>{oOe(U.name,ee.name,U.exact)&&iOe(ee,U.formState||h,cn,U.reRenderRoot)&&U.callback({values:{...i},...n,...ee})}}).unsubscribe,Pe=U=>(o.mount=!0,u={...u,...U.formState},ve({...U,formState:u})),Oe=(U,ee={})=>{for(const ie of U?Zo(U):a.mount)a.mount.delete(ie),a.array.delete(ie),ee.keepValue||(Ps(r,ie),Ps(i,ie)),!ee.keepError&&Ps(n.errors,ie),!ee.keepDirty&&Ps(n.dirtyFields,ie),!ee.keepTouched&&Ps(n.touchedFields,ie),!ee.keepIsValidating&&Ps(n.validatingFields,ie),!t.shouldUnregister&&!ee.keepDefaultValue&&Ps(s,ie);f.state.next({values:ts(i)}),f.state.next({...n,...ee.keepDirty?{isDirty:F()}:{}}),!ee.keepIsValid&&y()},ke=({disabled:U,name:ee})=>{(Ua(U)&&o.mount||U||a.disabled.has(ee))&&(U?a.disabled.add(ee):a.disabled.delete(ee))},ze=(U,ee={})=>{let ie=Ye(r,U);const _e=Ua(ee.disabled)||Ua(t.disabled);return kn(r,U,{...ie||{},_f:{...ie&&ie._f?ie._f:{ref:{name:U}},name:U,mount:!0,...ee}}),a.mount.add(U),ie?ke({disabled:Ua(ee.disabled)?ee.disabled:t.disabled,name:U}):T(U,!0,ee.value),{..._e?{disabled:ee.disabled||t.disabled}:{},...t.progressive?{required:!!ee.required,min:US(ee.min),max:US(ee.max),minLength:US(ee.minLength),maxLength:US(ee.maxLength),pattern:US(ee.pattern)}:{},name:U,onChange:se,onBlur:se,ref:we=>{if(we){ze(U,ee),ie=Ye(r,U);const pe=Br(we.value)&&we.querySelectorAll&&we.querySelectorAll("input,select,textarea")[0]||we,Se=JDe(pe),Fe=ie._f.refs||[];if(Se?Fe.find(ft=>ft===pe):pe===ie._f.ref)return;kn(r,U,{_f:{...ie._f,...Se?{refs:[...Fe.filter(x4),pe,...Array.isArray(Ye(s,U))?[{}]:[]],ref:{type:pe.type,name:U}}:{ref:pe}}}),T(U,!1,void 0,pe)}else ie=Ye(r,U,{}),ie._f&&(ie._f.mount=!1),(t.shouldUnregister||ee.shouldUnregister)&&!(Cse(a.array,U)&&o.action)&&a.unMount.add(U)}}},$e=()=>t.shouldFocusError&&Ob(r,he,a.mount),Te=U=>{Ua(U)&&(f.state.next({disabled:U}),Ob(r,(ee,ie)=>{const _e=Ye(r,ie);_e&&(ee.disabled=_e._f.disabled||U,Array.isArray(_e._f.refs)&&_e._f.refs.forEach(we=>{we.disabled=_e._f.disabled||U}))},0,!1))},Ue=(U,ee)=>async ie=>{let _e;ie&&(ie.preventDefault&&ie.preventDefault(),ie.persist&&ie.persist());let we=ts(i);if(f.state.next({isSubmitting:!0}),t.resolver){const{errors:pe,values:Se}=await D();n.errors=pe,we=Se}else await I(r);if(a.disabled.size)for(const pe of a.disabled)kn(we,pe,void 0);if(Ps(n.errors,"root"),Ji(n.errors)){f.state.next({errors:{}});try{await U(we,ie)}catch(pe){_e=pe}}else ee&&await ee({...n.errors},ie),$e(),setTimeout($e);if(f.state.next({isSubmitted:!0,isSubmitting:!1,isSubmitSuccessful:Ji(n.errors)&&!_e,submitCount:n.submitCount+1,errors:n.errors}),_e)throw _e},wt=(U,ee={})=>{Ye(r,U)&&(Br(ee.defaultValue)?H(U,ts(Ye(s,U))):(H(U,ee.defaultValue),kn(s,U,ts(ee.defaultValue))),ee.keepTouched||Ps(n.touchedFields,U),ee.keepDirty||(Ps(n.dirtyFields,U),n.isDirty=ee.defaultValue?F(U,ts(Ye(s,U))):F()),ee.keepError||(Ps(n.errors,U),h.isValid&&y()),f.state.next({...n}))},ut=(U,ee={})=>{const ie=U?ts(U):s,_e=ts(ie),we=Ji(U),pe=we?s:_e;if(ee.keepDefaultValues||(s=ie),!ee.keepValues){if(ee.keepDirtyValues){const Se=new Set([...a.mount,...Object.keys(BS(s,i))]);for(const Fe of Array.from(Se))Ye(n.dirtyFields,Fe)?kn(pe,Fe,Ye(i,Fe)):H(Fe,Ye(pe,Fe))}else{if(p8&&Br(U))for(const Se of a.mount){const Fe=Ye(r,Se);if(Fe&&Fe._f){const ft=Array.isArray(Fe._f.refs)?Fe._f.refs[0]:Fe._f.ref;if(PT(ft)){const ht=ft.closest("form");if(ht){ht.reset();break}}}}for(const Se of a.mount)H(Se,Ye(pe,Se))}i=ts(pe),f.array.next({values:{...pe}}),f.state.next({values:{...pe}})}a={mount:ee.keepDirtyValues?a.mount:new Set,unMount:new Set,array:new Set,disabled:new Set,watch:new Set,watchAll:!1,focus:""},o.mount=!h.isValid||!!ee.keepIsValid||!!ee.keepDirtyValues,o.watch=!!t.shouldUnregister,f.state.next({submitCount:ee.keepSubmitCount?n.submitCount:0,isDirty:we?!1:ee.keepDirty?n.isDirty:!!(ee.keepDefaultValues&&!gh(U,s)),isSubmitted:ee.keepIsSubmitted?n.isSubmitted:!1,dirtyFields:we?{}:ee.keepDirtyValues?ee.keepDefaultValues&&i?BS(s,i):n.dirtyFields:ee.keepDefaultValues&&U?BS(s,U):ee.keepDirty?n.dirtyFields:{},touchedFields:ee.keepTouched?n.touchedFields:{},errors:ee.keepErrors?n.errors:{},isSubmitSuccessful:ee.keepIsSubmitSuccessful?n.isSubmitSuccessful:!1,isSubmitting:!1})},St=(U,ee)=>ut(mc(U)?U(i):U,ee),Nn=(U,ee={})=>{const ie=Ye(r,U),_e=ie&&ie._f;if(_e){const we=_e.refs?_e.refs[0]:_e.ref;we.focus&&(we.focus(),ee.shouldSelect&&mc(we.select)&&we.select())}},cn=U=>{n={...n,...U}},It={control:{register:ze,unregister:Oe,getFieldState:te,handleSubmit:Ue,setError:be,_subscribe:ve,_runSchema:D,_getWatch:B,_getDirty:F,_setValid:y,_setFieldArray:w,_setDisabledField:ke,_setErrors:R,_getFieldArray:W,_reset:ut,_resetDefaultValues:()=>mc(t.defaultValues)&&t.defaultValues().then(U=>{St(U,t.resetOptions),f.state.next({isLoading:!1})}),_removeUnmounted:$,_disableForm:Te,_subjects:f,_proxyFormState:h,get _fields(){return r},get _formValues(){return i},get _state(){return o},set _state(U){o=U},get _defaultValues(){return s},get _names(){return a},set _names(U){a=U},get _formState(){return n},get _options(){return t},set _options(U){t={...t,...U}}},subscribe:Pe,trigger:re,register:ze,handleSubmit:Ue,watch:xe,setValue:H,getValues:J,reset:St,resetField:wt,clearErrors:ae,unregister:Oe,setError:be,setFocus:Nn,getFieldState:te};return{...It,formControl:It}}var Jf=()=>{const e=typeof performance>"u"?Date.now():performance.now()*1e3;return"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,t=>{const n=(Math.random()*16+e)%16|0;return(t=="x"?n:n&3|8).toString(16)})},_4=(e,t,n={})=>n.shouldFocus||Br(n.shouldFocus)?n.focusName||`${e}.${Br(n.focusIndex)?t:n.focusIndex}.`:"",w4=(e,t)=>[...e,...Zo(t)],S4=e=>Array.isArray(e)?e.map(()=>{}):void 0;function C4(e,t,n){return[...e.slice(0,t),...Zo(n),...e.slice(t)]}var E4=(e,t,n)=>Array.isArray(e)?(Br(e[n])&&(e[n]=void 0),e.splice(n,0,e.splice(t,1)[0]),e):[],A4=(e,t)=>[...Zo(t),...Zo(e)];function dOe(e,t){let n=0;const r=[...e];for(const s of t)r.splice(s-n,1),n++;return oR(r).length?r:[]}var R4=(e,t)=>Br(t)?[]:dOe(e,Zo(t).sort((n,r)=>n-r)),P4=(e,t,n)=>{[e[t],e[n]]=[e[n],e[t]]},l7=(e,t,n)=>(e[t]=n,e);function fOe(e){const t=ua(),{control:n=t.control,name:r,keyName:s="id",shouldUnregister:i,rules:o}=e,[a,c]=fe.useState(n._getFieldArray(r)),d=fe.useRef(n._getFieldArray(r).map(Jf)),h=fe.useRef(a),u=fe.useRef(r),f=fe.useRef(!1);u.current=r,h.current=a,n._names.array.add(r),o&&n.register(r,o),fe.useEffect(()=>n._subjects.array.subscribe({next:({values:T,name:N})=>{if(N===u.current||!N){const A=Ye(T,u.current);Array.isArray(A)&&(c(A),d.current=A.map(Jf))}}}).unsubscribe,[n]);const g=fe.useCallback(T=>{f.current=!0,n._setFieldArray(r,T)},[n,r]),v=(T,N)=>{const A=Zo(ts(T)),D=w4(n._getFieldArray(r),A);n._names.focus=_4(r,D.length-1,N),d.current=w4(d.current,A.map(Jf)),g(D),c(D),n._setFieldArray(r,D,w4,{argA:S4(T)})},m=(T,N)=>{const A=Zo(ts(T)),D=A4(n._getFieldArray(r),A);n._names.focus=_4(r,0,N),d.current=A4(d.current,A.map(Jf)),g(D),c(D),n._setFieldArray(r,D,A4,{argA:S4(T)})},x=T=>{const N=R4(n._getFieldArray(r),T);d.current=R4(d.current,T),g(N),c(N),!Array.isArray(Ye(n._fields,r))&&kn(n._fields,r,void 0),n._setFieldArray(r,N,R4,{argA:T})},y=(T,N,A)=>{const D=Zo(ts(N)),O=C4(n._getFieldArray(r),T,D);n._names.focus=_4(r,T,A),d.current=C4(d.current,T,D.map(Jf)),g(O),c(O),n._setFieldArray(r,O,C4,{argA:T,argB:S4(N)})},b=(T,N)=>{const A=n._getFieldArray(r);P4(A,T,N),P4(d.current,T,N),g(A),c(A),n._setFieldArray(r,A,P4,{argA:T,argB:N},!1)},w=(T,N)=>{const A=n._getFieldArray(r);E4(A,T,N),E4(d.current,T,N),g(A),c(A),n._setFieldArray(r,A,E4,{argA:T,argB:N},!1)},E=(T,N)=>{const A=ts(N),D=l7(n._getFieldArray(r),T,A);d.current=[...D].map((O,I)=>!O||I===T?Jf():d.current[I]),g(D),c([...D]),n._setFieldArray(r,D,l7,{argA:T,argB:A},!0,!1)},R=T=>{const N=Zo(ts(T));d.current=N.map(Jf),g([...N]),c([...N]),n._setFieldArray(r,[...N],A=>A,{},!0,!1)};return fe.useEffect(()=>{if(n._state.action=!1,iU(r,n._names)&&n._subjects.state.next({...n._formState}),f.current&&(!gb(n._options.mode).isOnSubmit||n._formState.isSubmitted)&&!gb(n._options.reValidateMode).isOnSubmit)if(n._options.resolver)n._runSchema([r]).then(T=>{const N=Ye(T.errors,r),A=Ye(n._formState.errors,r);(A?!N&&A.type||N&&(A.type!==N.type||A.message!==N.message):N&&N.type)&&(N?kn(n._formState.errors,r,N):Ps(n._formState.errors,r),n._subjects.state.next({errors:n._formState.errors}))});else{const T=Ye(n._fields,r);T&&T._f&&!(gb(n._options.reValidateMode).isOnSubmit&&gb(n._options.mode).isOnSubmit)&&oU(T,n._names.disabled,n._formValues,n._options.criteriaMode===gl.all,n._options.shouldUseNativeValidation,!0).then(N=>!Ji(N)&&n._subjects.state.next({errors:$se(n._formState.errors,N,r)}))}n._subjects.state.next({name:r,values:ts(n._formValues)}),n._names.focus&&Ob(n._fields,(T,N)=>{if(n._names.focus&&N.startsWith(n._names.focus)&&T.focus)return T.focus(),1}),n._names.focus="",n._setValid(),f.current=!1},[a,r,n]),fe.useEffect(()=>(!Ye(n._formValues,r)&&n._setFieldArray(r),()=>{const T=(N,A)=>{const D=Ye(n._fields,N);D&&D._f&&(D._f.mount=A)};n._options.shouldUnregister||i?n.unregister(r):T(r,!1)}),[r,n,s,i]),{swap:fe.useCallback(b,[g,r,n]),move:fe.useCallback(w,[g,r,n]),prepend:fe.useCallback(m,[g,r,n]),append:fe.useCallback(v,[g,r,n]),remove:fe.useCallback(x,[g,r,n]),insert:fe.useCallback(y,[g,r,n]),update:fe.useCallback(E,[g,r,n]),replace:fe.useCallback(R,[g,r,n]),fields:fe.useMemo(()=>a.map((T,N)=>({...T,[s]:d.current[N]||Jf()})),[a,s])}}function aR(e={}){const t=fe.useRef(void 0),n=fe.useRef(void 0),[r,s]=fe.useState({isDirty:!1,isValidating:!1,isLoading:mc(e.defaultValues),isSubmitted:!1,isSubmitting:!1,isSubmitSuccessful:!1,isValid:!1,submitCount:0,dirtyFields:{},touchedFields:{},validatingFields:{},errors:e.errors||{},disabled:e.disabled||!1,defaultValues:mc(e.defaultValues)?void 0:e.defaultValues});t.current||(t.current={...e.formControl?e.formControl:uOe(e),formState:r},e.formControl&&e.defaultValues&&!mc(e.defaultValues)&&e.formControl.reset(e.defaultValues,e.resetOptions));const i=t.current.control;return i._options=e,fe.useLayoutEffect(()=>i._subscribe({formState:i._proxyFormState,callback:()=>s({...i._formState}),reRenderRoot:!0}),[i]),fe.useEffect(()=>i._disableForm(e.disabled),[i,e.disabled]),fe.useEffect(()=>{if(i._proxyFormState.isDirty){const o=i._getDirty();o!==r.isDirty&&i._subjects.state.next({isDirty:o})}},[i,r.isDirty]),fe.useEffect(()=>{e.values&&!gh(e.values,n.current)?(i._reset(e.values,i._options.resetOptions),n.current=e.values,s(o=>({...o}))):i._resetDefaultValues()},[e.values,i]),fe.useEffect(()=>{e.errors&&!Ji(e.errors)&&i._setErrors(e.errors)},[e.errors,i]),fe.useEffect(()=>{i._state.mount||(i._setValid(),i._state.mount=!0),i._state.watch&&(i._state.watch=!1,i._subjects.state.next({...i._formState})),i._removeUnmounted()}),fe.useEffect(()=>{e.shouldUnregister&&i._subjects.state.next({values:i._getWatch()})},[e.shouldUnregister,i]),t.current.formState=Rse(r,i),t.current}var hOe="Label",Fse=C.forwardRef((e,t)=>_.jsx(He.label,{...e,ref:t,onMouseDown:n=>{var s;n.target.closest("button, input, select, textarea")||((s=e.onMouseDown)==null||s.call(e,n),!n.defaultPrevented&&n.detail>1&&n.preventDefault())}}));Fse.displayName=hOe;var zse=Fse;const pOe=Io("text-sm font-medium leading-none peer-disabled:cursor-not-allowed peer-disabled:opacity-70"),gy=C.forwardRef(({className:e,...t},n)=>_.jsx(zse,{ref:n,className:ge(pOe(),e),...t}));gy.displayName=zse.displayName;const lR=XDe,Bse=C.createContext({}),Hx=({...e})=>_.jsx(Bse.Provider,{value:{name:e.name},children:_.jsx(ZDe,{...e})}),Wx=()=>{const e=C.useContext(Bse),t=C.useContext(Use),{getFieldState:n,formState:r}=ua(),s=n(e.name,r);if(!e)throw new Error("useFormField should be used within <FormField>");const{id:i}=t;return{id:i,name:e.name,formItemId:`${i}-form-item`,formDescriptionId:`${i}-form-item-description`,formMessageId:`${i}-form-item-message`,...s}},Use=C.createContext({}),vy=C.forwardRef(({className:e,...t},n)=>{const r=C.useId();return _.jsx(Use.Provider,{value:{id:r},children:_.jsx("div",{ref:n,className:ge("space-y-2",e),...t})})});vy.displayName="FormItem";const Vse=C.forwardRef(({className:e,...t},n)=>{const{error:r,formItemId:s}=Wx();return _.jsx(gy,{ref:n,className:ge(r&&"text-destructive",e),htmlFor:s,...t})});Vse.displayName="FormLabel";const yy=C.forwardRef(({...e},t)=>{const{error:n,formItemId:r,formDescriptionId:s,formMessageId:i}=Wx();return _.jsx(Cc,{ref:t,id:r,"aria-describedby":n?`${s} ${i}`:`${s}`,"aria-invalid":!!n,...e})});yy.displayName="FormControl";const by=C.forwardRef(({className:e,...t},n)=>{const{formDescriptionId:r}=Wx();return _.jsx("p",{ref:n,id:r,className:ge("text-[0.8rem] text-muted-foreground",e),...t})});by.displayName="FormDescription";const Hse=C.forwardRef(({className:e,children:t,...n},r)=>{const{error:s,formMessageId:i}=Wx(),o=s?String((s==null?void 0:s.message)??""):t;return o?_.jsx("p",{ref:r,id:i,className:ge("text-[0.8rem] font-medium text-destructive",e),...n,children:o}):null});Hse.displayName="FormMessage";var N4,Wse="HoverCard",[qse,p7e]=_r(Wse,[Iu]),y8=Iu(),[m7e,b8]=qse(Wse),Gse="HoverCardTrigger",mOe=C.forwardRef((e,t)=>{const{__scopeHoverCard:n,...r}=e,s=b8(Gse,n),i=y8(n);return _.jsx(Ux,{asChild:!0,...i,children:_.jsx(He.a,{"data-state":s.open?"open":"closed",...r,ref:t,onPointerEnter:Ae(e.onPointerEnter,DT(s.onOpen)),onPointerLeave:Ae(e.onPointerLeave,DT(s.onClose)),onFocus:Ae(e.onFocus,s.onOpen),onBlur:Ae(e.onBlur,s.onClose),onTouchStart:Ae(e.onTouchStart,o=>o.preventDefault())})})});mOe.displayName=Gse;var gOe="HoverCardPortal",[g7e,vOe]=qse(gOe,{forceMount:void 0}),kT="HoverCardContent",Kse=C.forwardRef((e,t)=>{const n=vOe(kT,e.__scopeHoverCard),{forceMount:r=n.forceMount,...s}=e,i=b8(kT,e.__scopeHoverCard);return _.jsx(Vr,{present:r||i.open,children:_.jsx(yOe,{"data-state":i.open?"open":"closed",...s,onPointerEnter:Ae(e.onPointerEnter,DT(i.onOpen)),onPointerLeave:Ae(e.onPointerLeave,DT(i.onClose)),ref:t})})});Kse.displayName=kT;var yOe=C.forwardRef((e,t)=>{const{__scopeHoverCard:n,onEscapeKeyDown:r,onPointerDownOutside:s,onFocusOutside:i,onInteractOutside:o,...a}=e,c=b8(kT,n),d=y8(n),h=C.useRef(null),u=_t(t,h),[f,g]=C.useState(!1);return C.useEffect(()=>{if(f){const v=document.body;return N4=v.style.userSelect||v.style.webkitUserSelect,v.style.userSelect="none",v.style.webkitUserSelect="none",()=>{v.style.userSelect=N4,v.style.webkitUserSelect=N4}}},[f]),C.useEffect(()=>{if(h.current){const v=()=>{g(!1),c.isPointerDownOnContentRef.current=!1,setTimeout(()=>{var x;((x=document.getSelection())==null?void 0:x.toString())!==""&&(c.hasSelectionRef.current=!0)})};return document.addEventListener("pointerup",v),()=>{document.removeEventListener("pointerup",v),c.hasSelectionRef.current=!1,c.isPointerDownOnContentRef.current=!1}}},[c.isPointerDownOnContentRef,c.hasSelectionRef]),C.useEffect(()=>{h.current&&_Oe(h.current).forEach(m=>m.setAttribute("tabindex","-1"))}),_.jsx(Hf,{asChild:!0,disableOutsidePointerEvents:!1,onInteractOutside:o,onEscapeKeyDown:r,onPointerDownOutside:s,onFocusOutside:Ae(i,v=>{v.preventDefault()}),onDismiss:c.onDismiss,children:_.jsx(YA,{...d,...a,onPointerDown:Ae(a.onPointerDown,v=>{v.currentTarget.contains(v.target)&&g(!0),c.hasSelectionRef.current=!1,c.isPointerDownOnContentRef.current=!0}),ref:u,style:{...a.style,userSelect:f?"text":void 0,WebkitUserSelect:f?"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)"}})})}),bOe="HoverCardArrow",xOe=C.forwardRef((e,t)=>{const{__scopeHoverCard:n,...r}=e,s=y8(n);return _.jsx(XA,{...s,...r,ref:t})});xOe.displayName=bOe;function DT(e){return t=>t.pointerType==="touch"?void 0:e()}function _Oe(e){const t=[],n=document.createTreeWalker(e,NodeFilter.SHOW_ELEMENT,{acceptNode:r=>r.tabIndex>=0?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP});for(;n.nextNode();)t.push(n.currentNode);return t}var Yse=Kse;const wOe=C.forwardRef(({className:e,align:t="center",sideOffset:n=4,...r},s)=>_.jsx(Yse,{ref:s,align:t,sideOffset:n,className:ge("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",e),...r}));wOe.displayName=Yse.displayName;const cR=C.forwardRef(({className:e,type:t,...n},r)=>_.jsx("input",{type:t,className:ge("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",e),ref:r,...n}));cR.displayName="Input";var QD="Menubar",[aU,SOe,COe]=Uf(QD),[Xse,v7e]=_r(QD,[COe,Lu]),da=eR(),Qse=Lu(),[EOe,Zse]=Xse(QD),Jse=C.forwardRef((e,t)=>{const{__scopeMenubar:n,value:r,onValueChange:s,defaultValue:i,loop:o=!0,dir:a,...c}=e,d=kc(a),h=Qse(n),[u="",f]=os({prop:r,onChange:s,defaultProp:i}),[g,v]=C.useState(null);return _.jsx(EOe,{scope:n,value:u,onMenuOpen:C.useCallback(m=>{f(m),v(m)},[f]),onMenuClose:C.useCallback(()=>f(""),[f]),onMenuToggle:C.useCallback(m=>{f(x=>x?"":m),v(m)},[f]),dir:d,loop:o,children:_.jsx(aU.Provider,{scope:n,children:_.jsx(aU.Slot,{scope:n,children:_.jsx(QA,{asChild:!0,...h,orientation:"horizontal",loop:o,dir:d,currentTabStopId:g,onCurrentTabStopIdChange:v,children:_.jsx(He.div,{role:"menubar",...c,ref:t})})})})})});Jse.displayName=QD;var AOe="MenubarMenu",[y7e,eie]=Xse(AOe),lU="MenubarTrigger",tie=C.forwardRef((e,t)=>{const{__scopeMenubar:n,disabled:r=!1,...s}=e,i=Qse(n),o=da(n),a=Zse(lU,n),c=eie(lU,n),d=C.useRef(null),h=_t(t,d,c.triggerRef),[u,f]=C.useState(!1),g=a.value===c.value;return _.jsx(aU.ItemSlot,{scope:n,value:c.value,disabled:r,children:_.jsx(ZA,{asChild:!0,...i,focusable:!r,tabStopId:c.value,children:_.jsx(B6,{asChild:!0,...o,children:_.jsx(He.button,{type:"button",role:"menuitem",id:c.triggerId,"aria-haspopup":"menu","aria-expanded":g,"aria-controls":g?c.contentId:void 0,"data-highlighted":u?"":void 0,"data-state":g?"open":"closed","data-disabled":r?"":void 0,disabled:r,...s,ref:h,onPointerDown:Ae(e.onPointerDown,v=>{!r&&v.button===0&&v.ctrlKey===!1&&(a.onMenuOpen(c.value),g||v.preventDefault())}),onPointerEnter:Ae(e.onPointerEnter,()=>{var m;!!a.value&&!g&&(a.onMenuOpen(c.value),(m=d.current)==null||m.focus())}),onKeyDown:Ae(e.onKeyDown,v=>{r||(["Enter"," "].includes(v.key)&&a.onMenuToggle(c.value),v.key==="ArrowDown"&&a.onMenuOpen(c.value),["Enter"," ","ArrowDown"].includes(v.key)&&(c.wasKeyboardTriggerOpenRef.current=!0,v.preventDefault()))}),onFocus:Ae(e.onFocus,()=>f(!0)),onBlur:Ae(e.onBlur,()=>f(!1))})})})})});tie.displayName=lU;var ROe="MenubarPortal",nie=e=>{const{__scopeMenubar:t,...n}=e,r=da(t);return _.jsx(U6,{...r,...n})};nie.displayName=ROe;var cU="MenubarContent",rie=C.forwardRef((e,t)=>{const{__scopeMenubar:n,align:r="start",...s}=e,i=da(n),o=Zse(cU,n),a=eie(cU,n),c=SOe(n),d=C.useRef(!1);return _.jsx(V6,{id:a.contentId,"aria-labelledby":a.triggerId,"data-radix-menubar-content":"",...i,...s,ref:t,align:r,onCloseAutoFocus:Ae(e.onCloseAutoFocus,h=>{var f;!!!o.value&&!d.current&&((f=a.triggerRef.current)==null||f.focus()),d.current=!1,h.preventDefault()}),onFocusOutside:Ae(e.onFocusOutside,h=>{const u=h.target;c().some(g=>{var v;return(v=g.ref.current)==null?void 0:v.contains(u)})&&h.preventDefault()}),onInteractOutside:Ae(e.onInteractOutside,()=>{d.current=!0}),onEntryFocus:h=>{a.wasKeyboardTriggerOpenRef.current||h.preventDefault()},onKeyDown:Ae(e.onKeyDown,h=>{if(["ArrowRight","ArrowLeft"].includes(h.key)){const u=h.target,f=u.hasAttribute("data-radix-menubar-subtrigger"),g=u.closest("[data-radix-menubar-content]")!==h.currentTarget,m=(o.dir==="rtl"?"ArrowRight":"ArrowLeft")===h.key;if(!m&&f||g&&m)return;let b=c().filter(R=>!R.disabled).map(R=>R.value);m&&b.reverse();const w=b.indexOf(a.value);b=o.loop?UOe(b,w+1):b.slice(w+1);const[E]=b;E&&o.onMenuOpen(E)}},{checkForDefaultPrevented:!1}),style:{...e.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)"}})});rie.displayName=cU;var POe="MenubarGroup",NOe=C.forwardRef((e,t)=>{const{__scopeMenubar:n,...r}=e,s=da(n);return _.jsx(H6,{...s,...r,ref:t})});NOe.displayName=POe;var TOe="MenubarLabel",sie=C.forwardRef((e,t)=>{const{__scopeMenubar:n,...r}=e,s=da(n);return _.jsx(W6,{...s,...r,ref:t})});sie.displayName=TOe;var kOe="MenubarItem",iie=C.forwardRef((e,t)=>{const{__scopeMenubar:n,...r}=e,s=da(n);return _.jsx(q6,{...s,...r,ref:t})});iie.displayName=kOe;var DOe="MenubarCheckboxItem",oie=C.forwardRef((e,t)=>{const{__scopeMenubar:n,...r}=e,s=da(n);return _.jsx(G6,{...s,...r,ref:t})});oie.displayName=DOe;var OOe="MenubarRadioGroup",MOe=C.forwardRef((e,t)=>{const{__scopeMenubar:n,...r}=e,s=da(n);return _.jsx(K6,{...s,...r,ref:t})});MOe.displayName=OOe;var IOe="MenubarRadioItem",aie=C.forwardRef((e,t)=>{const{__scopeMenubar:n,...r}=e,s=da(n);return _.jsx(Y6,{...s,...r,ref:t})});aie.displayName=IOe;var LOe="MenubarItemIndicator",lie=C.forwardRef((e,t)=>{const{__scopeMenubar:n,...r}=e,s=da(n);return _.jsx(X6,{...s,...r,ref:t})});lie.displayName=LOe;var jOe="MenubarSeparator",cie=C.forwardRef((e,t)=>{const{__scopeMenubar:n,...r}=e,s=da(n);return _.jsx(Q6,{...s,...r,ref:t})});cie.displayName=jOe;var $Oe="MenubarArrow",FOe=C.forwardRef((e,t)=>{const{__scopeMenubar:n,...r}=e,s=da(n);return _.jsx(Z6,{...s,...r,ref:t})});FOe.displayName=$Oe;var zOe="MenubarSubTrigger",uie=C.forwardRef((e,t)=>{const{__scopeMenubar:n,...r}=e,s=da(n);return _.jsx(J6,{"data-radix-menubar-subtrigger":"",...s,...r,ref:t})});uie.displayName=zOe;var BOe="MenubarSubContent",die=C.forwardRef((e,t)=>{const{__scopeMenubar:n,...r}=e,s=da(n);return _.jsx(e8,{...s,"data-radix-menubar-content":"",...r,ref:t,style:{...e.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)"}})});die.displayName=BOe;function UOe(e,t){return e.map((n,r)=>e[(t+r)%e.length])}var fie=Jse,hie=tie,VOe=nie,pie=rie,mie=sie,gie=iie,vie=oie,yie=aie,bie=lie,xie=cie,_ie=uie,wie=die;const HOe=C.forwardRef(({className:e,...t},n)=>_.jsx(fie,{ref:n,className:ge("flex h-10 items-center space-x-1 rounded-md border bg-background p-1",e),...t}));HOe.displayName=fie.displayName;const WOe=C.forwardRef(({className:e,...t},n)=>_.jsx(hie,{ref:n,className:ge("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",e),...t}));WOe.displayName=hie.displayName;const qOe=C.forwardRef(({className:e,inset:t,children:n,...r},s)=>_.jsxs(_ie,{ref:s,className:ge("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",t&&"pl-8",e),...r,children:[n,_.jsx(Tx,{className:"ml-auto h-4 w-4"})]}));qOe.displayName=_ie.displayName;const GOe=C.forwardRef(({className:e,...t},n)=>_.jsx(wie,{ref:n,className:ge("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",e),...t}));GOe.displayName=wie.displayName;const KOe=C.forwardRef(({className:e,align:t="start",alignOffset:n=-4,sideOffset:r=8,...s},i)=>_.jsx(VOe,{children:_.jsx(pie,{ref:i,align:t,alignOffset:n,sideOffset:r,className:ge("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",e),...s})}));KOe.displayName=pie.displayName;const YOe=C.forwardRef(({className:e,inset:t,...n},r)=>_.jsx(gie,{ref:r,className:ge("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",t&&"pl-8",e),...n}));YOe.displayName=gie.displayName;const XOe=C.forwardRef(({className:e,children:t,checked:n,...r},s)=>_.jsxs(vie,{ref:s,className:ge("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",e),checked:n,...r,children:[_.jsx("span",{className:"absolute left-2 flex h-3.5 w-3.5 items-center justify-center",children:_.jsx(bie,{children:_.jsx(OA,{className:"h-4 w-4"})})}),t]}));XOe.displayName=vie.displayName;const QOe=C.forwardRef(({className:e,children:t,...n},r)=>_.jsxs(yie,{ref:r,className:ge("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",e),...n,children:[_.jsx("span",{className:"absolute left-2 flex h-3.5 w-3.5 items-center justify-center",children:_.jsx(bie,{children:_.jsx(cD,{className:"h-2 w-2 fill-current"})})}),t]}));QOe.displayName=yie.displayName;const ZOe=C.forwardRef(({className:e,inset:t,...n},r)=>_.jsx(mie,{ref:r,className:ge("px-2 py-1.5 text-sm font-semibold",t&&"pl-8",e),...n}));ZOe.displayName=mie.displayName;const JOe=C.forwardRef(({className:e,...t},n)=>_.jsx(xie,{ref:n,className:ge("-mx-1 my-1 h-px bg-muted",e),...t}));JOe.displayName=xie.displayName;var eMe="VisuallyHidden",uR=C.forwardRef((e,t)=>_.jsx(He.span,{...e,ref:t,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",...e.style}}));uR.displayName=eMe;var Sie=uR,qx="NavigationMenu",[x8,Cie,tMe]=Uf(qx),[uU,nMe,rMe]=Uf(qx),[_8,b7e]=_r(qx,[tMe,rMe]),[sMe,Pl]=_8(qx),[iMe,oMe]=_8(qx),Eie=C.forwardRef((e,t)=>{const{__scopeNavigationMenu:n,value:r,onValueChange:s,defaultValue:i,delayDuration:o=200,skipDelayDuration:a=300,orientation:c="horizontal",dir:d,...h}=e,[u,f]=C.useState(null),g=_t(t,D=>f(D)),v=kc(d),m=C.useRef(0),x=C.useRef(0),y=C.useRef(0),[b,w]=C.useState(!0),[E="",R]=os({prop:r,onChange:D=>{const O=D!=="",I=a>0;O?(window.clearTimeout(y.current),I&&w(!1)):(window.clearTimeout(y.current),y.current=window.setTimeout(()=>w(!0),a)),s==null||s(D)},defaultProp:i}),T=C.useCallback(()=>{window.clearTimeout(x.current),x.current=window.setTimeout(()=>R(""),150)},[R]),N=C.useCallback(D=>{window.clearTimeout(x.current),R(D)},[R]),A=C.useCallback(D=>{E===D?window.clearTimeout(x.current):m.current=window.setTimeout(()=>{window.clearTimeout(x.current),R(D)},o)},[E,R,o]);return C.useEffect(()=>()=>{window.clearTimeout(m.current),window.clearTimeout(x.current),window.clearTimeout(y.current)},[]),_.jsx(Rie,{scope:n,isRootMenu:!0,value:E,dir:v,orientation:c,rootNavigationMenu:u,onTriggerEnter:D=>{window.clearTimeout(m.current),b?A(D):N(D)},onTriggerLeave:()=>{window.clearTimeout(m.current),T()},onContentEnter:()=>window.clearTimeout(x.current),onContentLeave:T,onItemSelect:D=>{R(O=>O===D?"":D)},onItemDismiss:()=>R(""),children:_.jsx(He.nav,{"aria-label":"Main","data-orientation":c,dir:v,...h,ref:g})})});Eie.displayName=qx;var Aie="NavigationMenuSub",aMe=C.forwardRef((e,t)=>{const{__scopeNavigationMenu:n,value:r,onValueChange:s,defaultValue:i,orientation:o="horizontal",...a}=e,c=Pl(Aie,n),[d="",h]=os({prop:r,onChange:s,defaultProp:i});return _.jsx(Rie,{scope:n,isRootMenu:!1,value:d,dir:c.dir,orientation:o,rootNavigationMenu:c.rootNavigationMenu,onTriggerEnter:u=>h(u),onItemSelect:u=>h(u),onItemDismiss:()=>h(""),children:_.jsx(He.div,{"data-orientation":o,...a,ref:t})})});aMe.displayName=Aie;var Rie=e=>{const{scope:t,isRootMenu:n,rootNavigationMenu:r,dir:s,orientation:i,children:o,value:a,onItemSelect:c,onItemDismiss:d,onTriggerEnter:h,onTriggerLeave:u,onContentEnter:f,onContentLeave:g}=e,[v,m]=C.useState(null),[x,y]=C.useState(new Map),[b,w]=C.useState(null);return _.jsx(sMe,{scope:t,isRootMenu:n,rootNavigationMenu:r,value:a,previousValue:$x(a),baseId:si(),dir:s,orientation:i,viewport:v,onViewportChange:m,indicatorTrack:b,onIndicatorTrackChange:w,onTriggerEnter:bn(h),onTriggerLeave:bn(u),onContentEnter:bn(f),onContentLeave:bn(g),onItemSelect:bn(c),onItemDismiss:bn(d),onViewportContentChange:C.useCallback((E,R)=>{y(T=>(T.set(E,R),new Map(T)))},[]),onViewportContentRemove:C.useCallback(E=>{y(R=>R.has(E)?(R.delete(E),new Map(R)):R)},[]),children:_.jsx(x8.Provider,{scope:t,children:_.jsx(iMe,{scope:t,items:x,children:o})})})},Pie="NavigationMenuList",Nie=C.forwardRef((e,t)=>{const{__scopeNavigationMenu:n,...r}=e,s=Pl(Pie,n),i=_.jsx(He.ul,{"data-orientation":s.orientation,...r,ref:t});return _.jsx(He.div,{style:{position:"relative"},ref:s.onIndicatorTrackChange,children:_.jsx(x8.Slot,{scope:n,children:s.isRootMenu?_.jsx(jie,{asChild:!0,children:i}):i})})});Nie.displayName=Pie;var Tie="NavigationMenuItem",[lMe,kie]=_8(Tie),cMe=C.forwardRef((e,t)=>{const{__scopeNavigationMenu:n,value:r,...s}=e,i=si(),o=r||i||"LEGACY_REACT_AUTO_VALUE",a=C.useRef(null),c=C.useRef(null),d=C.useRef(null),h=C.useRef(()=>{}),u=C.useRef(!1),f=C.useCallback((v="start")=>{if(a.current){h.current();const m=fU(a.current);m.length&&C8(v==="start"?m:m.reverse())}},[]),g=C.useCallback(()=>{if(a.current){const v=fU(a.current);v.length&&(h.current=vMe(v))}},[]);return _.jsx(lMe,{scope:n,value:o,triggerRef:c,contentRef:a,focusProxyRef:d,wasEscapeCloseRef:u,onEntryKeyDown:f,onFocusProxyEnter:f,onRootContentClose:g,onContentFocusOutside:g,children:_.jsx(He.li,{...s,ref:t})})});cMe.displayName=Tie;var dU="NavigationMenuTrigger",Die=C.forwardRef((e,t)=>{const{__scopeNavigationMenu:n,disabled:r,...s}=e,i=Pl(dU,e.__scopeNavigationMenu),o=kie(dU,e.__scopeNavigationMenu),a=C.useRef(null),c=_t(a,o.triggerRef,t),d=Fie(i.baseId,o.value),h=zie(i.baseId,o.value),u=C.useRef(!1),f=C.useRef(!1),g=o.value===i.value;return _.jsxs(_.Fragment,{children:[_.jsx(x8.ItemSlot,{scope:n,value:o.value,children:_.jsx($ie,{asChild:!0,children:_.jsx(He.button,{id:d,disabled:r,"data-disabled":r?"":void 0,"data-state":E8(g),"aria-expanded":g,"aria-controls":h,...s,ref:c,onPointerEnter:Ae(e.onPointerEnter,()=>{f.current=!1,o.wasEscapeCloseRef.current=!1}),onPointerMove:Ae(e.onPointerMove,OT(()=>{r||f.current||o.wasEscapeCloseRef.current||u.current||(i.onTriggerEnter(o.value),u.current=!0)})),onPointerLeave:Ae(e.onPointerLeave,OT(()=>{r||(i.onTriggerLeave(),u.current=!1)})),onClick:Ae(e.onClick,()=>{i.onItemSelect(o.value),f.current=g}),onKeyDown:Ae(e.onKeyDown,v=>{const x={horizontal:"ArrowDown",vertical:i.dir==="rtl"?"ArrowLeft":"ArrowRight"}[i.orientation];g&&v.key===x&&(o.onEntryKeyDown(),v.preventDefault())})})})}),g&&_.jsxs(_.Fragment,{children:[_.jsx(Sie,{"aria-hidden":!0,tabIndex:0,ref:o.focusProxyRef,onFocus:v=>{const m=o.contentRef.current,x=v.relatedTarget,y=x===a.current,b=m==null?void 0:m.contains(x);(y||!b)&&o.onFocusProxyEnter(y?"start":"end")}}),i.viewport&&_.jsx("span",{"aria-owns":h})]})]})});Die.displayName=dU;var uMe="NavigationMenuLink",c7="navigationMenu.linkSelect",dMe=C.forwardRef((e,t)=>{const{__scopeNavigationMenu:n,active:r,onSelect:s,...i}=e;return _.jsx($ie,{asChild:!0,children:_.jsx(He.a,{"data-active":r?"":void 0,"aria-current":r?"page":void 0,...i,ref:t,onClick:Ae(e.onClick,o=>{const a=o.target,c=new CustomEvent(c7,{bubbles:!0,cancelable:!0});if(a.addEventListener(c7,d=>s==null?void 0:s(d),{once:!0}),vC(a,c),!c.defaultPrevented&&!o.metaKey){const d=new CustomEvent(JP,{bubbles:!0,cancelable:!0});vC(a,d)}},{checkForDefaultPrevented:!1})})})});dMe.displayName=uMe;var w8="NavigationMenuIndicator",Oie=C.forwardRef((e,t)=>{const{forceMount:n,...r}=e,s=Pl(w8,e.__scopeNavigationMenu),i=!!s.value;return s.indicatorTrack?kA.createPortal(_.jsx(Vr,{present:n||i,children:_.jsx(fMe,{...r,ref:t})}),s.indicatorTrack):null});Oie.displayName=w8;var fMe=C.forwardRef((e,t)=>{const{__scopeNavigationMenu:n,...r}=e,s=Pl(w8,n),i=Cie(n),[o,a]=C.useState(null),[c,d]=C.useState(null),h=s.orientation==="horizontal",u=!!s.value;C.useEffect(()=>{var m;const v=(m=i().find(x=>x.value===s.value))==null?void 0:m.ref.current;v&&a(v)},[i,s.value]);const f=()=>{o&&d({size:h?o.offsetWidth:o.offsetHeight,offset:h?o.offsetLeft:o.offsetTop})};return hU(o,f),hU(s.indicatorTrack,f),c?_.jsx(He.div,{"aria-hidden":!0,"data-state":u?"visible":"hidden","data-orientation":s.orientation,...r,ref:t,style:{position:"absolute",...h?{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}),lx="NavigationMenuContent",Mie=C.forwardRef((e,t)=>{const{forceMount:n,...r}=e,s=Pl(lx,e.__scopeNavigationMenu),i=kie(lx,e.__scopeNavigationMenu),o=_t(i.contentRef,t),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?_.jsx(hMe,{forceMount:n,...c,ref:o}):_.jsx(Vr,{present:n||a,children:_.jsx(Iie,{"data-state":E8(a),...c,ref:o,onPointerEnter:Ae(e.onPointerEnter,s.onContentEnter),onPointerLeave:Ae(e.onPointerLeave,OT(s.onContentLeave)),style:{pointerEvents:!a&&s.isRootMenu?"none":void 0,...c.style}})})});Mie.displayName=lx;var hMe=C.forwardRef((e,t)=>{const n=Pl(lx,e.__scopeNavigationMenu),{onViewportContentChange:r,onViewportContentRemove:s}=n;return Rr(()=>{r(e.value,{ref:t,...e})},[e,t,r]),Rr(()=>()=>s(e.value),[e.value,s]),null}),JP="navigationMenu.rootContentDismiss",Iie=C.forwardRef((e,t)=>{const{__scopeNavigationMenu:n,value:r,triggerRef:s,focusProxyRef:i,wasEscapeCloseRef:o,onRootContentClose:a,onContentFocusOutside:c,...d}=e,h=Pl(lx,n),u=C.useRef(null),f=_t(u,t),g=Fie(h.baseId,r),v=zie(h.baseId,r),m=Cie(n),x=C.useRef(null),{onItemDismiss:y}=h;C.useEffect(()=>{const w=u.current;if(h.isRootMenu&&w){const E=()=>{var R;y(),a(),w.contains(document.activeElement)&&((R=s.current)==null||R.focus())};return w.addEventListener(JP,E),()=>w.removeEventListener(JP,E)}},[h.isRootMenu,e.value,s,y,a]);const b=C.useMemo(()=>{const E=m().map(O=>O.value);h.dir==="rtl"&&E.reverse();const R=E.indexOf(h.value),T=E.indexOf(h.previousValue),N=r===h.value,A=T===E.indexOf(r);if(!N&&!A)return x.current;const D=(()=>{if(R!==T){if(N&&T!==-1)return R>T?"from-end":"from-start";if(A&&R!==-1)return R>T?"to-start":"to-end"}return null})();return x.current=D,D},[h.previousValue,h.value,h.dir,m,r]);return _.jsx(jie,{asChild:!0,children:_.jsx(Hf,{id:v,"aria-labelledby":g,"data-motion":b,"data-orientation":h.orientation,...d,ref:f,disableOutsidePointerEvents:!1,onDismiss:()=>{var E;const w=new Event(JP,{bubbles:!0,cancelable:!0});(E=u.current)==null||E.dispatchEvent(w)},onFocusOutside:Ae(e.onFocusOutside,w=>{var R;c();const E=w.target;(R=h.rootNavigationMenu)!=null&&R.contains(E)&&w.preventDefault()}),onPointerDownOutside:Ae(e.onPointerDownOutside,w=>{var N;const E=w.target,R=m().some(A=>{var D;return(D=A.ref.current)==null?void 0:D.contains(E)}),T=h.isRootMenu&&((N=h.viewport)==null?void 0:N.contains(E));(R||T||!h.isRootMenu)&&w.preventDefault()}),onKeyDown:Ae(e.onKeyDown,w=>{var T;const E=w.altKey||w.ctrlKey||w.metaKey;if(w.key==="Tab"&&!E){const N=fU(w.currentTarget),A=document.activeElement,D=N.findIndex($=>$===A),I=w.shiftKey?N.slice(0,D).reverse():N.slice(D+1,N.length);C8(I)?w.preventDefault():(T=i.current)==null||T.focus()}}),onEscapeKeyDown:Ae(e.onEscapeKeyDown,w=>{o.current=!0})})})}),S8="NavigationMenuViewport",Lie=C.forwardRef((e,t)=>{const{forceMount:n,...r}=e,i=!!Pl(S8,e.__scopeNavigationMenu).value;return _.jsx(Vr,{present:n||i,children:_.jsx(pMe,{...r,ref:t})})});Lie.displayName=S8;var pMe=C.forwardRef((e,t)=>{const{__scopeNavigationMenu:n,children:r,...s}=e,i=Pl(S8,n),o=_t(t,i.onViewportChange),a=oMe(lx,e.__scopeNavigationMenu),[c,d]=C.useState(null),[h,u]=C.useState(null),f=c?(c==null?void 0:c.width)+"px":void 0,g=c?(c==null?void 0:c.height)+"px":void 0,v=!!i.value,m=v?i.value:i.previousValue;return hU(h,()=>{h&&d({width:h.offsetWidth,height:h.offsetHeight})}),_.jsx(He.div,{"data-state":E8(v),"data-orientation":i.orientation,...s,ref:o,style:{pointerEvents:!v&&i.isRootMenu?"none":void 0,"--radix-navigation-menu-viewport-width":f,"--radix-navigation-menu-viewport-height":g,...s.style},onPointerEnter:Ae(e.onPointerEnter,i.onContentEnter),onPointerLeave:Ae(e.onPointerLeave,OT(i.onContentLeave)),children:Array.from(a.items).map(([y,{ref:b,forceMount:w,...E}])=>{const R=m===y;return _.jsx(Vr,{present:w||R,children:_.jsx(Iie,{...E,ref:DA(b,T=>{R&&T&&u(T)})})},y)})})}),mMe="FocusGroup",jie=C.forwardRef((e,t)=>{const{__scopeNavigationMenu:n,...r}=e,s=Pl(mMe,n);return _.jsx(uU.Provider,{scope:n,children:_.jsx(uU.Slot,{scope:n,children:_.jsx(He.div,{dir:s.dir,...r,ref:t})})})}),u7=["ArrowRight","ArrowLeft","ArrowUp","ArrowDown"],gMe="FocusGroupItem",$ie=C.forwardRef((e,t)=>{const{__scopeNavigationMenu:n,...r}=e,s=nMe(n),i=Pl(gMe,n);return _.jsx(uU.ItemSlot,{scope:n,children:_.jsx(He.button,{...r,ref:t,onKeyDown:Ae(e.onKeyDown,o=>{if(["Home","End",...u7].includes(o.key)){let c=s().map(u=>u.ref.current);if([i.dir==="rtl"?"ArrowRight":"ArrowLeft","ArrowUp","End"].includes(o.key)&&c.reverse(),u7.includes(o.key)){const u=c.indexOf(o.currentTarget);c=c.slice(u+1)}setTimeout(()=>C8(c)),o.preventDefault()}})})})});function fU(e){const t=[],n=document.createTreeWalker(e,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();)t.push(n.currentNode);return t}function C8(e){const t=document.activeElement;return e.some(n=>n===t?!0:(n.focus(),document.activeElement!==t))}function vMe(e){return e.forEach(t=>{t.dataset.tabindex=t.getAttribute("tabindex")||"",t.setAttribute("tabindex","-1")}),()=>{e.forEach(t=>{const n=t.dataset.tabindex;t.setAttribute("tabindex",n)})}}function hU(e,t){const n=bn(t);Rr(()=>{let r=0;if(e){const s=new ResizeObserver(()=>{cancelAnimationFrame(r),r=window.requestAnimationFrame(n)});return s.observe(e),()=>{window.cancelAnimationFrame(r),s.unobserve(e)}}},[e,n])}function E8(e){return e?"open":"closed"}function Fie(e,t){return`${e}-trigger-${t}`}function zie(e,t){return`${e}-content-${t}`}function OT(e){return t=>t.pointerType==="mouse"?e(t):void 0}var Bie=Eie,Uie=Nie,Vie=Die,Hie=Oie,Wie=Mie,qie=Lie;const yMe=C.forwardRef(({className:e,children:t,...n},r)=>_.jsxs(Bie,{ref:r,className:ge("relative z-10 flex max-w-max flex-1 items-center justify-center",e),...n,children:[t,_.jsx(Gie,{})]}));yMe.displayName=Bie.displayName;const bMe=C.forwardRef(({className:e,...t},n)=>_.jsx(Uie,{ref:n,className:ge("group flex flex-1 list-none items-center justify-center space-x-1",e),...t}));bMe.displayName=Uie.displayName;const xMe=Io("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"),_Me=C.forwardRef(({className:e,children:t,...n},r)=>_.jsxs(Vie,{ref:r,className:ge(xMe(),"group",e),...n,children:[t," ",_.jsx(Nx,{className:"relative top-[1px] ml-1 h-3 w-3 transition duration-200 group-data-[state=open]:rotate-180","aria-hidden":"true"})]}));_Me.displayName=Vie.displayName;const wMe=C.forwardRef(({className:e,...t},n)=>_.jsx(Wie,{ref:n,className:ge("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 ",e),...t}));wMe.displayName=Wie.displayName;const Gie=C.forwardRef(({className:e,...t},n)=>_.jsx("div",{className:ge("absolute left-0 top-full flex justify-center"),children:_.jsx(qie,{className:ge("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)]",e),ref:n,...t})}));Gie.displayName=qie.displayName;const SMe=C.forwardRef(({className:e,...t},n)=>_.jsx(Hie,{ref:n,className:ge("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",e),...t,children:_.jsx("div",{className:"relative top-[60%] h-2 w-2 rotate-45 rounded-tl-sm bg-border shadow-md"})}));SMe.displayName=Hie.displayName;var CMe=typeof window>"u",pU=CMe?fe.useEffect:fe.useLayoutEffect,EMe=0,d7=()=>++EMe,f7=!1;function AMe(){let[e,t]=fe.useState(f7?d7:void 0);return pU(()=>{e===void 0&&t(d7()),f7=!0},[]),e===void 0?e:`rwb-${e.toString(32)}`}function RMe(){return fe.useMemo(()=>"useId"in fe?fe.useId:AMe,[])()}var mU="__wrap_b",F1="__wrap_n",h7="__wrap_o",Kie=(e,t,n)=>{n=n||document.querySelector(`[data-br="${e}"]`);let r=n==null?void 0:n.parentElement;if(!r)return;let s=h=>n.style.maxWidth=h+"px";n.style.maxWidth="";let i=r.clientWidth,o=r.clientHeight,a=i/2-.25,c=i+.5,d;if(i){for(s(a),a=Math.max(n.scrollWidth,a);a+1<c;)d=Math.round((a+c)/2),s(d),r.clientHeight===o?c=d:a=d;s(c*t+i*(1-t))}n.__wrap_o||typeof ResizeObserver<"u"&&(n.__wrap_o=new ResizeObserver(()=>{self.__wrap_b(0,+n.dataset.brr,n)})).observe(r)},PMe=Kie.toString(),NMe='(self.CSS&&CSS.supports("text-wrap","balance")?1:2)',TMe=(e,t,n="")=>(n&&(n=`self.${F1}!=1&&${n}`),fe.createElement("script",{suppressHydrationWarning:!0,dangerouslySetInnerHTML:{__html:(e?"":`self.${F1}=self.${F1}||${NMe};self.${mU}=${PMe};`)+n},nonce:t})),kMe=fe.createContext({preferNative:!0,hasProvider:!1});fe.forwardRef(({ratio:e=1,preferNative:t,nonce:n,children:r,as:s,...i},o)=>{let a=RMe(),c=fe.useRef(),d=fe.useContext(kMe),h=t??d.preferNative,u=s||"span";return fe.useImperativeHandle(o,()=>c.current,[]),pU(()=>{h&&self[F1]===1||c.current&&(self[mU]=Kie)(0,e,c.current)},[r,h,e]),pU(()=>{if(!(h&&self[F1]===1))return()=>{if(!c.current)return;let f=c.current[h7];f&&(f.disconnect(),delete c.current[h7])}},[h]),fe.createElement(fe.Fragment,null,fe.createElement(u,{...i,"data-br":a,"data-brr":e,ref:c,style:{display:"inline-block",verticalAlign:"top",textDecoration:"inherit",textWrap:h?"balance":"initial"},suppressHydrationWarning:!0},r),TMe(d.hasProvider,n,`self.${mU}("${a}",${e})`))});var DMe="Separator",p7="horizontal",OMe=["horizontal","vertical"],Yie=C.forwardRef((e,t)=>{const{decorative:n,orientation:r=p7,...s}=e,i=MMe(r)?r:p7,a=n?{role:"none"}:{"aria-orientation":i==="vertical"?i:void 0,role:"separator"};return _.jsx(He.div,{"data-orientation":i,...a,...s,ref:t})});Yie.displayName=DMe;function MMe(e){return OMe.includes(e)}var Xie=Yie;const Ef=C.forwardRef(({className:e,orientation:t="horizontal",decorative:n=!0,...r},s)=>_.jsx(Xie,{ref:s,decorative:n,orientation:t,className:ge("shrink-0 bg-border",t==="horizontal"?"h-[1px] w-full":"h-full w-[1px]",e),...r}));Ef.displayName=Xie.displayName;const IMe=C.forwardRef(({className:e,...t},n)=>_.jsx("ul",{ref:n,className:ge("flex flex-row items-center gap-1",e),...t}));IMe.displayName="PaginationContent";const LMe=C.forwardRef(({className:e,...t},n)=>_.jsx("li",{ref:n,className:ge("",e),...t}));LMe.displayName="PaginationItem";var A8="Popover",[Qie,x7e]=_r(A8,[Iu]),dR=Iu(),[jMe,Np]=Qie(A8),Zie=e=>{const{__scopePopover:t,children:n,open:r,defaultOpen:s,onOpenChange:i,modal:o=!1}=e,a=dR(t),c=C.useRef(null),[d,h]=C.useState(!1),[u=!1,f]=os({prop:r,defaultProp:s,onChange:i});return _.jsx(HD,{...a,children:_.jsx(jMe,{scope:t,contentId:si(),triggerRef:c,open:u,onOpenChange:f,onOpenToggle:C.useCallback(()=>f(g=>!g),[f]),hasCustomAnchor:d,onCustomAnchorAdd:C.useCallback(()=>h(!0),[]),onCustomAnchorRemove:C.useCallback(()=>h(!1),[]),modal:o,children:n})})};Zie.displayName=A8;var Jie="PopoverAnchor",$Me=C.forwardRef((e,t)=>{const{__scopePopover:n,...r}=e,s=Np(Jie,n),i=dR(n),{onCustomAnchorAdd:o,onCustomAnchorRemove:a}=s;return C.useEffect(()=>(o(),()=>a()),[o,a]),_.jsx(Ux,{...i,...r,ref:t})});$Me.displayName=Jie;var eoe="PopoverTrigger",toe=C.forwardRef((e,t)=>{const{__scopePopover:n,...r}=e,s=Np(eoe,n),i=dR(n),o=_t(t,s.triggerRef),a=_.jsx(He.button,{type:"button","aria-haspopup":"dialog","aria-expanded":s.open,"aria-controls":s.contentId,"data-state":ooe(s.open),...r,ref:o,onClick:Ae(e.onClick,s.onOpenToggle)});return s.hasCustomAnchor?a:_.jsx(Ux,{asChild:!0,...i,children:a})});toe.displayName=eoe;var R8="PopoverPortal",[FMe,zMe]=Qie(R8,{forceMount:void 0}),noe=e=>{const{__scopePopover:t,forceMount:n,children:r,container:s}=e,i=Np(R8,t);return _.jsx(FMe,{scope:t,forceMount:n,children:_.jsx(Vr,{present:n||i.open,children:_.jsx(Dx,{asChild:!0,container:s,children:r})})})};noe.displayName=R8;var cx="PopoverContent",roe=C.forwardRef((e,t)=>{const n=zMe(cx,e.__scopePopover),{forceMount:r=n.forceMount,...s}=e,i=Np(cx,e.__scopePopover);return _.jsx(Vr,{present:r||i.open,children:i.modal?_.jsx(BMe,{...s,ref:t}):_.jsx(UMe,{...s,ref:t})})});roe.displayName=cx;var BMe=C.forwardRef((e,t)=>{const n=Np(cx,e.__scopePopover),r=C.useRef(null),s=_t(t,r),i=C.useRef(!1);return C.useEffect(()=>{const o=r.current;if(o)return Ox(o)},[]),_.jsx(IA,{as:Cc,allowPinchZoom:!0,children:_.jsx(soe,{...e,ref:s,trapFocus:n.open,disableOutsidePointerEvents:!0,onCloseAutoFocus:Ae(e.onCloseAutoFocus,o=>{var a;o.preventDefault(),i.current||(a=n.triggerRef.current)==null||a.focus()}),onPointerDownOutside:Ae(e.onPointerDownOutside,o=>{const a=o.detail.originalEvent,c=a.button===0&&a.ctrlKey===!0,d=a.button===2||c;i.current=d},{checkForDefaultPrevented:!1}),onFocusOutside:Ae(e.onFocusOutside,o=>o.preventDefault(),{checkForDefaultPrevented:!1})})})}),UMe=C.forwardRef((e,t)=>{const n=Np(cx,e.__scopePopover),r=C.useRef(!1),s=C.useRef(!1);return _.jsx(soe,{...e,ref:t,trapFocus:!1,disableOutsidePointerEvents:!1,onCloseAutoFocus:i=>{var o,a;(o=e.onCloseAutoFocus)==null||o.call(e,i),i.defaultPrevented||(r.current||(a=n.triggerRef.current)==null||a.focus(),i.preventDefault()),r.current=!1,s.current=!1},onInteractOutside:i=>{var c,d;(c=e.onInteractOutside)==null||c.call(e,i),i.defaultPrevented||(r.current=!0,i.detail.originalEvent.type==="pointerdown"&&(s.current=!0));const o=i.target;((d=n.triggerRef.current)==null?void 0:d.contains(o))&&i.preventDefault(),i.detail.originalEvent.type==="focusin"&&s.current&&i.preventDefault()}})}),soe=C.forwardRef((e,t)=>{const{__scopePopover:n,trapFocus:r,onOpenAutoFocus:s,onCloseAutoFocus:i,disableOutsidePointerEvents:o,onEscapeKeyDown:a,onPointerDownOutside:c,onFocusOutside:d,onInteractOutside:h,...u}=e,f=Np(cx,n),g=dR(n);return uD(),_.jsx(MA,{asChild:!0,loop:!0,trapped:r,onMountAutoFocus:s,onUnmountAutoFocus:i,children:_.jsx(Hf,{asChild:!0,disableOutsidePointerEvents:o,onInteractOutside:h,onEscapeKeyDown:a,onPointerDownOutside:c,onFocusOutside:d,onDismiss:()=>f.onOpenChange(!1),children:_.jsx(YA,{"data-state":ooe(f.open),role:"dialog",id:f.contentId,...g,...u,ref:t,style:{...u.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)"}})})})}),ioe="PopoverClose",VMe=C.forwardRef((e,t)=>{const{__scopePopover:n,...r}=e,s=Np(ioe,n);return _.jsx(He.button,{type:"button",...r,ref:t,onClick:Ae(e.onClick,()=>s.onOpenChange(!1))})});VMe.displayName=ioe;var HMe="PopoverArrow",WMe=C.forwardRef((e,t)=>{const{__scopePopover:n,...r}=e,s=dR(n);return _.jsx(XA,{...s,...r,ref:t})});WMe.displayName=HMe;function ooe(e){return e?"open":"closed"}var qMe=Zie,GMe=toe,KMe=noe,aoe=roe;const YMe=qMe,XMe=GMe,loe=C.forwardRef(({className:e,align:t="center",sideOffset:n=4,...r},s)=>_.jsx(KMe,{children:_.jsx(aoe,{ref:s,align:t,sideOffset:n,className:ge("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",e),...r})}));loe.displayName=aoe.displayName;var P8="Progress",N8=100,[QMe,_7e]=_r(P8),[ZMe,JMe]=QMe(P8),coe=C.forwardRef((e,t)=>{const{__scopeProgress:n,value:r=null,max:s,getValueLabel:i=eIe,...o}=e;(s||s===0)&&!m7(s)&&console.error(tIe(`${s}`,"Progress"));const a=m7(s)?s:N8;r!==null&&!g7(r,a)&&console.error(nIe(`${r}`,"Progress"));const c=g7(r,a)?r:null,d=MT(c)?i(c,a):void 0;return _.jsx(ZMe,{scope:n,value:c,max:a,children:_.jsx(He.div,{"aria-valuemax":a,"aria-valuemin":0,"aria-valuenow":MT(c)?c:void 0,"aria-valuetext":d,role:"progressbar","data-state":foe(c,a),"data-value":c??void 0,"data-max":a,...o,ref:t})})});coe.displayName=P8;var uoe="ProgressIndicator",doe=C.forwardRef((e,t)=>{const{__scopeProgress:n,...r}=e,s=JMe(uoe,n);return _.jsx(He.div,{"data-state":foe(s.value,s.max),"data-value":s.value??void 0,"data-max":s.max,...r,ref:t})});doe.displayName=uoe;function eIe(e,t){return`${Math.round(e/t*100)}%`}function foe(e,t){return e==null?"indeterminate":e===t?"complete":"loading"}function MT(e){return typeof e=="number"}function m7(e){return MT(e)&&!isNaN(e)&&e>0}function g7(e,t){return MT(e)&&!isNaN(e)&&e<=t&&e>=0}function tIe(e,t){return`Invalid prop \`max\` of value \`${e}\` supplied to \`${t}\`. Only numbers greater than 0 are valid max values. Defaulting to \`${N8}\`.`}function nIe(e,t){return`Invalid prop \`value\` of value \`${e}\` supplied to \`${t}\`. The \`value\` prop must be:
|
||
- a positive number
|
||
- less than the value passed to \`max\` (or ${N8} if no \`max\` prop is set)
|
||
- \`null\` or \`undefined\` if the progress is indeterminate.
|
||
|
||
Defaulting to \`null\`.`}var hoe=coe,rIe=doe;const T8=C.forwardRef(({className:e,value:t,...n},r)=>_.jsx(hoe,{ref:r,className:ge("relative h-4 w-full overflow-hidden rounded-full bg-secondary",e),...n,children:_.jsx(rIe,{className:"h-full w-full flex-1 bg-primary transition-all",style:{transform:`translateX(-${100-(t||0)}%)`}})}));T8.displayName=hoe.displayName;var k8="Radio",[sIe,poe]=_r(k8),[iIe,oIe]=sIe(k8),moe=C.forwardRef((e,t)=>{const{__scopeRadio:n,name:r,checked:s=!1,required:i,disabled:o,value:a="on",onCheck:c,...d}=e,[h,u]=C.useState(null),f=_t(t,m=>u(m)),g=C.useRef(!1),v=h?!!h.closest("form"):!0;return _.jsxs(iIe,{scope:n,checked:s,disabled:o,children:[_.jsx(He.button,{type:"button",role:"radio","aria-checked":s,"data-state":yoe(s),"data-disabled":o?"":void 0,disabled:o,value:a,...d,ref:f,onClick:Ae(e.onClick,m=>{s||c==null||c(),v&&(g.current=m.isPropagationStopped(),g.current||m.stopPropagation())})}),v&&_.jsx(aIe,{control:h,bubbles:!g.current,name:r,value:a,checked:s,required:i,disabled:o,style:{transform:"translateX(-100%)"}})]})});moe.displayName=k8;var goe="RadioIndicator",voe=C.forwardRef((e,t)=>{const{__scopeRadio:n,forceMount:r,...s}=e,i=oIe(goe,n);return _.jsx(Vr,{present:r||i.checked,children:_.jsx(He.span,{"data-state":yoe(i.checked),"data-disabled":i.disabled?"":void 0,...s,ref:t})})});voe.displayName=goe;var aIe=e=>{const{control:t,checked:n,bubbles:r=!0,...s}=e,i=C.useRef(null),o=$x(n),a=WA(t);return C.useEffect(()=>{const c=i.current,d=window.HTMLInputElement.prototype,u=Object.getOwnPropertyDescriptor(d,"checked").set;if(o!==n&&u){const f=new Event("click",{bubbles:r});u.call(c,n),c.dispatchEvent(f)}},[o,n,r]),_.jsx("input",{type:"radio","aria-hidden":!0,defaultChecked:n,...s,tabIndex:-1,ref:i,style:{...e.style,...a,position:"absolute",pointerEvents:"none",opacity:0,margin:0}})};function yoe(e){return e?"checked":"unchecked"}var lIe=["ArrowUp","ArrowDown","ArrowLeft","ArrowRight"],D8="RadioGroup",[cIe,w7e]=_r(D8,[Lu,poe]),boe=Lu(),xoe=poe(),[uIe,dIe]=cIe(D8),_oe=C.forwardRef((e,t)=>{const{__scopeRadioGroup:n,name:r,defaultValue:s,value:i,required:o=!1,disabled:a=!1,orientation:c,dir:d,loop:h=!0,onValueChange:u,...f}=e,g=boe(n),v=kc(d),[m,x]=os({prop:i,defaultProp:s,onChange:u});return _.jsx(uIe,{scope:n,name:r,required:o,disabled:a,value:m,onValueChange:x,children:_.jsx(QA,{asChild:!0,...g,orientation:c,dir:v,loop:h,children:_.jsx(He.div,{role:"radiogroup","aria-required":o,"aria-orientation":c,"data-disabled":a?"":void 0,dir:v,...f,ref:t})})})});_oe.displayName=D8;var woe="RadioGroupItem",Soe=C.forwardRef((e,t)=>{const{__scopeRadioGroup:n,disabled:r,...s}=e,i=dIe(woe,n),o=i.disabled||r,a=boe(n),c=xoe(n),d=C.useRef(null),h=_t(t,d),u=i.value===s.value,f=C.useRef(!1);return C.useEffect(()=>{const g=m=>{lIe.includes(m.key)&&(f.current=!0)},v=()=>f.current=!1;return document.addEventListener("keydown",g),document.addEventListener("keyup",v),()=>{document.removeEventListener("keydown",g),document.removeEventListener("keyup",v)}},[]),_.jsx(ZA,{asChild:!0,...a,focusable:!o,active:u,children:_.jsx(moe,{disabled:o,required:i.required,checked:u,...c,...s,name:i.name,ref:h,onCheck:()=>i.onValueChange(s.value),onKeyDown:Ae(g=>{g.key==="Enter"&&g.preventDefault()}),onFocus:Ae(s.onFocus,()=>{var g;f.current&&((g=d.current)==null||g.click())})})})});Soe.displayName=woe;var fIe="RadioGroupIndicator",Coe=C.forwardRef((e,t)=>{const{__scopeRadioGroup:n,...r}=e,s=xoe(n);return _.jsx(voe,{...s,...r,ref:t})});Coe.displayName=fIe;var Eoe=_oe,Aoe=Soe,hIe=Coe;const pIe=C.forwardRef(({className:e,...t},n)=>_.jsx(Eoe,{className:ge("grid gap-2",e),...t,ref:n}));pIe.displayName=Eoe.displayName;const mIe=C.forwardRef(({className:e,...t},n)=>_.jsx(Aoe,{ref:n,className:ge("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",e),...t,children:_.jsx(hIe,{className:"flex items-center justify-center",children:_.jsx(cD,{className:"h-2.5 w-2.5 fill-current text-current"})})}));mIe.displayName=Aoe.displayName;const{createElement:ux,createContext:gIe,forwardRef:Roe,useCallback:Fo,useContext:Poe,useEffect:Ev,useImperativeHandle:Noe,useLayoutEffect:vIe,useMemo:yIe,useRef:Ko,useState:Mb}=Tv,v7=Tv[`useId${Math.random()}`.slice(0,5)],bIe=vIe,ZD=gIe(null);ZD.displayName="PanelGroupContext";const Av=bIe,xIe=typeof v7=="function"?v7:()=>null;let _Ie=0;function O8(e=null){const t=xIe(),n=Ko(e||t||null);return n.current===null&&(n.current=""+_Ie++),e??n.current}function Toe({children:e,className:t="",collapsedSize:n,collapsible:r,defaultSize:s,forwardedRef:i,id:o,maxSize:a,minSize:c,onCollapse:d,onExpand:h,onResize:u,order:f,style:g,tagName:v="div",...m}){const x=Poe(ZD);if(x===null)throw Error("Panel components must be rendered within a PanelGroup container");const{collapsePanel:y,expandPanel:b,getPanelSize:w,getPanelStyle:E,groupId:R,isPanelCollapsed:T,reevaluatePanelConstraints:N,registerPanel:A,resizePanel:D,unregisterPanel:O}=x,I=O8(o),$=Ko({callbacks:{onCollapse:d,onExpand:h,onResize:u},constraints:{collapsedSize:n,collapsible:r,defaultSize:s,maxSize:a,minSize:c},id:I,idIsFromProps:o!==void 0,order:f});Ko({didLogMissingDefaultSizeWarning:!1}),Av(()=>{const{callbacks:B,constraints:W}=$.current,Z={...W};$.current.id=I,$.current.idIsFromProps=o!==void 0,$.current.order=f,B.onCollapse=d,B.onExpand=h,B.onResize=u,W.collapsedSize=n,W.collapsible=r,W.defaultSize=s,W.maxSize=a,W.minSize=c,(Z.collapsedSize!==W.collapsedSize||Z.collapsible!==W.collapsible||Z.maxSize!==W.maxSize||Z.minSize!==W.minSize)&&N($.current,Z)}),Av(()=>{const B=$.current;return A(B),()=>{O(B)}},[f,I,A,O]),Noe(i,()=>({collapse:()=>{y($.current)},expand:B=>{b($.current,B)},getId(){return I},getSize(){return w($.current)},isCollapsed(){return T($.current)},isExpanded(){return!T($.current)},resize:B=>{D($.current,B)}}),[y,b,w,T,I,D]);const F=E($.current,s);return ux(v,{...m,children:e,className:t,id:o,style:{...F,...g},"data-panel":"","data-panel-collapsible":r||void 0,"data-panel-group-id":R,"data-panel-id":I,"data-panel-size":parseFloat(""+F.flexGrow).toFixed(1)})}const koe=Roe((e,t)=>ux(Toe,{...e,forwardedRef:t}));Toe.displayName="Panel";koe.displayName="forwardRef(Panel)";let gU=null,hg=null;function wIe(e,t){if(t){const n=(t&Loe)!==0,r=(t&joe)!==0,s=(t&$oe)!==0,i=(t&Foe)!==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(e){case"horizontal":return"ew-resize";case"intersection":return"move";case"vertical":return"ns-resize"}}function SIe(){hg!==null&&(document.head.removeChild(hg),gU=null,hg=null)}function T4(e,t){const n=wIe(e,t);gU!==n&&(gU=n,hg===null&&(hg=document.createElement("style"),document.head.appendChild(hg)),hg.innerHTML=`*{cursor: ${n}!important;}`)}function Doe(e){return e.type==="keydown"}function Ooe(e){return e.type.startsWith("pointer")}function Moe(e){return e.type.startsWith("mouse")}function JD(e){if(Ooe(e)){if(e.isPrimary)return{x:e.clientX,y:e.clientY}}else if(Moe(e))return{x:e.clientX,y:e.clientY};return{x:1/0,y:1/0}}function CIe(){if(typeof matchMedia=="function")return matchMedia("(pointer:coarse)").matches?"coarse":"fine"}function EIe(e,t,n){return e.x<t.x+t.width&&e.x+e.width>t.x&&e.y<t.y+t.height&&e.y+e.height>t.y}function AIe(e,t){if(e===t)throw new Error("Cannot compare node with itself");const n={a:x7(e),b:x7(t)};let r;for(;n.a.at(-1)===n.b.at(-1);)e=n.a.pop(),t=n.b.pop(),r=e;tn(r,"Stacking order can only be calculated for elements with a common ancestor");const s={a:b7(y7(n.a)),b:b7(y7(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 RIe=/\b(?:position|zIndex|opacity|transform|webkitTransform|mixBlendMode|filter|webkitFilter|isolation)\b/;function PIe(e){var t;const n=getComputedStyle((t=Ioe(e))!==null&&t!==void 0?t:e).display;return n==="flex"||n==="inline-flex"}function NIe(e){const t=getComputedStyle(e);return!!(t.position==="fixed"||t.zIndex!=="auto"&&(t.position!=="static"||PIe(e))||+t.opacity<1||"transform"in t&&t.transform!=="none"||"webkitTransform"in t&&t.webkitTransform!=="none"||"mixBlendMode"in t&&t.mixBlendMode!=="normal"||"filter"in t&&t.filter!=="none"||"webkitFilter"in t&&t.webkitFilter!=="none"||"isolation"in t&&t.isolation==="isolate"||RIe.test(t.willChange)||t.webkitOverflowScrolling==="touch")}function y7(e){let t=e.length;for(;t--;){const n=e[t];if(tn(n,"Missing node"),NIe(n))return n}return null}function b7(e){return e&&Number(getComputedStyle(e).zIndex)||0}function x7(e){const t=[];for(;e;)t.push(e),e=Ioe(e);return t}function Ioe(e){const{parentNode:t}=e;return t&&t instanceof ShadowRoot?t.host:t}const Loe=1,joe=2,$oe=4,Foe=8,TIe=CIe()==="coarse";let _c=[],AC=!1,vh=new Map,eO=new Map;const RC=new Set;function kIe(e,t,n,r,s){var i;const{ownerDocument:o}=t,a={direction:n,element:t,hitAreaMargins:r,setResizeHandlerState:s},c=(i=vh.get(o))!==null&&i!==void 0?i:0;return vh.set(o,c+1),RC.add(a),IT(),function(){var h;eO.delete(e),RC.delete(a);const u=(h=vh.get(o))!==null&&h!==void 0?h:1;if(vh.set(o,u-1),IT(),u===1&&vh.delete(o),_c.includes(a)){const f=_c.indexOf(a);f>=0&&_c.splice(f,1),I8()}}}function _7(e){const{target:t}=e,{x:n,y:r}=JD(e);AC=!0,M8({target:t,x:n,y:r}),IT(),_c.length>0&&(LT("down",e),e.preventDefault(),e.stopPropagation())}function VS(e){const{x:t,y:n}=JD(e);if(e.buttons===0&&(AC=!1,LT("up",e)),!AC){const{target:r}=e;M8({target:r,x:t,y:n})}LT("move",e),I8(),_c.length>0&&e.preventDefault()}function $y(e){const{target:t}=e,{x:n,y:r}=JD(e);eO.clear(),AC=!1,_c.length>0&&e.preventDefault(),LT("up",e),M8({target:t,x:n,y:r}),I8(),IT()}function M8({target:e,x:t,y:n}){_c.splice(0);let r=null;e instanceof HTMLElement&&(r=e),RC.forEach(s=>{const{element:i,hitAreaMargins:o}=s,a=i.getBoundingClientRect(),{bottom:c,left:d,right:h,top:u}=a,f=TIe?o.coarse:o.fine;if(t>=d-f&&t<=h+f&&n>=u-f&&n<=c+f){if(r!==null&&i!==r&&!i.contains(r)&&!r.contains(i)&&AIe(r,i)>0){let v=r,m=!1;for(;v&&!v.contains(i);){if(EIe(v.getBoundingClientRect(),a)){m=!0;break}v=v.parentElement}if(m)return}_c.push(s)}})}function k4(e,t){eO.set(e,t)}function I8(){let e=!1,t=!1;_c.forEach(r=>{const{direction:s}=r;s==="horizontal"?e=!0:t=!0});let n=0;eO.forEach(r=>{n|=r}),e&&t?T4("intersection",n):e?T4("horizontal",n):t?T4("vertical",n):SIe()}function IT(){vh.forEach((e,t)=>{const{body:n}=t;n.removeEventListener("contextmenu",$y),n.removeEventListener("pointerdown",_7),n.removeEventListener("pointerleave",VS),n.removeEventListener("pointermove",VS)}),window.removeEventListener("pointerup",$y),window.removeEventListener("pointercancel",$y),RC.size>0&&(AC?(_c.length>0&&vh.forEach((e,t)=>{const{body:n}=t;e>0&&(n.addEventListener("contextmenu",$y),n.addEventListener("pointerleave",VS),n.addEventListener("pointermove",VS))}),window.addEventListener("pointerup",$y),window.addEventListener("pointercancel",$y)):vh.forEach((e,t)=>{const{body:n}=t;e>0&&(n.addEventListener("pointerdown",_7,{capture:!0}),n.addEventListener("pointermove",VS))}))}function LT(e,t){RC.forEach(n=>{const{setResizeHandlerState:r}=n,s=_c.includes(n);r(e,s,t)})}function DIe(){const[e,t]=Mb(0);return Fo(()=>t(n=>n+1),[])}function tn(e,t){if(!e)throw console.error(t),Error(t)}const L8=10;function qv(e,t,n=L8){return e.toFixed(n)===t.toFixed(n)?0:e>t?1:-1}function yf(e,t,n=L8){return qv(e,t,n)===0}function Ba(e,t,n){return qv(e,t,n)===0}function OIe(e,t,n){if(e.length!==t.length)return!1;for(let r=0;r<e.length;r++){const s=e[r],i=t[r];if(!Ba(s,i,n))return!1}return!0}function vb({panelConstraints:e,panelIndex:t,size:n}){const r=e[t];tn(r!=null,`Panel constraints not found for index ${t}`);let{collapsedSize:s=0,collapsible:i,maxSize:o=100,minSize:a=0}=r;if(qv(n,a)<0)if(i){const c=(s+a)/2;qv(n,c)<0?n=s:n=a}else n=a;return n=Math.min(o,n),n=parseFloat(n.toFixed(L8)),n}function c1({delta:e,initialLayout:t,panelConstraints:n,pivotIndices:r,prevLayout:s,trigger:i}){if(Ba(e,0))return t;const o=[...t],[a,c]=r;tn(a!=null,"Invalid first pivot index"),tn(c!=null,"Invalid second pivot index");let d=0;if(i==="keyboard"){{const u=e<0?c:a,f=n[u];tn(f,`Panel constraints not found for index ${u}`);const{collapsedSize:g=0,collapsible:v,minSize:m=0}=f;if(v){const x=t[u];if(tn(x!=null,`Previous layout not found for panel index ${u}`),Ba(x,g)){const y=m-x;qv(y,Math.abs(e))>0&&(e=e<0?0-y:y)}}}{const u=e<0?a:c,f=n[u];tn(f,`No panel constraints found for index ${u}`);const{collapsedSize:g=0,collapsible:v,minSize:m=0}=f;if(v){const x=t[u];if(tn(x!=null,`Previous layout not found for panel index ${u}`),Ba(x,m)){const y=x-g;qv(y,Math.abs(e))>0&&(e=e<0?0-y:y)}}}}{const u=e<0?1:-1;let f=e<0?c:a,g=0;for(;;){const m=t[f];tn(m!=null,`Previous layout not found for panel index ${f}`);const y=vb({panelConstraints:n,panelIndex:f,size:100})-m;if(g+=y,f+=u,f<0||f>=n.length)break}const v=Math.min(Math.abs(e),Math.abs(g));e=e<0?0-v:v}{let f=e<0?a:c;for(;f>=0&&f<n.length;){const g=Math.abs(e)-Math.abs(d),v=t[f];tn(v!=null,`Previous layout not found for panel index ${f}`);const m=v-g,x=vb({panelConstraints:n,panelIndex:f,size:m});if(!Ba(v,x)&&(d+=v-x,o[f]=x,d.toPrecision(3).localeCompare(Math.abs(e).toPrecision(3),void 0,{numeric:!0})>=0))break;e<0?f--:f++}}if(OIe(s,o))return s;{const u=e<0?c:a,f=t[u];tn(f!=null,`Previous layout not found for panel index ${u}`);const g=f+d,v=vb({panelConstraints:n,panelIndex:u,size:g});if(o[u]=v,!Ba(v,g)){let m=g-v,y=e<0?c:a;for(;y>=0&&y<n.length;){const b=o[y];tn(b!=null,`Previous layout not found for panel index ${y}`);const w=b+m,E=vb({panelConstraints:n,panelIndex:y,size:w});if(Ba(b,E)||(m-=E-b,o[y]=E),Ba(m,0))break;e>0?y--:y++}}}const h=o.reduce((u,f)=>f+u,0);return Ba(h,100)?o:s}function MIe({layout:e,panelsArray:t,pivotIndices:n}){let r=0,s=100,i=0,o=0;const a=n[0];tn(a!=null,"No pivot index found"),t.forEach((u,f)=>{const{constraints:g}=u,{maxSize:v=100,minSize:m=0}=g;f===a?(r=m,s=v):(i+=m,o+=v)});const c=Math.min(s,100-i),d=Math.max(r,100-o),h=e[a];return{valueMax:c,valueMin:d,valueNow:h}}function PC(e,t=document){return Array.from(t.querySelectorAll(`[data-panel-resize-handle-id][data-panel-group-id="${e}"]`))}function zoe(e,t,n=document){const s=PC(e,n).findIndex(i=>i.getAttribute("data-panel-resize-handle-id")===t);return s??null}function Boe(e,t,n){const r=zoe(e,t,n);return r!=null?[r,r+1]:[-1,-1]}function Uoe(e,t=document){var n;if(t instanceof HTMLElement&&(t==null||(n=t.dataset)===null||n===void 0?void 0:n.panelGroupId)==e)return t;const r=t.querySelector(`[data-panel-group][data-panel-group-id="${e}"]`);return r||null}function tO(e,t=document){const n=t.querySelector(`[data-panel-resize-handle-id="${e}"]`);return n||null}function IIe(e,t,n,r=document){var s,i,o,a;const c=tO(t,r),d=PC(e,r),h=c?d.indexOf(c):-1,u=(s=(i=n[h])===null||i===void 0?void 0:i.id)!==null&&s!==void 0?s:null,f=(o=(a=n[h+1])===null||a===void 0?void 0:a.id)!==null&&o!==void 0?o:null;return[u,f]}function LIe({committedValuesRef:e,eagerValuesRef:t,groupId:n,layout:r,panelDataArray:s,panelGroupElement:i,setLayout:o}){Ko({didWarnAboutMissingResizeHandle:!1}),Av(()=>{if(!i)return;const a=PC(n,i);for(let c=0;c<s.length-1;c++){const{valueMax:d,valueMin:h,valueNow:u}=MIe({layout:r,panelsArray:s,pivotIndices:[c,c+1]}),f=a[c];if(f!=null){const g=s[c];tn(g,`No panel data found for index "${c}"`),f.setAttribute("aria-controls",g.id),f.setAttribute("aria-valuemax",""+Math.round(d)),f.setAttribute("aria-valuemin",""+Math.round(h)),f.setAttribute("aria-valuenow",u!=null?""+Math.round(u):"")}}return()=>{a.forEach((c,d)=>{c.removeAttribute("aria-controls"),c.removeAttribute("aria-valuemax"),c.removeAttribute("aria-valuemin"),c.removeAttribute("aria-valuenow")})}},[n,r,s,i]),Ev(()=>{if(!i)return;const a=t.current;tn(a,"Eager values not found");const{panelDataArray:c}=a,d=Uoe(n,i);tn(d!=null,`No group found for id "${n}"`);const h=PC(n,i);tn(h,`No resize handles found for group id "${n}"`);const u=h.map(f=>{const g=f.getAttribute("data-panel-resize-handle-id");tn(g,"Resize handle element has no handle id attribute");const[v,m]=IIe(n,g,c,i);if(v==null||m==null)return()=>{};const x=y=>{if(!y.defaultPrevented)switch(y.key){case"Enter":{y.preventDefault();const b=c.findIndex(w=>w.id===v);if(b>=0){const w=c[b];tn(w,`No panel data found for index ${b}`);const E=r[b],{collapsedSize:R=0,collapsible:T,minSize:N=0}=w.constraints;if(E!=null&&T){const A=c1({delta:Ba(E,R)?N-R:R-E,initialLayout:r,panelConstraints:c.map(D=>D.constraints),pivotIndices:Boe(n,g,i),prevLayout:r,trigger:"keyboard"});r!==A&&o(A)}}break}}};return f.addEventListener("keydown",x),()=>{f.removeEventListener("keydown",x)}});return()=>{u.forEach(f=>f())}},[i,e,t,n,r,s,o])}function w7(e,t){if(e.length!==t.length)return!1;for(let n=0;n<e.length;n++)if(e[n]!==t[n])return!1;return!0}function Voe(e,t){const n=e==="horizontal",{x:r,y:s}=JD(t);return n?r:s}function jIe(e,t,n,r,s){const i=n==="horizontal",o=tO(t,s);tn(o,`No resize handle element found for id "${t}"`);const a=o.getAttribute("data-panel-group-id");tn(a,"Resize handle element has no group id attribute");let{initialCursorPosition:c}=r;const d=Voe(n,e),h=Uoe(a,s);tn(h,`No group element found for id "${a}"`);const u=h.getBoundingClientRect(),f=i?u.width:u.height;return(d-c)/f*100}function $Ie(e,t,n,r,s,i){if(Doe(e)){const o=n==="horizontal";let a=0;e.shiftKey?a=100:s!=null?a=s:a=10;let c=0;switch(e.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:jIe(e,t,n,r,i)}function FIe({panelDataArray:e}){const t=Array(e.length),n=e.map(i=>i.constraints);let r=0,s=100;for(let i=0;i<e.length;i++){const o=n[i];tn(o,`Panel constraints not found for index ${i}`);const{defaultSize:a}=o;a!=null&&(r++,t[i]=a,s-=a)}for(let i=0;i<e.length;i++){const o=n[i];tn(o,`Panel constraints not found for index ${i}`);const{defaultSize:a}=o;if(a!=null)continue;const c=e.length-r,d=s/c;r++,t[i]=d,s-=d}return t}function Fy(e,t,n){t.forEach((r,s)=>{const i=e[s];tn(i,`Panel data not found for index ${s}`);const{callbacks:o,constraints:a,id:c}=i,{collapsedSize:d=0,collapsible:h}=a,u=n[c];if(u==null||r!==u){n[c]=r;const{onCollapse:f,onExpand:g,onResize:v}=o;v&&v(r,u),h&&(f||g)&&(g&&(u==null||yf(u,d))&&!yf(r,d)&&g(),f&&(u==null||!yf(u,d))&&yf(r,d)&&f())}})}function hP(e,t){if(e.length!==t.length)return!1;for(let n=0;n<e.length;n++)if(e[n]!=t[n])return!1;return!0}function zIe({defaultSize:e,dragState:t,layout:n,panelData:r,panelIndex:s,precision:i=3}){const o=n[s];let a;return o==null?a=e!=null?e.toPrecision(i):"1":r.length===1?a="1":a=o.toPrecision(i),{flexBasis:0,flexGrow:a,flexShrink:1,overflow:"hidden",pointerEvents:t!==null?"none":void 0}}function BIe(e,t=10){let n=null;return(...s)=>{n!==null&&clearTimeout(n),n=setTimeout(()=>{e(...s)},t)}}function S7(e){try{if(typeof localStorage<"u")e.getItem=t=>localStorage.getItem(t),e.setItem=(t,n)=>{localStorage.setItem(t,n)};else throw new Error("localStorage not supported in this environment")}catch(t){console.error(t),e.getItem=()=>null,e.setItem=()=>{}}}function Hoe(e){return`react-resizable-panels:${e}`}function Woe(e){return e.map(t=>{const{constraints:n,id:r,idIsFromProps:s,order:i}=t;return s?r:i?`${i}:${JSON.stringify(n)}`:JSON.stringify(n)}).sort((t,n)=>t.localeCompare(n)).join(",")}function qoe(e,t){try{const n=Hoe(e),r=t.getItem(n);if(r){const s=JSON.parse(r);if(typeof s=="object"&&s!=null)return s}}catch{}return null}function UIe(e,t,n){var r,s;const i=(r=qoe(e,n))!==null&&r!==void 0?r:{},o=Woe(t);return(s=i[o])!==null&&s!==void 0?s:null}function VIe(e,t,n,r,s){var i;const o=Hoe(e),a=Woe(t),c=(i=qoe(e,s))!==null&&i!==void 0?i:{};c[a]={expandToSizes:Object.fromEntries(n.entries()),layout:r};try{s.setItem(o,JSON.stringify(c))}catch(d){console.error(d)}}function C7({layout:e,panelConstraints:t}){const n=[...e],r=n.reduce((i,o)=>i+o,0);if(n.length!==t.length)throw Error(`Invalid ${t.length} panel layout: ${n.map(i=>`${i}%`).join(", ")}`);if(!Ba(r,100))for(let i=0;i<t.length;i++){const o=n[i];tn(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<t.length;i++){const o=n[i];tn(o!=null,`No layout data found for index ${i}`);const a=vb({panelConstraints:t,panelIndex:i,size:o});o!=a&&(s+=o-a,n[i]=a)}if(!Ba(s,0))for(let i=0;i<t.length;i++){const o=n[i];tn(o!=null,`No layout data found for index ${i}`);const a=o+s,c=vb({panelConstraints:t,panelIndex:i,size:a});if(o!==c&&(s-=c-o,n[i]=c,Ba(s,0)))break}return n}const HIe=100,u1={getItem:e=>(S7(u1),u1.getItem(e)),setItem:(e,t)=>{S7(u1),u1.setItem(e,t)}},E7={};function Goe({autoSaveId:e=null,children:t,className:n="",direction:r,forwardedRef:s,id:i=null,onLayout:o=null,keyboardResizeBy:a=null,storage:c=u1,style:d,tagName:h="div",...u}){const f=O8(i),g=Ko(null),[v,m]=Mb(null),[x,y]=Mb([]),b=DIe(),w=Ko({}),E=Ko(new Map),R=Ko(0),T=Ko({autoSaveId:e,direction:r,dragState:v,id:f,keyboardResizeBy:a,onLayout:o,storage:c}),N=Ko({layout:x,panelDataArray:[],panelDataArrayChanged:!1});Ko({didLogIdAndOrderWarning:!1,didLogPanelConstraintsWarning:!1,prevPanelIds:[]}),Noe(s,()=>({getId:()=>T.current.id,getLayout:()=>{const{layout:te}=N.current;return te},setLayout:te=>{const{onLayout:ae}=T.current,{layout:be,panelDataArray:xe}=N.current,ve=C7({layout:te,panelConstraints:xe.map(Pe=>Pe.constraints)});w7(be,ve)||(y(ve),N.current.layout=ve,ae&&ae(ve),Fy(xe,ve,w.current))}}),[]),Av(()=>{T.current.autoSaveId=e,T.current.direction=r,T.current.dragState=v,T.current.id=f,T.current.onLayout=o,T.current.storage=c}),LIe({committedValuesRef:T,eagerValuesRef:N,groupId:f,layout:x,panelDataArray:N.current.panelDataArray,setLayout:y,panelGroupElement:g.current}),Ev(()=>{const{panelDataArray:te}=N.current;if(e){if(x.length===0||x.length!==te.length)return;let ae=E7[e];ae==null&&(ae=BIe(VIe,HIe),E7[e]=ae);const be=[...te],xe=new Map(E.current);ae(e,be,xe,x,c)}},[e,x,c]),Ev(()=>{});const A=Fo(te=>{const{onLayout:ae}=T.current,{layout:be,panelDataArray:xe}=N.current;if(te.constraints.collapsible){const ve=xe.map(ze=>ze.constraints),{collapsedSize:Pe=0,panelSize:Oe,pivotIndices:ke}=Xm(xe,te,be);if(tn(Oe!=null,`Panel size not found for panel "${te.id}"`),!yf(Oe,Pe)){E.current.set(te.id,Oe);const $e=Xy(xe,te)===xe.length-1?Oe-Pe:Pe-Oe,Te=c1({delta:$e,initialLayout:be,panelConstraints:ve,pivotIndices:ke,prevLayout:be,trigger:"imperative-api"});hP(be,Te)||(y(Te),N.current.layout=Te,ae&&ae(Te),Fy(xe,Te,w.current))}}},[]),D=Fo((te,ae)=>{const{onLayout:be}=T.current,{layout:xe,panelDataArray:ve}=N.current;if(te.constraints.collapsible){const Pe=ve.map(Ue=>Ue.constraints),{collapsedSize:Oe=0,panelSize:ke=0,minSize:ze=0,pivotIndices:$e}=Xm(ve,te,xe),Te=ae??ze;if(yf(ke,Oe)){const Ue=E.current.get(te.id),wt=Ue!=null&&Ue>=Te?Ue:Te,St=Xy(ve,te)===ve.length-1?ke-wt:wt-ke,Nn=c1({delta:St,initialLayout:xe,panelConstraints:Pe,pivotIndices:$e,prevLayout:xe,trigger:"imperative-api"});hP(xe,Nn)||(y(Nn),N.current.layout=Nn,be&&be(Nn),Fy(ve,Nn,w.current))}}},[]),O=Fo(te=>{const{layout:ae,panelDataArray:be}=N.current,{panelSize:xe}=Xm(be,te,ae);return tn(xe!=null,`Panel size not found for panel "${te.id}"`),xe},[]),I=Fo((te,ae)=>{const{panelDataArray:be}=N.current,xe=Xy(be,te);return zIe({defaultSize:ae,dragState:v,layout:x,panelData:be,panelIndex:xe})},[v,x]),$=Fo(te=>{const{layout:ae,panelDataArray:be}=N.current,{collapsedSize:xe=0,collapsible:ve,panelSize:Pe}=Xm(be,te,ae);return tn(Pe!=null,`Panel size not found for panel "${te.id}"`),ve===!0&&yf(Pe,xe)},[]),F=Fo(te=>{const{layout:ae,panelDataArray:be}=N.current,{collapsedSize:xe=0,collapsible:ve,panelSize:Pe}=Xm(be,te,ae);return tn(Pe!=null,`Panel size not found for panel "${te.id}"`),!ve||qv(Pe,xe)>0},[]),B=Fo(te=>{const{panelDataArray:ae}=N.current;ae.push(te),ae.sort((be,xe)=>{const ve=be.order,Pe=xe.order;return ve==null&&Pe==null?0:ve==null?-1:Pe==null?1:ve-Pe}),N.current.panelDataArrayChanged=!0,b()},[b]);Av(()=>{if(N.current.panelDataArrayChanged){N.current.panelDataArrayChanged=!1;const{autoSaveId:te,onLayout:ae,storage:be}=T.current,{layout:xe,panelDataArray:ve}=N.current;let Pe=null;if(te){const ke=UIe(te,ve,be);ke&&(E.current=new Map(Object.entries(ke.expandToSizes)),Pe=ke.layout)}Pe==null&&(Pe=FIe({panelDataArray:ve}));const Oe=C7({layout:Pe,panelConstraints:ve.map(ke=>ke.constraints)});w7(xe,Oe)||(y(Oe),N.current.layout=Oe,ae&&ae(Oe),Fy(ve,Oe,w.current))}}),Av(()=>{const te=N.current;return()=>{te.layout=[]}},[]);const W=Fo(te=>function(be){be.preventDefault();const xe=g.current;if(!xe)return()=>null;const{direction:ve,dragState:Pe,id:Oe,keyboardResizeBy:ke,onLayout:ze}=T.current,{layout:$e,panelDataArray:Te}=N.current,{initialLayout:Ue}=Pe??{},wt=Boe(Oe,te,xe);let ut=$Ie(be,te,ve,Pe,ke,xe);const St=ve==="horizontal";document.dir==="rtl"&&St&&(ut=-ut);const Nn=Te.map(It=>It.constraints),cn=c1({delta:ut,initialLayout:Ue??$e,panelConstraints:Nn,pivotIndices:wt,prevLayout:$e,trigger:Doe(be)?"keyboard":"mouse-or-touch"}),hn=!hP($e,cn);(Ooe(be)||Moe(be))&&R.current!=ut&&(R.current=ut,hn?k4(te,0):St?k4(te,ut<0?Loe:joe):k4(te,ut<0?$oe:Foe)),hn&&(y(cn),N.current.layout=cn,ze&&ze(cn),Fy(Te,cn,w.current))},[]),Z=Fo((te,ae)=>{const{onLayout:be}=T.current,{layout:xe,panelDataArray:ve}=N.current,Pe=ve.map(Ue=>Ue.constraints),{panelSize:Oe,pivotIndices:ke}=Xm(ve,te,xe);tn(Oe!=null,`Panel size not found for panel "${te.id}"`);const $e=Xy(ve,te)===ve.length-1?Oe-ae:ae-Oe,Te=c1({delta:$e,initialLayout:xe,panelConstraints:Pe,pivotIndices:ke,prevLayout:xe,trigger:"imperative-api"});hP(xe,Te)||(y(Te),N.current.layout=Te,be&&be(Te),Fy(ve,Te,w.current))},[]),Y=Fo((te,ae)=>{const{layout:be,panelDataArray:xe}=N.current,{collapsedSize:ve=0,collapsible:Pe}=ae,{collapsedSize:Oe=0,collapsible:ke,maxSize:ze=100,minSize:$e=0}=te.constraints,{panelSize:Te}=Xm(xe,te,be);Te!=null&&(Pe&&ke&&yf(Te,ve)?yf(ve,Oe)||Z(te,Oe):Te<$e?Z(te,$e):Te>ze&&Z(te,ze))},[Z]),H=Fo((te,ae)=>{const{direction:be}=T.current,{layout:xe}=N.current;if(!g.current)return;const ve=tO(te,g.current);tn(ve,`Drag handle element not found for id "${te}"`);const Pe=Voe(be,ae);m({dragHandleId:te,dragHandleRect:ve.getBoundingClientRect(),initialCursorPosition:Pe,initialLayout:xe})},[]),se=Fo(()=>{m(null)},[]),he=Fo(te=>{const{panelDataArray:ae}=N.current,be=Xy(ae,te);be>=0&&(ae.splice(be,1),delete w.current[te.id],N.current.panelDataArrayChanged=!0,b())},[b]),re=yIe(()=>({collapsePanel:A,direction:r,dragState:v,expandPanel:D,getPanelSize:O,getPanelStyle:I,groupId:f,isPanelCollapsed:$,isPanelExpanded:F,reevaluatePanelConstraints:Y,registerPanel:B,registerResizeHandle:W,resizePanel:Z,startDragging:H,stopDragging:se,unregisterPanel:he,panelGroupElement:g.current}),[A,v,r,D,O,I,f,$,F,Y,B,W,Z,H,se,he]),J={display:"flex",flexDirection:r==="horizontal"?"row":"column",height:"100%",overflow:"hidden",width:"100%"};return ux(ZD.Provider,{value:re},ux(h,{...u,children:t,className:n,id:i,ref:g,style:{...J,...d},"data-panel-group":"","data-panel-group-direction":r,"data-panel-group-id":f}))}const Koe=Roe((e,t)=>ux(Goe,{...e,forwardedRef:t}));Goe.displayName="PanelGroup";Koe.displayName="forwardRef(PanelGroup)";function Xy(e,t){return e.findIndex(n=>n===t||n.id===t.id)}function Xm(e,t,n){const r=Xy(e,t),i=r===e.length-1?[r-1,r]:[r,r+1],o=n[r];return{...t.constraints,panelSize:o,pivotIndices:i}}function WIe({disabled:e,handleId:t,resizeHandler:n,panelGroupElement:r}){Ev(()=>{if(e||n==null||r==null)return;const s=tO(t,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");tn(a,`No group element found for id "${a}"`);const c=PC(a,r),d=zoe(a,t,r);tn(d!==null,`No resize element found for id "${t}"`);const h=o.shiftKey?d>0?d-1:c.length-1:d+1<c.length?d+1:0;c[h].focus();break}}};return s.addEventListener("keydown",i),()=>{s.removeEventListener("keydown",i)}},[r,e,t,n])}function Yoe({children:e=null,className:t="",disabled:n=!1,hitAreaMargins:r,id:s,onBlur:i,onDragging:o,onFocus:a,style:c={},tabIndex:d=0,tagName:h="div",...u}){var f,g;const v=Ko(null),m=Ko({onDragging:o});Ev(()=>{m.current.onDragging=o});const x=Poe(ZD);if(x===null)throw Error("PanelResizeHandle components must be rendered within a PanelGroup container");const{direction:y,groupId:b,registerResizeHandle:w,startDragging:E,stopDragging:R,panelGroupElement:T}=x,N=O8(s),[A,D]=Mb("inactive"),[O,I]=Mb(!1),[$,F]=Mb(null),B=Ko({state:A});Av(()=>{B.current.state=A}),Ev(()=>{if(n)F(null);else{const H=w(N);F(()=>H)}},[n,N,w]);const W=(f=r==null?void 0:r.coarse)!==null&&f!==void 0?f:15,Z=(g=r==null?void 0:r.fine)!==null&&g!==void 0?g:5;return Ev(()=>{if(n||$==null)return;const H=v.current;return tn(H,"Element ref not attached"),kIe(N,H,y,{coarse:W,fine:Z},(he,re,J)=>{if(re)switch(he){case"down":{D("drag"),E(N,J);const{onDragging:te}=m.current;te&&te(!0);break}case"move":{const{state:te}=B.current;te!=="drag"&&D("hover"),$(J);break}case"up":{D("hover"),R();const{onDragging:te}=m.current;te&&te(!1);break}}else D("inactive")})},[W,y,n,Z,w,N,$,E,R]),WIe({disabled:n,handleId:N,resizeHandler:$,panelGroupElement:T}),ux(h,{...u,children:e,className:t,id:s,onBlur:()=>{I(!1),i==null||i()},onFocus:()=>{I(!0),a==null||a()},ref:v,role:"separator",style:{...{touchAction:"none",userSelect:"none"},...c},tabIndex:d,"data-panel-group-direction":y,"data-panel-group-id":b,"data-resize-handle":"","data-resize-handle-active":A==="drag"?"pointer":O?"keyboard":void 0,"data-resize-handle-state":A,"data-panel-resize-handle-enabled":!n,"data-panel-resize-handle-id":N})}Yoe.displayName="PanelResizeHandle";const qIe=({className:e,...t})=>_.jsx(Koe,{className:ge("flex h-full w-full data-[panel-group-direction=vertical]:flex-col",e),...t}),A7=koe,GIe=({withHandle:e,className:t,...n})=>_.jsx(Yoe,{className:ge("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",t),...n,children:e&&_.jsx("div",{className:"z-10 flex h-4 w-3 items-center justify-center rounded-sm border bg-border",children:_.jsx(CJ,{className:"h-2.5 w-2.5"})})});function NC(e,[t,n]){return Math.min(n,Math.max(t,e))}function KIe(e,t){return C.useReducer((n,r)=>t[n][r]??n,e)}var j8="ScrollArea",[Xoe,S7e]=_r(j8),[YIe,Nl]=Xoe(j8),Qoe=C.forwardRef((e,t)=>{const{__scopeScrollArea:n,type:r="hover",dir:s,scrollHideDelay:i=600,...o}=e,[a,c]=C.useState(null),[d,h]=C.useState(null),[u,f]=C.useState(null),[g,v]=C.useState(null),[m,x]=C.useState(null),[y,b]=C.useState(0),[w,E]=C.useState(0),[R,T]=C.useState(!1),[N,A]=C.useState(!1),D=_t(t,I=>c(I)),O=kc(s);return _.jsx(YIe,{scope:n,type:r,dir:O,scrollHideDelay:i,scrollArea:a,viewport:d,onViewportChange:h,content:u,onContentChange:f,scrollbarX:g,onScrollbarXChange:v,scrollbarXEnabled:R,onScrollbarXEnabledChange:T,scrollbarY:m,onScrollbarYChange:x,scrollbarYEnabled:N,onScrollbarYEnabledChange:A,onCornerWidthChange:b,onCornerHeightChange:E,children:_.jsx(He.div,{dir:O,...o,ref:D,style:{position:"relative","--radix-scroll-area-corner-width":y+"px","--radix-scroll-area-corner-height":w+"px",...e.style}})})});Qoe.displayName=j8;var Zoe="ScrollAreaViewport",Joe=C.forwardRef((e,t)=>{const{__scopeScrollArea:n,children:r,nonce:s,...i}=e,o=Nl(Zoe,n),a=C.useRef(null),c=_t(t,a,o.onViewportChange);return _.jsxs(_.Fragment,{children:[_.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}),_.jsx(He.div,{"data-radix-scroll-area-viewport":"",...i,ref:c,style:{overflowX:o.scrollbarXEnabled?"scroll":"hidden",overflowY:o.scrollbarYEnabled?"scroll":"hidden",...e.style},children:_.jsx("div",{ref:o.onContentChange,style:{minWidth:"100%",display:"table"},children:r})})]})});Joe.displayName=Zoe;var $u="ScrollAreaScrollbar",$8=C.forwardRef((e,t)=>{const{forceMount:n,...r}=e,s=Nl($u,e.__scopeScrollArea),{onScrollbarXEnabledChange:i,onScrollbarYEnabledChange:o}=s,a=e.orientation==="horizontal";return C.useEffect(()=>(a?i(!0):o(!0),()=>{a?i(!1):o(!1)}),[a,i,o]),s.type==="hover"?_.jsx(XIe,{...r,ref:t,forceMount:n}):s.type==="scroll"?_.jsx(QIe,{...r,ref:t,forceMount:n}):s.type==="auto"?_.jsx(eae,{...r,ref:t,forceMount:n}):s.type==="always"?_.jsx(F8,{...r,ref:t}):null});$8.displayName=$u;var XIe=C.forwardRef((e,t)=>{const{forceMount:n,...r}=e,s=Nl($u,e.__scopeScrollArea),[i,o]=C.useState(!1);return C.useEffect(()=>{const a=s.scrollArea;let c=0;if(a){const d=()=>{window.clearTimeout(c),o(!0)},h=()=>{c=window.setTimeout(()=>o(!1),s.scrollHideDelay)};return a.addEventListener("pointerenter",d),a.addEventListener("pointerleave",h),()=>{window.clearTimeout(c),a.removeEventListener("pointerenter",d),a.removeEventListener("pointerleave",h)}}},[s.scrollArea,s.scrollHideDelay]),_.jsx(Vr,{present:n||i,children:_.jsx(eae,{"data-state":i?"visible":"hidden",...r,ref:t})})}),QIe=C.forwardRef((e,t)=>{const{forceMount:n,...r}=e,s=Nl($u,e.__scopeScrollArea),i=e.orientation==="horizontal",o=rO(()=>c("SCROLL_END"),100),[a,c]=KIe("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 C.useEffect(()=>{if(a==="idle"){const d=window.setTimeout(()=>c("HIDE"),s.scrollHideDelay);return()=>window.clearTimeout(d)}},[a,s.scrollHideDelay,c]),C.useEffect(()=>{const d=s.viewport,h=i?"scrollLeft":"scrollTop";if(d){let u=d[h];const f=()=>{const g=d[h];u!==g&&(c("SCROLL"),o()),u=g};return d.addEventListener("scroll",f),()=>d.removeEventListener("scroll",f)}},[s.viewport,i,c,o]),_.jsx(Vr,{present:n||a!=="hidden",children:_.jsx(F8,{"data-state":a==="hidden"?"hidden":"visible",...r,ref:t,onPointerEnter:Ae(e.onPointerEnter,()=>c("POINTER_ENTER")),onPointerLeave:Ae(e.onPointerLeave,()=>c("POINTER_LEAVE"))})})}),eae=C.forwardRef((e,t)=>{const n=Nl($u,e.__scopeScrollArea),{forceMount:r,...s}=e,[i,o]=C.useState(!1),a=e.orientation==="horizontal",c=rO(()=>{if(n.viewport){const d=n.viewport.offsetWidth<n.viewport.scrollWidth,h=n.viewport.offsetHeight<n.viewport.scrollHeight;o(a?d:h)}},10);return dx(n.viewport,c),dx(n.content,c),_.jsx(Vr,{present:r||i,children:_.jsx(F8,{"data-state":i?"visible":"hidden",...s,ref:t})})}),F8=C.forwardRef((e,t)=>{const{orientation:n="vertical",...r}=e,s=Nl($u,e.__scopeScrollArea),i=C.useRef(null),o=C.useRef(0),[a,c]=C.useState({content:0,viewport:0,scrollbar:{size:0,paddingStart:0,paddingEnd:0}}),d=iae(a.viewport,a.content),h={...r,sizes:a,onSizesChange:c,hasThumb:d>0&&d<1,onThumbChange:f=>i.current=f,onThumbPointerUp:()=>o.current=0,onThumbPointerDown:f=>o.current=f};function u(f,g){return rLe(f,o.current,a,g)}return n==="horizontal"?_.jsx(ZIe,{...h,ref:t,onThumbPositionChange:()=>{if(s.viewport&&i.current){const f=s.viewport.scrollLeft,g=R7(f,a,s.dir);i.current.style.transform=`translate3d(${g}px, 0, 0)`}},onWheelScroll:f=>{s.viewport&&(s.viewport.scrollLeft=f)},onDragScroll:f=>{s.viewport&&(s.viewport.scrollLeft=u(f,s.dir))}}):n==="vertical"?_.jsx(JIe,{...h,ref:t,onThumbPositionChange:()=>{if(s.viewport&&i.current){const f=s.viewport.scrollTop,g=R7(f,a);i.current.style.transform=`translate3d(0, ${g}px, 0)`}},onWheelScroll:f=>{s.viewport&&(s.viewport.scrollTop=f)},onDragScroll:f=>{s.viewport&&(s.viewport.scrollTop=u(f))}}):null}),ZIe=C.forwardRef((e,t)=>{const{sizes:n,onSizesChange:r,...s}=e,i=Nl($u,e.__scopeScrollArea),[o,a]=C.useState(),c=C.useRef(null),d=_t(t,c,i.onScrollbarXChange);return C.useEffect(()=>{c.current&&a(getComputedStyle(c.current))},[c]),_.jsx(nae,{"data-orientation":"horizontal",...s,ref:d,sizes:n,style:{bottom:0,left:i.dir==="rtl"?"var(--radix-scroll-area-corner-width)":0,right:i.dir==="ltr"?"var(--radix-scroll-area-corner-width)":0,"--radix-scroll-area-thumb-width":nO(n)+"px",...e.style},onThumbPointerDown:h=>e.onThumbPointerDown(h.x),onDragScroll:h=>e.onDragScroll(h.x),onWheelScroll:(h,u)=>{if(i.viewport){const f=i.viewport.scrollLeft+h.deltaX;e.onWheelScroll(f),aae(f,u)&&h.preventDefault()}},onResize:()=>{c.current&&i.viewport&&o&&r({content:i.viewport.scrollWidth,viewport:i.viewport.offsetWidth,scrollbar:{size:c.current.clientWidth,paddingStart:$T(o.paddingLeft),paddingEnd:$T(o.paddingRight)}})}})}),JIe=C.forwardRef((e,t)=>{const{sizes:n,onSizesChange:r,...s}=e,i=Nl($u,e.__scopeScrollArea),[o,a]=C.useState(),c=C.useRef(null),d=_t(t,c,i.onScrollbarYChange);return C.useEffect(()=>{c.current&&a(getComputedStyle(c.current))},[c]),_.jsx(nae,{"data-orientation":"vertical",...s,ref:d,sizes:n,style:{top:0,right:i.dir==="ltr"?0:void 0,left:i.dir==="rtl"?0:void 0,bottom:"var(--radix-scroll-area-corner-height)","--radix-scroll-area-thumb-height":nO(n)+"px",...e.style},onThumbPointerDown:h=>e.onThumbPointerDown(h.y),onDragScroll:h=>e.onDragScroll(h.y),onWheelScroll:(h,u)=>{if(i.viewport){const f=i.viewport.scrollTop+h.deltaY;e.onWheelScroll(f),aae(f,u)&&h.preventDefault()}},onResize:()=>{c.current&&i.viewport&&o&&r({content:i.viewport.scrollHeight,viewport:i.viewport.offsetHeight,scrollbar:{size:c.current.clientHeight,paddingStart:$T(o.paddingTop),paddingEnd:$T(o.paddingBottom)}})}})}),[eLe,tae]=Xoe($u),nae=C.forwardRef((e,t)=>{const{__scopeScrollArea:n,sizes:r,hasThumb:s,onThumbChange:i,onThumbPointerUp:o,onThumbPointerDown:a,onThumbPositionChange:c,onDragScroll:d,onWheelScroll:h,onResize:u,...f}=e,g=Nl($u,n),[v,m]=C.useState(null),x=_t(t,D=>m(D)),y=C.useRef(null),b=C.useRef(""),w=g.viewport,E=r.content-r.viewport,R=bn(h),T=bn(c),N=rO(u,10);function A(D){if(y.current){const O=D.clientX-y.current.left,I=D.clientY-y.current.top;d({x:O,y:I})}}return C.useEffect(()=>{const D=O=>{const I=O.target;(v==null?void 0:v.contains(I))&&R(O,E)};return document.addEventListener("wheel",D,{passive:!1}),()=>document.removeEventListener("wheel",D,{passive:!1})},[w,v,E,R]),C.useEffect(T,[r,T]),dx(v,N),dx(g.content,N),_.jsx(eLe,{scope:n,scrollbar:v,hasThumb:s,onThumbChange:bn(i),onThumbPointerUp:bn(o),onThumbPositionChange:T,onThumbPointerDown:bn(a),children:_.jsx(He.div,{...f,ref:x,style:{position:"absolute",...f.style},onPointerDown:Ae(e.onPointerDown,D=>{D.button===0&&(D.target.setPointerCapture(D.pointerId),y.current=v.getBoundingClientRect(),b.current=document.body.style.webkitUserSelect,document.body.style.webkitUserSelect="none",g.viewport&&(g.viewport.style.scrollBehavior="auto"),A(D))}),onPointerMove:Ae(e.onPointerMove,A),onPointerUp:Ae(e.onPointerUp,D=>{const O=D.target;O.hasPointerCapture(D.pointerId)&&O.releasePointerCapture(D.pointerId),document.body.style.webkitUserSelect=b.current,g.viewport&&(g.viewport.style.scrollBehavior=""),y.current=null})})})}),jT="ScrollAreaThumb",rae=C.forwardRef((e,t)=>{const{forceMount:n,...r}=e,s=tae(jT,e.__scopeScrollArea);return _.jsx(Vr,{present:n||s.hasThumb,children:_.jsx(tLe,{ref:t,...r})})}),tLe=C.forwardRef((e,t)=>{const{__scopeScrollArea:n,style:r,...s}=e,i=Nl(jT,n),o=tae(jT,n),{onThumbPositionChange:a}=o,c=_t(t,u=>o.onThumbChange(u)),d=C.useRef(),h=rO(()=>{d.current&&(d.current(),d.current=void 0)},100);return C.useEffect(()=>{const u=i.viewport;if(u){const f=()=>{if(h(),!d.current){const g=sLe(u,a);d.current=g,a()}};return a(),u.addEventListener("scroll",f),()=>u.removeEventListener("scroll",f)}},[i.viewport,h,a]),_.jsx(He.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:Ae(e.onPointerDownCapture,u=>{const g=u.target.getBoundingClientRect(),v=u.clientX-g.left,m=u.clientY-g.top;o.onThumbPointerDown({x:v,y:m})}),onPointerUp:Ae(e.onPointerUp,o.onThumbPointerUp)})});rae.displayName=jT;var z8="ScrollAreaCorner",sae=C.forwardRef((e,t)=>{const n=Nl(z8,e.__scopeScrollArea),r=!!(n.scrollbarX&&n.scrollbarY);return n.type!=="scroll"&&r?_.jsx(nLe,{...e,ref:t}):null});sae.displayName=z8;var nLe=C.forwardRef((e,t)=>{const{__scopeScrollArea:n,...r}=e,s=Nl(z8,n),[i,o]=C.useState(0),[a,c]=C.useState(0),d=!!(i&&a);return dx(s.scrollbarX,()=>{var u;const h=((u=s.scrollbarX)==null?void 0:u.offsetHeight)||0;s.onCornerHeightChange(h),c(h)}),dx(s.scrollbarY,()=>{var u;const h=((u=s.scrollbarY)==null?void 0:u.offsetWidth)||0;s.onCornerWidthChange(h),o(h)}),d?_.jsx(He.div,{...r,ref:t,style:{width:i,height:a,position:"absolute",right:s.dir==="ltr"?0:void 0,left:s.dir==="rtl"?0:void 0,bottom:0,...e.style}}):null});function $T(e){return e?parseInt(e,10):0}function iae(e,t){const n=e/t;return isNaN(n)?0:n}function nO(e){const t=iae(e.viewport,e.content),n=e.scrollbar.paddingStart+e.scrollbar.paddingEnd,r=(e.scrollbar.size-n)*t;return Math.max(r,18)}function rLe(e,t,n,r="ltr"){const s=nO(n),i=s/2,o=t||i,a=s-o,c=n.scrollbar.paddingStart+o,d=n.scrollbar.size-n.scrollbar.paddingEnd-a,h=n.content-n.viewport,u=r==="ltr"?[0,h]:[h*-1,0];return oae([c,d],u)(e)}function R7(e,t,n="ltr"){const r=nO(t),s=t.scrollbar.paddingStart+t.scrollbar.paddingEnd,i=t.scrollbar.size-s,o=t.content-t.viewport,a=i-r,c=n==="ltr"?[0,o]:[o*-1,0],d=NC(e,c);return oae([0,o],[0,a])(d)}function oae(e,t){return n=>{if(e[0]===e[1]||t[0]===t[1])return t[0];const r=(t[1]-t[0])/(e[1]-e[0]);return t[0]+r*(n-e[0])}}function aae(e,t){return e>0&&e<t}var sLe=(e,t=()=>{})=>{let n={left:e.scrollLeft,top:e.scrollTop},r=0;return function s(){const i={left:e.scrollLeft,top:e.scrollTop},o=n.left!==i.left,a=n.top!==i.top;(o||a)&&t(),n=i,r=window.requestAnimationFrame(s)}(),()=>window.cancelAnimationFrame(r)};function rO(e,t){const n=bn(e),r=C.useRef(0);return C.useEffect(()=>()=>window.clearTimeout(r.current),[]),C.useCallback(()=>{window.clearTimeout(r.current),r.current=window.setTimeout(n,t)},[n,t])}function dx(e,t){const n=bn(t);Rr(()=>{let r=0;if(e){const s=new ResizeObserver(()=>{cancelAnimationFrame(r),r=window.requestAnimationFrame(n)});return s.observe(e),()=>{window.cancelAnimationFrame(r),s.unobserve(e)}}},[e,n])}var lae=Qoe,iLe=Joe,oLe=sae;const sO=C.forwardRef(({className:e,children:t,...n},r)=>_.jsxs(lae,{ref:r,className:ge("relative overflow-hidden",e),...n,children:[_.jsx(iLe,{className:"h-full w-full rounded-[inherit]",children:t}),_.jsx(cae,{}),_.jsx(oLe,{})]}));sO.displayName=lae.displayName;const cae=C.forwardRef(({className:e,orientation:t="vertical",...n},r)=>_.jsx($8,{ref:r,orientation:t,className:ge("flex touch-none select-none transition-colors",t==="vertical"&&"h-full w-2.5 border-l border-l-transparent p-[1px]",t==="horizontal"&&"h-2.5 flex-col border-t border-t-transparent p-[1px]",e),...n,children:_.jsx(rae,{className:"relative flex-1 rounded-full bg-border"})}));cae.displayName=$8.displayName;var aLe=[" ","Enter","ArrowUp","ArrowDown"],lLe=[" ","Enter"],fR="Select",[iO,oO,cLe]=Uf(fR),[Gx,C7e]=_r(fR,[cLe,Iu]),aO=Iu(),[uLe,Tp]=Gx(fR),[dLe,fLe]=Gx(fR),uae=e=>{const{__scopeSelect:t,children:n,open:r,defaultOpen:s,onOpenChange:i,value:o,defaultValue:a,onValueChange:c,dir:d,name:h,autoComplete:u,disabled:f,required:g}=e,v=aO(t),[m,x]=C.useState(null),[y,b]=C.useState(null),[w,E]=C.useState(!1),R=kc(d),[T=!1,N]=os({prop:r,defaultProp:s,onChange:i}),[A,D]=os({prop:o,defaultProp:a,onChange:c}),O=C.useRef(null),I=m?!!m.closest("form"):!0,[$,F]=C.useState(new Set),B=Array.from($).map(W=>W.props.value).join(";");return _.jsx(HD,{...v,children:_.jsxs(uLe,{required:g,scope:t,trigger:m,onTriggerChange:x,valueNode:y,onValueNodeChange:b,valueNodeHasChildren:w,onValueNodeHasChildrenChange:E,contentId:si(),value:A,onValueChange:D,open:T,onOpenChange:N,dir:R,triggerPointerDownPosRef:O,disabled:f,children:[_.jsx(iO.Provider,{scope:t,children:_.jsx(dLe,{scope:e.__scopeSelect,onNativeOptionAdd:C.useCallback(W=>{F(Z=>new Set(Z).add(W))},[]),onNativeOptionRemove:C.useCallback(W=>{F(Z=>{const Y=new Set(Z);return Y.delete(W),Y})},[]),children:n})}),I?_.jsxs(Iae,{"aria-hidden":!0,required:g,tabIndex:-1,name:h,autoComplete:u,value:A,onChange:W=>D(W.target.value),disabled:f,children:[A===void 0?_.jsx("option",{value:""}):null,Array.from($)]},B):null]})})};uae.displayName=fR;var dae="SelectTrigger",fae=C.forwardRef((e,t)=>{const{__scopeSelect:n,disabled:r=!1,...s}=e,i=aO(n),o=Tp(dae,n),a=o.disabled||r,c=_t(t,o.onTriggerChange),d=oO(n),[h,u,f]=Lae(v=>{const m=d().filter(b=>!b.disabled),x=m.find(b=>b.value===o.value),y=jae(m,v,x);y!==void 0&&o.onValueChange(y.value)}),g=()=>{a||(o.onOpenChange(!0),f())};return _.jsx(Ux,{asChild:!0,...i,children:_.jsx(He.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":Mae(o.value)?"":void 0,...s,ref:c,onClick:Ae(s.onClick,v=>{v.currentTarget.focus()}),onPointerDown:Ae(s.onPointerDown,v=>{const m=v.target;m.hasPointerCapture(v.pointerId)&&m.releasePointerCapture(v.pointerId),v.button===0&&v.ctrlKey===!1&&(g(),o.triggerPointerDownPosRef.current={x:Math.round(v.pageX),y:Math.round(v.pageY)},v.preventDefault())}),onKeyDown:Ae(s.onKeyDown,v=>{const m=h.current!=="";!(v.ctrlKey||v.altKey||v.metaKey)&&v.key.length===1&&u(v.key),!(m&&v.key===" ")&&aLe.includes(v.key)&&(g(),v.preventDefault())})})})});fae.displayName=dae;var hae="SelectValue",pae=C.forwardRef((e,t)=>{const{__scopeSelect:n,className:r,style:s,children:i,placeholder:o="",...a}=e,c=Tp(hae,n),{onValueNodeHasChildrenChange:d}=c,h=i!==void 0,u=_t(t,c.onValueNodeChange);return Rr(()=>{d(h)},[d,h]),_.jsx(He.span,{...a,ref:u,style:{pointerEvents:"none"},children:Mae(c.value)?_.jsx(_.Fragment,{children:o}):i})});pae.displayName=hae;var hLe="SelectIcon",mae=C.forwardRef((e,t)=>{const{__scopeSelect:n,children:r,...s}=e;return _.jsx(He.span,{"aria-hidden":!0,...s,ref:t,children:r||"▼"})});mae.displayName=hLe;var pLe="SelectPortal",gae=e=>_.jsx(Dx,{asChild:!0,...e});gae.displayName=pLe;var Gv="SelectContent",vae=C.forwardRef((e,t)=>{const n=Tp(Gv,e.__scopeSelect),[r,s]=C.useState();if(Rr(()=>{s(new DocumentFragment)},[]),!n.open){const i=r;return i?Li.createPortal(_.jsx(yae,{scope:e.__scopeSelect,children:_.jsx(iO.Slot,{scope:e.__scopeSelect,children:_.jsx("div",{children:e.children})})}),i):null}return _.jsx(bae,{...e,ref:t})});vae.displayName=Gv;var $d=10,[yae,kp]=Gx(Gv),mLe="SelectContentImpl",bae=C.forwardRef((e,t)=>{const{__scopeSelect:n,position:r="item-aligned",onCloseAutoFocus:s,onEscapeKeyDown:i,onPointerDownOutside:o,side:a,sideOffset:c,align:d,alignOffset:h,arrowPadding:u,collisionBoundary:f,collisionPadding:g,sticky:v,hideWhenDetached:m,avoidCollisions:x,...y}=e,b=Tp(Gv,n),[w,E]=C.useState(null),[R,T]=C.useState(null),N=_t(t,ve=>E(ve)),[A,D]=C.useState(null),[O,I]=C.useState(null),$=oO(n),[F,B]=C.useState(!1),W=C.useRef(!1);C.useEffect(()=>{if(w)return Ox(w)},[w]),uD();const Z=C.useCallback(ve=>{const[Pe,...Oe]=$().map($e=>$e.ref.current),[ke]=Oe.slice(-1),ze=document.activeElement;for(const $e of ve)if($e===ze||($e==null||$e.scrollIntoView({block:"nearest"}),$e===Pe&&R&&(R.scrollTop=0),$e===ke&&R&&(R.scrollTop=R.scrollHeight),$e==null||$e.focus(),document.activeElement!==ze))return},[$,R]),Y=C.useCallback(()=>Z([A,w]),[Z,A,w]);C.useEffect(()=>{F&&Y()},[F,Y]);const{onOpenChange:H,triggerPointerDownPosRef:se}=b;C.useEffect(()=>{if(w){let ve={x:0,y:0};const Pe=ke=>{var ze,$e;ve={x:Math.abs(Math.round(ke.pageX)-(((ze=se.current)==null?void 0:ze.x)??0)),y:Math.abs(Math.round(ke.pageY)-((($e=se.current)==null?void 0:$e.y)??0))}},Oe=ke=>{ve.x<=10&&ve.y<=10?ke.preventDefault():w.contains(ke.target)||H(!1),document.removeEventListener("pointermove",Pe),se.current=null};return se.current!==null&&(document.addEventListener("pointermove",Pe),document.addEventListener("pointerup",Oe,{capture:!0,once:!0})),()=>{document.removeEventListener("pointermove",Pe),document.removeEventListener("pointerup",Oe,{capture:!0})}}},[w,H,se]),C.useEffect(()=>{const ve=()=>H(!1);return window.addEventListener("blur",ve),window.addEventListener("resize",ve),()=>{window.removeEventListener("blur",ve),window.removeEventListener("resize",ve)}},[H]);const[he,re]=Lae(ve=>{const Pe=$().filter(ze=>!ze.disabled),Oe=Pe.find(ze=>ze.ref.current===document.activeElement),ke=jae(Pe,ve,Oe);ke&&setTimeout(()=>ke.ref.current.focus())}),J=C.useCallback((ve,Pe,Oe)=>{const ke=!W.current&&!Oe;(b.value!==void 0&&b.value===Pe||ke)&&(D(ve),ke&&(W.current=!0))},[b.value]),te=C.useCallback(()=>w==null?void 0:w.focus(),[w]),ae=C.useCallback((ve,Pe,Oe)=>{const ke=!W.current&&!Oe;(b.value!==void 0&&b.value===Pe||ke)&&I(ve)},[b.value]),be=r==="popper"?vU:xae,xe=be===vU?{side:a,sideOffset:c,align:d,alignOffset:h,arrowPadding:u,collisionBoundary:f,collisionPadding:g,sticky:v,hideWhenDetached:m,avoidCollisions:x}:{};return _.jsx(yae,{scope:n,content:w,viewport:R,onViewportChange:T,itemRefCallback:J,selectedItem:A,onItemLeave:te,itemTextRefCallback:ae,focusSelectedItem:Y,selectedItemText:O,position:r,isPositioned:F,searchRef:he,children:_.jsx(IA,{as:Cc,allowPinchZoom:!0,children:_.jsx(MA,{asChild:!0,trapped:b.open,onMountAutoFocus:ve=>{ve.preventDefault()},onUnmountAutoFocus:Ae(s,ve=>{var Pe;(Pe=b.trigger)==null||Pe.focus({preventScroll:!0}),ve.preventDefault()}),children:_.jsx(Hf,{asChild:!0,disableOutsidePointerEvents:!0,onEscapeKeyDown:i,onPointerDownOutside:o,onFocusOutside:ve=>ve.preventDefault(),onDismiss:()=>b.onOpenChange(!1),children:_.jsx(be,{role:"listbox",id:b.contentId,"data-state":b.open?"open":"closed",dir:b.dir,onContextMenu:ve=>ve.preventDefault(),...y,...xe,onPlaced:()=>B(!0),ref:N,style:{display:"flex",flexDirection:"column",outline:"none",...y.style},onKeyDown:Ae(y.onKeyDown,ve=>{const Pe=ve.ctrlKey||ve.altKey||ve.metaKey;if(ve.key==="Tab"&&ve.preventDefault(),!Pe&&ve.key.length===1&&re(ve.key),["ArrowUp","ArrowDown","Home","End"].includes(ve.key)){let ke=$().filter(ze=>!ze.disabled).map(ze=>ze.ref.current);if(["ArrowUp","End"].includes(ve.key)&&(ke=ke.slice().reverse()),["ArrowUp","ArrowDown"].includes(ve.key)){const ze=ve.target,$e=ke.indexOf(ze);ke=ke.slice($e+1)}setTimeout(()=>Z(ke)),ve.preventDefault()}})})})})})})});bae.displayName=mLe;var gLe="SelectItemAlignedPosition",xae=C.forwardRef((e,t)=>{const{__scopeSelect:n,onPlaced:r,...s}=e,i=Tp(Gv,n),o=kp(Gv,n),[a,c]=C.useState(null),[d,h]=C.useState(null),u=_t(t,N=>h(N)),f=oO(n),g=C.useRef(!1),v=C.useRef(!0),{viewport:m,selectedItem:x,selectedItemText:y,focusSelectedItem:b}=o,w=C.useCallback(()=>{if(i.trigger&&i.valueNode&&a&&d&&m&&x&&y){const N=i.trigger.getBoundingClientRect(),A=d.getBoundingClientRect(),D=i.valueNode.getBoundingClientRect(),O=y.getBoundingClientRect();if(i.dir!=="rtl"){const ze=O.left-A.left,$e=D.left-ze,Te=N.left-$e,Ue=N.width+Te,wt=Math.max(Ue,A.width),ut=window.innerWidth-$d,St=NC($e,[$d,ut-wt]);a.style.minWidth=Ue+"px",a.style.left=St+"px"}else{const ze=A.right-O.right,$e=window.innerWidth-D.right-ze,Te=window.innerWidth-N.right-$e,Ue=N.width+Te,wt=Math.max(Ue,A.width),ut=window.innerWidth-$d,St=NC($e,[$d,ut-wt]);a.style.minWidth=Ue+"px",a.style.right=St+"px"}const I=f(),$=window.innerHeight-$d*2,F=m.scrollHeight,B=window.getComputedStyle(d),W=parseInt(B.borderTopWidth,10),Z=parseInt(B.paddingTop,10),Y=parseInt(B.borderBottomWidth,10),H=parseInt(B.paddingBottom,10),se=W+Z+F+H+Y,he=Math.min(x.offsetHeight*5,se),re=window.getComputedStyle(m),J=parseInt(re.paddingTop,10),te=parseInt(re.paddingBottom,10),ae=N.top+N.height/2-$d,be=$-ae,xe=x.offsetHeight/2,ve=x.offsetTop+xe,Pe=W+Z+ve,Oe=se-Pe;if(Pe<=ae){const ze=x===I[I.length-1].ref.current;a.style.bottom="0px";const $e=d.clientHeight-m.offsetTop-m.offsetHeight,Te=Math.max(be,xe+(ze?te:0)+$e+Y),Ue=Pe+Te;a.style.height=Ue+"px"}else{const ze=x===I[0].ref.current;a.style.top="0px";const Te=Math.max(ae,W+m.offsetTop+(ze?J:0)+xe)+Oe;a.style.height=Te+"px",m.scrollTop=Pe-ae+m.offsetTop}a.style.margin=`${$d}px 0`,a.style.minHeight=he+"px",a.style.maxHeight=$+"px",r==null||r(),requestAnimationFrame(()=>g.current=!0)}},[f,i.trigger,i.valueNode,a,d,m,x,y,i.dir,r]);Rr(()=>w(),[w]);const[E,R]=C.useState();Rr(()=>{d&&R(window.getComputedStyle(d).zIndex)},[d]);const T=C.useCallback(N=>{N&&v.current===!0&&(w(),b==null||b(),v.current=!1)},[w,b]);return _.jsx(yLe,{scope:n,contentWrapper:a,shouldExpandOnScrollRef:g,onScrollButtonChange:T,children:_.jsx("div",{ref:c,style:{display:"flex",flexDirection:"column",position:"fixed",zIndex:E},children:_.jsx(He.div,{...s,ref:u,style:{boxSizing:"border-box",maxHeight:"100%",...s.style}})})})});xae.displayName=gLe;var vLe="SelectPopperPosition",vU=C.forwardRef((e,t)=>{const{__scopeSelect:n,align:r="start",collisionPadding:s=$d,...i}=e,o=aO(n);return _.jsx(YA,{...o,...i,ref:t,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)"}})});vU.displayName=vLe;var[yLe,B8]=Gx(Gv,{}),yU="SelectViewport",_ae=C.forwardRef((e,t)=>{const{__scopeSelect:n,nonce:r,...s}=e,i=kp(yU,n),o=B8(yU,n),a=_t(t,i.onViewportChange),c=C.useRef(0);return _.jsxs(_.Fragment,{children:[_.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}),_.jsx(iO.Slot,{scope:n,children:_.jsx(He.div,{"data-radix-select-viewport":"",role:"presentation",...s,ref:a,style:{position:"relative",flex:1,overflow:"auto",...s.style},onScroll:Ae(s.onScroll,d=>{const h=d.currentTarget,{contentWrapper:u,shouldExpandOnScrollRef:f}=o;if(f!=null&&f.current&&u){const g=Math.abs(c.current-h.scrollTop);if(g>0){const v=window.innerHeight-$d*2,m=parseFloat(u.style.minHeight),x=parseFloat(u.style.height),y=Math.max(m,x);if(y<v){const b=y+g,w=Math.min(v,b),E=b-w;u.style.height=w+"px",u.style.bottom==="0px"&&(h.scrollTop=E>0?E:0,u.style.justifyContent="flex-end")}}}c.current=h.scrollTop})})})]})});_ae.displayName=yU;var wae="SelectGroup",[bLe,xLe]=Gx(wae),_Le=C.forwardRef((e,t)=>{const{__scopeSelect:n,...r}=e,s=si();return _.jsx(bLe,{scope:n,id:s,children:_.jsx(He.div,{role:"group","aria-labelledby":s,...r,ref:t})})});_Le.displayName=wae;var Sae="SelectLabel",Cae=C.forwardRef((e,t)=>{const{__scopeSelect:n,...r}=e,s=xLe(Sae,n);return _.jsx(He.div,{id:s.id,...r,ref:t})});Cae.displayName=Sae;var FT="SelectItem",[wLe,Eae]=Gx(FT),Aae=C.forwardRef((e,t)=>{const{__scopeSelect:n,value:r,disabled:s=!1,textValue:i,...o}=e,a=Tp(FT,n),c=kp(FT,n),d=a.value===r,[h,u]=C.useState(i??""),[f,g]=C.useState(!1),v=_t(t,y=>{var b;return(b=c.itemRefCallback)==null?void 0:b.call(c,y,r,s)}),m=si(),x=()=>{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 _.jsx(wLe,{scope:n,value:r,disabled:s,textId:m,isSelected:d,onItemTextChange:C.useCallback(y=>{u(b=>b||((y==null?void 0:y.textContent)??"").trim())},[]),children:_.jsx(iO.ItemSlot,{scope:n,value:r,disabled:s,textValue:h,children:_.jsx(He.div,{role:"option","aria-labelledby":m,"data-highlighted":f?"":void 0,"aria-selected":d&&f,"data-state":d?"checked":"unchecked","aria-disabled":s||void 0,"data-disabled":s?"":void 0,tabIndex:s?void 0:-1,...o,ref:v,onFocus:Ae(o.onFocus,()=>g(!0)),onBlur:Ae(o.onBlur,()=>g(!1)),onPointerUp:Ae(o.onPointerUp,x),onPointerMove:Ae(o.onPointerMove,y=>{var b;s?(b=c.onItemLeave)==null||b.call(c):y.currentTarget.focus({preventScroll:!0})}),onPointerLeave:Ae(o.onPointerLeave,y=>{var b;y.currentTarget===document.activeElement&&((b=c.onItemLeave)==null||b.call(c))}),onKeyDown:Ae(o.onKeyDown,y=>{var w;((w=c.searchRef)==null?void 0:w.current)!==""&&y.key===" "||(lLe.includes(y.key)&&x(),y.key===" "&&y.preventDefault())})})})})});Aae.displayName=FT;var d1="SelectItemText",Rae=C.forwardRef((e,t)=>{const{__scopeSelect:n,className:r,style:s,...i}=e,o=Tp(d1,n),a=kp(d1,n),c=Eae(d1,n),d=fLe(d1,n),[h,u]=C.useState(null),f=_t(t,y=>u(y),c.onItemTextChange,y=>{var b;return(b=a.itemTextRefCallback)==null?void 0:b.call(a,y,c.value,c.disabled)}),g=h==null?void 0:h.textContent,v=C.useMemo(()=>_.jsx("option",{value:c.value,disabled:c.disabled,children:g},c.value),[c.disabled,c.value,g]),{onNativeOptionAdd:m,onNativeOptionRemove:x}=d;return Rr(()=>(m(v),()=>x(v)),[m,x,v]),_.jsxs(_.Fragment,{children:[_.jsx(He.span,{id:c.textId,...i,ref:f}),c.isSelected&&o.valueNode&&!o.valueNodeHasChildren?Li.createPortal(i.children,o.valueNode):null]})});Rae.displayName=d1;var Pae="SelectItemIndicator",Nae=C.forwardRef((e,t)=>{const{__scopeSelect:n,...r}=e;return Eae(Pae,n).isSelected?_.jsx(He.span,{"aria-hidden":!0,...r,ref:t}):null});Nae.displayName=Pae;var bU="SelectScrollUpButton",Tae=C.forwardRef((e,t)=>{const n=kp(bU,e.__scopeSelect),r=B8(bU,e.__scopeSelect),[s,i]=C.useState(!1),o=_t(t,r.onScrollButtonChange);return Rr(()=>{if(n.viewport&&n.isPositioned){let a=function(){const d=c.scrollTop>0;i(d)};const c=n.viewport;return a(),c.addEventListener("scroll",a),()=>c.removeEventListener("scroll",a)}},[n.viewport,n.isPositioned]),s?_.jsx(Dae,{...e,ref:o,onAutoScroll:()=>{const{viewport:a,selectedItem:c}=n;a&&c&&(a.scrollTop=a.scrollTop-c.offsetHeight)}}):null});Tae.displayName=bU;var xU="SelectScrollDownButton",kae=C.forwardRef((e,t)=>{const n=kp(xU,e.__scopeSelect),r=B8(xU,e.__scopeSelect),[s,i]=C.useState(!1),o=_t(t,r.onScrollButtonChange);return Rr(()=>{if(n.viewport&&n.isPositioned){let a=function(){const d=c.scrollHeight-c.clientHeight,h=Math.ceil(c.scrollTop)<d;i(h)};const c=n.viewport;return a(),c.addEventListener("scroll",a),()=>c.removeEventListener("scroll",a)}},[n.viewport,n.isPositioned]),s?_.jsx(Dae,{...e,ref:o,onAutoScroll:()=>{const{viewport:a,selectedItem:c}=n;a&&c&&(a.scrollTop=a.scrollTop+c.offsetHeight)}}):null});kae.displayName=xU;var Dae=C.forwardRef((e,t)=>{const{__scopeSelect:n,onAutoScroll:r,...s}=e,i=kp("SelectScrollButton",n),o=C.useRef(null),a=oO(n),c=C.useCallback(()=>{o.current!==null&&(window.clearInterval(o.current),o.current=null)},[]);return C.useEffect(()=>()=>c(),[c]),Rr(()=>{var h;const d=a().find(u=>u.ref.current===document.activeElement);(h=d==null?void 0:d.ref.current)==null||h.scrollIntoView({block:"nearest"})},[a]),_.jsx(He.div,{"aria-hidden":!0,...s,ref:t,style:{flexShrink:0,...s.style},onPointerDown:Ae(s.onPointerDown,()=>{o.current===null&&(o.current=window.setInterval(r,50))}),onPointerMove:Ae(s.onPointerMove,()=>{var d;(d=i.onItemLeave)==null||d.call(i),o.current===null&&(o.current=window.setInterval(r,50))}),onPointerLeave:Ae(s.onPointerLeave,()=>{c()})})}),SLe="SelectSeparator",Oae=C.forwardRef((e,t)=>{const{__scopeSelect:n,...r}=e;return _.jsx(He.div,{"aria-hidden":!0,...r,ref:t})});Oae.displayName=SLe;var _U="SelectArrow",CLe=C.forwardRef((e,t)=>{const{__scopeSelect:n,...r}=e,s=aO(n),i=Tp(_U,n),o=kp(_U,n);return i.open&&o.position==="popper"?_.jsx(XA,{...s,...r,ref:t}):null});CLe.displayName=_U;function Mae(e){return e===""||e===void 0}var Iae=C.forwardRef((e,t)=>{const{value:n,...r}=e,s=C.useRef(null),i=_t(t,s),o=$x(n);return C.useEffect(()=>{const a=s.current,c=window.HTMLSelectElement.prototype,h=Object.getOwnPropertyDescriptor(c,"value").set;if(o!==n&&h){const u=new Event("change",{bubbles:!0});h.call(a,n),a.dispatchEvent(u)}},[o,n]),_.jsx(uR,{asChild:!0,children:_.jsx("select",{...r,ref:i,defaultValue:n})})});Iae.displayName="BubbleSelect";function Lae(e){const t=bn(e),n=C.useRef(""),r=C.useRef(0),s=C.useCallback(o=>{const a=n.current+o;t(a),function c(d){n.current=d,window.clearTimeout(r.current),d!==""&&(r.current=window.setTimeout(()=>c(""),1e3))}(a)},[t]),i=C.useCallback(()=>{n.current="",window.clearTimeout(r.current)},[]);return C.useEffect(()=>()=>window.clearTimeout(r.current),[]),[n,s,i]}function jae(e,t,n){const s=t.length>1&&Array.from(t).every(d=>d===t[0])?t[0]:t,i=n?e.indexOf(n):-1;let o=ELe(e,Math.max(i,0));s.length===1&&(o=o.filter(d=>d!==n));const c=o.find(d=>d.textValue.toLowerCase().startsWith(s.toLowerCase()));return c!==n?c:void 0}function ELe(e,t){return e.map((n,r)=>e[(t+r)%e.length])}var ALe=uae,$ae=fae,RLe=pae,PLe=mae,NLe=gae,Fae=vae,TLe=_ae,zae=Cae,Bae=Aae,kLe=Rae,DLe=Nae,Uae=Tae,Vae=kae,Hae=Oae;const U8=ALe,V8=RLe,lO=C.forwardRef(({className:e,children:t,...n},r)=>_.jsxs($ae,{ref:r,className:ge("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",e),...n,children:[t,_.jsx(PLe,{asChild:!0,children:_.jsx(Nx,{className:"h-4 w-4 opacity-50"})})]}));lO.displayName=$ae.displayName;const Wae=C.forwardRef(({className:e,...t},n)=>_.jsx(Uae,{ref:n,className:ge("flex cursor-default items-center justify-center py-1",e),...t,children:_.jsx(bJ,{className:"h-4 w-4"})}));Wae.displayName=Uae.displayName;const qae=C.forwardRef(({className:e,...t},n)=>_.jsx(Vae,{ref:n,className:ge("flex cursor-default items-center justify-center py-1",e),...t,children:_.jsx(Nx,{className:"h-4 w-4"})}));qae.displayName=Vae.displayName;const cO=C.forwardRef(({className:e,children:t,position:n="popper",...r},s)=>_.jsx(NLe,{children:_.jsxs(Fae,{ref:s,className:ge("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",e),position:n,...r,children:[_.jsx(Wae,{}),_.jsx(TLe,{className:ge("p-1",n==="popper"&&"h-[var(--radix-select-trigger-height)] w-full min-w-[var(--radix-select-trigger-width)]"),children:t}),_.jsx(qae,{})]})}));cO.displayName=Fae.displayName;const OLe=C.forwardRef(({className:e,...t},n)=>_.jsx(zae,{ref:n,className:ge("py-1.5 pl-8 pr-2 text-sm font-semibold",e),...t}));OLe.displayName=zae.displayName;const Ib=C.forwardRef(({className:e,children:t,...n},r)=>_.jsxs(Bae,{ref:r,className:ge("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",e),...n,children:[_.jsx("span",{className:"absolute left-2 flex h-3.5 w-3.5 items-center justify-center",children:_.jsx(DLe,{children:_.jsx(OA,{className:"h-4 w-4"})})}),_.jsx(kLe,{children:t})]}));Ib.displayName=Bae.displayName;const MLe=C.forwardRef(({className:e,...t},n)=>_.jsx(Hae,{ref:n,className:ge("-mx-1 my-1 h-px bg-muted",e),...t}));MLe.displayName=Hae.displayName;const ILe=XH,LLe=QH,jLe=ZH,Gae=C.forwardRef(({className:e,...t},n)=>_.jsx(LA,{className:ge("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",e),...t,ref:n}));Gae.displayName=LA.displayName;const $Le=Io("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"}}),Kae=C.forwardRef(({side:e="right",className:t,children:n,...r},s)=>_.jsxs(jLe,{children:[_.jsx(Gae,{}),_.jsxs(jA,{ref:s,className:ge($Le({side:e}),t),...r,children:[n,_.jsxs(zA,{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:[_.jsx(sx,{className:"h-4 w-4"}),_.jsx("span",{className:"sr-only",children:"Close"})]})]})]}));Kae.displayName=jA.displayName;const FLe=C.forwardRef(({className:e,...t},n)=>_.jsx($A,{ref:n,className:ge("text-lg font-semibold text-foreground",e),...t}));FLe.displayName=$A.displayName;const zLe=C.forwardRef(({className:e,...t},n)=>_.jsx(FA,{ref:n,className:ge("text-sm text-muted-foreground",e),...t}));zLe.displayName=FA.displayName;function zo({className:e,...t}){return _.jsx("div",{className:ge("animate-pulse rounded-md bg-muted",e),...t})}var Yae=["PageUp","PageDown"],Xae=["ArrowUp","ArrowDown","ArrowLeft","ArrowRight"],Qae={"from-left":["Home","PageDown","ArrowDown","ArrowLeft"],"from-right":["Home","PageDown","ArrowDown","ArrowRight"],"from-bottom":["Home","PageDown","ArrowDown","ArrowLeft"],"from-top":["Home","PageDown","ArrowUp","ArrowLeft"]},Kx="Slider",[wU,BLe,ULe]=Uf(Kx),[Zae,E7e]=_r(Kx,[ULe]),[VLe,uO]=Zae(Kx),Jae=C.forwardRef((e,t)=>{const{name:n,min:r=0,max:s=100,step:i=1,orientation:o="horizontal",disabled:a=!1,minStepsBetweenThumbs:c=0,defaultValue:d=[r],value:h,onValueChange:u=()=>{},onValueCommit:f=()=>{},inverted:g=!1,...v}=e,m=C.useRef(new Set),x=C.useRef(0),b=o==="horizontal"?HLe:WLe,[w=[],E]=os({prop:h,defaultProp:d,onChange:O=>{var $;($=[...m.current][x.current])==null||$.focus(),u(O)}}),R=C.useRef(w);function T(O){const I=XLe(w,O);D(O,I)}function N(O){D(O,x.current)}function A(){const O=R.current[x.current];w[x.current]!==O&&f(w)}function D(O,I,{commit:$}={commit:!1}){const F=eje(i),B=tje(Math.round((O-r)/i)*i+r,F),W=NC(B,[r,s]);E((Z=[])=>{const Y=KLe(Z,W,I);if(JLe(Y,c*i)){x.current=Y.indexOf(W);const H=String(Y)!==String(Z);return H&&$&&f(Y),H?Y:Z}else return Z})}return _.jsx(VLe,{scope:e.__scopeSlider,name:n,disabled:a,min:r,max:s,valueIndexToChangeRef:x,thumbs:m.current,values:w,orientation:o,children:_.jsx(wU.Provider,{scope:e.__scopeSlider,children:_.jsx(wU.Slot,{scope:e.__scopeSlider,children:_.jsx(b,{"aria-disabled":a,"data-disabled":a?"":void 0,...v,ref:t,onPointerDown:Ae(v.onPointerDown,()=>{a||(R.current=w)}),min:r,max:s,inverted:g,onSlideStart:a?void 0:T,onSlideMove:a?void 0:N,onSlideEnd:a?void 0:A,onHomeKeyDown:()=>!a&&D(r,0,{commit:!0}),onEndKeyDown:()=>!a&&D(s,w.length-1,{commit:!0}),onStepKeyDown:({event:O,direction:I})=>{if(!a){const B=Yae.includes(O.key)||O.shiftKey&&Xae.includes(O.key)?10:1,W=x.current,Z=w[W],Y=i*B*I;D(Z+Y,W,{commit:!0})}}})})})})});Jae.displayName=Kx;var[ele,tle]=Zae(Kx,{startEdge:"left",endEdge:"right",size:"width",direction:1}),HLe=C.forwardRef((e,t)=>{const{min:n,max:r,dir:s,inverted:i,onSlideStart:o,onSlideMove:a,onSlideEnd:c,onStepKeyDown:d,...h}=e,[u,f]=C.useState(null),g=_t(t,w=>f(w)),v=C.useRef(),m=kc(s),x=m==="ltr",y=x&&!i||!x&&i;function b(w){const E=v.current||u.getBoundingClientRect(),R=[0,E.width],N=H8(R,y?[n,r]:[r,n]);return v.current=E,N(w-E.left)}return _.jsx(ele,{scope:e.__scopeSlider,startEdge:y?"left":"right",endEdge:y?"right":"left",direction:y?1:-1,size:"width",children:_.jsx(nle,{dir:m,"data-orientation":"horizontal",...h,ref:g,style:{...h.style,"--radix-slider-thumb-transform":"translateX(-50%)"},onSlideStart:w=>{const E=b(w.clientX);o==null||o(E)},onSlideMove:w=>{const E=b(w.clientX);a==null||a(E)},onSlideEnd:()=>{v.current=void 0,c==null||c()},onStepKeyDown:w=>{const R=Qae[y?"from-left":"from-right"].includes(w.key);d==null||d({event:w,direction:R?-1:1})}})})}),WLe=C.forwardRef((e,t)=>{const{min:n,max:r,inverted:s,onSlideStart:i,onSlideMove:o,onSlideEnd:a,onStepKeyDown:c,...d}=e,h=C.useRef(null),u=_t(t,h),f=C.useRef(),g=!s;function v(m){const x=f.current||h.current.getBoundingClientRect(),y=[0,x.height],w=H8(y,g?[r,n]:[n,r]);return f.current=x,w(m-x.top)}return _.jsx(ele,{scope:e.__scopeSlider,startEdge:g?"bottom":"top",endEdge:g?"top":"bottom",size:"height",direction:g?1:-1,children:_.jsx(nle,{"data-orientation":"vertical",...d,ref:u,style:{...d.style,"--radix-slider-thumb-transform":"translateY(50%)"},onSlideStart:m=>{const x=v(m.clientY);i==null||i(x)},onSlideMove:m=>{const x=v(m.clientY);o==null||o(x)},onSlideEnd:()=>{f.current=void 0,a==null||a()},onStepKeyDown:m=>{const y=Qae[g?"from-bottom":"from-top"].includes(m.key);c==null||c({event:m,direction:y?-1:1})}})})}),nle=C.forwardRef((e,t)=>{const{__scopeSlider:n,onSlideStart:r,onSlideMove:s,onSlideEnd:i,onHomeKeyDown:o,onEndKeyDown:a,onStepKeyDown:c,...d}=e,h=uO(Kx,n);return _.jsx(He.span,{...d,ref:t,onKeyDown:Ae(e.onKeyDown,u=>{u.key==="Home"?(o(u),u.preventDefault()):u.key==="End"?(a(u),u.preventDefault()):Yae.concat(Xae).includes(u.key)&&(c(u),u.preventDefault())}),onPointerDown:Ae(e.onPointerDown,u=>{const f=u.target;f.setPointerCapture(u.pointerId),u.preventDefault(),h.thumbs.has(f)?f.focus():r(u)}),onPointerMove:Ae(e.onPointerMove,u=>{u.target.hasPointerCapture(u.pointerId)&&s(u)}),onPointerUp:Ae(e.onPointerUp,u=>{const f=u.target;f.hasPointerCapture(u.pointerId)&&(f.releasePointerCapture(u.pointerId),i(u))})})}),rle="SliderTrack",sle=C.forwardRef((e,t)=>{const{__scopeSlider:n,...r}=e,s=uO(rle,n);return _.jsx(He.span,{"data-disabled":s.disabled?"":void 0,"data-orientation":s.orientation,...r,ref:t})});sle.displayName=rle;var SU="SliderRange",ile=C.forwardRef((e,t)=>{const{__scopeSlider:n,...r}=e,s=uO(SU,n),i=tle(SU,n),o=C.useRef(null),a=_t(t,o),c=s.values.length,d=s.values.map(f=>ale(f,s.min,s.max)),h=c>1?Math.min(...d):0,u=100-Math.max(...d);return _.jsx(He.span,{"data-orientation":s.orientation,"data-disabled":s.disabled?"":void 0,...r,ref:a,style:{...e.style,[i.startEdge]:h+"%",[i.endEdge]:u+"%"}})});ile.displayName=SU;var CU="SliderThumb",ole=C.forwardRef((e,t)=>{const n=BLe(e.__scopeSlider),[r,s]=C.useState(null),i=_t(t,a=>s(a)),o=C.useMemo(()=>r?n().findIndex(a=>a.ref.current===r):-1,[n,r]);return _.jsx(qLe,{...e,ref:i,index:o})}),qLe=C.forwardRef((e,t)=>{const{__scopeSlider:n,index:r,name:s,...i}=e,o=uO(CU,n),a=tle(CU,n),[c,d]=C.useState(null),h=_t(t,b=>d(b)),u=c?!!c.closest("form"):!0,f=WA(c),g=o.values[r],v=g===void 0?0:ale(g,o.min,o.max),m=YLe(r,o.values.length),x=f==null?void 0:f[a.size],y=x?QLe(x,v,a.direction):0;return C.useEffect(()=>{if(c)return o.thumbs.add(c),()=>{o.thumbs.delete(c)}},[c,o.thumbs]),_.jsxs("span",{style:{transform:"var(--radix-slider-thumb-transform)",position:"absolute",[a.startEdge]:`calc(${v}% + ${y}px)`},children:[_.jsx(wU.ItemSlot,{scope:e.__scopeSlider,children:_.jsx(He.span,{role:"slider","aria-label":e["aria-label"]||m,"aria-valuemin":o.min,"aria-valuenow":g,"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:h,style:g===void 0?{display:"none"}:e.style,onFocus:Ae(e.onFocus,()=>{o.valueIndexToChangeRef.current=r})})}),u&&_.jsx(GLe,{name:s??(o.name?o.name+(o.values.length>1?"[]":""):void 0),value:g},r)]})});ole.displayName=CU;var GLe=e=>{const{value:t,...n}=e,r=C.useRef(null),s=$x(t);return C.useEffect(()=>{const i=r.current,o=window.HTMLInputElement.prototype,c=Object.getOwnPropertyDescriptor(o,"value").set;if(s!==t&&c){const d=new Event("input",{bubbles:!0});c.call(i,t),i.dispatchEvent(d)}},[s,t]),_.jsx("input",{style:{display:"none"},...n,ref:r,defaultValue:t})};function KLe(e=[],t,n){const r=[...e];return r[n]=t,r.sort((s,i)=>s-i)}function ale(e,t,n){const i=100/(n-t)*(e-t);return NC(i,[0,100])}function YLe(e,t){return t>2?`Value ${e+1} of ${t}`:t===2?["Minimum","Maximum"][e]:void 0}function XLe(e,t){if(e.length===1)return 0;const n=e.map(s=>Math.abs(s-t)),r=Math.min(...n);return n.indexOf(r)}function QLe(e,t,n){const r=e/2,i=H8([0,50],[0,r]);return(r-i(t)*n)*n}function ZLe(e){return e.slice(0,-1).map((t,n)=>e[n+1]-t)}function JLe(e,t){if(t>0){const n=ZLe(e);return Math.min(...n)>=t}return!0}function H8(e,t){return n=>{if(e[0]===e[1]||t[0]===t[1])return t[0];const r=(t[1]-t[0])/(e[1]-e[0]);return t[0]+r*(n-e[0])}}function eje(e){return(String(e).split(".")[1]||"").length}function tje(e,t){const n=Math.pow(10,t);return Math.round(e*n)/n}var lle=Jae,nje=sle,rje=ile,sje=ole;const ije=C.forwardRef(({className:e,...t},n)=>_.jsxs(lle,{ref:n,className:ge("relative flex w-full touch-none select-none items-center",e),...t,children:[_.jsx(nje,{className:"relative h-2 w-full grow overflow-hidden rounded-full bg-secondary",children:_.jsx(rje,{className:"absolute h-full bg-primary"})}),_.jsx(sje,{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"})]}));ije.displayName=lle.displayName;var W8="Switch",[oje,A7e]=_r(W8),[aje,lje]=oje(W8),cle=C.forwardRef((e,t)=>{const{__scopeSwitch:n,name:r,checked:s,defaultChecked:i,required:o,disabled:a,value:c="on",onCheckedChange:d,...h}=e,[u,f]=C.useState(null),g=_t(t,b=>f(b)),v=C.useRef(!1),m=u?!!u.closest("form"):!0,[x=!1,y]=os({prop:s,defaultProp:i,onChange:d});return _.jsxs(aje,{scope:n,checked:x,disabled:a,children:[_.jsx(He.button,{type:"button",role:"switch","aria-checked":x,"aria-required":o,"data-state":fle(x),"data-disabled":a?"":void 0,disabled:a,value:c,...h,ref:g,onClick:Ae(e.onClick,b=>{y(w=>!w),m&&(v.current=b.isPropagationStopped(),v.current||b.stopPropagation())})}),m&&_.jsx(cje,{control:u,bubbles:!v.current,name:r,value:c,checked:x,required:o,disabled:a,style:{transform:"translateX(-100%)"}})]})});cle.displayName=W8;var ule="SwitchThumb",dle=C.forwardRef((e,t)=>{const{__scopeSwitch:n,...r}=e,s=lje(ule,n);return _.jsx(He.span,{"data-state":fle(s.checked),"data-disabled":s.disabled?"":void 0,...r,ref:t})});dle.displayName=ule;var cje=e=>{const{control:t,checked:n,bubbles:r=!0,...s}=e,i=C.useRef(null),o=$x(n),a=WA(t);return C.useEffect(()=>{const c=i.current,d=window.HTMLInputElement.prototype,u=Object.getOwnPropertyDescriptor(d,"checked").set;if(o!==n&&u){const f=new Event("click",{bubbles:r});u.call(c,n),c.dispatchEvent(f)}},[o,n,r]),_.jsx("input",{type:"checkbox","aria-hidden":!0,defaultChecked:n,...s,tabIndex:-1,ref:i,style:{...e.style,...a,position:"absolute",pointerEvents:"none",opacity:0,margin:0}})};function fle(e){return e?"checked":"unchecked"}var hle=cle,uje=dle;const ple=C.forwardRef(({className:e,...t},n)=>_.jsx(hle,{className:ge("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",e),...t,ref:n,children:_.jsx(uje,{className:ge("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")})}));ple.displayName=hle.displayName;const dO=C.forwardRef(({className:e,...t},n)=>_.jsx("div",{className:"relative w-full overflow-auto",children:_.jsx("table",{ref:n,className:ge("w-full caption-bottom text-sm",e),...t})}));dO.displayName="Table";const fO=C.forwardRef(({className:e,...t},n)=>_.jsx("thead",{ref:n,className:ge("[&_tr]:border-b",e),...t}));fO.displayName="TableHeader";const hO=C.forwardRef(({className:e,...t},n)=>_.jsx("tbody",{ref:n,className:ge("[&_tr:last-child]:border-0",e),...t}));hO.displayName="TableBody";const dje=C.forwardRef(({className:e,...t},n)=>_.jsx("tfoot",{ref:n,className:ge("border-t bg-muted/50 font-medium [&>tr]:last:border-b-0",e),...t}));dje.displayName="TableFooter";const dp=C.forwardRef(({className:e,...t},n)=>_.jsx("tr",{ref:n,className:ge("border-b transition-colors hover:bg-muted/50 data-[state=selected]:bg-muted",e),...t}));dp.displayName="TableRow";const pO=C.forwardRef(({className:e,...t},n)=>_.jsx("th",{ref:n,className:ge("h-12 px-4 text-left align-middle font-medium text-muted-foreground [&:has([role=checkbox])]:pr-0",e),...t}));pO.displayName="TableHead";const TC=C.forwardRef(({className:e,...t},n)=>_.jsx("td",{ref:n,className:ge("py-2 px-4 align-middle [&:has([role=checkbox])]:pr-0",e),...t}));TC.displayName="TableCell";const mle=C.forwardRef(({className:e,...t},n)=>_.jsx("caption",{ref:n,className:ge("mt-4 text-sm text-muted-foreground",e),...t}));mle.displayName="TableCaption";var q8="Tabs",[fje,R7e]=_r(q8,[Lu]),gle=Lu(),[hje,G8]=fje(q8),vle=C.forwardRef((e,t)=>{const{__scopeTabs:n,value:r,onValueChange:s,defaultValue:i,orientation:o="horizontal",dir:a,activationMode:c="automatic",...d}=e,h=kc(a),[u,f]=os({prop:r,onChange:s,defaultProp:i});return _.jsx(hje,{scope:n,baseId:si(),value:u,onValueChange:f,orientation:o,dir:h,activationMode:c,children:_.jsx(He.div,{dir:h,"data-orientation":o,...d,ref:t})})});vle.displayName=q8;var yle="TabsList",ble=C.forwardRef((e,t)=>{const{__scopeTabs:n,loop:r=!0,...s}=e,i=G8(yle,n),o=gle(n);return _.jsx(QA,{asChild:!0,...o,orientation:i.orientation,dir:i.dir,loop:r,children:_.jsx(He.div,{role:"tablist","aria-orientation":i.orientation,...s,ref:t})})});ble.displayName=yle;var xle="TabsTrigger",_le=C.forwardRef((e,t)=>{const{__scopeTabs:n,value:r,disabled:s=!1,...i}=e,o=G8(xle,n),a=gle(n),c=Cle(o.baseId,r),d=Ele(o.baseId,r),h=r===o.value;return _.jsx(ZA,{asChild:!0,...a,focusable:!s,active:h,children:_.jsx(He.button,{type:"button",role:"tab","aria-selected":h,"aria-controls":d,"data-state":h?"active":"inactive","data-disabled":s?"":void 0,disabled:s,id:c,...i,ref:t,onMouseDown:Ae(e.onMouseDown,u=>{!s&&u.button===0&&u.ctrlKey===!1?o.onValueChange(r):u.preventDefault()}),onKeyDown:Ae(e.onKeyDown,u=>{[" ","Enter"].includes(u.key)&&o.onValueChange(r)}),onFocus:Ae(e.onFocus,()=>{const u=o.activationMode!=="manual";!h&&!s&&u&&o.onValueChange(r)})})})});_le.displayName=xle;var wle="TabsContent",Sle=C.forwardRef((e,t)=>{const{__scopeTabs:n,value:r,forceMount:s,children:i,...o}=e,a=G8(wle,n),c=Cle(a.baseId,r),d=Ele(a.baseId,r),h=r===a.value,u=C.useRef(h);return C.useEffect(()=>{const f=requestAnimationFrame(()=>u.current=!1);return()=>cancelAnimationFrame(f)},[]),_.jsx(Vr,{present:s||h,children:({present:f})=>_.jsx(He.div,{"data-state":h?"active":"inactive","data-orientation":a.orientation,role:"tabpanel","aria-labelledby":c,hidden:!f,id:d,tabIndex:0,...o,ref:t,style:{...e.style,animationDuration:u.current?"0s":void 0},children:f&&i})})});Sle.displayName=wle;function Cle(e,t){return`${e}-trigger-${t}`}function Ele(e,t){return`${e}-content-${t}`}var pje=vle,Ale=ble,Rle=_le,Ple=Sle;const Nle=pje,K8=C.forwardRef(({className:e,...t},n)=>_.jsx(Ale,{ref:n,className:ge("inline-flex h-9 items-center justify-center rounded-lg bg-accent p-1 text-muted-foreground",e),...t}));K8.displayName=Ale.displayName;const zT=C.forwardRef(({className:e,...t},n)=>_.jsx(Rle,{ref:n,className:ge("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",e),...t}));zT.displayName=Rle.displayName;const BT=C.forwardRef(({className:e,...t},n)=>_.jsx(Ple,{ref:n,className:ge("mt-2 ring-offset-background focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2",e),...t}));BT.displayName=Ple.displayName;const Tle=C.forwardRef(({className:e,...t},n)=>_.jsx("textarea",{className:ge("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",e),ref:n,...t}));Tle.displayName="Textarea";var Y8="ToastProvider",[X8,mje,gje]=Uf("Toast"),[kle,P7e]=_r("Toast",[gje]),[vje,mO]=kle(Y8),Dle=e=>{const{__scopeToast:t,label:n="Notification",duration:r=5e3,swipeDirection:s="right",swipeThreshold:i=50,children:o}=e,[a,c]=C.useState(null),[d,h]=C.useState(0),u=C.useRef(!1),f=C.useRef(!1);return n.trim()||console.error(`Invalid prop \`label\` supplied to \`${Y8}\`. Expected non-empty \`string\`.`),_.jsx(X8.Provider,{scope:t,children:_.jsx(vje,{scope:t,label:n,duration:r,swipeDirection:s,swipeThreshold:i,toastCount:d,viewport:a,onViewportChange:c,onToastAdd:C.useCallback(()=>h(g=>g+1),[]),onToastRemove:C.useCallback(()=>h(g=>g-1),[]),isFocusedToastEscapeKeyDownRef:u,isClosePausedRef:f,children:o})})};Dle.displayName=Y8;var Ole="ToastViewport",yje=["F8"],EU="toast.viewportPause",AU="toast.viewportResume",Mle=C.forwardRef((e,t)=>{const{__scopeToast:n,hotkey:r=yje,label:s="Notifications ({hotkey})",...i}=e,o=mO(Ole,n),a=mje(n),c=C.useRef(null),d=C.useRef(null),h=C.useRef(null),u=C.useRef(null),f=_t(t,u,o.onViewportChange),g=r.join("+").replace(/Key/g,"").replace(/Digit/g,""),v=o.toastCount>0;C.useEffect(()=>{const x=y=>{var w;r.every(E=>y[E]||y.code===E)&&((w=u.current)==null||w.focus())};return document.addEventListener("keydown",x),()=>document.removeEventListener("keydown",x)},[r]),C.useEffect(()=>{const x=c.current,y=u.current;if(v&&x&&y){const b=()=>{if(!o.isClosePausedRef.current){const T=new CustomEvent(EU);y.dispatchEvent(T),o.isClosePausedRef.current=!0}},w=()=>{if(o.isClosePausedRef.current){const T=new CustomEvent(AU);y.dispatchEvent(T),o.isClosePausedRef.current=!1}},E=T=>{!x.contains(T.relatedTarget)&&w()},R=()=>{x.contains(document.activeElement)||w()};return x.addEventListener("focusin",b),x.addEventListener("focusout",E),x.addEventListener("pointermove",b),x.addEventListener("pointerleave",R),window.addEventListener("blur",b),window.addEventListener("focus",w),()=>{x.removeEventListener("focusin",b),x.removeEventListener("focusout",E),x.removeEventListener("pointermove",b),x.removeEventListener("pointerleave",R),window.removeEventListener("blur",b),window.removeEventListener("focus",w)}}},[v,o.isClosePausedRef]);const m=C.useCallback(({tabbingDirection:x})=>{const b=a().map(w=>{const E=w.ref.current,R=[E,...kje(E)];return x==="forwards"?R:R.reverse()});return(x==="forwards"?b.reverse():b).flat()},[a]);return C.useEffect(()=>{const x=u.current;if(x){const y=b=>{var R,T,N;const w=b.altKey||b.ctrlKey||b.metaKey;if(b.key==="Tab"&&!w){const A=document.activeElement,D=b.shiftKey;if(b.target===x&&D){(R=d.current)==null||R.focus();return}const $=m({tabbingDirection:D?"backwards":"forwards"}),F=$.findIndex(B=>B===A);D4($.slice(F+1))?b.preventDefault():D?(T=d.current)==null||T.focus():(N=h.current)==null||N.focus()}};return x.addEventListener("keydown",y),()=>x.removeEventListener("keydown",y)}},[a,m]),_.jsxs(s0e,{ref:c,role:"region","aria-label":s.replace("{hotkey}",g),tabIndex:-1,style:{pointerEvents:v?void 0:"none"},children:[v&&_.jsx(RU,{ref:d,onFocusFromOutsideViewport:()=>{const x=m({tabbingDirection:"forwards"});D4(x)}}),_.jsx(X8.Slot,{scope:n,children:_.jsx(He.ol,{tabIndex:-1,...i,ref:f})}),v&&_.jsx(RU,{ref:h,onFocusFromOutsideViewport:()=>{const x=m({tabbingDirection:"backwards"});D4(x)}})]})});Mle.displayName=Ole;var Ile="ToastFocusProxy",RU=C.forwardRef((e,t)=>{const{__scopeToast:n,onFocusFromOutsideViewport:r,...s}=e,i=mO(Ile,n);return _.jsx(uR,{"aria-hidden":!0,tabIndex:0,...s,ref:t,style:{position:"fixed"},onFocus:o=>{var d;const a=o.relatedTarget;!((d=i.viewport)!=null&&d.contains(a))&&r()}})});RU.displayName=Ile;var gO="Toast",bje="toast.swipeStart",xje="toast.swipeMove",_je="toast.swipeCancel",wje="toast.swipeEnd",Lle=C.forwardRef((e,t)=>{const{forceMount:n,open:r,defaultOpen:s,onOpenChange:i,...o}=e,[a=!0,c]=os({prop:r,defaultProp:s,onChange:i});return _.jsx(Vr,{present:n||a,children:_.jsx(Eje,{open:a,...o,ref:t,onClose:()=>c(!1),onPause:bn(e.onPause),onResume:bn(e.onResume),onSwipeStart:Ae(e.onSwipeStart,d=>{d.currentTarget.setAttribute("data-swipe","start")}),onSwipeMove:Ae(e.onSwipeMove,d=>{const{x:h,y:u}=d.detail.delta;d.currentTarget.setAttribute("data-swipe","move"),d.currentTarget.style.setProperty("--radix-toast-swipe-move-x",`${h}px`),d.currentTarget.style.setProperty("--radix-toast-swipe-move-y",`${u}px`)}),onSwipeCancel:Ae(e.onSwipeCancel,d=>{d.currentTarget.setAttribute("data-swipe","cancel"),d.currentTarget.style.removeProperty("--radix-toast-swipe-move-x"),d.currentTarget.style.removeProperty("--radix-toast-swipe-move-y"),d.currentTarget.style.removeProperty("--radix-toast-swipe-end-x"),d.currentTarget.style.removeProperty("--radix-toast-swipe-end-y")}),onSwipeEnd:Ae(e.onSwipeEnd,d=>{const{x:h,y:u}=d.detail.delta;d.currentTarget.setAttribute("data-swipe","end"),d.currentTarget.style.removeProperty("--radix-toast-swipe-move-x"),d.currentTarget.style.removeProperty("--radix-toast-swipe-move-y"),d.currentTarget.style.setProperty("--radix-toast-swipe-end-x",`${h}px`),d.currentTarget.style.setProperty("--radix-toast-swipe-end-y",`${u}px`),c(!1)})})})});Lle.displayName=gO;var[Sje,Cje]=kle(gO,{onClose(){}}),Eje=C.forwardRef((e,t)=>{const{__scopeToast:n,type:r="foreground",duration:s,open:i,onClose:o,onEscapeKeyDown:a,onPause:c,onResume:d,onSwipeStart:h,onSwipeMove:u,onSwipeCancel:f,onSwipeEnd:g,...v}=e,m=mO(gO,n),[x,y]=C.useState(null),b=_t(t,B=>y(B)),w=C.useRef(null),E=C.useRef(null),R=s||m.duration,T=C.useRef(0),N=C.useRef(R),A=C.useRef(0),{onToastAdd:D,onToastRemove:O}=m,I=bn(()=>{var W;(x==null?void 0:x.contains(document.activeElement))&&((W=m.viewport)==null||W.focus()),o()}),$=C.useCallback(B=>{!B||B===1/0||(window.clearTimeout(A.current),T.current=new Date().getTime(),A.current=window.setTimeout(I,B))},[I]);C.useEffect(()=>{const B=m.viewport;if(B){const W=()=>{$(N.current),d==null||d()},Z=()=>{const Y=new Date().getTime()-T.current;N.current=N.current-Y,window.clearTimeout(A.current),c==null||c()};return B.addEventListener(EU,Z),B.addEventListener(AU,W),()=>{B.removeEventListener(EU,Z),B.removeEventListener(AU,W)}}},[m.viewport,R,c,d,$]),C.useEffect(()=>{i&&!m.isClosePausedRef.current&&$(R)},[i,R,m.isClosePausedRef,$]),C.useEffect(()=>(D(),()=>O()),[D,O]);const F=C.useMemo(()=>x?Vle(x):null,[x]);return m.viewport?_.jsxs(_.Fragment,{children:[F&&_.jsx(Aje,{__scopeToast:n,role:"status","aria-live":r==="foreground"?"assertive":"polite","aria-atomic":!0,children:F}),_.jsx(Sje,{scope:n,onClose:I,children:Li.createPortal(_.jsx(X8.ItemSlot,{scope:n,children:_.jsx(r0e,{asChild:!0,onEscapeKeyDown:Ae(a,()=>{m.isFocusedToastEscapeKeyDownRef.current||I(),m.isFocusedToastEscapeKeyDownRef.current=!1}),children:_.jsx(He.li,{role:"status","aria-live":"off","aria-atomic":!0,tabIndex:0,"data-state":i?"open":"closed","data-swipe-direction":m.swipeDirection,...v,ref:b,style:{userSelect:"none",touchAction:"none",...e.style},onKeyDown:Ae(e.onKeyDown,B=>{B.key==="Escape"&&(a==null||a(B.nativeEvent),B.nativeEvent.defaultPrevented||(m.isFocusedToastEscapeKeyDownRef.current=!0,I()))}),onPointerDown:Ae(e.onPointerDown,B=>{B.button===0&&(w.current={x:B.clientX,y:B.clientY})}),onPointerMove:Ae(e.onPointerMove,B=>{if(!w.current)return;const W=B.clientX-w.current.x,Z=B.clientY-w.current.y,Y=!!E.current,H=["left","right"].includes(m.swipeDirection),se=["left","up"].includes(m.swipeDirection)?Math.min:Math.max,he=H?se(0,W):0,re=H?0:se(0,Z),J=B.pointerType==="touch"?10:2,te={x:he,y:re},ae={originalEvent:B,delta:te};Y?(E.current=te,pP(xje,u,ae,{discrete:!1})):P7(te,m.swipeDirection,J)?(E.current=te,pP(bje,h,ae,{discrete:!1}),B.target.setPointerCapture(B.pointerId)):(Math.abs(W)>J||Math.abs(Z)>J)&&(w.current=null)}),onPointerUp:Ae(e.onPointerUp,B=>{const W=E.current,Z=B.target;if(Z.hasPointerCapture(B.pointerId)&&Z.releasePointerCapture(B.pointerId),E.current=null,w.current=null,W){const Y=B.currentTarget,H={originalEvent:B,delta:W};P7(W,m.swipeDirection,m.swipeThreshold)?pP(wje,g,H,{discrete:!0}):pP(_je,f,H,{discrete:!0}),Y.addEventListener("click",se=>se.preventDefault(),{once:!0})}})})})}),m.viewport)})]}):null}),Aje=e=>{const{__scopeToast:t,children:n,...r}=e,s=mO(gO,t),[i,o]=C.useState(!1),[a,c]=C.useState(!1);return Nje(()=>o(!0)),C.useEffect(()=>{const d=window.setTimeout(()=>c(!0),1e3);return()=>window.clearTimeout(d)},[]),a?null:_.jsx(Dx,{asChild:!0,children:_.jsx(uR,{...r,children:i&&_.jsxs(_.Fragment,{children:[s.label," ",n]})})})},Rje="ToastTitle",jle=C.forwardRef((e,t)=>{const{__scopeToast:n,...r}=e;return _.jsx(He.div,{...r,ref:t})});jle.displayName=Rje;var Pje="ToastDescription",$le=C.forwardRef((e,t)=>{const{__scopeToast:n,...r}=e;return _.jsx(He.div,{...r,ref:t})});$le.displayName=Pje;var Fle="ToastAction",zle=C.forwardRef((e,t)=>{const{altText:n,...r}=e;return n.trim()?_.jsx(Ule,{altText:n,asChild:!0,children:_.jsx(Q8,{...r,ref:t})}):(console.error(`Invalid prop \`altText\` supplied to \`${Fle}\`. Expected non-empty \`string\`.`),null)});zle.displayName=Fle;var Ble="ToastClose",Q8=C.forwardRef((e,t)=>{const{__scopeToast:n,...r}=e,s=Cje(Ble,n);return _.jsx(Ule,{asChild:!0,children:_.jsx(He.button,{type:"button",...r,ref:t,onClick:Ae(e.onClick,s.onClose)})})});Q8.displayName=Ble;var Ule=C.forwardRef((e,t)=>{const{__scopeToast:n,altText:r,...s}=e;return _.jsx(He.div,{"data-radix-toast-announce-exclude":"","data-radix-toast-announce-alt":r||void 0,...s,ref:t})});function Vle(e){const t=[];return Array.from(e.childNodes).forEach(r=>{if(r.nodeType===r.TEXT_NODE&&r.textContent&&t.push(r.textContent),Tje(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&&t.push(o)}else t.push(...Vle(r))}}),t}function pP(e,t,n,{discrete:r}){const s=n.originalEvent.currentTarget,i=new CustomEvent(e,{bubbles:!0,cancelable:!0,detail:n});t&&s.addEventListener(e,t,{once:!0}),r?vC(s,i):s.dispatchEvent(i)}var P7=(e,t,n=0)=>{const r=Math.abs(e.x),s=Math.abs(e.y),i=r>s;return t==="left"||t==="right"?i&&r>n:!i&&s>n};function Nje(e=()=>{}){const t=bn(e);Rr(()=>{let n=0,r=0;return n=window.requestAnimationFrame(()=>r=window.requestAnimationFrame(t)),()=>{window.cancelAnimationFrame(n),window.cancelAnimationFrame(r)}},[t])}function Tje(e){return e.nodeType===e.ELEMENT_NODE}function kje(e){const t=[],n=document.createTreeWalker(e,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();)t.push(n.currentNode);return t}function D4(e){const t=document.activeElement;return e.some(n=>n===t?!0:(n.focus(),document.activeElement!==t))}var Dje=Dle,Hle=Mle,Wle=Lle,qle=jle,Gle=$le,Kle=zle,Yle=Q8;const Oje=Dje,Xle=C.forwardRef(({className:e,...t},n)=>_.jsx(Hle,{ref:n,className:ge("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]",e),...t}));Xle.displayName=Hle.displayName;const Mje=Io("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"}}),Qle=C.forwardRef(({className:e,variant:t,...n},r)=>_.jsx(Wle,{ref:r,className:ge(Mje({variant:t}),e),...n}));Qle.displayName=Wle.displayName;const Ije=C.forwardRef(({className:e,...t},n)=>_.jsx(Kle,{ref:n,className:ge("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",e),...t}));Ije.displayName=Kle.displayName;const Zle=C.forwardRef(({className:e,...t},n)=>_.jsx(Yle,{ref:n,className:ge("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",e),"toast-close":"",...t,children:_.jsx(sx,{className:"w-4 h-4"})}));Zle.displayName=Yle.displayName;const Jle=C.forwardRef(({className:e,...t},n)=>_.jsx(qle,{ref:n,className:ge("text-sm font-semibold",e),...t}));Jle.displayName=qle.displayName;const ece=C.forwardRef(({className:e,...t},n)=>_.jsx(Gle,{ref:n,className:ge("text-sm opacity-90",e),...t}));ece.displayName=Gle.displayName;const Lje=3,jje=1e6;let O4=0;function $je(){return O4=(O4+1)%Number.MAX_SAFE_INTEGER,O4.toString()}const M4=new Map,N7=e=>{if(M4.has(e))return;const t=setTimeout(()=>{M4.delete(e),z1({type:"REMOVE_TOAST",toastId:e})},jje);M4.set(e,t)},Fje=(e,t)=>{switch(t.type){case"ADD_TOAST":return{...e,toasts:[t.toast,...e.toasts].slice(0,Lje)};case"UPDATE_TOAST":return{...e,toasts:e.toasts.map(n=>n.id===t.toast.id?{...n,...t.toast}:n)};case"DISMISS_TOAST":{const{toastId:n}=t;return n?N7(n):e.toasts.forEach(r=>{N7(r.id)}),{...e,toasts:e.toasts.map(r=>r.id===n||n===void 0?{...r,open:!1}:r)}}case"REMOVE_TOAST":return t.toastId===void 0?{...e,toasts:[]}:{...e,toasts:e.toasts.filter(n=>n.id!==t.toastId)}}},eN=[];let tN={toasts:[]};function z1(e){tN=Fje(tN,e),eN.forEach(t=>{t(tN)})}function zje({...e}){const t=$je(),n=s=>z1({type:"UPDATE_TOAST",toast:{...s,id:t}}),r=()=>z1({type:"DISMISS_TOAST",toastId:t});return z1({type:"ADD_TOAST",toast:{...e,id:t,open:!0,onOpenChange:s=>{s||r()}}}),{id:t,dismiss:r,update:n}}function Fu(){const[e,t]=C.useState(tN);return C.useEffect(()=>(eN.push(t),()=>{const n=eN.indexOf(t);n>-1&&eN.splice(n,1)}),[e]),{...e,toast:zje,dismiss:n=>z1({type:"DISMISS_TOAST",toastId:n})}}function tce(){const{toasts:e}=Fu();return _.jsxs(Oje,{swipeDirection:"down",children:[e.map(function({id:t,title:n,description:r,action:s,...i}){return _.jsxs(Qle,{...i,children:[_.jsxs("div",{className:"grid gap-1",children:[n&&_.jsx(Jle,{children:n}),r&&_.jsx(ece,{children:r})]}),s,_.jsx(Zle,{})]},t)}),_.jsx(Xle,{className:"bottom-0 w-auto mx-auto sm:bottom-0 sm:left-0 sm:right-0"})]})}var Bje="Toggle",Z8=C.forwardRef((e,t)=>{const{pressed:n,defaultPressed:r=!1,onPressedChange:s,...i}=e,[o=!1,a]=os({prop:n,onChange:s,defaultProp:r});return _.jsx(He.button,{type:"button","aria-pressed":o,"data-state":o?"on":"off","data-disabled":e.disabled?"":void 0,...i,ref:t,onClick:Ae(e.onClick,()=>{e.disabled||a(!o)})})});Z8.displayName=Bje;var nce=Z8;const rce=Io("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"}}),sce=C.forwardRef(({className:e,variant:t,size:n,...r},s)=>_.jsx(nce,{ref:s,className:ge(rce({variant:t,size:n,className:e})),...r}));sce.displayName=nce.displayName;var Yx="ToggleGroup",[ice,N7e]=_r(Yx,[Lu]),oce=Lu(),J8=fe.forwardRef((e,t)=>{const{type:n,...r}=e;if(n==="single"){const s=r;return _.jsx(Uje,{...s,ref:t})}if(n==="multiple"){const s=r;return _.jsx(Vje,{...s,ref:t})}throw new Error(`Missing prop \`type\` expected on \`${Yx}\``)});J8.displayName=Yx;var[ace,lce]=ice(Yx),Uje=fe.forwardRef((e,t)=>{const{value:n,defaultValue:r,onValueChange:s=()=>{},...i}=e,[o,a]=os({prop:n,defaultProp:r,onChange:s});return _.jsx(ace,{scope:e.__scopeToggleGroup,type:"single",value:o?[o]:[],onItemActivate:a,onItemDeactivate:fe.useCallback(()=>a(""),[a]),children:_.jsx(cce,{...i,ref:t})})}),Vje=fe.forwardRef((e,t)=>{const{value:n,defaultValue:r,onValueChange:s=()=>{},...i}=e,[o=[],a]=os({prop:n,defaultProp:r,onChange:s}),c=fe.useCallback(h=>a((u=[])=>[...u,h]),[a]),d=fe.useCallback(h=>a((u=[])=>u.filter(f=>f!==h)),[a]);return _.jsx(ace,{scope:e.__scopeToggleGroup,type:"multiple",value:o,onItemActivate:c,onItemDeactivate:d,children:_.jsx(cce,{...i,ref:t})})});J8.displayName=Yx;var[Hje,Wje]=ice(Yx),cce=fe.forwardRef((e,t)=>{const{__scopeToggleGroup:n,disabled:r=!1,rovingFocus:s=!0,orientation:i,dir:o,loop:a=!0,...c}=e,d=oce(n),h=kc(o),u={role:"group",dir:h,...c};return _.jsx(Hje,{scope:n,rovingFocus:s,disabled:r,children:s?_.jsx(QA,{asChild:!0,...d,orientation:i,dir:h,loop:a,children:_.jsx(He.div,{...u,ref:t})}):_.jsx(He.div,{...u,ref:t})})}),UT="ToggleGroupItem",uce=fe.forwardRef((e,t)=>{const n=lce(UT,e.__scopeToggleGroup),r=Wje(UT,e.__scopeToggleGroup),s=oce(e.__scopeToggleGroup),i=n.value.includes(e.value),o=r.disabled||e.disabled,a={...e,pressed:i,disabled:o},c=fe.useRef(null);return r.rovingFocus?_.jsx(ZA,{asChild:!0,...s,focusable:!o,active:i,ref:c,children:_.jsx(T7,{...a,ref:t})}):_.jsx(T7,{...a,ref:t})});uce.displayName=UT;var T7=fe.forwardRef((e,t)=>{const{__scopeToggleGroup:n,value:r,...s}=e,i=lce(UT,n),o={role:"radio","aria-checked":e.pressed,"aria-pressed":void 0},a=i.type==="single"?o:void 0;return _.jsx(Z8,{...a,...s,ref:t,onPressedChange:c=>{c?i.onItemActivate(r):i.onItemDeactivate(r)}})}),dce=J8,fce=uce;const hce=C.createContext({size:"default",variant:"default"}),qje=C.forwardRef(({className:e,variant:t,size:n,children:r,...s},i)=>_.jsx(dce,{ref:i,className:ge("flex items-center justify-center gap-1",e),...s,children:_.jsx(hce.Provider,{value:{variant:t,size:n},children:r})}));qje.displayName=dce.displayName;const Gje=C.forwardRef(({className:e,children:t,variant:n,size:r,...s},i)=>{const o=C.useContext(hce);return _.jsx(fce,{ref:i,className:ge(rce({variant:o.variant||n,size:o.size||r}),e),...s,children:t})});Gje.displayName=fce.displayName;var[vO,T7e]=_r("Tooltip",[Iu]),yO=Iu(),pce="TooltipProvider",Kje=700,PU="tooltip.open",[Yje,eW]=vO(pce),mce=e=>{const{__scopeTooltip:t,delayDuration:n=Kje,skipDelayDuration:r=300,disableHoverableContent:s=!1,children:i}=e,[o,a]=C.useState(!0),c=C.useRef(!1),d=C.useRef(0);return C.useEffect(()=>{const h=d.current;return()=>window.clearTimeout(h)},[]),_.jsx(Yje,{scope:t,isOpenDelayed:o,delayDuration:n,onOpen:C.useCallback(()=>{window.clearTimeout(d.current),a(!1)},[]),onClose:C.useCallback(()=>{window.clearTimeout(d.current),d.current=window.setTimeout(()=>a(!0),r)},[r]),isPointerInTransitRef:c,onPointerInTransitChange:C.useCallback(h=>{c.current=h},[]),disableHoverableContent:s,children:i})};mce.displayName=pce;var bO="Tooltip",[Xje,xO]=vO(bO),gce=e=>{const{__scopeTooltip:t,children:n,open:r,defaultOpen:s=!1,onOpenChange:i,disableHoverableContent:o,delayDuration:a}=e,c=eW(bO,e.__scopeTooltip),d=yO(t),[h,u]=C.useState(null),f=si(),g=C.useRef(0),v=o??c.disableHoverableContent,m=a??c.delayDuration,x=C.useRef(!1),[y=!1,b]=os({prop:r,defaultProp:s,onChange:N=>{N?(c.onOpen(),document.dispatchEvent(new CustomEvent(PU))):c.onClose(),i==null||i(N)}}),w=C.useMemo(()=>y?x.current?"delayed-open":"instant-open":"closed",[y]),E=C.useCallback(()=>{window.clearTimeout(g.current),x.current=!1,b(!0)},[b]),R=C.useCallback(()=>{window.clearTimeout(g.current),b(!1)},[b]),T=C.useCallback(()=>{window.clearTimeout(g.current),g.current=window.setTimeout(()=>{x.current=!0,b(!0)},m)},[m,b]);return C.useEffect(()=>()=>window.clearTimeout(g.current),[]),_.jsx(HD,{...d,children:_.jsx(Xje,{scope:t,contentId:f,open:y,stateAttribute:w,trigger:h,onTriggerChange:u,onTriggerEnter:C.useCallback(()=>{c.isOpenDelayed?T():E()},[c.isOpenDelayed,T,E]),onTriggerLeave:C.useCallback(()=>{v?R():window.clearTimeout(g.current)},[R,v]),onOpen:E,onClose:R,disableHoverableContent:v,children:n})})};gce.displayName=bO;var NU="TooltipTrigger",vce=C.forwardRef((e,t)=>{const{__scopeTooltip:n,...r}=e,s=xO(NU,n),i=eW(NU,n),o=yO(n),a=C.useRef(null),c=_t(t,a,s.onTriggerChange),d=C.useRef(!1),h=C.useRef(!1),u=C.useCallback(()=>d.current=!1,[]);return C.useEffect(()=>()=>document.removeEventListener("pointerup",u),[u]),_.jsx(Ux,{asChild:!0,...o,children:_.jsx(He.button,{"aria-describedby":s.open?s.contentId:void 0,"data-state":s.stateAttribute,...r,ref:c,onPointerMove:Ae(e.onPointerMove,f=>{f.pointerType!=="touch"&&!h.current&&!i.isPointerInTransitRef.current&&(s.onTriggerEnter(),h.current=!0)}),onPointerLeave:Ae(e.onPointerLeave,()=>{s.onTriggerLeave(),h.current=!1}),onPointerDown:Ae(e.onPointerDown,()=>{d.current=!0,document.addEventListener("pointerup",u,{once:!0})}),onFocus:Ae(e.onFocus,()=>{d.current||s.onOpen()}),onBlur:Ae(e.onBlur,s.onClose),onClick:Ae(e.onClick,s.onClose)})})});vce.displayName=NU;var Qje="TooltipPortal",[k7e,Zje]=vO(Qje,{forceMount:void 0}),fx="TooltipContent",yce=C.forwardRef((e,t)=>{const n=Zje(fx,e.__scopeTooltip),{forceMount:r=n.forceMount,side:s="top",...i}=e,o=xO(fx,e.__scopeTooltip);return _.jsx(Vr,{present:r||o.open,children:o.disableHoverableContent?_.jsx(bce,{side:s,...i,ref:t}):_.jsx(Jje,{side:s,...i,ref:t})})}),Jje=C.forwardRef((e,t)=>{const n=xO(fx,e.__scopeTooltip),r=eW(fx,e.__scopeTooltip),s=C.useRef(null),i=_t(t,s),[o,a]=C.useState(null),{trigger:c,onClose:d}=n,h=s.current,{onPointerInTransitChange:u}=r,f=C.useCallback(()=>{a(null),u(!1)},[u]),g=C.useCallback((v,m)=>{const x=v.currentTarget,y={x:v.clientX,y:v.clientY},b=r2e(y,x.getBoundingClientRect()),w=s2e(y,b),E=i2e(m.getBoundingClientRect()),R=a2e([...w,...E]);a(R),u(!0)},[u]);return C.useEffect(()=>()=>f(),[f]),C.useEffect(()=>{if(c&&h){const v=x=>g(x,h),m=x=>g(x,c);return c.addEventListener("pointerleave",v),h.addEventListener("pointerleave",m),()=>{c.removeEventListener("pointerleave",v),h.removeEventListener("pointerleave",m)}}},[c,h,g,f]),C.useEffect(()=>{if(o){const v=m=>{const x=m.target,y={x:m.clientX,y:m.clientY},b=(c==null?void 0:c.contains(x))||(h==null?void 0:h.contains(x)),w=!o2e(y,o);b?f():w&&(f(),d())};return document.addEventListener("pointermove",v),()=>document.removeEventListener("pointermove",v)}},[c,h,o,d,f]),_.jsx(bce,{...e,ref:i})}),[e2e,t2e]=vO(bO,{isInside:!1}),bce=C.forwardRef((e,t)=>{const{__scopeTooltip:n,children:r,"aria-label":s,onEscapeKeyDown:i,onPointerDownOutside:o,...a}=e,c=xO(fx,n),d=yO(n),{onClose:h}=c;return C.useEffect(()=>(document.addEventListener(PU,h),()=>document.removeEventListener(PU,h)),[h]),C.useEffect(()=>{if(c.trigger){const u=f=>{const g=f.target;g!=null&&g.contains(c.trigger)&&h()};return window.addEventListener("scroll",u,{capture:!0}),()=>window.removeEventListener("scroll",u,{capture:!0})}},[c.trigger,h]),_.jsx(Hf,{asChild:!0,disableOutsidePointerEvents:!1,onEscapeKeyDown:i,onPointerDownOutside:o,onFocusOutside:u=>u.preventDefault(),onDismiss:h,children:_.jsxs(YA,{"data-state":c.stateAttribute,...d,...a,ref:t,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:[_.jsx(CH,{children:r}),_.jsx(e2e,{scope:n,isInside:!0,children:_.jsx(Sie,{id:c.contentId,role:"tooltip",children:s||r})})]})})});yce.displayName=fx;var xce="TooltipArrow",n2e=C.forwardRef((e,t)=>{const{__scopeTooltip:n,...r}=e,s=yO(n);return t2e(xce,n).isInside?null:_.jsx(XA,{...s,...r,ref:t})});n2e.displayName=xce;function r2e(e,t){const n=Math.abs(t.top-e.y),r=Math.abs(t.bottom-e.y),s=Math.abs(t.right-e.x),i=Math.abs(t.left-e.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 s2e(e,t,n=5){const r=[];switch(t){case"top":r.push({x:e.x-n,y:e.y+n},{x:e.x+n,y:e.y+n});break;case"bottom":r.push({x:e.x-n,y:e.y-n},{x:e.x+n,y:e.y-n});break;case"left":r.push({x:e.x+n,y:e.y-n},{x:e.x+n,y:e.y+n});break;case"right":r.push({x:e.x-n,y:e.y-n},{x:e.x-n,y:e.y+n});break}return r}function i2e(e){const{top:t,right:n,bottom:r,left:s}=e;return[{x:s,y:t},{x:n,y:t},{x:n,y:r},{x:s,y:r}]}function o2e(e,t){const{x:n,y:r}=e;let s=!1;for(let i=0,o=t.length-1;i<t.length;o=i++){const a=t[i].x,c=t[i].y,d=t[o].x,h=t[o].y;c>r!=h>r&&n<(d-a)*(r-c)/(h-c)+a&&(s=!s)}return s}function a2e(e){const t=e.slice();return t.sort((n,r)=>n.x<r.x?-1:n.x>r.x?1:n.y<r.y?-1:n.y>r.y?1:0),l2e(t)}function l2e(e){if(e.length<=1)return e.slice();const t=[];for(let r=0;r<e.length;r++){const s=e[r];for(;t.length>=2;){const i=t[t.length-1],o=t[t.length-2];if((i.x-o.x)*(s.y-o.y)>=(i.y-o.y)*(s.x-o.x))t.pop();else break}t.push(s)}t.pop();const n=[];for(let r=e.length-1;r>=0;r--){const s=e[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(),t.length===1&&n.length===1&&t[0].x===n[0].x&&t[0].y===n[0].y?t:t.concat(n)}var c2e=mce,u2e=gce,d2e=vce,_ce=yce;const wce=c2e,Mi=u2e,Ii=d2e,di=C.forwardRef(({className:e,sideOffset:t=4,...n},r)=>_.jsx(_ce,{ref:r,sideOffset:t,className:ge("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",e),...n}));di.displayName=_ce.displayName;/**
|
||
* @remix-run/router v1.23.0
|
||
*
|
||
* Copyright (c) Remix Software Inc.
|
||
*
|
||
* This source code is licensed under the MIT license found in the
|
||
* LICENSE.md file in the root directory of this source tree.
|
||
*
|
||
* @license MIT
|
||
*/function qr(){return qr=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},qr.apply(this,arguments)}var Ns;(function(e){e.Pop="POP",e.Push="PUSH",e.Replace="REPLACE"})(Ns||(Ns={}));const k7="popstate";function f2e(e){e===void 0&&(e={});function t(r,s){let{pathname:i,search:o,hash:a}=r.location;return kC("",{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:Kv(s)}return p2e(t,n,null,e)}function sn(e,t){if(e===!1||e===null||typeof e>"u")throw new Error(t)}function hx(e,t){if(!e){typeof console<"u"&&console.warn(t);try{throw new Error(t)}catch{}}}function h2e(){return Math.random().toString(36).substr(2,8)}function D7(e,t){return{usr:e.state,key:e.key,idx:t}}function kC(e,t,n,r){return n===void 0&&(n=null),qr({pathname:typeof e=="string"?e:e.pathname,search:"",hash:""},typeof t=="string"?Dp(t):t,{state:n,key:t&&t.key||r||h2e()})}function Kv(e){let{pathname:t="/",search:n="",hash:r=""}=e;return n&&n!=="?"&&(t+=n.charAt(0)==="?"?n:"?"+n),r&&r!=="#"&&(t+=r.charAt(0)==="#"?r:"#"+r),t}function Dp(e){let t={};if(e){let n=e.indexOf("#");n>=0&&(t.hash=e.substr(n),e=e.substr(0,n));let r=e.indexOf("?");r>=0&&(t.search=e.substr(r),e=e.substr(0,r)),e&&(t.pathname=e)}return t}function p2e(e,t,n,r){r===void 0&&(r={});let{window:s=document.defaultView,v5Compat:i=!1}=r,o=s.history,a=Ns.Pop,c=null,d=h();d==null&&(d=0,o.replaceState(qr({},o.state,{idx:d}),""));function h(){return(o.state||{idx:null}).idx}function u(){a=Ns.Pop;let x=h(),y=x==null?null:x-d;d=x,c&&c({action:a,location:m.location,delta:y})}function f(x,y){a=Ns.Push;let b=kC(m.location,x,y);d=h()+1;let w=D7(b,d),E=m.createHref(b);try{o.pushState(w,"",E)}catch(R){if(R instanceof DOMException&&R.name==="DataCloneError")throw R;s.location.assign(E)}i&&c&&c({action:a,location:m.location,delta:1})}function g(x,y){a=Ns.Replace;let b=kC(m.location,x,y);d=h();let w=D7(b,d),E=m.createHref(b);o.replaceState(w,"",E),i&&c&&c({action:a,location:m.location,delta:0})}function v(x){let y=s.location.origin!=="null"?s.location.origin:s.location.href,b=typeof x=="string"?x:Kv(x);return b=b.replace(/ $/,"%20"),sn(y,"No window.location.(origin|href) available to create URL for href: "+b),new URL(b,y)}let m={get action(){return a},get location(){return e(s,o)},listen(x){if(c)throw new Error("A history only accepts one active listener");return s.addEventListener(k7,u),c=x,()=>{s.removeEventListener(k7,u),c=null}},createHref(x){return t(s,x)},createURL:v,encodeLocation(x){let y=v(x);return{pathname:y.pathname,search:y.search,hash:y.hash}},push:f,replace:g,go(x){return o.go(x)}};return m}var er;(function(e){e.data="data",e.deferred="deferred",e.redirect="redirect",e.error="error"})(er||(er={}));const m2e=new Set(["lazy","caseSensitive","path","id","index","children"]);function g2e(e){return e.index===!0}function VT(e,t,n,r){return n===void 0&&(n=[]),r===void 0&&(r={}),e.map((s,i)=>{let o=[...n,String(i)],a=typeof s.id=="string"?s.id:o.join("-");if(sn(s.index!==!0||!s.children,"Cannot specify children on an index route"),sn(!r[a],'Found a route id collision on id "'+a+`". Route id's must be globally unique within Data Router usages`),g2e(s)){let c=qr({},s,t(s),{id:a});return r[a]=c,c}else{let c=qr({},s,t(s),{id:a,children:void 0});return r[a]=c,s.children&&(c.children=VT(s.children,t,o,r)),c}})}function ig(e,t,n){return n===void 0&&(n="/"),nN(e,t,n,!1)}function nN(e,t,n,r){let s=typeof t=="string"?Dp(t):t,i=yp(s.pathname||"/",n);if(i==null)return null;let o=Sce(e);y2e(o);let a=null;for(let c=0;a==null&&c<o.length;++c){let d=N2e(i);a=R2e(o[c],d,r)}return a}function v2e(e,t){let{route:n,pathname:r,params:s}=e;return{id:n.id,pathname:r,params:s,data:t[n.id],handle:n.handle}}function Sce(e,t,n,r){t===void 0&&(t=[]),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("/")&&(sn(c.relativePath.startsWith(r),'Absolute route path "'+c.relativePath+'" nested under path '+('"'+r+'" is not valid. An absolute child route path ')+"must start with the combined path of all its parent routes."),c.relativePath=c.relativePath.slice(r.length));let d=Af([r,c.relativePath]),h=n.concat(c);i.children&&i.children.length>0&&(sn(i.index!==!0,"Index routes must not have child routes. Please remove "+('all child routes from route path "'+d+'".')),Sce(i.children,t,h,d)),!(i.path==null&&!i.index)&&t.push({path:d,score:E2e(d,i.index),routesMeta:h})};return e.forEach((i,o)=>{var a;if(i.path===""||!((a=i.path)!=null&&a.includes("?")))s(i,o);else for(let c of Cce(i.path))s(i,o,c)}),t}function Cce(e){let t=e.split("/");if(t.length===0)return[];let[n,...r]=t,s=n.endsWith("?"),i=n.replace(/\?$/,"");if(r.length===0)return s?[i,""]:[i];let o=Cce(r.join("/")),a=[];return a.push(...o.map(c=>c===""?i:[i,c].join("/"))),s&&a.push(...o),a.map(c=>e.startsWith("/")&&c===""?"/":c)}function y2e(e){e.sort((t,n)=>t.score!==n.score?n.score-t.score:A2e(t.routesMeta.map(r=>r.childrenIndex),n.routesMeta.map(r=>r.childrenIndex)))}const b2e=/^:[\w-]+$/,x2e=3,_2e=2,w2e=1,S2e=10,C2e=-2,O7=e=>e==="*";function E2e(e,t){let n=e.split("/"),r=n.length;return n.some(O7)&&(r+=C2e),t&&(r+=_2e),n.filter(s=>!O7(s)).reduce((s,i)=>s+(b2e.test(i)?x2e:i===""?w2e:S2e),r)}function A2e(e,t){return e.length===t.length&&e.slice(0,-1).every((r,s)=>r===t[s])?e[e.length-1]-t[t.length-1]:0}function R2e(e,t,n){n===void 0&&(n=!1);let{routesMeta:r}=e,s={},i="/",o=[];for(let a=0;a<r.length;++a){let c=r[a],d=a===r.length-1,h=i==="/"?t:t.slice(i.length)||"/",u=M7({path:c.relativePath,caseSensitive:c.caseSensitive,end:d},h),f=c.route;if(!u&&d&&n&&!r[r.length-1].route.index&&(u=M7({path:c.relativePath,caseSensitive:c.caseSensitive,end:!1},h)),!u)return null;Object.assign(s,u.params),o.push({params:s,pathname:Af([i,u.pathname]),pathnameBase:D2e(Af([i,u.pathnameBase])),route:f}),u.pathnameBase!=="/"&&(i=Af([i,u.pathnameBase]))}return o}function M7(e,t){typeof e=="string"&&(e={path:e,caseSensitive:!1,end:!0});let[n,r]=P2e(e.path,e.caseSensitive,e.end),s=t.match(n);if(!s)return null;let i=s[0],o=i.replace(/(.)\/+$/,"$1"),a=s.slice(1);return{params:r.reduce((d,h,u)=>{let{paramName:f,isOptional:g}=h;if(f==="*"){let m=a[u]||"";o=i.slice(0,i.length-m.length).replace(/(.)\/+$/,"$1")}const v=a[u];return g&&!v?d[f]=void 0:d[f]=(v||"").replace(/%2F/g,"/"),d},{}),pathname:i,pathnameBase:o,pattern:e}}function P2e(e,t,n){t===void 0&&(t=!1),n===void 0&&(n=!0),hx(e==="*"||!e.endsWith("*")||e.endsWith("/*"),'Route path "'+e+'" will be treated as if it were '+('"'+e.replace(/\*$/,"/*")+'" because the `*` character must ')+"always follow a `/` in the pattern. To get rid of this warning, "+('please change the route path to "'+e.replace(/\*$/,"/*")+'".'));let r=[],s="^"+e.replace(/\/*\*?$/,"").replace(/^\/*/,"/").replace(/[\\.*+^${}|()[\]]/g,"\\$&").replace(/\/:([\w-]+)(\?)?/g,(o,a,c)=>(r.push({paramName:a,isOptional:c!=null}),c?"/?([^\\/]+)?":"/([^\\/]+)"));return e.endsWith("*")?(r.push({paramName:"*"}),s+=e==="*"||e==="/*"?"(.*)$":"(?:\\/(.+)|\\/*)$"):n?s+="\\/*$":e!==""&&e!=="/"&&(s+="(?:(?=\\/|$))"),[new RegExp(s,t?void 0:"i"),r]}function N2e(e){try{return e.split("/").map(t=>decodeURIComponent(t).replace(/\//g,"%2F")).join("/")}catch(t){return hx(!1,'The URL path "'+e+'" could not be decoded because it is is a malformed URL segment. This is probably due to a bad percent '+("encoding ("+t+").")),e}}function yp(e,t){if(t==="/")return e;if(!e.toLowerCase().startsWith(t.toLowerCase()))return null;let n=t.endsWith("/")?t.length-1:t.length,r=e.charAt(n);return r&&r!=="/"?null:e.slice(n)||"/"}function T2e(e,t){t===void 0&&(t="/");let{pathname:n,search:r="",hash:s=""}=typeof e=="string"?Dp(e):e;return{pathname:n?n.startsWith("/")?n:k2e(n,t):t,search:O2e(r),hash:M2e(s)}}function k2e(e,t){let n=t.replace(/\/+$/,"").split("/");return e.split("/").forEach(s=>{s===".."?n.length>1&&n.pop():s!=="."&&n.push(s)}),n.length>1?n.join("/"):"/"}function I4(e,t,n,r){return"Cannot include a '"+e+"' character in a manually specified "+("`to."+t+"` 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 Ece(e){return e.filter((t,n)=>n===0||t.route.path&&t.route.path.length>0)}function _O(e,t){let n=Ece(e);return t?n.map((r,s)=>s===n.length-1?r.pathname:r.pathnameBase):n.map(r=>r.pathnameBase)}function wO(e,t,n,r){r===void 0&&(r=!1);let s;typeof e=="string"?s=Dp(e):(s=qr({},e),sn(!s.pathname||!s.pathname.includes("?"),I4("?","pathname","search",s)),sn(!s.pathname||!s.pathname.includes("#"),I4("#","pathname","hash",s)),sn(!s.search||!s.search.includes("#"),I4("#","search","hash",s)));let i=e===""||s.pathname==="",o=i?"/":s.pathname,a;if(o==null)a=n;else{let u=t.length-1;if(!r&&o.startsWith("..")){let f=o.split("/");for(;f[0]==="..";)f.shift(),u-=1;s.pathname=f.join("/")}a=u>=0?t[u]:"/"}let c=T2e(s,a),d=o&&o!=="/"&&o.endsWith("/"),h=(i||o===".")&&n.endsWith("/");return!c.pathname.endsWith("/")&&(d||h)&&(c.pathname+="/"),c}const Af=e=>e.join("/").replace(/\/\/+/g,"/"),D2e=e=>e.replace(/\/+$/,"").replace(/^\/*/,"/"),O2e=e=>!e||e==="?"?"":e.startsWith("?")?e:"?"+e,M2e=e=>!e||e==="#"?"":e.startsWith("#")?e:"#"+e;class HT{constructor(t,n,r,s){s===void 0&&(s=!1),this.status=t,this.statusText=n||"",this.internal=s,r instanceof Error?(this.data=r.toString(),this.error=r):this.data=r}}function DC(e){return e!=null&&typeof e.status=="number"&&typeof e.statusText=="string"&&typeof e.internal=="boolean"&&"data"in e}const Ace=["post","put","patch","delete"],I2e=new Set(Ace),L2e=["get",...Ace],j2e=new Set(L2e),$2e=new Set([301,302,303,307,308]),F2e=new Set([307,308]),L4={state:"idle",location:void 0,formMethod:void 0,formAction:void 0,formEncType:void 0,formData:void 0,json:void 0,text:void 0},z2e={state:"idle",data:void 0,formMethod:void 0,formAction:void 0,formEncType:void 0,formData:void 0,json:void 0,text:void 0},Qy={state:"unblocked",proceed:void 0,reset:void 0,location:void 0},tW=/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i,B2e=e=>({hasErrorBoundary:!!e.hasErrorBoundary}),Rce="remix-router-transitions";function U2e(e){const t=e.window?e.window:typeof window<"u"?window:void 0,n=typeof t<"u"&&typeof t.document<"u"&&typeof t.document.createElement<"u",r=!n;sn(e.routes.length>0,"You must provide a non-empty routes array to createRouter");let s;if(e.mapRouteProperties)s=e.mapRouteProperties;else if(e.detectErrorBoundary){let de=e.detectErrorBoundary;s=ye=>({hasErrorBoundary:de(ye)})}else s=B2e;let i={},o=VT(e.routes,s,void 0,i),a,c=e.basename||"/",d=e.dataStrategy||q2e,h=e.patchRoutesOnNavigation,u=qr({v7_fetcherPersist:!1,v7_normalizeFormMethod:!1,v7_partialHydration:!1,v7_prependBasename:!1,v7_relativeSplatPath:!1,v7_skipActionErrorRevalidation:!1},e.future),f=null,g=new Set,v=null,m=null,x=null,y=e.hydrationData!=null,b=ig(o,e.history.location,c),w=!1,E=null;if(b==null&&!h){let de=Wo(404,{pathname:e.history.location.pathname}),{matches:ye,route:Ce}=W7(o);b=ye,E={[Ce.id]:de}}b&&!e.hydrationData&&Tn(b,o,e.history.location.pathname).active&&(b=null);let R;if(b)if(b.some(de=>de.route.lazy))R=!1;else if(!b.some(de=>de.route.loader))R=!0;else if(u.v7_partialHydration){let de=e.hydrationData?e.hydrationData.loaderData:null,ye=e.hydrationData?e.hydrationData.errors:null;if(ye){let Ce=b.findIndex(Me=>ye[Me.route.id]!==void 0);R=b.slice(0,Ce+1).every(Me=>!kU(Me.route,de,ye))}else R=b.every(Ce=>!kU(Ce.route,de,ye))}else R=e.hydrationData!=null;else if(R=!1,b=[],u.v7_partialHydration){let de=Tn(null,o,e.history.location.pathname);de.active&&de.matches&&(w=!0,b=de.matches)}let T,N={historyAction:e.history.action,location:e.history.location,matches:b,initialized:R,navigation:L4,restoreScrollPosition:e.hydrationData!=null?!1:null,preventScrollReset:!1,revalidation:"idle",loaderData:e.hydrationData&&e.hydrationData.loaderData||{},actionData:e.hydrationData&&e.hydrationData.actionData||null,errors:e.hydrationData&&e.hydrationData.errors||E,fetchers:new Map,blockers:new Map},A=Ns.Pop,D=!1,O,I=!1,$=new Map,F=null,B=!1,W=!1,Z=[],Y=new Set,H=new Map,se=0,he=-1,re=new Map,J=new Set,te=new Map,ae=new Map,be=new Set,xe=new Map,ve=new Map,Pe;function Oe(){if(f=e.history.listen(de=>{let{action:ye,location:Ce,delta:Me}=de;if(Pe){Pe(),Pe=void 0;return}hx(ve.size===0||Me!=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 Ge=Pt({currentLocation:N.location,nextLocation:Ce,historyAction:ye});if(Ge&&Me!=null){let lt=new Promise(Ct=>{Pe=Ct});e.history.go(Me*-1),Rt(Ge,{state:"blocked",location:Ce,proceed(){Rt(Ge,{state:"proceeding",proceed:void 0,reset:void 0,location:Ce}),lt.then(()=>e.history.go(Me))},reset(){let Ct=new Map(N.blockers);Ct.set(Ge,Qy),$e({blockers:Ct})}});return}return ut(ye,Ce)}),n){o$e(t,$);let de=()=>a$e(t,$);t.addEventListener("pagehide",de),F=()=>t.removeEventListener("pagehide",de)}return N.initialized||ut(Ns.Pop,N.location,{initialHydration:!0}),T}function ke(){f&&f(),F&&F(),g.clear(),O&&O.abort(),N.fetchers.forEach((de,ye)=>ht(ye)),N.blockers.forEach((de,ye)=>Ze(ye))}function ze(de){return g.add(de),()=>g.delete(de)}function $e(de,ye){ye===void 0&&(ye={}),N=qr({},N,de);let Ce=[],Me=[];u.v7_fetcherPersist&&N.fetchers.forEach((Ge,lt)=>{Ge.state==="idle"&&(be.has(lt)?Me.push(lt):Ce.push(lt))}),be.forEach(Ge=>{!N.fetchers.has(Ge)&&!H.has(Ge)&&Me.push(Ge)}),[...g].forEach(Ge=>Ge(N,{deletedFetchers:Me,viewTransitionOpts:ye.viewTransitionOpts,flushSync:ye.flushSync===!0})),u.v7_fetcherPersist?(Ce.forEach(Ge=>N.fetchers.delete(Ge)),Me.forEach(Ge=>ht(Ge))):Me.forEach(Ge=>be.delete(Ge))}function Te(de,ye,Ce){var Me,Ge;let{flushSync:lt}=Ce===void 0?{}:Ce,Ct=N.actionData!=null&&N.navigation.formMethod!=null&&fc(N.navigation.formMethod)&&N.navigation.state==="loading"&&((Me=de.state)==null?void 0:Me._isRedirect)!==!0,st;ye.actionData?Object.keys(ye.actionData).length>0?st=ye.actionData:st=null:Ct?st=N.actionData:st=null;let dt=ye.loaderData?V7(N.loaderData,ye.loaderData,ye.matches||[],ye.errors):N.loaderData,ot=N.blockers;ot.size>0&&(ot=new Map(ot),ot.forEach((Jt,ps)=>ot.set(ps,Qy)));let gt=D===!0||N.navigation.formMethod!=null&&fc(N.navigation.formMethod)&&((Ge=de.state)==null?void 0:Ge._isRedirect)!==!0;a&&(o=a,a=void 0),B||A===Ns.Pop||(A===Ns.Push?e.history.push(de,de.state):A===Ns.Replace&&e.history.replace(de,de.state));let Lt;if(A===Ns.Pop){let Jt=$.get(N.location.pathname);Jt&&Jt.has(de.pathname)?Lt={currentLocation:N.location,nextLocation:de}:$.has(de.pathname)&&(Lt={currentLocation:de,nextLocation:N.location})}else if(I){let Jt=$.get(N.location.pathname);Jt?Jt.add(de.pathname):(Jt=new Set([de.pathname]),$.set(N.location.pathname,Jt)),Lt={currentLocation:N.location,nextLocation:de}}$e(qr({},ye,{actionData:st,loaderData:dt,historyAction:A,location:de,initialized:!0,navigation:L4,revalidation:"idle",restoreScrollPosition:In(de,ye.matches||N.matches),preventScrollReset:gt,blockers:ot}),{viewTransitionOpts:Lt,flushSync:lt===!0}),A=Ns.Pop,D=!1,I=!1,B=!1,W=!1,Z=[]}async function Ue(de,ye){if(typeof de=="number"){e.history.go(de);return}let Ce=TU(N.location,N.matches,c,u.v7_prependBasename,de,u.v7_relativeSplatPath,ye==null?void 0:ye.fromRouteId,ye==null?void 0:ye.relative),{path:Me,submission:Ge,error:lt}=I7(u.v7_normalizeFormMethod,!1,Ce,ye),Ct=N.location,st=kC(N.location,Me,ye&&ye.state);st=qr({},st,e.history.encodeLocation(st));let dt=ye&&ye.replace!=null?ye.replace:void 0,ot=Ns.Push;dt===!0?ot=Ns.Replace:dt===!1||Ge!=null&&fc(Ge.formMethod)&&Ge.formAction===N.location.pathname+N.location.search&&(ot=Ns.Replace);let gt=ye&&"preventScrollReset"in ye?ye.preventScrollReset===!0:void 0,Lt=(ye&&ye.flushSync)===!0,Jt=Pt({currentLocation:Ct,nextLocation:st,historyAction:ot});if(Jt){Rt(Jt,{state:"blocked",location:st,proceed(){Rt(Jt,{state:"proceeding",proceed:void 0,reset:void 0,location:st}),Ue(de,ye)},reset(){let ps=new Map(N.blockers);ps.set(Jt,Qy),$e({blockers:ps})}});return}return await ut(ot,st,{submission:Ge,pendingError:lt,preventScrollReset:gt,replace:ye&&ye.replace,enableViewTransition:ye&&ye.viewTransition,flushSync:Lt})}function wt(){if(pe(),$e({revalidation:"loading"}),N.navigation.state!=="submitting"){if(N.navigation.state==="idle"){ut(N.historyAction,N.location,{startUninterruptedRevalidation:!0});return}ut(A||N.historyAction,N.navigation.location,{overrideNavigation:N.navigation,enableViewTransition:I===!0})}}async function ut(de,ye,Ce){O&&O.abort(),O=null,A=de,B=(Ce&&Ce.startUninterruptedRevalidation)===!0,Hn(N.location,N.matches),D=(Ce&&Ce.preventScrollReset)===!0,I=(Ce&&Ce.enableViewTransition)===!0;let Me=a||o,Ge=Ce&&Ce.overrideNavigation,lt=Ce!=null&&Ce.initialHydration&&N.matches&&N.matches.length>0&&!w?N.matches:ig(Me,ye,c),Ct=(Ce&&Ce.flushSync)===!0;if(lt&&N.initialized&&!W&&Z2e(N.location,ye)&&!(Ce&&Ce.submission&&fc(Ce.submission.formMethod))){Te(ye,{matches:lt},{flushSync:Ct});return}let st=Tn(lt,Me,ye.pathname);if(st.active&&st.matches&&(lt=st.matches),!lt){let{error:Wn,notFoundMatches:pn,route:wr}=Ut(ye.pathname);Te(ye,{matches:pn,loaderData:{},errors:{[wr.id]:Wn}},{flushSync:Ct});return}O=new AbortController;let dt=zy(e.history,ye,O.signal,Ce&&Ce.submission),ot;if(Ce&&Ce.pendingError)ot=[og(lt).route.id,{type:er.error,error:Ce.pendingError}];else if(Ce&&Ce.submission&&fc(Ce.submission.formMethod)){let Wn=await St(dt,ye,Ce.submission,lt,st.active,{replace:Ce.replace,flushSync:Ct});if(Wn.shortCircuited)return;if(Wn.pendingActionResult){let[pn,wr]=Wn.pendingActionResult;if(Va(wr)&&DC(wr.error)&&wr.error.status===404){O=null,Te(ye,{matches:Wn.matches,loaderData:{},errors:{[pn]:wr.error}});return}}lt=Wn.matches||lt,ot=Wn.pendingActionResult,Ge=j4(ye,Ce.submission),Ct=!1,st.active=!1,dt=zy(e.history,dt.url,dt.signal)}let{shortCircuited:gt,matches:Lt,loaderData:Jt,errors:ps}=await Nn(dt,ye,lt,st.active,Ge,Ce&&Ce.submission,Ce&&Ce.fetcherSubmission,Ce&&Ce.replace,Ce&&Ce.initialHydration===!0,Ct,ot);gt||(O=null,Te(ye,qr({matches:Lt||lt},H7(ot),{loaderData:Jt,errors:ps})))}async function St(de,ye,Ce,Me,Ge,lt){lt===void 0&&(lt={}),pe();let Ct=s$e(ye,Ce);if($e({navigation:Ct},{flushSync:lt.flushSync===!0}),Ge){let ot=await sr(Me,ye.pathname,de.signal);if(ot.type==="aborted")return{shortCircuited:!0};if(ot.type==="error"){let gt=og(ot.partialMatches).route.id;return{matches:ot.partialMatches,pendingActionResult:[gt,{type:er.error,error:ot.error}]}}else if(ot.matches)Me=ot.matches;else{let{notFoundMatches:gt,error:Lt,route:Jt}=Ut(ye.pathname);return{matches:gt,pendingActionResult:[Jt.id,{type:er.error,error:Lt}]}}}let st,dt=f1(Me,ye);if(!dt.route.action&&!dt.route.lazy)st={type:er.error,error:Wo(405,{method:de.method,pathname:ye.pathname,routeId:dt.route.id})};else if(st=(await _e("action",N,de,[dt],Me,null))[dt.route.id],de.signal.aborted)return{shortCircuited:!0};if(pg(st)){let ot;return lt&<.replace!=null?ot=lt.replace:ot=z7(st.response.headers.get("Location"),new URL(de.url),c)===N.location.pathname+N.location.search,await ie(de,st,!0,{submission:Ce,replace:ot}),{shortCircuited:!0}}if(Zh(st))throw Wo(400,{type:"defer-action"});if(Va(st)){let ot=og(Me,dt.route.id);return(lt&<.replace)!==!0&&(A=Ns.Push),{matches:Me,pendingActionResult:[ot.route.id,st]}}return{matches:Me,pendingActionResult:[dt.route.id,st]}}async function Nn(de,ye,Ce,Me,Ge,lt,Ct,st,dt,ot,gt){let Lt=Ge||j4(ye,lt),Jt=lt||Ct||G7(Lt),ps=!B&&(!u.v7_partialHydration||!dt);if(Me){if(ps){let Sr=cn(gt);$e(qr({navigation:Lt},Sr!==void 0?{actionData:Sr}:{}),{flushSync:ot})}let en=await sr(Ce,ye.pathname,de.signal);if(en.type==="aborted")return{shortCircuited:!0};if(en.type==="error"){let Sr=og(en.partialMatches).route.id;return{matches:en.partialMatches,loaderData:{},errors:{[Sr]:en.error}}}else if(en.matches)Ce=en.matches;else{let{error:Sr,notFoundMatches:Fc,route:Uu}=Ut(ye.pathname);return{matches:Fc,loaderData:{},errors:{[Uu.id]:Sr}}}}let Wn=a||o,[pn,wr]=j7(e.history,N,Ce,Jt,ye,u.v7_partialHydration&&dt===!0,u.v7_skipActionErrorRevalidation,W,Z,Y,be,te,J,Wn,c,gt);if(yt(en=>!(Ce&&Ce.some(Sr=>Sr.route.id===en))||pn&&pn.some(Sr=>Sr.route.id===en)),he=++se,pn.length===0&&wr.length===0){let en=Yt();return Te(ye,qr({matches:Ce,loaderData:{},errors:gt&&Va(gt[1])?{[gt[0]]:gt[1].error}:null},H7(gt),en?{fetchers:new Map(N.fetchers)}:{}),{flushSync:ot}),{shortCircuited:!0}}if(ps){let en={};if(!Me){en.navigation=Lt;let Sr=cn(gt);Sr!==void 0&&(en.actionData=Sr)}wr.length>0&&(en.fetchers=hn(wr)),$e(en,{flushSync:ot})}wr.forEach(en=>{Mn(en.key),en.controller&&H.set(en.key,en.controller)});let Lc=()=>wr.forEach(en=>Mn(en.key));O&&O.signal.addEventListener("abort",Lc);let{loaderResults:oo,fetcherResults:fa}=await we(N,Ce,pn,wr,de);if(de.signal.aborted)return{shortCircuited:!0};O&&O.signal.removeEventListener("abort",Lc),wr.forEach(en=>H.delete(en.key));let As=mP(oo);if(As)return await ie(de,As.result,!0,{replace:st}),{shortCircuited:!0};if(As=mP(fa),As)return J.add(As.key),await ie(de,As.result,!0,{replace:st}),{shortCircuited:!0};let{loaderData:$p,errors:Bu}=U7(N,Ce,oo,gt,wr,fa,xe);xe.forEach((en,Sr)=>{en.subscribe(Fc=>{(Fc||en.done)&&xe.delete(Sr)})}),u.v7_partialHydration&&dt&&N.errors&&(Bu=qr({},N.errors,Bu));let Tl=Yt(),jc=un(he),$c=Tl||jc||wr.length>0;return qr({matches:Ce,loaderData:$p,errors:Bu},$c?{fetchers:new Map(N.fetchers)}:{})}function cn(de){if(de&&!Va(de[1]))return{[de[0]]:de[1].data};if(N.actionData)return Object.keys(N.actionData).length===0?null:N.actionData}function hn(de){return de.forEach(ye=>{let Ce=N.fetchers.get(ye.key),Me=HS(void 0,Ce?Ce.data:void 0);N.fetchers.set(ye.key,Me)}),new Map(N.fetchers)}function It(de,ye,Ce,Me){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.");Mn(de);let Ge=(Me&&Me.flushSync)===!0,lt=a||o,Ct=TU(N.location,N.matches,c,u.v7_prependBasename,Ce,u.v7_relativeSplatPath,ye,Me==null?void 0:Me.relative),st=ig(lt,Ct,c),dt=Tn(st,lt,Ct);if(dt.active&&dt.matches&&(st=dt.matches),!st){Fe(de,ye,Wo(404,{pathname:Ct}),{flushSync:Ge});return}let{path:ot,submission:gt,error:Lt}=I7(u.v7_normalizeFormMethod,!0,Ct,Me);if(Lt){Fe(de,ye,Lt,{flushSync:Ge});return}let Jt=f1(st,ot),ps=(Me&&Me.preventScrollReset)===!0;if(gt&&fc(gt.formMethod)){U(de,ye,ot,Jt,st,dt.active,Ge,ps,gt);return}te.set(de,{routeId:ye,path:ot}),ee(de,ye,ot,Jt,st,dt.active,Ge,ps,gt)}async function U(de,ye,Ce,Me,Ge,lt,Ct,st,dt){pe(),te.delete(de);function ot(Wr){if(!Wr.route.action&&!Wr.route.lazy){let nl=Wo(405,{method:dt.formMethod,pathname:Ce,routeId:ye});return Fe(de,ye,nl,{flushSync:Ct}),!0}return!1}if(!lt&&ot(Me))return;let gt=N.fetchers.get(de);Se(de,i$e(dt,gt),{flushSync:Ct});let Lt=new AbortController,Jt=zy(e.history,Ce,Lt.signal,dt);if(lt){let Wr=await sr(Ge,new URL(Jt.url).pathname,Jt.signal,de);if(Wr.type==="aborted")return;if(Wr.type==="error"){Fe(de,ye,Wr.error,{flushSync:Ct});return}else if(Wr.matches){if(Ge=Wr.matches,Me=f1(Ge,Ce),ot(Me))return}else{Fe(de,ye,Wo(404,{pathname:Ce}),{flushSync:Ct});return}}H.set(de,Lt);let ps=se,pn=(await _e("action",N,Jt,[Me],Ge,de))[Me.route.id];if(Jt.signal.aborted){H.get(de)===Lt&&H.delete(de);return}if(u.v7_fetcherPersist&&be.has(de)){if(pg(pn)||Va(pn)){Se(de,sh(void 0));return}}else{if(pg(pn))if(H.delete(de),he>ps){Se(de,sh(void 0));return}else return J.add(de),Se(de,HS(dt)),ie(Jt,pn,!1,{fetcherSubmission:dt,preventScrollReset:st});if(Va(pn)){Fe(de,ye,pn.error);return}}if(Zh(pn))throw Wo(400,{type:"defer-action"});let wr=N.navigation.location||N.location,Lc=zy(e.history,wr,Lt.signal),oo=a||o,fa=N.navigation.state!=="idle"?ig(oo,N.navigation.location,c):N.matches;sn(fa,"Didn't find any matches after fetcher action");let As=++se;re.set(de,As);let $p=HS(dt,pn.data);N.fetchers.set(de,$p);let[Bu,Tl]=j7(e.history,N,fa,dt,wr,!1,u.v7_skipActionErrorRevalidation,W,Z,Y,be,te,J,oo,c,[Me.route.id,pn]);Tl.filter(Wr=>Wr.key!==de).forEach(Wr=>{let nl=Wr.key,Kf=N.fetchers.get(nl),Fp=HS(void 0,Kf?Kf.data:void 0);N.fetchers.set(nl,Fp),Mn(nl),Wr.controller&&H.set(nl,Wr.controller)}),$e({fetchers:new Map(N.fetchers)});let jc=()=>Tl.forEach(Wr=>Mn(Wr.key));Lt.signal.addEventListener("abort",jc);let{loaderResults:$c,fetcherResults:en}=await we(N,fa,Bu,Tl,Lc);if(Lt.signal.aborted)return;Lt.signal.removeEventListener("abort",jc),re.delete(de),H.delete(de),Tl.forEach(Wr=>H.delete(Wr.key));let Sr=mP($c);if(Sr)return ie(Lc,Sr.result,!1,{preventScrollReset:st});if(Sr=mP(en),Sr)return J.add(Sr.key),ie(Lc,Sr.result,!1,{preventScrollReset:st});let{loaderData:Fc,errors:Uu}=U7(N,fa,$c,void 0,Tl,en,xe);if(N.fetchers.has(de)){let Wr=sh(pn.data);N.fetchers.set(de,Wr)}un(As),N.navigation.state==="loading"&&As>he?(sn(A,"Expected pending action"),O&&O.abort(),Te(N.navigation.location,{matches:fa,loaderData:Fc,errors:Uu,fetchers:new Map(N.fetchers)})):($e({errors:Uu,loaderData:V7(N.loaderData,Fc,fa,Uu),fetchers:new Map(N.fetchers)}),W=!1)}async function ee(de,ye,Ce,Me,Ge,lt,Ct,st,dt){let ot=N.fetchers.get(de);Se(de,HS(dt,ot?ot.data:void 0),{flushSync:Ct});let gt=new AbortController,Lt=zy(e.history,Ce,gt.signal);if(lt){let pn=await sr(Ge,new URL(Lt.url).pathname,Lt.signal,de);if(pn.type==="aborted")return;if(pn.type==="error"){Fe(de,ye,pn.error,{flushSync:Ct});return}else if(pn.matches)Ge=pn.matches,Me=f1(Ge,Ce);else{Fe(de,ye,Wo(404,{pathname:Ce}),{flushSync:Ct});return}}H.set(de,gt);let Jt=se,Wn=(await _e("loader",N,Lt,[Me],Ge,de))[Me.route.id];if(Zh(Wn)&&(Wn=await nW(Wn,Lt.signal,!0)||Wn),H.get(de)===gt&&H.delete(de),!Lt.signal.aborted){if(be.has(de)){Se(de,sh(void 0));return}if(pg(Wn))if(he>Jt){Se(de,sh(void 0));return}else{J.add(de),await ie(Lt,Wn,!1,{preventScrollReset:st});return}if(Va(Wn)){Fe(de,ye,Wn.error);return}sn(!Zh(Wn),"Unhandled fetcher deferred data"),Se(de,sh(Wn.data))}}async function ie(de,ye,Ce,Me){let{submission:Ge,fetcherSubmission:lt,preventScrollReset:Ct,replace:st}=Me===void 0?{}:Me;ye.response.headers.has("X-Remix-Revalidate")&&(W=!0);let dt=ye.response.headers.get("Location");sn(dt,"Expected a Location header on the redirect Response"),dt=z7(dt,new URL(de.url),c);let ot=kC(N.location,dt,{_isRedirect:!0});if(n){let pn=!1;if(ye.response.headers.has("X-Remix-Reload-Document"))pn=!0;else if(tW.test(dt)){const wr=e.history.createURL(dt);pn=wr.origin!==t.location.origin||yp(wr.pathname,c)==null}if(pn){st?t.location.replace(dt):t.location.assign(dt);return}}O=null;let gt=st===!0||ye.response.headers.has("X-Remix-Replace")?Ns.Replace:Ns.Push,{formMethod:Lt,formAction:Jt,formEncType:ps}=N.navigation;!Ge&&!lt&&Lt&&Jt&&ps&&(Ge=G7(N.navigation));let Wn=Ge||lt;if(F2e.has(ye.response.status)&&Wn&&fc(Wn.formMethod))await ut(gt,ot,{submission:qr({},Wn,{formAction:dt}),preventScrollReset:Ct||D,enableViewTransition:Ce?I:void 0});else{let pn=j4(ot,Ge);await ut(gt,ot,{overrideNavigation:pn,fetcherSubmission:lt,preventScrollReset:Ct||D,enableViewTransition:Ce?I:void 0})}}async function _e(de,ye,Ce,Me,Ge,lt){let Ct,st={};try{Ct=await G2e(d,de,ye,Ce,Me,Ge,lt,i,s)}catch(dt){return Me.forEach(ot=>{st[ot.route.id]={type:er.error,error:dt}}),st}for(let[dt,ot]of Object.entries(Ct))if(J2e(ot)){let gt=ot.result;st[dt]={type:er.redirect,response:X2e(gt,Ce,dt,Ge,c,u.v7_relativeSplatPath)}}else st[dt]=await Y2e(ot);return st}async function we(de,ye,Ce,Me,Ge){let lt=de.matches,Ct=_e("loader",de,Ge,Ce,ye,null),st=Promise.all(Me.map(async gt=>{if(gt.matches&>.match&>.controller){let Jt=(await _e("loader",de,zy(e.history,gt.path,gt.controller.signal),[gt.match],gt.matches,gt.key))[gt.match.route.id];return{[gt.key]:Jt}}else return Promise.resolve({[gt.key]:{type:er.error,error:Wo(404,{pathname:gt.path})}})})),dt=await Ct,ot=(await st).reduce((gt,Lt)=>Object.assign(gt,Lt),{});return await Promise.all([n$e(ye,dt,Ge.signal,lt,de.loaderData),r$e(ye,ot,Me)]),{loaderResults:dt,fetcherResults:ot}}function pe(){W=!0,Z.push(...yt()),te.forEach((de,ye)=>{H.has(ye)&&Y.add(ye),Mn(ye)})}function Se(de,ye,Ce){Ce===void 0&&(Ce={}),N.fetchers.set(de,ye),$e({fetchers:new Map(N.fetchers)},{flushSync:(Ce&&Ce.flushSync)===!0})}function Fe(de,ye,Ce,Me){Me===void 0&&(Me={});let Ge=og(N.matches,ye);ht(de),$e({errors:{[Ge.route.id]:Ce},fetchers:new Map(N.fetchers)},{flushSync:(Me&&Me.flushSync)===!0})}function ft(de){return ae.set(de,(ae.get(de)||0)+1),be.has(de)&&be.delete(de),N.fetchers.get(de)||z2e}function ht(de){let ye=N.fetchers.get(de);H.has(de)&&!(ye&&ye.state==="loading"&&re.has(de))&&Mn(de),te.delete(de),re.delete(de),J.delete(de),u.v7_fetcherPersist&&be.delete(de),Y.delete(de),N.fetchers.delete(de)}function hs(de){let ye=(ae.get(de)||0)-1;ye<=0?(ae.delete(de),be.add(de),u.v7_fetcherPersist||ht(de)):ae.set(de,ye),$e({fetchers:new Map(N.fetchers)})}function Mn(de){let ye=H.get(de);ye&&(ye.abort(),H.delete(de))}function Hr(de){for(let ye of de){let Ce=ft(ye),Me=sh(Ce.data);N.fetchers.set(ye,Me)}}function Yt(){let de=[],ye=!1;for(let Ce of J){let Me=N.fetchers.get(Ce);sn(Me,"Expected fetcher: "+Ce),Me.state==="loading"&&(J.delete(Ce),de.push(Ce),ye=!0)}return Hr(de),ye}function un(de){let ye=[];for(let[Ce,Me]of re)if(Me<de){let Ge=N.fetchers.get(Ce);sn(Ge,"Expected fetcher: "+Ce),Ge.state==="loading"&&(Mn(Ce),re.delete(Ce),ye.push(Ce))}return Hr(ye),ye.length>0}function xn(de,ye){let Ce=N.blockers.get(de)||Qy;return ve.get(de)!==ye&&ve.set(de,ye),Ce}function Ze(de){N.blockers.delete(de),ve.delete(de)}function Rt(de,ye){let Ce=N.blockers.get(de)||Qy;sn(Ce.state==="unblocked"&&ye.state==="blocked"||Ce.state==="blocked"&&ye.state==="blocked"||Ce.state==="blocked"&&ye.state==="proceeding"||Ce.state==="blocked"&&ye.state==="unblocked"||Ce.state==="proceeding"&&ye.state==="unblocked","Invalid blocker state transition: "+Ce.state+" -> "+ye.state);let Me=new Map(N.blockers);Me.set(de,ye),$e({blockers:Me})}function Pt(de){let{currentLocation:ye,nextLocation:Ce,historyAction:Me}=de;if(ve.size===0)return;ve.size>1&&hx(!1,"A router only supports one blocker at a time");let Ge=Array.from(ve.entries()),[lt,Ct]=Ge[Ge.length-1],st=N.blockers.get(lt);if(!(st&&st.state==="proceeding")&&Ct({currentLocation:ye,nextLocation:Ce,historyAction:Me}))return lt}function Ut(de){let ye=Wo(404,{pathname:de}),Ce=a||o,{matches:Me,route:Ge}=W7(Ce);return yt(),{notFoundMatches:Me,route:Ge,error:ye}}function yt(de){let ye=[];return xe.forEach((Ce,Me)=>{(!de||de(Me))&&(Ce.cancel(),ye.push(Me),xe.delete(Me))}),ye}function dn(de,ye,Ce){if(v=de,x=ye,m=Ce||null,!y&&N.navigation===L4){y=!0;let Me=In(N.location,N.matches);Me!=null&&$e({restoreScrollPosition:Me})}return()=>{v=null,x=null,m=null}}function Gt(de,ye){return m&&m(de,ye.map(Me=>v2e(Me,N.loaderData)))||de.key}function Hn(de,ye){if(v&&x){let Ce=Gt(de,ye);v[Ce]=x()}}function In(de,ye){if(v){let Ce=Gt(de,ye),Me=v[Ce];if(typeof Me=="number")return Me}return null}function Tn(de,ye,Ce){if(h)if(de){if(Object.keys(de[0].params).length>0)return{active:!0,matches:nN(ye,Ce,c,!0)}}else return{active:!0,matches:nN(ye,Ce,c,!0)||[]};return{active:!1,matches:null}}async function sr(de,ye,Ce,Me){if(!h)return{type:"success",matches:de};let Ge=de;for(;;){let lt=a==null,Ct=a||o,st=i;try{await h({signal:Ce,path:ye,matches:Ge,fetcherKey:Me,patch:(gt,Lt)=>{Ce.aborted||F7(gt,Lt,Ct,st,s)}})}catch(gt){return{type:"error",error:gt,partialMatches:Ge}}finally{lt&&!Ce.aborted&&(o=[...o])}if(Ce.aborted)return{type:"aborted"};let dt=ig(Ct,ye,c);if(dt)return{type:"success",matches:dt};let ot=nN(Ct,ye,c,!0);if(!ot||Ge.length===ot.length&&Ge.every((gt,Lt)=>gt.route.id===ot[Lt].route.id))return{type:"success",matches:null};Ge=ot}}function Kr(de){i={},a=VT(de,s,void 0,i)}function ir(de,ye){let Ce=a==null;F7(de,ye,a||o,i,s),Ce&&(o=[...o],$e({}))}return T={get basename(){return c},get future(){return u},get state(){return N},get routes(){return o},get window(){return t},initialize:Oe,subscribe:ze,enableScrollRestoration:dn,navigate:Ue,fetch:It,revalidate:wt,createHref:de=>e.history.createHref(de),encodeLocation:de=>e.history.encodeLocation(de),getFetcher:ft,deleteFetcher:hs,dispose:ke,getBlocker:xn,deleteBlocker:Ze,patchRoutes:ir,_internalFetchControllers:H,_internalActiveDeferreds:xe,_internalSetRoutes:Kr},T}function V2e(e){return e!=null&&("formData"in e&&e.formData!=null||"body"in e&&e.body!==void 0)}function TU(e,t,n,r,s,i,o,a){let c,d;if(o){c=[];for(let u of t)if(c.push(u),u.route.id===o){d=u;break}}else c=t,d=t[t.length-1];let h=wO(s||".",_O(c,i),yp(e.pathname,n)||e.pathname,a==="path");if(s==null&&(h.search=e.search,h.hash=e.hash),(s==null||s===""||s===".")&&d){let u=rW(h.search);if(d.route.index&&!u)h.search=h.search?h.search.replace(/^\?/,"?index&"):"?index";else if(!d.route.index&&u){let f=new URLSearchParams(h.search),g=f.getAll("index");f.delete("index"),g.filter(m=>m).forEach(m=>f.append("index",m));let v=f.toString();h.search=v?"?"+v:""}}return r&&n!=="/"&&(h.pathname=h.pathname==="/"?n:Af([n,h.pathname])),Kv(h)}function I7(e,t,n,r){if(!r||!V2e(r))return{path:n};if(r.formMethod&&!t$e(r.formMethod))return{path:n,error:Wo(405,{method:r.formMethod})};let s=()=>({path:n,error:Wo(400,{type:"invalid-body"})}),i=r.formMethod||"get",o=e?i.toUpperCase():i.toLowerCase(),a=Tce(n);if(r.body!==void 0){if(r.formEncType==="text/plain"){if(!fc(o))return s();let f=typeof r.body=="string"?r.body:r.body instanceof FormData||r.body instanceof URLSearchParams?Array.from(r.body.entries()).reduce((g,v)=>{let[m,x]=v;return""+g+m+"="+x+`
|
||
`},""):String(r.body);return{path:n,submission:{formMethod:o,formAction:a,formEncType:r.formEncType,formData:void 0,json:void 0,text:f}}}else if(r.formEncType==="application/json"){if(!fc(o))return s();try{let f=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:f,text:void 0}}}catch{return s()}}}sn(typeof FormData=="function","FormData is not available in this environment");let c,d;if(r.formData)c=DU(r.formData),d=r.formData;else if(r.body instanceof FormData)c=DU(r.body),d=r.body;else if(r.body instanceof URLSearchParams)c=r.body,d=B7(c);else if(r.body==null)c=new URLSearchParams,d=new FormData;else try{c=new URLSearchParams(r.body),d=B7(c)}catch{return s()}let h={formMethod:o,formAction:a,formEncType:r&&r.formEncType||"application/x-www-form-urlencoded",formData:d,json:void 0,text:void 0};if(fc(h.formMethod))return{path:n,submission:h};let u=Dp(n);return t&&u.search&&rW(u.search)&&c.append("index",""),u.search="?"+c,{path:Kv(u),submission:h}}function L7(e,t,n){n===void 0&&(n=!1);let r=e.findIndex(s=>s.route.id===t);return r>=0?e.slice(0,n?r+1:r):e}function j7(e,t,n,r,s,i,o,a,c,d,h,u,f,g,v,m){let x=m?Va(m[1])?m[1].error:m[1].data:void 0,y=e.createURL(t.location),b=e.createURL(s),w=n;i&&t.errors?w=L7(n,Object.keys(t.errors)[0],!0):m&&Va(m[1])&&(w=L7(n,m[0]));let E=m?m[1].statusCode:void 0,R=o&&E&&E>=400,T=w.filter((A,D)=>{let{route:O}=A;if(O.lazy)return!0;if(O.loader==null)return!1;if(i)return kU(O,t.loaderData,t.errors);if(H2e(t.loaderData,t.matches[D],A)||c.some(F=>F===A.route.id))return!0;let I=t.matches[D],$=A;return $7(A,qr({currentUrl:y,currentParams:I.params,nextUrl:b,nextParams:$.params},r,{actionResult:x,actionStatus:E,defaultShouldRevalidate:R?!1:a||y.pathname+y.search===b.pathname+b.search||y.search!==b.search||Pce(I,$)}))}),N=[];return u.forEach((A,D)=>{if(i||!n.some(B=>B.route.id===A.routeId)||h.has(D))return;let O=ig(g,A.path,v);if(!O){N.push({key:D,routeId:A.routeId,path:A.path,matches:null,match:null,controller:null});return}let I=t.fetchers.get(D),$=f1(O,A.path),F=!1;f.has(D)?F=!1:d.has(D)?(d.delete(D),F=!0):I&&I.state!=="idle"&&I.data===void 0?F=a:F=$7($,qr({currentUrl:y,currentParams:t.matches[t.matches.length-1].params,nextUrl:b,nextParams:n[n.length-1].params},r,{actionResult:x,actionStatus:E,defaultShouldRevalidate:R?!1:a})),F&&N.push({key:D,routeId:A.routeId,path:A.path,matches:O,match:$,controller:new AbortController})}),[T,N]}function kU(e,t,n){if(e.lazy)return!0;if(!e.loader)return!1;let r=t!=null&&t[e.id]!==void 0,s=n!=null&&n[e.id]!==void 0;return!r&&s?!1:typeof e.loader=="function"&&e.loader.hydrate===!0?!0:!r&&!s}function H2e(e,t,n){let r=!t||n.route.id!==t.route.id,s=e[n.route.id]===void 0;return r||s}function Pce(e,t){let n=e.route.path;return e.pathname!==t.pathname||n!=null&&n.endsWith("*")&&e.params["*"]!==t.params["*"]}function $7(e,t){if(e.route.shouldRevalidate){let n=e.route.shouldRevalidate(t);if(typeof n=="boolean")return n}return t.defaultShouldRevalidate}function F7(e,t,n,r,s){var i;let o;if(e){let d=r[e];sn(d,"No route found to patch children into: routeId = "+e),d.children||(d.children=[]),o=d.children}else o=n;let a=t.filter(d=>!o.some(h=>Nce(d,h))),c=VT(a,s,[e||"_","patch",String(((i=o)==null?void 0:i.length)||"0")],r);o.push(...c)}function Nce(e,t){return"id"in e&&"id"in t&&e.id===t.id?!0:e.index===t.index&&e.path===t.path&&e.caseSensitive===t.caseSensitive?(!e.children||e.children.length===0)&&(!t.children||t.children.length===0)?!0:e.children.every((n,r)=>{var s;return(s=t.children)==null?void 0:s.some(i=>Nce(n,i))}):!1}async function W2e(e,t,n){if(!e.lazy)return;let r=await e.lazy();if(!e.lazy)return;let s=n[e.id];sn(s,"No route found in manifest");let i={};for(let o in r){let c=s[o]!==void 0&&o!=="hasErrorBoundary";hx(!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&&!m2e.has(o)&&(i[o]=r[o])}Object.assign(s,i),Object.assign(s,qr({},t(s),{lazy:void 0}))}async function q2e(e){let{matches:t}=e,n=t.filter(s=>s.shouldLoad);return(await Promise.all(n.map(s=>s.resolve()))).reduce((s,i,o)=>Object.assign(s,{[n[o].route.id]:i}),{})}async function G2e(e,t,n,r,s,i,o,a,c,d){let h=i.map(g=>g.route.lazy?W2e(g.route,c,a):void 0),u=i.map((g,v)=>{let m=h[v],x=s.some(b=>b.route.id===g.route.id);return qr({},g,{shouldLoad:x,resolve:async b=>(b&&r.method==="GET"&&(g.route.lazy||g.route.loader)&&(x=!0),x?K2e(t,r,g,m,b,d):Promise.resolve({type:er.data,result:void 0}))})}),f=await e({matches:u,request:r,params:i[0].params,fetcherKey:o,context:d});try{await Promise.all(h)}catch{}return f}async function K2e(e,t,n,r,s,i){let o,a,c=d=>{let h,u=new Promise((v,m)=>h=m);a=()=>h(),t.signal.addEventListener("abort",a);let f=v=>typeof d!="function"?Promise.reject(new Error("You cannot call the handler for a route which defines a boolean "+('"'+e+'" [routeId: '+n.route.id+"]"))):d({request:t,params:n.params,context:i},...v!==void 0?[v]:[]),g=(async()=>{try{return{type:"data",result:await(s?s(m=>f(m)):f())}}catch(v){return{type:"error",result:v}}})();return Promise.race([g,u])};try{let d=n.route[e];if(r)if(d){let h,[u]=await Promise.all([c(d).catch(f=>{h=f}),r]);if(h!==void 0)throw h;o=u}else if(await r,d=n.route[e],d)o=await c(d);else if(e==="action"){let h=new URL(t.url),u=h.pathname+h.search;throw Wo(405,{method:t.method,pathname:u,routeId:n.route.id})}else return{type:er.data,result:void 0};else if(d)o=await c(d);else{let h=new URL(t.url),u=h.pathname+h.search;throw Wo(404,{pathname:u})}sn(o.result!==void 0,"You defined "+(e==="action"?"an action":"a loader")+" for route "+('"'+n.route.id+"\" but didn't return anything from your `"+e+"` ")+"function. Please return a value or `null`.")}catch(d){return{type:er.error,result:d}}finally{a&&t.signal.removeEventListener("abort",a)}return o}async function Y2e(e){let{result:t,type:n}=e;if(kce(t)){let u;try{let f=t.headers.get("Content-Type");f&&/\bapplication\/json\b/.test(f)?t.body==null?u=null:u=await t.json():u=await t.text()}catch(f){return{type:er.error,error:f}}return n===er.error?{type:er.error,error:new HT(t.status,t.statusText,u),statusCode:t.status,headers:t.headers}:{type:er.data,data:u,statusCode:t.status,headers:t.headers}}if(n===er.error){if(q7(t)){var r,s;if(t.data instanceof Error){var i,o;return{type:er.error,error:t.data,statusCode:(i=t.init)==null?void 0:i.status,headers:(o=t.init)!=null&&o.headers?new Headers(t.init.headers):void 0}}return{type:er.error,error:new HT(((r=t.init)==null?void 0:r.status)||500,void 0,t.data),statusCode:DC(t)?t.status:void 0,headers:(s=t.init)!=null&&s.headers?new Headers(t.init.headers):void 0}}return{type:er.error,error:t,statusCode:DC(t)?t.status:void 0}}if(e$e(t)){var a,c;return{type:er.deferred,deferredData:t,statusCode:(a=t.init)==null?void 0:a.status,headers:((c=t.init)==null?void 0:c.headers)&&new Headers(t.init.headers)}}if(q7(t)){var d,h;return{type:er.data,data:t.data,statusCode:(d=t.init)==null?void 0:d.status,headers:(h=t.init)!=null&&h.headers?new Headers(t.init.headers):void 0}}return{type:er.data,data:t}}function X2e(e,t,n,r,s,i){let o=e.headers.get("Location");if(sn(o,"Redirects returned/thrown from loaders/actions must have a Location header"),!tW.test(o)){let a=r.slice(0,r.findIndex(c=>c.route.id===n)+1);o=TU(new URL(t.url),a,s,!0,o,i),e.headers.set("Location",o)}return e}function z7(e,t,n){if(tW.test(e)){let r=e,s=r.startsWith("//")?new URL(t.protocol+r):new URL(r),i=yp(s.pathname,n)!=null;if(s.origin===t.origin&&i)return s.pathname+s.search+s.hash}return e}function zy(e,t,n,r){let s=e.createURL(Tce(t)).toString(),i={signal:n};if(r&&fc(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=DU(r.formData):i.body=r.formData}return new Request(s,i)}function DU(e){let t=new URLSearchParams;for(let[n,r]of e.entries())t.append(n,typeof r=="string"?r:r.name);return t}function B7(e){let t=new FormData;for(let[n,r]of e.entries())t.append(n,r);return t}function Q2e(e,t,n,r,s){let i={},o=null,a,c=!1,d={},h=n&&Va(n[1])?n[1].error:void 0;return e.forEach(u=>{if(!(u.route.id in t))return;let f=u.route.id,g=t[f];if(sn(!pg(g),"Cannot handle redirect results in processLoaderData"),Va(g)){let v=g.error;h!==void 0&&(v=h,h=void 0),o=o||{};{let m=og(e,f);o[m.route.id]==null&&(o[m.route.id]=v)}i[f]=void 0,c||(c=!0,a=DC(g.error)?g.error.status:500),g.headers&&(d[f]=g.headers)}else Zh(g)?(r.set(f,g.deferredData),i[f]=g.deferredData.data,g.statusCode!=null&&g.statusCode!==200&&!c&&(a=g.statusCode),g.headers&&(d[f]=g.headers)):(i[f]=g.data,g.statusCode&&g.statusCode!==200&&!c&&(a=g.statusCode),g.headers&&(d[f]=g.headers))}),h!==void 0&&n&&(o={[n[0]]:h},i[n[0]]=void 0),{loaderData:i,errors:o,statusCode:a||200,loaderHeaders:d}}function U7(e,t,n,r,s,i,o){let{loaderData:a,errors:c}=Q2e(t,n,r,o);return s.forEach(d=>{let{key:h,match:u,controller:f}=d,g=i[h];if(sn(g,"Did not find corresponding fetcher result"),!(f&&f.signal.aborted))if(Va(g)){let v=og(e.matches,u==null?void 0:u.route.id);c&&c[v.route.id]||(c=qr({},c,{[v.route.id]:g.error})),e.fetchers.delete(h)}else if(pg(g))sn(!1,"Unhandled fetcher revalidation redirect");else if(Zh(g))sn(!1,"Unhandled fetcher deferred data");else{let v=sh(g.data);e.fetchers.set(h,v)}}),{loaderData:a,errors:c}}function V7(e,t,n,r){let s=qr({},t);for(let i of n){let o=i.route.id;if(t.hasOwnProperty(o)?t[o]!==void 0&&(s[o]=t[o]):e[o]!==void 0&&i.route.loader&&(s[o]=e[o]),r&&r.hasOwnProperty(o))break}return s}function H7(e){return e?Va(e[1])?{actionData:{}}:{actionData:{[e[0]]:e[1].data}}:{}}function og(e,t){return(t?e.slice(0,e.findIndex(r=>r.route.id===t)+1):[...e]).reverse().find(r=>r.route.hasErrorBoundary===!0)||e[0]}function W7(e){let t=e.length===1?e[0]:e.find(n=>n.index||!n.path||n.path==="/")||{id:"__shim-error-route__"};return{matches:[{params:{},pathname:"",pathnameBase:"",route:t}],route:t}}function Wo(e,t){let{pathname:n,routeId:r,method:s,type:i,message:o}=t===void 0?{}:t,a="Unknown Server Error",c="Unknown @remix-run/router error";return e===400?(a="Bad Request",s&&n&&r?c="You made a "+s+' request to "'+n+'" but '+('did not provide a `loader` for route "'+r+'", ')+"so there is no way to handle the request.":i==="defer-action"?c="defer() is not supported in actions":i==="invalid-body"&&(c="Unable to encode submission body")):e===403?(a="Forbidden",c='Route "'+r+'" does not match URL "'+n+'"'):e===404?(a="Not Found",c='No route matches URL "'+n+'"'):e===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 HT(e||500,a,new Error(c),!0)}function mP(e){let t=Object.entries(e);for(let n=t.length-1;n>=0;n--){let[r,s]=t[n];if(pg(s))return{key:r,result:s}}}function Tce(e){let t=typeof e=="string"?Dp(e):e;return Kv(qr({},t,{hash:""}))}function Z2e(e,t){return e.pathname!==t.pathname||e.search!==t.search?!1:e.hash===""?t.hash!=="":e.hash===t.hash?!0:t.hash!==""}function J2e(e){return kce(e.result)&&$2e.has(e.result.status)}function Zh(e){return e.type===er.deferred}function Va(e){return e.type===er.error}function pg(e){return(e&&e.type)===er.redirect}function q7(e){return typeof e=="object"&&e!=null&&"type"in e&&"data"in e&&"init"in e&&e.type==="DataWithResponseInit"}function e$e(e){let t=e;return t&&typeof t=="object"&&typeof t.data=="object"&&typeof t.subscribe=="function"&&typeof t.cancel=="function"&&typeof t.resolveData=="function"}function kce(e){return e!=null&&typeof e.status=="number"&&typeof e.statusText=="string"&&typeof e.headers=="object"&&typeof e.body<"u"}function t$e(e){return j2e.has(e.toLowerCase())}function fc(e){return I2e.has(e.toLowerCase())}async function n$e(e,t,n,r,s){let i=Object.entries(t);for(let o=0;o<i.length;o++){let[a,c]=i[o],d=e.find(f=>(f==null?void 0:f.route.id)===a);if(!d)continue;let h=r.find(f=>f.route.id===d.route.id),u=h!=null&&!Pce(h,d)&&(s&&s[d.route.id])!==void 0;Zh(c)&&u&&await nW(c,n,!1).then(f=>{f&&(t[a]=f)})}}async function r$e(e,t,n){for(let r=0;r<n.length;r++){let{key:s,routeId:i,controller:o}=n[r],a=t[s];e.find(d=>(d==null?void 0:d.route.id)===i)&&Zh(a)&&(sn(o,"Expected an AbortController for revalidating fetcher deferred result"),await nW(a,o.signal,!0).then(d=>{d&&(t[s]=d)}))}}async function nW(e,t,n){if(n===void 0&&(n=!1),!await e.deferredData.resolveData(t)){if(n)try{return{type:er.data,data:e.deferredData.unwrappedData}}catch(s){return{type:er.error,error:s}}return{type:er.data,data:e.deferredData.data}}}function rW(e){return new URLSearchParams(e).getAll("index").some(t=>t==="")}function f1(e,t){let n=typeof t=="string"?Dp(t).search:t.search;if(e[e.length-1].route.index&&rW(n||""))return e[e.length-1];let r=Ece(e);return r[r.length-1]}function G7(e){let{formMethod:t,formAction:n,formEncType:r,text:s,formData:i,json:o}=e;if(!(!t||!n||!r)){if(s!=null)return{formMethod:t,formAction:n,formEncType:r,formData:void 0,json:void 0,text:s};if(i!=null)return{formMethod:t,formAction:n,formEncType:r,formData:i,json:void 0,text:void 0};if(o!==void 0)return{formMethod:t,formAction:n,formEncType:r,formData:void 0,json:o,text:void 0}}}function j4(e,t){return t?{state:"loading",location:e,formMethod:t.formMethod,formAction:t.formAction,formEncType:t.formEncType,formData:t.formData,json:t.json,text:t.text}:{state:"loading",location:e,formMethod:void 0,formAction:void 0,formEncType:void 0,formData:void 0,json:void 0,text:void 0}}function s$e(e,t){return{state:"submitting",location:e,formMethod:t.formMethod,formAction:t.formAction,formEncType:t.formEncType,formData:t.formData,json:t.json,text:t.text}}function HS(e,t){return e?{state:"loading",formMethod:e.formMethod,formAction:e.formAction,formEncType:e.formEncType,formData:e.formData,json:e.json,text:e.text,data:t}:{state:"loading",formMethod:void 0,formAction:void 0,formEncType:void 0,formData:void 0,json:void 0,text:void 0,data:t}}function i$e(e,t){return{state:"submitting",formMethod:e.formMethod,formAction:e.formAction,formEncType:e.formEncType,formData:e.formData,json:e.json,text:e.text,data:t?t.data:void 0}}function sh(e){return{state:"idle",formMethod:void 0,formAction:void 0,formEncType:void 0,formData:void 0,json:void 0,text:void 0,data:e}}function o$e(e,t){try{let n=e.sessionStorage.getItem(Rce);if(n){let r=JSON.parse(n);for(let[s,i]of Object.entries(r||{}))i&&Array.isArray(i)&&t.set(s,new Set(i||[]))}}catch{}}function a$e(e,t){if(t.size>0){let n={};for(let[r,s]of t)n[r]=[...s];try{e.sessionStorage.setItem(Rce,JSON.stringify(n))}catch(r){hx(!1,"Failed to save applied view transitions in sessionStorage ("+r+").")}}}/**
|
||
* React Router v6.30.0
|
||
*
|
||
* Copyright (c) Remix Software Inc.
|
||
*
|
||
* This source code is licensed under the MIT license found in the
|
||
* LICENSE.md file in the root directory of this source tree.
|
||
*
|
||
* @license MIT
|
||
*/function px(){return px=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},px.apply(this,arguments)}const SO=C.createContext(null),Dce=C.createContext(null),Op=C.createContext(null),sW=C.createContext(null),zu=C.createContext({outlet:null,matches:[],isDataRoute:!1}),Oce=C.createContext(null);function l$e(e,t){let{relative:n}=t===void 0?{}:t;Xx()||sn(!1);let{basename:r,navigator:s}=C.useContext(Op),{hash:i,pathname:o,search:a}=Ice(e,{relative:n}),c=o;return r!=="/"&&(c=o==="/"?r:Af([r,o])),s.createHref({pathname:c,search:a,hash:i})}function Xx(){return C.useContext(sW)!=null}function Mp(){return Xx()||sn(!1),C.useContext(sW).location}function Mce(e){C.useContext(Op).static||C.useLayoutEffect(e)}function io(){let{isDataRoute:e}=C.useContext(zu);return e?S$e():c$e()}function c$e(){Xx()||sn(!1);let e=C.useContext(SO),{basename:t,future:n,navigator:r}=C.useContext(Op),{matches:s}=C.useContext(zu),{pathname:i}=Mp(),o=JSON.stringify(_O(s,n.v7_relativeSplatPath)),a=C.useRef(!1);return Mce(()=>{a.current=!0}),C.useCallback(function(d,h){if(h===void 0&&(h={}),!a.current)return;if(typeof d=="number"){r.go(d);return}let u=wO(d,JSON.parse(o),i,h.relative==="path");e==null&&t!=="/"&&(u.pathname=u.pathname==="/"?t:Af([t,u.pathname])),(h.replace?r.replace:r.push)(u,h.state,h)},[t,r,o,i,e])}const u$e=C.createContext(null);function d$e(e){let t=C.useContext(zu).outlet;return t&&C.createElement(u$e.Provider,{value:e},t)}function f$e(){let{matches:e}=C.useContext(zu),t=e[e.length-1];return t?t.params:{}}function Ice(e,t){let{relative:n}=t===void 0?{}:t,{future:r}=C.useContext(Op),{matches:s}=C.useContext(zu),{pathname:i}=Mp(),o=JSON.stringify(_O(s,r.v7_relativeSplatPath));return C.useMemo(()=>wO(e,JSON.parse(o),i,n==="path"),[e,o,i,n])}function h$e(e,t,n,r){Xx()||sn(!1);let{navigator:s,static:i}=C.useContext(Op),{matches:o}=C.useContext(zu),a=o[o.length-1],c=a?a.params:{};a&&a.pathname;let d=a?a.pathnameBase:"/";a&&a.route;let h=Mp(),u;u=h;let f=u.pathname||"/",g=f;if(d!=="/"){let x=d.replace(/^\//,"").split("/");g="/"+f.replace(/^\//,"").split("/").slice(x.length).join("/")}let v=!i&&n&&n.matches&&n.matches.length>0?n.matches:ig(e,{pathname:g});return y$e(v&&v.map(x=>Object.assign({},x,{params:Object.assign({},c,x.params),pathname:Af([d,s.encodeLocation?s.encodeLocation(x.pathname).pathname:x.pathname]),pathnameBase:x.pathnameBase==="/"?d:Af([d,s.encodeLocation?s.encodeLocation(x.pathnameBase).pathname:x.pathnameBase])})),o,n,r)}function p$e(){let e=x$e(),t=DC(e)?e.status+" "+e.statusText:e instanceof Error?e.message:JSON.stringify(e),n=e instanceof Error?e.stack:null,s={padding:"0.5rem",backgroundColor:"rgba(200,200,200, 0.5)"};return C.createElement(C.Fragment,null,C.createElement("h2",null,"Unexpected Application Error!"),C.createElement("h3",{style:{fontStyle:"italic"}},t),n?C.createElement("pre",{style:s},n):null,null)}const m$e=C.createElement(p$e,null);class g$e extends C.Component{constructor(t){super(t),this.state={location:t.location,revalidation:t.revalidation,error:t.error}}static getDerivedStateFromError(t){return{error:t}}static getDerivedStateFromProps(t,n){return n.location!==t.location||n.revalidation!=="idle"&&t.revalidation==="idle"?{error:t.error,location:t.location,revalidation:t.revalidation}:{error:t.error!==void 0?t.error:n.error,location:n.location,revalidation:t.revalidation||n.revalidation}}componentDidCatch(t,n){console.error("React Router caught the following error during render",t,n)}render(){return this.state.error!==void 0?C.createElement(zu.Provider,{value:this.props.routeContext},C.createElement(Oce.Provider,{value:this.state.error,children:this.props.component})):this.props.children}}function v$e(e){let{routeContext:t,match:n,children:r}=e,s=C.useContext(SO);return s&&s.static&&s.staticContext&&(n.route.errorElement||n.route.ErrorBoundary)&&(s.staticContext._deepestRenderedBoundaryId=n.route.id),C.createElement(zu.Provider,{value:t},r)}function y$e(e,t,n,r){var s;if(t===void 0&&(t=[]),n===void 0&&(n=null),r===void 0&&(r=null),e==null){var i;if(!n)return null;if(n.errors)e=n.matches;else if((i=r)!=null&&i.v7_partialHydration&&t.length===0&&!n.initialized&&n.matches.length>0)e=n.matches;else return null}let o=e,a=(s=n)==null?void 0:s.errors;if(a!=null){let h=o.findIndex(u=>u.route.id&&(a==null?void 0:a[u.route.id])!==void 0);h>=0||sn(!1),o=o.slice(0,Math.min(o.length,h+1))}let c=!1,d=-1;if(n&&r&&r.v7_partialHydration)for(let h=0;h<o.length;h++){let u=o[h];if((u.route.HydrateFallback||u.route.hydrateFallbackElement)&&(d=h),u.route.id){let{loaderData:f,errors:g}=n,v=u.route.loader&&f[u.route.id]===void 0&&(!g||g[u.route.id]===void 0);if(u.route.lazy||v){c=!0,d>=0?o=o.slice(0,d+1):o=[o[0]];break}}}return o.reduceRight((h,u,f)=>{let g,v=!1,m=null,x=null;n&&(g=a&&u.route.id?a[u.route.id]:void 0,m=u.route.errorElement||m$e,c&&(d<0&&f===0?(C$e("route-fallback"),v=!0,x=null):d===f&&(v=!0,x=u.route.hydrateFallbackElement||null)));let y=t.concat(o.slice(0,f+1)),b=()=>{let w;return g?w=m:v?w=x:u.route.Component?w=C.createElement(u.route.Component,null):u.route.element?w=u.route.element:w=h,C.createElement(v$e,{match:u,routeContext:{outlet:h,matches:y,isDataRoute:n!=null},children:w})};return n&&(u.route.ErrorBoundary||u.route.errorElement||f===0)?C.createElement(g$e,{location:n.location,revalidation:n.revalidation,component:m,error:g,children:b(),routeContext:{outlet:null,matches:y,isDataRoute:!0}}):b()},null)}var Lce=function(e){return e.UseBlocker="useBlocker",e.UseRevalidator="useRevalidator",e.UseNavigateStable="useNavigate",e}(Lce||{}),jce=function(e){return e.UseBlocker="useBlocker",e.UseLoaderData="useLoaderData",e.UseActionData="useActionData",e.UseRouteError="useRouteError",e.UseNavigation="useNavigation",e.UseRouteLoaderData="useRouteLoaderData",e.UseMatches="useMatches",e.UseRevalidator="useRevalidator",e.UseNavigateStable="useNavigate",e.UseRouteId="useRouteId",e}(jce||{});function $ce(e){let t=C.useContext(SO);return t||sn(!1),t}function Fce(e){let t=C.useContext(Dce);return t||sn(!1),t}function b$e(e){let t=C.useContext(zu);return t||sn(!1),t}function zce(e){let t=b$e(),n=t.matches[t.matches.length-1];return n.route.id||sn(!1),n.route.id}function x$e(){var e;let t=C.useContext(Oce),n=Fce(),r=zce();return t!==void 0?t:(e=n.errors)==null?void 0:e[r]}let _$e=0;function w$e(e){let{router:t,basename:n}=$ce(),r=Fce(),[s,i]=C.useState(""),o=C.useCallback(a=>{if(typeof e!="function")return!!e;if(n==="/")return e(a);let{currentLocation:c,nextLocation:d,historyAction:h}=a;return e({currentLocation:px({},c,{pathname:yp(c.pathname,n)||c.pathname}),nextLocation:px({},d,{pathname:yp(d.pathname,n)||d.pathname}),historyAction:h})},[n,e]);return C.useEffect(()=>{let a=String(++_$e);return i(a),()=>t.deleteBlocker(a)},[t]),C.useEffect(()=>{s!==""&&t.getBlocker(s,o)},[t,s,o]),s&&r.blockers.has(s)?r.blockers.get(s):Qy}function S$e(){let{router:e}=$ce(Lce.UseNavigateStable),t=zce(jce.UseNavigateStable),n=C.useRef(!1);return Mce(()=>{n.current=!0}),C.useCallback(function(s,i){i===void 0&&(i={}),n.current&&(typeof s=="number"?e.navigate(s):e.navigate(s,px({fromRouteId:t},i)))},[e,t])}const K7={};function C$e(e,t,n){K7[e]||(K7[e]=!0)}function E$e(e,t){e==null||e.v7_startTransition,(e==null?void 0:e.v7_relativeSplatPath)===void 0&&(!t||t.v7_relativeSplatPath),t&&(t.v7_fetcherPersist,t.v7_normalizeFormMethod,t.v7_partialHydration,t.v7_skipActionErrorRevalidation)}function Bce(e){let{to:t,replace:n,state:r,relative:s}=e;Xx()||sn(!1);let{future:i,static:o}=C.useContext(Op),{matches:a}=C.useContext(zu),{pathname:c}=Mp(),d=io(),h=wO(t,_O(a,i.v7_relativeSplatPath),c,s==="path"),u=JSON.stringify(h);return C.useEffect(()=>d(JSON.parse(u),{replace:n,state:r,relative:s}),[d,u,s,n,r]),null}function gP(e){return d$e(e.context)}function A$e(e){let{basename:t="/",children:n=null,location:r,navigationType:s=Ns.Pop,navigator:i,static:o=!1,future:a}=e;Xx()&&sn(!1);let c=t.replace(/^\/*/,"/"),d=C.useMemo(()=>({basename:c,navigator:i,static:o,future:px({v7_relativeSplatPath:!1},a)}),[c,a,i,o]);typeof r=="string"&&(r=Dp(r));let{pathname:h="/",search:u="",hash:f="",state:g=null,key:v="default"}=r,m=C.useMemo(()=>{let x=yp(h,c);return x==null?null:{location:{pathname:x,search:u,hash:f,state:g,key:v},navigationType:s}},[c,h,u,f,g,v,s]);return m==null?null:C.createElement(Op.Provider,{value:d},C.createElement(sW.Provider,{children:n,value:m}))}new Promise(()=>{});function R$e(e){let t={hasErrorBoundary:e.ErrorBoundary!=null||e.errorElement!=null};return e.Component&&Object.assign(t,{element:C.createElement(e.Component),Component:void 0}),e.HydrateFallback&&Object.assign(t,{hydrateFallbackElement:C.createElement(e.HydrateFallback),HydrateFallback:void 0}),e.ErrorBoundary&&Object.assign(t,{errorElement:C.createElement(e.ErrorBoundary),ErrorBoundary:void 0}),t}/**
|
||
* React Router DOM v6.30.0
|
||
*
|
||
* Copyright (c) Remix Software Inc.
|
||
*
|
||
* This source code is licensed under the MIT license found in the
|
||
* LICENSE.md file in the root directory of this source tree.
|
||
*
|
||
* @license MIT
|
||
*/function OC(){return OC=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},OC.apply(this,arguments)}function P$e(e,t){if(e==null)return{};var n={},r=Object.keys(e),s,i;for(i=0;i<r.length;i++)s=r[i],!(t.indexOf(s)>=0)&&(n[s]=e[s]);return n}function N$e(e){return!!(e.metaKey||e.altKey||e.ctrlKey||e.shiftKey)}function T$e(e,t){return e.button===0&&(!t||t==="_self")&&!N$e(e)}function OU(e){return e===void 0&&(e=""),new URLSearchParams(typeof e=="string"||Array.isArray(e)||e instanceof URLSearchParams?e:Object.keys(e).reduce((t,n)=>{let r=e[n];return t.concat(Array.isArray(r)?r.map(s=>[n,s]):[[n,r]])},[]))}function k$e(e,t){let n=OU(e);return t&&t.forEach((r,s)=>{n.has(s)||t.getAll(s).forEach(i=>{n.append(s,i)})}),n}const D$e=["onClick","relative","reloadDocument","replace","state","target","to","preventScrollReset","viewTransition"],O$e="6";try{window.__reactRouterVersion=O$e}catch{}function M$e(e,t){return U2e({basename:t==null?void 0:t.basename,future:OC({},t==null?void 0:t.future,{v7_prependBasename:!0}),history:f2e({window:t==null?void 0:t.window}),hydrationData:(t==null?void 0:t.hydrationData)||I$e(),routes:e,mapRouteProperties:R$e,dataStrategy:t==null?void 0:t.dataStrategy,patchRoutesOnNavigation:t==null?void 0:t.patchRoutesOnNavigation,window:t==null?void 0:t.window}).initialize()}function I$e(){var e;let t=(e=window)==null?void 0:e.__staticRouterHydrationData;return t&&t.errors&&(t=OC({},t,{errors:L$e(t.errors)})),t}function L$e(e){if(!e)return null;let t=Object.entries(e),n={};for(let[r,s]of t)if(s&&s.__type==="RouteErrorResponse")n[r]=new HT(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 j$e=C.createContext({isTransitioning:!1}),$$e=C.createContext(new Map),F$e="startTransition",Y7=Tv[F$e],z$e="flushSync",X7=xve[z$e];function B$e(e){Y7?Y7(e):e()}function WS(e){X7?X7(e):e()}class U$e{constructor(){this.status="pending",this.promise=new Promise((t,n)=>{this.resolve=r=>{this.status==="pending"&&(this.status="resolved",t(r))},this.reject=r=>{this.status==="pending"&&(this.status="rejected",n(r))}})}}function V$e(e){let{fallbackElement:t,router:n,future:r}=e,[s,i]=C.useState(n.state),[o,a]=C.useState(),[c,d]=C.useState({isTransitioning:!1}),[h,u]=C.useState(),[f,g]=C.useState(),[v,m]=C.useState(),x=C.useRef(new Map),{v7_startTransition:y}=r||{},b=C.useCallback(A=>{y?B$e(A):A()},[y]),w=C.useCallback((A,D)=>{let{deletedFetchers:O,flushSync:I,viewTransitionOpts:$}=D;A.fetchers.forEach((B,W)=>{B.data!==void 0&&x.current.set(W,B.data)}),O.forEach(B=>x.current.delete(B));let F=n.window==null||n.window.document==null||typeof n.window.document.startViewTransition!="function";if(!$||F){I?WS(()=>i(A)):b(()=>i(A));return}if(I){WS(()=>{f&&(h&&h.resolve(),f.skipTransition()),d({isTransitioning:!0,flushSync:!0,currentLocation:$.currentLocation,nextLocation:$.nextLocation})});let B=n.window.document.startViewTransition(()=>{WS(()=>i(A))});B.finished.finally(()=>{WS(()=>{u(void 0),g(void 0),a(void 0),d({isTransitioning:!1})})}),WS(()=>g(B));return}f?(h&&h.resolve(),f.skipTransition(),m({state:A,currentLocation:$.currentLocation,nextLocation:$.nextLocation})):(a(A),d({isTransitioning:!0,flushSync:!1,currentLocation:$.currentLocation,nextLocation:$.nextLocation}))},[n.window,f,h,x,b]);C.useLayoutEffect(()=>n.subscribe(w),[n,w]),C.useEffect(()=>{c.isTransitioning&&!c.flushSync&&u(new U$e)},[c]),C.useEffect(()=>{if(h&&o&&n.window){let A=o,D=h.promise,O=n.window.document.startViewTransition(async()=>{b(()=>i(A)),await D});O.finished.finally(()=>{u(void 0),g(void 0),a(void 0),d({isTransitioning:!1})}),g(O)}},[b,o,h,n.window]),C.useEffect(()=>{h&&o&&s.location.key===o.location.key&&h.resolve()},[h,f,s.location,o]),C.useEffect(()=>{!c.isTransitioning&&v&&(a(v.state),d({isTransitioning:!0,flushSync:!1,currentLocation:v.currentLocation,nextLocation:v.nextLocation}),m(void 0))},[c.isTransitioning,v]),C.useEffect(()=>{},[]);let E=C.useMemo(()=>({createHref:n.createHref,encodeLocation:n.encodeLocation,go:A=>n.navigate(A),push:(A,D,O)=>n.navigate(A,{state:D,preventScrollReset:O==null?void 0:O.preventScrollReset}),replace:(A,D,O)=>n.navigate(A,{replace:!0,state:D,preventScrollReset:O==null?void 0:O.preventScrollReset})}),[n]),R=n.basename||"/",T=C.useMemo(()=>({router:n,navigator:E,static:!1,basename:R}),[n,E,R]),N=C.useMemo(()=>({v7_relativeSplatPath:n.future.v7_relativeSplatPath}),[n.future.v7_relativeSplatPath]);return C.useEffect(()=>E$e(r,n.future),[r,n.future]),C.createElement(C.Fragment,null,C.createElement(SO.Provider,{value:T},C.createElement(Dce.Provider,{value:s},C.createElement($$e.Provider,{value:x.current},C.createElement(j$e.Provider,{value:c},C.createElement(A$e,{basename:R,location:s.location,navigationType:s.historyAction,navigator:E,future:N},s.initialized||n.future.v7_partialHydration?C.createElement(H$e,{routes:n.routes,future:n.future,state:s}):t))))),null)}const H$e=C.memo(W$e);function W$e(e){let{routes:t,future:n,state:r}=e;return h$e(t,void 0,r,n)}const q$e=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u",G$e=/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i,bf=C.forwardRef(function(t,n){let{onClick:r,relative:s,reloadDocument:i,replace:o,state:a,target:c,to:d,preventScrollReset:h,viewTransition:u}=t,f=P$e(t,D$e),{basename:g}=C.useContext(Op),v,m=!1;if(typeof d=="string"&&G$e.test(d)&&(v=d,q$e))try{let w=new URL(window.location.href),E=d.startsWith("//")?new URL(w.protocol+d):new URL(d),R=yp(E.pathname,g);E.origin===w.origin&&R!=null?d=R+E.search+E.hash:m=!0}catch{}let x=l$e(d,{relative:s}),y=K$e(d,{replace:o,state:a,target:c,preventScrollReset:h,relative:s,viewTransition:u});function b(w){r&&r(w),w.defaultPrevented||y(w)}return C.createElement("a",OC({},f,{href:v||x,onClick:m||i?r:b,ref:n,target:c}))});var Q7;(function(e){e.UseScrollRestoration="useScrollRestoration",e.UseSubmit="useSubmit",e.UseSubmitFetcher="useSubmitFetcher",e.UseFetcher="useFetcher",e.useViewTransitionState="useViewTransitionState"})(Q7||(Q7={}));var Z7;(function(e){e.UseFetcher="useFetcher",e.UseFetchers="useFetchers",e.UseScrollRestoration="useScrollRestoration"})(Z7||(Z7={}));function K$e(e,t){let{target:n,replace:r,state:s,preventScrollReset:i,relative:o,viewTransition:a}=t===void 0?{}:t,c=io(),d=Mp(),h=Ice(e,{relative:o});return C.useCallback(u=>{if(T$e(u,n)){u.preventDefault();let f=r!==void 0?r:Kv(d)===Kv(h);c(e,{replace:f,state:s,preventScrollReset:i,relative:o,viewTransition:a})}},[d,c,h,r,s,n,e,i,o,a])}function Y$e(e){let t=C.useRef(OU(e)),n=C.useRef(!1),r=Mp(),s=C.useMemo(()=>k$e(r.search,n.current?null:t.current),[r.search]),i=io(),o=C.useCallback((a,c)=>{const d=OU(typeof a=="function"?a(s):a);n.current=!0,i("?"+d,c)},[i,s]);return[s,o]}const Uce=({isOpen:e,onCancel:t,onConfirm:n,title:r,description:s,cancelLabel:i,confirmLabel:o})=>_.jsx(JH,{open:e,children:_.jsxs(pD,{children:[_.jsxs(mD,{children:[_.jsx(vD,{children:r}),_.jsx(yD,{children:s})]}),_.jsxs(gD,{children:[_.jsx(xD,{children:_.jsx(bf,{to:"#",onClick:t,children:i})}),_.jsx(bD,{children:_.jsx(bf,{to:"#",onClick:n,children:o})})]})]})}),Bt=e=>typeof e=="string",qS=()=>{let e,t;const n=new Promise((r,s)=>{e=r,t=s});return n.resolve=e,n.reject=t,n},J7=e=>e==null?"":""+e,X$e=(e,t,n)=>{e.forEach(r=>{t[r]&&(n[r]=t[r])})},Q$e=/###/g,eK=e=>e&&e.indexOf("###")>-1?e.replace(Q$e,"."):e,tK=e=>!e||Bt(e),B1=(e,t,n)=>{const r=Bt(t)?t.split("."):t;let s=0;for(;s<r.length-1;){if(tK(e))return{};const i=eK(r[s]);!e[i]&&n&&(e[i]=new n),Object.prototype.hasOwnProperty.call(e,i)?e=e[i]:e={},++s}return tK(e)?{}:{obj:e,k:eK(r[s])}},nK=(e,t,n)=>{const{obj:r,k:s}=B1(e,t,Object);if(r!==void 0||t.length===1){r[s]=n;return}let i=t[t.length-1],o=t.slice(0,t.length-1),a=B1(e,o,Object);for(;a.obj===void 0&&o.length;)i=`${o[o.length-1]}.${i}`,o=o.slice(0,o.length-1),a=B1(e,o,Object),a&&a.obj&&typeof a.obj[`${a.k}.${i}`]<"u"&&(a.obj=void 0);a.obj[`${a.k}.${i}`]=n},Z$e=(e,t,n,r)=>{const{obj:s,k:i}=B1(e,t,Object);s[i]=s[i]||[],s[i].push(n)},WT=(e,t)=>{const{obj:n,k:r}=B1(e,t);if(n)return n[r]},J$e=(e,t,n)=>{const r=WT(e,n);return r!==void 0?r:WT(t,n)},Vce=(e,t,n)=>{for(const r in t)r!=="__proto__"&&r!=="constructor"&&(r in e?Bt(e[r])||e[r]instanceof String||Bt(t[r])||t[r]instanceof String?n&&(e[r]=t[r]):Vce(e[r],t[r],n):e[r]=t[r]);return e},By=e=>e.replace(/[\-\[\]\/\{\}\(\)\*\+\?\.\\\^\$\|]/g,"\\$&");var eFe={"&":"&","<":"<",">":">",'"':""","'":"'","/":"/"};const tFe=e=>Bt(e)?e.replace(/[&<>"'\/]/g,t=>eFe[t]):e;class nFe{constructor(t){this.capacity=t,this.regExpMap=new Map,this.regExpQueue=[]}getRegExp(t){const n=this.regExpMap.get(t);if(n!==void 0)return n;const r=new RegExp(t);return this.regExpQueue.length===this.capacity&&this.regExpMap.delete(this.regExpQueue.shift()),this.regExpMap.set(t,r),this.regExpQueue.push(t),r}}const rFe=[" ",",","?","!",";"],sFe=new nFe(20),iFe=(e,t,n)=>{t=t||"",n=n||"";const r=rFe.filter(o=>t.indexOf(o)<0&&n.indexOf(o)<0);if(r.length===0)return!0;const s=sFe.getRegExp(`(${r.map(o=>o==="?"?"\\?":o).join("|")})`);let i=!s.test(e);if(!i){const o=e.indexOf(n);o>0&&!s.test(e.substring(0,o))&&(i=!0)}return i},MU=function(e,t){let n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:".";if(!e)return;if(e[t])return e[t];const r=t.split(n);let s=e;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},qT=e=>e&&e.replace("_","-"),oFe={type:"logger",log(e){this.output("log",e)},warn(e){this.output("warn",e)},error(e){this.output("error",e)},output(e,t){console&&console[e]&&console[e].apply(console,t)}};class GT{constructor(t){let n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};this.init(t,n)}init(t){let n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};this.prefix=n.prefix||"i18next:",this.logger=t||oFe,this.options=n,this.debug=n.debug}log(){for(var t=arguments.length,n=new Array(t),r=0;r<t;r++)n[r]=arguments[r];return this.forward(n,"log","",!0)}warn(){for(var t=arguments.length,n=new Array(t),r=0;r<t;r++)n[r]=arguments[r];return this.forward(n,"warn","",!0)}error(){for(var t=arguments.length,n=new Array(t),r=0;r<t;r++)n[r]=arguments[r];return this.forward(n,"error","")}deprecate(){for(var t=arguments.length,n=new Array(t),r=0;r<t;r++)n[r]=arguments[r];return this.forward(n,"warn","WARNING DEPRECATED: ",!0)}forward(t,n,r,s){return s&&!this.debug?null:(Bt(t[0])&&(t[0]=`${r}${this.prefix} ${t[0]}`),this.logger[n](t))}create(t){return new GT(this.logger,{prefix:`${this.prefix}:${t}:`,...this.options})}clone(t){return t=t||this.options,t.prefix=t.prefix||this.prefix,new GT(this.logger,t)}}var bu=new GT;class CO{constructor(){this.observers={}}on(t,n){return t.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(t,n){if(this.observers[t]){if(!n){delete this.observers[t];return}this.observers[t].delete(n)}}emit(t){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[t]&&Array.from(this.observers[t].entries()).forEach(o=>{let[a,c]=o;for(let d=0;d<c;d++)a(...r)}),this.observers["*"]&&Array.from(this.observers["*"].entries()).forEach(o=>{let[a,c]=o;for(let d=0;d<c;d++)a.apply(a,[t,...r])})}}class rK extends CO{constructor(t){let n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{ns:["translation"],defaultNS:"translation"};super(),this.data=t||{},this.options=n,this.options.keySeparator===void 0&&(this.options.keySeparator="."),this.options.ignoreJSONStructure===void 0&&(this.options.ignoreJSONStructure=!0)}addNamespaces(t){this.options.ns.indexOf(t)<0&&this.options.ns.push(t)}removeNamespaces(t){const n=this.options.ns.indexOf(t);n>-1&&this.options.ns.splice(n,1)}getResource(t,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;t.indexOf(".")>-1?a=t.split("."):(a=[t,n],r&&(Array.isArray(r)?a.push(...r):Bt(r)&&i?a.push(...r.split(i)):a.push(r)));const c=WT(this.data,a);return!c&&!n&&!r&&t.indexOf(".")>-1&&(t=a[0],n=a[1],r=a.slice(2).join(".")),c||!o||!Bt(r)?c:MU(this.data&&this.data[t]&&this.data[t][n],r,i)}addResource(t,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=[t,n];r&&(a=a.concat(o?r.split(o):r)),t.indexOf(".")>-1&&(a=t.split("."),s=n,n=a[1]),this.addNamespaces(n),nK(this.data,a,s),i.silent||this.emit("added",t,n,r,s)}addResources(t,n,r){let s=arguments.length>3&&arguments[3]!==void 0?arguments[3]:{silent:!1};for(const i in r)(Bt(r[i])||Array.isArray(r[i]))&&this.addResource(t,n,i,r[i],{silent:!0});s.silent||this.emit("added",t,n,r)}addResourceBundle(t,n,r,s,i){let o=arguments.length>5&&arguments[5]!==void 0?arguments[5]:{silent:!1,skipCopy:!1},a=[t,n];t.indexOf(".")>-1&&(a=t.split("."),s=r,r=n,n=a[1]),this.addNamespaces(n);let c=WT(this.data,a)||{};o.skipCopy||(r=JSON.parse(JSON.stringify(r))),s?Vce(c,r,i):c={...c,...r},nK(this.data,a,c),o.silent||this.emit("added",t,n,r)}removeResourceBundle(t,n){this.hasResourceBundle(t,n)&&delete this.data[t][n],this.removeNamespaces(n),this.emit("removed",t,n)}hasResourceBundle(t,n){return this.getResource(t,n)!==void 0}getResourceBundle(t,n){return n||(n=this.options.defaultNS),this.options.compatibilityAPI==="v1"?{...this.getResource(t,n)}:this.getResource(t,n)}getDataByLanguage(t){return this.data[t]}hasLanguageSomeTranslations(t){const n=this.getDataByLanguage(t);return!!(n&&Object.keys(n)||[]).find(s=>n[s]&&Object.keys(n[s]).length>0)}toJSON(){return this.data}}var Hce={processors:{},addPostProcessor(e){this.processors[e.name]=e},handle(e,t,n,r,s){return e.forEach(i=>{this.processors[i]&&(t=this.processors[i].process(t,n,r,s))}),t}};const sK={};class KT extends CO{constructor(t){let n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};super(),X$e(["resourceStore","languageUtils","pluralResolver","interpolator","backendConnector","i18nFormat","utils"],t,this),this.options=n,this.options.keySeparator===void 0&&(this.options.keySeparator="."),this.logger=bu.create("translator")}changeLanguage(t){t&&(this.language=t)}exists(t){let n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{interpolation:{}};if(t==null)return!1;const r=this.resolve(t,n);return r&&r.res!==void 0}extractFromKey(t,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&&t.indexOf(r)>-1,a=!this.options.userDefinedKeySeparator&&!n.keySeparator&&!this.options.userDefinedNsSeparator&&!n.nsSeparator&&!iFe(t,r,s);if(o&&!a){const c=t.match(this.interpolator.nestingRegexp);if(c&&c.length>0)return{key:t,namespaces:Bt(i)?[i]:i};const d=t.split(r);(r!==s||r===s&&this.options.ns.indexOf(d[0])>-1)&&(i=d.shift()),t=d.join(s)}return{key:t,namespaces:Bt(i)?[i]:i}}translate(t,n,r){if(typeof n!="object"&&this.options.overloadTranslationOptionHandler&&(n=this.options.overloadTranslationOptionHandler(arguments)),typeof n=="object"&&(n={...n}),n||(n={}),t==null)return"";Array.isArray(t)||(t=[String(t)]);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(t[t.length-1],n),c=a[a.length-1],d=n.lng||this.language,h=n.appendNamespaceToCIMode||this.options.appendNamespaceToCIMode;if(d&&d.toLowerCase()==="cimode"){if(h){const E=n.nsSeparator||this.options.nsSeparator;return s?{res:`${c}${E}${o}`,usedKey:o,exactUsedKey:o,usedLng:d,usedNS:c,usedParams:this.getUsedParamsDetails(n)}:`${c}${E}${o}`}return s?{res:o,usedKey:o,exactUsedKey:o,usedLng:d,usedNS:c,usedParams:this.getUsedParamsDetails(n)}:o}const u=this.resolve(t,n);let f=u&&u.res;const g=u&&u.usedKey||o,v=u&&u.exactUsedKey||o,m=Object.prototype.toString.apply(f),x=["[object Number]","[object Function]","[object RegExp]"],y=n.joinArrays!==void 0?n.joinArrays:this.options.joinArrays,b=!this.i18nFormat||this.i18nFormat.handleAsObject,w=!Bt(f)&&typeof f!="boolean"&&typeof f!="number";if(b&&f&&w&&x.indexOf(m)<0&&!(Bt(y)&&Array.isArray(f))){if(!n.returnObjects&&!this.options.returnObjects){this.options.returnedObjectHandler||this.logger.warn("accessing an object - but returnObjects options is not enabled!");const E=this.options.returnedObjectHandler?this.options.returnedObjectHandler(g,f,{...n,ns:a}):`key '${o} (${this.language})' returned an object instead of string.`;return s?(u.res=E,u.usedParams=this.getUsedParamsDetails(n),u):E}if(i){const E=Array.isArray(f),R=E?[]:{},T=E?v:g;for(const N in f)if(Object.prototype.hasOwnProperty.call(f,N)){const A=`${T}${i}${N}`;R[N]=this.translate(A,{...n,joinArrays:!1,ns:a}),R[N]===A&&(R[N]=f[N])}f=R}}else if(b&&Bt(y)&&Array.isArray(f))f=f.join(y),f&&(f=this.extendTranslation(f,t,n,r));else{let E=!1,R=!1;const T=n.count!==void 0&&!Bt(n.count),N=KT.hasDefaultValue(n),A=T?this.pluralResolver.getSuffix(d,n.count,n):"",D=n.ordinal&&T?this.pluralResolver.getSuffix(d,n.count,{ordinal:!1}):"",O=T&&!n.ordinal&&n.count===0&&this.pluralResolver.shouldUseIntlApi(),I=O&&n[`defaultValue${this.options.pluralSeparator}zero`]||n[`defaultValue${A}`]||n[`defaultValue${D}`]||n.defaultValue;!this.isValidLookup(f)&&N&&(E=!0,f=I),this.isValidLookup(f)||(R=!0,f=o);const F=(n.missingKeyNoValueFallbackToKey||this.options.missingKeyNoValueFallbackToKey)&&R?void 0:f,B=N&&I!==f&&this.options.updateMissing;if(R||E||B){if(this.logger.log(B?"updateKey":"missingKey",d,c,o,B?I:f),i){const H=this.resolve(o,{...n,keySeparator:!1});H&&H.res&&this.logger.warn("Seems the loaded translations were in flat JSON format instead of nested. Either set keySeparator: false on init or make sure your translations are published in nested format.")}let W=[];const Z=this.languageUtils.getFallbackCodes(this.options.fallbackLng,n.lng||this.language);if(this.options.saveMissingTo==="fallback"&&Z&&Z[0])for(let H=0;H<Z.length;H++)W.push(Z[H]);else this.options.saveMissingTo==="all"?W=this.languageUtils.toResolveHierarchy(n.lng||this.language):W.push(n.lng||this.language);const Y=(H,se,he)=>{const re=N&&he!==f?he:F;this.options.missingKeyHandler?this.options.missingKeyHandler(H,c,se,re,B,n):this.backendConnector&&this.backendConnector.saveMissing&&this.backendConnector.saveMissing(H,c,se,re,B,n),this.emit("missingKey",H,c,se,f)};this.options.saveMissing&&(this.options.saveMissingPlurals&&T?W.forEach(H=>{const se=this.pluralResolver.getSuffixes(H,n);O&&n[`defaultValue${this.options.pluralSeparator}zero`]&&se.indexOf(`${this.options.pluralSeparator}zero`)<0&&se.push(`${this.options.pluralSeparator}zero`),se.forEach(he=>{Y([H],o+he,n[`defaultValue${he}`]||I)})}):Y(W,o,I))}f=this.extendTranslation(f,t,n,u,r),R&&f===o&&this.options.appendNamespaceToMissingKey&&(f=`${c}:${o}`),(R||E)&&this.options.parseMissingKeyHandler&&(this.options.compatibilityAPI!=="v1"?f=this.options.parseMissingKeyHandler(this.options.appendNamespaceToMissingKey?`${c}:${o}`:o,E?f:void 0):f=this.options.parseMissingKeyHandler(f))}return s?(u.res=f,u.usedParams=this.getUsedParamsDetails(n),u):f}extendTranslation(t,n,r,s,i){var o=this;if(this.i18nFormat&&this.i18nFormat.parse)t=this.i18nFormat.parse(t,{...this.options.interpolation.defaultVariables,...r},r.lng||this.language||s.usedLng,s.usedNS,s.usedKey,{resolved:s});else if(!r.skipInterpolation){r.interpolation&&this.interpolator.init({...r,interpolation:{...this.options.interpolation,...r.interpolation}});const d=Bt(t)&&(r&&r.interpolation&&r.interpolation.skipOnVariables!==void 0?r.interpolation.skipOnVariables:this.options.interpolation.skipOnVariables);let h;if(d){const f=t.match(this.interpolator.nestingRegexp);h=f&&f.length}let u=r.replace&&!Bt(r.replace)?r.replace:r;if(this.options.interpolation.defaultVariables&&(u={...this.options.interpolation.defaultVariables,...u}),t=this.interpolator.interpolate(t,u,r.lng||this.language||s.usedLng,r),d){const f=t.match(this.interpolator.nestingRegexp),g=f&&f.length;h<g&&(r.nest=!1)}!r.lng&&this.options.compatibilityAPI!=="v1"&&s&&s.res&&(r.lng=this.language||s.usedLng),r.nest!==!1&&(t=this.interpolator.nest(t,function(){for(var f=arguments.length,g=new Array(f),v=0;v<f;v++)g[v]=arguments[v];return i&&i[0]===g[0]&&!r.context?(o.logger.warn(`It seems you are nesting recursively key: ${g[0]} in key: ${n[0]}`),null):o.translate(...g,n)},r)),r.interpolation&&this.interpolator.reset()}const a=r.postProcess||this.options.postProcess,c=Bt(a)?[a]:a;return t!=null&&c&&c.length&&r.applyPostProcessor!==!1&&(t=Hce.handle(c,t,n,this.options&&this.options.postProcessPassResolved?{i18nResolved:{...s,usedParams:this.getUsedParamsDetails(r)},...r}:r,this)),t}resolve(t){let n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},r,s,i,o,a;return Bt(t)&&(t=[t]),t.forEach(c=>{if(this.isValidLookup(r))return;const d=this.extractFromKey(c,n),h=d.key;s=h;let u=d.namespaces;this.options.fallbackNS&&(u=u.concat(this.options.fallbackNS));const f=n.count!==void 0&&!Bt(n.count),g=f&&!n.ordinal&&n.count===0&&this.pluralResolver.shouldUseIntlApi(),v=n.context!==void 0&&(Bt(n.context)||typeof n.context=="number")&&n.context!=="",m=n.lngs?n.lngs:this.languageUtils.toResolveHierarchy(n.lng||this.language,n.fallbackLng);u.forEach(x=>{this.isValidLookup(r)||(a=x,!sK[`${m[0]}-${x}`]&&this.utils&&this.utils.hasLoadedNamespace&&!this.utils.hasLoadedNamespace(a)&&(sK[`${m[0]}-${x}`]=!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(y=>{if(this.isValidLookup(r))return;o=y;const b=[h];if(this.i18nFormat&&this.i18nFormat.addLookupKeys)this.i18nFormat.addLookupKeys(b,h,y,x,n);else{let E;f&&(E=this.pluralResolver.getSuffix(y,n.count,n));const R=`${this.options.pluralSeparator}zero`,T=`${this.options.pluralSeparator}ordinal${this.options.pluralSeparator}`;if(f&&(b.push(h+E),n.ordinal&&E.indexOf(T)===0&&b.push(h+E.replace(T,this.options.pluralSeparator)),g&&b.push(h+R)),v){const N=`${h}${this.options.contextSeparator}${n.context}`;b.push(N),f&&(b.push(N+E),n.ordinal&&E.indexOf(T)===0&&b.push(N+E.replace(T,this.options.pluralSeparator)),g&&b.push(N+R))}}let w;for(;w=b.pop();)this.isValidLookup(r)||(i=w,r=this.getResource(y,x,w,n))}))})}),{res:r,usedKey:s,exactUsedKey:i,usedLng:o,usedNS:a}}isValidLookup(t){return t!==void 0&&!(!this.options.returnNull&&t===null)&&!(!this.options.returnEmptyString&&t==="")}getResource(t,n,r){let s=arguments.length>3&&arguments[3]!==void 0?arguments[3]:{};return this.i18nFormat&&this.i18nFormat.getResource?this.i18nFormat.getResource(t,n,r,s):this.resourceStore.getResource(t,n,r,s)}getUsedParamsDetails(){let t=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=t.replace&&!Bt(t.replace);let s=r?t.replace:t;if(r&&typeof t.count<"u"&&(s.count=t.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(t){const n="defaultValue";for(const r in t)if(Object.prototype.hasOwnProperty.call(t,r)&&n===r.substring(0,n.length)&&t[r]!==void 0)return!0;return!1}}const $4=e=>e.charAt(0).toUpperCase()+e.slice(1);class iK{constructor(t){this.options=t,this.supportedLngs=this.options.supportedLngs||!1,this.logger=bu.create("languageUtils")}getScriptPartFromCode(t){if(t=qT(t),!t||t.indexOf("-")<0)return null;const n=t.split("-");return n.length===2||(n.pop(),n[n.length-1].toLowerCase()==="x")?null:this.formatLanguageCode(n.join("-"))}getLanguagePartFromCode(t){if(t=qT(t),!t||t.indexOf("-")<0)return t;const n=t.split("-");return this.formatLanguageCode(n[0])}formatLanguageCode(t){if(Bt(t)&&t.indexOf("-")>-1){if(typeof Intl<"u"&&typeof Intl.getCanonicalLocales<"u")try{let s=Intl.getCanonicalLocales(t)[0];if(s&&this.options.lowerCaseLng&&(s=s.toLowerCase()),s)return s}catch{}const n=["hans","hant","latn","cyrl","cans","mong","arab"];let r=t.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]=$4(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]=$4(r[1].toLowerCase())),n.indexOf(r[2].toLowerCase())>-1&&(r[2]=$4(r[2].toLowerCase()))),r.join("-")}return this.options.cleanCode||this.options.lowerCaseLng?t.toLowerCase():t}isSupportedCode(t){return(this.options.load==="languageOnly"||this.options.nonExplicitSupportedLngs)&&(t=this.getLanguagePartFromCode(t)),!this.supportedLngs||!this.supportedLngs.length||this.supportedLngs.indexOf(t)>-1}getBestMatchFromCodes(t){if(!t)return null;let n;return t.forEach(r=>{if(n)return;const s=this.formatLanguageCode(r);(!this.options.supportedLngs||this.isSupportedCode(s))&&(n=s)}),!n&&this.options.supportedLngs&&t.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(t,n){if(!t)return[];if(typeof t=="function"&&(t=t(n)),Bt(t)&&(t=[t]),Array.isArray(t))return t;if(!n)return t.default||[];let r=t[n];return r||(r=t[this.getScriptPartFromCode(n)]),r||(r=t[this.formatLanguageCode(n)]),r||(r=t[this.getLanguagePartFromCode(n)]),r||(r=t.default),r||[]}toResolveHierarchy(t,n){const r=this.getFallbackCodes(n||this.options.fallbackLng||[],t),s=[],i=o=>{o&&(this.isSupportedCode(o)?s.push(o):this.logger.warn(`rejecting language code not found in supportedLngs: ${o}`))};return Bt(t)&&(t.indexOf("-")>-1||t.indexOf("_")>-1)?(this.options.load!=="languageOnly"&&i(this.formatLanguageCode(t)),this.options.load!=="languageOnly"&&this.options.load!=="currentOnly"&&i(this.getScriptPartFromCode(t)),this.options.load!=="currentOnly"&&i(this.getLanguagePartFromCode(t))):Bt(t)&&i(this.formatLanguageCode(t)),r.forEach(o=>{s.indexOf(o)<0&&i(this.formatLanguageCode(o))}),s}}let aFe=[{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}],lFe={1:e=>+(e>1),2:e=>+(e!=1),3:e=>0,4:e=>e%10==1&&e%100!=11?0:e%10>=2&&e%10<=4&&(e%100<10||e%100>=20)?1:2,5:e=>e==0?0:e==1?1:e==2?2:e%100>=3&&e%100<=10?3:e%100>=11?4:5,6:e=>e==1?0:e>=2&&e<=4?1:2,7:e=>e==1?0:e%10>=2&&e%10<=4&&(e%100<10||e%100>=20)?1:2,8:e=>e==1?0:e==2?1:e!=8&&e!=11?2:3,9:e=>+(e>=2),10:e=>e==1?0:e==2?1:e<7?2:e<11?3:4,11:e=>e==1||e==11?0:e==2||e==12?1:e>2&&e<20?2:3,12:e=>+(e%10!=1||e%100==11),13:e=>+(e!==0),14:e=>e==1?0:e==2?1:e==3?2:3,15:e=>e%10==1&&e%100!=11?0:e%10>=2&&(e%100<10||e%100>=20)?1:2,16:e=>e%10==1&&e%100!=11?0:e!==0?1:2,17:e=>e==1||e%10==1&&e%100!=11?0:1,18:e=>e==0?0:e==1?1:2,19:e=>e==1?0:e==0||e%100>1&&e%100<11?1:e%100>10&&e%100<20?2:3,20:e=>e==1?0:e==0||e%100>0&&e%100<20?1:2,21:e=>e%100==1?1:e%100==2?2:e%100==3||e%100==4?3:0,22:e=>e==1?0:e==2?1:(e<0||e>10)&&e%10==0?2:3};const cFe=["v1","v2","v3"],uFe=["v4"],oK={zero:0,one:1,two:2,few:3,many:4,other:5},dFe=()=>{const e={};return aFe.forEach(t=>{t.lngs.forEach(n=>{e[n]={numbers:t.nr,plurals:lFe[t.fc]}})}),e};class fFe{constructor(t){let n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};this.languageUtils=t,this.options=n,this.logger=bu.create("pluralResolver"),(!this.options.compatibilityJSON||uFe.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=dFe(),this.pluralRulesCache={}}addRule(t,n){this.rules[t]=n}clearCache(){this.pluralRulesCache={}}getRule(t){let n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};if(this.shouldUseIntlApi()){const r=qT(t==="dev"?"en":t),s=n.ordinal?"ordinal":"cardinal",i=JSON.stringify({cleanedCode:r,type:s});if(i in this.pluralRulesCache)return this.pluralRulesCache[i];let o;try{o=new Intl.PluralRules(r,{type:s})}catch{if(!t.match(/-|_/))return;const c=this.languageUtils.getLanguagePartFromCode(t);o=this.getRule(c,n)}return this.pluralRulesCache[i]=o,o}return this.rules[t]||this.rules[this.languageUtils.getLanguagePartFromCode(t)]}needsPlural(t){let n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};const r=this.getRule(t,n);return this.shouldUseIntlApi()?r&&r.resolvedOptions().pluralCategories.length>1:r&&r.numbers.length>1}getPluralFormsOfKey(t,n){let r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};return this.getSuffixes(t,r).map(s=>`${n}${s}`)}getSuffixes(t){let n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};const r=this.getRule(t,n);return r?this.shouldUseIntlApi()?r.resolvedOptions().pluralCategories.sort((s,i)=>oK[s]-oK[i]).map(s=>`${this.options.prepend}${n.ordinal?`ordinal${this.options.prepend}`:""}${s}`):r.numbers.map(s=>this.getSuffix(t,s,n)):[]}getSuffix(t,n){let r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};const s=this.getRule(t,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: ${t}`),"")}getSuffixRetroCompatible(t,n){const r=t.noAbs?t.plurals(n):t.plurals(Math.abs(n));let s=t.numbers[r];this.options.simplifyPluralSuffix&&t.numbers.length===2&&t.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&&t.numbers.length===2&&t.numbers[0]===1?i():this.options.prepend&&r.toString()?this.options.prepend+r.toString():r.toString()}shouldUseIntlApi(){return!cFe.includes(this.options.compatibilityJSON)}}const aK=function(e,t,n){let r=arguments.length>3&&arguments[3]!==void 0?arguments[3]:".",s=arguments.length>4&&arguments[4]!==void 0?arguments[4]:!0,i=J$e(e,t,n);return!i&&s&&Bt(n)&&(i=MU(e,n,r),i===void 0&&(i=MU(t,n,r))),i},F4=e=>e.replace(/\$/g,"$$$$");class hFe{constructor(){let t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};this.logger=bu.create("interpolator"),this.options=t,this.format=t.interpolation&&t.interpolation.format||(n=>n),this.init(t)}init(){let t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};t.interpolation||(t.interpolation={escapeValue:!0});const{escape:n,escapeValue:r,useRawValueToEscape:s,prefix:i,prefixEscaped:o,suffix:a,suffixEscaped:c,formatSeparator:d,unescapeSuffix:h,unescapePrefix:u,nestingPrefix:f,nestingPrefixEscaped:g,nestingSuffix:v,nestingSuffixEscaped:m,nestingOptionsSeparator:x,maxReplaces:y,alwaysFormat:b}=t.interpolation;this.escape=n!==void 0?n:tFe,this.escapeValue=r!==void 0?r:!0,this.useRawValueToEscape=s!==void 0?s:!1,this.prefix=i?By(i):o||"{{",this.suffix=a?By(a):c||"}}",this.formatSeparator=d||",",this.unescapePrefix=h?"":u||"-",this.unescapeSuffix=this.unescapePrefix?"":h||"",this.nestingPrefix=f?By(f):g||By("$t("),this.nestingSuffix=v?By(v):m||By(")"),this.nestingOptionsSeparator=x||",",this.maxReplaces=y||1e3,this.alwaysFormat=b!==void 0?b:!1,this.resetRegExp()}reset(){this.options&&this.init(this.options)}resetRegExp(){const t=(n,r)=>n&&n.source===r?(n.lastIndex=0,n):new RegExp(r,"g");this.regexp=t(this.regexp,`${this.prefix}(.+?)${this.suffix}`),this.regexpUnescape=t(this.regexpUnescape,`${this.prefix}${this.unescapePrefix}(.+?)${this.unescapeSuffix}${this.suffix}`),this.nestingRegexp=t(this.nestingRegexp,`${this.nestingPrefix}(.+?)${this.nestingSuffix}`)}interpolate(t,n,r,s){let i,o,a;const c=this.options&&this.options.interpolation&&this.options.interpolation.defaultVariables||{},d=g=>{if(g.indexOf(this.formatSeparator)<0){const y=aK(n,c,g,this.options.keySeparator,this.options.ignoreJSONStructure);return this.alwaysFormat?this.format(y,void 0,r,{...s,...n,interpolationkey:g}):y}const v=g.split(this.formatSeparator),m=v.shift().trim(),x=v.join(this.formatSeparator).trim();return this.format(aK(n,c,m,this.options.keySeparator,this.options.ignoreJSONStructure),x,r,{...s,...n,interpolationkey:m})};this.resetRegExp();const h=s&&s.missingInterpolationHandler||this.options.missingInterpolationHandler,u=s&&s.interpolation&&s.interpolation.skipOnVariables!==void 0?s.interpolation.skipOnVariables:this.options.interpolation.skipOnVariables;return[{regex:this.regexpUnescape,safeValue:g=>F4(g)},{regex:this.regexp,safeValue:g=>this.escapeValue?F4(this.escape(g)):F4(g)}].forEach(g=>{for(a=0;i=g.regex.exec(t);){const v=i[1].trim();if(o=d(v),o===void 0)if(typeof h=="function"){const x=h(t,i,s);o=Bt(x)?x:""}else if(s&&Object.prototype.hasOwnProperty.call(s,v))o="";else if(u){o=i[0];continue}else this.logger.warn(`missed to pass in variable ${v} for interpolating ${t}`),o="";else!Bt(o)&&!this.useRawValueToEscape&&(o=J7(o));const m=g.safeValue(o);if(t=t.replace(i[0],m),u?(g.regex.lastIndex+=o.length,g.regex.lastIndex-=i[0].length):g.regex.lastIndex=0,a++,a>=this.maxReplaces)break}}),t}nest(t,n){let r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{},s,i,o;const a=(c,d)=>{const h=this.nestingOptionsSeparator;if(c.indexOf(h)<0)return c;const u=c.split(new RegExp(`${h}[ ]*{`));let f=`{${u[1]}`;c=u[0],f=this.interpolate(f,o);const g=f.match(/'/g),v=f.match(/"/g);(g&&g.length%2===0&&!v||v.length%2!==0)&&(f=f.replace(/'/g,'"'));try{o=JSON.parse(f),d&&(o={...d,...o})}catch(m){return this.logger.warn(`failed parsing options string in nesting for key ${c}`,m),`${c}${h}${f}`}return o.defaultValue&&o.defaultValue.indexOf(this.prefix)>-1&&delete o.defaultValue,c};for(;s=this.nestingRegexp.exec(t);){let c=[];o={...r},o=o.replace&&!Bt(o.replace)?o.replace:o,o.applyPostProcessor=!1,delete o.defaultValue;let d=!1;if(s[0].indexOf(this.formatSeparator)!==-1&&!/{.*}/.test(s[1])){const h=s[1].split(this.formatSeparator).map(u=>u.trim());s[1]=h.shift(),c=h,d=!0}if(i=n(a.call(this,s[1].trim(),o),o),i&&s[0]===t&&!Bt(i))return i;Bt(i)||(i=J7(i)),i||(this.logger.warn(`missed to resolve ${s[1]} for nesting ${t}`),i=""),d&&(i=c.reduce((h,u)=>this.format(h,u,r.lng,{...r,interpolationkey:s[1].trim()}),i.trim())),t=t.replace(s[0],i),this.regexp.lastIndex=0}return t}}const pFe=e=>{let t=e.toLowerCase().trim();const n={};if(e.indexOf("(")>-1){const r=e.split("(");t=r[0].toLowerCase().trim();const s=r[1].substring(0,r[1].length-1);t==="currency"&&s.indexOf(":")<0?n.currency||(n.currency=s.trim()):t==="relativetime"&&s.indexOf(":")<0?n.range||(n.range=s.trim()):s.split(";").forEach(o=>{if(o){const[a,...c]=o.split(":"),d=c.join(":").trim().replace(/^'+|'+$/g,""),h=a.trim();n[h]||(n[h]=d),d==="false"&&(n[h]=!1),d==="true"&&(n[h]=!0),isNaN(d)||(n[h]=parseInt(d,10))}})}return{formatName:t,formatOptions:n}},Uy=e=>{const t={};return(n,r,s)=>{let i=s;s&&s.interpolationkey&&s.formatParams&&s.formatParams[s.interpolationkey]&&s[s.interpolationkey]&&(i={...i,[s.interpolationkey]:void 0});const o=r+JSON.stringify(i);let a=t[o];return a||(a=e(qT(r),s),t[o]=a),a(n)}};class mFe{constructor(){let t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};this.logger=bu.create("formatter"),this.options=t,this.formats={number:Uy((n,r)=>{const s=new Intl.NumberFormat(n,{...r});return i=>s.format(i)}),currency:Uy((n,r)=>{const s=new Intl.NumberFormat(n,{...r,style:"currency"});return i=>s.format(i)}),datetime:Uy((n,r)=>{const s=new Intl.DateTimeFormat(n,{...r});return i=>s.format(i)}),relativetime:Uy((n,r)=>{const s=new Intl.RelativeTimeFormat(n,{...r});return i=>s.format(i,r.range||"day")}),list:Uy((n,r)=>{const s=new Intl.ListFormat(n,{...r});return i=>s.format(i)})},this.init(t)}init(t){let n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{interpolation:{}};this.formatSeparator=n.interpolation.formatSeparator||","}add(t,n){this.formats[t.toLowerCase().trim()]=n}addCached(t,n){this.formats[t.toLowerCase().trim()]=Uy(n)}format(t,n,r){let s=arguments.length>3&&arguments[3]!==void 0?arguments[3]:{};const i=n.split(this.formatSeparator);if(i.length>1&&i[0].indexOf("(")>1&&i[0].indexOf(")")<0&&i.find(a=>a.indexOf(")")>-1)){const a=i.findIndex(c=>c.indexOf(")")>-1);i[0]=[i[0],...i.splice(1,a)].join(this.formatSeparator)}return i.reduce((a,c)=>{const{formatName:d,formatOptions:h}=pFe(c);if(this.formats[d]){let u=a;try{const f=s&&s.formatParams&&s.formatParams[s.interpolationkey]||{},g=f.locale||f.lng||s.locale||s.lng||r;u=this.formats[d](a,g,{...h,...s,...f})}catch(f){this.logger.warn(f)}return u}else this.logger.warn(`there was no format function for ${d}`);return a},t)}}const gFe=(e,t)=>{e.pending[t]!==void 0&&(delete e.pending[t],e.pendingCount--)};class vFe extends CO{constructor(t,n,r){let s=arguments.length>3&&arguments[3]!==void 0?arguments[3]:{};super(),this.backend=t,this.store=n,this.services=r,this.languageUtils=r.languageUtils,this.options=s,this.logger=bu.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(t,n,r,s){const i={},o={},a={},c={};return t.forEach(d=>{let h=!0;n.forEach(u=>{const f=`${d}|${u}`;!r.reload&&this.store.hasResourceBundle(d,u)?this.state[f]=2:this.state[f]<0||(this.state[f]===1?o[f]===void 0&&(o[f]=!0):(this.state[f]=1,h=!1,o[f]===void 0&&(o[f]=!0),i[f]===void 0&&(i[f]=!0),c[u]===void 0&&(c[u]=!0)))}),h||(a[d]=!0)}),(Object.keys(i).length||Object.keys(o).length)&&this.queue.push({pending:o,pendingCount:Object.keys(o).length,loaded:{},errors:[],callback:s}),{toLoad:Object.keys(i),pending:Object.keys(o),toLoadLanguages:Object.keys(a),toLoadNamespaces:Object.keys(c)}}loaded(t,n,r){const s=t.split("|"),i=s[0],o=s[1];n&&this.emit("failedLoading",i,o,n),!n&&r&&this.store.addResourceBundle(i,o,r,void 0,void 0,{skipCopy:!0}),this.state[t]=n?-1:2,n&&r&&(this.state[t]=0);const a={};this.queue.forEach(c=>{Z$e(c.loaded,[i],o),gFe(c,t),n&&c.errors.push(n),c.pendingCount===0&&!c.done&&(Object.keys(c.loaded).forEach(d=>{a[d]||(a[d]={});const h=c.loaded[d];h.length&&h.forEach(u=>{a[d][u]===void 0&&(a[d][u]=!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(t,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(!t.length)return o(null,{});if(this.readingCalls>=this.maxParallelReads){this.waitingReads.push({lng:t,ns:n,fcName:r,tried:s,wait:i,callback:o});return}this.readingCalls++;const a=(d,h)=>{if(this.readingCalls--,this.waitingReads.length>0){const u=this.waitingReads.shift();this.read(u.lng,u.ns,u.fcName,u.tried,u.wait,u.callback)}if(d&&h&&s<this.maxRetries){setTimeout(()=>{this.read.call(this,t,n,r,s+1,i*2,o)},i);return}o(d,h)},c=this.backend[r].bind(this.backend);if(c.length===2){try{const d=c(t,n);d&&typeof d.then=="function"?d.then(h=>a(null,h)).catch(a):a(null,d)}catch(d){a(d)}return}return c(t,n,a)}prepareLoading(t,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();Bt(t)&&(t=this.languageUtils.toResolveHierarchy(t)),Bt(n)&&(n=[n]);const i=this.queueLoad(t,n,r,s);if(!i.toLoad.length)return i.pending.length||s(),null;i.toLoad.forEach(o=>{this.loadOne(o)})}load(t,n,r){this.prepareLoading(t,n,{},r)}reload(t,n,r){this.prepareLoading(t,n,{reload:!0},r)}loadOne(t){let n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"";const r=t.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(t,o,a)})}saveMissing(t,n,r,s,i){let o=arguments.length>5&&arguments[5]!==void 0?arguments[5]:{},a=arguments.length>6&&arguments[6]!==void 0?arguments[6]:()=>{};if(this.services.utils&&this.services.utils.hasLoadedNamespace&&!this.services.utils.hasLoadedNamespace(n)){this.logger.warn(`did not save key "${r}" as the namespace "${n}" was not yet loaded`,"This means something IS WRONG in your setup. You access the t function before i18next.init / i18next.loadNamespace / i18next.changeLanguage was done. Wait for the callback or Promise to resolve before accessing it!!!");return}if(!(r==null||r==="")){if(this.backend&&this.backend.create){const c={...o,isUpdate:i},d=this.backend.create.bind(this.backend);if(d.length<6)try{let h;d.length===5?h=d(t,n,r,s,c):h=d(t,n,r,s),h&&typeof h.then=="function"?h.then(u=>a(null,u)).catch(a):a(null,h)}catch(h){a(h)}else d(t,n,r,s,a,c)}!t||!t[0]||this.store.addResource(t[0],n,r,s)}}}const lK=()=>({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:e=>{let t={};if(typeof e[1]=="object"&&(t=e[1]),Bt(e[1])&&(t.defaultValue=e[1]),Bt(e[2])&&(t.tDescription=e[2]),typeof e[2]=="object"||typeof e[3]=="object"){const n=e[3]||e[2];Object.keys(n).forEach(r=>{t[r]=n[r]})}return t},interpolation:{escapeValue:!0,format:e=>e,prefix:"{{",suffix:"}}",formatSeparator:",",unescapePrefix:"-",nestingPrefix:"$t(",nestingSuffix:")",nestingOptionsSeparator:",",maxReplaces:1e3,skipOnVariables:!0}}),cK=e=>(Bt(e.ns)&&(e.ns=[e.ns]),Bt(e.fallbackLng)&&(e.fallbackLng=[e.fallbackLng]),Bt(e.fallbackNS)&&(e.fallbackNS=[e.fallbackNS]),e.supportedLngs&&e.supportedLngs.indexOf("cimode")<0&&(e.supportedLngs=e.supportedLngs.concat(["cimode"])),e),vP=()=>{},yFe=e=>{Object.getOwnPropertyNames(Object.getPrototypeOf(e)).forEach(n=>{typeof e[n]=="function"&&(e[n]=e[n].bind(e))})};class MC extends CO{constructor(){let t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},n=arguments.length>1?arguments[1]:void 0;if(super(),this.options=cK(t),this.services={},this.logger=bu,this.modules={external:[]},yFe(this),n&&!this.isInitialized&&!t.isClone){if(!this.options.initImmediate)return this.init(t,n),this;setTimeout(()=>{this.init(t,n)},0)}}init(){var t=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&&(Bt(n.ns)?n.defaultNS=n.ns:n.ns.indexOf("translation")<0&&(n.defaultNS=n.ns[0]));const s=lK();this.options={...s,...this.options,...cK(n)},this.options.compatibilityAPI!=="v1"&&(this.options.interpolation={...s.interpolation,...this.options.interpolation}),n.keySeparator!==void 0&&(this.options.userDefinedKeySeparator=n.keySeparator),n.nsSeparator!==void 0&&(this.options.userDefinedNsSeparator=n.nsSeparator);const i=h=>h?typeof h=="function"?new h:h:null;if(!this.options.isClone){this.modules.logger?bu.init(i(this.modules.logger),this.options):bu.init(null,this.options);let h;this.modules.formatter?h=this.modules.formatter:typeof Intl<"u"&&(h=mFe);const u=new iK(this.options);this.store=new rK(this.options.resources,this.options);const f=this.services;f.logger=bu,f.resourceStore=this.store,f.languageUtils=u,f.pluralResolver=new fFe(u,{prepend:this.options.pluralSeparator,compatibilityJSON:this.options.compatibilityJSON,simplifyPluralSuffix:this.options.simplifyPluralSuffix}),h&&(!this.options.interpolation.format||this.options.interpolation.format===s.interpolation.format)&&(f.formatter=i(h),f.formatter.init(f,this.options),this.options.interpolation.format=f.formatter.format.bind(f.formatter)),f.interpolator=new hFe(this.options),f.utils={hasLoadedNamespace:this.hasLoadedNamespace.bind(this)},f.backendConnector=new vFe(i(this.modules.backend),f.resourceStore,f,this.options),f.backendConnector.on("*",function(g){for(var v=arguments.length,m=new Array(v>1?v-1:0),x=1;x<v;x++)m[x-1]=arguments[x];t.emit(g,...m)}),this.modules.languageDetector&&(f.languageDetector=i(this.modules.languageDetector),f.languageDetector.init&&f.languageDetector.init(f,this.options.detection,this.options)),this.modules.i18nFormat&&(f.i18nFormat=i(this.modules.i18nFormat),f.i18nFormat.init&&f.i18nFormat.init(this)),this.translator=new KT(this.services,this.options),this.translator.on("*",function(g){for(var v=arguments.length,m=new Array(v>1?v-1:0),x=1;x<v;x++)m[x-1]=arguments[x];t.emit(g,...m)}),this.modules.external.forEach(g=>{g.init&&g.init(this)})}if(this.format=this.options.interpolation.format,r||(r=vP),this.options.fallbackLng&&!this.services.languageDetector&&!this.options.lng){const h=this.services.languageUtils.getFallbackCodes(this.options.fallbackLng);h.length>0&&h[0]!=="dev"&&(this.options.lng=h[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(h=>{this[h]=function(){return t.store[h](...arguments)}}),["addResource","addResources","addResourceBundle","removeResourceBundle"].forEach(h=>{this[h]=function(){return t.store[h](...arguments),t}});const c=qS(),d=()=>{const h=(u,f)=>{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(f),r(u,f)};if(this.languages&&this.options.compatibilityAPI!=="v1"&&!this.isInitialized)return h(null,this.t.bind(this));this.changeLanguage(this.options.lng,h)};return this.options.resources||!this.options.initImmediate?d():setTimeout(d,0),c}loadResources(t){let r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:vP;const s=Bt(t)?t:this.language;if(typeof t=="function"&&(r=t),!this.options.resources||this.options.partialBundledLanguages){if(s&&s.toLowerCase()==="cimode"&&(!this.options.preload||this.options.preload.length===0))return r();const i=[],o=a=>{if(!a||a==="cimode")return;this.services.languageUtils.toResolveHierarchy(a).forEach(d=>{d!=="cimode"&&i.indexOf(d)<0&&i.push(d)})};s?o(s):this.services.languageUtils.getFallbackCodes(this.options.fallbackLng).forEach(c=>o(c)),this.options.preload&&this.options.preload.forEach(a=>o(a)),this.services.backendConnector.load(i,this.options.ns,a=>{!a&&!this.resolvedLanguage&&this.language&&this.setResolvedLanguage(this.language),r(a)})}else r(null)}reloadResources(t,n,r){const s=qS();return typeof t=="function"&&(r=t,t=void 0),typeof n=="function"&&(r=n,n=void 0),t||(t=this.languages),n||(n=this.options.ns),r||(r=vP),this.services.backendConnector.reload(t,n,i=>{s.resolve(),r(i)}),s}use(t){if(!t)throw new Error("You are passing an undefined module! Please check the object you are passing to i18next.use()");if(!t.type)throw new Error("You are passing a wrong module! Please check the object you are passing to i18next.use()");return t.type==="backend"&&(this.modules.backend=t),(t.type==="logger"||t.log&&t.warn&&t.error)&&(this.modules.logger=t),t.type==="languageDetector"&&(this.modules.languageDetector=t),t.type==="i18nFormat"&&(this.modules.i18nFormat=t),t.type==="postProcessor"&&Hce.addPostProcessor(t),t.type==="formatter"&&(this.modules.formatter=t),t.type==="3rdParty"&&this.modules.external.push(t),this}setResolvedLanguage(t){if(!(!t||!this.languages)&&!(["cimode","dev"].indexOf(t)>-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(t,n){var r=this;this.isLanguageChangingTo=t;const s=qS();this.emit("languageChanging",t);const i=c=>{this.language=c,this.languages=this.services.languageUtils.toResolveHierarchy(c),this.resolvedLanguage=void 0,this.setResolvedLanguage(c)},o=(c,d)=>{d?(i(d),this.translator.changeLanguage(d),this.isLanguageChangingTo=void 0,this.emit("languageChanged",d),this.logger.log("languageChanged",d)):this.isLanguageChangingTo=void 0,s.resolve(function(){return r.t(...arguments)}),n&&n(c,function(){return r.t(...arguments)})},a=c=>{!t&&!c&&this.services.languageDetector&&(c=[]);const d=Bt(c)?c:this.services.languageUtils.getBestMatchFromCodes(c);d&&(this.language||i(d),this.translator.language||this.translator.changeLanguage(d),this.services.languageDetector&&this.services.languageDetector.cacheUserLanguage&&this.services.languageDetector.cacheUserLanguage(d)),this.loadResources(d,h=>{o(h,d)})};return!t&&this.services.languageDetector&&!this.services.languageDetector.async?a(this.services.languageDetector.detect()):!t&&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(t),s}getFixedT(t,n,r){var s=this;const i=function(o,a){let c;if(typeof a!="object"){for(var d=arguments.length,h=new Array(d>2?d-2:0),u=2;u<d;u++)h[u-2]=arguments[u];c=s.options.overloadTranslationOptionHandler([o,a].concat(h))}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 f=s.options.keySeparator||".";let g;return c.keyPrefix&&Array.isArray(o)?g=o.map(v=>`${c.keyPrefix}${f}${v}`):g=c.keyPrefix?`${c.keyPrefix}${f}${o}`:o,s.t(g,c)};return Bt(t)?i.lng=t:i.lngs=t,i.ns=n,i.keyPrefix=r,i}t(){return this.translator&&this.translator.translate(...arguments)}exists(){return this.translator&&this.translator.exists(...arguments)}setDefaultNamespace(t){this.options.defaultNS=t}hasLoadedNamespace(t){let n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};if(!this.isInitialized)return this.logger.warn("hasLoadedNamespace: i18next was not initialized",this.languages),!1;if(!this.languages||!this.languages.length)return this.logger.warn("hasLoadedNamespace: i18n.languages were undefined or empty",this.languages),!1;const r=n.lng||this.resolvedLanguage||this.languages[0],s=this.options?this.options.fallbackLng:!1,i=this.languages[this.languages.length-1];if(r.toLowerCase()==="cimode")return!0;const o=(a,c)=>{const d=this.services.backendConnector.state[`${a}|${c}`];return d===-1||d===0||d===2};if(n.precheck){const a=n.precheck(this,o);if(a!==void 0)return a}return!!(this.hasResourceBundle(r,t)||!this.services.backendConnector.backend||this.options.resources&&!this.options.partialBundledLanguages||o(r,t)&&(!s||o(i,t)))}loadNamespaces(t,n){const r=qS();return this.options.ns?(Bt(t)&&(t=[t]),t.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(t,n){const r=qS();Bt(t)&&(t=[t]);const s=this.options.preload||[],i=t.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(t){if(t||(t=this.resolvedLanguage||(this.languages&&this.languages.length>0?this.languages[0]:this.language)),!t)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 iK(lK());return n.indexOf(r.getLanguagePartFromCode(t))>-1||t.toLowerCase().indexOf("-arab")>1?"rtl":"ltr"}static createInstance(){let t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},n=arguments.length>1?arguments[1]:void 0;return new MC(t,n)}cloneInstance(){let t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:vP;const r=t.forkResourceStore;r&&delete t.forkResourceStore;const s={...this.options,...t,isClone:!0},i=new MC(s);return(t.debug!==void 0||t.prefix!==void 0)&&(i.logger=i.logger.clone(t)),["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 rK(this.store.data,s),i.services.resourceStore=i.store),i.translator=new KT(i.services,s),i.translator.on("*",function(a){for(var c=arguments.length,d=new Array(c>1?c-1:0),h=1;h<c;h++)d[h-1]=arguments[h];i.emit(a,...d)}),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 Bi=MC.createInstance();Bi.createInstance=MC.createInstance;Bi.createInstance;Bi.dir;Bi.init;Bi.loadResources;Bi.reloadResources;Bi.use;Bi.changeLanguage;Bi.getFixedT;const ue=Bi.t;Bi.exists;Bi.setDefaultNamespace;Bi.hasLoadedNamespace;Bi.loadNamespaces;Bi.loadLanguages;const bFe=e=>{const[t,n]=C.useState(!1),[r,s]=C.useState({title:"Título",description:"Descripción",cancelLabel:ue("common.no"),confirmLabel:ue("common.yes"),onCancel:()=>{},onConfirm:()=>{},...e}),i=(d,h)=>{d==null||d.preventDefault(),h&&s(h),n(!0)},o=d=>{d==null||d.preventDefault(),n(!1),r==null||r.onCancel(d)},a=d=>{d==null||d.preventDefault(),n(!1),r==null||r.onConfirm(d)},c=r?_.jsx(Uce,{isOpen:t,onCancel:o,onConfirm:a,title:r.title,description:r.description,cancelLabel:r.cancelLabel,confirmLabel:r.confirmLabel}):_.jsx(_.Fragment,{});return{openDialog:i,cancelDialog:o,confirmDialog:a,DialogComponent:c}};var Wce={exports:{}};(function(e,t){(function(n,r){e.exports=r()})(self,()=>{return n={7629:(s,i,o)=>{const a=o(375),c=o(8571),d=o(9474),h=o(1687),u=o(8652),f=o(8160),g=o(3292),v=o(6354),m=o(8901),x=o(9708),y=o(6914),b=o(2294),w=o(6133),E=o(1152),R=o(8863),T=o(2036),N={Base:class{constructor(A){this.type=A,this.$_root=null,this._definition={},this._reset()}_reset(){this._ids=new b.Ids,this._preferences=null,this._refs=new w.Manager,this._cache=null,this._valids=null,this._invalids=null,this._flags={},this._rules=[],this._singleRules=new Map,this.$_terms={},this.$_temp={ruleset:null,whens:{}}}describe(){return a(typeof x.describe=="function","Manifest functionality disabled"),x.describe(this)}allow(...A){return f.verifyFlat(A,"allow"),this._values(A,"_valids")}alter(A){a(A&&typeof A=="object"&&!Array.isArray(A),"Invalid targets argument"),a(!this._inRuleset(),"Cannot set alterations inside a ruleset");const D=this.clone();D.$_terms.alterations=D.$_terms.alterations||[];for(const O in A){const I=A[O];a(typeof I=="function","Alteration adjuster for",O,"must be a function"),D.$_terms.alterations.push({target:O,adjuster:I})}return D.$_temp.ruleset=!1,D}artifact(A){return a(A!==void 0,"Artifact cannot be undefined"),a(!this._cache,"Cannot set an artifact with a rule cache"),this.$_setFlag("artifact",A)}cast(A){return a(A===!1||typeof A=="string","Invalid to value"),a(A===!1||this._definition.cast[A],"Type",this.type,"does not support casting to",A),this.$_setFlag("cast",A===!1?void 0:A)}default(A,D){return this._default("default",A,D)}description(A){return a(A&&typeof A=="string","Description must be a non-empty string"),this.$_setFlag("description",A)}empty(A){const D=this.clone();return A!==void 0&&(A=D.$_compile(A,{override:!1})),D.$_setFlag("empty",A,{clone:!1})}error(A){return a(A,"Missing error"),a(A instanceof Error||typeof A=="function","Must provide a valid Error object or a function"),this.$_setFlag("error",A)}example(A,D={}){return a(A!==void 0,"Missing example"),f.assertOptions(D,["override"]),this._inner("examples",A,{single:!0,override:D.override})}external(A,D){return typeof A=="object"&&(a(!D,"Cannot combine options with description"),D=A.description,A=A.method),a(typeof A=="function","Method must be a function"),a(D===void 0||D&&typeof D=="string","Description must be a non-empty string"),this._inner("externals",{method:A,description:D},{single:!0})}failover(A,D){return this._default("failover",A,D)}forbidden(){return this.presence("forbidden")}id(A){return A?(a(typeof A=="string","id must be a non-empty string"),a(/^[^\.]+$/.test(A),"id cannot contain period character"),this.$_setFlag("id",A)):this.$_setFlag("id",void 0)}invalid(...A){return this._values(A,"_invalids")}label(A){return a(A&&typeof A=="string","Label name must be a non-empty string"),this.$_setFlag("label",A)}meta(A){return a(A!==void 0,"Meta cannot be undefined"),this._inner("metas",A,{single:!0})}note(...A){a(A.length,"Missing notes");for(const D of A)a(D&&typeof D=="string","Notes must be non-empty strings");return this._inner("notes",A)}only(A=!0){return a(typeof A=="boolean","Invalid mode:",A),this.$_setFlag("only",A)}optional(){return this.presence("optional")}prefs(A){a(A,"Missing preferences"),a(A.context===void 0,"Cannot override context"),a(A.externals===void 0,"Cannot override externals"),a(A.warnings===void 0,"Cannot override warnings"),a(A.debug===void 0,"Cannot override debug"),f.checkPreferences(A);const D=this.clone();return D._preferences=f.preferences(D._preferences,A),D}presence(A){return a(["optional","required","forbidden"].includes(A),"Unknown presence mode",A),this.$_setFlag("presence",A)}raw(A=!0){return this.$_setFlag("result",A?"raw":void 0)}result(A){return a(["raw","strip"].includes(A),"Unknown result mode",A),this.$_setFlag("result",A)}required(){return this.presence("required")}strict(A){const D=this.clone(),O=A!==void 0&&!A;return D._preferences=f.preferences(D._preferences,{convert:O}),D}strip(A=!0){return this.$_setFlag("result",A?"strip":void 0)}tag(...A){a(A.length,"Missing tags");for(const D of A)a(D&&typeof D=="string","Tags must be non-empty strings");return this._inner("tags",A)}unit(A){return a(A&&typeof A=="string","Unit name must be a non-empty string"),this.$_setFlag("unit",A)}valid(...A){f.verifyFlat(A,"valid");const D=this.allow(...A);return D.$_setFlag("only",!!D._valids,{clone:!1}),D}when(A,D){const O=this.clone();O.$_terms.whens||(O.$_terms.whens=[]);const I=g.when(O,A,D);if(!["any","link"].includes(O.type)){const $=I.is?[I]:I.switch;for(const F of $)a(!F.then||F.then.type==="any"||F.then.type===O.type,"Cannot combine",O.type,"with",F.then&&F.then.type),a(!F.otherwise||F.otherwise.type==="any"||F.otherwise.type===O.type,"Cannot combine",O.type,"with",F.otherwise&&F.otherwise.type)}return O.$_terms.whens.push(I),O.$_mutateRebuild()}cache(A){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 D=this.clone();return D._cache=A||u.provider.provision(),D.$_temp.ruleset=!1,D}clone(){const A=Object.create(Object.getPrototypeOf(this));return this._assign(A)}concat(A){a(f.isSchema(A),"Invalid schema object"),a(this.type==="any"||A.type==="any"||A.type===this.type,"Cannot merge type",this.type,"with another type:",A.type),a(!this._inRuleset(),"Cannot concatenate onto a schema with open ruleset"),a(!A._inRuleset(),"Cannot concatenate a schema with open ruleset");let D=this.clone();if(this.type==="any"&&A.type!=="any"){const O=A.clone();for(const I of Object.keys(D))I!=="type"&&(O[I]=D[I]);D=O}D._ids.concat(A._ids),D._refs.register(A,w.toSibling),D._preferences=D._preferences?f.preferences(D._preferences,A._preferences):A._preferences,D._valids=T.merge(D._valids,A._valids,A._invalids),D._invalids=T.merge(D._invalids,A._invalids,A._valids);for(const O of A._singleRules.keys())D._singleRules.has(O)&&(D._rules=D._rules.filter(I=>I.keep||I.name!==O),D._singleRules.delete(O));for(const O of A._rules)A._definition.rules[O.method].multi||D._singleRules.set(O.name,O),D._rules.push(O);if(D._flags.empty&&A._flags.empty){D._flags.empty=D._flags.empty.concat(A._flags.empty);const O=Object.assign({},A._flags);delete O.empty,h(D._flags,O)}else if(A._flags.empty){D._flags.empty=A._flags.empty;const O=Object.assign({},A._flags);delete O.empty,h(D._flags,O)}else h(D._flags,A._flags);for(const O in A.$_terms){const I=A.$_terms[O];I?D.$_terms[O]?D.$_terms[O]=D.$_terms[O].concat(I):D.$_terms[O]=I.slice():D.$_terms[O]||(D.$_terms[O]=I)}return this.$_root._tracer&&this.$_root._tracer._combine(D,[this,A]),D.$_mutateRebuild()}extend(A){return a(!A.base,"Cannot extend type with another base"),m.type(this,A)}extract(A){return A=Array.isArray(A)?A:A.split("."),this._ids.reach(A)}fork(A,D){a(!this._inRuleset(),"Cannot fork inside a ruleset");let O=this;for(let I of[].concat(A))I=Array.isArray(I)?I:I.split("."),O=O._ids.fork(I,D,O);return O.$_temp.ruleset=!1,O}rule(A){const D=this._definition;f.assertOptions(A,Object.keys(D.modifiers)),a(this.$_temp.ruleset!==!1,"Cannot apply rules to empty ruleset or the last rule added does not support rule properties");const O=this.$_temp.ruleset===null?this._rules.length-1:this.$_temp.ruleset;a(O>=0&&O<this._rules.length,"Cannot apply rules to empty ruleset");const I=this.clone();for(let $=O;$<I._rules.length;++$){const F=I._rules[$],B=c(F);for(const W in A)D.modifiers[W](B,A[W]),a(B.name===F.name,"Cannot change rule name");I._rules[$]=B,I._singleRules.get(B.name)===F&&I._singleRules.set(B.name,B)}return I.$_temp.ruleset=!1,I.$_mutateRebuild()}get ruleset(){a(!this._inRuleset(),"Cannot start a new ruleset without closing the previous one");const A=this.clone();return A.$_temp.ruleset=A._rules.length,A}get $(){return this.ruleset}tailor(A){A=[].concat(A),a(!this._inRuleset(),"Cannot tailor inside a ruleset");let D=this;if(this.$_terms.alterations)for(const{target:O,adjuster:I}of this.$_terms.alterations)A.includes(O)&&(D=I(D),a(f.isSchema(D),"Alteration adjuster for",O,"failed to return a schema object"));return D=D.$_modify({each:O=>O.tailor(A),ref:!1}),D.$_temp.ruleset=!1,D.$_mutateRebuild()}tracer(){return E.location?E.location(this):this}validate(A,D){return R.entry(A,this,D)}validateAsync(A,D){return R.entryAsync(A,this,D)}$_addRule(A){typeof A=="string"&&(A={name:A}),a(A&&typeof A=="object","Invalid options"),a(A.name&&typeof A.name=="string","Invalid rule name");for(const F in A)a(F[0]!=="_","Cannot set private rule properties");const D=Object.assign({},A);D._resolve=[],D.method=D.method||D.name;const O=this._definition.rules[D.method],I=D.args;a(O,"Unknown rule",D.method);const $=this.clone();if(I){a(Object.keys(I).length===1||Object.keys(I).length===this._definition.rules[D.name].args.length,"Invalid rule definition for",this.type,D.name);for(const F in I){let B=I[F];if(O.argsByName){const W=O.argsByName.get(F);if(W.ref&&f.isResolvable(B))D._resolve.push(F),$.$_mutateRegister(B);else if(W.normalize&&(B=W.normalize(B),I[F]=B),W.assert){const Z=f.validateArg(B,F,W);a(!Z,Z,"or reference")}}B!==void 0?I[F]=B:delete I[F]}}return O.multi||($._ruleRemove(D.name,{clone:!1}),$._singleRules.set(D.name,D)),$.$_temp.ruleset===!1&&($.$_temp.ruleset=null),O.priority?$._rules.unshift(D):$._rules.push(D),$}$_compile(A,D){return g.schema(this.$_root,A,D)}$_createError(A,D,O,I,$,F={}){const B=F.flags!==!1?this._flags:{},W=F.messages?y.merge(this._definition.messages,F.messages):this._definition.messages;return new v.Report(A,D,O,B,W,I,$)}$_getFlag(A){return this._flags[A]}$_getRule(A){return this._singleRules.get(A)}$_mapLabels(A){return A=Array.isArray(A)?A:A.split("."),this._ids.labels(A)}$_match(A,D,O,I){(O=Object.assign({},O)).abortEarly=!0,O._externals=!1,D.snapshot();const $=!R.validate(A,this,D,O,I).errors;return D.restore(),$}$_modify(A){return f.assertOptions(A,["each","once","ref","schema"]),b.schema(this,A)||this}$_mutateRebuild(){return a(!this._inRuleset(),"Cannot add this rule inside a ruleset"),this._refs.reset(),this._ids.reset(),this.$_modify({each:(A,{source:D,name:O,path:I,key:$})=>{const F=this._definition[D][O]&&this._definition[D][O].register;F!==!1&&this.$_mutateRegister(A,{family:F,key:$})}}),this._definition.rebuild&&this._definition.rebuild(this),this.$_temp.ruleset=!1,this}$_mutateRegister(A,{family:D,key:O}={}){this._refs.register(A,D),this._ids.register(A,{key:O})}$_property(A){return this._definition.properties[A]}$_reach(A){return this._ids.reach(A)}$_rootReferences(){return this._refs.roots()}$_setFlag(A,D,O={}){a(A[0]==="_"||!this._inRuleset(),"Cannot set flag inside a ruleset");const I=this._definition.flags[A]||{};if(d(D,I.default)&&(D=void 0),d(D,this._flags[A]))return this;const $=O.clone!==!1?this.clone():this;return D!==void 0?($._flags[A]=D,$.$_mutateRegister(D)):delete $._flags[A],A[0]!=="_"&&($.$_temp.ruleset=!1),$}$_parent(A,...D){return this[A][f.symbols.parent].call(this,...D)}$_validate(A,D,O){return R.validate(A,this,D,O)}_assign(A){A.type=this.type,A.$_root=this.$_root,A.$_temp=Object.assign({},this.$_temp),A.$_temp.whens={},A._ids=this._ids.clone(),A._preferences=this._preferences,A._valids=this._valids&&this._valids.clone(),A._invalids=this._invalids&&this._invalids.clone(),A._rules=this._rules.slice(),A._singleRules=c(this._singleRules,{shallow:!0}),A._refs=this._refs.clone(),A._flags=Object.assign({},this._flags),A._cache=null,A.$_terms={};for(const D in this.$_terms)A.$_terms[D]=this.$_terms[D]?this.$_terms[D].slice():null;A.$_super={};for(const D in this.$_super)A.$_super[D]=this._super[D].bind(A);return A}_bare(){const A=this.clone();A._reset();const D=A._definition.terms;for(const O in D){const I=D[O];A.$_terms[O]=I.init}return A.$_mutateRebuild()}_default(A,D,O={}){return f.assertOptions(O,"literal"),a(D!==void 0,"Missing",A,"value"),a(typeof D=="function"||!O.literal,"Only function value supports literal option"),typeof D=="function"&&O.literal&&(D={[f.symbols.literal]:!0,literal:D}),this.$_setFlag(A,D)}_generate(A,D,O){if(!this.$_terms.whens)return{schema:this};const I=[],$=[];for(let W=0;W<this.$_terms.whens.length;++W){const Z=this.$_terms.whens[W];if(Z.concat){I.push(Z.concat),$.push(`${W}.concat`);continue}const Y=Z.ref?Z.ref.resolve(A,D,O):A,H=Z.is?[Z]:Z.switch,se=$.length;for(let he=0;he<H.length;++he){const{is:re,then:J,otherwise:te}=H[he],ae=`${W}${Z.switch?"."+he:""}`;if(re.$_match(Y,D.nest(re,`${ae}.is`),O)){if(J){const be=D.localize([...D.path,`${ae}.then`],D.ancestors,D.schemas),{schema:xe,id:ve}=J._generate(A,be,O);I.push(xe),$.push(`${ae}.then${ve?`(${ve})`:""}`);break}}else if(te){const be=D.localize([...D.path,`${ae}.otherwise`],D.ancestors,D.schemas),{schema:xe,id:ve}=te._generate(A,be,O);I.push(xe),$.push(`${ae}.otherwise${ve?`(${ve})`:""}`);break}}if(Z.break&&$.length>se)break}const F=$.join(", ");if(D.mainstay.tracer.debug(D,"rule","when",F),!F)return{schema:this};if(!D.mainstay.tracer.active&&this.$_temp.whens[F])return{schema:this.$_temp.whens[F],id:F};let B=this;this._definition.generate&&(B=this._definition.generate(this,A,D,O));for(const W of I)B=B.concat(W);return this.$_root._tracer&&this.$_root._tracer._combine(B,[this,...I]),this.$_temp.whens[F]=B,{schema:B,id:F}}_inner(A,D,O={}){a(!this._inRuleset(),`Cannot set ${A} inside a ruleset`);const I=this.clone();return I.$_terms[A]&&!O.override||(I.$_terms[A]=[]),O.single?I.$_terms[A].push(D):I.$_terms[A].push(...D),I.$_temp.ruleset=!1,I}_inRuleset(){return this.$_temp.ruleset!==null&&this.$_temp.ruleset!==!1}_ruleRemove(A,D={}){if(!this._singleRules.has(A))return this;const O=D.clone!==!1?this.clone():this;O._singleRules.delete(A);const I=[];for(let $=0;$<O._rules.length;++$){const F=O._rules[$];F.name!==A||F.keep?I.push(F):O._inRuleset()&&$<O.$_temp.ruleset&&--O.$_temp.ruleset}return O._rules=I,O}_values(A,D){f.verifyFlat(A,D.slice(1,-1));const O=this.clone(),I=A[0]===f.symbols.override;if(I&&(A=A.slice(1)),!O[D]&&A.length?O[D]=new T:I&&(O[D]=A.length?new T:null,O.$_mutateRebuild()),!O[D])return O;I&&O[D].override();for(const $ of A){a($!==void 0,"Cannot call allow/valid/invalid with undefined"),a($!==f.symbols.override,"Override must be the first value");const F=D==="_invalids"?"_valids":"_invalids";O[F]&&(O[F].remove($),O[F].length||(a(D==="_valids"||!O._flags.only,"Setting invalid value",$,"leaves schema rejecting all values due to previous valid rule"),O[F]=null)),O[D].add($,O._refs)}return O}}};N.Base.prototype[f.symbols.any]={version:f.version,compile:g.compile,root:"$_root"},N.Base.prototype.isImmutable=!0,N.Base.prototype.deny=N.Base.prototype.invalid,N.Base.prototype.disallow=N.Base.prototype.invalid,N.Base.prototype.equal=N.Base.prototype.valid,N.Base.prototype.exist=N.Base.prototype.required,N.Base.prototype.not=N.Base.prototype.invalid,N.Base.prototype.options=N.Base.prototype.prefs,N.Base.prototype.preferences=N.Base.prototype.prefs,s.exports=new N.Base},8652:(s,i,o)=>{const a=o(375),c=o(8571),d=o(8160),h={max:1e3,supported:new Set(["undefined","boolean","number","string"])};i.provider={provision:u=>new h.Cache(u)},h.Cache=class{constructor(u={}){d.assertOptions(u,["max"]),a(u.max===void 0||u.max&&u.max>0&&isFinite(u.max),"Invalid max cache size"),this._max=u.max||h.max,this._map=new Map,this._list=new h.List}get length(){return this._map.size}set(u,f){if(u!==null&&!h.supported.has(typeof u))return;let g=this._map.get(u);if(g)return g.value=f,void this._list.first(g);g=this._list.unshift({key:u,value:f}),this._map.set(u,g),this._compact()}get(u){const f=this._map.get(u);if(f)return this._list.first(f),c(f.value)}_compact(){if(this._map.size>this._max){const u=this._list.pop();this._map.delete(u.key)}}},h.List=class{constructor(){this.tail=null,this.head=null}unshift(u){return u.next=null,u.prev=this.head,this.head&&(this.head.next=u),this.head=u,this.tail||(this.tail=u),u}first(u){u!==this.head&&(this._remove(u),this.unshift(u))}pop(){return this._remove(this.tail)}_remove(u){const{next:f,prev:g}=u;return f.prev=g,g&&(g.next=f),u===this.tail&&(this.tail=f),u.prev=null,u.next=null,u}}},8160:(s,i,o)=>{const a=o(375),c=o(7916),d=o(5934);let h,u;const f={isoDate:/^(?:[-+]\d{2})?(?:\d{4}(?!\d{2}\b))(?:(-?)(?:(?:0[1-9]|1[0-2])(?:\1(?:[12]\d|0[1-9]|3[01]))?|W(?:[0-4]\d|5[0-2])(?:-?[1-7])?|(?:00[1-9]|0[1-9]\d|[12]\d{2}|3(?:[0-5]\d|6[1-6])))(?![T]$|[T][\d]+Z$)(?:[T\s](?:(?:(?:[01]\d|2[0-3])(?:(:?)[0-5]\d)?|24\:?00)(?:[.,]\d+(?!:))?)(?:\2[0-5]\d(?:[.,]\d+)?)?(?:[Z]|(?:[+-])(?:[01]\d|2[0-3])(?::?[0-5]\d)?)?)?)?$/};i.version=d.version,i.defaults={abortEarly:!0,allowUnknown:!1,artifacts:!1,cache:!0,context:null,convert:!0,dateFormat:"iso",errors:{escapeHtml:!1,label:"path",language:null,render:!0,stack:!1,wrap:{label:'"',array:"[]"}},externals:!0,messages:{},nonEnumerables:!1,noDefaults:!1,presence:"optional",skipFunctions:!1,stripUnknown:!1,warnings:!1},i.symbols={any:Symbol.for("@hapi/joi/schema"),arraySingle:Symbol("arraySingle"),deepDefault:Symbol("deepDefault"),errors:Symbol("errors"),literal:Symbol("literal"),override:Symbol("override"),parent:Symbol("parent"),prefs:Symbol("prefs"),ref:Symbol("ref"),template:Symbol("template"),values:Symbol("values")},i.assertOptions=function(g,v,m="Options"){a(g&&typeof g=="object"&&!Array.isArray(g),"Options must be of type object");const x=Object.keys(g).filter(y=>!v.includes(y));a(x.length===0,`${m} contain unknown keys: ${x}`)},i.checkPreferences=function(g){u=u||o(3378);const v=u.preferences.validate(g);if(v.error)throw new c([v.error.details[0].message])},i.compare=function(g,v,m){switch(m){case"=":return g===v;case">":return g>v;case"<":return g<v;case">=":return g>=v;case"<=":return g<=v}},i.default=function(g,v){return g===void 0?v:g},i.isIsoDate=function(g){return f.isoDate.test(g)},i.isNumber=function(g){return typeof g=="number"&&!isNaN(g)},i.isResolvable=function(g){return!!g&&(g[i.symbols.ref]||g[i.symbols.template])},i.isSchema=function(g,v={}){const m=g&&g[i.symbols.any];return!!m&&(a(v.legacy||m.version===i.version,"Cannot mix different versions of joi schemas"),!0)},i.isValues=function(g){return g[i.symbols.values]},i.limit=function(g){return Number.isSafeInteger(g)&&g>=0},i.preferences=function(g,v){h=h||o(6914),g=g||{},v=v||{};const m=Object.assign({},g,v);return v.errors&&g.errors&&(m.errors=Object.assign({},g.errors,v.errors),m.errors.wrap=Object.assign({},g.errors.wrap,v.errors.wrap)),v.messages&&(m.messages=h.compile(v.messages,g.messages)),delete m[i.symbols.prefs],m},i.tryWithPath=function(g,v,m={}){try{return g()}catch(x){throw x.path!==void 0?x.path=v+"."+x.path:x.path=v,m.append&&(x.message=`${x.message} (${x.path})`),x}},i.validateArg=function(g,v,{assert:m,message:x}){if(i.isSchema(m)){const y=m.validate(g);return y.error?y.error.message:void 0}if(!m(g))return v?`${v} ${x}`:x},i.verifyFlat=function(g,v){for(const m of g)a(!Array.isArray(m),"Method no longer accepts array arguments:",v)}},3292:(s,i,o)=>{const a=o(375),c=o(8160),d=o(6133),h={};i.schema=function(u,f,g={}){c.assertOptions(g,["appendPath","override"]);try{return h.schema(u,f,g)}catch(v){throw g.appendPath&&v.path!==void 0&&(v.message=`${v.message} (${v.path})`),v}},h.schema=function(u,f,g){a(f!==void 0,"Invalid undefined schema"),Array.isArray(f)&&(a(f.length,"Invalid empty array schema"),f.length===1&&(f=f[0]));const v=(m,...x)=>g.override!==!1?m.valid(u.override,...x):m.valid(...x);if(h.simple(f))return v(u,f);if(typeof f=="function")return u.custom(f);if(a(typeof f=="object","Invalid schema content:",typeof f),c.isResolvable(f))return v(u,f);if(c.isSchema(f))return f;if(Array.isArray(f)){for(const m of f)if(!h.simple(m))return u.alternatives().try(...f);return v(u,...f)}return f instanceof RegExp?u.string().regex(f):f instanceof Date?v(u.date(),f):(a(Object.getPrototypeOf(f)===Object.getPrototypeOf({}),"Schema can only contain plain objects"),u.object().keys(f))},i.ref=function(u,f){return d.isRef(u)?u:d.create(u,f)},i.compile=function(u,f,g={}){c.assertOptions(g,["legacy"]);const v=f&&f[c.symbols.any];if(v)return a(g.legacy||v.version===c.version,"Cannot mix different versions of joi schemas:",v.version,c.version),f;if(typeof f!="object"||!g.legacy)return i.schema(u,f,{appendPath:!0});const m=h.walk(f);return m?m.compile(m.root,f):i.schema(u,f,{appendPath:!0})},h.walk=function(u){if(typeof u!="object")return null;if(Array.isArray(u)){for(const g of u){const v=h.walk(g);if(v)return v}return null}const f=u[c.symbols.any];if(f)return{root:u[f.root],compile:f.compile};a(Object.getPrototypeOf(u)===Object.getPrototypeOf({}),"Schema can only contain plain objects");for(const g in u){const v=h.walk(u[g]);if(v)return v}return null},h.simple=function(u){return u===null||["boolean","string","number"].includes(typeof u)},i.when=function(u,f,g){if(g===void 0&&(a(f&&typeof f=="object","Missing options"),g=f,f=d.create(".")),Array.isArray(g)&&(g={switch:g}),c.assertOptions(g,["is","not","then","otherwise","switch","break"]),c.isSchema(f))return a(g.is===void 0,'"is" can not be used with a schema condition'),a(g.not===void 0,'"not" can not be used with a schema condition'),a(g.switch===void 0,'"switch" can not be used with a schema condition'),h.condition(u,{is:f,then:g.then,otherwise:g.otherwise,break:g.break});if(a(d.isRef(f)||typeof f=="string","Invalid condition:",f),a(g.not===void 0||g.is===void 0,'Cannot combine "is" with "not"'),g.switch===void 0){let m=g;g.not!==void 0&&(m={is:g.not,then:g.otherwise,otherwise:g.then,break:g.break});let x=m.is!==void 0?u.$_compile(m.is):u.$_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"),g.is===void 0||d.isRef(g.is)||c.isSchema(g.is)||(x=x.required()),h.condition(u,{ref:i.ref(f),is:x,then:m.then,otherwise:m.otherwise,break:m.break})}a(Array.isArray(g.switch),'"switch" must be an array'),a(g.is===void 0,'Cannot combine "switch" with "is"'),a(g.not===void 0,'Cannot combine "switch" with "not"'),a(g.then===void 0,'Cannot combine "switch" with "then"');const v={ref:i.ref(f),switch:[],break:g.break};for(let m=0;m<g.switch.length;++m){const x=g.switch[m],y=m===g.switch.length-1;c.assertOptions(x,y?["is","then","otherwise"]:["is","then"]),a(x.is!==void 0,'Switch statement missing "is"'),a(x.then!==void 0,'Switch statement missing "then"');const b={is:u.$_compile(x.is),then:u.$_compile(x.then)};if(d.isRef(x.is)||c.isSchema(x.is)||(b.is=b.is.required()),y){a(g.otherwise===void 0||x.otherwise===void 0,'Cannot specify "otherwise" inside and outside a "switch"');const w=g.otherwise!==void 0?g.otherwise:x.otherwise;w!==void 0&&(a(v.break===void 0,"Cannot specify both otherwise and break"),b.otherwise=u.$_compile(w))}v.switch.push(b)}return v},h.condition=function(u,f){for(const g of["then","otherwise"])f[g]===void 0?delete f[g]:f[g]=u.$_compile(f[g]);return f}},6354:(s,i,o)=>{const a=o(5688),c=o(8160),d=o(3328);i.Report=class{constructor(h,u,f,g,v,m,x){if(this.code=h,this.flags=g,this.messages=v,this.path=m.path,this.prefs=x,this.state=m,this.value=u,this.message=null,this.template=null,this.local=f||{},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 y=this.path[this.path.length-1];typeof y!="object"&&(this.local.key=y)}}_setTemplate(h){if(this.template=h,!this.flags.label&&this.path.length===0){const u=this._template(this.template,"root");u&&(this.local.label=u)}}toString(){if(this.message)return this.message;const h=this.code;if(!this.prefs.errors.render)return this.code;const u=this._template(this.template)||this._template(this.prefs.messages)||this._template(this.messages);return u===void 0?`Error code "${h}" is not defined, your custom type is missing the correct messages definition`:(this.message=u.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(h,u){return i.template(this.value,h,u||this.code,this.state,this.prefs)}},i.path=function(h){let u="";for(const f of h)typeof f!="object"&&(typeof f=="string"?(u&&(u+="."),u+=f):u+=`[${f}]`);return u},i.template=function(h,u,f,g,v){if(!u)return;if(d.isTemplate(u))return f!=="root"?u:null;let m=v.errors.language;if(c.isResolvable(m)&&(m=m.resolve(h,g,v)),m&&u[m]){if(u[m][f]!==void 0)return u[m][f];if(u[m]["*"]!==void 0)return u[m]["*"]}return u[f]?u[f]:u["*"]},i.label=function(h,u,f,g){if(!f.errors.label)return"";if(h.label)return h.label;let v=u.path;return f.errors.label==="key"&&u.path.length>1&&(v=u.path.slice(-1)),i.path(v)||i.template(null,f.messages,"root",u,f)||g&&i.template(null,g,"root",u,f)||"value"},i.process=function(h,u,f){if(!h)return null;const{override:g,message:v,details:m}=i.details(h);if(g)return g;if(f.errors.stack)return new i.ValidationError(v,m,u);const x=Error.stackTraceLimit;Error.stackTraceLimit=0;const y=new i.ValidationError(v,m,u);return Error.stackTraceLimit=x,y},i.details=function(h,u={}){let f=[];const g=[];for(const v of h){if(v instanceof Error){if(u.override!==!1)return{override:v};const x=v.toString();f.push(x),g.push({message:x,type:"override",context:{error:v}});continue}const m=v.toString();f.push(m),g.push({message:m,path:v.path.filter(x=>typeof x!="object"),type:v.code,context:v.local})}return f.length>1&&(f=[...new Set(f)]),{message:f.join(". "),details:g}},i.ValidationError=class extends Error{constructor(h,u,f){super(h),this._original=f,this.details=u}static isError(h){return h instanceof i.ValidationError}},i.ValidationError.prototype.isJoi=!0,i.ValidationError.prototype.name="ValidationError",i.ValidationError.prototype.annotate=a.error},8901:(s,i,o)=>{const a=o(375),c=o(8571),d=o(8160),h=o(6914),u={};i.type=function(f,g){const v=Object.getPrototypeOf(f),m=c(v),x=f._assign(Object.create(m)),y=Object.assign({},g);delete y.base,m._definition=y;const b=v._definition||{};y.messages=h.merge(b.messages,y.messages),y.properties=Object.assign({},b.properties,y.properties),x.type=y.type,y.flags=Object.assign({},b.flags,y.flags);const w=Object.assign({},b.terms);if(y.terms)for(const N in y.terms){const A=y.terms[N];a(x.$_terms[N]===void 0,"Invalid term override for",y.type,N),x.$_terms[N]=A.init,w[N]=A}y.terms=w,y.args||(y.args=b.args),y.prepare=u.prepare(y.prepare,b.prepare),y.coerce&&(typeof y.coerce=="function"&&(y.coerce={method:y.coerce}),y.coerce.from&&!Array.isArray(y.coerce.from)&&(y.coerce={method:y.coerce.method,from:[].concat(y.coerce.from)})),y.coerce=u.coerce(y.coerce,b.coerce),y.validate=u.validate(y.validate,b.validate);const E=Object.assign({},b.rules);if(y.rules)for(const N in y.rules){const A=y.rules[N];a(typeof A=="object","Invalid rule definition for",y.type,N);let D=A.method;if(D===void 0&&(D=function(){return this.$_addRule(N)}),D&&(a(!m[N],"Rule conflict in",y.type,N),m[N]=D),a(!E[N],"Rule conflict in",y.type,N),E[N]=A,A.alias){const O=[].concat(A.alias);for(const I of O)m[I]=A.method}A.args&&(A.argsByName=new Map,A.args=A.args.map(O=>(typeof O=="string"&&(O={name:O}),a(!A.argsByName.has(O.name),"Duplicated argument name",O.name),d.isSchema(O.assert)&&(O.assert=O.assert.strict().label(O.name)),A.argsByName.set(O.name,O),O)))}y.rules=E;const R=Object.assign({},b.modifiers);if(y.modifiers)for(const N in y.modifiers){a(!m[N],"Rule conflict in",y.type,N);const A=y.modifiers[N];a(typeof A=="function","Invalid modifier definition for",y.type,N);const D=function(O){return this.rule({[N]:O})};m[N]=D,R[N]=A}if(y.modifiers=R,y.overrides){m._super=v,x.$_super={};for(const N in y.overrides)a(v[N],"Cannot override missing",N),y.overrides[N][d.symbols.parent]=v[N],x.$_super[N]=v[N].bind(x);Object.assign(m,y.overrides)}y.cast=Object.assign({},b.cast,y.cast);const T=Object.assign({},b.manifest,y.manifest);return T.build=u.build(y.manifest&&y.manifest.build,b.manifest&&b.manifest.build),y.manifest=T,y.rebuild=u.rebuild(y.rebuild,b.rebuild),x},u.build=function(f,g){return f&&g?function(v,m){return g(f(v,m),m)}:f||g},u.coerce=function(f,g){return f&&g?{from:f.from&&g.from?[...new Set([...f.from,...g.from])]:null,method(v,m){let x;if((!g.from||g.from.includes(typeof v))&&(x=g.method(v,m),x)){if(x.errors||x.value===void 0)return x;v=x.value}if(!f.from||f.from.includes(typeof v)){const y=f.method(v,m);if(y)return y}return x}}:f||g},u.prepare=function(f,g){return f&&g?function(v,m){const x=f(v,m);if(x){if(x.errors||x.value===void 0)return x;v=x.value}return g(v,m)||x}:f||g},u.rebuild=function(f,g){return f&&g?function(v){g(v),f(v)}:f||g},u.validate=function(f,g){return f&&g?function(v,m){const x=g(v,m);if(x){if(x.errors&&(!Array.isArray(x.errors)||x.errors.length))return x;v=x.value}return f(v,m)||x}:f||g}},5107:(s,i,o)=>{const a=o(375),c=o(8571),d=o(8652),h=o(8160),u=o(3292),f=o(6354),g=o(8901),v=o(9708),m=o(6133),x=o(3328),y=o(1152);let b;const w={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 E={_types:new Set(Object.keys(w.types))};for(const R of E._types)E[R]=function(...T){return a(!T.length||["alternatives","link","object"].includes(R),"The",R,"type does not allow arguments"),w.generate(this,w.types[R],T)};for(const R of["allow","custom","disallow","equal","exist","forbidden","invalid","not","only","optional","options","prefs","preferences","required","strip","valid","when"])E[R]=function(...T){return this.any()[R](...T)};Object.assign(E,w.methods);for(const R in w.aliases){const T=w.aliases[R];E[R]=E[T]}return E.x=E.expression,y.setup&&y.setup(E),E}};w.methods={ValidationError:f.ValidationError,version:h.version,cache:d.provider,assert(E,R,...T){w.assert(E,R,!0,T)},attempt:(E,R,...T)=>w.assert(E,R,!1,T),build(E){return a(typeof v.build=="function","Manifest functionality disabled"),v.build(this,E)},checkPreferences(E){h.checkPreferences(E)},compile(E,R){return u.compile(this,E,R)},defaults(E){a(typeof E=="function","modifier must be a function");const R=Object.assign({},this);for(const T of R._types){const N=E(R[T]());a(h.isSchema(N),"modifier must return a valid schema object"),R[T]=function(...A){return w.generate(this,N,A)}}return R},expression:(...E)=>new x(...E),extend(...E){h.verifyFlat(E,"extend"),b=b||o(3378),a(E.length,"You need to provide at least one extension"),this.assert(E,b.extensions);const R=Object.assign({},this);R._types=new Set(R._types);for(let T of E){typeof T=="function"&&(T=T(R)),this.assert(T,b.extension);const N=w.expandExtension(T,R);for(const A of N){a(R[A.type]===void 0||R._types.has(A.type),"Cannot override name",A.type);const D=A.base||this.any(),O=g.type(D,A);R._types.add(A.type),R[A.type]=function(...I){return w.generate(this,O,I)}}}return R},isError:f.ValidationError.isError,isExpression:x.isTemplate,isRef:m.isRef,isSchema:h.isSchema,in:(...E)=>m.in(...E),override:h.symbols.override,ref:(...E)=>m.create(...E),types(){const E={};for(const R of this._types)E[R]=this[R]();for(const R in w.aliases)E[R]=this[R]();return E}},w.assert=function(E,R,T,N){const A=N[0]instanceof Error||typeof N[0]=="string"?N[0]:null,D=A!==null?N[1]:N[0],O=R.validate(E,h.preferences({errors:{stack:!0}},D||{}));let I=O.error;if(!I)return O.value;if(A instanceof Error)throw A;const $=T&&typeof I.annotate=="function"?I.annotate():I.message;throw I instanceof f.ValidationError==0&&(I=c(I)),I.message=A?`${A} ${$}`:$,I},w.generate=function(E,R,T){return a(E,"Must be invoked on a Joi instance."),R.$_root=E,R._definition.args&&T.length?R._definition.args(R,...T):R},w.expandExtension=function(E,R){if(typeof E.type=="string")return[E];const T=[];for(const N of R._types)if(E.type.test(N)){const A=Object.assign({},E);A.type=N,A.base=R[N](),T.push(A)}return T},s.exports=w.root()},6914:(s,i,o)=>{const a=o(375),c=o(8571),d=o(3328);i.compile=function(h,u){if(typeof h=="string")return a(!u,"Cannot set single message string"),new d(h);if(d.isTemplate(h))return a(!u,"Cannot set single message template"),h;a(typeof h=="object"&&!Array.isArray(h),"Invalid message options"),u=u?c(u):{};for(let f in h){const g=h[f];if(f==="root"||d.isTemplate(g)){u[f]=g;continue}if(typeof g=="string"){u[f]=new d(g);continue}a(typeof g=="object"&&!Array.isArray(g),"Invalid message for",f);const v=f;for(f in u[v]=u[v]||{},g){const m=g[f];f==="root"||d.isTemplate(m)?u[v][f]=m:(a(typeof m=="string","Invalid message for",f,"in",v),u[v][f]=new d(m))}}return u},i.decompile=function(h){const u={};for(let f in h){const g=h[f];if(f==="root"){u.root=g;continue}if(d.isTemplate(g)){u[f]=g.describe({compact:!0});continue}const v=f;for(f in u[v]={},g){const m=g[f];f!=="root"?u[v][f]=m.describe({compact:!0}):u[v].root=m}}return u},i.merge=function(h,u){if(!h)return i.compile(u);if(!u)return h;if(typeof u=="string")return new d(u);if(d.isTemplate(u))return u;const f=c(h);for(let g in u){const v=u[g];if(g==="root"||d.isTemplate(v)){f[g]=v;continue}if(typeof v=="string"){f[g]=new d(v);continue}a(typeof v=="object"&&!Array.isArray(v),"Invalid message for",g);const m=g;for(g in f[m]=f[m]||{},v){const x=v[g];g==="root"||d.isTemplate(x)?f[m][g]=x:(a(typeof x=="string","Invalid message for",g,"in",m),f[m][g]=new d(x))}}return f}},2294:(s,i,o)=>{const a=o(375),c=o(8160),d=o(6133),h={};i.Ids=h.Ids=class{constructor(){this._byId=new Map,this._byKey=new Map,this._schemaChain=!1}clone(){const u=new h.Ids;return u._byId=new Map(this._byId),u._byKey=new Map(this._byKey),u._schemaChain=this._schemaChain,u}concat(u){u._schemaChain&&(this._schemaChain=!0);for(const[f,g]of u._byId.entries())a(!this._byKey.has(f),"Schema id conflicts with existing key:",f),this._byId.set(f,g);for(const[f,g]of u._byKey.entries())a(!this._byId.has(f),"Schema key conflicts with existing id:",f),this._byKey.set(f,g)}fork(u,f,g){const v=this._collect(u);v.push({schema:g});const m=v.shift();let x={id:m.id,schema:f(m.schema)};a(c.isSchema(x.schema),"adjuster function failed to return a joi schema type");for(const y of v)x={id:y.id,schema:h.fork(y.schema,x.id,x.schema)};return x.schema}labels(u,f=[]){const g=u[0],v=this._get(g);if(!v)return[...f,...u].join(".");const m=u.slice(1);return f=[...f,v.schema._flags.label||g],m.length?v.schema._ids.labels(m,f):f.join(".")}reach(u,f=[]){const g=u[0],v=this._get(g);a(v,"Schema does not contain path",[...f,...u].join("."));const m=u.slice(1);return m.length?v.schema._ids.reach(m,[...f,g]):v.schema}register(u,{key:f}={}){if(!u||!c.isSchema(u))return;(u.$_property("schemaChain")||u._ids._schemaChain)&&(this._schemaChain=!0);const g=u._flags.id;if(g){const v=this._byId.get(g);a(!v||v.schema===u,"Cannot add different schemas with the same id:",g),a(!this._byKey.has(g),"Schema id conflicts with existing key:",g),this._byId.set(g,{schema:u,id:g})}f&&(a(!this._byKey.has(f),"Schema already contains key:",f),a(!this._byId.has(f),"Schema key conflicts with existing id:",f),this._byKey.set(f,{schema:u,id:f}))}reset(){this._byId=new Map,this._byKey=new Map,this._schemaChain=!1}_collect(u,f=[],g=[]){const v=u[0],m=this._get(v);a(m,"Schema does not contain path",[...f,...u].join(".")),g=[m,...g];const x=u.slice(1);return x.length?m.schema._ids._collect(x,[...f,v],g):g}_get(u){return this._byId.get(u)||this._byKey.get(u)}},h.fork=function(u,f,g){const v=i.schema(u,{each:(m,{key:x})=>{if(f===(m._flags.id||x))return g},ref:!1});return v?v.$_mutateRebuild():u},i.schema=function(u,f){let g;for(const v in u._flags){if(v[0]==="_")continue;const m=h.scan(u._flags[v],{source:"flags",name:v},f);m!==void 0&&(g=g||u.clone(),g._flags[v]=m)}for(let v=0;v<u._rules.length;++v){const m=u._rules[v],x=h.scan(m.args,{source:"rules",name:m.name},f);if(x!==void 0){g=g||u.clone();const y=Object.assign({},m);y.args=x,g._rules[v]=y,g._singleRules.get(m.name)===m&&g._singleRules.set(m.name,y)}}for(const v in u.$_terms){if(v[0]==="_")continue;const m=h.scan(u.$_terms[v],{source:"terms",name:v},f);m!==void 0&&(g=g||u.clone(),g.$_terms[v]=m)}return g},h.scan=function(u,f,g,v,m){const x=v||[];if(u===null||typeof u!="object")return;let y;if(Array.isArray(u)){for(let b=0;b<u.length;++b){const w=f.source==="terms"&&f.name==="keys"&&u[b].key,E=h.scan(u[b],f,g,[b,...x],w);E!==void 0&&(y=y||u.slice(),y[b]=E)}return y}if(g.schema!==!1&&c.isSchema(u)||g.ref!==!1&&d.isRef(u)){const b=g.each(u,{...f,path:x,key:m});return b===u?void 0:b}for(const b in u){if(b[0]==="_")continue;const w=h.scan(u[b],f,g,[b,...x],m);w!==void 0&&(y=y||Object.assign({},u),y[b]=w)}return y}},6133:(s,i,o)=>{const a=o(375),c=o(8571),d=o(9621),h=o(8160);let u;const f={symbol:Symbol("ref"),defaults:{adjust:null,in:!1,iterables:null,map:null,separator:".",type:"value"}};i.create=function(g,v={}){a(typeof g=="string","Invalid reference key:",g),h.assertOptions(v,["adjust","ancestor","in","iterables","map","prefix","render","separator"]),a(!v.prefix||typeof v.prefix=="object","options.prefix must be of type object");const m=Object.assign({},f.defaults,v);delete m.prefix;const x=m.separator,y=f.context(g,x,v.prefix);if(m.type=y.type,g=y.key,m.type==="value")if(y.root&&(a(!x||g[0]!==x,"Cannot specify relative path with root prefix"),m.ancestor="root",g||(g=null)),x&&x===g)g=null,m.ancestor=0;else if(m.ancestor!==void 0)a(!x||!g||g[0]!==x,"Cannot combine prefix with ancestor option");else{const[b,w]=f.ancestor(g,x);w&&(g=g.slice(w))===""&&(g=null),m.ancestor=b}return m.path=x?g===null?[]:g.split(x):[g],new f.Ref(m)},i.in=function(g,v={}){return i.create(g,{...v,in:!0})},i.isRef=function(g){return!!g&&!!g[h.symbols.ref]},f.Ref=class{constructor(g){a(typeof g=="object","Invalid reference construction"),h.assertOptions(g,["adjust","ancestor","in","iterables","map","path","render","separator","type","depth","key","root","display"]),a([!1,void 0].includes(g.separator)||typeof g.separator=="string"&&g.separator.length===1,"Invalid separator"),a(!g.adjust||typeof g.adjust=="function","options.adjust must be a function"),a(!g.map||Array.isArray(g.map),"options.map must be an array"),a(!g.map||!g.adjust,"Cannot set both map and adjust options"),Object.assign(this,f.defaults,g),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(g,v,m,x,y={}){return a(!this.in||y.in,"Invalid in() reference usage"),this.type==="global"?this._resolve(m.context,v,y):this.type==="local"?this._resolve(x,v,y):this.ancestor?this.ancestor==="root"?this._resolve(v.ancestors[v.ancestors.length-1],v,y):(a(this.ancestor<=v.ancestors.length,"Invalid reference exceeds the schema root:",this.display),this._resolve(v.ancestors[this.ancestor-1],v,y)):this._resolve(g,v,y)}_resolve(g,v,m){let x;if(this.type==="value"&&v.mainstay.shadow&&m.shadow!==!1&&(x=v.mainstay.shadow.get(this.absolute(v))),x===void 0&&(x=d(g,this.path,{iterables:this.iterables,functions:!0})),this.adjust&&(x=this.adjust(x)),this.map){const y=this.map.get(x);y!==void 0&&(x=y)}return v.mainstay&&v.mainstay.tracer.resolve(v,this,x),x}toString(){return this.display}absolute(g){return[...g.path.slice(0,-this.ancestor),...this.path]}clone(){return new f.Ref(this)}describe(){const g={path:this.path};this.type!=="value"&&(g.type=this.type),this.separator!=="."&&(g.separator=this.separator),this.type==="value"&&this.ancestor!==1&&(g.ancestor=this.ancestor),this.map&&(g.map=[...this.map]);for(const v of["adjust","iterables","render"])this[v]!==null&&this[v]!==void 0&&(g[v]=this[v]);return this.in!==!1&&(g.in=!0),{ref:g}}updateDisplay(){const g=this.key!==null?this.key:"";if(this.type!=="value")return void(this.display=`ref:${this.type}:${g}`);if(!this.separator)return void(this.display=`ref:${g}`);if(!this.ancestor)return void(this.display=`ref:${this.separator}${g}`);if(this.ancestor==="root")return void(this.display=`ref:root:${g}`);if(this.ancestor===1)return void(this.display=`ref:${g||".."}`);const v=new Array(this.ancestor+1).fill(this.separator).join("");this.display=`ref:${v}${g||""}`}},f.Ref.prototype[h.symbols.ref]=!0,i.build=function(g){return(g=Object.assign({},f.defaults,g)).type==="value"&&g.ancestor===void 0&&(g.ancestor=1),new f.Ref(g)},f.context=function(g,v,m={}){if(g=g.trim(),m){const x=m.global===void 0?"$":m.global;if(x!==v&&g.startsWith(x))return{key:g.slice(x.length),type:"global"};const y=m.local===void 0?"#":m.local;if(y!==v&&g.startsWith(y))return{key:g.slice(y.length),type:"local"};const b=m.root===void 0?"/":m.root;if(b!==v&&g.startsWith(b))return{key:g.slice(b.length),type:"value",root:!0}}return{key:g,type:"value"}},f.ancestor=function(g,v){if(!v)return[1,0];if(g[0]!==v)return[1,0];if(g[1]!==v)return[0,1];let m=2;for(;g[m]===v;)++m;return[m-1,m]},i.toSibling=0,i.toParent=1,i.Manager=class{constructor(){this.refs=[]}register(g,v){if(g)if(v=v===void 0?i.toParent:v,Array.isArray(g))for(const m of g)this.register(m,v);else if(h.isSchema(g))for(const m of g._refs.refs)m.ancestor-v>=0&&this.refs.push({ancestor:m.ancestor-v,root:m.root});else i.isRef(g)&&g.type==="value"&&g.ancestor-v>=0&&this.refs.push({ancestor:g.ancestor-v,root:g.root}),u=u||o(3328),u.isTemplate(g)&&this.register(g.refs(),v)}get length(){return this.refs.length}clone(){const g=new i.Manager;return g.refs=c(this.refs),g}reset(){this.refs=[]}roots(){return this.refs.filter(g=>!g.ancestor).map(g=>g.root)}}},3378:(s,i,o)=>{const a=o(5107),c={};c.wrap=a.string().min(1).max(2).allow(!1),i.preferences=a.object({allowUnknown:a.boolean(),abortEarly:a.boolean(),artifacts:a.boolean(),cache:a.boolean(),context:a.object(),convert:a.boolean(),dateFormat:a.valid("date","iso","string","time","utc"),debug:a.boolean(),errors:{escapeHtml:a.boolean(),label:a.valid("path","key",!1),language:[a.string(),a.object().ref()],render:a.boolean(),stack:a.boolean(),wrap:{label:c.wrap,array:c.wrap,string:c.wrap}},externals:a.boolean(),messages:a.object(),noDefaults:a.boolean(),nonEnumerables:a.boolean(),presence:a.valid("required","optional","forbidden"),skipFunctions:a.boolean(),stripUnknown:a.object({arrays:a.boolean(),objects:a.boolean()}).or("arrays","objects").allow(!0,!1),warnings:a.boolean()}).strict(),c.nameRx=/^[a-zA-Z0-9]\w*$/,c.rule=a.object({alias:a.array().items(a.string().pattern(c.nameRx)).single(),args:a.array().items(a.string(),a.object({name:a.string().pattern(c.nameRx).required(),ref:a.boolean(),assert:a.alternatives([a.function(),a.object().schema()]).conditional("ref",{is:!0,then:a.required()}),normalize:a.function(),message:a.string().when("assert",{is:a.function(),then:a.required()})})),convert:a.boolean(),manifest:a.boolean(),method:a.function().allow(!1),multi:a.boolean(),validate:a.function()}),i.extension=a.object({type:a.alternatives([a.string(),a.object().regex()]).required(),args:a.function(),cast:a.object().pattern(c.nameRx,a.object({from:a.function().maxArity(1).required(),to:a.function().minArity(1).maxArity(2).required()})),base:a.object().schema().when("type",{is:a.object().regex(),then:a.forbidden()}),coerce:[a.function().maxArity(3),a.object({method:a.function().maxArity(3).required(),from:a.array().items(a.string()).single()})],flags:a.object().pattern(c.nameRx,a.object({setter:a.string(),default:a.any()})),manifest:{build:a.function().arity(2)},messages:[a.object(),a.string()],modifiers:a.object().pattern(c.nameRx,a.function().minArity(1).maxArity(2)),overrides:a.object().pattern(c.nameRx,a.function()),prepare:a.function().maxArity(3),rebuild:a.function().arity(1),rules:a.object().pattern(c.nameRx,c.rule),terms:a.object().pattern(c.nameRx,a.object({init:a.array().allow(null).required(),manifest:a.object().pattern(/.+/,[a.valid("schema","single"),a.object({mapped:a.object({from:a.string().required(),to:a.string().required()}).required()})])})),validate:a.function().maxArity(3)}).strict(),i.extensions=a.array().items(a.object(),a.function().arity(1)).strict(),c.desc={buffer:a.object({buffer:a.string()}),func:a.object({function:a.function().required(),options:{literal:!0}}),override:a.object({override:!0}),ref:a.object({ref:a.object({type:a.valid("value","global","local"),path:a.array().required(),separator:a.string().length(1).allow(!1),ancestor:a.number().min(0).integer().allow("root"),map:a.array().items(a.array().length(2)).min(1),adjust:a.function(),iterables:a.boolean(),in:a.boolean(),render:a.boolean()}).required()}),regex:a.object({regex:a.string().min(3)}),special:a.object({special:a.valid("deep").required()}),template:a.object({template:a.string().required(),options:a.object()}),value:a.object({value:a.alternatives([a.object(),a.array()]).required()})},c.desc.entity=a.alternatives([a.array().items(a.link("...")),a.boolean(),a.function(),a.number(),a.string(),c.desc.buffer,c.desc.func,c.desc.ref,c.desc.regex,c.desc.special,c.desc.template,c.desc.value,a.link("/")]),c.desc.values=a.array().items(null,a.boolean(),a.function(),a.number().allow(1/0,-1/0),a.string().allow(""),a.symbol(),c.desc.buffer,c.desc.func,c.desc.override,c.desc.ref,c.desc.regex,c.desc.template,c.desc.value),c.desc.messages=a.object().pattern(/.+/,[a.string(),c.desc.template,a.object().pattern(/.+/,[a.string(),c.desc.template])]),i.description=a.object({type:a.string().required(),flags:a.object({cast:a.string(),default:a.any(),description:a.string(),empty:a.link("/"),failover:c.desc.entity,id:a.string(),label:a.string(),only:!0,presence:["optional","required","forbidden"],result:["raw","strip"],strip:a.boolean(),unit:a.string()}).unknown(),preferences:{allowUnknown:a.boolean(),abortEarly:a.boolean(),artifacts:a.boolean(),cache:a.boolean(),convert:a.boolean(),dateFormat:["date","iso","string","time","utc"],errors:{escapeHtml:a.boolean(),label:["path","key"],language:[a.string(),c.desc.ref],wrap:{label:c.wrap,array:c.wrap}},externals:a.boolean(),messages:c.desc.messages,noDefaults:a.boolean(),nonEnumerables:a.boolean(),presence:["required","optional","forbidden"],skipFunctions:a.boolean(),stripUnknown:a.object({arrays:a.boolean(),objects:a.boolean()}).or("arrays","objects").allow(!0,!1),warnings:a.boolean()},allow:c.desc.values,invalid:c.desc.values,rules:a.array().min(1).items({name:a.string().required(),args:a.object().min(1),keep:a.boolean(),message:[a.string(),c.desc.messages],warn:a.boolean()}),keys:a.object().pattern(/.*/,a.link("/")),link:c.desc.ref}).pattern(/^[a-z]\w*$/,a.any())},493:(s,i,o)=>{const a=o(8571),c=o(9621),d=o(8160),h={value:Symbol("value")};s.exports=h.State=class{constructor(u,f,g){this.path=u,this.ancestors=f,this.mainstay=g.mainstay,this.schemas=g.schemas,this.debug=null}localize(u,f=null,g=null){const v=new h.State(u,f,this);return g&&v.schemas&&(v.schemas=[h.schemas(g),...v.schemas]),v}nest(u,f){const g=new h.State(this.path,this.ancestors,this);return g.schemas=g.schemas&&[h.schemas(u),...g.schemas],g.debug=f,g}shadow(u,f){this.mainstay.shadow=this.mainstay.shadow||new h.Shadow,this.mainstay.shadow.set(this.path,u,f)}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()}},h.schemas=function(u){return d.isSchema(u)?{schema:u}:u},h.Shadow=class{constructor(){this._values=null}set(u,f,g){if(!u.length||g==="strip"&&typeof u[u.length-1]=="number")return;this._values=this._values||new Map;let v=this._values;for(let m=0;m<u.length;++m){const x=u[m];let y=v.get(x);y||(y=new Map,v.set(x,y)),v=y}v[h.value]=f}get(u){const f=this.node(u);if(f)return f[h.value]}node(u){if(this._values)return c(this._values,u,{iterables:!0})}override(u,f){if(!this._values)return;const g=u.slice(0,-1),v=u[u.length-1],m=c(this._values,g,{iterables:!0});f?m.set(v,f):m&&m.delete(v)}}},3328:(s,i,o)=>{const a=o(375),c=o(8571),d=o(5277),h=o(1447),u=o(8160),f=o(6354),g=o(6133),v={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=v.Template=class{constructor(m,x){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,x){const{functions:y,...b}=x;this._settings=Object.keys(b).length?c(b):void 0,this._functions=y,this._functions&&(a(Object.keys(this._functions).every(w=>typeof w=="string"),"Functions keys must be strings"),a(Object.values(this._functions).every(w=>typeof w=="function"),"Functions values must be functions"))}else this._settings=void 0,this._functions=void 0;this._parse()}_parse(){if(!this.source.includes("{"))return;const m=v.encode(this.source),x=v.split(m);let y=!1;const b=[],w=x.shift();w&&b.push(w);for(const E of x){const R=E[0]!=="{",T=R?"}":"}}",N=E.indexOf(T);if(N===-1||E[1]==="{"){b.push(`{${v.decode(E)}`);continue}let A=E.slice(R?0:1,N);const D=A[0]===":";D&&(A=A.slice(1));const O=this._ref(v.decode(A),{raw:R,wrapped:D});b.push(O),typeof O!="string"&&(y=!0);const I=E.slice(N+T.length);I&&b.push(v.decode(I))}y?this._template=b:this.rendered=b.join("")}static date(m,x){return v.dateFormat[x.dateFormat].call(m)}describe(m={}){if(!this._settings&&m.compact)return this.source;const x={template:this.source};return this._settings&&(x.options=this._settings),this._functions&&(x.functions=this._functions),x}static build(m){return new v.Template(m.template,m.options||m.functions?{...m.options,functions:m.functions}:void 0)}isDynamic(){return!!this._template}static isTemplate(m){return!!m&&!!m[u.symbols.template]}refs(){if(!this._template)return;const m=[];for(const x of this._template)typeof x!="string"&&m.push(...x.refs);return m}resolve(m,x,y,b){return this._template&&this._template.length===1?this._part(this._template[0],m,x,y,b,{}):this.render(m,x,y,b)}_part(m,...x){return m.ref?m.ref.resolve(...x):m.formula.evaluate(x)}render(m,x,y,b,w={}){if(!this.isDynamic())return this.rendered;const E=[];for(const R of this._template)if(typeof R=="string")E.push(R);else{const T=this._part(R,m,x,y,b,w),N=v.stringify(T,m,x,y,b,w);if(N!==void 0){const A=R.raw||(w.errors&&w.errors.escapeHtml)===!1?N:d(N);E.push(v.wrap(A,R.wrapped&&y.errors.wrap.label))}}return E.join("")}_ref(m,{raw:x,wrapped:y}){const b=[],w=R=>{const T=g.create(R,this._settings);return b.push(T),N=>{const A=T.resolve(...N);return A!==void 0?A:null}};try{const R=this._functions?{...v.functions,...this._functions}:v.functions;var E=new h.Parser(m,{reference:w,functions:R,constants:v.constants})}catch(R){throw R.message=`Invalid template variable "${m}" fails due to: ${R.message}`,R}if(E.single){if(E.single.type==="reference"){const R=b[0];return{ref:R,raw:x,refs:b,wrapped:y||R.type==="local"&&R.key==="label"}}return v.stringify(E.single.value)}return{formula:E,raw:x,refs:b}}toString(){return this.source}},v.Template.prototype[u.symbols.template]=!0,v.Template.prototype.isImmutable=!0,v.encode=function(m){return m.replace(/\\(\{+)/g,(x,y)=>v.opens.slice(0,y.length)).replace(/\\(\}+)/g,(x,y)=>v.closes.slice(0,y.length))},v.decode=function(m){return m.replace(/\u0000/g,"{").replace(/\u0001/g,"}")},v.split=function(m){const x=[];let y="";for(let b=0;b<m.length;++b){const w=m[b];if(w==="{"){let E="";for(;b+1<m.length&&m[b+1]==="{";)E+="{",++b;x.push(y),y=E}else y+=w}return x.push(y),x},v.wrap=function(m,x){return x?x.length===1?`${x}${m}${x}`:`${x[0]}${m}${x[1]}`:m},v.stringify=function(m,x,y,b,w,E={}){const R=typeof m,T=b&&b.errors&&b.errors.wrap||{};let N=!1;if(g.isRef(m)&&m.render&&(N=m.in,m=m.resolve(x,y,b,w,{in:m.in,...E})),m===null)return"null";if(R==="string")return v.wrap(m,E.arrayItems&&T.string);if(R==="number"||R==="function"||R==="symbol")return m.toString();if(R!=="object")return JSON.stringify(m);if(m instanceof Date)return v.Template.date(m,b);if(m instanceof Map){const D=[];for(const[O,I]of m.entries())D.push(`${O.toString()} -> ${I.toString()}`);m=D}if(!Array.isArray(m))return m.toString();const A=[];for(const D of m)A.push(v.stringify(D,x,y,b,w,{arrayItems:!0,...E}));return v.wrap(A.join(", "),!N&&T.array)},v.constants={true:!0,false:!1,null:null,second:1e3,minute:6e4,hour:36e5,day:864e5},v.functions={if:(m,x,y)=>m?x:y,length:m=>typeof m=="string"?m.length:m&&typeof m=="object"?Array.isArray(m)?m.length:Object.keys(m).length:null,msg(m){const[x,y,b,w,E]=this,R=E.messages;if(!R)return"";const T=f.template(x,R[0],m,y,b)||f.template(x,R[1],m,y,b);return T?T.render(x,y,b,w,E):""},number:m=>typeof m=="number"?m:typeof m=="string"?parseFloat(m):typeof m=="boolean"?m?1:0:m instanceof Date?m.getTime():null}},4946:(s,i,o)=>{const a=o(375),c=o(1687),d=o(8068),h=o(8160),u=o(3292),f=o(6354),g=o(6133),v={};s.exports=d.extend({type:"alternatives",flags:{match:{default:"any"}},terms:{matches:{init:[],register:g.toSibling}},args:(m,...x)=>x.length===1&&Array.isArray(x[0])?m.try(...x[0]):m.try(...x),validate(m,x){const{schema:y,error:b,state:w,prefs:E}=x;if(y._flags.match){const T=[],N=[];for(let D=0;D<y.$_terms.matches.length;++D){const O=y.$_terms.matches[D],I=w.nest(O.schema,`match.${D}`);I.snapshot();const $=O.schema.$_validate(m,I,E);$.errors?(N.push($.errors),I.restore()):(T.push($.value),I.commit())}if(T.length===0)return{errors:b("alternatives.any",{details:N.map(D=>f.details(D,{override:!1}))})};if(y._flags.match==="one")return T.length===1?{value:T[0]}:{errors:b("alternatives.one")};if(T.length!==y.$_terms.matches.length)return{errors:b("alternatives.all",{details:N.map(D=>f.details(D,{override:!1}))})};const A=D=>D.$_terms.matches.some(O=>O.schema.type==="object"||O.schema.type==="alternatives"&&A(O.schema));return A(y)?{value:T.reduce((D,O)=>c(D,O,{mergeArrays:!1}))}:{value:T[T.length-1]}}const R=[];for(let T=0;T<y.$_terms.matches.length;++T){const N=y.$_terms.matches[T];if(N.schema){const O=w.nest(N.schema,`match.${T}`);O.snapshot();const I=N.schema.$_validate(m,O,E);if(!I.errors)return O.commit(),I;O.restore(),R.push({schema:N.schema,reports:I.errors});continue}const A=N.ref?N.ref.resolve(m,w,E):m,D=N.is?[N]:N.switch;for(let O=0;O<D.length;++O){const I=D[O],{is:$,then:F,otherwise:B}=I,W=`match.${T}${N.switch?"."+O:""}`;if($.$_match(A,w.nest($,`${W}.is`),E)){if(F)return F.$_validate(m,w.nest(F,`${W}.then`),E)}else if(B)return B.$_validate(m,w.nest(B,`${W}.otherwise`),E)}}return v.errors(R,x)},rules:{conditional:{method(m,x){a(!this._flags._endedSwitch,"Unreachable condition"),a(!this._flags.match,"Cannot combine match mode",this._flags.match,"with conditional rule"),a(x.break===void 0,"Cannot use break option with alternatives conditional");const y=this.clone(),b=u.when(y,m,x),w=b.is?[b]:b.switch;for(const E of w)if(E.then&&E.otherwise){y.$_setFlag("_endedSwitch",!0,{clone:!1});break}return y.$_terms.matches.push(b),y.$_mutateRebuild()}},match:{method(m){if(a(["any","one","all"].includes(m),"Invalid alternatives match mode",m),m!=="any")for(const x of this.$_terms.matches)a(x.schema,"Cannot combine match mode",m,"with conditional rules");return this.$_setFlag("match",m)}},try:{method(...m){a(m.length,"Missing alternative schemas"),h.verifyFlat(m,"try"),a(!this._flags._endedSwitch,"Unreachable condition");const x=this.clone();for(const y of m)x.$_terms.matches.push({schema:x.$_compile(y)});return x.$_mutateRebuild()}}},overrides:{label(m){return this.$_parent("label",m).$_modify({each:(x,y)=>y.path[0]!=="is"&&typeof x._flags.label!="string"?x.label(m):void 0,ref:!1})}},rebuild(m){m.$_modify({each:x=>{h.isSchema(x)&&x.type==="array"&&m.$_setFlag("_arrayItems",!0,{clone:!1})}})},manifest:{build(m,x){if(x.matches)for(const y of x.matches){const{schema:b,ref:w,is:E,not:R,then:T,otherwise:N}=y;m=b?m.try(b):w?m.conditional(w,{is:E,then:T,not:R,otherwise:N,switch:y.switch}):m.conditional(E,{then:T,otherwise:N})}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}}"}}),v.errors=function(m,{error:x,state:y}){if(!m.length)return{errors:x("alternatives.any")};if(m.length===1)return{errors:m[0].reports};const b=new Set,w=[];for(const{reports:E,schema:R}of m){if(E.length>1)return v.unmatched(m,x);const T=E[0];if(T instanceof f.Report==0)return v.unmatched(m,x);if(T.state.path.length!==y.path.length){w.push({type:R.type,report:T});continue}if(T.code==="any.only"){for(const D of T.local.valids)b.add(D);continue}const[N,A]=T.code.split(".");A!=="base"?w.push({type:R.type,report:T}):T.code==="object.base"?b.add(T.local.type):b.add(N)}return w.length?w.length===1?{errors:w[0].report}:v.unmatched(m,x):{errors:x("alternatives.types",{types:[...b]})}},v.unmatched=function(m,x){const y=[];for(const b of m)y.push(...b.reports);return{errors:x("alternatives.match",f.details(y,{override:!1}))}}},8068:(s,i,o)=>{const a=o(375),c=o(7629),d=o(8160),h=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(u,f){return a(typeof u=="function","Method must be a function"),a(f===void 0||f&&typeof f=="string","Description must be a non-empty string"),this.$_addRule({name:"custom",args:{method:u,description:f}})},validate(u,f,{method:g}){try{return g(u,f)}catch(v){return f.error("any.custom",{error:v})}},args:["method","description"],multi:!0},messages:{method(u){return this.prefs({messages:u})}},shared:{method(u){a(d.isSchema(u)&&u._flags.id,"Schema must be a schema with an id");const f=this.clone();return f.$_terms.shared=f.$_terms.shared||[],f.$_terms.shared.push(u),f.$_mutateRegister(u),f}},warning:{method(u,f){return a(u&&typeof u=="string","Invalid warning code"),this.$_addRule({name:"warning",args:{code:u,local:f},warn:!0})},validate:(u,f,{code:g,local:v})=>f.error(g,v),args:["code","local"],multi:!0}},modifiers:{keep(u,f=!0){u.keep=f},message(u,f){u.message=h.compile(f)},warn(u,f=!0){u.warn=f}},manifest:{build(u,f){for(const g in f){const v=f[g];if(["examples","externals","metas","notes","tags"].includes(g))for(const m of v)u=u[g.slice(0,-1)](m);else if(g!=="alterations")if(g!=="whens"){if(g==="shared")for(const m of v)u=u.shared(m)}else for(const m of v){const{ref:x,is:y,not:b,then:w,otherwise:E,concat:R}=m;u=R?u.concat(R):x?u.when(x,{is:y,not:b,then:w,otherwise:E,switch:m.switch,break:m.break}):u.when(y,{then:w,otherwise:E,break:m.break})}else{const m={};for(const{target:x,adjuster:y}of v)m[x]=y;u=u.alter(m)}}return u}},messages:{"any.custom":"{{#label}} failed custom validation because {{#error.message}}","any.default":"{{#label}} threw an error when running default method","any.failover":"{{#label}} threw an error when running failover method","any.invalid":"{{#label}} contains an invalid value","any.only":'{{#label}} must be {if(#valids.length == 1, "", "one of ")}{{#valids}}',"any.ref":"{{#label}} {{#arg}} references {{:#ref}} which {{#reason}}","any.required":"{{#label}} is required","any.unknown":"{{#label}} is not allowed"}})},546:(s,i,o)=>{const a=o(375),c=o(9474),d=o(9621),h=o(8068),u=o(8160),f=o(3292),g={};s.exports=h.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(v,{schema:m,state:x,prefs:y}){if(!Array.isArray(v))return;const b=m.$_getRule("sort");return b?g.sort(m,v,b.args.options,x,y):void 0}},validate(v,{schema:m,error:x}){if(!Array.isArray(v)){if(m._flags.single){const y=[v];return y[u.symbols.arraySingle]=!0,{value:y}}return{errors:x("array.base")}}if(m.$_getRule("items")||m.$_terms.externals)return{value:v.slice()}},rules:{has:{method(v){v=this.$_compile(v,{appendPath:!0});const m=this.$_addRule({name:"has",args:{schema:v}});return m.$_mutateRegister(v),m},validate(v,{state:m,prefs:x,error:y},{schema:b}){const w=[v,...m.ancestors];for(let R=0;R<v.length;++R){const T=m.localize([...m.path,R],w,b);if(b.$_match(v[R],T,x))return v}const E=b._flags.label;return E?y("array.hasKnown",{patternLabel:E}):y("array.hasUnknown",null)},multi:!0},items:{method(...v){u.verifyFlat(v,"items");const m=this.$_addRule("items");for(let x=0;x<v.length;++x){const y=u.tryWithPath(()=>this.$_compile(v[x]),x,{append:!0});m.$_terms.items.push(y)}return m.$_mutateRebuild()},validate(v,{schema:m,error:x,state:y,prefs:b,errorsArray:w}){const E=m.$_terms._requireds.slice(),R=m.$_terms.ordered.slice(),T=[...m.$_terms._inclusions,...E],N=!v[u.symbols.arraySingle];delete v[u.symbols.arraySingle];const A=w();let D=v.length;for(let O=0;O<D;++O){const I=v[O];let $=!1,F=!1;const B=N?O:new Number(O),W=[...y.path,B];if(!m._flags.sparse&&I===void 0){if(A.push(x("array.sparse",{key:B,path:W,pos:O,value:void 0},y.localize(W))),b.abortEarly)return A;R.shift();continue}const Z=[v,...y.ancestors];for(const he of m.$_terms._exclusions)if(he.$_match(I,y.localize(W,Z,he),b,{presence:"ignore"})){if(A.push(x("array.excludes",{pos:O,value:I},y.localize(W))),b.abortEarly)return A;$=!0,R.shift();break}if($)continue;if(m.$_terms.ordered.length){if(R.length){const he=R.shift(),re=he.$_validate(I,y.localize(W,Z,he),b);if(re.errors){if(A.push(...re.errors),b.abortEarly)return A}else if(he._flags.result==="strip")g.fastSplice(v,O),--O,--D;else{if(!m._flags.sparse&&re.value===void 0){if(A.push(x("array.sparse",{key:B,path:W,pos:O,value:void 0},y.localize(W))),b.abortEarly)return A;continue}v[O]=re.value}continue}if(!m.$_terms.items.length){if(A.push(x("array.orderedLength",{pos:O,limit:m.$_terms.ordered.length})),b.abortEarly)return A;break}}const Y=[];let H=E.length;for(let he=0;he<H;++he){const re=y.localize(W,Z,E[he]);re.snapshot();const J=E[he].$_validate(I,re,b);if(Y[he]=J,!J.errors){if(re.commit(),v[O]=J.value,F=!0,g.fastSplice(E,he),--he,--H,!m._flags.sparse&&J.value===void 0&&(A.push(x("array.sparse",{key:B,path:W,pos:O,value:void 0},y.localize(W))),b.abortEarly))return A;break}re.restore()}if(F)continue;const se=b.stripUnknown&&!!b.stripUnknown.arrays||!1;H=T.length;for(const he of T){let re;const J=E.indexOf(he);if(J!==-1)re=Y[J];else{const te=y.localize(W,Z,he);if(te.snapshot(),re=he.$_validate(I,te,b),!re.errors){te.commit(),he._flags.result==="strip"?(g.fastSplice(v,O),--O,--D):m._flags.sparse||re.value!==void 0?v[O]=re.value:(A.push(x("array.sparse",{key:B,path:W,pos:O,value:void 0},y.localize(W))),$=!0),F=!0;break}te.restore()}if(H===1){if(se){g.fastSplice(v,O),--O,--D,F=!0;break}if(A.push(...re.errors),b.abortEarly)return A;$=!0;break}}if(!$&&(m.$_terms._inclusions.length||m.$_terms._requireds.length)&&!F){if(se){g.fastSplice(v,O),--O,--D;continue}if(A.push(x("array.includes",{pos:O,value:I},y.localize(W))),b.abortEarly)return A}}return E.length&&g.fillMissedErrors(m,A,E,v,y,b),R.length&&(g.fillOrderedErrors(m,A,R,v,y,b),A.length||g.fillDefault(R,v,y,b)),A.length?A:v},priority:!0,manifest:!1},length:{method(v){return this.$_addRule({name:"length",args:{limit:v},operator:"="})},validate:(v,m,{limit:x},{name:y,operator:b,args:w})=>u.compare(v.length,x,b)?v:m.error("array."+y,{limit:w.limit,value:v}),args:[{name:"limit",ref:!0,assert:u.limit,message:"must be a positive integer"}]},max:{method(v){return this.$_addRule({name:"max",method:"length",args:{limit:v},operator:"<="})}},min:{method(v){return this.$_addRule({name:"min",method:"length",args:{limit:v},operator:">="})}},ordered:{method(...v){u.verifyFlat(v,"ordered");const m=this.$_addRule("items");for(let x=0;x<v.length;++x){const y=u.tryWithPath(()=>this.$_compile(v[x]),x,{append:!0});g.validateSingle(y,m),m.$_mutateRegister(y),m.$_terms.ordered.push(y)}return m.$_mutateRebuild()}},single:{method(v){const m=v===void 0||!!v;return a(!m||!this._flags._arrayItems,"Cannot specify single rule when array has array items"),this.$_setFlag("single",m)}},sort:{method(v={}){u.assertOptions(v,["by","order"]);const m={order:v.order||"ascending"};return v.by&&(m.by=f.ref(v.by,{ancestor:0}),a(!m.by.ancestor,"Cannot sort by ancestor")),this.$_addRule({name:"sort",args:{options:m}})},validate(v,{error:m,state:x,prefs:y,schema:b},{options:w}){const{value:E,errors:R}=g.sort(b,v,w,x,y);if(R)return R;for(let T=0;T<v.length;++T)if(v[T]!==E[T])return m("array.sort",{order:w.order,by:w.by?w.by.key:"value"});return v},convert:!0},sparse:{method(v){const m=v===void 0||!!v;return this._flags.sparse===m?this:(m?this.clone():this.$_addRule("items")).$_setFlag("sparse",m,{clone:!1})}},unique:{method(v,m={}){a(!v||typeof v=="function"||typeof v=="string","comparator must be a function or a string"),u.assertOptions(m,["ignoreUndefined","separator"]);const x={name:"unique",args:{options:m,comparator:v}};if(v)if(typeof v=="string"){const y=u.default(m.separator,".");x.path=y?v.split(y):[v]}else x.comparator=v;return this.$_addRule(x)},validate(v,{state:m,error:x,schema:y},{comparator:b,options:w},{comparator:E,path:R}){const T={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},N=E||c,A=w.ignoreUndefined;for(let D=0;D<v.length;++D){const O=R?d(v[D],R):v[D],I=E?T.custom:T[typeof O];if(a(I,"Failed to find unique map container for type",typeof O),I instanceof Map){const $=I.entries();let F;for(;!(F=$.next()).done;)if(N(F.value[0],O)){const B=m.localize([...m.path,D],[v,...m.ancestors]),W={pos:D,value:v[D],dupePos:F.value[1],dupeValue:v[F.value[1]]};return R&&(W.path=b),x("array.unique",W,B)}I.set(O,D)}else{if((!A||O!==void 0)&&I[O]!==void 0){const $={pos:D,value:v[D],dupePos:I[O],dupeValue:v[I[O]]};return R&&($.path=b),x("array.unique",$,m.localize([...m.path,D],[v,...m.ancestors]))}I[O]=D}}return v},args:["comparator","options"],multi:!0}},cast:{set:{from:Array.isArray,to:(v,m)=>new Set(v)}},rebuild(v){v.$_terms._inclusions=[],v.$_terms._exclusions=[],v.$_terms._requireds=[];for(const m of v.$_terms.items)g.validateSingle(m,v),m._flags.presence==="required"?v.$_terms._requireds.push(m):m._flags.presence==="forbidden"?v.$_terms._exclusions.push(m):v.$_terms._inclusions.push(m);for(const m of v.$_terms.ordered)g.validateSingle(m,v)},manifest:{build:(v,m)=>(m.items&&(v=v.items(...m.items)),m.ordered&&(v=v.ordered(...m.ordered)),v)},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"}}),g.fillMissedErrors=function(v,m,x,y,b,w){const E=[];let R=0;for(const T of x){const N=T._flags.label;N?E.push(N):++R}E.length?R?m.push(v.$_createError("array.includesRequiredBoth",y,{knownMisses:E,unknownMisses:R},b,w)):m.push(v.$_createError("array.includesRequiredKnowns",y,{knownMisses:E},b,w)):m.push(v.$_createError("array.includesRequiredUnknowns",y,{unknownMisses:R},b,w))},g.fillOrderedErrors=function(v,m,x,y,b,w){const E=[];for(const R of x)R._flags.presence==="required"&&E.push(R);E.length&&g.fillMissedErrors(v,m,E,y,b,w)},g.fillDefault=function(v,m,x,y){const b=[];let w=!0;for(let E=v.length-1;E>=0;--E){const R=v[E],T=[m,...x.ancestors],N=R.$_validate(void 0,x.localize(x.path,T,R),y).value;if(w){if(N===void 0)continue;w=!1}b.unshift(N)}b.length&&m.push(...b)},g.fastSplice=function(v,m){let x=m;for(;x<v.length;)v[x++]=v[x];--v.length},g.validateSingle=function(v,m){(v.type==="array"||v._flags._arrayItems)&&(a(!m._flags.single,"Cannot specify array item with single rule enabled"),m.$_setFlag("_arrayItems",!0,{clone:!1}))},g.sort=function(v,m,x,y,b){const w=x.order==="ascending"?1:-1,E=-1*w,R=w,T=(N,A)=>{let D=g.compare(N,A,E,R);if(D!==null||(x.by&&(N=x.by.resolve(N,y,b),A=x.by.resolve(A,y,b)),D=g.compare(N,A,E,R),D!==null))return D;const O=typeof N;if(O!==typeof A)throw v.$_createError("array.sort.mismatching",m,null,y,b);if(O!=="number"&&O!=="string")throw v.$_createError("array.sort.unsupported",m,{type:O},y,b);return O==="number"?(N-A)*w:N<A?E:R};try{return{value:m.slice().sort(T)}}catch(N){return{errors:N}}},g.compare=function(v,m,x,y){return v===m?0:v===void 0?1:m===void 0?-1:v===null?y:m===null?x:null}},4937:(s,i,o)=>{const a=o(375),c=o(8068),d=o(8160),h=o(2036),u={isBool:function(f){return typeof f=="boolean"}};s.exports=c.extend({type:"boolean",flags:{sensitive:{default:!1}},terms:{falsy:{init:null,manifest:"values"},truthy:{init:null,manifest:"values"}},coerce(f,{schema:g}){if(typeof f!="boolean"){if(typeof f=="string"){const v=g._flags.sensitive?f:f.toLowerCase();f=v==="true"||v!=="false"&&f}return typeof f!="boolean"&&(f=g.$_terms.truthy&&g.$_terms.truthy.has(f,null,null,!g._flags.sensitive)||(!g.$_terms.falsy||!g.$_terms.falsy.has(f,null,null,!g._flags.sensitive))&&f),{value:f}}},validate(f,{error:g}){if(typeof f!="boolean")return{value:f,errors:g("boolean.base")}},rules:{truthy:{method(...f){d.verifyFlat(f,"truthy");const g=this.clone();g.$_terms.truthy=g.$_terms.truthy||new h;for(let v=0;v<f.length;++v){const m=f[v];a(m!==void 0,"Cannot call truthy with undefined"),g.$_terms.truthy.add(m)}return g}},falsy:{method(...f){d.verifyFlat(f,"falsy");const g=this.clone();g.$_terms.falsy=g.$_terms.falsy||new h;for(let v=0;v<f.length;++v){const m=f[v];a(m!==void 0,"Cannot call falsy with undefined"),g.$_terms.falsy.add(m)}return g}},sensitive:{method(f=!0){return this.$_setFlag("sensitive",f)}}},cast:{number:{from:u.isBool,to:(f,g)=>f?1:0},string:{from:u.isBool,to:(f,g)=>f?"true":"false"}},manifest:{build:(f,g)=>(g.truthy&&(f=f.truthy(...g.truthy)),g.falsy&&(f=f.falsy(...g.falsy)),f)},messages:{"boolean.base":"{{#label}} must be a boolean"}})},7500:(s,i,o)=>{const a=o(375),c=o(8068),d=o(8160),h=o(3328),u={isDate:function(f){return f instanceof Date}};s.exports=c.extend({type:"date",coerce:{from:["number","string"],method:(f,{schema:g})=>({value:u.parse(f,g._flags.format)||f})},validate(f,{schema:g,error:v,prefs:m}){if(f instanceof Date&&!isNaN(f.getTime()))return;const x=g._flags.format;return m.convert&&x&&typeof f=="string"?{value:f,errors:v("date.format",{format:x})}:{value:f,errors:v("date.base")}},rules:{compare:{method:!1,validate(f,g,{date:v},{name:m,operator:x,args:y}){const b=v==="now"?Date.now():v.getTime();return d.compare(f.getTime(),b,x)?f:g.error("date."+m,{limit:y.date,value:f})},args:[{name:"date",ref:!0,normalize:f=>f==="now"?f:u.parse(f),assert:f=>f!==null,message:"must have a valid date format"}]},format:{method(f){return a(["iso","javascript","unix"].includes(f),"Unknown date format",f),this.$_setFlag("format",f)}},greater:{method(f){return this.$_addRule({name:"greater",method:"compare",args:{date:f},operator:">"})}},iso:{method(){return this.format("iso")}},less:{method(f){return this.$_addRule({name:"less",method:"compare",args:{date:f},operator:"<"})}},max:{method(f){return this.$_addRule({name:"max",method:"compare",args:{date:f},operator:"<="})}},min:{method(f){return this.$_addRule({name:"min",method:"compare",args:{date:f},operator:">="})}},timestamp:{method(f="javascript"){return a(["javascript","unix"].includes(f),'"type" must be one of "javascript, unix"'),this.format(f)}}},cast:{number:{from:u.isDate,to:(f,g)=>f.getTime()},string:{from:u.isDate,to:(f,{prefs:g})=>h.date(f,g)}},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"}}),u.parse=function(f,g){if(f instanceof Date)return f;if(typeof f!="string"&&(isNaN(f)||!isFinite(f))||/^\s*$/.test(f))return null;if(g==="iso")return d.isIsoDate(f)?u.date(f.toString()):null;const v=f;if(typeof f=="string"&&/^[+-]?\d+(\.\d+)?$/.test(f)&&(f=parseFloat(f)),g){if(g==="javascript")return u.date(1*f);if(g==="unix")return u.date(1e3*f);if(typeof v=="string")return null}return u.date(f)},u.date=function(f){const g=new Date(f);return isNaN(g.getTime())?null:g}},390:(s,i,o)=>{const a=o(375),c=o(7824);s.exports=c.extend({type:"function",properties:{typeof:"function"},rules:{arity:{method(d){return a(Number.isSafeInteger(d)&&d>=0,"n must be a positive integer"),this.$_addRule({name:"arity",args:{n:d}})},validate:(d,h,{n:u})=>d.length===u?d:h.error("function.arity",{n:u})},class:{method(){return this.$_addRule("class")},validate:(d,h)=>/^\s*class\s/.test(d.toString())?d:h.error("function.class",{value:d})},minArity:{method(d){return a(Number.isSafeInteger(d)&&d>0,"n must be a strict positive integer"),this.$_addRule({name:"minArity",args:{n:d}})},validate:(d,h,{n:u})=>d.length>=u?d:h.error("function.minArity",{n:u})},maxArity:{method(d){return a(Number.isSafeInteger(d)&&d>=0,"n must be a positive integer"),this.$_addRule({name:"maxArity",args:{n:d}})},validate:(d,h,{n:u})=>d.length<=u?d:h.error("function.maxArity",{n:u})}},messages:{"function.arity":"{{#label}} must have an arity of {{#n}}","function.class":"{{#label}} must be a class","function.maxArity":"{{#label}} must have an arity lesser or equal to {{#n}}","function.minArity":"{{#label}} must have an arity greater or equal to {{#n}}"}})},7824:(s,i,o)=>{const a=o(978),c=o(375),d=o(8571),h=o(3652),u=o(8068),f=o(8160),g=o(3292),v=o(6354),m=o(6133),x=o(3328),y={renameDefaults:{alias:!1,multiple:!1,override:!1}};s.exports=u.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:(b,w)=>b.keys(w),validate(b,{schema:w,error:E,state:R,prefs:T}){if(!b||typeof b!==w.$_property("typeof")||Array.isArray(b))return{value:b,errors:E("object.base",{type:w.$_property("typeof")})};if(!(w.$_terms.renames||w.$_terms.dependencies||w.$_terms.keys||w.$_terms.patterns||w.$_terms.externals))return;b=y.clone(b,T);const N=[];if(w.$_terms.renames&&!y.rename(w,b,R,T,N))return{value:b,errors:N};if(!w.$_terms.keys&&!w.$_terms.patterns&&!w.$_terms.dependencies)return{value:b,errors:N};const A=new Set(Object.keys(b));if(w.$_terms.keys){const D=[b,...R.ancestors];for(const O of w.$_terms.keys){const I=O.key,$=b[I];A.delete(I);const F=R.localize([...R.path,I],D,O),B=O.schema.$_validate($,F,T);if(B.errors){if(T.abortEarly)return{value:b,errors:B.errors};B.value!==void 0&&(b[I]=B.value),N.push(...B.errors)}else O.schema._flags.result==="strip"||B.value===void 0&&$!==void 0?delete b[I]:B.value!==void 0&&(b[I]=B.value)}}if(A.size||w._flags._hasPatternMatch){const D=y.unknown(w,b,A,N,R,T);if(D)return D}if(w.$_terms.dependencies)for(const D of w.$_terms.dependencies){if(D.key!==null&&y.isPresent(D.options)(D.key.resolve(b,R,T,null,{shadow:!1}))===!1)continue;const O=y.dependencies[D.rel](w,D,b,R,T);if(O){const I=w.$_createError(O.code,b,O.context,R,T);if(T.abortEarly)return{value:b,errors:I};N.push(I)}}return{value:b,errors:N}},rules:{and:{method(...b){return f.verifyFlat(b,"and"),y.dependency(this,"and",null,b)}},append:{method(b){return b==null||Object.keys(b).length===0?this:this.keys(b)}},assert:{method(b,w,E){x.isTemplate(b)||(b=g.ref(b)),c(E===void 0||typeof E=="string","Message must be a string"),w=this.$_compile(w,{appendPath:!0});const R=this.$_addRule({name:"assert",args:{subject:b,schema:w,message:E}});return R.$_mutateRegister(b),R.$_mutateRegister(w),R},validate(b,{error:w,prefs:E,state:R},{subject:T,schema:N,message:A}){const D=T.resolve(b,R,E),O=m.isRef(T)?T.absolute(R):[];return N.$_match(D,R.localize(O,[b,...R.ancestors],N),E)?b:w("object.assert",{subject:T,message:A})},args:["subject","schema","message"],multi:!0},instance:{method(b,w){return c(typeof b=="function","constructor must be a function"),w=w||b.name,this.$_addRule({name:"instance",args:{constructor:b,name:w}})},validate:(b,w,{constructor:E,name:R})=>b instanceof E?b:w.error("object.instance",{type:R,value:b}),args:["constructor","name"]},keys:{method(b){c(b===void 0||typeof b=="object","Object schema must be a valid object"),c(!f.isSchema(b),"Object schema cannot be a joi schema");const w=this.clone();if(b)if(Object.keys(b).length){w.$_terms.keys=w.$_terms.keys?w.$_terms.keys.filter(E=>!b.hasOwnProperty(E.key)):new y.Keys;for(const E in b)f.tryWithPath(()=>w.$_terms.keys.push({key:E,schema:this.$_compile(b[E])}),E)}else w.$_terms.keys=new y.Keys;else w.$_terms.keys=null;return w.$_mutateRebuild()}},length:{method(b){return this.$_addRule({name:"length",args:{limit:b},operator:"="})},validate:(b,w,{limit:E},{name:R,operator:T,args:N})=>f.compare(Object.keys(b).length,E,T)?b:w.error("object."+R,{limit:N.limit,value:b}),args:[{name:"limit",ref:!0,assert:f.limit,message:"must be a positive integer"}]},max:{method(b){return this.$_addRule({name:"max",method:"length",args:{limit:b},operator:"<="})}},min:{method(b){return this.$_addRule({name:"min",method:"length",args:{limit:b},operator:">="})}},nand:{method(...b){return f.verifyFlat(b,"nand"),y.dependency(this,"nand",null,b)}},or:{method(...b){return f.verifyFlat(b,"or"),y.dependency(this,"or",null,b)}},oxor:{method(...b){return y.dependency(this,"oxor",null,b)}},pattern:{method(b,w,E={}){const R=b instanceof RegExp;R||(b=this.$_compile(b,{appendPath:!0})),c(w!==void 0,"Invalid rule"),f.assertOptions(E,["fallthrough","matches"]),R&&c(!b.flags.includes("g")&&!b.flags.includes("y"),"pattern should not use global or sticky mode"),w=this.$_compile(w,{appendPath:!0});const T=this.clone();T.$_terms.patterns=T.$_terms.patterns||[];const N={[R?"regex":"schema"]:b,rule:w};return E.matches&&(N.matches=this.$_compile(E.matches),N.matches.type!=="array"&&(N.matches=N.matches.$_root.array().items(N.matches)),T.$_mutateRegister(N.matches),T.$_setFlag("_hasPatternMatch",!0,{clone:!1})),E.fallthrough&&(N.fallthrough=!0),T.$_terms.patterns.push(N),T.$_mutateRegister(w),T}},ref:{method(){return this.$_addRule("ref")},validate:(b,w)=>m.isRef(b)?b:w.error("object.refType",{value:b})},regex:{method(){return this.$_addRule("regex")},validate:(b,w)=>b instanceof RegExp?b:w.error("object.regex",{value:b})},rename:{method(b,w,E={}){c(typeof b=="string"||b instanceof RegExp,"Rename missing the from argument"),c(typeof w=="string"||w instanceof x,"Invalid rename to argument"),c(w!==b,"Cannot rename key to same name:",b),f.assertOptions(E,["alias","ignoreUndefined","override","multiple"]);const R=this.clone();R.$_terms.renames=R.$_terms.renames||[];for(const T of R.$_terms.renames)c(T.from!==b,"Cannot rename the same key multiple times");return w instanceof x&&R.$_mutateRegister(w),R.$_terms.renames.push({from:b,to:w,options:a(y.renameDefaults,E)}),R}},schema:{method(b="any"){return this.$_addRule({name:"schema",args:{type:b}})},validate:(b,w,{type:E})=>!f.isSchema(b)||E!=="any"&&b.type!==E?w.error("object.schema",{type:E}):b},unknown:{method(b){return this.$_setFlag("unknown",b!==!1)}},with:{method(b,w,E={}){return y.dependency(this,"with",b,w,E)}},without:{method(b,w,E={}){return y.dependency(this,"without",b,w,E)}},xor:{method(...b){return f.verifyFlat(b,"xor"),y.dependency(this,"xor",null,b)}}},overrides:{default(b,w){return b===void 0&&(b=f.symbols.deepDefault),this.$_parent("default",b,w)}},rebuild(b){if(b.$_terms.keys){const w=new h.Sorter;for(const E of b.$_terms.keys)f.tryWithPath(()=>w.add(E,{after:E.schema.$_rootReferences(),group:E.key}),E.key);b.$_terms.keys=new y.Keys(...w.nodes)}},manifest:{build(b,w){if(w.keys&&(b=b.keys(w.keys)),w.dependencies)for(const{rel:E,key:R=null,peers:T,options:N}of w.dependencies)b=y.dependency(b,E,R,T,N);if(w.patterns)for(const{regex:E,schema:R,rule:T,fallthrough:N,matches:A}of w.patterns)b=b.pattern(E||R,T,{fallthrough:N,matches:A});if(w.renames)for(const{from:E,to:R,options:T}of w.renames)b=b.rename(E,R,T);return b}},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}}"}}),y.clone=function(b,w){if(typeof b=="object"){if(w.nonEnumerables)return d(b,{shallow:!0});const R=Object.create(Object.getPrototypeOf(b));return Object.assign(R,b),R}const E=function(...R){return b.apply(this,R)};return E.prototype=d(b.prototype),Object.defineProperty(E,"name",{value:b.name,writable:!1}),Object.defineProperty(E,"length",{value:b.length,writable:!1}),Object.assign(E,b),E},y.dependency=function(b,w,E,R,T){c(E===null||typeof E=="string",w,"key must be a strings"),T||(T=R.length>1&&typeof R[R.length-1]=="object"?R.pop():{}),f.assertOptions(T,["separator","isPresent"]),R=[].concat(R);const N=f.default(T.separator,"."),A=[];for(const O of R)c(typeof O=="string",w,"peers must be strings"),A.push(g.ref(O,{separator:N,ancestor:0,prefix:!1}));E!==null&&(E=g.ref(E,{separator:N,ancestor:0,prefix:!1}));const D=b.clone();return D.$_terms.dependencies=D.$_terms.dependencies||[],D.$_terms.dependencies.push(new y.Dependency(w,E,A,R,T)),D},y.dependencies={and(b,w,E,R,T){const N=[],A=[],D=w.peers.length,O=y.isPresent(w.options);for(const I of w.peers)O(I.resolve(E,R,T,null,{shadow:!1}))===!1?N.push(I.key):A.push(I.key);if(N.length!==D&&A.length!==D)return{code:"object.and",context:{present:A,presentWithLabels:y.keysToLabels(b,A),missing:N,missingWithLabels:y.keysToLabels(b,N)}}},nand(b,w,E,R,T){const N=[],A=y.isPresent(w.options);for(const I of w.peers)A(I.resolve(E,R,T,null,{shadow:!1}))&&N.push(I.key);if(N.length!==w.peers.length)return;const D=w.paths[0],O=w.paths.slice(1);return{code:"object.nand",context:{main:D,mainWithLabel:y.keysToLabels(b,D),peers:O,peersWithLabels:y.keysToLabels(b,O)}}},or(b,w,E,R,T){const N=y.isPresent(w.options);for(const A of w.peers)if(N(A.resolve(E,R,T,null,{shadow:!1})))return;return{code:"object.missing",context:{peers:w.paths,peersWithLabels:y.keysToLabels(b,w.paths)}}},oxor(b,w,E,R,T){const N=[],A=y.isPresent(w.options);for(const O of w.peers)A(O.resolve(E,R,T,null,{shadow:!1}))&&N.push(O.key);if(!N.length||N.length===1)return;const D={peers:w.paths,peersWithLabels:y.keysToLabels(b,w.paths)};return D.present=N,D.presentWithLabels=y.keysToLabels(b,N),{code:"object.oxor",context:D}},with(b,w,E,R,T){const N=y.isPresent(w.options);for(const A of w.peers)if(N(A.resolve(E,R,T,null,{shadow:!1}))===!1)return{code:"object.with",context:{main:w.key.key,mainWithLabel:y.keysToLabels(b,w.key.key),peer:A.key,peerWithLabel:y.keysToLabels(b,A.key)}}},without(b,w,E,R,T){const N=y.isPresent(w.options);for(const A of w.peers)if(N(A.resolve(E,R,T,null,{shadow:!1})))return{code:"object.without",context:{main:w.key.key,mainWithLabel:y.keysToLabels(b,w.key.key),peer:A.key,peerWithLabel:y.keysToLabels(b,A.key)}}},xor(b,w,E,R,T){const N=[],A=y.isPresent(w.options);for(const O of w.peers)A(O.resolve(E,R,T,null,{shadow:!1}))&&N.push(O.key);if(N.length===1)return;const D={peers:w.paths,peersWithLabels:y.keysToLabels(b,w.paths)};return N.length===0?{code:"object.missing",context:D}:(D.present=N,D.presentWithLabels=y.keysToLabels(b,N),{code:"object.xor",context:D})}},y.keysToLabels=function(b,w){return Array.isArray(w)?w.map(E=>b.$_mapLabels(E)):b.$_mapLabels(w)},y.isPresent=function(b){return typeof b.isPresent=="function"?b.isPresent:w=>w!==void 0},y.rename=function(b,w,E,R,T){const N={};for(const A of b.$_terms.renames){const D=[],O=typeof A.from!="string";if(O)for(const I in w){if(w[I]===void 0&&A.options.ignoreUndefined||I===A.to)continue;const $=A.from.exec(I);$&&D.push({from:I,to:A.to,match:$})}else!Object.prototype.hasOwnProperty.call(w,A.from)||w[A.from]===void 0&&A.options.ignoreUndefined||D.push(A);for(const I of D){const $=I.from;let F=I.to;if(F instanceof x&&(F=F.render(w,E,R,I.match)),$!==F){if(!A.options.multiple&&N[F]&&(T.push(b.$_createError("object.rename.multiple",w,{from:$,to:F,pattern:O},E,R)),R.abortEarly)||Object.prototype.hasOwnProperty.call(w,F)&&!A.options.override&&!N[F]&&(T.push(b.$_createError("object.rename.override",w,{from:$,to:F,pattern:O},E,R)),R.abortEarly))return!1;w[$]===void 0?delete w[F]:w[F]=w[$],N[F]=!0,A.options.alias||delete w[$]}}}return!0},y.unknown=function(b,w,E,R,T,N){if(b.$_terms.patterns){let A=!1;const D=b.$_terms.patterns.map(I=>{if(I.matches)return A=!0,[]}),O=[w,...T.ancestors];for(const I of E){const $=w[I],F=[...T.path,I];for(let B=0;B<b.$_terms.patterns.length;++B){const W=b.$_terms.patterns[B];if(W.regex){const H=W.regex.test(I);if(T.mainstay.tracer.debug(T,"rule",`pattern.${B}`,H?"pass":"error"),!H)continue}else if(!W.schema.$_match(I,T.nest(W.schema,`pattern.${B}`),N))continue;E.delete(I);const Z=T.localize(F,O,{schema:W.rule,key:I}),Y=W.rule.$_validate($,Z,N);if(Y.errors){if(N.abortEarly)return{value:w,errors:Y.errors};R.push(...Y.errors)}if(W.matches&&D[B].push(I),w[I]=Y.value,!W.fallthrough)break}}if(A)for(let I=0;I<D.length;++I){const $=D[I];if(!$)continue;const F=b.$_terms.patterns[I].matches,B=T.localize(T.path,O,F),W=F.$_validate($,B,N);if(W.errors){const Z=v.details(W.errors,{override:!1});Z.matches=$;const Y=b.$_createError("object.pattern.match",w,Z,T,N);if(N.abortEarly)return{value:w,errors:Y};R.push(Y)}}}if(E.size&&(b.$_terms.keys||b.$_terms.patterns)){if(N.stripUnknown&&b._flags.unknown===void 0||N.skipFunctions){const A=!(!N.stripUnknown||N.stripUnknown!==!0&&!N.stripUnknown.objects);for(const D of E)A?(delete w[D],E.delete(D)):typeof w[D]=="function"&&E.delete(D)}if(!f.default(b._flags.unknown,N.allowUnknown))for(const A of E){const D=T.localize([...T.path,A],[]),O=b.$_createError("object.unknown",w[A],{child:A},D,N,{flags:!1});if(N.abortEarly)return{value:w,errors:O};R.push(O)}}},y.Dependency=class{constructor(b,w,E,R,T){this.rel=b,this.key=w,this.peers=E,this.paths=R,this.options=T}describe(){const b={rel:this.rel,peers:this.paths};return this.key!==null&&(b.key=this.key.key),this.peers[0].separator!=="."&&(b.options={...b.options,separator:this.peers[0].separator}),this.options.isPresent&&(b.options={...b.options,isPresent:this.options.isPresent}),b}},y.Keys=class extends Array{concat(b){const w=this.slice(),E=new Map;for(let R=0;R<w.length;++R)E.set(w[R].key,R);for(const R of b){const T=R.key,N=E.get(T);N!==void 0?w[N]={key:T,schema:w[N].schema.concat(R.schema)}:w.push(R)}return w}}},8785:(s,i,o)=>{const a=o(375),c=o(8068),d=o(8160),h=o(3292),u=o(6354),f={};s.exports=c.extend({type:"link",properties:{schemaChain:!0},terms:{link:{init:null,manifest:"single",register:!1}},args:(g,v)=>g.ref(v),validate(g,{schema:v,state:m,prefs:x}){a(v.$_terms.link,"Uninitialized link schema");const y=f.generate(v,g,m,x),b=v.$_terms.link[0].ref;return y.$_validate(g,m.nest(y,`link:${b.display}:${y.type}`),x)},generate:(g,v,m,x)=>f.generate(g,v,m,x),rules:{ref:{method(g){a(!this.$_terms.link,"Cannot reinitialize schema"),g=h.ref(g),a(g.type==="value"||g.type==="local","Invalid reference type:",g.type),a(g.type==="local"||g.ancestor==="root"||g.ancestor>0,"Link cannot reference itself");const v=this.clone();return v.$_terms.link=[{ref:g}],v}},relative:{method(g=!0){return this.$_setFlag("relative",g)}}},overrides:{concat(g){a(this.$_terms.link,"Uninitialized link schema"),a(d.isSchema(g),"Invalid schema object"),a(g.type!=="link","Cannot merge type link with another link");const v=this.clone();return v.$_terms.whens||(v.$_terms.whens=[]),v.$_terms.whens.push({concat:g}),v.$_mutateRebuild()}},manifest:{build:(g,v)=>(a(v.link,"Invalid link description missing link"),g.ref(v.link))}}),f.generate=function(g,v,m,x){let y=m.mainstay.links.get(g);if(y)return y._generate(v,m,x).schema;const b=g.$_terms.link[0].ref,{perspective:w,path:E}=f.perspective(b,m);f.assert(w,"which is outside of schema boundaries",b,g,m,x);try{y=E.length?w.$_reach(E):w}catch{f.assert(!1,"to non-existing schema",b,g,m,x)}return f.assert(y.type!=="link","which is another link",b,g,m,x),g._flags.relative||m.mainstay.links.set(g,y),y._generate(v,m,x).schema},f.perspective=function(g,v){if(g.type==="local"){for(const{schema:m,key:x}of v.schemas){if((m._flags.id||x)===g.path[0])return{perspective:m,path:g.path.slice(1)};if(m.$_terms.shared){for(const y of m.$_terms.shared)if(y._flags.id===g.path[0])return{perspective:y,path:g.path.slice(1)}}}return{perspective:null,path:null}}return g.ancestor==="root"?{perspective:v.schemas[v.schemas.length-1].schema,path:g.path}:{perspective:v.schemas[g.ancestor]&&v.schemas[g.ancestor].schema,path:g.path}},f.assert=function(g,v,m,x,y,b){g||a(!1,`"${u.label(x._flags,y,b)}" contains link reference "${m.display}" ${v}`)}},3832:(s,i,o)=>{const a=o(375),c=o(8068),d=o(8160),h={numberRx:/^\s*[+-]?(?:(?:\d+(?:\.\d*)?)|(?:\.\d+))(?:e([+-]?\d+))?\s*$/i,precisionRx:/(?:\.(\d+))?(?:[eE]([+-]?\d+))?$/,exponentialPartRegex:/[eE][+-]?\d+$/,leadingSignAndZerosRegex:/^[+-]?(0*)?/,dotRegex:/\./,trailingZerosRegex:/0+$/,decimalPlaces(u){const f=u.toString(),g=f.indexOf("."),v=f.indexOf("e");return(g<0?0:(v<0?f.length:v)-g-1)+(v<0?0:Math.max(0,-parseInt(f.slice(v+1))))}};s.exports=c.extend({type:"number",flags:{unsafe:{default:!1}},coerce:{from:"string",method(u,{schema:f,error:g}){if(!u.match(h.numberRx))return;u=u.trim();const v={value:parseFloat(u)};if(v.value===0&&(v.value=0),!f._flags.unsafe)if(u.match(/e/i)){if(h.extractSignificantDigits(u)!==h.extractSignificantDigits(String(v.value)))return v.errors=g("number.unsafe"),v}else{const m=v.value.toString();if(m.match(/e/i))return v;if(m!==h.normalizeDecimal(u))return v.errors=g("number.unsafe"),v}return v}},validate(u,{schema:f,error:g,prefs:v}){if(u===1/0||u===-1/0)return{value:u,errors:g("number.infinity")};if(!d.isNumber(u))return{value:u,errors:g("number.base")};const m={value:u};if(v.convert){const x=f.$_getRule("precision");if(x){const y=Math.pow(10,x.args.limit);m.value=Math.round(m.value*y)/y}}return m.value===0&&(m.value=0),!f._flags.unsafe&&(u>Number.MAX_SAFE_INTEGER||u<Number.MIN_SAFE_INTEGER)&&(m.errors=g("number.unsafe")),m},rules:{compare:{method:!1,validate:(u,f,{limit:g},{name:v,operator:m,args:x})=>d.compare(u,g,m)?u:f.error("number."+v,{limit:x.limit,value:u}),args:[{name:"limit",ref:!0,assert:d.isNumber,message:"must be a number"}]},greater:{method(u){return this.$_addRule({name:"greater",method:"compare",args:{limit:u},operator:">"})}},integer:{method(){return this.$_addRule("integer")},validate:(u,f)=>Math.trunc(u)-u==0?u:f.error("number.integer")},less:{method(u){return this.$_addRule({name:"less",method:"compare",args:{limit:u},operator:"<"})}},max:{method(u){return this.$_addRule({name:"max",method:"compare",args:{limit:u},operator:"<="})}},min:{method(u){return this.$_addRule({name:"min",method:"compare",args:{limit:u},operator:">="})}},multiple:{method(u){const f=typeof u=="number"?h.decimalPlaces(u):null,g=Math.pow(10,f);return this.$_addRule({name:"multiple",args:{base:u,baseDecimalPlace:f,pfactor:g}})},validate:(u,f,{base:g,baseDecimalPlace:v,pfactor:m},x)=>h.decimalPlaces(u)>v?f.error("number.multiple",{multiple:x.args.base,value:u}):Math.round(m*u)%Math.round(m*g)==0?u:f.error("number.multiple",{multiple:x.args.base,value:u}),args:[{name:"base",ref:!0,assert:u=>typeof u=="number"&&isFinite(u)&&u>0,message:"must be a positive number"},"baseDecimalPlace","pfactor"],multi:!0},negative:{method(){return this.sign("negative")}},port:{method(){return this.$_addRule("port")},validate:(u,f)=>Number.isSafeInteger(u)&&u>=0&&u<=65535?u:f.error("number.port")},positive:{method(){return this.sign("positive")}},precision:{method(u){return a(Number.isSafeInteger(u),"limit must be an integer"),this.$_addRule({name:"precision",args:{limit:u}})},validate(u,f,{limit:g}){const v=u.toString().match(h.precisionRx);return Math.max((v[1]?v[1].length:0)-(v[2]?parseInt(v[2],10):0),0)<=g?u:f.error("number.precision",{limit:g,value:u})},convert:!0},sign:{method(u){return a(["negative","positive"].includes(u),"Invalid sign",u),this.$_addRule({name:"sign",args:{sign:u}})},validate:(u,f,{sign:g})=>g==="negative"&&u<0||g==="positive"&&u>0?u:f.error(`number.${g}`)},unsafe:{method(u=!0){return a(typeof u=="boolean","enabled must be a boolean"),this.$_setFlag("unsafe",u)}}},cast:{string:{from:u=>typeof u=="number",to:(u,f)=>u.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"}}),h.extractSignificantDigits=function(u){return u.replace(h.exponentialPartRegex,"").replace(h.dotRegex,"").replace(h.trailingZerosRegex,"").replace(h.leadingSignAndZerosRegex,"")},h.normalizeDecimal=function(u){return(u=u.replace(/^\+/,"").replace(/\.0*$/,"").replace(/^(-?)\.([^\.]*)$/,"$10.$2").replace(/^(-?)0+([0-9])/,"$1$2")).includes(".")&&u.endsWith("0")&&(u=u.replace(/0+$/,"")),u==="-0"?"0":u}},8966:(s,i,o)=>{const a=o(7824);s.exports=a.extend({type:"object",cast:{map:{from:c=>c&&typeof c=="object",to:(c,d)=>new Map(Object.entries(c))}}})},7417:(s,i,o)=>{const a=o(375),c=o(5380),d=o(1745),h=o(9959),u=o(6064),f=o(9926),g=o(5752),v=o(8068),m=o(8160),x={tlds:f instanceof Set&&{tlds:{allow:f,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:h.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=v.extend({type:"string",flags:{insensitive:{default:!1},truncate:{default:!1}},terms:{replacements:{init:null}},coerce:{from:"string",method(y,{schema:b,state:w,prefs:E}){const R=b.$_getRule("normalize");R&&(y=y.normalize(R.args.form));const T=b.$_getRule("case");T&&(y=T.args.direction==="upper"?y.toLocaleUpperCase():y.toLocaleLowerCase());const N=b.$_getRule("trim");if(N&&N.args.enabled&&(y=y.trim()),b.$_terms.replacements)for(const D of b.$_terms.replacements)y=y.replace(D.pattern,D.replacement);const A=b.$_getRule("hex");if(A&&A.args.options.byteAligned&&y.length%2!=0&&(y=`0${y}`),b.$_getRule("isoDate")){const D=x.isoDate(y);D&&(y=D)}if(b._flags.truncate){const D=b.$_getRule("max");if(D){let O=D.args.limit;if(m.isResolvable(O)&&(O=O.resolve(y,w,E),!m.limit(O)))return{value:y,errors:b.$_createError("any.ref",O,{ref:D.args.limit,arg:"limit",reason:"must be a positive integer"},w,E)};y=y.slice(0,O)}}return{value:y}}},validate(y,{schema:b,error:w}){if(typeof y!="string")return{value:y,errors:w("string.base")};if(y===""){const E=b.$_getRule("min");return E&&E.args.limit===0?void 0:{value:y,errors:w("string.empty")}}},rules:{alphanum:{method(){return this.$_addRule("alphanum")},validate:(y,b)=>/^[a-zA-Z0-9]+$/.test(y)?y:b.error("string.alphanum")},base64:{method(y={}){return m.assertOptions(y,["paddingRequired","urlSafe"]),y={urlSafe:!1,paddingRequired:!0,...y},a(typeof y.paddingRequired=="boolean","paddingRequired must be boolean"),a(typeof y.urlSafe=="boolean","urlSafe must be boolean"),this.$_addRule({name:"base64",args:{options:y}})},validate:(y,b,{options:w})=>x.base64Regex[w.paddingRequired][w.urlSafe].test(y)?y:b.error("string.base64")},case:{method(y){return a(["lower","upper"].includes(y),"Invalid case:",y),this.$_addRule({name:"case",args:{direction:y}})},validate:(y,b,{direction:w})=>w==="lower"&&y===y.toLocaleLowerCase()||w==="upper"&&y===y.toLocaleUpperCase()?y:b.error(`string.${w}case`),convert:!0},creditCard:{method(){return this.$_addRule("creditCard")},validate(y,b){let w=y.length,E=0,R=1;for(;w--;){const T=y.charAt(w)*R;E+=T-9*(T>9),R^=3}return E>0&&E%10==0?y:b.error("string.creditCard")}},dataUri:{method(y={}){return m.assertOptions(y,["paddingRequired"]),y={paddingRequired:!0,...y},a(typeof y.paddingRequired=="boolean","paddingRequired must be boolean"),this.$_addRule({name:"dataUri",args:{options:y}})},validate(y,b,{options:w}){const E=y.match(x.dataUriRegex);return E&&(!E[2]||E[2]!=="base64"||x.base64Regex[w.paddingRequired].false.test(E[3]))?y:b.error("string.dataUri")}},domain:{method(y){y&&m.assertOptions(y,["allowFullyQualified","allowUnicode","maxDomainSegments","minDomainSegments","tlds"]);const b=x.addressOptions(y);return this.$_addRule({name:"domain",args:{options:y},address:b})},validate:(y,b,w,{address:E})=>c.isValid(y,E)?y:b.error("string.domain")},email:{method(y={}){m.assertOptions(y,["allowFullyQualified","allowUnicode","ignoreLength","maxDomainSegments","minDomainSegments","multiple","separator","tlds"]),a(y.multiple===void 0||typeof y.multiple=="boolean","multiple option must be an boolean");const b=x.addressOptions(y),w=new RegExp(`\\s*[${y.separator?u(y.separator):","}]\\s*`);return this.$_addRule({name:"email",args:{options:y},regex:w,address:b})},validate(y,b,{options:w},{regex:E,address:R}){const T=w.multiple?y.split(E):[y],N=[];for(const A of T)d.isValid(A,R)||N.push(A);return N.length?b.error("string.email",{value:y,invalids:N}):y}},guid:{alias:"uuid",method(y={}){m.assertOptions(y,["version","separator"]);let b="";if(y.version){const R=[].concat(y.version);a(R.length>=1,"version must have at least 1 valid version specified");const T=new Set;for(let N=0;N<R.length;++N){const A=R[N];a(typeof A=="string","version at position "+N+" must be a string");const D=x.guidVersions[A.toLowerCase()];a(D,"version at position "+N+" must be one of "+Object.keys(x.guidVersions).join(", ")),a(!T.has(D),"version at position "+N+" must not be a duplicate"),b+=D,T.add(D)}}a(x.guidSeparators.has(y.separator),'separator must be one of true, false, "-", or ":"');const w=y.separator===void 0?"[:-]?":y.separator===!0?"[:-]":y.separator===!1?"[]?":`\\${y.separator}`,E=new RegExp(`^([\\[{\\(]?)[0-9A-F]{8}(${w})[0-9A-F]{4}\\2?[${b||"0-9A-F"}][0-9A-F]{3}\\2?[${b?"89AB":"0-9A-F"}][0-9A-F]{3}\\2?[0-9A-F]{12}([\\]}\\)]?)$`,"i");return this.$_addRule({name:"guid",args:{options:y},regex:E})},validate(y,b,w,{regex:E}){const R=E.exec(y);return R?x.guidBrackets[R[1]]!==R[R.length-1]?b.error("string.guid"):y:b.error("string.guid")}},hex:{method(y={}){return m.assertOptions(y,["byteAligned","prefix"]),y={byteAligned:!1,prefix:!1,...y},a(typeof y.byteAligned=="boolean","byteAligned must be boolean"),a(typeof y.prefix=="boolean"||y.prefix==="optional",'prefix must be boolean or "optional"'),this.$_addRule({name:"hex",args:{options:y}})},validate:(y,b,{options:w})=>(w.prefix==="optional"?x.hexRegex.withOptionalPrefix:w.prefix===!0?x.hexRegex.withPrefix:x.hexRegex.withoutPrefix).test(y)?w.byteAligned&&y.length%2!=0?b.error("string.hexAlign"):y:b.error("string.hex")},hostname:{method(){return this.$_addRule("hostname")},validate:(y,b)=>c.isValid(y,{minDomainSegments:1})||x.ipRegex.test(y)?y:b.error("string.hostname")},insensitive:{method(){return this.$_setFlag("insensitive",!0)}},ip:{method(y={}){m.assertOptions(y,["cidr","version"]);const{cidr:b,versions:w,regex:E}=h.regex(y),R=y.version?w:void 0;return this.$_addRule({name:"ip",args:{options:{cidr:b,version:R}},regex:E})},validate:(y,b,{options:w},{regex:E})=>E.test(y)?y:w.version?b.error("string.ipVersion",{value:y,cidr:w.cidr,version:w.version}):b.error("string.ip",{value:y,cidr:w.cidr})},isoDate:{method(){return this.$_addRule("isoDate")},validate:(y,{error:b})=>x.isoDate(y)?y:b("string.isoDate")},isoDuration:{method(){return this.$_addRule("isoDuration")},validate:(y,b)=>x.isoDurationRegex.test(y)?y:b.error("string.isoDuration")},length:{method(y,b){return x.length(this,"length",y,"=",b)},validate(y,b,{limit:w,encoding:E},{name:R,operator:T,args:N}){const A=!E&&y.length;return m.compare(A,w,T)?y:b.error("string."+R,{limit:N.limit,value:y,encoding:E})},args:[{name:"limit",ref:!0,assert:m.limit,message:"must be a positive integer"},"encoding"]},lowercase:{method(){return this.case("lower")}},max:{method(y,b){return x.length(this,"max",y,"<=",b)},args:["limit","encoding"]},min:{method(y,b){return x.length(this,"min",y,">=",b)},args:["limit","encoding"]},normalize:{method(y="NFC"){return a(x.normalizationForms.includes(y),"normalization form must be one of "+x.normalizationForms.join(", ")),this.$_addRule({name:"normalize",args:{form:y}})},validate:(y,{error:b},{form:w})=>y===y.normalize(w)?y:b("string.normalize",{value:y,form:w}),convert:!0},pattern:{alias:"regex",method(y,b={}){a(y instanceof RegExp,"regex must be a RegExp"),a(!y.flags.includes("g")&&!y.flags.includes("y"),"regex should not use global or sticky mode"),typeof b=="string"&&(b={name:b}),m.assertOptions(b,["invert","name"]);const w=["string.pattern",b.invert?".invert":"",b.name?".name":".base"].join("");return this.$_addRule({name:"pattern",args:{regex:y,options:b},errorCode:w})},validate:(y,b,{regex:w,options:E},{errorCode:R})=>w.test(y)^E.invert?y:b.error(R,{name:E.name,regex:w,value:y}),args:["regex","options"],multi:!0},replace:{method(y,b){typeof y=="string"&&(y=new RegExp(u(y),"g")),a(y instanceof RegExp,"pattern must be a RegExp"),a(typeof b=="string","replacement must be a String");const w=this.clone();return w.$_terms.replacements||(w.$_terms.replacements=[]),w.$_terms.replacements.push({pattern:y,replacement:b}),w}},token:{method(){return this.$_addRule("token")},validate:(y,b)=>/^\w+$/.test(y)?y:b.error("string.token")},trim:{method(y=!0){return a(typeof y=="boolean","enabled must be a boolean"),this.$_addRule({name:"trim",args:{enabled:y}})},validate:(y,b,{enabled:w})=>w&&y!==y.trim()?b.error("string.trim"):y,convert:!0},truncate:{method(y=!0){return a(typeof y=="boolean","enabled must be a boolean"),this.$_setFlag("truncate",y)}},uppercase:{method(){return this.case("upper")}},uri:{method(y={}){m.assertOptions(y,["allowRelative","allowQuerySquareBrackets","domain","relativeOnly","scheme","encodeUri"]),y.domain&&m.assertOptions(y.domain,["allowFullyQualified","allowUnicode","maxDomainSegments","minDomainSegments","tlds"]);const{regex:b,scheme:w}=g.regex(y),E=y.domain?x.addressOptions(y.domain):null;return this.$_addRule({name:"uri",args:{options:y},regex:b,domain:E,scheme:w})},validate(y,b,{options:w},{regex:E,domain:R,scheme:T}){if(["http:/","https:/"].includes(y))return b.error("string.uri");let N=E.exec(y);if(!N&&b.prefs.convert&&w.encodeUri){const A=encodeURI(y);N=E.exec(A),N&&(y=A)}if(N){const A=N[1]||N[2];return!R||w.allowRelative&&!A||c.isValid(A,R)?y:b.error("string.domain",{value:A})}return w.relativeOnly?b.error("string.uriRelativeOnly"):w.scheme?b.error("string.uriCustomScheme",{scheme:T,value:y}):b.error("string.uri")}}},manifest:{build(y,b){if(b.replacements)for(const{pattern:w,replacement:E}of b.replacements)y=y.replace(w,E);return y}},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"}}),x.addressOptions=function(y){if(!y)return x.tlds||y;if(a(y.minDomainSegments===void 0||Number.isSafeInteger(y.minDomainSegments)&&y.minDomainSegments>0,"minDomainSegments must be a positive integer"),a(y.maxDomainSegments===void 0||Number.isSafeInteger(y.maxDomainSegments)&&y.maxDomainSegments>0,"maxDomainSegments must be a positive integer"),y.tlds===!1)return y;if(y.tlds===!0||y.tlds===void 0)return a(x.tlds,"Built-in TLD list disabled"),Object.assign({},y,x.tlds);a(typeof y.tlds=="object","tlds must be true, false, or an object");const b=y.tlds.deny;if(b)return Array.isArray(b)&&(y=Object.assign({},y,{tlds:{deny:new Set(b)}})),a(y.tlds.deny instanceof Set,"tlds.deny must be an array, Set, or boolean"),a(!y.tlds.allow,"Cannot specify both tlds.allow and tlds.deny lists"),x.validateTlds(y.tlds.deny,"tlds.deny"),y;const w=y.tlds.allow;return w?w===!0?(a(x.tlds,"Built-in TLD list disabled"),Object.assign({},y,x.tlds)):(Array.isArray(w)&&(y=Object.assign({},y,{tlds:{allow:new Set(w)}})),a(y.tlds.allow instanceof Set,"tlds.allow must be an array, Set, or boolean"),x.validateTlds(y.tlds.allow,"tlds.allow"),y):y},x.validateTlds=function(y,b){for(const w of y)a(c.isValid(w,{minDomainSegments:1,maxDomainSegments:1}),`${b} must contain valid top level domain names`)},x.isoDate=function(y){if(!m.isIsoDate(y))return null;/.*T.*[+-]\d\d$/.test(y)&&(y+="00");const b=new Date(y);return isNaN(b.getTime())?null:b.toISOString()},x.length=function(y,b,w,E,R){return a(!R||!1,"Invalid encoding:",R),y.$_addRule({name:b,method:"length",args:{limit:w,encoding:R},operator:E})}},8826:(s,i,o)=>{const a=o(375),c=o(8068),d={};d.Map=class extends Map{slice(){return new d.Map(this)}},s.exports=c.extend({type:"symbol",terms:{map:{init:new d.Map}},coerce:{method(h,{schema:u,error:f}){const g=u.$_terms.map.get(h);return g&&(h=g),u._flags.only&&typeof h!="symbol"?{value:h,errors:f("symbol.map",{map:u.$_terms.map})}:{value:h}}},validate(h,{error:u}){if(typeof h!="symbol")return{value:h,errors:u("symbol.base")}},rules:{map:{method(h){h&&!h[Symbol.iterator]&&typeof h=="object"&&(h=Object.entries(h)),a(h&&h[Symbol.iterator],"Iterable must be an iterable or object");const u=this.clone(),f=[];for(const g of h){a(g&&g[Symbol.iterator],"Entry must be an iterable");const[v,m]=g;a(typeof v!="object"&&typeof v!="function"&&typeof v!="symbol","Key must not be of type object, function, or Symbol"),a(typeof m=="symbol","Value must be a Symbol"),u.$_terms.map.set(v,m),f.push(m)}return u.valid(...f)}}},manifest:{build:(h,u)=>(u.map&&(h=h.map(u.map)),h)},messages:{"symbol.base":"{{#label}} must be a symbol","symbol.map":"{{#label}} must be one of {{#map}}"}})},8863:(s,i,o)=>{const a=o(375),c=o(8571),d=o(738),h=o(9621),u=o(8160),f=o(6354),g=o(493),v={result:Symbol("result")};i.entry=function(m,x,y){let b=u.defaults;y&&(a(y.warnings===void 0,"Cannot override warnings preference in synchronous validation"),a(y.artifacts===void 0,"Cannot override artifacts preference in synchronous validation"),b=u.preferences(u.defaults,y));const w=v.entry(m,x,b);a(!w.mainstay.externals.length,"Schema with external rules must use validateAsync()");const E={value:w.value};return w.error&&(E.error=w.error),w.mainstay.warnings.length&&(E.warning=f.details(w.mainstay.warnings)),w.mainstay.debug&&(E.debug=w.mainstay.debug),w.mainstay.artifacts&&(E.artifacts=w.mainstay.artifacts),E},i.entryAsync=async function(m,x,y){let b=u.defaults;y&&(b=u.preferences(u.defaults,y));const w=v.entry(m,x,b),E=w.mainstay;if(w.error)throw E.debug&&(w.error.debug=E.debug),w.error;if(E.externals.length){let T=w.value;const N=[];for(const A of E.externals){const D=A.state.path,O=A.schema.type==="link"?E.links.get(A.schema):null;let I,$,F=T;const B=D.length?[T]:[],W=D.length?h(m,D):m;if(D.length){I=D[D.length-1];let Z=T;for(const Y of D.slice(0,-1))Z=Z[Y],B.unshift(Z);$=B[0],F=$[I]}try{const Z=(H,se)=>(O||A.schema).$_createError(H,F,se,A.state,b),Y=await A.method(F,{schema:A.schema,linked:O,state:A.state,prefs:y,original:W,error:Z,errorsArray:v.errorsArray,warn:(H,se)=>E.warnings.push((O||A.schema).$_createError(H,F,se,A.state,b)),message:(H,se)=>(O||A.schema).$_createError("external",F,se,A.state,b,{messages:H})});if(Y===void 0||Y===F)continue;if(Y instanceof f.Report){if(E.tracer.log(A.schema,A.state,"rule","external","error"),N.push(Y),b.abortEarly)break;continue}if(Array.isArray(Y)&&Y[u.symbols.errors]){if(E.tracer.log(A.schema,A.state,"rule","external","error"),N.push(...Y),b.abortEarly)break;continue}$?(E.tracer.value(A.state,"rule",F,Y,"external"),$[I]=Y):(E.tracer.value(A.state,"rule",T,Y,"external"),T=Y)}catch(Z){throw b.errors.label&&(Z.message+=` (${A.label})`),Z}}if(w.value=T,N.length)throw w.error=f.process(N,m,b),E.debug&&(w.error.debug=E.debug),w.error}if(!b.warnings&&!b.debug&&!b.artifacts)return w.value;const R={value:w.value};return E.warnings.length&&(R.warning=f.details(E.warnings)),E.debug&&(R.debug=E.debug),E.artifacts&&(R.artifacts=E.artifacts),R},v.Mainstay=class{constructor(m,x,y){this.externals=[],this.warnings=[],this.tracer=m,this.debug=x,this.links=y,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()}},v.entry=function(m,x,y){const{tracer:b,cleanup:w}=v.tracer(x,y),E=y.debug?[]:null,R=x._ids._schemaChain?new Map:null,T=new v.Mainstay(b,E,R),N=x._ids._schemaChain?[{schema:x}]:null,A=new g([],[],{mainstay:T,schemas:N}),D=i.validate(m,x,A,y);w&&x.$_root.untrace();const O=f.process(D.errors,m,y);return{value:D.value,error:O,mainstay:T}},v.tracer=function(m,x){return m.$_root._tracer?{tracer:m.$_root._tracer._register(m)}:x.debug?(a(m.$_root.trace,"Debug mode not supported"),{tracer:m.$_root.trace()._register(m),cleanup:!0}):{tracer:v.ignore}},i.validate=function(m,x,y,b,w={}){if(x.$_terms.whens&&(x=x._generate(m,y,b).schema),x._preferences&&(b=v.prefs(x,b)),x._cache&&b.cache){const O=x._cache.get(m);if(y.mainstay.tracer.debug(y,"validate","cached",!!O),O)return O}const E=(O,I,$)=>x.$_createError(O,m,I,$||y,b),R={original:m,prefs:b,schema:x,state:y,error:E,errorsArray:v.errorsArray,warn:(O,I,$)=>y.mainstay.warnings.push(E(O,I,$)),message:(O,I)=>x.$_createError("custom",m,I,y,b,{messages:O})};y.mainstay.tracer.entry(x,y);const T=x._definition;if(T.prepare&&m!==void 0&&b.convert){const O=T.prepare(m,R);if(O){if(y.mainstay.tracer.value(y,"prepare",m,O.value),O.errors)return v.finalize(O.value,[].concat(O.errors),R);m=O.value}}if(T.coerce&&m!==void 0&&b.convert&&(!T.coerce.from||T.coerce.from.includes(typeof m))){const O=T.coerce.method(m,R);if(O){if(y.mainstay.tracer.value(y,"coerced",m,O.value),O.errors)return v.finalize(O.value,[].concat(O.errors),R);m=O.value}}const N=x._flags.empty;N&&N.$_match(v.trim(m,x),y.nest(N),u.defaults)&&(y.mainstay.tracer.value(y,"empty",m,void 0),m=void 0);const A=w.presence||x._flags.presence||(x._flags._endedSwitch?null:b.presence);if(m===void 0){if(A==="forbidden")return v.finalize(m,null,R);if(A==="required")return v.finalize(m,[x.$_createError("any.required",m,null,y,b)],R);if(A==="optional"){if(x._flags.default!==u.symbols.deepDefault)return v.finalize(m,null,R);y.mainstay.tracer.value(y,"default",m,{}),m={}}}else if(A==="forbidden")return v.finalize(m,[x.$_createError("any.unknown",m,null,y,b)],R);const D=[];if(x._valids){const O=x._valids.get(m,y,b,x._flags.insensitive);if(O)return b.convert&&(y.mainstay.tracer.value(y,"valids",m,O.value),m=O.value),y.mainstay.tracer.filter(x,y,"valid",O),v.finalize(m,null,R);if(x._flags.only){const I=x.$_createError("any.only",m,{valids:x._valids.values({display:!0})},y,b);if(b.abortEarly)return v.finalize(m,[I],R);D.push(I)}}if(x._invalids){const O=x._invalids.get(m,y,b,x._flags.insensitive);if(O){y.mainstay.tracer.filter(x,y,"invalid",O);const I=x.$_createError("any.invalid",m,{invalids:x._invalids.values({display:!0})},y,b);if(b.abortEarly)return v.finalize(m,[I],R);D.push(I)}}if(T.validate){const O=T.validate(m,R);if(O&&(y.mainstay.tracer.value(y,"base",m,O.value),m=O.value,O.errors)){if(!Array.isArray(O.errors))return D.push(O.errors),v.finalize(m,D,R);if(O.errors.length)return D.push(...O.errors),v.finalize(m,D,R)}}return x._rules.length?v.rules(m,D,R):v.finalize(m,D,R)},v.rules=function(m,x,y){const{schema:b,state:w,prefs:E}=y;for(const R of b._rules){const T=b._definition.rules[R.method];if(T.convert&&E.convert){w.mainstay.tracer.log(b,w,"rule",R.name,"full");continue}let N,A=R.args;if(R._resolve.length){A=Object.assign({},A);for(const O of R._resolve){const I=T.argsByName.get(O),$=A[O].resolve(m,w,E),F=I.normalize?I.normalize($):$,B=u.validateArg(F,null,I);if(B){N=b.$_createError("any.ref",$,{arg:O,ref:A[O],reason:B},w,E);break}A[O]=F}}N=N||T.validate(m,y,A,R);const D=v.rule(N,R);if(D.errors){if(w.mainstay.tracer.log(b,w,"rule",R.name,"error"),R.warn){w.mainstay.warnings.push(...D.errors);continue}if(E.abortEarly)return v.finalize(m,D.errors,y);x.push(...D.errors)}else w.mainstay.tracer.log(b,w,"rule",R.name,"pass"),w.mainstay.tracer.value(w,"rule",m,D.value,R.name),m=D.value}return v.finalize(m,x,y)},v.rule=function(m,x){return m instanceof f.Report?(v.error(m,x),{errors:[m],value:null}):Array.isArray(m)&&m[u.symbols.errors]?(m.forEach(y=>v.error(y,x)),{errors:m,value:null}):{errors:null,value:m}},v.error=function(m,x){return x.message&&m._setTemplate(x.message),m},v.finalize=function(m,x,y){x=x||[];const{schema:b,state:w,prefs:E}=y;if(x.length){const T=v.default("failover",void 0,x,y);T!==void 0&&(w.mainstay.tracer.value(w,"failover",m,T),m=T,x=[])}if(x.length&&b._flags.error)if(typeof b._flags.error=="function"){x=b._flags.error(x),Array.isArray(x)||(x=[x]);for(const T of x)a(T instanceof Error||T instanceof f.Report,"error() must return an Error object")}else x=[b._flags.error];if(m===void 0){const T=v.default("default",m,x,y);w.mainstay.tracer.value(w,"default",m,T),m=T}if(b._flags.cast&&m!==void 0){const T=b._definition.cast[b._flags.cast];if(T.from(m)){const N=T.to(m,y);w.mainstay.tracer.value(w,"cast",m,N,b._flags.cast),m=N}}if(b.$_terms.externals&&E.externals&&E._externals!==!1)for(const{method:T}of b.$_terms.externals)w.mainstay.externals.push({method:T,schema:b,state:w,label:f.label(b._flags,w,E)});const R={value:m,errors:x.length?x:null};return b._flags.result&&(R.value=b._flags.result==="strip"?void 0:y.original,w.mainstay.tracer.value(w,b._flags.result,m,R.value),w.shadow(m,b._flags.result)),b._cache&&E.cache!==!1&&!b._refs.length&&b._cache.set(y.original,R),m===void 0||R.errors||b._flags.artifact===void 0||(w.mainstay.artifacts=w.mainstay.artifacts||new Map,w.mainstay.artifacts.has(b._flags.artifact)||w.mainstay.artifacts.set(b._flags.artifact,[]),w.mainstay.artifacts.get(b._flags.artifact).push(w.path)),R},v.prefs=function(m,x){const y=x===u.defaults;return y&&m._preferences[u.symbols.prefs]?m._preferences[u.symbols.prefs]:(x=u.preferences(x,m._preferences),y&&(m._preferences[u.symbols.prefs]=x),x)},v.default=function(m,x,y,b){const{schema:w,state:E,prefs:R}=b,T=w._flags[m];if(R.noDefaults||T===void 0)return x;if(E.mainstay.tracer.log(w,E,"rule",m,"full"),!T)return T;if(typeof T=="function"){const N=T.length?[c(E.ancestors[0]),b]:[];try{return T(...N)}catch(A){return void y.push(w.$_createError(`any.${m}`,null,{error:A},E,R))}}return typeof T!="object"?T:T[u.symbols.literal]?T.literal:u.isResolvable(T)?T.resolve(x,E,R):c(T)},v.trim=function(m,x){if(typeof m!="string")return m;const y=x.$_getRule("trim");return y&&y.args.enabled?m.trim():m},v.ignore={active:!1,debug:d,entry:d,filter:d,log:d,resolve:d,value:d},v.errorsArray=function(){const m=[];return m[u.symbols.errors]=!0,m}},2036:(s,i,o)=>{const a=o(375),c=o(9474),d=o(8160),h={};s.exports=h.Values=class{constructor(u,f){this._values=new Set(u),this._refs=new Set(f),this._lowercase=h.lowercases(u),this._override=!1}get length(){return this._values.size+this._refs.size}add(u,f){d.isResolvable(u)?this._refs.has(u)||(this._refs.add(u),f&&f.register(u)):this.has(u,null,null,!1)||(this._values.add(u),typeof u=="string"&&this._lowercase.set(u.toLowerCase(),u))}static merge(u,f,g){if(u=u||new h.Values,f){if(f._override)return f.clone();for(const v of[...f._values,...f._refs])u.add(v)}if(g)for(const v of[...g._values,...g._refs])u.remove(v);return u.length?u:null}remove(u){d.isResolvable(u)?this._refs.delete(u):(this._values.delete(u),typeof u=="string"&&this._lowercase.delete(u.toLowerCase()))}has(u,f,g,v){return!!this.get(u,f,g,v)}get(u,f,g,v){if(!this.length)return!1;if(this._values.has(u))return{value:u};if(typeof u=="string"&&u&&v){const m=this._lowercase.get(u.toLowerCase());if(m)return{value:m}}if(!this._refs.size&&typeof u!="object")return!1;if(typeof u=="object"){for(const m of this._values)if(c(m,u))return{value:m}}if(f)for(const m of this._refs){const x=m.resolve(u,f,g,null,{in:!0});if(x===void 0)continue;const y=m.in&&typeof x=="object"?Array.isArray(x)?x:Object.keys(x):[x];for(const b of y)if(typeof b==typeof u){if(v&&u&&typeof u=="string"){if(b.toLowerCase()===u.toLowerCase())return{value:b,ref:m}}else if(c(b,u))return{value:b,ref:m}}}return!1}override(){this._override=!0}values(u){if(u&&u.display){const f=[];for(const g of[...this._values,...this._refs])g!==void 0&&f.push(g);return f}return Array.from([...this._values,...this._refs])}clone(){const u=new h.Values(this._values,this._refs);return u._override=this._override,u}concat(u){a(!u._override,"Cannot concat override set of values");const f=new h.Values([...this._values,...u._values],[...this._refs,...u._refs]);return f._override=this._override,f}describe(){const u=[];this._override&&u.push({override:!0});for(const f of this._values.values())u.push(f&&typeof f=="object"?{value:f}:f);for(const f of this._refs.values())u.push(f.describe());return u}},h.Values.prototype[d.symbols.values]=!0,h.Values.prototype.slice=h.Values.prototype.clone,h.lowercases=function(u){const f=new Map;if(u)for(const g of u)typeof g=="string"&&f.set(g.toLowerCase(),g);return f}},978:(s,i,o)=>{const a=o(375),c=o(8571),d=o(1687),h=o(9621),u={};s.exports=function(f,g,v={}){if(a(f&&typeof f=="object","Invalid defaults value: must be an object"),a(!g||g===!0||typeof g=="object","Invalid source value: must be true, falsy or an object"),a(typeof v=="object","Invalid options: must be an object"),!g)return null;if(v.shallow)return u.applyToDefaultsWithShallow(f,g,v);const m=c(f);if(g===!0)return m;const x=v.nullOverride!==void 0&&v.nullOverride;return d(m,g,{nullOverride:x,mergeArrays:!1})},u.applyToDefaultsWithShallow=function(f,g,v){const m=v.shallow;a(Array.isArray(m),"Invalid keys");const x=new Map,y=g===!0?null:new Set;for(let E of m){E=Array.isArray(E)?E:E.split(".");const R=h(f,E);R&&typeof R=="object"?x.set(R,y&&h(g,E)||R):y&&y.add(E)}const b=c(f,{},x);if(!y)return b;for(const E of y)u.reachCopy(b,g,E);const w=v.nullOverride!==void 0&&v.nullOverride;return d(b,g,{nullOverride:w,mergeArrays:!1})},u.reachCopy=function(f,g,v){for(const y of v){if(!(y in g))return;const b=g[y];if(typeof b!="object"||b===null)return;g=b}const m=g;let x=f;for(let y=0;y<v.length-1;++y){const b=v[y];typeof x[b]!="object"&&(x[b]={}),x=x[b]}x[v[v.length-1]]=m}},375:(s,i,o)=>{const a=o(7916);s.exports=function(c,...d){if(!c)throw d.length===1&&d[0]instanceof Error?d[0]:new a(d)}},8571:(s,i,o)=>{const a=o(9621),c=o(4277),d=o(7043),h={needsProtoHack:new Set([c.set,c.map,c.weakSet,c.weakMap])};s.exports=h.clone=function(u,f={},g=null){if(typeof u!="object"||u===null)return u;let v=h.clone,m=g;if(f.shallow){if(f.shallow!==!0)return h.cloneWithShallow(u,f);v=w=>w}else if(m){const w=m.get(u);if(w)return w}else m=new Map;const x=c.getInternalProto(u);if(x===c.buffer)return!1;if(x===c.date)return new Date(u.getTime());if(x===c.regex)return new RegExp(u);const y=h.base(u,x,f);if(y===u)return u;if(m&&m.set(u,y),x===c.set)for(const w of u)y.add(v(w,f,m));else if(x===c.map)for(const[w,E]of u)y.set(w,v(E,f,m));const b=d.keys(u,f);for(const w of b){if(w==="__proto__")continue;if(x===c.array&&w==="length"){y.length=u.length;continue}const E=Object.getOwnPropertyDescriptor(u,w);E?E.get||E.set?Object.defineProperty(y,w,E):E.enumerable?y[w]=v(u[w],f,m):Object.defineProperty(y,w,{enumerable:!1,writable:!0,configurable:!0,value:v(u[w],f,m)}):Object.defineProperty(y,w,{enumerable:!0,writable:!0,configurable:!0,value:v(u[w],f,m)})}return y},h.cloneWithShallow=function(u,f){const g=f.shallow;(f=Object.assign({},f)).shallow=!1;const v=new Map;for(const m of g){const x=a(u,m);typeof x!="object"&&typeof x!="function"||v.set(x,x)}return h.clone(u,f,v)},h.base=function(u,f,g){if(g.prototype===!1)return h.needsProtoHack.has(f)?new f.constructor:f===c.array?[]:{};const v=Object.getPrototypeOf(u);if(v&&v.isImmutable)return u;if(f===c.array){const m=[];return v!==f&&Object.setPrototypeOf(m,v),m}if(h.needsProtoHack.has(f)){const m=new v.constructor;return v!==f&&Object.setPrototypeOf(m,v),m}return Object.create(v)}},9474:(s,i,o)=>{const a=o(4277),c={mismatched:null};s.exports=function(d,h,u){return u=Object.assign({prototype:!0},u),!!c.isDeepEqual(d,h,u,[])},c.isDeepEqual=function(d,h,u,f){if(d===h)return d!==0||1/d==1/h;const g=typeof d;if(g!==typeof h||d===null||h===null)return!1;if(g==="function"){if(!u.deepFunction||d.toString()!==h.toString())return!1}else if(g!=="object")return d!=d&&h!=h;const v=c.getSharedType(d,h,!!u.prototype);switch(v){case a.buffer:return!1;case a.promise:return d===h;case a.regex:return d.toString()===h.toString();case c.mismatched:return!1}for(let m=f.length-1;m>=0;--m)if(f[m].isSame(d,h))return!0;f.push(new c.SeenEntry(d,h));try{return!!c.isDeepEqualObj(v,d,h,u,f)}finally{f.pop()}},c.getSharedType=function(d,h,u){if(u)return Object.getPrototypeOf(d)!==Object.getPrototypeOf(h)?c.mismatched:a.getInternalProto(d);const f=a.getInternalProto(d);return f!==a.getInternalProto(h)?c.mismatched:f},c.valueOf=function(d){const h=d.valueOf;if(h===void 0)return d;try{return h.call(d)}catch(u){return u}},c.hasOwnEnumerableProperty=function(d,h){return Object.prototype.propertyIsEnumerable.call(d,h)},c.isSetSimpleEqual=function(d,h){for(const u of Set.prototype.values.call(d))if(!Set.prototype.has.call(h,u))return!1;return!0},c.isDeepEqualObj=function(d,h,u,f,g){const{isDeepEqual:v,valueOf:m,hasOwnEnumerableProperty:x}=c,{keys:y,getOwnPropertySymbols:b}=Object;if(d===a.array){if(!f.part){if(h.length!==u.length)return!1;for(let N=0;N<h.length;++N)if(!v(h[N],u[N],f,g))return!1;return!0}for(const N of h)for(const A of u)if(v(N,A,f,g))return!0}else if(d===a.set){if(h.size!==u.size)return!1;if(!c.isSetSimpleEqual(h,u)){const N=new Set(Set.prototype.values.call(u));for(const A of Set.prototype.values.call(h)){if(N.delete(A))continue;let D=!1;for(const O of N)if(v(A,O,f,g)){N.delete(O),D=!0;break}if(!D)return!1}}}else if(d===a.map){if(h.size!==u.size)return!1;for(const[N,A]of Map.prototype.entries.call(h))if(A===void 0&&!Map.prototype.has.call(u,N)||!v(A,Map.prototype.get.call(u,N),f,g))return!1}else if(d===a.error&&(h.name!==u.name||h.message!==u.message))return!1;const w=m(h),E=m(u);if((h!==w||u!==E)&&!v(w,E,f,g))return!1;const R=y(h);if(!f.part&&R.length!==y(u).length&&!f.skip)return!1;let T=0;for(const N of R)if(f.skip&&f.skip.includes(N))u[N]===void 0&&++T;else if(!x(u,N)||!v(h[N],u[N],f,g))return!1;if(!f.part&&R.length-T!==y(u).length)return!1;if(f.symbols!==!1){const N=b(h),A=new Set(b(u));for(const D of N){if(!f.skip||!f.skip.includes(D)){if(x(h,D)){if(!x(u,D)||!v(h[D],u[D],f,g))return!1}else if(x(u,D))return!1}A.delete(D)}for(const D of A)if(x(u,D))return!1}return!0},c.SeenEntry=class{constructor(d,h){this.obj=d,this.ref=h}isSame(d,h){return this.obj===d&&this.ref===h}}},7916:(s,i,o)=>{const a=o(8761);s.exports=class extends Error{constructor(c){super(c.filter(d=>d!=="").map(d=>typeof d=="string"?d:d instanceof Error?d.message:a(d)).join(" ")||"Unknown error"),typeof Error.captureStackTrace=="function"&&Error.captureStackTrace(this,i.assert)}}},5277:s=>{const i={};s.exports=function(o){if(!o)return"";let a="";for(let c=0;c<o.length;++c){const d=o.charCodeAt(c);i.isSafe(d)?a+=o[c]:a+=i.escapeHtmlChar(d)}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),d=o(7043),h={};s.exports=h.merge=function(u,f,g){if(a(u&&typeof u=="object","Invalid target value: must be an object"),a(f==null||typeof f=="object","Invalid source value: must be null, undefined, or an object"),!f)return u;if(g=Object.assign({nullOverride:!0,mergeArrays:!0},g),Array.isArray(f)){a(Array.isArray(u),"Cannot merge array onto an object"),g.mergeArrays||(u.length=0);for(let m=0;m<f.length;++m)u.push(c(f[m],{symbols:g.symbols}));return u}const v=d.keys(f,g);for(let m=0;m<v.length;++m){const x=v[m];if(x==="__proto__"||!Object.prototype.propertyIsEnumerable.call(f,x))continue;const y=f[x];if(y&&typeof y=="object"){if(u[x]===y)continue;!u[x]||typeof u[x]!="object"||Array.isArray(u[x])!==Array.isArray(y)||y instanceof Date||y instanceof RegExp?u[x]=c(y,{symbols:g.symbols}):h.merge(u[x],y,g)}else(y!=null||g.nullOverride)&&(u[x]=y)}return u}},9621:(s,i,o)=>{const a=o(375),c={};s.exports=function(d,h,u){if(h===!1||h==null)return d;typeof(u=u||{})=="string"&&(u={separator:u});const f=Array.isArray(h);a(!f||!u.separator,"Separator option is not valid for array-based chain");const g=f?h:h.split(u.separator||".");let v=d;for(let m=0;m<g.length;++m){let x=g[m];const y=u.iterables&&c.iterables(v);if(Array.isArray(v)||y==="set"){const b=Number(x);Number.isInteger(b)&&(x=b<0?v.length+b:b)}if(!v||typeof v=="function"&&u.functions===!1||!y&&v[x]===void 0){a(!u.strict||m+1===g.length,"Missing segment",x,"in reach path ",h),a(typeof v=="object"||u.functions===!0||typeof v!="function","Invalid segment",x,"in reach path ",h),v=u.default;break}v=y?y==="set"?[...v][x]:v.get(x):v[x]}return v},c.iterables=function(d){return d instanceof Set?"set":d 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(d,h){const u=[].concat((h=h||{}).before||[]),f=[].concat(h.after||[]),g=h.group||"?",v=h.sort||0;a(!u.includes(g),`Item cannot come before itself: ${g}`),a(!u.includes("?"),"Item cannot come before unassociated items"),a(!f.includes(g),`Item cannot come after itself: ${g}`),a(!f.includes("?"),"Item cannot come after unassociated items"),Array.isArray(d)||(d=[d]);for(const m of d){const x={seq:this._items.length,sort:v,before:u,after:f,group:g,node:m};this._items.push(x)}if(!h.manual){const m=this._sort();a(m,"item",g!=="?"?`added into group ${g}`:"","created a dependencies error")}return this.nodes}merge(d){Array.isArray(d)||(d=[d]);for(const u of d)if(u)for(const f of u._items)this._items.push(Object.assign({},f));this._items.sort(c.mergeSort);for(let u=0;u<this._items.length;++u)this._items[u].seq=u;const h=this._sort();return a(h,"merge created a dependencies error"),this.nodes}sort(){const d=this._sort();return a(d,"sort created a dependencies error"),this.nodes}_sort(){const d={},h=Object.create(null),u=Object.create(null);for(const x of this._items){const y=x.seq,b=x.group;u[b]=u[b]||[],u[b].push(y),d[y]=x.before;for(const w of x.after)h[w]=h[w]||[],h[w].push(y)}for(const x in d){const y=[];for(const b in d[x]){const w=d[x][b];u[w]=u[w]||[],y.push(...u[w])}d[x]=y}for(const x in h)if(u[x])for(const y of u[x])d[y].push(...h[x]);const f={};for(const x in d){const y=d[x];for(const b of y)f[b]=f[b]||[],f[b].push(x)}const g={},v=[];for(let x=0;x<this._items.length;++x){let y=x;if(f[x]){y=null;for(let b=0;b<this._items.length;++b){if(g[b]===!0)continue;f[b]||(f[b]=[]);const w=f[b].length;let E=0;for(let R=0;R<w;++R)g[f[b][R]]&&++E;if(E===w){y=b;break}}}y!==null&&(g[y]=!0,v.push(y))}if(v.length!==this._items.length)return!1;const m={};for(const x of this._items)m[x.seq]=x;this._items=[],this.nodes=[];for(const x of v){const y=m[x];this.nodes.push(y.node),this._items.push(y)}return!0}},c.mergeSort=(d,h)=>d.sort===h.sort?0:d.sort<h.sort?-1:1},5380:(s,i,o)=>{const a=o(443),c=o(2178),d={minDomainSegments:2,nonAsciiRx:/[^\x00-\x7f]/,domainControlRx:/[\x00-\x20@\:\/\\#!\$&\'\(\)\*\+,;=\?]/,tldSegmentRx:/^[a-zA-Z](?:[a-zA-Z0-9\-]*[a-zA-Z0-9])?$/,domainSegmentRx:/^[a-zA-Z0-9](?:[a-zA-Z0-9\-]*[a-zA-Z0-9])?$/,URL:a.URL||URL};i.analyze=function(h,u={}){if(!h)return c.code("DOMAIN_NON_EMPTY_STRING");if(typeof h!="string")throw new Error("Invalid input: domain must be a string");if(h.length>256)return c.code("DOMAIN_TOO_LONG");if(d.nonAsciiRx.test(h)){if(u.allowUnicode===!1)return c.code("DOMAIN_INVALID_UNICODE_CHARS");h=h.normalize("NFC")}if(d.domainControlRx.test(h))return c.code("DOMAIN_INVALID_CHARS");h=d.punycode(h),u.allowFullyQualified&&h[h.length-1]==="."&&(h=h.slice(0,-1));const f=u.minDomainSegments||d.minDomainSegments,g=h.split(".");if(g.length<f)return c.code("DOMAIN_SEGMENTS_COUNT");if(u.maxDomainSegments&&g.length>u.maxDomainSegments)return c.code("DOMAIN_SEGMENTS_COUNT_MAX");const v=u.tlds;if(v){const m=g[g.length-1].toLowerCase();if(v.deny&&v.deny.has(m)||v.allow&&!v.allow.has(m))return c.code("DOMAIN_FORBIDDEN_TLDS")}for(let m=0;m<g.length;++m){const x=g[m];if(!x.length)return c.code("DOMAIN_EMPTY_SEGMENT");if(x.length>63)return c.code("DOMAIN_LONG_SEGMENT");if(m<g.length-1){if(!d.domainSegmentRx.test(x))return c.code("DOMAIN_INVALID_CHARS")}else if(!d.tldSegmentRx.test(x))return c.code("DOMAIN_INVALID_TLDS_CHARS")}return null},i.isValid=function(h,u){return!i.analyze(h,u)},d.punycode=function(h){h.includes("%")&&(h=h.replace(/%/g,"%25"));try{return new d.URL(`http://${h}`).host}catch{return h}}},1745:(s,i,o)=>{const a=o(9848),c=o(5380),d=o(2178),h={nonAsciiRx:/[^\x00-\x7f]/,encoder:new(a.TextEncoder||TextEncoder)};i.analyze=function(u,f){return h.email(u,f)},i.isValid=function(u,f){return!h.email(u,f)},h.email=function(u,f={}){if(typeof u!="string")throw new Error("Invalid input: email must be a string");if(!u)return d.code("EMPTY_STRING");const g=!h.nonAsciiRx.test(u);if(!g){if(f.allowUnicode===!1)return d.code("FORBIDDEN_UNICODE");u=u.normalize("NFC")}const v=u.split("@");if(v.length!==2)return v.length>2?d.code("MULTIPLE_AT_CHAR"):d.code("MISSING_AT_CHAR");const[m,x]=v;if(!m)return d.code("EMPTY_LOCAL");if(!f.ignoreLength){if(u.length>254)return d.code("ADDRESS_TOO_LONG");if(h.encoder.encode(m).length>64)return d.code("LOCAL_TOO_LONG")}return h.local(m,g)||c.analyze(x,f)},h.local=function(u,f){const g=u.split(".");for(const v of g){if(!v.length)return d.code("EMPTY_LOCAL_SEGMENT");if(f){if(!h.atextRx.test(v))return d.code("INVALID_LOCAL_CHARS")}else for(const m of v){if(h.atextRx.test(m))continue;const x=h.binary(m);if(!h.atomRx.test(x))return d.code("INVALID_LOCAL_CHARS")}}},h.binary=function(u){return Array.from(h.encoder.encode(u)).map(f=>String.fromCharCode(f)).join("")},h.atextRx=/^[\w!#\$%&'\*\+\-/=\?\^`\{\|\}~]+$/,h.atomRx=new RegExp(["(?:[\\xc2-\\xdf][\\x80-\\xbf])","(?:\\xe0[\\xa0-\\xbf][\\x80-\\xbf])|(?:[\\xe1-\\xec][\\x80-\\xbf]{2})|(?:\\xed[\\x80-\\x9f][\\x80-\\xbf])|(?:[\\xee-\\xef][\\x80-\\xbf]{2})","(?:\\xf0[\\x90-\\xbf][\\x80-\\xbf]{2})|(?:[\\xf1-\\xf3][\\x80-\\xbf]{3})|(?:\\xf4[\\x80-\\x8f][\\x80-\\xbf]{2})"].join("|"))},2178:(s,i)=>{i.codes={EMPTY_STRING:"Address must be a non-empty string",FORBIDDEN_UNICODE:"Address contains forbidden Unicode characters",MULTIPLE_AT_CHAR:"Address cannot contain more than one @ character",MISSING_AT_CHAR:"Address must contain one @ character",EMPTY_LOCAL:"Address local part cannot be empty",ADDRESS_TOO_LONG:"Address too long",LOCAL_TOO_LONG:"Address local part too long",EMPTY_LOCAL_SEGMENT:"Address local part contains empty dot-separated segment",INVALID_LOCAL_CHARS:"Address local part contains invalid character",DOMAIN_NON_EMPTY_STRING:"Domain must be a non-empty string",DOMAIN_TOO_LONG:"Domain too long",DOMAIN_INVALID_UNICODE_CHARS:"Domain contains forbidden Unicode characters",DOMAIN_INVALID_CHARS:"Domain contains invalid character",DOMAIN_INVALID_TLDS_CHARS:"Domain contains invalid tld character",DOMAIN_SEGMENTS_COUNT:"Domain lacks the minimum required number of segments",DOMAIN_SEGMENTS_COUNT_MAX:"Domain contains too many segments",DOMAIN_FORBIDDEN_TLDS:"Domain uses forbidden TLD",DOMAIN_EMPTY_SEGMENT:"Domain contains empty dot-separated segment",DOMAIN_LONG_SEGMENT:"Domain contains dot-separated segment that is too long"},i.code=function(o){return{code:o,error:i.codes[o]}}},9959:(s,i,o)=>{const a=o(375),c=o(5752);i.regex=function(d={}){a(d.cidr===void 0||typeof d.cidr=="string","options.cidr must be a string");const h=d.cidr?d.cidr.toLowerCase():"optional";a(["required","optional","forbidden"].includes(h),"options.cidr must be one of required, optional, forbidden"),a(d.version===void 0||typeof d.version=="string"||Array.isArray(d.version),"options.version must be a string or an array of string");let u=d.version||["ipv4","ipv6","ipvfuture"];Array.isArray(u)||(u=[u]),a(u.length>=1,"options.version must have at least 1 version specified");for(let v=0;v<u.length;++v)a(typeof u[v]=="string","options.version must only contain strings"),u[v]=u[v].toLowerCase(),a(["ipv4","ipv6","ipvfuture"].includes(u[v]),"options.version contains unknown version "+u[v]+" - must be one of ipv4, ipv6, ipvfuture");u=Array.from(new Set(u));const f=`(?:${u.map(v=>{if(h==="forbidden")return c.ip[v];const m=`\\/${v==="ipv4"?c.ip.v4Cidr:c.ip.v6Cidr}`;return h==="required"?`${c.ip[v]}${m}`:`${c.ip[v]}(?:${m})?`}).join("|")})`,g=new RegExp(`^${f}$`);return{cidr:h,versions:u,regex:g,raw:f}}},5752:(s,i,o)=>{const a=o(375),c=o(6064),d={generate:function(){const h={},u="\\dA-Fa-f",f="["+u+"]",g="\\w-\\.~",v="!\\$&'\\(\\)\\*\\+,;=",m="%"+u,x=g+m+v+":@",y="["+x+"]",b="(?:0{0,2}\\d|0?[1-9]\\d|1\\d\\d|2[0-4]\\d|25[0-5])";h.ipv4address="(?:"+b+"\\.){3}"+b;const w=f+"{1,4}",E="(?:"+w+":"+w+"|"+h.ipv4address+")",R="(?:"+w+":){6}"+E,T="::(?:"+w+":){5}"+E,N="(?:"+w+")?::(?:"+w+":){4}"+E,A="(?:(?:"+w+":){0,1}"+w+")?::(?:"+w+":){3}"+E,D="(?:(?:"+w+":){0,2}"+w+")?::(?:"+w+":){2}"+E,O="(?:(?:"+w+":){0,3}"+w+")?::"+w+":"+E,I="(?:(?:"+w+":){0,4}"+w+")?::"+E,$="(?:(?:"+w+":){0,5}"+w+")?::"+w,F="(?:(?:"+w+":){0,6}"+w+")?::";h.ipv4Cidr="(?:\\d|[1-2]\\d|3[0-2])",h.ipv6Cidr="(?:0{0,2}\\d|0?[1-9]\\d|1[01]\\d|12[0-8])",h.ipv6address="(?:"+R+"|"+T+"|"+N+"|"+A+"|"+D+"|"+O+"|"+I+"|"+$+"|"+F+")",h.ipvFuture="v"+f+"+\\.["+g+v+":]+",h.scheme="[a-zA-Z][a-zA-Z\\d+-\\.]*",h.schemeRegex=new RegExp(h.scheme);const B="["+g+m+v+":]*",W="["+g+m+v+"]{1,255}",Z="(?:\\[(?:"+h.ipv6address+"|"+h.ipvFuture+")\\]|"+h.ipv4address+"|"+W+")",Y="(?:"+B+"@)?"+Z+"(?::\\d*)?",H="(?:"+B+"@)?("+Z+")(?::\\d*)?",se=y+"*",he=y+"+",re="(?:\\/"+se+")*",J="\\/(?:"+he+re+")?",te=he+re,ae="["+g+m+v+"@]+"+re,be="(?:\\/\\/\\/"+se+re+")";return h.hierPart="(?:(?:\\/\\/"+Y+re+")|"+J+"|"+te+"|"+be+")",h.hierPartCapture="(?:(?:\\/\\/"+H+re+")|"+J+"|"+te+")",h.relativeRef="(?:(?:\\/\\/"+Y+re+")|"+J+"|"+ae+"|)",h.relativeRefCapture="(?:(?:\\/\\/"+H+re+")|"+J+"|"+ae+"|)",h.query="["+x+"\\/\\?]*(?=#|$)",h.queryWithSquareBrackets="["+x+"\\[\\]\\/\\?]*(?=#|$)",h.fragment="["+x+"\\/\\?]*",h}};d.rfc3986=d.generate(),i.ip={v4Cidr:d.rfc3986.ipv4Cidr,v6Cidr:d.rfc3986.ipv6Cidr,ipv4:d.rfc3986.ipv4address,ipv6:d.rfc3986.ipv6address,ipvfuture:d.rfc3986.ipvFuture},d.createRegex=function(h){const u=d.rfc3986,f="(?:\\?"+(h.allowQuerySquareBrackets?u.queryWithSquareBrackets:u.query)+")?(?:#"+u.fragment+")?",g=h.domain?u.relativeRefCapture:u.relativeRef;if(h.relativeOnly)return d.wrap(g+f);let v="";if(h.scheme){a(h.scheme instanceof RegExp||typeof h.scheme=="string"||Array.isArray(h.scheme),"scheme must be a RegExp, String, or Array");const y=[].concat(h.scheme);a(y.length>=1,"scheme must have at least 1 scheme specified");const b=[];for(let w=0;w<y.length;++w){const E=y[w];a(E instanceof RegExp||typeof E=="string","scheme at position "+w+" must be a RegExp or String"),E instanceof RegExp?b.push(E.source.toString()):(a(u.schemeRegex.test(E),"scheme at position "+w+" must be a valid scheme"),b.push(c(E)))}v=b.join("|")}const m="(?:"+(v?"(?:"+v+")":u.scheme)+":"+(h.domain?u.hierPartCapture:u.hierPart)+")",x=h.allowRelative?"(?:"+m+"|"+g+")":m;return d.wrap(x+f,v)},d.wrap=function(h,u){return{raw:h=`(?=.)(?!https?:/(?:$|[^/]))(?!https?:///)(?!https?:[^/])${h}`,regex:new RegExp(`^${h}$`),scheme:u}},d.uriRegex=d.createRegex({}),i.regex=function(h={}){return h.scheme||h.allowRelative||h.relativeOnly||h.allowQuerySquareBrackets||h.domain?d.createRegex(h):d.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 d in c.constants){const h=c.constants[d];if(h!==null&&!["boolean","number","string"].includes(typeof h))throw new Error(`Formula constant ${d} contains invalid ${typeof h} value type`)}this.settings=c[o.settings]?c:Object.assign({[o.settings]:!0,constants:{},functions:{}},c),this.single=null,this._parts=null,this._parse(a)}_parse(a){let c=[],d="",h=0,u=!1;const f=v=>{if(h)throw new Error("Formula missing closing parenthesis");const m=c.length?c[c.length-1]:null;if(u||d||v){if(m&&m.type==="reference"&&v===")")return m.type="function",m.value=this._subFormula(d,m.value),void(d="");if(v===")"){const x=new i.Parser(d,this.settings);c.push({type:"segment",value:x})}else if(u){if(u==="]")return c.push({type:"reference",value:d}),void(d="");c.push({type:"literal",value:d})}else if(o.operatorCharacters.includes(d))m&&m.type==="operator"&&o.operators.includes(m.value+d)?m.value+=d:c.push({type:"operator",value:d});else if(d.match(o.numberRx))c.push({type:"constant",value:parseFloat(d)});else if(this.settings.constants[d]!==void 0)c.push({type:"constant",value:this.settings.constants[d]});else{if(!d.match(o.tokenRx))throw new Error(`Formula contains invalid token: ${d}`);c.push({type:"reference",value:d})}d=""}};for(const v of a)u?v===u?(f(),u=!1):d+=v:h?v==="("?(d+=v,++h):v===")"?(--h,h?d+=v:f(v)):d+=v:v in o.literals?u=o.literals[v]:v==="("?(f(),++h):o.operatorCharacters.includes(v)?(f(),d=v,f()):v!==" "?d+=v:f();f(),c=c.map((v,m)=>v.type!=="operator"||v.value!=="-"||m&&c[m-1].type!=="operator"?v:{type:"operator",value:"n"});let g=!1;for(const v of c){if(v.type==="operator"){if(o.operatorsPrefix.includes(v.value))continue;if(!g)throw new Error("Formula contains an operator in invalid position");if(!o.operators.includes(v.value))throw new Error(`Formula contains an unknown operator ${v.value}`)}else if(g)throw new Error("Formula missing expected operator");g=!g}if(!g)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(v=>{if(v.type==="operator")return o.operatorsPrefix.includes(v.value)?v:v.value;if(v.type!=="reference")return v.value;if(this.settings.tokenRx&&!this.settings.tokenRx.test(v.value))throw new Error(`Formula contains invalid reference ${v.value}`);return this.settings.reference?this.settings.reference(v.value):o.reference(v.value)})}_subFormula(a,c){const d=this.settings.functions[c];if(typeof d!="function")throw new Error(`Formula contains unknown function ${c}`);let h=[];if(a){let u="",f=0,g=!1;const v=()=>{if(!u)throw new Error(`Formula contains function ${c} with invalid arguments ${a}`);h.push(u),u=""};for(let m=0;m<a.length;++m){const x=a[m];g?(u+=x,x===g&&(g=!1)):x in o.literals&&!f?(u+=x,g=o.literals[x]):x!==","||f?(u+=x,x==="("?++f:x===")"&&--f):v()}v()}return h=h.map(u=>new i.Parser(u,this.settings)),function(u){const f=[];for(const g of h)f.push(g.evaluate(u));return d.call(u,...f)}}evaluate(a){const c=this._parts.slice();for(let d=c.length-2;d>=0;--d){const h=c[d];if(h&&h.type==="operator"){const u=c[d+1];c.splice(d+1,1);const f=o.evaluate(u,a);c[d]=o.single(h.value,f)}}return o.operatorsOrder.forEach(d=>{for(let h=1;h<c.length-1;)if(d.includes(c[h])){const u=c[h],f=o.evaluate(c[h-1],a),g=o.evaluate(c[h+1],a);c.splice(h,2);const v=o.calculate(u,f,g);c[h-1]=v===0?0:v}else h+=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 d=-c;return d===0?0:d},o.calculate=function(a,c,d){if(a==="??")return o.exists(c)?c:d;if(typeof c=="string"||typeof d=="string"){if(a==="+")return(c=o.exists(c)?c:"")+(o.exists(d)?d:"")}else switch(a){case"^":return Math.pow(c,d);case"*":return c*d;case"/":return c/d;case"%":return c%d;case"+":return c+d;case"-":return c-d}switch(a){case"<":return c<d;case"<=":return c<=d;case">":return c>d;case">=":return c>=d;case"==":return c===d;case"!=":return c!==d;case"&&":return c&&d;case"||":return c||d}return null},o.exists=function(a){return a!=null}},9926:()=>{},5688:()=>{},9708:()=>{},1152:()=>{},443:()=>{},9848:()=>{},5934:s=>{s.exports=JSON.parse('{"version":"17.13.3"}')}},r={},function s(i){var o=r[i];if(o!==void 0)return o.exports;var a=r[i]={exports:{}};return n[i](a,a.exports,s),a.exports}(5107);var n,r})})(Wce);var xFe=Wce.exports;const wn=Al(xFe),_Fe=e=>typeof e=="object"&&e!==null&&e.hasOwnProperty("total_items");class Vn{constructor(t){Be(this,"_object");Be(this,"_error");Be(this,"isSuccess");Be(this,"isFailure");const{isSuccess:n,error:r,object:s}=t;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(t){return new Vn({isSuccess:!0,object:t})}static fail(t){return new Vn({isSuccess:!1,error:t})}static combine(t){for(const n of t)if(n.isFailure)return n;return Vn.ok()}}class nr{static validate(t,n,r={}){if(!wn.isSchema(t))throw new wFe("Rule provided is not a valid Joi schema!");const s={abortEarly:!1,errors:{wrap:{label:"{}"}},...r},i=t.validate(n,s);return i.error?Vn.fail(i.error):Vn.ok(i.value)}static validateFnc(t){return(n,r)=>{const s=t(n);return s.isSuccess?n:r.message({custom:s.error.message})}}}Be(nr,"RULE_NOT_NULL_OR_UNDEFINED",wn.any().required().invalid(null)),Be(nr,"RULE_ALLOW_NULL_OR_UNDEFINED",wn.any().optional().valid(null)),Be(nr,"RULE_ALLOW_NULL",wn.any().valid(null)),Be(nr,"RULE_ALLOW_EMPTY",wn.any().optional().valid(null,"")),Be(nr,"RULE_IS_TYPE_STRING",wn.string()),Be(nr,"RULE_IS_TYPE_NUMBER",wn.number());class wFe extends Error{}class iW extends Error{constructor(n,r,s={}){super(r);Be(this,"code");Be(this,"payload",{});this.name=this.constructor.name,this.code=n,this.payload=s,Object.setPrototypeOf(this,iW.prototype)}}const wk=class wk extends iW{static create(t,n,r){return new wk(t,n,r)}};Be(wk,"INVALID_INPUT_DATA","INVALID_INPUT_DATA");let Pc=wk;function bp(e,t="",n){return Pc.create(e,t,n)}var qce={};(function(e){Object.defineProperty(e,"__esModule",{value:!0});var t=Object.prototype.hasOwnProperty;e.is=function(n,r){return n===r?n!==0||r!==0||1/n===1/r:n!==n&&r!==r},e.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:e.is,c=0;c<i.length;c++){var d=i[c];if(!t.call(r,d)||!a(n[d],r[d]))return!1}return!0}})(qce);class oW{constructor(t){Be(this,"props");this.props=typeof t=="object"?Object.freeze(t):t}get value(){return this.props}equals(t){return t==null||t.props===void 0?!1:qce.shallowEqual(this.props,t.props)}}class D7e extends wn.ValidationError{}class O7e extends wn.ValidationError{}let yP;const SFe=new Uint8Array(16);function CFe(){if(!yP&&(yP=typeof crypto<"u"&&crypto.getRandomValues&&crypto.getRandomValues.bind(crypto),!yP))throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");return yP(SFe)}const wi=[];for(let e=0;e<256;++e)wi.push((e+256).toString(16).slice(1));function EFe(e,t=0){return wi[e[t+0]]+wi[e[t+1]]+wi[e[t+2]]+wi[e[t+3]]+"-"+wi[e[t+4]]+wi[e[t+5]]+"-"+wi[e[t+6]]+wi[e[t+7]]+"-"+wi[e[t+8]]+wi[e[t+9]]+"-"+wi[e[t+10]]+wi[e[t+11]]+wi[e[t+12]]+wi[e[t+13]]+wi[e[t+14]]+wi[e[t+15]]}const AFe=typeof crypto<"u"&&crypto.randomUUID&&crypto.randomUUID.bind(crypto),uK={randomUUID:AFe};function RFe(e,t,n){if(uK.randomUUID&&!e)return uK.randomUUID();e=e||{};const r=e.random||(e.rng||CFe)();return r[6]=r[6]&15|64,r[8]=r[8]&63|128,EFe(r)}class hR extends oW{constructor(){super(...arguments);Be(this,"isNull",()=>this.props===null)}}class uh extends hR{static validate(t,n){const r=nr.RULE_ALLOW_EMPTY.default(""),s=wn.string().guid({version:["uuidv4"]}).label(n.label?n.label:"id"),i=wn.alternatives(r,s);return nr.validate(i,t)}static sanitize(t){return t.trim()}static create(t,n={}){const r={label:"id",generateOnEmpty:!1,...n};if(!t&&!r.generateOnEmpty)return Vn.fail(bp(Pc.INVALID_INPUT_DATA,"ID is null or empty"));if(t){const s=uh.validate(t,r);return s.isFailure?Vn.fail(bp(Pc.INVALID_INPUT_DATA,s.error.message,r)):Vn.ok(new uh(uh.sanitize(s.object)))}return r.generateOnEmpty?uh.generateNewID():Vn.ok(new uh(null))}static generateNewID(){return Vn.ok(new uh(RFe()))}get value(){return String(this.props)}toString(){return String(this.props)}toPrimitive(){return this.toString()}}class M7e extends wn.ValidationError{}class I7e extends wn.ValidationError{}class L7e extends wn.ValidationError{}class j7e extends wn.ValidationError{}class $7e extends wn.ValidationError{}const z4={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"}},fh=class fh extends hR{constructor(){super(...arguments);Be(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=wn.alternatives(nr.RULE_ALLOW_EMPTY.default(""),wn.string().uppercase().valid(...Object.keys(z4)).label(String(r.label)));return nr.validate(s,n)}static createFromCode(n,r={}){const s={...r,label:r.label?r.label:"current_code"},i=fh.validate(n,s);return i.isFailure?Vn.fail(bp(Pc.INVALID_INPUT_DATA,i.error.message,s)):Vn.ok(new fh(z4[i.object]))}static createDefaultCode(){return fh.createFromCode(fh.DEFAULT_CURRENCY_CODE)}isEmpty(){return this.isNull()||this.props===void 0}toPrimitive(){return this.toString()}};Be(fh,"DEFAULT_CURRENCY_CODE","EUR"),Be(fh,"CURRENCIES",z4);let Rv=fh;class F7e extends wn.ValidationError{}const B4={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"}},hh=class hh extends hR{constructor(){super(...arguments);Be(this,"toString",()=>this.code)}static validate(n,r){const s=wn.alternatives(nr.RULE_ALLOW_EMPTY.default(""),wn.string().lowercase().valid(...Object.keys(B4)).label(String(r.label)));return nr.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=hh.validate(n,s);if(i.isFailure)return Vn.fail(bp(Pc.INVALID_INPUT_DATA,i.error.message,s));const o=hh.sanitize(i.object),a=o?{...B4[i.object],code:o}:void 0;return Vn.ok(new hh(a))}static createDefaultCode(){return hh.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()}};Be(hh,"DEFAULT_LANGUAGE_CODE","es"),Be(hh,"LANGUAGES",B4);let U1=hh;var PFe={defaultAmount:0,defaultCurrency:"USD",defaultPrecision:2},NFe={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 V1(e){"@babel/helpers - typeof";return typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?V1=function(t){return typeof t}:V1=function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},V1(e)}function dK(e){return TFe(e)||kFe(e)||DFe(e)||OFe()}function TFe(e){if(Array.isArray(e))return e}function kFe(e){if(typeof Symbol<"u"&&Symbol.iterator in Object(e))return Array.from(e)}function DFe(e,t){if(e){if(typeof e=="string")return fK(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);if(n==="Object"&&e.constructor&&(n=e.constructor.name),n==="Map"||n==="Set")return Array.from(e);if(n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return fK(e,t)}}function fK(e,t){(t==null||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function OFe(){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 MFe={normalizePrecision:function(t){var n=t.reduce(function(r,s){return Math.max(r.getPrecision(),s.getPrecision())});return t.map(function(r){return r.getPrecision()!==n?r.convertPrecision(n):r})},minimum:function(t){var n=dK(t),r=n[0],s=n.slice(1),i=r;return s.forEach(function(o){i=i.lessThan(o)?i:o}),i},maximum:function(t){var n=dK(t),r=n[0],s=n.slice(1),i=r;return s.forEach(function(o){i=i.greaterThan(o)?i:o}),i}};function Gce(e){return!isNaN(parseInt(e))&&isFinite(e)}function IFe(e){return Gce(e)&&e<=100&&e>=0}function LFe(e){return e.length>0&&e.every(function(t){return t>=0})&&e.some(function(t){return t>0})}function hK(e){return e%2===0}function pK(e){return Gce(e)&&!Number.isInteger(e)}function jFe(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:0,t=e.toString();if(t.indexOf("e-")>0)return parseInt(t.split("e-")[1]);var n=t.split(".")[1];return n?n.length:0}function GS(e){return Math.abs(e)%1===.5}function $Fe(e){var t=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",e,!0),FFe(s,t.headers),s.send()})}function FFe(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};for(var n in t)e.setRequestHeader(n,t[n]);return e}function h1(e){return typeof e>"u"}function Kce(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:".",n={};return Object.entries(e).forEach(function(r){if(V1(r[1])==="object"){var s=Kce(r[1]);Object.entries(s).forEach(function(i){n[r[0]+t+i[0]]=i[1]})}else n[r[0]]=r[1]}),n}function zFe(e){return!!e&&(V1(e)==="object"||typeof e=="function")&&typeof e.then=="function"}function Yce(){var e=function(r,s){var i=function(c){return Math.pow(10,jFe(c))},o=Math.max(i(r),i(s));return Math.round(r*o)*Math.round(s*o)/(o*o)},t={HALF_ODD:function(r){var s=Math.round(r);return GS(r)&&hK(s)?s-1:s},HALF_EVEN:function(r){var s=Math.round(r);return GS(r)?hK(s)?s:s-1:s},HALF_UP:function(r){return Math.round(r)},HALF_DOWN:function(r){return GS(r)?Math.floor(r):Math.round(r)},HALF_TOWARDS_ZERO:function(r){return GS(r)?Math.sign(r)*Math.floor(Math.abs(r)):Math.round(r)},HALF_AWAY_FROM_ZERO:function(r){return GS(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 pK(r)||pK(s)?e(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 t[s](r)}}}var BFe=Yce();function UFe(e){var t=/^(?:(\$|USD)?0(?:(,)0)?(\.)?(0+)?|0(?:(,)0)?(\.)?(0+)?\s?(dollar)?)$/gm.exec(e);return{getMatches:function(){return t!==null?t.slice(1).filter(function(r){return!h1(r)}):[]},getMinimumFractionDigits:function(){var r=function(i){return i==="."};return h1(this.getMatches().find(r))?0:this.getMatches()[BFe.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 h1(this.getCurrencyDisplay(this.getMatches()))?"decimal":"currency"},getUseGrouping:function(){return!h1(this.getMatches().find(function(r){return r===","}))}}}function VFe(e){var t=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 $Fe(t(e.endpoint,{from:s,to:i}),{headers:e.headers})};return{getExchangeRate:function(s,i){return(zFe(e.endpoint)?e.endpoint:n(s,i)).then(function(o){return Kce(o)[t(e.propertyPath,{from:s,to:i})]})}}}function IC(e,t){var n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:Error;if(!e)throw new n(t)}function HFe(e){IC(IFe(e),"You must provide a numeric value between 0 and 100.",RangeError)}function WFe(e){IC(LFe(e),"You must provide a non-empty array of numeric values greater than 0.",TypeError)}function U4(e){IC(Number.isInteger(e),"You must provide an integer.",TypeError)}var $r=Yce(),qFe=function e(t){var n=Object.assign({},{amount:e.defaultAmount,currency:e.defaultCurrency,precision:e.defaultPrecision},t),r=n.amount,s=n.currency,i=n.precision;U4(r),U4(i);var o=e.globalLocale,a=e.globalFormat,c=e.globalRoundingMode,d=e.globalFormatRoundingMode,h=Object.assign({},e.globalExchangeRatesApi),u=function(v){var m=Object.assign({},Object.assign({},{amount:r,currency:s,precision:i},v),Object.assign({},{locale:this.locale},v));return Object.assign(e({amount:m.amount,currency:m.currency,precision:m.precision}),{locale:m.locale})},f=function(v){IC(this.hasSameCurrency(v),"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(v){return u.call(this,{locale:v})},getPrecision:function(){return i},convertPrecision:function(v){var m=arguments.length>1&&arguments[1]!==void 0?arguments[1]:d;U4(v);var x=this.getPrecision(),y=v>x,b=y?$r.multiply:$r.divide,w=y?[v,x]:[x,v],E=Math.pow(10,$r.subtract.apply($r,w));return u.call(this,{amount:$r.round(b(this.getAmount(),E),m),precision:v})},add:function(v){f.call(this,v);var m=e.normalizePrecision([this,v]);return u.call(this,{amount:$r.add(m[0].getAmount(),m[1].getAmount()),precision:m[0].getPrecision()})},subtract:function(v){f.call(this,v);var m=e.normalizePrecision([this,v]);return u.call(this,{amount:$r.subtract(m[0].getAmount(),m[1].getAmount()),precision:m[0].getPrecision()})},multiply:function(v){var m=arguments.length>1&&arguments[1]!==void 0?arguments[1]:c;return u.call(this,{amount:$r.round($r.multiply(this.getAmount(),v),m)})},divide:function(v){var m=arguments.length>1&&arguments[1]!==void 0?arguments[1]:c;return u.call(this,{amount:$r.round($r.divide(this.getAmount(),v),m)})},percentage:function(v){var m=arguments.length>1&&arguments[1]!==void 0?arguments[1]:c;return HFe(v),this.multiply($r.divide(v,100),m)},allocate:function(v){var m=this;WFe(v);for(var x=v.reduce(function(E,R){return $r.add(E,R)}),y=this.getAmount(),b=v.map(function(E){var R=Math.floor($r.divide($r.multiply(m.getAmount(),E),x));return y=$r.subtract(y,R),u.call(m,{amount:R})}),w=0;y>0;)v[w]>0&&(b[w]=b[w].add(u.call(this,{amount:1})),y=$r.subtract(y,1)),w+=1;return b},convert:function(v){var m=this,x=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},y=x.endpoint,b=y===void 0?h.endpoint:y,w=x.propertyPath,E=w===void 0?h.propertyPath||"rates.{{to}}":w,R=x.headers,T=R===void 0?h.headers:R,N=x.roundingMode,A=N===void 0?c:N,D=Object.assign({},{endpoint:b,propertyPath:E,headers:T,roundingMode:A});return VFe(D).getExchangeRate(this.getCurrency(),v).then(function(O){return IC(!h1(O),'No rate was found for the destination currency "'.concat(v,'".'),TypeError),u.call(m,{amount:$r.round($r.multiply(m.getAmount(),parseFloat(O)),D.roundingMode),currency:v})})},equalsTo:function(v){return this.hasSameAmount(v)&&this.hasSameCurrency(v)},lessThan:function(v){f.call(this,v);var m=e.normalizePrecision([this,v]);return m[0].getAmount()<m[1].getAmount()},lessThanOrEqual:function(v){f.call(this,v);var m=e.normalizePrecision([this,v]);return m[0].getAmount()<=m[1].getAmount()},greaterThan:function(v){f.call(this,v);var m=e.normalizePrecision([this,v]);return m[0].getAmount()>m[1].getAmount()},greaterThanOrEqual:function(v){f.call(this,v);var m=e.normalizePrecision([this,v]);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 $r.modulo(this.getAmount(),Math.pow(10,i))!==0},hasCents:function(){return $r.modulo(this.getAmount(),Math.pow(10,i))!==0},hasSameCurrency:function(v){return this.getCurrency()===v.getCurrency()},hasSameAmount:function(v){var m=e.normalizePrecision([this,v]);return m[0].getAmount()===m[1].getAmount()},toFormat:function(){var v=arguments.length>0&&arguments[0]!==void 0?arguments[0]:a,m=arguments.length>1&&arguments[1]!==void 0?arguments[1]:d,x=UFe(v);return this.toRoundedUnit(x.getMinimumFractionDigits(),m).toLocaleString(this.getLocale(),{currencyDisplay:x.getCurrencyDisplay(),useGrouping:x.getUseGrouping(),minimumFractionDigits:x.getMinimumFractionDigits(),style:x.getStyle(),currency:this.getCurrency()})},toUnit:function(){return $r.divide(this.getAmount(),Math.pow(10,i))},toRoundedUnit:function(v){var m=arguments.length>1&&arguments[1]!==void 0?arguments[1]:d,x=Math.pow(10,v);return $r.divide($r.round($r.multiply(this.toUnit(),x),m),x)},toObject:function(){return{amount:r,currency:s,precision:i}},toJSON:function(){return this.toObject()}}},bP=Object.assign(qFe,PFe,NFe,MFe),YT={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
|
||
*/YT.exports;(function(e,t){(function(){var n,r="4.17.21",s=200,i="Unsupported core-js use. Try https://npms.io/search?q=ponyfill.",o="Expected a function",a="Invalid `variable` option passed into `_.template`",c="__lodash_hash_undefined__",d=500,h="__lodash_placeholder__",u=1,f=2,g=4,v=1,m=2,x=1,y=2,b=4,w=8,E=16,R=32,T=64,N=128,A=256,D=512,O=30,I="...",$=800,F=16,B=1,W=2,Z=3,Y=1/0,H=9007199254740991,se=17976931348623157e292,he=NaN,re=4294967295,J=re-1,te=re>>>1,ae=[["ary",N],["bind",x],["bindKey",y],["curry",w],["curryRight",E],["flip",D],["partial",R],["partialRight",T],["rearg",A]],be="[object Arguments]",xe="[object Array]",ve="[object AsyncFunction]",Pe="[object Boolean]",Oe="[object Date]",ke="[object DOMException]",ze="[object Error]",$e="[object Function]",Te="[object GeneratorFunction]",Ue="[object Map]",wt="[object Number]",ut="[object Null]",St="[object Object]",Nn="[object Promise]",cn="[object Proxy]",hn="[object RegExp]",It="[object Set]",U="[object String]",ee="[object Symbol]",ie="[object Undefined]",_e="[object WeakMap]",we="[object WeakSet]",pe="[object ArrayBuffer]",Se="[object DataView]",Fe="[object Float32Array]",ft="[object Float64Array]",ht="[object Int8Array]",hs="[object Int16Array]",Mn="[object Int32Array]",Hr="[object Uint8Array]",Yt="[object Uint8ClampedArray]",un="[object Uint16Array]",xn="[object Uint32Array]",Ze=/\b__p \+= '';/g,Rt=/\b(__p \+=) '' \+/g,Pt=/(__e\(.*?\)|\b__t\)) \+\n'';/g,Ut=/&(?:amp|lt|gt|quot|#39);/g,yt=/[&<>"']/g,dn=RegExp(Ut.source),Gt=RegExp(yt.source),Hn=/<%-([\s\S]+?)%>/g,In=/<%([\s\S]+?)%>/g,Tn=/<%=([\s\S]+?)%>/g,sr=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,Kr=/^\w*$/,ir=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,de=/[\\^$.*+?()[\]{}|]/g,ye=RegExp(de.source),Ce=/^\s+/,Me=/\s/,Ge=/\{(?:\n\/\* \[wrapped with .+\] \*\/)?\n?/,lt=/\{\n\/\* \[wrapped with (.+)\] \*/,Ct=/,? & /,st=/[^\x00-\x2f\x3a-\x40\x5b-\x60\x7b-\x7f]+/g,dt=/[()=,{}\[\]\/\s]/,ot=/\\(\\)?/g,gt=/\$\{([^\\}]*(?:\\.[^\\}]*)*)\}/g,Lt=/\w*$/,Jt=/^[-+]0x[0-9a-f]+$/i,ps=/^0b[01]+$/i,Wn=/^\[object .+?Constructor\]$/,pn=/^0o[0-7]+$/i,wr=/^(?:0|[1-9]\d*)$/,Lc=/[\xc0-\xd6\xd8-\xf6\xf8-\xff\u0100-\u017f]/g,oo=/($^)/,fa=/['\n\r\u2028\u2029\\]/g,As="\\ud800-\\udfff",$p="\\u0300-\\u036f",Bu="\\ufe20-\\ufe2f",Tl="\\u20d0-\\u20ff",jc=$p+Bu+Tl,$c="\\u2700-\\u27bf",en="a-z\\xdf-\\xf6\\xf8-\\xff",Sr="\\xac\\xb1\\xd7\\xf7",Fc="\\x00-\\x2f\\x3a-\\x40\\x5b-\\x60\\x7b-\\xbf",Uu="\\u2000-\\u206f",Wr=" \\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",nl="A-Z\\xc0-\\xd6\\xd8-\\xde",Kf="\\ufe0e\\ufe0f",Fp=Sr+Fc+Uu+Wr,zp="['’]",dM="["+As+"]",o_="["+Fp+"]",Vu="["+jc+"]",a_="\\d+",fM="["+$c+"]",l_="["+en+"]",c_="[^"+As+Fp+a_+$c+en+nl+"]",Bp="\\ud83c[\\udffb-\\udfff]",hM="(?:"+Vu+"|"+Bp+")",u_="[^"+As+"]",Up="(?:\\ud83c[\\udde6-\\uddff]){2}",Vp="[\\ud800-\\udbff][\\udc00-\\udfff]",ha="["+nl+"]",d_="\\u200d",f_="(?:"+l_+"|"+c_+")",pM="(?:"+ha+"|"+c_+")",h_="(?:"+zp+"(?:d|ll|m|re|s|t|ve))?",p_="(?:"+zp+"(?:D|LL|M|RE|S|T|VE))?",m_=hM+"?",g_="["+Kf+"]?",mM="(?:"+d_+"(?:"+[u_,Up,Vp].join("|")+")"+g_+m_+")*",gM="\\d*(?:1st|2nd|3rd|(?![123])\\dth)(?=\\b|[A-Z_])",vM="\\d*(?:1ST|2ND|3RD|(?![123])\\dTH)(?=\\b|[a-z_])",v_=g_+m_+mM,yM="(?:"+[fM,Up,Vp].join("|")+")"+v_,bM="(?:"+[u_+Vu+"?",Vu,Up,Vp,dM].join("|")+")",xM=RegExp(zp,"g"),_M=RegExp(Vu,"g"),Hp=RegExp(Bp+"(?="+Bp+")|"+bM+v_,"g"),wM=RegExp([ha+"?"+l_+"+"+h_+"(?="+[o_,ha,"$"].join("|")+")",pM+"+"+p_+"(?="+[o_,ha+f_,"$"].join("|")+")",ha+"?"+f_+"+"+h_,ha+"+"+p_,vM,gM,a_,yM].join("|"),"g"),SM=RegExp("["+d_+As+jc+Kf+"]"),CM=/[a-z][A-Z]|[A-Z]{2}[a-z]|[0-9][a-zA-Z]|[a-zA-Z][0-9]|[^a-zA-Z0-9 ]/,EM=["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"],AM=-1,Tt={};Tt[Fe]=Tt[ft]=Tt[ht]=Tt[hs]=Tt[Mn]=Tt[Hr]=Tt[Yt]=Tt[un]=Tt[xn]=!0,Tt[be]=Tt[xe]=Tt[pe]=Tt[Pe]=Tt[Se]=Tt[Oe]=Tt[ze]=Tt[$e]=Tt[Ue]=Tt[wt]=Tt[St]=Tt[hn]=Tt[It]=Tt[U]=Tt[_e]=!1;var Nt={};Nt[be]=Nt[xe]=Nt[pe]=Nt[Se]=Nt[Pe]=Nt[Oe]=Nt[Fe]=Nt[ft]=Nt[ht]=Nt[hs]=Nt[Mn]=Nt[Ue]=Nt[wt]=Nt[St]=Nt[hn]=Nt[It]=Nt[U]=Nt[ee]=Nt[Hr]=Nt[Yt]=Nt[un]=Nt[xn]=!0,Nt[ze]=Nt[$e]=Nt[_e]=!1;var RM={À:"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"},PM={"&":"&","<":"<",">":">",'"':""","'":"'"},NM={"&":"&","<":"<",">":">",""":'"',"'":"'"},TM={"\\":"\\","'":"'","\n":"n","\r":"r","\u2028":"u2028","\u2029":"u2029"},kM=parseFloat,DM=parseInt,y_=typeof xr=="object"&&xr&&xr.Object===Object&&xr,OM=typeof self=="object"&&self&&self.Object===Object&&self,mn=y_||OM||Function("return this")(),Wp=t&&!t.nodeType&&t,ao=Wp&&!0&&e&&!e.nodeType&&e,b_=ao&&ao.exports===Wp,qp=b_&&y_.process,Nr=function(){try{var X=ao&&ao.require&&ao.require("util").types;return X||qp&&qp.binding&&qp.binding("util")}catch{}}(),x_=Nr&&Nr.isArrayBuffer,__=Nr&&Nr.isDate,w_=Nr&&Nr.isMap,S_=Nr&&Nr.isRegExp,C_=Nr&&Nr.isSet,E_=Nr&&Nr.isTypedArray;function dr(X,oe,ne){switch(ne.length){case 0:return X.call(oe);case 1:return X.call(oe,ne[0]);case 2:return X.call(oe,ne[0],ne[1]);case 3:return X.call(oe,ne[0],ne[1],ne[2])}return X.apply(oe,ne)}function MM(X,oe,ne,Re){for(var We=-1,pt=X==null?0:X.length;++We<pt;){var Xt=X[We];oe(Re,Xt,ne(Xt),X)}return Re}function Tr(X,oe){for(var ne=-1,Re=X==null?0:X.length;++ne<Re&&oe(X[ne],ne,X)!==!1;);return X}function IM(X,oe){for(var ne=X==null?0:X.length;ne--&&oe(X[ne],ne,X)!==!1;);return X}function A_(X,oe){for(var ne=-1,Re=X==null?0:X.length;++ne<Re;)if(!oe(X[ne],ne,X))return!1;return!0}function hi(X,oe){for(var ne=-1,Re=X==null?0:X.length,We=0,pt=[];++ne<Re;){var Xt=X[ne];oe(Xt,ne,X)&&(pt[We++]=Xt)}return pt}function Hu(X,oe){var ne=X==null?0:X.length;return!!ne&&pa(X,oe,0)>-1}function Gp(X,oe,ne){for(var Re=-1,We=X==null?0:X.length;++Re<We;)if(ne(oe,X[Re]))return!0;return!1}function Ot(X,oe){for(var ne=-1,Re=X==null?0:X.length,We=Array(Re);++ne<Re;)We[ne]=oe(X[ne],ne,X);return We}function pi(X,oe){for(var ne=-1,Re=oe.length,We=X.length;++ne<Re;)X[We+ne]=oe[ne];return X}function Kp(X,oe,ne,Re){var We=-1,pt=X==null?0:X.length;for(Re&&pt&&(ne=X[++We]);++We<pt;)ne=oe(ne,X[We],We,X);return ne}function LM(X,oe,ne,Re){var We=X==null?0:X.length;for(Re&&We&&(ne=X[--We]);We--;)ne=oe(ne,X[We],We,X);return ne}function Yp(X,oe){for(var ne=-1,Re=X==null?0:X.length;++ne<Re;)if(oe(X[ne],ne,X))return!0;return!1}var jM=Xp("length");function $M(X){return X.split("")}function FM(X){return X.match(st)||[]}function R_(X,oe,ne){var Re;return ne(X,function(We,pt,Xt){if(oe(We,pt,Xt))return Re=pt,!1}),Re}function Wu(X,oe,ne,Re){for(var We=X.length,pt=ne+(Re?1:-1);Re?pt--:++pt<We;)if(oe(X[pt],pt,X))return pt;return-1}function pa(X,oe,ne){return oe===oe?QM(X,oe,ne):Wu(X,P_,ne)}function zM(X,oe,ne,Re){for(var We=ne-1,pt=X.length;++We<pt;)if(Re(X[We],oe))return We;return-1}function P_(X){return X!==X}function N_(X,oe){var ne=X==null?0:X.length;return ne?Zp(X,oe)/ne:he}function Xp(X){return function(oe){return oe==null?n:oe[X]}}function Qp(X){return function(oe){return X==null?n:X[oe]}}function T_(X,oe,ne,Re,We){return We(X,function(pt,Xt,Et){ne=Re?(Re=!1,pt):oe(ne,pt,Xt,Et)}),ne}function BM(X,oe){var ne=X.length;for(X.sort(oe);ne--;)X[ne]=X[ne].value;return X}function Zp(X,oe){for(var ne,Re=-1,We=X.length;++Re<We;){var pt=oe(X[Re]);pt!==n&&(ne=ne===n?pt:ne+pt)}return ne}function Jp(X,oe){for(var ne=-1,Re=Array(X);++ne<X;)Re[ne]=oe(ne);return Re}function UM(X,oe){return Ot(oe,function(ne){return[ne,X[ne]]})}function k_(X){return X&&X.slice(0,I_(X)+1).replace(Ce,"")}function fr(X){return function(oe){return X(oe)}}function em(X,oe){return Ot(oe,function(ne){return X[ne]})}function kl(X,oe){return X.has(oe)}function D_(X,oe){for(var ne=-1,Re=X.length;++ne<Re&&pa(oe,X[ne],0)>-1;);return ne}function O_(X,oe){for(var ne=X.length;ne--&&pa(oe,X[ne],0)>-1;);return ne}function VM(X,oe){for(var ne=X.length,Re=0;ne--;)X[ne]===oe&&++Re;return Re}var HM=Qp(RM),WM=Qp(PM);function qM(X){return"\\"+TM[X]}function GM(X,oe){return X==null?n:X[oe]}function ma(X){return SM.test(X)}function KM(X){return CM.test(X)}function YM(X){for(var oe,ne=[];!(oe=X.next()).done;)ne.push(oe.value);return ne}function tm(X){var oe=-1,ne=Array(X.size);return X.forEach(function(Re,We){ne[++oe]=[We,Re]}),ne}function M_(X,oe){return function(ne){return X(oe(ne))}}function mi(X,oe){for(var ne=-1,Re=X.length,We=0,pt=[];++ne<Re;){var Xt=X[ne];(Xt===oe||Xt===h)&&(X[ne]=h,pt[We++]=ne)}return pt}function qu(X){var oe=-1,ne=Array(X.size);return X.forEach(function(Re){ne[++oe]=Re}),ne}function XM(X){var oe=-1,ne=Array(X.size);return X.forEach(function(Re){ne[++oe]=[Re,Re]}),ne}function QM(X,oe,ne){for(var Re=ne-1,We=X.length;++Re<We;)if(X[Re]===oe)return Re;return-1}function ZM(X,oe,ne){for(var Re=ne+1;Re--;)if(X[Re]===oe)return Re;return Re}function ga(X){return ma(X)?eI(X):jM(X)}function Yr(X){return ma(X)?tI(X):$M(X)}function I_(X){for(var oe=X.length;oe--&&Me.test(X.charAt(oe)););return oe}var JM=Qp(NM);function eI(X){for(var oe=Hp.lastIndex=0;Hp.test(X);)++oe;return oe}function tI(X){return X.match(Hp)||[]}function nI(X){return X.match(wM)||[]}var rI=function X(oe){oe=oe==null?mn:va.defaults(mn.Object(),oe,va.pick(mn,EM));var ne=oe.Array,Re=oe.Date,We=oe.Error,pt=oe.Function,Xt=oe.Math,Et=oe.Object,nm=oe.RegExp,sI=oe.String,kr=oe.TypeError,Gu=ne.prototype,iI=pt.prototype,ya=Et.prototype,Ku=oe["__core-js_shared__"],Yu=iI.toString,bt=ya.hasOwnProperty,oI=0,L_=function(){var l=/[^.]+$/.exec(Ku&&Ku.keys&&Ku.keys.IE_PROTO||"");return l?"Symbol(src)_1."+l:""}(),Xu=ya.toString,aI=Yu.call(Et),lI=mn._,cI=nm("^"+Yu.call(bt).replace(de,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),Qu=b_?oe.Buffer:n,gi=oe.Symbol,Zu=oe.Uint8Array,j_=Qu?Qu.allocUnsafe:n,Ju=M_(Et.getPrototypeOf,Et),$_=Et.create,F_=ya.propertyIsEnumerable,ed=Gu.splice,z_=gi?gi.isConcatSpreadable:n,Dl=gi?gi.iterator:n,lo=gi?gi.toStringTag:n,td=function(){try{var l=po(Et,"defineProperty");return l({},"",{}),l}catch{}}(),uI=oe.clearTimeout!==mn.clearTimeout&&oe.clearTimeout,dI=Re&&Re.now!==mn.Date.now&&Re.now,fI=oe.setTimeout!==mn.setTimeout&&oe.setTimeout,nd=Xt.ceil,rd=Xt.floor,rm=Et.getOwnPropertySymbols,hI=Qu?Qu.isBuffer:n,B_=oe.isFinite,pI=Gu.join,mI=M_(Et.keys,Et),Qt=Xt.max,Sn=Xt.min,gI=Re.now,vI=oe.parseInt,U_=Xt.random,yI=Gu.reverse,sm=po(oe,"DataView"),Ol=po(oe,"Map"),im=po(oe,"Promise"),ba=po(oe,"Set"),Ml=po(oe,"WeakMap"),Il=po(Et,"create"),sd=Ml&&new Ml,xa={},bI=mo(sm),xI=mo(Ol),_I=mo(im),wI=mo(ba),SI=mo(Ml),id=gi?gi.prototype:n,Ll=id?id.valueOf:n,V_=id?id.toString:n;function L(l){if(Ft(l)&&!qe(l)&&!(l instanceof et)){if(l instanceof Dr)return l;if(bt.call(l,"__wrapped__"))return Hw(l)}return new Dr(l)}var _a=function(){function l(){}return function(p){if(!jt(p))return{};if($_)return $_(p);l.prototype=p;var S=new l;return l.prototype=n,S}}();function od(){}function Dr(l,p){this.__wrapped__=l,this.__actions__=[],this.__chain__=!!p,this.__index__=0,this.__values__=n}L.templateSettings={escape:Hn,evaluate:In,interpolate:Tn,variable:"",imports:{_:L}},L.prototype=od.prototype,L.prototype.constructor=L,Dr.prototype=_a(od.prototype),Dr.prototype.constructor=Dr;function et(l){this.__wrapped__=l,this.__actions__=[],this.__dir__=1,this.__filtered__=!1,this.__iteratees__=[],this.__takeCount__=re,this.__views__=[]}function CI(){var l=new et(this.__wrapped__);return l.__actions__=Gn(this.__actions__),l.__dir__=this.__dir__,l.__filtered__=this.__filtered__,l.__iteratees__=Gn(this.__iteratees__),l.__takeCount__=this.__takeCount__,l.__views__=Gn(this.__views__),l}function EI(){if(this.__filtered__){var l=new et(this);l.__dir__=-1,l.__filtered__=!0}else l=this.clone(),l.__dir__*=-1;return l}function AI(){var l=this.__wrapped__.value(),p=this.__dir__,S=qe(l),k=p<0,M=S?l.length:0,j=$L(0,M,this.__views__),z=j.start,q=j.end,Q=q-z,le=k?q:z-1,ce=this.__iteratees__,me=ce.length,Ee=0,De=Sn(Q,this.__takeCount__);if(!S||!k&&M==Q&&De==Q)return hw(l,this.__actions__);var Le=[];e:for(;Q--&&Ee<De;){le+=p;for(var Xe=-1,je=l[le];++Xe<me;){var Je=ce[Xe],rt=Je.iteratee,mr=Je.type,$n=rt(je);if(mr==W)je=$n;else if(!$n){if(mr==B)continue e;break e}}Le[Ee++]=je}return Le}et.prototype=_a(od.prototype),et.prototype.constructor=et;function co(l){var p=-1,S=l==null?0:l.length;for(this.clear();++p<S;){var k=l[p];this.set(k[0],k[1])}}function RI(){this.__data__=Il?Il(null):{},this.size=0}function PI(l){var p=this.has(l)&&delete this.__data__[l];return this.size-=p?1:0,p}function NI(l){var p=this.__data__;if(Il){var S=p[l];return S===c?n:S}return bt.call(p,l)?p[l]:n}function TI(l){var p=this.__data__;return Il?p[l]!==n:bt.call(p,l)}function kI(l,p){var S=this.__data__;return this.size+=this.has(l)?0:1,S[l]=Il&&p===n?c:p,this}co.prototype.clear=RI,co.prototype.delete=PI,co.prototype.get=NI,co.prototype.has=TI,co.prototype.set=kI;function Ms(l){var p=-1,S=l==null?0:l.length;for(this.clear();++p<S;){var k=l[p];this.set(k[0],k[1])}}function DI(){this.__data__=[],this.size=0}function OI(l){var p=this.__data__,S=ad(p,l);if(S<0)return!1;var k=p.length-1;return S==k?p.pop():ed.call(p,S,1),--this.size,!0}function MI(l){var p=this.__data__,S=ad(p,l);return S<0?n:p[S][1]}function II(l){return ad(this.__data__,l)>-1}function LI(l,p){var S=this.__data__,k=ad(S,l);return k<0?(++this.size,S.push([l,p])):S[k][1]=p,this}Ms.prototype.clear=DI,Ms.prototype.delete=OI,Ms.prototype.get=MI,Ms.prototype.has=II,Ms.prototype.set=LI;function Is(l){var p=-1,S=l==null?0:l.length;for(this.clear();++p<S;){var k=l[p];this.set(k[0],k[1])}}function jI(){this.size=0,this.__data__={hash:new co,map:new(Ol||Ms),string:new co}}function $I(l){var p=bd(this,l).delete(l);return this.size-=p?1:0,p}function FI(l){return bd(this,l).get(l)}function zI(l){return bd(this,l).has(l)}function BI(l,p){var S=bd(this,l),k=S.size;return S.set(l,p),this.size+=S.size==k?0:1,this}Is.prototype.clear=jI,Is.prototype.delete=$I,Is.prototype.get=FI,Is.prototype.has=zI,Is.prototype.set=BI;function uo(l){var p=-1,S=l==null?0:l.length;for(this.__data__=new Is;++p<S;)this.add(l[p])}function UI(l){return this.__data__.set(l,c),this}function VI(l){return this.__data__.has(l)}uo.prototype.add=uo.prototype.push=UI,uo.prototype.has=VI;function Xr(l){var p=this.__data__=new Ms(l);this.size=p.size}function HI(){this.__data__=new Ms,this.size=0}function WI(l){var p=this.__data__,S=p.delete(l);return this.size=p.size,S}function qI(l){return this.__data__.get(l)}function GI(l){return this.__data__.has(l)}function KI(l,p){var S=this.__data__;if(S instanceof Ms){var k=S.__data__;if(!Ol||k.length<s-1)return k.push([l,p]),this.size=++S.size,this;S=this.__data__=new Is(k)}return S.set(l,p),this.size=S.size,this}Xr.prototype.clear=HI,Xr.prototype.delete=WI,Xr.prototype.get=qI,Xr.prototype.has=GI,Xr.prototype.set=KI;function H_(l,p){var S=qe(l),k=!S&&go(l),M=!S&&!k&&_i(l),j=!S&&!k&&!M&&Ea(l),z=S||k||M||j,q=z?Jp(l.length,sI):[],Q=q.length;for(var le in l)(p||bt.call(l,le))&&!(z&&(le=="length"||M&&(le=="offset"||le=="parent")||j&&(le=="buffer"||le=="byteLength"||le=="byteOffset")||Fs(le,Q)))&&q.push(le);return q}function W_(l){var p=l.length;return p?l[gm(0,p-1)]:n}function YI(l,p){return xd(Gn(l),fo(p,0,l.length))}function XI(l){return xd(Gn(l))}function om(l,p,S){(S!==n&&!Qr(l[p],S)||S===n&&!(p in l))&&Ls(l,p,S)}function jl(l,p,S){var k=l[p];(!(bt.call(l,p)&&Qr(k,S))||S===n&&!(p in l))&&Ls(l,p,S)}function ad(l,p){for(var S=l.length;S--;)if(Qr(l[S][0],p))return S;return-1}function QI(l,p,S,k){return vi(l,function(M,j,z){p(k,M,S(M),z)}),k}function q_(l,p){return l&&gs(p,rn(p),l)}function ZI(l,p){return l&&gs(p,Yn(p),l)}function Ls(l,p,S){p=="__proto__"&&td?td(l,p,{configurable:!0,enumerable:!0,value:S,writable:!0}):l[p]=S}function am(l,p){for(var S=-1,k=p.length,M=ne(k),j=l==null;++S<k;)M[S]=j?n:Bm(l,p[S]);return M}function fo(l,p,S){return l===l&&(S!==n&&(l=l<=S?l:S),p!==n&&(l=l>=p?l:p)),l}function Or(l,p,S,k,M,j){var z,q=p&u,Q=p&f,le=p&g;if(S&&(z=M?S(l,k,M,j):S(l)),z!==n)return z;if(!jt(l))return l;var ce=qe(l);if(ce){if(z=zL(l),!q)return Gn(l,z)}else{var me=Cn(l),Ee=me==$e||me==Te;if(_i(l))return gw(l,q);if(me==St||me==be||Ee&&!M){if(z=Q||Ee?{}:Iw(l),!q)return Q?NL(l,ZI(z,l)):PL(l,q_(z,l))}else{if(!Nt[me])return M?l:{};z=BL(l,me,q)}}j||(j=new Xr);var De=j.get(l);if(De)return De;j.set(l,z),uS(l)?l.forEach(function(je){z.add(Or(je,p,S,je,l,j))}):lS(l)&&l.forEach(function(je,Je){z.set(Je,Or(je,p,S,Je,l,j))});var Le=le?Q?Rm:Am:Q?Yn:rn,Xe=ce?n:Le(l);return Tr(Xe||l,function(je,Je){Xe&&(Je=je,je=l[Je]),jl(z,Je,Or(je,p,S,Je,l,j))}),z}function JI(l){var p=rn(l);return function(S){return G_(S,l,p)}}function G_(l,p,S){var k=S.length;if(l==null)return!k;for(l=Et(l);k--;){var M=S[k],j=p[M],z=l[M];if(z===n&&!(M in l)||!j(z))return!1}return!0}function K_(l,p,S){if(typeof l!="function")throw new kr(o);return Hl(function(){l.apply(n,S)},p)}function $l(l,p,S,k){var M=-1,j=Hu,z=!0,q=l.length,Q=[],le=p.length;if(!q)return Q;S&&(p=Ot(p,fr(S))),k?(j=Gp,z=!1):p.length>=s&&(j=kl,z=!1,p=new uo(p));e:for(;++M<q;){var ce=l[M],me=S==null?ce:S(ce);if(ce=k||ce!==0?ce:0,z&&me===me){for(var Ee=le;Ee--;)if(p[Ee]===me)continue e;Q.push(ce)}else j(p,me,k)||Q.push(ce)}return Q}var vi=_w(ms),Y_=_w(cm,!0);function eL(l,p){var S=!0;return vi(l,function(k,M,j){return S=!!p(k,M,j),S}),S}function ld(l,p,S){for(var k=-1,M=l.length;++k<M;){var j=l[k],z=p(j);if(z!=null&&(q===n?z===z&&!pr(z):S(z,q)))var q=z,Q=j}return Q}function tL(l,p,S,k){var M=l.length;for(S=Ke(S),S<0&&(S=-S>M?0:M+S),k=k===n||k>M?M:Ke(k),k<0&&(k+=M),k=S>k?0:fS(k);S<k;)l[S++]=p;return l}function X_(l,p){var S=[];return vi(l,function(k,M,j){p(k,M,j)&&S.push(k)}),S}function gn(l,p,S,k,M){var j=-1,z=l.length;for(S||(S=VL),M||(M=[]);++j<z;){var q=l[j];p>0&&S(q)?p>1?gn(q,p-1,S,k,M):pi(M,q):k||(M[M.length]=q)}return M}var lm=ww(),Q_=ww(!0);function ms(l,p){return l&&lm(l,p,rn)}function cm(l,p){return l&&Q_(l,p,rn)}function cd(l,p){return hi(p,function(S){return zs(l[S])})}function ho(l,p){p=bi(p,l);for(var S=0,k=p.length;l!=null&&S<k;)l=l[vs(p[S++])];return S&&S==k?l:n}function Z_(l,p,S){var k=p(l);return qe(l)?k:pi(k,S(l))}function Ln(l){return l==null?l===n?ie:ut:lo&&lo in Et(l)?jL(l):XL(l)}function um(l,p){return l>p}function nL(l,p){return l!=null&&bt.call(l,p)}function rL(l,p){return l!=null&&p in Et(l)}function sL(l,p,S){return l>=Sn(p,S)&&l<Qt(p,S)}function dm(l,p,S){for(var k=S?Gp:Hu,M=l[0].length,j=l.length,z=j,q=ne(j),Q=1/0,le=[];z--;){var ce=l[z];z&&p&&(ce=Ot(ce,fr(p))),Q=Sn(ce.length,Q),q[z]=!S&&(p||M>=120&&ce.length>=120)?new uo(z&&ce):n}ce=l[0];var me=-1,Ee=q[0];e:for(;++me<M&&le.length<Q;){var De=ce[me],Le=p?p(De):De;if(De=S||De!==0?De:0,!(Ee?kl(Ee,Le):k(le,Le,S))){for(z=j;--z;){var Xe=q[z];if(!(Xe?kl(Xe,Le):k(l[z],Le,S)))continue e}Ee&&Ee.push(Le),le.push(De)}}return le}function iL(l,p,S,k){return ms(l,function(M,j,z){p(k,S(M),j,z)}),k}function Fl(l,p,S){p=bi(p,l),l=Fw(l,p);var k=l==null?l:l[vs(Ir(p))];return k==null?n:dr(k,l,S)}function J_(l){return Ft(l)&&Ln(l)==be}function oL(l){return Ft(l)&&Ln(l)==pe}function aL(l){return Ft(l)&&Ln(l)==Oe}function zl(l,p,S,k,M){return l===p?!0:l==null||p==null||!Ft(l)&&!Ft(p)?l!==l&&p!==p:lL(l,p,S,k,zl,M)}function lL(l,p,S,k,M,j){var z=qe(l),q=qe(p),Q=z?xe:Cn(l),le=q?xe:Cn(p);Q=Q==be?St:Q,le=le==be?St:le;var ce=Q==St,me=le==St,Ee=Q==le;if(Ee&&_i(l)){if(!_i(p))return!1;z=!0,ce=!1}if(Ee&&!ce)return j||(j=new Xr),z||Ea(l)?Dw(l,p,S,k,M,j):IL(l,p,Q,S,k,M,j);if(!(S&v)){var De=ce&&bt.call(l,"__wrapped__"),Le=me&&bt.call(p,"__wrapped__");if(De||Le){var Xe=De?l.value():l,je=Le?p.value():p;return j||(j=new Xr),M(Xe,je,S,k,j)}}return Ee?(j||(j=new Xr),LL(l,p,S,k,M,j)):!1}function cL(l){return Ft(l)&&Cn(l)==Ue}function fm(l,p,S,k){var M=S.length,j=M,z=!k;if(l==null)return!j;for(l=Et(l);M--;){var q=S[M];if(z&&q[2]?q[1]!==l[q[0]]:!(q[0]in l))return!1}for(;++M<j;){q=S[M];var Q=q[0],le=l[Q],ce=q[1];if(z&&q[2]){if(le===n&&!(Q in l))return!1}else{var me=new Xr;if(k)var Ee=k(le,ce,Q,l,p,me);if(!(Ee===n?zl(ce,le,v|m,k,me):Ee))return!1}}return!0}function ew(l){if(!jt(l)||WL(l))return!1;var p=zs(l)?cI:Wn;return p.test(mo(l))}function uL(l){return Ft(l)&&Ln(l)==hn}function dL(l){return Ft(l)&&Cn(l)==It}function fL(l){return Ft(l)&&Ad(l.length)&&!!Tt[Ln(l)]}function tw(l){return typeof l=="function"?l:l==null?Xn:typeof l=="object"?qe(l)?sw(l[0],l[1]):rw(l):SS(l)}function hm(l){if(!Vl(l))return mI(l);var p=[];for(var S in Et(l))bt.call(l,S)&&S!="constructor"&&p.push(S);return p}function hL(l){if(!jt(l))return YL(l);var p=Vl(l),S=[];for(var k in l)k=="constructor"&&(p||!bt.call(l,k))||S.push(k);return S}function pm(l,p){return l<p}function nw(l,p){var S=-1,k=Kn(l)?ne(l.length):[];return vi(l,function(M,j,z){k[++S]=p(M,j,z)}),k}function rw(l){var p=Nm(l);return p.length==1&&p[0][2]?jw(p[0][0],p[0][1]):function(S){return S===l||fm(S,l,p)}}function sw(l,p){return km(l)&&Lw(p)?jw(vs(l),p):function(S){var k=Bm(S,l);return k===n&&k===p?Um(S,l):zl(p,k,v|m)}}function ud(l,p,S,k,M){l!==p&&lm(p,function(j,z){if(M||(M=new Xr),jt(j))pL(l,p,z,S,ud,k,M);else{var q=k?k(Om(l,z),j,z+"",l,p,M):n;q===n&&(q=j),om(l,z,q)}},Yn)}function pL(l,p,S,k,M,j,z){var q=Om(l,S),Q=Om(p,S),le=z.get(Q);if(le){om(l,S,le);return}var ce=j?j(q,Q,S+"",l,p,z):n,me=ce===n;if(me){var Ee=qe(Q),De=!Ee&&_i(Q),Le=!Ee&&!De&&Ea(Q);ce=Q,Ee||De||Le?qe(q)?ce=q:Vt(q)?ce=Gn(q):De?(me=!1,ce=gw(Q,!0)):Le?(me=!1,ce=vw(Q,!0)):ce=[]:Wl(Q)||go(Q)?(ce=q,go(q)?ce=hS(q):(!jt(q)||zs(q))&&(ce=Iw(Q))):me=!1}me&&(z.set(Q,ce),M(ce,Q,k,j,z),z.delete(Q)),om(l,S,ce)}function iw(l,p){var S=l.length;if(S)return p+=p<0?S:0,Fs(p,S)?l[p]:n}function ow(l,p,S){p.length?p=Ot(p,function(j){return qe(j)?function(z){return ho(z,j.length===1?j[0]:j)}:j}):p=[Xn];var k=-1;p=Ot(p,fr(Ie()));var M=nw(l,function(j,z,q){var Q=Ot(p,function(le){return le(j)});return{criteria:Q,index:++k,value:j}});return BM(M,function(j,z){return RL(j,z,S)})}function mL(l,p){return aw(l,p,function(S,k){return Um(l,k)})}function aw(l,p,S){for(var k=-1,M=p.length,j={};++k<M;){var z=p[k],q=ho(l,z);S(q,z)&&Bl(j,bi(z,l),q)}return j}function gL(l){return function(p){return ho(p,l)}}function mm(l,p,S,k){var M=k?zM:pa,j=-1,z=p.length,q=l;for(l===p&&(p=Gn(p)),S&&(q=Ot(l,fr(S)));++j<z;)for(var Q=0,le=p[j],ce=S?S(le):le;(Q=M(q,ce,Q,k))>-1;)q!==l&&ed.call(q,Q,1),ed.call(l,Q,1);return l}function lw(l,p){for(var S=l?p.length:0,k=S-1;S--;){var M=p[S];if(S==k||M!==j){var j=M;Fs(M)?ed.call(l,M,1):bm(l,M)}}return l}function gm(l,p){return l+rd(U_()*(p-l+1))}function vL(l,p,S,k){for(var M=-1,j=Qt(nd((p-l)/(S||1)),0),z=ne(j);j--;)z[k?j:++M]=l,l+=S;return z}function vm(l,p){var S="";if(!l||p<1||p>H)return S;do p%2&&(S+=l),p=rd(p/2),p&&(l+=l);while(p);return S}function Qe(l,p){return Mm($w(l,p,Xn),l+"")}function yL(l){return W_(Aa(l))}function bL(l,p){var S=Aa(l);return xd(S,fo(p,0,S.length))}function Bl(l,p,S,k){if(!jt(l))return l;p=bi(p,l);for(var M=-1,j=p.length,z=j-1,q=l;q!=null&&++M<j;){var Q=vs(p[M]),le=S;if(Q==="__proto__"||Q==="constructor"||Q==="prototype")return l;if(M!=z){var ce=q[Q];le=k?k(ce,Q,q):n,le===n&&(le=jt(ce)?ce:Fs(p[M+1])?[]:{})}jl(q,Q,le),q=q[Q]}return l}var cw=sd?function(l,p){return sd.set(l,p),l}:Xn,xL=td?function(l,p){return td(l,"toString",{configurable:!0,enumerable:!1,value:Hm(p),writable:!0})}:Xn;function _L(l){return xd(Aa(l))}function Mr(l,p,S){var k=-1,M=l.length;p<0&&(p=-p>M?0:M+p),S=S>M?M:S,S<0&&(S+=M),M=p>S?0:S-p>>>0,p>>>=0;for(var j=ne(M);++k<M;)j[k]=l[k+p];return j}function wL(l,p){var S;return vi(l,function(k,M,j){return S=p(k,M,j),!S}),!!S}function dd(l,p,S){var k=0,M=l==null?k:l.length;if(typeof p=="number"&&p===p&&M<=te){for(;k<M;){var j=k+M>>>1,z=l[j];z!==null&&!pr(z)&&(S?z<=p:z<p)?k=j+1:M=j}return M}return ym(l,p,Xn,S)}function ym(l,p,S,k){var M=0,j=l==null?0:l.length;if(j===0)return 0;p=S(p);for(var z=p!==p,q=p===null,Q=pr(p),le=p===n;M<j;){var ce=rd((M+j)/2),me=S(l[ce]),Ee=me!==n,De=me===null,Le=me===me,Xe=pr(me);if(z)var je=k||Le;else le?je=Le&&(k||Ee):q?je=Le&&Ee&&(k||!De):Q?je=Le&&Ee&&!De&&(k||!Xe):De||Xe?je=!1:je=k?me<=p:me<p;je?M=ce+1:j=ce}return Sn(j,J)}function uw(l,p){for(var S=-1,k=l.length,M=0,j=[];++S<k;){var z=l[S],q=p?p(z):z;if(!S||!Qr(q,Q)){var Q=q;j[M++]=z===0?0:z}}return j}function dw(l){return typeof l=="number"?l:pr(l)?he:+l}function hr(l){if(typeof l=="string")return l;if(qe(l))return Ot(l,hr)+"";if(pr(l))return V_?V_.call(l):"";var p=l+"";return p=="0"&&1/l==-1/0?"-0":p}function yi(l,p,S){var k=-1,M=Hu,j=l.length,z=!0,q=[],Q=q;if(S)z=!1,M=Gp;else if(j>=s){var le=p?null:OL(l);if(le)return qu(le);z=!1,M=kl,Q=new uo}else Q=p?[]:q;e:for(;++k<j;){var ce=l[k],me=p?p(ce):ce;if(ce=S||ce!==0?ce:0,z&&me===me){for(var Ee=Q.length;Ee--;)if(Q[Ee]===me)continue e;p&&Q.push(me),q.push(ce)}else M(Q,me,S)||(Q!==q&&Q.push(me),q.push(ce))}return q}function bm(l,p){return p=bi(p,l),l=Fw(l,p),l==null||delete l[vs(Ir(p))]}function fw(l,p,S,k){return Bl(l,p,S(ho(l,p)),k)}function fd(l,p,S,k){for(var M=l.length,j=k?M:-1;(k?j--:++j<M)&&p(l[j],j,l););return S?Mr(l,k?0:j,k?j+1:M):Mr(l,k?j+1:0,k?M:j)}function hw(l,p){var S=l;return S instanceof et&&(S=S.value()),Kp(p,function(k,M){return M.func.apply(M.thisArg,pi([k],M.args))},S)}function xm(l,p,S){var k=l.length;if(k<2)return k?yi(l[0]):[];for(var M=-1,j=ne(k);++M<k;)for(var z=l[M],q=-1;++q<k;)q!=M&&(j[M]=$l(j[M]||z,l[q],p,S));return yi(gn(j,1),p,S)}function pw(l,p,S){for(var k=-1,M=l.length,j=p.length,z={};++k<M;){var q=k<j?p[k]:n;S(z,l[k],q)}return z}function _m(l){return Vt(l)?l:[]}function wm(l){return typeof l=="function"?l:Xn}function bi(l,p){return qe(l)?l:km(l,p)?[l]:Vw(vt(l))}var SL=Qe;function xi(l,p,S){var k=l.length;return S=S===n?k:S,!p&&S>=k?l:Mr(l,p,S)}var mw=uI||function(l){return mn.clearTimeout(l)};function gw(l,p){if(p)return l.slice();var S=l.length,k=j_?j_(S):new l.constructor(S);return l.copy(k),k}function Sm(l){var p=new l.constructor(l.byteLength);return new Zu(p).set(new Zu(l)),p}function CL(l,p){var S=p?Sm(l.buffer):l.buffer;return new l.constructor(S,l.byteOffset,l.byteLength)}function EL(l){var p=new l.constructor(l.source,Lt.exec(l));return p.lastIndex=l.lastIndex,p}function AL(l){return Ll?Et(Ll.call(l)):{}}function vw(l,p){var S=p?Sm(l.buffer):l.buffer;return new l.constructor(S,l.byteOffset,l.length)}function yw(l,p){if(l!==p){var S=l!==n,k=l===null,M=l===l,j=pr(l),z=p!==n,q=p===null,Q=p===p,le=pr(p);if(!q&&!le&&!j&&l>p||j&&z&&Q&&!q&&!le||k&&z&&Q||!S&&Q||!M)return 1;if(!k&&!j&&!le&&l<p||le&&S&&M&&!k&&!j||q&&S&&M||!z&&M||!Q)return-1}return 0}function RL(l,p,S){for(var k=-1,M=l.criteria,j=p.criteria,z=M.length,q=S.length;++k<z;){var Q=yw(M[k],j[k]);if(Q){if(k>=q)return Q;var le=S[k];return Q*(le=="desc"?-1:1)}}return l.index-p.index}function bw(l,p,S,k){for(var M=-1,j=l.length,z=S.length,q=-1,Q=p.length,le=Qt(j-z,0),ce=ne(Q+le),me=!k;++q<Q;)ce[q]=p[q];for(;++M<z;)(me||M<j)&&(ce[S[M]]=l[M]);for(;le--;)ce[q++]=l[M++];return ce}function xw(l,p,S,k){for(var M=-1,j=l.length,z=-1,q=S.length,Q=-1,le=p.length,ce=Qt(j-q,0),me=ne(ce+le),Ee=!k;++M<ce;)me[M]=l[M];for(var De=M;++Q<le;)me[De+Q]=p[Q];for(;++z<q;)(Ee||M<j)&&(me[De+S[z]]=l[M++]);return me}function Gn(l,p){var S=-1,k=l.length;for(p||(p=ne(k));++S<k;)p[S]=l[S];return p}function gs(l,p,S,k){var M=!S;S||(S={});for(var j=-1,z=p.length;++j<z;){var q=p[j],Q=k?k(S[q],l[q],q,S,l):n;Q===n&&(Q=l[q]),M?Ls(S,q,Q):jl(S,q,Q)}return S}function PL(l,p){return gs(l,Tm(l),p)}function NL(l,p){return gs(l,Ow(l),p)}function hd(l,p){return function(S,k){var M=qe(S)?MM:QI,j=p?p():{};return M(S,l,Ie(k,2),j)}}function wa(l){return Qe(function(p,S){var k=-1,M=S.length,j=M>1?S[M-1]:n,z=M>2?S[2]:n;for(j=l.length>3&&typeof j=="function"?(M--,j):n,z&&jn(S[0],S[1],z)&&(j=M<3?n:j,M=1),p=Et(p);++k<M;){var q=S[k];q&&l(p,q,k,j)}return p})}function _w(l,p){return function(S,k){if(S==null)return S;if(!Kn(S))return l(S,k);for(var M=S.length,j=p?M:-1,z=Et(S);(p?j--:++j<M)&&k(z[j],j,z)!==!1;);return S}}function ww(l){return function(p,S,k){for(var M=-1,j=Et(p),z=k(p),q=z.length;q--;){var Q=z[l?q:++M];if(S(j[Q],Q,j)===!1)break}return p}}function TL(l,p,S){var k=p&x,M=Ul(l);function j(){var z=this&&this!==mn&&this instanceof j?M:l;return z.apply(k?S:this,arguments)}return j}function Sw(l){return function(p){p=vt(p);var S=ma(p)?Yr(p):n,k=S?S[0]:p.charAt(0),M=S?xi(S,1).join(""):p.slice(1);return k[l]()+M}}function Sa(l){return function(p){return Kp(_S(xS(p).replace(xM,"")),l,"")}}function Ul(l){return function(){var p=arguments;switch(p.length){case 0:return new l;case 1:return new l(p[0]);case 2:return new l(p[0],p[1]);case 3:return new l(p[0],p[1],p[2]);case 4:return new l(p[0],p[1],p[2],p[3]);case 5:return new l(p[0],p[1],p[2],p[3],p[4]);case 6:return new l(p[0],p[1],p[2],p[3],p[4],p[5]);case 7:return new l(p[0],p[1],p[2],p[3],p[4],p[5],p[6])}var S=_a(l.prototype),k=l.apply(S,p);return jt(k)?k:S}}function kL(l,p,S){var k=Ul(l);function M(){for(var j=arguments.length,z=ne(j),q=j,Q=Ca(M);q--;)z[q]=arguments[q];var le=j<3&&z[0]!==Q&&z[j-1]!==Q?[]:mi(z,Q);if(j-=le.length,j<S)return Pw(l,p,pd,M.placeholder,n,z,le,n,n,S-j);var ce=this&&this!==mn&&this instanceof M?k:l;return dr(ce,this,z)}return M}function Cw(l){return function(p,S,k){var M=Et(p);if(!Kn(p)){var j=Ie(S,3);p=rn(p),S=function(q){return j(M[q],q,M)}}var z=l(p,S,k);return z>-1?M[j?p[z]:z]:n}}function Ew(l){return $s(function(p){var S=p.length,k=S,M=Dr.prototype.thru;for(l&&p.reverse();k--;){var j=p[k];if(typeof j!="function")throw new kr(o);if(M&&!z&&yd(j)=="wrapper")var z=new Dr([],!0)}for(k=z?k:S;++k<S;){j=p[k];var q=yd(j),Q=q=="wrapper"?Pm(j):n;Q&&Dm(Q[0])&&Q[1]==(N|w|R|A)&&!Q[4].length&&Q[9]==1?z=z[yd(Q[0])].apply(z,Q[3]):z=j.length==1&&Dm(j)?z[q]():z.thru(j)}return function(){var le=arguments,ce=le[0];if(z&&le.length==1&&qe(ce))return z.plant(ce).value();for(var me=0,Ee=S?p[me].apply(this,le):ce;++me<S;)Ee=p[me].call(this,Ee);return Ee}})}function pd(l,p,S,k,M,j,z,q,Q,le){var ce=p&N,me=p&x,Ee=p&y,De=p&(w|E),Le=p&D,Xe=Ee?n:Ul(l);function je(){for(var Je=arguments.length,rt=ne(Je),mr=Je;mr--;)rt[mr]=arguments[mr];if(De)var $n=Ca(je),gr=VM(rt,$n);if(k&&(rt=bw(rt,k,M,De)),j&&(rt=xw(rt,j,z,De)),Je-=gr,De&&Je<le){var Ht=mi(rt,$n);return Pw(l,p,pd,je.placeholder,S,rt,Ht,q,Q,le-Je)}var Zr=me?S:this,Us=Ee?Zr[l]:l;return Je=rt.length,q?rt=QL(rt,q):Le&&Je>1&&rt.reverse(),ce&&Q<Je&&(rt.length=Q),this&&this!==mn&&this instanceof je&&(Us=Xe||Ul(Us)),Us.apply(Zr,rt)}return je}function Aw(l,p){return function(S,k){return iL(S,l,p(k),{})}}function md(l,p){return function(S,k){var M;if(S===n&&k===n)return p;if(S!==n&&(M=S),k!==n){if(M===n)return k;typeof S=="string"||typeof k=="string"?(S=hr(S),k=hr(k)):(S=dw(S),k=dw(k)),M=l(S,k)}return M}}function Cm(l){return $s(function(p){return p=Ot(p,fr(Ie())),Qe(function(S){var k=this;return l(p,function(M){return dr(M,k,S)})})})}function gd(l,p){p=p===n?" ":hr(p);var S=p.length;if(S<2)return S?vm(p,l):p;var k=vm(p,nd(l/ga(p)));return ma(p)?xi(Yr(k),0,l).join(""):k.slice(0,l)}function DL(l,p,S,k){var M=p&x,j=Ul(l);function z(){for(var q=-1,Q=arguments.length,le=-1,ce=k.length,me=ne(ce+Q),Ee=this&&this!==mn&&this instanceof z?j:l;++le<ce;)me[le]=k[le];for(;Q--;)me[le++]=arguments[++q];return dr(Ee,M?S:this,me)}return z}function Rw(l){return function(p,S,k){return k&&typeof k!="number"&&jn(p,S,k)&&(S=k=n),p=Bs(p),S===n?(S=p,p=0):S=Bs(S),k=k===n?p<S?1:-1:Bs(k),vL(p,S,k,l)}}function vd(l){return function(p,S){return typeof p=="string"&&typeof S=="string"||(p=Lr(p),S=Lr(S)),l(p,S)}}function Pw(l,p,S,k,M,j,z,q,Q,le){var ce=p&w,me=ce?z:n,Ee=ce?n:z,De=ce?j:n,Le=ce?n:j;p|=ce?R:T,p&=~(ce?T:R),p&b||(p&=-4);var Xe=[l,p,M,De,me,Le,Ee,q,Q,le],je=S.apply(n,Xe);return Dm(l)&&zw(je,Xe),je.placeholder=k,Bw(je,l,p)}function Em(l){var p=Xt[l];return function(S,k){if(S=Lr(S),k=k==null?0:Sn(Ke(k),292),k&&B_(S)){var M=(vt(S)+"e").split("e"),j=p(M[0]+"e"+(+M[1]+k));return M=(vt(j)+"e").split("e"),+(M[0]+"e"+(+M[1]-k))}return p(S)}}var OL=ba&&1/qu(new ba([,-0]))[1]==Y?function(l){return new ba(l)}:Gm;function Nw(l){return function(p){var S=Cn(p);return S==Ue?tm(p):S==It?XM(p):UM(p,l(p))}}function js(l,p,S,k,M,j,z,q){var Q=p&y;if(!Q&&typeof l!="function")throw new kr(o);var le=k?k.length:0;if(le||(p&=-97,k=M=n),z=z===n?z:Qt(Ke(z),0),q=q===n?q:Ke(q),le-=M?M.length:0,p&T){var ce=k,me=M;k=M=n}var Ee=Q?n:Pm(l),De=[l,p,S,k,M,ce,me,j,z,q];if(Ee&&KL(De,Ee),l=De[0],p=De[1],S=De[2],k=De[3],M=De[4],q=De[9]=De[9]===n?Q?0:l.length:Qt(De[9]-le,0),!q&&p&(w|E)&&(p&=-25),!p||p==x)var Le=TL(l,p,S);else p==w||p==E?Le=kL(l,p,q):(p==R||p==(x|R))&&!M.length?Le=DL(l,p,S,k):Le=pd.apply(n,De);var Xe=Ee?cw:zw;return Bw(Xe(Le,De),l,p)}function Tw(l,p,S,k){return l===n||Qr(l,ya[S])&&!bt.call(k,S)?p:l}function kw(l,p,S,k,M,j){return jt(l)&&jt(p)&&(j.set(p,l),ud(l,p,n,kw,j),j.delete(p)),l}function ML(l){return Wl(l)?n:l}function Dw(l,p,S,k,M,j){var z=S&v,q=l.length,Q=p.length;if(q!=Q&&!(z&&Q>q))return!1;var le=j.get(l),ce=j.get(p);if(le&&ce)return le==p&&ce==l;var me=-1,Ee=!0,De=S&m?new uo:n;for(j.set(l,p),j.set(p,l);++me<q;){var Le=l[me],Xe=p[me];if(k)var je=z?k(Xe,Le,me,p,l,j):k(Le,Xe,me,l,p,j);if(je!==n){if(je)continue;Ee=!1;break}if(De){if(!Yp(p,function(Je,rt){if(!kl(De,rt)&&(Le===Je||M(Le,Je,S,k,j)))return De.push(rt)})){Ee=!1;break}}else if(!(Le===Xe||M(Le,Xe,S,k,j))){Ee=!1;break}}return j.delete(l),j.delete(p),Ee}function IL(l,p,S,k,M,j,z){switch(S){case Se:if(l.byteLength!=p.byteLength||l.byteOffset!=p.byteOffset)return!1;l=l.buffer,p=p.buffer;case pe:return!(l.byteLength!=p.byteLength||!j(new Zu(l),new Zu(p)));case Pe:case Oe:case wt:return Qr(+l,+p);case ze:return l.name==p.name&&l.message==p.message;case hn:case U:return l==p+"";case Ue:var q=tm;case It:var Q=k&v;if(q||(q=qu),l.size!=p.size&&!Q)return!1;var le=z.get(l);if(le)return le==p;k|=m,z.set(l,p);var ce=Dw(q(l),q(p),k,M,j,z);return z.delete(l),ce;case ee:if(Ll)return Ll.call(l)==Ll.call(p)}return!1}function LL(l,p,S,k,M,j){var z=S&v,q=Am(l),Q=q.length,le=Am(p),ce=le.length;if(Q!=ce&&!z)return!1;for(var me=Q;me--;){var Ee=q[me];if(!(z?Ee in p:bt.call(p,Ee)))return!1}var De=j.get(l),Le=j.get(p);if(De&&Le)return De==p&&Le==l;var Xe=!0;j.set(l,p),j.set(p,l);for(var je=z;++me<Q;){Ee=q[me];var Je=l[Ee],rt=p[Ee];if(k)var mr=z?k(rt,Je,Ee,p,l,j):k(Je,rt,Ee,l,p,j);if(!(mr===n?Je===rt||M(Je,rt,S,k,j):mr)){Xe=!1;break}je||(je=Ee=="constructor")}if(Xe&&!je){var $n=l.constructor,gr=p.constructor;$n!=gr&&"constructor"in l&&"constructor"in p&&!(typeof $n=="function"&&$n instanceof $n&&typeof gr=="function"&&gr instanceof gr)&&(Xe=!1)}return j.delete(l),j.delete(p),Xe}function $s(l){return Mm($w(l,n,Gw),l+"")}function Am(l){return Z_(l,rn,Tm)}function Rm(l){return Z_(l,Yn,Ow)}var Pm=sd?function(l){return sd.get(l)}:Gm;function yd(l){for(var p=l.name+"",S=xa[p],k=bt.call(xa,p)?S.length:0;k--;){var M=S[k],j=M.func;if(j==null||j==l)return M.name}return p}function Ca(l){var p=bt.call(L,"placeholder")?L:l;return p.placeholder}function Ie(){var l=L.iteratee||Wm;return l=l===Wm?tw:l,arguments.length?l(arguments[0],arguments[1]):l}function bd(l,p){var S=l.__data__;return HL(p)?S[typeof p=="string"?"string":"hash"]:S.map}function Nm(l){for(var p=rn(l),S=p.length;S--;){var k=p[S],M=l[k];p[S]=[k,M,Lw(M)]}return p}function po(l,p){var S=GM(l,p);return ew(S)?S:n}function jL(l){var p=bt.call(l,lo),S=l[lo];try{l[lo]=n;var k=!0}catch{}var M=Xu.call(l);return k&&(p?l[lo]=S:delete l[lo]),M}var Tm=rm?function(l){return l==null?[]:(l=Et(l),hi(rm(l),function(p){return F_.call(l,p)}))}:Km,Ow=rm?function(l){for(var p=[];l;)pi(p,Tm(l)),l=Ju(l);return p}:Km,Cn=Ln;(sm&&Cn(new sm(new ArrayBuffer(1)))!=Se||Ol&&Cn(new Ol)!=Ue||im&&Cn(im.resolve())!=Nn||ba&&Cn(new ba)!=It||Ml&&Cn(new Ml)!=_e)&&(Cn=function(l){var p=Ln(l),S=p==St?l.constructor:n,k=S?mo(S):"";if(k)switch(k){case bI:return Se;case xI:return Ue;case _I:return Nn;case wI:return It;case SI:return _e}return p});function $L(l,p,S){for(var k=-1,M=S.length;++k<M;){var j=S[k],z=j.size;switch(j.type){case"drop":l+=z;break;case"dropRight":p-=z;break;case"take":p=Sn(p,l+z);break;case"takeRight":l=Qt(l,p-z);break}}return{start:l,end:p}}function FL(l){var p=l.match(lt);return p?p[1].split(Ct):[]}function Mw(l,p,S){p=bi(p,l);for(var k=-1,M=p.length,j=!1;++k<M;){var z=vs(p[k]);if(!(j=l!=null&&S(l,z)))break;l=l[z]}return j||++k!=M?j:(M=l==null?0:l.length,!!M&&Ad(M)&&Fs(z,M)&&(qe(l)||go(l)))}function zL(l){var p=l.length,S=new l.constructor(p);return p&&typeof l[0]=="string"&&bt.call(l,"index")&&(S.index=l.index,S.input=l.input),S}function Iw(l){return typeof l.constructor=="function"&&!Vl(l)?_a(Ju(l)):{}}function BL(l,p,S){var k=l.constructor;switch(p){case pe:return Sm(l);case Pe:case Oe:return new k(+l);case Se:return CL(l,S);case Fe:case ft:case ht:case hs:case Mn:case Hr:case Yt:case un:case xn:return vw(l,S);case Ue:return new k;case wt:case U:return new k(l);case hn:return EL(l);case It:return new k;case ee:return AL(l)}}function UL(l,p){var S=p.length;if(!S)return l;var k=S-1;return p[k]=(S>1?"& ":"")+p[k],p=p.join(S>2?", ":" "),l.replace(Ge,`{
|
||
/* [wrapped with `+p+`] */
|
||
`)}function VL(l){return qe(l)||go(l)||!!(z_&&l&&l[z_])}function Fs(l,p){var S=typeof l;return p=p??H,!!p&&(S=="number"||S!="symbol"&&wr.test(l))&&l>-1&&l%1==0&&l<p}function jn(l,p,S){if(!jt(S))return!1;var k=typeof p;return(k=="number"?Kn(S)&&Fs(p,S.length):k=="string"&&p in S)?Qr(S[p],l):!1}function km(l,p){if(qe(l))return!1;var S=typeof l;return S=="number"||S=="symbol"||S=="boolean"||l==null||pr(l)?!0:Kr.test(l)||!sr.test(l)||p!=null&&l in Et(p)}function HL(l){var p=typeof l;return p=="string"||p=="number"||p=="symbol"||p=="boolean"?l!=="__proto__":l===null}function Dm(l){var p=yd(l),S=L[p];if(typeof S!="function"||!(p in et.prototype))return!1;if(l===S)return!0;var k=Pm(S);return!!k&&l===k[0]}function WL(l){return!!L_&&L_ in l}var qL=Ku?zs:Ym;function Vl(l){var p=l&&l.constructor,S=typeof p=="function"&&p.prototype||ya;return l===S}function Lw(l){return l===l&&!jt(l)}function jw(l,p){return function(S){return S==null?!1:S[l]===p&&(p!==n||l in Et(S))}}function GL(l){var p=Cd(l,function(k){return S.size===d&&S.clear(),k}),S=p.cache;return p}function KL(l,p){var S=l[1],k=p[1],M=S|k,j=M<(x|y|N),z=k==N&&S==w||k==N&&S==A&&l[7].length<=p[8]||k==(N|A)&&p[7].length<=p[8]&&S==w;if(!(j||z))return l;k&x&&(l[2]=p[2],M|=S&x?0:b);var q=p[3];if(q){var Q=l[3];l[3]=Q?bw(Q,q,p[4]):q,l[4]=Q?mi(l[3],h):p[4]}return q=p[5],q&&(Q=l[5],l[5]=Q?xw(Q,q,p[6]):q,l[6]=Q?mi(l[5],h):p[6]),q=p[7],q&&(l[7]=q),k&N&&(l[8]=l[8]==null?p[8]:Sn(l[8],p[8])),l[9]==null&&(l[9]=p[9]),l[0]=p[0],l[1]=M,l}function YL(l){var p=[];if(l!=null)for(var S in Et(l))p.push(S);return p}function XL(l){return Xu.call(l)}function $w(l,p,S){return p=Qt(p===n?l.length-1:p,0),function(){for(var k=arguments,M=-1,j=Qt(k.length-p,0),z=ne(j);++M<j;)z[M]=k[p+M];M=-1;for(var q=ne(p+1);++M<p;)q[M]=k[M];return q[p]=S(z),dr(l,this,q)}}function Fw(l,p){return p.length<2?l:ho(l,Mr(p,0,-1))}function QL(l,p){for(var S=l.length,k=Sn(p.length,S),M=Gn(l);k--;){var j=p[k];l[k]=Fs(j,S)?M[j]:n}return l}function Om(l,p){if(!(p==="constructor"&&typeof l[p]=="function")&&p!="__proto__")return l[p]}var zw=Uw(cw),Hl=fI||function(l,p){return mn.setTimeout(l,p)},Mm=Uw(xL);function Bw(l,p,S){var k=p+"";return Mm(l,UL(k,ZL(FL(k),S)))}function Uw(l){var p=0,S=0;return function(){var k=gI(),M=F-(k-S);if(S=k,M>0){if(++p>=$)return arguments[0]}else p=0;return l.apply(n,arguments)}}function xd(l,p){var S=-1,k=l.length,M=k-1;for(p=p===n?k:p;++S<p;){var j=gm(S,M),z=l[j];l[j]=l[S],l[S]=z}return l.length=p,l}var Vw=GL(function(l){var p=[];return l.charCodeAt(0)===46&&p.push(""),l.replace(ir,function(S,k,M,j){p.push(M?j.replace(ot,"$1"):k||S)}),p});function vs(l){if(typeof l=="string"||pr(l))return l;var p=l+"";return p=="0"&&1/l==-1/0?"-0":p}function mo(l){if(l!=null){try{return Yu.call(l)}catch{}try{return l+""}catch{}}return""}function ZL(l,p){return Tr(ae,function(S){var k="_."+S[0];p&S[1]&&!Hu(l,k)&&l.push(k)}),l.sort()}function Hw(l){if(l instanceof et)return l.clone();var p=new Dr(l.__wrapped__,l.__chain__);return p.__actions__=Gn(l.__actions__),p.__index__=l.__index__,p.__values__=l.__values__,p}function JL(l,p,S){(S?jn(l,p,S):p===n)?p=1:p=Qt(Ke(p),0);var k=l==null?0:l.length;if(!k||p<1)return[];for(var M=0,j=0,z=ne(nd(k/p));M<k;)z[j++]=Mr(l,M,M+=p);return z}function ej(l){for(var p=-1,S=l==null?0:l.length,k=0,M=[];++p<S;){var j=l[p];j&&(M[k++]=j)}return M}function tj(){var l=arguments.length;if(!l)return[];for(var p=ne(l-1),S=arguments[0],k=l;k--;)p[k-1]=arguments[k];return pi(qe(S)?Gn(S):[S],gn(p,1))}var nj=Qe(function(l,p){return Vt(l)?$l(l,gn(p,1,Vt,!0)):[]}),rj=Qe(function(l,p){var S=Ir(p);return Vt(S)&&(S=n),Vt(l)?$l(l,gn(p,1,Vt,!0),Ie(S,2)):[]}),sj=Qe(function(l,p){var S=Ir(p);return Vt(S)&&(S=n),Vt(l)?$l(l,gn(p,1,Vt,!0),n,S):[]});function ij(l,p,S){var k=l==null?0:l.length;return k?(p=S||p===n?1:Ke(p),Mr(l,p<0?0:p,k)):[]}function oj(l,p,S){var k=l==null?0:l.length;return k?(p=S||p===n?1:Ke(p),p=k-p,Mr(l,0,p<0?0:p)):[]}function aj(l,p){return l&&l.length?fd(l,Ie(p,3),!0,!0):[]}function lj(l,p){return l&&l.length?fd(l,Ie(p,3),!0):[]}function cj(l,p,S,k){var M=l==null?0:l.length;return M?(S&&typeof S!="number"&&jn(l,p,S)&&(S=0,k=M),tL(l,p,S,k)):[]}function Ww(l,p,S){var k=l==null?0:l.length;if(!k)return-1;var M=S==null?0:Ke(S);return M<0&&(M=Qt(k+M,0)),Wu(l,Ie(p,3),M)}function qw(l,p,S){var k=l==null?0:l.length;if(!k)return-1;var M=k-1;return S!==n&&(M=Ke(S),M=S<0?Qt(k+M,0):Sn(M,k-1)),Wu(l,Ie(p,3),M,!0)}function Gw(l){var p=l==null?0:l.length;return p?gn(l,1):[]}function uj(l){var p=l==null?0:l.length;return p?gn(l,Y):[]}function dj(l,p){var S=l==null?0:l.length;return S?(p=p===n?1:Ke(p),gn(l,p)):[]}function fj(l){for(var p=-1,S=l==null?0:l.length,k={};++p<S;){var M=l[p];k[M[0]]=M[1]}return k}function Kw(l){return l&&l.length?l[0]:n}function hj(l,p,S){var k=l==null?0:l.length;if(!k)return-1;var M=S==null?0:Ke(S);return M<0&&(M=Qt(k+M,0)),pa(l,p,M)}function pj(l){var p=l==null?0:l.length;return p?Mr(l,0,-1):[]}var mj=Qe(function(l){var p=Ot(l,_m);return p.length&&p[0]===l[0]?dm(p):[]}),gj=Qe(function(l){var p=Ir(l),S=Ot(l,_m);return p===Ir(S)?p=n:S.pop(),S.length&&S[0]===l[0]?dm(S,Ie(p,2)):[]}),vj=Qe(function(l){var p=Ir(l),S=Ot(l,_m);return p=typeof p=="function"?p:n,p&&S.pop(),S.length&&S[0]===l[0]?dm(S,n,p):[]});function yj(l,p){return l==null?"":pI.call(l,p)}function Ir(l){var p=l==null?0:l.length;return p?l[p-1]:n}function bj(l,p,S){var k=l==null?0:l.length;if(!k)return-1;var M=k;return S!==n&&(M=Ke(S),M=M<0?Qt(k+M,0):Sn(M,k-1)),p===p?ZM(l,p,M):Wu(l,P_,M,!0)}function xj(l,p){return l&&l.length?iw(l,Ke(p)):n}var _j=Qe(Yw);function Yw(l,p){return l&&l.length&&p&&p.length?mm(l,p):l}function wj(l,p,S){return l&&l.length&&p&&p.length?mm(l,p,Ie(S,2)):l}function Sj(l,p,S){return l&&l.length&&p&&p.length?mm(l,p,n,S):l}var Cj=$s(function(l,p){var S=l==null?0:l.length,k=am(l,p);return lw(l,Ot(p,function(M){return Fs(M,S)?+M:M}).sort(yw)),k});function Ej(l,p){var S=[];if(!(l&&l.length))return S;var k=-1,M=[],j=l.length;for(p=Ie(p,3);++k<j;){var z=l[k];p(z,k,l)&&(S.push(z),M.push(k))}return lw(l,M),S}function Im(l){return l==null?l:yI.call(l)}function Aj(l,p,S){var k=l==null?0:l.length;return k?(S&&typeof S!="number"&&jn(l,p,S)?(p=0,S=k):(p=p==null?0:Ke(p),S=S===n?k:Ke(S)),Mr(l,p,S)):[]}function Rj(l,p){return dd(l,p)}function Pj(l,p,S){return ym(l,p,Ie(S,2))}function Nj(l,p){var S=l==null?0:l.length;if(S){var k=dd(l,p);if(k<S&&Qr(l[k],p))return k}return-1}function Tj(l,p){return dd(l,p,!0)}function kj(l,p,S){return ym(l,p,Ie(S,2),!0)}function Dj(l,p){var S=l==null?0:l.length;if(S){var k=dd(l,p,!0)-1;if(Qr(l[k],p))return k}return-1}function Oj(l){return l&&l.length?uw(l):[]}function Mj(l,p){return l&&l.length?uw(l,Ie(p,2)):[]}function Ij(l){var p=l==null?0:l.length;return p?Mr(l,1,p):[]}function Lj(l,p,S){return l&&l.length?(p=S||p===n?1:Ke(p),Mr(l,0,p<0?0:p)):[]}function jj(l,p,S){var k=l==null?0:l.length;return k?(p=S||p===n?1:Ke(p),p=k-p,Mr(l,p<0?0:p,k)):[]}function $j(l,p){return l&&l.length?fd(l,Ie(p,3),!1,!0):[]}function Fj(l,p){return l&&l.length?fd(l,Ie(p,3)):[]}var zj=Qe(function(l){return yi(gn(l,1,Vt,!0))}),Bj=Qe(function(l){var p=Ir(l);return Vt(p)&&(p=n),yi(gn(l,1,Vt,!0),Ie(p,2))}),Uj=Qe(function(l){var p=Ir(l);return p=typeof p=="function"?p:n,yi(gn(l,1,Vt,!0),n,p)});function Vj(l){return l&&l.length?yi(l):[]}function Hj(l,p){return l&&l.length?yi(l,Ie(p,2)):[]}function Wj(l,p){return p=typeof p=="function"?p:n,l&&l.length?yi(l,n,p):[]}function Lm(l){if(!(l&&l.length))return[];var p=0;return l=hi(l,function(S){if(Vt(S))return p=Qt(S.length,p),!0}),Jp(p,function(S){return Ot(l,Xp(S))})}function Xw(l,p){if(!(l&&l.length))return[];var S=Lm(l);return p==null?S:Ot(S,function(k){return dr(p,n,k)})}var qj=Qe(function(l,p){return Vt(l)?$l(l,p):[]}),Gj=Qe(function(l){return xm(hi(l,Vt))}),Kj=Qe(function(l){var p=Ir(l);return Vt(p)&&(p=n),xm(hi(l,Vt),Ie(p,2))}),Yj=Qe(function(l){var p=Ir(l);return p=typeof p=="function"?p:n,xm(hi(l,Vt),n,p)}),Xj=Qe(Lm);function Qj(l,p){return pw(l||[],p||[],jl)}function Zj(l,p){return pw(l||[],p||[],Bl)}var Jj=Qe(function(l){var p=l.length,S=p>1?l[p-1]:n;return S=typeof S=="function"?(l.pop(),S):n,Xw(l,S)});function Qw(l){var p=L(l);return p.__chain__=!0,p}function e2(l,p){return p(l),l}function _d(l,p){return p(l)}var t2=$s(function(l){var p=l.length,S=p?l[0]:0,k=this.__wrapped__,M=function(j){return am(j,l)};return p>1||this.__actions__.length||!(k instanceof et)||!Fs(S)?this.thru(M):(k=k.slice(S,+S+(p?1:0)),k.__actions__.push({func:_d,args:[M],thisArg:n}),new Dr(k,this.__chain__).thru(function(j){return p&&!j.length&&j.push(n),j}))});function n2(){return Qw(this)}function r2(){return new Dr(this.value(),this.__chain__)}function s2(){this.__values__===n&&(this.__values__=dS(this.value()));var l=this.__index__>=this.__values__.length,p=l?n:this.__values__[this.__index__++];return{done:l,value:p}}function i2(){return this}function o2(l){for(var p,S=this;S instanceof od;){var k=Hw(S);k.__index__=0,k.__values__=n,p?M.__wrapped__=k:p=k;var M=k;S=S.__wrapped__}return M.__wrapped__=l,p}function a2(){var l=this.__wrapped__;if(l instanceof et){var p=l;return this.__actions__.length&&(p=new et(this)),p=p.reverse(),p.__actions__.push({func:_d,args:[Im],thisArg:n}),new Dr(p,this.__chain__)}return this.thru(Im)}function l2(){return hw(this.__wrapped__,this.__actions__)}var c2=hd(function(l,p,S){bt.call(l,S)?++l[S]:Ls(l,S,1)});function u2(l,p,S){var k=qe(l)?A_:eL;return S&&jn(l,p,S)&&(p=n),k(l,Ie(p,3))}function d2(l,p){var S=qe(l)?hi:X_;return S(l,Ie(p,3))}var f2=Cw(Ww),h2=Cw(qw);function p2(l,p){return gn(wd(l,p),1)}function m2(l,p){return gn(wd(l,p),Y)}function g2(l,p,S){return S=S===n?1:Ke(S),gn(wd(l,p),S)}function Zw(l,p){var S=qe(l)?Tr:vi;return S(l,Ie(p,3))}function Jw(l,p){var S=qe(l)?IM:Y_;return S(l,Ie(p,3))}var v2=hd(function(l,p,S){bt.call(l,S)?l[S].push(p):Ls(l,S,[p])});function y2(l,p,S,k){l=Kn(l)?l:Aa(l),S=S&&!k?Ke(S):0;var M=l.length;return S<0&&(S=Qt(M+S,0)),Rd(l)?S<=M&&l.indexOf(p,S)>-1:!!M&&pa(l,p,S)>-1}var b2=Qe(function(l,p,S){var k=-1,M=typeof p=="function",j=Kn(l)?ne(l.length):[];return vi(l,function(z){j[++k]=M?dr(p,z,S):Fl(z,p,S)}),j}),x2=hd(function(l,p,S){Ls(l,S,p)});function wd(l,p){var S=qe(l)?Ot:nw;return S(l,Ie(p,3))}function _2(l,p,S,k){return l==null?[]:(qe(p)||(p=p==null?[]:[p]),S=k?n:S,qe(S)||(S=S==null?[]:[S]),ow(l,p,S))}var w2=hd(function(l,p,S){l[S?0:1].push(p)},function(){return[[],[]]});function S2(l,p,S){var k=qe(l)?Kp:T_,M=arguments.length<3;return k(l,Ie(p,4),S,M,vi)}function C2(l,p,S){var k=qe(l)?LM:T_,M=arguments.length<3;return k(l,Ie(p,4),S,M,Y_)}function E2(l,p){var S=qe(l)?hi:X_;return S(l,Ed(Ie(p,3)))}function A2(l){var p=qe(l)?W_:yL;return p(l)}function R2(l,p,S){(S?jn(l,p,S):p===n)?p=1:p=Ke(p);var k=qe(l)?YI:bL;return k(l,p)}function P2(l){var p=qe(l)?XI:_L;return p(l)}function N2(l){if(l==null)return 0;if(Kn(l))return Rd(l)?ga(l):l.length;var p=Cn(l);return p==Ue||p==It?l.size:hm(l).length}function T2(l,p,S){var k=qe(l)?Yp:wL;return S&&jn(l,p,S)&&(p=n),k(l,Ie(p,3))}var k2=Qe(function(l,p){if(l==null)return[];var S=p.length;return S>1&&jn(l,p[0],p[1])?p=[]:S>2&&jn(p[0],p[1],p[2])&&(p=[p[0]]),ow(l,gn(p,1),[])}),Sd=dI||function(){return mn.Date.now()};function D2(l,p){if(typeof p!="function")throw new kr(o);return l=Ke(l),function(){if(--l<1)return p.apply(this,arguments)}}function eS(l,p,S){return p=S?n:p,p=l&&p==null?l.length:p,js(l,N,n,n,n,n,p)}function tS(l,p){var S;if(typeof p!="function")throw new kr(o);return l=Ke(l),function(){return--l>0&&(S=p.apply(this,arguments)),l<=1&&(p=n),S}}var jm=Qe(function(l,p,S){var k=x;if(S.length){var M=mi(S,Ca(jm));k|=R}return js(l,k,p,S,M)}),nS=Qe(function(l,p,S){var k=x|y;if(S.length){var M=mi(S,Ca(nS));k|=R}return js(p,k,l,S,M)});function rS(l,p,S){p=S?n:p;var k=js(l,w,n,n,n,n,n,p);return k.placeholder=rS.placeholder,k}function sS(l,p,S){p=S?n:p;var k=js(l,E,n,n,n,n,n,p);return k.placeholder=sS.placeholder,k}function iS(l,p,S){var k,M,j,z,q,Q,le=0,ce=!1,me=!1,Ee=!0;if(typeof l!="function")throw new kr(o);p=Lr(p)||0,jt(S)&&(ce=!!S.leading,me="maxWait"in S,j=me?Qt(Lr(S.maxWait)||0,p):j,Ee="trailing"in S?!!S.trailing:Ee);function De(Ht){var Zr=k,Us=M;return k=M=n,le=Ht,z=l.apply(Us,Zr),z}function Le(Ht){return le=Ht,q=Hl(Je,p),ce?De(Ht):z}function Xe(Ht){var Zr=Ht-Q,Us=Ht-le,CS=p-Zr;return me?Sn(CS,j-Us):CS}function je(Ht){var Zr=Ht-Q,Us=Ht-le;return Q===n||Zr>=p||Zr<0||me&&Us>=j}function Je(){var Ht=Sd();if(je(Ht))return rt(Ht);q=Hl(Je,Xe(Ht))}function rt(Ht){return q=n,Ee&&k?De(Ht):(k=M=n,z)}function mr(){q!==n&&mw(q),le=0,k=Q=M=q=n}function $n(){return q===n?z:rt(Sd())}function gr(){var Ht=Sd(),Zr=je(Ht);if(k=arguments,M=this,Q=Ht,Zr){if(q===n)return Le(Q);if(me)return mw(q),q=Hl(Je,p),De(Q)}return q===n&&(q=Hl(Je,p)),z}return gr.cancel=mr,gr.flush=$n,gr}var O2=Qe(function(l,p){return K_(l,1,p)}),M2=Qe(function(l,p,S){return K_(l,Lr(p)||0,S)});function I2(l){return js(l,D)}function Cd(l,p){if(typeof l!="function"||p!=null&&typeof p!="function")throw new kr(o);var S=function(){var k=arguments,M=p?p.apply(this,k):k[0],j=S.cache;if(j.has(M))return j.get(M);var z=l.apply(this,k);return S.cache=j.set(M,z)||j,z};return S.cache=new(Cd.Cache||Is),S}Cd.Cache=Is;function Ed(l){if(typeof l!="function")throw new kr(o);return function(){var p=arguments;switch(p.length){case 0:return!l.call(this);case 1:return!l.call(this,p[0]);case 2:return!l.call(this,p[0],p[1]);case 3:return!l.call(this,p[0],p[1],p[2])}return!l.apply(this,p)}}function L2(l){return tS(2,l)}var j2=SL(function(l,p){p=p.length==1&&qe(p[0])?Ot(p[0],fr(Ie())):Ot(gn(p,1),fr(Ie()));var S=p.length;return Qe(function(k){for(var M=-1,j=Sn(k.length,S);++M<j;)k[M]=p[M].call(this,k[M]);return dr(l,this,k)})}),$m=Qe(function(l,p){var S=mi(p,Ca($m));return js(l,R,n,p,S)}),oS=Qe(function(l,p){var S=mi(p,Ca(oS));return js(l,T,n,p,S)}),$2=$s(function(l,p){return js(l,A,n,n,n,p)});function F2(l,p){if(typeof l!="function")throw new kr(o);return p=p===n?p:Ke(p),Qe(l,p)}function z2(l,p){if(typeof l!="function")throw new kr(o);return p=p==null?0:Qt(Ke(p),0),Qe(function(S){var k=S[p],M=xi(S,0,p);return k&&pi(M,k),dr(l,this,M)})}function B2(l,p,S){var k=!0,M=!0;if(typeof l!="function")throw new kr(o);return jt(S)&&(k="leading"in S?!!S.leading:k,M="trailing"in S?!!S.trailing:M),iS(l,p,{leading:k,maxWait:p,trailing:M})}function U2(l){return eS(l,1)}function V2(l,p){return $m(wm(p),l)}function H2(){if(!arguments.length)return[];var l=arguments[0];return qe(l)?l:[l]}function W2(l){return Or(l,g)}function q2(l,p){return p=typeof p=="function"?p:n,Or(l,g,p)}function G2(l){return Or(l,u|g)}function K2(l,p){return p=typeof p=="function"?p:n,Or(l,u|g,p)}function Y2(l,p){return p==null||G_(l,p,rn(p))}function Qr(l,p){return l===p||l!==l&&p!==p}var X2=vd(um),Q2=vd(function(l,p){return l>=p}),go=J_(function(){return arguments}())?J_:function(l){return Ft(l)&&bt.call(l,"callee")&&!F_.call(l,"callee")},qe=ne.isArray,Z2=x_?fr(x_):oL;function Kn(l){return l!=null&&Ad(l.length)&&!zs(l)}function Vt(l){return Ft(l)&&Kn(l)}function J2(l){return l===!0||l===!1||Ft(l)&&Ln(l)==Pe}var _i=hI||Ym,e$=__?fr(__):aL;function t$(l){return Ft(l)&&l.nodeType===1&&!Wl(l)}function n$(l){if(l==null)return!0;if(Kn(l)&&(qe(l)||typeof l=="string"||typeof l.splice=="function"||_i(l)||Ea(l)||go(l)))return!l.length;var p=Cn(l);if(p==Ue||p==It)return!l.size;if(Vl(l))return!hm(l).length;for(var S in l)if(bt.call(l,S))return!1;return!0}function r$(l,p){return zl(l,p)}function s$(l,p,S){S=typeof S=="function"?S:n;var k=S?S(l,p):n;return k===n?zl(l,p,n,S):!!k}function Fm(l){if(!Ft(l))return!1;var p=Ln(l);return p==ze||p==ke||typeof l.message=="string"&&typeof l.name=="string"&&!Wl(l)}function i$(l){return typeof l=="number"&&B_(l)}function zs(l){if(!jt(l))return!1;var p=Ln(l);return p==$e||p==Te||p==ve||p==cn}function aS(l){return typeof l=="number"&&l==Ke(l)}function Ad(l){return typeof l=="number"&&l>-1&&l%1==0&&l<=H}function jt(l){var p=typeof l;return l!=null&&(p=="object"||p=="function")}function Ft(l){return l!=null&&typeof l=="object"}var lS=w_?fr(w_):cL;function o$(l,p){return l===p||fm(l,p,Nm(p))}function a$(l,p,S){return S=typeof S=="function"?S:n,fm(l,p,Nm(p),S)}function l$(l){return cS(l)&&l!=+l}function c$(l){if(qL(l))throw new We(i);return ew(l)}function u$(l){return l===null}function d$(l){return l==null}function cS(l){return typeof l=="number"||Ft(l)&&Ln(l)==wt}function Wl(l){if(!Ft(l)||Ln(l)!=St)return!1;var p=Ju(l);if(p===null)return!0;var S=bt.call(p,"constructor")&&p.constructor;return typeof S=="function"&&S instanceof S&&Yu.call(S)==aI}var zm=S_?fr(S_):uL;function f$(l){return aS(l)&&l>=-9007199254740991&&l<=H}var uS=C_?fr(C_):dL;function Rd(l){return typeof l=="string"||!qe(l)&&Ft(l)&&Ln(l)==U}function pr(l){return typeof l=="symbol"||Ft(l)&&Ln(l)==ee}var Ea=E_?fr(E_):fL;function h$(l){return l===n}function p$(l){return Ft(l)&&Cn(l)==_e}function m$(l){return Ft(l)&&Ln(l)==we}var g$=vd(pm),v$=vd(function(l,p){return l<=p});function dS(l){if(!l)return[];if(Kn(l))return Rd(l)?Yr(l):Gn(l);if(Dl&&l[Dl])return YM(l[Dl]());var p=Cn(l),S=p==Ue?tm:p==It?qu:Aa;return S(l)}function Bs(l){if(!l)return l===0?l:0;if(l=Lr(l),l===Y||l===-1/0){var p=l<0?-1:1;return p*se}return l===l?l:0}function Ke(l){var p=Bs(l),S=p%1;return p===p?S?p-S:p:0}function fS(l){return l?fo(Ke(l),0,re):0}function Lr(l){if(typeof l=="number")return l;if(pr(l))return he;if(jt(l)){var p=typeof l.valueOf=="function"?l.valueOf():l;l=jt(p)?p+"":p}if(typeof l!="string")return l===0?l:+l;l=k_(l);var S=ps.test(l);return S||pn.test(l)?DM(l.slice(2),S?2:8):Jt.test(l)?he:+l}function hS(l){return gs(l,Yn(l))}function y$(l){return l?fo(Ke(l),-9007199254740991,H):l===0?l:0}function vt(l){return l==null?"":hr(l)}var b$=wa(function(l,p){if(Vl(p)||Kn(p)){gs(p,rn(p),l);return}for(var S in p)bt.call(p,S)&&jl(l,S,p[S])}),pS=wa(function(l,p){gs(p,Yn(p),l)}),Pd=wa(function(l,p,S,k){gs(p,Yn(p),l,k)}),x$=wa(function(l,p,S,k){gs(p,rn(p),l,k)}),_$=$s(am);function w$(l,p){var S=_a(l);return p==null?S:q_(S,p)}var S$=Qe(function(l,p){l=Et(l);var S=-1,k=p.length,M=k>2?p[2]:n;for(M&&jn(p[0],p[1],M)&&(k=1);++S<k;)for(var j=p[S],z=Yn(j),q=-1,Q=z.length;++q<Q;){var le=z[q],ce=l[le];(ce===n||Qr(ce,ya[le])&&!bt.call(l,le))&&(l[le]=j[le])}return l}),C$=Qe(function(l){return l.push(n,kw),dr(mS,n,l)});function E$(l,p){return R_(l,Ie(p,3),ms)}function A$(l,p){return R_(l,Ie(p,3),cm)}function R$(l,p){return l==null?l:lm(l,Ie(p,3),Yn)}function P$(l,p){return l==null?l:Q_(l,Ie(p,3),Yn)}function N$(l,p){return l&&ms(l,Ie(p,3))}function T$(l,p){return l&&cm(l,Ie(p,3))}function k$(l){return l==null?[]:cd(l,rn(l))}function D$(l){return l==null?[]:cd(l,Yn(l))}function Bm(l,p,S){var k=l==null?n:ho(l,p);return k===n?S:k}function O$(l,p){return l!=null&&Mw(l,p,nL)}function Um(l,p){return l!=null&&Mw(l,p,rL)}var M$=Aw(function(l,p,S){p!=null&&typeof p.toString!="function"&&(p=Xu.call(p)),l[p]=S},Hm(Xn)),I$=Aw(function(l,p,S){p!=null&&typeof p.toString!="function"&&(p=Xu.call(p)),bt.call(l,p)?l[p].push(S):l[p]=[S]},Ie),L$=Qe(Fl);function rn(l){return Kn(l)?H_(l):hm(l)}function Yn(l){return Kn(l)?H_(l,!0):hL(l)}function j$(l,p){var S={};return p=Ie(p,3),ms(l,function(k,M,j){Ls(S,p(k,M,j),k)}),S}function $$(l,p){var S={};return p=Ie(p,3),ms(l,function(k,M,j){Ls(S,M,p(k,M,j))}),S}var F$=wa(function(l,p,S){ud(l,p,S)}),mS=wa(function(l,p,S,k){ud(l,p,S,k)}),z$=$s(function(l,p){var S={};if(l==null)return S;var k=!1;p=Ot(p,function(j){return j=bi(j,l),k||(k=j.length>1),j}),gs(l,Rm(l),S),k&&(S=Or(S,u|f|g,ML));for(var M=p.length;M--;)bm(S,p[M]);return S});function B$(l,p){return gS(l,Ed(Ie(p)))}var U$=$s(function(l,p){return l==null?{}:mL(l,p)});function gS(l,p){if(l==null)return{};var S=Ot(Rm(l),function(k){return[k]});return p=Ie(p),aw(l,S,function(k,M){return p(k,M[0])})}function V$(l,p,S){p=bi(p,l);var k=-1,M=p.length;for(M||(M=1,l=n);++k<M;){var j=l==null?n:l[vs(p[k])];j===n&&(k=M,j=S),l=zs(j)?j.call(l):j}return l}function H$(l,p,S){return l==null?l:Bl(l,p,S)}function W$(l,p,S,k){return k=typeof k=="function"?k:n,l==null?l:Bl(l,p,S,k)}var vS=Nw(rn),yS=Nw(Yn);function q$(l,p,S){var k=qe(l),M=k||_i(l)||Ea(l);if(p=Ie(p,4),S==null){var j=l&&l.constructor;M?S=k?new j:[]:jt(l)?S=zs(j)?_a(Ju(l)):{}:S={}}return(M?Tr:ms)(l,function(z,q,Q){return p(S,z,q,Q)}),S}function G$(l,p){return l==null?!0:bm(l,p)}function K$(l,p,S){return l==null?l:fw(l,p,wm(S))}function Y$(l,p,S,k){return k=typeof k=="function"?k:n,l==null?l:fw(l,p,wm(S),k)}function Aa(l){return l==null?[]:em(l,rn(l))}function X$(l){return l==null?[]:em(l,Yn(l))}function Q$(l,p,S){return S===n&&(S=p,p=n),S!==n&&(S=Lr(S),S=S===S?S:0),p!==n&&(p=Lr(p),p=p===p?p:0),fo(Lr(l),p,S)}function Z$(l,p,S){return p=Bs(p),S===n?(S=p,p=0):S=Bs(S),l=Lr(l),sL(l,p,S)}function J$(l,p,S){if(S&&typeof S!="boolean"&&jn(l,p,S)&&(p=S=n),S===n&&(typeof p=="boolean"?(S=p,p=n):typeof l=="boolean"&&(S=l,l=n)),l===n&&p===n?(l=0,p=1):(l=Bs(l),p===n?(p=l,l=0):p=Bs(p)),l>p){var k=l;l=p,p=k}if(S||l%1||p%1){var M=U_();return Sn(l+M*(p-l+kM("1e-"+((M+"").length-1))),p)}return gm(l,p)}var eF=Sa(function(l,p,S){return p=p.toLowerCase(),l+(S?bS(p):p)});function bS(l){return Vm(vt(l).toLowerCase())}function xS(l){return l=vt(l),l&&l.replace(Lc,HM).replace(_M,"")}function tF(l,p,S){l=vt(l),p=hr(p);var k=l.length;S=S===n?k:fo(Ke(S),0,k);var M=S;return S-=p.length,S>=0&&l.slice(S,M)==p}function nF(l){return l=vt(l),l&&Gt.test(l)?l.replace(yt,WM):l}function rF(l){return l=vt(l),l&&ye.test(l)?l.replace(de,"\\$&"):l}var sF=Sa(function(l,p,S){return l+(S?"-":"")+p.toLowerCase()}),iF=Sa(function(l,p,S){return l+(S?" ":"")+p.toLowerCase()}),oF=Sw("toLowerCase");function aF(l,p,S){l=vt(l),p=Ke(p);var k=p?ga(l):0;if(!p||k>=p)return l;var M=(p-k)/2;return gd(rd(M),S)+l+gd(nd(M),S)}function lF(l,p,S){l=vt(l),p=Ke(p);var k=p?ga(l):0;return p&&k<p?l+gd(p-k,S):l}function cF(l,p,S){l=vt(l),p=Ke(p);var k=p?ga(l):0;return p&&k<p?gd(p-k,S)+l:l}function uF(l,p,S){return S||p==null?p=0:p&&(p=+p),vI(vt(l).replace(Ce,""),p||0)}function dF(l,p,S){return(S?jn(l,p,S):p===n)?p=1:p=Ke(p),vm(vt(l),p)}function fF(){var l=arguments,p=vt(l[0]);return l.length<3?p:p.replace(l[1],l[2])}var hF=Sa(function(l,p,S){return l+(S?"_":"")+p.toLowerCase()});function pF(l,p,S){return S&&typeof S!="number"&&jn(l,p,S)&&(p=S=n),S=S===n?re:S>>>0,S?(l=vt(l),l&&(typeof p=="string"||p!=null&&!zm(p))&&(p=hr(p),!p&&ma(l))?xi(Yr(l),0,S):l.split(p,S)):[]}var mF=Sa(function(l,p,S){return l+(S?" ":"")+Vm(p)});function gF(l,p,S){return l=vt(l),S=S==null?0:fo(Ke(S),0,l.length),p=hr(p),l.slice(S,S+p.length)==p}function vF(l,p,S){var k=L.templateSettings;S&&jn(l,p,S)&&(p=n),l=vt(l),p=Pd({},p,k,Tw);var M=Pd({},p.imports,k.imports,Tw),j=rn(M),z=em(M,j),q,Q,le=0,ce=p.interpolate||oo,me="__p += '",Ee=nm((p.escape||oo).source+"|"+ce.source+"|"+(ce===Tn?gt:oo).source+"|"+(p.evaluate||oo).source+"|$","g"),De="//# sourceURL="+(bt.call(p,"sourceURL")?(p.sourceURL+"").replace(/\s/g," "):"lodash.templateSources["+ ++AM+"]")+`
|
||
`;l.replace(Ee,function(je,Je,rt,mr,$n,gr){return rt||(rt=mr),me+=l.slice(le,gr).replace(fa,qM),Je&&(q=!0,me+=`' +
|
||
__e(`+Je+`) +
|
||
'`),$n&&(Q=!0,me+=`';
|
||
`+$n+`;
|
||
__p += '`),rt&&(me+=`' +
|
||
((__t = (`+rt+`)) == null ? '' : __t) +
|
||
'`),le=gr+je.length,je}),me+=`';
|
||
`;var Le=bt.call(p,"variable")&&p.variable;if(!Le)me=`with (obj) {
|
||
`+me+`
|
||
}
|
||
`;else if(dt.test(Le))throw new We(a);me=(Q?me.replace(Ze,""):me).replace(Rt,"$1").replace(Pt,"$1;"),me="function("+(Le||"obj")+`) {
|
||
`+(Le?"":`obj || (obj = {});
|
||
`)+"var __t, __p = ''"+(q?", __e = _.escape":"")+(Q?`, __j = Array.prototype.join;
|
||
function print() { __p += __j.call(arguments, '') }
|
||
`:`;
|
||
`)+me+`return __p
|
||
}`;var Xe=wS(function(){return pt(j,De+"return "+me).apply(n,z)});if(Xe.source=me,Fm(Xe))throw Xe;return Xe}function yF(l){return vt(l).toLowerCase()}function bF(l){return vt(l).toUpperCase()}function xF(l,p,S){if(l=vt(l),l&&(S||p===n))return k_(l);if(!l||!(p=hr(p)))return l;var k=Yr(l),M=Yr(p),j=D_(k,M),z=O_(k,M)+1;return xi(k,j,z).join("")}function _F(l,p,S){if(l=vt(l),l&&(S||p===n))return l.slice(0,I_(l)+1);if(!l||!(p=hr(p)))return l;var k=Yr(l),M=O_(k,Yr(p))+1;return xi(k,0,M).join("")}function wF(l,p,S){if(l=vt(l),l&&(S||p===n))return l.replace(Ce,"");if(!l||!(p=hr(p)))return l;var k=Yr(l),M=D_(k,Yr(p));return xi(k,M).join("")}function SF(l,p){var S=O,k=I;if(jt(p)){var M="separator"in p?p.separator:M;S="length"in p?Ke(p.length):S,k="omission"in p?hr(p.omission):k}l=vt(l);var j=l.length;if(ma(l)){var z=Yr(l);j=z.length}if(S>=j)return l;var q=S-ga(k);if(q<1)return k;var Q=z?xi(z,0,q).join(""):l.slice(0,q);if(M===n)return Q+k;if(z&&(q+=Q.length-q),zm(M)){if(l.slice(q).search(M)){var le,ce=Q;for(M.global||(M=nm(M.source,vt(Lt.exec(M))+"g")),M.lastIndex=0;le=M.exec(ce);)var me=le.index;Q=Q.slice(0,me===n?q:me)}}else if(l.indexOf(hr(M),q)!=q){var Ee=Q.lastIndexOf(M);Ee>-1&&(Q=Q.slice(0,Ee))}return Q+k}function CF(l){return l=vt(l),l&&dn.test(l)?l.replace(Ut,JM):l}var EF=Sa(function(l,p,S){return l+(S?" ":"")+p.toUpperCase()}),Vm=Sw("toUpperCase");function _S(l,p,S){return l=vt(l),p=S?n:p,p===n?KM(l)?nI(l):FM(l):l.match(p)||[]}var wS=Qe(function(l,p){try{return dr(l,n,p)}catch(S){return Fm(S)?S:new We(S)}}),AF=$s(function(l,p){return Tr(p,function(S){S=vs(S),Ls(l,S,jm(l[S],l))}),l});function RF(l){var p=l==null?0:l.length,S=Ie();return l=p?Ot(l,function(k){if(typeof k[1]!="function")throw new kr(o);return[S(k[0]),k[1]]}):[],Qe(function(k){for(var M=-1;++M<p;){var j=l[M];if(dr(j[0],this,k))return dr(j[1],this,k)}})}function PF(l){return JI(Or(l,u))}function Hm(l){return function(){return l}}function NF(l,p){return l==null||l!==l?p:l}var TF=Ew(),kF=Ew(!0);function Xn(l){return l}function Wm(l){return tw(typeof l=="function"?l:Or(l,u))}function DF(l){return rw(Or(l,u))}function OF(l,p){return sw(l,Or(p,u))}var MF=Qe(function(l,p){return function(S){return Fl(S,l,p)}}),IF=Qe(function(l,p){return function(S){return Fl(l,S,p)}});function qm(l,p,S){var k=rn(p),M=cd(p,k);S==null&&!(jt(p)&&(M.length||!k.length))&&(S=p,p=l,l=this,M=cd(p,rn(p)));var j=!(jt(S)&&"chain"in S)||!!S.chain,z=zs(l);return Tr(M,function(q){var Q=p[q];l[q]=Q,z&&(l.prototype[q]=function(){var le=this.__chain__;if(j||le){var ce=l(this.__wrapped__),me=ce.__actions__=Gn(this.__actions__);return me.push({func:Q,args:arguments,thisArg:l}),ce.__chain__=le,ce}return Q.apply(l,pi([this.value()],arguments))})}),l}function LF(){return mn._===this&&(mn._=lI),this}function Gm(){}function jF(l){return l=Ke(l),Qe(function(p){return iw(p,l)})}var $F=Cm(Ot),FF=Cm(A_),zF=Cm(Yp);function SS(l){return km(l)?Xp(vs(l)):gL(l)}function BF(l){return function(p){return l==null?n:ho(l,p)}}var UF=Rw(),VF=Rw(!0);function Km(){return[]}function Ym(){return!1}function HF(){return{}}function WF(){return""}function qF(){return!0}function GF(l,p){if(l=Ke(l),l<1||l>H)return[];var S=re,k=Sn(l,re);p=Ie(p),l-=re;for(var M=Jp(k,p);++S<l;)p(S);return M}function KF(l){return qe(l)?Ot(l,vs):pr(l)?[l]:Gn(Vw(vt(l)))}function YF(l){var p=++oI;return vt(l)+p}var XF=md(function(l,p){return l+p},0),QF=Em("ceil"),ZF=md(function(l,p){return l/p},1),JF=Em("floor");function e3(l){return l&&l.length?ld(l,Xn,um):n}function t3(l,p){return l&&l.length?ld(l,Ie(p,2),um):n}function n3(l){return N_(l,Xn)}function r3(l,p){return N_(l,Ie(p,2))}function s3(l){return l&&l.length?ld(l,Xn,pm):n}function i3(l,p){return l&&l.length?ld(l,Ie(p,2),pm):n}var o3=md(function(l,p){return l*p},1),a3=Em("round"),l3=md(function(l,p){return l-p},0);function c3(l){return l&&l.length?Zp(l,Xn):0}function u3(l,p){return l&&l.length?Zp(l,Ie(p,2)):0}return L.after=D2,L.ary=eS,L.assign=b$,L.assignIn=pS,L.assignInWith=Pd,L.assignWith=x$,L.at=_$,L.before=tS,L.bind=jm,L.bindAll=AF,L.bindKey=nS,L.castArray=H2,L.chain=Qw,L.chunk=JL,L.compact=ej,L.concat=tj,L.cond=RF,L.conforms=PF,L.constant=Hm,L.countBy=c2,L.create=w$,L.curry=rS,L.curryRight=sS,L.debounce=iS,L.defaults=S$,L.defaultsDeep=C$,L.defer=O2,L.delay=M2,L.difference=nj,L.differenceBy=rj,L.differenceWith=sj,L.drop=ij,L.dropRight=oj,L.dropRightWhile=aj,L.dropWhile=lj,L.fill=cj,L.filter=d2,L.flatMap=p2,L.flatMapDeep=m2,L.flatMapDepth=g2,L.flatten=Gw,L.flattenDeep=uj,L.flattenDepth=dj,L.flip=I2,L.flow=TF,L.flowRight=kF,L.fromPairs=fj,L.functions=k$,L.functionsIn=D$,L.groupBy=v2,L.initial=pj,L.intersection=mj,L.intersectionBy=gj,L.intersectionWith=vj,L.invert=M$,L.invertBy=I$,L.invokeMap=b2,L.iteratee=Wm,L.keyBy=x2,L.keys=rn,L.keysIn=Yn,L.map=wd,L.mapKeys=j$,L.mapValues=$$,L.matches=DF,L.matchesProperty=OF,L.memoize=Cd,L.merge=F$,L.mergeWith=mS,L.method=MF,L.methodOf=IF,L.mixin=qm,L.negate=Ed,L.nthArg=jF,L.omit=z$,L.omitBy=B$,L.once=L2,L.orderBy=_2,L.over=$F,L.overArgs=j2,L.overEvery=FF,L.overSome=zF,L.partial=$m,L.partialRight=oS,L.partition=w2,L.pick=U$,L.pickBy=gS,L.property=SS,L.propertyOf=BF,L.pull=_j,L.pullAll=Yw,L.pullAllBy=wj,L.pullAllWith=Sj,L.pullAt=Cj,L.range=UF,L.rangeRight=VF,L.rearg=$2,L.reject=E2,L.remove=Ej,L.rest=F2,L.reverse=Im,L.sampleSize=R2,L.set=H$,L.setWith=W$,L.shuffle=P2,L.slice=Aj,L.sortBy=k2,L.sortedUniq=Oj,L.sortedUniqBy=Mj,L.split=pF,L.spread=z2,L.tail=Ij,L.take=Lj,L.takeRight=jj,L.takeRightWhile=$j,L.takeWhile=Fj,L.tap=e2,L.throttle=B2,L.thru=_d,L.toArray=dS,L.toPairs=vS,L.toPairsIn=yS,L.toPath=KF,L.toPlainObject=hS,L.transform=q$,L.unary=U2,L.union=zj,L.unionBy=Bj,L.unionWith=Uj,L.uniq=Vj,L.uniqBy=Hj,L.uniqWith=Wj,L.unset=G$,L.unzip=Lm,L.unzipWith=Xw,L.update=K$,L.updateWith=Y$,L.values=Aa,L.valuesIn=X$,L.without=qj,L.words=_S,L.wrap=V2,L.xor=Gj,L.xorBy=Kj,L.xorWith=Yj,L.zip=Xj,L.zipObject=Qj,L.zipObjectDeep=Zj,L.zipWith=Jj,L.entries=vS,L.entriesIn=yS,L.extend=pS,L.extendWith=Pd,qm(L,L),L.add=XF,L.attempt=wS,L.camelCase=eF,L.capitalize=bS,L.ceil=QF,L.clamp=Q$,L.clone=W2,L.cloneDeep=G2,L.cloneDeepWith=K2,L.cloneWith=q2,L.conformsTo=Y2,L.deburr=xS,L.defaultTo=NF,L.divide=ZF,L.endsWith=tF,L.eq=Qr,L.escape=nF,L.escapeRegExp=rF,L.every=u2,L.find=f2,L.findIndex=Ww,L.findKey=E$,L.findLast=h2,L.findLastIndex=qw,L.findLastKey=A$,L.floor=JF,L.forEach=Zw,L.forEachRight=Jw,L.forIn=R$,L.forInRight=P$,L.forOwn=N$,L.forOwnRight=T$,L.get=Bm,L.gt=X2,L.gte=Q2,L.has=O$,L.hasIn=Um,L.head=Kw,L.identity=Xn,L.includes=y2,L.indexOf=hj,L.inRange=Z$,L.invoke=L$,L.isArguments=go,L.isArray=qe,L.isArrayBuffer=Z2,L.isArrayLike=Kn,L.isArrayLikeObject=Vt,L.isBoolean=J2,L.isBuffer=_i,L.isDate=e$,L.isElement=t$,L.isEmpty=n$,L.isEqual=r$,L.isEqualWith=s$,L.isError=Fm,L.isFinite=i$,L.isFunction=zs,L.isInteger=aS,L.isLength=Ad,L.isMap=lS,L.isMatch=o$,L.isMatchWith=a$,L.isNaN=l$,L.isNative=c$,L.isNil=d$,L.isNull=u$,L.isNumber=cS,L.isObject=jt,L.isObjectLike=Ft,L.isPlainObject=Wl,L.isRegExp=zm,L.isSafeInteger=f$,L.isSet=uS,L.isString=Rd,L.isSymbol=pr,L.isTypedArray=Ea,L.isUndefined=h$,L.isWeakMap=p$,L.isWeakSet=m$,L.join=yj,L.kebabCase=sF,L.last=Ir,L.lastIndexOf=bj,L.lowerCase=iF,L.lowerFirst=oF,L.lt=g$,L.lte=v$,L.max=e3,L.maxBy=t3,L.mean=n3,L.meanBy=r3,L.min=s3,L.minBy=i3,L.stubArray=Km,L.stubFalse=Ym,L.stubObject=HF,L.stubString=WF,L.stubTrue=qF,L.multiply=o3,L.nth=xj,L.noConflict=LF,L.noop=Gm,L.now=Sd,L.pad=aF,L.padEnd=lF,L.padStart=cF,L.parseInt=uF,L.random=J$,L.reduce=S2,L.reduceRight=C2,L.repeat=dF,L.replace=fF,L.result=V$,L.round=a3,L.runInContext=X,L.sample=A2,L.size=N2,L.snakeCase=hF,L.some=T2,L.sortedIndex=Rj,L.sortedIndexBy=Pj,L.sortedIndexOf=Nj,L.sortedLastIndex=Tj,L.sortedLastIndexBy=kj,L.sortedLastIndexOf=Dj,L.startCase=mF,L.startsWith=gF,L.subtract=l3,L.sum=c3,L.sumBy=u3,L.template=vF,L.times=GF,L.toFinite=Bs,L.toInteger=Ke,L.toLength=fS,L.toLower=yF,L.toNumber=Lr,L.toSafeInteger=y$,L.toString=vt,L.toUpper=bF,L.trim=xF,L.trimEnd=_F,L.trimStart=wF,L.truncate=SF,L.unescape=CF,L.uniqueId=YF,L.upperCase=EF,L.upperFirst=Vm,L.each=Zw,L.eachRight=Jw,L.first=Kw,qm(L,function(){var l={};return ms(L,function(p,S){bt.call(L.prototype,S)||(l[S]=p)}),l}(),{chain:!1}),L.VERSION=r,Tr(["bind","bindKey","curry","curryRight","partial","partialRight"],function(l){L[l].placeholder=L}),Tr(["drop","take"],function(l,p){et.prototype[l]=function(S){S=S===n?1:Qt(Ke(S),0);var k=this.__filtered__&&!p?new et(this):this.clone();return k.__filtered__?k.__takeCount__=Sn(S,k.__takeCount__):k.__views__.push({size:Sn(S,re),type:l+(k.__dir__<0?"Right":"")}),k},et.prototype[l+"Right"]=function(S){return this.reverse()[l](S).reverse()}}),Tr(["filter","map","takeWhile"],function(l,p){var S=p+1,k=S==B||S==Z;et.prototype[l]=function(M){var j=this.clone();return j.__iteratees__.push({iteratee:Ie(M,3),type:S}),j.__filtered__=j.__filtered__||k,j}}),Tr(["head","last"],function(l,p){var S="take"+(p?"Right":"");et.prototype[l]=function(){return this[S](1).value()[0]}}),Tr(["initial","tail"],function(l,p){var S="drop"+(p?"":"Right");et.prototype[l]=function(){return this.__filtered__?new et(this):this[S](1)}}),et.prototype.compact=function(){return this.filter(Xn)},et.prototype.find=function(l){return this.filter(l).head()},et.prototype.findLast=function(l){return this.reverse().find(l)},et.prototype.invokeMap=Qe(function(l,p){return typeof l=="function"?new et(this):this.map(function(S){return Fl(S,l,p)})}),et.prototype.reject=function(l){return this.filter(Ed(Ie(l)))},et.prototype.slice=function(l,p){l=Ke(l);var S=this;return S.__filtered__&&(l>0||p<0)?new et(S):(l<0?S=S.takeRight(-l):l&&(S=S.drop(l)),p!==n&&(p=Ke(p),S=p<0?S.dropRight(-p):S.take(p-l)),S)},et.prototype.takeRightWhile=function(l){return this.reverse().takeWhile(l).reverse()},et.prototype.toArray=function(){return this.take(re)},ms(et.prototype,function(l,p){var S=/^(?:filter|find|map|reject)|While$/.test(p),k=/^(?:head|last)$/.test(p),M=L[k?"take"+(p=="last"?"Right":""):p],j=k||/^find/.test(p);M&&(L.prototype[p]=function(){var z=this.__wrapped__,q=k?[1]:arguments,Q=z instanceof et,le=q[0],ce=Q||qe(z),me=function(Je){var rt=M.apply(L,pi([Je],q));return k&&Ee?rt[0]:rt};ce&&S&&typeof le=="function"&&le.length!=1&&(Q=ce=!1);var Ee=this.__chain__,De=!!this.__actions__.length,Le=j&&!Ee,Xe=Q&&!De;if(!j&&ce){z=Xe?z:new et(this);var je=l.apply(z,q);return je.__actions__.push({func:_d,args:[me],thisArg:n}),new Dr(je,Ee)}return Le&&Xe?l.apply(this,q):(je=this.thru(me),Le?k?je.value()[0]:je.value():je)})}),Tr(["pop","push","shift","sort","splice","unshift"],function(l){var p=Gu[l],S=/^(?:push|sort|unshift)$/.test(l)?"tap":"thru",k=/^(?:pop|shift)$/.test(l);L.prototype[l]=function(){var M=arguments;if(k&&!this.__chain__){var j=this.value();return p.apply(qe(j)?j:[],M)}return this[S](function(z){return p.apply(qe(z)?z:[],M)})}}),ms(et.prototype,function(l,p){var S=L[p];if(S){var k=S.name+"";bt.call(xa,k)||(xa[k]=[]),xa[k].push({name:p,func:S})}}),xa[pd(n,y).name]=[{name:"wrapper",func:n}],et.prototype.clone=CI,et.prototype.reverse=EI,et.prototype.value=AI,L.prototype.at=t2,L.prototype.chain=n2,L.prototype.commit=r2,L.prototype.next=s2,L.prototype.plant=o2,L.prototype.reverse=a2,L.prototype.toJSON=L.prototype.valueOf=L.prototype.value=l2,L.prototype.first=L.prototype.head,Dl&&(L.prototype[Dl]=i2),L},va=rI();ao?((ao.exports=va)._=va,Wp._=va):mn._=va}).call(xr)})(YT,YT.exports);var rN=YT.exports;const IU=({amount:e,scale:t})=>{const n=10**t;return Number(e)/n},GFe=e=>{const t=e.getFullYear(),n=String(e.getMonth()+1).padStart(2,"0"),r=String(e.getDate()).padStart(2,"0");return`${t}-${n}-${r}`},V4={locale:"es-ES"},Vy={amount:null,currencyCode:Rv.DEFAULT_CURRENCY_CODE,scale:2},ls=class ls extends oW{constructor(n,r,s){super(n);Be(this,"_isNull");Be(this,"_options");Be(this,"isEmpty",()=>this.isNull());Be(this,"isNull",()=>this._isNull);this._isNull=Object.freeze(r),this._options=Object.freeze(s)}static validate(n,r){const s=wn.any().optional().valid(null),i=wn.number().label(r.label?r.label:"amount"),o=wn.alternatives(s,i);return nr.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=Vy,r=V4){if(n===null)throw new Error("InvalidParams: props params is missing");const{amount:s=Vy.amount,currencyCode:i=Vy.currencyCode,scale:o=Vy.scale}=n||{},a=ls.validate(s,r);if(a.isFailure)return Vn.fail(bp(Pc.INVALID_INPUT_DATA,a.error.message,r));const c=ls.sanitize(a.object),d=i,h=bP({amount:Number(c),currency:d,precision:o}).setLocale(r.locale);return Vn.ok(new this(h,rN.isNull(c),r))}static createFromFormattedValue(n,r,s=ls.DEFAULT_SCALE,i={locale:V4.locale}){if(n===null||n==="")return ls.create({amount:null,scale:s,currencyCode:r});const o=String(n),[a,c]=o.split(",");let d=a,h=2;return c===void 0?h=0:(c===""&&(d=a+c.padEnd(1,"0"),h=1),c.length===1?(d=a+c.padEnd(1,"0"),h=1):c.length===2?(d=a+c.padEnd(2,"0"),h=2):c.length===3?(d=a+c.padEnd(3,"0"),h=3):c.length===4&&(d=a+c.padEnd(4,"0"),h=4)),ls.create({amount:d,scale:h,currencyCode:r},i)}static sanitize(n){let r=null;return typeof n=="string"?r=parseFloat(n):r=n,r}static createFromDinero(n){return Vn.ok(new ls(n,!1,V4))}static normalizeScale(n){return bP.normalizePrecision(n.map(r=>r.props)).map(r=>ls.createFromDinero(r).object)}static minimum(n){return ls.createFromDinero(bP.minimum(n.map(r=>r.props))).object}static maximum(n){return ls.createFromDinero(bP.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:IU({amount:n,scale:r}));const i=Math.pow(10,r);return(Number(n)/i).toFixed(r)}toString(){return ls._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?ls.create({amount:null,scale:n,currencyCode:this.getCurrency().code}).object:ls.createFromDinero(this.props.convertPrecision(n,r)).object}getCurrency(){return Rv.createFromCode(this.props.getCurrency()).object}getLocale(){return this.props.getLocale()}add(n){return ls.createFromDinero(this.props.add(n.props)).object}subtract(n){return ls.createFromDinero(this.props.subtract(n.props)).object}multiply(n,r){return ls.createFromDinero(this.props.multiply(n,r)).object}divide(n,r){return ls.createFromDinero(this.props.divide(n,r)).object}percentage(n,r){return ls.createFromDinero(this.props.percentage(n,r)).object}allocate(n){return this.props.allocate(n).map(r=>ls.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()}};Be(ls,"DEFAULT_SCALE",Vy.scale),Be(ls,"DEFAULT_CURRENCY_CODE",Vy.currencyCode);let No=ls;class z7e extends wn.ValidationError{}class Xce{constructor(t){Be(this,"_collection",[]);this._collection=t??[]}add(t){this._collection.push(t)}reset(){this._collection=[]}hasSomeFaultyResult(){return this._collection.some(t=>t.isFailure)}getFirstFaultyResult(){return this._collection.find(t=>t.isFailure)}getAllFaultyResults(){return this._collection.filter(t=>t.isFailure)}get objects(){return this._collection.filter(t=>t.isSuccess).map(t=>t.object)}get errors(){return this._collection.filter(t=>t.isFailure).map(t=>t.error)}}const Qce=2,H4={amount:0,scale:Qce},Qn=class Qn extends hR{constructor(n,r,s){super(n);Be(this,"_isNull");Be(this,"_options");Be(this,"isEmpty",()=>this.isNull());Be(this,"isNull",()=>this._isNull);this._isNull=Object.freeze(r),this._options=Object.freeze(s)}static validate(n,r,s){const i=nr.RULE_ALLOW_NULL_OR_UNDEFINED,o=nr.RULE_ALLOW_EMPTY,a=nr.RULE_IS_TYPE_NUMBER.label(s.label?s.label:"amount"),c=nr.RULE_IS_TYPE_STRING.regex(/^[-]?\d+$/).label(s.label?s.label:"amount"),d=wn.number().min(Qn.MIN_SCALE).max(Qn.MAX_SCALE).label(s.label?s.label:"scale"),h=new Xce([nr.validate(wn.alternatives(i,o,a,c),n),nr.validate(wn.alternatives(nr.RULE_IS_TYPE_NUMBER.label(s.label?s.label:"scale"),d),r)]);if(h.hasSomeFaultyResult())return h.getFirstFaultyResult();let u=typeof n=="string"?parseInt(n,10):Number(n),f=rN.isNull(r)?Qn.DEFAULT_SCALE:Number(r);const g=u/Math.pow(10,f);return g<Qn.MIN_VALUE||g>Qn.MAX_VALUE?Vn.fail(new Error(`Value with scale is out of range: ${g}`)):Vn.ok()}static create(n=H4,r={}){if(n===null)throw new Error("InvalidParams: props params is missing");const{amount:s=H4.amount,scale:i=H4.scale}=n,o={label:"percentage",...r},a=Qn.validate(s,i,o);if(a.isFailure)return Vn.fail(bp(Pc.INVALID_INPUT_DATA,a.error.message,o));let c=Qn._sanitize(s);const d={amount:rN.isNull(c)?0:c,scale:i};return Vn.ok(new this(d,rN.isNull(c),r))}static createFromFormattedValue(n,r={}){if(n===null||n==="")return Qn.create({amount:null,scale:Qn.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)),Qn.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(Qn._toString(n,r));return s>=Qn.MIN_VALUE&&s<=Qn.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 Qn._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!==Qn.DEFAULT_SCALE?this.convertScale(Qn.DEFAULT_SCALE).toPrimitive():this.amount}toPrimitives(){return this.toObject()}toObject(){return{amount:this.amount,scale:this.scale}}convertScale(n){if(n<Qn.MIN_SCALE||n>Qn.MAX_SCALE)throw new Error(`Scale out of range: ${n}`);if(this.isNull())return new Qn({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(!Qn._isWithinRange(o,n))throw new Error(`Value out of range after conversion: ${o} ${n}`);return new Qn({amount:o,scale:n},!1,this._options)}hasSameScale(n){return this.scale===n.scale}isWithinRange(){return Qn._isWithinRange(this.amount,this.scale)}};Be(Qn,"DEFAULT_SCALE",Qce),Be(Qn,"MIN_VALUE",0),Be(Qn,"MAX_VALUE",100),Be(Qn,"MIN_SCALE",0),Be(Qn,"MAX_SCALE",2);let Tu=Qn;class B7e extends wn.ValidationError{}const Zce=2,W4={amount:0,scale:Zce},or=class or extends hR{constructor(n,r,s){super(n);Be(this,"_isNull");Be(this,"_options");Be(this,"isEmpty",()=>this.isNull());Be(this,"isNull",()=>this._isNull);this._isNull=Object.freeze(r),this._options=Object.freeze(s)}static validate(n,r,s={}){const i=nr.RULE_ALLOW_NULL_OR_UNDEFINED,o=nr.RULE_ALLOW_EMPTY,a=nr.RULE_IS_TYPE_NUMBER.label(s.label?s.label:"amount"),c=nr.RULE_IS_TYPE_STRING.regex(/^[-]?\d+$/).label(s.label?s.label:"amount"),d=wn.number().min(or.MIN_SCALE).max(or.MAX_SCALE).label(s.label?s.label:"scale"),h=new Xce([nr.validate(wn.alternatives(i,o,a,c),n),nr.validate(wn.alternatives(nr.RULE_IS_TYPE_NUMBER.label(s.label?s.label:"scale"),d),r)]);return h.hasSomeFaultyResult()?h.getFirstFaultyResult():Vn.ok()}static create(n=W4,r={}){if(n===null)throw new Error("InvalidParams: props params is missing");const{amount:s=W4.amount,scale:i=W4.scale}=n,o={label:"quantity",...r},a=or.validate(s,i,o);if(a.isFailure)return Vn.fail(bp(Pc.INVALID_INPUT_DATA,a.error.message,o));let c=or._sanitize(s);const d={amount:c===null?0:c,scale:i};return Vn.ok(new or(d,c===null,r))}static createFromFormattedValue(n,r={}){if(n===null||n==="")return or.create({amount:null,scale:or.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)),or.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 or._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!==or.DEFAULT_SCALE?this.convertScale(or.DEFAULT_SCALE).toPrimitive():this.amount}toPrimitives(){return this.toObject()}toObject(){return{amount:this.amount,scale:this.scale}}convertScale(n){if(n<or.MIN_SCALE||n>or.MAX_SCALE)throw new Error(`Scale out of range: ${n}`);if(this.isNull())return new or({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 or({amount:o,scale:n},!1,this._options)}hasSameScale(n){return this.scale===n.scale}increment(n){return this.isNull()?n?or.create(n.toObject()):or.create():n?this.hasSameScale(n)?or.create({amount:Number(this.amount)+Number(n.amount),scale:this.scale},this._options):Vn.fail(Error("No se pueden sumar cantidades con diferentes escalas.")):or.create({amount:Number(this.amount)+1,scale:this.scale},this._options)}decrement(n){return this.isNull()?n?or.create(n.toObject()):or.create():n?this.hasSameScale(n)?or.create({amount:Number(this.amount)-Number(n.amount),scale:this.scale},this._options):Vn.fail(Error("No se pueden restar cantidades con diferentes escalas.")):or.create({amount:Number(this.amount)-1,scale:this.scale},this._options)}};Be(or,"DEFAULT_SCALE",Zce),Be(or,"MIN_SCALE",0),Be(or,"MAX_SCALE",2);let xp=or;const mK=2;class KFe extends No{static create(t){const{amount:n,currencyCode:r,scale:s=mK}=t,i=No.create({amount:n,currencyCode:r,scale:s});if(i.isFailure)return i;const o=i.object.convertScale(mK);return Vn.ok(o)}}class Lb extends oW{constructor(){super(...arguments);Be(this,"isValid",()=>!isNaN(this.props.valueOf())&&this.props.valueOf()!==0);Be(this,"isEmpty",()=>!this.isValid());Be(this,"toISO8601",()=>this.isValid()?this.props.toISOString():"");Be(this,"toDateString",()=>this.isValid()?this.props.toDateString():"");Be(this,"toLocaleDateString",(n,r)=>this.isValid()?this.props.toLocaleDateString(n,r):"");Be(this,"toLocaleTimeString",()=>this.isValid()?this.props.toLocaleTimeString():"")}static validate(n,r){const s=nr.RULE_ALLOW_EMPTY.default(0),i=wn.date().label(String(r.label)),o=wn.alternatives(s,i);return nr.validate(o,n)}static createCurrentDate(){return Vn.ok(new Lb(new Date))}static create(n,r={}){const s={...r,dateFormat:r.dateFormat?r.dateFormat:"YYYY-MM-DD",label:r.label?r.label:"date"},i=Lb.validate(n,s);return i.isFailure?Vn.fail(bp(Pc.INVALID_INPUT_DATA,i.error.message,s)):Vn.ok(new Lb(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 jb=0,aW=10,LU=1,Jce=9999,YFe=({isPending:e,interval:t=1e3,onInterval:n})=>{const[r,s]=C.useState(void 0);return C.useEffect(()=>{let i;return e&&(i=setInterval(()=>{s(o=>o===void 0?t:o+t)},t)),()=>{clearInterval(i),s(void 0)}},[e,t]),C.useEffect(()=>{n&&r&&n(r)},[r]),{elapsedTime:r}},XFe=2*60*1e3,QFe=60*1e3,lW=({queryKey:e,queryFn:t,enabled:n,select:r,queryOptions:s={},overtimeOptions:i})=>{const[o,a]=C.useState(!1),c=iD({queryKey:e,queryFn:t,placeholderData:UZ,staleTime:QFe,refetchInterval:XFe,refetchOnWindowFocus:!0,enabled:n&&!!t,select:r,...s});C.useEffect(()=>{c.isSuccess&&_Fe(c.data)&&a(c.data.total_items===0)},[c]);const{elapsedTime:d}=YFe({isPending:c.isFetching,interval:i==null?void 0:i.interval,onInterval:i==null?void 0:i.onInterval});return{...c,overtime:{elapsedTime:d},isEmpty:o}},eue=e=>iD({placeholderData:UZ,...e});function ZFe(e){return mu({...e})}const tue=C.createContext(void 0),JFe=({dataSource:e,children:t})=>_.jsx(tue.Provider,{value:e,children:t}),e3e=[5,10,15,30,50,75,100],EO=(e=jb,t=aW)=>{const[n,r]=C.useState({pageIndex:e,pageSize:t});return[n,i=>{const o=i;return o.pageIndex<jb&&(o.pageIndex=jb),(i.pageSize<LU||i.pageSize>Jce)&&(o.pageSize=LU),r(a=>({...a,pageIndex:i.pageIndex,pageSize:i.pageSize})),o}]},t3e=(e=jb,t=aW)=>{const[n,r]=Y$e(),s=n.get("page_index"),i=n.get("page_size"),o=C.useMemo(()=>{const u=parseInt(s??"",10);let f=isNaN(u)?e:u;return f<e&&(f=e),f},[s,e]),a=C.useMemo(()=>{const u=parseInt(i??"",10);let f=isNaN(u)?t:u;return(f<LU||f>Jce)&&(f=t),f},[i,t]),[c,d]=EO(o,a);return[c,u=>{const f=d(u);r({page_index:String(f.pageIndex),page_size:String(f.pageSize)})}]},n3e=({syncWithLocation:e=!0,initialPageIndex:t,initialPageSize:n})=>{const[r,s]=t3e(),[i,o]=EO(t,n);return e?[r,s]:[i,o]},nue=C.createContext(null),mx=({syncWithLocation:e=!0,initialGlobalFilter:t=[],initialPageIndex:n,initialPageSize:r,children:s})=>{const[i,o]=n3e({syncWithLocation:e,initialPageIndex:n,initialPageSize:r}),[a,c]=C.useState(t||[]),[d,h]=C.useState([]),u=C.useMemo(()=>!!(a&&a.length),[a]),f=C.useCallback(()=>c([]),[]);return _.jsx(nue.Provider,{value:{pagination:i,setPagination:o,sorting:d,setSorting:h,globalFilter:a,setGlobalFilter:c,resetGlobalFilter:f,isFiltered:u},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 r3e(){return{accessor:(e,t)=>typeof e=="function"?{...t,accessorFn:e}:{...t,accessorKey:e},display:e=>e,group:e=>e}}function Jh(e,t){return typeof e=="function"?e(t):e}function Ja(e,t){return n=>{t.setState(r=>({...r,[e]:Jh(n,r[e])}))}}function AO(e){return e instanceof Function}function s3e(e){return Array.isArray(e)&&e.every(t=>typeof t=="number")}function i3e(e,t){const n=[],r=s=>{s.forEach(i=>{n.push(i);const o=t(i);o!=null&&o.length&&r(o)})};return r(e),n}function kt(e,t,n){let r=[],s;return i=>{let o;n.key&&n.debug&&(o=Date.now());const a=e(i);if(!(a.length!==r.length||a.some((h,u)=>r[u]!==h)))return s;r=a;let d;if(n.key&&n.debug&&(d=Date.now()),s=t(...a),n==null||n.onChange==null||n.onChange(s),n.key&&n.debug&&n!=null&&n.debug()){const h=Math.round((Date.now()-o)*100)/100,u=Math.round((Date.now()-d)*100)/100,f=u/16,g=(v,m)=>{for(v=String(v);v.length<m;)v=" "+v;return v};console.info(`%c⏱ ${g(u,5)} /${g(h,5)} ms`,`
|
||
font-size: .6rem;
|
||
font-weight: bold;
|
||
color: hsl(${Math.max(0,Math.min(120-120*f,120))}deg 100% 31%);`,n==null?void 0:n.key)}return s}}function Dt(e,t,n,r){return{debug:()=>{var s;return(s=e==null?void 0:e.debugAll)!=null?s:e[t]},key:!1,onChange:r}}function o3e(e,t,n,r){const s=()=>{var o;return(o=i.getValue())!=null?o:e.options.renderFallbackValue},i={id:`${t.id}_${n.id}`,row:t,column:n,getValue:()=>t.getValue(r),renderValue:s,getContext:kt(()=>[e,n,t,i],(o,a,c,d)=>({table:o,column:a,row:c,cell:d,getValue:d.getValue,renderValue:d.renderValue}),Dt(e.options,"debugCells"))};return e._features.forEach(o=>{o.createCell==null||o.createCell(i,n,t,e)},{}),i}function a3e(e,t,n,r){var s,i;const a={...e._getDefaultColumnDef(),...t},c=a.accessorKey;let d=(s=(i=a.id)!=null?i:c?typeof String.prototype.replaceAll=="function"?c.replaceAll(".","_"):c.replace(/\./g,"_"):void 0)!=null?s:typeof a.header=="string"?a.header:void 0,h;if(a.accessorFn?h=a.accessorFn:c&&(c.includes(".")?h=f=>{let g=f;for(const m of c.split(".")){var v;g=(v=g)==null?void 0:v[m]}return g}:h=f=>f[a.accessorKey]),!d)throw new Error;let u={id:`${String(d)}`,accessorFn:h,parent:r,depth:n,columnDef:a,columns:[],getFlatColumns:kt(()=>[!0],()=>{var f;return[u,...(f=u.columns)==null?void 0:f.flatMap(g=>g.getFlatColumns())]},Dt(e.options,"debugColumns")),getLeafColumns:kt(()=>[e._getOrderColumnsFn()],f=>{var g;if((g=u.columns)!=null&&g.length){let v=u.columns.flatMap(m=>m.getLeafColumns());return f(v)}return[u]},Dt(e.options,"debugColumns"))};for(const f of e._features)f.createColumn==null||f.createColumn(u,e);return u}const Wi="debugHeaders";function gK(e,t,n){var r;let i={id:(r=n.id)!=null?r:t.id,column:t,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:e,header:i,column:t})};return e._features.forEach(o=>{o.createHeader==null||o.createHeader(i,e)}),i}const l3e={createTable:e=>{e.getHeaderGroups=kt(()=>[e.getAllColumns(),e.getVisibleLeafColumns(),e.getState().columnPinning.left,e.getState().columnPinning.right],(t,n,r,s)=>{var i,o;const a=(i=r==null?void 0:r.map(u=>n.find(f=>f.id===u)).filter(Boolean))!=null?i:[],c=(o=s==null?void 0:s.map(u=>n.find(f=>f.id===u)).filter(Boolean))!=null?o:[],d=n.filter(u=>!(r!=null&&r.includes(u.id))&&!(s!=null&&s.includes(u.id)));return xP(t,[...a,...d,...c],e)},Dt(e.options,Wi)),e.getCenterHeaderGroups=kt(()=>[e.getAllColumns(),e.getVisibleLeafColumns(),e.getState().columnPinning.left,e.getState().columnPinning.right],(t,n,r,s)=>(n=n.filter(i=>!(r!=null&&r.includes(i.id))&&!(s!=null&&s.includes(i.id))),xP(t,n,e,"center")),Dt(e.options,Wi)),e.getLeftHeaderGroups=kt(()=>[e.getAllColumns(),e.getVisibleLeafColumns(),e.getState().columnPinning.left],(t,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 xP(t,i,e,"left")},Dt(e.options,Wi)),e.getRightHeaderGroups=kt(()=>[e.getAllColumns(),e.getVisibleLeafColumns(),e.getState().columnPinning.right],(t,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 xP(t,i,e,"right")},Dt(e.options,Wi)),e.getFooterGroups=kt(()=>[e.getHeaderGroups()],t=>[...t].reverse(),Dt(e.options,Wi)),e.getLeftFooterGroups=kt(()=>[e.getLeftHeaderGroups()],t=>[...t].reverse(),Dt(e.options,Wi)),e.getCenterFooterGroups=kt(()=>[e.getCenterHeaderGroups()],t=>[...t].reverse(),Dt(e.options,Wi)),e.getRightFooterGroups=kt(()=>[e.getRightHeaderGroups()],t=>[...t].reverse(),Dt(e.options,Wi)),e.getFlatHeaders=kt(()=>[e.getHeaderGroups()],t=>t.map(n=>n.headers).flat(),Dt(e.options,Wi)),e.getLeftFlatHeaders=kt(()=>[e.getLeftHeaderGroups()],t=>t.map(n=>n.headers).flat(),Dt(e.options,Wi)),e.getCenterFlatHeaders=kt(()=>[e.getCenterHeaderGroups()],t=>t.map(n=>n.headers).flat(),Dt(e.options,Wi)),e.getRightFlatHeaders=kt(()=>[e.getRightHeaderGroups()],t=>t.map(n=>n.headers).flat(),Dt(e.options,Wi)),e.getCenterLeafHeaders=kt(()=>[e.getCenterFlatHeaders()],t=>t.filter(n=>{var r;return!((r=n.subHeaders)!=null&&r.length)}),Dt(e.options,Wi)),e.getLeftLeafHeaders=kt(()=>[e.getLeftFlatHeaders()],t=>t.filter(n=>{var r;return!((r=n.subHeaders)!=null&&r.length)}),Dt(e.options,Wi)),e.getRightLeafHeaders=kt(()=>[e.getRightFlatHeaders()],t=>t.filter(n=>{var r;return!((r=n.subHeaders)!=null&&r.length)}),Dt(e.options,Wi)),e.getLeafHeaders=kt(()=>[e.getLeftHeaderGroups(),e.getCenterHeaderGroups(),e.getRightHeaderGroups()],(t,n,r)=>{var s,i,o,a,c,d;return[...(s=(i=t[0])==null?void 0:i.headers)!=null?s:[],...(o=(a=n[0])==null?void 0:a.headers)!=null?o:[],...(c=(d=r[0])==null?void 0:d.headers)!=null?c:[]].map(h=>h.getLeafHeaders()).flat()},Dt(e.options,Wi))}};function xP(e,t,n,r){var s,i;let o=0;const a=function(f,g){g===void 0&&(g=1),o=Math.max(o,g),f.filter(v=>v.getIsVisible()).forEach(v=>{var m;(m=v.columns)!=null&&m.length&&a(v.columns,g+1)},0)};a(e);let c=[];const d=(f,g)=>{const v={depth:g,id:[r,`${g}`].filter(Boolean).join("_"),headers:[]},m=[];f.forEach(x=>{const y=[...m].reverse()[0],b=x.column.depth===v.depth;let w,E=!1;if(b&&x.column.parent?w=x.column.parent:(w=x.column,E=!0),y&&(y==null?void 0:y.column)===w)y.subHeaders.push(x);else{const R=gK(n,w,{id:[r,g,w.id,x==null?void 0:x.id].filter(Boolean).join("_"),isPlaceholder:E,placeholderId:E?`${m.filter(T=>T.column===w).length}`:void 0,depth:g,index:m.length});R.subHeaders.push(x),m.push(R)}v.headers.push(x),x.headerGroup=v}),c.push(v),g>0&&d(m,g-1)},h=t.map((f,g)=>gK(n,f,{depth:o,index:g}));d(h,o-1),c.reverse();const u=f=>f.filter(v=>v.column.getIsVisible()).map(v=>{let m=0,x=0,y=[0];v.subHeaders&&v.subHeaders.length?(y=[],u(v.subHeaders).forEach(w=>{let{colSpan:E,rowSpan:R}=w;m+=E,y.push(R)})):m=1;const b=Math.min(...y);return x=x+b,v.colSpan=m,v.rowSpan=x,{colSpan:m,rowSpan:x}});return u((s=(i=c[0])==null?void 0:i.headers)!=null?s:[]),c}const cW=(e,t,n,r,s,i,o)=>{let a={id:t,index:r,original:n,depth:s,parentId:o,_valuesCache:{},_uniqueValuesCache:{},getValue:c=>{if(a._valuesCache.hasOwnProperty(c))return a._valuesCache[c];const d=e.getColumn(c);if(d!=null&&d.accessorFn)return a._valuesCache[c]=d.accessorFn(a.original,r),a._valuesCache[c]},getUniqueValues:c=>{if(a._uniqueValuesCache.hasOwnProperty(c))return a._uniqueValuesCache[c];const d=e.getColumn(c);if(d!=null&&d.accessorFn)return d.columnDef.getUniqueValues?(a._uniqueValuesCache[c]=d.columnDef.getUniqueValues(a.original,r),a._uniqueValuesCache[c]):(a._uniqueValuesCache[c]=[a.getValue(c)],a._uniqueValuesCache[c])},renderValue:c=>{var d;return(d=a.getValue(c))!=null?d:e.options.renderFallbackValue},subRows:[],getLeafRows:()=>i3e(a.subRows,c=>c.subRows),getParentRow:()=>a.parentId?e.getRow(a.parentId,!0):void 0,getParentRows:()=>{let c=[],d=a;for(;;){const h=d.getParentRow();if(!h)break;c.push(h),d=h}return c.reverse()},getAllCells:kt(()=>[e.getAllLeafColumns()],c=>c.map(d=>o3e(e,a,d,d.id)),Dt(e.options,"debugRows")),_getAllCellsByColumnId:kt(()=>[a.getAllCells()],c=>c.reduce((d,h)=>(d[h.column.id]=h,d),{}),Dt(e.options,"debugRows"))};for(let c=0;c<e._features.length;c++){const d=e._features[c];d==null||d.createRow==null||d.createRow(a,e)}return a},c3e={createColumn:(e,t)=>{e._getFacetedRowModel=t.options.getFacetedRowModel&&t.options.getFacetedRowModel(t,e.id),e.getFacetedRowModel=()=>e._getFacetedRowModel?e._getFacetedRowModel():t.getPreFilteredRowModel(),e._getFacetedUniqueValues=t.options.getFacetedUniqueValues&&t.options.getFacetedUniqueValues(t,e.id),e.getFacetedUniqueValues=()=>e._getFacetedUniqueValues?e._getFacetedUniqueValues():new Map,e._getFacetedMinMaxValues=t.options.getFacetedMinMaxValues&&t.options.getFacetedMinMaxValues(t,e.id),e.getFacetedMinMaxValues=()=>{if(e._getFacetedMinMaxValues)return e._getFacetedMinMaxValues()}}},rue=(e,t,n)=>{var r,s;const i=n==null||(r=n.toString())==null?void 0:r.toLowerCase();return!!(!((s=e.getValue(t))==null||(s=s.toString())==null||(s=s.toLowerCase())==null)&&s.includes(i))};rue.autoRemove=e=>wc(e);const sue=(e,t,n)=>{var r;return!!(!((r=e.getValue(t))==null||(r=r.toString())==null)&&r.includes(n))};sue.autoRemove=e=>wc(e);const iue=(e,t,n)=>{var r;return((r=e.getValue(t))==null||(r=r.toString())==null?void 0:r.toLowerCase())===(n==null?void 0:n.toLowerCase())};iue.autoRemove=e=>wc(e);const oue=(e,t,n)=>{var r;return(r=e.getValue(t))==null?void 0:r.includes(n)};oue.autoRemove=e=>wc(e);const aue=(e,t,n)=>!n.some(r=>{var s;return!((s=e.getValue(t))!=null&&s.includes(r))});aue.autoRemove=e=>wc(e)||!(e!=null&&e.length);const lue=(e,t,n)=>n.some(r=>{var s;return(s=e.getValue(t))==null?void 0:s.includes(r)});lue.autoRemove=e=>wc(e)||!(e!=null&&e.length);const cue=(e,t,n)=>e.getValue(t)===n;cue.autoRemove=e=>wc(e);const uue=(e,t,n)=>e.getValue(t)==n;uue.autoRemove=e=>wc(e);const uW=(e,t,n)=>{let[r,s]=n;const i=e.getValue(t);return i>=r&&i<=s};uW.resolveFilterValue=e=>{let[t,n]=e,r=typeof t!="number"?parseFloat(t):t,s=typeof n!="number"?parseFloat(n):n,i=t===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]};uW.autoRemove=e=>wc(e)||wc(e[0])&&wc(e[1]);const Fd={includesString:rue,includesStringSensitive:sue,equalsString:iue,arrIncludes:oue,arrIncludesAll:aue,arrIncludesSome:lue,equals:cue,weakEquals:uue,inNumberRange:uW};function wc(e){return e==null||e===""}const u3e={getDefaultColumnDef:()=>({filterFn:"auto"}),getInitialState:e=>({columnFilters:[],...e}),getDefaultOptions:e=>({onColumnFiltersChange:Ja("columnFilters",e),filterFromLeafRows:!1,maxLeafRowFilterDepth:100}),createColumn:(e,t)=>{e.getAutoFilterFn=()=>{const n=t.getCoreRowModel().flatRows[0],r=n==null?void 0:n.getValue(e.id);return typeof r=="string"?Fd.includesString:typeof r=="number"?Fd.inNumberRange:typeof r=="boolean"||r!==null&&typeof r=="object"?Fd.equals:Array.isArray(r)?Fd.arrIncludes:Fd.weakEquals},e.getFilterFn=()=>{var n,r;return AO(e.columnDef.filterFn)?e.columnDef.filterFn:e.columnDef.filterFn==="auto"?e.getAutoFilterFn():(n=(r=t.options.filterFns)==null?void 0:r[e.columnDef.filterFn])!=null?n:Fd[e.columnDef.filterFn]},e.getCanFilter=()=>{var n,r,s;return((n=e.columnDef.enableColumnFilter)!=null?n:!0)&&((r=t.options.enableColumnFilters)!=null?r:!0)&&((s=t.options.enableFilters)!=null?s:!0)&&!!e.accessorFn},e.getIsFiltered=()=>e.getFilterIndex()>-1,e.getFilterValue=()=>{var n;return(n=t.getState().columnFilters)==null||(n=n.find(r=>r.id===e.id))==null?void 0:n.value},e.getFilterIndex=()=>{var n,r;return(n=(r=t.getState().columnFilters)==null?void 0:r.findIndex(s=>s.id===e.id))!=null?n:-1},e.setFilterValue=n=>{t.setColumnFilters(r=>{const s=e.getFilterFn(),i=r==null?void 0:r.find(h=>h.id===e.id),o=Jh(n,i?i.value:void 0);if(vK(s,o,e)){var a;return(a=r==null?void 0:r.filter(h=>h.id!==e.id))!=null?a:[]}const c={id:e.id,value:o};if(i){var d;return(d=r==null?void 0:r.map(h=>h.id===e.id?c:h))!=null?d:[]}return r!=null&&r.length?[...r,c]:[c]})}},createRow:(e,t)=>{e.columnFilters={},e.columnFiltersMeta={}},createTable:e=>{e.setColumnFilters=t=>{const n=e.getAllLeafColumns(),r=s=>{var i;return(i=Jh(t,s))==null?void 0:i.filter(o=>{const a=n.find(c=>c.id===o.id);if(a){const c=a.getFilterFn();if(vK(c,o.value,a))return!1}return!0})};e.options.onColumnFiltersChange==null||e.options.onColumnFiltersChange(r)},e.resetColumnFilters=t=>{var n,r;e.setColumnFilters(t?[]:(n=(r=e.initialState)==null?void 0:r.columnFilters)!=null?n:[])},e.getPreFilteredRowModel=()=>e.getCoreRowModel(),e.getFilteredRowModel=()=>(!e._getFilteredRowModel&&e.options.getFilteredRowModel&&(e._getFilteredRowModel=e.options.getFilteredRowModel(e)),e.options.manualFiltering||!e._getFilteredRowModel?e.getPreFilteredRowModel():e._getFilteredRowModel())}};function vK(e,t,n){return(e&&e.autoRemove?e.autoRemove(t,n):!1)||typeof t>"u"||typeof t=="string"&&!t}const d3e=(e,t,n)=>n.reduce((r,s)=>{const i=s.getValue(e);return r+(typeof i=="number"?i:0)},0),f3e=(e,t,n)=>{let r;return n.forEach(s=>{const i=s.getValue(e);i!=null&&(r>i||r===void 0&&i>=i)&&(r=i)}),r},h3e=(e,t,n)=>{let r;return n.forEach(s=>{const i=s.getValue(e);i!=null&&(r<i||r===void 0&&i>=i)&&(r=i)}),r},p3e=(e,t,n)=>{let r,s;return n.forEach(i=>{const o=i.getValue(e);o!=null&&(r===void 0?o>=o&&(r=s=o):(r>o&&(r=o),s<o&&(s=o)))}),[r,s]},m3e=(e,t)=>{let n=0,r=0;if(t.forEach(s=>{let i=s.getValue(e);i!=null&&(i=+i)>=i&&(++n,r+=i)}),n)return r/n},g3e=(e,t)=>{if(!t.length)return;const n=t.map(i=>i.getValue(e));if(!s3e(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},v3e=(e,t)=>Array.from(new Set(t.map(n=>n.getValue(e))).values()),y3e=(e,t)=>new Set(t.map(n=>n.getValue(e))).size,b3e=(e,t)=>t.length,q4={sum:d3e,min:f3e,max:h3e,extent:p3e,mean:m3e,median:g3e,unique:v3e,uniqueCount:y3e,count:b3e},x3e={getDefaultColumnDef:()=>({aggregatedCell:e=>{var t,n;return(t=(n=e.getValue())==null||n.toString==null?void 0:n.toString())!=null?t:null},aggregationFn:"auto"}),getInitialState:e=>({grouping:[],...e}),getDefaultOptions:e=>({onGroupingChange:Ja("grouping",e),groupedColumnMode:"reorder"}),createColumn:(e,t)=>{e.toggleGrouping=()=>{t.setGrouping(n=>n!=null&&n.includes(e.id)?n.filter(r=>r!==e.id):[...n??[],e.id])},e.getCanGroup=()=>{var n,r;return((n=e.columnDef.enableGrouping)!=null?n:!0)&&((r=t.options.enableGrouping)!=null?r:!0)&&(!!e.accessorFn||!!e.columnDef.getGroupingValue)},e.getIsGrouped=()=>{var n;return(n=t.getState().grouping)==null?void 0:n.includes(e.id)},e.getGroupedIndex=()=>{var n;return(n=t.getState().grouping)==null?void 0:n.indexOf(e.id)},e.getToggleGroupingHandler=()=>{const n=e.getCanGroup();return()=>{n&&e.toggleGrouping()}},e.getAutoAggregationFn=()=>{const n=t.getCoreRowModel().flatRows[0],r=n==null?void 0:n.getValue(e.id);if(typeof r=="number")return q4.sum;if(Object.prototype.toString.call(r)==="[object Date]")return q4.extent},e.getAggregationFn=()=>{var n,r;if(!e)throw new Error;return AO(e.columnDef.aggregationFn)?e.columnDef.aggregationFn:e.columnDef.aggregationFn==="auto"?e.getAutoAggregationFn():(n=(r=t.options.aggregationFns)==null?void 0:r[e.columnDef.aggregationFn])!=null?n:q4[e.columnDef.aggregationFn]}},createTable:e=>{e.setGrouping=t=>e.options.onGroupingChange==null?void 0:e.options.onGroupingChange(t),e.resetGrouping=t=>{var n,r;e.setGrouping(t?[]:(n=(r=e.initialState)==null?void 0:r.grouping)!=null?n:[])},e.getPreGroupedRowModel=()=>e.getFilteredRowModel(),e.getGroupedRowModel=()=>(!e._getGroupedRowModel&&e.options.getGroupedRowModel&&(e._getGroupedRowModel=e.options.getGroupedRowModel(e)),e.options.manualGrouping||!e._getGroupedRowModel?e.getPreGroupedRowModel():e._getGroupedRowModel())},createRow:(e,t)=>{e.getIsGrouped=()=>!!e.groupingColumnId,e.getGroupingValue=n=>{if(e._groupingValuesCache.hasOwnProperty(n))return e._groupingValuesCache[n];const r=t.getColumn(n);return r!=null&&r.columnDef.getGroupingValue?(e._groupingValuesCache[n]=r.columnDef.getGroupingValue(e.original),e._groupingValuesCache[n]):e.getValue(n)},e._groupingValuesCache={}},createCell:(e,t,n,r)=>{e.getIsGrouped=()=>t.getIsGrouped()&&t.id===n.groupingColumnId,e.getIsPlaceholder=()=>!e.getIsGrouped()&&t.getIsGrouped(),e.getIsAggregated=()=>{var s;return!e.getIsGrouped()&&!e.getIsPlaceholder()&&!!((s=n.subRows)!=null&&s.length)}}};function _3e(e,t,n){if(!(t!=null&&t.length)||!n)return e;const r=e.filter(i=>!t.includes(i.id));return n==="remove"?r:[...t.map(i=>e.find(o=>o.id===i)).filter(Boolean),...r]}const w3e={getInitialState:e=>({columnOrder:[],...e}),getDefaultOptions:e=>({onColumnOrderChange:Ja("columnOrder",e)}),createColumn:(e,t)=>{e.getIndex=kt(n=>[H1(t,n)],n=>n.findIndex(r=>r.id===e.id),Dt(t.options,"debugColumns")),e.getIsFirstColumn=n=>{var r;return((r=H1(t,n)[0])==null?void 0:r.id)===e.id},e.getIsLastColumn=n=>{var r;const s=H1(t,n);return((r=s[s.length-1])==null?void 0:r.id)===e.id}},createTable:e=>{e.setColumnOrder=t=>e.options.onColumnOrderChange==null?void 0:e.options.onColumnOrderChange(t),e.resetColumnOrder=t=>{var n;e.setColumnOrder(t?[]:(n=e.initialState.columnOrder)!=null?n:[])},e._getOrderColumnsFn=kt(()=>[e.getState().columnOrder,e.getState().grouping,e.options.groupedColumnMode],(t,n,r)=>s=>{let i=[];if(!(t!=null&&t.length))i=s;else{const o=[...t],a=[...s];for(;a.length&&o.length;){const c=o.shift(),d=a.findIndex(h=>h.id===c);d>-1&&i.push(a.splice(d,1)[0])}i=[...i,...a]}return _3e(i,n,r)},Dt(e.options,"debugTable"))}},G4=()=>({left:[],right:[]}),S3e={getInitialState:e=>({columnPinning:G4(),...e}),getDefaultOptions:e=>({onColumnPinningChange:Ja("columnPinning",e)}),createColumn:(e,t)=>{e.pin=n=>{const r=e.getLeafColumns().map(s=>s.id).filter(Boolean);t.setColumnPinning(s=>{var i,o;if(n==="right"){var a,c;return{left:((a=s==null?void 0:s.left)!=null?a:[]).filter(u=>!(r!=null&&r.includes(u))),right:[...((c=s==null?void 0:s.right)!=null?c:[]).filter(u=>!(r!=null&&r.includes(u))),...r]}}if(n==="left"){var d,h;return{left:[...((d=s==null?void 0:s.left)!=null?d:[]).filter(u=>!(r!=null&&r.includes(u))),...r],right:((h=s==null?void 0:s.right)!=null?h:[]).filter(u=>!(r!=null&&r.includes(u)))}}return{left:((i=s==null?void 0:s.left)!=null?i:[]).filter(u=>!(r!=null&&r.includes(u))),right:((o=s==null?void 0:s.right)!=null?o:[]).filter(u=>!(r!=null&&r.includes(u)))}})},e.getCanPin=()=>e.getLeafColumns().some(r=>{var s,i,o;return((s=r.columnDef.enablePinning)!=null?s:!0)&&((i=(o=t.options.enableColumnPinning)!=null?o:t.options.enablePinning)!=null?i:!0)}),e.getIsPinned=()=>{const n=e.getLeafColumns().map(a=>a.id),{left:r,right:s}=t.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},e.getPinnedIndex=()=>{var n,r;const s=e.getIsPinned();return s?(n=(r=t.getState().columnPinning)==null||(r=r[s])==null?void 0:r.indexOf(e.id))!=null?n:-1:0}},createRow:(e,t)=>{e.getCenterVisibleCells=kt(()=>[e._getAllVisibleCells(),t.getState().columnPinning.left,t.getState().columnPinning.right],(n,r,s)=>{const i=[...r??[],...s??[]];return n.filter(o=>!i.includes(o.column.id))},Dt(t.options,"debugRows")),e.getLeftVisibleCells=kt(()=>[e._getAllVisibleCells(),t.getState().columnPinning.left],(n,r)=>(r??[]).map(i=>n.find(o=>o.column.id===i)).filter(Boolean).map(i=>({...i,position:"left"})),Dt(t.options,"debugRows")),e.getRightVisibleCells=kt(()=>[e._getAllVisibleCells(),t.getState().columnPinning.right],(n,r)=>(r??[]).map(i=>n.find(o=>o.column.id===i)).filter(Boolean).map(i=>({...i,position:"right"})),Dt(t.options,"debugRows"))},createTable:e=>{e.setColumnPinning=t=>e.options.onColumnPinningChange==null?void 0:e.options.onColumnPinningChange(t),e.resetColumnPinning=t=>{var n,r;return e.setColumnPinning(t?G4():(n=(r=e.initialState)==null?void 0:r.columnPinning)!=null?n:G4())},e.getIsSomeColumnsPinned=t=>{var n;const r=e.getState().columnPinning;if(!t){var s,i;return!!((s=r.left)!=null&&s.length||(i=r.right)!=null&&i.length)}return!!((n=r[t])!=null&&n.length)},e.getLeftLeafColumns=kt(()=>[e.getAllLeafColumns(),e.getState().columnPinning.left],(t,n)=>(n??[]).map(r=>t.find(s=>s.id===r)).filter(Boolean),Dt(e.options,"debugColumns")),e.getRightLeafColumns=kt(()=>[e.getAllLeafColumns(),e.getState().columnPinning.right],(t,n)=>(n??[]).map(r=>t.find(s=>s.id===r)).filter(Boolean),Dt(e.options,"debugColumns")),e.getCenterLeafColumns=kt(()=>[e.getAllLeafColumns(),e.getState().columnPinning.left,e.getState().columnPinning.right],(t,n,r)=>{const s=[...n??[],...r??[]];return t.filter(i=>!s.includes(i.id))},Dt(e.options,"debugColumns"))}},_P={size:150,minSize:20,maxSize:Number.MAX_SAFE_INTEGER},K4=()=>({startOffset:null,startSize:null,deltaOffset:null,deltaPercentage:null,isResizingColumn:!1,columnSizingStart:[]}),C3e={getDefaultColumnDef:()=>_P,getInitialState:e=>({columnSizing:{},columnSizingInfo:K4(),...e}),getDefaultOptions:e=>({columnResizeMode:"onEnd",columnResizeDirection:"ltr",onColumnSizingChange:Ja("columnSizing",e),onColumnSizingInfoChange:Ja("columnSizingInfo",e)}),createColumn:(e,t)=>{e.getSize=()=>{var n,r,s;const i=t.getState().columnSizing[e.id];return Math.min(Math.max((n=e.columnDef.minSize)!=null?n:_P.minSize,(r=i??e.columnDef.size)!=null?r:_P.size),(s=e.columnDef.maxSize)!=null?s:_P.maxSize)},e.getStart=kt(n=>[n,H1(t,n),t.getState().columnSizing],(n,r)=>r.slice(0,e.getIndex(n)).reduce((s,i)=>s+i.getSize(),0),Dt(t.options,"debugColumns")),e.getAfter=kt(n=>[n,H1(t,n),t.getState().columnSizing],(n,r)=>r.slice(e.getIndex(n)+1).reduce((s,i)=>s+i.getSize(),0),Dt(t.options,"debugColumns")),e.resetSize=()=>{t.setColumnSizing(n=>{let{[e.id]:r,...s}=n;return s})},e.getCanResize=()=>{var n,r;return((n=e.columnDef.enableResizing)!=null?n:!0)&&((r=t.options.enableColumnResizing)!=null?r:!0)},e.getIsResizing=()=>t.getState().columnSizingInfo.isResizingColumn===e.id},createHeader:(e,t)=>{e.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(e),n},e.getStart=()=>{if(e.index>0){const n=e.headerGroup.headers[e.index-1];return n.getStart()+n.getSize()}return 0},e.getResizeHandler=n=>{const r=t.getColumn(e.column.id),s=r==null?void 0:r.getCanResize();return i=>{if(!r||!s||(i.persist==null||i.persist(),Y4(i)&&i.touches&&i.touches.length>1))return;const o=e.getSize(),a=e?e.getLeafHeaders().map(y=>[y.column.id,y.column.getSize()]):[[r.id,r.getSize()]],c=Y4(i)?Math.round(i.touches[0].clientX):i.clientX,d={},h=(y,b)=>{typeof b=="number"&&(t.setColumnSizingInfo(w=>{var E,R;const T=t.options.columnResizeDirection==="rtl"?-1:1,N=(b-((E=w==null?void 0:w.startOffset)!=null?E:0))*T,A=Math.max(N/((R=w==null?void 0:w.startSize)!=null?R:0),-.999999);return w.columnSizingStart.forEach(D=>{let[O,I]=D;d[O]=Math.round(Math.max(I+I*A,0)*100)/100}),{...w,deltaOffset:N,deltaPercentage:A}}),(t.options.columnResizeMode==="onChange"||y==="end")&&t.setColumnSizing(w=>({...w,...d})))},u=y=>h("move",y),f=y=>{h("end",y),t.setColumnSizingInfo(b=>({...b,isResizingColumn:!1,startOffset:null,startSize:null,deltaOffset:null,deltaPercentage:null,columnSizingStart:[]}))},g=n||typeof document<"u"?document:null,v={moveHandler:y=>u(y.clientX),upHandler:y=>{g==null||g.removeEventListener("mousemove",v.moveHandler),g==null||g.removeEventListener("mouseup",v.upHandler),f(y.clientX)}},m={moveHandler:y=>(y.cancelable&&(y.preventDefault(),y.stopPropagation()),u(y.touches[0].clientX),!1),upHandler:y=>{var b;g==null||g.removeEventListener("touchmove",m.moveHandler),g==null||g.removeEventListener("touchend",m.upHandler),y.cancelable&&(y.preventDefault(),y.stopPropagation()),f((b=y.touches[0])==null?void 0:b.clientX)}},x=E3e()?{passive:!1}:!1;Y4(i)?(g==null||g.addEventListener("touchmove",m.moveHandler,x),g==null||g.addEventListener("touchend",m.upHandler,x)):(g==null||g.addEventListener("mousemove",v.moveHandler,x),g==null||g.addEventListener("mouseup",v.upHandler,x)),t.setColumnSizingInfo(y=>({...y,startOffset:c,startSize:o,deltaOffset:0,deltaPercentage:0,columnSizingStart:a,isResizingColumn:r.id}))}}},createTable:e=>{e.setColumnSizing=t=>e.options.onColumnSizingChange==null?void 0:e.options.onColumnSizingChange(t),e.setColumnSizingInfo=t=>e.options.onColumnSizingInfoChange==null?void 0:e.options.onColumnSizingInfoChange(t),e.resetColumnSizing=t=>{var n;e.setColumnSizing(t?{}:(n=e.initialState.columnSizing)!=null?n:{})},e.resetHeaderSizeInfo=t=>{var n;e.setColumnSizingInfo(t?K4():(n=e.initialState.columnSizingInfo)!=null?n:K4())},e.getTotalSize=()=>{var t,n;return(t=(n=e.getHeaderGroups()[0])==null?void 0:n.headers.reduce((r,s)=>r+s.getSize(),0))!=null?t:0},e.getLeftTotalSize=()=>{var t,n;return(t=(n=e.getLeftHeaderGroups()[0])==null?void 0:n.headers.reduce((r,s)=>r+s.getSize(),0))!=null?t:0},e.getCenterTotalSize=()=>{var t,n;return(t=(n=e.getCenterHeaderGroups()[0])==null?void 0:n.headers.reduce((r,s)=>r+s.getSize(),0))!=null?t:0},e.getRightTotalSize=()=>{var t,n;return(t=(n=e.getRightHeaderGroups()[0])==null?void 0:n.headers.reduce((r,s)=>r+s.getSize(),0))!=null?t:0}}};let wP=null;function E3e(){if(typeof wP=="boolean")return wP;let e=!1;try{const t={get passive(){return e=!0,!1}},n=()=>{};window.addEventListener("test",n,t),window.removeEventListener("test",n)}catch{e=!1}return wP=e,wP}function Y4(e){return e.type==="touchstart"}const A3e={getInitialState:e=>({columnVisibility:{},...e}),getDefaultOptions:e=>({onColumnVisibilityChange:Ja("columnVisibility",e)}),createColumn:(e,t)=>{e.toggleVisibility=n=>{e.getCanHide()&&t.setColumnVisibility(r=>({...r,[e.id]:n??!e.getIsVisible()}))},e.getIsVisible=()=>{var n,r;const s=e.columns;return(n=s.length?s.some(i=>i.getIsVisible()):(r=t.getState().columnVisibility)==null?void 0:r[e.id])!=null?n:!0},e.getCanHide=()=>{var n,r;return((n=e.columnDef.enableHiding)!=null?n:!0)&&((r=t.options.enableHiding)!=null?r:!0)},e.getToggleVisibilityHandler=()=>n=>{e.toggleVisibility==null||e.toggleVisibility(n.target.checked)}},createRow:(e,t)=>{e._getAllVisibleCells=kt(()=>[e.getAllCells(),t.getState().columnVisibility],n=>n.filter(r=>r.column.getIsVisible()),Dt(t.options,"debugRows")),e.getVisibleCells=kt(()=>[e.getLeftVisibleCells(),e.getCenterVisibleCells(),e.getRightVisibleCells()],(n,r,s)=>[...n,...r,...s],Dt(t.options,"debugRows"))},createTable:e=>{const t=(n,r)=>kt(()=>[r(),r().filter(s=>s.getIsVisible()).map(s=>s.id).join("_")],s=>s.filter(i=>i.getIsVisible==null?void 0:i.getIsVisible()),Dt(e.options,"debugColumns"));e.getVisibleFlatColumns=t("getVisibleFlatColumns",()=>e.getAllFlatColumns()),e.getVisibleLeafColumns=t("getVisibleLeafColumns",()=>e.getAllLeafColumns()),e.getLeftVisibleLeafColumns=t("getLeftVisibleLeafColumns",()=>e.getLeftLeafColumns()),e.getRightVisibleLeafColumns=t("getRightVisibleLeafColumns",()=>e.getRightLeafColumns()),e.getCenterVisibleLeafColumns=t("getCenterVisibleLeafColumns",()=>e.getCenterLeafColumns()),e.setColumnVisibility=n=>e.options.onColumnVisibilityChange==null?void 0:e.options.onColumnVisibilityChange(n),e.resetColumnVisibility=n=>{var r;e.setColumnVisibility(n?{}:(r=e.initialState.columnVisibility)!=null?r:{})},e.toggleAllColumnsVisible=n=>{var r;n=(r=n)!=null?r:!e.getIsAllColumnsVisible(),e.setColumnVisibility(e.getAllLeafColumns().reduce((s,i)=>({...s,[i.id]:n||!(i.getCanHide!=null&&i.getCanHide())}),{}))},e.getIsAllColumnsVisible=()=>!e.getAllLeafColumns().some(n=>!(n.getIsVisible!=null&&n.getIsVisible())),e.getIsSomeColumnsVisible=()=>e.getAllLeafColumns().some(n=>n.getIsVisible==null?void 0:n.getIsVisible()),e.getToggleAllColumnsVisibilityHandler=()=>n=>{var r;e.toggleAllColumnsVisible((r=n.target)==null?void 0:r.checked)}}};function H1(e,t){return t?t==="center"?e.getCenterVisibleLeafColumns():t==="left"?e.getLeftVisibleLeafColumns():e.getRightVisibleLeafColumns():e.getVisibleLeafColumns()}const R3e={createTable:e=>{e._getGlobalFacetedRowModel=e.options.getFacetedRowModel&&e.options.getFacetedRowModel(e,"__global__"),e.getGlobalFacetedRowModel=()=>e.options.manualFiltering||!e._getGlobalFacetedRowModel?e.getPreFilteredRowModel():e._getGlobalFacetedRowModel(),e._getGlobalFacetedUniqueValues=e.options.getFacetedUniqueValues&&e.options.getFacetedUniqueValues(e,"__global__"),e.getGlobalFacetedUniqueValues=()=>e._getGlobalFacetedUniqueValues?e._getGlobalFacetedUniqueValues():new Map,e._getGlobalFacetedMinMaxValues=e.options.getFacetedMinMaxValues&&e.options.getFacetedMinMaxValues(e,"__global__"),e.getGlobalFacetedMinMaxValues=()=>{if(e._getGlobalFacetedMinMaxValues)return e._getGlobalFacetedMinMaxValues()}}},P3e={getInitialState:e=>({globalFilter:void 0,...e}),getDefaultOptions:e=>({onGlobalFilterChange:Ja("globalFilter",e),globalFilterFn:"auto",getColumnCanGlobalFilter:t=>{var n;const r=(n=e.getCoreRowModel().flatRows[0])==null||(n=n._getAllCellsByColumnId()[t.id])==null?void 0:n.getValue();return typeof r=="string"||typeof r=="number"}}),createColumn:(e,t)=>{e.getCanGlobalFilter=()=>{var n,r,s,i;return((n=e.columnDef.enableGlobalFilter)!=null?n:!0)&&((r=t.options.enableGlobalFilter)!=null?r:!0)&&((s=t.options.enableFilters)!=null?s:!0)&&((i=t.options.getColumnCanGlobalFilter==null?void 0:t.options.getColumnCanGlobalFilter(e))!=null?i:!0)&&!!e.accessorFn}},createTable:e=>{e.getGlobalAutoFilterFn=()=>Fd.includesString,e.getGlobalFilterFn=()=>{var t,n;const{globalFilterFn:r}=e.options;return AO(r)?r:r==="auto"?e.getGlobalAutoFilterFn():(t=(n=e.options.filterFns)==null?void 0:n[r])!=null?t:Fd[r]},e.setGlobalFilter=t=>{e.options.onGlobalFilterChange==null||e.options.onGlobalFilterChange(t)},e.resetGlobalFilter=t=>{e.setGlobalFilter(t?void 0:e.initialState.globalFilter)}}},N3e={getInitialState:e=>({expanded:{},...e}),getDefaultOptions:e=>({onExpandedChange:Ja("expanded",e),paginateExpandedRows:!0}),createTable:e=>{let t=!1,n=!1;e._autoResetExpanded=()=>{var r,s;if(!t){e._queue(()=>{t=!0});return}if((r=(s=e.options.autoResetAll)!=null?s:e.options.autoResetExpanded)!=null?r:!e.options.manualExpanding){if(n)return;n=!0,e._queue(()=>{e.resetExpanded(),n=!1})}},e.setExpanded=r=>e.options.onExpandedChange==null?void 0:e.options.onExpandedChange(r),e.toggleAllRowsExpanded=r=>{r??!e.getIsAllRowsExpanded()?e.setExpanded(!0):e.setExpanded({})},e.resetExpanded=r=>{var s,i;e.setExpanded(r?{}:(s=(i=e.initialState)==null?void 0:i.expanded)!=null?s:{})},e.getCanSomeRowsExpand=()=>e.getPrePaginationRowModel().flatRows.some(r=>r.getCanExpand()),e.getToggleAllRowsExpandedHandler=()=>r=>{r.persist==null||r.persist(),e.toggleAllRowsExpanded()},e.getIsSomeRowsExpanded=()=>{const r=e.getState().expanded;return r===!0||Object.values(r).some(Boolean)},e.getIsAllRowsExpanded=()=>{const r=e.getState().expanded;return typeof r=="boolean"?r===!0:!(!Object.keys(r).length||e.getRowModel().flatRows.some(s=>!s.getIsExpanded()))},e.getExpandedDepth=()=>{let r=0;return(e.getState().expanded===!0?Object.keys(e.getRowModel().rowsById):Object.keys(e.getState().expanded)).forEach(i=>{const o=i.split(".");r=Math.max(r,o.length)}),r},e.getPreExpandedRowModel=()=>e.getSortedRowModel(),e.getExpandedRowModel=()=>(!e._getExpandedRowModel&&e.options.getExpandedRowModel&&(e._getExpandedRowModel=e.options.getExpandedRowModel(e)),e.options.manualExpanding||!e._getExpandedRowModel?e.getPreExpandedRowModel():e._getExpandedRowModel())},createRow:(e,t)=>{e.toggleExpanded=n=>{t.setExpanded(r=>{var s;const i=r===!0?!0:!!(r!=null&&r[e.id]);let o={};if(r===!0?Object.keys(t.getRowModel().rowsById).forEach(a=>{o[a]=!0}):o=r,n=(s=n)!=null?s:!i,!i&&n)return{...o,[e.id]:!0};if(i&&!n){const{[e.id]:a,...c}=o;return c}return r})},e.getIsExpanded=()=>{var n;const r=t.getState().expanded;return!!((n=t.options.getIsRowExpanded==null?void 0:t.options.getIsRowExpanded(e))!=null?n:r===!0||r!=null&&r[e.id])},e.getCanExpand=()=>{var n,r,s;return(n=t.options.getRowCanExpand==null?void 0:t.options.getRowCanExpand(e))!=null?n:((r=t.options.enableExpanding)!=null?r:!0)&&!!((s=e.subRows)!=null&&s.length)},e.getIsAllParentsExpanded=()=>{let n=!0,r=e;for(;n&&r.parentId;)r=t.getRow(r.parentId,!0),n=r.getIsExpanded();return n},e.getToggleExpandedHandler=()=>{const n=e.getCanExpand();return()=>{n&&e.toggleExpanded()}}}},jU=0,$U=10,X4=()=>({pageIndex:jU,pageSize:$U}),T3e={getInitialState:e=>({...e,pagination:{...X4(),...e==null?void 0:e.pagination}}),getDefaultOptions:e=>({onPaginationChange:Ja("pagination",e)}),createTable:e=>{let t=!1,n=!1;e._autoResetPageIndex=()=>{var r,s;if(!t){e._queue(()=>{t=!0});return}if((r=(s=e.options.autoResetAll)!=null?s:e.options.autoResetPageIndex)!=null?r:!e.options.manualPagination){if(n)return;n=!0,e._queue(()=>{e.resetPageIndex(),n=!1})}},e.setPagination=r=>{const s=i=>Jh(r,i);return e.options.onPaginationChange==null?void 0:e.options.onPaginationChange(s)},e.resetPagination=r=>{var s;e.setPagination(r?X4():(s=e.initialState.pagination)!=null?s:X4())},e.setPageIndex=r=>{e.setPagination(s=>{let i=Jh(r,s.pageIndex);const o=typeof e.options.pageCount>"u"||e.options.pageCount===-1?Number.MAX_SAFE_INTEGER:e.options.pageCount-1;return i=Math.max(0,Math.min(i,o)),{...s,pageIndex:i}})},e.resetPageIndex=r=>{var s,i;e.setPageIndex(r?jU:(s=(i=e.initialState)==null||(i=i.pagination)==null?void 0:i.pageIndex)!=null?s:jU)},e.resetPageSize=r=>{var s,i;e.setPageSize(r?$U:(s=(i=e.initialState)==null||(i=i.pagination)==null?void 0:i.pageSize)!=null?s:$U)},e.setPageSize=r=>{e.setPagination(s=>{const i=Math.max(1,Jh(r,s.pageSize)),o=s.pageSize*s.pageIndex,a=Math.floor(o/i);return{...s,pageIndex:a,pageSize:i}})},e.setPageCount=r=>e.setPagination(s=>{var i;let o=Jh(r,(i=e.options.pageCount)!=null?i:-1);return typeof o=="number"&&(o=Math.max(-1,o)),{...s,pageCount:o}}),e.getPageOptions=kt(()=>[e.getPageCount()],r=>{let s=[];return r&&r>0&&(s=[...new Array(r)].fill(null).map((i,o)=>o)),s},Dt(e.options,"debugTable")),e.getCanPreviousPage=()=>e.getState().pagination.pageIndex>0,e.getCanNextPage=()=>{const{pageIndex:r}=e.getState().pagination,s=e.getPageCount();return s===-1?!0:s===0?!1:r<s-1},e.previousPage=()=>e.setPageIndex(r=>r-1),e.nextPage=()=>e.setPageIndex(r=>r+1),e.firstPage=()=>e.setPageIndex(0),e.lastPage=()=>e.setPageIndex(e.getPageCount()-1),e.getPrePaginationRowModel=()=>e.getExpandedRowModel(),e.getPaginationRowModel=()=>(!e._getPaginationRowModel&&e.options.getPaginationRowModel&&(e._getPaginationRowModel=e.options.getPaginationRowModel(e)),e.options.manualPagination||!e._getPaginationRowModel?e.getPrePaginationRowModel():e._getPaginationRowModel()),e.getPageCount=()=>{var r;return(r=e.options.pageCount)!=null?r:Math.ceil(e.getRowCount()/e.getState().pagination.pageSize)},e.getRowCount=()=>{var r;return(r=e.options.rowCount)!=null?r:e.getPrePaginationRowModel().rows.length}}},Q4=()=>({top:[],bottom:[]}),k3e={getInitialState:e=>({rowPinning:Q4(),...e}),getDefaultOptions:e=>({onRowPinningChange:Ja("rowPinning",e)}),createRow:(e,t)=>{e.pin=(n,r,s)=>{const i=r?e.getLeafRows().map(c=>{let{id:d}=c;return d}):[],o=s?e.getParentRows().map(c=>{let{id:d}=c;return d}):[],a=new Set([...o,e.id,...i]);t.setRowPinning(c=>{var d,h;if(n==="bottom"){var u,f;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))),...Array.from(a)]}}if(n==="top"){var g,v;return{top:[...((g=c==null?void 0:c.top)!=null?g:[]).filter(m=>!(a!=null&&a.has(m))),...Array.from(a)],bottom:((v=c==null?void 0:c.bottom)!=null?v:[]).filter(m=>!(a!=null&&a.has(m)))}}return{top:((d=c==null?void 0:c.top)!=null?d:[]).filter(m=>!(a!=null&&a.has(m))),bottom:((h=c==null?void 0:c.bottom)!=null?h:[]).filter(m=>!(a!=null&&a.has(m)))}})},e.getCanPin=()=>{var n;const{enableRowPinning:r,enablePinning:s}=t.options;return typeof r=="function"?r(e):(n=r??s)!=null?n:!0},e.getIsPinned=()=>{const n=[e.id],{top:r,bottom:s}=t.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},e.getPinnedIndex=()=>{var n,r;const s=e.getIsPinned();if(!s)return-1;const i=(n=s==="top"?t.getTopRows():t.getBottomRows())==null?void 0:n.map(o=>{let{id:a}=o;return a});return(r=i==null?void 0:i.indexOf(e.id))!=null?r:-1}},createTable:e=>{e.setRowPinning=t=>e.options.onRowPinningChange==null?void 0:e.options.onRowPinningChange(t),e.resetRowPinning=t=>{var n,r;return e.setRowPinning(t?Q4():(n=(r=e.initialState)==null?void 0:r.rowPinning)!=null?n:Q4())},e.getIsSomeRowsPinned=t=>{var n;const r=e.getState().rowPinning;if(!t){var s,i;return!!((s=r.top)!=null&&s.length||(i=r.bottom)!=null&&i.length)}return!!((n=r[t])!=null&&n.length)},e._getPinnedRows=(t,n,r)=>{var s;return((s=e.options.keepPinnedRows)==null||s?(n??[]).map(o=>{const a=e.getRow(o,!0);return a.getIsAllParentsExpanded()?a:null}):(n??[]).map(o=>t.find(a=>a.id===o))).filter(Boolean).map(o=>({...o,position:r}))},e.getTopRows=kt(()=>[e.getRowModel().rows,e.getState().rowPinning.top],(t,n)=>e._getPinnedRows(t,n,"top"),Dt(e.options,"debugRows")),e.getBottomRows=kt(()=>[e.getRowModel().rows,e.getState().rowPinning.bottom],(t,n)=>e._getPinnedRows(t,n,"bottom"),Dt(e.options,"debugRows")),e.getCenterRows=kt(()=>[e.getRowModel().rows,e.getState().rowPinning.top,e.getState().rowPinning.bottom],(t,n,r)=>{const s=new Set([...n??[],...r??[]]);return t.filter(i=>!s.has(i.id))},Dt(e.options,"debugRows"))}},D3e={getInitialState:e=>({rowSelection:{},...e}),getDefaultOptions:e=>({onRowSelectionChange:Ja("rowSelection",e),enableRowSelection:!0,enableMultiRowSelection:!0,enableSubRowSelection:!0}),createTable:e=>{e.setRowSelection=t=>e.options.onRowSelectionChange==null?void 0:e.options.onRowSelectionChange(t),e.resetRowSelection=t=>{var n;return e.setRowSelection(t?{}:(n=e.initialState.rowSelection)!=null?n:{})},e.toggleAllRowsSelected=t=>{e.setRowSelection(n=>{t=typeof t<"u"?t:!e.getIsAllRowsSelected();const r={...n},s=e.getPreGroupedRowModel().flatRows;return t?s.forEach(i=>{i.getCanSelect()&&(r[i.id]=!0)}):s.forEach(i=>{delete r[i.id]}),r})},e.toggleAllPageRowsSelected=t=>e.setRowSelection(n=>{const r=typeof t<"u"?t:!e.getIsAllPageRowsSelected(),s={...n};return e.getRowModel().rows.forEach(i=>{FU(s,i.id,r,!0,e)}),s}),e.getPreSelectedRowModel=()=>e.getCoreRowModel(),e.getSelectedRowModel=kt(()=>[e.getState().rowSelection,e.getCoreRowModel()],(t,n)=>Object.keys(t).length?Z4(e,n):{rows:[],flatRows:[],rowsById:{}},Dt(e.options,"debugTable")),e.getFilteredSelectedRowModel=kt(()=>[e.getState().rowSelection,e.getFilteredRowModel()],(t,n)=>Object.keys(t).length?Z4(e,n):{rows:[],flatRows:[],rowsById:{}},Dt(e.options,"debugTable")),e.getGroupedSelectedRowModel=kt(()=>[e.getState().rowSelection,e.getSortedRowModel()],(t,n)=>Object.keys(t).length?Z4(e,n):{rows:[],flatRows:[],rowsById:{}},Dt(e.options,"debugTable")),e.getIsAllRowsSelected=()=>{const t=e.getFilteredRowModel().flatRows,{rowSelection:n}=e.getState();let r=!!(t.length&&Object.keys(n).length);return r&&t.some(s=>s.getCanSelect()&&!n[s.id])&&(r=!1),r},e.getIsAllPageRowsSelected=()=>{const t=e.getPaginationRowModel().flatRows.filter(s=>s.getCanSelect()),{rowSelection:n}=e.getState();let r=!!t.length;return r&&t.some(s=>!n[s.id])&&(r=!1),r},e.getIsSomeRowsSelected=()=>{var t;const n=Object.keys((t=e.getState().rowSelection)!=null?t:{}).length;return n>0&&n<e.getFilteredRowModel().flatRows.length},e.getIsSomePageRowsSelected=()=>{const t=e.getPaginationRowModel().flatRows;return e.getIsAllPageRowsSelected()?!1:t.filter(n=>n.getCanSelect()).some(n=>n.getIsSelected()||n.getIsSomeSelected())},e.getToggleAllRowsSelectedHandler=()=>t=>{e.toggleAllRowsSelected(t.target.checked)},e.getToggleAllPageRowsSelectedHandler=()=>t=>{e.toggleAllPageRowsSelected(t.target.checked)}},createRow:(e,t)=>{e.toggleSelected=(n,r)=>{const s=e.getIsSelected();t.setRowSelection(i=>{var o;if(n=typeof n<"u"?n:!s,e.getCanSelect()&&s===n)return i;const a={...i};return FU(a,e.id,n,(o=r==null?void 0:r.selectChildren)!=null?o:!0,t),a})},e.getIsSelected=()=>{const{rowSelection:n}=t.getState();return dW(e,n)},e.getIsSomeSelected=()=>{const{rowSelection:n}=t.getState();return zU(e,n)==="some"},e.getIsAllSubRowsSelected=()=>{const{rowSelection:n}=t.getState();return zU(e,n)==="all"},e.getCanSelect=()=>{var n;return typeof t.options.enableRowSelection=="function"?t.options.enableRowSelection(e):(n=t.options.enableRowSelection)!=null?n:!0},e.getCanSelectSubRows=()=>{var n;return typeof t.options.enableSubRowSelection=="function"?t.options.enableSubRowSelection(e):(n=t.options.enableSubRowSelection)!=null?n:!0},e.getCanMultiSelect=()=>{var n;return typeof t.options.enableMultiRowSelection=="function"?t.options.enableMultiRowSelection(e):(n=t.options.enableMultiRowSelection)!=null?n:!0},e.getToggleSelectedHandler=()=>{const n=e.getCanSelect();return r=>{var s;n&&e.toggleSelected((s=r.target)==null?void 0:s.checked)}}}},FU=(e,t,n,r,s)=>{var i;const o=s.getRow(t,!0);n?(o.getCanMultiSelect()||Object.keys(e).forEach(a=>delete e[a]),o.getCanSelect()&&(e[t]=!0)):delete e[t],r&&(i=o.subRows)!=null&&i.length&&o.getCanSelectSubRows()&&o.subRows.forEach(a=>FU(e,a.id,n,r,s))};function Z4(e,t){const n=e.getState().rowSelection,r=[],s={},i=function(o,a){return o.map(c=>{var d;const h=dW(c,n);if(h&&(r.push(c),s[c.id]=c),(d=c.subRows)!=null&&d.length&&(c={...c,subRows:i(c.subRows)}),h)return c}).filter(Boolean)};return{rows:i(t.rows),flatRows:r,rowsById:s}}function dW(e,t){var n;return(n=t[e.id])!=null?n:!1}function zU(e,t,n){var r;if(!((r=e.subRows)!=null&&r.length))return!1;let s=!0,i=!1;return e.subRows.forEach(o=>{if(!(i&&!s)&&(o.getCanSelect()&&(dW(o,t)?i=!0:s=!1),o.subRows&&o.subRows.length)){const a=zU(o,t);a==="all"?i=!0:(a==="some"&&(i=!0),s=!1)}}),s?"all":i?"some":!1}const BU=/([0-9]+)/gm,O3e=(e,t,n)=>due(_p(e.getValue(n)).toLowerCase(),_p(t.getValue(n)).toLowerCase()),M3e=(e,t,n)=>due(_p(e.getValue(n)),_p(t.getValue(n))),I3e=(e,t,n)=>fW(_p(e.getValue(n)).toLowerCase(),_p(t.getValue(n)).toLowerCase()),L3e=(e,t,n)=>fW(_p(e.getValue(n)),_p(t.getValue(n))),j3e=(e,t,n)=>{const r=e.getValue(n),s=t.getValue(n);return r>s?1:r<s?-1:0},$3e=(e,t,n)=>fW(e.getValue(n),t.getValue(n));function fW(e,t){return e===t?0:e>t?1:-1}function _p(e){return typeof e=="number"?isNaN(e)||e===1/0||e===-1/0?"":String(e):typeof e=="string"?e:""}function due(e,t){const n=e.split(BU).filter(Boolean),r=t.split(BU).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 KS={alphanumeric:O3e,alphanumericCaseSensitive:M3e,text:I3e,textCaseSensitive:L3e,datetime:j3e,basic:$3e},F3e={getInitialState:e=>({sorting:[],...e}),getDefaultColumnDef:()=>({sortingFn:"auto",sortUndefined:1}),getDefaultOptions:e=>({onSortingChange:Ja("sorting",e),isMultiSortEvent:t=>t.shiftKey}),createColumn:(e,t)=>{e.getAutoSortingFn=()=>{const n=t.getFilteredRowModel().flatRows.slice(10);let r=!1;for(const s of n){const i=s==null?void 0:s.getValue(e.id);if(Object.prototype.toString.call(i)==="[object Date]")return KS.datetime;if(typeof i=="string"&&(r=!0,i.split(BU).length>1))return KS.alphanumeric}return r?KS.text:KS.basic},e.getAutoSortDir=()=>{const n=t.getFilteredRowModel().flatRows[0];return typeof(n==null?void 0:n.getValue(e.id))=="string"?"asc":"desc"},e.getSortingFn=()=>{var n,r;if(!e)throw new Error;return AO(e.columnDef.sortingFn)?e.columnDef.sortingFn:e.columnDef.sortingFn==="auto"?e.getAutoSortingFn():(n=(r=t.options.sortingFns)==null?void 0:r[e.columnDef.sortingFn])!=null?n:KS[e.columnDef.sortingFn]},e.toggleSorting=(n,r)=>{const s=e.getNextSortingOrder(),i=typeof n<"u"&&n!==null;t.setSorting(o=>{const a=o==null?void 0:o.find(g=>g.id===e.id),c=o==null?void 0:o.findIndex(g=>g.id===e.id);let d=[],h,u=i?n:s==="desc";if(o!=null&&o.length&&e.getCanMultiSort()&&r?a?h="toggle":h="add":o!=null&&o.length&&c!==o.length-1?h="replace":a?h="toggle":h="replace",h==="toggle"&&(i||s||(h="remove")),h==="add"){var f;d=[...o,{id:e.id,desc:u}],d.splice(0,d.length-((f=t.options.maxMultiSortColCount)!=null?f:Number.MAX_SAFE_INTEGER))}else h==="toggle"?d=o.map(g=>g.id===e.id?{...g,desc:u}:g):h==="remove"?d=o.filter(g=>g.id!==e.id):d=[{id:e.id,desc:u}];return d})},e.getFirstSortDir=()=>{var n,r;return((n=(r=e.columnDef.sortDescFirst)!=null?r:t.options.sortDescFirst)!=null?n:e.getAutoSortDir()==="desc")?"desc":"asc"},e.getNextSortingOrder=n=>{var r,s;const i=e.getFirstSortDir(),o=e.getIsSorted();return o?o!==i&&((r=t.options.enableSortingRemoval)==null||r)&&(!(n&&(s=t.options.enableMultiRemove)!=null)||s)?!1:o==="desc"?"asc":"desc":i},e.getCanSort=()=>{var n,r;return((n=e.columnDef.enableSorting)!=null?n:!0)&&((r=t.options.enableSorting)!=null?r:!0)&&!!e.accessorFn},e.getCanMultiSort=()=>{var n,r;return(n=(r=e.columnDef.enableMultiSort)!=null?r:t.options.enableMultiSort)!=null?n:!!e.accessorFn},e.getIsSorted=()=>{var n;const r=(n=t.getState().sorting)==null?void 0:n.find(s=>s.id===e.id);return r?r.desc?"desc":"asc":!1},e.getSortIndex=()=>{var n,r;return(n=(r=t.getState().sorting)==null?void 0:r.findIndex(s=>s.id===e.id))!=null?n:-1},e.clearSorting=()=>{t.setSorting(n=>n!=null&&n.length?n.filter(r=>r.id!==e.id):[])},e.getToggleSortingHandler=()=>{const n=e.getCanSort();return r=>{n&&(r.persist==null||r.persist(),e.toggleSorting==null||e.toggleSorting(void 0,e.getCanMultiSort()?t.options.isMultiSortEvent==null?void 0:t.options.isMultiSortEvent(r):!1))}}},createTable:e=>{e.setSorting=t=>e.options.onSortingChange==null?void 0:e.options.onSortingChange(t),e.resetSorting=t=>{var n,r;e.setSorting(t?[]:(n=(r=e.initialState)==null?void 0:r.sorting)!=null?n:[])},e.getPreSortedRowModel=()=>e.getGroupedRowModel(),e.getSortedRowModel=()=>(!e._getSortedRowModel&&e.options.getSortedRowModel&&(e._getSortedRowModel=e.options.getSortedRowModel(e)),e.options.manualSorting||!e._getSortedRowModel?e.getPreSortedRowModel():e._getSortedRowModel())}},z3e=[l3e,A3e,w3e,S3e,c3e,u3e,R3e,P3e,F3e,x3e,N3e,T3e,k3e,D3e,C3e];function B3e(e){var t,n;const r=[...z3e,...(t=e._features)!=null?t:[]];let s={_features:r};const i=s._features.reduce((f,g)=>Object.assign(f,g.getDefaultOptions==null?void 0:g.getDefaultOptions(s)),{}),o=f=>s.options.mergeOptions?s.options.mergeOptions(i,f):{...i,...f};let c={...{},...(n=e.initialState)!=null?n:{}};s._features.forEach(f=>{var g;c=(g=f.getInitialState==null?void 0:f.getInitialState(c))!=null?g:c});const d=[];let h=!1;const u={_features:r,options:{...i,...e},initialState:c,_queue:f=>{d.push(f),h||(h=!0,Promise.resolve().then(()=>{for(;d.length;)d.shift()();h=!1}).catch(g=>setTimeout(()=>{throw g})))},reset:()=>{s.setState(s.initialState)},setOptions:f=>{const g=Jh(f,s.options);s.options=o(g)},getState:()=>s.options.state,setState:f=>{s.options.onStateChange==null||s.options.onStateChange(f)},_getRowId:(f,g,v)=>{var m;return(m=s.options.getRowId==null?void 0:s.options.getRowId(f,g,v))!=null?m:`${v?[v.id,g].join("."):g}`},getCoreRowModel:()=>(s._getCoreRowModel||(s._getCoreRowModel=s.options.getCoreRowModel(s)),s._getCoreRowModel()),getRowModel:()=>s.getPaginationRowModel(),getRow:(f,g)=>{let v=(g?s.getPrePaginationRowModel():s.getRowModel()).rowsById[f];if(!v&&(v=s.getCoreRowModel().rowsById[f],!v))throw new Error;return v},_getDefaultColumnDef:kt(()=>[s.options.defaultColumn],f=>{var g;return f=(g=f)!=null?g:{},{header:v=>{const m=v.header.column.columnDef;return m.accessorKey?m.accessorKey:m.accessorFn?m.id:null},cell:v=>{var m,x;return(m=(x=v.renderValue())==null||x.toString==null?void 0:x.toString())!=null?m:null},...s._features.reduce((v,m)=>Object.assign(v,m.getDefaultColumnDef==null?void 0:m.getDefaultColumnDef()),{}),...f}},Dt(e,"debugColumns")),_getColumnDefs:()=>s.options.columns,getAllColumns:kt(()=>[s._getColumnDefs()],f=>{const g=function(v,m,x){return x===void 0&&(x=0),v.map(y=>{const b=a3e(s,y,x,m),w=y;return b.columns=w.columns?g(w.columns,b,x+1):[],b})};return g(f)},Dt(e,"debugColumns")),getAllFlatColumns:kt(()=>[s.getAllColumns()],f=>f.flatMap(g=>g.getFlatColumns()),Dt(e,"debugColumns")),_getAllFlatColumnsById:kt(()=>[s.getAllFlatColumns()],f=>f.reduce((g,v)=>(g[v.id]=v,g),{}),Dt(e,"debugColumns")),getAllLeafColumns:kt(()=>[s.getAllColumns(),s._getOrderColumnsFn()],(f,g)=>{let v=f.flatMap(m=>m.getLeafColumns());return g(v)},Dt(e,"debugColumns")),getColumn:f=>s._getAllFlatColumnsById()[f]};Object.assign(s,u);for(let f=0;f<s._features.length;f++){const g=s._features[f];g==null||g.createTable==null||g.createTable(s)}return s}function fue(){return e=>kt(()=>[e.options.data],t=>{const n={rows:[],flatRows:[],rowsById:{}},r=function(s,i,o){i===void 0&&(i=0);const a=[];for(let d=0;d<s.length;d++){const h=cW(e,e._getRowId(s[d],d,o),s[d],d,i,void 0,o==null?void 0:o.id);if(n.flatRows.push(h),n.rowsById[h.id]=h,a.push(h),e.options.getSubRows){var c;h.originalSubRows=e.options.getSubRows(s[d],d),(c=h.originalSubRows)!=null&&c.length&&(h.subRows=r(h.originalSubRows,i+1,h))}}return a};return n.rows=r(t),n},Dt(e.options,"debugTable","getRowModel",()=>e._autoResetPageIndex()))}function hue(e,t,n){return n.options.filterFromLeafRows?U3e(e,t,n):V3e(e,t,n)}function U3e(e,t,n){var r;const s=[],i={},o=(r=n.options.maxLeafRowFilterDepth)!=null?r:100,a=function(c,d){d===void 0&&(d=0);const h=[];for(let f=0;f<c.length;f++){var u;let g=c[f];const v=cW(n,g.id,g.original,g.index,g.depth,void 0,g.parentId);if(v.columnFilters=g.columnFilters,(u=g.subRows)!=null&&u.length&&d<o){if(v.subRows=a(g.subRows,d+1),g=v,t(g)&&!v.subRows.length){h.push(g),i[g.id]=g,s.push(g);continue}if(t(g)||v.subRows.length){h.push(g),i[g.id]=g,s.push(g);continue}}else g=v,t(g)&&(h.push(g),i[g.id]=g,s.push(g))}return h};return{rows:a(e),flatRows:s,rowsById:i}}function V3e(e,t,n){var r;const s=[],i={},o=(r=n.options.maxLeafRowFilterDepth)!=null?r:100,a=function(c,d){d===void 0&&(d=0);const h=[];for(let f=0;f<c.length;f++){let g=c[f];if(t(g)){var u;if((u=g.subRows)!=null&&u.length&&d<o){const m=cW(n,g.id,g.original,g.index,g.depth,void 0,g.parentId);m.subRows=a(g.subRows,d+1),g=m}h.push(g),s.push(g),i[g.id]=g}}return h};return{rows:a(e),flatRows:s,rowsById:i}}function H3e(){return(e,t)=>kt(()=>[e.getPreFilteredRowModel(),e.getState().columnFilters,e.getState().globalFilter,e.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!==t),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 hue(n.rows,o,e)},Dt(e.options,"debugTable"))}function W3e(){return(e,t)=>kt(()=>{var n;return[(n=e.getColumn(t))==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(t);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},Dt(e.options,"debugTable"))}function q3e(){return e=>kt(()=>[e.getPreFilteredRowModel(),e.getState().columnFilters,e.getState().globalFilter],(t,n,r)=>{if(!t.rows.length||!(n!=null&&n.length)&&!r){for(let f=0;f<t.flatRows.length;f++)t.flatRows[f].columnFilters={},t.flatRows[f].columnFiltersMeta={};return t}const s=[],i=[];(n??[]).forEach(f=>{var g;const v=e.getColumn(f.id);if(!v)return;const m=v.getFilterFn();m&&s.push({id:f.id,filterFn:m,resolvedValue:(g=m.resolveFilterValue==null?void 0:m.resolveFilterValue(f.value))!=null?g:f.value})});const o=(n??[]).map(f=>f.id),a=e.getGlobalFilterFn(),c=e.getAllLeafColumns().filter(f=>f.getCanGlobalFilter());r&&a&&c.length&&(o.push("__global__"),c.forEach(f=>{var g;i.push({id:f.id,filterFn:a,resolvedValue:(g=a.resolveFilterValue==null?void 0:a.resolveFilterValue(r))!=null?g:r})}));let d,h;for(let f=0;f<t.flatRows.length;f++){const g=t.flatRows[f];if(g.columnFilters={},s.length)for(let v=0;v<s.length;v++){d=s[v];const m=d.id;g.columnFilters[m]=d.filterFn(g,m,d.resolvedValue,x=>{g.columnFiltersMeta[m]=x})}if(i.length){for(let v=0;v<i.length;v++){h=i[v];const m=h.id;if(h.filterFn(g,m,h.resolvedValue,x=>{g.columnFiltersMeta[m]=x})){g.columnFilters.__global__=!0;break}}g.columnFilters.__global__!==!0&&(g.columnFilters.__global__=!1)}}const u=f=>{for(let g=0;g<o.length;g++)if(f.columnFilters[o[g]]===!1)return!1;return!0};return hue(t.rows,u,e)},Dt(e.options,"debugTable","getFilteredRowModel",()=>e._autoResetPageIndex()))}function G3e(){return e=>kt(()=>[e.getState().sorting,e.getPreSortedRowModel()],(t,n)=>{if(!n.rows.length||!(t!=null&&t.length))return n;const r=e.getState().sorting,s=[],i=r.filter(c=>{var d;return(d=e.getColumn(c.id))==null?void 0:d.getCanSort()}),o={};i.forEach(c=>{const d=e.getColumn(c.id);d&&(o[c.id]={sortUndefined:d.columnDef.sortUndefined,invertSorting:d.columnDef.invertSorting,sortingFn:d.getSortingFn()})});const a=c=>{const d=c.map(h=>({...h}));return d.sort((h,u)=>{for(let g=0;g<i.length;g+=1){var f;const v=i[g],m=o[v.id],x=m.sortUndefined,y=(f=v==null?void 0:v.desc)!=null?f:!1;let b=0;if(x){const w=h.getValue(v.id),E=u.getValue(v.id),R=w===void 0,T=E===void 0;if(R||T){if(x==="first")return R?-1:1;if(x==="last")return R?1:-1;b=R&&T?0:R?x:-x}}if(b===0&&(b=m.sortingFn(h,u,v.id)),b!==0)return y&&(b*=-1),m.invertSorting&&(b*=-1),b}return h.index-u.index}),d.forEach(h=>{var u;s.push(h),(u=h.subRows)!=null&&u.length&&(h.subRows=a(h.subRows))}),d};return{rows:a(n.rows),flatRows:s,rowsById:n.rowsById}},Dt(e.options,"debugTable","getSortedRowModel",()=>e._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 XT(e,t){return e?K3e(e)?C.createElement(e,t):e:null}function K3e(e){return Y3e(e)||typeof e=="function"||X3e(e)}function Y3e(e){return typeof e=="function"&&(()=>{const t=Object.getPrototypeOf(e);return t.prototype&&t.prototype.isReactComponent})()}function X3e(e){return typeof e=="object"&&typeof e.$$typeof=="symbol"&&["react.memo","react.forward_ref"].includes(e.$$typeof.description)}function pue(e){const t={state:{},onStateChange:()=>{},renderFallbackValue:null,...e},[n]=C.useState(()=>({current:B3e(t)})),[r,s]=C.useState(()=>n.current.initialState);return n.current.setOptions(i=>({...i,...e,state:{...r,...e.state},onStateChange:o=>{s(o),e.onStateChange==null||e.onStateChange(o)}})),n.current}const Yv=fe.forwardRef(({className:e,...t},n)=>_.jsx("div",{ref:n,className:ge("flex items-center gap-2",e),...t}));Yv.displayName="ButtonGroup";const mue=({label:e="Cancelar",...t})=>_.jsx(at,{type:"button",variant:"secondary",...t,children:e});mue.displayName="CancelButton";const Q3e=({buttonText:e,title:t="",content:n,className:r=""})=>_.jsx("div",{className:`flex items-baseline justify-center mr-4 font-medium ${r}`,children:_.jsxs(Fx,{children:[_.jsx(E6,{asChild:!0,children:_.jsxs(at,{variant:"link",className:"inline-flex items-center font-medium group",children:[_.jsx("span",{className:"underline-offset-4 group-hover:underline",children:e}),_.jsx(_J,{className:"w-4 h-4 ml-1 text-muted-foreground"})]})}),_.jsxs(cy,{className:"sm:max-w-[425px]",children:[_.jsx(uy,{children:_.jsx(fy,{children:t})}),_.jsxs(sO,{className:"grid gap-4 py-2",children:[n,_.jsx(dy,{children:_.jsx(bT,{asChild:!0,children:_.jsx(at,{type:"button",children:ue("common.close")})})})]})]})]})}),Z3e=Io("",{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"}}),gue=fe.forwardRef(({className:e,label:t,size:n,icon:r,children:s,...i},o)=>{const a=!!r;return _.jsxs(at,{ref:o,size:n,className:ge(a?"gap-1":"",e),...i,children:[a&&_.jsx(r,{className:ge(Z3e({size:n}))}),_.jsx(_.Fragment,{children:t||s})]})});gue.displayName="CustomButton";const RO=({label:e="Enviar",...t})=>_.jsx(gue,{type:"submit",label:e,variant:"default",...t});RO.displayName="SubmitButton";function J3e(e){let r=0;for(let h=0;h<e.length;h++)r=e.charCodeAt(h)+((r<<5)-r);let s="#";for(let h=0;h<3;h++){const u=r>>h*8&255;s+=("00"+u.toString(16)).substr(-2)}const i=parseInt(s.substr(1,2),16),o=parseInt(s.substr(3,2),16),a=parseInt(s.substr(5,2),16),c=`#${(i*.7|0).toString(16).padStart(2,"0")}${(o*.7|0).toString(16).padStart(2,"0")}${(a*.7|0).toString(16).padStart(2,"0")}`,d=`#${Math.min(255,Math.floor(i+(255-i)*.7)).toString(16).padStart(2,"0")}${Math.min(255,Math.floor(o+(255-o)*.7)).toString(16).padStart(2,"0")}${Math.min(255,Math.floor(a+(255-a)*.7)).toString(16).padStart(2,"0")}`;return[c,d]}const vue=({label:e,className:t})=>{const[n,r]=J3e(e);return _.jsx(_D,{className:t,style:t?{}:{backgroundColor:r,color:n},children:e})},e4e=Io("p-6",{variants:{variant:{full:"w-full",boxed:"container max-w-3xl lg:max-w-5xl mx-auto"}},defaultVariants:{variant:"full"}}),yue=({className:e,as:t="article",variant:n,...r})=>_.jsx(t,{className:ge(e4e({variant:n,className:e})),...r});yue.displayName="Container";const hW=()=>{const e=io();return _.jsxs(at,{variant:"outline",size:"icon",className:"h-7 w-7",onClick:()=>e(-1),children:[_.jsx(lD,{className:"w-4 h-4"}),_.jsx("span",{className:"sr-only",children:ue("common.back")})]})};function bue({table:e,header:t,className:n}){return t.column.getCanSort()?_.jsx("div",{className:ge("flex items-center space-x-2",n),children:_.jsxs(rR,{children:[_.jsx(sR,{asChild:!0,children:_.jsxs(at,{"aria-label":t.column.getIsSorted()==="desc"?ue("common.sort_desc_description"):t.column.getIsSorted()==="asc"?ue("common.sort_asc_description"):ue("sort_none_description"),size:"sm",variant:"ghost",className:"-ml-3 h-8 data-[state=open]:bg-accent font-bold text-muted-foreground",children:[XT(t.column.columnDef.header,t.getContext()),t.column.getIsSorted()==="desc"?_.jsx(PG,{className:"w-4 h-4 ml-2","aria-hidden":"true"}):t.column.getIsSorted()==="asc"?_.jsx(NG,{className:"w-4 h-4 ml-2","aria-hidden":"true"}):_.jsx(Kye,{className:"w-4 h-4 ml-2 text-muted-foreground/30","aria-hidden":"true"})]})}),_.jsxs(Vx,{align:"start",children:[t.column.getCanSort()&&_.jsxs(_.Fragment,{children:[_.jsxs(up,{onClick:()=>t.column.toggleSorting(!1),"aria-label":ue("common.sort_asc"),children:[_.jsx(NG,{className:"mr-2 h-3.5 w-3.5 text-muted-foreground/70","aria-hidden":"true"}),ue("common.sort_asc")]}),_.jsxs(up,{onClick:()=>t.column.toggleSorting(!0),"aria-label":ue("common.sort_desc"),children:[_.jsx(PG,{className:"mr-2 h-3.5 w-3.5 text-muted-foreground/70","aria-hidden":"true"}),ue("common.sort_desc")]})]}),t.column.getCanSort()&&t.column.getCanHide()&&_.jsx(ax,{}),t.column.getCanHide()&&_.jsxs(up,{onClick:()=>t.column.toggleVisibility(!1),"aria-label":ue("Hide"),children:[_.jsx(SJ,{className:"mr-2 h-3.5 w-3.5 text-muted-foreground/70","aria-hidden":"true"}),ue("Hide")]})]})]})}):_.jsxs(_.Fragment,{children:[_.jsx("div",{className:ge("data-[state=open]:bg-accent tracking-wide text-ellipsis",n),children:t.isPlaceholder?null:XT(t.column.columnDef.header,t.getContext())}),!1]})}function t4e({table:e,className:t,enablePageSizeSelector:n=!0,visible:r="auto"}){const s=C.useMemo(()=>r===!0,[r]),i=C.useMemo(()=>r==="auto",[r]);return!s||i&&e.getPageCount()<1?null:_.jsxs("div",{className:t,children:[_.jsx("div",{className:"flex-1 text-base text-muted-foreground",children:e.getSelectedRowModel().rows.length>0&&_.jsx(_.Fragment,{children:ue("common.rows_selected_of_total",{count:e.getFilteredSelectedRowModel().rows.length,total:e.getFilteredRowModel().rows.length})})}),_.jsxs("div",{className:"flex justify-between space-x-6 lg:space-x-8",children:[n&&_.jsxs("div",{className:"flex items-center space-x-2 grow",children:[_.jsx("p",{className:"text-sm font-medium",children:ue("common.rows_per_page")}),_.jsxs(U8,{value:`${e.getState().pagination.pageSize}`,onValueChange:o=>{e.setPageSize(Number(o))},children:[_.jsx(lO,{className:"h-8 w-[70px]",children:_.jsx(V8,{placeholder:e.getState().pagination.pageSize})}),_.jsx(cO,{side:"top",children:e3e.map(o=>_.jsx(Ib,{value:`${o}`,children:o},o))})]})]}),_.jsxs("div",{className:ge("flex space-x-2 flex-1",n?"justify-end":"justify-between"),children:[_.jsx("div",{className:"flex w-[150px] items-center justify-start",children:_.jsx("p",{className:"text-sm font-medium ",children:ue("common.num_page_of_total",{count:e.getState().pagination.pageIndex+1,total:e.getPageCount()})})}),_.jsxs("div",{className:"flex items-center space-x-2",children:[_.jsxs(at,{type:"button",variant:"outline",className:"hidden w-8 h-8 p-0 lg:flex",onClick:()=>e.setPageIndex(jb),disabled:!e.getCanPreviousPage(),children:[_.jsx("span",{className:"sr-only",children:ue("common.go_to_first_page")}),_.jsx(Xye,{className:"w-4 h-4"})]}),_.jsxs(at,{type:"button",variant:"outline",className:"w-8 h-8 p-0",onClick:()=>e.previousPage(),disabled:!e.getCanPreviousPage(),children:[_.jsx("span",{className:"sr-only",children:ue("common.go_to_prev_page")}),_.jsx(lD,{className:"w-4 h-4"})]}),_.jsxs(at,{type:"button",variant:"outline",className:"w-8 h-8 p-0",onClick:()=>e.nextPage(),disabled:!e.getCanNextPage(),children:[_.jsx("span",{className:"sr-only",children:ue("common.go_to_next_page")}),_.jsx(Tx,{className:"w-4 h-4"})]}),_.jsxs(at,{type:"button",variant:"outline",className:"hidden w-8 h-8 p-0 lg:flex",onClick:()=>e.setPageIndex(e.getPageCount()+1),disabled:!e.getCanNextPage(),children:[_.jsx("span",{className:"sr-only",children:ue("common.go_to_last_page")}),_.jsx(Qye,{className:"w-4 h-4"})]})]})]})]})]})}function PO({table:e,title:t,description:n,caption:r,paginationOptions:s,headerOptions:i={visible:!0},children:o,className:a,contentClassName:c,footerClassName:d,rowClassName:h,cellClassName:u,onRowClick:f,activeRowIndex:g}){var m;const v=i==null?void 0:i.visible;return _.jsxs(bs,{className:a,children:[(t||n)&&_.jsxs(Go,{className:"pb-0",children:[_.jsx(ui,{children:t}),_.jsx(Di,{children:n})]}),_.jsxs(xs,{className:ge("pt-6",c),children:[o&&_.jsxs(_.Fragment,{children:[_.jsx("div",{className:"flex space-x-2",children:o}),_.jsx(Ef,{className:"my-4"})]}),_.jsxs(dO,{children:[typeof r<"u"&&_.jsx(mle,{children:r}),v&&e.getHeaderGroups().length&&_.jsx(fO,{children:e.getHeaderGroups().map(x=>_.jsx(dp,{className:h,children:x.headers.map(y=>_.jsx(pO,{colSpan:y.colSpan,style:{width:y.getSize()===Number.MAX_SAFE_INTEGER?"auto":y.getSize()},children:_.jsx(bue,{table:e,header:y})},y.id))},x.id))}),_.jsx(hO,{children:(m=e.getRowModel().rows)!=null&&m.length?e.getRowModel().rows.map(x=>_.jsx(dp,{onClick:()=>{f&&f(x)},tabIndex:0,"data-state":x.getIsSelected()&&"selected",className:ge(x.getIsSelected()||g===x.index?"bg-accent cursor-pointer hover:bg-accent":"cursor-pointer",h),children:x.getVisibleCells().map(y=>_.jsx(TC,{className:u,style:{width:y.column.getSize()===Number.MAX_SAFE_INTEGER?"auto":y.column.getSize()},children:XT(y.column.columnDef.cell,y.getContext())},y.id))},x.id)):_.jsx(dp,{className:h,children:_.jsx(TC,{className:ge("h-24 text-center",u),colSpan:e.getAllColumns.length,children:"No hay datos para mostrar"})})})]})]}),_.jsx(fl,{className:d,children:_.jsx(t4e,{className:"flex-1",table:e,...s})})]})}function n4e({actions:e,rowContext:t}){return _.jsxs(rR,{children:[_.jsx(sR,{asChild:!0,children:_.jsxs(at,{size:"icon",variant:"outline",className:"w-8 h-8",children:[_.jsx(nbe,{className:"h-3.5 w-3.5"}),_.jsx("span",{className:"sr-only",children:ue("common.open_menu")})]})}),_.jsxs(Vx,{align:"end",children:[_.jsxs(XD,{children:[ue("common.actions")," "]}),e&&e(t).map((n,r)=>n.label==="-"?_.jsx(ax,{},r):_.jsxs(up,{onClick:s=>n.onClick?n.onClick(t,s):null,children:[n.icon&&_.jsx(_.Fragment,{children:n.icon}),n.label,n.shortcut&&_.jsx(_se,{children:n.shortcut})]},r))]})]})}function r4e(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return C.useMemo(()=>r=>{t.forEach(s=>s(r))},t)}const NO=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u";function Qx(e){const t=Object.prototype.toString.call(e);return t==="[object Window]"||t==="[object global]"}function pW(e){return"nodeType"in e}function jo(e){var t,n;return e?Qx(e)?e:pW(e)&&(t=(n=e.ownerDocument)==null?void 0:n.defaultView)!=null?t:window:window}function mW(e){const{Document:t}=jo(e);return e instanceof t}function pR(e){return Qx(e)?!1:e instanceof jo(e).HTMLElement}function xue(e){return e instanceof jo(e).SVGElement}function Zx(e){return e?Qx(e)?e.document:pW(e)?mW(e)?e:pR(e)||xue(e)?e.ownerDocument:document:document:document}const Nc=NO?C.useLayoutEffect:C.useEffect;function TO(e){const t=C.useRef(e);return Nc(()=>{t.current=e}),C.useCallback(function(){for(var n=arguments.length,r=new Array(n),s=0;s<n;s++)r[s]=arguments[s];return t.current==null?void 0:t.current(...r)},[])}function s4e(){const e=C.useRef(null),t=C.useCallback((r,s)=>{e.current=setInterval(r,s)},[]),n=C.useCallback(()=>{e.current!==null&&(clearInterval(e.current),e.current=null)},[]);return[t,n]}function LC(e,t){t===void 0&&(t=[e]);const n=C.useRef(e);return Nc(()=>{n.current!==e&&(n.current=e)},t),n}function mR(e,t){const n=C.useRef();return C.useMemo(()=>{const r=e(n.current);return n.current=r,r},[...t])}function QT(e){const t=TO(e),n=C.useRef(null),r=C.useCallback(s=>{s!==n.current&&(t==null||t(s,n.current)),n.current=s},[]);return[n,r]}function ZT(e){const t=C.useRef();return C.useEffect(()=>{t.current=e},[e]),t.current}let J4={};function gR(e,t){return C.useMemo(()=>{if(t)return t;const n=J4[e]==null?0:J4[e]+1;return J4[e]=n,e+"-"+n},[e,t])}function _ue(e){return function(t){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,d]of a){const h=i[c];h!=null&&(i[c]=h+e*d)}return i},{...t})}}const $b=_ue(1),JT=_ue(-1);function i4e(e){return"clientX"in e&&"clientY"in e}function kO(e){if(!e)return!1;const{KeyboardEvent:t}=jo(e.target);return t&&e instanceof t}function o4e(e){if(!e)return!1;const{TouchEvent:t}=jo(e.target);return t&&e instanceof t}function ek(e){if(o4e(e)){if(e.touches&&e.touches.length){const{clientX:t,clientY:n}=e.touches[0];return{x:t,y:n}}else if(e.changedTouches&&e.changedTouches.length){const{clientX:t,clientY:n}=e.changedTouches[0];return{x:t,y:n}}}return i4e(e)?{x:e.clientX,y:e.clientY}:null}const ku=Object.freeze({Translate:{toString(e){if(!e)return;const{x:t,y:n}=e;return"translate3d("+(t?Math.round(t):0)+"px, "+(n?Math.round(n):0)+"px, 0)"}},Scale:{toString(e){if(!e)return;const{scaleX:t,scaleY:n}=e;return"scaleX("+t+") scaleY("+n+")"}},Transform:{toString(e){if(e)return[ku.Translate.toString(e),ku.Scale.toString(e)].join(" ")}},Transition:{toString(e){let{property:t,duration:n,easing:r}=e;return t+" "+n+"ms "+r}}}),yK="a,frame,iframe,input:not([type=hidden]):not(:disabled),select:not(:disabled),textarea:not(:disabled),button:not(:disabled),*[tabindex]";function a4e(e){return e.matches(yK)?e:e.querySelector(yK)}const l4e={display:"none"};function c4e(e){let{id:t,value:n}=e;return fe.createElement("div",{id:t,style:l4e},n)}function u4e(e){let{id:t,announcement:n,ariaLiveType:r="assertive"}=e;const s={position:"fixed",top:0,left:0,width:1,height:1,margin:-1,border:0,padding:0,overflow:"hidden",clip:"rect(0 0 0 0)",clipPath:"inset(100%)",whiteSpace:"nowrap"};return fe.createElement("div",{id:t,style:s,role:"status","aria-live":r,"aria-atomic":!0},n)}function d4e(){const[e,t]=C.useState("");return{announce:C.useCallback(r=>{r!=null&&t(r)},[]),announcement:e}}const wue=C.createContext(null);function f4e(e){const t=C.useContext(wue);C.useEffect(()=>{if(!t)throw new Error("useDndMonitor must be used within a children of <DndContext>");return t(e)},[e,t])}function h4e(){const[e]=C.useState(()=>new Set),t=C.useCallback(r=>(e.add(r),()=>e.delete(r)),[e]);return[C.useCallback(r=>{let{type:s,event:i}=r;e.forEach(o=>{var a;return(a=o[s])==null?void 0:a.call(o,i)})},[e]),t]}const p4e={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.
|
||
`},m4e={onDragStart(e){let{active:t}=e;return"Picked up draggable item "+t.id+"."},onDragOver(e){let{active:t,over:n}=e;return n?"Draggable item "+t.id+" was moved over droppable area "+n.id+".":"Draggable item "+t.id+" is no longer over a droppable area."},onDragEnd(e){let{active:t,over:n}=e;return n?"Draggable item "+t.id+" was dropped over droppable area "+n.id:"Draggable item "+t.id+" was dropped."},onDragCancel(e){let{active:t}=e;return"Dragging was cancelled. Draggable item "+t.id+" was dropped."}};function g4e(e){let{announcements:t=m4e,container:n,hiddenTextDescribedById:r,screenReaderInstructions:s=p4e}=e;const{announce:i,announcement:o}=d4e(),a=gR("DndLiveRegion"),[c,d]=C.useState(!1);if(C.useEffect(()=>{d(!0)},[]),f4e(C.useMemo(()=>({onDragStart(u){let{active:f}=u;i(t.onDragStart({active:f}))},onDragMove(u){let{active:f,over:g}=u;t.onDragMove&&i(t.onDragMove({active:f,over:g}))},onDragOver(u){let{active:f,over:g}=u;i(t.onDragOver({active:f,over:g}))},onDragEnd(u){let{active:f,over:g}=u;i(t.onDragEnd({active:f,over:g}))},onDragCancel(u){let{active:f,over:g}=u;i(t.onDragCancel({active:f,over:g}))}}),[i,t])),!c)return null;const h=fe.createElement(fe.Fragment,null,fe.createElement(c4e,{id:r,value:s.draggable}),fe.createElement(u4e,{id:a,announcement:o}));return n?Li.createPortal(h,n):h}var ei;(function(e){e.DragStart="dragStart",e.DragMove="dragMove",e.DragEnd="dragEnd",e.DragCancel="dragCancel",e.DragOver="dragOver",e.RegisterDroppable="registerDroppable",e.SetDroppableDisabled="setDroppableDisabled",e.UnregisterDroppable="unregisterDroppable"})(ei||(ei={}));function tk(){}function SP(e,t){return C.useMemo(()=>({sensor:e,options:t??{}}),[e,t])}function v4e(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return C.useMemo(()=>[...t].filter(r=>r!=null),[...t])}const Tc=Object.freeze({x:0,y:0});function y4e(e,t){return Math.sqrt(Math.pow(e.x-t.x,2)+Math.pow(e.y-t.y,2))}function b4e(e,t){const n=ek(e);if(!n)return"0 0";const r={x:(n.x-t.left)/t.width*100,y:(n.y-t.top)/t.height*100};return r.x+"% "+r.y+"%"}function x4e(e,t){let{data:{value:n}}=e,{data:{value:r}}=t;return n-r}function _4e(e,t){let{data:{value:n}}=e,{data:{value:r}}=t;return r-n}function w4e(e,t){if(!e||e.length===0)return null;const[n]=e;return n[t]}function bK(e,t,n){return t===void 0&&(t=e.left),n===void 0&&(n=e.top),{x:t+e.width*.5,y:n+e.height*.5}}const S4e=e=>{let{collisionRect:t,droppableRects:n,droppableContainers:r}=e;const s=bK(t,t.left,t.top),i=[];for(const o of r){const{id:a}=o,c=n.get(a);if(c){const d=y4e(bK(c),s);i.push({id:a,data:{droppableContainer:o,value:d}})}}return i.sort(x4e)};function C4e(e,t){const n=Math.max(t.top,e.top),r=Math.max(t.left,e.left),s=Math.min(t.left+t.width,e.left+e.width),i=Math.min(t.top+t.height,e.top+e.height),o=s-r,a=i-n;if(r<s&&n<i){const c=t.width*t.height,d=e.width*e.height,h=o*a,u=h/(c+d-h);return Number(u.toFixed(4))}return 0}const E4e=e=>{let{collisionRect:t,droppableRects:n,droppableContainers:r}=e;const s=[];for(const i of r){const{id:o}=i,a=n.get(o);if(a){const c=C4e(a,t);c>0&&s.push({id:o,data:{droppableContainer:i,value:c}})}}return s.sort(_4e)};function A4e(e,t,n){return{...e,scaleX:t&&n?t.width/n.width:1,scaleY:t&&n?t.height/n.height:1}}function Sue(e,t){return e&&t?{x:e.left-t.left,y:e.top-t.top}:Tc}function R4e(e){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+e*a.y,bottom:o.bottom+e*a.y,left:o.left+e*a.x,right:o.right+e*a.x}),{...n})}}const P4e=R4e(1);function Cue(e){if(e.startsWith("matrix3d(")){const t=e.slice(9,-1).split(/, /);return{x:+t[12],y:+t[13],scaleX:+t[0],scaleY:+t[5]}}else if(e.startsWith("matrix(")){const t=e.slice(7,-1).split(/, /);return{x:+t[4],y:+t[5],scaleX:+t[0],scaleY:+t[3]}}return null}function N4e(e,t,n){const r=Cue(t);if(!r)return e;const{scaleX:s,scaleY:i,x:o,y:a}=r,c=e.left-o-(1-s)*parseFloat(n),d=e.top-a-(1-i)*parseFloat(n.slice(n.indexOf(" ")+1)),h=s?e.width/s:e.width,u=i?e.height/i:e.height;return{width:h,height:u,top:d,right:c+h,bottom:d+u,left:c}}const T4e={ignoreTransform:!1};function Jx(e,t){t===void 0&&(t=T4e);let n=e.getBoundingClientRect();if(t.ignoreTransform){const{transform:d,transformOrigin:h}=jo(e).getComputedStyle(e);d&&(n=N4e(n,d,h))}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 xK(e){return Jx(e,{ignoreTransform:!0})}function k4e(e){const t=e.innerWidth,n=e.innerHeight;return{top:0,left:0,right:t,bottom:n,width:t,height:n}}function D4e(e,t){return t===void 0&&(t=jo(e).getComputedStyle(e)),t.position==="fixed"}function O4e(e,t){t===void 0&&(t=jo(e).getComputedStyle(e));const n=/(auto|scroll|overlay)/;return["overflow","overflowX","overflowY"].some(s=>{const i=t[s];return typeof i=="string"?n.test(i):!1})}function gW(e,t){const n=[];function r(s){if(t!=null&&n.length>=t||!s)return n;if(mW(s)&&s.scrollingElement!=null&&!n.includes(s.scrollingElement))return n.push(s.scrollingElement),n;if(!pR(s)||xue(s)||n.includes(s))return n;const i=jo(e).getComputedStyle(s);return s!==e&&O4e(s,i)&&n.push(s),D4e(s,i)?n:r(s.parentNode)}return e?r(e):n}function Eue(e){const[t]=gW(e,1);return t??null}function ez(e){return!NO||!e?null:Qx(e)?e:pW(e)?mW(e)||e===Zx(e).scrollingElement?window:pR(e)?e:null:null}function Aue(e){return Qx(e)?e.scrollX:e.scrollLeft}function Rue(e){return Qx(e)?e.scrollY:e.scrollTop}function UU(e){return{x:Aue(e),y:Rue(e)}}var ci;(function(e){e[e.Forward=1]="Forward",e[e.Backward=-1]="Backward"})(ci||(ci={}));function Pue(e){return!NO||!e?!1:e===document.scrollingElement}function Nue(e){const t={x:0,y:0},n=Pue(e)?{height:window.innerHeight,width:window.innerWidth}:{height:e.clientHeight,width:e.clientWidth},r={x:e.scrollWidth-n.width,y:e.scrollHeight-n.height},s=e.scrollTop<=t.y,i=e.scrollLeft<=t.x,o=e.scrollTop>=r.y,a=e.scrollLeft>=r.x;return{isTop:s,isLeft:i,isBottom:o,isRight:a,maxScroll:r,minScroll:t}}const M4e={x:.2,y:.2};function I4e(e,t,n,r,s){let{top:i,left:o,right:a,bottom:c}=n;r===void 0&&(r=10),s===void 0&&(s=M4e);const{isTop:d,isBottom:h,isLeft:u,isRight:f}=Nue(e),g={x:0,y:0},v={x:0,y:0},m={height:t.height*s.y,width:t.width*s.x};return!d&&i<=t.top+m.height?(g.y=ci.Backward,v.y=r*Math.abs((t.top+m.height-i)/m.height)):!h&&c>=t.bottom-m.height&&(g.y=ci.Forward,v.y=r*Math.abs((t.bottom-m.height-c)/m.height)),!f&&a>=t.right-m.width?(g.x=ci.Forward,v.x=r*Math.abs((t.right-m.width-a)/m.width)):!u&&o<=t.left+m.width&&(g.x=ci.Backward,v.x=r*Math.abs((t.left+m.width-o)/m.width)),{direction:g,speed:v}}function L4e(e){if(e===document.scrollingElement){const{innerWidth:i,innerHeight:o}=window;return{top:0,left:0,right:i,bottom:o,width:i,height:o}}const{top:t,left:n,right:r,bottom:s}=e.getBoundingClientRect();return{top:t,left:n,right:r,bottom:s,width:e.clientWidth,height:e.clientHeight}}function Tue(e){return e.reduce((t,n)=>$b(t,UU(n)),Tc)}function j4e(e){return e.reduce((t,n)=>t+Aue(n),0)}function $4e(e){return e.reduce((t,n)=>t+Rue(n),0)}function kue(e,t){if(t===void 0&&(t=Jx),!e)return;const{top:n,left:r,bottom:s,right:i}=t(e);Eue(e)&&(s<=0||i<=0||n>=window.innerHeight||r>=window.innerWidth)&&e.scrollIntoView({block:"center",inline:"center"})}const F4e=[["x",["left","right"],j4e],["y",["top","bottom"],$4e]];class vW{constructor(t,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=gW(n),s=Tue(r);this.rect={...t},this.width=t.width,this.height=t.height;for(const[i,o,a]of F4e)for(const c of o)Object.defineProperty(this,c,{get:()=>{const d=a(r),h=s[i]-d;return this.rect[c]+h},enumerable:!0});Object.defineProperty(this,"rect",{enumerable:!1})}}class W1{constructor(t){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=t}add(t,n,r){var s;(s=this.target)==null||s.addEventListener(t,n,r),this.listeners.push([t,n,r])}}function z4e(e){const{EventTarget:t}=jo(e);return e instanceof t?e:Zx(e)}function tz(e,t){const n=Math.abs(e.x),r=Math.abs(e.y);return typeof t=="number"?Math.sqrt(n**2+r**2)>t:"x"in t&&"y"in t?n>t.x&&r>t.y:"x"in t?n>t.x:"y"in t?r>t.y:!1}var hl;(function(e){e.Click="click",e.DragStart="dragstart",e.Keydown="keydown",e.ContextMenu="contextmenu",e.Resize="resize",e.SelectionChange="selectionchange",e.VisibilityChange="visibilitychange"})(hl||(hl={}));function _K(e){e.preventDefault()}function B4e(e){e.stopPropagation()}var Un;(function(e){e.Space="Space",e.Down="ArrowDown",e.Right="ArrowRight",e.Left="ArrowLeft",e.Up="ArrowUp",e.Esc="Escape",e.Enter="Enter",e.Tab="Tab"})(Un||(Un={}));const Due={start:[Un.Space,Un.Enter],cancel:[Un.Esc],end:[Un.Space,Un.Enter,Un.Tab]},U4e=(e,t)=>{let{currentCoordinates:n}=t;switch(e.code){case Un.Right:return{...n,x:n.x+25};case Un.Left:return{...n,x:n.x-25};case Un.Down:return{...n,y:n.y+25};case Un.Up:return{...n,y:n.y-25}}};class yW{constructor(t){this.props=void 0,this.autoScrollEnabled=!1,this.referenceCoordinates=void 0,this.listeners=void 0,this.windowListeners=void 0,this.props=t;const{event:{target:n}}=t;this.props=t,this.listeners=new W1(Zx(n)),this.windowListeners=new W1(jo(n)),this.handleKeyDown=this.handleKeyDown.bind(this),this.handleCancel=this.handleCancel.bind(this),this.attach()}attach(){this.handleStart(),this.windowListeners.add(hl.Resize,this.handleCancel),this.windowListeners.add(hl.VisibilityChange,this.handleCancel),setTimeout(()=>this.listeners.add(hl.Keydown,this.handleKeyDown))}handleStart(){const{activeNode:t,onStart:n}=this.props,r=t.node.current;r&&kue(r),n(Tc)}handleKeyDown(t){if(kO(t)){const{active:n,context:r,options:s}=this.props,{keyboardCodes:i=Due,coordinateGetter:o=U4e,scrollBehavior:a="smooth"}=s,{code:c}=t;if(i.end.includes(c)){this.handleEnd(t);return}if(i.cancel.includes(c)){this.handleCancel(t);return}const{collisionRect:d}=r.current,h=d?{x:d.left,y:d.top}:Tc;this.referenceCoordinates||(this.referenceCoordinates=h);const u=o(t,{active:n,context:r.current,currentCoordinates:h});if(u){const f=JT(u,h),g={x:0,y:0},{scrollableAncestors:v}=r.current;for(const m of v){const x=t.code,{isTop:y,isRight:b,isLeft:w,isBottom:E,maxScroll:R,minScroll:T}=Nue(m),N=L4e(m),A={x:Math.min(x===Un.Right?N.right-N.width/2:N.right,Math.max(x===Un.Right?N.left:N.left+N.width/2,u.x)),y:Math.min(x===Un.Down?N.bottom-N.height/2:N.bottom,Math.max(x===Un.Down?N.top:N.top+N.height/2,u.y))},D=x===Un.Right&&!b||x===Un.Left&&!w,O=x===Un.Down&&!E||x===Un.Up&&!y;if(D&&A.x!==u.x){const I=m.scrollLeft+f.x,$=x===Un.Right&&I<=R.x||x===Un.Left&&I>=T.x;if($&&!f.y){m.scrollTo({left:I,behavior:a});return}$?g.x=m.scrollLeft-I:g.x=x===Un.Right?m.scrollLeft-R.x:m.scrollLeft-T.x,g.x&&m.scrollBy({left:-g.x,behavior:a});break}else if(O&&A.y!==u.y){const I=m.scrollTop+f.y,$=x===Un.Down&&I<=R.y||x===Un.Up&&I>=T.y;if($&&!f.x){m.scrollTo({top:I,behavior:a});return}$?g.y=m.scrollTop-I:g.y=x===Un.Down?m.scrollTop-R.y:m.scrollTop-T.y,g.y&&m.scrollBy({top:-g.y,behavior:a});break}}this.handleMove(t,$b(JT(u,this.referenceCoordinates),g))}}}handleMove(t,n){const{onMove:r}=this.props;t.preventDefault(),r(n)}handleEnd(t){const{onEnd:n}=this.props;t.preventDefault(),this.detach(),n()}handleCancel(t){const{onCancel:n}=this.props;t.preventDefault(),this.detach(),n()}detach(){this.listeners.removeAll(),this.windowListeners.removeAll()}}yW.activators=[{eventName:"onKeyDown",handler:(e,t,n)=>{let{keyboardCodes:r=Due,onActivation:s}=t,{active:i}=n;const{code:o}=e.nativeEvent;if(r.start.includes(o)){const a=i.activatorNode.current;return a&&e.target!==a?!1:(e.preventDefault(),s==null||s({event:e.nativeEvent}),!0)}return!1}}];function wK(e){return!!(e&&"distance"in e)}function SK(e){return!!(e&&"delay"in e)}class bW{constructor(t,n,r){var s;r===void 0&&(r=z4e(t.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=t,this.events=n;const{event:i}=t,{target:o}=i;this.props=t,this.events=n,this.document=Zx(o),this.documentListeners=new W1(this.document),this.listeners=new W1(r),this.windowListeners=new W1(jo(o)),this.initialCoordinates=(s=ek(i))!=null?s:Tc,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:t,props:{options:{activationConstraint:n,bypassActivationConstraint:r}}}=this;if(this.listeners.add(t.move.name,this.handleMove,{passive:!1}),this.listeners.add(t.end.name,this.handleEnd),t.cancel&&this.listeners.add(t.cancel.name,this.handleCancel),this.windowListeners.add(hl.Resize,this.handleCancel),this.windowListeners.add(hl.DragStart,_K),this.windowListeners.add(hl.VisibilityChange,this.handleCancel),this.windowListeners.add(hl.ContextMenu,_K),this.documentListeners.add(hl.Keydown,this.handleKeydown),n){if(r!=null&&r({event:this.props.event,activeNode:this.props.activeNode,options:this.props.options}))return this.handleStart();if(SK(n)){this.timeoutId=setTimeout(this.handleStart,n.delay),this.handlePending(n);return}if(wK(n)){this.handlePending(n);return}}this.handleStart()}detach(){this.listeners.removeAll(),this.windowListeners.removeAll(),setTimeout(this.documentListeners.removeAll,50),this.timeoutId!==null&&(clearTimeout(this.timeoutId),this.timeoutId=null)}handlePending(t,n){const{active:r,onPending:s}=this.props;s(r,t,this.initialCoordinates,n)}handleStart(){const{initialCoordinates:t}=this,{onStart:n}=this.props;t&&(this.activated=!0,this.documentListeners.add(hl.Click,B4e,{capture:!0}),this.removeTextSelection(),this.documentListeners.add(hl.SelectionChange,this.removeTextSelection),n(t))}handleMove(t){var n;const{activated:r,initialCoordinates:s,props:i}=this,{onMove:o,options:{activationConstraint:a}}=i;if(!s)return;const c=(n=ek(t))!=null?n:Tc,d=JT(s,c);if(!r&&a){if(wK(a)){if(a.tolerance!=null&&tz(d,a.tolerance))return this.handleCancel();if(tz(d,a.distance))return this.handleStart()}if(SK(a)&&tz(d,a.tolerance))return this.handleCancel();this.handlePending(a,d);return}t.cancelable&&t.preventDefault(),o(c)}handleEnd(){const{onAbort:t,onEnd:n}=this.props;this.detach(),this.activated||t(this.props.active),n()}handleCancel(){const{onAbort:t,onCancel:n}=this.props;this.detach(),this.activated||t(this.props.active),n()}handleKeydown(t){t.code===Un.Esc&&this.handleCancel()}removeTextSelection(){var t;(t=this.document.getSelection())==null||t.removeAllRanges()}}const V4e={cancel:{name:"pointercancel"},move:{name:"pointermove"},end:{name:"pointerup"}};class xW extends bW{constructor(t){const{event:n}=t,r=Zx(n.target);super(t,V4e,r)}}xW.activators=[{eventName:"onPointerDown",handler:(e,t)=>{let{nativeEvent:n}=e,{onActivation:r}=t;return!n.isPrimary||n.button!==0?!1:(r==null||r({event:n}),!0)}}];const H4e={move:{name:"mousemove"},end:{name:"mouseup"}};var VU;(function(e){e[e.RightClick=2]="RightClick"})(VU||(VU={}));class Oue extends bW{constructor(t){super(t,H4e,Zx(t.event.target))}}Oue.activators=[{eventName:"onMouseDown",handler:(e,t)=>{let{nativeEvent:n}=e,{onActivation:r}=t;return n.button===VU.RightClick?!1:(r==null||r({event:n}),!0)}}];const nz={cancel:{name:"touchcancel"},move:{name:"touchmove"},end:{name:"touchend"}};class Mue extends bW{constructor(t){super(t,nz)}static setup(){return window.addEventListener(nz.move.name,t,{capture:!1,passive:!1}),function(){window.removeEventListener(nz.move.name,t)};function t(){}}}Mue.activators=[{eventName:"onTouchStart",handler:(e,t)=>{let{nativeEvent:n}=e,{onActivation:r}=t;const{touches:s}=n;return s.length>1?!1:(r==null||r({event:n}),!0)}}];var q1;(function(e){e[e.Pointer=0]="Pointer",e[e.DraggableRect=1]="DraggableRect"})(q1||(q1={}));var nk;(function(e){e[e.TreeOrder=0]="TreeOrder",e[e.ReversedTreeOrder=1]="ReversedTreeOrder"})(nk||(nk={}));function W4e(e){let{acceleration:t,activator:n=q1.Pointer,canScroll:r,draggingRect:s,enabled:i,interval:o=5,order:a=nk.TreeOrder,pointerCoordinates:c,scrollableAncestors:d,scrollableAncestorRects:h,delta:u,threshold:f}=e;const g=G4e({delta:u,disabled:!i}),[v,m]=s4e(),x=C.useRef({x:0,y:0}),y=C.useRef({x:0,y:0}),b=C.useMemo(()=>{switch(n){case q1.Pointer:return c?{top:c.y,bottom:c.y,left:c.x,right:c.x}:null;case q1.DraggableRect:return s}},[n,s,c]),w=C.useRef(null),E=C.useCallback(()=>{const T=w.current;if(!T)return;const N=x.current.x*y.current.x,A=x.current.y*y.current.y;T.scrollBy(N,A)},[]),R=C.useMemo(()=>a===nk.TreeOrder?[...d].reverse():d,[a,d]);C.useEffect(()=>{if(!i||!d.length||!b){m();return}for(const T of R){if((r==null?void 0:r(T))===!1)continue;const N=d.indexOf(T),A=h[N];if(!A)continue;const{direction:D,speed:O}=I4e(T,A,b,t,f);for(const I of["x","y"])g[I][D[I]]||(O[I]=0,D[I]=0);if(O.x>0||O.y>0){m(),w.current=T,v(E,o),x.current=O,y.current=D;return}}x.current={x:0,y:0},y.current={x:0,y:0},m()},[t,E,r,m,i,o,JSON.stringify(b),JSON.stringify(g),v,d,R,h,JSON.stringify(f)])}const q4e={x:{[ci.Backward]:!1,[ci.Forward]:!1},y:{[ci.Backward]:!1,[ci.Forward]:!1}};function G4e(e){let{delta:t,disabled:n}=e;const r=ZT(t);return mR(s=>{if(n||!r||!s)return q4e;const i={x:Math.sign(t.x-r.x),y:Math.sign(t.y-r.y)};return{x:{[ci.Backward]:s.x[ci.Backward]||i.x===-1,[ci.Forward]:s.x[ci.Forward]||i.x===1},y:{[ci.Backward]:s.y[ci.Backward]||i.y===-1,[ci.Forward]:s.y[ci.Forward]||i.y===1}}},[n,t,r])}function K4e(e,t){const n=t!=null?e.get(t):void 0,r=n?n.node.current:null;return mR(s=>{var i;return t==null?null:(i=r??s)!=null?i:null},[r,t])}function Y4e(e,t){return C.useMemo(()=>e.reduce((n,r)=>{const{sensor:s}=r,i=s.activators.map(o=>({eventName:o.eventName,handler:t(o.handler,r)}));return[...n,...i]},[]),[e,t])}var gx;(function(e){e[e.Always=0]="Always",e[e.BeforeDragging=1]="BeforeDragging",e[e.WhileDragging=2]="WhileDragging"})(gx||(gx={}));var HU;(function(e){e.Optimized="optimized"})(HU||(HU={}));const CK=new Map;function X4e(e,t){let{dragging:n,dependencies:r,config:s}=t;const[i,o]=C.useState(null),{frequency:a,measure:c,strategy:d}=s,h=C.useRef(e),u=x(),f=LC(u),g=C.useCallback(function(y){y===void 0&&(y=[]),!f.current&&o(b=>b===null?y:b.concat(y.filter(w=>!b.includes(w))))},[f]),v=C.useRef(null),m=mR(y=>{if(u&&!n)return CK;if(!y||y===CK||h.current!==e||i!=null){const b=new Map;for(let w of e){if(!w)continue;if(i&&i.length>0&&!i.includes(w.id)&&w.rect.current){b.set(w.id,w.rect.current);continue}const E=w.node.current,R=E?new vW(c(E),E):null;w.rect.current=R,R&&b.set(w.id,R)}return b}return y},[e,i,n,u,c]);return C.useEffect(()=>{h.current=e},[e]),C.useEffect(()=>{u||g()},[n,u]),C.useEffect(()=>{i&&i.length>0&&o(null)},[JSON.stringify(i)]),C.useEffect(()=>{u||typeof a!="number"||v.current!==null||(v.current=setTimeout(()=>{g(),v.current=null},a))},[a,u,g,...r]),{droppableRects:m,measureDroppableContainers:g,measuringScheduled:i!=null};function x(){switch(d){case gx.Always:return!1;case gx.BeforeDragging:return n;default:return!n}}}function _W(e,t){return mR(n=>e?n||(typeof t=="function"?t(e):e):null,[t,e])}function Q4e(e,t){return _W(e,t)}function Z4e(e){let{callback:t,disabled:n}=e;const r=TO(t),s=C.useMemo(()=>{if(n||typeof window>"u"||typeof window.MutationObserver>"u")return;const{MutationObserver:i}=window;return new i(r)},[r,n]);return C.useEffect(()=>()=>s==null?void 0:s.disconnect(),[s]),s}function DO(e){let{callback:t,disabled:n}=e;const r=TO(t),s=C.useMemo(()=>{if(n||typeof window>"u"||typeof window.ResizeObserver>"u")return;const{ResizeObserver:i}=window;return new i(r)},[n]);return C.useEffect(()=>()=>s==null?void 0:s.disconnect(),[s]),s}function J4e(e){return new vW(Jx(e),e)}function EK(e,t,n){t===void 0&&(t=J4e);const[r,s]=C.useState(null);function i(){s(c=>{if(!e)return null;if(e.isConnected===!1){var d;return(d=c??n)!=null?d:null}const h=t(e);return JSON.stringify(c)===JSON.stringify(h)?c:h})}const o=Z4e({callback(c){if(e)for(const d of c){const{type:h,target:u}=d;if(h==="childList"&&u instanceof HTMLElement&&u.contains(e)){i();break}}}}),a=DO({callback:i});return Nc(()=>{i(),e?(a==null||a.observe(e),o==null||o.observe(document.body,{childList:!0,subtree:!0})):(a==null||a.disconnect(),o==null||o.disconnect())},[e]),r}function eze(e){const t=_W(e);return Sue(e,t)}const AK=[];function tze(e){const t=C.useRef(e),n=mR(r=>e?r&&r!==AK&&e&&t.current&&e.parentNode===t.current.parentNode?r:gW(e):AK,[e]);return C.useEffect(()=>{t.current=e},[e]),n}function nze(e){const[t,n]=C.useState(null),r=C.useRef(e),s=C.useCallback(i=>{const o=ez(i.target);o&&n(a=>a?(a.set(o,UU(o)),new Map(a)):null)},[]);return C.useEffect(()=>{const i=r.current;if(e!==i){o(i);const a=e.map(c=>{const d=ez(c);return d?(d.addEventListener("scroll",s,{passive:!0}),[d,UU(d)]):null}).filter(c=>c!=null);n(a.length?new Map(a):null),r.current=e}return()=>{o(e),o(i)};function o(a){a.forEach(c=>{const d=ez(c);d==null||d.removeEventListener("scroll",s)})}},[s,e]),C.useMemo(()=>e.length?t?Array.from(t.values()).reduce((i,o)=>$b(i,o),Tc):Tue(e):Tc,[e,t])}function RK(e,t){t===void 0&&(t=[]);const n=C.useRef(null);return C.useEffect(()=>{n.current=null},t),C.useEffect(()=>{const r=e!==Tc;r&&!n.current&&(n.current=e),!r&&n.current&&(n.current=null)},[e]),n.current?JT(e,n.current):Tc}function rze(e){C.useEffect(()=>{if(!NO)return;const t=e.map(n=>{let{sensor:r}=n;return r.setup==null?void 0:r.setup()});return()=>{for(const n of t)n==null||n()}},e.map(t=>{let{sensor:n}=t;return n}))}function sze(e,t){return C.useMemo(()=>e.reduce((n,r)=>{let{eventName:s,handler:i}=r;return n[s]=o=>{i(o,t)},n},{}),[e,t])}function Iue(e){return C.useMemo(()=>e?k4e(e):null,[e])}const PK=[];function ize(e,t){t===void 0&&(t=Jx);const[n]=e,r=Iue(n?jo(n):null),[s,i]=C.useState(PK);function o(){i(()=>e.length?e.map(c=>Pue(c)?r:new vW(t(c),c)):PK)}const a=DO({callback:o});return Nc(()=>{a==null||a.disconnect(),o(),e.forEach(c=>a==null?void 0:a.observe(c))},[e]),s}function Lue(e){if(!e)return null;if(e.children.length>1)return e;const t=e.children[0];return pR(t)?t:e}function oze(e){let{measure:t}=e;const[n,r]=C.useState(null),s=C.useCallback(d=>{for(const{target:h}of d)if(pR(h)){r(u=>{const f=t(h);return u?{...u,width:f.width,height:f.height}:f});break}},[t]),i=DO({callback:s}),o=C.useCallback(d=>{const h=Lue(d);i==null||i.disconnect(),h&&(i==null||i.observe(h)),r(h?t(h):null)},[t,i]),[a,c]=QT(o);return C.useMemo(()=>({nodeRef:a,rect:n,setRef:c}),[n,a,c])}const aze=[{sensor:xW,options:{}},{sensor:yW,options:{}}],lze={current:{}},sN={draggable:{measure:xK},droppable:{measure:xK,strategy:gx.WhileDragging,frequency:HU.Optimized},dragOverlay:{measure:Jx}};class G1 extends Map{get(t){var n;return t!=null&&(n=super.get(t))!=null?n:void 0}toArray(){return Array.from(this.values())}getEnabled(){return this.toArray().filter(t=>{let{disabled:n}=t;return!n})}getNodeFor(t){var n,r;return(n=(r=this.get(t))==null?void 0:r.node.current)!=null?n:void 0}}const cze={activatorEvent:null,active:null,activeNode:null,activeNodeRect:null,collisions:null,containerNodeRect:null,draggableNodes:new Map,droppableRects:new Map,droppableContainers:new G1,over:null,dragOverlay:{nodeRef:{current:null},rect:null,setRef:tk},scrollableAncestors:[],scrollableAncestorRects:[],measuringConfiguration:sN,measureDroppableContainers:tk,windowRect:null,measuringScheduled:!1},jue={activatorEvent:null,activators:[],active:null,activeNodeRect:null,ariaDescribedById:{draggable:""},dispatch:tk,draggableNodes:new Map,over:null,measureDroppableContainers:tk},vR=C.createContext(jue),$ue=C.createContext(cze);function uze(){return{draggable:{active:null,initialCoordinates:{x:0,y:0},nodes:new Map,translate:{x:0,y:0}},droppable:{containers:new G1}}}function dze(e,t){switch(t.type){case ei.DragStart:return{...e,draggable:{...e.draggable,initialCoordinates:t.initialCoordinates,active:t.active}};case ei.DragMove:return e.draggable.active==null?e:{...e,draggable:{...e.draggable,translate:{x:t.coordinates.x-e.draggable.initialCoordinates.x,y:t.coordinates.y-e.draggable.initialCoordinates.y}}};case ei.DragEnd:case ei.DragCancel:return{...e,draggable:{...e.draggable,active:null,initialCoordinates:{x:0,y:0},translate:{x:0,y:0}}};case ei.RegisterDroppable:{const{element:n}=t,{id:r}=n,s=new G1(e.droppable.containers);return s.set(r,n),{...e,droppable:{...e.droppable,containers:s}}}case ei.SetDroppableDisabled:{const{id:n,key:r,disabled:s}=t,i=e.droppable.containers.get(n);if(!i||r!==i.key)return e;const o=new G1(e.droppable.containers);return o.set(n,{...i,disabled:s}),{...e,droppable:{...e.droppable,containers:o}}}case ei.UnregisterDroppable:{const{id:n,key:r}=t,s=e.droppable.containers.get(n);if(!s||r!==s.key)return e;const i=new G1(e.droppable.containers);return i.delete(n),{...e,droppable:{...e.droppable,containers:i}}}default:return e}}function fze(e){let{disabled:t}=e;const{active:n,activatorEvent:r,draggableNodes:s}=C.useContext(vR),i=ZT(r),o=ZT(n==null?void 0:n.id);return C.useEffect(()=>{if(!t&&!r&&i&&o!=null){if(!kO(i)||document.activeElement===i.target)return;const a=s.get(o);if(!a)return;const{activatorNode:c,node:d}=a;if(!c.current&&!d.current)return;requestAnimationFrame(()=>{for(const h of[c.current,d.current]){if(!h)continue;const u=a4e(h);if(u){u.focus();break}}})}},[r,t,s,o,i]),null}function Fue(e,t){let{transform:n,...r}=t;return e!=null&&e.length?e.reduce((s,i)=>i({transform:s,...r}),n):n}function hze(e){return C.useMemo(()=>({draggable:{...sN.draggable,...e==null?void 0:e.draggable},droppable:{...sN.droppable,...e==null?void 0:e.droppable},dragOverlay:{...sN.dragOverlay,...e==null?void 0:e.dragOverlay}}),[e==null?void 0:e.draggable,e==null?void 0:e.droppable,e==null?void 0:e.dragOverlay])}function pze(e){let{activeNode:t,measure:n,initialRect:r,config:s=!0}=e;const i=C.useRef(!1),{x:o,y:a}=typeof s=="boolean"?{x:s,y:s}:s;Nc(()=>{if(!o&&!a||!t){i.current=!1;return}if(i.current||!r)return;const d=t==null?void 0:t.node.current;if(!d||d.isConnected===!1)return;const h=n(d),u=Sue(h,r);if(o||(u.x=0),a||(u.y=0),i.current=!0,Math.abs(u.x)>0||Math.abs(u.y)>0){const f=Eue(d);f&&f.scrollBy({top:u.y,left:u.x})}},[t,o,a,r,n])}const OO=C.createContext({...Tc,scaleX:1,scaleY:1});var dh;(function(e){e[e.Uninitialized=0]="Uninitialized",e[e.Initializing=1]="Initializing",e[e.Initialized=2]="Initialized"})(dh||(dh={}));const mze=C.memo(function(t){var n,r,s,i;let{id:o,accessibility:a,autoScroll:c=!0,children:d,sensors:h=aze,collisionDetection:u=E4e,measuring:f,modifiers:g,...v}=t;const m=C.useReducer(dze,void 0,uze),[x,y]=m,[b,w]=h4e(),[E,R]=C.useState(dh.Uninitialized),T=E===dh.Initialized,{draggable:{active:N,nodes:A,translate:D},droppable:{containers:O}}=x,I=N!=null?A.get(N):null,$=C.useRef({initial:null,translated:null}),F=C.useMemo(()=>{var yt;return N!=null?{id:N,data:(yt=I==null?void 0:I.data)!=null?yt:lze,rect:$}:null},[N,I]),B=C.useRef(null),[W,Z]=C.useState(null),[Y,H]=C.useState(null),se=LC(v,Object.values(v)),he=gR("DndDescribedBy",o),re=C.useMemo(()=>O.getEnabled(),[O]),J=hze(f),{droppableRects:te,measureDroppableContainers:ae,measuringScheduled:be}=X4e(re,{dragging:T,dependencies:[D.x,D.y],config:J.droppable}),xe=K4e(A,N),ve=C.useMemo(()=>Y?ek(Y):null,[Y]),Pe=Ut(),Oe=Q4e(xe,J.draggable.measure);pze({activeNode:N!=null?A.get(N):null,config:Pe.layoutShiftCompensation,initialRect:Oe,measure:J.draggable.measure});const ke=EK(xe,J.draggable.measure,Oe),ze=EK(xe?xe.parentElement:null),$e=C.useRef({activatorEvent:null,active:null,activeNode:xe,collisionRect:null,collisions:null,droppableRects:te,draggableNodes:A,draggingNode:null,draggingNodeRect:null,droppableContainers:O,over:null,scrollableAncestors:[],scrollAdjustedTranslate:null}),Te=O.getNodeFor((n=$e.current.over)==null?void 0:n.id),Ue=oze({measure:J.dragOverlay.measure}),wt=(r=Ue.nodeRef.current)!=null?r:xe,ut=T?(s=Ue.rect)!=null?s:ke:null,St=!!(Ue.nodeRef.current&&Ue.rect),Nn=eze(St?null:ke),cn=Iue(wt?jo(wt):null),hn=tze(T?Te??xe:null),It=ize(hn),U=Fue(g,{transform:{x:D.x-Nn.x,y:D.y-Nn.y,scaleX:1,scaleY:1},activatorEvent:Y,active:F,activeNodeRect:ke,containerNodeRect:ze,draggingNodeRect:ut,over:$e.current.over,overlayNodeRect:Ue.rect,scrollableAncestors:hn,scrollableAncestorRects:It,windowRect:cn}),ee=ve?$b(ve,D):null,ie=nze(hn),_e=RK(ie),we=RK(ie,[ke]),pe=$b(U,_e),Se=ut?P4e(ut,U):null,Fe=F&&Se?u({active:F,collisionRect:Se,droppableRects:te,droppableContainers:re,pointerCoordinates:ee}):null,ft=w4e(Fe,"id"),[ht,hs]=C.useState(null),Mn=St?U:$b(U,we),Hr=A4e(Mn,(i=ht==null?void 0:ht.rect)!=null?i:null,ke),Yt=C.useRef(null),un=C.useCallback((yt,dn)=>{let{sensor:Gt,options:Hn}=dn;if(B.current==null)return;const In=A.get(B.current);if(!In)return;const Tn=yt.nativeEvent,sr=new Gt({active:B.current,activeNode:In,event:Tn,options:Hn,context:$e,onAbort(ir){if(!A.get(ir))return;const{onDragAbort:ye}=se.current,Ce={id:ir};ye==null||ye(Ce),b({type:"onDragAbort",event:Ce})},onPending(ir,de,ye,Ce){if(!A.get(ir))return;const{onDragPending:Ge}=se.current,lt={id:ir,constraint:de,initialCoordinates:ye,offset:Ce};Ge==null||Ge(lt),b({type:"onDragPending",event:lt})},onStart(ir){const de=B.current;if(de==null)return;const ye=A.get(de);if(!ye)return;const{onDragStart:Ce}=se.current,Me={activatorEvent:Tn,active:{id:de,data:ye.data,rect:$}};Li.unstable_batchedUpdates(()=>{Ce==null||Ce(Me),R(dh.Initializing),y({type:ei.DragStart,initialCoordinates:ir,active:de}),b({type:"onDragStart",event:Me}),Z(Yt.current),H(Tn)})},onMove(ir){y({type:ei.DragMove,coordinates:ir})},onEnd:Kr(ei.DragEnd),onCancel:Kr(ei.DragCancel)});Yt.current=sr;function Kr(ir){return async function(){const{active:ye,collisions:Ce,over:Me,scrollAdjustedTranslate:Ge}=$e.current;let lt=null;if(ye&&Ge){const{cancelDrop:Ct}=se.current;lt={activatorEvent:Tn,active:ye,collisions:Ce,delta:Ge,over:Me},ir===ei.DragEnd&&typeof Ct=="function"&&await Promise.resolve(Ct(lt))&&(ir=ei.DragCancel)}B.current=null,Li.unstable_batchedUpdates(()=>{y({type:ir}),R(dh.Uninitialized),hs(null),Z(null),H(null),Yt.current=null;const Ct=ir===ei.DragEnd?"onDragEnd":"onDragCancel";if(lt){const st=se.current[Ct];st==null||st(lt),b({type:Ct,event:lt})}})}}},[A]),xn=C.useCallback((yt,dn)=>(Gt,Hn)=>{const In=Gt.nativeEvent,Tn=A.get(Hn);if(B.current!==null||!Tn||In.dndKit||In.defaultPrevented)return;const sr={active:Tn};yt(Gt,dn.options,sr)===!0&&(In.dndKit={capturedBy:dn.sensor},B.current=Hn,un(Gt,dn))},[A,un]),Ze=Y4e(h,xn);rze(h),Nc(()=>{ke&&E===dh.Initializing&&R(dh.Initialized)},[ke,E]),C.useEffect(()=>{const{onDragMove:yt}=se.current,{active:dn,activatorEvent:Gt,collisions:Hn,over:In}=$e.current;if(!dn||!Gt)return;const Tn={active:dn,activatorEvent:Gt,collisions:Hn,delta:{x:pe.x,y:pe.y},over:In};Li.unstable_batchedUpdates(()=>{yt==null||yt(Tn),b({type:"onDragMove",event:Tn})})},[pe.x,pe.y]),C.useEffect(()=>{const{active:yt,activatorEvent:dn,collisions:Gt,droppableContainers:Hn,scrollAdjustedTranslate:In}=$e.current;if(!yt||B.current==null||!dn||!In)return;const{onDragOver:Tn}=se.current,sr=Hn.get(ft),Kr=sr&&sr.rect.current?{id:sr.id,rect:sr.rect.current,data:sr.data,disabled:sr.disabled}:null,ir={active:yt,activatorEvent:dn,collisions:Gt,delta:{x:In.x,y:In.y},over:Kr};Li.unstable_batchedUpdates(()=>{hs(Kr),Tn==null||Tn(ir),b({type:"onDragOver",event:ir})})},[ft]),Nc(()=>{$e.current={activatorEvent:Y,active:F,activeNode:xe,collisionRect:Se,collisions:Fe,droppableRects:te,draggableNodes:A,draggingNode:wt,draggingNodeRect:ut,droppableContainers:O,over:ht,scrollableAncestors:hn,scrollAdjustedTranslate:pe},$.current={initial:ut,translated:Se}},[F,xe,Fe,Se,A,wt,ut,te,O,ht,hn,pe]),W4e({...Pe,delta:D,draggingRect:Se,pointerCoordinates:ee,scrollableAncestors:hn,scrollableAncestorRects:It});const Rt=C.useMemo(()=>({active:F,activeNode:xe,activeNodeRect:ke,activatorEvent:Y,collisions:Fe,containerNodeRect:ze,dragOverlay:Ue,draggableNodes:A,droppableContainers:O,droppableRects:te,over:ht,measureDroppableContainers:ae,scrollableAncestors:hn,scrollableAncestorRects:It,measuringConfiguration:J,measuringScheduled:be,windowRect:cn}),[F,xe,ke,Y,Fe,ze,Ue,A,O,te,ht,ae,hn,It,J,be,cn]),Pt=C.useMemo(()=>({activatorEvent:Y,activators:Ze,active:F,activeNodeRect:ke,ariaDescribedById:{draggable:he},dispatch:y,draggableNodes:A,over:ht,measureDroppableContainers:ae}),[Y,Ze,F,ke,y,he,A,ht,ae]);return fe.createElement(wue.Provider,{value:w},fe.createElement(vR.Provider,{value:Pt},fe.createElement($ue.Provider,{value:Rt},fe.createElement(OO.Provider,{value:Hr},d)),fe.createElement(fze,{disabled:(a==null?void 0:a.restoreFocus)===!1})),fe.createElement(g4e,{...a,hiddenTextDescribedById:he}));function Ut(){const yt=(W==null?void 0:W.autoScrollEnabled)===!1,dn=typeof c=="object"?c.enabled===!1:c===!1,Gt=T&&!yt&&!dn;return typeof c=="object"?{...c,enabled:Gt}:{enabled:Gt}}}),gze=C.createContext(null),NK="button",vze="Draggable";function yze(e){let{id:t,data:n,disabled:r=!1,attributes:s}=e;const i=gR(vze),{activators:o,activatorEvent:a,active:c,activeNodeRect:d,ariaDescribedById:h,draggableNodes:u,over:f}=C.useContext(vR),{role:g=NK,roleDescription:v="draggable",tabIndex:m=0}=s??{},x=(c==null?void 0:c.id)===t,y=C.useContext(x?OO:gze),[b,w]=QT(),[E,R]=QT(),T=sze(o,t),N=LC(n);Nc(()=>(u.set(t,{id:t,key:i,node:b,activatorNode:E,data:N}),()=>{const D=u.get(t);D&&D.key===i&&u.delete(t)}),[u,t]);const A=C.useMemo(()=>({role:g,tabIndex:m,"aria-disabled":r,"aria-pressed":x&&g===NK?!0:void 0,"aria-roledescription":v,"aria-describedby":h.draggable}),[r,g,m,x,v,h.draggable]);return{active:c,activatorEvent:a,activeNodeRect:d,attributes:A,isDragging:x,listeners:r?void 0:T,node:b,over:f,setNodeRef:w,setActivatorNodeRef:R,transform:y}}function zue(){return C.useContext($ue)}const bze="Droppable",xze={timeout:25};function _ze(e){let{data:t,disabled:n=!1,id:r,resizeObserverConfig:s}=e;const i=gR(bze),{active:o,dispatch:a,over:c,measureDroppableContainers:d}=C.useContext(vR),h=C.useRef({disabled:n}),u=C.useRef(!1),f=C.useRef(null),g=C.useRef(null),{disabled:v,updateMeasurementsFor:m,timeout:x}={...xze,...s},y=LC(m??r),b=C.useCallback(()=>{if(!u.current){u.current=!0;return}g.current!=null&&clearTimeout(g.current),g.current=setTimeout(()=>{d(Array.isArray(y.current)?y.current:[y.current]),g.current=null},x)},[x]),w=DO({callback:b,disabled:v||!o}),E=C.useCallback((A,D)=>{w&&(D&&(w.unobserve(D),u.current=!1),A&&w.observe(A))},[w]),[R,T]=QT(E),N=LC(t);return C.useEffect(()=>{!w||!R.current||(w.disconnect(),u.current=!1,w.observe(R.current))},[R,w]),C.useEffect(()=>(a({type:ei.RegisterDroppable,element:{id:r,key:i,disabled:n,node:R,rect:f,data:N}}),()=>a({type:ei.UnregisterDroppable,key:i,id:r})),[r]),C.useEffect(()=>{n!==h.current.disabled&&(a({type:ei.SetDroppableDisabled,id:r,key:i,disabled:n}),h.current.disabled=n)},[r,i,n,a]),{active:o,rect:f,isOver:(c==null?void 0:c.id)===r,node:R,over:c,setNodeRef:T}}function wze(e){let{animation:t,children:n}=e;const[r,s]=C.useState(null),[i,o]=C.useState(null),a=ZT(n);return!n&&!r&&a&&s(a),Nc(()=>{if(!i)return;const c=r==null?void 0:r.key,d=r==null?void 0:r.props.id;if(c==null||d==null){s(null);return}Promise.resolve(t(d,i)).then(()=>{s(null)})},[t,r,i]),fe.createElement(fe.Fragment,null,n,r?C.cloneElement(r,{ref:o}):null)}const Sze={x:0,y:0,scaleX:1,scaleY:1};function Cze(e){let{children:t}=e;return fe.createElement(vR.Provider,{value:jue},fe.createElement(OO.Provider,{value:Sze},t))}const Eze={position:"fixed",touchAction:"none"},Aze=e=>kO(e)?"transform 250ms ease":void 0,Rze=C.forwardRef((e,t)=>{let{as:n,activatorEvent:r,adjustScale:s,children:i,className:o,rect:a,style:c,transform:d,transition:h=Aze}=e;if(!a)return null;const u=s?d:{...d,scaleX:1,scaleY:1},f={...Eze,width:a.width,height:a.height,top:a.top,left:a.left,transform:ku.Transform.toString(u),transformOrigin:s&&r?b4e(r,a):void 0,transition:typeof h=="function"?h(r):h,...c};return fe.createElement(n,{className:o,style:f,ref:t},i)}),Pze=e=>t=>{let{active:n,dragOverlay:r}=t;const s={},{styles:i,className:o}=e;if(i!=null&&i.active)for(const[a,c]of Object.entries(i.active))c!==void 0&&(s[a]=n.node.style.getPropertyValue(a),n.node.style.setProperty(a,c));if(i!=null&&i.dragOverlay)for(const[a,c]of Object.entries(i.dragOverlay))c!==void 0&&r.node.style.setProperty(a,c);return o!=null&&o.active&&n.node.classList.add(o.active),o!=null&&o.dragOverlay&&r.node.classList.add(o.dragOverlay),function(){for(const[c,d]of Object.entries(s))n.node.style.setProperty(c,d);o!=null&&o.active&&n.node.classList.remove(o.active)}},Nze=e=>{let{transform:{initial:t,final:n}}=e;return[{transform:ku.Transform.toString(t)},{transform:ku.Transform.toString(n)}]},WU={duration:250,easing:"ease",keyframes:Nze,sideEffects:Pze({styles:{active:{opacity:"0"}}})};function Tze(e){let{config:t,draggableNodes:n,droppableContainers:r,measuringConfiguration:s}=e;return TO((i,o)=>{if(t===null)return;const a=n.get(i);if(!a)return;const c=a.node.current;if(!c)return;const d=Lue(o);if(!d)return;const{transform:h}=jo(o).getComputedStyle(o),u=Cue(h);if(!u)return;const f=typeof t=="function"?t:kze(t);return kue(c,s.draggable.measure),f({active:{id:i,data:a.data,node:c,rect:s.draggable.measure(c)},draggableNodes:n,dragOverlay:{node:o,rect:s.dragOverlay.measure(d)},droppableContainers:r,measuringConfiguration:s,transform:u})})}function kze(e){const{duration:t,easing:n,sideEffects:r,keyframes:s}={...WU,...e};return i=>{let{active:o,dragOverlay:a,transform:c,...d}=i;if(!t)return;const h={x:a.rect.left-o.rect.left,y:a.rect.top-o.rect.top},u={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},f={x:c.x-h.x,y:c.y-h.y,...u},g=s({...d,active:o,dragOverlay:a,transform:{initial:c,final:f}}),[v]=g,m=g[g.length-1];if(JSON.stringify(v)===JSON.stringify(m))return;const x=r==null?void 0:r({active:o,dragOverlay:a,...d}),y=a.node.animate(g,{duration:t,easing:n,fill:"forwards"});return new Promise(b=>{y.onfinish=()=>{x==null||x(),b()}})}}let TK=0;function Dze(e){return C.useMemo(()=>{if(e!=null)return TK++,TK},[e])}const Oze=fe.memo(e=>{let{adjustScale:t=!1,children:n,dropAnimation:r,style:s,transition:i,modifiers:o,wrapperElement:a="div",className:c,zIndex:d=999}=e;const{activatorEvent:h,active:u,activeNodeRect:f,containerNodeRect:g,draggableNodes:v,droppableContainers:m,dragOverlay:x,over:y,measuringConfiguration:b,scrollableAncestors:w,scrollableAncestorRects:E,windowRect:R}=zue(),T=C.useContext(OO),N=Dze(u==null?void 0:u.id),A=Fue(o,{activatorEvent:h,active:u,activeNodeRect:f,containerNodeRect:g,draggingNodeRect:x.rect,over:y,overlayNodeRect:x.rect,scrollableAncestors:w,scrollableAncestorRects:E,transform:T,windowRect:R}),D=_W(f),O=Tze({config:r,draggableNodes:v,droppableContainers:m,measuringConfiguration:b}),I=D?x.setRef:void 0;return fe.createElement(Cze,null,fe.createElement(wze,{animation:O},u&&N?fe.createElement(Rze,{key:N,id:u.id,ref:I,as:a,activatorEvent:h,adjustScale:t,className:c,transition:i,rect:D,style:{zIndex:d,...s},transform:A},n):null))});function Bue(e,t,n){const r=e.slice();return r.splice(n<0?r.length+n:n,0,r.splice(t,1)[0]),r}function Mze(e,t){return e.reduce((n,r,s)=>{const i=t.get(r);return i&&(n[s]=i),n},Array(e.length))}function CP(e){return e!==null&&e>=0}function Ize(e,t){if(e===t)return!0;if(e.length!==t.length)return!1;for(let n=0;n<e.length;n++)if(e[n]!==t[n])return!1;return!0}function Lze(e){return typeof e=="boolean"?{draggable:e,droppable:e}:e}const Uue=e=>{let{rects:t,activeIndex:n,overIndex:r,index:s}=e;const i=Bue(t,r,n),o=t[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}},EP={scaleX:1,scaleY:1},jze=e=>{var t;let{activeIndex:n,activeNodeRect:r,index:s,rects:i,overIndex:o}=e;const a=(t=i[n])!=null?t:r;if(!a)return null;if(s===n){const d=i[o];return d?{x:0,y:n<o?d.top+d.height-(a.top+a.height):d.top-a.top,...EP}:null}const c=$ze(i,s,n);return s>n&&s<=o?{x:0,y:-a.height-c,...EP}:s<n&&s>=o?{x:0,y:a.height+c,...EP}:{x:0,y:0,...EP}};function $ze(e,t,n){const r=e[t],s=e[t-1],i=e[t+1];return r?n<t?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 Vue="Sortable",Hue=fe.createContext({activeIndex:-1,containerId:Vue,disableTransforms:!1,items:[],overIndex:-1,useDragOverlay:!1,sortedRects:[],strategy:Uue,disabled:{draggable:!1,droppable:!1}});function Fze(e){let{children:t,id:n,items:r,strategy:s=Uue,disabled:i=!1}=e;const{active:o,dragOverlay:a,droppableRects:c,over:d,measureDroppableContainers:h}=zue(),u=gR(Vue,n),f=a.rect!==null,g=C.useMemo(()=>r.map(T=>typeof T=="object"&&"id"in T?T.id:T),[r]),v=o!=null,m=o?g.indexOf(o.id):-1,x=d?g.indexOf(d.id):-1,y=C.useRef(g),b=!Ize(g,y.current),w=x!==-1&&m===-1||b,E=Lze(i);Nc(()=>{b&&v&&h(g)},[b,g,v,h]),C.useEffect(()=>{y.current=g},[g]);const R=C.useMemo(()=>({activeIndex:m,containerId:u,disabled:E,disableTransforms:w,items:g,overIndex:x,useDragOverlay:f,sortedRects:Mze(g,c),strategy:s}),[m,u,E.draggable,E.droppable,w,g,x,c,f,s]);return fe.createElement(Hue.Provider,{value:R},t)}const zze=e=>{let{id:t,items:n,activeIndex:r,overIndex:s}=e;return Bue(n,r,s).indexOf(t)},Wue=e=>{let{containerId:t,isSorting:n,wasDragging:r,index:s,items:i,newIndex:o,previousItems:a,previousContainerId:c,transition:d}=e;return!d||!r||a!==i&&s===o?!1:n?!0:o!==s&&t===c},Bze={duration:200,easing:"ease"},que="transform",Uze=ku.Transition.toString({property:que,duration:0,easing:"linear"}),Vze={roleDescription:"sortable"};function Hze(e){let{disabled:t,index:n,node:r,rect:s}=e;const[i,o]=C.useState(null),a=C.useRef(n);return Nc(()=>{if(!t&&n!==a.current&&r.current){const c=s.current;if(c){const d=Jx(r.current,{ignoreTransform:!0}),h={x:c.left-d.left,y:c.top-d.top,scaleX:c.width/d.width,scaleY:c.height/d.height};(h.x||h.y)&&o(h)}}n!==a.current&&(a.current=n)},[t,n,r,s]),C.useEffect(()=>{i&&o(null)},[i]),i}function Gue(e){let{animateLayoutChanges:t=Wue,attributes:n,disabled:r,data:s,getNewIndex:i=zze,id:o,strategy:a,resizeObserverConfig:c,transition:d=Bze}=e;const{items:h,containerId:u,activeIndex:f,disabled:g,disableTransforms:v,sortedRects:m,overIndex:x,useDragOverlay:y,strategy:b}=C.useContext(Hue),w=Wze(r,g),E=h.indexOf(o),R=C.useMemo(()=>({sortable:{containerId:u,index:E,items:h},...s}),[u,s,E,h]),T=C.useMemo(()=>h.slice(h.indexOf(o)),[h,o]),{rect:N,node:A,isOver:D,setNodeRef:O}=_ze({id:o,data:R,disabled:w.droppable,resizeObserverConfig:{updateMeasurementsFor:T,...c}}),{active:I,activatorEvent:$,activeNodeRect:F,attributes:B,setNodeRef:W,listeners:Z,isDragging:Y,over:H,setActivatorNodeRef:se,transform:he}=yze({id:o,data:R,attributes:{...Vze,...n},disabled:w.draggable}),re=r4e(O,W),J=!!I,te=J&&!v&&CP(f)&&CP(x),ae=!y&&Y,be=ae&&te?he:null,ve=te?be??(a??b)({rects:m,activeNodeRect:F,activeIndex:f,overIndex:x,index:E}):null,Pe=CP(f)&&CP(x)?i({id:o,items:h,activeIndex:f,overIndex:x}):E,Oe=I==null?void 0:I.id,ke=C.useRef({activeId:Oe,items:h,newIndex:Pe,containerId:u}),ze=h!==ke.current.items,$e=t({active:I,containerId:u,isDragging:Y,isSorting:J,id:o,index:E,items:h,newIndex:ke.current.newIndex,previousItems:ke.current.items,previousContainerId:ke.current.containerId,transition:d,wasDragging:ke.current.activeId!=null}),Te=Hze({disabled:!$e,index:E,node:A,rect:N});return C.useEffect(()=>{J&&ke.current.newIndex!==Pe&&(ke.current.newIndex=Pe),u!==ke.current.containerId&&(ke.current.containerId=u),h!==ke.current.items&&(ke.current.items=h)},[J,Pe,u,h]),C.useEffect(()=>{if(Oe===ke.current.activeId)return;if(Oe&&!ke.current.activeId){ke.current.activeId=Oe;return}const wt=setTimeout(()=>{ke.current.activeId=Oe},50);return()=>clearTimeout(wt)},[Oe]),{active:I,activeIndex:f,attributes:B,data:R,rect:N,index:E,newIndex:Pe,items:h,isOver:D,isSorting:J,isDragging:Y,listeners:Z,node:A,overIndex:x,over:H,setNodeRef:re,setActivatorNodeRef:se,setDroppableNodeRef:O,setDraggableNodeRef:W,transform:Te??ve,transition:Ue()};function Ue(){if(Te||ze&&ke.current.newIndex===E)return Uze;if(!(ae&&!kO($)||!d)&&(J||$e))return ku.Transition.toString({...d,property:que})}}function Wze(e,t){var n,r;return typeof e=="boolean"?{draggable:e,droppable:!1}:{draggable:(n=e==null?void 0:e.draggable)!=null?n:t.draggable,droppable:(r=e==null?void 0:e.droppable)!=null?r:t.droppable}}Un.Down,Un.Right,Un.Up,Un.Left;const qze=({rowId:e,className:t})=>{const{attributes:n,listeners:r,isDragging:s}=Gue({id:e});return _.jsxs(at,{onClick:i=>{i.preventDefault()},size:"icon",variant:"link",className:ge(s?"cursor-grabbing":"cursor-grab","w-4 h-4 mt-2 text-ring hover:text-muted-foreground",t),...n,...r,children:[_.jsx(CJ,{className:"w-4 h-4"}),_.jsx("span",{className:"sr-only",children:ue("common.move_row")})]})};function Gze(){return{id:"select",header:({table:e})=>_.jsx(_C,{id:"select-all",checked:e.getIsAllPageRowsSelected()||e.getIsSomePageRowsSelected()&&"indeterminate",onCheckedChange:t=>e.toggleAllPageRowsSelected(!!t),"aria-label":"Seleccionar todo",className:"translate-y-[2px]"}),cell:({row:e})=>_.jsx(_C,{id:`select-row-${e.id}`,checked:e.getIsSelected(),onCheckedChange:t=>{e.toggleSelected(!!t)},"aria-label":"Seleccionar file",className:"translate-y-[2px]"}),enableSorting:!1,enableHiding:!1}}function MO({columnCount:e,rowCount:t=10,searchableColumnCount:n=0,filterableColumnCount:r=0,showViewOptions:s=!0,cellWidths:i=["auto"],withPagination:o=!0,shrinkZero:a=!1,className:c,...d}){return _.jsxs("div",{className:ge("w-full space-y-2.5 overflow-auto",c),...d,children:[_.jsxs("div",{className:"flex items-center justify-between w-full p-1 space-x-2 overflow-auto",children:[_.jsxs("div",{className:"flex items-center flex-1 space-x-2",children:[n>0?Array.from({length:n}).map((h,u)=>_.jsx(zo,{className:"w-40 h-7 lg:w-60"},u)):null,r>0?Array.from({length:r}).map((h,u)=>_.jsx(zo,{className:"h-7 w-[4.5rem] border-dashed"},u)):null]}),s?_.jsx(zo,{className:"ml-auto hidden h-7 w-[4.5rem] lg:flex"}):null]}),_.jsx("div",{className:"border rounded-md",children:_.jsxs(dO,{children:[_.jsx(fO,{children:Array.from({length:1}).map((h,u)=>_.jsx(dp,{className:"hover:bg-transparent",children:Array.from({length:e}).map((f,g)=>_.jsx(pO,{style:{width:i[g],minWidth:a?i[g]:"auto"},children:_.jsx(zo,{className:"w-full h-6"})},g))},u))}),_.jsx(hO,{children:Array.from({length:t}).map((h,u)=>_.jsx(dp,{className:"hover:bg-transparent",children:Array.from({length:e}).map((f,g)=>_.jsx(TC,{style:{width:i[g],minWidth:a?i[g]:"auto"},children:_.jsx(zo,{className:"w-full h-6"})},g))},u))})]})}),o?_.jsxs("div",{className:"flex items-center justify-between w-full gap-4 p-1 overflow-auto sm:gap-8",children:[_.jsx(zo,{className:"w-40 h-7 shrink-0"}),_.jsxs("div",{className:"flex items-center gap-4 sm:gap-6 lg:gap-8",children:[_.jsxs("div",{className:"flex items-center space-x-2",children:[_.jsx(zo,{className:"w-24 h-7"}),_.jsx(zo,{className:"h-7 w-[4.5rem]"})]}),_.jsx("div",{className:"flex items-center justify-center text-sm font-medium",children:_.jsx(zo,{className:"w-20 h-7"})}),_.jsxs("div",{className:"flex items-center space-x-2",children:[_.jsx(zo,{className:"hidden size-7 lg:block"}),_.jsx(zo,{className:"size-7"}),_.jsx(zo,{className:"size-7"}),_.jsx(zo,{className:"hidden size-7 lg:block"})]})]})]}):null]})}const IO=({title:e="Esto está muy vacío",subtitle:t="Empieza dando de alta un item",buttonText:n="Nuevo item",onButtonClick:r=()=>{},actions:s=void 0})=>_.jsxs("div",{className:"text-center",children:[_.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:_.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"})}),_.jsx("h3",{className:"mt-2 text-lg font-semibold text-slate-900",children:e}),_.jsx("p",{className:"mt-1 text-base text-slate-500",children:t}),_.jsxs("div",{className:"items-center mt-6",children:[s&&_.jsx(_.Fragment,{children:s}),!s&&_.jsxs(at,{className:"my-4",onClick:r,children:[_.jsx(MH,{}),n]})]})]}),Ip=({title:e="Se ha producido un error",subtitle:t=void 0,description:n=void 0,errorMessage:r=void 0})=>{const s=io();return _.jsx("div",{className:"grid h-screen place-items-center ",children:_.jsxs("div",{className:"text-center",children:[_.jsx("h2",{className:"mt-2 text-xl font-semibold text-center text-slate-900",children:e}),_.jsxs("p",{className:"mt-1 font-medium text-slate-500",children:[t||r,_.jsx("br",{}),n]}),_.jsxs("div",{className:"mt-6 space-x-8 md:ml-4",children:[_.jsx(hW,{}),_.jsxs(at,{onClick:()=>s("/"),children:[_.jsx(ibe,{className:"w-4 h-4 mr-2"})," Ir al inicio"]})]})]})})};Ip.displayName="ErrorOverlay";var Dn=function(){return Dn=Object.assign||function(t){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)&&(t[i]=n[i])}return t},Dn.apply(this,arguments)};function wW(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&typeof Object.getOwnPropertySymbols=="function")for(var s=0,r=Object.getOwnPropertySymbols(e);s<r.length;s++)t.indexOf(r[s])<0&&Object.prototype.propertyIsEnumerable.call(e,r[s])&&(n[r[s]]=e[r[s]]);return n}function Na(e,t,n){if(n||arguments.length===2)for(var r=0,s=t.length,i;r<s;r++)(i||!(r in t))&&(i||(i=Array.prototype.slice.call(t,0,r)),i[r]=t[r]);return e.concat(i||Array.prototype.slice.call(t))}var Du=function(e){return e.replace(/[-/\\^$*+?.()|[\]{}]/g,"\\$&")},Kze={k:1e3,m:1e6,b:1e9},Yze=function(e,t){t===void 0&&(t=".");var n=new RegExp("(\\d+(".concat(Du(t),"\\d*)?)([kmb])$"),"i"),r=e.match(n);if(r){var s=r[1],i=r[3],o=Kze[i.toLowerCase()];return Number(s.replace(t,"."))*o}},Xze=function(e,t){t===void 0&&(t=",");var n=new RegExp(Du(t),"g");return e.replace(n,"")},Qze=function(e,t){var n=Du(t.join("")),r=new RegExp("[^\\d".concat(n,"]"),"gi");return e.replace(r,"")},rz=function(e){var t=e.value,n=e.groupSeparator,r=n===void 0?",":n,s=e.decimalSeparator,i=s===void 0?".":s,o=e.allowDecimals,a=o===void 0?!0:o,c=e.decimalsLimit,d=c===void 0?2:c,h=e.allowNegativeValue,u=h===void 0?!0:h,f=e.disableAbbreviations,g=f===void 0?!1:f,v=e.prefix,m=v===void 0?"":v,x=e.transformRawValue,y=x===void 0?function(he){return he}:x,b=y(t);if(b==="-")return b;var w=g?[]:["k","m","b"],E=new RegExp("((^|\\D)-\\d)|(-".concat(Du(m),")")),R=E.test(b),T=RegExp("(\\d+)-?".concat(Du(m))).exec(t)||[],N=T[0],A=T[1],D=m?N?b.replace(N,"").concat(A):b.replace(m,""):b,O=Xze(D,r),I=Qze(O,Na([r,i],w,!0)),$=I;if(!g){if(w.some(function(he){return he===I.toLowerCase().replace(i,"")}))return"";var F=Yze(I,i);F&&($=String(F))}var B=R&&u?"-":"";if(i&&$.includes(i)){var W=I.split(i),Z=W[0],Y=W[1],H=d&&Y?Y.slice(0,d):Y,se=a?"".concat(i).concat(H):"";return"".concat(B).concat(Z).concat(se)}return"".concat(B).concat($)},Zze=function(e,t,n){if(n!==void 0&&e.length>1){if(n===0)return e.replace(t,"");if(e.includes(t)){var r=e.split(t),s=r[0],i=r[1];if(i.length===n)return e;if(i.length>n)return"".concat(s).concat(t).concat(i.slice(0,n))}var o=e.length>n?new RegExp("(\\d+)(\\d{".concat(n,"})")):new RegExp("(\\d)(\\d+)"),a=e.match(o);if(a){var s=a[1],i=a[2];return"".concat(s).concat(t).concat(i)}}return e},Kue=function(e,t){var n=t.groupSeparator,r=n===void 0?",":n,s=t.decimalSeparator,i=s===void 0?".":s,o=new RegExp("\\d([^".concat(Du(r)).concat(Du(i),"0-9]+)")),a=e.match(o);return a?a[1]:void 0},YS=function(e){var t=e.value,n=e.decimalSeparator,r=e.intlConfig,s=e.decimalScale,i=e.prefix,o=i===void 0?"":i,a=e.suffix,c=a===void 0?"":a;if(t===""||t===void 0)return"";if(t==="-")return"-";var d=new RegExp("^\\d?-".concat(o?"".concat(Du(o),"?"):"","\\d")).test(t),h=n!=="."?Jze(t,n,d):t;n&&n!=="-"&&h.startsWith(n)&&(h="0"+h);var u=r||{},f=u.locale,g=u.currency,v=wW(u,["locale","currency"]),m=Dn(Dn({},v),{minimumFractionDigits:s||0,maximumFractionDigits:20}),x=r?new Intl.NumberFormat(f,Dn(Dn({},m),g&&{style:"currency",currency:g})):new Intl.NumberFormat(void 0,m),y=x.formatToParts(Number(h)),b=eBe(y,e),w=Kue(b,Dn({},e)),E=t.slice(-1)===n?n:"",R=h.match(RegExp("\\d+\\.(\\d+)"))||[],T=R[1];return s===void 0&&T&&n&&(b.includes(n)?b=b.replace(RegExp("(\\d+)(".concat(Du(n),")(\\d+)"),"g"),"$1$2".concat(T)):w&&!c?b=b.replace(w,"".concat(n).concat(T).concat(w)):b="".concat(b).concat(n).concat(T)),c&&E?"".concat(b).concat(E).concat(c):w&&E?b.replace(w,"".concat(E).concat(w)):w&&c?b.replace(w,"".concat(E).concat(c)):[b,E,c].join("")},Jze=function(e,t,n){var r=e;return t&&t!=="."&&(r=r.replace(RegExp(Du(t),"g"),"."),n&&t==="-"&&(r="-".concat(r.slice(1)))),r},eBe=function(e,t){var n=t.prefix,r=t.groupSeparator,s=t.decimalSeparator,i=t.decimalScale,o=t.disableGroupSeparators,a=o===void 0?!1:o;return e.reduce(function(c,d,h){var u=d.type,f=d.value;return h===0&&n?u==="minusSign"?[f,n]:u==="currency"?Na(Na([],c,!0),[n],!1):[n,f]:u==="currency"?n?c:Na(Na([],c,!0),[f],!1):u==="group"?a?c:Na(Na([],c,!0),[r!==void 0?r:f],!1):u==="decimal"?i!==void 0&&i===0?c:Na(Na([],c,!0),[s!==void 0?s:f],!1):u==="fraction"?Na(Na([],c,!0),[i!==void 0?f.slice(0,i):f],!1):Na(Na([],c,!0),[f],!1)},[""]).join("")},tBe={currencySymbol:"",groupSeparator:"",decimalSeparator:"",prefix:"",suffix:""},nBe=function(e){var t=e||{},n=t.locale,r=t.currency,s=wW(t,["locale","currency"]),i=n?new Intl.NumberFormat(n,Dn(Dn({},s),r&&{currency:r,style:"currency"})):new Intl.NumberFormat;return i.formatToParts(1000.1).reduce(function(o,a,c){return a.type==="currency"?c===0?Dn(Dn({},o),{currencySymbol:a.value,prefix:a.value}):Dn(Dn({},o),{currencySymbol:a.value,suffix:a.value}):a.type==="group"?Dn(Dn({},o),{groupSeparator:a.value}):a.type==="decimal"?Dn(Dn({},o),{decimalSeparator:a.value}):o},tBe)},kK=function(e){return RegExp(/\d/,"gi").test(e)},rBe=function(e,t,n){if(n===void 0||t===""||t===void 0||e===""||e===void 0)return e;if(!e.match(/\d/g))return"";var r=e.split(t),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(t).concat(o)},sBe=function(e){var t=e.selectionStart,n=e.value,r=e.lastKeyStroke,s=e.stateValue,i=e.groupSeparator,o=t,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:t}},LO=C.forwardRef(function(e,t){var n=e.allowDecimals,r=n===void 0?!0:n,s=e.allowNegativeValue,i=s===void 0?!0:s,o=e.id,a=e.name,c=e.className,d=e.customInput,h=e.decimalsLimit,u=e.defaultValue,f=e.disabled,g=f===void 0?!1:f,v=e.maxLength,m=e.value,x=e.onValueChange,y=e.fixedDecimalLength,b=e.placeholder,w=e.decimalScale,E=e.prefix,R=e.suffix,T=e.intlConfig,N=e.step,A=e.min,D=e.max,O=e.disableGroupSeparators,I=O===void 0?!1:O,$=e.disableAbbreviations,F=$===void 0?!1:$,B=e.decimalSeparator,W=e.groupSeparator,Z=e.onChange,Y=e.onFocus,H=e.onBlur,se=e.onKeyDown,he=e.onKeyUp,re=e.transformRawValue,J=e.formatValueOnBlur,te=J===void 0?!0:J,ae=wW(e,["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(B&&kK(B))throw new Error("decimalSeparator cannot be a number");if(W&&kK(W))throw new Error("groupSeparator cannot be a number");var be=C.useMemo(function(){return nBe(T)},[T]),xe=B||be.decimalSeparator||"",ve=W||be.groupSeparator||"";if(xe&&ve&&xe===ve&&I===!1)throw new Error("decimalSeparator cannot be the same as groupSeparator");var Pe={decimalSeparator:xe,groupSeparator:ve,disableGroupSeparators:I,intlConfig:T,prefix:E||be.prefix,suffix:R},Oe={decimalSeparator:xe,groupSeparator:ve,allowDecimals:r,decimalsLimit:h||y||2,allowNegativeValue:i,disableAbbreviations:F,prefix:E||be.prefix,transformRawValue:re},ke=C.useState(function(){return u!=null?YS(Dn(Dn({},Pe),{decimalScale:w,value:String(u)})):m!=null?YS(Dn(Dn({},Pe),{decimalScale:w,value:String(m)})):""}),ze=ke[0],$e=ke[1],Te=C.useState(!1),Ue=Te[0],wt=Te[1],ut=C.useState(0),St=ut[0],Nn=ut[1],cn=C.useState(0),hn=cn[0],It=cn[1],U=C.useState(null),ee=U[0],ie=U[1],_e=C.useRef(null);C.useImperativeHandle(t,function(){return _e.current});var we=function(Yt,un){wt(!0);var xn=sBe({selectionStart:un,value:Yt,lastKeyStroke:ee,stateValue:ze,groupSeparator:ve}),Ze=xn.modifiedValue,Rt=xn.cursorPosition,Pt=rz(Dn({value:Ze},Oe));if(!(v&&Pt.replace(/-/g,"").length>v)){if(Pt===""||Pt==="-"||Pt===xe){x&&x(void 0,a,{float:null,formatted:"",value:""}),$e(Pt),Nn(1);return}var Ut=xe?Pt.replace(xe,"."):Pt,yt=parseFloat(Ut),dn=YS(Dn({value:Pt},Pe));if(Rt!=null){var Gt=Rt+(dn.length-Yt.length);Gt=Gt<=0?E?E.length:0:Gt,Nn(Gt),It(hn+1)}if($e(dn),x){var Hn={float:yt,formatted:dn,value:Pt};x(Pt,a,Hn)}}},pe=function(Yt){var un=Yt.target,xn=un.value,Ze=un.selectionStart;we(xn,Ze),Z&&Z(Yt)},Se=function(Yt){return Y&&Y(Yt),ze?ze.length:0},Fe=function(Yt){var un=Yt.target.value,xn=rz(Dn({value:un},Oe));if(xn==="-"||xn===xe||!xn){$e(""),H&&H(Yt);return}var Ze=Zze(xn,xe,y),Rt=rBe(Ze,xe,w!==void 0?w:y),Pt=xe?Rt.replace(xe,"."):Rt,Ut=parseFloat(Pt),yt=YS(Dn(Dn({},Pe),{value:Rt}));x&&te&&x(Rt,a,{float:Ut,formatted:yt,value:Rt}),$e(yt),H&&H(Yt)},ft=function(Yt){var un=Yt.key;if(ie(un),N&&(un==="ArrowUp"||un==="ArrowDown")){Yt.preventDefault(),Nn(ze.length);var xn=m!=null?String(m):void 0,Ze=xe&&xn?xn.replace(xe,"."):xn,Rt=parseFloat(Ze??rz(Dn({value:ze},Oe)))||0,Pt=un==="ArrowUp"?Rt+N:Rt-N;if(A!==void 0&&Pt<Number(A)||!i&&Pt<0||D!==void 0&&Pt>Number(D))return;var Ut=String(N).includes(".")?Number(String(N).split(".")[1].length):void 0;we(String(Ut?Pt.toFixed(Ut):Pt).replace(".",xe))}se&&se(Yt)},ht=function(Yt){var un=Yt.key,xn=Yt.currentTarget.selectionStart;if(un!=="ArrowUp"&&un!=="ArrowDown"&&ze!=="-"){var Ze=Kue(ze,{groupSeparator:ve,decimalSeparator:xe});if(Ze&&xn&&xn>ze.length-Ze.length&&_e.current){var Rt=ze.length-Ze.length;_e.current.setSelectionRange(Rt,Rt)}}he&&he(Yt)};C.useEffect(function(){m==null&&u==null&&$e("")},[u,m]),C.useEffect(function(){Ue&&ze!=="-"&&_e.current&&document.activeElement===_e.current&&_e.current.setSelectionRange(St,St)},[ze,St,_e,Ue,hn]);var hs=function(){return m!=null&&ze!=="-"&&(!xe||ze!==xe)?YS(Dn(Dn({},Pe),{decimalScale:Ue?void 0:w,value:String(m)})):ze},Mn=Dn({type:"text",inputMode:"decimal",id:o,name:a,className:c,onChange:pe,onBlur:Fe,onFocus:Se,onKeyDown:ft,onKeyUp:ht,placeholder:b,disabled:g,value:hs(),ref:_e},ae);if(d){var Hr=d;return fe.createElement(Hr,Dn({},Mn))}return fe.createElement("input",Dn({},Mn))});LO.displayName="CurrencyInput";const xy=C.forwardRef(({children:e,...t},n)=>{var i;const{error:r}=Wx();let s=e;return r&&(r.message?s=String((r==null?void 0:r.message)||((i=r.root)==null?void 0:i.message)):r.type==="required"&&(s=ue("common.required_field"))),_.jsx(Hse,{ref:n,...t,children:s})});xy.displayName="FormErrorMessage";const _y=fe.forwardRef(({label:e,hint:t,required:n,...r},s)=>{const{error:i}=Wx(),o=t||(n?ue("common.required"):""),a=i?"text-destructive font-semibold":"";return _.jsxs(Vse,{ref:s,className:"flex justify-between text-sm",...r,children:[_.jsx("span",{className:`block font-semibold ${a}`,children:e}),o&&_.jsx("span",{className:`text-xs font-medium text-primary ${a} `,children:o})]})});_y.displayName="FormLabel";const iBe=Io("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"}}),iN=C.forwardRef(e=>{const{name:t,label:n,hint:r,description:s,placeholder:i,className:o,disabled:a,defaultValue:c,rules:d,readOnly:h,scale:u,currency:f,language:g,variant:v}=e,{control:m}=ua(),[x,y]=C.useState(""),b={input:w=>{if(w==null||typeof w!="object")return w;const E=No.create(w);if(E.isFailure)throw console.error(E.error),E.error;const R=E.object.toString();return x.endsWith(",")?R.replace(/.0$/,","):R},output:(w,E,R)=>{const{value:T}=R??{value:null};y(T??"");const N=No.createFromFormattedValue(T,f.code,u);if(N.isFailure)throw N.error;return N.object.toObject()}};return _.jsx(Hx,{defaultValue:c,control:m,name:t,disabled:a,rules:d,render:({field:w})=>{const E=b.input(w.value),R=a||w.disabled,T=!!((d==null?void 0:d.required)??!1);return _.jsxs(vy,{className:ge(o,"space-y-3"),children:[n&&_.jsx(_y,{label:n,hint:r,required:T}),_.jsx(yy,{children:_.jsx(LO,{intlConfig:{locale:g.code,useGrouping:!0},name:w.name,ref:w.ref,onBlur:w.onBlur,disabled:R,readOnly:h,className:ge(iBe({variant:v,className:o})),suffix:` ${f==null?void 0:f.symbol}`,groupSeparator:".",decimalSeparator:",",placeholder:i,decimalsLimit:u,decimalScale:u,step:1,value:E,onValueChange:(N,A,D)=>w.onChange(b.output(N,A,D))})}),s&&_.jsx(by,{children:s}),_.jsx(xy,{})]})}})});iN.displayName="FormCurrencyField";const Yue=C.forwardRef((e,t)=>{const{label:n,placeholder:r,hint:s,description:i,required:o,disabled:a,className:c,name:d}=e,{control:h}=ua(),[u,f]=C.useState(!1);return _.jsx(Hx,{control:h,disabled:a,name:d,rules:{required:o},render:({field:g})=>_.jsxs(vy,{ref:t,className:ge(c,"flex flex-col space-y-3"),children:[n&&_.jsx(_y,{label:n,hint:s,required:o}),_.jsxs(YMe,{open:u,onOpenChange:f,children:[_.jsx(XMe,{asChild:!0,children:_.jsx(yy,{children:_.jsxs(at,{disabled:a,variant:"ghost",className:ge("pl-3 text-left font-normal","border border-input ",!g.value&&"text-muted-foreground"),children:[g.value?new Date(g.value).toLocaleDateString():r||_.jsx("span",{children:ue("common.pick_date")}),_.jsx(Yye,{className:ge("w-4 h-4 ml-auto disabled:opacity-50 ",a?"text-foreground":"text-ring")})]})})}),_.jsx(loe,{className:"w-auto p-0",align:"start",children:_.jsx(nte,{className:"bg-background",mode:"single",captionLayout:"buttons",defaultMonth:g.value,selected:new Date(g.value),onSelect:v=>{g.onChange(v),f(!1)},disabled:v=>v<new Date("1980-01-01"),weekStartsOn:1,fixedWeeks:!0,fromYear:2024,toYear:new Date().getFullYear()+1,initialFocus:!0})})]}),i&&_.jsx(by,{children:i}),_.jsx(xy,{})]})})}),rk=fe.forwardRef(({className:e,title:t,description:n,actions:r,footerActions:s,children:i},o)=>{const a=fe.useId(),c=C.useMemo(()=>t||n||r,[t,n,r]);return _.jsxs(bs,{id:a,className:ge(c?"":"pt-6",e),ref:o,children:[c&&_.jsxs(Go,{className:"flex flex-row flex-wrap items-center justify-between sm:flex-nowrap",children:[_.jsxs("div",{children:[t&&_.jsx(ui,{className:"text-lg leading-normal",children:t}),n&&_.jsx(Di,{className:"leading-loose",children:n})]}),r&&_.jsx("div",{className:"flex-shrink-0",children:r})]}),_.jsx(xs,{className:"grid items-start gap-6",children:i}),s&&_.jsx(fl,{className:"px-6 py-4 border-t",style:{borderStyle:"inherit"},children:s})]})});rk.displayName="FormGroup";const oBe=Io("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"}}),sk=C.forwardRef(e=>{const{name:t,label:n,hint:r,description:s,placeholder:i,className:o,disabled:a,defaultValue:c,rules:d,readOnly:h,scale:u,variant:f}=e,{control:g}=ua(),[v,m]=C.useState(""),x={input:y=>{if(typeof y!="object")return y;const b=Tu.create(y);if(b.isFailure)throw b.error;const w=b.object.toString();return v.endsWith(",")?w.replace(/.0$/,","):w},output:(y,b,w)=>{const{value:E}=w??{value:null};m(E??"");const R=Tu.createFromFormattedValue(E);if(R.isFailure)throw R.error;return R.object.toObject()}};return _.jsx(Hx,{defaultValue:c,control:g,name:t,disabled:a,rules:{max:100,min:0,...d},render:({field:y})=>{const b=x.input(y.value),w=a||y.disabled,E=!!((d==null?void 0:d.required)??!1);return _.jsxs(vy,{className:ge(o,"space-y-3"),children:[n&&_.jsx(_y,{label:n,hint:r,required:E}),_.jsx(yy,{children:_.jsx(LO,{name:y.name,ref:y.ref,onBlur:y.onBlur,disabled:w,readOnly:h,className:ge(oBe({variant:f,className:o})),groupSeparator:".",decimalSeparator:",",placeholder:i,allowDecimals:u!==0,decimalsLimit:u,decimalScale:u,step:1,value:b,onValueChange:(R,T,N)=>y.onChange(x.output(R,T,N))})}),s&&_.jsx(by,{children:s}),_.jsx(xy,{})]})}})}),aBe=Io("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"}}),lBe=C.forwardRef(e=>{const{name:t,label:n,hint:r,description:s,placeholder:i,className:o,disabled:a,defaultValue:c,rules:d,readOnly:h,scale:u,variant:f}=e,{control:g}=ua(),[v,m]=C.useState(""),x={input:y=>{if(typeof y!="object")return y;const b=xp.create(y);if(b.isFailure)throw b.error;const w=b.object.toString();return v.endsWith(",")?w.replace(/.0$/,","):w},output:(y,b,w)=>{const{value:E}=w??{value:null};m(E??"");const R=xp.createFromFormattedValue(E);if(R.isFailure)throw R.error;return R.object.toObject()}};return _.jsx(Hx,{defaultValue:c,control:g,name:t,disabled:a,rules:d,render:({field:y})=>{const b=x.input(y.value),w=a||y.disabled,E=!!((d==null?void 0:d.required)??!1);return _.jsxs(vy,{className:ge(o,"space-y-3"),children:[n&&_.jsx(_y,{label:n,hint:r,required:E}),_.jsx(yy,{children:_.jsx(LO,{name:y.name,ref:y.ref,onBlur:y.onBlur,disabled:w,readOnly:h,className:ge(aBe({variant:f,className:o})),groupSeparator:".",decimalSeparator:",",placeholder:i,allowDecimals:u!==0,decimalsLimit:u,decimalScale:u,step:1,value:b,onValueChange:(R,T,N)=>y.onChange(x.output(R,T,N))})}),s&&_.jsx(by,{children:s}),_.jsx(xy,{})]})}})}),DK=Io("",{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"}}),gc=C.forwardRef(({name:e,label:t,hint:n,placeholder:r,description:s,required:i,className:o,autoSize:a,variant:c,...d})=>{const{control:h}=ua();return _.jsx(Hx,{control:h,name:e,rules:{required:i},render:({field:u,fieldState:f})=>_.jsxs(vy,{className:ge(o,"flex flex-col space-y-3"),children:[t&&_.jsx(_y,{label:t,hint:n,required:i}),_.jsx(yy,{className:"grow",children:a?_.jsx(Ree,{placeholder:r,className:ge(f.error?"border-destructive focus-visible:ring-destructive":"","resize-y",DK({variant:c,className:o})),...d,...u}):_.jsx(Tle,{placeholder:r,className:ge(f.error?"border-destructive focus-visible:ring-destructive":"","resize-y",DK({variant:c,className:o})),...d,...u})}),s&&_.jsx(by,{children:s}),_.jsx(xy,{})]})})}),cBe=Io("",{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"}}),mg=C.forwardRef(e=>{const{name:t,label:n,hint:r,description:s,placeholder:i,className:o,disabled:a,rules:c,required:d,type:h,variant:u}=e,{control:f}=ua();return _.jsx(Hx,{control:f,name:t,disabled:a,rules:{required:d,...c},render:({field:g,fieldState:v})=>{const m=!!((c==null?void 0:c.required)??d);return _.jsxs(vy,{className:ge(o,"space-y-3"),children:[n&&_.jsx(_y,{label:n,hint:r,required:m}),_.jsx(yy,{className:"block",children:_.jsx(cR,{type:h,placeholder:i,className:ge(v.error?"border-destructive focus-visible:ring-destructive":"",cBe({variant:u,className:o})),...g})}),s&&_.jsx(by,{children:s}),_.jsx(xy,{})]})}})}),e_=({className:e,children:t})=>_.jsx(Nhe,{children:_.jsx("div",{className:ge("flex flex-col w-full min-h-screen",e),children:t})});e_.displayName="Layout";const t_=({className:e,children:t})=>_.jsxs(_.Fragment,{children:[_.jsx("main",{className:ge("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",e),children:t}),_.jsx(tce,{})]});t_.displayName="LayoutContent";const OK=(e,t,n)=>{if(e&&"reportValidity"in e){const r=Ye(n,t);e.setCustomValidity(r&&r.message||""),e.reportValidity()}},Xue=(e,t)=>{for(const n in t.fields){const r=t.fields[n];r&&r.ref&&"reportValidity"in r.ref?OK(r.ref,n,e):r.refs&&r.refs.forEach(s=>OK(s,n,e))}},uBe=(e,t)=>{t.shouldUseNativeValidation&&Xue(e,t);const n={};for(const r in e){const s=Ye(t.fields,r),i=Object.assign(e[r]||{},{ref:s&&s.ref});if(dBe(t.names||Object.keys(e),r)){const o=Object.assign({},Ye(n,r));kn(o,"root",i),kn(n,r,o)}else kn(n,r,i)}return n},dBe=(e,t)=>e.some(n=>n.startsWith(t+"."));var SW=function(e,t,n){return t===void 0&&(t={abortEarly:!1}),n===void 0&&(n={}),function(r,s,i){try{var o=function(){return c.error?{values:{},errors:uBe((h=c.error,u=!i.shouldUseNativeValidation&&i.criteriaMode==="all",h.details.length?h.details.reduce(function(f,g){var v=g.path.join(".");if(f[v]||(f[v]={message:g.message,type:g.type}),u){var m=f[v].types,x=m&&m[g.type];f[v]=kse(v,u,f,g.type,x?[].concat(x,g.message):g.message)}return f},{}):{}),i)}:(i.shouldUseNativeValidation&&Xue({},i),{errors:{},values:c.value});var h,u},a=Object.assign({},t,{context:s}),c={},d=function(){if(n.mode==="sync")c=e.validate(r,a);else{var h=function(u,f){try{var g=u()}catch(v){return f(v)}return g&&g.then?g.then(void 0,f):g}(function(){return Promise.resolve(e.validateAsync(r,a)).then(function(u){c.value=u})},function(u){c.error=u});if(h&&h.then)return h.then(function(){})}}();return Promise.resolve(d&&d.then?d.then(o):o())}catch(h){return Promise.reject(h)}}},Que={exports:{}};(function(e,t){(function(n,r){e.exports=r()})(self,()=>{return n={7629:(s,i,o)=>{const a=o(375),c=o(8571),d=o(9474),h=o(1687),u=o(8652),f=o(8160),g=o(3292),v=o(6354),m=o(8901),x=o(9708),y=o(6914),b=o(2294),w=o(6133),E=o(1152),R=o(8863),T=o(2036),N={Base:class{constructor(A){this.type=A,this.$_root=null,this._definition={},this._reset()}_reset(){this._ids=new b.Ids,this._preferences=null,this._refs=new w.Manager,this._cache=null,this._valids=null,this._invalids=null,this._flags={},this._rules=[],this._singleRules=new Map,this.$_terms={},this.$_temp={ruleset:null,whens:{}}}describe(){return a(typeof x.describe=="function","Manifest functionality disabled"),x.describe(this)}allow(...A){return f.verifyFlat(A,"allow"),this._values(A,"_valids")}alter(A){a(A&&typeof A=="object"&&!Array.isArray(A),"Invalid targets argument"),a(!this._inRuleset(),"Cannot set alterations inside a ruleset");const D=this.clone();D.$_terms.alterations=D.$_terms.alterations||[];for(const O in A){const I=A[O];a(typeof I=="function","Alteration adjuster for",O,"must be a function"),D.$_terms.alterations.push({target:O,adjuster:I})}return D.$_temp.ruleset=!1,D}artifact(A){return a(A!==void 0,"Artifact cannot be undefined"),a(!this._cache,"Cannot set an artifact with a rule cache"),this.$_setFlag("artifact",A)}cast(A){return a(A===!1||typeof A=="string","Invalid to value"),a(A===!1||this._definition.cast[A],"Type",this.type,"does not support casting to",A),this.$_setFlag("cast",A===!1?void 0:A)}default(A,D){return this._default("default",A,D)}description(A){return a(A&&typeof A=="string","Description must be a non-empty string"),this.$_setFlag("description",A)}empty(A){const D=this.clone();return A!==void 0&&(A=D.$_compile(A,{override:!1})),D.$_setFlag("empty",A,{clone:!1})}error(A){return a(A,"Missing error"),a(A instanceof Error||typeof A=="function","Must provide a valid Error object or a function"),this.$_setFlag("error",A)}example(A,D={}){return a(A!==void 0,"Missing example"),f.assertOptions(D,["override"]),this._inner("examples",A,{single:!0,override:D.override})}external(A,D){return typeof A=="object"&&(a(!D,"Cannot combine options with description"),D=A.description,A=A.method),a(typeof A=="function","Method must be a function"),a(D===void 0||D&&typeof D=="string","Description must be a non-empty string"),this._inner("externals",{method:A,description:D},{single:!0})}failover(A,D){return this._default("failover",A,D)}forbidden(){return this.presence("forbidden")}id(A){return A?(a(typeof A=="string","id must be a non-empty string"),a(/^[^\.]+$/.test(A),"id cannot contain period character"),this.$_setFlag("id",A)):this.$_setFlag("id",void 0)}invalid(...A){return this._values(A,"_invalids")}label(A){return a(A&&typeof A=="string","Label name must be a non-empty string"),this.$_setFlag("label",A)}meta(A){return a(A!==void 0,"Meta cannot be undefined"),this._inner("metas",A,{single:!0})}note(...A){a(A.length,"Missing notes");for(const D of A)a(D&&typeof D=="string","Notes must be non-empty strings");return this._inner("notes",A)}only(A=!0){return a(typeof A=="boolean","Invalid mode:",A),this.$_setFlag("only",A)}optional(){return this.presence("optional")}prefs(A){a(A,"Missing preferences"),a(A.context===void 0,"Cannot override context"),a(A.externals===void 0,"Cannot override externals"),a(A.warnings===void 0,"Cannot override warnings"),a(A.debug===void 0,"Cannot override debug"),f.checkPreferences(A);const D=this.clone();return D._preferences=f.preferences(D._preferences,A),D}presence(A){return a(["optional","required","forbidden"].includes(A),"Unknown presence mode",A),this.$_setFlag("presence",A)}raw(A=!0){return this.$_setFlag("result",A?"raw":void 0)}result(A){return a(["raw","strip"].includes(A),"Unknown result mode",A),this.$_setFlag("result",A)}required(){return this.presence("required")}strict(A){const D=this.clone(),O=A!==void 0&&!A;return D._preferences=f.preferences(D._preferences,{convert:O}),D}strip(A=!0){return this.$_setFlag("result",A?"strip":void 0)}tag(...A){a(A.length,"Missing tags");for(const D of A)a(D&&typeof D=="string","Tags must be non-empty strings");return this._inner("tags",A)}unit(A){return a(A&&typeof A=="string","Unit name must be a non-empty string"),this.$_setFlag("unit",A)}valid(...A){f.verifyFlat(A,"valid");const D=this.allow(...A);return D.$_setFlag("only",!!D._valids,{clone:!1}),D}when(A,D){const O=this.clone();O.$_terms.whens||(O.$_terms.whens=[]);const I=g.when(O,A,D);if(!["any","link"].includes(O.type)){const $=I.is?[I]:I.switch;for(const F of $)a(!F.then||F.then.type==="any"||F.then.type===O.type,"Cannot combine",O.type,"with",F.then&&F.then.type),a(!F.otherwise||F.otherwise.type==="any"||F.otherwise.type===O.type,"Cannot combine",O.type,"with",F.otherwise&&F.otherwise.type)}return O.$_terms.whens.push(I),O.$_mutateRebuild()}cache(A){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 D=this.clone();return D._cache=A||u.provider.provision(),D.$_temp.ruleset=!1,D}clone(){const A=Object.create(Object.getPrototypeOf(this));return this._assign(A)}concat(A){a(f.isSchema(A),"Invalid schema object"),a(this.type==="any"||A.type==="any"||A.type===this.type,"Cannot merge type",this.type,"with another type:",A.type),a(!this._inRuleset(),"Cannot concatenate onto a schema with open ruleset"),a(!A._inRuleset(),"Cannot concatenate a schema with open ruleset");let D=this.clone();if(this.type==="any"&&A.type!=="any"){const O=A.clone();for(const I of Object.keys(D))I!=="type"&&(O[I]=D[I]);D=O}D._ids.concat(A._ids),D._refs.register(A,w.toSibling),D._preferences=D._preferences?f.preferences(D._preferences,A._preferences):A._preferences,D._valids=T.merge(D._valids,A._valids,A._invalids),D._invalids=T.merge(D._invalids,A._invalids,A._valids);for(const O of A._singleRules.keys())D._singleRules.has(O)&&(D._rules=D._rules.filter(I=>I.keep||I.name!==O),D._singleRules.delete(O));for(const O of A._rules)A._definition.rules[O.method].multi||D._singleRules.set(O.name,O),D._rules.push(O);if(D._flags.empty&&A._flags.empty){D._flags.empty=D._flags.empty.concat(A._flags.empty);const O=Object.assign({},A._flags);delete O.empty,h(D._flags,O)}else if(A._flags.empty){D._flags.empty=A._flags.empty;const O=Object.assign({},A._flags);delete O.empty,h(D._flags,O)}else h(D._flags,A._flags);for(const O in A.$_terms){const I=A.$_terms[O];I?D.$_terms[O]?D.$_terms[O]=D.$_terms[O].concat(I):D.$_terms[O]=I.slice():D.$_terms[O]||(D.$_terms[O]=I)}return this.$_root._tracer&&this.$_root._tracer._combine(D,[this,A]),D.$_mutateRebuild()}extend(A){return a(!A.base,"Cannot extend type with another base"),m.type(this,A)}extract(A){return A=Array.isArray(A)?A:A.split("."),this._ids.reach(A)}fork(A,D){a(!this._inRuleset(),"Cannot fork inside a ruleset");let O=this;for(let I of[].concat(A))I=Array.isArray(I)?I:I.split("."),O=O._ids.fork(I,D,O);return O.$_temp.ruleset=!1,O}rule(A){const D=this._definition;f.assertOptions(A,Object.keys(D.modifiers)),a(this.$_temp.ruleset!==!1,"Cannot apply rules to empty ruleset or the last rule added does not support rule properties");const O=this.$_temp.ruleset===null?this._rules.length-1:this.$_temp.ruleset;a(O>=0&&O<this._rules.length,"Cannot apply rules to empty ruleset");const I=this.clone();for(let $=O;$<I._rules.length;++$){const F=I._rules[$],B=c(F);for(const W in A)D.modifiers[W](B,A[W]),a(B.name===F.name,"Cannot change rule name");I._rules[$]=B,I._singleRules.get(B.name)===F&&I._singleRules.set(B.name,B)}return I.$_temp.ruleset=!1,I.$_mutateRebuild()}get ruleset(){a(!this._inRuleset(),"Cannot start a new ruleset without closing the previous one");const A=this.clone();return A.$_temp.ruleset=A._rules.length,A}get $(){return this.ruleset}tailor(A){A=[].concat(A),a(!this._inRuleset(),"Cannot tailor inside a ruleset");let D=this;if(this.$_terms.alterations)for(const{target:O,adjuster:I}of this.$_terms.alterations)A.includes(O)&&(D=I(D),a(f.isSchema(D),"Alteration adjuster for",O,"failed to return a schema object"));return D=D.$_modify({each:O=>O.tailor(A),ref:!1}),D.$_temp.ruleset=!1,D.$_mutateRebuild()}tracer(){return E.location?E.location(this):this}validate(A,D){return R.entry(A,this,D)}validateAsync(A,D){return R.entryAsync(A,this,D)}$_addRule(A){typeof A=="string"&&(A={name:A}),a(A&&typeof A=="object","Invalid options"),a(A.name&&typeof A.name=="string","Invalid rule name");for(const F in A)a(F[0]!=="_","Cannot set private rule properties");const D=Object.assign({},A);D._resolve=[],D.method=D.method||D.name;const O=this._definition.rules[D.method],I=D.args;a(O,"Unknown rule",D.method);const $=this.clone();if(I){a(Object.keys(I).length===1||Object.keys(I).length===this._definition.rules[D.name].args.length,"Invalid rule definition for",this.type,D.name);for(const F in I){let B=I[F];if(O.argsByName){const W=O.argsByName.get(F);if(W.ref&&f.isResolvable(B))D._resolve.push(F),$.$_mutateRegister(B);else if(W.normalize&&(B=W.normalize(B),I[F]=B),W.assert){const Z=f.validateArg(B,F,W);a(!Z,Z,"or reference")}}B!==void 0?I[F]=B:delete I[F]}}return O.multi||($._ruleRemove(D.name,{clone:!1}),$._singleRules.set(D.name,D)),$.$_temp.ruleset===!1&&($.$_temp.ruleset=null),O.priority?$._rules.unshift(D):$._rules.push(D),$}$_compile(A,D){return g.schema(this.$_root,A,D)}$_createError(A,D,O,I,$,F={}){const B=F.flags!==!1?this._flags:{},W=F.messages?y.merge(this._definition.messages,F.messages):this._definition.messages;return new v.Report(A,D,O,B,W,I,$)}$_getFlag(A){return this._flags[A]}$_getRule(A){return this._singleRules.get(A)}$_mapLabels(A){return A=Array.isArray(A)?A:A.split("."),this._ids.labels(A)}$_match(A,D,O,I){(O=Object.assign({},O)).abortEarly=!0,O._externals=!1,D.snapshot();const $=!R.validate(A,this,D,O,I).errors;return D.restore(),$}$_modify(A){return f.assertOptions(A,["each","once","ref","schema"]),b.schema(this,A)||this}$_mutateRebuild(){return a(!this._inRuleset(),"Cannot add this rule inside a ruleset"),this._refs.reset(),this._ids.reset(),this.$_modify({each:(A,{source:D,name:O,path:I,key:$})=>{const F=this._definition[D][O]&&this._definition[D][O].register;F!==!1&&this.$_mutateRegister(A,{family:F,key:$})}}),this._definition.rebuild&&this._definition.rebuild(this),this.$_temp.ruleset=!1,this}$_mutateRegister(A,{family:D,key:O}={}){this._refs.register(A,D),this._ids.register(A,{key:O})}$_property(A){return this._definition.properties[A]}$_reach(A){return this._ids.reach(A)}$_rootReferences(){return this._refs.roots()}$_setFlag(A,D,O={}){a(A[0]==="_"||!this._inRuleset(),"Cannot set flag inside a ruleset");const I=this._definition.flags[A]||{};if(d(D,I.default)&&(D=void 0),d(D,this._flags[A]))return this;const $=O.clone!==!1?this.clone():this;return D!==void 0?($._flags[A]=D,$.$_mutateRegister(D)):delete $._flags[A],A[0]!=="_"&&($.$_temp.ruleset=!1),$}$_parent(A,...D){return this[A][f.symbols.parent].call(this,...D)}$_validate(A,D,O){return R.validate(A,this,D,O)}_assign(A){A.type=this.type,A.$_root=this.$_root,A.$_temp=Object.assign({},this.$_temp),A.$_temp.whens={},A._ids=this._ids.clone(),A._preferences=this._preferences,A._valids=this._valids&&this._valids.clone(),A._invalids=this._invalids&&this._invalids.clone(),A._rules=this._rules.slice(),A._singleRules=c(this._singleRules,{shallow:!0}),A._refs=this._refs.clone(),A._flags=Object.assign({},this._flags),A._cache=null,A.$_terms={};for(const D in this.$_terms)A.$_terms[D]=this.$_terms[D]?this.$_terms[D].slice():null;A.$_super={};for(const D in this.$_super)A.$_super[D]=this._super[D].bind(A);return A}_bare(){const A=this.clone();A._reset();const D=A._definition.terms;for(const O in D){const I=D[O];A.$_terms[O]=I.init}return A.$_mutateRebuild()}_default(A,D,O={}){return f.assertOptions(O,"literal"),a(D!==void 0,"Missing",A,"value"),a(typeof D=="function"||!O.literal,"Only function value supports literal option"),typeof D=="function"&&O.literal&&(D={[f.symbols.literal]:!0,literal:D}),this.$_setFlag(A,D)}_generate(A,D,O){if(!this.$_terms.whens)return{schema:this};const I=[],$=[];for(let W=0;W<this.$_terms.whens.length;++W){const Z=this.$_terms.whens[W];if(Z.concat){I.push(Z.concat),$.push(`${W}.concat`);continue}const Y=Z.ref?Z.ref.resolve(A,D,O):A,H=Z.is?[Z]:Z.switch,se=$.length;for(let he=0;he<H.length;++he){const{is:re,then:J,otherwise:te}=H[he],ae=`${W}${Z.switch?"."+he:""}`;if(re.$_match(Y,D.nest(re,`${ae}.is`),O)){if(J){const be=D.localize([...D.path,`${ae}.then`],D.ancestors,D.schemas),{schema:xe,id:ve}=J._generate(A,be,O);I.push(xe),$.push(`${ae}.then${ve?`(${ve})`:""}`);break}}else if(te){const be=D.localize([...D.path,`${ae}.otherwise`],D.ancestors,D.schemas),{schema:xe,id:ve}=te._generate(A,be,O);I.push(xe),$.push(`${ae}.otherwise${ve?`(${ve})`:""}`);break}}if(Z.break&&$.length>se)break}const F=$.join(", ");if(D.mainstay.tracer.debug(D,"rule","when",F),!F)return{schema:this};if(!D.mainstay.tracer.active&&this.$_temp.whens[F])return{schema:this.$_temp.whens[F],id:F};let B=this;this._definition.generate&&(B=this._definition.generate(this,A,D,O));for(const W of I)B=B.concat(W);return this.$_root._tracer&&this.$_root._tracer._combine(B,[this,...I]),this.$_temp.whens[F]=B,{schema:B,id:F}}_inner(A,D,O={}){a(!this._inRuleset(),`Cannot set ${A} inside a ruleset`);const I=this.clone();return I.$_terms[A]&&!O.override||(I.$_terms[A]=[]),O.single?I.$_terms[A].push(D):I.$_terms[A].push(...D),I.$_temp.ruleset=!1,I}_inRuleset(){return this.$_temp.ruleset!==null&&this.$_temp.ruleset!==!1}_ruleRemove(A,D={}){if(!this._singleRules.has(A))return this;const O=D.clone!==!1?this.clone():this;O._singleRules.delete(A);const I=[];for(let $=0;$<O._rules.length;++$){const F=O._rules[$];F.name!==A||F.keep?I.push(F):O._inRuleset()&&$<O.$_temp.ruleset&&--O.$_temp.ruleset}return O._rules=I,O}_values(A,D){f.verifyFlat(A,D.slice(1,-1));const O=this.clone(),I=A[0]===f.symbols.override;if(I&&(A=A.slice(1)),!O[D]&&A.length?O[D]=new T:I&&(O[D]=A.length?new T:null,O.$_mutateRebuild()),!O[D])return O;I&&O[D].override();for(const $ of A){a($!==void 0,"Cannot call allow/valid/invalid with undefined"),a($!==f.symbols.override,"Override must be the first value");const F=D==="_invalids"?"_valids":"_invalids";O[F]&&(O[F].remove($),O[F].length||(a(D==="_valids"||!O._flags.only,"Setting invalid value",$,"leaves schema rejecting all values due to previous valid rule"),O[F]=null)),O[D].add($,O._refs)}return O}}};N.Base.prototype[f.symbols.any]={version:f.version,compile:g.compile,root:"$_root"},N.Base.prototype.isImmutable=!0,N.Base.prototype.deny=N.Base.prototype.invalid,N.Base.prototype.disallow=N.Base.prototype.invalid,N.Base.prototype.equal=N.Base.prototype.valid,N.Base.prototype.exist=N.Base.prototype.required,N.Base.prototype.not=N.Base.prototype.invalid,N.Base.prototype.options=N.Base.prototype.prefs,N.Base.prototype.preferences=N.Base.prototype.prefs,s.exports=new N.Base},8652:(s,i,o)=>{const a=o(375),c=o(8571),d=o(8160),h={max:1e3,supported:new Set(["undefined","boolean","number","string"])};i.provider={provision:u=>new h.Cache(u)},h.Cache=class{constructor(u={}){d.assertOptions(u,["max"]),a(u.max===void 0||u.max&&u.max>0&&isFinite(u.max),"Invalid max cache size"),this._max=u.max||h.max,this._map=new Map,this._list=new h.List}get length(){return this._map.size}set(u,f){if(u!==null&&!h.supported.has(typeof u))return;let g=this._map.get(u);if(g)return g.value=f,void this._list.first(g);g=this._list.unshift({key:u,value:f}),this._map.set(u,g),this._compact()}get(u){const f=this._map.get(u);if(f)return this._list.first(f),c(f.value)}_compact(){if(this._map.size>this._max){const u=this._list.pop();this._map.delete(u.key)}}},h.List=class{constructor(){this.tail=null,this.head=null}unshift(u){return u.next=null,u.prev=this.head,this.head&&(this.head.next=u),this.head=u,this.tail||(this.tail=u),u}first(u){u!==this.head&&(this._remove(u),this.unshift(u))}pop(){return this._remove(this.tail)}_remove(u){const{next:f,prev:g}=u;return f.prev=g,g&&(g.next=f),u===this.tail&&(this.tail=f),u.prev=null,u.next=null,u}}},8160:(s,i,o)=>{const a=o(375),c=o(7916),d=o(5934);let h,u;const f={isoDate:/^(?:[-+]\d{2})?(?:\d{4}(?!\d{2}\b))(?:(-?)(?:(?:0[1-9]|1[0-2])(?:\1(?:[12]\d|0[1-9]|3[01]))?|W(?:[0-4]\d|5[0-2])(?:-?[1-7])?|(?:00[1-9]|0[1-9]\d|[12]\d{2}|3(?:[0-5]\d|6[1-6])))(?![T]$|[T][\d]+Z$)(?:[T\s](?:(?:(?:[01]\d|2[0-3])(?:(:?)[0-5]\d)?|24\:?00)(?:[.,]\d+(?!:))?)(?:\2[0-5]\d(?:[.,]\d+)?)?(?:[Z]|(?:[+-])(?:[01]\d|2[0-3])(?::?[0-5]\d)?)?)?)?$/};i.version=d.version,i.defaults={abortEarly:!0,allowUnknown:!1,artifacts:!1,cache:!0,context:null,convert:!0,dateFormat:"iso",errors:{escapeHtml:!1,label:"path",language:null,render:!0,stack:!1,wrap:{label:'"',array:"[]"}},externals:!0,messages:{},nonEnumerables:!1,noDefaults:!1,presence:"optional",skipFunctions:!1,stripUnknown:!1,warnings:!1},i.symbols={any:Symbol.for("@hapi/joi/schema"),arraySingle:Symbol("arraySingle"),deepDefault:Symbol("deepDefault"),errors:Symbol("errors"),literal:Symbol("literal"),override:Symbol("override"),parent:Symbol("parent"),prefs:Symbol("prefs"),ref:Symbol("ref"),template:Symbol("template"),values:Symbol("values")},i.assertOptions=function(g,v,m="Options"){a(g&&typeof g=="object"&&!Array.isArray(g),"Options must be of type object");const x=Object.keys(g).filter(y=>!v.includes(y));a(x.length===0,`${m} contain unknown keys: ${x}`)},i.checkPreferences=function(g){u=u||o(3378);const v=u.preferences.validate(g);if(v.error)throw new c([v.error.details[0].message])},i.compare=function(g,v,m){switch(m){case"=":return g===v;case">":return g>v;case"<":return g<v;case">=":return g>=v;case"<=":return g<=v}},i.default=function(g,v){return g===void 0?v:g},i.isIsoDate=function(g){return f.isoDate.test(g)},i.isNumber=function(g){return typeof g=="number"&&!isNaN(g)},i.isResolvable=function(g){return!!g&&(g[i.symbols.ref]||g[i.symbols.template])},i.isSchema=function(g,v={}){const m=g&&g[i.symbols.any];return!!m&&(a(v.legacy||m.version===i.version,"Cannot mix different versions of joi schemas"),!0)},i.isValues=function(g){return g[i.symbols.values]},i.limit=function(g){return Number.isSafeInteger(g)&&g>=0},i.preferences=function(g,v){h=h||o(6914),g=g||{},v=v||{};const m=Object.assign({},g,v);return v.errors&&g.errors&&(m.errors=Object.assign({},g.errors,v.errors),m.errors.wrap=Object.assign({},g.errors.wrap,v.errors.wrap)),v.messages&&(m.messages=h.compile(v.messages,g.messages)),delete m[i.symbols.prefs],m},i.tryWithPath=function(g,v,m={}){try{return g()}catch(x){throw x.path!==void 0?x.path=v+"."+x.path:x.path=v,m.append&&(x.message=`${x.message} (${x.path})`),x}},i.validateArg=function(g,v,{assert:m,message:x}){if(i.isSchema(m)){const y=m.validate(g);return y.error?y.error.message:void 0}if(!m(g))return v?`${v} ${x}`:x},i.verifyFlat=function(g,v){for(const m of g)a(!Array.isArray(m),"Method no longer accepts array arguments:",v)}},3292:(s,i,o)=>{const a=o(375),c=o(8160),d=o(6133),h={};i.schema=function(u,f,g={}){c.assertOptions(g,["appendPath","override"]);try{return h.schema(u,f,g)}catch(v){throw g.appendPath&&v.path!==void 0&&(v.message=`${v.message} (${v.path})`),v}},h.schema=function(u,f,g){a(f!==void 0,"Invalid undefined schema"),Array.isArray(f)&&(a(f.length,"Invalid empty array schema"),f.length===1&&(f=f[0]));const v=(m,...x)=>g.override!==!1?m.valid(u.override,...x):m.valid(...x);if(h.simple(f))return v(u,f);if(typeof f=="function")return u.custom(f);if(a(typeof f=="object","Invalid schema content:",typeof f),c.isResolvable(f))return v(u,f);if(c.isSchema(f))return f;if(Array.isArray(f)){for(const m of f)if(!h.simple(m))return u.alternatives().try(...f);return v(u,...f)}return f instanceof RegExp?u.string().regex(f):f instanceof Date?v(u.date(),f):(a(Object.getPrototypeOf(f)===Object.getPrototypeOf({}),"Schema can only contain plain objects"),u.object().keys(f))},i.ref=function(u,f){return d.isRef(u)?u:d.create(u,f)},i.compile=function(u,f,g={}){c.assertOptions(g,["legacy"]);const v=f&&f[c.symbols.any];if(v)return a(g.legacy||v.version===c.version,"Cannot mix different versions of joi schemas:",v.version,c.version),f;if(typeof f!="object"||!g.legacy)return i.schema(u,f,{appendPath:!0});const m=h.walk(f);return m?m.compile(m.root,f):i.schema(u,f,{appendPath:!0})},h.walk=function(u){if(typeof u!="object")return null;if(Array.isArray(u)){for(const g of u){const v=h.walk(g);if(v)return v}return null}const f=u[c.symbols.any];if(f)return{root:u[f.root],compile:f.compile};a(Object.getPrototypeOf(u)===Object.getPrototypeOf({}),"Schema can only contain plain objects");for(const g in u){const v=h.walk(u[g]);if(v)return v}return null},h.simple=function(u){return u===null||["boolean","string","number"].includes(typeof u)},i.when=function(u,f,g){if(g===void 0&&(a(f&&typeof f=="object","Missing options"),g=f,f=d.create(".")),Array.isArray(g)&&(g={switch:g}),c.assertOptions(g,["is","not","then","otherwise","switch","break"]),c.isSchema(f))return a(g.is===void 0,'"is" can not be used with a schema condition'),a(g.not===void 0,'"not" can not be used with a schema condition'),a(g.switch===void 0,'"switch" can not be used with a schema condition'),h.condition(u,{is:f,then:g.then,otherwise:g.otherwise,break:g.break});if(a(d.isRef(f)||typeof f=="string","Invalid condition:",f),a(g.not===void 0||g.is===void 0,'Cannot combine "is" with "not"'),g.switch===void 0){let m=g;g.not!==void 0&&(m={is:g.not,then:g.otherwise,otherwise:g.then,break:g.break});let x=m.is!==void 0?u.$_compile(m.is):u.$_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"),g.is===void 0||d.isRef(g.is)||c.isSchema(g.is)||(x=x.required()),h.condition(u,{ref:i.ref(f),is:x,then:m.then,otherwise:m.otherwise,break:m.break})}a(Array.isArray(g.switch),'"switch" must be an array'),a(g.is===void 0,'Cannot combine "switch" with "is"'),a(g.not===void 0,'Cannot combine "switch" with "not"'),a(g.then===void 0,'Cannot combine "switch" with "then"');const v={ref:i.ref(f),switch:[],break:g.break};for(let m=0;m<g.switch.length;++m){const x=g.switch[m],y=m===g.switch.length-1;c.assertOptions(x,y?["is","then","otherwise"]:["is","then"]),a(x.is!==void 0,'Switch statement missing "is"'),a(x.then!==void 0,'Switch statement missing "then"');const b={is:u.$_compile(x.is),then:u.$_compile(x.then)};if(d.isRef(x.is)||c.isSchema(x.is)||(b.is=b.is.required()),y){a(g.otherwise===void 0||x.otherwise===void 0,'Cannot specify "otherwise" inside and outside a "switch"');const w=g.otherwise!==void 0?g.otherwise:x.otherwise;w!==void 0&&(a(v.break===void 0,"Cannot specify both otherwise and break"),b.otherwise=u.$_compile(w))}v.switch.push(b)}return v},h.condition=function(u,f){for(const g of["then","otherwise"])f[g]===void 0?delete f[g]:f[g]=u.$_compile(f[g]);return f}},6354:(s,i,o)=>{const a=o(5688),c=o(8160),d=o(3328);i.Report=class{constructor(h,u,f,g,v,m,x){if(this.code=h,this.flags=g,this.messages=v,this.path=m.path,this.prefs=x,this.state=m,this.value=u,this.message=null,this.template=null,this.local=f||{},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 y=this.path[this.path.length-1];typeof y!="object"&&(this.local.key=y)}}_setTemplate(h){if(this.template=h,!this.flags.label&&this.path.length===0){const u=this._template(this.template,"root");u&&(this.local.label=u)}}toString(){if(this.message)return this.message;const h=this.code;if(!this.prefs.errors.render)return this.code;const u=this._template(this.template)||this._template(this.prefs.messages)||this._template(this.messages);return u===void 0?`Error code "${h}" is not defined, your custom type is missing the correct messages definition`:(this.message=u.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(h,u){return i.template(this.value,h,u||this.code,this.state,this.prefs)}},i.path=function(h){let u="";for(const f of h)typeof f!="object"&&(typeof f=="string"?(u&&(u+="."),u+=f):u+=`[${f}]`);return u},i.template=function(h,u,f,g,v){if(!u)return;if(d.isTemplate(u))return f!=="root"?u:null;let m=v.errors.language;if(c.isResolvable(m)&&(m=m.resolve(h,g,v)),m&&u[m]){if(u[m][f]!==void 0)return u[m][f];if(u[m]["*"]!==void 0)return u[m]["*"]}return u[f]?u[f]:u["*"]},i.label=function(h,u,f,g){if(!f.errors.label)return"";if(h.label)return h.label;let v=u.path;return f.errors.label==="key"&&u.path.length>1&&(v=u.path.slice(-1)),i.path(v)||i.template(null,f.messages,"root",u,f)||g&&i.template(null,g,"root",u,f)||"value"},i.process=function(h,u,f){if(!h)return null;const{override:g,message:v,details:m}=i.details(h);if(g)return g;if(f.errors.stack)return new i.ValidationError(v,m,u);const x=Error.stackTraceLimit;Error.stackTraceLimit=0;const y=new i.ValidationError(v,m,u);return Error.stackTraceLimit=x,y},i.details=function(h,u={}){let f=[];const g=[];for(const v of h){if(v instanceof Error){if(u.override!==!1)return{override:v};const x=v.toString();f.push(x),g.push({message:x,type:"override",context:{error:v}});continue}const m=v.toString();f.push(m),g.push({message:m,path:v.path.filter(x=>typeof x!="object"),type:v.code,context:v.local})}return f.length>1&&(f=[...new Set(f)]),{message:f.join(". "),details:g}},i.ValidationError=class extends Error{constructor(h,u,f){super(h),this._original=f,this.details=u}static isError(h){return h instanceof i.ValidationError}},i.ValidationError.prototype.isJoi=!0,i.ValidationError.prototype.name="ValidationError",i.ValidationError.prototype.annotate=a.error},8901:(s,i,o)=>{const a=o(375),c=o(8571),d=o(8160),h=o(6914),u={};i.type=function(f,g){const v=Object.getPrototypeOf(f),m=c(v),x=f._assign(Object.create(m)),y=Object.assign({},g);delete y.base,m._definition=y;const b=v._definition||{};y.messages=h.merge(b.messages,y.messages),y.properties=Object.assign({},b.properties,y.properties),x.type=y.type,y.flags=Object.assign({},b.flags,y.flags);const w=Object.assign({},b.terms);if(y.terms)for(const N in y.terms){const A=y.terms[N];a(x.$_terms[N]===void 0,"Invalid term override for",y.type,N),x.$_terms[N]=A.init,w[N]=A}y.terms=w,y.args||(y.args=b.args),y.prepare=u.prepare(y.prepare,b.prepare),y.coerce&&(typeof y.coerce=="function"&&(y.coerce={method:y.coerce}),y.coerce.from&&!Array.isArray(y.coerce.from)&&(y.coerce={method:y.coerce.method,from:[].concat(y.coerce.from)})),y.coerce=u.coerce(y.coerce,b.coerce),y.validate=u.validate(y.validate,b.validate);const E=Object.assign({},b.rules);if(y.rules)for(const N in y.rules){const A=y.rules[N];a(typeof A=="object","Invalid rule definition for",y.type,N);let D=A.method;if(D===void 0&&(D=function(){return this.$_addRule(N)}),D&&(a(!m[N],"Rule conflict in",y.type,N),m[N]=D),a(!E[N],"Rule conflict in",y.type,N),E[N]=A,A.alias){const O=[].concat(A.alias);for(const I of O)m[I]=A.method}A.args&&(A.argsByName=new Map,A.args=A.args.map(O=>(typeof O=="string"&&(O={name:O}),a(!A.argsByName.has(O.name),"Duplicated argument name",O.name),d.isSchema(O.assert)&&(O.assert=O.assert.strict().label(O.name)),A.argsByName.set(O.name,O),O)))}y.rules=E;const R=Object.assign({},b.modifiers);if(y.modifiers)for(const N in y.modifiers){a(!m[N],"Rule conflict in",y.type,N);const A=y.modifiers[N];a(typeof A=="function","Invalid modifier definition for",y.type,N);const D=function(O){return this.rule({[N]:O})};m[N]=D,R[N]=A}if(y.modifiers=R,y.overrides){m._super=v,x.$_super={};for(const N in y.overrides)a(v[N],"Cannot override missing",N),y.overrides[N][d.symbols.parent]=v[N],x.$_super[N]=v[N].bind(x);Object.assign(m,y.overrides)}y.cast=Object.assign({},b.cast,y.cast);const T=Object.assign({},b.manifest,y.manifest);return T.build=u.build(y.manifest&&y.manifest.build,b.manifest&&b.manifest.build),y.manifest=T,y.rebuild=u.rebuild(y.rebuild,b.rebuild),x},u.build=function(f,g){return f&&g?function(v,m){return g(f(v,m),m)}:f||g},u.coerce=function(f,g){return f&&g?{from:f.from&&g.from?[...new Set([...f.from,...g.from])]:null,method(v,m){let x;if((!g.from||g.from.includes(typeof v))&&(x=g.method(v,m),x)){if(x.errors||x.value===void 0)return x;v=x.value}if(!f.from||f.from.includes(typeof v)){const y=f.method(v,m);if(y)return y}return x}}:f||g},u.prepare=function(f,g){return f&&g?function(v,m){const x=f(v,m);if(x){if(x.errors||x.value===void 0)return x;v=x.value}return g(v,m)||x}:f||g},u.rebuild=function(f,g){return f&&g?function(v){g(v),f(v)}:f||g},u.validate=function(f,g){return f&&g?function(v,m){const x=g(v,m);if(x){if(x.errors&&(!Array.isArray(x.errors)||x.errors.length))return x;v=x.value}return f(v,m)||x}:f||g}},5107:(s,i,o)=>{const a=o(375),c=o(8571),d=o(8652),h=o(8160),u=o(3292),f=o(6354),g=o(8901),v=o(9708),m=o(6133),x=o(3328),y=o(1152);let b;const w={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 E={_types:new Set(Object.keys(w.types))};for(const R of E._types)E[R]=function(...T){return a(!T.length||["alternatives","link","object"].includes(R),"The",R,"type does not allow arguments"),w.generate(this,w.types[R],T)};for(const R of["allow","custom","disallow","equal","exist","forbidden","invalid","not","only","optional","options","prefs","preferences","required","strip","valid","when"])E[R]=function(...T){return this.any()[R](...T)};Object.assign(E,w.methods);for(const R in w.aliases){const T=w.aliases[R];E[R]=E[T]}return E.x=E.expression,y.setup&&y.setup(E),E}};w.methods={ValidationError:f.ValidationError,version:h.version,cache:d.provider,assert(E,R,...T){w.assert(E,R,!0,T)},attempt:(E,R,...T)=>w.assert(E,R,!1,T),build(E){return a(typeof v.build=="function","Manifest functionality disabled"),v.build(this,E)},checkPreferences(E){h.checkPreferences(E)},compile(E,R){return u.compile(this,E,R)},defaults(E){a(typeof E=="function","modifier must be a function");const R=Object.assign({},this);for(const T of R._types){const N=E(R[T]());a(h.isSchema(N),"modifier must return a valid schema object"),R[T]=function(...A){return w.generate(this,N,A)}}return R},expression:(...E)=>new x(...E),extend(...E){h.verifyFlat(E,"extend"),b=b||o(3378),a(E.length,"You need to provide at least one extension"),this.assert(E,b.extensions);const R=Object.assign({},this);R._types=new Set(R._types);for(let T of E){typeof T=="function"&&(T=T(R)),this.assert(T,b.extension);const N=w.expandExtension(T,R);for(const A of N){a(R[A.type]===void 0||R._types.has(A.type),"Cannot override name",A.type);const D=A.base||this.any(),O=g.type(D,A);R._types.add(A.type),R[A.type]=function(...I){return w.generate(this,O,I)}}}return R},isError:f.ValidationError.isError,isExpression:x.isTemplate,isRef:m.isRef,isSchema:h.isSchema,in:(...E)=>m.in(...E),override:h.symbols.override,ref:(...E)=>m.create(...E),types(){const E={};for(const R of this._types)E[R]=this[R]();for(const R in w.aliases)E[R]=this[R]();return E}},w.assert=function(E,R,T,N){const A=N[0]instanceof Error||typeof N[0]=="string"?N[0]:null,D=A!==null?N[1]:N[0],O=R.validate(E,h.preferences({errors:{stack:!0}},D||{}));let I=O.error;if(!I)return O.value;if(A instanceof Error)throw A;const $=T&&typeof I.annotate=="function"?I.annotate():I.message;throw I instanceof f.ValidationError==0&&(I=c(I)),I.message=A?`${A} ${$}`:$,I},w.generate=function(E,R,T){return a(E,"Must be invoked on a Joi instance."),R.$_root=E,R._definition.args&&T.length?R._definition.args(R,...T):R},w.expandExtension=function(E,R){if(typeof E.type=="string")return[E];const T=[];for(const N of R._types)if(E.type.test(N)){const A=Object.assign({},E);A.type=N,A.base=R[N](),T.push(A)}return T},s.exports=w.root()},6914:(s,i,o)=>{const a=o(375),c=o(8571),d=o(3328);i.compile=function(h,u){if(typeof h=="string")return a(!u,"Cannot set single message string"),new d(h);if(d.isTemplate(h))return a(!u,"Cannot set single message template"),h;a(typeof h=="object"&&!Array.isArray(h),"Invalid message options"),u=u?c(u):{};for(let f in h){const g=h[f];if(f==="root"||d.isTemplate(g)){u[f]=g;continue}if(typeof g=="string"){u[f]=new d(g);continue}a(typeof g=="object"&&!Array.isArray(g),"Invalid message for",f);const v=f;for(f in u[v]=u[v]||{},g){const m=g[f];f==="root"||d.isTemplate(m)?u[v][f]=m:(a(typeof m=="string","Invalid message for",f,"in",v),u[v][f]=new d(m))}}return u},i.decompile=function(h){const u={};for(let f in h){const g=h[f];if(f==="root"){u.root=g;continue}if(d.isTemplate(g)){u[f]=g.describe({compact:!0});continue}const v=f;for(f in u[v]={},g){const m=g[f];f!=="root"?u[v][f]=m.describe({compact:!0}):u[v].root=m}}return u},i.merge=function(h,u){if(!h)return i.compile(u);if(!u)return h;if(typeof u=="string")return new d(u);if(d.isTemplate(u))return u;const f=c(h);for(let g in u){const v=u[g];if(g==="root"||d.isTemplate(v)){f[g]=v;continue}if(typeof v=="string"){f[g]=new d(v);continue}a(typeof v=="object"&&!Array.isArray(v),"Invalid message for",g);const m=g;for(g in f[m]=f[m]||{},v){const x=v[g];g==="root"||d.isTemplate(x)?f[m][g]=x:(a(typeof x=="string","Invalid message for",g,"in",m),f[m][g]=new d(x))}}return f}},2294:(s,i,o)=>{const a=o(375),c=o(8160),d=o(6133),h={};i.Ids=h.Ids=class{constructor(){this._byId=new Map,this._byKey=new Map,this._schemaChain=!1}clone(){const u=new h.Ids;return u._byId=new Map(this._byId),u._byKey=new Map(this._byKey),u._schemaChain=this._schemaChain,u}concat(u){u._schemaChain&&(this._schemaChain=!0);for(const[f,g]of u._byId.entries())a(!this._byKey.has(f),"Schema id conflicts with existing key:",f),this._byId.set(f,g);for(const[f,g]of u._byKey.entries())a(!this._byId.has(f),"Schema key conflicts with existing id:",f),this._byKey.set(f,g)}fork(u,f,g){const v=this._collect(u);v.push({schema:g});const m=v.shift();let x={id:m.id,schema:f(m.schema)};a(c.isSchema(x.schema),"adjuster function failed to return a joi schema type");for(const y of v)x={id:y.id,schema:h.fork(y.schema,x.id,x.schema)};return x.schema}labels(u,f=[]){const g=u[0],v=this._get(g);if(!v)return[...f,...u].join(".");const m=u.slice(1);return f=[...f,v.schema._flags.label||g],m.length?v.schema._ids.labels(m,f):f.join(".")}reach(u,f=[]){const g=u[0],v=this._get(g);a(v,"Schema does not contain path",[...f,...u].join("."));const m=u.slice(1);return m.length?v.schema._ids.reach(m,[...f,g]):v.schema}register(u,{key:f}={}){if(!u||!c.isSchema(u))return;(u.$_property("schemaChain")||u._ids._schemaChain)&&(this._schemaChain=!0);const g=u._flags.id;if(g){const v=this._byId.get(g);a(!v||v.schema===u,"Cannot add different schemas with the same id:",g),a(!this._byKey.has(g),"Schema id conflicts with existing key:",g),this._byId.set(g,{schema:u,id:g})}f&&(a(!this._byKey.has(f),"Schema already contains key:",f),a(!this._byId.has(f),"Schema key conflicts with existing id:",f),this._byKey.set(f,{schema:u,id:f}))}reset(){this._byId=new Map,this._byKey=new Map,this._schemaChain=!1}_collect(u,f=[],g=[]){const v=u[0],m=this._get(v);a(m,"Schema does not contain path",[...f,...u].join(".")),g=[m,...g];const x=u.slice(1);return x.length?m.schema._ids._collect(x,[...f,v],g):g}_get(u){return this._byId.get(u)||this._byKey.get(u)}},h.fork=function(u,f,g){const v=i.schema(u,{each:(m,{key:x})=>{if(f===(m._flags.id||x))return g},ref:!1});return v?v.$_mutateRebuild():u},i.schema=function(u,f){let g;for(const v in u._flags){if(v[0]==="_")continue;const m=h.scan(u._flags[v],{source:"flags",name:v},f);m!==void 0&&(g=g||u.clone(),g._flags[v]=m)}for(let v=0;v<u._rules.length;++v){const m=u._rules[v],x=h.scan(m.args,{source:"rules",name:m.name},f);if(x!==void 0){g=g||u.clone();const y=Object.assign({},m);y.args=x,g._rules[v]=y,g._singleRules.get(m.name)===m&&g._singleRules.set(m.name,y)}}for(const v in u.$_terms){if(v[0]==="_")continue;const m=h.scan(u.$_terms[v],{source:"terms",name:v},f);m!==void 0&&(g=g||u.clone(),g.$_terms[v]=m)}return g},h.scan=function(u,f,g,v,m){const x=v||[];if(u===null||typeof u!="object")return;let y;if(Array.isArray(u)){for(let b=0;b<u.length;++b){const w=f.source==="terms"&&f.name==="keys"&&u[b].key,E=h.scan(u[b],f,g,[b,...x],w);E!==void 0&&(y=y||u.slice(),y[b]=E)}return y}if(g.schema!==!1&&c.isSchema(u)||g.ref!==!1&&d.isRef(u)){const b=g.each(u,{...f,path:x,key:m});return b===u?void 0:b}for(const b in u){if(b[0]==="_")continue;const w=h.scan(u[b],f,g,[b,...x],m);w!==void 0&&(y=y||Object.assign({},u),y[b]=w)}return y}},6133:(s,i,o)=>{const a=o(375),c=o(8571),d=o(9621),h=o(8160);let u;const f={symbol:Symbol("ref"),defaults:{adjust:null,in:!1,iterables:null,map:null,separator:".",type:"value"}};i.create=function(g,v={}){a(typeof g=="string","Invalid reference key:",g),h.assertOptions(v,["adjust","ancestor","in","iterables","map","prefix","render","separator"]),a(!v.prefix||typeof v.prefix=="object","options.prefix must be of type object");const m=Object.assign({},f.defaults,v);delete m.prefix;const x=m.separator,y=f.context(g,x,v.prefix);if(m.type=y.type,g=y.key,m.type==="value")if(y.root&&(a(!x||g[0]!==x,"Cannot specify relative path with root prefix"),m.ancestor="root",g||(g=null)),x&&x===g)g=null,m.ancestor=0;else if(m.ancestor!==void 0)a(!x||!g||g[0]!==x,"Cannot combine prefix with ancestor option");else{const[b,w]=f.ancestor(g,x);w&&(g=g.slice(w))===""&&(g=null),m.ancestor=b}return m.path=x?g===null?[]:g.split(x):[g],new f.Ref(m)},i.in=function(g,v={}){return i.create(g,{...v,in:!0})},i.isRef=function(g){return!!g&&!!g[h.symbols.ref]},f.Ref=class{constructor(g){a(typeof g=="object","Invalid reference construction"),h.assertOptions(g,["adjust","ancestor","in","iterables","map","path","render","separator","type","depth","key","root","display"]),a([!1,void 0].includes(g.separator)||typeof g.separator=="string"&&g.separator.length===1,"Invalid separator"),a(!g.adjust||typeof g.adjust=="function","options.adjust must be a function"),a(!g.map||Array.isArray(g.map),"options.map must be an array"),a(!g.map||!g.adjust,"Cannot set both map and adjust options"),Object.assign(this,f.defaults,g),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(g,v,m,x,y={}){return a(!this.in||y.in,"Invalid in() reference usage"),this.type==="global"?this._resolve(m.context,v,y):this.type==="local"?this._resolve(x,v,y):this.ancestor?this.ancestor==="root"?this._resolve(v.ancestors[v.ancestors.length-1],v,y):(a(this.ancestor<=v.ancestors.length,"Invalid reference exceeds the schema root:",this.display),this._resolve(v.ancestors[this.ancestor-1],v,y)):this._resolve(g,v,y)}_resolve(g,v,m){let x;if(this.type==="value"&&v.mainstay.shadow&&m.shadow!==!1&&(x=v.mainstay.shadow.get(this.absolute(v))),x===void 0&&(x=d(g,this.path,{iterables:this.iterables,functions:!0})),this.adjust&&(x=this.adjust(x)),this.map){const y=this.map.get(x);y!==void 0&&(x=y)}return v.mainstay&&v.mainstay.tracer.resolve(v,this,x),x}toString(){return this.display}absolute(g){return[...g.path.slice(0,-this.ancestor),...this.path]}clone(){return new f.Ref(this)}describe(){const g={path:this.path};this.type!=="value"&&(g.type=this.type),this.separator!=="."&&(g.separator=this.separator),this.type==="value"&&this.ancestor!==1&&(g.ancestor=this.ancestor),this.map&&(g.map=[...this.map]);for(const v of["adjust","iterables","render"])this[v]!==null&&this[v]!==void 0&&(g[v]=this[v]);return this.in!==!1&&(g.in=!0),{ref:g}}updateDisplay(){const g=this.key!==null?this.key:"";if(this.type!=="value")return void(this.display=`ref:${this.type}:${g}`);if(!this.separator)return void(this.display=`ref:${g}`);if(!this.ancestor)return void(this.display=`ref:${this.separator}${g}`);if(this.ancestor==="root")return void(this.display=`ref:root:${g}`);if(this.ancestor===1)return void(this.display=`ref:${g||".."}`);const v=new Array(this.ancestor+1).fill(this.separator).join("");this.display=`ref:${v}${g||""}`}},f.Ref.prototype[h.symbols.ref]=!0,i.build=function(g){return(g=Object.assign({},f.defaults,g)).type==="value"&&g.ancestor===void 0&&(g.ancestor=1),new f.Ref(g)},f.context=function(g,v,m={}){if(g=g.trim(),m){const x=m.global===void 0?"$":m.global;if(x!==v&&g.startsWith(x))return{key:g.slice(x.length),type:"global"};const y=m.local===void 0?"#":m.local;if(y!==v&&g.startsWith(y))return{key:g.slice(y.length),type:"local"};const b=m.root===void 0?"/":m.root;if(b!==v&&g.startsWith(b))return{key:g.slice(b.length),type:"value",root:!0}}return{key:g,type:"value"}},f.ancestor=function(g,v){if(!v)return[1,0];if(g[0]!==v)return[1,0];if(g[1]!==v)return[0,1];let m=2;for(;g[m]===v;)++m;return[m-1,m]},i.toSibling=0,i.toParent=1,i.Manager=class{constructor(){this.refs=[]}register(g,v){if(g)if(v=v===void 0?i.toParent:v,Array.isArray(g))for(const m of g)this.register(m,v);else if(h.isSchema(g))for(const m of g._refs.refs)m.ancestor-v>=0&&this.refs.push({ancestor:m.ancestor-v,root:m.root});else i.isRef(g)&&g.type==="value"&&g.ancestor-v>=0&&this.refs.push({ancestor:g.ancestor-v,root:g.root}),u=u||o(3328),u.isTemplate(g)&&this.register(g.refs(),v)}get length(){return this.refs.length}clone(){const g=new i.Manager;return g.refs=c(this.refs),g}reset(){this.refs=[]}roots(){return this.refs.filter(g=>!g.ancestor).map(g=>g.root)}}},3378:(s,i,o)=>{const a=o(5107),c={};c.wrap=a.string().min(1).max(2).allow(!1),i.preferences=a.object({allowUnknown:a.boolean(),abortEarly:a.boolean(),artifacts:a.boolean(),cache:a.boolean(),context:a.object(),convert:a.boolean(),dateFormat:a.valid("date","iso","string","time","utc"),debug:a.boolean(),errors:{escapeHtml:a.boolean(),label:a.valid("path","key",!1),language:[a.string(),a.object().ref()],render:a.boolean(),stack:a.boolean(),wrap:{label:c.wrap,array:c.wrap,string:c.wrap}},externals:a.boolean(),messages:a.object(),noDefaults:a.boolean(),nonEnumerables:a.boolean(),presence:a.valid("required","optional","forbidden"),skipFunctions:a.boolean(),stripUnknown:a.object({arrays:a.boolean(),objects:a.boolean()}).or("arrays","objects").allow(!0,!1),warnings:a.boolean()}).strict(),c.nameRx=/^[a-zA-Z0-9]\w*$/,c.rule=a.object({alias:a.array().items(a.string().pattern(c.nameRx)).single(),args:a.array().items(a.string(),a.object({name:a.string().pattern(c.nameRx).required(),ref:a.boolean(),assert:a.alternatives([a.function(),a.object().schema()]).conditional("ref",{is:!0,then:a.required()}),normalize:a.function(),message:a.string().when("assert",{is:a.function(),then:a.required()})})),convert:a.boolean(),manifest:a.boolean(),method:a.function().allow(!1),multi:a.boolean(),validate:a.function()}),i.extension=a.object({type:a.alternatives([a.string(),a.object().regex()]).required(),args:a.function(),cast:a.object().pattern(c.nameRx,a.object({from:a.function().maxArity(1).required(),to:a.function().minArity(1).maxArity(2).required()})),base:a.object().schema().when("type",{is:a.object().regex(),then:a.forbidden()}),coerce:[a.function().maxArity(3),a.object({method:a.function().maxArity(3).required(),from:a.array().items(a.string()).single()})],flags:a.object().pattern(c.nameRx,a.object({setter:a.string(),default:a.any()})),manifest:{build:a.function().arity(2)},messages:[a.object(),a.string()],modifiers:a.object().pattern(c.nameRx,a.function().minArity(1).maxArity(2)),overrides:a.object().pattern(c.nameRx,a.function()),prepare:a.function().maxArity(3),rebuild:a.function().arity(1),rules:a.object().pattern(c.nameRx,c.rule),terms:a.object().pattern(c.nameRx,a.object({init:a.array().allow(null).required(),manifest:a.object().pattern(/.+/,[a.valid("schema","single"),a.object({mapped:a.object({from:a.string().required(),to:a.string().required()}).required()})])})),validate:a.function().maxArity(3)}).strict(),i.extensions=a.array().items(a.object(),a.function().arity(1)).strict(),c.desc={buffer:a.object({buffer:a.string()}),func:a.object({function:a.function().required(),options:{literal:!0}}),override:a.object({override:!0}),ref:a.object({ref:a.object({type:a.valid("value","global","local"),path:a.array().required(),separator:a.string().length(1).allow(!1),ancestor:a.number().min(0).integer().allow("root"),map:a.array().items(a.array().length(2)).min(1),adjust:a.function(),iterables:a.boolean(),in:a.boolean(),render:a.boolean()}).required()}),regex:a.object({regex:a.string().min(3)}),special:a.object({special:a.valid("deep").required()}),template:a.object({template:a.string().required(),options:a.object()}),value:a.object({value:a.alternatives([a.object(),a.array()]).required()})},c.desc.entity=a.alternatives([a.array().items(a.link("...")),a.boolean(),a.function(),a.number(),a.string(),c.desc.buffer,c.desc.func,c.desc.ref,c.desc.regex,c.desc.special,c.desc.template,c.desc.value,a.link("/")]),c.desc.values=a.array().items(null,a.boolean(),a.function(),a.number().allow(1/0,-1/0),a.string().allow(""),a.symbol(),c.desc.buffer,c.desc.func,c.desc.override,c.desc.ref,c.desc.regex,c.desc.template,c.desc.value),c.desc.messages=a.object().pattern(/.+/,[a.string(),c.desc.template,a.object().pattern(/.+/,[a.string(),c.desc.template])]),i.description=a.object({type:a.string().required(),flags:a.object({cast:a.string(),default:a.any(),description:a.string(),empty:a.link("/"),failover:c.desc.entity,id:a.string(),label:a.string(),only:!0,presence:["optional","required","forbidden"],result:["raw","strip"],strip:a.boolean(),unit:a.string()}).unknown(),preferences:{allowUnknown:a.boolean(),abortEarly:a.boolean(),artifacts:a.boolean(),cache:a.boolean(),convert:a.boolean(),dateFormat:["date","iso","string","time","utc"],errors:{escapeHtml:a.boolean(),label:["path","key"],language:[a.string(),c.desc.ref],wrap:{label:c.wrap,array:c.wrap}},externals:a.boolean(),messages:c.desc.messages,noDefaults:a.boolean(),nonEnumerables:a.boolean(),presence:["required","optional","forbidden"],skipFunctions:a.boolean(),stripUnknown:a.object({arrays:a.boolean(),objects:a.boolean()}).or("arrays","objects").allow(!0,!1),warnings:a.boolean()},allow:c.desc.values,invalid:c.desc.values,rules:a.array().min(1).items({name:a.string().required(),args:a.object().min(1),keep:a.boolean(),message:[a.string(),c.desc.messages],warn:a.boolean()}),keys:a.object().pattern(/.*/,a.link("/")),link:c.desc.ref}).pattern(/^[a-z]\w*$/,a.any())},493:(s,i,o)=>{const a=o(8571),c=o(9621),d=o(8160),h={value:Symbol("value")};s.exports=h.State=class{constructor(u,f,g){this.path=u,this.ancestors=f,this.mainstay=g.mainstay,this.schemas=g.schemas,this.debug=null}localize(u,f=null,g=null){const v=new h.State(u,f,this);return g&&v.schemas&&(v.schemas=[h.schemas(g),...v.schemas]),v}nest(u,f){const g=new h.State(this.path,this.ancestors,this);return g.schemas=g.schemas&&[h.schemas(u),...g.schemas],g.debug=f,g}shadow(u,f){this.mainstay.shadow=this.mainstay.shadow||new h.Shadow,this.mainstay.shadow.set(this.path,u,f)}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()}},h.schemas=function(u){return d.isSchema(u)?{schema:u}:u},h.Shadow=class{constructor(){this._values=null}set(u,f,g){if(!u.length||g==="strip"&&typeof u[u.length-1]=="number")return;this._values=this._values||new Map;let v=this._values;for(let m=0;m<u.length;++m){const x=u[m];let y=v.get(x);y||(y=new Map,v.set(x,y)),v=y}v[h.value]=f}get(u){const f=this.node(u);if(f)return f[h.value]}node(u){if(this._values)return c(this._values,u,{iterables:!0})}override(u,f){if(!this._values)return;const g=u.slice(0,-1),v=u[u.length-1],m=c(this._values,g,{iterables:!0});f?m.set(v,f):m&&m.delete(v)}}},3328:(s,i,o)=>{const a=o(375),c=o(8571),d=o(5277),h=o(1447),u=o(8160),f=o(6354),g=o(6133),v={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=v.Template=class{constructor(m,x){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,x){const{functions:y,...b}=x;this._settings=Object.keys(b).length?c(b):void 0,this._functions=y,this._functions&&(a(Object.keys(this._functions).every(w=>typeof w=="string"),"Functions keys must be strings"),a(Object.values(this._functions).every(w=>typeof w=="function"),"Functions values must be functions"))}else this._settings=void 0,this._functions=void 0;this._parse()}_parse(){if(!this.source.includes("{"))return;const m=v.encode(this.source),x=v.split(m);let y=!1;const b=[],w=x.shift();w&&b.push(w);for(const E of x){const R=E[0]!=="{",T=R?"}":"}}",N=E.indexOf(T);if(N===-1||E[1]==="{"){b.push(`{${v.decode(E)}`);continue}let A=E.slice(R?0:1,N);const D=A[0]===":";D&&(A=A.slice(1));const O=this._ref(v.decode(A),{raw:R,wrapped:D});b.push(O),typeof O!="string"&&(y=!0);const I=E.slice(N+T.length);I&&b.push(v.decode(I))}y?this._template=b:this.rendered=b.join("")}static date(m,x){return v.dateFormat[x.dateFormat].call(m)}describe(m={}){if(!this._settings&&m.compact)return this.source;const x={template:this.source};return this._settings&&(x.options=this._settings),this._functions&&(x.functions=this._functions),x}static build(m){return new v.Template(m.template,m.options||m.functions?{...m.options,functions:m.functions}:void 0)}isDynamic(){return!!this._template}static isTemplate(m){return!!m&&!!m[u.symbols.template]}refs(){if(!this._template)return;const m=[];for(const x of this._template)typeof x!="string"&&m.push(...x.refs);return m}resolve(m,x,y,b){return this._template&&this._template.length===1?this._part(this._template[0],m,x,y,b,{}):this.render(m,x,y,b)}_part(m,...x){return m.ref?m.ref.resolve(...x):m.formula.evaluate(x)}render(m,x,y,b,w={}){if(!this.isDynamic())return this.rendered;const E=[];for(const R of this._template)if(typeof R=="string")E.push(R);else{const T=this._part(R,m,x,y,b,w),N=v.stringify(T,m,x,y,b,w);if(N!==void 0){const A=R.raw||(w.errors&&w.errors.escapeHtml)===!1?N:d(N);E.push(v.wrap(A,R.wrapped&&y.errors.wrap.label))}}return E.join("")}_ref(m,{raw:x,wrapped:y}){const b=[],w=R=>{const T=g.create(R,this._settings);return b.push(T),N=>{const A=T.resolve(...N);return A!==void 0?A:null}};try{const R=this._functions?{...v.functions,...this._functions}:v.functions;var E=new h.Parser(m,{reference:w,functions:R,constants:v.constants})}catch(R){throw R.message=`Invalid template variable "${m}" fails due to: ${R.message}`,R}if(E.single){if(E.single.type==="reference"){const R=b[0];return{ref:R,raw:x,refs:b,wrapped:y||R.type==="local"&&R.key==="label"}}return v.stringify(E.single.value)}return{formula:E,raw:x,refs:b}}toString(){return this.source}},v.Template.prototype[u.symbols.template]=!0,v.Template.prototype.isImmutable=!0,v.encode=function(m){return m.replace(/\\(\{+)/g,(x,y)=>v.opens.slice(0,y.length)).replace(/\\(\}+)/g,(x,y)=>v.closes.slice(0,y.length))},v.decode=function(m){return m.replace(/\u0000/g,"{").replace(/\u0001/g,"}")},v.split=function(m){const x=[];let y="";for(let b=0;b<m.length;++b){const w=m[b];if(w==="{"){let E="";for(;b+1<m.length&&m[b+1]==="{";)E+="{",++b;x.push(y),y=E}else y+=w}return x.push(y),x},v.wrap=function(m,x){return x?x.length===1?`${x}${m}${x}`:`${x[0]}${m}${x[1]}`:m},v.stringify=function(m,x,y,b,w,E={}){const R=typeof m,T=b&&b.errors&&b.errors.wrap||{};let N=!1;if(g.isRef(m)&&m.render&&(N=m.in,m=m.resolve(x,y,b,w,{in:m.in,...E})),m===null)return"null";if(R==="string")return v.wrap(m,E.arrayItems&&T.string);if(R==="number"||R==="function"||R==="symbol")return m.toString();if(R!=="object")return JSON.stringify(m);if(m instanceof Date)return v.Template.date(m,b);if(m instanceof Map){const D=[];for(const[O,I]of m.entries())D.push(`${O.toString()} -> ${I.toString()}`);m=D}if(!Array.isArray(m))return m.toString();const A=[];for(const D of m)A.push(v.stringify(D,x,y,b,w,{arrayItems:!0,...E}));return v.wrap(A.join(", "),!N&&T.array)},v.constants={true:!0,false:!1,null:null,second:1e3,minute:6e4,hour:36e5,day:864e5},v.functions={if:(m,x,y)=>m?x:y,length:m=>typeof m=="string"?m.length:m&&typeof m=="object"?Array.isArray(m)?m.length:Object.keys(m).length:null,msg(m){const[x,y,b,w,E]=this,R=E.messages;if(!R)return"";const T=f.template(x,R[0],m,y,b)||f.template(x,R[1],m,y,b);return T?T.render(x,y,b,w,E):""},number:m=>typeof m=="number"?m:typeof m=="string"?parseFloat(m):typeof m=="boolean"?m?1:0:m instanceof Date?m.getTime():null}},4946:(s,i,o)=>{const a=o(375),c=o(1687),d=o(8068),h=o(8160),u=o(3292),f=o(6354),g=o(6133),v={};s.exports=d.extend({type:"alternatives",flags:{match:{default:"any"}},terms:{matches:{init:[],register:g.toSibling}},args:(m,...x)=>x.length===1&&Array.isArray(x[0])?m.try(...x[0]):m.try(...x),validate(m,x){const{schema:y,error:b,state:w,prefs:E}=x;if(y._flags.match){const T=[],N=[];for(let D=0;D<y.$_terms.matches.length;++D){const O=y.$_terms.matches[D],I=w.nest(O.schema,`match.${D}`);I.snapshot();const $=O.schema.$_validate(m,I,E);$.errors?(N.push($.errors),I.restore()):(T.push($.value),I.commit())}if(T.length===0)return{errors:b("alternatives.any",{details:N.map(D=>f.details(D,{override:!1}))})};if(y._flags.match==="one")return T.length===1?{value:T[0]}:{errors:b("alternatives.one")};if(T.length!==y.$_terms.matches.length)return{errors:b("alternatives.all",{details:N.map(D=>f.details(D,{override:!1}))})};const A=D=>D.$_terms.matches.some(O=>O.schema.type==="object"||O.schema.type==="alternatives"&&A(O.schema));return A(y)?{value:T.reduce((D,O)=>c(D,O,{mergeArrays:!1}))}:{value:T[T.length-1]}}const R=[];for(let T=0;T<y.$_terms.matches.length;++T){const N=y.$_terms.matches[T];if(N.schema){const O=w.nest(N.schema,`match.${T}`);O.snapshot();const I=N.schema.$_validate(m,O,E);if(!I.errors)return O.commit(),I;O.restore(),R.push({schema:N.schema,reports:I.errors});continue}const A=N.ref?N.ref.resolve(m,w,E):m,D=N.is?[N]:N.switch;for(let O=0;O<D.length;++O){const I=D[O],{is:$,then:F,otherwise:B}=I,W=`match.${T}${N.switch?"."+O:""}`;if($.$_match(A,w.nest($,`${W}.is`),E)){if(F)return F.$_validate(m,w.nest(F,`${W}.then`),E)}else if(B)return B.$_validate(m,w.nest(B,`${W}.otherwise`),E)}}return v.errors(R,x)},rules:{conditional:{method(m,x){a(!this._flags._endedSwitch,"Unreachable condition"),a(!this._flags.match,"Cannot combine match mode",this._flags.match,"with conditional rule"),a(x.break===void 0,"Cannot use break option with alternatives conditional");const y=this.clone(),b=u.when(y,m,x),w=b.is?[b]:b.switch;for(const E of w)if(E.then&&E.otherwise){y.$_setFlag("_endedSwitch",!0,{clone:!1});break}return y.$_terms.matches.push(b),y.$_mutateRebuild()}},match:{method(m){if(a(["any","one","all"].includes(m),"Invalid alternatives match mode",m),m!=="any")for(const x of this.$_terms.matches)a(x.schema,"Cannot combine match mode",m,"with conditional rules");return this.$_setFlag("match",m)}},try:{method(...m){a(m.length,"Missing alternative schemas"),h.verifyFlat(m,"try"),a(!this._flags._endedSwitch,"Unreachable condition");const x=this.clone();for(const y of m)x.$_terms.matches.push({schema:x.$_compile(y)});return x.$_mutateRebuild()}}},overrides:{label(m){return this.$_parent("label",m).$_modify({each:(x,y)=>y.path[0]!=="is"&&typeof x._flags.label!="string"?x.label(m):void 0,ref:!1})}},rebuild(m){m.$_modify({each:x=>{h.isSchema(x)&&x.type==="array"&&m.$_setFlag("_arrayItems",!0,{clone:!1})}})},manifest:{build(m,x){if(x.matches)for(const y of x.matches){const{schema:b,ref:w,is:E,not:R,then:T,otherwise:N}=y;m=b?m.try(b):w?m.conditional(w,{is:E,then:T,not:R,otherwise:N,switch:y.switch}):m.conditional(E,{then:T,otherwise:N})}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}}"}}),v.errors=function(m,{error:x,state:y}){if(!m.length)return{errors:x("alternatives.any")};if(m.length===1)return{errors:m[0].reports};const b=new Set,w=[];for(const{reports:E,schema:R}of m){if(E.length>1)return v.unmatched(m,x);const T=E[0];if(T instanceof f.Report==0)return v.unmatched(m,x);if(T.state.path.length!==y.path.length){w.push({type:R.type,report:T});continue}if(T.code==="any.only"){for(const D of T.local.valids)b.add(D);continue}const[N,A]=T.code.split(".");A!=="base"?w.push({type:R.type,report:T}):T.code==="object.base"?b.add(T.local.type):b.add(N)}return w.length?w.length===1?{errors:w[0].report}:v.unmatched(m,x):{errors:x("alternatives.types",{types:[...b]})}},v.unmatched=function(m,x){const y=[];for(const b of m)y.push(...b.reports);return{errors:x("alternatives.match",f.details(y,{override:!1}))}}},8068:(s,i,o)=>{const a=o(375),c=o(7629),d=o(8160),h=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(u,f){return a(typeof u=="function","Method must be a function"),a(f===void 0||f&&typeof f=="string","Description must be a non-empty string"),this.$_addRule({name:"custom",args:{method:u,description:f}})},validate(u,f,{method:g}){try{return g(u,f)}catch(v){return f.error("any.custom",{error:v})}},args:["method","description"],multi:!0},messages:{method(u){return this.prefs({messages:u})}},shared:{method(u){a(d.isSchema(u)&&u._flags.id,"Schema must be a schema with an id");const f=this.clone();return f.$_terms.shared=f.$_terms.shared||[],f.$_terms.shared.push(u),f.$_mutateRegister(u),f}},warning:{method(u,f){return a(u&&typeof u=="string","Invalid warning code"),this.$_addRule({name:"warning",args:{code:u,local:f},warn:!0})},validate:(u,f,{code:g,local:v})=>f.error(g,v),args:["code","local"],multi:!0}},modifiers:{keep(u,f=!0){u.keep=f},message(u,f){u.message=h.compile(f)},warn(u,f=!0){u.warn=f}},manifest:{build(u,f){for(const g in f){const v=f[g];if(["examples","externals","metas","notes","tags"].includes(g))for(const m of v)u=u[g.slice(0,-1)](m);else if(g!=="alterations")if(g!=="whens"){if(g==="shared")for(const m of v)u=u.shared(m)}else for(const m of v){const{ref:x,is:y,not:b,then:w,otherwise:E,concat:R}=m;u=R?u.concat(R):x?u.when(x,{is:y,not:b,then:w,otherwise:E,switch:m.switch,break:m.break}):u.when(y,{then:w,otherwise:E,break:m.break})}else{const m={};for(const{target:x,adjuster:y}of v)m[x]=y;u=u.alter(m)}}return u}},messages:{"any.custom":"{{#label}} failed custom validation because {{#error.message}}","any.default":"{{#label}} threw an error when running default method","any.failover":"{{#label}} threw an error when running failover method","any.invalid":"{{#label}} contains an invalid value","any.only":'{{#label}} must be {if(#valids.length == 1, "", "one of ")}{{#valids}}',"any.ref":"{{#label}} {{#arg}} references {{:#ref}} which {{#reason}}","any.required":"{{#label}} is required","any.unknown":"{{#label}} is not allowed"}})},546:(s,i,o)=>{const a=o(375),c=o(9474),d=o(9621),h=o(8068),u=o(8160),f=o(3292),g={};s.exports=h.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(v,{schema:m,state:x,prefs:y}){if(!Array.isArray(v))return;const b=m.$_getRule("sort");return b?g.sort(m,v,b.args.options,x,y):void 0}},validate(v,{schema:m,error:x}){if(!Array.isArray(v)){if(m._flags.single){const y=[v];return y[u.symbols.arraySingle]=!0,{value:y}}return{errors:x("array.base")}}if(m.$_getRule("items")||m.$_terms.externals)return{value:v.slice()}},rules:{has:{method(v){v=this.$_compile(v,{appendPath:!0});const m=this.$_addRule({name:"has",args:{schema:v}});return m.$_mutateRegister(v),m},validate(v,{state:m,prefs:x,error:y},{schema:b}){const w=[v,...m.ancestors];for(let R=0;R<v.length;++R){const T=m.localize([...m.path,R],w,b);if(b.$_match(v[R],T,x))return v}const E=b._flags.label;return E?y("array.hasKnown",{patternLabel:E}):y("array.hasUnknown",null)},multi:!0},items:{method(...v){u.verifyFlat(v,"items");const m=this.$_addRule("items");for(let x=0;x<v.length;++x){const y=u.tryWithPath(()=>this.$_compile(v[x]),x,{append:!0});m.$_terms.items.push(y)}return m.$_mutateRebuild()},validate(v,{schema:m,error:x,state:y,prefs:b,errorsArray:w}){const E=m.$_terms._requireds.slice(),R=m.$_terms.ordered.slice(),T=[...m.$_terms._inclusions,...E],N=!v[u.symbols.arraySingle];delete v[u.symbols.arraySingle];const A=w();let D=v.length;for(let O=0;O<D;++O){const I=v[O];let $=!1,F=!1;const B=N?O:new Number(O),W=[...y.path,B];if(!m._flags.sparse&&I===void 0){if(A.push(x("array.sparse",{key:B,path:W,pos:O,value:void 0},y.localize(W))),b.abortEarly)return A;R.shift();continue}const Z=[v,...y.ancestors];for(const he of m.$_terms._exclusions)if(he.$_match(I,y.localize(W,Z,he),b,{presence:"ignore"})){if(A.push(x("array.excludes",{pos:O,value:I},y.localize(W))),b.abortEarly)return A;$=!0,R.shift();break}if($)continue;if(m.$_terms.ordered.length){if(R.length){const he=R.shift(),re=he.$_validate(I,y.localize(W,Z,he),b);if(re.errors){if(A.push(...re.errors),b.abortEarly)return A}else if(he._flags.result==="strip")g.fastSplice(v,O),--O,--D;else{if(!m._flags.sparse&&re.value===void 0){if(A.push(x("array.sparse",{key:B,path:W,pos:O,value:void 0},y.localize(W))),b.abortEarly)return A;continue}v[O]=re.value}continue}if(!m.$_terms.items.length){if(A.push(x("array.orderedLength",{pos:O,limit:m.$_terms.ordered.length})),b.abortEarly)return A;break}}const Y=[];let H=E.length;for(let he=0;he<H;++he){const re=y.localize(W,Z,E[he]);re.snapshot();const J=E[he].$_validate(I,re,b);if(Y[he]=J,!J.errors){if(re.commit(),v[O]=J.value,F=!0,g.fastSplice(E,he),--he,--H,!m._flags.sparse&&J.value===void 0&&(A.push(x("array.sparse",{key:B,path:W,pos:O,value:void 0},y.localize(W))),b.abortEarly))return A;break}re.restore()}if(F)continue;const se=b.stripUnknown&&!!b.stripUnknown.arrays||!1;H=T.length;for(const he of T){let re;const J=E.indexOf(he);if(J!==-1)re=Y[J];else{const te=y.localize(W,Z,he);if(te.snapshot(),re=he.$_validate(I,te,b),!re.errors){te.commit(),he._flags.result==="strip"?(g.fastSplice(v,O),--O,--D):m._flags.sparse||re.value!==void 0?v[O]=re.value:(A.push(x("array.sparse",{key:B,path:W,pos:O,value:void 0},y.localize(W))),$=!0),F=!0;break}te.restore()}if(H===1){if(se){g.fastSplice(v,O),--O,--D,F=!0;break}if(A.push(...re.errors),b.abortEarly)return A;$=!0;break}}if(!$&&(m.$_terms._inclusions.length||m.$_terms._requireds.length)&&!F){if(se){g.fastSplice(v,O),--O,--D;continue}if(A.push(x("array.includes",{pos:O,value:I},y.localize(W))),b.abortEarly)return A}}return E.length&&g.fillMissedErrors(m,A,E,v,y,b),R.length&&(g.fillOrderedErrors(m,A,R,v,y,b),A.length||g.fillDefault(R,v,y,b)),A.length?A:v},priority:!0,manifest:!1},length:{method(v){return this.$_addRule({name:"length",args:{limit:v},operator:"="})},validate:(v,m,{limit:x},{name:y,operator:b,args:w})=>u.compare(v.length,x,b)?v:m.error("array."+y,{limit:w.limit,value:v}),args:[{name:"limit",ref:!0,assert:u.limit,message:"must be a positive integer"}]},max:{method(v){return this.$_addRule({name:"max",method:"length",args:{limit:v},operator:"<="})}},min:{method(v){return this.$_addRule({name:"min",method:"length",args:{limit:v},operator:">="})}},ordered:{method(...v){u.verifyFlat(v,"ordered");const m=this.$_addRule("items");for(let x=0;x<v.length;++x){const y=u.tryWithPath(()=>this.$_compile(v[x]),x,{append:!0});g.validateSingle(y,m),m.$_mutateRegister(y),m.$_terms.ordered.push(y)}return m.$_mutateRebuild()}},single:{method(v){const m=v===void 0||!!v;return a(!m||!this._flags._arrayItems,"Cannot specify single rule when array has array items"),this.$_setFlag("single",m)}},sort:{method(v={}){u.assertOptions(v,["by","order"]);const m={order:v.order||"ascending"};return v.by&&(m.by=f.ref(v.by,{ancestor:0}),a(!m.by.ancestor,"Cannot sort by ancestor")),this.$_addRule({name:"sort",args:{options:m}})},validate(v,{error:m,state:x,prefs:y,schema:b},{options:w}){const{value:E,errors:R}=g.sort(b,v,w,x,y);if(R)return R;for(let T=0;T<v.length;++T)if(v[T]!==E[T])return m("array.sort",{order:w.order,by:w.by?w.by.key:"value"});return v},convert:!0},sparse:{method(v){const m=v===void 0||!!v;return this._flags.sparse===m?this:(m?this.clone():this.$_addRule("items")).$_setFlag("sparse",m,{clone:!1})}},unique:{method(v,m={}){a(!v||typeof v=="function"||typeof v=="string","comparator must be a function or a string"),u.assertOptions(m,["ignoreUndefined","separator"]);const x={name:"unique",args:{options:m,comparator:v}};if(v)if(typeof v=="string"){const y=u.default(m.separator,".");x.path=y?v.split(y):[v]}else x.comparator=v;return this.$_addRule(x)},validate(v,{state:m,error:x,schema:y},{comparator:b,options:w},{comparator:E,path:R}){const T={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},N=E||c,A=w.ignoreUndefined;for(let D=0;D<v.length;++D){const O=R?d(v[D],R):v[D],I=E?T.custom:T[typeof O];if(a(I,"Failed to find unique map container for type",typeof O),I instanceof Map){const $=I.entries();let F;for(;!(F=$.next()).done;)if(N(F.value[0],O)){const B=m.localize([...m.path,D],[v,...m.ancestors]),W={pos:D,value:v[D],dupePos:F.value[1],dupeValue:v[F.value[1]]};return R&&(W.path=b),x("array.unique",W,B)}I.set(O,D)}else{if((!A||O!==void 0)&&I[O]!==void 0){const $={pos:D,value:v[D],dupePos:I[O],dupeValue:v[I[O]]};return R&&($.path=b),x("array.unique",$,m.localize([...m.path,D],[v,...m.ancestors]))}I[O]=D}}return v},args:["comparator","options"],multi:!0}},cast:{set:{from:Array.isArray,to:(v,m)=>new Set(v)}},rebuild(v){v.$_terms._inclusions=[],v.$_terms._exclusions=[],v.$_terms._requireds=[];for(const m of v.$_terms.items)g.validateSingle(m,v),m._flags.presence==="required"?v.$_terms._requireds.push(m):m._flags.presence==="forbidden"?v.$_terms._exclusions.push(m):v.$_terms._inclusions.push(m);for(const m of v.$_terms.ordered)g.validateSingle(m,v)},manifest:{build:(v,m)=>(m.items&&(v=v.items(...m.items)),m.ordered&&(v=v.ordered(...m.ordered)),v)},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"}}),g.fillMissedErrors=function(v,m,x,y,b,w){const E=[];let R=0;for(const T of x){const N=T._flags.label;N?E.push(N):++R}E.length?R?m.push(v.$_createError("array.includesRequiredBoth",y,{knownMisses:E,unknownMisses:R},b,w)):m.push(v.$_createError("array.includesRequiredKnowns",y,{knownMisses:E},b,w)):m.push(v.$_createError("array.includesRequiredUnknowns",y,{unknownMisses:R},b,w))},g.fillOrderedErrors=function(v,m,x,y,b,w){const E=[];for(const R of x)R._flags.presence==="required"&&E.push(R);E.length&&g.fillMissedErrors(v,m,E,y,b,w)},g.fillDefault=function(v,m,x,y){const b=[];let w=!0;for(let E=v.length-1;E>=0;--E){const R=v[E],T=[m,...x.ancestors],N=R.$_validate(void 0,x.localize(x.path,T,R),y).value;if(w){if(N===void 0)continue;w=!1}b.unshift(N)}b.length&&m.push(...b)},g.fastSplice=function(v,m){let x=m;for(;x<v.length;)v[x++]=v[x];--v.length},g.validateSingle=function(v,m){(v.type==="array"||v._flags._arrayItems)&&(a(!m._flags.single,"Cannot specify array item with single rule enabled"),m.$_setFlag("_arrayItems",!0,{clone:!1}))},g.sort=function(v,m,x,y,b){const w=x.order==="ascending"?1:-1,E=-1*w,R=w,T=(N,A)=>{let D=g.compare(N,A,E,R);if(D!==null||(x.by&&(N=x.by.resolve(N,y,b),A=x.by.resolve(A,y,b)),D=g.compare(N,A,E,R),D!==null))return D;const O=typeof N;if(O!==typeof A)throw v.$_createError("array.sort.mismatching",m,null,y,b);if(O!=="number"&&O!=="string")throw v.$_createError("array.sort.unsupported",m,{type:O},y,b);return O==="number"?(N-A)*w:N<A?E:R};try{return{value:m.slice().sort(T)}}catch(N){return{errors:N}}},g.compare=function(v,m,x,y){return v===m?0:v===void 0?1:m===void 0?-1:v===null?y:m===null?x:null}},4937:(s,i,o)=>{const a=o(375),c=o(8068),d=o(8160),h=o(2036),u={isBool:function(f){return typeof f=="boolean"}};s.exports=c.extend({type:"boolean",flags:{sensitive:{default:!1}},terms:{falsy:{init:null,manifest:"values"},truthy:{init:null,manifest:"values"}},coerce(f,{schema:g}){if(typeof f!="boolean"){if(typeof f=="string"){const v=g._flags.sensitive?f:f.toLowerCase();f=v==="true"||v!=="false"&&f}return typeof f!="boolean"&&(f=g.$_terms.truthy&&g.$_terms.truthy.has(f,null,null,!g._flags.sensitive)||(!g.$_terms.falsy||!g.$_terms.falsy.has(f,null,null,!g._flags.sensitive))&&f),{value:f}}},validate(f,{error:g}){if(typeof f!="boolean")return{value:f,errors:g("boolean.base")}},rules:{truthy:{method(...f){d.verifyFlat(f,"truthy");const g=this.clone();g.$_terms.truthy=g.$_terms.truthy||new h;for(let v=0;v<f.length;++v){const m=f[v];a(m!==void 0,"Cannot call truthy with undefined"),g.$_terms.truthy.add(m)}return g}},falsy:{method(...f){d.verifyFlat(f,"falsy");const g=this.clone();g.$_terms.falsy=g.$_terms.falsy||new h;for(let v=0;v<f.length;++v){const m=f[v];a(m!==void 0,"Cannot call falsy with undefined"),g.$_terms.falsy.add(m)}return g}},sensitive:{method(f=!0){return this.$_setFlag("sensitive",f)}}},cast:{number:{from:u.isBool,to:(f,g)=>f?1:0},string:{from:u.isBool,to:(f,g)=>f?"true":"false"}},manifest:{build:(f,g)=>(g.truthy&&(f=f.truthy(...g.truthy)),g.falsy&&(f=f.falsy(...g.falsy)),f)},messages:{"boolean.base":"{{#label}} must be a boolean"}})},7500:(s,i,o)=>{const a=o(375),c=o(8068),d=o(8160),h=o(3328),u={isDate:function(f){return f instanceof Date}};s.exports=c.extend({type:"date",coerce:{from:["number","string"],method:(f,{schema:g})=>({value:u.parse(f,g._flags.format)||f})},validate(f,{schema:g,error:v,prefs:m}){if(f instanceof Date&&!isNaN(f.getTime()))return;const x=g._flags.format;return m.convert&&x&&typeof f=="string"?{value:f,errors:v("date.format",{format:x})}:{value:f,errors:v("date.base")}},rules:{compare:{method:!1,validate(f,g,{date:v},{name:m,operator:x,args:y}){const b=v==="now"?Date.now():v.getTime();return d.compare(f.getTime(),b,x)?f:g.error("date."+m,{limit:y.date,value:f})},args:[{name:"date",ref:!0,normalize:f=>f==="now"?f:u.parse(f),assert:f=>f!==null,message:"must have a valid date format"}]},format:{method(f){return a(["iso","javascript","unix"].includes(f),"Unknown date format",f),this.$_setFlag("format",f)}},greater:{method(f){return this.$_addRule({name:"greater",method:"compare",args:{date:f},operator:">"})}},iso:{method(){return this.format("iso")}},less:{method(f){return this.$_addRule({name:"less",method:"compare",args:{date:f},operator:"<"})}},max:{method(f){return this.$_addRule({name:"max",method:"compare",args:{date:f},operator:"<="})}},min:{method(f){return this.$_addRule({name:"min",method:"compare",args:{date:f},operator:">="})}},timestamp:{method(f="javascript"){return a(["javascript","unix"].includes(f),'"type" must be one of "javascript, unix"'),this.format(f)}}},cast:{number:{from:u.isDate,to:(f,g)=>f.getTime()},string:{from:u.isDate,to:(f,{prefs:g})=>h.date(f,g)}},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"}}),u.parse=function(f,g){if(f instanceof Date)return f;if(typeof f!="string"&&(isNaN(f)||!isFinite(f))||/^\s*$/.test(f))return null;if(g==="iso")return d.isIsoDate(f)?u.date(f.toString()):null;const v=f;if(typeof f=="string"&&/^[+-]?\d+(\.\d+)?$/.test(f)&&(f=parseFloat(f)),g){if(g==="javascript")return u.date(1*f);if(g==="unix")return u.date(1e3*f);if(typeof v=="string")return null}return u.date(f)},u.date=function(f){const g=new Date(f);return isNaN(g.getTime())?null:g}},390:(s,i,o)=>{const a=o(375),c=o(7824);s.exports=c.extend({type:"function",properties:{typeof:"function"},rules:{arity:{method(d){return a(Number.isSafeInteger(d)&&d>=0,"n must be a positive integer"),this.$_addRule({name:"arity",args:{n:d}})},validate:(d,h,{n:u})=>d.length===u?d:h.error("function.arity",{n:u})},class:{method(){return this.$_addRule("class")},validate:(d,h)=>/^\s*class\s/.test(d.toString())?d:h.error("function.class",{value:d})},minArity:{method(d){return a(Number.isSafeInteger(d)&&d>0,"n must be a strict positive integer"),this.$_addRule({name:"minArity",args:{n:d}})},validate:(d,h,{n:u})=>d.length>=u?d:h.error("function.minArity",{n:u})},maxArity:{method(d){return a(Number.isSafeInteger(d)&&d>=0,"n must be a positive integer"),this.$_addRule({name:"maxArity",args:{n:d}})},validate:(d,h,{n:u})=>d.length<=u?d:h.error("function.maxArity",{n:u})}},messages:{"function.arity":"{{#label}} must have an arity of {{#n}}","function.class":"{{#label}} must be a class","function.maxArity":"{{#label}} must have an arity lesser or equal to {{#n}}","function.minArity":"{{#label}} must have an arity greater or equal to {{#n}}"}})},7824:(s,i,o)=>{const a=o(978),c=o(375),d=o(8571),h=o(3652),u=o(8068),f=o(8160),g=o(3292),v=o(6354),m=o(6133),x=o(3328),y={renameDefaults:{alias:!1,multiple:!1,override:!1}};s.exports=u.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:(b,w)=>b.keys(w),validate(b,{schema:w,error:E,state:R,prefs:T}){if(!b||typeof b!==w.$_property("typeof")||Array.isArray(b))return{value:b,errors:E("object.base",{type:w.$_property("typeof")})};if(!(w.$_terms.renames||w.$_terms.dependencies||w.$_terms.keys||w.$_terms.patterns||w.$_terms.externals))return;b=y.clone(b,T);const N=[];if(w.$_terms.renames&&!y.rename(w,b,R,T,N))return{value:b,errors:N};if(!w.$_terms.keys&&!w.$_terms.patterns&&!w.$_terms.dependencies)return{value:b,errors:N};const A=new Set(Object.keys(b));if(w.$_terms.keys){const D=[b,...R.ancestors];for(const O of w.$_terms.keys){const I=O.key,$=b[I];A.delete(I);const F=R.localize([...R.path,I],D,O),B=O.schema.$_validate($,F,T);if(B.errors){if(T.abortEarly)return{value:b,errors:B.errors};B.value!==void 0&&(b[I]=B.value),N.push(...B.errors)}else O.schema._flags.result==="strip"||B.value===void 0&&$!==void 0?delete b[I]:B.value!==void 0&&(b[I]=B.value)}}if(A.size||w._flags._hasPatternMatch){const D=y.unknown(w,b,A,N,R,T);if(D)return D}if(w.$_terms.dependencies)for(const D of w.$_terms.dependencies){if(D.key!==null&&y.isPresent(D.options)(D.key.resolve(b,R,T,null,{shadow:!1}))===!1)continue;const O=y.dependencies[D.rel](w,D,b,R,T);if(O){const I=w.$_createError(O.code,b,O.context,R,T);if(T.abortEarly)return{value:b,errors:I};N.push(I)}}return{value:b,errors:N}},rules:{and:{method(...b){return f.verifyFlat(b,"and"),y.dependency(this,"and",null,b)}},append:{method(b){return b==null||Object.keys(b).length===0?this:this.keys(b)}},assert:{method(b,w,E){x.isTemplate(b)||(b=g.ref(b)),c(E===void 0||typeof E=="string","Message must be a string"),w=this.$_compile(w,{appendPath:!0});const R=this.$_addRule({name:"assert",args:{subject:b,schema:w,message:E}});return R.$_mutateRegister(b),R.$_mutateRegister(w),R},validate(b,{error:w,prefs:E,state:R},{subject:T,schema:N,message:A}){const D=T.resolve(b,R,E),O=m.isRef(T)?T.absolute(R):[];return N.$_match(D,R.localize(O,[b,...R.ancestors],N),E)?b:w("object.assert",{subject:T,message:A})},args:["subject","schema","message"],multi:!0},instance:{method(b,w){return c(typeof b=="function","constructor must be a function"),w=w||b.name,this.$_addRule({name:"instance",args:{constructor:b,name:w}})},validate:(b,w,{constructor:E,name:R})=>b instanceof E?b:w.error("object.instance",{type:R,value:b}),args:["constructor","name"]},keys:{method(b){c(b===void 0||typeof b=="object","Object schema must be a valid object"),c(!f.isSchema(b),"Object schema cannot be a joi schema");const w=this.clone();if(b)if(Object.keys(b).length){w.$_terms.keys=w.$_terms.keys?w.$_terms.keys.filter(E=>!b.hasOwnProperty(E.key)):new y.Keys;for(const E in b)f.tryWithPath(()=>w.$_terms.keys.push({key:E,schema:this.$_compile(b[E])}),E)}else w.$_terms.keys=new y.Keys;else w.$_terms.keys=null;return w.$_mutateRebuild()}},length:{method(b){return this.$_addRule({name:"length",args:{limit:b},operator:"="})},validate:(b,w,{limit:E},{name:R,operator:T,args:N})=>f.compare(Object.keys(b).length,E,T)?b:w.error("object."+R,{limit:N.limit,value:b}),args:[{name:"limit",ref:!0,assert:f.limit,message:"must be a positive integer"}]},max:{method(b){return this.$_addRule({name:"max",method:"length",args:{limit:b},operator:"<="})}},min:{method(b){return this.$_addRule({name:"min",method:"length",args:{limit:b},operator:">="})}},nand:{method(...b){return f.verifyFlat(b,"nand"),y.dependency(this,"nand",null,b)}},or:{method(...b){return f.verifyFlat(b,"or"),y.dependency(this,"or",null,b)}},oxor:{method(...b){return y.dependency(this,"oxor",null,b)}},pattern:{method(b,w,E={}){const R=b instanceof RegExp;R||(b=this.$_compile(b,{appendPath:!0})),c(w!==void 0,"Invalid rule"),f.assertOptions(E,["fallthrough","matches"]),R&&c(!b.flags.includes("g")&&!b.flags.includes("y"),"pattern should not use global or sticky mode"),w=this.$_compile(w,{appendPath:!0});const T=this.clone();T.$_terms.patterns=T.$_terms.patterns||[];const N={[R?"regex":"schema"]:b,rule:w};return E.matches&&(N.matches=this.$_compile(E.matches),N.matches.type!=="array"&&(N.matches=N.matches.$_root.array().items(N.matches)),T.$_mutateRegister(N.matches),T.$_setFlag("_hasPatternMatch",!0,{clone:!1})),E.fallthrough&&(N.fallthrough=!0),T.$_terms.patterns.push(N),T.$_mutateRegister(w),T}},ref:{method(){return this.$_addRule("ref")},validate:(b,w)=>m.isRef(b)?b:w.error("object.refType",{value:b})},regex:{method(){return this.$_addRule("regex")},validate:(b,w)=>b instanceof RegExp?b:w.error("object.regex",{value:b})},rename:{method(b,w,E={}){c(typeof b=="string"||b instanceof RegExp,"Rename missing the from argument"),c(typeof w=="string"||w instanceof x,"Invalid rename to argument"),c(w!==b,"Cannot rename key to same name:",b),f.assertOptions(E,["alias","ignoreUndefined","override","multiple"]);const R=this.clone();R.$_terms.renames=R.$_terms.renames||[];for(const T of R.$_terms.renames)c(T.from!==b,"Cannot rename the same key multiple times");return w instanceof x&&R.$_mutateRegister(w),R.$_terms.renames.push({from:b,to:w,options:a(y.renameDefaults,E)}),R}},schema:{method(b="any"){return this.$_addRule({name:"schema",args:{type:b}})},validate:(b,w,{type:E})=>!f.isSchema(b)||E!=="any"&&b.type!==E?w.error("object.schema",{type:E}):b},unknown:{method(b){return this.$_setFlag("unknown",b!==!1)}},with:{method(b,w,E={}){return y.dependency(this,"with",b,w,E)}},without:{method(b,w,E={}){return y.dependency(this,"without",b,w,E)}},xor:{method(...b){return f.verifyFlat(b,"xor"),y.dependency(this,"xor",null,b)}}},overrides:{default(b,w){return b===void 0&&(b=f.symbols.deepDefault),this.$_parent("default",b,w)}},rebuild(b){if(b.$_terms.keys){const w=new h.Sorter;for(const E of b.$_terms.keys)f.tryWithPath(()=>w.add(E,{after:E.schema.$_rootReferences(),group:E.key}),E.key);b.$_terms.keys=new y.Keys(...w.nodes)}},manifest:{build(b,w){if(w.keys&&(b=b.keys(w.keys)),w.dependencies)for(const{rel:E,key:R=null,peers:T,options:N}of w.dependencies)b=y.dependency(b,E,R,T,N);if(w.patterns)for(const{regex:E,schema:R,rule:T,fallthrough:N,matches:A}of w.patterns)b=b.pattern(E||R,T,{fallthrough:N,matches:A});if(w.renames)for(const{from:E,to:R,options:T}of w.renames)b=b.rename(E,R,T);return b}},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}}"}}),y.clone=function(b,w){if(typeof b=="object"){if(w.nonEnumerables)return d(b,{shallow:!0});const R=Object.create(Object.getPrototypeOf(b));return Object.assign(R,b),R}const E=function(...R){return b.apply(this,R)};return E.prototype=d(b.prototype),Object.defineProperty(E,"name",{value:b.name,writable:!1}),Object.defineProperty(E,"length",{value:b.length,writable:!1}),Object.assign(E,b),E},y.dependency=function(b,w,E,R,T){c(E===null||typeof E=="string",w,"key must be a strings"),T||(T=R.length>1&&typeof R[R.length-1]=="object"?R.pop():{}),f.assertOptions(T,["separator","isPresent"]),R=[].concat(R);const N=f.default(T.separator,"."),A=[];for(const O of R)c(typeof O=="string",w,"peers must be strings"),A.push(g.ref(O,{separator:N,ancestor:0,prefix:!1}));E!==null&&(E=g.ref(E,{separator:N,ancestor:0,prefix:!1}));const D=b.clone();return D.$_terms.dependencies=D.$_terms.dependencies||[],D.$_terms.dependencies.push(new y.Dependency(w,E,A,R,T)),D},y.dependencies={and(b,w,E,R,T){const N=[],A=[],D=w.peers.length,O=y.isPresent(w.options);for(const I of w.peers)O(I.resolve(E,R,T,null,{shadow:!1}))===!1?N.push(I.key):A.push(I.key);if(N.length!==D&&A.length!==D)return{code:"object.and",context:{present:A,presentWithLabels:y.keysToLabels(b,A),missing:N,missingWithLabels:y.keysToLabels(b,N)}}},nand(b,w,E,R,T){const N=[],A=y.isPresent(w.options);for(const I of w.peers)A(I.resolve(E,R,T,null,{shadow:!1}))&&N.push(I.key);if(N.length!==w.peers.length)return;const D=w.paths[0],O=w.paths.slice(1);return{code:"object.nand",context:{main:D,mainWithLabel:y.keysToLabels(b,D),peers:O,peersWithLabels:y.keysToLabels(b,O)}}},or(b,w,E,R,T){const N=y.isPresent(w.options);for(const A of w.peers)if(N(A.resolve(E,R,T,null,{shadow:!1})))return;return{code:"object.missing",context:{peers:w.paths,peersWithLabels:y.keysToLabels(b,w.paths)}}},oxor(b,w,E,R,T){const N=[],A=y.isPresent(w.options);for(const O of w.peers)A(O.resolve(E,R,T,null,{shadow:!1}))&&N.push(O.key);if(!N.length||N.length===1)return;const D={peers:w.paths,peersWithLabels:y.keysToLabels(b,w.paths)};return D.present=N,D.presentWithLabels=y.keysToLabels(b,N),{code:"object.oxor",context:D}},with(b,w,E,R,T){const N=y.isPresent(w.options);for(const A of w.peers)if(N(A.resolve(E,R,T,null,{shadow:!1}))===!1)return{code:"object.with",context:{main:w.key.key,mainWithLabel:y.keysToLabels(b,w.key.key),peer:A.key,peerWithLabel:y.keysToLabels(b,A.key)}}},without(b,w,E,R,T){const N=y.isPresent(w.options);for(const A of w.peers)if(N(A.resolve(E,R,T,null,{shadow:!1})))return{code:"object.without",context:{main:w.key.key,mainWithLabel:y.keysToLabels(b,w.key.key),peer:A.key,peerWithLabel:y.keysToLabels(b,A.key)}}},xor(b,w,E,R,T){const N=[],A=y.isPresent(w.options);for(const O of w.peers)A(O.resolve(E,R,T,null,{shadow:!1}))&&N.push(O.key);if(N.length===1)return;const D={peers:w.paths,peersWithLabels:y.keysToLabels(b,w.paths)};return N.length===0?{code:"object.missing",context:D}:(D.present=N,D.presentWithLabels=y.keysToLabels(b,N),{code:"object.xor",context:D})}},y.keysToLabels=function(b,w){return Array.isArray(w)?w.map(E=>b.$_mapLabels(E)):b.$_mapLabels(w)},y.isPresent=function(b){return typeof b.isPresent=="function"?b.isPresent:w=>w!==void 0},y.rename=function(b,w,E,R,T){const N={};for(const A of b.$_terms.renames){const D=[],O=typeof A.from!="string";if(O)for(const I in w){if(w[I]===void 0&&A.options.ignoreUndefined||I===A.to)continue;const $=A.from.exec(I);$&&D.push({from:I,to:A.to,match:$})}else!Object.prototype.hasOwnProperty.call(w,A.from)||w[A.from]===void 0&&A.options.ignoreUndefined||D.push(A);for(const I of D){const $=I.from;let F=I.to;if(F instanceof x&&(F=F.render(w,E,R,I.match)),$!==F){if(!A.options.multiple&&N[F]&&(T.push(b.$_createError("object.rename.multiple",w,{from:$,to:F,pattern:O},E,R)),R.abortEarly)||Object.prototype.hasOwnProperty.call(w,F)&&!A.options.override&&!N[F]&&(T.push(b.$_createError("object.rename.override",w,{from:$,to:F,pattern:O},E,R)),R.abortEarly))return!1;w[$]===void 0?delete w[F]:w[F]=w[$],N[F]=!0,A.options.alias||delete w[$]}}}return!0},y.unknown=function(b,w,E,R,T,N){if(b.$_terms.patterns){let A=!1;const D=b.$_terms.patterns.map(I=>{if(I.matches)return A=!0,[]}),O=[w,...T.ancestors];for(const I of E){const $=w[I],F=[...T.path,I];for(let B=0;B<b.$_terms.patterns.length;++B){const W=b.$_terms.patterns[B];if(W.regex){const H=W.regex.test(I);if(T.mainstay.tracer.debug(T,"rule",`pattern.${B}`,H?"pass":"error"),!H)continue}else if(!W.schema.$_match(I,T.nest(W.schema,`pattern.${B}`),N))continue;E.delete(I);const Z=T.localize(F,O,{schema:W.rule,key:I}),Y=W.rule.$_validate($,Z,N);if(Y.errors){if(N.abortEarly)return{value:w,errors:Y.errors};R.push(...Y.errors)}if(W.matches&&D[B].push(I),w[I]=Y.value,!W.fallthrough)break}}if(A)for(let I=0;I<D.length;++I){const $=D[I];if(!$)continue;const F=b.$_terms.patterns[I].matches,B=T.localize(T.path,O,F),W=F.$_validate($,B,N);if(W.errors){const Z=v.details(W.errors,{override:!1});Z.matches=$;const Y=b.$_createError("object.pattern.match",w,Z,T,N);if(N.abortEarly)return{value:w,errors:Y};R.push(Y)}}}if(E.size&&(b.$_terms.keys||b.$_terms.patterns)){if(N.stripUnknown&&b._flags.unknown===void 0||N.skipFunctions){const A=!(!N.stripUnknown||N.stripUnknown!==!0&&!N.stripUnknown.objects);for(const D of E)A?(delete w[D],E.delete(D)):typeof w[D]=="function"&&E.delete(D)}if(!f.default(b._flags.unknown,N.allowUnknown))for(const A of E){const D=T.localize([...T.path,A],[]),O=b.$_createError("object.unknown",w[A],{child:A},D,N,{flags:!1});if(N.abortEarly)return{value:w,errors:O};R.push(O)}}},y.Dependency=class{constructor(b,w,E,R,T){this.rel=b,this.key=w,this.peers=E,this.paths=R,this.options=T}describe(){const b={rel:this.rel,peers:this.paths};return this.key!==null&&(b.key=this.key.key),this.peers[0].separator!=="."&&(b.options={...b.options,separator:this.peers[0].separator}),this.options.isPresent&&(b.options={...b.options,isPresent:this.options.isPresent}),b}},y.Keys=class extends Array{concat(b){const w=this.slice(),E=new Map;for(let R=0;R<w.length;++R)E.set(w[R].key,R);for(const R of b){const T=R.key,N=E.get(T);N!==void 0?w[N]={key:T,schema:w[N].schema.concat(R.schema)}:w.push(R)}return w}}},8785:(s,i,o)=>{const a=o(375),c=o(8068),d=o(8160),h=o(3292),u=o(6354),f={};s.exports=c.extend({type:"link",properties:{schemaChain:!0},terms:{link:{init:null,manifest:"single",register:!1}},args:(g,v)=>g.ref(v),validate(g,{schema:v,state:m,prefs:x}){a(v.$_terms.link,"Uninitialized link schema");const y=f.generate(v,g,m,x),b=v.$_terms.link[0].ref;return y.$_validate(g,m.nest(y,`link:${b.display}:${y.type}`),x)},generate:(g,v,m,x)=>f.generate(g,v,m,x),rules:{ref:{method(g){a(!this.$_terms.link,"Cannot reinitialize schema"),g=h.ref(g),a(g.type==="value"||g.type==="local","Invalid reference type:",g.type),a(g.type==="local"||g.ancestor==="root"||g.ancestor>0,"Link cannot reference itself");const v=this.clone();return v.$_terms.link=[{ref:g}],v}},relative:{method(g=!0){return this.$_setFlag("relative",g)}}},overrides:{concat(g){a(this.$_terms.link,"Uninitialized link schema"),a(d.isSchema(g),"Invalid schema object"),a(g.type!=="link","Cannot merge type link with another link");const v=this.clone();return v.$_terms.whens||(v.$_terms.whens=[]),v.$_terms.whens.push({concat:g}),v.$_mutateRebuild()}},manifest:{build:(g,v)=>(a(v.link,"Invalid link description missing link"),g.ref(v.link))}}),f.generate=function(g,v,m,x){let y=m.mainstay.links.get(g);if(y)return y._generate(v,m,x).schema;const b=g.$_terms.link[0].ref,{perspective:w,path:E}=f.perspective(b,m);f.assert(w,"which is outside of schema boundaries",b,g,m,x);try{y=E.length?w.$_reach(E):w}catch{f.assert(!1,"to non-existing schema",b,g,m,x)}return f.assert(y.type!=="link","which is another link",b,g,m,x),g._flags.relative||m.mainstay.links.set(g,y),y._generate(v,m,x).schema},f.perspective=function(g,v){if(g.type==="local"){for(const{schema:m,key:x}of v.schemas){if((m._flags.id||x)===g.path[0])return{perspective:m,path:g.path.slice(1)};if(m.$_terms.shared){for(const y of m.$_terms.shared)if(y._flags.id===g.path[0])return{perspective:y,path:g.path.slice(1)}}}return{perspective:null,path:null}}return g.ancestor==="root"?{perspective:v.schemas[v.schemas.length-1].schema,path:g.path}:{perspective:v.schemas[g.ancestor]&&v.schemas[g.ancestor].schema,path:g.path}},f.assert=function(g,v,m,x,y,b){g||a(!1,`"${u.label(x._flags,y,b)}" contains link reference "${m.display}" ${v}`)}},3832:(s,i,o)=>{const a=o(375),c=o(8068),d=o(8160),h={numberRx:/^\s*[+-]?(?:(?:\d+(?:\.\d*)?)|(?:\.\d+))(?:e([+-]?\d+))?\s*$/i,precisionRx:/(?:\.(\d+))?(?:[eE]([+-]?\d+))?$/,exponentialPartRegex:/[eE][+-]?\d+$/,leadingSignAndZerosRegex:/^[+-]?(0*)?/,dotRegex:/\./,trailingZerosRegex:/0+$/,decimalPlaces(u){const f=u.toString(),g=f.indexOf("."),v=f.indexOf("e");return(g<0?0:(v<0?f.length:v)-g-1)+(v<0?0:Math.max(0,-parseInt(f.slice(v+1))))}};s.exports=c.extend({type:"number",flags:{unsafe:{default:!1}},coerce:{from:"string",method(u,{schema:f,error:g}){if(!u.match(h.numberRx))return;u=u.trim();const v={value:parseFloat(u)};if(v.value===0&&(v.value=0),!f._flags.unsafe)if(u.match(/e/i)){if(h.extractSignificantDigits(u)!==h.extractSignificantDigits(String(v.value)))return v.errors=g("number.unsafe"),v}else{const m=v.value.toString();if(m.match(/e/i))return v;if(m!==h.normalizeDecimal(u))return v.errors=g("number.unsafe"),v}return v}},validate(u,{schema:f,error:g,prefs:v}){if(u===1/0||u===-1/0)return{value:u,errors:g("number.infinity")};if(!d.isNumber(u))return{value:u,errors:g("number.base")};const m={value:u};if(v.convert){const x=f.$_getRule("precision");if(x){const y=Math.pow(10,x.args.limit);m.value=Math.round(m.value*y)/y}}return m.value===0&&(m.value=0),!f._flags.unsafe&&(u>Number.MAX_SAFE_INTEGER||u<Number.MIN_SAFE_INTEGER)&&(m.errors=g("number.unsafe")),m},rules:{compare:{method:!1,validate:(u,f,{limit:g},{name:v,operator:m,args:x})=>d.compare(u,g,m)?u:f.error("number."+v,{limit:x.limit,value:u}),args:[{name:"limit",ref:!0,assert:d.isNumber,message:"must be a number"}]},greater:{method(u){return this.$_addRule({name:"greater",method:"compare",args:{limit:u},operator:">"})}},integer:{method(){return this.$_addRule("integer")},validate:(u,f)=>Math.trunc(u)-u==0?u:f.error("number.integer")},less:{method(u){return this.$_addRule({name:"less",method:"compare",args:{limit:u},operator:"<"})}},max:{method(u){return this.$_addRule({name:"max",method:"compare",args:{limit:u},operator:"<="})}},min:{method(u){return this.$_addRule({name:"min",method:"compare",args:{limit:u},operator:">="})}},multiple:{method(u){const f=typeof u=="number"?h.decimalPlaces(u):null,g=Math.pow(10,f);return this.$_addRule({name:"multiple",args:{base:u,baseDecimalPlace:f,pfactor:g}})},validate:(u,f,{base:g,baseDecimalPlace:v,pfactor:m},x)=>h.decimalPlaces(u)>v?f.error("number.multiple",{multiple:x.args.base,value:u}):Math.round(m*u)%Math.round(m*g)==0?u:f.error("number.multiple",{multiple:x.args.base,value:u}),args:[{name:"base",ref:!0,assert:u=>typeof u=="number"&&isFinite(u)&&u>0,message:"must be a positive number"},"baseDecimalPlace","pfactor"],multi:!0},negative:{method(){return this.sign("negative")}},port:{method(){return this.$_addRule("port")},validate:(u,f)=>Number.isSafeInteger(u)&&u>=0&&u<=65535?u:f.error("number.port")},positive:{method(){return this.sign("positive")}},precision:{method(u){return a(Number.isSafeInteger(u),"limit must be an integer"),this.$_addRule({name:"precision",args:{limit:u}})},validate(u,f,{limit:g}){const v=u.toString().match(h.precisionRx);return Math.max((v[1]?v[1].length:0)-(v[2]?parseInt(v[2],10):0),0)<=g?u:f.error("number.precision",{limit:g,value:u})},convert:!0},sign:{method(u){return a(["negative","positive"].includes(u),"Invalid sign",u),this.$_addRule({name:"sign",args:{sign:u}})},validate:(u,f,{sign:g})=>g==="negative"&&u<0||g==="positive"&&u>0?u:f.error(`number.${g}`)},unsafe:{method(u=!0){return a(typeof u=="boolean","enabled must be a boolean"),this.$_setFlag("unsafe",u)}}},cast:{string:{from:u=>typeof u=="number",to:(u,f)=>u.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"}}),h.extractSignificantDigits=function(u){return u.replace(h.exponentialPartRegex,"").replace(h.dotRegex,"").replace(h.trailingZerosRegex,"").replace(h.leadingSignAndZerosRegex,"")},h.normalizeDecimal=function(u){return(u=u.replace(/^\+/,"").replace(/\.0*$/,"").replace(/^(-?)\.([^\.]*)$/,"$10.$2").replace(/^(-?)0+([0-9])/,"$1$2")).includes(".")&&u.endsWith("0")&&(u=u.replace(/0+$/,"")),u==="-0"?"0":u}},8966:(s,i,o)=>{const a=o(7824);s.exports=a.extend({type:"object",cast:{map:{from:c=>c&&typeof c=="object",to:(c,d)=>new Map(Object.entries(c))}}})},7417:(s,i,o)=>{const a=o(375),c=o(5380),d=o(1745),h=o(9959),u=o(6064),f=o(9926),g=o(5752),v=o(8068),m=o(8160),x={tlds:f instanceof Set&&{tlds:{allow:f,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:h.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=v.extend({type:"string",flags:{insensitive:{default:!1},truncate:{default:!1}},terms:{replacements:{init:null}},coerce:{from:"string",method(y,{schema:b,state:w,prefs:E}){const R=b.$_getRule("normalize");R&&(y=y.normalize(R.args.form));const T=b.$_getRule("case");T&&(y=T.args.direction==="upper"?y.toLocaleUpperCase():y.toLocaleLowerCase());const N=b.$_getRule("trim");if(N&&N.args.enabled&&(y=y.trim()),b.$_terms.replacements)for(const D of b.$_terms.replacements)y=y.replace(D.pattern,D.replacement);const A=b.$_getRule("hex");if(A&&A.args.options.byteAligned&&y.length%2!=0&&(y=`0${y}`),b.$_getRule("isoDate")){const D=x.isoDate(y);D&&(y=D)}if(b._flags.truncate){const D=b.$_getRule("max");if(D){let O=D.args.limit;if(m.isResolvable(O)&&(O=O.resolve(y,w,E),!m.limit(O)))return{value:y,errors:b.$_createError("any.ref",O,{ref:D.args.limit,arg:"limit",reason:"must be a positive integer"},w,E)};y=y.slice(0,O)}}return{value:y}}},validate(y,{schema:b,error:w}){if(typeof y!="string")return{value:y,errors:w("string.base")};if(y===""){const E=b.$_getRule("min");return E&&E.args.limit===0?void 0:{value:y,errors:w("string.empty")}}},rules:{alphanum:{method(){return this.$_addRule("alphanum")},validate:(y,b)=>/^[a-zA-Z0-9]+$/.test(y)?y:b.error("string.alphanum")},base64:{method(y={}){return m.assertOptions(y,["paddingRequired","urlSafe"]),y={urlSafe:!1,paddingRequired:!0,...y},a(typeof y.paddingRequired=="boolean","paddingRequired must be boolean"),a(typeof y.urlSafe=="boolean","urlSafe must be boolean"),this.$_addRule({name:"base64",args:{options:y}})},validate:(y,b,{options:w})=>x.base64Regex[w.paddingRequired][w.urlSafe].test(y)?y:b.error("string.base64")},case:{method(y){return a(["lower","upper"].includes(y),"Invalid case:",y),this.$_addRule({name:"case",args:{direction:y}})},validate:(y,b,{direction:w})=>w==="lower"&&y===y.toLocaleLowerCase()||w==="upper"&&y===y.toLocaleUpperCase()?y:b.error(`string.${w}case`),convert:!0},creditCard:{method(){return this.$_addRule("creditCard")},validate(y,b){let w=y.length,E=0,R=1;for(;w--;){const T=y.charAt(w)*R;E+=T-9*(T>9),R^=3}return E>0&&E%10==0?y:b.error("string.creditCard")}},dataUri:{method(y={}){return m.assertOptions(y,["paddingRequired"]),y={paddingRequired:!0,...y},a(typeof y.paddingRequired=="boolean","paddingRequired must be boolean"),this.$_addRule({name:"dataUri",args:{options:y}})},validate(y,b,{options:w}){const E=y.match(x.dataUriRegex);return E&&(!E[2]||E[2]!=="base64"||x.base64Regex[w.paddingRequired].false.test(E[3]))?y:b.error("string.dataUri")}},domain:{method(y){y&&m.assertOptions(y,["allowFullyQualified","allowUnicode","maxDomainSegments","minDomainSegments","tlds"]);const b=x.addressOptions(y);return this.$_addRule({name:"domain",args:{options:y},address:b})},validate:(y,b,w,{address:E})=>c.isValid(y,E)?y:b.error("string.domain")},email:{method(y={}){m.assertOptions(y,["allowFullyQualified","allowUnicode","ignoreLength","maxDomainSegments","minDomainSegments","multiple","separator","tlds"]),a(y.multiple===void 0||typeof y.multiple=="boolean","multiple option must be an boolean");const b=x.addressOptions(y),w=new RegExp(`\\s*[${y.separator?u(y.separator):","}]\\s*`);return this.$_addRule({name:"email",args:{options:y},regex:w,address:b})},validate(y,b,{options:w},{regex:E,address:R}){const T=w.multiple?y.split(E):[y],N=[];for(const A of T)d.isValid(A,R)||N.push(A);return N.length?b.error("string.email",{value:y,invalids:N}):y}},guid:{alias:"uuid",method(y={}){m.assertOptions(y,["version","separator"]);let b="";if(y.version){const R=[].concat(y.version);a(R.length>=1,"version must have at least 1 valid version specified");const T=new Set;for(let N=0;N<R.length;++N){const A=R[N];a(typeof A=="string","version at position "+N+" must be a string");const D=x.guidVersions[A.toLowerCase()];a(D,"version at position "+N+" must be one of "+Object.keys(x.guidVersions).join(", ")),a(!T.has(D),"version at position "+N+" must not be a duplicate"),b+=D,T.add(D)}}a(x.guidSeparators.has(y.separator),'separator must be one of true, false, "-", or ":"');const w=y.separator===void 0?"[:-]?":y.separator===!0?"[:-]":y.separator===!1?"[]?":`\\${y.separator}`,E=new RegExp(`^([\\[{\\(]?)[0-9A-F]{8}(${w})[0-9A-F]{4}\\2?[${b||"0-9A-F"}][0-9A-F]{3}\\2?[${b?"89AB":"0-9A-F"}][0-9A-F]{3}\\2?[0-9A-F]{12}([\\]}\\)]?)$`,"i");return this.$_addRule({name:"guid",args:{options:y},regex:E})},validate(y,b,w,{regex:E}){const R=E.exec(y);return R?x.guidBrackets[R[1]]!==R[R.length-1]?b.error("string.guid"):y:b.error("string.guid")}},hex:{method(y={}){return m.assertOptions(y,["byteAligned","prefix"]),y={byteAligned:!1,prefix:!1,...y},a(typeof y.byteAligned=="boolean","byteAligned must be boolean"),a(typeof y.prefix=="boolean"||y.prefix==="optional",'prefix must be boolean or "optional"'),this.$_addRule({name:"hex",args:{options:y}})},validate:(y,b,{options:w})=>(w.prefix==="optional"?x.hexRegex.withOptionalPrefix:w.prefix===!0?x.hexRegex.withPrefix:x.hexRegex.withoutPrefix).test(y)?w.byteAligned&&y.length%2!=0?b.error("string.hexAlign"):y:b.error("string.hex")},hostname:{method(){return this.$_addRule("hostname")},validate:(y,b)=>c.isValid(y,{minDomainSegments:1})||x.ipRegex.test(y)?y:b.error("string.hostname")},insensitive:{method(){return this.$_setFlag("insensitive",!0)}},ip:{method(y={}){m.assertOptions(y,["cidr","version"]);const{cidr:b,versions:w,regex:E}=h.regex(y),R=y.version?w:void 0;return this.$_addRule({name:"ip",args:{options:{cidr:b,version:R}},regex:E})},validate:(y,b,{options:w},{regex:E})=>E.test(y)?y:w.version?b.error("string.ipVersion",{value:y,cidr:w.cidr,version:w.version}):b.error("string.ip",{value:y,cidr:w.cidr})},isoDate:{method(){return this.$_addRule("isoDate")},validate:(y,{error:b})=>x.isoDate(y)?y:b("string.isoDate")},isoDuration:{method(){return this.$_addRule("isoDuration")},validate:(y,b)=>x.isoDurationRegex.test(y)?y:b.error("string.isoDuration")},length:{method(y,b){return x.length(this,"length",y,"=",b)},validate(y,b,{limit:w,encoding:E},{name:R,operator:T,args:N}){const A=!E&&y.length;return m.compare(A,w,T)?y:b.error("string."+R,{limit:N.limit,value:y,encoding:E})},args:[{name:"limit",ref:!0,assert:m.limit,message:"must be a positive integer"},"encoding"]},lowercase:{method(){return this.case("lower")}},max:{method(y,b){return x.length(this,"max",y,"<=",b)},args:["limit","encoding"]},min:{method(y,b){return x.length(this,"min",y,">=",b)},args:["limit","encoding"]},normalize:{method(y="NFC"){return a(x.normalizationForms.includes(y),"normalization form must be one of "+x.normalizationForms.join(", ")),this.$_addRule({name:"normalize",args:{form:y}})},validate:(y,{error:b},{form:w})=>y===y.normalize(w)?y:b("string.normalize",{value:y,form:w}),convert:!0},pattern:{alias:"regex",method(y,b={}){a(y instanceof RegExp,"regex must be a RegExp"),a(!y.flags.includes("g")&&!y.flags.includes("y"),"regex should not use global or sticky mode"),typeof b=="string"&&(b={name:b}),m.assertOptions(b,["invert","name"]);const w=["string.pattern",b.invert?".invert":"",b.name?".name":".base"].join("");return this.$_addRule({name:"pattern",args:{regex:y,options:b},errorCode:w})},validate:(y,b,{regex:w,options:E},{errorCode:R})=>w.test(y)^E.invert?y:b.error(R,{name:E.name,regex:w,value:y}),args:["regex","options"],multi:!0},replace:{method(y,b){typeof y=="string"&&(y=new RegExp(u(y),"g")),a(y instanceof RegExp,"pattern must be a RegExp"),a(typeof b=="string","replacement must be a String");const w=this.clone();return w.$_terms.replacements||(w.$_terms.replacements=[]),w.$_terms.replacements.push({pattern:y,replacement:b}),w}},token:{method(){return this.$_addRule("token")},validate:(y,b)=>/^\w+$/.test(y)?y:b.error("string.token")},trim:{method(y=!0){return a(typeof y=="boolean","enabled must be a boolean"),this.$_addRule({name:"trim",args:{enabled:y}})},validate:(y,b,{enabled:w})=>w&&y!==y.trim()?b.error("string.trim"):y,convert:!0},truncate:{method(y=!0){return a(typeof y=="boolean","enabled must be a boolean"),this.$_setFlag("truncate",y)}},uppercase:{method(){return this.case("upper")}},uri:{method(y={}){m.assertOptions(y,["allowRelative","allowQuerySquareBrackets","domain","relativeOnly","scheme","encodeUri"]),y.domain&&m.assertOptions(y.domain,["allowFullyQualified","allowUnicode","maxDomainSegments","minDomainSegments","tlds"]);const{regex:b,scheme:w}=g.regex(y),E=y.domain?x.addressOptions(y.domain):null;return this.$_addRule({name:"uri",args:{options:y},regex:b,domain:E,scheme:w})},validate(y,b,{options:w},{regex:E,domain:R,scheme:T}){if(["http:/","https:/"].includes(y))return b.error("string.uri");let N=E.exec(y);if(!N&&b.prefs.convert&&w.encodeUri){const A=encodeURI(y);N=E.exec(A),N&&(y=A)}if(N){const A=N[1]||N[2];return!R||w.allowRelative&&!A||c.isValid(A,R)?y:b.error("string.domain",{value:A})}return w.relativeOnly?b.error("string.uriRelativeOnly"):w.scheme?b.error("string.uriCustomScheme",{scheme:T,value:y}):b.error("string.uri")}}},manifest:{build(y,b){if(b.replacements)for(const{pattern:w,replacement:E}of b.replacements)y=y.replace(w,E);return y}},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"}}),x.addressOptions=function(y){if(!y)return x.tlds||y;if(a(y.minDomainSegments===void 0||Number.isSafeInteger(y.minDomainSegments)&&y.minDomainSegments>0,"minDomainSegments must be a positive integer"),a(y.maxDomainSegments===void 0||Number.isSafeInteger(y.maxDomainSegments)&&y.maxDomainSegments>0,"maxDomainSegments must be a positive integer"),y.tlds===!1)return y;if(y.tlds===!0||y.tlds===void 0)return a(x.tlds,"Built-in TLD list disabled"),Object.assign({},y,x.tlds);a(typeof y.tlds=="object","tlds must be true, false, or an object");const b=y.tlds.deny;if(b)return Array.isArray(b)&&(y=Object.assign({},y,{tlds:{deny:new Set(b)}})),a(y.tlds.deny instanceof Set,"tlds.deny must be an array, Set, or boolean"),a(!y.tlds.allow,"Cannot specify both tlds.allow and tlds.deny lists"),x.validateTlds(y.tlds.deny,"tlds.deny"),y;const w=y.tlds.allow;return w?w===!0?(a(x.tlds,"Built-in TLD list disabled"),Object.assign({},y,x.tlds)):(Array.isArray(w)&&(y=Object.assign({},y,{tlds:{allow:new Set(w)}})),a(y.tlds.allow instanceof Set,"tlds.allow must be an array, Set, or boolean"),x.validateTlds(y.tlds.allow,"tlds.allow"),y):y},x.validateTlds=function(y,b){for(const w of y)a(c.isValid(w,{minDomainSegments:1,maxDomainSegments:1}),`${b} must contain valid top level domain names`)},x.isoDate=function(y){if(!m.isIsoDate(y))return null;/.*T.*[+-]\d\d$/.test(y)&&(y+="00");const b=new Date(y);return isNaN(b.getTime())?null:b.toISOString()},x.length=function(y,b,w,E,R){return a(!R||!1,"Invalid encoding:",R),y.$_addRule({name:b,method:"length",args:{limit:w,encoding:R},operator:E})}},8826:(s,i,o)=>{const a=o(375),c=o(8068),d={};d.Map=class extends Map{slice(){return new d.Map(this)}},s.exports=c.extend({type:"symbol",terms:{map:{init:new d.Map}},coerce:{method(h,{schema:u,error:f}){const g=u.$_terms.map.get(h);return g&&(h=g),u._flags.only&&typeof h!="symbol"?{value:h,errors:f("symbol.map",{map:u.$_terms.map})}:{value:h}}},validate(h,{error:u}){if(typeof h!="symbol")return{value:h,errors:u("symbol.base")}},rules:{map:{method(h){h&&!h[Symbol.iterator]&&typeof h=="object"&&(h=Object.entries(h)),a(h&&h[Symbol.iterator],"Iterable must be an iterable or object");const u=this.clone(),f=[];for(const g of h){a(g&&g[Symbol.iterator],"Entry must be an iterable");const[v,m]=g;a(typeof v!="object"&&typeof v!="function"&&typeof v!="symbol","Key must not be of type object, function, or Symbol"),a(typeof m=="symbol","Value must be a Symbol"),u.$_terms.map.set(v,m),f.push(m)}return u.valid(...f)}}},manifest:{build:(h,u)=>(u.map&&(h=h.map(u.map)),h)},messages:{"symbol.base":"{{#label}} must be a symbol","symbol.map":"{{#label}} must be one of {{#map}}"}})},8863:(s,i,o)=>{const a=o(375),c=o(8571),d=o(738),h=o(9621),u=o(8160),f=o(6354),g=o(493),v={result:Symbol("result")};i.entry=function(m,x,y){let b=u.defaults;y&&(a(y.warnings===void 0,"Cannot override warnings preference in synchronous validation"),a(y.artifacts===void 0,"Cannot override artifacts preference in synchronous validation"),b=u.preferences(u.defaults,y));const w=v.entry(m,x,b);a(!w.mainstay.externals.length,"Schema with external rules must use validateAsync()");const E={value:w.value};return w.error&&(E.error=w.error),w.mainstay.warnings.length&&(E.warning=f.details(w.mainstay.warnings)),w.mainstay.debug&&(E.debug=w.mainstay.debug),w.mainstay.artifacts&&(E.artifacts=w.mainstay.artifacts),E},i.entryAsync=async function(m,x,y){let b=u.defaults;y&&(b=u.preferences(u.defaults,y));const w=v.entry(m,x,b),E=w.mainstay;if(w.error)throw E.debug&&(w.error.debug=E.debug),w.error;if(E.externals.length){let T=w.value;const N=[];for(const A of E.externals){const D=A.state.path,O=A.schema.type==="link"?E.links.get(A.schema):null;let I,$,F=T;const B=D.length?[T]:[],W=D.length?h(m,D):m;if(D.length){I=D[D.length-1];let Z=T;for(const Y of D.slice(0,-1))Z=Z[Y],B.unshift(Z);$=B[0],F=$[I]}try{const Z=(H,se)=>(O||A.schema).$_createError(H,F,se,A.state,b),Y=await A.method(F,{schema:A.schema,linked:O,state:A.state,prefs:y,original:W,error:Z,errorsArray:v.errorsArray,warn:(H,se)=>E.warnings.push((O||A.schema).$_createError(H,F,se,A.state,b)),message:(H,se)=>(O||A.schema).$_createError("external",F,se,A.state,b,{messages:H})});if(Y===void 0||Y===F)continue;if(Y instanceof f.Report){if(E.tracer.log(A.schema,A.state,"rule","external","error"),N.push(Y),b.abortEarly)break;continue}if(Array.isArray(Y)&&Y[u.symbols.errors]){if(E.tracer.log(A.schema,A.state,"rule","external","error"),N.push(...Y),b.abortEarly)break;continue}$?(E.tracer.value(A.state,"rule",F,Y,"external"),$[I]=Y):(E.tracer.value(A.state,"rule",T,Y,"external"),T=Y)}catch(Z){throw b.errors.label&&(Z.message+=` (${A.label})`),Z}}if(w.value=T,N.length)throw w.error=f.process(N,m,b),E.debug&&(w.error.debug=E.debug),w.error}if(!b.warnings&&!b.debug&&!b.artifacts)return w.value;const R={value:w.value};return E.warnings.length&&(R.warning=f.details(E.warnings)),E.debug&&(R.debug=E.debug),E.artifacts&&(R.artifacts=E.artifacts),R},v.Mainstay=class{constructor(m,x,y){this.externals=[],this.warnings=[],this.tracer=m,this.debug=x,this.links=y,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()}},v.entry=function(m,x,y){const{tracer:b,cleanup:w}=v.tracer(x,y),E=y.debug?[]:null,R=x._ids._schemaChain?new Map:null,T=new v.Mainstay(b,E,R),N=x._ids._schemaChain?[{schema:x}]:null,A=new g([],[],{mainstay:T,schemas:N}),D=i.validate(m,x,A,y);w&&x.$_root.untrace();const O=f.process(D.errors,m,y);return{value:D.value,error:O,mainstay:T}},v.tracer=function(m,x){return m.$_root._tracer?{tracer:m.$_root._tracer._register(m)}:x.debug?(a(m.$_root.trace,"Debug mode not supported"),{tracer:m.$_root.trace()._register(m),cleanup:!0}):{tracer:v.ignore}},i.validate=function(m,x,y,b,w={}){if(x.$_terms.whens&&(x=x._generate(m,y,b).schema),x._preferences&&(b=v.prefs(x,b)),x._cache&&b.cache){const O=x._cache.get(m);if(y.mainstay.tracer.debug(y,"validate","cached",!!O),O)return O}const E=(O,I,$)=>x.$_createError(O,m,I,$||y,b),R={original:m,prefs:b,schema:x,state:y,error:E,errorsArray:v.errorsArray,warn:(O,I,$)=>y.mainstay.warnings.push(E(O,I,$)),message:(O,I)=>x.$_createError("custom",m,I,y,b,{messages:O})};y.mainstay.tracer.entry(x,y);const T=x._definition;if(T.prepare&&m!==void 0&&b.convert){const O=T.prepare(m,R);if(O){if(y.mainstay.tracer.value(y,"prepare",m,O.value),O.errors)return v.finalize(O.value,[].concat(O.errors),R);m=O.value}}if(T.coerce&&m!==void 0&&b.convert&&(!T.coerce.from||T.coerce.from.includes(typeof m))){const O=T.coerce.method(m,R);if(O){if(y.mainstay.tracer.value(y,"coerced",m,O.value),O.errors)return v.finalize(O.value,[].concat(O.errors),R);m=O.value}}const N=x._flags.empty;N&&N.$_match(v.trim(m,x),y.nest(N),u.defaults)&&(y.mainstay.tracer.value(y,"empty",m,void 0),m=void 0);const A=w.presence||x._flags.presence||(x._flags._endedSwitch?null:b.presence);if(m===void 0){if(A==="forbidden")return v.finalize(m,null,R);if(A==="required")return v.finalize(m,[x.$_createError("any.required",m,null,y,b)],R);if(A==="optional"){if(x._flags.default!==u.symbols.deepDefault)return v.finalize(m,null,R);y.mainstay.tracer.value(y,"default",m,{}),m={}}}else if(A==="forbidden")return v.finalize(m,[x.$_createError("any.unknown",m,null,y,b)],R);const D=[];if(x._valids){const O=x._valids.get(m,y,b,x._flags.insensitive);if(O)return b.convert&&(y.mainstay.tracer.value(y,"valids",m,O.value),m=O.value),y.mainstay.tracer.filter(x,y,"valid",O),v.finalize(m,null,R);if(x._flags.only){const I=x.$_createError("any.only",m,{valids:x._valids.values({display:!0})},y,b);if(b.abortEarly)return v.finalize(m,[I],R);D.push(I)}}if(x._invalids){const O=x._invalids.get(m,y,b,x._flags.insensitive);if(O){y.mainstay.tracer.filter(x,y,"invalid",O);const I=x.$_createError("any.invalid",m,{invalids:x._invalids.values({display:!0})},y,b);if(b.abortEarly)return v.finalize(m,[I],R);D.push(I)}}if(T.validate){const O=T.validate(m,R);if(O&&(y.mainstay.tracer.value(y,"base",m,O.value),m=O.value,O.errors)){if(!Array.isArray(O.errors))return D.push(O.errors),v.finalize(m,D,R);if(O.errors.length)return D.push(...O.errors),v.finalize(m,D,R)}}return x._rules.length?v.rules(m,D,R):v.finalize(m,D,R)},v.rules=function(m,x,y){const{schema:b,state:w,prefs:E}=y;for(const R of b._rules){const T=b._definition.rules[R.method];if(T.convert&&E.convert){w.mainstay.tracer.log(b,w,"rule",R.name,"full");continue}let N,A=R.args;if(R._resolve.length){A=Object.assign({},A);for(const O of R._resolve){const I=T.argsByName.get(O),$=A[O].resolve(m,w,E),F=I.normalize?I.normalize($):$,B=u.validateArg(F,null,I);if(B){N=b.$_createError("any.ref",$,{arg:O,ref:A[O],reason:B},w,E);break}A[O]=F}}N=N||T.validate(m,y,A,R);const D=v.rule(N,R);if(D.errors){if(w.mainstay.tracer.log(b,w,"rule",R.name,"error"),R.warn){w.mainstay.warnings.push(...D.errors);continue}if(E.abortEarly)return v.finalize(m,D.errors,y);x.push(...D.errors)}else w.mainstay.tracer.log(b,w,"rule",R.name,"pass"),w.mainstay.tracer.value(w,"rule",m,D.value,R.name),m=D.value}return v.finalize(m,x,y)},v.rule=function(m,x){return m instanceof f.Report?(v.error(m,x),{errors:[m],value:null}):Array.isArray(m)&&m[u.symbols.errors]?(m.forEach(y=>v.error(y,x)),{errors:m,value:null}):{errors:null,value:m}},v.error=function(m,x){return x.message&&m._setTemplate(x.message),m},v.finalize=function(m,x,y){x=x||[];const{schema:b,state:w,prefs:E}=y;if(x.length){const T=v.default("failover",void 0,x,y);T!==void 0&&(w.mainstay.tracer.value(w,"failover",m,T),m=T,x=[])}if(x.length&&b._flags.error)if(typeof b._flags.error=="function"){x=b._flags.error(x),Array.isArray(x)||(x=[x]);for(const T of x)a(T instanceof Error||T instanceof f.Report,"error() must return an Error object")}else x=[b._flags.error];if(m===void 0){const T=v.default("default",m,x,y);w.mainstay.tracer.value(w,"default",m,T),m=T}if(b._flags.cast&&m!==void 0){const T=b._definition.cast[b._flags.cast];if(T.from(m)){const N=T.to(m,y);w.mainstay.tracer.value(w,"cast",m,N,b._flags.cast),m=N}}if(b.$_terms.externals&&E.externals&&E._externals!==!1)for(const{method:T}of b.$_terms.externals)w.mainstay.externals.push({method:T,schema:b,state:w,label:f.label(b._flags,w,E)});const R={value:m,errors:x.length?x:null};return b._flags.result&&(R.value=b._flags.result==="strip"?void 0:y.original,w.mainstay.tracer.value(w,b._flags.result,m,R.value),w.shadow(m,b._flags.result)),b._cache&&E.cache!==!1&&!b._refs.length&&b._cache.set(y.original,R),m===void 0||R.errors||b._flags.artifact===void 0||(w.mainstay.artifacts=w.mainstay.artifacts||new Map,w.mainstay.artifacts.has(b._flags.artifact)||w.mainstay.artifacts.set(b._flags.artifact,[]),w.mainstay.artifacts.get(b._flags.artifact).push(w.path)),R},v.prefs=function(m,x){const y=x===u.defaults;return y&&m._preferences[u.symbols.prefs]?m._preferences[u.symbols.prefs]:(x=u.preferences(x,m._preferences),y&&(m._preferences[u.symbols.prefs]=x),x)},v.default=function(m,x,y,b){const{schema:w,state:E,prefs:R}=b,T=w._flags[m];if(R.noDefaults||T===void 0)return x;if(E.mainstay.tracer.log(w,E,"rule",m,"full"),!T)return T;if(typeof T=="function"){const N=T.length?[c(E.ancestors[0]),b]:[];try{return T(...N)}catch(A){return void y.push(w.$_createError(`any.${m}`,null,{error:A},E,R))}}return typeof T!="object"?T:T[u.symbols.literal]?T.literal:u.isResolvable(T)?T.resolve(x,E,R):c(T)},v.trim=function(m,x){if(typeof m!="string")return m;const y=x.$_getRule("trim");return y&&y.args.enabled?m.trim():m},v.ignore={active:!1,debug:d,entry:d,filter:d,log:d,resolve:d,value:d},v.errorsArray=function(){const m=[];return m[u.symbols.errors]=!0,m}},2036:(s,i,o)=>{const a=o(375),c=o(9474),d=o(8160),h={};s.exports=h.Values=class{constructor(u,f){this._values=new Set(u),this._refs=new Set(f),this._lowercase=h.lowercases(u),this._override=!1}get length(){return this._values.size+this._refs.size}add(u,f){d.isResolvable(u)?this._refs.has(u)||(this._refs.add(u),f&&f.register(u)):this.has(u,null,null,!1)||(this._values.add(u),typeof u=="string"&&this._lowercase.set(u.toLowerCase(),u))}static merge(u,f,g){if(u=u||new h.Values,f){if(f._override)return f.clone();for(const v of[...f._values,...f._refs])u.add(v)}if(g)for(const v of[...g._values,...g._refs])u.remove(v);return u.length?u:null}remove(u){d.isResolvable(u)?this._refs.delete(u):(this._values.delete(u),typeof u=="string"&&this._lowercase.delete(u.toLowerCase()))}has(u,f,g,v){return!!this.get(u,f,g,v)}get(u,f,g,v){if(!this.length)return!1;if(this._values.has(u))return{value:u};if(typeof u=="string"&&u&&v){const m=this._lowercase.get(u.toLowerCase());if(m)return{value:m}}if(!this._refs.size&&typeof u!="object")return!1;if(typeof u=="object"){for(const m of this._values)if(c(m,u))return{value:m}}if(f)for(const m of this._refs){const x=m.resolve(u,f,g,null,{in:!0});if(x===void 0)continue;const y=m.in&&typeof x=="object"?Array.isArray(x)?x:Object.keys(x):[x];for(const b of y)if(typeof b==typeof u){if(v&&u&&typeof u=="string"){if(b.toLowerCase()===u.toLowerCase())return{value:b,ref:m}}else if(c(b,u))return{value:b,ref:m}}}return!1}override(){this._override=!0}values(u){if(u&&u.display){const f=[];for(const g of[...this._values,...this._refs])g!==void 0&&f.push(g);return f}return Array.from([...this._values,...this._refs])}clone(){const u=new h.Values(this._values,this._refs);return u._override=this._override,u}concat(u){a(!u._override,"Cannot concat override set of values");const f=new h.Values([...this._values,...u._values],[...this._refs,...u._refs]);return f._override=this._override,f}describe(){const u=[];this._override&&u.push({override:!0});for(const f of this._values.values())u.push(f&&typeof f=="object"?{value:f}:f);for(const f of this._refs.values())u.push(f.describe());return u}},h.Values.prototype[d.symbols.values]=!0,h.Values.prototype.slice=h.Values.prototype.clone,h.lowercases=function(u){const f=new Map;if(u)for(const g of u)typeof g=="string"&&f.set(g.toLowerCase(),g);return f}},978:(s,i,o)=>{const a=o(375),c=o(8571),d=o(1687),h=o(9621),u={};s.exports=function(f,g,v={}){if(a(f&&typeof f=="object","Invalid defaults value: must be an object"),a(!g||g===!0||typeof g=="object","Invalid source value: must be true, falsy or an object"),a(typeof v=="object","Invalid options: must be an object"),!g)return null;if(v.shallow)return u.applyToDefaultsWithShallow(f,g,v);const m=c(f);if(g===!0)return m;const x=v.nullOverride!==void 0&&v.nullOverride;return d(m,g,{nullOverride:x,mergeArrays:!1})},u.applyToDefaultsWithShallow=function(f,g,v){const m=v.shallow;a(Array.isArray(m),"Invalid keys");const x=new Map,y=g===!0?null:new Set;for(let E of m){E=Array.isArray(E)?E:E.split(".");const R=h(f,E);R&&typeof R=="object"?x.set(R,y&&h(g,E)||R):y&&y.add(E)}const b=c(f,{},x);if(!y)return b;for(const E of y)u.reachCopy(b,g,E);const w=v.nullOverride!==void 0&&v.nullOverride;return d(b,g,{nullOverride:w,mergeArrays:!1})},u.reachCopy=function(f,g,v){for(const y of v){if(!(y in g))return;const b=g[y];if(typeof b!="object"||b===null)return;g=b}const m=g;let x=f;for(let y=0;y<v.length-1;++y){const b=v[y];typeof x[b]!="object"&&(x[b]={}),x=x[b]}x[v[v.length-1]]=m}},375:(s,i,o)=>{const a=o(7916);s.exports=function(c,...d){if(!c)throw d.length===1&&d[0]instanceof Error?d[0]:new a(d)}},8571:(s,i,o)=>{const a=o(9621),c=o(4277),d=o(7043),h={needsProtoHack:new Set([c.set,c.map,c.weakSet,c.weakMap])};s.exports=h.clone=function(u,f={},g=null){if(typeof u!="object"||u===null)return u;let v=h.clone,m=g;if(f.shallow){if(f.shallow!==!0)return h.cloneWithShallow(u,f);v=w=>w}else if(m){const w=m.get(u);if(w)return w}else m=new Map;const x=c.getInternalProto(u);if(x===c.buffer)return!1;if(x===c.date)return new Date(u.getTime());if(x===c.regex)return new RegExp(u);const y=h.base(u,x,f);if(y===u)return u;if(m&&m.set(u,y),x===c.set)for(const w of u)y.add(v(w,f,m));else if(x===c.map)for(const[w,E]of u)y.set(w,v(E,f,m));const b=d.keys(u,f);for(const w of b){if(w==="__proto__")continue;if(x===c.array&&w==="length"){y.length=u.length;continue}const E=Object.getOwnPropertyDescriptor(u,w);E?E.get||E.set?Object.defineProperty(y,w,E):E.enumerable?y[w]=v(u[w],f,m):Object.defineProperty(y,w,{enumerable:!1,writable:!0,configurable:!0,value:v(u[w],f,m)}):Object.defineProperty(y,w,{enumerable:!0,writable:!0,configurable:!0,value:v(u[w],f,m)})}return y},h.cloneWithShallow=function(u,f){const g=f.shallow;(f=Object.assign({},f)).shallow=!1;const v=new Map;for(const m of g){const x=a(u,m);typeof x!="object"&&typeof x!="function"||v.set(x,x)}return h.clone(u,f,v)},h.base=function(u,f,g){if(g.prototype===!1)return h.needsProtoHack.has(f)?new f.constructor:f===c.array?[]:{};const v=Object.getPrototypeOf(u);if(v&&v.isImmutable)return u;if(f===c.array){const m=[];return v!==f&&Object.setPrototypeOf(m,v),m}if(h.needsProtoHack.has(f)){const m=new v.constructor;return v!==f&&Object.setPrototypeOf(m,v),m}return Object.create(v)}},9474:(s,i,o)=>{const a=o(4277),c={mismatched:null};s.exports=function(d,h,u){return u=Object.assign({prototype:!0},u),!!c.isDeepEqual(d,h,u,[])},c.isDeepEqual=function(d,h,u,f){if(d===h)return d!==0||1/d==1/h;const g=typeof d;if(g!==typeof h||d===null||h===null)return!1;if(g==="function"){if(!u.deepFunction||d.toString()!==h.toString())return!1}else if(g!=="object")return d!=d&&h!=h;const v=c.getSharedType(d,h,!!u.prototype);switch(v){case a.buffer:return!1;case a.promise:return d===h;case a.regex:return d.toString()===h.toString();case c.mismatched:return!1}for(let m=f.length-1;m>=0;--m)if(f[m].isSame(d,h))return!0;f.push(new c.SeenEntry(d,h));try{return!!c.isDeepEqualObj(v,d,h,u,f)}finally{f.pop()}},c.getSharedType=function(d,h,u){if(u)return Object.getPrototypeOf(d)!==Object.getPrototypeOf(h)?c.mismatched:a.getInternalProto(d);const f=a.getInternalProto(d);return f!==a.getInternalProto(h)?c.mismatched:f},c.valueOf=function(d){const h=d.valueOf;if(h===void 0)return d;try{return h.call(d)}catch(u){return u}},c.hasOwnEnumerableProperty=function(d,h){return Object.prototype.propertyIsEnumerable.call(d,h)},c.isSetSimpleEqual=function(d,h){for(const u of Set.prototype.values.call(d))if(!Set.prototype.has.call(h,u))return!1;return!0},c.isDeepEqualObj=function(d,h,u,f,g){const{isDeepEqual:v,valueOf:m,hasOwnEnumerableProperty:x}=c,{keys:y,getOwnPropertySymbols:b}=Object;if(d===a.array){if(!f.part){if(h.length!==u.length)return!1;for(let N=0;N<h.length;++N)if(!v(h[N],u[N],f,g))return!1;return!0}for(const N of h)for(const A of u)if(v(N,A,f,g))return!0}else if(d===a.set){if(h.size!==u.size)return!1;if(!c.isSetSimpleEqual(h,u)){const N=new Set(Set.prototype.values.call(u));for(const A of Set.prototype.values.call(h)){if(N.delete(A))continue;let D=!1;for(const O of N)if(v(A,O,f,g)){N.delete(O),D=!0;break}if(!D)return!1}}}else if(d===a.map){if(h.size!==u.size)return!1;for(const[N,A]of Map.prototype.entries.call(h))if(A===void 0&&!Map.prototype.has.call(u,N)||!v(A,Map.prototype.get.call(u,N),f,g))return!1}else if(d===a.error&&(h.name!==u.name||h.message!==u.message))return!1;const w=m(h),E=m(u);if((h!==w||u!==E)&&!v(w,E,f,g))return!1;const R=y(h);if(!f.part&&R.length!==y(u).length&&!f.skip)return!1;let T=0;for(const N of R)if(f.skip&&f.skip.includes(N))u[N]===void 0&&++T;else if(!x(u,N)||!v(h[N],u[N],f,g))return!1;if(!f.part&&R.length-T!==y(u).length)return!1;if(f.symbols!==!1){const N=b(h),A=new Set(b(u));for(const D of N){if(!f.skip||!f.skip.includes(D)){if(x(h,D)){if(!x(u,D)||!v(h[D],u[D],f,g))return!1}else if(x(u,D))return!1}A.delete(D)}for(const D of A)if(x(u,D))return!1}return!0},c.SeenEntry=class{constructor(d,h){this.obj=d,this.ref=h}isSame(d,h){return this.obj===d&&this.ref===h}}},7916:(s,i,o)=>{const a=o(8761);s.exports=class extends Error{constructor(c){super(c.filter(d=>d!=="").map(d=>typeof d=="string"?d:d instanceof Error?d.message:a(d)).join(" ")||"Unknown error"),typeof Error.captureStackTrace=="function"&&Error.captureStackTrace(this,i.assert)}}},5277:s=>{const i={};s.exports=function(o){if(!o)return"";let a="";for(let c=0;c<o.length;++c){const d=o.charCodeAt(c);i.isSafe(d)?a+=o[c]:a+=i.escapeHtmlChar(d)}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),d=o(7043),h={};s.exports=h.merge=function(u,f,g){if(a(u&&typeof u=="object","Invalid target value: must be an object"),a(f==null||typeof f=="object","Invalid source value: must be null, undefined, or an object"),!f)return u;if(g=Object.assign({nullOverride:!0,mergeArrays:!0},g),Array.isArray(f)){a(Array.isArray(u),"Cannot merge array onto an object"),g.mergeArrays||(u.length=0);for(let m=0;m<f.length;++m)u.push(c(f[m],{symbols:g.symbols}));return u}const v=d.keys(f,g);for(let m=0;m<v.length;++m){const x=v[m];if(x==="__proto__"||!Object.prototype.propertyIsEnumerable.call(f,x))continue;const y=f[x];if(y&&typeof y=="object"){if(u[x]===y)continue;!u[x]||typeof u[x]!="object"||Array.isArray(u[x])!==Array.isArray(y)||y instanceof Date||y instanceof RegExp?u[x]=c(y,{symbols:g.symbols}):h.merge(u[x],y,g)}else(y!=null||g.nullOverride)&&(u[x]=y)}return u}},9621:(s,i,o)=>{const a=o(375),c={};s.exports=function(d,h,u){if(h===!1||h==null)return d;typeof(u=u||{})=="string"&&(u={separator:u});const f=Array.isArray(h);a(!f||!u.separator,"Separator option is not valid for array-based chain");const g=f?h:h.split(u.separator||".");let v=d;for(let m=0;m<g.length;++m){let x=g[m];const y=u.iterables&&c.iterables(v);if(Array.isArray(v)||y==="set"){const b=Number(x);Number.isInteger(b)&&(x=b<0?v.length+b:b)}if(!v||typeof v=="function"&&u.functions===!1||!y&&v[x]===void 0){a(!u.strict||m+1===g.length,"Missing segment",x,"in reach path ",h),a(typeof v=="object"||u.functions===!0||typeof v!="function","Invalid segment",x,"in reach path ",h),v=u.default;break}v=y?y==="set"?[...v][x]:v.get(x):v[x]}return v},c.iterables=function(d){return d instanceof Set?"set":d 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(d,h){const u=[].concat((h=h||{}).before||[]),f=[].concat(h.after||[]),g=h.group||"?",v=h.sort||0;a(!u.includes(g),`Item cannot come before itself: ${g}`),a(!u.includes("?"),"Item cannot come before unassociated items"),a(!f.includes(g),`Item cannot come after itself: ${g}`),a(!f.includes("?"),"Item cannot come after unassociated items"),Array.isArray(d)||(d=[d]);for(const m of d){const x={seq:this._items.length,sort:v,before:u,after:f,group:g,node:m};this._items.push(x)}if(!h.manual){const m=this._sort();a(m,"item",g!=="?"?`added into group ${g}`:"","created a dependencies error")}return this.nodes}merge(d){Array.isArray(d)||(d=[d]);for(const u of d)if(u)for(const f of u._items)this._items.push(Object.assign({},f));this._items.sort(c.mergeSort);for(let u=0;u<this._items.length;++u)this._items[u].seq=u;const h=this._sort();return a(h,"merge created a dependencies error"),this.nodes}sort(){const d=this._sort();return a(d,"sort created a dependencies error"),this.nodes}_sort(){const d={},h=Object.create(null),u=Object.create(null);for(const x of this._items){const y=x.seq,b=x.group;u[b]=u[b]||[],u[b].push(y),d[y]=x.before;for(const w of x.after)h[w]=h[w]||[],h[w].push(y)}for(const x in d){const y=[];for(const b in d[x]){const w=d[x][b];u[w]=u[w]||[],y.push(...u[w])}d[x]=y}for(const x in h)if(u[x])for(const y of u[x])d[y].push(...h[x]);const f={};for(const x in d){const y=d[x];for(const b of y)f[b]=f[b]||[],f[b].push(x)}const g={},v=[];for(let x=0;x<this._items.length;++x){let y=x;if(f[x]){y=null;for(let b=0;b<this._items.length;++b){if(g[b]===!0)continue;f[b]||(f[b]=[]);const w=f[b].length;let E=0;for(let R=0;R<w;++R)g[f[b][R]]&&++E;if(E===w){y=b;break}}}y!==null&&(g[y]=!0,v.push(y))}if(v.length!==this._items.length)return!1;const m={};for(const x of this._items)m[x.seq]=x;this._items=[],this.nodes=[];for(const x of v){const y=m[x];this.nodes.push(y.node),this._items.push(y)}return!0}},c.mergeSort=(d,h)=>d.sort===h.sort?0:d.sort<h.sort?-1:1},5380:(s,i,o)=>{const a=o(443),c=o(2178),d={minDomainSegments:2,nonAsciiRx:/[^\x00-\x7f]/,domainControlRx:/[\x00-\x20@\:\/\\#!\$&\'\(\)\*\+,;=\?]/,tldSegmentRx:/^[a-zA-Z](?:[a-zA-Z0-9\-]*[a-zA-Z0-9])?$/,domainSegmentRx:/^[a-zA-Z0-9](?:[a-zA-Z0-9\-]*[a-zA-Z0-9])?$/,URL:a.URL||URL};i.analyze=function(h,u={}){if(!h)return c.code("DOMAIN_NON_EMPTY_STRING");if(typeof h!="string")throw new Error("Invalid input: domain must be a string");if(h.length>256)return c.code("DOMAIN_TOO_LONG");if(d.nonAsciiRx.test(h)){if(u.allowUnicode===!1)return c.code("DOMAIN_INVALID_UNICODE_CHARS");h=h.normalize("NFC")}if(d.domainControlRx.test(h))return c.code("DOMAIN_INVALID_CHARS");h=d.punycode(h),u.allowFullyQualified&&h[h.length-1]==="."&&(h=h.slice(0,-1));const f=u.minDomainSegments||d.minDomainSegments,g=h.split(".");if(g.length<f)return c.code("DOMAIN_SEGMENTS_COUNT");if(u.maxDomainSegments&&g.length>u.maxDomainSegments)return c.code("DOMAIN_SEGMENTS_COUNT_MAX");const v=u.tlds;if(v){const m=g[g.length-1].toLowerCase();if(v.deny&&v.deny.has(m)||v.allow&&!v.allow.has(m))return c.code("DOMAIN_FORBIDDEN_TLDS")}for(let m=0;m<g.length;++m){const x=g[m];if(!x.length)return c.code("DOMAIN_EMPTY_SEGMENT");if(x.length>63)return c.code("DOMAIN_LONG_SEGMENT");if(m<g.length-1){if(!d.domainSegmentRx.test(x))return c.code("DOMAIN_INVALID_CHARS")}else if(!d.tldSegmentRx.test(x))return c.code("DOMAIN_INVALID_TLDS_CHARS")}return null},i.isValid=function(h,u){return!i.analyze(h,u)},d.punycode=function(h){h.includes("%")&&(h=h.replace(/%/g,"%25"));try{return new d.URL(`http://${h}`).host}catch{return h}}},1745:(s,i,o)=>{const a=o(9848),c=o(5380),d=o(2178),h={nonAsciiRx:/[^\x00-\x7f]/,encoder:new(a.TextEncoder||TextEncoder)};i.analyze=function(u,f){return h.email(u,f)},i.isValid=function(u,f){return!h.email(u,f)},h.email=function(u,f={}){if(typeof u!="string")throw new Error("Invalid input: email must be a string");if(!u)return d.code("EMPTY_STRING");const g=!h.nonAsciiRx.test(u);if(!g){if(f.allowUnicode===!1)return d.code("FORBIDDEN_UNICODE");u=u.normalize("NFC")}const v=u.split("@");if(v.length!==2)return v.length>2?d.code("MULTIPLE_AT_CHAR"):d.code("MISSING_AT_CHAR");const[m,x]=v;if(!m)return d.code("EMPTY_LOCAL");if(!f.ignoreLength){if(u.length>254)return d.code("ADDRESS_TOO_LONG");if(h.encoder.encode(m).length>64)return d.code("LOCAL_TOO_LONG")}return h.local(m,g)||c.analyze(x,f)},h.local=function(u,f){const g=u.split(".");for(const v of g){if(!v.length)return d.code("EMPTY_LOCAL_SEGMENT");if(f){if(!h.atextRx.test(v))return d.code("INVALID_LOCAL_CHARS")}else for(const m of v){if(h.atextRx.test(m))continue;const x=h.binary(m);if(!h.atomRx.test(x))return d.code("INVALID_LOCAL_CHARS")}}},h.binary=function(u){return Array.from(h.encoder.encode(u)).map(f=>String.fromCharCode(f)).join("")},h.atextRx=/^[\w!#\$%&'\*\+\-/=\?\^`\{\|\}~]+$/,h.atomRx=new RegExp(["(?:[\\xc2-\\xdf][\\x80-\\xbf])","(?:\\xe0[\\xa0-\\xbf][\\x80-\\xbf])|(?:[\\xe1-\\xec][\\x80-\\xbf]{2})|(?:\\xed[\\x80-\\x9f][\\x80-\\xbf])|(?:[\\xee-\\xef][\\x80-\\xbf]{2})","(?:\\xf0[\\x90-\\xbf][\\x80-\\xbf]{2})|(?:[\\xf1-\\xf3][\\x80-\\xbf]{3})|(?:\\xf4[\\x80-\\x8f][\\x80-\\xbf]{2})"].join("|"))},2178:(s,i)=>{i.codes={EMPTY_STRING:"Address must be a non-empty string",FORBIDDEN_UNICODE:"Address contains forbidden Unicode characters",MULTIPLE_AT_CHAR:"Address cannot contain more than one @ character",MISSING_AT_CHAR:"Address must contain one @ character",EMPTY_LOCAL:"Address local part cannot be empty",ADDRESS_TOO_LONG:"Address too long",LOCAL_TOO_LONG:"Address local part too long",EMPTY_LOCAL_SEGMENT:"Address local part contains empty dot-separated segment",INVALID_LOCAL_CHARS:"Address local part contains invalid character",DOMAIN_NON_EMPTY_STRING:"Domain must be a non-empty string",DOMAIN_TOO_LONG:"Domain too long",DOMAIN_INVALID_UNICODE_CHARS:"Domain contains forbidden Unicode characters",DOMAIN_INVALID_CHARS:"Domain contains invalid character",DOMAIN_INVALID_TLDS_CHARS:"Domain contains invalid tld character",DOMAIN_SEGMENTS_COUNT:"Domain lacks the minimum required number of segments",DOMAIN_SEGMENTS_COUNT_MAX:"Domain contains too many segments",DOMAIN_FORBIDDEN_TLDS:"Domain uses forbidden TLD",DOMAIN_EMPTY_SEGMENT:"Domain contains empty dot-separated segment",DOMAIN_LONG_SEGMENT:"Domain contains dot-separated segment that is too long"},i.code=function(o){return{code:o,error:i.codes[o]}}},9959:(s,i,o)=>{const a=o(375),c=o(5752);i.regex=function(d={}){a(d.cidr===void 0||typeof d.cidr=="string","options.cidr must be a string");const h=d.cidr?d.cidr.toLowerCase():"optional";a(["required","optional","forbidden"].includes(h),"options.cidr must be one of required, optional, forbidden"),a(d.version===void 0||typeof d.version=="string"||Array.isArray(d.version),"options.version must be a string or an array of string");let u=d.version||["ipv4","ipv6","ipvfuture"];Array.isArray(u)||(u=[u]),a(u.length>=1,"options.version must have at least 1 version specified");for(let v=0;v<u.length;++v)a(typeof u[v]=="string","options.version must only contain strings"),u[v]=u[v].toLowerCase(),a(["ipv4","ipv6","ipvfuture"].includes(u[v]),"options.version contains unknown version "+u[v]+" - must be one of ipv4, ipv6, ipvfuture");u=Array.from(new Set(u));const f=`(?:${u.map(v=>{if(h==="forbidden")return c.ip[v];const m=`\\/${v==="ipv4"?c.ip.v4Cidr:c.ip.v6Cidr}`;return h==="required"?`${c.ip[v]}${m}`:`${c.ip[v]}(?:${m})?`}).join("|")})`,g=new RegExp(`^${f}$`);return{cidr:h,versions:u,regex:g,raw:f}}},5752:(s,i,o)=>{const a=o(375),c=o(6064),d={generate:function(){const h={},u="\\dA-Fa-f",f="["+u+"]",g="\\w-\\.~",v="!\\$&'\\(\\)\\*\\+,;=",m="%"+u,x=g+m+v+":@",y="["+x+"]",b="(?:0{0,2}\\d|0?[1-9]\\d|1\\d\\d|2[0-4]\\d|25[0-5])";h.ipv4address="(?:"+b+"\\.){3}"+b;const w=f+"{1,4}",E="(?:"+w+":"+w+"|"+h.ipv4address+")",R="(?:"+w+":){6}"+E,T="::(?:"+w+":){5}"+E,N="(?:"+w+")?::(?:"+w+":){4}"+E,A="(?:(?:"+w+":){0,1}"+w+")?::(?:"+w+":){3}"+E,D="(?:(?:"+w+":){0,2}"+w+")?::(?:"+w+":){2}"+E,O="(?:(?:"+w+":){0,3}"+w+")?::"+w+":"+E,I="(?:(?:"+w+":){0,4}"+w+")?::"+E,$="(?:(?:"+w+":){0,5}"+w+")?::"+w,F="(?:(?:"+w+":){0,6}"+w+")?::";h.ipv4Cidr="(?:\\d|[1-2]\\d|3[0-2])",h.ipv6Cidr="(?:0{0,2}\\d|0?[1-9]\\d|1[01]\\d|12[0-8])",h.ipv6address="(?:"+R+"|"+T+"|"+N+"|"+A+"|"+D+"|"+O+"|"+I+"|"+$+"|"+F+")",h.ipvFuture="v"+f+"+\\.["+g+v+":]+",h.scheme="[a-zA-Z][a-zA-Z\\d+-\\.]*",h.schemeRegex=new RegExp(h.scheme);const B="["+g+m+v+":]*",W="["+g+m+v+"]{1,255}",Z="(?:\\[(?:"+h.ipv6address+"|"+h.ipvFuture+")\\]|"+h.ipv4address+"|"+W+")",Y="(?:"+B+"@)?"+Z+"(?::\\d*)?",H="(?:"+B+"@)?("+Z+")(?::\\d*)?",se=y+"*",he=y+"+",re="(?:\\/"+se+")*",J="\\/(?:"+he+re+")?",te=he+re,ae="["+g+m+v+"@]+"+re,be="(?:\\/\\/\\/"+se+re+")";return h.hierPart="(?:(?:\\/\\/"+Y+re+")|"+J+"|"+te+"|"+be+")",h.hierPartCapture="(?:(?:\\/\\/"+H+re+")|"+J+"|"+te+")",h.relativeRef="(?:(?:\\/\\/"+Y+re+")|"+J+"|"+ae+"|)",h.relativeRefCapture="(?:(?:\\/\\/"+H+re+")|"+J+"|"+ae+"|)",h.query="["+x+"\\/\\?]*(?=#|$)",h.queryWithSquareBrackets="["+x+"\\[\\]\\/\\?]*(?=#|$)",h.fragment="["+x+"\\/\\?]*",h}};d.rfc3986=d.generate(),i.ip={v4Cidr:d.rfc3986.ipv4Cidr,v6Cidr:d.rfc3986.ipv6Cidr,ipv4:d.rfc3986.ipv4address,ipv6:d.rfc3986.ipv6address,ipvfuture:d.rfc3986.ipvFuture},d.createRegex=function(h){const u=d.rfc3986,f="(?:\\?"+(h.allowQuerySquareBrackets?u.queryWithSquareBrackets:u.query)+")?(?:#"+u.fragment+")?",g=h.domain?u.relativeRefCapture:u.relativeRef;if(h.relativeOnly)return d.wrap(g+f);let v="";if(h.scheme){a(h.scheme instanceof RegExp||typeof h.scheme=="string"||Array.isArray(h.scheme),"scheme must be a RegExp, String, or Array");const y=[].concat(h.scheme);a(y.length>=1,"scheme must have at least 1 scheme specified");const b=[];for(let w=0;w<y.length;++w){const E=y[w];a(E instanceof RegExp||typeof E=="string","scheme at position "+w+" must be a RegExp or String"),E instanceof RegExp?b.push(E.source.toString()):(a(u.schemeRegex.test(E),"scheme at position "+w+" must be a valid scheme"),b.push(c(E)))}v=b.join("|")}const m="(?:"+(v?"(?:"+v+")":u.scheme)+":"+(h.domain?u.hierPartCapture:u.hierPart)+")",x=h.allowRelative?"(?:"+m+"|"+g+")":m;return d.wrap(x+f,v)},d.wrap=function(h,u){return{raw:h=`(?=.)(?!https?:/(?:$|[^/]))(?!https?:///)(?!https?:[^/])${h}`,regex:new RegExp(`^${h}$`),scheme:u}},d.uriRegex=d.createRegex({}),i.regex=function(h={}){return h.scheme||h.allowRelative||h.relativeOnly||h.allowQuerySquareBrackets||h.domain?d.createRegex(h):d.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 d in c.constants){const h=c.constants[d];if(h!==null&&!["boolean","number","string"].includes(typeof h))throw new Error(`Formula constant ${d} contains invalid ${typeof h} value type`)}this.settings=c[o.settings]?c:Object.assign({[o.settings]:!0,constants:{},functions:{}},c),this.single=null,this._parts=null,this._parse(a)}_parse(a){let c=[],d="",h=0,u=!1;const f=v=>{if(h)throw new Error("Formula missing closing parenthesis");const m=c.length?c[c.length-1]:null;if(u||d||v){if(m&&m.type==="reference"&&v===")")return m.type="function",m.value=this._subFormula(d,m.value),void(d="");if(v===")"){const x=new i.Parser(d,this.settings);c.push({type:"segment",value:x})}else if(u){if(u==="]")return c.push({type:"reference",value:d}),void(d="");c.push({type:"literal",value:d})}else if(o.operatorCharacters.includes(d))m&&m.type==="operator"&&o.operators.includes(m.value+d)?m.value+=d:c.push({type:"operator",value:d});else if(d.match(o.numberRx))c.push({type:"constant",value:parseFloat(d)});else if(this.settings.constants[d]!==void 0)c.push({type:"constant",value:this.settings.constants[d]});else{if(!d.match(o.tokenRx))throw new Error(`Formula contains invalid token: ${d}`);c.push({type:"reference",value:d})}d=""}};for(const v of a)u?v===u?(f(),u=!1):d+=v:h?v==="("?(d+=v,++h):v===")"?(--h,h?d+=v:f(v)):d+=v:v in o.literals?u=o.literals[v]:v==="("?(f(),++h):o.operatorCharacters.includes(v)?(f(),d=v,f()):v!==" "?d+=v:f();f(),c=c.map((v,m)=>v.type!=="operator"||v.value!=="-"||m&&c[m-1].type!=="operator"?v:{type:"operator",value:"n"});let g=!1;for(const v of c){if(v.type==="operator"){if(o.operatorsPrefix.includes(v.value))continue;if(!g)throw new Error("Formula contains an operator in invalid position");if(!o.operators.includes(v.value))throw new Error(`Formula contains an unknown operator ${v.value}`)}else if(g)throw new Error("Formula missing expected operator");g=!g}if(!g)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(v=>{if(v.type==="operator")return o.operatorsPrefix.includes(v.value)?v:v.value;if(v.type!=="reference")return v.value;if(this.settings.tokenRx&&!this.settings.tokenRx.test(v.value))throw new Error(`Formula contains invalid reference ${v.value}`);return this.settings.reference?this.settings.reference(v.value):o.reference(v.value)})}_subFormula(a,c){const d=this.settings.functions[c];if(typeof d!="function")throw new Error(`Formula contains unknown function ${c}`);let h=[];if(a){let u="",f=0,g=!1;const v=()=>{if(!u)throw new Error(`Formula contains function ${c} with invalid arguments ${a}`);h.push(u),u=""};for(let m=0;m<a.length;++m){const x=a[m];g?(u+=x,x===g&&(g=!1)):x in o.literals&&!f?(u+=x,g=o.literals[x]):x!==","||f?(u+=x,x==="("?++f:x===")"&&--f):v()}v()}return h=h.map(u=>new i.Parser(u,this.settings)),function(u){const f=[];for(const g of h)f.push(g.evaluate(u));return d.call(u,...f)}}evaluate(a){const c=this._parts.slice();for(let d=c.length-2;d>=0;--d){const h=c[d];if(h&&h.type==="operator"){const u=c[d+1];c.splice(d+1,1);const f=o.evaluate(u,a);c[d]=o.single(h.value,f)}}return o.operatorsOrder.forEach(d=>{for(let h=1;h<c.length-1;)if(d.includes(c[h])){const u=c[h],f=o.evaluate(c[h-1],a),g=o.evaluate(c[h+1],a);c.splice(h,2);const v=o.calculate(u,f,g);c[h-1]=v===0?0:v}else h+=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 d=-c;return d===0?0:d},o.calculate=function(a,c,d){if(a==="??")return o.exists(c)?c:d;if(typeof c=="string"||typeof d=="string"){if(a==="+")return(c=o.exists(c)?c:"")+(o.exists(d)?d:"")}else switch(a){case"^":return Math.pow(c,d);case"*":return c*d;case"/":return c/d;case"%":return c%d;case"+":return c+d;case"-":return c-d}switch(a){case"<":return c<d;case"<=":return c<=d;case">":return c>d;case">=":return c>=d;case"==":return c===d;case"!=":return c!==d;case"&&":return c&&d;case"||":return c||d}return null},o.exists=function(a){return a!=null}},9926:()=>{},5688:()=>{},9708:()=>{},1152:()=>{},443:()=>{},9848:()=>{},5934:s=>{s.exports=JSON.parse('{"version":"17.13.3"}')}},r={},function s(i){var o=r[i];if(o!==void 0)return o.exports;var a=r[i]={exports:{}};return n[i](a,a.exports,s),a.exports}(5107);var n,r})})(Que);var fBe=Que.exports;const wf=Al(fBe),vx=()=>{const e=C.useContext(tue);if(e===void 0)throw new Error("useDataSource must be used within a DataSourceProvider");return e},hBe=()=>{const e=vx();return{useSubmitIncidence:t=>{const{mutateOptions:n={}}=t||{};return mu({mutationFn:r=>e.createOne({resource:"support",data:r}),...n})}}},pBe=wf.object({incidence:wf.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 mBe(){const[e,t]=C.useState(!1),[n,r]=C.useState(!1),{toast:s}=Fu(),{useSubmitIncidence:i}=hBe(),o=aR({mode:"onBlur",resolver:SW(pBe),defaultValues:{incidence:""}}),{handleSubmit:a,watch:c,reset:d}=o,h=c("incidence"),{mutate:u}=i({mutateOptions:{onSuccess:()=>{s({title:"Incidencia enviada",description:"La incidencia se ha enviado correctamente",variant:"success"}),t(!1),d()},onError:()=>{s({title:"Error en el envío",description:"No se ha podido enviar la incidencia correctamente. Por favor, inténtalo de nuevo.",variant:"destructive"})}}}),f=async m=>{u(m)},g=()=>{h.trim()?r(!0):(t(!1),d())},v=()=>{r(!1),t(!1),d()};return _.jsxs(_.Fragment,{children:[_.jsxs(Fx,{open:e,onOpenChange:t,children:[_.jsx(E6,{asChild:!0,children:_.jsxs(at,{variant:"outline",size:"icon",className:"overflow-hidden rounded-full bg-primary text-primary-foreground",onClick:()=>t(!0),children:[_.jsx(_J,{className:"w-5 h-5"}),_.jsx("span",{className:"sr-only",children:"Abrir ventana de soporte"})]})}),_.jsxs(cy,{className:"sm:max-w-xl",children:[_.jsxs(uy,{className:"mb-2",children:[_.jsx(fy,{children:ue("support.modal.title")}),_.jsx(GA,{children:ue("support.modal.subtitle")})]}),_.jsx(lR,{...o,children:_.jsxs("form",{onSubmit:a(f),className:"space-y-4",children:[_.jsx(gc,{name:"incidence",placeholder:"Describe la incidencia aquí...",className:"min-h-96"}),_.jsxs(dy,{children:[_.jsx(at,{type:"button",variant:"outline",onClick:g,children:"Cancelar"}),_.jsx(at,{type:"submit",children:"Enviar incidencia"})]})]})})]})]}),_.jsx(JH,{open:n,onOpenChange:r,children:_.jsxs(pD,{children:[_.jsxs(mD,{children:[_.jsx(vD,{children:"¿Estás seguro de que quieres cancelar?"}),_.jsx(yD,{children:"Has escrito texto en el campo de descripción. Si cierras la ventana, perderás los cambios no guardados."})]}),_.jsxs(gD,{children:[_.jsx(xD,{onClick:()=>r(!1),children:"Volver al formulario"}),_.jsx(bD,{onClick:v,children:"Sí, cerrar"})]})]})})]})}var gBe={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 vBe=Al(gBe);var yBe=/\s([^'"/\s><]+?)[\s/>]|([^\s=]+)=\s?(".*?"|'.*?')/g;function MK(e){var t={type:"tag",name:"",voidElement:!1,attrs:{},children:[]},n=e.match(/<\/?([^\s]+?)[/\s>]/);if(n&&(t.name=n[1],(vBe[n[1]]||e.charAt(e.length-2)==="/")&&(t.voidElement=!0),t.name.startsWith("!--"))){var r=e.indexOf("-->");return{type:"comment",comment:r!==-1?e.slice(4,r):""}}for(var s=new RegExp(yBe),i=null;(i=s.exec(e))!==null;)if(i[0].trim())if(i[1]){var o=i[1].trim(),a=[o,""];o.indexOf("=")>-1&&(a=o.split("=")),t.attrs[a[0]]=a[1],s.lastIndex--}else i[2]&&(t.attrs[i[2]]=i[3].trim().substring(1,i[3].length-1));return t}var bBe=/<[a-zA-Z0-9\-\!\/](?:"[^"]*"|'[^']*'|[^'">])*>/g,xBe=/^\s*$/,_Be=Object.create(null);function Zue(e,t){switch(t.type){case"text":return e+t.content;case"tag":return e+="<"+t.name+(t.attrs?function(n){var r=[];for(var s in n)r.push(s+'="'+n[s]+'"');return r.length?" "+r.join(" "):""}(t.attrs):"")+(t.voidElement?"/>":">"),t.voidElement?e:e+t.children.reduce(Zue,"")+"</"+t.name+">";case"comment":return e+"<!--"+t.comment+"-->"}}var wBe={parse:function(e,t){t||(t={}),t.components||(t.components=_Be);var n,r=[],s=[],i=-1,o=!1;if(e.indexOf("<")!==0){var a=e.indexOf("<");r.push({type:"text",content:a===-1?e:e.substring(0,a)})}return e.replace(bBe,function(c,d){if(o){if(c!=="</"+n.name+">")return;o=!1}var h,u=c.charAt(1)!=="/",f=c.startsWith("<!--"),g=d+c.length,v=e.charAt(g);if(f){var m=MK(c);return i<0?(r.push(m),r):((h=s[i]).children.push(m),r)}if(u&&(i++,(n=MK(c)).type==="tag"&&t.components[n.name]&&(n.type="component",o=!0),n.voidElement||o||!v||v==="<"||n.children.push({type:"text",content:e.slice(g,e.indexOf("<",g))}),i===0&&r.push(n),(h=s[i-1])&&h.children.push(n),s[i]=n),(!u||n.voidElement)&&(i>-1&&(n.voidElement||n.name===c.slice(2,-1))&&(i--,n=i===-1?r:s[i]),!o&&v!=="<"&&v)){h=i===-1?r:s[i].children;var x=e.indexOf("<",g),y=e.slice(g,x===-1?void 0:x);xBe.test(y)&&(y=" "),(x>-1&&i+h.length>=0||y!==" ")&&h.push({type:"text",content:y})}}),r},stringify:function(e){return e.reduce(function(t,n){return t+Zue("",n)},"")}};const oN=(e,t,n,r)=>{var i,o,a,c;const s=[n,{code:t,...r||{}}];if((o=(i=e==null?void 0:e.services)==null?void 0:i.logger)!=null&&o.forward)return e.services.logger.forward(s,"warn","react-i18next::",!0);wl(s[0])&&(s[0]=`react-i18next:: ${s[0]}`),(c=(a=e==null?void 0:e.services)==null?void 0:a.logger)!=null&&c.warn?e.services.logger.warn(...s):console!=null&&console.warn&&console.warn(...s)},IK={},jC=(e,t,n,r)=>{wl(n)&&IK[n]||(wl(n)&&(IK[n]=new Date),oN(e,t,n,r))},Jue=(e,t)=>()=>{if(e.isInitialized)t();else{const n=()=>{setTimeout(()=>{e.off("initialized",n)},0),t()};e.on("initialized",n)}},qU=(e,t,n)=>{e.loadNamespaces(t,Jue(e,n))},LK=(e,t,n,r)=>{if(wl(n)&&(n=[n]),e.options.preload&&e.options.preload.indexOf(t)>-1)return qU(e,n,r);n.forEach(s=>{e.options.ns.indexOf(s)<0&&e.options.ns.push(s)}),e.loadLanguages(t,Jue(e,r))},SBe=(e,t,n={})=>!t.languages||!t.languages.length?(jC(t,"NO_LANGUAGES","i18n.languages were undefined or empty",{languages:t.languages}),!0):t.hasLoadedNamespace(e,{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,e))return!1}}),wl=e=>typeof e=="string",gg=e=>typeof e=="object"&&e!==null,CBe=/&(?:amp|#38|lt|#60|gt|#62|apos|#39|quot|#34|nbsp|#160|copy|#169|reg|#174|hellip|#8230|#x2F|#47);/g,EBe={"&":"&","&":"&","<":"<","<":"<",">":">",">":">","'":"'","'":"'",""":'"',""":'"'," ":" "," ":" ","©":"©","©":"©","®":"®","®":"®","…":"…","…":"…","/":"/","/":"/"},ABe=e=>EBe[e],RBe=e=>e.replace(CBe,ABe);let GU={bindI18n:"languageChanged",bindI18nStore:"",transEmptyNodeValue:"",transSupportBasicHtmlNodes:!0,transWrapTextNodes:"",transKeepBasicHtmlNodesFor:["br","strong","i","p"],useSuspense:!0,unescape:RBe};const PBe=(e={})=>{GU={...GU,...e}},ede=()=>GU;let tde;const NBe=e=>{tde=e},CW=()=>tde,sz=(e,t)=>{var r;if(!e)return!1;const n=((r=e.props)==null?void 0:r.children)??e.children;return t?n.length>0:!!n},iz=e=>{var n,r;if(!e)return[];const t=((n=e.props)==null?void 0:n.children)??e.children;return(r=e.props)!=null&&r.i18nIsDynamicList?yb(t):t},TBe=e=>Array.isArray(e)&&e.every(C.isValidElement),yb=e=>Array.isArray(e)?e:[e],kBe=(e,t)=>{const n={...t};return n.props=Object.assign(e.props,t.props),n},nde=(e,t,n,r)=>{if(!e)return"";let s="";const i=yb(e),o=t!=null&&t.transSupportBasicHtmlNodes?t.transKeepBasicHtmlNodesFor??[]:[];return i.forEach((a,c)=>{if(wl(a)){s+=`${a}`;return}if(C.isValidElement(a)){const{props:d,type:h}=a,u=Object.keys(d).length,f=o.indexOf(h)>-1,g=d.children;if(!g&&f&&!u){s+=`<${h}/>`;return}if(!g&&(!f||u)||d.i18nIsDynamicList){s+=`<${c}></${c}>`;return}if(f&&u===1&&wl(g)){s+=`<${h}>${g}</${h}>`;return}const v=nde(g,t,n,r);s+=`<${c}>${v}</${c}>`;return}if(a===null){oN(n,"TRANS_NULL_VALUE","Passed in a null value as child",{i18nKey:r});return}if(gg(a)){const{format:d,...h}=a,u=Object.keys(h);if(u.length===1){const f=d?`${u[0]}, ${d}`:u[0];s+=`{{${f}}}`;return}oN(n,"TRANS_INVALID_OBJ","Invalid child - Object should only have keys {{ value, format }} (format is optional).",{i18nKey:r,child:a});return}oN(n,"TRANS_INVALID_VAR","Passed in a variable like {number} - pass variables for interpolation as full objects like {{number}}.",{i18nKey:r,child:a})}),s},DBe=(e,t,n,r,s,i)=>{if(t==="")return[];const o=r.transKeepBasicHtmlNodesFor||[],a=t&&new RegExp(o.map(x=>`<${x}`).join("|")).test(t);if(!e&&!a&&!i)return[t];const c={},d=x=>{yb(x).forEach(b=>{wl(b)||(sz(b)?d(iz(b)):gg(b)&&!C.isValidElement(b)&&Object.assign(c,b))})};d(e);const h=wBe.parse(`<0>${t}</0>`),u={...c,...s},f=(x,y,b)=>{var R;const w=iz(x),E=v(w,y.children,b);return TBe(w)&&E.length===0||(R=x.props)!=null&&R.i18nIsDynamicList?w:E},g=(x,y,b,w,E)=>{x.dummy?(x.children=y,b.push(C.cloneElement(x,{key:w},E?void 0:y))):b.push(...C.Children.map([x],R=>{const T={...R.props};return delete T.i18nIsDynamicList,C.createElement(R.type,{...T,key:w,ref:R.ref},E?null:y)}))},v=(x,y,b)=>{const w=yb(x);return yb(y).reduce((R,T,N)=>{var D,O;const A=((O=(D=T.children)==null?void 0:D[0])==null?void 0:O.content)&&n.services.interpolator.interpolate(T.children[0].content,u,n.language);if(T.type==="tag"){let I=w[parseInt(T.name,10)];b.length===1&&!I&&(I=b[0][T.name]),I||(I={});const $=Object.keys(T.attrs).length!==0?kBe({props:T.attrs},I):I,F=C.isValidElement($),B=F&&sz(T,!0)&&!T.voidElement,W=a&&gg($)&&$.dummy&&!F,Z=gg(e)&&Object.hasOwnProperty.call(e,T.name);if(wl($)){const Y=n.services.interpolator.interpolate($,u,n.language);R.push(Y)}else if(sz($)||B){const Y=f($,T,b);g($,Y,R,N)}else if(W){const Y=v(w,T.children,b);g($,Y,R,N)}else if(Number.isNaN(parseFloat(T.name)))if(Z){const Y=f($,T,b);g($,Y,R,N,T.voidElement)}else if(r.transSupportBasicHtmlNodes&&o.indexOf(T.name)>-1)if(T.voidElement)R.push(C.createElement(T.name,{key:`${T.name}-${N}`}));else{const Y=v(w,T.children,b);R.push(C.createElement(T.name,{key:`${T.name}-${N}`},Y))}else if(T.voidElement)R.push(`<${T.name} />`);else{const Y=v(w,T.children,b);R.push(`<${T.name}>${Y}</${T.name}>`)}else if(gg($)&&!F){const Y=T.children[0]?A:null;Y&&R.push(Y)}else g($,A,R,N,T.children.length!==1||!A)}else if(T.type==="text"){const I=r.transWrapTextNodes,$=i?r.unescape(n.services.interpolator.interpolate(T.content,u,n.language)):n.services.interpolator.interpolate(T.content,u,n.language);I?R.push(C.createElement(I,{key:`${T.name}-${N}`},$)):R.push($)}return R},[])},m=v([{dummy:!0,children:e||[]}],h,yb(e||[]));return iz(m[0])},rde=(e,t,n)=>{const r=e.key||t,s=C.cloneElement(e,{key:r});if(!s.props||!s.props.children||n.indexOf(`${t}/>`)<0&&n.indexOf(`${t} />`)<0)return s;function i(){return C.createElement(C.Fragment,null,s)}return C.createElement(i,{key:r})},OBe=(e,t)=>e.map((n,r)=>rde(n,r,t)),MBe=(e,t)=>{const n={};return Object.keys(e).forEach(r=>{Object.assign(n,{[r]:rde(e[r],r,t)})}),n},IBe=(e,t,n,r)=>e?Array.isArray(e)?OBe(e,t):gg(e)?MBe(e,t):(jC(n,"TRANS_INVALID_COMPONENTS",'<Trans /> "components" prop expects an object or array',{i18nKey:r}),null):null;function LBe({children:e,count:t,parent:n,i18nKey:r,context:s,tOptions:i={},values:o,defaults:a,components:c,ns:d,i18n:h,t:u,shouldUnescape:f,...g}){var $,F,B,W,Z,Y;const v=h||CW();if(!v)return jC(v,"NO_I18NEXT_INSTANCE","Trans: You need to pass in an i18next instance using i18nextReactModule",{i18nKey:r}),e;const m=u||v.t.bind(v)||(H=>H),x={...ede(),...($=v.options)==null?void 0:$.react};let y=d||m.ns||((F=v.options)==null?void 0:F.defaultNS);y=wl(y)?[y]:y||["translation"];const b=nde(e,x,v,r),w=a||b||x.transEmptyNodeValue||r,{hashTransKey:E}=x,R=r||(E?E(b||w):b||w);(W=(B=v.options)==null?void 0:B.interpolation)!=null&&W.defaultVariables&&(o=o&&Object.keys(o).length>0?{...o,...v.options.interpolation.defaultVariables}:{...v.options.interpolation.defaultVariables});const T=o||t!==void 0&&!((Y=(Z=v.options)==null?void 0:Z.interpolation)!=null&&Y.alwaysFormat)||!e?i.interpolation:{interpolation:{...i.interpolation,prefix:"#$?",suffix:"?$#"}},N={...i,context:s||i.context,count:t,...o,...T,defaultValue:w,ns:y},A=R?m(R,N):w,D=IBe(c,A,v,r),O=DBe(D||e,A,v,x,N,f),I=n??x.defaultTransParent;return I?C.createElement(I,g,O):O}const jBe={type:"3rdParty",init(e){PBe(e.options.react),NBe(e)}},EW=C.createContext();class $Be{constructor(){this.usedNamespaces={}}addUsedNamespaces(t){t.forEach(n=>{this.usedNamespaces[n]||(this.usedNamespaces[n]=!0)})}getUsedNamespaces(){return Object.keys(this.usedNamespaces)}}function Zt({children:e,count:t,parent:n,i18nKey:r,context:s,tOptions:i={},values:o,defaults:a,components:c,ns:d,i18n:h,t:u,shouldUnescape:f,...g}){var b;const{i18n:v,defaultNS:m}=C.useContext(EW)||{},x=h||v||CW(),y=u||(x==null?void 0:x.t.bind(x));return LBe({children:e,count:t,parent:n,i18nKey:r,context:s,tOptions:i,values:o,defaults:a,components:c,ns:d||(y==null?void 0:y.ns)||m||((b=x==null?void 0:x.options)==null?void 0:b.defaultNS),i18n:x,t:u,shouldUnescape:f,...g})}const FBe=(e,t)=>{const n=C.useRef();return C.useEffect(()=>{n.current=e},[e,t]),n.current},sde=(e,t,n,r)=>e.getFixedT(t,n,r),zBe=(e,t,n,r)=>C.useCallback(sde(e,t,n,r),[e,t,n,r]),AW=(e,t={})=>{var E,R,T,N;const{i18n:n}=t,{i18n:r,defaultNS:s}=C.useContext(EW)||{},i=n||r||CW();if(i&&!i.reportNamespaces&&(i.reportNamespaces=new $Be),!i){jC(i,"NO_I18NEXT_INSTANCE","useTranslation: You will need to pass in an i18next instance by using initReactI18next");const A=(O,I)=>wl(I)?I:gg(I)&&wl(I.defaultValue)?I.defaultValue:Array.isArray(O)?O[O.length-1]:O,D=[A,{},!1];return D.t=A,D.i18n={},D.ready=!1,D}(E=i.options.react)!=null&&E.wait&&jC(i,"DEPRECATED_OPTION","useTranslation: It seems you are still using the old wait option, you may migrate to the new useSuspense behaviour.");const o={...ede(),...i.options.react,...t},{useSuspense:a,keyPrefix:c}=o;let d=s||((R=i.options)==null?void 0:R.defaultNS);d=wl(d)?[d]:d||["translation"],(N=(T=i.reportNamespaces).addUsedNamespaces)==null||N.call(T,d);const h=(i.isInitialized||i.initializedStoreOnce)&&d.every(A=>SBe(A,i,o)),u=zBe(i,t.lng||null,o.nsMode==="fallback"?d:d[0],c),f=()=>u,g=()=>sde(i,t.lng||null,o.nsMode==="fallback"?d:d[0],c),[v,m]=C.useState(f);let x=d.join();t.lng&&(x=`${t.lng}${x}`);const y=FBe(x),b=C.useRef(!0);C.useEffect(()=>{const{bindI18n:A,bindI18nStore:D}=o;b.current=!0,!h&&!a&&(t.lng?LK(i,t.lng,d,()=>{b.current&&m(g)}):qU(i,d,()=>{b.current&&m(g)})),h&&y&&y!==x&&b.current&&m(g);const O=()=>{b.current&&m(g)};return A&&(i==null||i.on(A,O)),D&&(i==null||i.store.on(D,O)),()=>{b.current=!1,i&&(A==null||A.split(" ").forEach(I=>i.off(I,O))),D&&i&&D.split(" ").forEach(I=>i.store.off(I,O))}},[i,x]),C.useEffect(()=>{b.current&&h&&m(f)},[i,c,h]);const w=[v,i,h];if(w.t=v,w.i18n=i,w.ready=h,h||!h&&!a)return w;throw new Promise(A=>{t.lng?LK(i,t.lng,d,()=>A()):qU(i,d,()=>A())})};function BBe({i18n:e,defaultNS:t,children:n}){const r=C.useMemo(()=>({i18n:e,defaultNS:t}),[e,t]);return C.createElement(EW.Provider,{value:r},n)}const KU=({className:e,...t})=>_.jsx("svg",{viewBox:"0 0 336 100",fill:"none",xmlns:"http://www.w3.org/2000/svg",className:e,...t,children:_.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:e})}),UBe=()=>{const[e,t]=C.useState(!1),n=io(),{openDialog:r,DialogComponent:s}=bFe({title:ue("main_menu.logout_dialog.title"),description:ue("main_menu.logout_dialog.description"),confirmLabel:ue("main_menu.logout_dialog.confirm_label"),cancelLabel:ue("main_menu.logout_dialog.cancel_label"),onConfirm:()=>{n("/logout")}}),{data:i,status:o}=SH(),a=c=>{c.preventDefault(),t(!0)};return _.jsxs(_.Fragment,{children:[o==="success"&&_.jsxs("div",{className:"grid gap-1 text-right",children:[_.jsx("p",{className:"text-xs font-medium leading-none",children:i==null?void 0:i.name}),_.jsx("p",{className:"text-xs text-muted-foreground",children:i==null?void 0:i.email})]}),_.jsxs(rR,{open:e,onOpenChange:t,children:[_.jsx(sR,{asChild:!0,children:_.jsxs(at,{variant:"outline",size:"icon",className:"overflow-hidden rounded-full",onClick:a,children:[_.jsx(Jye,{className:"w-5 h-5 accent-current"}),_.jsx("span",{className:"sr-only",children:ue("main_menu.user.user_menu")})]})}),_.jsxs(Vx,{align:"end",className:"w-56",children:[_.jsx(XD,{children:ue("main_menu.user.my_account")}),_.jsx(ax,{}),_.jsx(HDe,{children:_.jsxs(up,{onSelect:()=>n("/settings"),children:[_.jsx(pbe,{className:"w-4 h-4 mr-2"}),_.jsx("span",{children:ue("main_menu.user.settings")})]})}),_.jsx(ax,{}),_.jsxs(up,{onSelect:()=>r(),children:[_.jsx(lbe,{className:"w-4 h-4 mr-2"}),_.jsx("span",{children:ue("main_menu.user.logout")})]})]}),s]})]})},jK=[{label:"main_menu.quotes",to:"/quotes"},{label:"main_menu.catalog",to:"/catalog"},{label:"main_menu.settings",to:"/settings"}],n_=()=>{const e=Mp(),t=C.useCallback(n=>e.pathname===n,[e.pathname]);return _.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:[_.jsxs("nav",{className:"flex-col hidden gap-6 text-lg font-medium md:flex md:flex-row md:items-center md:text-sm",children:[_.jsxs(bf,{to:"/",className:"flex items-center mr-6 font-semibold",children:[_.jsx(KU,{className:"w-24"}),_.jsx("span",{className:"sr-only",children:"Uecko"})]}),jK.map(n=>_.jsx(bf,{to:n.to,className:ge("transition-colors text-muted-foreground hover:text-foreground",t(n.to)?"text-foreground font-bold":"text-muted-foreground font-semibold"),children:_.jsx(Zt,{i18nKey:n.label})},n.to))]}),_.jsxs(ILe,{children:[_.jsx(LLe,{asChild:!0,children:_.jsxs(at,{variant:"outline",size:"icon",className:"shrink-0 md:hidden",children:[_.jsx(cbe,{className:"w-5 h-5"}),_.jsx("span",{className:"sr-only",children:"Toggle navigation menu"})]})}),_.jsx(Kae,{side:"left",children:_.jsxs("nav",{className:"grid gap-6 text-lg font-medium",children:[_.jsxs(bf,{to:"/",className:"flex items-center gap-2 text-lg font-semibold",children:[_.jsx(ube,{className:"w-6 h-6"}),_.jsx("span",{className:"sr-only",children:"Uecko"})]}),jK.map(n=>_.jsx(bf,{to:n.to,className:ge("flex items-center gap-4 px-4 py-3 rounded-lg transition-colors","hover:bg-primary-light hover:text-primary text-muted-foreground"),children:_.jsx(Zt,{i18nKey:n.label})},n.to))]})})]}),_.jsxs(bf,{to:"/",className:"flex items-center font-semibold shrink-0 md:hidden",children:[_.jsx(KU,{className:"w-24"}),_.jsx("span",{className:"sr-only",children:"Uecko"})]}),_.jsxs("div",{className:"flex items-center justify-end w-full gap-4 md:ml-auto md:gap-2 lg:gap-4",children:[_.jsx(UBe,{}),_.jsx(mBe,{})]})]})};n_.displayName="LayoutHeader";const VBe="_LoadingIndicator_1cqh6_4",HBe="_LoadingIndicator__title_1cqh6_9",WBe="_LoadingIndicator__subtitle_1cqh6_13",qBe="_LoadingIndicator__lighttext_1cqh6_17",GBe="_LoadingIndicator__darktext_1cqh6_21",Qm={LoadingIndicator:VBe,LoadingIndicator__title:HBe,LoadingIndicator__subtitle:WBe,LoadingIndicator__lighttext:qBe,LoadingIndicator__darktext:GBe},KBe=({size:e=5,color:t="brand",className:n})=>_.jsxs("svg",{className:`animate-spin text-${t} w-${e} h-${e} ${n}`,xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",children:[_.jsx("circle",{className:"opacity-25",cx:"12",cy:"12",r:"10",stroke:"currentColor",strokeWidth:"4"}),_.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"})]}),ide=({active:e=!0,look:t="dark",title:n=ue("components.loading_indicator.title"),subtitle:r=""})=>{const s=t==="dark",i=s?"text-brand":"text-white";if(e)return _.jsxs("div",{className:Qm.LoadingIndicator,children:[_.jsx(KBe,{size:12,className:i}),n?_.jsx("h2",{className:ge(Qm.LoadingIndicator__title,s?Qm.LoadingIndicator__darktext:Qm.LoadingIndicator__lighttext),children:n}):null,r?_.jsx("p",{className:ge(Qm.LoadingIndicator__subtitle,s?Qm.LoadingIndicator__darktext:Qm.LoadingIndicator__lighttext),children:r}):null]})};ide.displayName="LoadingIndicator";const Ou=({title:e=ue("components.loading_overlay.title"),subtitle:t=ue("components.loading_overlay.subtitle"),...n})=>_.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:_.jsx(ide,{look:"dark",title:e,subtitle:t})});Ou.displayName="LoadingOverlay";const YBe="w-6 h-6 rounded-full animate-spin",ode=C.forwardRef((e,t)=>{const{className:n,...r}=e;return _.jsx(abe,{ref:t,className:ge(YBe,n),...r})});ode.displayName="LoadingSpinner";function XBe(e,t,n){C.useEffect(()=>{if(!e||!("ResizeObserver"in window))return;const r=new ResizeObserver(n);return r.observe(e,t),()=>{r.disconnect()}},[e,t,n])}function QBe(e=!1){const[t,n]=C.useState(e);return[t,()=>n(s=>!s)]}const ZBe="modulepreload",JBe=function(e){return"/"+e},$K={},AP=function(t,n,r){let s=Promise.resolve();if(n&&n.length>0){document.getElementsByTagName("link");const o=document.querySelector("meta[property=csp-nonce]"),a=(o==null?void 0:o.nonce)||(o==null?void 0:o.getAttribute("nonce"));s=Promise.allSettled(n.map(c=>{if(c=JBe(c),c in $K)return;$K[c]=!0;const d=c.endsWith(".css"),h=d?'[rel="stylesheet"]':"";if(document.querySelector(`link[href="${c}"]${h}`))return;const u=document.createElement("link");if(u.rel=d?"stylesheet":ZBe,d||(u.as="script"),u.crossOrigin="",u.href=c,a&&u.setAttribute("nonce",a),document.head.appendChild(u),d)return new Promise((f,g)=>{u.addEventListener("load",f),u.addEventListener("error",()=>g(new Error(`Unable to preload CSS for ${c}`)))})}))}function i(o){const a=new Event("vite:preloadError",{cancelable:!0});if(a.payload=o,window.dispatchEvent(a),!a.defaultPrevented)throw o}return s.then(o=>{for(const a of o||[])a.status==="rejected"&&i(a.reason);return t().catch(i)})};var K1={};K1.d=(e,t)=>{for(var n in t)K1.o(t,n)&&!K1.o(e,n)&&Object.defineProperty(e,n,{enumerable:!0,get:t[n]})};K1.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t);var $t=globalThis.pdfjsLib={};K1.d($t,{AbortException:()=>Sy,AnnotationEditorLayer:()=>sV,AnnotationEditorParamsType:()=>zt,AnnotationEditorType:()=>_n,AnnotationEditorUIManager:()=>Qv,AnnotationLayer:()=>Q5e,AnnotationMode:()=>yh,CMapCompressionType:()=>XU,ColorPicker:()=>dk,DOMSVGFactory:()=>NW,DrawLayer:()=>lV,FeatureTest:()=>Jo,GlobalWorkerOptions:()=>Rf,ImageKind:()=>aN,InvalidPDFException:()=>lde,MissingPDFException:()=>wy,OPS:()=>Yl,Outliner:()=>F5,PDFDataRangeTransport:()=>rfe,PDFDateString:()=>mde,PDFWorker:()=>zb,PasswordResponses:()=>rUe,PermissionFlag:()=>nUe,PixelsPerInch:()=>wp,RenderingCancelledException:()=>TW,TextLayer:()=>ck,UnexpectedResponseException:()=>zO,Util:()=>xt,VerbosityLevel:()=>jO,XfaLayer:()=>ife,build:()=>k5e,createValidAbsoluteUrl:()=>aUe,fetchData:()=>WO,getDocument:()=>w5e,getFilenameFromUrl:()=>vUe,getPdfFilenameFromUrl:()=>yUe,getXfaPageViewport:()=>bUe,isDataScheme:()=>kW,isPdfFile:()=>DW,noContextMenu:()=>ia,normalizeUnicode:()=>hUe,renderTextLayer:()=>h5e,setLayerDimensions:()=>Xv,shadow:()=>An,updateTextLayer:()=>p5e,version:()=>T5e});const ro=typeof process=="object"&&process+""=="[object process]"&&!process.versions.nw&&!(process.versions.electron&&process.type&&process.type!=="browser"),ade=[1,0,0,1,0,0],YU=[.001,0,0,.001,0,0],eUe=1e7,oz=1.35,ul={ANY:1,DISPLAY:2,PRINT:4,ANNOTATIONS_FORMS:16,ANNOTATIONS_STORAGE:32,ANNOTATIONS_DISABLE:64,OPLIST:256},yh={DISABLE:0,ENABLE:1,ENABLE_FORMS:2,ENABLE_STORAGE:3},tUe="pdfjs_internal_editor_",_n={DISABLE:-1,NONE:0,FREETEXT:3,HIGHLIGHT:9,STAMP:13,INK:15},zt={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},nUe={PRINT:4,MODIFY_CONTENTS:8,COPY:16,MODIFY_ANNOTATIONS:32,FILL_INTERACTIVE_FORMS:256,COPY_FOR_ACCESSIBILITY:512,ASSEMBLE:1024,PRINT_HIGH_QUALITY:2048},qi={FILL:0,STROKE:1,FILL_STROKE:2,INVISIBLE:3,FILL_STROKE_MASK:3,ADD_TO_PATH_FLAG:4},aN={GRAYSCALE_1BPP:1,RGB_24BPP:2,RGBA_32BPP:3},Vs={TEXT:1,LINK:2,FREETEXT:3,LINE:4,SQUARE:5,CIRCLE:6,POLYGON:7,POLYLINE:8,HIGHLIGHT:9,UNDERLINE:10,SQUIGGLY:11,STRIKEOUT:12,STAMP:13,CARET:14,INK:15,POPUP:16,FILEATTACHMENT:17,WIDGET:20},XS={SOLID:1,DASHED:2,BEVELED:3,INSET:4,UNDERLINE:5},jO={ERRORS:0,WARNINGS:1,INFOS:5},XU={NONE:0,BINARY:1},Yl={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},rUe={NEED_PASSWORD:1,INCORRECT_PASSWORD:2};let $O=jO.WARNINGS;function sUe(e){Number.isInteger(e)&&($O=e)}function iUe(){return $O}function FO(e){$O>=jO.INFOS&&console.log(`Info: ${e}`)}function nn(e){$O>=jO.WARNINGS&&console.log(`Warning: ${e}`)}function lr(e){throw new Error(e)}function ni(e,t){e||lr(t)}function oUe(e){switch(e==null?void 0:e.protocol){case"http:":case"https:":case"ftp:":case"mailto:":case"tel:":return!0;default:return!1}}function aUe(e,t=null,n=null){if(!e)return null;try{if(n&&typeof e=="string"){if(n.addDefaultProtocol&&e.startsWith("www.")){const s=e.match(/\./g);(s==null?void 0:s.length)>=2&&(e=`http://${e}`)}if(n.tryConvertEncoding)try{e=fUe(e)}catch{}}const r=t?new URL(e,t):new URL(e);if(oUe(r))return r}catch{}return null}function An(e,t,n,r=!1){return Object.defineProperty(e,t,{value:n,enumerable:!r,configurable:!0,writable:!1}),n}const Lp=function(){function t(n,r){this.constructor===t&&lr("Cannot initialize BaseException."),this.message=n,this.name=r}return t.prototype=new Error,t.constructor=t,t}();class QU extends Lp{constructor(t,n){super(t,"PasswordException"),this.code=n}}class ZU extends Lp{constructor(t,n){super(t,"UnknownErrorException"),this.details=n}}class lde extends Lp{constructor(t){super(t,"InvalidPDFException")}}class wy extends Lp{constructor(t){super(t,"MissingPDFException")}}class zO extends Lp{constructor(t,n){super(t,"UnexpectedResponseException"),this.status=n}}class lUe extends Lp{constructor(t){super(t,"FormatError")}}class Sy extends Lp{constructor(t){super(t,"AbortException")}}function cde(e){(typeof e!="object"||(e==null?void 0:e.length)===void 0)&&lr("Invalid argument for bytesToString");const t=e.length,n=8192;if(t<n)return String.fromCharCode.apply(null,e);const r=[];for(let s=0;s<t;s+=n){const i=Math.min(s+n,t),o=e.subarray(s,i);r.push(String.fromCharCode.apply(null,o))}return r.join("")}function BO(e){typeof e!="string"&&lr("Invalid argument for stringToBytes");const t=e.length,n=new Uint8Array(t);for(let r=0;r<t;++r)n[r]=e.charCodeAt(r)&255;return n}function cUe(e){return String.fromCharCode(e>>24&255,e>>16&255,e>>8&255,e&255)}function RW(e){const t=Object.create(null);for(const[n,r]of e)t[n]=r;return t}function uUe(){const e=new Uint8Array(4);return e[0]=1,new Uint32Array(e.buffer,0,1)[0]===1}function dUe(){try{return new Function(""),!0}catch{return!1}}class Jo{static get isLittleEndian(){return An(this,"isLittleEndian",uUe())}static get isEvalSupported(){return An(this,"isEvalSupported",dUe())}static get isOffscreenCanvasSupported(){return An(this,"isOffscreenCanvasSupported",typeof OffscreenCanvas<"u")}static get platform(){return typeof navigator<"u"&&typeof(navigator==null?void 0:navigator.platform)=="string"?An(this,"platform",{isMac:navigator.platform.includes("Mac")}):An(this,"platform",{isMac:!1})}static get isCSSRoundSupported(){var t,n;return An(this,"isCSSRoundSupported",(n=(t=globalThis.CSS)==null?void 0:t.supports)==null?void 0:n.call(t,"width: round(1.5px, 1px)"))}}const az=Array.from(Array(256).keys(),e=>e.toString(16).padStart(2,"0"));var Tf,lN,JU;class xt{static makeHexColor(t,n,r){return`#${az[t]}${az[n]}${az[r]}`}static scaleMinMax(t,n){let r;t[0]?(t[0]<0&&(r=n[0],n[0]=n[2],n[2]=r),n[0]*=t[0],n[2]*=t[0],t[3]<0&&(r=n[1],n[1]=n[3],n[3]=r),n[1]*=t[3],n[3]*=t[3]):(r=n[0],n[0]=n[1],n[1]=r,r=n[2],n[2]=n[3],n[3]=r,t[1]<0&&(r=n[1],n[1]=n[3],n[3]=r),n[1]*=t[1],n[3]*=t[1],t[2]<0&&(r=n[0],n[0]=n[2],n[2]=r),n[0]*=t[2],n[2]*=t[2]),n[0]+=t[4],n[1]+=t[5],n[2]+=t[4],n[3]+=t[5]}static transform(t,n){return[t[0]*n[0]+t[2]*n[1],t[1]*n[0]+t[3]*n[1],t[0]*n[2]+t[2]*n[3],t[1]*n[2]+t[3]*n[3],t[0]*n[4]+t[2]*n[5]+t[4],t[1]*n[4]+t[3]*n[5]+t[5]]}static applyTransform(t,n){const r=t[0]*n[0]+t[1]*n[2]+n[4],s=t[0]*n[1]+t[1]*n[3]+n[5];return[r,s]}static applyInverseTransform(t,n){const r=n[0]*n[3]-n[1]*n[2],s=(t[0]*n[3]-t[1]*n[2]+n[2]*n[5]-n[4]*n[3])/r,i=(-t[0]*n[1]+t[1]*n[0]+n[4]*n[1]-n[5]*n[0])/r;return[s,i]}static getAxialAlignedBoundingBox(t,n){const r=this.applyTransform(t,n),s=this.applyTransform(t.slice(2,4),n),i=this.applyTransform([t[0],t[3]],n),o=this.applyTransform([t[2],t[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(t){const n=t[0]*t[3]-t[1]*t[2];return[t[3]/n,-t[1]/n,-t[2]/n,t[0]/n,(t[2]*t[5]-t[4]*t[3])/n,(t[4]*t[1]-t[5]*t[0])/n]}static singularValueDecompose2dScale(t){const n=[t[0],t[2],t[1],t[3]],r=t[0]*n[0]+t[1]*n[2],s=t[0]*n[1]+t[1]*n[3],i=t[2]*n[0]+t[3]*n[2],o=t[2]*n[1]+t[3]*n[3],a=(r+o)/2,c=Math.sqrt((r+o)**2-4*(r*o-i*s))/2,d=a+c||1,h=a-c||1;return[Math.sqrt(d),Math.sqrt(h)]}static normalizeRect(t){const n=t.slice(0);return t[0]>t[2]&&(n[0]=t[2],n[2]=t[0]),t[1]>t[3]&&(n[1]=t[3],n[3]=t[1]),n}static intersect(t,n){const r=Math.max(Math.min(t[0],t[2]),Math.min(n[0],n[2])),s=Math.min(Math.max(t[0],t[2]),Math.max(n[0],n[2]));if(r>s)return null;const i=Math.max(Math.min(t[1],t[3]),Math.min(n[1],n[3])),o=Math.min(Math.max(t[1],t[3]),Math.max(n[1],n[3]));return i>o?null:[r,i,s,o]}static bezierBoundingBox(t,n,r,s,i,o,a,c,d){return d?(d[0]=Math.min(d[0],t,a),d[1]=Math.min(d[1],n,c),d[2]=Math.max(d[2],t,a),d[3]=Math.max(d[3],n,c)):d=[Math.min(t,a),Math.min(n,c),Math.max(t,a),Math.max(n,c)],K(this,Tf,JU).call(this,t,r,i,a,n,s,o,c,3*(-t+3*(r-i)+a),6*(t-2*r+i),3*(r-t),d),K(this,Tf,JU).call(this,t,r,i,a,n,s,o,c,3*(-n+3*(s-o)+c),6*(n-2*s+o),3*(s-n),d),d}}Tf=new WeakSet,lN=function(t,n,r,s,i,o,a,c,d,h){if(d<=0||d>=1)return;const u=1-d,f=d*d,g=f*d,v=u*(u*(u*t+3*d*n)+3*f*r)+g*s,m=u*(u*(u*i+3*d*o)+3*f*a)+g*c;h[0]=Math.min(h[0],v),h[1]=Math.min(h[1],m),h[2]=Math.max(h[2],v),h[3]=Math.max(h[3],m)},JU=function(t,n,r,s,i,o,a,c,d,h,u,f){if(Math.abs(d)<1e-12){Math.abs(h)>=1e-12&&K(this,Tf,lN).call(this,t,n,r,s,i,o,a,c,-u/h,f);return}const g=h**2-4*u*d;if(g<0)return;const v=Math.sqrt(g),m=2*d;K(this,Tf,lN).call(this,t,n,r,s,i,o,a,c,(-h+v)/m,f),K(this,Tf,lN).call(this,t,n,r,s,i,o,a,c,(-h-v)/m,f)},G(xt,Tf);function fUe(e){return decodeURIComponent(escape(e))}let lz=null,FK=null;function hUe(e){return lz||(lz=/([\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,FK=new Map([["ſt","ſt"]])),e.replaceAll(lz,(t,n,r)=>n?n.normalize("NFKC"):FK.get(r))}function pUe(){if(typeof crypto<"u"&&typeof(crypto==null?void 0:crypto.randomUUID)=="function")return crypto.randomUUID();const e=new Uint8Array(32);if(typeof crypto<"u"&&typeof(crypto==null?void 0:crypto.getRandomValues)=="function")crypto.getRandomValues(e);else for(let t=0;t<32;t++)e[t]=Math.floor(Math.random()*255);return cde(e)}const ude="pdfjs_internal_id_",Dd={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 UO{constructor(){this.constructor===UO&&lr("Cannot initialize BaseFilterFactory.")}addFilter(t){return"none"}addHCMFilter(t,n){return"none"}addAlphaFilter(t){return"none"}addLuminosityFilter(t){return"none"}addHighlightHCMFilter(t,n,r,s,i){return"none"}destroy(t=!1){}}var KC;const iq=class iq{constructor({enableHWA:t=!1}={}){G(this,KC,!1);this.constructor===iq&&lr("Cannot initialize BaseCanvasFactory."),V(this,KC,t)}create(t,n){if(t<=0||n<=0)throw new Error("Invalid canvas size");const r=this._createCanvas(t,n);return{canvas:r,context:r.getContext("2d",{willReadFrequently:!P(this,KC)})}}reset(t,n,r){if(!t.canvas)throw new Error("Canvas is not specified");if(n<=0||r<=0)throw new Error("Invalid canvas size");t.canvas.width=n,t.canvas.height=r}destroy(t){if(!t.canvas)throw new Error("Canvas is not specified");t.canvas.width=0,t.canvas.height=0,t.canvas=null,t.context=null}_createCanvas(t,n){lr("Abstract method `_createCanvas` called.")}};KC=new WeakMap;let ik=iq;class VO{constructor({baseUrl:t=null,isCompressed:n=!0}){this.constructor===VO&&lr("Cannot initialize BaseCMapReaderFactory."),this.baseUrl=t,this.isCompressed=n}async fetch({name:t}){if(!this.baseUrl)throw new Error('The CMap "baseUrl" parameter must be specified, ensure that the "cMapUrl" and "cMapPacked" API parameters are provided.');if(!t)throw new Error("CMap name must be specified.");const n=this.baseUrl+t+(this.isCompressed?".bcmap":""),r=this.isCompressed?XU.BINARY:XU.NONE;return this._fetchData(n,r).catch(s=>{throw new Error(`Unable to load ${this.isCompressed?"binary ":""}CMap at: ${n}`)})}_fetchData(t,n){lr("Abstract method `_fetchData` called.")}}class HO{constructor({baseUrl:t=null}){this.constructor===HO&&lr("Cannot initialize BaseStandardFontDataFactory."),this.baseUrl=t}async fetch({filename:t}){if(!this.baseUrl)throw new Error('The standard font "baseUrl" parameter must be specified, ensure that the "standardFontDataUrl" API parameter is provided.');if(!t)throw new Error("Font filename must be specified.");const n=`${this.baseUrl}${t}`;return this._fetchData(n).catch(r=>{throw new Error(`Unable to load font data at: ${n}`)})}_fetchData(t){lr("Abstract method `_fetchData` called.")}}class PW{constructor(){this.constructor===PW&&lr("Cannot initialize BaseSVGFactory.")}create(t,n,r=!1){if(t<=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",`${t}px`),s.setAttribute("height",`${n}px`)),s.setAttribute("preserveAspectRatio","none"),s.setAttribute("viewBox",`0 0 ${t} ${n}`),s}createElement(t){if(typeof t!="string")throw new Error("Invalid SVG element type");return this._createSVG(t)}_createSVG(t){lr("Abstract method `_createSVG` called.")}}const Ld="http://www.w3.org/2000/svg",ag=class ag{};Be(ag,"CSS",96),Be(ag,"PDF",72),Be(ag,"PDF_TO_CSS_UNITS",ag.CSS/ag.PDF);let wp=ag;var Rg,Yc,Gd,Vo,Sk,Pg,mt,Gi,Zy,Jy,cN,dde,e5,eb,p1,m1,t5,g1;class mUe extends UO{constructor({docId:n,ownerDocument:r=globalThis.document}={}){super();G(this,mt);G(this,Rg);G(this,Yc);G(this,Gd);G(this,Vo);G(this,Sk);G(this,Pg,0);V(this,Gd,n),V(this,Vo,r)}addFilter(n){if(!n)return"none";let r=P(this,mt,Gi).get(n);if(r)return r;const[s,i,o]=K(this,mt,cN).call(this,n),a=n.length===1?s:`${s}${i}${o}`;if(r=P(this,mt,Gi).get(a),r)return P(this,mt,Gi).set(n,r),r;const c=`g_${P(this,Gd)}_transfer_map_${Ui(this,Pg)._++}`,d=`url(#${c})`;P(this,mt,Gi).set(n,d),P(this,mt,Gi).set(a,d);const h=K(this,mt,eb).call(this,c);return K(this,mt,m1).call(this,s,i,o,h),d}addHCMFilter(n,r){var v;const s=`${n}-${r}`,i="base";let o=P(this,mt,Zy).get(i);if((o==null?void 0:o.key)===s||(o?((v=o.filter)==null||v.remove(),o.key=s,o.url="none",o.filter=null):(o={key:s,url:"none",filter:null},P(this,mt,Zy).set(i,o)),!n||!r))return o.url;const a=K(this,mt,g1).call(this,n);n=xt.makeHexColor(...a);const c=K(this,mt,g1).call(this,r);if(r=xt.makeHexColor(...c),P(this,mt,Jy).style.color="",n==="#000000"&&r==="#ffffff"||n===r)return o.url;const d=new Array(256);for(let m=0;m<=255;m++){const x=m/255;d[m]=x<=.03928?x/12.92:((x+.055)/1.055)**2.4}const h=d.join(","),u=`g_${P(this,Gd)}_hcm_filter`,f=o.filter=K(this,mt,eb).call(this,u);K(this,mt,m1).call(this,h,h,h,f),K(this,mt,e5).call(this,f);const g=(m,x)=>{const y=a[m]/255,b=c[m]/255,w=new Array(x+1);for(let E=0;E<=x;E++)w[E]=y+E/x*(b-y);return w.join(",")};return K(this,mt,m1).call(this,g(0,5),g(1,5),g(2,5),f),o.url=`url(#${u})`,o.url}addAlphaFilter(n){let r=P(this,mt,Gi).get(n);if(r)return r;const[s]=K(this,mt,cN).call(this,[n]),i=`alpha_${s}`;if(r=P(this,mt,Gi).get(i),r)return P(this,mt,Gi).set(n,r),r;const o=`g_${P(this,Gd)}_alpha_map_${Ui(this,Pg)._++}`,a=`url(#${o})`;P(this,mt,Gi).set(n,a),P(this,mt,Gi).set(i,a);const c=K(this,mt,eb).call(this,o);return K(this,mt,t5).call(this,s,c),a}addLuminosityFilter(n){let r=P(this,mt,Gi).get(n||"luminosity");if(r)return r;let s,i;if(n?([s]=K(this,mt,cN).call(this,[n]),i=`luminosity_${s}`):i="luminosity",r=P(this,mt,Gi).get(i),r)return P(this,mt,Gi).set(n,r),r;const o=`g_${P(this,Gd)}_luminosity_map_${Ui(this,Pg)._++}`,a=`url(#${o})`;P(this,mt,Gi).set(n,a),P(this,mt,Gi).set(i,a);const c=K(this,mt,eb).call(this,o);return K(this,mt,dde).call(this,c),n&&K(this,mt,t5).call(this,s,c),a}addHighlightHCMFilter(n,r,s,i,o){var b;const a=`${r}-${s}-${i}-${o}`;let c=P(this,mt,Zy).get(n);if((c==null?void 0:c.key)===a||(c?((b=c.filter)==null||b.remove(),c.key=a,c.url="none",c.filter=null):(c={key:a,url:"none",filter:null},P(this,mt,Zy).set(n,c)),!r||!s))return c.url;const[d,h]=[r,s].map(K(this,mt,g1).bind(this));let u=Math.round(.2126*d[0]+.7152*d[1]+.0722*d[2]),f=Math.round(.2126*h[0]+.7152*h[1]+.0722*h[2]),[g,v]=[i,o].map(K(this,mt,g1).bind(this));f<u&&([u,f,g,v]=[f,u,v,g]),P(this,mt,Jy).style.color="";const m=(w,E,R)=>{const T=new Array(256),N=(f-u)/R,A=w/255,D=(E-w)/(255*R);let O=0;for(let I=0;I<=R;I++){const $=Math.round(u+I*N),F=A+I*D;for(let B=O;B<=$;B++)T[B]=F;O=$+1}for(let I=O;I<256;I++)T[I]=T[O-1];return T.join(",")},x=`g_${P(this,Gd)}_hcm_${n}_filter`,y=c.filter=K(this,mt,eb).call(this,x);return K(this,mt,e5).call(this,y),K(this,mt,m1).call(this,m(g[0],v[0],5),m(g[1],v[1],5),m(g[2],v[2],5),y),c.url=`url(#${x})`,c.url}destroy(n=!1){n&&P(this,mt,Zy).size!==0||(P(this,Yc)&&(P(this,Yc).parentNode.parentNode.remove(),V(this,Yc,null)),P(this,Rg)&&(P(this,Rg).clear(),V(this,Rg,null)),V(this,Pg,0))}}Rg=new WeakMap,Yc=new WeakMap,Gd=new WeakMap,Vo=new WeakMap,Sk=new WeakMap,Pg=new WeakMap,mt=new WeakSet,Gi=function(){return P(this,Rg)||V(this,Rg,new Map)},Zy=function(){return P(this,Sk)||V(this,Sk,new Map)},Jy=function(){if(!P(this,Yc)){const n=P(this,Vo).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=P(this,Vo).createElementNS(Ld,"svg");s.setAttribute("width",0),s.setAttribute("height",0),V(this,Yc,P(this,Vo).createElementNS(Ld,"defs")),n.append(s),s.append(P(this,Yc)),P(this,Vo).body.append(n)}return P(this,Yc)},cN=function(n){if(n.length===1){const d=n[0],h=new Array(256);for(let f=0;f<256;f++)h[f]=d[f]/255;const u=h.join(",");return[u,u,u]}const[r,s,i]=n,o=new Array(256),a=new Array(256),c=new Array(256);for(let d=0;d<256;d++)o[d]=r[d]/255,a[d]=s[d]/255,c[d]=i[d]/255;return[o.join(","),a.join(","),c.join(",")]},dde=function(n){const r=P(this,Vo).createElementNS(Ld,"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)},e5=function(n){const r=P(this,Vo).createElementNS(Ld,"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)},eb=function(n){const r=P(this,Vo).createElementNS(Ld,"filter");return r.setAttribute("color-interpolation-filters","sRGB"),r.setAttribute("id",n),P(this,mt,Jy).append(r),r},p1=function(n,r,s){const i=P(this,Vo).createElementNS(Ld,r);i.setAttribute("type","discrete"),i.setAttribute("tableValues",s),n.append(i)},m1=function(n,r,s,i){const o=P(this,Vo).createElementNS(Ld,"feComponentTransfer");i.append(o),K(this,mt,p1).call(this,o,"feFuncR",n),K(this,mt,p1).call(this,o,"feFuncG",r),K(this,mt,p1).call(this,o,"feFuncB",s)},t5=function(n,r){const s=P(this,Vo).createElementNS(Ld,"feComponentTransfer");r.append(s),K(this,mt,p1).call(this,s,"feFuncA",n)},g1=function(n){return P(this,mt,Jy).style.color=n,OW(getComputedStyle(P(this,mt,Jy)).getPropertyValue("color"))};class gUe extends ik{constructor({ownerDocument:t=globalThis.document,enableHWA:n=!1}={}){super({enableHWA:n}),this._document=t}_createCanvas(t,n){const r=this._document.createElement("canvas");return r.width=t,r.height=n,r}}async function WO(e,t="text"){if(v1(e,document.baseURI)){const n=await fetch(e);if(!n.ok)throw new Error(n.statusText);switch(t){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",e,!0),s.responseType=t,s.onreadystatechange=()=>{if(s.readyState===XMLHttpRequest.DONE){if(s.status===200||s.status===0){switch(t){case"arraybuffer":case"blob":case"json":n(s.response);return}n(s.responseText);return}r(new Error(s.statusText))}},s.send(null)})}class fde extends VO{_fetchData(t,n){return WO(t,this.isCompressed?"arraybuffer":"text").then(r=>({cMapData:r instanceof ArrayBuffer?new Uint8Array(r):BO(r),compressionType:n}))}}class hde extends HO{_fetchData(t){return WO(t,"arraybuffer").then(n=>new Uint8Array(n))}}class NW extends PW{_createSVG(t){return document.createElementNS(Ld,t)}}class yR{constructor({viewBox:t,scale:n,rotation:r,offsetX:s=0,offsetY:i=0,dontFlip:o=!1}){this.viewBox=t,this.scale=n,this.rotation=r,this.offsetX=s,this.offsetY=i;const a=(t[2]+t[0])/2,c=(t[3]+t[1])/2;let d,h,u,f;switch(r%=360,r<0&&(r+=360),r){case 180:d=-1,h=0,u=0,f=1;break;case 90:d=0,h=1,u=1,f=0;break;case 270:d=0,h=-1,u=-1,f=0;break;case 0:d=1,h=0,u=0,f=-1;break;default:throw new Error("PageViewport: Invalid rotation, must be a multiple of 90 degrees.")}o&&(u=-u,f=-f);let g,v,m,x;d===0?(g=Math.abs(c-t[1])*n+s,v=Math.abs(a-t[0])*n+i,m=(t[3]-t[1])*n,x=(t[2]-t[0])*n):(g=Math.abs(a-t[0])*n+s,v=Math.abs(c-t[1])*n+i,m=(t[2]-t[0])*n,x=(t[3]-t[1])*n),this.transform=[d*n,h*n,u*n,f*n,g-d*n*a-u*n*c,v-h*n*a-f*n*c],this.width=m,this.height=x}get rawDims(){const{viewBox:t}=this;return An(this,"rawDims",{pageWidth:t[2]-t[0],pageHeight:t[3]-t[1],pageX:t[0],pageY:t[1]})}clone({scale:t=this.scale,rotation:n=this.rotation,offsetX:r=this.offsetX,offsetY:s=this.offsetY,dontFlip:i=!1}={}){return new yR({viewBox:this.viewBox.slice(),scale:t,rotation:n,offsetX:r,offsetY:s,dontFlip:i})}convertToViewportPoint(t,n){return xt.applyTransform([t,n],this.transform)}convertToViewportRectangle(t){const n=xt.applyTransform([t[0],t[1]],this.transform),r=xt.applyTransform([t[2],t[3]],this.transform);return[n[0],n[1],r[0],r[1]]}convertToPdfPoint(t,n){return xt.applyInverseTransform([t,n],this.transform)}}class TW extends Lp{constructor(t,n=0){super(t,"RenderingCancelledException"),this.extraDelay=n}}function kW(e){const t=e.length;let n=0;for(;n<t&&e[n].trim()==="";)n++;return e.substring(n,n+5).toLowerCase()==="data:"}function DW(e){return typeof e=="string"&&/\.pdf$/i.test(e)}function vUe(e){return[e]=e.split(/[#?]/,1),e.substring(e.lastIndexOf("/")+1)}function yUe(e,t="document.pdf"){if(typeof e!="string")return t;if(kW(e))return nn('getPdfFilenameFromUrl: ignore "data:"-URL for performance reasons.'),t;const n=/^(?:(?:[^:]+:)?\/\/[^/]+)?([^?#]*)(\?[^#]*)?(#.*)?$/,r=/[^/?#=]+\.pdf\b(?!.*\.pdf\b)/i,s=n.exec(e);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||t}class zK{constructor(){Be(this,"started",Object.create(null));Be(this,"times",[])}time(t){t in this.started&&nn(`Timer is already running for ${t}`),this.started[t]=Date.now()}timeEnd(t){t in this.started||nn(`Timer has not been started for ${t}`),this.times.push({name:t,start:this.started[t],end:Date.now()}),delete this.started[t]}toString(){const t=[];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)t.push(`${r.padEnd(n)} ${i-s}ms
|
||
`);return t.join("")}}function v1(e,t){try{const{protocol:n}=t?new URL(e,t):new URL(e);return n==="http:"||n==="https:"}catch{return!1}}function ia(e){e.preventDefault()}function pde(e){console.log("Deprecated API usage: "+e)}let BK;class mde{static toDateObject(t){if(!t||typeof t!="string")return null;BK||(BK=new RegExp("^D:(\\d{4})(\\d{2})?(\\d{2})?(\\d{2})?(\\d{2})?(\\d{2})?([Z|+|-])?(\\d{2})?'?(\\d{2})?'?"));const n=BK.exec(t);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 d=n[7]||"Z";let h=parseInt(n[8],10);h=h>=0&&h<=23?h:0;let u=parseInt(n[9],10)||0;return u=u>=0&&u<=59?u:0,d==="-"?(o+=h,a+=u):d==="+"&&(o-=h,a-=u),new Date(Date.UTC(r,s,i,o,a,c))}}function bUe(e,{scale:t=1,rotation:n=0}){const{width:r,height:s}=e.attributes.style,i=[0,0,parseInt(r),parseInt(s)];return new yR({viewBox:i,scale:t,rotation:n})}function OW(e){if(e.startsWith("#")){const t=parseInt(e.slice(1),16);return[(t&16711680)>>16,(t&65280)>>8,t&255]}return e.startsWith("rgb(")?e.slice(4,-1).split(",").map(t=>parseInt(t)):e.startsWith("rgba(")?e.slice(5,-1).split(",").map(t=>parseInt(t)).slice(0,3):(nn(`Not a valid color format: "${e}"`),[0,0,0])}function xUe(e){const t=document.createElement("span");t.style.visibility="hidden",document.body.append(t);for(const n of e.keys()){t.style.color=n;const r=window.getComputedStyle(t).color;e.set(n,OW(r))}t.remove()}function es(e){const{a:t,b:n,c:r,d:s,e:i,f:o}=e.getTransform();return[t,n,r,s,i,o]}function Od(e){const{a:t,b:n,c:r,d:s,e:i,f:o}=e.getTransform().invertSelf();return[t,n,r,s,i,o]}function Xv(e,t,n=!1,r=!0){if(t instanceof yR){const{pageWidth:s,pageHeight:i}=t.rawDims,{style:o}=e,a=Jo.isCSSRoundSupported,c=`var(--scale-factor) * ${s}px`,d=`var(--scale-factor) * ${i}px`,h=a?`round(${c}, 1px)`:`calc(${c})`,u=a?`round(${d}, 1px)`:`calc(${d})`;!n||t.rotation%180===0?(o.width=h,o.height=u):(o.width=u,o.height=h)}r&&e.setAttribute("data-main-rotation",t.rotation)}var Ng,Tg,Da,kg,Ck,gde,ko,vde,yde,uN,bde,r5;const Ek=class Ek{constructor(t){G(this,ko);G(this,Ng,null);G(this,Tg,null);G(this,Da);G(this,kg,null);V(this,Da,t)}render(){const t=V(this,Ng,document.createElement("div"));t.className="editToolbar",t.setAttribute("role","toolbar");const n=P(this,Da)._uiManager._signal;t.addEventListener("contextmenu",ia,{signal:n}),t.addEventListener("pointerdown",K(Ek,Ck,gde),{signal:n});const r=V(this,kg,document.createElement("div"));r.className="buttons",t.append(r);const s=P(this,Da).toolbarPosition;if(s){const{style:i}=t,o=P(this,Da)._uiManager.direction==="ltr"?1-s[0]:s[0];i.insetInlineEnd=`${100*o}%`,i.top=`calc(${100*s[1]}% + var(--editor-toolbar-vert-offset))`}return K(this,ko,bde).call(this),t}hide(){var t;P(this,Ng).classList.add("hidden"),(t=P(this,Tg))==null||t.hideDropdown()}show(){P(this,Ng).classList.remove("hidden")}addAltTextButton(t){K(this,ko,uN).call(this,t),P(this,kg).prepend(t,P(this,ko,r5))}addColorPicker(t){V(this,Tg,t);const n=t.renderButton();K(this,ko,uN).call(this,n),P(this,kg).prepend(n,P(this,ko,r5))}remove(){var t;P(this,Ng).remove(),(t=P(this,Tg))==null||t.destroy(),V(this,Tg,null)}};Ng=new WeakMap,Tg=new WeakMap,Da=new WeakMap,kg=new WeakMap,Ck=new WeakSet,gde=function(t){t.stopPropagation()},ko=new WeakSet,vde=function(t){P(this,Da)._focusEventsAllowed=!1,t.preventDefault(),t.stopPropagation()},yde=function(t){P(this,Da)._focusEventsAllowed=!0,t.preventDefault(),t.stopPropagation()},uN=function(t){const n=P(this,Da)._uiManager._signal;t.addEventListener("focusin",K(this,ko,vde).bind(this),{capture:!0,signal:n}),t.addEventListener("focusout",K(this,ko,yde).bind(this),{capture:!0,signal:n}),t.addEventListener("contextmenu",ia,{signal:n})},bde=function(){const t=document.createElement("button");t.className="delete",t.tabIndex=0,t.setAttribute("data-l10n-id",`pdfjs-editor-remove-${P(this,Da).editorType}-button`),K(this,ko,uN).call(this,t),t.addEventListener("click",n=>{P(this,Da)._uiManager.delete()},{signal:P(this,Da)._uiManager._signal}),P(this,kg).append(t)},r5=function(){const t=document.createElement("div");return t.className="divider",t},G(Ek,Ck);let n5=Ek;var YC,Dg,Og,Sp,xde,_de,wde;class _Ue{constructor(t){G(this,Sp);G(this,YC,null);G(this,Dg,null);G(this,Og);V(this,Og,t)}show(t,n,r){const[s,i]=K(this,Sp,_de).call(this,n,r),{style:o}=P(this,Dg)||V(this,Dg,K(this,Sp,xde).call(this));t.append(P(this,Dg)),o.insetInlineEnd=`${100*s}%`,o.top=`calc(${100*i}% + var(--editor-toolbar-vert-offset))`}hide(){P(this,Dg).remove()}}YC=new WeakMap,Dg=new WeakMap,Og=new WeakMap,Sp=new WeakSet,xde=function(){const t=V(this,Dg,document.createElement("div"));t.className="editToolbar",t.setAttribute("role","toolbar"),t.addEventListener("contextmenu",ia,{signal:P(this,Og)._signal});const n=V(this,YC,document.createElement("div"));return n.className="buttons",t.append(n),K(this,Sp,wde).call(this),t},_de=function(t,n){let r=0,s=0;for(const i of t){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]},wde=function(){const t=document.createElement("button");t.className="highlightButton",t.tabIndex=0,t.setAttribute("data-l10n-id","pdfjs-highlight-floating-button1");const n=document.createElement("span");t.append(n),n.className="visuallyHidden",n.setAttribute("data-l10n-id","pdfjs-highlight-floating-button-label");const r=P(this,Og)._signal;t.addEventListener("contextmenu",ia,{signal:r}),t.addEventListener("click",()=>{P(this,Og).highlightSelection("floating_button")},{signal:r}),P(this,YC).append(t)};function ok(e,t,n){for(const r of n)t.addEventListener(r,e[r].bind(e))}function wUe(e){return Math.round(Math.min(255,Math.max(1,255*e))).toString(16).padStart(2,"0")}var Ak;class SUe{constructor(){G(this,Ak,0)}get id(){return`${tUe}${Ui(this,Ak)._++}`}}Ak=new WeakMap;var XC,Rk,il,QC,i5;const oq=class oq{constructor(){G(this,QC);G(this,XC,pUe());G(this,Rk,0);G(this,il,null)}static get _isSVGFittingCanvas(){const t='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=t;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 An(this,"_isSVGFittingCanvas",i)}async getFromFile(t){const{lastModified:n,name:r,size:s,type:i}=t;return K(this,QC,i5).call(this,`${n}_${r}_${s}_${i}`,t)}async getFromUrl(t){return K(this,QC,i5).call(this,t,t)}async getFromId(t){P(this,il)||V(this,il,new Map);const n=P(this,il).get(t);return n?n.bitmap?(n.refCounter+=1,n):n.file?this.getFromFile(n.file):this.getFromUrl(n.url):null}getSvgUrl(t){const n=P(this,il).get(t);return n!=null&&n.isSvg?n.svgUrl:null}deleteId(t){P(this,il)||V(this,il,new Map);const n=P(this,il).get(t);n&&(n.refCounter-=1,n.refCounter===0&&(n.bitmap=null))}isValidId(t){return t.startsWith(`image_${P(this,XC)}_`)}};XC=new WeakMap,Rk=new WeakMap,il=new WeakMap,QC=new WeakSet,i5=async function(t,n){P(this,il)||V(this,il,new Map);let r=P(this,il).get(t);if(r===null)return null;if(r!=null&&r.bitmap)return r.refCounter+=1,r;try{r||(r={bitmap:null,id:`image_${P(this,XC)}_${Ui(this,Rk)._++}`,refCounter:0,isSvg:!1});let s;if(typeof n=="string"?(r.url=n,s=await WO(n,"blob")):s=r.file=n,s.type==="image/svg+xml"){const i=oq._isSVGFittingCanvas,o=new FileReader,a=new Image,c=new Promise((d,h)=>{a.onload=()=>{r.bitmap=a,r.isSvg=!0,d()},o.onload=async()=>{const u=r.svgUrl=o.result;a.src=await i?`${u}#svgView(preserveAspectRatio(none))`:u},a.onerror=o.onerror=h});o.readAsDataURL(s),await c}else r.bitmap=await createImageBitmap(s);r.refCounter=1}catch(s){console.error(s),r=null}return P(this,il).set(t,r),r&&P(this,il).set(r.id,r),r};let s5=oq;var oi,Nh,ZC,ai;class CUe{constructor(t=128){G(this,oi,[]);G(this,Nh,!1);G(this,ZC);G(this,ai,-1);V(this,ZC,t)}add({cmd:t,undo:n,post:r,mustExec:s,type:i=NaN,overwriteIfSameType:o=!1,keepUndo:a=!1}){if(s&&t(),P(this,Nh))return;const c={cmd:t,undo:n,post:r,type:i};if(P(this,ai)===-1){P(this,oi).length>0&&(P(this,oi).length=0),V(this,ai,0),P(this,oi).push(c);return}if(o&&P(this,oi)[P(this,ai)].type===i){a&&(c.undo=P(this,oi)[P(this,ai)].undo),P(this,oi)[P(this,ai)]=c;return}const d=P(this,ai)+1;d===P(this,ZC)?P(this,oi).splice(0,1):(V(this,ai,d),d<P(this,oi).length&&P(this,oi).splice(d)),P(this,oi).push(c)}undo(){if(P(this,ai)===-1)return;V(this,Nh,!0);const{undo:t,post:n}=P(this,oi)[P(this,ai)];t(),n==null||n(),V(this,Nh,!1),V(this,ai,P(this,ai)-1)}redo(){if(P(this,ai)<P(this,oi).length-1){V(this,ai,P(this,ai)+1),V(this,Nh,!0);const{cmd:t,post:n}=P(this,oi)[P(this,ai)];t(),n==null||n(),V(this,Nh,!1)}}hasSomethingToUndo(){return P(this,ai)!==-1}hasSomethingToRedo(){return P(this,ai)<P(this,oi).length-1}destroy(){V(this,oi,null)}}oi=new WeakMap,Nh=new WeakMap,ZC=new WeakMap,ai=new WeakMap;var Pk,Sde;class bR{constructor(t){G(this,Pk);this.buffer=[],this.callbacks=new Map,this.allKeys=new Set;const{isMac:n}=Jo.platform;for(const[r,s,i={}]of t)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(t,n){if(!this.allKeys.has(n.key))return;const r=this.callbacks.get(K(this,Pk,Sde).call(this,n));if(!r)return;const{callback:s,options:{bubbles:i=!1,args:o=[],checker:a=null}}=r;a&&!a(t,n)||(s.bind(t,...o,n)(),i||(n.stopPropagation(),n.preventDefault()))}}Pk=new WeakSet,Sde=function(t){t.altKey&&this.buffer.push("alt"),t.ctrlKey&&this.buffer.push("ctrl"),t.metaKey&&this.buffer.push("meta"),t.shiftKey&&this.buffer.push("shift"),this.buffer.push(t.key);const n=this.buffer.join("+");return this.buffer.length=0,n};const Nk=class Nk{get _colors(){const t=new Map([["CanvasText",null],["Canvas",null]]);return xUe(t),An(this,"_colors",t)}convert(t){const n=OW(t);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 Nk._colorsMapping.get(r);return n}getHexCode(t){const n=this._colors.get(t);return n?xt.makeHexColor(...n):t}};Be(Nk,"_colorsMapping",new Map([["CanvasText",[0,0,0]],["Canvas",[255,255,255]]]));let o5=Nk;var n0,Oa,Ws,Ei,r0,Kd,s0,Zl,i0,Mg,Xc,Jl,Ig,JC,eE,Qc,o0,Th,Zc,Tk,kh,tE,Lg,nE,a0,Ai,Zn,Yd,jg,rE,sE,iE,oE,aE,lE,cE,uE,dE,fE,hE,pE,mE,Dh,Jc,Xd,gE,tt,dN,Cde,Ede,fN,Ade,Rde,Pde,a5,Nde,l5,c5,Tde,vo,ih,kde,Dde,u5,Ode,y1,d5;const bb=class bb{constructor(t,n,r,s,i,o,a,c,d){G(this,tt);G(this,n0,new AbortController);G(this,Oa,null);G(this,Ws,new Map);G(this,Ei,new Map);G(this,r0,null);G(this,Kd,null);G(this,s0,null);G(this,Zl,new CUe);G(this,i0,0);G(this,Mg,new Set);G(this,Xc,null);G(this,Jl,null);G(this,Ig,new Set);G(this,JC,!1);G(this,eE,null);G(this,Qc,null);G(this,o0,null);G(this,Th,!1);G(this,Zc,null);G(this,Tk,new SUe);G(this,kh,!1);G(this,tE,!1);G(this,Lg,null);G(this,nE,null);G(this,a0,null);G(this,Ai,_n.NONE);G(this,Zn,new Set);G(this,Yd,null);G(this,jg,null);G(this,rE,null);G(this,sE,this.blur.bind(this));G(this,iE,this.focus.bind(this));G(this,oE,this.copy.bind(this));G(this,aE,this.cut.bind(this));G(this,lE,this.paste.bind(this));G(this,cE,this.keydown.bind(this));G(this,uE,this.keyup.bind(this));G(this,dE,this.onEditingAction.bind(this));G(this,fE,this.onPageChanging.bind(this));G(this,hE,this.onScaleChanging.bind(this));G(this,pE,this.onRotationChanging.bind(this));G(this,mE,{isEditing:!1,isEmpty:!0,hasSomethingToUndo:!1,hasSomethingToRedo:!1,hasSelectedEditor:!1,hasSelectedText:!1});G(this,Dh,[0,0]);G(this,Jc,null);G(this,Xd,null);G(this,gE,null);this._signal=P(this,n0).signal,V(this,Xd,t),V(this,gE,n),V(this,r0,r),this._eventBus=s,this._eventBus._on("editingaction",P(this,dE)),this._eventBus._on("pagechanging",P(this,fE)),this._eventBus._on("scalechanging",P(this,hE)),this._eventBus._on("rotationchanging",P(this,pE)),K(this,tt,Ade).call(this),K(this,tt,Tde).call(this),K(this,tt,a5).call(this),V(this,Kd,i.annotationStorage),V(this,eE,i.filterFactory),V(this,jg,o),V(this,o0,a||null),V(this,JC,c),V(this,a0,d||null),this.viewParameters={realScale:wp.PDF_TO_CSS_UNITS,rotation:0},this.isShiftKeyDown=!1}static get _keyboardManager(){const t=bb.prototype,n=o=>P(o,Xd).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 An(this,"_keyboardManager",new bR([[["ctrl+a","mac+meta+a"],t.selectAll,{checker:r}],[["ctrl+z","mac+meta+z"],t.undo,{checker:r}],[["ctrl+y","ctrl+shift+z","mac+meta+shift+z","ctrl+shift+Z","mac+meta+shift+Z"],t.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"],t.delete,{checker:r}],[["Enter","mac+Enter"],t.addNewEditorFromKeyboard,{checker:(o,{target:a})=>!(a instanceof HTMLButtonElement)&&P(o,Xd).contains(a)&&!o.isEnterHandled}],[[" ","mac+ "],t.addNewEditorFromKeyboard,{checker:(o,{target:a})=>!(a instanceof HTMLButtonElement)&&P(o,Xd).contains(document.activeElement)}],[["Escape","mac+Escape"],t.unselectAll],[["ArrowLeft","mac+ArrowLeft"],t.translateSelectedEditors,{args:[-s,0],checker:n}],[["ctrl+ArrowLeft","mac+shift+ArrowLeft"],t.translateSelectedEditors,{args:[-i,0],checker:n}],[["ArrowRight","mac+ArrowRight"],t.translateSelectedEditors,{args:[s,0],checker:n}],[["ctrl+ArrowRight","mac+shift+ArrowRight"],t.translateSelectedEditors,{args:[i,0],checker:n}],[["ArrowUp","mac+ArrowUp"],t.translateSelectedEditors,{args:[0,-s],checker:n}],[["ctrl+ArrowUp","mac+shift+ArrowUp"],t.translateSelectedEditors,{args:[0,-i],checker:n}],[["ArrowDown","mac+ArrowDown"],t.translateSelectedEditors,{args:[0,s],checker:n}],[["ctrl+ArrowDown","mac+shift+ArrowDown"],t.translateSelectedEditors,{args:[0,i],checker:n}]]))}destroy(){var t,n,r;(t=P(this,n0))==null||t.abort(),V(this,n0,null),this._signal=null,this._eventBus._off("editingaction",P(this,dE)),this._eventBus._off("pagechanging",P(this,fE)),this._eventBus._off("scalechanging",P(this,hE)),this._eventBus._off("rotationchanging",P(this,pE));for(const s of P(this,Ei).values())s.destroy();P(this,Ei).clear(),P(this,Ws).clear(),P(this,Ig).clear(),V(this,Oa,null),P(this,Zn).clear(),P(this,Zl).destroy(),(n=P(this,r0))==null||n.destroy(),(r=P(this,Zc))==null||r.hide(),V(this,Zc,null),P(this,Qc)&&(clearTimeout(P(this,Qc)),V(this,Qc,null)),P(this,Jc)&&(clearTimeout(P(this,Jc)),V(this,Jc,null))}async mlGuess(t){var n;return((n=P(this,a0))==null?void 0:n.guess(t))||null}get hasMLManager(){return!!P(this,a0)}get hcmFilter(){return An(this,"hcmFilter",P(this,jg)?P(this,eE).addHCMFilter(P(this,jg).foreground,P(this,jg).background):"none")}get direction(){return An(this,"direction",getComputedStyle(P(this,Xd)).direction)}get highlightColors(){return An(this,"highlightColors",P(this,o0)?new Map(P(this,o0).split(",").map(t=>t.split("=").map(n=>n.trim()))):null)}get highlightColorNames(){return An(this,"highlightColorNames",this.highlightColors?new Map(Array.from(this.highlightColors,t=>t.reverse())):null)}setMainHighlightColorPicker(t){V(this,nE,t)}editAltText(t){var n;(n=P(this,r0))==null||n.editAltText(this,t)}onPageChanging({pageNumber:t}){V(this,i0,t-1)}focusMainContainer(){P(this,Xd).focus()}findParent(t,n){for(const r of P(this,Ei).values()){const{x:s,y:i,width:o,height:a}=r.div.getBoundingClientRect();if(t>=s&&t<=s+o&&n>=i&&n<=i+a)return r}return null}disableUserSelect(t=!1){P(this,gE).classList.toggle("noUserSelect",t)}addShouldRescale(t){P(this,Ig).add(t)}removeShouldRescale(t){P(this,Ig).delete(t)}onScaleChanging({scale:t}){this.commitOrRemove(),this.viewParameters.realScale=t*wp.PDF_TO_CSS_UNITS;for(const n of P(this,Ig))n.onScaleChanging()}onRotationChanging({pagesRotation:t}){this.commitOrRemove(),this.viewParameters.rotation=t}highlightSelection(t=""){const n=document.getSelection();if(!n||n.isCollapsed)return;const{anchorNode:r,anchorOffset:s,focusNode:i,focusOffset:o}=n,a=n.toString(),d=K(this,tt,dN).call(this,n).closest(".textLayer"),h=this.getSelectionBoxes(d);if(h){n.empty(),P(this,Ai)===_n.NONE&&(this._eventBus.dispatch("showannotationeditorui",{source:this,mode:_n.HIGHLIGHT}),this.showAllEditors("highlight",!0,!0));for(const u of P(this,Ei).values())if(u.hasTextLayer(d)){u.createAndAddNewEditor({x:0,y:0},!1,{methodOfCreation:t,boxes:h,anchorNode:r,anchorOffset:s,focusNode:i,focusOffset:o,text:a});break}}}addToAnnotationStorage(t){!t.isEmpty()&&P(this,Kd)&&!P(this,Kd).has(t.id)&&P(this,Kd).setValue(t.id,t)}blur(){if(this.isShiftKeyDown=!1,P(this,Th)&&(V(this,Th,!1),K(this,tt,fN).call(this,"main_toolbar")),!this.hasSelection)return;const{activeElement:t}=document;for(const n of P(this,Zn))if(n.div.contains(t)){V(this,Lg,[n,t]),n._focusEventsAllowed=!1;break}}focus(){if(!P(this,Lg))return;const[t,n]=P(this,Lg);V(this,Lg,null),n.addEventListener("focusin",()=>{t._focusEventsAllowed=!0},{once:!0,signal:this._signal}),n.focus()}addEditListeners(){K(this,tt,a5).call(this),K(this,tt,l5).call(this)}removeEditListeners(){K(this,tt,Nde).call(this),K(this,tt,c5).call(this)}dragOver(t){for(const{type:n}of t.dataTransfer.items)for(const r of P(this,Jl))if(r.isHandlingMimeForPasting(n)){t.dataTransfer.dropEffect="copy",t.preventDefault();return}}drop(t){for(const n of t.dataTransfer.items)for(const r of P(this,Jl))if(r.isHandlingMimeForPasting(n.type)){r.paste(n,this.currentLayer),t.preventDefault();return}}copy(t){var r;if(t.preventDefault(),(r=P(this,Oa))==null||r.commitOrRemove(),!this.hasSelection)return;const n=[];for(const s of P(this,Zn)){const i=s.serialize(!0);i&&n.push(i)}n.length!==0&&t.clipboardData.setData("application/pdfjs",JSON.stringify(n))}cut(t){this.copy(t),this.delete()}paste(t){t.preventDefault();const{clipboardData:n}=t;for(const i of n.items)for(const o of P(this,Jl))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){nn(`paste: "${i.message}".`);return}if(!Array.isArray(r))return;this.unselectAll();const s=this.currentLayer;try{const i=[];for(const c of r){const d=s.deserialize(c);if(!d)return;i.push(d)}const o=()=>{for(const c of i)K(this,tt,u5).call(this,c);K(this,tt,d5).call(this,i)},a=()=>{for(const c of i)c.remove()};this.addCommands({cmd:o,undo:a,mustExec:!0})}catch(i){nn(`paste: "${i.message}".`)}}keydown(t){!this.isShiftKeyDown&&t.key==="Shift"&&(this.isShiftKeyDown=!0),P(this,Ai)!==_n.NONE&&!this.isEditorHandlingKeyboard&&bb._keyboardManager.exec(this,t)}keyup(t){this.isShiftKeyDown&&t.key==="Shift"&&(this.isShiftKeyDown=!1,P(this,Th)&&(V(this,Th,!1),K(this,tt,fN).call(this,"main_toolbar")))}onEditingAction({name:t}){switch(t){case"undo":case"redo":case"delete":case"selectAll":this[t]();break;case"highlightSelection":this.highlightSelection("context_menu");break}}setEditingState(t){t?(K(this,tt,Rde).call(this),K(this,tt,l5).call(this),K(this,tt,vo).call(this,{isEditing:P(this,Ai)!==_n.NONE,isEmpty:K(this,tt,y1).call(this),hasSomethingToUndo:P(this,Zl).hasSomethingToUndo(),hasSomethingToRedo:P(this,Zl).hasSomethingToRedo(),hasSelectedEditor:!1})):(K(this,tt,Pde).call(this),K(this,tt,c5).call(this),K(this,tt,vo).call(this,{isEditing:!1}),this.disableUserSelect(!1))}registerEditorTypes(t){if(!P(this,Jl)){V(this,Jl,t);for(const n of P(this,Jl))K(this,tt,ih).call(this,n.defaultPropertiesToUpdate)}}getId(){return P(this,Tk).id}get currentLayer(){return P(this,Ei).get(P(this,i0))}getLayer(t){return P(this,Ei).get(t)}get currentPageIndex(){return P(this,i0)}addLayer(t){P(this,Ei).set(t.pageIndex,t),P(this,kh)?t.enable():t.disable()}removeLayer(t){P(this,Ei).delete(t.pageIndex)}updateMode(t,n=null,r=!1){if(P(this,Ai)!==t){if(V(this,Ai,t),t===_n.NONE){this.setEditingState(!1),K(this,tt,Dde).call(this);return}this.setEditingState(!0),K(this,tt,kde).call(this),this.unselectAll();for(const s of P(this,Ei).values())s.updateMode(t);if(!n&&r){this.addNewEditorFromKeyboard();return}if(n){for(const s of P(this,Ws).values())if(s.annotationElementId===n){this.setSelected(s),s.enterInEditMode();break}}}}addNewEditorFromKeyboard(){this.currentLayer.canCreateNewEmptyEditor()&&this.currentLayer.addNewEditor()}updateToolbar(t){t!==P(this,Ai)&&this._eventBus.dispatch("switchannotationeditormode",{source:this,mode:t})}updateParams(t,n){var r;if(P(this,Jl)){switch(t){case zt.CREATE:this.currentLayer.addNewEditor();return;case zt.HIGHLIGHT_DEFAULT_COLOR:(r=P(this,nE))==null||r.updateColor(n);break;case zt.HIGHLIGHT_SHOW_ALL:this._eventBus.dispatch("reporttelemetry",{source:this,details:{type:"editing",data:{type:"highlight",action:"toggle_visibility"}}}),(P(this,rE)||V(this,rE,new Map)).set(t,n),this.showAllEditors("highlight",n);break}for(const s of P(this,Zn))s.updateParams(t,n);for(const s of P(this,Jl))s.updateDefaultParams(t,n)}}showAllEditors(t,n,r=!1){var i;for(const o of P(this,Ws).values())o.editorType===t&&o.show(n);(((i=P(this,rE))==null?void 0:i.get(zt.HIGHLIGHT_SHOW_ALL))??!0)!==n&&K(this,tt,ih).call(this,[[zt.HIGHLIGHT_SHOW_ALL,n]])}enableWaiting(t=!1){if(P(this,tE)!==t){V(this,tE,t);for(const n of P(this,Ei).values())t?n.disableClick():n.enableClick(),n.div.classList.toggle("waiting",t)}}getEditors(t){const n=[];for(const r of P(this,Ws).values())r.pageIndex===t&&n.push(r);return n}getEditor(t){return P(this,Ws).get(t)}addEditor(t){P(this,Ws).set(t.id,t)}removeEditor(t){var n;t.div.contains(document.activeElement)&&(P(this,Qc)&&clearTimeout(P(this,Qc)),V(this,Qc,setTimeout(()=>{this.focusMainContainer(),V(this,Qc,null)},0))),P(this,Ws).delete(t.id),this.unselect(t),(!t.annotationElementId||!P(this,Mg).has(t.annotationElementId))&&((n=P(this,Kd))==null||n.remove(t.id))}addDeletedAnnotationElement(t){P(this,Mg).add(t.annotationElementId),this.addChangedExistingAnnotation(t),t.deleted=!0}isDeletedAnnotationElement(t){return P(this,Mg).has(t)}removeDeletedAnnotationElement(t){P(this,Mg).delete(t.annotationElementId),this.removeChangedExistingAnnotation(t),t.deleted=!1}setActiveEditor(t){P(this,Oa)!==t&&(V(this,Oa,t),t&&K(this,tt,ih).call(this,t.propertiesToUpdate))}updateUI(t){P(this,tt,Ode)===t&&K(this,tt,ih).call(this,t.propertiesToUpdate)}toggleSelected(t){if(P(this,Zn).has(t)){P(this,Zn).delete(t),t.unselect(),K(this,tt,vo).call(this,{hasSelectedEditor:this.hasSelection});return}P(this,Zn).add(t),t.select(),K(this,tt,ih).call(this,t.propertiesToUpdate),K(this,tt,vo).call(this,{hasSelectedEditor:!0})}setSelected(t){for(const n of P(this,Zn))n!==t&&n.unselect();P(this,Zn).clear(),P(this,Zn).add(t),t.select(),K(this,tt,ih).call(this,t.propertiesToUpdate),K(this,tt,vo).call(this,{hasSelectedEditor:!0})}isSelected(t){return P(this,Zn).has(t)}get firstSelectedEditor(){return P(this,Zn).values().next().value}unselect(t){t.unselect(),P(this,Zn).delete(t),K(this,tt,vo).call(this,{hasSelectedEditor:this.hasSelection})}get hasSelection(){return P(this,Zn).size!==0}get isEnterHandled(){return P(this,Zn).size===1&&this.firstSelectedEditor.isEnterHandled}undo(){P(this,Zl).undo(),K(this,tt,vo).call(this,{hasSomethingToUndo:P(this,Zl).hasSomethingToUndo(),hasSomethingToRedo:!0,isEmpty:K(this,tt,y1).call(this)})}redo(){P(this,Zl).redo(),K(this,tt,vo).call(this,{hasSomethingToUndo:!0,hasSomethingToRedo:P(this,Zl).hasSomethingToRedo(),isEmpty:K(this,tt,y1).call(this)})}addCommands(t){P(this,Zl).add(t),K(this,tt,vo).call(this,{hasSomethingToUndo:!0,hasSomethingToRedo:!1,isEmpty:K(this,tt,y1).call(this)})}delete(){if(this.commitOrRemove(),!this.hasSelection)return;const t=[...P(this,Zn)],n=()=>{for(const s of t)s.remove()},r=()=>{for(const s of t)K(this,tt,u5).call(this,s)};this.addCommands({cmd:n,undo:r,mustExec:!0})}commitOrRemove(){var t;(t=P(this,Oa))==null||t.commitOrRemove()}hasSomethingToControl(){return P(this,Oa)||this.hasSelection}selectAll(){for(const t of P(this,Zn))t.commit();K(this,tt,d5).call(this,P(this,Ws).values())}unselectAll(){if(!(P(this,Oa)&&(P(this,Oa).commitOrRemove(),P(this,Ai)!==_n.NONE))&&this.hasSelection){for(const t of P(this,Zn))t.unselect();P(this,Zn).clear(),K(this,tt,vo).call(this,{hasSelectedEditor:!1})}}translateSelectedEditors(t,n,r=!1){if(r||this.commitOrRemove(),!this.hasSelection)return;P(this,Dh)[0]+=t,P(this,Dh)[1]+=n;const[s,i]=P(this,Dh),o=[...P(this,Zn)],a=1e3;P(this,Jc)&&clearTimeout(P(this,Jc)),V(this,Jc,setTimeout(()=>{V(this,Jc,null),P(this,Dh)[0]=P(this,Dh)[1]=0,this.addCommands({cmd:()=>{for(const c of o)P(this,Ws).has(c.id)&&c.translateInPage(s,i)},undo:()=>{for(const c of o)P(this,Ws).has(c.id)&&c.translateInPage(-s,-i)},mustExec:!1})},a));for(const c of o)c.translateInPage(t,n)}setUpDragSession(){if(this.hasSelection){this.disableUserSelect(!0),V(this,Xc,new Map);for(const t of P(this,Zn))P(this,Xc).set(t,{savedX:t.x,savedY:t.y,savedPageIndex:t.pageIndex,newX:0,newY:0,newPageIndex:-1})}}endDragSession(){if(!P(this,Xc))return!1;this.disableUserSelect(!1);const t=P(this,Xc);V(this,Xc,null);let n=!1;for(const[{x:s,y:i,pageIndex:o},a]of t)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(P(this,Ws).has(s.id)){const c=P(this,Ei).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 t)r(s,i,o,a)},undo:()=>{for(const[s,{savedX:i,savedY:o,savedPageIndex:a}]of t)r(s,i,o,a)},mustExec:!0}),!0}dragSelectedEditors(t,n){if(P(this,Xc))for(const r of P(this,Xc).keys())r.drag(t,n)}rebuild(t){if(t.parent===null){const n=this.getLayer(t.pageIndex);n?(n.changeParent(t),n.addOrRebuild(t)):(this.addEditor(t),this.addToAnnotationStorage(t),t.rebuild())}else t.parent.addOrRebuild(t)}get isEditorHandlingKeyboard(){var t;return((t=this.getActive())==null?void 0:t.shouldGetKeyboardEvents())||P(this,Zn).size===1&&this.firstSelectedEditor.shouldGetKeyboardEvents()}isActive(t){return P(this,Oa)===t}getActive(){return P(this,Oa)}getMode(){return P(this,Ai)}get imageManager(){return An(this,"imageManager",new s5)}getSelectionBoxes(t){if(!t)return null;const n=document.getSelection();for(let d=0,h=n.rangeCount;d<h;d++)if(!t.contains(n.getRangeAt(d).commonAncestorContainer))return null;const{x:r,y:s,width:i,height:o}=t.getBoundingClientRect();let a;switch(t.getAttribute("data-main-rotation")){case"90":a=(d,h,u,f)=>({x:(h-s)/o,y:1-(d+u-r)/i,width:f/o,height:u/i});break;case"180":a=(d,h,u,f)=>({x:1-(d+u-r)/i,y:1-(h+f-s)/o,width:u/i,height:f/o});break;case"270":a=(d,h,u,f)=>({x:1-(h+f-s)/o,y:(d-r)/i,width:f/o,height:u/i});break;default:a=(d,h,u,f)=>({x:(d-r)/i,y:(h-s)/o,width:u/i,height:f/o});break}const c=[];for(let d=0,h=n.rangeCount;d<h;d++){const u=n.getRangeAt(d);if(!u.collapsed)for(const{x:f,y:g,width:v,height:m}of u.getClientRects())v===0||m===0||c.push(a(f,g,v,m))}return c.length===0?null:c}addChangedExistingAnnotation({annotationElementId:t,id:n}){(P(this,s0)||V(this,s0,new Map)).set(t,n)}removeChangedExistingAnnotation({annotationElementId:t}){var n;(n=P(this,s0))==null||n.delete(t)}renderAnnotationElement(t){var s;const n=(s=P(this,s0))==null?void 0:s.get(t.data.id);if(!n)return;const r=P(this,Kd).getRawValue(n);r&&(P(this,Ai)===_n.NONE&&!r.hasBeenModified||r.renderAnnotationElement(t))}};n0=new WeakMap,Oa=new WeakMap,Ws=new WeakMap,Ei=new WeakMap,r0=new WeakMap,Kd=new WeakMap,s0=new WeakMap,Zl=new WeakMap,i0=new WeakMap,Mg=new WeakMap,Xc=new WeakMap,Jl=new WeakMap,Ig=new WeakMap,JC=new WeakMap,eE=new WeakMap,Qc=new WeakMap,o0=new WeakMap,Th=new WeakMap,Zc=new WeakMap,Tk=new WeakMap,kh=new WeakMap,tE=new WeakMap,Lg=new WeakMap,nE=new WeakMap,a0=new WeakMap,Ai=new WeakMap,Zn=new WeakMap,Yd=new WeakMap,jg=new WeakMap,rE=new WeakMap,sE=new WeakMap,iE=new WeakMap,oE=new WeakMap,aE=new WeakMap,lE=new WeakMap,cE=new WeakMap,uE=new WeakMap,dE=new WeakMap,fE=new WeakMap,hE=new WeakMap,pE=new WeakMap,mE=new WeakMap,Dh=new WeakMap,Jc=new WeakMap,Xd=new WeakMap,gE=new WeakMap,tt=new WeakSet,dN=function({anchorNode:t}){return t.nodeType===Node.TEXT_NODE?t.parentElement:t},Cde=function(){const t=document.getSelection();if(!t||t.isCollapsed)return;const r=K(this,tt,dN).call(this,t).closest(".textLayer"),s=this.getSelectionBoxes(r);s&&(P(this,Zc)||V(this,Zc,new _Ue(this)),P(this,Zc).show(r,s,this.direction==="ltr"))},Ede=function(){var i,o,a;const t=document.getSelection();if(!t||t.isCollapsed){P(this,Yd)&&((i=P(this,Zc))==null||i.hide(),V(this,Yd,null),K(this,tt,vo).call(this,{hasSelectedText:!1}));return}const{anchorNode:n}=t;if(n===P(this,Yd))return;if(!K(this,tt,dN).call(this,t).closest(".textLayer")){P(this,Yd)&&((o=P(this,Zc))==null||o.hide(),V(this,Yd,null),K(this,tt,vo).call(this,{hasSelectedText:!1}));return}if((a=P(this,Zc))==null||a.hide(),V(this,Yd,n),K(this,tt,vo).call(this,{hasSelectedText:!0}),!(P(this,Ai)!==_n.HIGHLIGHT&&P(this,Ai)!==_n.NONE)&&(P(this,Ai)===_n.HIGHLIGHT&&this.showAllEditors("highlight",!0,!0),V(this,Th,this.isShiftKeyDown),!this.isShiftKeyDown)){const c=this._signal,d=h=>{h.type==="pointerup"&&h.button!==0||(window.removeEventListener("pointerup",d),window.removeEventListener("blur",d),h.type==="pointerup"&&K(this,tt,fN).call(this,"main_toolbar"))};window.addEventListener("pointerup",d,{signal:c}),window.addEventListener("blur",d,{signal:c})}},fN=function(t=""){P(this,Ai)===_n.HIGHLIGHT?this.highlightSelection(t):P(this,JC)&&K(this,tt,Cde).call(this)},Ade=function(){document.addEventListener("selectionchange",K(this,tt,Ede).bind(this),{signal:this._signal})},Rde=function(){const t=this._signal;window.addEventListener("focus",P(this,iE),{signal:t}),window.addEventListener("blur",P(this,sE),{signal:t})},Pde=function(){window.removeEventListener("focus",P(this,iE)),window.removeEventListener("blur",P(this,sE))},a5=function(){const t=this._signal;window.addEventListener("keydown",P(this,cE),{signal:t}),window.addEventListener("keyup",P(this,uE),{signal:t})},Nde=function(){window.removeEventListener("keydown",P(this,cE)),window.removeEventListener("keyup",P(this,uE))},l5=function(){const t=this._signal;document.addEventListener("copy",P(this,oE),{signal:t}),document.addEventListener("cut",P(this,aE),{signal:t}),document.addEventListener("paste",P(this,lE),{signal:t})},c5=function(){document.removeEventListener("copy",P(this,oE)),document.removeEventListener("cut",P(this,aE)),document.removeEventListener("paste",P(this,lE))},Tde=function(){const t=this._signal;document.addEventListener("dragover",this.dragOver.bind(this),{signal:t}),document.addEventListener("drop",this.drop.bind(this),{signal:t})},vo=function(t){Object.entries(t).some(([r,s])=>P(this,mE)[r]!==s)&&(this._eventBus.dispatch("annotationeditorstateschanged",{source:this,details:Object.assign(P(this,mE),t)}),P(this,Ai)===_n.HIGHLIGHT&&t.hasSelectedEditor===!1&&K(this,tt,ih).call(this,[[zt.HIGHLIGHT_FREE,!0]]))},ih=function(t){this._eventBus.dispatch("annotationeditorparamschanged",{source:this,details:t})},kde=function(){if(!P(this,kh)){V(this,kh,!0);for(const t of P(this,Ei).values())t.enable();for(const t of P(this,Ws).values())t.enable()}},Dde=function(){if(this.unselectAll(),P(this,kh)){V(this,kh,!1);for(const t of P(this,Ei).values())t.disable();for(const t of P(this,Ws).values())t.disable()}},u5=function(t){const n=P(this,Ei).get(t.pageIndex);n?n.addOrRebuild(t):(this.addEditor(t),this.addToAnnotationStorage(t))},Ode=function(){let t=null;for(t of P(this,Zn));return t},y1=function(){if(P(this,Ws).size===0)return!0;if(P(this,Ws).size===1)for(const t of P(this,Ws).values())return t.isEmpty();return!1},d5=function(t){for(const n of P(this,Zn))n.unselect();P(this,Zn).clear();for(const n of t)n.isEmpty()||(P(this,Zn).add(n),n.select());K(this,tt,vo).call(this,{hasSelectedEditor:this.hasSelection})},Be(bb,"TRANSLATE_SMALL",1),Be(bb,"TRANSLATE_BIG",10);let Qv=bb;var Qd,Zd,ec,Jd,Ma,l0,tc,vE,f5;const zd=class zd{constructor(t){G(this,vE);G(this,Qd,"");G(this,Zd,!1);G(this,ec,null);G(this,Jd,null);G(this,Ma,null);G(this,l0,!1);G(this,tc,null);V(this,tc,t)}static initialize(t){zd._l10nPromise||(zd._l10nPromise=t)}async render(){const t=V(this,ec,document.createElement("button"));t.className="altText";const n=await zd._l10nPromise.get("pdfjs-editor-alt-text-button-label");t.textContent=n,t.setAttribute("aria-label",n),t.tabIndex="0";const r=P(this,tc)._uiManager._signal;t.addEventListener("contextmenu",ia,{signal:r}),t.addEventListener("pointerdown",i=>i.stopPropagation(),{signal:r});const s=i=>{i.preventDefault(),P(this,tc)._uiManager.editAltText(P(this,tc))};return t.addEventListener("click",s,{capture:!0,signal:r}),t.addEventListener("keydown",i=>{i.target===t&&i.key==="Enter"&&(V(this,l0,!0),s(i))},{signal:r}),await K(this,vE,f5).call(this),t}finish(){P(this,ec)&&(P(this,ec).focus({focusVisible:P(this,l0)}),V(this,l0,!1))}isEmpty(){return!P(this,Qd)&&!P(this,Zd)}get data(){return{altText:P(this,Qd),decorative:P(this,Zd)}}set data({altText:t,decorative:n}){P(this,Qd)===t&&P(this,Zd)===n||(V(this,Qd,t),V(this,Zd,n),K(this,vE,f5).call(this))}toggle(t=!1){P(this,ec)&&(!t&&P(this,Ma)&&(clearTimeout(P(this,Ma)),V(this,Ma,null)),P(this,ec).disabled=!t)}destroy(){var t;(t=P(this,ec))==null||t.remove(),V(this,ec,null),V(this,Jd,null)}};Qd=new WeakMap,Zd=new WeakMap,ec=new WeakMap,Jd=new WeakMap,Ma=new WeakMap,l0=new WeakMap,tc=new WeakMap,vE=new WeakSet,f5=async function(){var s;const t=P(this,ec);if(!t)return;if(!P(this,Qd)&&!P(this,Zd)){t.classList.remove("done"),(s=P(this,Jd))==null||s.remove();return}t.classList.add("done"),zd._l10nPromise.get("pdfjs-editor-alt-text-edit-button-label").then(i=>{t.setAttribute("aria-label",i)});let n=P(this,Jd);if(!n){V(this,Jd,n=document.createElement("span")),n.className="tooltip",n.setAttribute("role","tooltip");const i=n.id=`alt-text-tooltip-${P(this,tc).id}`;t.setAttribute("aria-describedby",i);const o=100,a=P(this,tc)._uiManager._signal;a.addEventListener("abort",()=>{clearTimeout(P(this,Ma)),V(this,Ma,null)},{once:!0}),t.addEventListener("mouseenter",()=>{V(this,Ma,setTimeout(()=>{V(this,Ma,null),P(this,Jd).classList.add("show"),P(this,tc)._reportTelemetry({action:"alt_text_tooltip"})},o))},{signal:a}),t.addEventListener("mouseleave",()=>{var c;P(this,Ma)&&(clearTimeout(P(this,Ma)),V(this,Ma,null)),(c=P(this,Jd))==null||c.classList.remove("show")},{signal:a})}n.innerText=P(this,Zd)?await zd._l10nPromise.get("pdfjs-editor-alt-text-decorative-tooltip"):P(this,Qd),n.parentNode||t.append(n);const r=P(this,tc).getImageForAltText();r==null||r.setAttribute("aria-describedby",n.id)},Be(zd,"_l10nPromise",null);let ak=zd;var $g,nc,Qi,c0,Fg,Ri,zg,u0,d0,Zi,yE,Bg,Oh,bE,Ug,ef,eu,f0,h0,ol,xE,kk,on,h5,_E,p5,m5,Mde,Ide,g5,v5,y5,Lde,jde,$de,Fde,b5,b1;const vr=class vr{constructor(t){G(this,on);G(this,$g,null);G(this,nc,null);G(this,Qi,null);G(this,c0,!1);G(this,Fg,!1);G(this,Ri,null);G(this,zg,null);G(this,u0,this.focusin.bind(this));G(this,d0,this.focusout.bind(this));G(this,Zi,null);G(this,yE,"");G(this,Bg,!1);G(this,Oh,null);G(this,bE,!1);G(this,Ug,!1);G(this,ef,!1);G(this,eu,null);G(this,f0,0);G(this,h0,0);G(this,ol,null);Be(this,"_initialOptions",Object.create(null));Be(this,"_isVisible",!0);Be(this,"_uiManager",null);Be(this,"_focusEventsAllowed",!0);Be(this,"_l10nPromise",null);G(this,xE,!1);G(this,kk,vr._zIndex++);this.constructor===vr&&lr("Cannot initialize AnnotationEditor."),this.parent=t.parent,this.id=t.id,this.width=this.height=null,this.pageIndex=t.parent.pageIndex,this.name=t.name,this.div=null,this._uiManager=t.uiManager,this.annotationElementId=null,this._willKeepAspectRatio=!1,this._initialOptions.isCentered=t.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=t.x/a,this.y=t.y/c,this.isAttachedToDOM=!1,this.deleted=!1}static get _resizerKeyboardManager(){const t=vr.prototype._resizeWithKeyboard,n=Qv.TRANSLATE_SMALL,r=Qv.TRANSLATE_BIG;return An(this,"_resizerKeyboardManager",new bR([[["ArrowLeft","mac+ArrowLeft"],t,{args:[-n,0]}],[["ctrl+ArrowLeft","mac+shift+ArrowLeft"],t,{args:[-r,0]}],[["ArrowRight","mac+ArrowRight"],t,{args:[n,0]}],[["ctrl+ArrowRight","mac+shift+ArrowRight"],t,{args:[r,0]}],[["ArrowUp","mac+ArrowUp"],t,{args:[0,-n]}],[["ctrl+ArrowUp","mac+shift+ArrowUp"],t,{args:[0,-r]}],[["ArrowDown","mac+ArrowDown"],t,{args:[0,n]}],[["ctrl+ArrowDown","mac+shift+ArrowDown"],t,{args:[0,r]}],[["Escape","mac+Escape"],vr.prototype._stopResizingWithKeyboard]]))}get editorType(){return Object.getPrototypeOf(this).constructor._type}static get _defaultLineColor(){return An(this,"_defaultLineColor",this._colorManager.getHexCode("CanvasText"))}static deleteAnnotationElement(t){const n=new EUe({id:t.parent.getNextId(),parent:t.parent,uiManager:t._uiManager});n.annotationElementId=t.annotationElementId,n.deleted=!0,n._uiManager.addToAnnotationStorage(n)}static initialize(t,n,r){if(vr._l10nPromise||(vr._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,t.get(i.replaceAll(/([A-Z])/g,o=>`-${o.toLowerCase()}`))]))),r!=null&&r.strings)for(const i of r.strings)vr._l10nPromise.set(i,t.get(i));if(vr._borderLineWidth!==-1)return;const s=getComputedStyle(document.documentElement);vr._borderLineWidth=parseFloat(s.getPropertyValue("--outline-width"))||0}static updateDefaultParams(t,n){}static get defaultPropertiesToUpdate(){return[]}static isHandlingMimeForPasting(t){return!1}static paste(t,n){lr("Not implemented")}get propertiesToUpdate(){return[]}get _isDraggable(){return P(this,xE)}set _isDraggable(t){var n;V(this,xE,t),(n=this.div)==null||n.classList.toggle("draggable",t)}get isEnterHandled(){return!0}center(){const[t,n]=this.pageDimensions;switch(this.parentRotation){case 90:this.x-=this.height*n/(t*2),this.y+=this.width*t/(n*2);break;case 180:this.x+=this.width/2,this.y+=this.height/2;break;case 270:this.x+=this.height*n/(t*2),this.y-=this.width*t/(n*2);break;default:this.x-=this.width/2,this.y-=this.height/2;break}this.fixAndSetPosition()}addCommands(t){this._uiManager.addCommands(t)}get currentLayer(){return this._uiManager.currentLayer}setInBackground(){this.div.style.zIndex=0}setInForeground(){this.div.style.zIndex=P(this,kk)}setParent(t){t!==null?(this.pageIndex=t.pageIndex,this.pageDimensions=t.pageDimensions):K(this,on,b1).call(this),this.parent=t}focusin(t){this._focusEventsAllowed&&(P(this,Bg)?V(this,Bg,!1):this.parent.setSelected(this))}focusout(t){var r;if(!this._focusEventsAllowed||!this.isAttachedToDOM)return;const n=t.relatedTarget;n!=null&&n.closest(`#${this.id}`)||(t.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(t,n,r,s){const[i,o]=this.parentDimensions;[r,s]=this.screenToPageTranslation(r,s),this.x=(t+r)/i,this.y=(n+s)/o,this.fixAndSetPosition()}translate(t,n){K(this,on,h5).call(this,this.parentDimensions,t,n)}translateInPage(t,n){P(this,Oh)||V(this,Oh,[this.x,this.y]),K(this,on,h5).call(this,this.pageDimensions,t,n),this.div.scrollIntoView({block:"nearest"})}drag(t,n){P(this,Oh)||V(this,Oh,[this.x,this.y]);const[r,s]=this.parentDimensions;if(this.x+=t/r,this.y+=n/s,this.parent&&(this.x<0||this.x>1||this.y<0||this.y>1)){const{x:d,y:h}=this.div.getBoundingClientRect();this.parent.findNewParent(this,d,h)&&(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!!P(this,Oh)&&(P(this,Oh)[0]!==this.x||P(this,Oh)[1]!==this.y)}getBaseTranslation(){const[t,n]=this.parentDimensions,{_borderLineWidth:r}=vr,s=r/t,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(t=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(t){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,d]=this.getBaseTranslation();s+=c,i+=d;const{style:h}=this.div;h.left=`${(100*s).toFixed(2)}%`,h.top=`${(100*i).toFixed(2)}%`,this.moveInDOM()}screenToPageTranslation(t,n){var r;return K(r=vr,_E,p5).call(r,t,n,this.parentRotation)}pageTranslationToScreen(t,n){var r;return K(r=vr,_E,p5).call(r,t,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:t,pageDimensions:[n,r]}=this,s=n*t,i=r*t;return Jo.isCSSRoundSupported?[Math.round(s),Math.round(i)]:[s,i]}setDims(t,n){const[r,s]=this.parentDimensions;this.div.style.width=`${(100*t/r).toFixed(2)}%`,P(this,Fg)||(this.div.style.height=`${(100*n/s).toFixed(2)}%`)}fixDims(){const{style:t}=this.div,{height:n,width:r}=t,s=r.endsWith("%"),i=!P(this,Fg)&&n.endsWith("%");if(s&&i)return;const[o,a]=this.parentDimensions;s||(t.width=`${(100*parseFloat(r)/o).toFixed(2)}%`),!P(this,Fg)&&!i&&(t.height=`${(100*parseFloat(n)/a).toFixed(2)}%`)}getInitialTranslation(){return[0,0]}altTextFinish(){var t;(t=P(this,Qi))==null||t.finish()}async addEditToolbar(){return P(this,Zi)||P(this,Ug)?P(this,Zi):(V(this,Zi,new n5(this)),this.div.append(P(this,Zi).render()),P(this,Qi)&&P(this,Zi).addAltTextButton(await P(this,Qi).render()),P(this,Zi))}removeEditToolbar(){var t;P(this,Zi)&&(P(this,Zi).remove(),V(this,Zi,null),(t=P(this,Qi))==null||t.destroy())}getClientDimensions(){return this.div.getBoundingClientRect()}async addAltTextButton(){P(this,Qi)||(ak.initialize(vr._l10nPromise),V(this,Qi,new ak(this)),P(this,$g)&&(P(this,Qi).data=P(this,$g),V(this,$g,null)),await this.addEditToolbar())}get altTextData(){var t;return(t=P(this,Qi))==null?void 0:t.data}set altTextData(t){P(this,Qi)&&(P(this,Qi).data=t)}hasAltText(){var t;return!((t=P(this,Qi))!=null&&t.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=P(this,c0)?-1:0,this._isVisible||this.div.classList.add("hidden"),this.setInForeground();const t=this._uiManager._signal;this.div.addEventListener("focusin",P(this,u0),{signal:t}),this.div.addEventListener("focusout",P(this,d0),{signal:t});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),ok(this,this.div,["pointerdown"]),this.div}pointerdown(t){const{isMac:n}=Jo.platform;if(t.button!==0||t.ctrlKey&&n){t.preventDefault();return}if(V(this,Bg,!0),this._isDraggable){K(this,on,Lde).call(this,t);return}K(this,on,y5).call(this,t)}moveInDOM(){P(this,eu)&&clearTimeout(P(this,eu)),V(this,eu,setTimeout(()=>{var t;V(this,eu,null),(t=this.parent)==null||t.moveEditorInDOM(this)},0))}_setParentAndPosition(t,n,r){t.changeParent(this),this.x=n,this.y=r,this.fixAndSetPosition()}getRect(t,n,r=this.rotation){const s=this.parentScale,[i,o]=this.pageDimensions,[a,c]=this.pageTranslation,d=t/s,h=n/s,u=this.x*i,f=this.y*o,g=this.width*i,v=this.height*o;switch(r){case 0:return[u+d+a,o-f-h-v+c,u+d+g+a,o-f-h+c];case 90:return[u+h+a,o-f+d+c,u+h+v+a,o-f+d+g+c];case 180:return[u-d-g+a,o-f+h+c,u-d+a,o-f+h+v+c];case 270:return[u-h-v+a,o-f-d-g+c,u-h+a,o-f-d+c];default:throw new Error("Invalid rotation")}}getRectInCurrentCoords(t,n){const[r,s,i,o]=t,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(){V(this,Ug,!0)}disableEditMode(){V(this,Ug,!1)}isInEditMode(){return P(this,Ug)}shouldGetKeyboardEvents(){return P(this,ef)}needsToBeRebuilt(){return this.div&&!this.isAttachedToDOM}rebuild(){var n,r;const t=this._uiManager._signal;(n=this.div)==null||n.addEventListener("focusin",P(this,u0),{signal:t}),(r=this.div)==null||r.addEventListener("focusout",P(this,d0),{signal:t})}rotate(t){}serialize(t=!1,n=null){lr("An editor must be serializable")}static deserialize(t,n,r){const s=new this.prototype.constructor({parent:n,id:n.getNextId(),uiManager:r});s.rotation=t.rotation,V(s,$g,t.accessibilityData);const[i,o]=s.pageDimensions,[a,c,d,h]=s.getRectInCurrentCoords(t.rect,o);return s.x=a/i,s.y=c/o,s.width=d/i,s.height=h/o,s}get hasBeenModified(){return!!this.annotationElementId&&(this.deleted||this.serialize()!==null)}remove(){if(this.div.removeEventListener("focusin",P(this,u0)),this.div.removeEventListener("focusout",P(this,d0)),this.isEmpty()||this.commit(),this.parent?this.parent.remove(this):this._uiManager.removeEditor(this),P(this,eu)&&(clearTimeout(P(this,eu)),V(this,eu,null)),K(this,on,b1).call(this),this.removeEditToolbar(),P(this,ol)){for(const t of P(this,ol).values())clearTimeout(t);V(this,ol,null)}this.parent=null}get isResizable(){return!1}makeResizable(){this.isResizable&&(K(this,on,Mde).call(this),P(this,Ri).classList.remove("hidden"),ok(this,this.div,["keydown"]))}get toolbarPosition(){return null}keydown(t){if(!this.isResizable||t.target!==this.div||t.key!=="Enter")return;this._uiManager.setSelected(this),V(this,zg,{savedX:this.x,savedY:this.y,savedWidth:this.width,savedHeight:this.height});const n=P(this,Ri).children;if(!P(this,nc)){V(this,nc,Array.from(n));const o=K(this,on,jde).bind(this),a=K(this,on,$de).bind(this),c=this._uiManager._signal;for(const d of P(this,nc)){const h=d.getAttribute("data-resizer-name");d.setAttribute("role","spinbutton"),d.addEventListener("keydown",o,{signal:c}),d.addEventListener("blur",a,{signal:c}),d.addEventListener("focus",K(this,on,Fde).bind(this,h),{signal:c}),vr._l10nPromise.get(`pdfjs-editor-resizer-label-${h}`).then(u=>d.setAttribute("aria-label",u))}}const r=P(this,nc)[0];let s=0;for(const o of n){if(o===r)break;s++}const i=(360-this.rotation+this.parentRotation)%360/90*(P(this,nc).length/4);if(i!==s){if(i<s)for(let a=0;a<s-i;a++)P(this,Ri).append(P(this,Ri).firstChild);else if(i>s)for(let a=0;a<i-s;a++)P(this,Ri).firstChild.before(P(this,Ri).lastChild);let o=0;for(const a of n){const d=P(this,nc)[o++].getAttribute("data-resizer-name");vr._l10nPromise.get(`pdfjs-editor-resizer-label-${d}`).then(h=>a.setAttribute("aria-label",h))}}K(this,on,b5).call(this,0),V(this,ef,!0),P(this,Ri).firstChild.focus({focusVisible:!0}),t.preventDefault(),t.stopImmediatePropagation()}_resizeWithKeyboard(t,n){P(this,ef)&&K(this,on,v5).call(this,P(this,yE),{movementX:t,movementY:n})}_stopResizingWithKeyboard(){K(this,on,b1).call(this),this.div.focus()}select(){var t,n;if(this.makeResizable(),(t=this.div)==null||t.classList.add("selectedEditor"),!P(this,Zi)){this.addEditToolbar().then(()=>{var r,s;(r=this.div)!=null&&r.classList.contains("selectedEditor")&&((s=P(this,Zi))==null||s.show())});return}(n=P(this,Zi))==null||n.show()}unselect(){var t,n,r,s;(t=P(this,Ri))==null||t.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=P(this,Zi))==null||s.hide()}updateParams(t,n){}disableEditing(){}enableEditing(){}enterInEditMode(){}getImageForAltText(){return null}get contentDiv(){return this.div}get isEditing(){return P(this,bE)}set isEditing(t){V(this,bE,t),this.parent&&(t?(this.parent.setSelected(this),this.parent.setActiveEditor(this)):this.parent.setActiveEditor(null))}setAspectRatio(t,n){V(this,Fg,!0);const r=t/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(t,n=!1){if(n){P(this,ol)||V(this,ol,new Map);const{action:r}=t;let s=P(this,ol).get(r);s&&clearTimeout(s),s=setTimeout(()=>{this._reportTelemetry(t),P(this,ol).delete(r),P(this,ol).size===0&&V(this,ol,null)},vr._telemetryTimeout),P(this,ol).set(r,s);return}t.type||(t.type=this.editorType),this._uiManager._eventBus.dispatch("reporttelemetry",{source:this,details:{type:"editing",data:t}})}show(t=this._isVisible){this.div.classList.toggle("hidden",!t),this._isVisible=t}enable(){this.div&&(this.div.tabIndex=0),V(this,c0,!1)}disable(){this.div&&(this.div.tabIndex=-1),V(this,c0,!0)}renderAnnotationElement(t){let n=t.container.querySelector(".annotationContent");if(!n)n=document.createElement("div"),n.classList.add("annotationContent",this.editorType),t.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(t){const{firstChild:n}=t.container;n.nodeName==="DIV"&&n.classList.contains("annotationContent")&&n.remove()}};$g=new WeakMap,nc=new WeakMap,Qi=new WeakMap,c0=new WeakMap,Fg=new WeakMap,Ri=new WeakMap,zg=new WeakMap,u0=new WeakMap,d0=new WeakMap,Zi=new WeakMap,yE=new WeakMap,Bg=new WeakMap,Oh=new WeakMap,bE=new WeakMap,Ug=new WeakMap,ef=new WeakMap,eu=new WeakMap,f0=new WeakMap,h0=new WeakMap,ol=new WeakMap,xE=new WeakMap,kk=new WeakMap,on=new WeakSet,h5=function([t,n],r,s){[r,s]=this.screenToPageTranslation(r,s),this.x+=r/t,this.y+=s/n,this.fixAndSetPosition()},_E=new WeakSet,p5=function(t,n,r){switch(r){case 90:return[n,-t];case 180:return[-t,-n];case 270:return[-n,t];default:return[t,n]}},m5=function(t){switch(t){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]}},Mde=function(){if(P(this,Ri))return;V(this,Ri,document.createElement("div")),P(this,Ri).classList.add("resizers");const t=this._willKeepAspectRatio?["topLeft","topRight","bottomRight","bottomLeft"]:["topLeft","topMiddle","topRight","middleRight","bottomRight","bottomMiddle","bottomLeft","middleLeft"],n=this._uiManager._signal;for(const r of t){const s=document.createElement("div");P(this,Ri).append(s),s.classList.add("resizer",r),s.setAttribute("data-resizer-name",r),s.addEventListener("pointerdown",K(this,on,Ide).bind(this,r),{signal:n}),s.addEventListener("contextmenu",ia,{signal:n}),s.tabIndex=-1}this.div.prepend(P(this,Ri))},Ide=function(t,n){var m;n.preventDefault();const{isMac:r}=Jo.platform;if(n.button!==0||n.ctrlKey&&r)return;(m=P(this,Qi))==null||m.toggle(!1);const s=K(this,on,v5).bind(this,t),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",ia,{signal:o});const c=this.x,d=this.y,h=this.width,u=this.height,f=this.parent.div.style.cursor,g=this.div.style.cursor;this.div.style.cursor=this.parent.div.style.cursor=window.getComputedStyle(n.target).cursor;const v=()=>{var x;this.parent.togglePointerEvents(!0),(x=P(this,Qi))==null||x.toggle(!0),this._isDraggable=i,window.removeEventListener("pointerup",v),window.removeEventListener("blur",v),window.removeEventListener("pointermove",s,a),window.removeEventListener("contextmenu",ia),this.parent.div.style.cursor=f,this.div.style.cursor=g,K(this,on,g5).call(this,c,d,h,u)};window.addEventListener("pointerup",v,{signal:o}),window.addEventListener("blur",v,{signal:o})},g5=function(t,n,r,s){const i=this.x,o=this.y,a=this.width,c=this.height;i===t&&o===n&&a===r&&c===s||this.addCommands({cmd:()=>{this.width=a,this.height=c,this.x=i,this.y=o;const[d,h]=this.parentDimensions;this.setDims(d*a,h*c),this.fixAndSetPosition()},undo:()=>{this.width=r,this.height=s,this.x=t,this.y=n;const[d,h]=this.parentDimensions;this.setDims(d*r,h*s),this.fixAndSetPosition()},mustExec:!0})},v5=function(t,n){const[r,s]=this.parentDimensions,i=this.x,o=this.y,a=this.width,c=this.height,d=vr.MIN_SIZE/r,h=vr.MIN_SIZE/s,u=Y=>Math.round(Y*1e4)/1e4,f=K(this,on,m5).call(this,this.rotation),g=(Y,H)=>[f[0]*Y+f[2]*H,f[1]*Y+f[3]*H],v=K(this,on,m5).call(this,360-this.rotation),m=(Y,H)=>[v[0]*Y+v[2]*H,v[1]*Y+v[3]*H];let x,y,b=!1,w=!1;switch(t){case"topLeft":b=!0,x=(Y,H)=>[0,0],y=(Y,H)=>[Y,H];break;case"topMiddle":x=(Y,H)=>[Y/2,0],y=(Y,H)=>[Y/2,H];break;case"topRight":b=!0,x=(Y,H)=>[Y,0],y=(Y,H)=>[0,H];break;case"middleRight":w=!0,x=(Y,H)=>[Y,H/2],y=(Y,H)=>[0,H/2];break;case"bottomRight":b=!0,x=(Y,H)=>[Y,H],y=(Y,H)=>[0,0];break;case"bottomMiddle":x=(Y,H)=>[Y/2,H],y=(Y,H)=>[Y/2,0];break;case"bottomLeft":b=!0,x=(Y,H)=>[0,H],y=(Y,H)=>[Y,0];break;case"middleLeft":w=!0,x=(Y,H)=>[0,H/2],y=(Y,H)=>[Y,H/2];break}const E=x(a,c),R=y(a,c);let T=g(...R);const N=u(i+T[0]),A=u(o+T[1]);let D=1,O=1,[I,$]=this.screenToPageTranslation(n.movementX,n.movementY);if([I,$]=m(I/r,$/s),b){const Y=Math.hypot(a,c);D=O=Math.max(Math.min(Math.hypot(R[0]-E[0]-I,R[1]-E[1]-$)/Y,1/a,1/c),d/a,h/c)}else w?D=Math.max(d,Math.min(1,Math.abs(R[0]-E[0]-I)))/a:O=Math.max(h,Math.min(1,Math.abs(R[1]-E[1]-$)))/c;const F=u(a*D),B=u(c*O);T=g(...y(F,B));const W=N-T[0],Z=A-T[1];this.width=F,this.height=B,this.x=W,this.y=Z,this.setDims(r*F,s*B),this.fixAndSetPosition()},y5=function(t){const{isMac:n}=Jo.platform;t.ctrlKey&&!n||t.shiftKey||t.metaKey&&n?this.parent.toggleSelected(this):this.parent.setSelected(this)},Lde=function(t){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},V(this,f0,t.clientX),V(this,h0,t.clientY),s=a=>{const{clientX:c,clientY:d}=a,[h,u]=this.screenToPageTranslation(c-P(this,f0),d-P(this,h0));V(this,f0,c),V(this,h0,d),this._uiManager.dragSelectedEditors(h,u)},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)),V(this,Bg,!1),this._uiManager.endDragSession()||K(this,on,y5).call(this,t)};window.addEventListener("pointerup",o,{signal:i}),window.addEventListener("blur",o,{signal:i})},jde=function(t){vr._resizerKeyboardManager.exec(this,t)},$de=function(t){var n;P(this,ef)&&((n=t.relatedTarget)==null?void 0:n.parentNode)!==P(this,Ri)&&K(this,on,b1).call(this)},Fde=function(t){V(this,yE,P(this,ef)?t:"")},b5=function(t){if(P(this,nc))for(const n of P(this,nc))n.tabIndex=t},b1=function(){if(V(this,ef,!1),K(this,on,b5).call(this,-1),P(this,zg)){const{savedX:t,savedY:n,savedWidth:r,savedHeight:s}=P(this,zg);K(this,on,g5).call(this,t,n,r,s),V(this,zg,null)}},G(vr,_E),Be(vr,"_borderLineWidth",-1),Be(vr,"_colorManager",new o5),Be(vr,"_zIndex",1),Be(vr,"_telemetryTimeout",1e3);let tr=vr;class EUe extends tr{constructor(t){super(t),this.annotationElementId=t.annotationElementId,this.deleted=!0}serialize(){return{id:this.annotationElementId,deleted:!0,pageIndex:this.pageIndex}}}const UK=3285377520,rl=4294901760,Bc=65535;class zde{constructor(t){this.h1=t?t&4294967295:UK,this.h2=t?t&4294967295:UK}update(t){let n,r;if(typeof t=="string"){n=new Uint8Array(t.length*2),r=0;for(let m=0,x=t.length;m<x;m++){const y=t.charCodeAt(m);y<=255?n[r++]=y:(n[r++]=y>>>8,n[r++]=y&255)}}else if(ArrayBuffer.isView(t))n=t.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,d=this.h1,h=this.h2;const u=3432918353,f=461845907,g=u&Bc,v=f&Bc;for(let m=0;m<s;m++)m&1?(a=o[m],a=a*u&rl|a*g&Bc,a=a<<15|a>>>17,a=a*f&rl|a*v&Bc,d^=a,d=d<<13|d>>>19,d=d*5+3864292196):(c=o[m],c=c*u&rl|c*g&Bc,c=c<<15|c>>>17,c=c*f&rl|c*v&Bc,h^=c,h=h<<13|h>>>19,h=h*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*u&rl|a*g&Bc,a=a<<15|a>>>17,a=a*f&rl|a*v&Bc,s&1?d^=a:h^=a}this.h1=d,this.h2=h}hexdigest(){let t=this.h1,n=this.h2;return t^=n>>>1,t=t*3981806797&rl|t*36045&Bc,n=n*4283543511&rl|((n<<16|t>>>16)*2950163797&rl)>>>16,t^=n>>>1,t=t*444984403&rl|t*60499&Bc,n=n*3301882366&rl|((n<<16|t>>>16)*3120437893&rl)>>>16,t^=n>>>1,(t>>>0).toString(16).padStart(8,"0")+(n>>>0).toString(16).padStart(8,"0")}}const x5=Object.freeze({map:null,hash:"",transfer:void 0});var Vg,Pi,Dk,Bde;class MW{constructor(){G(this,Dk);G(this,Vg,!1);G(this,Pi,new Map);this.onSetModified=null,this.onResetModified=null,this.onAnnotationEditor=null}getValue(t,n){const r=P(this,Pi).get(t);return r===void 0?n:Object.assign(n,r)}getRawValue(t){return P(this,Pi).get(t)}remove(t){if(P(this,Pi).delete(t),P(this,Pi).size===0&&this.resetModified(),typeof this.onAnnotationEditor=="function"){for(const n of P(this,Pi).values())if(n instanceof tr)return;this.onAnnotationEditor(null)}}setValue(t,n){const r=P(this,Pi).get(t);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,P(this,Pi).set(t,n);s&&K(this,Dk,Bde).call(this),n instanceof tr&&typeof this.onAnnotationEditor=="function"&&this.onAnnotationEditor(n.constructor._type)}has(t){return P(this,Pi).has(t)}getAll(){return P(this,Pi).size>0?RW(P(this,Pi)):null}setAll(t){for(const[n,r]of Object.entries(t))this.setValue(n,r)}get size(){return P(this,Pi).size}resetModified(){P(this,Vg)&&(V(this,Vg,!1),typeof this.onResetModified=="function"&&this.onResetModified())}get print(){return new Ude(this)}get serializable(){if(P(this,Pi).size===0)return x5;const t=new Map,n=new zde,r=[],s=Object.create(null);let i=!1;for(const[o,a]of P(this,Pi)){const c=a instanceof tr?a.serialize(!1,s):a;c&&(t.set(o,c),n.update(`${o}:${JSON.stringify(c)}`),i||(i=!!c.bitmap))}if(i)for(const o of t.values())o.bitmap&&r.push(o.bitmap);return t.size>0?{map:t,hash:n.hexdigest(),transfer:r}:x5}get editorStats(){let t=null;const n=new Map;for(const r of P(this,Pi).values()){if(!(r instanceof tr))continue;const s=r.telemetryFinalData;if(!s)continue;const{type:i}=s;n.has(i)||n.set(i,Object.getPrototypeOf(r).constructor),t||(t=Object.create(null));const o=t[i]||(t[i]=new Map);for(const[a,c]of Object.entries(s)){if(a==="type")continue;let d=o.get(a);d||(d=new Map,o.set(a,d));const h=d.get(c)??0;d.set(c,h+1)}}for(const[r,s]of n)t[r]=s.computeTelemetryFinalData(t[r]);return t}}Vg=new WeakMap,Pi=new WeakMap,Dk=new WeakSet,Bde=function(){P(this,Vg)||(V(this,Vg,!0),typeof this.onSetModified=="function"&&this.onSetModified())};var wE;class Ude extends MW{constructor(n){super();G(this,wE);const{map:r,hash:s,transfer:i}=n.serializable,o=structuredClone(r,i?{transfer:i}:null);V(this,wE,{map:o,hash:s,transfer:i})}get print(){lr("Should not call PrintAnnotationStorage.print")}get serializable(){return P(this,wE)}}wE=new WeakMap;var p0;class AUe{constructor({ownerDocument:t=globalThis.document,styleElement:n=null}){G(this,p0,new Set);this._document=t,this.nativeFontFaces=new Set,this.styleElement=null,this.loadingRequests=[],this.loadTestFontId=0}addNativeFontFace(t){this.nativeFontFaces.add(t),this._document.fonts.add(t)}removeNativeFontFace(t){this.nativeFontFaces.delete(t),this._document.fonts.delete(t)}insertRule(t){this.styleElement||(this.styleElement=this._document.createElement("style"),this._document.documentElement.getElementsByTagName("head")[0].append(this.styleElement));const n=this.styleElement.sheet;n.insertRule(t,n.cssRules.length)}clear(){for(const t of this.nativeFontFaces)this._document.fonts.delete(t);this.nativeFontFaces.clear(),P(this,p0).clear(),this.styleElement&&(this.styleElement.remove(),this.styleElement=null)}async loadSystemFont({systemFontInfo:t,_inspectFont:n}){if(!(!t||P(this,p0).has(t.loadedName))){if(ni(!this.disableFontFace,"loadSystemFont shouldn't be called when `disableFontFace` is set."),this.isFontLoadingAPISupported){const{loadedName:r,src:s,style:i}=t,o=new FontFace(r,s,i);this.addNativeFontFace(o);try{await o.load(),P(this,p0).add(r),n==null||n(t)}catch{nn(`Cannot load system font: ${t.baseFontName}, installing it could help to improve PDF rendering.`),this.removeNativeFontFace(o)}return}lr("Not implemented: loadSystemFont without the Font Loading API.")}}async bind(t){if(t.attached||t.missingFile&&!t.systemFontInfo)return;if(t.attached=!0,t.systemFontInfo){await this.loadSystemFont(t);return}if(this.isFontLoadingAPISupported){const r=t.createNativeFontFace();if(r){this.addNativeFontFace(r);try{await r.loaded}catch(s){throw nn(`Failed to load font '${r.family}': '${s}'.`),t.disableFontFace=!0,s}}return}const n=t.createFontFaceRule();if(n){if(this.insertRule(n),this.isSyncFontLoadingSupported)return;await new Promise(r=>{const s=this._queueLoadingCallback(r);this._prepareFontLoadEvent(t,s)})}}get isFontLoadingAPISupported(){var n;const t=!!((n=this._document)!=null&&n.fonts);return An(this,"isFontLoadingAPISupported",t)}get isSyncFontLoadingSupported(){let t=!1;return(ro||typeof navigator<"u"&&typeof(navigator==null?void 0:navigator.userAgent)=="string"&&/Mozilla\/5.0.*?rv:\d+.*? Gecko/.test(navigator.userAgent))&&(t=!0),An(this,"isSyncFontLoadingSupported",t)}_queueLoadingCallback(t){function n(){for(ni(!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:t};return r.push(s),s}get _loadTestFont(){const t=atob("T1RUTwALAIAAAwAwQ0ZGIDHtZg4AAAOYAAAAgUZGVE1lkzZwAAAEHAAAABxHREVGABQAFQAABDgAAAAeT1MvMlYNYwkAAAEgAAAAYGNtYXABDQLUAAACNAAAAUJoZWFk/xVFDQAAALwAAAA2aGhlYQdkA+oAAAD0AAAAJGhtdHgD6AAAAAAEWAAAAAZtYXhwAAJQAAAAARgAAAAGbmFtZVjmdH4AAAGAAAAAsXBvc3T/hgAzAAADeAAAACAAAQAAAAEAALZRFsRfDzz1AAsD6AAAAADOBOTLAAAAAM4KHDwAAAAAA+gDIQAAAAgAAgAAAAAAAAABAAADIQAAAFoD6AAAAAAD6AABAAAAAAAAAAAAAAAAAAAAAQAAUAAAAgAAAAQD6AH0AAUAAAKKArwAAACMAooCvAAAAeAAMQECAAACAAYJAAAAAAAAAAAAAQAAAAAAAAAAAAAAAFBmRWQAwAAuAC4DIP84AFoDIQAAAAAAAQAAAAAAAAAAACAAIAABAAAADgCuAAEAAAAAAAAAAQAAAAEAAAAAAAEAAQAAAAEAAAAAAAIAAQAAAAEAAAAAAAMAAQAAAAEAAAAAAAQAAQAAAAEAAAAAAAUAAQAAAAEAAAAAAAYAAQAAAAMAAQQJAAAAAgABAAMAAQQJAAEAAgABAAMAAQQJAAIAAgABAAMAAQQJAAMAAgABAAMAAQQJAAQAAgABAAMAAQQJAAUAAgABAAMAAQQJAAYAAgABWABYAAAAAAAAAwAAAAMAAAAcAAEAAAAAADwAAwABAAAAHAAEACAAAAAEAAQAAQAAAC7//wAAAC7////TAAEAAAAAAAABBgAAAQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAEAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAMAAAAAAAD/gwAyAAAAAQAAAAAAAAAAAAAAAAAAAAABAAQEAAEBAQJYAAEBASH4DwD4GwHEAvgcA/gXBIwMAYuL+nz5tQXkD5j3CBLnEQACAQEBIVhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYAAABAQAADwACAQEEE/t3Dov6fAH6fAT+fPp8+nwHDosMCvm1Cvm1DAz6fBQAAAAAAAABAAAAAMmJbzEAAAAAzgTjFQAAAADOBOQpAAEAAAAAAAAADAAUAAQAAAABAAAAAgABAAAAAAAAAAAD6AAAAAAAAA==");return An(this,"_loadTestFont",t)}_prepareFontLoadEvent(t,n){function r(E,R){return E.charCodeAt(R)<<24|E.charCodeAt(R+1)<<16|E.charCodeAt(R+2)<<8|E.charCodeAt(R+3)&255}function s(E,R,T,N){const A=E.substring(0,R),D=E.substring(R+T);return A+N+D}let i,o;const a=this._document.createElement("canvas");a.width=1,a.height=1;const c=a.getContext("2d");let d=0;function h(E,R){if(++d>30){nn("Load test font never loaded."),R();return}if(c.font="30px "+E,c.fillText(".",0,20),c.getImageData(0,0,1,1).data[3]>0){R();return}setTimeout(h.bind(null,E,R))}const u=`lt${Date.now()}${this.loadTestFontId++}`;let f=this._loadTestFont;f=s(f,976,u.length,u);const v=16,m=1482184792;let x=r(f,v);for(i=0,o=u.length-3;i<o;i+=4)x=x-m+r(u,i)|0;i<u.length&&(x=x-m+r(u+"XXX",i)|0),f=s(f,v,4,cUe(x));const y=`url(data:font/opentype;base64,${btoa(f)});`,b=`@font-face {font-family:"${u}";src:${y}}`;this.insertRule(b);const w=this._document.createElement("div");w.style.visibility="hidden",w.style.width=w.style.height="10px",w.style.position="absolute",w.style.top=w.style.left="0px";for(const E of[t.loadedName,u]){const R=this._document.createElement("span");R.textContent="Hi",R.style.fontFamily=E,w.append(R)}this._document.body.append(w),h(u,()=>{w.remove(),n.complete()})}}p0=new WeakMap;class RUe{constructor(t,{disableFontFace:n=!1,inspectFont:r=null}){this.compiledGlyphs=Object.create(null);for(const s in t)this[s]=t[s];this.disableFontFace=n===!0,this._inspectFont=r}createNativeFontFace(){var n;if(!this.data||this.disableFontFace)return null;let t;if(!this.cssFontInfo)t=new FontFace(this.loadedName,this.data,{});else{const r={weight:this.cssFontInfo.fontWeight};this.cssFontInfo.italicAngle&&(r.style=`oblique ${this.cssFontInfo.italicAngle}deg`),t=new FontFace(this.cssFontInfo.fontFamily,this.data,r)}return(n=this._inspectFont)==null||n.call(this,this),t}createFontFaceRule(){var s;if(!this.data||this.disableFontFace)return null;const t=cde(this.data),n=`url(data:${this.mimetype};base64,${btoa(t)});`;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(t,n){if(this.compiledGlyphs[n]!==void 0)return this.compiledGlyphs[n];let r;try{r=t.get(this.loadedName+"_path_"+n)}catch(i){nn(`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 Dd.BEZIER_CURVE_TO:{const[a,c,d,h,u,f]=r.slice(i,i+6);s.push(g=>g.bezierCurveTo(a,c,d,h,u,f)),i+=6}break;case Dd.MOVE_TO:{const[a,c]=r.slice(i,i+2);s.push(d=>d.moveTo(a,c)),i+=2}break;case Dd.LINE_TO:{const[a,c]=r.slice(i,i+2);s.push(d=>d.lineTo(a,c)),i+=2}break;case Dd.QUADRATIC_CURVE_TO:{const[a,c,d,h]=r.slice(i,i+4);s.push(u=>u.quadraticCurveTo(a,c,d,h)),i+=4}break;case Dd.RESTORE:s.push(a=>a.restore());break;case Dd.SAVE:s.push(a=>a.save());break;case Dd.SCALE:ni(s.length===2,"Scale command is only valid at the third position.");break;case Dd.TRANSFORM:{const[a,c,d,h,u,f]=r.slice(i,i+6);s.push(g=>g.transform(a,c,d,h,u,f)),i+=6}break;case Dd.TRANSLATE:{const[a,c]=r.slice(i,i+2);s.push(d=>d.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,d=s.length;c<d;c++)s[c](o)}}}if(ro){var _5=Promise.withResolvers(),Y1=null;(async()=>{const t=await AP(()=>Promise.resolve().then(()=>N1),[]),n=await AP(()=>Promise.resolve().then(()=>N1),void 0),r=await AP(()=>Promise.resolve().then(()=>N1),void 0),s=await AP(()=>Promise.resolve().then(()=>N1),void 0);let i,o;return new Map(Object.entries({fs:t,http:n,https:r,url:s,canvas:i,path2d:o}))})().then(t=>{Y1=t,_5.resolve()},t=>{nn(`loadPackages: ${t}`),Y1=new Map,_5.resolve()})}class Mu{static get promise(){return _5.promise}static get(t){return Y1==null?void 0:Y1.get(t)}}const Vde=function(e){return Mu.get("fs").promises.readFile(e).then(n=>new Uint8Array(n))};class PUe extends UO{}class NUe extends ik{_createCanvas(t,n){return Mu.get("canvas").createCanvas(t,n)}}class TUe extends VO{_fetchData(t,n){return Vde(t).then(r=>({cMapData:r,compressionType:n}))}}class kUe extends HO{_fetchData(t){return Vde(t)}}const Ro={FILL:"Fill",STROKE:"Stroke",SHADING:"Shading"};function w5(e,t){if(!t)return;const n=t[2]-t[0],r=t[3]-t[1],s=new Path2D;s.rect(t[0],t[1],n,r),e.clip(s)}class xR{constructor(){this.constructor===xR&&lr("Cannot initialize BaseShadingPattern.")}getPattern(){lr("Abstract method `getPattern` called.")}}class DUe extends xR{constructor(t){super(),this._type=t[1],this._bbox=t[2],this._colorStops=t[3],this._p0=t[4],this._p1=t[5],this._r0=t[6],this._r1=t[7],this.matrix=null}_createGradient(t){let n;this._type==="axial"?n=t.createLinearGradient(this._p0[0],this._p0[1],this._p1[0],this._p1[1]):this._type==="radial"&&(n=t.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(t,n,r,s){let i;if(s===Ro.STROKE||s===Ro.FILL){const o=n.current.getClippedPathBoundingBox(s,es(t))||[0,0,0,0],a=Math.ceil(o[2]-o[0])||1,c=Math.ceil(o[3]-o[1])||1,d=n.cachedCanvases.getCanvas("pattern",a,c,!0),h=d.context;h.clearRect(0,0,h.canvas.width,h.canvas.height),h.beginPath(),h.rect(0,0,h.canvas.width,h.canvas.height),h.translate(-o[0],-o[1]),r=xt.transform(r,[1,0,0,1,o[0],o[1]]),h.transform(...n.baseTransform),this.matrix&&h.transform(...this.matrix),w5(h,this._bbox),h.fillStyle=this._createGradient(h),h.fill(),i=t.createPattern(d.canvas,"no-repeat");const u=new DOMMatrix(r);i.setTransform(u)}else w5(t,this._bbox),i=this._createGradient(t);return i}}function cz(e,t,n,r,s,i,o,a){const c=t.coords,d=t.colors,h=e.data,u=e.width*4;let f;c[n+1]>c[r+1]&&(f=n,n=r,r=f,f=i,i=o,o=f),c[r+1]>c[s+1]&&(f=r,r=s,s=f,f=o,o=a,a=f),c[n+1]>c[r+1]&&(f=n,n=r,r=f,f=i,i=o,o=f);const g=(c[n]+t.offsetX)*t.scaleX,v=(c[n+1]+t.offsetY)*t.scaleY,m=(c[r]+t.offsetX)*t.scaleX,x=(c[r+1]+t.offsetY)*t.scaleY,y=(c[s]+t.offsetX)*t.scaleX,b=(c[s+1]+t.offsetY)*t.scaleY;if(v>=b)return;const w=d[i],E=d[i+1],R=d[i+2],T=d[o],N=d[o+1],A=d[o+2],D=d[a],O=d[a+1],I=d[a+2],$=Math.round(v),F=Math.round(b);let B,W,Z,Y,H,se,he,re;for(let J=$;J<=F;J++){if(J<x){const ve=J<v?0:(v-J)/(v-x);B=g-(g-m)*ve,W=w-(w-T)*ve,Z=E-(E-N)*ve,Y=R-(R-A)*ve}else{let ve;J>b?ve=1:x===b?ve=0:ve=(x-J)/(x-b),B=m-(m-y)*ve,W=T-(T-D)*ve,Z=N-(N-O)*ve,Y=A-(A-I)*ve}let te;J<v?te=0:J>b?te=1:te=(v-J)/(v-b),H=g-(g-y)*te,se=w-(w-D)*te,he=E-(E-O)*te,re=R-(R-I)*te;const ae=Math.round(Math.min(B,H)),be=Math.round(Math.max(B,H));let xe=u*J+ae*4;for(let ve=ae;ve<=be;ve++)te=(B-ve)/(B-H),te<0?te=0:te>1&&(te=1),h[xe++]=W-(W-se)*te|0,h[xe++]=Z-(Z-he)*te|0,h[xe++]=Y-(Y-re)*te|0,h[xe++]=255}}function OUe(e,t,n){const r=t.coords,s=t.colors;let i,o;switch(t.type){case"lattice":const a=t.verticesPerRow,c=Math.floor(r.length/a)-1,d=a-1;for(i=0;i<c;i++){let h=i*a;for(let u=0;u<d;u++,h++)cz(e,n,r[h],r[h+1],r[h+a],s[h],s[h+1],s[h+a]),cz(e,n,r[h+a+1],r[h+1],r[h+a],s[h+a+1],s[h+1],s[h+a])}break;case"triangles":for(i=0,o=r.length;i<o;i+=3)cz(e,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 MUe extends xR{constructor(t){super(),this._coords=t[2],this._colors=t[3],this._figures=t[4],this._bounds=t[5],this._bbox=t[7],this._background=t[8],this.matrix=null}_createMeshCanvas(t,n,r){const a=Math.floor(this._bounds[0]),c=Math.floor(this._bounds[1]),d=Math.ceil(this._bounds[2])-a,h=Math.ceil(this._bounds[3])-c,u=Math.min(Math.ceil(Math.abs(d*t[0]*1.1)),3e3),f=Math.min(Math.ceil(Math.abs(h*t[1]*1.1)),3e3),g=d/u,v=h/f,m={coords:this._coords,colors:this._colors,offsetX:-a,offsetY:-c,scaleX:1/g,scaleY:1/v},x=u+2*2,y=f+2*2,b=r.getCanvas("mesh",x,y,!1),w=b.context,E=w.createImageData(u,f);if(n){const T=E.data;for(let N=0,A=T.length;N<A;N+=4)T[N]=n[0],T[N+1]=n[1],T[N+2]=n[2],T[N+3]=255}for(const T of this._figures)OUe(E,T,m);return w.putImageData(E,2,2),{canvas:b.canvas,offsetX:a-2*g,offsetY:c-2*v,scaleX:g,scaleY:v}}getPattern(t,n,r,s){w5(t,this._bbox);let i;if(s===Ro.SHADING)i=xt.singularValueDecompose2dScale(es(t));else if(i=xt.singularValueDecompose2dScale(n.baseTransform),this.matrix){const a=xt.singularValueDecompose2dScale(this.matrix);i=[i[0]*a[0],i[1]*a[1]]}const o=this._createMeshCanvas(i,s===Ro.SHADING?null:this._background,n.cachedCanvases);return s!==Ro.SHADING&&(t.setTransform(...n.baseTransform),this.matrix&&t.transform(...this.matrix)),t.translate(o.offsetX,o.offsetY),t.scale(o.scaleX,o.scaleY),t.createPattern(o.canvas,"no-repeat")}}class IUe extends xR{getPattern(){return"hotpink"}}function LUe(e){switch(e[0]){case"RadialAxial":return new DUe(e);case"Mesh":return new MUe(e);case"Dummy":return new IUe}throw new Error(`Unknown IR type: ${e[0]}`)}const VK={COLORED:1,UNCOLORED:2},Ok=class Ok{constructor(t,n,r,s,i){this.operatorList=t[2],this.matrix=t[3],this.bbox=t[4],this.xstep=t[5],this.ystep=t[6],this.paintType=t[7],this.tilingType=t[8],this.color=n,this.ctx=r,this.canvasGraphicsFactory=s,this.baseTransform=i}createPatternCanvas(t){const n=this.operatorList,r=this.bbox,s=this.xstep,i=this.ystep,o=this.paintType,a=this.tilingType,c=this.color,d=this.canvasGraphicsFactory;FO("TilingType: "+a);const h=r[0],u=r[1],f=r[2],g=r[3],v=xt.singularValueDecompose2dScale(this.matrix),m=xt.singularValueDecompose2dScale(this.baseTransform),x=[v[0]*m[0],v[1]*m[1]],y=this.getSizeAndScale(s,this.ctx.canvas.width,x[0]),b=this.getSizeAndScale(i,this.ctx.canvas.height,x[1]),w=t.cachedCanvases.getCanvas("pattern",y.size,b.size,!0),E=w.context,R=d.createCanvasGraphics(E);R.groupLevel=t.groupLevel,this.setFillAndStrokeStyleToContext(R,o,c);let T=h,N=u,A=f,D=g;return h<0&&(T=0,A+=Math.abs(h)),u<0&&(N=0,D+=Math.abs(u)),E.translate(-(y.scale*T),-(b.scale*N)),R.transform(y.scale,0,0,b.scale,0,0),E.save(),this.clipBbox(R,T,N,A,D),R.baseTransform=es(R.ctx),R.executeOperatorList(n),R.endDrawing(),{canvas:w.canvas,scaleX:y.scale,scaleY:b.scale,offsetX:T,offsetY:N}}getSizeAndScale(t,n,r){t=Math.abs(t);const s=Math.max(Ok.MAX_PATTERN_SIZE,n);let i=Math.ceil(t*r);return i>=s?i=s:r=i/t,{scale:r,size:i}}clipBbox(t,n,r,s,i){const o=s-n,a=i-r;t.ctx.rect(n,r,o,a),t.current.updateRectMinMax(es(t.ctx),[n,r,s,i]),t.clip(),t.endPath()}setFillAndStrokeStyleToContext(t,n,r){const s=t.ctx,i=t.current;switch(n){case VK.COLORED:const o=this.ctx;s.fillStyle=o.fillStyle,s.strokeStyle=o.strokeStyle,i.fillColor=o.fillStyle,i.strokeColor=o.strokeStyle;break;case VK.UNCOLORED:const a=xt.makeHexColor(r[0],r[1],r[2]);s.fillStyle=a,s.strokeStyle=a,i.fillColor=a,i.strokeColor=a;break;default:throw new lUe(`Unsupported paint type: ${n}`)}}getPattern(t,n,r,s){let i=r;s!==Ro.SHADING&&(i=xt.transform(i,n.baseTransform),this.matrix&&(i=xt.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=t.createPattern(o.canvas,"repeat");return c.setTransform(a),c}};Be(Ok,"MAX_PATTERN_SIZE",3e3);let S5=Ok;function jUe({src:e,srcPos:t=0,dest:n,width:r,height:s,nonBlackColor:i=4294967295,inverseDecode:o=!1}){const a=Jo.isLittleEndian?4278190080:255,[c,d]=o?[i,a]:[a,i],h=r>>3,u=r&7,f=e.length;n=new Uint32Array(n.buffer);let g=0;for(let v=0;v<s;v++){for(const x=t+h;t<x;t++){const y=t<f?e[t]:255;n[g++]=y&128?d:c,n[g++]=y&64?d:c,n[g++]=y&32?d:c,n[g++]=y&16?d:c,n[g++]=y&8?d:c,n[g++]=y&4?d:c,n[g++]=y&2?d:c,n[g++]=y&1?d:c}if(u===0)continue;const m=t<f?e[t++]:255;for(let x=0;x<u;x++)n[g++]=m&1<<7-x?d:c}return{srcPos:t,destPos:g}}const HK=16,WK=100,$Ue=15,qK=10,GK=1e3,qo=16;function FUe(e,t){if(e._removeMirroring)throw new Error("Context is already forwarding operations.");e.__originalSave=e.save,e.__originalRestore=e.restore,e.__originalRotate=e.rotate,e.__originalScale=e.scale,e.__originalTranslate=e.translate,e.__originalTransform=e.transform,e.__originalSetTransform=e.setTransform,e.__originalResetTransform=e.resetTransform,e.__originalClip=e.clip,e.__originalMoveTo=e.moveTo,e.__originalLineTo=e.lineTo,e.__originalBezierCurveTo=e.bezierCurveTo,e.__originalRect=e.rect,e.__originalClosePath=e.closePath,e.__originalBeginPath=e.beginPath,e._removeMirroring=()=>{e.save=e.__originalSave,e.restore=e.__originalRestore,e.rotate=e.__originalRotate,e.scale=e.__originalScale,e.translate=e.__originalTranslate,e.transform=e.__originalTransform,e.setTransform=e.__originalSetTransform,e.resetTransform=e.__originalResetTransform,e.clip=e.__originalClip,e.moveTo=e.__originalMoveTo,e.lineTo=e.__originalLineTo,e.bezierCurveTo=e.__originalBezierCurveTo,e.rect=e.__originalRect,e.closePath=e.__originalClosePath,e.beginPath=e.__originalBeginPath,delete e._removeMirroring},e.save=function(){t.save(),this.__originalSave()},e.restore=function(){t.restore(),this.__originalRestore()},e.translate=function(r,s){t.translate(r,s),this.__originalTranslate(r,s)},e.scale=function(r,s){t.scale(r,s),this.__originalScale(r,s)},e.transform=function(r,s,i,o,a,c){t.transform(r,s,i,o,a,c),this.__originalTransform(r,s,i,o,a,c)},e.setTransform=function(r,s,i,o,a,c){t.setTransform(r,s,i,o,a,c),this.__originalSetTransform(r,s,i,o,a,c)},e.resetTransform=function(){t.resetTransform(),this.__originalResetTransform()},e.rotate=function(r){t.rotate(r),this.__originalRotate(r)},e.clip=function(r){t.clip(r),this.__originalClip(r)},e.moveTo=function(n,r){t.moveTo(n,r),this.__originalMoveTo(n,r)},e.lineTo=function(n,r){t.lineTo(n,r),this.__originalLineTo(n,r)},e.bezierCurveTo=function(n,r,s,i,o,a){t.bezierCurveTo(n,r,s,i,o,a),this.__originalBezierCurveTo(n,r,s,i,o,a)},e.rect=function(n,r,s,i){t.rect(n,r,s,i),this.__originalRect(n,r,s,i)},e.closePath=function(){t.closePath(),this.__originalClosePath()},e.beginPath=function(){t.beginPath(),this.__originalBeginPath()}}class zUe{constructor(t){this.canvasFactory=t,this.cache=Object.create(null)}getCanvas(t,n,r){let s;return this.cache[t]!==void 0?(s=this.cache[t],this.canvasFactory.reset(s,n,r)):(s=this.canvasFactory.create(n,r),this.cache[t]=s),s}delete(t){delete this.cache[t]}clear(){for(const t in this.cache){const n=this.cache[t];this.canvasFactory.destroy(n),delete this.cache[t]}}}function RP(e,t,n,r,s,i,o,a,c,d){const[h,u,f,g,v,m]=es(e);if(u===0&&f===0){const b=o*h+v,w=Math.round(b),E=a*g+m,R=Math.round(E),T=(o+c)*h+v,N=Math.abs(Math.round(T)-w)||1,A=(a+d)*g+m,D=Math.abs(Math.round(A)-R)||1;return e.setTransform(Math.sign(h),0,0,Math.sign(g),w,R),e.drawImage(t,n,r,s,i,0,0,N,D),e.setTransform(h,u,f,g,v,m),[N,D]}if(h===0&&g===0){const b=a*f+v,w=Math.round(b),E=o*u+m,R=Math.round(E),T=(a+d)*f+v,N=Math.abs(Math.round(T)-w)||1,A=(o+c)*u+m,D=Math.abs(Math.round(A)-R)||1;return e.setTransform(0,Math.sign(u),Math.sign(f),0,w,R),e.drawImage(t,n,r,s,i,0,0,D,N),e.setTransform(h,u,f,g,v,m),[D,N]}e.drawImage(t,n,r,s,i,o,a,c,d);const x=Math.hypot(h,u),y=Math.hypot(f,g);return[x*c,y*d]}function BUe(e){const{width:t,height:n}=e;if(t>GK||n>GK)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=t+1;let o=new Uint8Array(i*(n+1)),a,c,d;const h=t+7&-8;let u=new Uint8Array(h*n),f=0;for(const y of e.data){let b=128;for(;b>0;)u[f++]=y&b?0:255,b>>=1}let g=0;for(f=0,u[f]!==0&&(o[0]=1,++g),c=1;c<t;c++)u[f]!==u[f+1]&&(o[c]=u[f]?2:1,++g),f++;for(u[f]!==0&&(o[c]=2,++g),a=1;a<n;a++){f=a*h,d=a*i,u[f-h]!==u[f]&&(o[d]=u[f]?1:8,++g);let y=(u[f]?4:0)+(u[f-h]?8:0);for(c=1;c<t;c++)y=(y>>2)+(u[f+1]?4:0)+(u[f-h+1]?8:0),s[y]&&(o[d+c]=s[y],++g),f++;if(u[f-h]!==u[f]&&(o[d+c]=u[f]?2:4,++g),g>r)return null}for(f=h*(n-1),d=a*i,u[f]!==0&&(o[d]=8,++g),c=1;c<t;c++)u[f]!==u[f+1]&&(o[d+c]=u[f]?4:8,++g),f++;if(u[f]!==0&&(o[d+c]=4,++g),g>r)return null;const v=new Int32Array([0,i,-1,0,-i,0,0,0,1]),m=new Path2D;for(a=0;g&&a<=n;a++){let y=a*i;const b=y+t;for(;y<b&&!o[y];)y++;if(y===b)continue;m.moveTo(y%i,a);const w=y;let E=o[y];do{const R=v[E];do y+=R;while(!o[y]);const T=o[y];T!==5&&T!==10?(E=T,o[y]=0):(E=T&51*E>>4,o[y]&=E>>2|E<<2),m.lineTo(y%i,y/i|0),o[y]||--g}while(w!==y);--a}return u=null,o=null,function(y){y.save(),y.scale(1/t,-1/n),y.translate(0,-n),y.fill(m),y.beginPath(),y.restore()}}class KK{constructor(t,n){this.alphaIsShape=!1,this.fontSize=0,this.fontSizeScale=1,this.textMatrix=ade,this.textMatrixScale=1,this.fontMatrix=YU,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=qi.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,t,n])}clone(){const t=Object.create(this);return t.clipBox=this.clipBox.slice(),t}setCurrentPoint(t,n){this.x=t,this.y=n}updatePathMinMax(t,n,r){[n,r]=xt.applyTransform([n,r],t),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(t,n){const r=xt.applyTransform(n,t),s=xt.applyTransform(n.slice(2),t),i=xt.applyTransform([n[0],n[3]],t),o=xt.applyTransform([n[2],n[1]],t);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(t,n){xt.scaleMinMax(t,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(t,n,r,s,i,o,a,c,d,h){const u=xt.bezierBoundingBox(n,r,s,i,o,a,c,d,h);h||this.updateRectMinMax(t,u)}getPathBoundingBox(t=Ro.FILL,n=null){const r=[this.minX,this.minY,this.maxX,this.maxY];if(t===Ro.STROKE){n||lr("Stroke bounding box must include transform.");const s=xt.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 t=xt.intersect(this.clipBox,this.getPathBoundingBox());this.startNewPathAndClipBox(t||[0,0,0,0])}isEmptyClip(){return this.minX===1/0}startNewPathAndClipBox(t){this.clipBox=t,this.minX=1/0,this.minY=1/0,this.maxX=0,this.maxY=0}getClippedPathBoundingBox(t=Ro.FILL,n=null){return xt.intersect(this.clipBox,this.getPathBoundingBox(t,n))}}function YK(e,t){if(typeof ImageData<"u"&&t instanceof ImageData){e.putImageData(t,0,0);return}const n=t.height,r=t.width,s=n%qo,i=(n-s)/qo,o=s===0?i:i+1,a=e.createImageData(r,qo);let c=0,d;const h=t.data,u=a.data;let f,g,v,m;if(t.kind===aN.GRAYSCALE_1BPP){const x=h.byteLength,y=new Uint32Array(u.buffer,0,u.byteLength>>2),b=y.length,w=r+7>>3,E=4294967295,R=Jo.isLittleEndian?4278190080:255;for(f=0;f<o;f++){for(v=f<i?qo:s,d=0,g=0;g<v;g++){const T=x-c;let N=0;const A=T>w?r:T*8-7,D=A&-8;let O=0,I=0;for(;N<D;N+=8)I=h[c++],y[d++]=I&128?E:R,y[d++]=I&64?E:R,y[d++]=I&32?E:R,y[d++]=I&16?E:R,y[d++]=I&8?E:R,y[d++]=I&4?E:R,y[d++]=I&2?E:R,y[d++]=I&1?E:R;for(;N<A;N++)O===0&&(I=h[c++],O=128),y[d++]=I&O?E:R,O>>=1}for(;d<b;)y[d++]=0;e.putImageData(a,0,f*qo)}}else if(t.kind===aN.RGBA_32BPP){for(g=0,m=r*qo*4,f=0;f<i;f++)u.set(h.subarray(c,c+m)),c+=m,e.putImageData(a,0,g),g+=qo;f<o&&(m=r*s*4,u.set(h.subarray(c,c+m)),e.putImageData(a,0,g))}else if(t.kind===aN.RGB_24BPP)for(v=qo,m=r*v,f=0;f<o;f++){for(f>=i&&(v=s,m=r*v),d=0,g=m;g--;)u[d++]=h[c++],u[d++]=h[c++],u[d++]=h[c++],u[d++]=255;e.putImageData(a,0,f*qo)}else throw new Error(`bad image kind: ${t.kind}`)}function XK(e,t){if(t.bitmap){e.drawImage(t.bitmap,0,0);return}const n=t.height,r=t.width,s=n%qo,i=(n-s)/qo,o=s===0?i:i+1,a=e.createImageData(r,qo);let c=0;const d=t.data,h=a.data;for(let u=0;u<o;u++){const f=u<i?qo:s;({srcPos:c}=jUe({src:d,srcPos:c,dest:h,width:r,height:f,nonBlackColor:0})),e.putImageData(a,0,u*qo)}}function QS(e,t){const n=["strokeStyle","fillStyle","fillRule","globalAlpha","lineWidth","lineCap","lineJoin","miterLimit","globalCompositeOperation","font","filter"];for(const r of n)e[r]!==void 0&&(t[r]=e[r]);e.setLineDash!==void 0&&(t.setLineDash(e.getLineDash()),t.lineDashOffset=e.lineDashOffset)}function PP(e){if(e.strokeStyle=e.fillStyle="#000000",e.fillRule="nonzero",e.globalAlpha=1,e.lineWidth=1,e.lineCap="butt",e.lineJoin="miter",e.miterLimit=10,e.globalCompositeOperation="source-over",e.font="10px sans-serif",e.setLineDash!==void 0&&(e.setLineDash([]),e.lineDashOffset=0),!ro){const{filter:t}=e;t!=="none"&&t!==""&&(e.filter="none")}}function QK(e,t){if(t)return!0;const n=xt.singularValueDecompose2dScale(e);n[0]=Math.fround(n[0]),n[1]=Math.fround(n[1]);const r=Math.fround((globalThis.devicePixelRatio||1)*wp.PDF_TO_CSS_UNITS);return n[0]<=r&&n[1]<=r}const UUe=["butt","round","square"],VUe=["miter","round","bevel"],HUe={},ZK={};var Cp,C5,E5;const aq=class aq{constructor(t,n,r,s,i,{optionalContentConfig:o,markedContentStack:a=null},c,d){G(this,Cp);this.ctx=t,this.current=new KK(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 zUe(this.canvasFactory),this.cachedPatterns=new Map,this.annotationCanvasMap=c,this.viewportScale=1,this.outputScaleX=1,this.outputScaleY=1,this.pageColors=d,this._cachedScaleForStroking=[-1,0],this._cachedGetSinglePixelWidth=null,this._cachedBitmapsMap=new Map}getObject(t,n=null){return typeof t=="string"?t.startsWith("g_")?this.commonObjs.get(t):this.objs.get(t):n}beginDrawing({transform:t,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(...es(this.compositeCtx))}this.ctx.save(),PP(this.ctx),t&&(this.ctx.transform(...t),this.outputScaleX=t[0],this.outputScaleY=t[0]),this.ctx.transform(...n.transform),this.viewportScale=n.scale,this.baseTransform=es(this.ctx)}executeOperatorList(t,n,r,s){const i=t.argsArray,o=t.fnArray;let a=n||0;const c=i.length;if(c===a)return a;const d=c-a>qK&&typeof r=="function",h=d?Date.now()+$Ue:0;let u=0;const f=this.commonObjs,g=this.objs;let v;for(;;){if(s!==void 0&&a===s.nextBreakPoint)return s.breakIt(a,r),a;if(v=o[a],v!==Yl.dependency)this[v].apply(this,i[a]);else for(const m of i[a]){const x=m.startsWith("g_")?f:g;if(!x.has(m))return x.get(m,r),a}if(a++,a===c)return a;if(d&&++u>qK){if(Date.now()>h)return r(),a;u=0}}}endDrawing(){K(this,Cp,C5).call(this),this.cachedCanvases.clear(),this.cachedPatterns.clear();for(const t of this._cachedBitmapsMap.values()){for(const n of t.values())typeof HTMLCanvasElement<"u"&&n instanceof HTMLCanvasElement&&(n.width=n.height=0);t.clear()}this._cachedBitmapsMap.clear(),K(this,Cp,E5).call(this)}_scaleImage(t,n){const r=t.width,s=t.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,d="prescale1",h,u;for(;i>2&&a>1||o>2&&c>1;){let f=a,g=c;i>2&&a>1&&(f=a>=16384?Math.floor(a/2)-1||1:Math.ceil(a/2),i/=a/f),o>2&&c>1&&(g=c>=16384?Math.floor(c/2)-1||1:Math.ceil(c)/2,o/=c/g),h=this.cachedCanvases.getCanvas(d,f,g),u=h.context,u.clearRect(0,0,f,g),u.drawImage(t,0,0,a,c,0,0,f,g),t=h.canvas,a=f,c=g,d=d==="prescale1"?"prescale2":"prescale1"}return{img:t,paintWidth:a,paintHeight:c}}_createMaskCanvas(t){const n=this.ctx,{width:r,height:s}=t,i=this.current.fillColor,o=this.current.patternFill,a=es(n);let c,d,h,u;if((t.bitmap||t.data)&&t.count>1){const A=t.bitmap||t.data.buffer;d=JSON.stringify(o?a:[a.slice(0,4),i]),c=this._cachedBitmapsMap.get(A),c||(c=new Map,this._cachedBitmapsMap.set(A,c));const D=c.get(d);if(D&&!o){const O=Math.round(Math.min(a[0],a[2])+a[4]),I=Math.round(Math.min(a[1],a[3])+a[5]);return{canvas:D,offsetX:O,offsetY:I}}h=D}h||(u=this.cachedCanvases.getCanvas("maskCanvas",r,s),XK(u.context,t));let f=xt.transform(a,[1/r,0,0,-1/s,0,0]);f=xt.transform(f,[1,0,0,1,0,-s]);const[g,v,m,x]=xt.getAxialAlignedBoundingBox([0,0,r,s],f),y=Math.round(m-g)||1,b=Math.round(x-v)||1,w=this.cachedCanvases.getCanvas("fillCanvas",y,b),E=w.context,R=g,T=v;E.translate(-R,-T),E.transform(...f),h||(h=this._scaleImage(u.canvas,Od(E)),h=h.img,c&&o&&c.set(d,h)),E.imageSmoothingEnabled=QK(es(E),t.interpolate),RP(E,h,0,0,h.width,h.height,0,0,r,s),E.globalCompositeOperation="source-in";const N=xt.transform(Od(E),[1,0,0,1,-R,-T]);return E.fillStyle=o?i.getPattern(n,this,N,Ro.FILL):i,E.fillRect(0,0,r,s),c&&!o&&(this.cachedCanvases.delete("fillCanvas"),c.set(d,w.canvas)),{canvas:w.canvas,offsetX:Math.round(R),offsetY:Math.round(T)}}setLineWidth(t){t!==this.current.lineWidth&&(this._cachedScaleForStroking[0]=-1),this.current.lineWidth=t,this.ctx.lineWidth=t}setLineCap(t){this.ctx.lineCap=UUe[t]}setLineJoin(t){this.ctx.lineJoin=VUe[t]}setMiterLimit(t){this.ctx.miterLimit=t}setDash(t,n){const r=this.ctx;r.setLineDash!==void 0&&(r.setLineDash(t),r.lineDashOffset=n)}setRenderingIntent(t){}setFlatness(t){}setGState(t){for(const[n,r]of t)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 t=this.inSMaskMode;this.current.activeSMask&&!t?this.beginSMaskMode():!this.current.activeSMask&&t&&this.endSMaskMode()}beginSMaskMode(){if(this.inSMaskMode)throw new Error("beginSMaskMode called while already in smask mode");const t=this.ctx.canvas.width,n=this.ctx.canvas.height,r="smaskGroupAt"+this.groupLevel,s=this.cachedCanvases.getCanvas(r,t,n);this.suspendedCtx=this.ctx,this.ctx=s.context;const i=this.ctx;i.setTransform(...es(this.suspendedCtx)),QS(this.suspendedCtx,i),FUe(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(),QS(this.ctx,this.suspendedCtx),this.ctx=this.suspendedCtx,this.suspendedCtx=null}compose(t){if(!this.current.activeSMask)return;t?(t[0]=Math.floor(t[0]),t[1]=Math.floor(t[1]),t[2]=Math.ceil(t[2]),t[3]=Math.ceil(t[3])):t=[0,0,this.ctx.canvas.width,this.ctx.canvas.height];const n=this.current.activeSMask,r=this.suspendedCtx;this.composeSMask(r,n,this.ctx,t),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(t,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),t.save(),t.globalAlpha=1,t.globalCompositeOperation="source-over",t.setTransform(1,0,0,1,0,0),t.drawImage(r.canvas,0,0),t.restore())}genericComposeSMask(t,n,r,s,i,o,a,c,d,h,u){let f=t.canvas,g=c-h,v=d-u;if(o){if(g<0||v<0||g+r>f.width||v+s>f.height){const x=this.cachedCanvases.getCanvas("maskExtension",r,s),y=x.context;y.drawImage(f,-g,-v),o.some(b=>b!==0)&&(y.globalCompositeOperation="destination-atop",y.fillStyle=xt.makeHexColor(...o),y.fillRect(0,0,r,s),y.globalCompositeOperation="source-over"),f=x.canvas,g=v=0}else if(o.some(x=>x!==0)){t.save(),t.globalAlpha=1,t.setTransform(1,0,0,1,0,0);const x=new Path2D;x.rect(g,v,r,s),t.clip(x),t.globalCompositeOperation="destination-atop",t.fillStyle=xt.makeHexColor(...o),t.fillRect(g,v,r,s),t.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,d,r,s),n.clip(m),n.globalCompositeOperation="destination-in",n.drawImage(f,g,v,r,s,c,d,r,s),n.restore()}save(){this.inSMaskMode?(QS(this.ctx,this.suspendedCtx),this.suspendedCtx.save()):this.ctx.save();const t=this.current;this.stateStack.push(t),this.current=t.clone()}restore(){this.stateStack.length===0&&this.inSMaskMode&&this.endSMaskMode(),this.stateStack.length!==0&&(this.current=this.stateStack.pop(),this.inSMaskMode?(this.suspendedCtx.restore(),QS(this.suspendedCtx,this.ctx)):this.ctx.restore(),this.checkSMaskState(),this.pendingClip=null,this._cachedScaleForStroking[0]=-1,this._cachedGetSinglePixelWidth=null)}transform(t,n,r,s,i,o){this.ctx.transform(t,n,r,s,i,o),this._cachedScaleForStroking[0]=-1,this._cachedGetSinglePixelWidth=null}constructPath(t,n,r){const s=this.ctx,i=this.current;let o=i.x,a=i.y,c,d;const h=es(s),u=h[0]===0&&h[3]===0||h[1]===0&&h[2]===0,f=u?r.slice(0):null;for(let g=0,v=0,m=t.length;g<m;g++)switch(t[g]|0){case Yl.rectangle:o=n[v++],a=n[v++];const x=n[v++],y=n[v++],b=o+x,w=a+y;s.moveTo(o,a),x===0||y===0?s.lineTo(b,w):(s.lineTo(b,a),s.lineTo(b,w),s.lineTo(o,w)),u||i.updateRectMinMax(h,[o,a,b,w]),s.closePath();break;case Yl.moveTo:o=n[v++],a=n[v++],s.moveTo(o,a),u||i.updatePathMinMax(h,o,a);break;case Yl.lineTo:o=n[v++],a=n[v++],s.lineTo(o,a),u||i.updatePathMinMax(h,o,a);break;case Yl.curveTo:c=o,d=a,o=n[v+4],a=n[v+5],s.bezierCurveTo(n[v],n[v+1],n[v+2],n[v+3],o,a),i.updateCurvePathMinMax(h,c,d,n[v],n[v+1],n[v+2],n[v+3],o,a,f),v+=6;break;case Yl.curveTo2:c=o,d=a,s.bezierCurveTo(o,a,n[v],n[v+1],n[v+2],n[v+3]),i.updateCurvePathMinMax(h,c,d,o,a,n[v],n[v+1],n[v+2],n[v+3],f),o=n[v+2],a=n[v+3],v+=4;break;case Yl.curveTo3:c=o,d=a,o=n[v+2],a=n[v+3],s.bezierCurveTo(n[v],n[v+1],o,a,o,a),i.updateCurvePathMinMax(h,c,d,n[v],n[v+1],o,a,o,a,f),v+=4;break;case Yl.closePath:s.closePath();break}u&&i.updateScalingPathMinMax(h,f),i.setCurrentPoint(o,a)}closePath(){this.ctx.closePath()}stroke(t=!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,Od(n),Ro.STROKE),this.rescaleAndStroke(!1),n.restore()):this.rescaleAndStroke(!0)),t&&this.consumePath(this.current.getClippedPathBoundingBox()),n.globalAlpha=this.current.fillAlpha}closeStroke(){this.closePath(),this.stroke()}fill(t=!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,Od(n),Ro.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(),t&&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=HUe}eoClip(){this.pendingClip=ZK}beginText(){this.current.textMatrix=ade,this.current.textMatrixScale=1,this.current.x=this.current.lineX=0,this.current.y=this.current.lineY=0}endText(){const t=this.pendingTextPaths,n=this.ctx;if(t===void 0){n.beginPath();return}n.save(),n.beginPath();for(const r of t)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(t){this.current.charSpacing=t}setWordSpacing(t){this.current.wordSpacing=t}setHScale(t){this.current.textHScale=t/100}setLeading(t){this.current.leading=-t}setFont(t,n){var h;const r=this.commonObjs.get(t),s=this.current;if(!r)throw new Error(`Can't find font for ${t}`);if(s.fontMatrix=r.fontMatrix||YU,(s.fontMatrix[0]===0||s.fontMatrix[3]===0)&&nn("Invalid font matrix for font "+t),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=((h=r.systemFontInfo)==null?void 0:h.css)||`"${i}", ${r.fallbackName}`;let a="normal";r.black?a="900":r.bold&&(a="bold");const c=r.italic?"italic":"normal";let d=n;n<HK?d=HK:n>WK&&(d=WK),this.current.fontSizeScale=n/d,this.ctx.font=`${c} ${a} ${d}px ${o}`}setTextRenderingMode(t){this.current.textRenderingMode=t}setTextRise(t){this.current.textRise=t}moveText(t,n){this.current.x=this.current.lineX+=t,this.current.y=this.current.lineY+=n}setLeadingMoveText(t,n){this.setLeading(-n),this.moveText(t,n)}setTextMatrix(t,n,r,s,i,o){this.current.textMatrix=[t,n,r,s,i,o],this.current.textMatrixScale=Math.hypot(t,n),this.current.x=this.current.lineX=0,this.current.y=this.current.lineY=0}nextLine(){this.moveText(0,this.current.leading)}paintChar(t,n,r,s){const i=this.ctx,o=this.current,a=o.font,c=o.textRenderingMode,d=o.fontSize/o.fontSizeScale,h=c&qi.FILL_STROKE_MASK,u=!!(c&qi.ADD_TO_PATH_FLAG),f=o.patternFill&&!a.missingFile;let g;(a.disableFontFace||u||f)&&(g=a.getPathGenerator(this.commonObjs,t)),a.disableFontFace||f?(i.save(),i.translate(n,r),i.beginPath(),g(i,d),s&&i.setTransform(...s),(h===qi.FILL||h===qi.FILL_STROKE)&&i.fill(),(h===qi.STROKE||h===qi.FILL_STROKE)&&i.stroke(),i.restore()):((h===qi.FILL||h===qi.FILL_STROKE)&&i.fillText(t,n,r),(h===qi.STROKE||h===qi.FILL_STROKE)&&i.strokeText(t,n,r)),u&&(this.pendingTextPaths||(this.pendingTextPaths=[])).push({transform:es(i),x:n,y:r,fontSize:d,addToPath:g})}get isFontSubpixelAAEnabled(){const{context:t}=this.cachedCanvases.getCanvas("isFontSubpixelAAEnabled",10,10);t.scale(1.5,1),t.fillText("I",0,10);const n=t.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 An(this,"isFontSubpixelAAEnabled",r)}showText(t){const n=this.current,r=n.font;if(r.isType3Font)return this.showType3Text(t);const s=n.fontSize;if(s===0)return;const i=this.ctx,o=n.fontSizeScale,a=n.charSpacing,c=n.wordSpacing,d=n.fontDirection,h=n.textHScale*d,u=t.length,f=r.vertical,g=f?1:-1,v=r.defaultVMetrics,m=s*n.fontMatrix[0],x=n.textRenderingMode===qi.FILL&&!r.disableFontFace&&!n.patternFill;i.save(),i.transform(...n.textMatrix),i.translate(n.x,n.y+n.textRise),d>0?i.scale(h,-1):i.scale(h,1);let y;if(n.patternFill){i.save();const T=n.fillColor.getPattern(i,this,Od(i),Ro.FILL);y=es(i),i.restore(),i.fillStyle=T}let b=n.lineWidth;const w=n.textMatrixScale;if(w===0||b===0){const T=n.textRenderingMode&qi.FILL_STROKE_MASK;(T===qi.STROKE||T===qi.FILL_STROKE)&&(b=this.getSinglePixelWidth())}else b/=w;if(o!==1&&(i.scale(o,o),b/=o),i.lineWidth=b,r.isInvalidPDFjsFont){const T=[];let N=0;for(const A of t)T.push(A.unicode),N+=A.width;i.fillText(T.join(""),0,0),n.x+=N*m*h,i.restore(),this.compose();return}let E=0,R;for(R=0;R<u;++R){const T=t[R];if(typeof T=="number"){E+=g*T*s/1e3;continue}let N=!1;const A=(T.isSpace?c:0)+a,D=T.fontChar,O=T.accent;let I,$,F=T.width;if(f){const W=T.vmetric||v,Z=-(T.vmetric?W[1]:F*.5)*m,Y=W[2]*m;F=W?-W[0]:F,I=Z/o,$=(E+Y)/o}else I=E/o,$=0;if(r.remeasure&&F>0){const W=i.measureText(D).width*1e3/s*o;if(F<W&&this.isFontSubpixelAAEnabled){const Z=F/W;N=!0,i.save(),i.scale(Z,1),I/=Z}else F!==W&&(I+=(F-W)/2e3*s/o)}if(this.contentVisible&&(T.isInFont||r.missingFile)){if(x&&!O)i.fillText(D,I,$);else if(this.paintChar(D,I,$,y),O){const W=I+s*O.offset.x/o,Z=$-s*O.offset.y/o;this.paintChar(O.fontChar,W,Z,y)}}const B=f?F*m-A*d:F*m+A*d;E+=B,N&&i.restore()}f?n.y-=E:n.x+=E*h,i.restore(),this.compose()}showType3Text(t){const n=this.ctx,r=this.current,s=r.font,i=r.fontSize,o=r.fontDirection,a=s.vertical?1:-1,c=r.charSpacing,d=r.wordSpacing,h=r.textHScale*o,u=r.fontMatrix||YU,f=t.length,g=r.textRenderingMode===qi.INVISIBLE;let v,m,x,y;if(!(g||i===0)){for(this._cachedScaleForStroking[0]=-1,this._cachedGetSinglePixelWidth=null,n.save(),n.transform(...r.textMatrix),n.translate(r.x,r.y),n.scale(h,o),v=0;v<f;++v){if(m=t[v],typeof m=="number"){y=a*m*i/1e3,this.ctx.translate(y,0),r.x+=y*h;continue}const b=(m.isSpace?d:0)+c,w=s.charProcOperatorList[m.operatorListId];if(!w){nn(`Type3 character "${m.operatorListId}" is not available.`);continue}this.contentVisible&&(this.processingType3=m,this.save(),n.scale(i,i),n.transform(...u),this.executeOperatorList(w),this.restore()),x=xt.applyTransform([m.width,0],u)[0]*i+b,n.translate(x,0),r.x+=x*h}n.restore(),this.processingType3=null}}setCharWidth(t,n){}setCharWidthAndBounds(t,n,r,s,i,o){this.ctx.rect(r,s,i-r,o-s),this.ctx.clip(),this.endPath()}getColorN_Pattern(t){let n;if(t[0]==="TilingPattern"){const r=t[1],s=this.baseTransform||es(this.ctx),i={createCanvasGraphics:o=>new aq(o,this.commonObjs,this.objs,this.canvasFactory,this.filterFactory,{optionalContentConfig:this.optionalContentConfig,markedContentStack:this.markedContentStack})};n=new S5(t,r,this.ctx,i,s)}else n=this._getPattern(t[1],t[2]);return n}setStrokeColorN(){this.current.strokeColor=this.getColorN_Pattern(arguments)}setFillColorN(){this.current.fillColor=this.getColorN_Pattern(arguments),this.current.patternFill=!0}setStrokeRGBColor(t,n,r){const s=xt.makeHexColor(t,n,r);this.ctx.strokeStyle=s,this.current.strokeColor=s}setFillRGBColor(t,n,r){const s=xt.makeHexColor(t,n,r);this.ctx.fillStyle=s,this.current.fillColor=s,this.current.patternFill=!1}_getPattern(t,n=null){let r;return this.cachedPatterns.has(t)?r=this.cachedPatterns.get(t):(r=LUe(this.getObject(t)),this.cachedPatterns.set(t,r)),n&&(r.matrix=n),r}shadingFill(t){if(!this.contentVisible)return;const n=this.ctx;this.save();const r=this._getPattern(t);n.fillStyle=r.getPattern(n,this,Od(n),Ro.SHADING);const s=Od(n);if(s){const{width:i,height:o}=n.canvas,[a,c,d,h]=xt.getAxialAlignedBoundingBox([0,0,i,o],s);this.ctx.fillRect(a,c,d-a,h-c)}else this.ctx.fillRect(-1e10,-1e10,2e10,2e10);this.compose(this.current.getClippedPathBoundingBox()),this.restore()}beginInlineImage(){lr("Should not call beginInlineImage")}beginImageData(){lr("Should not call beginImageData")}paintFormXObjectBegin(t,n){if(this.contentVisible&&(this.save(),this.baseTransformStack.push(this.baseTransform),t&&this.transform(...t),this.baseTransform=es(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(es(this.ctx),n),this.clip(),this.endPath()}}paintFormXObjectEnd(){this.contentVisible&&(this.restore(),this.baseTransform=this.baseTransformStack.pop())}beginGroup(t){if(!this.contentVisible)return;this.save(),this.inSMaskMode&&(this.endSMaskMode(),this.current.activeSMask=null);const n=this.ctx;t.isolated||FO("TODO: Support non-isolated groups."),t.knockout&&nn("Knockout groups not supported.");const r=es(n);if(t.matrix&&n.transform(...t.matrix),!t.bbox)throw new Error("Bounding box is required.");let s=xt.getAxialAlignedBoundingBox(t.bbox,es(n));const i=[0,0,n.canvas.width,n.canvas.height];s=xt.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),d=Math.max(Math.ceil(s[3])-a,1);this.current.startNewPathAndClipBox([0,0,c,d]);let h="groupAt"+this.groupLevel;t.smask&&(h+="_smask_"+this.smaskCounter++%2);const u=this.cachedCanvases.getCanvas(h,c,d),f=u.context;f.translate(-o,-a),f.transform(...r),t.smask?this.smaskStack.push({canvas:u.canvas,context:f,offsetX:o,offsetY:a,subtype:t.smask.subtype,backdrop:t.smask.backdrop,transferMap:t.smask.transferMap||null,startTransformInverse:null}):(n.setTransform(1,0,0,1,0,0),n.translate(o,a),n.save()),QS(n,f),this.ctx=f,this.setGState([["BM","source-over"],["ca",1],["CA",1]]),this.groupStack.push(n),this.groupLevel++}endGroup(t){if(!this.contentVisible)return;this.groupLevel--;const n=this.ctx,r=this.groupStack.pop();if(this.ctx=r,this.ctx.imageSmoothingEnabled=!1,t.smask)this.tempSMask=this.smaskStack.pop(),this.restore();else{this.ctx.restore();const s=es(this.ctx);this.restore(),this.ctx.save(),this.ctx.setTransform(...s);const i=xt.getAxialAlignedBoundingBox([0,0,n.canvas.width,n.canvas.height],s);this.ctx.drawImage(n.canvas,0,0),this.ctx.restore(),this.compose(i)}}beginAnnotation(t,n,r,s,i){if(K(this,Cp,C5).call(this),PP(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,d]=xt.singularValueDecompose2dScale(es(this.ctx)),{viewportScale:h}=this,u=Math.ceil(o*this.outputScaleX*h),f=Math.ceil(a*this.outputScaleY*h);this.annotationCanvas=this.canvasFactory.create(u,f);const{canvas:g,context:v}=this.annotationCanvas;this.annotationCanvasMap.set(t,g),this.annotationCanvas.savedCtx=this.ctx,this.ctx=v,this.ctx.save(),this.ctx.setTransform(c,0,0,-d,0,a*d),PP(this.ctx)}else PP(this.ctx),this.ctx.rect(n[0],n[1],o,a),this.ctx.clip(),this.endPath()}this.current=new KK(this.ctx.canvas.width,this.ctx.canvas.height),this.transform(...r),this.transform(...s)}endAnnotation(){this.annotationCanvas&&(this.ctx.restore(),K(this,Cp,E5).call(this),this.ctx=this.annotationCanvas.savedCtx,delete this.annotationCanvas.savedCtx,delete this.annotationCanvas)}paintImageMaskXObject(t){if(!this.contentVisible)return;const n=t.count;t=this.getObject(t.data,t),t.count=n;const r=this.ctx,s=this.processingType3;if(s&&(s.compiled===void 0&&(s.compiled=BUe(t)),s.compiled)){s.compiled(r);return}const i=this._createMaskCanvas(t),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(t,n,r=0,s=0,i,o){if(!this.contentVisible)return;t=this.getObject(t.data,t);const a=this.ctx;a.save();const c=es(a);a.transform(n,r,s,i,0,0);const d=this._createMaskCanvas(t);a.setTransform(1,0,0,1,d.offsetX-c[4],d.offsetY-c[5]);for(let h=0,u=o.length;h<u;h+=2){const f=xt.transform(c,[n,r,s,i,o[h],o[h+1]]),[g,v]=xt.applyTransform([0,0],f);a.drawImage(d.canvas,g,v)}a.restore(),this.compose()}paintImageMaskXObjectGroup(t){if(!this.contentVisible)return;const n=this.ctx,r=this.current.fillColor,s=this.current.patternFill;for(const i of t){const{data:o,width:a,height:c,transform:d}=i,h=this.cachedCanvases.getCanvas("maskCanvas",a,c),u=h.context;u.save();const f=this.getObject(o,i);XK(u,f),u.globalCompositeOperation="source-in",u.fillStyle=s?r.getPattern(u,this,Od(n),Ro.FILL):r,u.fillRect(0,0,a,c),u.restore(),n.save(),n.transform(...d),n.scale(1,-1),RP(n,h.canvas,0,0,a,c,0,-1,1,1),n.restore()}this.compose()}paintImageXObject(t){if(!this.contentVisible)return;const n=this.getObject(t);if(!n){nn("Dependent image isn't ready yet");return}this.paintInlineImageXObject(n)}paintImageXObjectRepeat(t,n,r,s){if(!this.contentVisible)return;const i=this.getObject(t);if(!i){nn("Dependent image isn't ready yet");return}const o=i.width,a=i.height,c=[];for(let d=0,h=s.length;d<h;d+=2)c.push({transform:[n,0,0,r,s[d],s[d+1]],x:0,y:0,w:o,h:a});this.paintInlineImageXObjectGroup(i,c)}applyTransferMapsToCanvas(t){return this.current.transferMaps!=="none"&&(t.filter=this.current.transferMaps,t.drawImage(t.canvas,0,0),t.filter="none"),t.canvas}applyTransferMapsToBitmap(t){if(this.current.transferMaps==="none")return t.bitmap;const{bitmap:n,width:r,height:s}=t,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(t){if(!this.contentVisible)return;const n=t.width,r=t.height,s=this.ctx;if(this.save(),!ro){const{filter:a}=s;a!=="none"&&a!==""&&(s.filter="none")}s.scale(1/n,-1/r);let i;if(t.bitmap)i=this.applyTransferMapsToBitmap(t);else if(typeof HTMLElement=="function"&&t instanceof HTMLElement||!t.data)i=t;else{const c=this.cachedCanvases.getCanvas("inlineImage",n,r).context;YK(c,t),i=this.applyTransferMapsToCanvas(c)}const o=this._scaleImage(i,Od(s));s.imageSmoothingEnabled=QK(es(s),t.interpolate),RP(s,o.img,0,0,o.paintWidth,o.paintHeight,0,-r,n,r),this.compose(),this.restore()}paintInlineImageXObjectGroup(t,n){if(!this.contentVisible)return;const r=this.ctx;let s;if(t.bitmap)s=t.bitmap;else{const i=t.width,o=t.height,c=this.cachedCanvases.getCanvas("inlineImage",i,o).context;YK(c,t),s=this.applyTransferMapsToCanvas(c)}for(const i of n)r.save(),r.transform(...i.transform),r.scale(1,-1),RP(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(t){}markPointProps(t,n){}beginMarkedContent(t){this.markedContentStack.push({visible:!0})}beginMarkedContentProps(t,n){t==="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(t){const n=this.current.isEmptyClip();this.pendingClip&&this.current.updateClipFromPath(),this.pendingClip||this.compose(t);const r=this.ctx;this.pendingClip&&(n||(this.pendingClip===ZK?r.clip("evenodd"):r.clip()),this.pendingClip=null),this.current.startNewPathAndClipBox(this.current.clipBox),r.beginPath()}getSinglePixelWidth(){if(!this._cachedGetSinglePixelWidth){const t=es(this.ctx);if(t[1]===0&&t[2]===0)this._cachedGetSinglePixelWidth=1/Math.min(Math.abs(t[0]),Math.abs(t[3]));else{const n=Math.abs(t[0]*t[3]-t[2]*t[1]),r=Math.hypot(t[0],t[2]),s=Math.hypot(t[1],t[3]);this._cachedGetSinglePixelWidth=Math.max(r,s)/n}}return this._cachedGetSinglePixelWidth}getScaleForStroking(){if(this._cachedScaleForStroking[0]===-1){const{lineWidth:t}=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),d=Math.abs(i);if(c===d)if(t===0)o=a=1/c;else{const h=c*t;o=a=h<1?1/h:1}else if(t===0)o=1/c,a=1/d;else{const h=c*t,u=d*t;o=h<1?1/h:1,a=u<1?1/u:1}}else{const c=Math.abs(n*i-r*s),d=Math.hypot(n,r),h=Math.hypot(s,i);if(t===0)o=h/c,a=d/c;else{const u=t*c;o=h>u?h/u:1,a=d>u?d/u:1}}this._cachedScaleForStroking[0]=o,this._cachedScaleForStroking[1]=a}return this._cachedScaleForStroking}rescaleAndStroke(t){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(t&&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(),t&&n.restore()}isContentVisible(){for(let t=this.markedContentStack.length-1;t>=0;t--)if(!this.markedContentStack[t].visible)return!1;return!0}};Cp=new WeakSet,C5=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)},E5=function(){if(this.pageColors){const t=this.filterFactory.addHCMFilter(this.pageColors.foreground,this.pageColors.background);if(t!=="none"){const n=this.ctx.filter;this.ctx.filter=t,this.ctx.drawImage(this.ctx.canvas,0,0),this.ctx.filter=n}}};let Fb=aq;for(const e in Yl)Fb.prototype[e]!==void 0&&(Fb.prototype[Yl[e]]=Fb.prototype[e]);var SE,CE;class Rf{static get workerPort(){return P(this,SE)}static set workerPort(t){if(!(typeof Worker<"u"&&t instanceof Worker)&&t!==null)throw new Error("Invalid `workerPort` type.");V(this,SE,t)}static get workerSrc(){return P(this,CE)}static set workerSrc(t){if(typeof t!="string")throw new Error("Invalid `workerSrc` type.");V(this,CE,t)}}SE=new WeakMap,CE=new WeakMap,G(Rf,SE,null),G(Rf,CE,"");const NP={DATA:1,ERROR:2},Rs={CANCEL:1,CANCEL_COMPLETE:2,CLOSE:3,ENQUEUE:4,ERROR:5,PULL:6,PULL_COMPLETE:7,START_COMPLETE:8};function Ra(e){switch(e instanceof Error||typeof e=="object"&&e!==null||lr('wrapReason: Expected "reason" to be a (possibly cloned) Error.'),e.name){case"AbortException":return new Sy(e.message);case"MissingPDFException":return new wy(e.message);case"PasswordException":return new QU(e.message,e.code);case"UnexpectedResponseException":return new zO(e.message,e.status);case"UnknownErrorException":return new ZU(e.message,e.details);default:return new ZU(e.message,e.toString())}}var Eu,Hde,Wde,hN;class x1{constructor(t,n,r){G(this,Eu);this.sourceName=t,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){K(this,Eu,Wde).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===NP.DATA)c.resolve(i.data);else if(i.callback===NP.ERROR)c.reject(Ra(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(d){d(o(i.data))}).then(function(d){r.postMessage({sourceName:a,targetName:c,callback:NP.DATA,callbackId:i.callbackId,data:d})},function(d){r.postMessage({sourceName:a,targetName:c,callback:NP.ERROR,callbackId:i.callbackId,reason:Ra(d)})});return}if(i.streamId){K(this,Eu,Hde).call(this,i);return}o(i.data)},r.addEventListener("message",this._onComObjOnMessage)}on(t,n){const r=this.actionHandler;if(r[t])throw new Error(`There is already an actionName called "${t}"`);r[t]=n}send(t,n,r){this.comObj.postMessage({sourceName:this.sourceName,targetName:this.targetName,action:t,data:n},r)}sendWithPromise(t,n,r){const s=this.callbackId++,i=Promise.withResolvers();this.callbackCapabilities[s]=i;try{this.comObj.postMessage({sourceName:this.sourceName,targetName:this.targetName,action:t,callbackId:s,data:n},r)}catch(o){i.reject(o)}return i.promise}sendWithStream(t,n,r,s){const i=this.streamId++,o=this.sourceName,a=this.targetName,c=this.comObj;return new ReadableStream({start:d=>{const h=Promise.withResolvers();return this.streamControllers[i]={controller:d,startCall:h,pullCall:null,cancelCall:null,isClosed:!1},c.postMessage({sourceName:o,targetName:a,action:t,streamId:i,data:n,desiredSize:d.desiredSize},s),h.promise},pull:d=>{const h=Promise.withResolvers();return this.streamControllers[i].pullCall=h,c.postMessage({sourceName:o,targetName:a,stream:Rs.PULL,streamId:i,desiredSize:d.desiredSize}),h.promise},cancel:d=>{ni(d instanceof Error,"cancel must have a valid reason");const h=Promise.withResolvers();return this.streamControllers[i].cancelCall=h,this.streamControllers[i].isClosed=!0,c.postMessage({sourceName:o,targetName:a,stream:Rs.CANCEL,streamId:i,reason:Ra(d)}),h.promise}},r)}destroy(){this.comObj.removeEventListener("message",this._onComObjOnMessage)}}Eu=new WeakSet,Hde=function(t){const n=t.streamId,r=this.sourceName,s=t.sourceName,i=this.comObj,o=this,a=this.actionHandler[t.action],c={enqueue(d,h=1,u){if(this.isCancelled)return;const f=this.desiredSize;this.desiredSize-=h,f>0&&this.desiredSize<=0&&(this.sinkCapability=Promise.withResolvers(),this.ready=this.sinkCapability.promise),i.postMessage({sourceName:r,targetName:s,stream:Rs.ENQUEUE,streamId:n,chunk:d},u)},close(){this.isCancelled||(this.isCancelled=!0,i.postMessage({sourceName:r,targetName:s,stream:Rs.CLOSE,streamId:n}),delete o.streamSinks[n])},error(d){ni(d instanceof Error,"error must have a valid reason"),!this.isCancelled&&(this.isCancelled=!0,i.postMessage({sourceName:r,targetName:s,stream:Rs.ERROR,streamId:n,reason:Ra(d)}))},sinkCapability:Promise.withResolvers(),onPull:null,onCancel:null,isCancelled:!1,desiredSize:t.desiredSize,ready:null};c.sinkCapability.resolve(),c.ready=c.sinkCapability.promise,this.streamSinks[n]=c,new Promise(function(d){d(a(t.data,c))}).then(function(){i.postMessage({sourceName:r,targetName:s,stream:Rs.START_COMPLETE,streamId:n,success:!0})},function(d){i.postMessage({sourceName:r,targetName:s,stream:Rs.START_COMPLETE,streamId:n,reason:Ra(d)})})},Wde=function(t){const n=t.streamId,r=this.sourceName,s=t.sourceName,i=this.comObj,o=this.streamControllers[n],a=this.streamSinks[n];switch(t.stream){case Rs.START_COMPLETE:t.success?o.startCall.resolve():o.startCall.reject(Ra(t.reason));break;case Rs.PULL_COMPLETE:t.success?o.pullCall.resolve():o.pullCall.reject(Ra(t.reason));break;case Rs.PULL:if(!a){i.postMessage({sourceName:r,targetName:s,stream:Rs.PULL_COMPLETE,streamId:n,success:!0});break}a.desiredSize<=0&&t.desiredSize>0&&a.sinkCapability.resolve(),a.desiredSize=t.desiredSize,new Promise(function(c){var d;c((d=a.onPull)==null?void 0:d.call(a))}).then(function(){i.postMessage({sourceName:r,targetName:s,stream:Rs.PULL_COMPLETE,streamId:n,success:!0})},function(c){i.postMessage({sourceName:r,targetName:s,stream:Rs.PULL_COMPLETE,streamId:n,reason:Ra(c)})});break;case Rs.ENQUEUE:if(ni(o,"enqueue should have stream controller"),o.isClosed)break;o.controller.enqueue(t.chunk);break;case Rs.CLOSE:if(ni(o,"close should have stream controller"),o.isClosed)break;o.isClosed=!0,o.controller.close(),K(this,Eu,hN).call(this,o,n);break;case Rs.ERROR:ni(o,"error should have stream controller"),o.controller.error(Ra(t.reason)),K(this,Eu,hN).call(this,o,n);break;case Rs.CANCEL_COMPLETE:t.success?o.cancelCall.resolve():o.cancelCall.reject(Ra(t.reason)),K(this,Eu,hN).call(this,o,n);break;case Rs.CANCEL:if(!a)break;new Promise(function(c){var d;c((d=a.onCancel)==null?void 0:d.call(a,Ra(t.reason)))}).then(function(){i.postMessage({sourceName:r,targetName:s,stream:Rs.CANCEL_COMPLETE,streamId:n,success:!0})},function(c){i.postMessage({sourceName:r,targetName:s,stream:Rs.CANCEL_COMPLETE,streamId:n,reason:Ra(c)})}),a.sinkCapability.reject(Ra(t.reason)),a.isCancelled=!0,delete this.streamSinks[n];break;default:throw new Error("Unexpected stream case")}},hN=async function(t,n){var r,s,i;await Promise.allSettled([(r=t.startCall)==null?void 0:r.promise,(s=t.pullCall)==null?void 0:s.promise,(i=t.cancelCall)==null?void 0:i.promise]),delete this.streamControllers[n]};var Hg,EE;class WUe{constructor({parsedData:t,rawData:n}){G(this,Hg);G(this,EE);V(this,Hg,t),V(this,EE,n)}getRaw(){return P(this,EE)}get(t){return P(this,Hg).get(t)??null}getAll(){return RW(P(this,Hg))}has(t){return P(this,Hg).has(t)}}Hg=new WeakMap,EE=new WeakMap;const oh=Symbol("INTERNAL");var AE,RE,PE,m0;class qUe{constructor(t,{name:n,intent:r,usage:s}){G(this,AE,!1);G(this,RE,!1);G(this,PE,!1);G(this,m0,!0);V(this,AE,!!(t&ul.DISPLAY)),V(this,RE,!!(t&ul.PRINT)),this.name=n,this.intent=r,this.usage=s}get visible(){if(P(this,PE))return P(this,m0);if(!P(this,m0))return!1;const{print:t,view:n}=this.usage;return P(this,AE)?(n==null?void 0:n.viewState)!=="OFF":P(this,RE)?(t==null?void 0:t.printState)!=="OFF":!0}_setVisible(t,n,r=!1){t!==oh&&lr("Internal method `_setVisible` called."),V(this,PE,r),V(this,m0,n)}}AE=new WeakMap,RE=new WeakMap,PE=new WeakMap,m0=new WeakMap;var Mh,ar,g0,v0,NE,A5;class GUe{constructor(t,n=ul.DISPLAY){G(this,NE);G(this,Mh,null);G(this,ar,new Map);G(this,g0,null);G(this,v0,null);if(this.renderingIntent=n,this.name=null,this.creator=null,t!==null){this.name=t.name,this.creator=t.creator,V(this,v0,t.order);for(const r of t.groups)P(this,ar).set(r.id,new qUe(n,r));if(t.baseState==="OFF")for(const r of P(this,ar).values())r._setVisible(oh,!1);for(const r of t.on)P(this,ar).get(r)._setVisible(oh,!0);for(const r of t.off)P(this,ar).get(r)._setVisible(oh,!1);V(this,g0,this.getHash())}}isVisible(t){if(P(this,ar).size===0)return!0;if(!t)return FO("Optional content group not defined."),!0;if(t.type==="OCG")return P(this,ar).has(t.id)?P(this,ar).get(t.id).visible:(nn(`Optional content group not found: ${t.id}`),!0);if(t.type==="OCMD"){if(t.expression)return K(this,NE,A5).call(this,t.expression);if(!t.policy||t.policy==="AnyOn"){for(const n of t.ids){if(!P(this,ar).has(n))return nn(`Optional content group not found: ${n}`),!0;if(P(this,ar).get(n).visible)return!0}return!1}else if(t.policy==="AllOn"){for(const n of t.ids){if(!P(this,ar).has(n))return nn(`Optional content group not found: ${n}`),!0;if(!P(this,ar).get(n).visible)return!1}return!0}else if(t.policy==="AnyOff"){for(const n of t.ids){if(!P(this,ar).has(n))return nn(`Optional content group not found: ${n}`),!0;if(!P(this,ar).get(n).visible)return!0}return!1}else if(t.policy==="AllOff"){for(const n of t.ids){if(!P(this,ar).has(n))return nn(`Optional content group not found: ${n}`),!0;if(P(this,ar).get(n).visible)return!1}return!0}return nn(`Unknown optional content policy ${t.policy}.`),!0}return nn(`Unknown group type ${t.type}.`),!0}setVisibility(t,n=!0){const r=P(this,ar).get(t);if(!r){nn(`Optional content group not found: ${t}`);return}r._setVisible(oh,!!n,!0),V(this,Mh,null)}setOCGState({state:t,preserveRB:n}){let r;for(const s of t){switch(s){case"ON":case"OFF":case"Toggle":r=s;continue}const i=P(this,ar).get(s);if(i)switch(r){case"ON":i._setVisible(oh,!0);break;case"OFF":i._setVisible(oh,!1);break;case"Toggle":i._setVisible(oh,!i.visible);break}}V(this,Mh,null)}get hasInitialVisibility(){return P(this,g0)===null||this.getHash()===P(this,g0)}getOrder(){return P(this,ar).size?P(this,v0)?P(this,v0).slice():[...P(this,ar).keys()]:null}getGroups(){return P(this,ar).size>0?RW(P(this,ar)):null}getGroup(t){return P(this,ar).get(t)||null}getHash(){if(P(this,Mh)!==null)return P(this,Mh);const t=new zde;for(const[n,r]of P(this,ar))t.update(`${n}:${r.visible}`);return V(this,Mh,t.hexdigest())}}Mh=new WeakMap,ar=new WeakMap,g0=new WeakMap,v0=new WeakMap,NE=new WeakSet,A5=function(t){const n=t.length;if(n<2)return!0;const r=t[0];for(let s=1;s<n;s++){const i=t[s];let o;if(Array.isArray(i))o=K(this,NE,A5).call(this,i);else if(P(this,ar).has(i))o=P(this,ar).get(i).visible;else return nn(`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 KUe{constructor(t,{disableRange:n=!1,disableStream:r=!1}){ni(t,'PDFDataTransportStream - missing required "pdfDataRangeTransport" argument.');const{length:s,initialData:i,progressiveDone:o,contentDispositionFilename:a}=t;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=t,this._isStreamingSupported=!r,this._isRangeSupported=!n,this._contentLength=s,this._fullRequestReader=null,this._rangeReaders=[],t.addRangeListener((c,d)=>{this._onReceiveData({begin:c,chunk:d})}),t.addProgressListener((c,d)=>{this._onProgress({loaded:c,total:d})}),t.addProgressiveReadListener(c=>{this._onReceiveData({chunk:c})}),t.addProgressiveDoneListener(()=>{this._onProgressiveDone()}),t.transportReady()}_onReceiveData({begin:t,chunk:n}){const r=n instanceof Uint8Array&&n.byteLength===n.buffer.byteLength?n.buffer:new Uint8Array(n).buffer;if(t===void 0)this._fullRequestReader?this._fullRequestReader._enqueue(r):this._queuedChunks.push(r);else{const s=this._rangeReaders.some(function(i){return i._begin!==t?!1:(i._enqueue(r),!0)});ni(s,"_onReceiveData - no `PDFDataTransportStreamRangeReader` instance found.")}}get _progressiveDataLength(){var t;return((t=this._fullRequestReader)==null?void 0:t._loaded)??0}_onProgress(t){var n,r,s,i;t.total===void 0?(r=(n=this._rangeReaders[0])==null?void 0:n.onProgress)==null||r.call(n,{loaded:t.loaded}):(i=(s=this._fullRequestReader)==null?void 0:s.onProgress)==null||i.call(s,{loaded:t.loaded,total:t.total})}_onProgressiveDone(){var t;(t=this._fullRequestReader)==null||t.progressiveDone(),this._progressiveDone=!0}_removeRangeReader(t){const n=this._rangeReaders.indexOf(t);n>=0&&this._rangeReaders.splice(n,1)}getFullReader(){ni(!this._fullRequestReader,"PDFDataTransportStream.getFullReader can only be called once.");const t=this._queuedChunks;return this._queuedChunks=null,new YUe(this,t,this._progressiveDone,this._contentDispositionFilename)}getRangeReader(t,n){if(n<=this._progressiveDataLength)return null;const r=new XUe(this,t,n);return this._pdfDataRangeTransport.requestDataRange(t,n),this._rangeReaders.push(r),r}cancelAllRequests(t){var n;(n=this._fullRequestReader)==null||n.cancel(t);for(const r of this._rangeReaders.slice(0))r.cancel(t);this._pdfDataRangeTransport.abort()}}class YUe{constructor(t,n,r=!1,s=null){this._stream=t,this._done=r||!1,this._filename=DW(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(),t._fullRequestReader=this,this.onProgress=null}_enqueue(t){this._done||(this._requests.length>0?this._requests.shift().resolve({value:t,done:!1}):this._queuedChunks.push(t),this._loaded+=t.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 t=Promise.withResolvers();return this._requests.push(t),t.promise}cancel(t){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 XUe{constructor(t,n,r){this._stream=t,this._begin=n,this._end=r,this._queuedChunk=null,this._requests=[],this._done=!1,this.onProgress=null}_enqueue(t){if(!this._done){if(this._requests.length===0)this._queuedChunk=t;else{this._requests.shift().resolve({value:t,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 t=Promise.withResolvers();return this._requests.push(t),t.promise}cancel(t){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 QUe(e){let t=!0,n=r("filename\\*","i").exec(e);if(n){n=n[1];let h=a(n);return h=unescape(h),h=c(h),h=d(h),i(h)}if(n=o(e),n){const h=d(n);return i(h)}if(n=r("filename","i").exec(e),n){n=n[1];let h=a(n);return h=d(h),i(h)}function r(h,u){return new RegExp("(?:^|;)\\s*"+h+'\\s*=\\s*([^";\\s][^;\\s]*|"(?:[^"\\\\]|\\\\"?)+"?)',u)}function s(h,u){if(h){if(!/^[\x00-\xFF]+$/.test(u))return u;try{const f=new TextDecoder(h,{fatal:!0}),g=BO(u);u=f.decode(g),t=!1}catch{}}return u}function i(h){return t&&/[\x80-\xff]/.test(h)&&(h=s("utf-8",h),t&&(h=s("iso-8859-1",h))),h}function o(h){const u=[];let f;const g=r("filename\\*((?!0\\d)\\d+)(\\*?)","ig");for(;(f=g.exec(h))!==null;){let[,m,x,y]=f;if(m=parseInt(m,10),m in u){if(m===0)break;continue}u[m]=[x,y]}const v=[];for(let m=0;m<u.length&&m in u;++m){let[x,y]=u[m];y=a(y),x&&(y=unescape(y),m===0&&(y=c(y))),v.push(y)}return v.join("")}function a(h){if(h.startsWith('"')){const u=h.slice(1).split('\\"');for(let f=0;f<u.length;++f){const g=u[f].indexOf('"');g!==-1&&(u[f]=u[f].slice(0,g),u.length=f+1),u[f]=u[f].replaceAll(/\\(.)/g,"$1")}h=u.join('"')}return h}function c(h){const u=h.indexOf("'");if(u===-1)return h;const f=h.slice(0,u),v=h.slice(u+1).replace(/^[^']*'/,"");return s(f,v)}function d(h){return!h.startsWith("=?")||/[\x00-\x19\x80-\xff]/.test(h)?h:h.replaceAll(/=\?([\w-]*)\?([QqBb])\?((?:[^?]|\?(?!=))*)\?=/g,function(u,f,g,v){if(g==="q"||g==="Q")return v=v.replaceAll("_"," "),v=v.replaceAll(/=([0-9a-fA-F]{2})/g,function(m,x){return String.fromCharCode(parseInt(x,16))}),s(f,v);try{v=atob(v)}catch{}return s(f,v)})}return""}function IW({getResponseHeader:e,isHttp:t,rangeChunkSize:n,disableRange:r}){const s={allowRangeRequests:!1,suggestedLength:void 0},i=parseInt(e("Content-Length"),10);return!Number.isInteger(i)||(s.suggestedLength=i,i<=2*n)||r||!t||e("Accept-Ranges")!=="bytes"||(e("Content-Encoding")||"identity")!=="identity"||(s.allowRangeRequests=!0),s}function LW(e){const t=e("Content-Disposition");if(t){let n=QUe(t);if(n.includes("%"))try{n=decodeURIComponent(n)}catch{}if(DW(n))return n}return null}function qO(e,t){return e===404||e===0&&t.startsWith("file:")?new wy('Missing PDF "'+t+'".'):new zO(`Unexpected server response (${e}) while retrieving PDF "${t}".`,e)}function qde(e){return e===200||e===206}function Gde(e,t,n){return{method:"GET",headers:e,signal:n.signal,mode:"cors",credentials:t?"include":"same-origin",redirect:"follow"}}function Kde(e){const t=new Headers;for(const n in e){const r=e[n];r!==void 0&&t.append(n,r)}return t}function Yde(e){return e instanceof Uint8Array?e.buffer:e instanceof ArrayBuffer?e:(nn(`getArrayBuffer - unexpected data format: ${e}`),new Uint8Array(e).buffer)}class JK{constructor(t){this.source=t,this.isHttp=/^https?:/i.test(t.url),this.httpHeaders=this.isHttp&&t.httpHeaders||{},this._fullRequestReader=null,this._rangeRequestReaders=[]}get _progressiveDataLength(){var t;return((t=this._fullRequestReader)==null?void 0:t._loaded)??0}getFullReader(){return ni(!this._fullRequestReader,"PDFFetchStream.getFullReader can only be called once."),this._fullRequestReader=new ZUe(this),this._fullRequestReader}getRangeReader(t,n){if(n<=this._progressiveDataLength)return null;const r=new JUe(this,t,n);return this._rangeRequestReaders.push(r),r}cancelAllRequests(t){var n;(n=this._fullRequestReader)==null||n.cancel(t);for(const r of this._rangeRequestReaders.slice(0))r.cancel(t)}}class ZUe{constructor(t){this._stream=t,this._reader=null,this._loaded=0,this._filename=null;const n=t.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=Kde(this._stream.httpHeaders);const r=n.url;fetch(r,Gde(this._headers,this._withCredentials,this._abortController)).then(s=>{if(!qde(s.status))throw qO(s.status,r);this._reader=s.body.getReader(),this._headersCapability.resolve();const i=c=>s.headers.get(c),{allowRangeRequests:o,suggestedLength:a}=IW({getResponseHeader:i,isHttp:this._stream.isHttp,rangeChunkSize:this._rangeChunkSize,disableRange:this._disableRange});this._isRangeSupported=o,this._contentLength=a||this._contentLength,this._filename=LW(i),!this._isStreamingSupported&&this._isRangeSupported&&this.cancel(new Sy("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:t,done:n}=await this._reader.read();return n?{value:t,done:n}:(this._loaded+=t.byteLength,(r=this.onProgress)==null||r.call(this,{loaded:this._loaded,total:this._contentLength}),{value:Yde(t),done:!1})}cancel(t){var n;(n=this._reader)==null||n.cancel(t),this._abortController.abort()}}class JUe{constructor(t,n,r){this._stream=t,this._reader=null,this._loaded=0;const s=t.source;this._withCredentials=s.withCredentials||!1,this._readCapability=Promise.withResolvers(),this._isStreamingSupported=!s.disableStream,this._abortController=new AbortController,this._headers=Kde(this._stream.httpHeaders),this._headers.append("Range",`bytes=${n}-${r-1}`);const i=s.url;fetch(i,Gde(this._headers,this._withCredentials,this._abortController)).then(o=>{if(!qde(o.status))throw qO(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:t,done:n}=await this._reader.read();return n?{value:t,done:n}:(this._loaded+=t.byteLength,(r=this.onProgress)==null||r.call(this,{loaded:this._loaded}),{value:Yde(t),done:!1})}cancel(t){var n;(n=this._reader)==null||n.cancel(t),this._abortController.abort()}}const uz=200,dz=206;function e5e(e){const t=e.response;return typeof t!="string"?t:BO(t).buffer}class t5e{constructor(t,n={}){this.url=t,this.isHttp=/^https?:/i.test(t),this.httpHeaders=this.isHttp&&n.httpHeaders||Object.create(null),this.withCredentials=n.withCredentials||!1,this.currXhrId=0,this.pendingRequests=Object.create(null)}requestRange(t,n,r){const s={begin:t,end:n};for(const i in r)s[i]=r[i];return this.request(s)}requestFull(t){return this.request(t)}request(t){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 t&&"end"in t?(n.setRequestHeader("Range",`bytes=${t.begin}-${t.end-1}`),s.expectedStatus=dz):s.expectedStatus=uz,n.responseType="arraybuffer",t.onError&&(n.onerror=function(i){t.onError(n.status)}),n.onreadystatechange=this.onStateChange.bind(this,r),n.onprogress=this.onProgress.bind(this,r),s.onHeadersReceived=t.onHeadersReceived,s.onDone=t.onDone,s.onError=t.onError,s.onProgress=t.onProgress,n.send(null),r}onProgress(t,n){var s;const r=this.pendingRequests[t];r&&((s=r.onProgress)==null||s.call(r,n))}onStateChange(t,n){var c,d,h;const r=this.pendingRequests[t];if(!r)return;const s=r.xhr;if(s.readyState>=2&&r.onHeadersReceived&&(r.onHeadersReceived(),delete r.onHeadersReceived),s.readyState!==4||!(t in this.pendingRequests))return;if(delete this.pendingRequests[t],s.status===0&&this.isHttp){(c=r.onError)==null||c.call(r,s.status);return}const i=s.status||uz;if(!(i===uz&&r.expectedStatus===dz)&&i!==r.expectedStatus){(d=r.onError)==null||d.call(r,s.status);return}const a=e5e(s);if(i===dz){const u=s.getResponseHeader("Content-Range"),f=/bytes (\d+)-(\d+)\/(\d+)/.exec(u);r.onDone({begin:parseInt(f[1],10),chunk:a})}else a?r.onDone({begin:0,chunk:a}):(h=r.onError)==null||h.call(r,s.status)}getRequestXhr(t){return this.pendingRequests[t].xhr}isPendingRequest(t){return t in this.pendingRequests}abortRequest(t){const n=this.pendingRequests[t].xhr;delete this.pendingRequests[t],n.abort()}}class n5e{constructor(t){this._source=t,this._manager=new t5e(t.url,{httpHeaders:t.httpHeaders,withCredentials:t.withCredentials}),this._rangeChunkSize=t.rangeChunkSize,this._fullRequestReader=null,this._rangeRequestReaders=[]}_onRangeRequestReaderClosed(t){const n=this._rangeRequestReaders.indexOf(t);n>=0&&this._rangeRequestReaders.splice(n,1)}getFullReader(){return ni(!this._fullRequestReader,"PDFNetworkStream.getFullReader can only be called once."),this._fullRequestReader=new r5e(this._manager,this._source),this._fullRequestReader}getRangeReader(t,n){const r=new s5e(this._manager,t,n);return r.onClosed=this._onRangeRequestReaderClosed.bind(this),this._rangeRequestReaders.push(r),r}cancelAllRequests(t){var n;(n=this._fullRequestReader)==null||n.cancel(t);for(const r of this._rangeRequestReaders.slice(0))r.cancel(t)}}class r5e{constructor(t,n){this._manager=t;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=t.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 t=this._fullRequestId,n=this._manager.getRequestXhr(t),r=o=>n.getResponseHeader(o),{allowRangeRequests:s,suggestedLength:i}=IW({getResponseHeader:r,isHttp:this._manager.isHttp,rangeChunkSize:this._rangeChunkSize,disableRange:this._disableRange});s&&(this._isRangeSupported=!0),this._contentLength=i||this._contentLength,this._filename=LW(r),this._isRangeSupported&&this._manager.abortRequest(t),this._headersReceivedCapability.resolve()}_onDone(t){if(t&&(this._requests.length>0?this._requests.shift().resolve({value:t.chunk,done:!1}):this._cachedChunks.push(t.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(t){this._storedError=qO(t,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(t){var n;(n=this.onProgress)==null||n.call(this,{loaded:t.loaded,total:t.lengthComputable?t.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 t=Promise.withResolvers();return this._requests.push(t),t.promise}cancel(t){this._done=!0,this._headersReceivedCapability.reject(t);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 s5e{constructor(t,n,r){this._manager=t;const s={onDone:this._onDone.bind(this),onError:this._onError.bind(this),onProgress:this._onProgress.bind(this)};this._url=t.url,this._requestId=t.requestRange(n,r,s),this._requests=[],this._queuedChunk=null,this._done=!1,this._storedError=void 0,this.onProgress=null,this.onClosed=null}_close(){var t;(t=this.onClosed)==null||t.call(this,this)}_onDone(t){const n=t.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(t){this._storedError=qO(t,this._url);for(const n of this._requests)n.reject(this._storedError);this._requests.length=0,this._queuedChunk=null}_onProgress(t){var n;this.isStreamingSupported||(n=this.onProgress)==null||n.call(this,{loaded:t.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 t=Promise.withResolvers();return this._requests.push(t),t.promise}cancel(t){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 Xde=/^file:\/\/\/[a-zA-Z]:\//;function i5e(e){const t=Mu.get("url"),n=t.parse(e);return n.protocol==="file:"||n.host?n:/^[a-z]:[/\\]/i.test(e)?t.parse(`file:///${e}`):(n.host||(n.protocol="file:"),n)}class o5e{constructor(t){this.source=t,this.url=i5e(t.url),this.isHttp=this.url.protocol==="http:"||this.url.protocol==="https:",this.isFsUrl=this.url.protocol==="file:",this.httpHeaders=this.isHttp&&t.httpHeaders||{},this._fullRequestReader=null,this._rangeRequestReaders=[]}get _progressiveDataLength(){var t;return((t=this._fullRequestReader)==null?void 0:t._loaded)??0}getFullReader(){return ni(!this._fullRequestReader,"PDFNodeStream.getFullReader can only be called once."),this._fullRequestReader=this.isFsUrl?new c5e(this):new a5e(this),this._fullRequestReader}getRangeReader(t,n){if(n<=this._progressiveDataLength)return null;const r=this.isFsUrl?new u5e(this,t,n):new l5e(this,t,n);return this._rangeRequestReaders.push(r),r}cancelAllRequests(t){var n;(n=this._fullRequestReader)==null||n.cancel(t);for(const r of this._rangeRequestReaders.slice(0))r.cancel(t)}}class Qde{constructor(t){this._url=t.url,this._done=!1,this._storedError=null,this.onProgress=null;const n=t.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 t=this._readableStream.read();return t===null?(this._readCapability=Promise.withResolvers(),this.read()):(this._loaded+=t.length,(r=this.onProgress)==null||r.call(this,{loaded:this._loaded,total:this._contentLength}),{value:new Uint8Array(t).buffer,done:!1})}cancel(t){if(!this._readableStream){this._error(t);return}this._readableStream.destroy(t)}_error(t){this._storedError=t,this._readCapability.resolve()}_setReadableStream(t){this._readableStream=t,t.on("readable",()=>{this._readCapability.resolve()}),t.on("end",()=>{t.destroy(),this._done=!0,this._readCapability.resolve()}),t.on("error",n=>{this._error(n)}),!this._isStreamingSupported&&this._isRangeSupported&&this._error(new Sy("streaming is disabled")),this._storedError&&this._readableStream.destroy(this._storedError)}}class Zde{constructor(t){this._url=t.url,this._done=!1,this._storedError=null,this.onProgress=null,this._loaded=0,this._readableStream=null,this._readCapability=Promise.withResolvers();const n=t.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 t=this._readableStream.read();return t===null?(this._readCapability=Promise.withResolvers(),this.read()):(this._loaded+=t.length,(r=this.onProgress)==null||r.call(this,{loaded:this._loaded}),{value:new Uint8Array(t).buffer,done:!1})}cancel(t){if(!this._readableStream){this._error(t);return}this._readableStream.destroy(t)}_error(t){this._storedError=t,this._readCapability.resolve()}_setReadableStream(t){this._readableStream=t,t.on("readable",()=>{this._readCapability.resolve()}),t.on("end",()=>{t.destroy(),this._done=!0,this._readCapability.resolve()}),t.on("error",n=>{this._error(n)}),this._storedError&&this._readableStream.destroy(this._storedError)}}function lk(e,t){return{protocol:e.protocol,auth:e.auth,host:e.hostname,port:e.port,path:e.path,method:"GET",headers:t}}class a5e extends Qde{constructor(t){super(t);const n=r=>{if(r.statusCode===404){const a=new wy(`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}=IW({getResponseHeader:s,isHttp:t.isHttp,rangeChunkSize:this._rangeChunkSize,disableRange:this._disableRange});this._isRangeSupported=i,this._contentLength=o||this._contentLength,this._filename=LW(s)};if(this._request=null,this._url.protocol==="http:"){const r=Mu.get("http");this._request=r.request(lk(this._url,t.httpHeaders),n)}else{const r=Mu.get("https");this._request=r.request(lk(this._url,t.httpHeaders),n)}this._request.on("error",r=>{this._storedError=r,this._headersCapability.reject(r)}),this._request.end()}}class l5e extends Zde{constructor(t,n,r){super(t),this._httpHeaders={};for(const i in t.httpHeaders){const o=t.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 wy(`Missing PDF "${this._url}".`);this._storedError=o;return}this._setReadableStream(i)};if(this._request=null,this._url.protocol==="http:"){const i=Mu.get("http");this._request=i.request(lk(this._url,this._httpHeaders),s)}else{const i=Mu.get("https");this._request=i.request(lk(this._url,this._httpHeaders),s)}this._request.on("error",i=>{this._storedError=i}),this._request.end()}}class c5e extends Qde{constructor(t){super(t);let n=decodeURIComponent(this._url.path);Xde.test(this._url.href)&&(n=n.replace(/^\//,""));const r=Mu.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 wy(`Missing PDF "${n}".`)),this._storedError=s,this._headersCapability.reject(s)})}}class u5e extends Zde{constructor(t,n,r){super(t);let s=decodeURIComponent(this._url.path);Xde.test(this._url.href)&&(s=s.replace(/^\//,""));const i=Mu.get("fs");this._setReadableStream(i.createReadStream(s,{start:n,end:r-1}))}}const d5e=1e5,$o=30,f5e=.8;var CX,Ih,Ho,TE,kE,Wg,tf,DE,OE,qg,y0,b0,Lh,x0,ME,_0,Gg,IE,LE,Zs,Kg,Yg,jh,w0,Ff,Jde,efe,R5,Au,pN,tfe,nfe;let ck=(Zs=class{constructor({textContentSource:t,container:n,viewport:r}){G(this,Ff);G(this,Ih,Promise.withResolvers());G(this,Ho,null);G(this,TE,!1);G(this,kE,!!((CX=globalThis.FontInspector)!=null&&CX.enabled));G(this,Wg,null);G(this,tf,null);G(this,DE,0);G(this,OE,0);G(this,qg,null);G(this,y0,null);G(this,b0,0);G(this,Lh,0);G(this,x0,Object.create(null));G(this,ME,[]);G(this,_0,null);G(this,Gg,[]);G(this,IE,new WeakMap);G(this,LE,null);var c;if(t instanceof ReadableStream)V(this,_0,t);else if(typeof t=="object")V(this,_0,new ReadableStream({start(d){d.enqueue(t),d.close()}}));else throw new Error('No "textContentSource" parameter specified.');V(this,Ho,V(this,y0,n)),V(this,Lh,r.scale*(globalThis.devicePixelRatio||1)),V(this,b0,r.rotation),V(this,tf,{prevFontSize:null,prevFontFamily:null,div:null,properties:null,ctx:null});const{pageWidth:s,pageHeight:i,pageX:o,pageY:a}=r.rawDims;V(this,LE,[1,0,0,-1,-o,a+i]),V(this,OE,s),V(this,DE,i),K(c=Zs,Au,tfe).call(c),Xv(n,r),P(this,Ih).promise.catch(()=>{}).then(()=>{P(Zs,w0).delete(this),V(this,tf,null),V(this,x0,null)})}render(){const t=()=>{P(this,qg).read().then(({value:n,done:r})=>{if(r){P(this,Ih).resolve();return}P(this,Wg)??V(this,Wg,n.lang),Object.assign(P(this,x0),n.styles),K(this,Ff,Jde).call(this,n.items),t()},P(this,Ih).reject)};return V(this,qg,P(this,_0).getReader()),P(Zs,w0).add(this),t(),P(this,Ih).promise}update({viewport:t,onBefore:n=null}){var i;const r=t.scale*(globalThis.devicePixelRatio||1),s=t.rotation;if(s!==P(this,b0)&&(n==null||n(),V(this,b0,s),Xv(P(this,y0),{rotation:s})),r!==P(this,Lh)){n==null||n(),V(this,Lh,r);const o={prevFontSize:null,prevFontFamily:null,div:null,properties:null,ctx:K(i=Zs,Au,pN).call(i,P(this,Wg))};for(const a of P(this,Gg))o.properties=P(this,IE).get(a),o.div=a,K(this,Ff,R5).call(this,o)}}cancel(){var n;const t=new Sy("TextLayer task cancelled.");(n=P(this,qg))==null||n.cancel(t).catch(()=>{}),V(this,qg,null),P(this,Ih).reject(t)}get textDivs(){return P(this,Gg)}get textContentItemsStr(){return P(this,ME)}static cleanup(){if(!(P(this,w0).size>0)){P(this,Kg).clear();for(const{canvas:t}of P(this,Yg).values())t.remove();P(this,Yg).clear()}}},Ih=new WeakMap,Ho=new WeakMap,TE=new WeakMap,kE=new WeakMap,Wg=new WeakMap,tf=new WeakMap,DE=new WeakMap,OE=new WeakMap,qg=new WeakMap,y0=new WeakMap,b0=new WeakMap,Lh=new WeakMap,x0=new WeakMap,ME=new WeakMap,_0=new WeakMap,Gg=new WeakMap,IE=new WeakMap,LE=new WeakMap,Kg=new WeakMap,Yg=new WeakMap,jh=new WeakMap,w0=new WeakMap,Ff=new WeakSet,Jde=function(t){var s,i;if(P(this,TE))return;(i=P(this,tf)).ctx??(i.ctx=K(s=Zs,Au,pN).call(s,P(this,Wg)));const n=P(this,Gg),r=P(this,ME);for(const o of t){if(n.length>d5e){nn("Ignoring additional textDivs for performance reasons."),V(this,TE,!0);return}if(o.str===void 0){if(o.type==="beginMarkedContentProps"||o.type==="beginMarkedContent"){const a=P(this,Ho);V(this,Ho,document.createElement("span")),P(this,Ho).classList.add("markedContent"),o.id!==null&&P(this,Ho).setAttribute("id",`${o.id}`),a.append(P(this,Ho))}else o.type==="endMarkedContent"&&V(this,Ho,P(this,Ho).parentNode);continue}r.push(o.str),K(this,Ff,efe).call(this,o)}},efe=function(t){var m;const n=document.createElement("span"),r={angle:0,canvasWidth:0,hasText:t.str!=="",hasEOL:t.hasEOL,fontSize:0};P(this,Gg).push(n);const s=xt.transform(P(this,LE),t.transform);let i=Math.atan2(s[1],s[0]);const o=P(this,x0)[t.fontName];o.vertical&&(i+=Math.PI/2);const a=P(this,kE)&&o.fontSubstitution||o.fontFamily,c=Math.hypot(s[2],s[3]),d=c*K(m=Zs,Au,nfe).call(m,a,P(this,Wg));let h,u;i===0?(h=s[4],u=s[5]-d):(h=s[4]+d*Math.sin(i),u=s[5]-d*Math.cos(i));const f="calc(var(--scale-factor)*",g=n.style;P(this,Ho)===P(this,y0)?(g.left=`${(100*h/P(this,OE)).toFixed(2)}%`,g.top=`${(100*u/P(this,DE)).toFixed(2)}%`):(g.left=`${f}${h.toFixed(2)}px)`,g.top=`${f}${u.toFixed(2)}px)`),g.fontSize=`${f}${(P(Zs,jh)*c).toFixed(2)}px)`,g.fontFamily=a,r.fontSize=c,n.setAttribute("role","presentation"),n.textContent=t.str,n.dir=t.dir,P(this,kE)&&(n.dataset.fontName=o.fontSubstitutionLoadedName||t.fontName),i!==0&&(r.angle=i*(180/Math.PI));let v=!1;if(t.str.length>1)v=!0;else if(t.str!==" "&&t.transform[0]!==t.transform[3]){const x=Math.abs(t.transform[0]),y=Math.abs(t.transform[3]);x!==y&&Math.max(x,y)/Math.min(x,y)>1.5&&(v=!0)}if(v&&(r.canvasWidth=o.vertical?t.height:t.width),P(this,IE).set(n,r),P(this,tf).div=n,P(this,tf).properties=r,K(this,Ff,R5).call(this,P(this,tf)),r.hasText&&P(this,Ho).append(n),r.hasEOL){const x=document.createElement("br");x.setAttribute("role","presentation"),P(this,Ho).append(x)}},R5=function(t){const{div:n,properties:r,ctx:s,prevFontSize:i,prevFontFamily:o}=t,{style:a}=n;let c="";if(P(Zs,jh)>1&&(c=`scale(${1/P(Zs,jh)})`),r.canvasWidth!==0&&r.hasText){const{fontFamily:d}=a,{canvasWidth:h,fontSize:u}=r;(i!==u||o!==d)&&(s.font=`${u*P(this,Lh)}px ${d}`,t.prevFontSize=u,t.prevFontFamily=d);const{width:f}=s.measureText(n.textContent);f>0&&(c=`scaleX(${h*P(this,Lh)/f}) ${c}`)}r.angle!==0&&(c=`rotate(${r.angle}deg) ${c}`),c.length>0&&(a.transform=c)},Au=new WeakSet,pN=function(t=null){let n=P(this,Yg).get(t||(t=""));if(!n){const r=document.createElement("canvas");r.className="hiddenCanvasElement",r.lang=t,document.body.append(r),n=r.getContext("2d",{alpha:!1,willReadFrequently:!0}),P(this,Yg).set(t,n)}return n},tfe=function(){if(P(this,jh)!==null)return;const t=document.createElement("div");t.style.opacity=0,t.style.lineHeight=1,t.style.fontSize="1px",t.textContent="X",document.body.append(t),V(this,jh,t.getBoundingClientRect().height),t.remove()},nfe=function(t,n){const r=P(this,Kg).get(t);if(r)return r;const s=K(this,Au,pN).call(this,n),i=s.font;s.canvas.width=s.canvas.height=$o,s.font=`${$o}px ${t}`;const o=s.measureText("");let a=o.fontBoundingBoxAscent,c=Math.abs(o.fontBoundingBoxDescent);if(a){const u=a/(a+c);return P(this,Kg).set(t,u),s.canvas.width=s.canvas.height=0,s.font=i,u}s.strokeStyle="red",s.clearRect(0,0,$o,$o),s.strokeText("g",0,0);let d=s.getImageData(0,0,$o,$o).data;c=0;for(let u=d.length-1-3;u>=0;u-=4)if(d[u]>0){c=Math.ceil(u/4/$o);break}s.clearRect(0,0,$o,$o),s.strokeText("A",0,$o),d=s.getImageData(0,0,$o,$o).data,a=0;for(let u=0,f=d.length;u<f;u+=4)if(d[u]>0){a=$o-Math.floor(u/4/$o);break}s.canvas.width=s.canvas.height=0,s.font=i;const h=a?a/(a+c):f5e;return P(this,Kg).set(t,h),h},G(Zs,Au),G(Zs,Kg,new Map),G(Zs,Yg,new Map),G(Zs,jh,null),G(Zs,w0,new Set),Zs);function h5e(){pde("`renderTextLayer`, please use `TextLayer` instead.");const{textContentSource:e,container:t,viewport:n,...r}=arguments[0],s=Object.keys(r);s.length>0&&nn("Ignoring `renderTextLayer` parameters: "+s.join(", "));const i=new ck({textContentSource:e,container:t,viewport:n}),{textDivs:o,textContentItemsStr:a}=i;return{promise:i.render(),textDivs:o,textContentItemsStr:a}}function p5e(){pde("`updateTextLayer`, please use `TextLayer` instead.")}class $C{static textContent(t){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($C.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 d of i.children)s(d)}return s(t),r}static shouldBuildText(t){return!(t==="textarea"||t==="input"||t==="option"||t==="select")}}const m5e=65536,g5e=100,v5e=5e3,y5e=ro?NUe:gUe,b5e=ro?TUe:fde,x5e=ro?PUe:mUe,_5e=ro?kUe:hde;function w5e(e={}){typeof e=="string"||e instanceof URL?e={url:e}:(e instanceof ArrayBuffer||ArrayBuffer.isView(e))&&(e={data:e});const t=new P5,{docId:n}=t,r=e.url?S5e(e.url):null,s=e.data?C5e(e.data):null,i=e.httpHeaders||null,o=e.withCredentials===!0,a=e.password??null,c=e.range instanceof rfe?e.range:null,d=Number.isInteger(e.rangeChunkSize)&&e.rangeChunkSize>0?e.rangeChunkSize:m5e;let h=e.worker instanceof zb?e.worker:null;const u=e.verbosity,f=typeof e.docBaseUrl=="string"&&!kW(e.docBaseUrl)?e.docBaseUrl:null,g=typeof e.cMapUrl=="string"?e.cMapUrl:null,v=e.cMapPacked!==!1,m=e.CMapReaderFactory||b5e,x=typeof e.standardFontDataUrl=="string"?e.standardFontDataUrl:null,y=e.StandardFontDataFactory||_5e,b=e.stopAtErrors!==!0,w=Number.isInteger(e.maxImageSize)&&e.maxImageSize>-1?e.maxImageSize:-1,E=e.isEvalSupported!==!1,R=typeof e.isOffscreenCanvasSupported=="boolean"?e.isOffscreenCanvasSupported:!ro,T=Number.isInteger(e.canvasMaxAreaInBytes)?e.canvasMaxAreaInBytes:-1,N=typeof e.disableFontFace=="boolean"?e.disableFontFace:ro,A=e.fontExtraProperties===!0,D=e.enableXfa===!0,O=e.ownerDocument||globalThis.document,I=e.disableRange===!0,$=e.disableStream===!0,F=e.disableAutoFetch===!0,B=e.pdfBug===!0,W=e.enableHWA===!0,Z=c?c.length:e.length??NaN,Y=typeof e.useSystemFonts=="boolean"?e.useSystemFonts:!ro&&!N,H=typeof e.useWorkerFetch=="boolean"?e.useWorkerFetch:m===fde&&y===hde&&g&&x&&v1(g,document.baseURI)&&v1(x,document.baseURI),se=e.canvasFactory||new y5e({ownerDocument:O,enableHWA:W}),he=e.filterFactory||new x5e({docId:n,ownerDocument:O}),re=null;sUe(u);const J={canvasFactory:se,filterFactory:he};if(H||(J.cMapReaderFactory=new m({baseUrl:g,isCompressed:v}),J.standardFontDataFactory=new y({baseUrl:x})),!h){const be={verbosity:u,port:Rf.workerPort};h=be.port?zb.fromPort(be):new zb(be),t._worker=h}const te={docId:n,apiVersion:"4.4.168",data:s,password:a,disableAutoFetch:F,rangeChunkSize:d,length:Z,docBaseUrl:f,enableXfa:D,evaluatorOptions:{maxImageSize:w,disableFontFace:N,ignoreErrors:b,isEvalSupported:E,isOffscreenCanvasSupported:R,canvasMaxAreaInBytes:T,fontExtraProperties:A,useSystemFonts:Y,cMapUrl:H?g:null,standardFontDataUrl:H?x:null}},ae={disableFontFace:N,fontExtraProperties:A,ownerDocument:O,pdfBug:B,styleElement:re,loadingParams:{disableAutoFetch:F,enableXfa:D}};return h.promise.then(function(){if(t.destroyed)throw new Error("Loading aborted");if(h.destroyed)throw new Error("Worker was destroyed");const be=h.messageHandler.sendWithPromise("GetDocRequest",te,s?[s.buffer]:null);let xe;if(c)xe=new KUe(c,{disableRange:I,disableStream:$});else if(!s){if(!r)throw new Error("getDocument - no `url` parameter provided.");xe=(Pe=>ro?function(){return typeof fetch<"u"&&typeof Response<"u"&&"body"in Response.prototype}()&&v1(Pe.url)?new JK(Pe):new o5e(Pe):v1(Pe.url)?new JK(Pe):new n5e(Pe))({url:r,length:Z,httpHeaders:i,withCredentials:o,rangeChunkSize:d,disableRange:I,disableStream:$})}return be.then(ve=>{if(t.destroyed)throw new Error("Loading aborted");if(h.destroyed)throw new Error("Worker was destroyed");const Pe=new x1(n,ve,h.port),Oe=new P5e(Pe,t,xe,ae,J);t._transport=Oe,Pe.send("Ready",null)})}).catch(t._capability.reject),t}function S5e(e){if(e instanceof URL)return e.href;try{return new URL(e,window.location).href}catch{if(ro&&typeof e=="string")return e}throw new Error("Invalid PDF url data: either string or URL-object is expected in the url property.")}function C5e(e){if(ro&&typeof Buffer<"u"&&e instanceof Buffer)throw new Error("Please provide binary data as `Uint8Array`, rather than `Buffer`.");if(e instanceof Uint8Array&&e.byteLength===e.buffer.byteLength)return e;if(typeof e=="string")return BO(e);if(e instanceof ArrayBuffer||ArrayBuffer.isView(e)||typeof e=="object"&&!isNaN(e==null?void 0:e.length))return new Uint8Array(e);throw new Error("Invalid PDF binary data: either TypedArray, string, or array-like object is expected in the data property.")}function eY(e){return typeof e=="object"&&Number.isInteger(e==null?void 0:e.num)&&e.num>=0&&Number.isInteger(e==null?void 0:e.gen)&&e.gen>=0}var Mk;const Ik=class Ik{constructor(){this._capability=Promise.withResolvers(),this._transport=null,this._worker=null,this.docId=`d${Ui(Ik,Mk)._++}`,this.destroyed=!1,this.onPassword=null,this.onProgress=null}get promise(){return this._capability.promise}async destroy(){var t,n,r;this.destroyed=!0;try{(t=this._worker)!=null&&t.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)}};Mk=new WeakMap,G(Ik,Mk,0);let P5=Ik,rfe=class{constructor(t,n,r=!1,s=null){this.length=t,this.initialData=n,this.progressiveDone=r,this.contentDispositionFilename=s,this._rangeListeners=[],this._progressListeners=[],this._progressiveReadListeners=[],this._progressiveDoneListeners=[],this._readyCapability=Promise.withResolvers()}addRangeListener(t){this._rangeListeners.push(t)}addProgressListener(t){this._progressListeners.push(t)}addProgressiveReadListener(t){this._progressiveReadListeners.push(t)}addProgressiveDoneListener(t){this._progressiveDoneListeners.push(t)}onDataRange(t,n){for(const r of this._rangeListeners)r(t,n)}onDataProgress(t,n){this._readyCapability.promise.then(()=>{for(const r of this._progressListeners)r(t,n)})}onDataProgressiveRead(t){this._readyCapability.promise.then(()=>{for(const n of this._progressiveReadListeners)n(t)})}onDataProgressiveDone(){this._readyCapability.promise.then(()=>{for(const t of this._progressiveDoneListeners)t()})}transportReady(){this._readyCapability.resolve()}requestDataRange(t,n){lr("Abstract method PDFDataRangeTransport.requestDataRange")}abort(){}};class E5e{constructor(t,n){this._pdfInfo=t,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 An(this,"isPureXfa",!!this._transport._htmlForXfa)}get allXfaHtml(){return this._transport._htmlForXfa}getPage(t){return this._transport.getPage(t)}getPageIndex(t){return this._transport.getPageIndex(t)}getDestinations(){return this._transport.getDestinations()}getDestination(t){return this._transport.getDestination(t)}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:t="display"}={}){const{renderingIntent:n}=this._transport.getRenderingIntent(t);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(t=!1){return this._transport.startCleanup(t||this.isPureXfa)}destroy(){return this.loadingTask.destroy()}cachedPageNumber(t){return this._transport.cachedPageNumber(t)}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 $h,nf,vl,tb,mN;class A5e{constructor(t,n,r,s=!1){G(this,vl);G(this,$h,null);G(this,nf,!1);this._pageIndex=t,this._pageInfo=n,this._transport=r,this._stats=s?new zK:null,this._pdfBug=s,this.commonObjs=r.commonObjs,this.objs=new sfe,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:t,rotation:n=this.rotate,offsetX:r=0,offsetY:s=0,dontFlip:i=!1}={}){return new yR({viewBox:this.view,scale:t,rotation:n,offsetX:r,offsetY:s,dontFlip:i})}getAnnotations({intent:t="display"}={}){const{renderingIntent:n}=this._transport.getRenderingIntent(t);return this._transport.getAnnotations(this._pageIndex,n)}getJSActions(){return this._transport.getPageJSActions(this._pageIndex)}get filterFactory(){return this._transport.filterFactory}get isPureXfa(){return An(this,"isPureXfa",!!this._transport._htmlForXfa)}async getXfa(){var t;return((t=this._transport._htmlForXfa)==null?void 0:t.children[this._pageIndex])||null}render({canvasContext:t,viewport:n,intent:r="display",annotationMode:s=yh.ENABLE,transform:i=null,background:o=null,optionalContentConfigPromise:a=null,annotationCanvasMap:c=null,pageColors:d=null,printAnnotationStorage:h=null}){var w,E;(w=this._stats)==null||w.time("Overall");const u=this._transport.getRenderingIntent(r,s,h),{renderingIntent:f,cacheKey:g}=u;V(this,nf,!1),K(this,vl,mN).call(this),a||(a=this._transport.getOptionalContentConfig(f));let v=this._intentStates.get(g);v||(v=Object.create(null),this._intentStates.set(g,v)),v.streamReaderCancelTimeout&&(clearTimeout(v.streamReaderCancelTimeout),v.streamReaderCancelTimeout=null);const m=!!(f&ul.PRINT);v.displayReadyCapability||(v.displayReadyCapability=Promise.withResolvers(),v.operatorList={fnArray:[],argsArray:[],lastChunk:!1,separateAnnots:null},(E=this._stats)==null||E.time("Page Request"),this._pumpOperatorList(u));const x=R=>{var T;v.renderTasks.delete(y),(this._maybeCleanupAfterRender||m)&&V(this,nf,!0),K(this,vl,tb).call(this,!m),R?(y.capability.reject(R),this._abortOperatorList({intentState:v,reason:R instanceof Error?R:new Error(R)})):y.capability.resolve(),this._stats&&(this._stats.timeEnd("Rendering"),this._stats.timeEnd("Overall"),(T=globalThis.Stats)!=null&&T.enabled&&globalThis.Stats.add(this.pageNumber,this._stats))},y=new T5({callback:x,params:{canvasContext:t,viewport:n,transform:i,background:o},objs:this.objs,commonObjs:this.commonObjs,annotationCanvasMap:c,operatorList:v.operatorList,pageIndex:this._pageIndex,canvasFactory:this._transport.canvasFactory,filterFactory:this._transport.filterFactory,useRequestAnimationFrame:!m,pdfBug:this._pdfBug,pageColors:d});(v.renderTasks||(v.renderTasks=new Set)).add(y);const b=y.task;return Promise.all([v.displayReadyCapability.promise,a]).then(([R,T])=>{var N;if(this.destroyed){x();return}if((N=this._stats)==null||N.time("Rendering"),!(T.renderingIntent&f))throw new Error("Must use the same `intent`-argument when calling the `PDFPageProxy.render` and `PDFDocumentProxy.getOptionalContentConfig` methods.");y.initializeGraphics({transparency:R,optionalContentConfig:T}),y.operatorListChanged()}).catch(x),b}getOperatorList({intent:t="display",annotationMode:n=yh.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(t,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:t=!1,disableNormalization:n=!1}={}){return this._transport.messageHandler.sendWithStream("GetTextContent",{pageIndex:this._pageIndex,includeMarkedContent:t===!0,disableNormalization:n===!0},{highWaterMark:100,size(s){return s.items.length}})}getTextContent(t={}){if(this._transport._htmlForXfa)return this.getXfa().then(r=>$C.textContent(r));const n=this.streamTextContent(t);return new Promise(function(r,s){function i(){o.read().then(function({value:c,done:d}){if(d){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 t=[];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)t.push(r.completed),r.cancel();return this.objs.clear(),V(this,nf,!1),K(this,vl,mN).call(this),Promise.all(t)}cleanup(t=!1){V(this,nf,!0);const n=K(this,vl,tb).call(this,!1);return t&&n&&this._stats&&(this._stats=new zK),n}_startRenderPage(t,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(t))}_renderPageChunk(t,n){for(let r=0,s=t.length;r<s;r++)n.operatorList.fnArray.push(t.fnArray[r]),n.operatorList.argsArray.push(t.argsArray[r]);n.operatorList.lastChunk=t.lastChunk,n.operatorList.separateAnnots=t.separateAnnots;for(const r of n.renderTasks)r.operatorListChanged();t.lastChunk&&K(this,vl,tb).call(this,!0)}_pumpOperatorList({renderingIntent:t,cacheKey:n,annotationStorageSerializable:r}){const{map:s,transfer:i}=r,a=this._transport.messageHandler.sendWithStream("GetOperatorList",{pageIndex:this._pageIndex,intent:t,cacheKey:n,annotationStorage:s},i).getReader(),c=this._intentStates.get(n);c.streamReader=a;const d=()=>{a.read().then(({value:h,done:u})=>{if(u){c.streamReader=null;return}this._transport.destroyed||(this._renderPageChunk(h,c),d())},h=>{if(c.streamReader=null,!this._transport.destroyed){if(c.operatorList){c.operatorList.lastChunk=!0;for(const u of c.renderTasks)u.operatorListChanged();K(this,vl,tb).call(this,!0)}if(c.displayReadyCapability)c.displayReadyCapability.reject(h);else if(c.opListReadCapability)c.opListReadCapability.reject(h);else throw h}})};d()}_abortOperatorList({intentState:t,reason:n,force:r=!1}){if(t.streamReader){if(t.streamReaderCancelTimeout&&(clearTimeout(t.streamReaderCancelTimeout),t.streamReaderCancelTimeout=null),!r){if(t.renderTasks.size>0)return;if(n instanceof TW){let s=g5e;n.extraDelay>0&&n.extraDelay<1e3&&(s+=n.extraDelay),t.streamReaderCancelTimeout=setTimeout(()=>{t.streamReaderCancelTimeout=null,this._abortOperatorList({intentState:t,reason:n,force:!0})},s);return}}if(t.streamReader.cancel(new Sy(n.message)).catch(()=>{}),t.streamReader=null,!this._transport.destroyed){for(const[s,i]of this._intentStates)if(i===t){this._intentStates.delete(s);break}this.cleanup()}}}get stats(){return this._stats}}$h=new WeakMap,nf=new WeakMap,vl=new WeakSet,tb=function(t=!1){if(K(this,vl,mN).call(this),!P(this,nf)||this.destroyed)return!1;if(t)return V(this,$h,setTimeout(()=>{V(this,$h,null),K(this,vl,tb).call(this,!1)},v5e)),!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(),V(this,nf,!1),!0},mN=function(){P(this,$h)&&(clearTimeout(P(this,$h)),V(this,$h,null))};var Xg,Lk;class R5e{constructor(){G(this,Xg,new Set);G(this,Lk,Promise.resolve())}postMessage(t,n){const r={data:structuredClone(t,n?{transfer:n}:null)};P(this,Lk).then(()=>{for(const s of P(this,Xg))s.call(this,r)})}addEventListener(t,n){P(this,Xg).add(n)}removeEventListener(t,n){P(this,Xg).delete(n)}terminate(){P(this,Xg).clear()}}Xg=new WeakMap,Lk=new WeakMap;const Hd={isWorkerDisabled:!1,fakeWorkerId:0};ro&&(Hd.isWorkerDisabled=!0,Rf.workerSrc||(Rf.workerSrc="./pdf.worker.mjs")),Hd.isSameOrigin=function(e,t){let n;try{if(n=new URL(e),!n.origin||n.origin==="null")return!1}catch{return!1}const r=new URL(t,n);return n.origin===r.origin},Hd.createCDNWrapper=function(e){const t=`await import("${e}");`;return URL.createObjectURL(new Blob([t],{type:"text/javascript"}))};var Qg,S0,gN,C0,vN;const ka=class ka{constructor({name:t=null,port:n=null,verbosity:r=iUe()}={}){G(this,S0);var s;if(this.name=t,this.destroyed=!1,this.verbosity=r,this._readyCapability=Promise.withResolvers(),this._port=null,this._webWorker=null,this._messageHandler=null,n){if((s=P(ka,Qg))!=null&&s.has(n))throw new Error("Cannot use more than one PDFWorker per port.");(P(ka,Qg)||V(ka,Qg,new WeakMap)).set(n,this),this._initializeFromPort(n);return}this._initialize()}get promise(){return ro?Promise.all([Mu.promise,this._readyCapability.promise]):this._readyCapability.promise}get port(){return this._port}get messageHandler(){return this._messageHandler}_initializeFromPort(t){this._port=t,this._messageHandler=new x1("main","worker",t),this._messageHandler.on("ready",function(){}),K(this,S0,gN).call(this)}_initialize(){if(Hd.isWorkerDisabled||P(ka,C0,vN)){this._setupFakeWorker();return}let{workerSrc:t}=ka;try{Hd.isSameOrigin(window.location.href,t)||(t=Hd.createCDNWrapper(new URL(t,window.location).href));const n=new Worker(t,{type:"module"}),r=new x1("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,K(this,S0,gN).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{FO("The worker has been disabled.")}this._setupFakeWorker()}_setupFakeWorker(){Hd.isWorkerDisabled||(nn("Setting up fake worker."),Hd.isWorkerDisabled=!0),ka._setupFakeWorkerGlobal.then(t=>{if(this.destroyed){this._readyCapability.reject(new Error("Worker was destroyed"));return}const n=new R5e;this._port=n;const r=`fake${Hd.fakeWorkerId++}`,s=new x1(r+"_worker",r,n);t.setup(s,n),this._messageHandler=new x1(r,r+"_worker",n),K(this,S0,gN).call(this)}).catch(t=>{this._readyCapability.reject(new Error(`Setting up fake worker failed: "${t.message}".`))})}destroy(){var t;this.destroyed=!0,this._webWorker&&(this._webWorker.terminate(),this._webWorker=null),(t=P(ka,Qg))==null||t.delete(this._port),this._port=null,this._messageHandler&&(this._messageHandler.destroy(),this._messageHandler=null)}static fromPort(t){var r;if(!(t!=null&&t.port))throw new Error("PDFWorker.fromPort - invalid method signature.");const n=(r=P(this,Qg))==null?void 0:r.get(t.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 ka(t)}static get workerSrc(){if(Rf.workerSrc)return Rf.workerSrc;throw new Error('No "GlobalWorkerOptions.workerSrc" specified.')}static get _setupFakeWorkerGlobal(){return An(this,"_setupFakeWorkerGlobal",(async()=>P(this,C0,vN)?P(this,C0,vN):(await import(this.workerSrc)).WorkerMessageHandler)())}};Qg=new WeakMap,S0=new WeakSet,gN=function(){this._readyCapability.resolve(),this._messageHandler.send("configure",{verbosity:this.verbosity})},C0=new WeakSet,vN=function(){var t;try{return((t=globalThis.pdfjsWorker)==null?void 0:t.WorkerMessageHandler)||null}catch{return null}},G(ka,C0),G(ka,Qg);let zb=ka;var rf,tu,E0,A0,nu,Zg,_1;class P5e{constructor(t,n,r,s,i){G(this,Zg);G(this,rf,new Map);G(this,tu,new Map);G(this,E0,new Map);G(this,A0,new Map);G(this,nu,null);this.messageHandler=t,this.loadingTask=n,this.commonObjs=new sfe,this.fontLoader=new AUe({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 An(this,"annotationStorage",new MW)}getRenderingIntent(t,n=yh.ENABLE,r=null,s=!1){let i=ul.DISPLAY,o=x5;switch(t){case"any":i=ul.ANY;break;case"display":break;case"print":i=ul.PRINT;break;default:nn(`getRenderingIntent - invalid intent: ${t}`)}switch(n){case yh.DISABLE:i+=ul.ANNOTATIONS_DISABLE;break;case yh.ENABLE:break;case yh.ENABLE_FORMS:i+=ul.ANNOTATIONS_FORMS;break;case yh.ENABLE_STORAGE:i+=ul.ANNOTATIONS_STORAGE,o=(i&ul.PRINT&&r instanceof Ude?r:this.annotationStorage).serializable;break;default:nn(`getRenderingIntent - invalid annotationMode: ${n}`)}return s&&(i+=ul.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=P(this,nu))==null||r.reject(new Error("Worker was destroyed during onPassword callback"));const t=[];for(const s of P(this,tu).values())t.push(s._destroy());P(this,tu).clear(),P(this,E0).clear(),P(this,A0).clear(),this.hasOwnProperty("annotationStorage")&&this.annotationStorage.resetModified();const n=this.messageHandler.sendWithPromise("Terminate",null);return t.push(n),Promise.all(t).then(()=>{var s;this.commonObjs.clear(),this.fontLoader.clear(),P(this,rf).clear(),this.filterFactory.destroy(),ck.cleanup(),(s=this._networkStream)==null||s.cancelAllRequests(new Sy("Worker was terminated.")),this.messageHandler&&(this.messageHandler.destroy(),this.messageHandler=null),this.destroyCapability.resolve()},this.destroyCapability.reject),this.destroyCapability.promise}setupMessageHandler(){const{messageHandler:t,loadingTask:n}=this;t.on("GetReader",(r,s)=>{ni(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}ni(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})}}),t.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}),t.on("GetRangeReader",(r,s)=>{ni(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}ni(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})}}),t.on("GetDoc",({pdfInfo:r})=>{this._numPages=r.numPages,this._htmlForXfa=r.htmlForXfa,delete r.htmlForXfa,n._capability.resolve(new E5e(r,this))}),t.on("DocException",function(r){let s;switch(r.name){case"PasswordException":s=new QU(r.message,r.code);break;case"InvalidPDFException":s=new lde(r.message);break;case"MissingPDFException":s=new wy(r.message);break;case"UnexpectedResponseException":s=new zO(r.message,r.status);break;case"UnknownErrorException":s=new ZU(r.message,r.details);break;default:lr("DocException - expected a valid Error.")}n._capability.reject(s)}),t.on("PasswordRequest",r=>{if(V(this,nu,Promise.withResolvers()),n.onPassword){const s=i=>{i instanceof Error?P(this,nu).reject(i):P(this,nu).resolve({password:i})};try{n.onPassword(s,r.code)}catch(i){P(this,nu).reject(i)}}else P(this,nu).reject(new QU(r.message,r.code));return P(this,nu).promise}),t.on("DataLoaded",r=>{var s;(s=n.onProgress)==null||s.call(n,{loaded:r.length,total:r.length}),this.downloadInfoCapability.resolve(r)}),t.on("StartRenderPage",r=>{if(this.destroyed)return;P(this,tu).get(r.pageIndex)._startRenderPage(r.transparency,r.cacheKey)}),t.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:d}=this._params;if("error"in i){const g=i.error;nn(`Error during font loading: ${g}`),this.commonObjs.resolve(r,g);break}const h=d&&((o=globalThis.FontInspector)!=null&&o.enabled)?(g,v)=>globalThis.FontInspector.fontAdded(g,v):null,u=new RUe(i,{disableFontFace:a,inspectFont:h});this.fontLoader.bind(u).catch(()=>t.sendWithPromise("FontFallback",{id:r})).finally(()=>{!c&&u.data&&(u.data=null),this.commonObjs.resolve(r,u)});break;case"CopyLocalImage":const{imageRef:f}=i;ni(f,"The imageRef must be defined.");for(const g of P(this,tu).values())for(const[,v]of g.objs)if((v==null?void 0:v.ref)===f)return v.dataLen?(this.commonObjs.resolve(r,structuredClone(v)),v.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}),t.on("obj",([r,s,i,o])=>{var c;if(this.destroyed)return;const a=P(this,tu).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)>eUe&&(a._maybeCleanupAfterRender=!0);break;case"Pattern":a.objs.resolve(r,o);break;default:throw new Error(`Got unknown object type ${i}`)}}}),t.on("DocProgress",r=>{var s;this.destroyed||(s=n.onProgress)==null||s.call(n,{loaded:r.loaded,total:r.total})}),t.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."))),t.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&&nn("saveDocument called while `annotationStorage` is empty, please use the getData-method instead.");const{map:t,transfer:n}=this.annotationStorage.serializable;return this.messageHandler.sendWithPromise("SaveDocument",{isPureXfa:!!this._htmlForXfa,numPages:this._numPages,annotationStorage:t,filename:((r=this._fullReader)==null?void 0:r.filename)??null},n).finally(()=>{this.annotationStorage.resetModified()})}getPage(t){if(!Number.isInteger(t)||t<=0||t>this._numPages)return Promise.reject(new Error("Invalid page request."));const n=t-1,r=P(this,E0).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&&P(this,A0).set(i.refStr,t);const o=new A5e(n,i,this,this._params.pdfBug);return P(this,tu).set(n,o),o});return P(this,E0).set(n,s),s}getPageIndex(t){return eY(t)?this.messageHandler.sendWithPromise("GetPageIndex",{num:t.num,gen:t.gen}):Promise.reject(new Error("Invalid pageIndex request."))}getAnnotations(t,n){return this.messageHandler.sendWithPromise("GetAnnotations",{pageIndex:t,intent:n})}getFieldObjects(){return K(this,Zg,_1).call(this,"GetFieldObjects")}hasJSActions(){return K(this,Zg,_1).call(this,"HasJSActions")}getCalculationOrderIds(){return this.messageHandler.sendWithPromise("GetCalculationOrderIds",null)}getDestinations(){return this.messageHandler.sendWithPromise("GetDestinations",null)}getDestination(t){return typeof t!="string"?Promise.reject(new Error("Invalid destination request.")):this.messageHandler.sendWithPromise("GetDestination",{id:t})}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 K(this,Zg,_1).call(this,"GetDocJSActions")}getPageJSActions(t){return this.messageHandler.sendWithPromise("GetPageJSActions",{pageIndex:t})}getStructTree(t){return this.messageHandler.sendWithPromise("GetStructTree",{pageIndex:t})}getOutline(){return this.messageHandler.sendWithPromise("GetOutline",null)}getOptionalContentConfig(t){return K(this,Zg,_1).call(this,"GetOptionalContentConfig").then(n=>new GUe(n,t))}getPermissions(){return this.messageHandler.sendWithPromise("GetPermissions",null)}getMetadata(){const t="GetMetadata",n=P(this,rf).get(t);if(n)return n;const r=this.messageHandler.sendWithPromise(t,null).then(s=>{var i,o;return{info:s[0],metadata:s[1]?new WUe(s[1]):null,contentDispositionFilename:((i=this._fullReader)==null?void 0:i.filename)??null,contentLength:((o=this._fullReader)==null?void 0:o.contentLength)??null}});return P(this,rf).set(t,r),r}getMarkInfo(){return this.messageHandler.sendWithPromise("GetMarkInfo",null)}async startCleanup(t=!1){if(!this.destroyed){await this.messageHandler.sendWithPromise("Cleanup",null);for(const n of P(this,tu).values())if(!n.cleanup())throw new Error(`startCleanup: Page ${n.pageNumber} is currently rendering.`);this.commonObjs.clear(),t||this.fontLoader.clear(),P(this,rf).clear(),this.filterFactory.destroy(!0),ck.cleanup()}}cachedPageNumber(t){if(!eY(t))return null;const n=t.gen===0?`${t.num}R`:`${t.num}R${t.gen}`;return P(this,A0).get(n)??null}}rf=new WeakMap,tu=new WeakMap,E0=new WeakMap,A0=new WeakMap,nu=new WeakMap,Zg=new WeakSet,_1=function(t,n=null){const r=P(this,rf).get(t);if(r)return r;const s=this.messageHandler.sendWithPromise(t,n);return P(this,rf).set(t,s),s};const TP=Symbol("INITIAL_DATA");var rc,jE,N5;class sfe{constructor(){G(this,jE);G(this,rc,Object.create(null))}get(t,n=null){if(n){const s=K(this,jE,N5).call(this,t);return s.promise.then(()=>n(s.data)),null}const r=P(this,rc)[t];if(!r||r.data===TP)throw new Error(`Requesting object that isn't resolved yet ${t}.`);return r.data}has(t){const n=P(this,rc)[t];return!!n&&n.data!==TP}resolve(t,n=null){const r=K(this,jE,N5).call(this,t);r.data=n,r.resolve()}clear(){var t;for(const n in P(this,rc)){const{data:r}=P(this,rc)[n];(t=r==null?void 0:r.bitmap)==null||t.close()}V(this,rc,Object.create(null))}*[Symbol.iterator](){for(const t in P(this,rc)){const{data:n}=P(this,rc)[t];n!==TP&&(yield[t,n])}}}rc=new WeakMap,jE=new WeakSet,N5=function(t){var n;return(n=P(this,rc))[t]||(n[t]={...Promise.withResolvers(),data:TP})};var Fh;class N5e{constructor(t){G(this,Fh,null);V(this,Fh,t),this.onContinue=null}get promise(){return P(this,Fh).capability.promise}cancel(t=0){P(this,Fh).cancel(null,t)}get separateAnnots(){const{separateAnnots:t}=P(this,Fh).operatorList;if(!t)return!1;const{annotationCanvasMap:n}=P(this,Fh);return t.form||t.canvas&&(n==null?void 0:n.size)>0}}Fh=new WeakMap;var zh,Jg;const lg=class lg{constructor({callback:t,params:n,objs:r,commonObjs:s,annotationCanvasMap:i,operatorList:o,pageIndex:a,canvasFactory:c,filterFactory:d,useRequestAnimationFrame:h=!1,pdfBug:u=!1,pageColors:f=null}){G(this,zh,null);this.callback=t,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=d,this._pdfBug=u,this.pageColors=f,this.running=!1,this.graphicsReadyCallback=null,this.graphicsReady=!1,this._useRequestAnimationFrame=h===!0&&typeof window<"u",this.cancelled=!1,this.capability=Promise.withResolvers(),this.task=new N5e(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:t=!1,optionalContentConfig:n}){var a,c;if(this.cancelled)return;if(this._canvas){if(P(lg,Jg).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.");P(lg,Jg).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 Fb(r,this.commonObjs,this.objs,this.canvasFactory,this.filterFactory,{optionalContentConfig:n},this.annotationCanvasMap,this.pageColors),this.gfx.beginDrawing({transform:i,viewport:s,transparency:t,background:o}),this.operatorListIdx=0,this.graphicsReady=!0,(c=this.graphicsReadyCallback)==null||c.call(this)}cancel(t=null,n=0){var r;this.running=!1,this.cancelled=!0,(r=this.gfx)==null||r.endDrawing(),P(this,zh)&&(window.cancelAnimationFrame(P(this,zh)),V(this,zh,null)),P(lg,Jg).delete(this._canvas),this.callback(t||new TW(`Rendering cancelled, page ${this._pageIndex+1}`,n))}operatorListChanged(){var t;if(!this.graphicsReady){this.graphicsReadyCallback||(this.graphicsReadyCallback=this._continueBound);return}(t=this.stepper)==null||t.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?V(this,zh,window.requestAnimationFrame(()=>{V(this,zh,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(),P(lg,Jg).delete(this._canvas),this.callback())))}};zh=new WeakMap,Jg=new WeakMap,G(lg,Jg,new WeakSet);let T5=lg;const T5e="4.4.168",k5e="19fbc8998";function tY(e){return Math.floor(Math.max(0,Math.min(1,e))*255).toString(16).padStart(2,"0")}function ZS(e){return Math.max(0,Math.min(255,255*e))}class nY{static CMYK_G([t,n,r,s]){return["G",1-Math.min(1,.3*t+.59*r+.11*n+s)]}static G_CMYK([t]){return["CMYK",0,0,0,1-t]}static G_RGB([t]){return["RGB",t,t,t]}static G_rgb([t]){return t=ZS(t),[t,t,t]}static G_HTML([t]){const n=tY(t);return`#${n}${n}${n}`}static RGB_G([t,n,r]){return["G",.3*t+.59*n+.11*r]}static RGB_rgb(t){return t.map(ZS)}static RGB_HTML(t){return`#${t.map(tY).join("")}`}static T_HTML(){return"#00000000"}static T_rgb(){return[null]}static CMYK_RGB([t,n,r,s]){return["RGB",1-Math.min(1,t+s),1-Math.min(1,r+s),1-Math.min(1,n+s)]}static CMYK_rgb([t,n,r,s]){return[ZS(1-Math.min(1,t+s)),ZS(1-Math.min(1,r+s)),ZS(1-Math.min(1,n+s))]}static CMYK_HTML(t){const n=this.CMYK_RGB(t).slice(1);return this.RGB_HTML(n)}static RGB_CMYK([t,n,r]){const s=1-t,i=1-n,o=1-r,a=Math.min(s,i,o);return["CMYK",s,i,o,a]}}class ife{static setupStorage(t,n,r,s,i){const o=s.getValue(n,{value:null});switch(r.name){case"textarea":if(o.value!==null&&(t.textContent=o.value),i==="print")break;t.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?t.setAttribute("checked",!0):o.value===r.attributes.xfaOff&&t.removeAttribute("checked"),i==="print")break;t.addEventListener("change",a=>{s.setValue(n,{value:a.target.checked?a.target.getAttribute("xfaOn"):a.target.getAttribute("xfaOff")})})}else{if(o.value!==null&&t.setAttribute("value",o.value),i==="print")break;t.addEventListener("input",a=>{s.setValue(n,{value:a.target.value})})}break;case"select":if(o.value!==null){t.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}t.addEventListener("input",a=>{const c=a.target.options,d=c.selectedIndex===-1?"":c[c.selectedIndex].value;s.setValue(n,{value:d})});break}}static setAttributes({html:t,element:n,storage:r=null,intent:s,linkService:i}){const{attributes:o}=n,a=t instanceof HTMLAnchorElement;o.type==="radio"&&(o.name=`${o.name}-${s}`);for(const[c,d]of Object.entries(o))if(d!=null)switch(c){case"class":d.length&&t.setAttribute(c,d.join(" "));break;case"dataId":break;case"id":t.setAttribute("data-element-id",d);break;case"style":Object.assign(t.style,d);break;case"textContent":t.textContent=d;break;default:(!a||c!=="href"&&c!=="newWindow")&&t.setAttribute(c,d)}a&&i.addLinkAttributes(t,o.href,o.newWindow),r&&o.dataId&&this.setupStorage(t,o.dataId,n,r)}static render(t){var u,f;const n=t.annotationStorage,r=t.linkService,s=t.xfaHtml,i=t.intent||"display",o=document.createElement(s.name);s.attributes&&this.setAttributes({html:o,element:s,intent:i,linkService:r});const a=i!=="richText",c=t.div;if(c.append(o),t.viewport){const g=`matrix(${t.viewport.transform.join(",")})`;c.style.transform=g}a&&c.setAttribute("class","xfaLayer xfaFont");const d=[];if(s.children.length===0){if(s.value){const g=document.createTextNode(s.value);o.append(g),a&&$C.shouldBuildText(s.name)&&d.push(g)}return{textDivs:d}}const h=[[s,-1,o]];for(;h.length>0;){const[g,v,m]=h.at(-1);if(v+1===g.children.length){h.pop();continue}const x=g.children[++h.at(-1)[1]];if(x===null)continue;const{name:y}=x;if(y==="#text"){const w=document.createTextNode(x.value);d.push(w),m.append(w);continue}const b=(u=x==null?void 0:x.attributes)!=null&&u.xmlns?document.createElementNS(x.attributes.xmlns,y):document.createElement(y);if(m.append(b),x.attributes&&this.setAttributes({html:b,element:x,storage:n,intent:i,linkService:r}),((f=x.children)==null?void 0:f.length)>0)h.push([x,-1,b]);else if(x.value){const w=document.createTextNode(x.value);a&&$C.shouldBuildText(y)&&d.push(w),b.append(w)}}for(const g of c.querySelectorAll(".xfaNonInteractive input, .xfaNonInteractive textarea"))g.setAttribute("readOnly",!0);return{textDivs:d}}static update(t){const n=`matrix(${t.viewport.transform.join(",")})`;t.div.style.transform=n,t.div.hidden=!1}}const _R=1e3,D5e=9,Zv=new WeakSet;function Pf(e){return{width:e[2]-e[0],height:e[3]-e[1]}}class O5e{static create(t){switch(t.data.annotationType){case Vs.LINK:return new ofe(t);case Vs.TEXT:return new M5e(t);case Vs.WIDGET:switch(t.data.fieldType){case"Tx":return new I5e(t);case"Btn":return t.data.radioButton?new cfe(t):t.data.checkBox?new j5e(t):new $5e(t);case"Ch":return new F5e(t);case"Sig":return new L5e(t)}return new Cy(t);case Vs.POPUP:return new D5(t);case Vs.FREETEXT:return new pfe(t);case Vs.LINE:return new B5e(t);case Vs.SQUARE:return new U5e(t);case Vs.CIRCLE:return new V5e(t);case Vs.POLYLINE:return new mfe(t);case Vs.CARET:return new W5e(t);case Vs.INK:return new gfe(t);case Vs.POLYGON:return new H5e(t);case Vs.HIGHLIGHT:return new q5e(t);case Vs.UNDERLINE:return new G5e(t);case Vs.SQUIGGLY:return new K5e(t);case Vs.STRIKEOUT:return new Y5e(t);case Vs.STAMP:return new vfe(t);case Vs.FILEATTACHMENT:return new X5e(t);default:return new Cs(t)}}}var ev,R0,P0,$E,k5;const lq=class lq{constructor(t,{isRenderable:n=!1,ignoreBorder:r=!1,createQuadrilaterals:s=!1}={}){G(this,$E);G(this,ev,null);G(this,R0,!1);G(this,P0,null);this.isRenderable=n,this.data=t.data,this.layer=t.layer,this.linkService=t.linkService,this.downloadManager=t.downloadManager,this.imageResourcesPath=t.imageResourcesPath,this.renderForms=t.renderForms,this.svgFactory=t.svgFactory,this.annotationStorage=t.annotationStorage,this.enableScripting=t.enableScripting,this.hasJSActions=t.hasJSActions,this._fieldObjects=t.fieldObjects,this.parent=t.parent,n&&(this.container=this._createContainer(r)),s&&this._createQuadrilaterals()}static _hasPopupData({titleObj:t,contentsObj:n,richText:r}){return!!(t!=null&&t.str||n!=null&&n.str||r!=null&&r.str)}get hasPopupData(){return lq._hasPopupData(this.data)}updateEdited(t){var r;if(!this.container)return;P(this,ev)||V(this,ev,{rect:this.data.rect.slice(0)});const{rect:n}=t;n&&K(this,$E,k5).call(this,n),(r=P(this,P0))==null||r.popup.updateEdited(t)}resetEdited(){var t;P(this,ev)&&(K(this,$E,k5).call(this,P(this,ev).rect),(t=P(this,P0))==null||t.popup.resetEdited(),V(this,ev,null))}_createContainer(t){const{data:n,parent:{page:r,viewport:s}}=this,i=document.createElement("section");i.setAttribute("data-annotation-id",n.id),this instanceof Cy||(i.tabIndex=_R);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 D5){const{rotation:m}=n;return!n.hasOwnCanvas&&m!==0&&this.setRotation(m,i),i}const{width:a,height:c}=Pf(n.rect);if(!t&&n.borderStyle.width>0){o.borderWidth=`${n.borderStyle.width}px`;const m=n.borderStyle.horizontalCornerRadius,x=n.borderStyle.verticalCornerRadius;if(m>0||x>0){const b=`calc(${m}px * var(--scale-factor)) / calc(${x}px * var(--scale-factor))`;o.borderRadius=b}else if(this instanceof cfe){const b=`calc(${a}px * var(--scale-factor)) / calc(${c}px * var(--scale-factor))`;o.borderRadius=b}switch(n.borderStyle.style){case XS.SOLID:o.borderStyle="solid";break;case XS.DASHED:o.borderStyle="dashed";break;case XS.BEVELED:nn("Unimplemented border style: beveled");break;case XS.INSET:nn("Unimplemented border style: inset");break;case XS.UNDERLINE:o.borderBottomStyle="solid";break}const y=n.borderColor||null;y?(V(this,R0,!0),o.borderColor=xt.makeHexColor(y[0]|0,y[1]|0,y[2]|0)):o.borderWidth=0}const d=xt.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:h,pageHeight:u,pageX:f,pageY:g}=s.rawDims;o.left=`${100*(d[0]-f)/h}%`,o.top=`${100*(d[1]-g)/u}%`;const{rotation:v}=n;return n.hasOwnCanvas||v===0?(o.width=`${100*a/h}%`,o.height=`${100*c/u}%`):this.setRotation(v,i),i}setRotation(t,n=this.container){if(!this.data.rect)return;const{pageWidth:r,pageHeight:s}=this.parent.viewport.rawDims,{width:i,height:o}=Pf(this.data.rect);let a,c;t%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-t)%360)}get _commonActions(){const t=(n,r,s)=>{const i=s.detail[n],o=i[0],a=i.slice(1);s.target.style[r]=nY[`${o}_HTML`](a),this.annotationStorage.setValue(this.data.id,{[r]:nY[`${o}_rgb`](a)})};return An(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=>{t("bgColor","backgroundColor",n)},fillColor:n=>{t("fillColor","backgroundColor",n)},fgColor:n=>{t("fgColor","color",n)},textColor:n=>{t("textColor","color",n)},borderColor:n=>{t("borderColor","borderColor",n)},strokeColor:n=>{t("strokeColor","borderColor",n)},rotation:n=>{const r=n.detail.rotation;this.setRotation(r),this.annotationStorage.setValue(this.data.id,{rotation:r})}})}_dispatchEventFromSandbox(t,n){const r=this._commonActions;for(const s of Object.keys(n.detail)){const i=t[s]||r[s];i==null||i(n)}}_setDefaultPropertiesFromJS(t){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:t};o(a),delete n[s]}}}_createQuadrilaterals(){if(!this.container)return;const{quadPoints:t}=this.data;if(!t)return;const[n,r,s,i]=this.data.rect.map(m=>Math.fround(m));if(t.length===8){const[m,x,y,b]=t.subarray(2,6);if(s===m&&i===x&&n===y&&r===b)return}const{style:o}=this.container;let a;if(P(this,R0)){const{borderColor:m,borderWidth:x}=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="${x}">`],this.container.classList.add("hasBorder")}const c=s-n,d=i-r,{svgFactory:h}=this,u=h.createElement("svg");u.classList.add("quadrilateralsContainer"),u.setAttribute("width",0),u.setAttribute("height",0);const f=h.createElement("defs");u.append(f);const g=h.createElement("clipPath"),v=`clippath_${this.data.id}`;g.setAttribute("id",v),g.setAttribute("clipPathUnits","objectBoundingBox"),f.append(g);for(let m=2,x=t.length;m<x;m+=8){const y=t[m],b=t[m+1],w=t[m+2],E=t[m+3],R=h.createElement("rect"),T=(w-n)/c,N=(i-b)/d,A=(y-w)/c,D=(b-E)/d;R.setAttribute("x",T),R.setAttribute("y",N),R.setAttribute("width",A),R.setAttribute("height",D),g.append(R),a==null||a.push(`<rect vector-effect="non-scaling-stroke" x="${T}" y="${N}" width="${A}" height="${D}"/>`)}P(this,R0)&&(a.push("</g></svg>')"),o.backgroundImage=a.join("")),this.container.append(u),this.container.style.clipPath=`url(#${v})`}_createPopup(){const{container:t,data:n}=this;t.setAttribute("aria-haspopup","dialog");const r=V(this,P0,new D5({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(){lr("Abstract method `AnnotationElement.render` called")}_getElementsByName(t,n=null){const r=[];if(this._fieldObjects){const s=this._fieldObjects[t];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,d=document.querySelector(`[data-element-id="${o}"]`);if(d&&!Zv.has(d)){nn(`_getElementsByName - element not allowed: ${o}`);continue}r.push({id:o,exportValue:c,domElement:d})}return r}for(const s of document.getElementsByName(t)){const{exportValue:i}=s,o=s.getAttribute("data-element-id");o!==n&&Zv.has(s)&&r.push({id:o,exportValue:i,domElement:s})}return r}show(){var t;this.container&&(this.container.hidden=!1),(t=this.popup)==null||t.maybeShow()}hide(){var t;this.container&&(this.container.hidden=!0),(t=this.popup)==null||t.forceHide()}getElementsToTriggerPopup(){return this.container}addHighlightArea(){const t=this.getElementsToTriggerPopup();if(Array.isArray(t))for(const n of t)n.classList.add("highlightArea");else t.classList.add("highlightArea")}get _isEditable(){return!1}_editOnDoubleClick(){if(!this._isEditable)return;const{annotationEditorType:t,data:{id:n}}=this;this.container.addEventListener("dblclick",()=>{var r;(r=this.linkService.eventBus)==null||r.dispatch("switchannotationeditormode",{source:this,mode:t,editId:n})})}};ev=new WeakMap,R0=new WeakMap,P0=new WeakMap,$E=new WeakSet,k5=function(t){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,...t);const{width:d,height:h}=Pf(t);n.left=`${100*(t[0]-a)/i}%`,n.top=`${100*(o-t[3]+c)/o}%`,s===0?(n.width=`${100*d/i}%`,n.height=`${100*h/o}%`):this.setRotation(s)};let Cs=lq;var Wa,ng,afe,lfe;class ofe extends Cs{constructor(n,r=null){super(n,{isRenderable:!0,ignoreBorder:!!(r!=null&&r.ignoreBorder),createQuadrilaterals:!0});G(this,Wa);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?(K(this,Wa,afe).call(this,s,n.attachment,n.attachmentDest),i=!0):n.setOCGState?(K(this,Wa,lfe).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==="")&&K(this,Wa,ng).call(this)}_bindNamedAction(n,r){n.href=this.linkService.getAnchorUrl(""),n.onclick=()=>(this.linkService.executeNamedAction(r),!1),K(this,Wa,ng).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),K(this,Wa,ng).call(this)}_bindResetFormAction(n,r){const s=n.onclick;if(s||(n.href=this.linkService.getAnchorUrl("")),K(this,Wa,ng).call(this),!this._fieldObjects){nn('_bindResetFormAction - "resetForm" action not supported, ensure that the `fieldObjects` parameter is provided.'),s||(n.onclick=()=>!1);return}n.onclick=()=>{var u;s==null||s();const{fields:i,refs:o,include:a}=r,c=[];if(i.length!==0||o.length!==0){const f=new Set(o);for(const g of i){const v=this._fieldObjects[g]||[];for(const{id:m}of v)f.add(m)}for(const g of Object.values(this._fieldObjects))for(const v of g)f.has(v.id)===a&&c.push(v)}else for(const f of Object.values(this._fieldObjects))c.push(...f);const d=this.annotationStorage,h=[];for(const f of c){const{id:g}=f;switch(h.push(g),f.type){case"text":{const m=f.defaultValue||"";d.setValue(g,{value:m});break}case"checkbox":case"radiobutton":{const m=f.defaultValue===f.exportValues;d.setValue(g,{value:m});break}case"combobox":case"listbox":{const m=f.defaultValue||"";d.setValue(g,{value:m});break}default:continue}const v=document.querySelector(`[data-element-id="${g}"]`);if(v){if(!Zv.has(v)){nn(`_bindResetFormAction - element not allowed: ${g}`);continue}}else continue;v.dispatchEvent(new Event("resetform"))}return this.enableScripting&&((u=this.linkService.eventBus)==null||u.dispatch("dispatcheventinsandbox",{source:this,detail:{id:"app",ids:h,name:"ResetForm"}})),!1}}}Wa=new WeakSet,ng=function(){this.container.setAttribute("data-internal-link","")},afe=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},K(this,Wa,ng).call(this)},lfe=function(n,r){n.href=this.linkService.getAnchorUrl(""),n.onclick=()=>(this.linkService.executeSetOCGState(r),!1),K(this,Wa,ng).call(this)};class M5e extends Cs{constructor(t){super(t,{isRenderable:!0})}render(){this.container.classList.add("textAnnotation");const t=document.createElement("img");return t.src=this.imageResourcesPath+"annotation-"+this.data.name.toLowerCase()+".svg",t.setAttribute("data-l10n-id","pdfjs-text-annotation-type"),t.setAttribute("data-l10n-args",JSON.stringify({type:this.data.name})),!this.data.popupRef&&this.hasPopupData&&this._createPopup(),this.container.append(t),this.container}}class Cy extends Cs{render(){return this.container}showElementAndHideCanvas(t){var n;this.data.hasOwnCanvas&&(((n=t.previousSibling)==null?void 0:n.nodeName)==="CANVAS"&&(t.previousSibling.hidden=!0),t.hidden=!1)}_getKeyModifier(t){return Jo.platform.isMac?t.metaKey:t.ctrlKey}_setEventListener(t,n,r,s,i){r.includes("mouse")?t.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)}})}):t.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(t,n,r,s){var i,o,a;for(const[c,d]of r)(d==="Action"||(i=this.data.actions)!=null&&i[d])&&((d==="Focus"||d==="Blur")&&(n||(n={focused:!1})),this._setEventListener(t,n,c,d,s),d==="Focus"&&!((o=this.data.actions)!=null&&o.Blur)?this._setEventListener(t,n,"blur","Blur",null):d==="Blur"&&!((a=this.data.actions)!=null&&a.Focus)&&this._setEventListener(t,n,"focus","Focus",null))}_setBackgroundColor(t){const n=this.data.backgroundColor||null;t.style.backgroundColor=n===null?"transparent":xt.makeHexColor(n[0],n[1],n[2])}_setTextStyle(t){const n=["left","center","right"],{fontColor:r}=this.data.defaultAppearanceData,s=this.data.defaultAppearanceData.fontSize||D5e,i=t.style;let o;const a=2,c=d=>Math.round(10*d)/10;if(this.data.multiLine){const d=Math.abs(this.data.rect[3]-this.data.rect[1]-a),h=Math.round(d/(oz*s))||1,u=d/h;o=Math.min(s,c(u/oz))}else{const d=Math.abs(this.data.rect[3]-this.data.rect[1]-a);o=Math.min(s,c(d/oz))}i.fontSize=`calc(${o}px * var(--scale-factor))`,i.color=xt.makeHexColor(r[0],r[1],r[2]),this.data.textAlignment!==null&&(i.textAlign=n[this.data.textAlignment])}_setRequired(t,n){n?t.setAttribute("required",!0):t.removeAttribute("required"),t.setAttribute("aria-required",n)}}class I5e extends Cy{constructor(t){const n=t.renderForms||t.data.hasOwnCanvas||!t.data.hasAppearance&&!!t.data.fieldValue;super(t,{isRenderable:n})}setPropertyOnSiblings(t,n,r,s){const i=this.annotationStorage;for(const o of this._getElementsByName(t.name,t.id))o.domElement&&(o.domElement[n]=r),i.setValue(o.id,{[s]:r})}render(){var s,i;const t=this.annotationStorage,n=this.data.id;this.container.classList.add("textWidgetAnnotation");let r=null;if(this.renderForms){const o=t.getValue(n,{value:this.data.fieldValue});let a=o.value||"";const c=t.getValue(n,{charLimit:this.data.maxLen}).charLimit;c&&a.length>c&&(a=a.slice(0,c));let d=o.formattedValue||((s=this.data.textContent)==null?void 0:s.join(`
|
||
`))||null;d&&this.data.comb&&(d=d.replaceAll(/\s+/g,""));const h={userValue:a,formattedValue:d,lastCommittedValue:null,commitKey:1,focused:!1};this.data.multiLine?(r=document.createElement("textarea"),r.textContent=d??a,this.data.doNotScroll&&(r.style.overflowY="hidden")):(r=document.createElement("input"),r.type="text",r.setAttribute("value",d??a),this.data.doNotScroll&&(r.style.overflowX="hidden")),this.data.hasOwnCanvas&&(r.hidden=!0),Zv.add(r),r.setAttribute("data-element-id",n),r.disabled=this.data.readOnly,r.name=this.data.fieldName,r.tabIndex=_R,this._setRequired(r,this.data.required),c&&(r.maxLength=c),r.addEventListener("input",f=>{t.setValue(n,{value:f.target.value}),this.setPropertyOnSiblings(r,"value",f.target.value,"value"),h.formattedValue=null}),r.addEventListener("resetform",f=>{const g=this.data.defaultFieldValue??"";r.value=h.userValue=g,h.formattedValue=null});let u=f=>{const{formattedValue:g}=h;g!=null&&(f.target.value=g),f.target.scrollLeft=0};if(this.enableScripting&&this.hasJSActions){r.addEventListener("focus",g=>{var m;if(h.focused)return;const{target:v}=g;h.userValue&&(v.value=h.userValue),h.lastCommittedValue=v.value,h.commitKey=1,(m=this.data.actions)!=null&&m.Focus||(h.focused=!0)}),r.addEventListener("updatefromsandbox",g=>{this.showElementAndHideCanvas(g.target);const v={value(m){h.userValue=m.detail.value??"",t.setValue(n,{value:h.userValue.toString()}),m.target.value=h.userValue},formattedValue(m){const{formattedValue:x}=m.detail;h.formattedValue=x,x!=null&&m.target!==document.activeElement&&(m.target.value=x),t.setValue(n,{formattedValue:x})},selRange(m){m.target.setSelectionRange(...m.detail.selRange)},charLimit:m=>{var w;const{charLimit:x}=m.detail,{target:y}=m;if(x===0){y.removeAttribute("maxLength");return}y.setAttribute("maxLength",x);let b=h.userValue;!b||b.length<=x||(b=b.slice(0,x),y.value=h.userValue=b,t.setValue(n,{value:b}),(w=this.linkService.eventBus)==null||w.dispatch("dispatcheventinsandbox",{source:this,detail:{id:n,name:"Keystroke",value:b,willCommit:!0,commitKey:1,selStart:y.selectionStart,selEnd:y.selectionEnd}}))}};this._dispatchEventFromSandbox(v,g)}),r.addEventListener("keydown",g=>{var x;h.commitKey=1;let v=-1;if(g.key==="Escape"?v=0:g.key==="Enter"&&!this.data.multiLine?v=2:g.key==="Tab"&&(h.commitKey=3),v===-1)return;const{value:m}=g.target;h.lastCommittedValue!==m&&(h.lastCommittedValue=m,h.userValue=m,(x=this.linkService.eventBus)==null||x.dispatch("dispatcheventinsandbox",{source:this,detail:{id:n,name:"Keystroke",value:m,willCommit:!0,commitKey:v,selStart:g.target.selectionStart,selEnd:g.target.selectionEnd}}))});const f=u;u=null,r.addEventListener("blur",g=>{var m,x;if(!h.focused||!g.relatedTarget)return;(m=this.data.actions)!=null&&m.Blur||(h.focused=!1);const{value:v}=g.target;h.userValue=v,h.lastCommittedValue!==v&&((x=this.linkService.eventBus)==null||x.dispatch("dispatcheventinsandbox",{source:this,detail:{id:n,name:"Keystroke",value:v,willCommit:!0,commitKey:h.commitKey,selStart:g.target.selectionStart,selEnd:g.target.selectionEnd}})),f(g)}),(i=this.data.actions)!=null&&i.Keystroke&&r.addEventListener("beforeinput",g=>{var R;h.lastCommittedValue=null;const{data:v,target:m}=g,{value:x,selectionStart:y,selectionEnd:b}=m;let w=y,E=b;switch(g.inputType){case"deleteWordBackward":{const T=x.substring(0,y).match(/\w*[^\w]*$/);T&&(w-=T[0].length);break}case"deleteWordForward":{const T=x.substring(y).match(/^[^\w]*\w*/);T&&(E+=T[0].length);break}case"deleteContentBackward":y===b&&(w-=1);break;case"deleteContentForward":y===b&&(E+=1);break}g.preventDefault(),(R=this.linkService.eventBus)==null||R.dispatch("dispatcheventinsandbox",{source:this,detail:{id:n,name:"Keystroke",value:x,change:v||"",willCommit:!1,selStart:w,selEnd:E}})}),this._setEventListeners(r,h,[["focus","Focus"],["blur","Blur"],["mousedown","Mouse Down"],["mouseenter","Mouse Enter"],["mouseleave","Mouse Exit"],["mouseup","Mouse Up"]],g=>g.target.value)}if(u&&r.addEventListener("blur",u),this.data.comb){const g=(this.data.rect[2]-this.data.rect[0])/c;r.classList.add("comb"),r.style.letterSpacing=`calc(${g}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 L5e extends Cy{constructor(t){super(t,{isRenderable:!!t.data.hasOwnCanvas})}}class j5e extends Cy{constructor(t){super(t,{isRenderable:t.renderForms})}render(){const t=this.annotationStorage,n=this.data,r=n.id;let s=t.getValue(r,{value:n.exportValue===n.fieldValue}).value;typeof s=="string"&&(s=s!=="Off",t.setValue(r,{value:s})),this.container.classList.add("buttonWidgetAnnotation","checkBox");const i=document.createElement("input");return Zv.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=_R,i.addEventListener("change",o=>{const{name:a,checked:c}=o.target;for(const d of this._getElementsByName(a,r)){const h=c&&d.exportValue===n.exportValue;d.domElement&&(d.domElement.checked=h),t.setValue(d.id,{value:h})}t.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",t.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 cfe extends Cy{constructor(t){super(t,{isRenderable:t.renderForms})}render(){this.container.classList.add("buttonWidgetAnnotation","radioButton");const t=this.annotationStorage,n=this.data,r=n.id;let s=t.getValue(r,{value:n.fieldValue===n.buttonValue}).value;if(typeof s=="string"&&(s=s!==n.buttonValue,t.setValue(r,{value:s})),s)for(const o of this._getElementsByName(n.fieldName,r))t.setValue(o.id,{value:!1});const i=document.createElement("input");if(Zv.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=_R,i.addEventListener("change",o=>{const{name:a,checked:c}=o.target;for(const d of this._getElementsByName(a,r))t.setValue(d.id,{value:!1});t.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:d=>{const h=o===d.detail.value;for(const u of this._getElementsByName(d.target.name)){const f=h&&u.id===r;u.domElement&&(u.domElement.checked=f),t.setValue(u.id,{value:f})}}};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 $5e extends ofe{constructor(t){super(t,{ignoreBorder:t.data.hasAppearance})}render(){const t=super.render();t.classList.add("buttonWidgetAnnotation","pushButton");const n=t.lastChild;return this.enableScripting&&this.hasJSActions&&n&&(this._setDefaultPropertiesFromJS(n),n.addEventListener("updatefromsandbox",r=>{this._dispatchEventFromSandbox({},r)})),t}}class F5e extends Cy{constructor(t){super(t,{isRenderable:t.renderForms})}render(){this.container.classList.add("choiceWidgetAnnotation");const t=this.annotationStorage,n=this.data.id,r=t.getValue(n,{value:this.data.fieldValue}),s=document.createElement("select");Zv.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=_R;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",h=>{const u=this.data.defaultFieldValue;for(const f of s.options)f.selected=f.value===u});for(const h of this.data.options){const u=document.createElement("option");u.textContent=h.displayValue,u.value=h.exportValue,r.value.includes(h.exportValue)&&(u.setAttribute("selected",!0),i=!1),s.append(u)}let o=null;if(i){const h=document.createElement("option");h.value=" ",h.setAttribute("hidden",!0),h.setAttribute("selected",!0),s.prepend(h),o=()=>{h.remove(),s.removeEventListener("input",o),o=null},s.addEventListener("input",o)}const a=h=>{const u=h?"value":"textContent",{options:f,multiple:g}=s;return g?Array.prototype.filter.call(f,v=>v.selected).map(v=>v[u]):f.selectedIndex===-1?null:f[f.selectedIndex][u]};let c=a(!1);const d=h=>{const u=h.target.options;return Array.prototype.map.call(u,f=>({displayValue:f.textContent,exportValue:f.value}))};return this.enableScripting&&this.hasJSActions?(s.addEventListener("updatefromsandbox",h=>{const u={value(f){o==null||o();const g=f.detail.value,v=new Set(Array.isArray(g)?g:[g]);for(const m of s.options)m.selected=v.has(m.value);t.setValue(n,{value:a(!0)}),c=a(!1)},multipleSelection(f){s.multiple=!0},remove(f){const g=s.options,v=f.detail.remove;g[v].selected=!1,s.remove(v),g.length>0&&Array.prototype.findIndex.call(g,x=>x.selected)===-1&&(g[0].selected=!0),t.setValue(n,{value:a(!0),items:d(f)}),c=a(!1)},clear(f){for(;s.length!==0;)s.remove(0);t.setValue(n,{value:null,items:[]}),c=a(!1)},insert(f){const{index:g,displayValue:v,exportValue:m}=f.detail.insert,x=s.children[g],y=document.createElement("option");y.textContent=v,y.value=m,x?x.before(y):s.append(y),t.setValue(n,{value:a(!0),items:d(f)}),c=a(!1)},items(f){const{items:g}=f.detail;for(;s.length!==0;)s.remove(0);for(const v of g){const{displayValue:m,exportValue:x}=v,y=document.createElement("option");y.textContent=m,y.value=x,s.append(y)}s.options.length>0&&(s.options[0].selected=!0),t.setValue(n,{value:a(!0),items:d(f)}),c=a(!1)},indices(f){const g=new Set(f.detail.indices);for(const v of f.target.options)v.selected=g.has(v.index);t.setValue(n,{value:a(!0)}),c=a(!1)},editable(f){f.target.disabled=!f.detail.editable}};this._dispatchEventFromSandbox(u,h)}),s.addEventListener("input",h=>{var g;const u=a(!0),f=a(!1);t.setValue(n,{value:u}),h.preventDefault(),(g=this.linkService.eventBus)==null||g.dispatch("dispatcheventinsandbox",{source:this,detail:{id:n,name:"Keystroke",value:c,change:f,changeEx:u,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"]],h=>h.target.value)):s.addEventListener("input",function(h){t.setValue(n,{value:a(!0)})}),this.data.combo&&this._setTextStyle(s),this._setBackgroundColor(s),this._setDefaultPropertiesFromJS(s),this.container.append(s),this.container}}class D5 extends Cs{constructor(t){const{data:n,elements:r}=t;super(t,{isRenderable:Cs._hasPopupData(n)}),this.elements=r,this.popup=null}render(){this.container.classList.add("popupAnnotation");const t=this.popup=new z5e({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=t,n.push(r.data.id),r.addHighlightArea();return this.container.setAttribute("aria-controls",n.map(r=>`${ude}${r}`).join(",")),this.container}}var N0,jk,$k,T0,tv,us,sf,nv,FE,zE,k0,of,sc,af,BE,lf,UE,rv,sv,cr,yN,O5,ufe,dfe,ffe,hfe,bN,xN,M5;class z5e{constructor({container:t,color:n,elements:r,titleObj:s,modificationDate:i,contentsObj:o,richText:a,parent:c,rect:d,parentRect:h,open:u}){G(this,cr);G(this,N0,K(this,cr,ffe).bind(this));G(this,jk,K(this,cr,M5).bind(this));G(this,$k,K(this,cr,xN).bind(this));G(this,T0,K(this,cr,bN).bind(this));G(this,tv,null);G(this,us,null);G(this,sf,null);G(this,nv,null);G(this,FE,null);G(this,zE,null);G(this,k0,null);G(this,of,!1);G(this,sc,null);G(this,af,null);G(this,BE,null);G(this,lf,null);G(this,UE,null);G(this,rv,null);G(this,sv,!1);var f;V(this,us,t),V(this,UE,s),V(this,sf,o),V(this,lf,a),V(this,zE,c),V(this,tv,n),V(this,BE,d),V(this,k0,h),V(this,FE,r),V(this,nv,mde.toDateObject(i)),this.trigger=r.flatMap(g=>g.getElementsToTriggerPopup());for(const g of this.trigger)g.addEventListener("click",P(this,T0)),g.addEventListener("mouseenter",P(this,$k)),g.addEventListener("mouseleave",P(this,jk)),g.classList.add("popupTriggerArea");for(const g of r)(f=g.container)==null||f.addEventListener("keydown",P(this,N0));P(this,us).hidden=!0,u&&K(this,cr,bN).call(this)}render(){if(P(this,sc))return;const t=V(this,sc,document.createElement("div"));if(t.className="popup",P(this,tv)){const i=t.style.outlineColor=xt.makeHexColor(...P(this,tv));CSS.supports("background-color","color-mix(in srgb, red 30%, white)")?t.style.backgroundColor=`color-mix(in srgb, ${i} 30%, white)`:t.style.backgroundColor=xt.makeHexColor(...P(this,tv).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}=P(this,UE),t.append(n),P(this,nv)){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:P(this,nv).toLocaleDateString(),time:P(this,nv).toLocaleTimeString()})),n.append(i)}const s=P(this,cr,yN);if(s)ife.render({xfaHtml:s,intent:"richText",div:t}),t.lastChild.classList.add("richText","popupContent");else{const i=this._formatContents(P(this,sf));t.append(i)}P(this,us).append(t)}_formatContents({str:t,dir:n}){const r=document.createElement("p");r.classList.add("popupContent"),r.dir=n;const s=t.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:t,popupContent:n}){var r;P(this,rv)||V(this,rv,{contentsObj:P(this,sf),richText:P(this,lf)}),t&&V(this,af,null),n&&(V(this,lf,K(this,cr,dfe).call(this,n)),V(this,sf,null)),(r=P(this,sc))==null||r.remove(),V(this,sc,null)}resetEdited(){var t;P(this,rv)&&({contentsObj:Ui(this,sf)._,richText:Ui(this,lf)._}=P(this,rv),V(this,rv,null),(t=P(this,sc))==null||t.remove(),V(this,sc,null),V(this,af,null))}forceHide(){V(this,sv,this.isVisible),P(this,sv)&&(P(this,us).hidden=!0)}maybeShow(){P(this,sv)&&(P(this,sc)||K(this,cr,xN).call(this),V(this,sv,!1),P(this,us).hidden=!1)}get isVisible(){return P(this,us).hidden===!1}}N0=new WeakMap,jk=new WeakMap,$k=new WeakMap,T0=new WeakMap,tv=new WeakMap,us=new WeakMap,sf=new WeakMap,nv=new WeakMap,FE=new WeakMap,zE=new WeakMap,k0=new WeakMap,of=new WeakMap,sc=new WeakMap,af=new WeakMap,BE=new WeakMap,lf=new WeakMap,UE=new WeakMap,rv=new WeakMap,sv=new WeakMap,cr=new WeakSet,yN=function(){const t=P(this,lf),n=P(this,sf);return t!=null&&t.str&&(!(n!=null&&n.str)||n.str===t.str)&&P(this,lf).html||null},O5=function(){var t,n,r;return((r=(n=(t=P(this,cr,yN))==null?void 0:t.attributes)==null?void 0:n.style)==null?void 0:r.fontSize)||0},ufe=function(){var t,n,r;return((r=(n=(t=P(this,cr,yN))==null?void 0:t.attributes)==null?void 0:n.style)==null?void 0:r.color)||null},dfe=function(t){const n=[],r={str:t,html:{name:"div",attributes:{dir:"auto"},children:[{name:"p",children:n}]}},s={style:{color:P(this,cr,ufe),fontSize:P(this,cr,O5)?`calc(${P(this,cr,O5)}px * var(--scale-factor))`:""}};for(const i of t.split(`
|
||
`))n.push({name:"span",value:i,attributes:s});return r},ffe=function(t){t.altKey||t.shiftKey||t.ctrlKey||t.metaKey||(t.key==="Enter"||t.key==="Escape"&&P(this,of))&&K(this,cr,bN).call(this)},hfe=function(){if(P(this,af)!==null)return;const{page:{view:t},viewport:{rawDims:{pageWidth:n,pageHeight:r,pageX:s,pageY:i}}}=P(this,zE);let o=!!P(this,k0),a=o?P(this,k0):P(this,BE);for(const v of P(this,FE))if(!a||xt.intersect(v.data.rect,a)!==null){a=v.data.rect,o=!0;break}const c=xt.normalizeRect([a[0],t[3]-a[1]+t[1],a[2],t[3]-a[3]+t[1]]),h=o?a[2]-a[0]+5:0,u=c[0]+h,f=c[1];V(this,af,[100*(u-s)/n,100*(f-i)/r]);const{style:g}=P(this,us);g.left=`${P(this,af)[0]}%`,g.top=`${P(this,af)[1]}%`},bN=function(){V(this,of,!P(this,of)),P(this,of)?(K(this,cr,xN).call(this),P(this,us).addEventListener("click",P(this,T0)),P(this,us).addEventListener("keydown",P(this,N0))):(K(this,cr,M5).call(this),P(this,us).removeEventListener("click",P(this,T0)),P(this,us).removeEventListener("keydown",P(this,N0)))},xN=function(){P(this,sc)||this.render(),this.isVisible?P(this,of)&&P(this,us).classList.add("focused"):(K(this,cr,hfe).call(this),P(this,us).hidden=!1,P(this,us).style.zIndex=parseInt(P(this,us).style.zIndex)+1e3)},M5=function(){P(this,us).classList.remove("focused"),!(P(this,of)||!this.isVisible)&&(P(this,us).hidden=!0,P(this,us).style.zIndex=parseInt(P(this,us).style.zIndex)-1e3)};class pfe extends Cs{constructor(t){super(t,{isRenderable:!0,ignoreBorder:!0}),this.textContent=t.data.textContent,this.textPosition=t.data.textPosition,this.annotationEditorType=_n.FREETEXT}render(){if(this.container.classList.add("freeTextAnnotation"),this.textContent){const t=document.createElement("div");t.classList.add("annotationTextContent"),t.setAttribute("role","comment");for(const n of this.textContent){const r=document.createElement("span");r.textContent=n,t.append(r)}this.container.append(t)}return!this.data.popupRef&&this.hasPopupData&&this._createPopup(),this._editOnDoubleClick(),this.container}get _isEditable(){return this.data.hasOwnCanvas}}var VE;class B5e extends Cs{constructor(n){super(n,{isRenderable:!0,ignoreBorder:!0});G(this,VE,null)}render(){this.container.classList.add("lineAnnotation");const n=this.data,{width:r,height:s}=Pf(n.rect),i=this.svgFactory.create(r,s,!0),o=V(this,VE,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 P(this,VE)}addHighlightArea(){this.container.classList.add("highlightArea")}}VE=new WeakMap;var HE;class U5e extends Cs{constructor(n){super(n,{isRenderable:!0,ignoreBorder:!0});G(this,HE,null)}render(){this.container.classList.add("squareAnnotation");const n=this.data,{width:r,height:s}=Pf(n.rect),i=this.svgFactory.create(r,s,!0),o=n.borderStyle.width,a=V(this,HE,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 P(this,HE)}addHighlightArea(){this.container.classList.add("highlightArea")}}HE=new WeakMap;var WE;class V5e extends Cs{constructor(n){super(n,{isRenderable:!0,ignoreBorder:!0});G(this,WE,null)}render(){this.container.classList.add("circleAnnotation");const n=this.data,{width:r,height:s}=Pf(n.rect),i=this.svgFactory.create(r,s,!0),o=n.borderStyle.width,a=V(this,WE,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 P(this,WE)}addHighlightArea(){this.container.classList.add("highlightArea")}}WE=new WeakMap;var qE;class mfe extends Cs{constructor(n){super(n,{isRenderable:!0,ignoreBorder:!0});G(this,qE,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}=Pf(n),c=this.svgFactory.create(o,a,!0);let d=[];for(let u=0,f=r.length;u<f;u+=2){const g=r[u]-n[0],v=n[3]-r[u+1];d.push(`${g},${v}`)}d=d.join(" ");const h=V(this,qE,this.svgFactory.createElement(this.svgElementName));return h.setAttribute("points",d),h.setAttribute("stroke-width",s.width||1),h.setAttribute("stroke","transparent"),h.setAttribute("fill","transparent"),c.append(h),this.container.append(c),!i&&this.hasPopupData&&this._createPopup(),this.container}getElementsToTriggerPopup(){return P(this,qE)}addHighlightArea(){this.container.classList.add("highlightArea")}}qE=new WeakMap;class H5e extends mfe{constructor(t){super(t),this.containerClassName="polygonAnnotation",this.svgElementName="svg:polygon"}}class W5e extends Cs{constructor(t){super(t,{isRenderable:!0,ignoreBorder:!0})}render(){return this.container.classList.add("caretAnnotation"),!this.data.popupRef&&this.hasPopupData&&this._createPopup(),this.container}}var GE;class gfe extends Cs{constructor(n){super(n,{isRenderable:!0,ignoreBorder:!0});G(this,GE,[]);this.containerClassName="inkAnnotation",this.svgElementName="svg:polyline",this.annotationEditorType=_n.INK}render(){this.container.classList.add(this.containerClassName);const{data:{rect:n,inkLists:r,borderStyle:s,popupRef:i}}=this,{width:o,height:a}=Pf(n),c=this.svgFactory.create(o,a,!0);for(const d of r){let h=[];for(let f=0,g=d.length;f<g;f+=2){const v=d[f]-n[0],m=n[3]-d[f+1];h.push(`${v},${m}`)}h=h.join(" ");const u=this.svgFactory.createElement(this.svgElementName);P(this,GE).push(u),u.setAttribute("points",h),u.setAttribute("stroke-width",s.width||1),u.setAttribute("stroke","transparent"),u.setAttribute("fill","transparent"),!i&&this.hasPopupData&&this._createPopup(),c.append(u)}return this.container.append(c),this.container}getElementsToTriggerPopup(){return P(this,GE)}addHighlightArea(){this.container.classList.add("highlightArea")}}GE=new WeakMap;class q5e extends Cs{constructor(t){super(t,{isRenderable:!0,ignoreBorder:!0,createQuadrilaterals:!0})}render(){return!this.data.popupRef&&this.hasPopupData&&this._createPopup(),this.container.classList.add("highlightAnnotation"),this.container}}class G5e extends Cs{constructor(t){super(t,{isRenderable:!0,ignoreBorder:!0,createQuadrilaterals:!0})}render(){return!this.data.popupRef&&this.hasPopupData&&this._createPopup(),this.container.classList.add("underlineAnnotation"),this.container}}class K5e extends Cs{constructor(t){super(t,{isRenderable:!0,ignoreBorder:!0,createQuadrilaterals:!0})}render(){return!this.data.popupRef&&this.hasPopupData&&this._createPopup(),this.container.classList.add("squigglyAnnotation"),this.container}}class Y5e extends Cs{constructor(t){super(t,{isRenderable:!0,ignoreBorder:!0,createQuadrilaterals:!0})}render(){return!this.data.popupRef&&this.hasPopupData&&this._createPopup(),this.container.classList.add("strikeoutAnnotation"),this.container}}class vfe extends Cs{constructor(t){super(t,{isRenderable:!0,ignoreBorder:!0})}render(){return this.container.classList.add("stampAnnotation"),!this.data.popupRef&&this.hasPopupData&&this._createPopup(),this.container}}var KE,YE,I5;class X5e extends Cs{constructor(n){var s;super(n,{isRenderable:!0});G(this,YE);G(this,KE,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",K(this,YE,I5).bind(this)),V(this,KE,s);const{isMac:i}=Jo.platform;return n.addEventListener("keydown",o=>{o.key==="Enter"&&(i?o.metaKey:o.ctrlKey)&&K(this,YE,I5).call(this)}),!r.popupRef&&this.hasPopupData?this._createPopup():s.classList.add("popupTriggerArea"),n.append(s),n}getElementsToTriggerPopup(){return P(this,KE)}addHighlightArea(){this.container.classList.add("highlightArea")}}KE=new WeakMap,YE=new WeakSet,I5=function(){var n;(n=this.downloadManager)==null||n.openOrDownloadData(this.content,this.filename)};var XE,iv,D0,ny,yfe,L5,EX;let Q5e=(EX=class{constructor({div:t,accessibilityManager:n,annotationCanvasMap:r,annotationEditorUIManager:s,page:i,viewport:o}){G(this,ny);G(this,XE,null);G(this,iv,null);G(this,D0,new Map);this.div=t,V(this,XE,n),V(this,iv,r),this.page=i,this.viewport=o,this.zIndex=0,this._annotationEditorUIManager=s}async render(t){var o;const{annotations:n}=t,r=this.div;Xv(r,this.viewport);const s=new Map,i={data:null,layer:r,linkService:t.linkService,downloadManager:t.downloadManager,imageResourcesPath:t.imageResourcesPath||"",renderForms:t.renderForms!==!1,svgFactory:new NW,annotationStorage:t.annotationStorage||new MW,enableScripting:t.enableScripting===!0,hasJSActions:t.hasJSActions,fieldObjects:t.fieldObjects,parent:this,elements:null};for(const a of n){if(a.noHTML)continue;const c=a.annotationType===Vs.POPUP;if(c){const u=s.get(a.id);if(!u)continue;i.elements=u}else{const{width:u,height:f}=Pf(a.rect);if(u<=0||f<=0)continue}i.data=a;const d=O5e.create(i);if(!d.isRenderable)continue;if(!c&&a.popupRef){const u=s.get(a.popupRef);u?u.push(d):s.set(a.popupRef,[d])}const h=d.render();a.hidden&&(h.style.visibility="hidden"),K(this,ny,yfe).call(this,h,a.id),d.annotationEditorType>0&&(P(this,D0).set(d.data.id,d),(o=this._annotationEditorUIManager)==null||o.renderAnnotationElement(d))}K(this,ny,L5).call(this)}update({viewport:t}){const n=this.div;this.viewport=t,Xv(n,{rotation:t.rotation}),K(this,ny,L5).call(this),n.hidden=!1}getEditableAnnotations(){return Array.from(P(this,D0).values())}getEditableAnnotation(t){return P(this,D0).get(t)}},XE=new WeakMap,iv=new WeakMap,D0=new WeakMap,ny=new WeakSet,yfe=function(t,n){var s;const r=t.firstChild||t;r.id=`${ude}${n}`,this.div.append(t),(s=P(this,XE))==null||s.moveElementInDOM(this.div,t,r,!1)},L5=function(){if(!P(this,iv))return;const t=this.div;for(const[n,r]of P(this,iv)){const s=t.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)}P(this,iv).clear()},EX);const kP=/\r\n?|\n/g;var QE,ZE,JE,eA,tA,ic,Ia,nA,La,O0,Os,bfe,xfe,_fe,_N,kf,wN,SN,wfe,$5,Sfe;const Cr=class Cr extends tr{constructor(n){super({...n,name:"freeTextEditor"});G(this,Os);G(this,QE,this.editorDivBlur.bind(this));G(this,ZE,this.editorDivFocus.bind(this));G(this,JE,this.editorDivInput.bind(this));G(this,eA,this.editorDivKeydown.bind(this));G(this,tA,this.editorDivPaste.bind(this));G(this,ic);G(this,Ia,"");G(this,nA,`${this.id}-editor`);G(this,La);G(this,O0,null);V(this,ic,n.color||Cr._defaultColor||tr._defaultLineColor),V(this,La,n.fontSize||Cr._defaultFontSize)}static get _keyboardManager(){const n=Cr.prototype,r=o=>o.isEmpty(),s=Qv.TRANSLATE_SMALL,i=Qv.TRANSLATE_BIG;return An(this,"_keyboardManager",new bR([[["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){tr.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 zt.FREETEXT_SIZE:Cr._defaultFontSize=r;break;case zt.FREETEXT_COLOR:Cr._defaultColor=r;break}}updateParams(n,r){switch(n){case zt.FREETEXT_SIZE:K(this,Os,bfe).call(this,r);break;case zt.FREETEXT_COLOR:K(this,Os,xfe).call(this,r);break}}static get defaultPropertiesToUpdate(){return[[zt.FREETEXT_SIZE,Cr._defaultFontSize],[zt.FREETEXT_COLOR,Cr._defaultColor||tr._defaultLineColor]]}get propertiesToUpdate(){return[[zt.FREETEXT_SIZE,P(this,La)],[zt.FREETEXT_COLOR,P(this,ic)]]}_translateEmpty(n,r){this._uiManager.translateSelectedEditors(n,r,!0)}getInitialTranslation(){const n=this.parentScale;return[-Cr._internalPadding*n,-(Cr._internalPadding+P(this,La))*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(_n.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",P(this,eA),{signal:n}),this.editorDiv.addEventListener("focus",P(this,ZE),{signal:n}),this.editorDiv.addEventListener("blur",P(this,QE),{signal:n}),this.editorDiv.addEventListener("input",P(this,JE),{signal:n}),this.editorDiv.addEventListener("paste",P(this,tA),{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",P(this,nA)),this._isDraggable=!0,this.editorDiv.removeEventListener("keydown",P(this,eA)),this.editorDiv.removeEventListener("focus",P(this,ZE)),this.editorDiv.removeEventListener("blur",P(this,QE)),this.editorDiv.removeEventListener("input",P(this,JE)),this.editorDiv.removeEventListener("paste",P(this,tA)),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=P(this,Ia),r=V(this,Ia,K(this,Os,_fe).call(this).trimEnd());if(n===r)return;const s=i=>{if(V(this,Ia,i),!i){this.remove();return}K(this,Os,SN).call(this),this._uiManager.rebuild(this),K(this,Os,_N).call(this)};this.addCommands({cmd:()=>{s(r)},undo:()=>{s(n)},mustExec:!1}),K(this,Os,_N).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){Cr._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",P(this,nA)),this.editorDiv.setAttribute("data-l10n-id","pdfjs-free-text"),this.enableEditing(),tr._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(${P(this,La)}px * var(--scale-factor))`,s.color=P(this,ic),this.div.append(this.editorDiv),this.overlayDiv=document.createElement("div"),this.overlayDiv.classList.add("overlay","enabled"),this.div.append(this.overlayDiv),ok(this,this.div,["dblclick","keydown"]),this.width){const[i,o]=this.parentDimensions;if(this.annotationElementId){const{position:a}=P(this,O0);let[c,d]=this.getInitialTranslation();[c,d]=this.pageTranslationToScreen(c,d);const[h,u]=this.pageDimensions,[f,g]=this.pageTranslation;let v,m;switch(this.rotation){case 0:v=n+(a[0]-f)/h,m=r+this.height-(a[1]-g)/u;break;case 90:v=n+(a[0]-f)/h,m=r-(a[1]-g)/u,[c,d]=[d,-c];break;case 180:v=n-this.width+(a[0]-f)/h,m=r-(a[1]-g)/u,[c,d]=[-c,-d];break;case 270:v=n+(a[0]-f-this.height*u)/h,m=r+(a[1]-g-this.width*h)/u,[c,d]=[-d,c];break}this.setAt(v*i,m*o,c,d)}else this.setAt(n*i,r*o,this.width*i,this.height*o);K(this,Os,SN).call(this),this._isDraggable=!0,this.editorDiv.contentEditable=!1}else this._isDraggable=!1,this.editorDiv.contentEditable=!0;return this.div}editorDivPaste(n){var v,m,x;const r=n.clipboardData||window.clipboardData,{types:s}=r;if(s.length===1&&s[0]==="text/plain")return;n.preventDefault();const i=K(v=Cr,kf,$5).call(v,r.getData("text")||"").replaceAll(kP,`
|
||
`);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:d}=a,h=[],u=[];if(c.nodeType===Node.TEXT_NODE){const y=c.parentElement;if(u.push(c.nodeValue.slice(d).replaceAll(kP,"")),y!==this.editorDiv){let b=h;for(const w of this.editorDiv.childNodes){if(w===y){b=u;continue}b.push(K(m=Cr,kf,wN).call(m,w))}}h.push(c.nodeValue.slice(0,d).replaceAll(kP,""))}else if(c===this.editorDiv){let y=h,b=0;for(const w of this.editorDiv.childNodes)b++===d&&(y=u),y.push(K(x=Cr,kf,wN).call(x,w))}V(this,Ia,`${h.join(`
|
||
`)}${i}${u.join(`
|
||
`)}`),K(this,Os,SN).call(this);const f=new Range;let g=h.reduce((y,b)=>y+b.length,0);for(const{firstChild:y}of this.editorDiv.childNodes)if(y.nodeType===Node.TEXT_NODE){const b=y.nodeValue.length;if(g<=b){f.setStart(y,g),f.setEnd(y,g);break}g-=b}o.removeAllRanges(),o.addRange(f)}get contentDiv(){return this.editorDiv}static deserialize(n,r,s){var a;let i=null;if(n instanceof pfe){const{data:{defaultAppearanceData:{fontSize:c,fontColor:d},rect:h,rotation:u,id:f},textContent:g,textPosition:v,parent:{page:{pageNumber:m}}}=n;if(!g||g.length===0)return null;i=n={annotationType:_n.FREETEXT,color:Array.from(d),fontSize:c,value:g.join(`
|
||
`),position:v,pageIndex:m-1,rect:h.slice(0),rotation:u,id:f,deleted:!1}}const o=super.deserialize(n,r,s);return V(o,La,n.fontSize),V(o,ic,xt.makeHexColor(...n.color)),V(o,Ia,K(a=Cr,kf,$5).call(a,n.value)),o.annotationElementId=n.id||null,V(o,O0,i),o}serialize(n=!1){if(this.isEmpty())return null;if(this.deleted)return{pageIndex:this.pageIndex,id:this.annotationElementId,deleted:!0};const r=Cr._internalPadding*this.parentScale,s=this.getRect(r,r),i=tr._colorManager.convert(this.isAttachedToDOM?getComputedStyle(this.editorDiv).color:P(this,ic)),o={annotationType:_n.FREETEXT,color:i,fontSize:P(this,La),value:K(this,Os,wfe).call(this),pageIndex:this.pageIndex,rect:s,rotation:this.rotation,structTreeParentId:this._structTreeParentId};return n?o:this.annotationElementId&&!K(this,Os,Sfe).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(${P(this,La)}px * var(--scale-factor))`,s.color=P(this,ic),r.replaceChildren();for(const o of P(this,Ia).split(`
|
||
`)){const a=document.createElement("div");a.append(o?document.createTextNode(o):document.createElement("br")),r.append(a)}const i=Cr._internalPadding*this.parentScale;return n.updateEdited({rect:this.getRect(i,i),popupContent:P(this,Ia)}),r}resetAnnotationElement(n){super.resetAnnotationElement(n),n.resetEdited()}};QE=new WeakMap,ZE=new WeakMap,JE=new WeakMap,eA=new WeakMap,tA=new WeakMap,ic=new WeakMap,Ia=new WeakMap,nA=new WeakMap,La=new WeakMap,O0=new WeakMap,Os=new WeakSet,bfe=function(n){const r=i=>{this.editorDiv.style.fontSize=`calc(${i}px * var(--scale-factor))`,this.translate(0,-(i-P(this,La))*this.parentScale),V(this,La,i),K(this,Os,_N).call(this)},s=P(this,La);this.addCommands({cmd:r.bind(this,n),undo:r.bind(this,s),post:this._uiManager.updateUI.bind(this._uiManager,this),mustExec:!0,type:zt.FREETEXT_SIZE,overwriteIfSameType:!0,keepUndo:!0})},xfe=function(n){const r=i=>{V(this,ic,this.editorDiv.style.color=i)},s=P(this,ic);this.addCommands({cmd:r.bind(this,n),undo:r.bind(this,s),post:this._uiManager.updateUI.bind(this._uiManager,this),mustExec:!0,type:zt.FREETEXT_COLOR,overwriteIfSameType:!0,keepUndo:!0})},_fe=function(){var r;const n=[];this.editorDiv.normalize();for(const s of this.editorDiv.childNodes)n.push(K(r=Cr,kf,wN).call(r,s));return n.join(`
|
||
`)},_N=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()},kf=new WeakSet,wN=function(n){return(n.nodeType===Node.TEXT_NODE?n.nodeValue:n.innerText).replaceAll(kP,"")},SN=function(){if(this.editorDiv.replaceChildren(),!!P(this,Ia))for(const n of P(this,Ia).split(`
|
||
`)){const r=document.createElement("div");r.append(n?document.createTextNode(n):document.createElement("br")),this.editorDiv.append(r)}},wfe=function(){return P(this,Ia).replaceAll(" "," ")},$5=function(n){return n.replaceAll(" "," ")},Sfe=function(n){const{value:r,fontSize:s,color:i,pageIndex:o}=P(this,O0);return this._hasBeenMoved||n.value!==r||n.fontSize!==s||n.color.some((a,c)=>a!==i[c])||n.pageIndex!==o},G(Cr,kf),Be(Cr,"_freeTextDefaultContent",""),Be(Cr,"_internalPadding",0),Be(Cr,"_defaultColor",null),Be(Cr,"_defaultFontSize",10),Be(Cr,"_type","freetext"),Be(Cr,"_editorType",_n.FREETEXT);let j5=Cr;var rA,Bh,oc,Do,Cfe,CN,Efe,Afe,z5;class F5{constructor(t,n=0,r=0,s=!0){G(this,Do);G(this,rA);G(this,Bh,[]);G(this,oc,[]);let i=1/0,o=-1/0,a=1/0,c=-1/0;const d=10**-4;for(const{x,y,width:b,height:w}of t){const E=Math.floor((x-n)/d)*d,R=Math.ceil((x+b+n)/d)*d,T=Math.floor((y-n)/d)*d,N=Math.ceil((y+w+n)/d)*d,A=[E,T,N,!0],D=[R,T,N,!1];P(this,Bh).push(A,D),i=Math.min(i,E),o=Math.max(o,R),a=Math.min(a,T),c=Math.max(c,N)}const h=o-i+2*r,u=c-a+2*r,f=i-r,g=a-r,v=P(this,Bh).at(s?-1:-2),m=[v[0],v[2]];for(const x of P(this,Bh)){const[y,b,w]=x;x[0]=(y-f)/h,x[1]=(b-g)/u,x[2]=(w-g)/u}V(this,rA,{x:f,y:g,width:h,height:u,lastPoint:m})}getOutlines(){P(this,Bh).sort((n,r)=>n[0]-r[0]||n[1]-r[1]||n[2]-r[2]);const t=[];for(const n of P(this,Bh))n[3]?(t.push(...K(this,Do,z5).call(this,n)),K(this,Do,Efe).call(this,n)):(K(this,Do,Afe).call(this,n),t.push(...K(this,Do,z5).call(this,n)));return K(this,Do,Cfe).call(this,t)}}rA=new WeakMap,Bh=new WeakMap,oc=new WeakMap,Do=new WeakSet,Cfe=function(t){const n=[],r=new Set;for(const o of t){const[a,c,d]=o;n.push([a,c,o],[a,d,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],d=n[o+1][2];c.push(d),d.push(c),r.add(c),r.add(d)}const s=[];let i;for(;r.size>0;){const o=r.values().next().value;let[a,c,d,h,u]=o;r.delete(o);let f=a,g=c;for(i=[a,d],s.push(i);;){let v;if(r.has(h))v=h;else if(r.has(u))v=u;else break;r.delete(v),[a,c,d,h,u]=v,f!==a&&(i.push(f,g,a,g===c?c:d),f=a),g=g===c?d:c}i.push(f,g)}return new Z5e(s,P(this,rA))},CN=function(t){const n=P(this,oc);let r=0,s=n.length-1;for(;r<=s;){const i=r+s>>1,o=n[i][0];if(o===t)return i;o<t?r=i+1:s=i-1}return s+1},Efe=function([,t,n]){const r=K(this,Do,CN).call(this,t);P(this,oc).splice(r,0,[t,n])},Afe=function([,t,n]){const r=K(this,Do,CN).call(this,t);for(let s=r;s<P(this,oc).length;s++){const[i,o]=P(this,oc)[s];if(i!==t)break;if(i===t&&o===n){P(this,oc).splice(s,1);return}}for(let s=r-1;s>=0;s--){const[i,o]=P(this,oc)[s];if(i!==t)break;if(i===t&&o===n){P(this,oc).splice(s,1);return}}},z5=function(t){const[n,r,s]=t,i=[[n,r,s]],o=K(this,Do,CN).call(this,s);for(let a=0;a<o;a++){const[c,d]=P(this,oc)[a];for(let h=0,u=i.length;h<u;h++){const[,f,g]=i[h];if(!(d<=f||g<=c)){if(f>=c){if(g>d)i[h][1]=d;else{if(u===1)return[];i.splice(h,1),h--,u--}continue}i[h][2]=c,g>d&&i.push([n,d,g])}}}return i};class Rfe{toSVGPath(){throw new Error("Abstract method `toSVGPath` must be implemented.")}get box(){throw new Error("Abstract getter `box` must be implemented.")}serialize(t,n){throw new Error("Abstract method `serialize` must be implemented.")}get free(){return this instanceof U5}}var sA,M0;class Z5e extends Rfe{constructor(n,r){super();G(this,sA);G(this,M0);V(this,M0,n),V(this,sA,r)}toSVGPath(){const n=[];for(const r of P(this,M0)){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,d=i-r;for(const h of P(this,M0)){const u=new Array(h.length);for(let f=0;f<h.length;f+=2)u[f]=n+h[f]*c,u[f+1]=i-h[f+1]*d;a.push(u)}return a}get box(){return P(this,sA)}}sA=new WeakMap,M0=new WeakMap;var ru,cf,I0,L0,su,yn,ov,av,iA,oA,j0,$0,Uh,aA,Fk,zk,lA,B5;const Bd=class Bd{constructor({x:t,y:n},r,s,i,o,a=0){G(this,lA);G(this,ru);G(this,cf,[]);G(this,I0);G(this,L0);G(this,su,[]);G(this,yn,new Float64Array(18));G(this,ov);G(this,av);G(this,iA);G(this,oA);G(this,j0);G(this,$0);G(this,Uh,[]);V(this,ru,r),V(this,$0,i*s),V(this,L0,o),P(this,yn).set([NaN,NaN,NaN,NaN,t,n],6),V(this,I0,a),V(this,oA,P(Bd,aA)*s),V(this,iA,P(Bd,zk)*s),V(this,j0,s),P(this,Uh).push(t,n)}get free(){return!0}isEmpty(){return isNaN(P(this,yn)[8])}add({x:t,y:n}){var D;V(this,ov,t),V(this,av,n);const[r,s,i,o]=P(this,ru);let[a,c,d,h]=P(this,yn).subarray(8,12);const u=t-d,f=n-h,g=Math.hypot(u,f);if(g<P(this,iA))return!1;const v=g-P(this,oA),m=v/g,x=m*u,y=m*f;let b=a,w=c;a=d,c=h,d+=x,h+=y,(D=P(this,Uh))==null||D.push(t,n);const E=-y/v,R=x/v,T=E*P(this,$0),N=R*P(this,$0);return P(this,yn).set(P(this,yn).subarray(2,8),0),P(this,yn).set([d+T,h+N],4),P(this,yn).set(P(this,yn).subarray(14,18),12),P(this,yn).set([d-T,h-N],16),isNaN(P(this,yn)[6])?(P(this,su).length===0&&(P(this,yn).set([a+T,c+N],2),P(this,su).push(NaN,NaN,NaN,NaN,(a+T-r)/i,(c+N-s)/o),P(this,yn).set([a-T,c-N],14),P(this,cf).push(NaN,NaN,NaN,NaN,(a-T-r)/i,(c-N-s)/o)),P(this,yn).set([b,w,a,c,d,h],6),!this.isEmpty()):(P(this,yn).set([b,w,a,c,d,h],6),Math.abs(Math.atan2(w-c,b-a)-Math.atan2(y,x))<Math.PI/2?([a,c,d,h]=P(this,yn).subarray(2,6),P(this,su).push(NaN,NaN,NaN,NaN,((a+d)/2-r)/i,((c+h)/2-s)/o),[a,c,b,w]=P(this,yn).subarray(14,18),P(this,cf).push(NaN,NaN,NaN,NaN,((b+a)/2-r)/i,((w+c)/2-s)/o),!0):([b,w,a,c,d,h]=P(this,yn).subarray(0,6),P(this,su).push(((b+5*a)/6-r)/i,((w+5*c)/6-s)/o,((5*a+d)/6-r)/i,((5*c+h)/6-s)/o,((a+d)/2-r)/i,((c+h)/2-s)/o),[d,h,a,c,b,w]=P(this,yn).subarray(12,18),P(this,cf).push(((b+5*a)/6-r)/i,((w+5*c)/6-s)/o,((5*a+d)/6-r)/i,((5*c+h)/6-s)/o,((a+d)/2-r)/i,((c+h)/2-s)/o),!0))}toSVGPath(){if(this.isEmpty())return"";const t=P(this,su),n=P(this,cf),r=P(this,yn).subarray(4,6),s=P(this,yn).subarray(16,18),[i,o,a,c]=P(this,ru),[d,h,u,f]=K(this,lA,B5).call(this);if(isNaN(P(this,yn)[6])&&!this.isEmpty())return`M${(P(this,yn)[2]-i)/a} ${(P(this,yn)[3]-o)/c} L${(P(this,yn)[4]-i)/a} ${(P(this,yn)[5]-o)/c} L${d} ${h} L${u} ${f} L${(P(this,yn)[16]-i)/a} ${(P(this,yn)[17]-o)/c} L${(P(this,yn)[14]-i)/a} ${(P(this,yn)[15]-o)/c} Z`;const g=[];g.push(`M${t[4]} ${t[5]}`);for(let v=6;v<t.length;v+=6)isNaN(t[v])?g.push(`L${t[v+4]} ${t[v+5]}`):g.push(`C${t[v]} ${t[v+1]} ${t[v+2]} ${t[v+3]} ${t[v+4]} ${t[v+5]}`);g.push(`L${(r[0]-i)/a} ${(r[1]-o)/c} L${d} ${h} L${u} ${f} L${(s[0]-i)/a} ${(s[1]-o)/c}`);for(let v=n.length-6;v>=6;v-=6)isNaN(n[v])?g.push(`L${n[v+4]} ${n[v+5]}`):g.push(`C${n[v]} ${n[v+1]} ${n[v+2]} ${n[v+3]} ${n[v+4]} ${n[v+5]}`);return g.push(`L${n[4]} ${n[5]} Z`),g.join(" ")}getOutlines(){var y;const t=P(this,su),n=P(this,cf),r=P(this,yn),s=r.subarray(4,6),i=r.subarray(16,18),[o,a,c,d]=P(this,ru),h=new Float64Array((((y=P(this,Uh))==null?void 0:y.length)??0)+2);for(let b=0,w=h.length-2;b<w;b+=2)h[b]=(P(this,Uh)[b]-o)/c,h[b+1]=(P(this,Uh)[b+1]-a)/d;h[h.length-2]=(P(this,ov)-o)/c,h[h.length-1]=(P(this,av)-a)/d;const[u,f,g,v]=K(this,lA,B5).call(this);if(isNaN(r[6])&&!this.isEmpty()){const b=new Float64Array(36);return b.set([NaN,NaN,NaN,NaN,(r[2]-o)/c,(r[3]-a)/d,NaN,NaN,NaN,NaN,(r[4]-o)/c,(r[5]-a)/d,NaN,NaN,NaN,NaN,u,f,NaN,NaN,NaN,NaN,g,v,NaN,NaN,NaN,NaN,(r[16]-o)/c,(r[17]-a)/d,NaN,NaN,NaN,NaN,(r[14]-o)/c,(r[15]-a)/d],0),new U5(b,h,P(this,ru),P(this,j0),P(this,I0),P(this,L0))}const m=new Float64Array(P(this,su).length+24+P(this,cf).length);let x=t.length;for(let b=0;b<x;b+=2){if(isNaN(t[b])){m[b]=m[b+1]=NaN;continue}m[b]=t[b],m[b+1]=t[b+1]}m.set([NaN,NaN,NaN,NaN,(s[0]-o)/c,(s[1]-a)/d,NaN,NaN,NaN,NaN,u,f,NaN,NaN,NaN,NaN,g,v,NaN,NaN,NaN,NaN,(i[0]-o)/c,(i[1]-a)/d],x),x+=24;for(let b=n.length-6;b>=6;b-=6)for(let w=0;w<6;w+=2){if(isNaN(n[b+w])){m[x]=m[x+1]=NaN,x+=2;continue}m[x]=n[b+w],m[x+1]=n[b+w+1],x+=2}return m.set([NaN,NaN,NaN,NaN,n[4],n[5]],x),new U5(m,h,P(this,ru),P(this,j0),P(this,I0),P(this,L0))}};ru=new WeakMap,cf=new WeakMap,I0=new WeakMap,L0=new WeakMap,su=new WeakMap,yn=new WeakMap,ov=new WeakMap,av=new WeakMap,iA=new WeakMap,oA=new WeakMap,j0=new WeakMap,$0=new WeakMap,Uh=new WeakMap,aA=new WeakMap,Fk=new WeakMap,zk=new WeakMap,lA=new WeakSet,B5=function(){const t=P(this,yn).subarray(4,6),n=P(this,yn).subarray(16,18),[r,s,i,o]=P(this,ru);return[(P(this,ov)+(t[0]-n[0])/2-r)/i,(P(this,av)+(t[1]-n[1])/2-s)/o,(P(this,ov)+(n[0]-t[0])/2-r)/i,(P(this,av)+(n[1]-t[1])/2-s)/o]},G(Bd,aA,8),G(Bd,Fk,2),G(Bd,zk,P(Bd,aA)+P(Bd,Fk));let uk=Bd;var F0,lv,uf,cA,ja,uA,ys,ea,w1,S1,Pfe;class U5 extends Rfe{constructor(n,r,s,i,o,a){super();G(this,ea);G(this,F0);G(this,lv,null);G(this,uf);G(this,cA);G(this,ja);G(this,uA);G(this,ys);V(this,ys,n),V(this,ja,r),V(this,F0,s),V(this,uA,i),V(this,uf,o),V(this,cA,a),K(this,ea,Pfe).call(this,a);const{x:c,y:d,width:h,height:u}=P(this,lv);for(let f=0,g=n.length;f<g;f+=2)n[f]=(n[f]-c)/h,n[f+1]=(n[f+1]-d)/u;for(let f=0,g=r.length;f<g;f+=2)r[f]=(r[f]-c)/h,r[f+1]=(r[f+1]-d)/u}toSVGPath(){const n=[`M${P(this,ys)[4]} ${P(this,ys)[5]}`];for(let r=6,s=P(this,ys).length;r<s;r+=6){if(isNaN(P(this,ys)[r])){n.push(`L${P(this,ys)[r+4]} ${P(this,ys)[r+5]}`);continue}n.push(`C${P(this,ys)[r]} ${P(this,ys)[r+1]} ${P(this,ys)[r+2]} ${P(this,ys)[r+3]} ${P(this,ys)[r+4]} ${P(this,ys)[r+5]}`)}return n.push("Z"),n.join(" ")}serialize([n,r,s,i],o){const a=s-n,c=i-r;let d,h;switch(o){case 0:d=K(this,ea,w1).call(this,P(this,ys),n,i,a,-c),h=K(this,ea,w1).call(this,P(this,ja),n,i,a,-c);break;case 90:d=K(this,ea,S1).call(this,P(this,ys),n,r,a,c),h=K(this,ea,S1).call(this,P(this,ja),n,r,a,c);break;case 180:d=K(this,ea,w1).call(this,P(this,ys),s,r,-a,c),h=K(this,ea,w1).call(this,P(this,ja),s,r,-a,c);break;case 270:d=K(this,ea,S1).call(this,P(this,ys),s,i,-a,-c),h=K(this,ea,S1).call(this,P(this,ja),s,i,-a,-c);break}return{outline:Array.from(d),points:[Array.from(h)]}}get box(){return P(this,lv)}getNewOutline(n,r){const{x:s,y:i,width:o,height:a}=P(this,lv),[c,d,h,u]=P(this,F0),f=o*h,g=a*u,v=s*h+c,m=i*u+d,x=new uk({x:P(this,ja)[0]*f+v,y:P(this,ja)[1]*g+m},P(this,F0),P(this,uA),n,P(this,cA),r??P(this,uf));for(let y=2;y<P(this,ja).length;y+=2)x.add({x:P(this,ja)[y]*f+v,y:P(this,ja)[y+1]*g+m});return x.getOutlines()}}F0=new WeakMap,lv=new WeakMap,uf=new WeakMap,cA=new WeakMap,ja=new WeakMap,uA=new WeakMap,ys=new WeakMap,ea=new WeakSet,w1=function(n,r,s,i,o){const a=new Float64Array(n.length);for(let c=0,d=n.length;c<d;c+=2)a[c]=r+n[c]*i,a[c+1]=s+n[c+1]*o;return a},S1=function(n,r,s,i,o){const a=new Float64Array(n.length);for(let c=0,d=n.length;c<d;c+=2)a[c]=r+n[c+1]*i,a[c+1]=s+n[c]*o;return a},Pfe=function(n){const r=P(this,ys);let s=r[4],i=r[5],o=s,a=i,c=s,d=i,h=s,u=i;const f=n?Math.max:Math.min;for(let y=6,b=r.length;y<b;y+=6){if(isNaN(r[y]))o=Math.min(o,r[y+4]),a=Math.min(a,r[y+5]),c=Math.max(c,r[y+4]),d=Math.max(d,r[y+5]),u<r[y+5]?(h=r[y+4],u=r[y+5]):u===r[y+5]&&(h=f(h,r[y+4]));else{const w=xt.bezierBoundingBox(s,i,...r.slice(y,y+6));o=Math.min(o,w[0]),a=Math.min(a,w[1]),c=Math.max(c,w[2]),d=Math.max(d,w[3]),u<w[3]?(h=w[2],u=w[3]):u===w[3]&&(h=f(h,w[2]))}s=r[y+4],i=r[y+5]}const g=o-P(this,uf),v=a-P(this,uf),m=c-o+2*P(this,uf),x=d-a+2*P(this,uf);V(this,lv,{x:g,y:v,width:m,height:x,lastPoint:[h,u]})};var dA,fA,ac,cv,z0,qs,hA,B0,pA,mA,lc,U0,br,V5,H5,Nfe,rg,Tfe,ah;const Ud=class Ud{constructor({editor:t=null,uiManager:n=null}){G(this,br);G(this,dA,K(this,br,Nfe).bind(this));G(this,fA,K(this,br,Tfe).bind(this));G(this,ac,null);G(this,cv,null);G(this,z0);G(this,qs,null);G(this,hA,!1);G(this,B0,!1);G(this,pA,null);G(this,mA);G(this,lc,null);G(this,U0);var r;t?(V(this,B0,!1),V(this,U0,zt.HIGHLIGHT_COLOR),V(this,pA,t)):(V(this,B0,!0),V(this,U0,zt.HIGHLIGHT_DEFAULT_COLOR)),V(this,lc,(t==null?void 0:t._uiManager)||n),V(this,mA,P(this,lc)._eventBus),V(this,z0,(t==null?void 0:t.color)||((r=P(this,lc))==null?void 0:r.highlightColors.values().next().value)||"#FFFF98")}static get _keyboardManager(){return An(this,"_keyboardManager",new bR([[["Escape","mac+Escape"],Ud.prototype._hideDropdownFromKeyboard],[[" ","mac+ "],Ud.prototype._colorSelectFromKeyboard],[["ArrowDown","ArrowRight","mac+ArrowDown","mac+ArrowRight"],Ud.prototype._moveToNext],[["ArrowUp","ArrowLeft","mac+ArrowUp","mac+ArrowLeft"],Ud.prototype._moveToPrevious],[["Home","mac+Home"],Ud.prototype._moveToBeginning],[["End","mac+End"],Ud.prototype._moveToEnd]]))}renderButton(){const t=V(this,ac,document.createElement("button"));t.className="colorPicker",t.tabIndex="0",t.setAttribute("data-l10n-id","pdfjs-editor-colorpicker-button"),t.setAttribute("aria-haspopup",!0);const n=P(this,lc)._signal;t.addEventListener("click",K(this,br,rg).bind(this),{signal:n}),t.addEventListener("keydown",P(this,dA),{signal:n});const r=V(this,cv,document.createElement("span"));return r.className="swatch",r.setAttribute("aria-hidden",!0),r.style.backgroundColor=P(this,z0),t.append(r),t}renderMainDropdown(){const t=V(this,qs,K(this,br,V5).call(this));return t.setAttribute("aria-orientation","horizontal"),t.setAttribute("aria-labelledby","highlightColorPickerLabel"),t}_colorSelectFromKeyboard(t){if(t.target===P(this,ac)){K(this,br,rg).call(this,t);return}const n=t.target.getAttribute("data-color");n&&K(this,br,H5).call(this,n,t)}_moveToNext(t){var n,r;if(!P(this,br,ah)){K(this,br,rg).call(this,t);return}if(t.target===P(this,ac)){(n=P(this,qs).firstChild)==null||n.focus();return}(r=t.target.nextSibling)==null||r.focus()}_moveToPrevious(t){var n,r;if(t.target===((n=P(this,qs))==null?void 0:n.firstChild)||t.target===P(this,ac)){P(this,br,ah)&&this._hideDropdownFromKeyboard();return}P(this,br,ah)||K(this,br,rg).call(this,t),(r=t.target.previousSibling)==null||r.focus()}_moveToBeginning(t){var n;if(!P(this,br,ah)){K(this,br,rg).call(this,t);return}(n=P(this,qs).firstChild)==null||n.focus()}_moveToEnd(t){var n;if(!P(this,br,ah)){K(this,br,rg).call(this,t);return}(n=P(this,qs).lastChild)==null||n.focus()}hideDropdown(){var t;(t=P(this,qs))==null||t.classList.add("hidden"),window.removeEventListener("pointerdown",P(this,fA))}_hideDropdownFromKeyboard(){var t;if(!P(this,B0)){if(!P(this,br,ah)){(t=P(this,pA))==null||t.unselect();return}this.hideDropdown(),P(this,ac).focus({preventScroll:!0,focusVisible:P(this,hA)})}}updateColor(t){if(P(this,cv)&&(P(this,cv).style.backgroundColor=t),!P(this,qs))return;const n=P(this,lc).highlightColors.values();for(const r of P(this,qs).children)r.setAttribute("aria-selected",n.next().value===t)}destroy(){var t,n;(t=P(this,ac))==null||t.remove(),V(this,ac,null),V(this,cv,null),(n=P(this,qs))==null||n.remove(),V(this,qs,null)}};dA=new WeakMap,fA=new WeakMap,ac=new WeakMap,cv=new WeakMap,z0=new WeakMap,qs=new WeakMap,hA=new WeakMap,B0=new WeakMap,pA=new WeakMap,mA=new WeakMap,lc=new WeakMap,U0=new WeakMap,br=new WeakSet,V5=function(){const t=document.createElement("div"),n=P(this,lc)._signal;t.addEventListener("contextmenu",ia,{signal:n}),t.className="dropdown",t.role="listbox",t.setAttribute("aria-multiselectable",!1),t.setAttribute("aria-orientation","vertical"),t.setAttribute("data-l10n-id","pdfjs-editor-colorpicker-dropdown");for(const[r,s]of P(this,lc).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===P(this,z0)),i.addEventListener("click",K(this,br,H5).bind(this,s),{signal:n}),t.append(i)}return t.addEventListener("keydown",P(this,dA),{signal:n}),t},H5=function(t,n){n.stopPropagation(),P(this,mA).dispatch("switchannotationeditorparams",{source:this,type:P(this,U0),value:t})},Nfe=function(t){Ud._keyboardManager.exec(this,t)},rg=function(t){if(P(this,br,ah)){this.hideDropdown();return}if(V(this,hA,t.detail===0),window.addEventListener("pointerdown",P(this,fA),{signal:P(this,lc)._signal}),P(this,qs)){P(this,qs).classList.remove("hidden");return}const n=V(this,qs,K(this,br,V5).call(this));P(this,ac).append(n)},Tfe=function(t){var n;(n=P(this,qs))!=null&&n.contains(t.target)||this.hideDropdown()},ah=function(){return P(this,qs)&&!P(this,qs).classList.contains("hidden")};let dk=Ud;var V0,gA,Vh,uv,H0,al,vA,yA,dv,cc,xo,$a,Bk,W0,fv,Gs,q0,iu,bA,an,W5,q5,kfe,Dfe,Ofe,G5,C1,yl,nb,Mfe,EN,E1,Ife,Lfe,jfe,$fe;const zn=class zn extends tr{constructor(n){super({...n,name:"highlightEditor"});G(this,an);G(this,V0,null);G(this,gA,0);G(this,Vh);G(this,uv,null);G(this,H0,null);G(this,al,null);G(this,vA,null);G(this,yA,0);G(this,dv,null);G(this,cc,null);G(this,xo,null);G(this,$a,!1);G(this,Bk,K(this,an,Mfe).bind(this));G(this,W0,null);G(this,fv);G(this,Gs,null);G(this,q0,"");G(this,iu);G(this,bA,"");this.color=n.color||zn._defaultColor,V(this,iu,n.thickness||zn._defaultThickness),V(this,fv,n.opacity||zn._defaultOpacity),V(this,Vh,n.boxes||null),V(this,bA,n.methodOfCreation||""),V(this,q0,n.text||""),this._isDraggable=!1,n.highlightId>-1?(V(this,$a,!0),K(this,an,q5).call(this,n),K(this,an,C1).call(this)):(V(this,V0,n.anchorNode),V(this,gA,n.anchorOffset),V(this,vA,n.focusNode),V(this,yA,n.focusOffset),K(this,an,W5).call(this),K(this,an,C1).call(this),this.rotate(this.rotation))}static get _keyboardManager(){const n=zn.prototype;return An(this,"_keyboardManager",new bR([[["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:P(this,$a)?"free_highlight":"highlight",color:this._uiManager.highlightColorNames.get(this.color),thickness:P(this,iu),methodOfCreation:P(this,bA)}}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;tr.initialize(n,r),zn._defaultColor||(zn._defaultColor=((s=r.highlightColors)==null?void 0:s.values().next().value)||"#fff066")}static updateDefaultParams(n,r){switch(n){case zt.HIGHLIGHT_DEFAULT_COLOR:zn._defaultColor=r;break;case zt.HIGHLIGHT_THICKNESS:zn._defaultThickness=r;break}}translateInPage(n,r){}get toolbarPosition(){return P(this,W0)}updateParams(n,r){switch(n){case zt.HIGHLIGHT_COLOR:K(this,an,kfe).call(this,r);break;case zt.HIGHLIGHT_THICKNESS:K(this,an,Dfe).call(this,r);break}}static get defaultPropertiesToUpdate(){return[[zt.HIGHLIGHT_DEFAULT_COLOR,zn._defaultColor],[zt.HIGHLIGHT_THICKNESS,zn._defaultThickness]]}get propertiesToUpdate(){return[[zt.HIGHLIGHT_COLOR,this.color||zn._defaultColor],[zt.HIGHLIGHT_THICKNESS,P(this,iu)||zn._defaultThickness],[zt.HIGHLIGHT_FREE,P(this,$a)]]}async addEditToolbar(){const n=await super.addEditToolbar();return n?(this._uiManager.highlightColors&&(V(this,H0,new dk({editor:this})),n.addColorPicker(P(this,H0))),n):null}disableEditing(){super.disableEditing(),this.div.classList.toggle("disabled",!0)}enableEditing(){super.enableEditing(),this.div.classList.toggle("disabled",!1)}fixAndSetPosition(){return super.fixAndSetPosition(K(this,an,E1).call(this))}getBaseTranslation(){return[0,0]}getRect(n,r){return super.getRect(n,r,K(this,an,E1).call(this))}onceAdded(){this.parent.addUndoableEditor(this),this.div.focus()}remove(){K(this,an,G5).call(this),this._reportTelemetry({action:"deleted"}),super.remove()}rebuild(){this.parent&&(super.rebuild(),this.div!==null&&(K(this,an,C1).call(this),this.isAttachedToDOM||this.parent.add(this)))}setParent(n){var s;let r=!1;this.parent&&!n?K(this,an,G5).call(this):n&&(K(this,an,C1).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;P(this,$a)?(n=(n-this.rotation+360)%360,s=K(i=zn,yl,nb).call(i,P(this,cc).box,n)):s=K(o=zn,yl,nb).call(o,this,n),r.rotate(P(this,xo),n),r.rotate(P(this,Gs),n),r.updateBox(P(this,xo),s),r.updateBox(P(this,Gs),K(a=zn,yl,nb).call(a,P(this,al).box,n))}render(){if(this.div)return this.div;const n=super.render();P(this,q0)&&(n.setAttribute("aria-label",P(this,q0)),n.setAttribute("role","mark")),P(this,$a)?n.classList.add("free"):this.div.addEventListener("keydown",P(this,Bk),{signal:this._uiManager._signal});const r=V(this,dv,document.createElement("div"));n.append(r),r.setAttribute("aria-hidden","true"),r.className="internal",r.style.clipPath=P(this,uv);const[s,i]=this.parentDimensions;return this.setDims(this.width*s,this.height*i),ok(this,P(this,dv),["pointerover","pointerleave"]),this.enableEditing(),n}pointerover(){this.parent.drawLayer.addClass(P(this,Gs),"hovered")}pointerleave(){this.parent.drawLayer.removeClass(P(this,Gs),"hovered")}_moveCaret(n){switch(this.parent.unselect(this),n){case 0:case 2:K(this,an,EN).call(this,!0);break;case 1:case 3:K(this,an,EN).call(this,!1);break}}select(){var n,r;super.select(),P(this,Gs)&&((n=this.parent)==null||n.drawLayer.removeClass(P(this,Gs),"hovered"),(r=this.parent)==null||r.drawLayer.addClass(P(this,Gs),"selected"))}unselect(){var n;super.unselect(),P(this,Gs)&&((n=this.parent)==null||n.drawLayer.removeClass(P(this,Gs),"selected"),P(this,$a)||K(this,an,EN).call(this,!1))}get _mustFixPosition(){return!P(this,$a)}show(n=this._isVisible){super.show(n),this.parent&&(this.parent.drawLayer.show(P(this,xo),n),this.parent.drawLayer.show(P(this,Gs),n))}static startHighlighting(n,r,{target:s,x:i,y:o}){const{x:a,y:c,width:d,height:h}=s.getBoundingClientRect(),u=x=>{K(this,yl,jfe).call(this,n,x)},f=n._signal,g={capture:!0,passive:!1,signal:f},v=x=>{x.preventDefault(),x.stopPropagation()},m=x=>{s.removeEventListener("pointermove",u),window.removeEventListener("blur",m),window.removeEventListener("pointerup",m),window.removeEventListener("pointerdown",v,g),window.removeEventListener("contextmenu",ia),K(this,yl,$fe).call(this,n,x)};window.addEventListener("blur",m,{signal:f}),window.addEventListener("pointerup",m,{signal:f}),window.addEventListener("pointerdown",v,g),window.addEventListener("contextmenu",ia,{signal:f}),s.addEventListener("pointermove",u,{signal:f}),this._freeHighlight=new uk({x:i,y:o},[a,c,d,h],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,d],color:h,quadPoints:u}=n;i.color=xt.makeHexColor(...h),V(i,fv,n.opacity);const[f,g]=i.pageDimensions;i.width=(c-o)/f,i.height=(d-a)/g;const v=V(i,Vh,[]);for(let x=0;x<u.length;x+=8)v.push({x:(u[4]-c)/f,y:(d-(1-u[x+5]))/g,width:(u[x+2]-u[x])/f,height:(u[x+5]-u[x+1])/g});return K(m=i,an,W5).call(m),i}serialize(n=!1){if(this.isEmpty()||n)return null;const r=this.getRect(0,0),s=tr._colorManager.convert(this.color);return{annotationType:_n.HIGHLIGHT,color:s,opacity:P(this,fv),thickness:P(this,iu),quadPoints:K(this,an,Ife).call(this),outlines:K(this,an,Lfe).call(this,r),pageIndex:this.pageIndex,rect:r,rotation:K(this,an,E1).call(this),structTreeParentId:this._structTreeParentId}}static canCreateNewEmptyEditor(){return!1}};V0=new WeakMap,gA=new WeakMap,Vh=new WeakMap,uv=new WeakMap,H0=new WeakMap,al=new WeakMap,vA=new WeakMap,yA=new WeakMap,dv=new WeakMap,cc=new WeakMap,xo=new WeakMap,$a=new WeakMap,Bk=new WeakMap,W0=new WeakMap,fv=new WeakMap,Gs=new WeakMap,q0=new WeakMap,iu=new WeakMap,bA=new WeakMap,an=new WeakSet,W5=function(){const n=new F5(P(this,Vh),.001);V(this,cc,n.getOutlines()),{x:this.x,y:this.y,width:this.width,height:this.height}=P(this,cc).box;const r=new F5(P(this,Vh),.0025,.001,this._uiManager.direction==="ltr");V(this,al,r.getOutlines());const{lastPoint:s}=P(this,al).box;V(this,W0,[(s[0]-this.x)/this.width,(s[1]-this.y)/this.height])},q5=function({highlightOutlines:n,highlightId:r,clipPathId:s}){var u,f;if(V(this,cc,n),V(this,al,n.getNewOutline(P(this,iu)/2+1.5,.0025)),r>=0)V(this,xo,r),V(this,uv,s),this.parent.drawLayer.finalizeLine(r,n),V(this,Gs,this.parent.drawLayer.highlightOutline(P(this,al)));else if(this.parent){const g=this.parent.viewport.rotation;this.parent.drawLayer.updateLine(P(this,xo),n),this.parent.drawLayer.updateBox(P(this,xo),K(u=zn,yl,nb).call(u,P(this,cc).box,(g-this.rotation+360)%360)),this.parent.drawLayer.updateLine(P(this,Gs),P(this,al)),this.parent.drawLayer.updateBox(P(this,Gs),K(f=zn,yl,nb).call(f,P(this,al).box,g))}const{x:o,y:a,width:c,height:d}=n.box;switch(this.rotation){case 0:this.x=o,this.y=a,this.width=c,this.height=d;break;case 90:{const[g,v]=this.parentDimensions;this.x=a,this.y=1-o,this.width=c*v/g,this.height=d*g/v;break}case 180:this.x=1-o,this.y=1-a,this.width=c,this.height=d;break;case 270:{const[g,v]=this.parentDimensions;this.x=1-a,this.y=o,this.width=c*v/g,this.height=d*g/v;break}}const{lastPoint:h}=P(this,al).box;V(this,W0,[(h[0]-o)/c,(h[1]-a)/d])},kfe=function(n){const r=i=>{var o,a;this.color=i,(o=this.parent)==null||o.drawLayer.changeColor(P(this,xo),i),(a=P(this,H0))==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:zt.HIGHLIGHT_COLOR,overwriteIfSameType:!0,keepUndo:!0}),this._reportTelemetry({action:"color_changed",color:this._uiManager.highlightColorNames.get(n)},!0)},Dfe=function(n){const r=P(this,iu),s=i=>{V(this,iu,i),K(this,an,Ofe).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:zt.INK_THICKNESS,overwriteIfSameType:!0,keepUndo:!0}),this._reportTelemetry({action:"thickness_changed",thickness:n},!0)},Ofe=function(n){if(!P(this,$a))return;K(this,an,q5).call(this,{highlightOutlines:P(this,cc).getNewOutline(n/2)}),this.fixAndSetPosition();const[r,s]=this.parentDimensions;this.setDims(this.width*r,this.height*s)},G5=function(){P(this,xo)===null||!this.parent||(this.parent.drawLayer.remove(P(this,xo)),V(this,xo,null),this.parent.drawLayer.remove(P(this,Gs)),V(this,Gs,null))},C1=function(n=this.parent){P(this,xo)===null&&({id:Ui(this,xo)._,clipPathId:Ui(this,uv)._}=n.drawLayer.highlight(P(this,cc),this.color,P(this,fv)),V(this,Gs,n.drawLayer.highlightOutline(P(this,al))),P(this,dv)&&(P(this,dv).style.clipPath=P(this,uv)))},yl=new WeakSet,nb=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}},Mfe=function(n){zn._keyboardManager.exec(this,n)},EN=function(n){if(!P(this,V0))return;const r=window.getSelection();n?r.setPosition(P(this,V0),P(this,gA)):r.setPosition(P(this,vA),P(this,yA))},E1=function(){return P(this,$a)?this.rotation:0},Ife=function(){if(P(this,$a))return null;const[n,r]=this.pageDimensions,s=P(this,Vh),i=new Float32Array(s.length*8);let o=0;for(const{x:a,y:c,width:d,height:h}of s){const u=a*n,f=(1-c-h)*r;i[o]=i[o+4]=u,i[o+1]=i[o+3]=f,i[o+2]=i[o+6]=u+d*n,i[o+5]=i[o+7]=f+h*r,o+=8}return i},Lfe=function(n){return P(this,cc).serialize(n,K(this,an,E1).call(this))},jfe=function(n,r){this._freeHighlight.add(r)&&n.drawLayer.updatePath(this._freeHighlightId,this._freeHighlight)},$fe=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=""},G(zn,yl),Be(zn,"_defaultColor",null),Be(zn,"_defaultOpacity",1),Be(zn,"_defaultThickness",12),Be(zn,"_l10nPromise"),Be(zn,"_type","highlight"),Be(zn,"_editorType",_n.HIGHLIGHT),Be(zn,"_freeHighlightId",-1),Be(zn,"_freeHighlight",null),Be(zn,"_freeHighlightClipId","");let fk=zn;var hv,pv,xA,_A,wA,mv,ou,df,ll,gv,vv,ff,yv,bv,Hh,nt,Ffe,zfe,Bfe,Ufe,Y5,Vfe,X5,Hfe,Wfe,qfe,Gfe,Kfe,sg,Q5,AN,RN,rb,Z5,PN,zf,Yfe,J5,Xfe,Qfe,eV,NN,A1;const Jr=class Jr extends tr{constructor(n){super({...n,name:"inkEditor"});G(this,nt);G(this,hv,0);G(this,pv,0);G(this,xA,this.canvasPointermove.bind(this));G(this,_A,this.canvasPointerleave.bind(this));G(this,wA,this.canvasPointerup.bind(this));G(this,mv,this.canvasPointerdown.bind(this));G(this,ou,null);G(this,df,new Path2D);G(this,ll,!1);G(this,gv,!1);G(this,vv,!1);G(this,ff,null);G(this,yv,0);G(this,bv,0);G(this,Hh,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){tr.initialize(n,r)}static updateDefaultParams(n,r){switch(n){case zt.INK_THICKNESS:Jr._defaultThickness=r;break;case zt.INK_COLOR:Jr._defaultColor=r;break;case zt.INK_OPACITY:Jr._defaultOpacity=r/100;break}}updateParams(n,r){switch(n){case zt.INK_THICKNESS:K(this,nt,Ffe).call(this,r);break;case zt.INK_COLOR:K(this,nt,zfe).call(this,r);break;case zt.INK_OPACITY:K(this,nt,Bfe).call(this,r);break}}static get defaultPropertiesToUpdate(){return[[zt.INK_THICKNESS,Jr._defaultThickness],[zt.INK_COLOR,Jr._defaultColor||tr._defaultLineColor],[zt.INK_OPACITY,Math.round(Jr._defaultOpacity*100)]]}get propertiesToUpdate(){return[[zt.INK_THICKNESS,this.thickness||Jr._defaultThickness],[zt.INK_COLOR,this.color||Jr._defaultColor||tr._defaultLineColor],[zt.INK_OPACITY,Math.round(100*(this.opacity??Jr._defaultOpacity))]]}rebuild(){this.parent&&(super.rebuild(),this.div!==null&&(this.canvas||(K(this,nt,AN).call(this),K(this,nt,RN).call(this)),this.isAttachedToDOM||(this.parent.add(this),K(this,nt,rb).call(this)),K(this,nt,A1).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,P(this,ou)&&(clearTimeout(P(this,ou)),V(this,ou,null)),(n=P(this,ff))==null||n.disconnect(),V(this,ff,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(){P(this,ll)||this.canvas===null||(super.enableEditMode(),this._isDraggable=!1,this.canvas.addEventListener("pointerdown",P(this,mv),{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",P(this,mv)))}onceAdded(){this._isDraggable=!this.isEmpty()}isEmpty(){return this.paths.length===0||this.paths.length===1&&this.paths[0].length===0}commit(){P(this,ll)||(super.commit(),this.isEditing=!1,this.disableEditMode(),this.setInForeground(),V(this,ll,!0),this.div.classList.add("disabled"),K(this,nt,A1).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()||P(this,ll)||(this.setInForeground(),n.preventDefault(),this.div.contains(document.activeElement)||this.div.focus({preventScroll:!0}),K(this,nt,Vfe).call(this,n.offsetX,n.offsetY))}canvasPointermove(n){n.preventDefault(),K(this,nt,X5).call(this,n.offsetX,n.offsetY)}canvasPointerup(n){n.preventDefault(),K(this,nt,Q5).call(this,n)}canvasPointerleave(n){K(this,nt,Q5).call(this,n)}get isResizable(){return!this.isEmpty()&&P(this,ll)}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]=K(this,nt,Ufe).call(this);if(this.setAt(s,i,0,0),this.setDims(o,a),K(this,nt,AN).call(this),this.width){const[c,d]=this.parentDimensions;this.setAspectRatio(this.width*c,this.height*d),this.setAt(n*c,r*d,this.width*c,this.height*d),V(this,vv,!0),K(this,nt,rb).call(this),this.setDims(this.width*c,this.height*d),K(this,nt,sg).call(this),this.div.classList.add("disabled")}else this.div.classList.add("editing"),this.enableEditMode();return K(this,nt,RN).call(this),this.div}setDimensions(n,r){const s=Math.round(n),i=Math.round(r);if(P(this,yv)===s&&P(this,bv)===i)return;V(this,yv,s),V(this,bv,i),this.canvas.style.visibility="hidden";const[o,a]=this.parentDimensions;this.width=n/o,this.height=r/a,this.fixAndSetPosition(),P(this,ll)&&K(this,nt,Z5).call(this,n,r),K(this,nt,rb).call(this),K(this,nt,sg).call(this),this.canvas.style.visibility="visible",this.fixDims()}static deserialize(n,r,s){var x,y,b;if(n instanceof gfe)return null;const i=super.deserialize(n,r,s);i.thickness=n.thickness,i.color=xt.makeHexColor(...n.color),i.opacity=n.opacity;const[o,a]=i.pageDimensions,c=i.width*o,d=i.height*a,h=i.parentScale,u=n.thickness/2;V(i,ll,!0),V(i,yv,Math.round(c)),V(i,bv,Math.round(d));const{paths:f,rect:g,rotation:v}=n;for(let{bezier:w}of f){w=K(x=Jr,zf,Xfe).call(x,w,g,v);const E=[];i.paths.push(E);let R=h*(w[0]-u),T=h*(w[1]-u);for(let A=2,D=w.length;A<D;A+=6){const O=h*(w[A]-u),I=h*(w[A+1]-u),$=h*(w[A+2]-u),F=h*(w[A+3]-u),B=h*(w[A+4]-u),W=h*(w[A+5]-u);E.push([[R,T],[O,I],[$,F],[B,W]]),R=B,T=W}const N=K(this,zf,Yfe).call(this,E);i.bezierPath2D.push(N)}const m=K(y=i,nt,eV).call(y);return V(i,pv,Math.max(tr.MIN_SIZE,m[2]-m[0])),V(i,hv,Math.max(tr.MIN_SIZE,m[3]-m[1])),K(b=i,nt,Z5).call(b,c,d),i}serialize(){if(this.isEmpty())return null;const n=this.getRect(0,0),r=tr._colorManager.convert(this.ctx.strokeStyle);return{annotationType:_n.INK,color:r,thickness:this.thickness,opacity:this.opacity,paths:K(this,nt,Qfe).call(this,this.scaleFactor/this.parentScale,this.translationX,this.translationY,n),pageIndex:this.pageIndex,rect:n,rotation:this.rotation,structTreeParentId:this._structTreeParentId}}};hv=new WeakMap,pv=new WeakMap,xA=new WeakMap,_A=new WeakMap,wA=new WeakMap,mv=new WeakMap,ou=new WeakMap,df=new WeakMap,ll=new WeakMap,gv=new WeakMap,vv=new WeakMap,ff=new WeakMap,yv=new WeakMap,bv=new WeakMap,Hh=new WeakMap,nt=new WeakSet,Ffe=function(n){const r=i=>{this.thickness=i,K(this,nt,A1).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:zt.INK_THICKNESS,overwriteIfSameType:!0,keepUndo:!0})},zfe=function(n){const r=i=>{this.color=i,K(this,nt,sg).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:zt.INK_COLOR,overwriteIfSameType:!0,keepUndo:!0})},Bfe=function(n){const r=i=>{this.opacity=i,K(this,nt,sg).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:zt.INK_OPACITY,overwriteIfSameType:!0,keepUndo:!0})},Ufe=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]}},Y5=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}${wUe(s)}`},Vfe=function(n,r){const s=this._uiManager._signal;this.canvas.addEventListener("contextmenu",ia,{signal:s}),this.canvas.addEventListener("pointerleave",P(this,_A),{signal:s}),this.canvas.addEventListener("pointermove",P(this,xA),{signal:s}),this.canvas.addEventListener("pointerup",P(this,wA),{signal:s}),this.canvas.removeEventListener("pointerdown",P(this,mv)),this.isEditing=!0,P(this,vv)||(V(this,vv,!0),K(this,nt,rb).call(this),this.thickness||(this.thickness=Jr._defaultThickness),this.color||(this.color=Jr._defaultColor||tr._defaultLineColor),this.opacity??(this.opacity=Jr._defaultOpacity)),this.currentPath.push([n,r]),V(this,gv,!1),K(this,nt,Y5).call(this),V(this,Hh,()=>{K(this,nt,qfe).call(this),P(this,Hh)&&window.requestAnimationFrame(P(this,Hh))}),window.requestAnimationFrame(P(this,Hh))},X5=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=P(this,df);if(o.push([n,r]),V(this,gv,!0),o.length<=2){a.moveTo(...o[0]),a.lineTo(n,r);return}o.length===3&&(V(this,df,a=new Path2D),a.moveTo(...o[0])),K(this,nt,Gfe).call(this,a,...o.at(-3),...o.at(-2),n,r)},Hfe=function(){if(this.currentPath.length===0)return;const n=this.currentPath.at(-1);P(this,df).lineTo(...n)},Wfe=function(n,r){V(this,Hh,null),n=Math.min(Math.max(n,0),this.canvas.width),r=Math.min(Math.max(r,0),this.canvas.height),K(this,nt,X5).call(this,n,r),K(this,nt,Hfe).call(this);let s;if(this.currentPath.length!==1)s=K(this,nt,Kfe).call(this);else{const d=[n,r];s=[[d,d.slice(),d.slice(),d]]}const i=P(this,df),o=this.currentPath;this.currentPath=[],V(this,df,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||(K(this,nt,AN).call(this),K(this,nt,RN).call(this)),K(this,nt,A1).call(this))};this.addCommands({cmd:a,undo:c,mustExec:!0})},qfe=function(){if(!P(this,gv))return;V(this,gv,!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(P(this,df)),o.restore()},Gfe=function(n,r,s,i,o,a,c){const d=(r+i)/2,h=(s+o)/2,u=(i+a)/2,f=(o+c)/2;n.bezierCurveTo(d+2*(i-d)/3,h+2*(o-h)/3,u+2*(i-u)/3,f+2*(o-f)/3,u,f)},Kfe=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[g,v]=n[s],[m,x]=n[s+1],y=(g+m)/2,b=(v+x)/2,w=[i+2*(g-i)/3,o+2*(v-o)/3],E=[y+2*(g-y)/3,b+2*(v-b)/3];r.push([[i,o],w,E,[y,b]]),[i,o]=[y,b]}const[a,c]=n[s],[d,h]=n[s+1],u=[i+2*(a-i)/3,o+2*(c-o)/3],f=[d+2*(a-d)/3,h+2*(c-h)/3];return r.push([[i,o],u,f,[d,h]]),r},sg=function(){if(this.isEmpty()){K(this,nt,PN).call(this);return}K(this,nt,Y5).call(this);const{canvas:n,ctx:r}=this;r.setTransform(1,0,0,1,0,0),r.clearRect(0,0,n.width,n.height),K(this,nt,PN).call(this);for(const s of this.bezierPath2D)r.stroke(s)},Q5=function(n){this.canvas.removeEventListener("pointerleave",P(this,_A)),this.canvas.removeEventListener("pointermove",P(this,xA)),this.canvas.removeEventListener("pointerup",P(this,wA)),this.canvas.addEventListener("pointerdown",P(this,mv),{signal:this._uiManager._signal}),P(this,ou)&&clearTimeout(P(this,ou)),V(this,ou,setTimeout(()=>{V(this,ou,null),this.canvas.removeEventListener("contextmenu",ia)},10)),K(this,nt,Wfe).call(this,n.offsetX,n.offsetY),this.addToAnnotationStorage(),this.setInBackground()},AN=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")},RN=function(){V(this,ff,new ResizeObserver(n=>{const r=n[0].contentRect;r.width&&r.height&&this.setDimensions(r.width,r.height)})),P(this,ff).observe(this.div),this._uiManager._signal.addEventListener("abort",()=>{var n;(n=P(this,ff))==null||n.disconnect(),V(this,ff,null)},{once:!0})},rb=function(){if(!P(this,vv))return;const[n,r]=this.parentDimensions;this.canvas.width=Math.ceil(this.width*n),this.canvas.height=Math.ceil(this.height*r),K(this,nt,PN).call(this)},Z5=function(n,r){const s=K(this,nt,NN).call(this),i=(n-s)/P(this,pv),o=(r-s)/P(this,hv);this.scaleFactor=Math.min(i,o)},PN=function(){const n=K(this,nt,NN).call(this)/2;this.ctx.setTransform(this.scaleFactor,0,0,this.scaleFactor,this.translationX*this.scaleFactor+n,this.translationY*this.scaleFactor+n)},zf=new WeakSet,Yfe=function(n){const r=new Path2D;for(let s=0,i=n.length;s<i;s++){const[o,a,c,d]=n[s];s===0&&r.moveTo(...o),r.bezierCurveTo(a[0],a[1],c[0],c[1],d[0],d[1])}return r},J5=function(n,r,s){const[i,o,a,c]=r;switch(s){case 0:for(let d=0,h=n.length;d<h;d+=2)n[d]+=i,n[d+1]=c-n[d+1];break;case 90:for(let d=0,h=n.length;d<h;d+=2){const u=n[d];n[d]=n[d+1]+i,n[d+1]=u+o}break;case 180:for(let d=0,h=n.length;d<h;d+=2)n[d]=a-n[d],n[d+1]+=o;break;case 270:for(let d=0,h=n.length;d<h;d+=2){const u=n[d];n[d]=a-n[d+1],n[d+1]=c-u}break;default:throw new Error("Invalid rotation")}return n},Xfe=function(n,r,s){const[i,o,a,c]=r;switch(s){case 0:for(let d=0,h=n.length;d<h;d+=2)n[d]-=i,n[d+1]=c-n[d+1];break;case 90:for(let d=0,h=n.length;d<h;d+=2){const u=n[d];n[d]=n[d+1]-o,n[d+1]=u-i}break;case 180:for(let d=0,h=n.length;d<h;d+=2)n[d]=a-n[d],n[d+1]-=o;break;case 270:for(let d=0,h=n.length;d<h;d+=2){const u=n[d];n[d]=c-n[d+1],n[d+1]=a-u}break;default:throw new Error("Invalid rotation")}return n},Qfe=function(n,r,s,i){var h,u;const o=[],a=this.thickness/2,c=n*r+a,d=n*s+a;for(const f of this.paths){const g=[],v=[];for(let m=0,x=f.length;m<x;m++){const[y,b,w,E]=f[m];if(y[0]===E[0]&&y[1]===E[1]&&x===1){const F=n*y[0]+c,B=n*y[1]+d;g.push(F,B),v.push(F,B);break}const R=n*y[0]+c,T=n*y[1]+d,N=n*b[0]+c,A=n*b[1]+d,D=n*w[0]+c,O=n*w[1]+d,I=n*E[0]+c,$=n*E[1]+d;m===0&&(g.push(R,T),v.push(R,T)),g.push(N,A,D,O,I,$),v.push(N,A),m===x-1&&v.push(I,$)}o.push({bezier:K(h=Jr,zf,J5).call(h,g,i,this.rotation),points:K(u=Jr,zf,J5).call(u,v,i,this.rotation)})}return o},eV=function(){let n=1/0,r=-1/0,s=1/0,i=-1/0;for(const o of this.paths)for(const[a,c,d,h]of o){const u=xt.bezierBoundingBox(...a,...c,...d,...h);n=Math.min(n,u[0]),s=Math.min(s,u[1]),r=Math.max(r,u[2]),i=Math.max(i,u[3])}return[n,s,r,i]},NN=function(){return P(this,ll)?Math.ceil(this.thickness*this.parentScale):0},A1=function(n=!1){if(this.isEmpty())return;if(!P(this,ll)){K(this,nt,sg).call(this);return}const r=K(this,nt,eV).call(this),s=K(this,nt,NN).call(this);V(this,pv,Math.max(tr.MIN_SIZE,r[2]-r[0])),V(this,hv,Math.max(tr.MIN_SIZE,r[3]-r[1]));const i=Math.ceil(s+P(this,pv)*this.scaleFactor),o=Math.ceil(s+P(this,hv)*this.scaleFactor),[a,c]=this.parentDimensions;this.width=i/a,this.height=o/c,this.setAspectRatio(i,o);const d=this.translationX,h=this.translationY;this.translationX=-r[0],this.translationY=-r[1],K(this,nt,rb).call(this),K(this,nt,sg).call(this),V(this,yv,i),V(this,bv,o),this.setDims(i,o);const u=n?s/this.scaleFactor/2:0;this.translate(d-this.translationX-u,h-this.translationY-u)},G(Jr,zf),Be(Jr,"_defaultColor",null),Be(Jr,"_defaultOpacity",1),Be(Jr,"_defaultThickness",1),Be(Jr,"_type","ink"),Be(Jr,"_editorType",_n.INK);let K5=Jr;var Ni,Ti,Wh,hf,qh,G0,au,pf,lu,uc,SA,On,R1,P1,TN,nV,Zfe,Jfe,rV,kN,ehe;const Z1=class Z1 extends tr{constructor(n){super({...n,name:"stampEditor"});G(this,On);G(this,Ni,null);G(this,Ti,null);G(this,Wh,null);G(this,hf,null);G(this,qh,null);G(this,G0,"");G(this,au,null);G(this,pf,null);G(this,lu,null);G(this,uc,!1);G(this,SA,!1);V(this,hf,n.bitmapUrl),V(this,qh,n.bitmapFile)}static initialize(n,r){tr.initialize(n,r)}static get supportedTypes(){return An(this,"supportedTypes",["apng","avif","bmp","gif","jpeg","png","svg+xml","webp","x-icon"].map(r=>`image/${r}`))}static get supportedTypesStr(){return An(this,"supportedTypesStr",this.supportedTypes.join(","))}static isHandlingMimeForPasting(n){return this.supportedTypes.includes(n)}static paste(n,r){r.pasteEditor(_n.STAMP,{bitmapFile:n.getAsFile()})}remove(){var n,r;P(this,Ti)&&(V(this,Ni,null),this._uiManager.imageManager.deleteId(P(this,Ti)),(n=P(this,au))==null||n.remove(),V(this,au,null),(r=P(this,pf))==null||r.disconnect(),V(this,pf,null),P(this,lu)&&(clearTimeout(P(this,lu)),V(this,lu,null))),super.remove()}rebuild(){if(!this.parent){P(this,Ti)&&K(this,On,TN).call(this);return}super.rebuild(),this.div!==null&&(P(this,Ti)&&P(this,au)===null&&K(this,On,TN).call(this),this.isAttachedToDOM||this.parent.add(this))}onceAdded(){this._isDraggable=!0,this.div.focus()}isEmpty(){return!(P(this,Wh)||P(this,Ni)||P(this,hf)||P(this,qh)||P(this,Ti))}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(),P(this,Ni)?K(this,On,nV).call(this):K(this,On,TN).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 P(this,au)}static deserialize(n,r,s){if(n instanceof vfe)return null;const i=super.deserialize(n,r,s),{rect:o,bitmapUrl:a,bitmapId:c,isSvg:d,accessibilityData:h}=n;c&&s.imageManager.isValidId(c)?V(i,Ti,c):V(i,hf,a),V(i,uc,d);const[u,f]=i.pageDimensions;return i.width=(o[2]-o[0])/u,i.height=(o[3]-o[1])/f,h&&(i.altTextData=h),i}serialize(n=!1,r=null){if(this.isEmpty())return null;const s={annotationType:_n.STAMP,bitmapId:P(this,Ti),pageIndex:this.pageIndex,rect:this.getRect(0,0),rotation:this.rotation,isSvg:P(this,uc),structTreeParentId:this._structTreeParentId};if(n)return s.bitmapUrl=K(this,On,kN).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=P(this,uc)?(s.rect[2]-s.rect[0])*(s.rect[3]-s.rect[1]):null;if(!r.stamps.has(P(this,Ti)))r.stamps.set(P(this,Ti),{area:a,serialized:s}),s.bitmap=K(this,On,kN).call(this,!1);else if(P(this,uc)){const c=r.stamps.get(P(this,Ti));a>c.area&&(c.area=a,c.serialized.bitmap.close(),c.serialized.bitmap=K(this,On,kN).call(this,!1))}return s}};Ni=new WeakMap,Ti=new WeakMap,Wh=new WeakMap,hf=new WeakMap,qh=new WeakMap,G0=new WeakMap,au=new WeakMap,pf=new WeakMap,lu=new WeakMap,uc=new WeakMap,SA=new WeakMap,On=new WeakSet,R1=function(n,r=!1){if(!n){this.remove();return}V(this,Ni,n.bitmap),r||(V(this,Ti,n.id),V(this,uc,n.isSvg)),n.file&&V(this,G0,n.file.name),K(this,On,nV).call(this)},P1=function(){V(this,Wh,null),this._uiManager.enableWaiting(!1),P(this,au)&&this.div.focus()},TN=function(){if(P(this,Ti)){this._uiManager.enableWaiting(!0),this._uiManager.imageManager.getFromId(P(this,Ti)).then(s=>K(this,On,R1).call(this,s,!0)).finally(()=>K(this,On,P1).call(this));return}if(P(this,hf)){const s=P(this,hf);V(this,hf,null),this._uiManager.enableWaiting(!0),V(this,Wh,this._uiManager.imageManager.getFromUrl(s).then(i=>K(this,On,R1).call(this,i)).finally(()=>K(this,On,P1).call(this)));return}if(P(this,qh)){const s=P(this,qh);V(this,qh,null),this._uiManager.enableWaiting(!0),V(this,Wh,this._uiManager.imageManager.getFromFile(s).then(i=>K(this,On,R1).call(this,i)).finally(()=>K(this,On,P1).call(this)));return}const n=document.createElement("input");n.type="file",n.accept=Z1.supportedTypesStr;const r=this._uiManager._signal;V(this,Wh,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]);K(this,On,R1).call(this,i)}s()},{signal:r}),n.addEventListener("cancel",()=>{this.remove(),s()},{signal:r})}).finally(()=>K(this,On,P1).call(this))),n.click()},nV=function(){const{div:n}=this;let{width:r,height:s}=P(this,Ni);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 u=Math.min(a*i/r,a*o/s);r*=u,s*=u}const[c,d]=this.parentDimensions;this.setDims(r*c/i,s*d/o),this._uiManager.enableWaiting(!1);const h=V(this,au,document.createElement("canvas"));n.append(h),n.hidden=!1,K(this,On,rV).call(this,r,s),K(this,On,ehe).call(this),P(this,SA)||(this.parent.addUndoableEditor(this),V(this,SA,!0)),this._reportTelemetry({action:"inserted_image"}),P(this,G0)&&h.setAttribute("aria-label",P(this,G0))},Zfe=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,P(this,lu)!==null&&clearTimeout(P(this,lu)),V(this,lu,setTimeout(()=>{V(this,lu,null),K(this,On,rV).call(this,n,r)},200))},Jfe=function(n,r){const{width:s,height:i}=P(this,Ni);let o=s,a=i,c=P(this,Ni);for(;o>2*n||a>2*r;){const d=o,h=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 u=new OffscreenCanvas(o,a);u.getContext("2d").drawImage(c,0,0,d,h,0,0,o,a),c=u.transferToImageBitmap()}return c},rV=function(n,r){n=Math.ceil(n),r=Math.ceil(r);const s=P(this,au);if(!s||s.width===n&&s.height===r)return;s.width=n,s.height=r;const i=P(this,uc)?P(this,Ni):K(this,On,Jfe).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(d=>{const h=(d==null?void 0:d.output)||"";this.parent&&h&&!this.hasAltText()&&(this.altTextData={altText:h,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)},kN=function(n){if(n){if(P(this,uc)){const i=this._uiManager.imageManager.getSvgUrl(P(this,Ti));if(i)return i}const r=document.createElement("canvas");return{width:r.width,height:r.height}=P(this,Ni),r.getContext("2d").drawImage(P(this,Ni),0,0),r.toDataURL()}if(P(this,uc)){const[r,s]=this.pageDimensions,i=Math.round(this.width*r*wp.PDF_TO_CSS_UNITS),o=Math.round(this.height*s*wp.PDF_TO_CSS_UNITS),a=new OffscreenCanvas(i,o);return a.getContext("2d").drawImage(P(this,Ni),0,0,P(this,Ni).width,P(this,Ni).height,0,0,i,o),a.transferToImageBitmap()}return structuredClone(P(this,Ni))},ehe=function(){this._uiManager._signal&&(V(this,pf,new ResizeObserver(n=>{const r=n[0].contentRect;r.width&&r.height&&K(this,On,Zfe).call(this,r.width,r.height)})),P(this,pf).observe(this.div),this._uiManager._signal.addEventListener("abort",()=>{var n;(n=P(this,pf))==null||n.disconnect(),V(this,pf,null)},{once:!0}))},Be(Z1,"_type","stamp"),Be(Z1,"_editorType",_n.STAMP);let tV=Z1;var xv,K0,cu,_v,mf,gf,vf,Fa,Gh,Y0,X0,_o,At,Kh,$i,the,iV,oV,aV,DN;const Gl=class Gl{constructor({uiManager:t,pageIndex:n,div:r,accessibilityManager:s,annotationLayer:i,drawLayer:o,textLayer:a,viewport:c,l10n:d}){G(this,$i);G(this,xv);G(this,K0,!1);G(this,cu,null);G(this,_v,null);G(this,mf,null);G(this,gf,null);G(this,vf,null);G(this,Fa,new Map);G(this,Gh,!1);G(this,Y0,!1);G(this,X0,!1);G(this,_o,null);G(this,At);const h=[...P(Gl,Kh).values()];if(!Gl._initialized){Gl._initialized=!0;for(const u of h)u.initialize(d,t)}t.registerEditorTypes(h),V(this,At,t),this.pageIndex=n,this.div=r,V(this,xv,s),V(this,cu,i),this.viewport=c,V(this,_o,a),this.drawLayer=o,P(this,At).addLayer(this)}get isEmpty(){return P(this,Fa).size===0}get isInvisible(){return this.isEmpty&&P(this,At).getMode()===_n.NONE}updateToolbar(t){P(this,At).updateToolbar(t)}updateMode(t=P(this,At).getMode()){switch(K(this,$i,DN).call(this),t){case _n.NONE:this.disableTextSelection(),this.togglePointerEvents(!1),this.toggleAnnotationLayerPointerEvents(!0),this.disableClick();return;case _n.INK:this.addInkEditorIfNeeded(!1),this.disableTextSelection(),this.togglePointerEvents(!0),this.disableClick();break;case _n.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 P(Gl,Kh).values())n.toggle(`${r._type}Editing`,t===r._editorType);this.div.hidden=!1}hasTextLayer(t){var n;return t===((n=P(this,_o))==null?void 0:n.div)}addInkEditorIfNeeded(t){if(P(this,At).getMode()!==_n.INK)return;if(!t){for(const r of P(this,Fa).values())if(r.isEmpty()){r.setInBackground();return}}this.createAndAddNewEditor({offsetX:0,offsetY:0},!1).setInBackground()}setEditingState(t){P(this,At).setEditingState(t)}addCommands(t){P(this,At).addCommands(t)}togglePointerEvents(t=!1){this.div.classList.toggle("disabled",!t)}toggleAnnotationLayerPointerEvents(t=!1){var n;(n=P(this,cu))==null||n.div.classList.toggle("disabled",!t)}enable(){this.div.tabIndex=0,this.togglePointerEvents(!0);const t=new Set;for(const r of P(this,Fa).values())r.enableEditing(),r.show(!0),r.annotationElementId&&(P(this,At).removeChangedExistingAnnotation(r),t.add(r.annotationElementId));if(!P(this,cu))return;const n=P(this,cu).getEditableAnnotations();for(const r of n){if(r.hide(),P(this,At).isDeletedAnnotationElement(r.data.id)||t.has(r.data.id))continue;const s=this.deserialize(r);s&&(this.addOrRebuild(s),s.enableEditing())}}disable(){var s;V(this,X0,!0),this.div.tabIndex=-1,this.togglePointerEvents(!1);const t=new Map,n=new Map;for(const i of P(this,Fa).values())if(i.disableEditing(),!!i.annotationElementId){if(i.serialize()!==null){t.set(i.annotationElementId,i);continue}else n.set(i.annotationElementId,i);(s=this.getEditableAnnotation(i.annotationElementId))==null||s.show(),i.remove()}if(P(this,cu)){const i=P(this,cu).getEditableAnnotations();for(const o of i){const{id:a}=o.data;if(P(this,At).isDeletedAnnotationElement(a))continue;let c=n.get(a);if(c){c.resetAnnotationElement(o),c.show(!1),o.show();continue}c=t.get(a),c&&(P(this,At).addChangedExistingAnnotation(c),c.renderAnnotationElement(o),c.show(!1)),o.show()}}K(this,$i,DN).call(this),this.isEmpty&&(this.div.hidden=!0);const{classList:r}=this.div;for(const i of P(Gl,Kh).values())r.remove(`${i._type}Editing`);this.disableTextSelection(),this.toggleAnnotationLayerPointerEvents(!0),V(this,X0,!1)}getEditableAnnotation(t){var n;return((n=P(this,cu))==null?void 0:n.getEditableAnnotation(t))||null}setActiveEditor(t){P(this,At).getActive()!==t&&P(this,At).setActiveEditor(t)}enableTextSelection(){var t;this.div.tabIndex=-1,(t=P(this,_o))!=null&&t.div&&!P(this,gf)&&(V(this,gf,K(this,$i,the).bind(this)),P(this,_o).div.addEventListener("pointerdown",P(this,gf),{signal:P(this,At)._signal}),P(this,_o).div.classList.add("highlighting"))}disableTextSelection(){var t;this.div.tabIndex=0,(t=P(this,_o))!=null&&t.div&&P(this,gf)&&(P(this,_o).div.removeEventListener("pointerdown",P(this,gf)),V(this,gf,null),P(this,_o).div.classList.remove("highlighting"))}enableClick(){if(P(this,mf))return;const t=P(this,At)._signal;V(this,mf,this.pointerdown.bind(this)),V(this,_v,this.pointerup.bind(this)),this.div.addEventListener("pointerdown",P(this,mf),{signal:t}),this.div.addEventListener("pointerup",P(this,_v),{signal:t})}disableClick(){P(this,mf)&&(this.div.removeEventListener("pointerdown",P(this,mf)),this.div.removeEventListener("pointerup",P(this,_v)),V(this,mf,null),V(this,_v,null))}attach(t){P(this,Fa).set(t.id,t);const{annotationElementId:n}=t;n&&P(this,At).isDeletedAnnotationElement(n)&&P(this,At).removeDeletedAnnotationElement(t)}detach(t){var n;P(this,Fa).delete(t.id),(n=P(this,xv))==null||n.removePointerInTextLayer(t.contentDiv),!P(this,X0)&&t.annotationElementId&&P(this,At).addDeletedAnnotationElement(t)}remove(t){this.detach(t),P(this,At).removeEditor(t),t.div.remove(),t.isAttachedToDOM=!1,P(this,Y0)||this.addInkEditorIfNeeded(!1)}changeParent(t){var n;t.parent!==this&&(t.parent&&t.annotationElementId&&(P(this,At).addDeletedAnnotationElement(t.annotationElementId),tr.deleteAnnotationElement(t),t.annotationElementId=null),this.attach(t),(n=t.parent)==null||n.detach(t),t.setParent(this),t.div&&t.isAttachedToDOM&&(t.div.remove(),this.div.append(t.div)))}add(t){if(!(t.parent===this&&t.isAttachedToDOM)){if(this.changeParent(t),P(this,At).addEditor(t),this.attach(t),!t.isAttachedToDOM){const n=t.render();this.div.append(n),t.isAttachedToDOM=!0}t.fixAndSetPosition(),t.onceAdded(),P(this,At).addToAnnotationStorage(t),t._reportTelemetry(t.telemetryInitialData)}}moveEditorInDOM(t){var r;if(!t.isAttachedToDOM)return;const{activeElement:n}=document;t.div.contains(n)&&!P(this,vf)&&(t._focusEventsAllowed=!1,V(this,vf,setTimeout(()=>{V(this,vf,null),t.div.contains(document.activeElement)?t._focusEventsAllowed=!0:(t.div.addEventListener("focusin",()=>{t._focusEventsAllowed=!0},{once:!0,signal:P(this,At)._signal}),n.focus())},0))),t._structTreeParentId=(r=P(this,xv))==null?void 0:r.moveElementInDOM(this.div,t.div,t.contentDiv,!0)}addOrRebuild(t){t.needsToBeRebuilt()?(t.parent||(t.parent=this),t.rebuild(),t.show()):this.add(t)}addUndoableEditor(t){const n=()=>t._uiManager.rebuild(t),r=()=>{t.remove()};this.addCommands({cmd:n,undo:r,mustExec:!1})}getNextId(){return P(this,At).getId()}get _signal(){return P(this,At)._signal}canCreateNewEmptyEditor(){var t;return(t=P(this,$i,iV))==null?void 0:t.canCreateNewEmptyEditor()}pasteEditor(t,n){P(this,At).updateToolbar(t),P(this,At).updateMode(t);const{offsetX:r,offsetY:s}=K(this,$i,aV).call(this),i=this.getNextId(),o=K(this,$i,oV).call(this,{parent:this,id:i,x:r,y:s,uiManager:P(this,At),isCentered:!0,...n});o&&this.add(o)}deserialize(t){var n;return((n=P(Gl,Kh).get(t.annotationType??t.annotationEditorType))==null?void 0:n.deserialize(t,this,P(this,At)))||null}createAndAddNewEditor(t,n,r={}){const s=this.getNextId(),i=K(this,$i,oV).call(this,{parent:this,id:s,x:t.offsetX,y:t.offsetY,uiManager:P(this,At),isCentered:n,...r});return i&&this.add(i),i}addNewEditor(){this.createAndAddNewEditor(K(this,$i,aV).call(this),!0)}setSelected(t){P(this,At).setSelected(t)}toggleSelected(t){P(this,At).toggleSelected(t)}isSelected(t){return P(this,At).isSelected(t)}unselect(t){P(this,At).unselect(t)}pointerup(t){const{isMac:n}=Jo.platform;if(!(t.button!==0||t.ctrlKey&&n)&&t.target===this.div&&P(this,Gh)){if(V(this,Gh,!1),!P(this,K0)){V(this,K0,!0);return}if(P(this,At).getMode()===_n.STAMP){P(this,At).unselectAll();return}this.createAndAddNewEditor(t,!1)}}pointerdown(t){if(P(this,At).getMode()===_n.HIGHLIGHT&&this.enableTextSelection(),P(this,Gh)){V(this,Gh,!1);return}const{isMac:n}=Jo.platform;if(t.button!==0||t.ctrlKey&&n||t.target!==this.div)return;V(this,Gh,!0);const r=P(this,At).getActive();V(this,K0,!r||r.isEmpty())}findNewParent(t,n,r){const s=P(this,At).findParent(n,r);return s===null||s===this?!1:(s.changeParent(t),!0)}destroy(){var t,n;((t=P(this,At).getActive())==null?void 0:t.parent)===this&&(P(this,At).commitOrRemove(),P(this,At).setActiveEditor(null)),P(this,vf)&&(clearTimeout(P(this,vf)),V(this,vf,null));for(const r of P(this,Fa).values())(n=P(this,xv))==null||n.removePointerInTextLayer(r.contentDiv),r.setParent(null),r.isAttachedToDOM=!1,r.div.remove();this.div=null,P(this,Fa).clear(),P(this,At).removeLayer(this)}render({viewport:t}){this.viewport=t,Xv(this.div,t);for(const n of P(this,At).getEditors(this.pageIndex))this.add(n),n.rebuild();this.updateMode()}update({viewport:t}){P(this,At).commitOrRemove(),K(this,$i,DN).call(this);const n=this.viewport.rotation,r=t.rotation;if(this.viewport=t,Xv(this.div,{rotation:r}),n!==r)for(const s of P(this,Fa).values())s.rotate(r);this.addInkEditorIfNeeded(!1)}get pageDimensions(){const{pageWidth:t,pageHeight:n}=this.viewport.rawDims;return[t,n]}get scale(){return P(this,At).viewParameters.realScale}};xv=new WeakMap,K0=new WeakMap,cu=new WeakMap,_v=new WeakMap,mf=new WeakMap,gf=new WeakMap,vf=new WeakMap,Fa=new WeakMap,Gh=new WeakMap,Y0=new WeakMap,X0=new WeakMap,_o=new WeakMap,At=new WeakMap,Kh=new WeakMap,$i=new WeakSet,the=function(t){if(P(this,At).unselectAll(),t.target===P(this,_o).div){const{isMac:n}=Jo.platform;if(t.button!==0||t.ctrlKey&&n)return;P(this,At).showAllEditors("highlight",!0,!0),P(this,_o).div.classList.add("free"),fk.startHighlighting(this,P(this,At).direction==="ltr",t),P(this,_o).div.addEventListener("pointerup",()=>{P(this,_o).div.classList.remove("free")},{once:!0,signal:P(this,At)._signal}),t.preventDefault()}},iV=function(){return P(Gl,Kh).get(P(this,At).getMode())},oV=function(t){const n=P(this,$i,iV);return n?new n.prototype.constructor(t):null},aV=function(){const{x:t,y:n,width:r,height:s}=this.div.getBoundingClientRect(),i=Math.max(0,t),o=Math.max(0,n),a=Math.min(window.innerWidth,t+r),c=Math.min(window.innerHeight,n+s),d=(i+a)/2-t,h=(o+c)/2-n,[u,f]=this.viewport.rotation%180===0?[d,h]:[h,d];return{offsetX:u,offsetY:f}},DN=function(){V(this,Y0,!0);for(const t of P(this,Fa).values())t.isEmpty()&&t.remove();V(this,Y0,!1)},Be(Gl,"_initialized",!1),G(Gl,Kh,new Map([j5,K5,tV,fk].map(t=>[t._editorType,t])));let sV=Gl;var uu,CA,Ks,Yh,EA,cV,ry,uV,nhe;const Ci=class Ci{constructor({pageIndex:t}){G(this,ry);G(this,uu,null);G(this,CA,0);G(this,Ks,new Map);G(this,Yh,new Map);this.pageIndex=t}setParent(t){if(!P(this,uu)){V(this,uu,t);return}if(P(this,uu)!==t){if(P(this,Ks).size>0)for(const n of P(this,Ks).values())n.remove(),t.append(n);V(this,uu,t)}}static get _svgFactory(){return An(this,"_svgFactory",new NW)}highlight(t,n,r,s=!1){const i=Ui(this,CA)._++,o=K(this,ry,uV).call(this,t.box);o.classList.add("highlight"),t.free&&o.classList.add("free");const a=Ci._svgFactory.createElement("defs");o.append(a);const c=Ci._svgFactory.createElement("path");a.append(c);const d=`path_p${this.pageIndex}_${i}`;c.setAttribute("id",d),c.setAttribute("d",t.toSVGPath()),s&&P(this,Yh).set(i,c);const h=K(this,ry,nhe).call(this,a,d),u=Ci._svgFactory.createElement("use");return o.append(u),o.setAttribute("fill",n),o.setAttribute("fill-opacity",r),u.setAttribute("href",`#${d}`),P(this,Ks).set(i,o),{id:i,clipPathId:`url(#${h})`}}highlightOutline(t){const n=Ui(this,CA)._++,r=K(this,ry,uV).call(this,t.box);r.classList.add("highlightOutline");const s=Ci._svgFactory.createElement("defs");r.append(s);const i=Ci._svgFactory.createElement("path");s.append(i);const o=`path_p${this.pageIndex}_${n}`;i.setAttribute("id",o),i.setAttribute("d",t.toSVGPath()),i.setAttribute("vector-effect","non-scaling-stroke");let a;if(t.free){r.classList.add("free");const h=Ci._svgFactory.createElement("mask");s.append(h),a=`mask_p${this.pageIndex}_${n}`,h.setAttribute("id",a),h.setAttribute("maskUnits","objectBoundingBox");const u=Ci._svgFactory.createElement("rect");h.append(u),u.setAttribute("width","1"),u.setAttribute("height","1"),u.setAttribute("fill","white");const f=Ci._svgFactory.createElement("use");h.append(f),f.setAttribute("href",`#${o}`),f.setAttribute("stroke","none"),f.setAttribute("fill","black"),f.setAttribute("fill-rule","nonzero"),f.classList.add("mask")}const c=Ci._svgFactory.createElement("use");r.append(c),c.setAttribute("href",`#${o}`),a&&c.setAttribute("mask",`url(#${a})`);const d=c.cloneNode();return r.append(d),c.classList.add("mainOutline"),d.classList.add("secondaryOutline"),P(this,Ks).set(n,r),n}finalizeLine(t,n){const r=P(this,Yh).get(t);P(this,Yh).delete(t),this.updateBox(t,n.box),r.setAttribute("d",n.toSVGPath())}updateLine(t,n){P(this,Ks).get(t).firstChild.firstChild.setAttribute("d",n.toSVGPath())}removeFreeHighlight(t){this.remove(t),P(this,Yh).delete(t)}updatePath(t,n){P(this,Yh).get(t).setAttribute("d",n.toSVGPath())}updateBox(t,n){var r;K(r=Ci,EA,cV).call(r,P(this,Ks).get(t),n)}show(t,n){P(this,Ks).get(t).classList.toggle("hidden",!n)}rotate(t,n){P(this,Ks).get(t).setAttribute("data-main-rotation",n)}changeColor(t,n){P(this,Ks).get(t).setAttribute("fill",n)}changeOpacity(t,n){P(this,Ks).get(t).setAttribute("fill-opacity",n)}addClass(t,n){P(this,Ks).get(t).classList.add(n)}removeClass(t,n){P(this,Ks).get(t).classList.remove(n)}remove(t){P(this,uu)!==null&&(P(this,Ks).get(t).remove(),P(this,Ks).delete(t))}destroy(){V(this,uu,null);for(const t of P(this,Ks).values())t.remove();P(this,Ks).clear()}};uu=new WeakMap,CA=new WeakMap,Ks=new WeakMap,Yh=new WeakMap,EA=new WeakSet,cV=function(t,{x:n=0,y:r=0,width:s=1,height:i=1}={}){const{style:o}=t;o.top=`${100*r}%`,o.left=`${100*n}%`,o.width=`${100*s}%`,o.height=`${100*i}%`},ry=new WeakSet,uV=function(t){var r;const n=Ci._svgFactory.create(1,1,!0);return P(this,uu).append(n),n.setAttribute("aria-hidden",!0),K(r=Ci,EA,cV).call(r,n,t),n},nhe=function(t,n){const r=Ci._svgFactory.createElement("clipPath");t.append(r);const s=`clip_${n}`;r.setAttribute("id",s),r.setAttribute("clipPathUnits","objectBoundingBox");const i=Ci._svgFactory.createElement("use");return r.append(i),i.setAttribute("href",`#${n}`),i.classList.add("clip"),s},G(Ci,EA);let lV=Ci;var J5e=$t.AbortException,eVe=$t.AnnotationEditorLayer,tVe=$t.AnnotationEditorParamsType,nVe=$t.AnnotationEditorType,rVe=$t.AnnotationEditorUIManager,rhe=$t.AnnotationLayer,she=$t.AnnotationMode,sVe=$t.CMapCompressionType,iVe=$t.ColorPicker,oVe=$t.DOMSVGFactory,aVe=$t.DrawLayer,lVe=$t.FeatureTest,jW=$t.GlobalWorkerOptions,cVe=$t.ImageKind,uVe=$t.InvalidPDFException,dVe=$t.MissingPDFException,fVe=$t.OPS,hVe=$t.Outliner,pVe=$t.PDFDataRangeTransport,mVe=$t.PDFDateString,gVe=$t.PDFWorker,vVe=$t.PasswordResponses,yVe=$t.PermissionFlag,bVe=$t.PixelsPerInch,xVe=$t.RenderingCancelledException,ihe=$t.TextLayer,_Ve=$t.UnexpectedResponseException,wVe=$t.Util,SVe=$t.VerbosityLevel,CVe=$t.XfaLayer,EVe=$t.build,AVe=$t.createValidAbsoluteUrl,RVe=$t.fetchData,ohe=$t.getDocument,PVe=$t.getFilenameFromUrl,NVe=$t.getPdfFilenameFromUrl,TVe=$t.getXfaPageViewport,kVe=$t.isDataScheme,DVe=$t.isPdfFile,OVe=$t.noContextMenu,MVe=$t.normalizeUnicode,IVe=$t.renderTextLayer,LVe=$t.setLayerDimensions,jVe=$t.shadow,$Ve=$t.updateTextLayer,ahe=$t.version;const FVe=Object.freeze(Object.defineProperty({__proto__:null,AbortException:J5e,AnnotationEditorLayer:eVe,AnnotationEditorParamsType:tVe,AnnotationEditorType:nVe,AnnotationEditorUIManager:rVe,AnnotationLayer:rhe,AnnotationMode:she,CMapCompressionType:sVe,ColorPicker:iVe,DOMSVGFactory:oVe,DrawLayer:aVe,FeatureTest:lVe,GlobalWorkerOptions:jW,ImageKind:cVe,InvalidPDFException:uVe,MissingPDFException:dVe,OPS:fVe,Outliner:hVe,PDFDataRangeTransport:pVe,PDFDateString:mVe,PDFWorker:gVe,PasswordResponses:vVe,PermissionFlag:yVe,PixelsPerInch:bVe,RenderingCancelledException:xVe,TextLayer:ihe,UnexpectedResponseException:_Ve,Util:wVe,VerbosityLevel:SVe,XfaLayer:CVe,build:EVe,createValidAbsoluteUrl:AVe,fetchData:RVe,getDocument:ohe,getFilenameFromUrl:PVe,getPdfFilenameFromUrl:NVe,getXfaPageViewport:TVe,isDataScheme:kVe,isPdfFile:DVe,noContextMenu:OVe,normalizeUnicode:MVe,renderTextLayer:IVe,setLayerDimensions:LVe,shadow:jVe,updateTextLayer:$Ve,version:ahe},Symbol.toStringTag,{value:"Module"}));var ii=function(e,t,n){if(n||arguments.length===2)for(var r=0,s=t.length,i;r<s;r++)(i||!(r in t))&&(i||(i=Array.prototype.slice.call(t,0,r)),i[r]=t[r]);return e.concat(i||Array.prototype.slice.call(t))},zVe=["onCopy","onCut","onPaste"],BVe=["onCompositionEnd","onCompositionStart","onCompositionUpdate"],UVe=["onFocus","onBlur"],VVe=["onInput","onInvalid","onReset","onSubmit"],HVe=["onLoad","onError"],WVe=["onKeyDown","onKeyPress","onKeyUp"],qVe=["onAbort","onCanPlay","onCanPlayThrough","onDurationChange","onEmptied","onEncrypted","onEnded","onError","onLoadedData","onLoadedMetadata","onLoadStart","onPause","onPlay","onPlaying","onProgress","onRateChange","onSeeked","onSeeking","onStalled","onSuspend","onTimeUpdate","onVolumeChange","onWaiting"],GVe=["onClick","onContextMenu","onDoubleClick","onMouseDown","onMouseEnter","onMouseLeave","onMouseMove","onMouseOut","onMouseOver","onMouseUp"],KVe=["onDrag","onDragEnd","onDragEnter","onDragExit","onDragLeave","onDragOver","onDragStart","onDrop"],YVe=["onSelect"],XVe=["onTouchCancel","onTouchEnd","onTouchMove","onTouchStart"],QVe=["onPointerDown","onPointerMove","onPointerUp","onPointerCancel","onGotPointerCapture","onLostPointerCapture","onPointerEnter","onPointerLeave","onPointerOver","onPointerOut"],ZVe=["onScroll"],JVe=["onWheel"],eHe=["onAnimationStart","onAnimationEnd","onAnimationIteration"],tHe=["onTransitionEnd"],nHe=["onToggle"],rHe=["onChange"],sHe=ii(ii(ii(ii(ii(ii(ii(ii(ii(ii(ii(ii(ii(ii(ii(ii(ii(ii([],zVe,!0),BVe,!0),UVe,!0),VVe,!0),HVe,!0),WVe,!0),qVe,!0),GVe,!0),KVe,!0),YVe,!0),XVe,!0),QVe,!0),ZVe,!0),JVe,!0),eHe,!0),tHe,!0),rHe,!0),nHe,!0);function lhe(e,t){var n={};return sHe.forEach(function(r){var s=e[r];s&&(t?n[r]=function(i){return s(i,t(r))}:n[r]=s)}),n}function wR(e){var t=!1,n=new Promise(function(r,s){e.then(function(i){return!t&&r(i)}).catch(function(i){return!t&&s(i)})});return{promise:n,cancel:function(){t=!0}}}var iHe=function(){},oHe=iHe;const to=Al(oHe);var rY=Object.prototype.hasOwnProperty;function sY(e,t,n){for(n of e.keys())if(Pv(n,t))return n}function Pv(e,t){var n,r,s;if(e===t)return!0;if(e&&t&&(n=e.constructor)===t.constructor){if(n===Date)return e.getTime()===t.getTime();if(n===RegExp)return e.toString()===t.toString();if(n===Array){if((r=e.length)===t.length)for(;r--&&Pv(e[r],t[r]););return r===-1}if(n===Set){if(e.size!==t.size)return!1;for(r of e)if(s=r,s&&typeof s=="object"&&(s=sY(t,s),!s)||!t.has(s))return!1;return!0}if(n===Map){if(e.size!==t.size)return!1;for(r of e)if(s=r[0],s&&typeof s=="object"&&(s=sY(t,s),!s)||!Pv(r[1],t.get(s)))return!1;return!0}if(n===ArrayBuffer)e=new Uint8Array(e),t=new Uint8Array(t);else if(n===DataView){if((r=e.byteLength)===t.byteLength)for(;r--&&e.getInt8(r)===t.getInt8(r););return r===-1}if(ArrayBuffer.isView(e)){if((r=e.byteLength)===t.byteLength)for(;r--&&e[r]===t[r];);return r===-1}if(!n||typeof e=="object"){r=0;for(n in e)if(rY.call(e,n)&&++r&&!rY.call(t,n)||!(n in t)||!Pv(e[n],t[n]))return!1;return Object.keys(t).length===r}}return e!==e&&t!==t}const che=C.createContext(null);function Bb({children:e,type:t}){return _.jsx("div",{className:`react-pdf__message react-pdf__message--${t}`,children:e})}const aHe="noopener noreferrer nofollow";class lHe{constructor(){this.externalLinkEnabled=!0,this.externalLinkRel=void 0,this.externalLinkTarget=void 0,this.isInPresentationMode=!1,this.pdfDocument=void 0,this.pdfViewer=void 0}setDocument(t){this.pdfDocument=t}setViewer(t){this.pdfViewer=t}setExternalLinkRel(t){this.externalLinkRel=t}setExternalLinkTarget(t){this.externalLinkTarget=t}setHistory(){}get pagesCount(){return this.pdfDocument?this.pdfDocument.numPages:0}get page(){return yr(this.pdfViewer),this.pdfViewer.currentPageNumber||0}set page(t){yr(this.pdfViewer),this.pdfViewer.currentPageNumber=t}get rotation(){return 0}set rotation(t){}goToDestination(t){return new Promise(n=>{yr(this.pdfDocument),yr(t),typeof t=="string"?this.pdfDocument.getDestination(t).then(n):Array.isArray(t)?n(t):t.then(n)}).then(n=>{yr(Array.isArray(n));const r=n[0];new Promise(s=>{yr(this.pdfDocument),r instanceof Object?this.pdfDocument.getPageIndex(r).then(i=>{s(i)}).catch(()=>{yr(!1)}):typeof r=="number"?s(r):yr(!1)}).then(s=>{const i=s+1;yr(this.pdfViewer),yr(i>=1&&i<=this.pagesCount),this.pdfViewer.scrollPageIntoView({dest:n,pageIndex:s,pageNumber:i})})})}navigateTo(t){this.goToDestination(t)}goToPage(t){const n=t-1;yr(this.pdfViewer),yr(t>=1&&t<=this.pagesCount),this.pdfViewer.scrollPageIntoView({pageIndex:n,pageNumber:t})}addLinkAttributes(t,n,r){t.href=n,t.rel=this.externalLinkRel||aHe,t.target=r?"_blank":this.externalLinkTarget||""}getDestinationHash(){return"#"}getAnchorUrl(){return"#"}setHash(){}executeNamedAction(){}cachePageRef(){}isPageVisible(){return!0}isPageCached(){return!0}executeSetOCGState(){}}const iY={NEED_PASSWORD:1,INCORRECT_PASSWORD:2},GO=typeof document<"u",uhe=GO&&window.location.protocol==="file:";function cHe(e){return typeof e<"u"}function Zm(e){return cHe(e)&&e!==null}function uHe(e){return typeof e=="string"}function dHe(e){return e instanceof ArrayBuffer}function fHe(e){return yr(GO),e instanceof Blob}function dV(e){return uHe(e)&&/^data:/.test(e)}function oY(e){yr(dV(e));const[t="",n=""]=e.split(",");return t.split(";").indexOf("base64")!==-1?atob(n):unescape(n)}function hHe(){return GO&&window.devicePixelRatio||1}const dhe="On Chromium based browsers, you can use --allow-file-access-from-files flag for debugging purposes.";function aY(){to(!uhe,`Loading PDF as base64 strings/URLs may not work on protocols other than HTTP/HTTPS. ${dhe}`)}function pHe(){to(!uhe,`Loading PDF.js worker may not work on protocols other than HTTP/HTTPS. ${dhe}`)}function Jv(e){e!=null&&e.cancel&&e.cancel()}function fV(e,t){return Object.defineProperty(e,"width",{get(){return this.view[2]*t},configurable:!0}),Object.defineProperty(e,"height",{get(){return this.view[3]*t},configurable:!0}),Object.defineProperty(e,"originalWidth",{get(){return this.view[2]},configurable:!0}),Object.defineProperty(e,"originalHeight",{get(){return this.view[3]},configurable:!0}),e}function mHe(e){return e.name==="RenderingCancelledException"}function gHe(e){return new Promise((t,n)=>{const r=new FileReader;r.onload=()=>{if(!r.result)return n(new Error("Error while reading a file."));t(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(e)})}function vHe(e,t){switch(t.type){case"RESOLVE":return{value:t.value,error:void 0};case"REJECT":return{value:!1,error:t.error};case"RESET":return{value:void 0,error:void 0};default:return e}}function yx(){return C.useReducer(vHe,{value:void 0,error:void 0})}var yHe=function(e,t,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(h){try{d(r.next(h))}catch(u){o(u)}}function c(h){try{d(r.throw(h))}catch(u){o(u)}}function d(h){h.done?i(h.value):s(h.value).then(a,c)}d((r=r.apply(e,t||[])).next())})},lY=function(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&typeof Object.getOwnPropertySymbols=="function")for(var s=0,r=Object.getOwnPropertySymbols(e);s<r.length;s++)t.indexOf(r[s])<0&&Object.prototype.propertyIsEnumerable.call(e,r[s])&&(n[r[s]]=e[r[s]]);return n};const{PDFDataRangeTransport:bHe}=FVe,xHe=(e,t)=>{switch(t){case iY.NEED_PASSWORD:{const n=prompt("Enter the password to open this PDF file.");e(n);break}case iY.INCORRECT_PASSWORD:{const n=prompt("Invalid password. Please try again.");e(n);break}}};function cY(e){return typeof e=="object"&&e!==null&&("data"in e||"range"in e||"url"in e)}const _He=C.forwardRef(function(t,n){var{children:r,className:s,error:i="Failed to load PDF file.",externalLinkRel:o,externalLinkTarget:a,file:c,inputRef:d,imageResourcesPath:h,loading:u="Loading PDF…",noData:f="No PDF file specified.",onItemClick:g,onLoadError:v,onLoadProgress:m,onLoadSuccess:x,onPassword:y=xHe,onSourceError:b,onSourceSuccess:w,options:E,renderMode:R,rotate:T}=t,N=lY(t,["children","className","error","externalLinkRel","externalLinkTarget","file","inputRef","imageResourcesPath","loading","noData","onItemClick","onLoadError","onLoadProgress","onLoadSuccess","onPassword","onSourceError","onSourceSuccess","options","renderMode","rotate"]);const[A,D]=yx(),{value:O,error:I}=A,[$,F]=yx(),{value:B,error:W}=$,Z=C.useRef(new lHe),Y=C.useRef([]),H=C.useRef(void 0),se=C.useRef(void 0);c&&c!==H.current&&cY(c)&&(to(!Pv(c,H.current),`File prop passed to <Document /> changed, but it's equal to previous one. This might result in unnecessary reloads. Consider memoizing the value passed to "file" prop.`),H.current=c),E&&E!==se.current&&(to(!Pv(E,se.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.`),se.current=E);const he=C.useRef({scrollPageIntoView:Te=>{const{dest:Ue,pageNumber:wt,pageIndex:ut=wt-1}=Te;if(g){g({dest:Ue,pageIndex:ut,pageNumber:wt});return}const St=Y.current[ut];if(St){St.scrollIntoView();return}to(!1,`An internal link leading to page ${wt} 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>.`)}});C.useImperativeHandle(n,()=>({linkService:Z,pages:Y,viewer:he}),[]);function re(){w&&w()}function J(){I&&(to(!1,I.toString()),b&&b(I))}function te(){D({type:"RESET"})}C.useEffect(te,[c,D]);const ae=C.useCallback(()=>yHe(this,void 0,void 0,function*(){if(!c)return null;if(typeof c=="string")return dV(c)?{data:oY(c)}:(aY(),{url:c});if(c instanceof bHe)return{range:c};if(dHe(c))return{data:c};if(GO&&fHe(c))return{data:yield gHe(c)};if(yr(typeof c=="object"),yr(cY(c)),"url"in c&&typeof c.url=="string"){if(dV(c.url)){const{url:Te}=c,Ue=lY(c,["url"]),wt=oY(Te);return Object.assign({data:wt},Ue)}aY()}return c}),[c]);C.useEffect(()=>{const Te=wR(ae());return Te.promise.then(Ue=>{D({type:"RESOLVE",value:Ue})}).catch(Ue=>{D({type:"REJECT",error:Ue})}),()=>{Jv(Te)}},[ae,D]),C.useEffect(()=>{if(!(typeof O>"u")){if(O===!1){J();return}re()}},[O]);function be(){B&&(x&&x(B),Y.current=new Array(B.numPages),Z.current.setDocument(B))}function xe(){W&&(to(!1,W.toString()),v&&v(W))}C.useEffect(function(){F({type:"RESET"})},[F,O]),C.useEffect(function(){if(!O)return;const Ue=Object.assign(Object.assign({},O),E),wt=ohe(Ue);m&&(wt.onProgress=m),y&&(wt.onPassword=y);const ut=wt;return ut.promise.then(St=>{F({type:"RESOLVE",value:St})}).catch(St=>{ut.destroyed||F({type:"REJECT",error:St})}),()=>{ut.destroy()}},[E,F,O]),C.useEffect(()=>{if(!(typeof B>"u")){if(B===!1){xe();return}be()}},[B]),C.useEffect(function(){Z.current.setViewer(he.current),Z.current.setExternalLinkRel(o),Z.current.setExternalLinkTarget(a)},[o,a]);const ve=C.useCallback((Te,Ue)=>{Y.current[Te]=Ue},[]),Pe=C.useCallback(Te=>{delete Y.current[Te]},[]),Oe=C.useMemo(()=>({imageResourcesPath:h,linkService:Z.current,onItemClick:g,pdf:B,registerPage:ve,renderMode:R,rotate:T,unregisterPage:Pe}),[h,g,B,ve,R,T,Pe]),ke=C.useMemo(()=>lhe(N,()=>B),[N,B]);function ze(){return _.jsx(che.Provider,{value:Oe,children:r})}function $e(){return c?B==null?_.jsx(Bb,{type:"loading",children:typeof u=="function"?u():u}):B===!1?_.jsx(Bb,{type:"error",children:typeof i=="function"?i():i}):ze():_.jsx(Bb,{type:"no-data",children:typeof f=="function"?f():f})}return _.jsx("div",Object.assign({className:oy("react-pdf__Document",s),ref:d,style:{"--scale-factor":"1"}},ke,{children:$e()}))});function fhe(){return C.useContext(che)}function hhe(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];var n=e.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 phe=C.createContext(null),mhe={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},wHe=/^H(\d+)$/;function SHe(e){return e in mhe}function KO(e){return"children"in e}function ghe(e){return KO(e)?e.children.length===1&&0 in e.children&&"id"in e.children[0]:!1}function CHe(e){const t={};if(KO(e)){const{role:n}=e,r=n.match(wHe);if(r)t.role="heading",t["aria-level"]=Number(r[1]);else if(SHe(n)){const s=mhe[n];s&&(t.role=s)}}return t}function vhe(e){const t={};if(KO(e)){if(e.alt!==void 0&&(t["aria-label"]=e.alt),e.lang!==void 0&&(t.lang=e.lang),ghe(e)){const[n]=e.children;if(n){const r=vhe(n);return Object.assign(Object.assign({},t),r)}}}else"id"in e&&(t["aria-owns"]=e.id);return t}function EHe(e){return e?Object.assign(Object.assign({},CHe(e)),vhe(e)):null}function yhe({className:e,node:t}){const n=C.useMemo(()=>EHe(t),[t]),r=C.useMemo(()=>!KO(t)||ghe(t)?null:t.children.map((s,i)=>_.jsx(yhe,{node:s},i)),[t]);return _.jsx("span",Object.assign({className:e},n,{children:r}))}function YO(){return C.useContext(phe)}function AHe(){const e=YO();yr(e);const{onGetStructTreeError:t,onGetStructTreeSuccess:n}=e,[r,s]=yx(),{value:i,error:o}=r,{customTextRenderer:a,page:c}=e;function d(){i&&n&&n(i)}function h(){o&&(to(!1,o.toString()),t&&t(o))}return C.useEffect(function(){s({type:"RESET"})},[s,c]),C.useEffect(function(){if(a||!c)return;const f=wR(c.getStructTree()),g=f;return f.promise.then(v=>{s({type:"RESOLVE",value:v})}).catch(v=>{s({type:"REJECT",error:v})}),()=>Jv(g)},[a,c,s]),C.useEffect(()=>{if(i!==void 0){if(i===!1){h();return}d()}},[i]),i?_.jsx(yhe,{className:"react-pdf__Page__structTree structTree",node:i}):null}const uY=she;function RHe(e){const t=YO();yr(t);const n=Object.assign(Object.assign({},t),e),{_className:r,canvasBackground:s,devicePixelRatio:i=hHe(),onRenderError:o,onRenderSuccess:a,page:c,renderForms:d,renderTextLayer:h,rotate:u,scale:f}=n,{canvasRef:g}=e;yr(c);const v=C.useRef(null);function m(){c&&a&&a(fV(c,f))}function x(E){mHe(E)||(to(!1,E.toString()),o&&o(E))}const y=C.useMemo(()=>c.getViewport({scale:f*i,rotation:u}),[i,c,u,f]),b=C.useMemo(()=>c.getViewport({scale:f,rotation:u}),[c,u,f]);C.useEffect(function(){if(!c)return;c.cleanup();const{current:R}=v;if(!R)return;R.width=y.width,R.height=y.height,R.style.width=`${Math.floor(b.width)}px`,R.style.height=`${Math.floor(b.height)}px`,R.style.visibility="hidden";const T={annotationMode:d?uY.ENABLE_FORMS:uY.ENABLE,canvasContext:R.getContext("2d",{alpha:!1}),viewport:y};s&&(T.background=s);const N=c.render(T),A=N;return N.promise.then(()=>{R.style.visibility="",m()}).catch(x),()=>Jv(A)},[s,c,d,y,b]);const w=C.useCallback(()=>{const{current:E}=v;E&&(E.width=0,E.height=0)},[]);return C.useEffect(()=>w,[w]),_.jsx("canvas",{className:`${r}__canvas`,dir:"ltr",ref:hhe(g,v),style:{display:"block",userSelect:"none"},children:h?_.jsx(AHe,{}):null})}function PHe(e){return"str"in e}function NHe(){const e=YO();yr(e);const{customTextRenderer:t,onGetTextError:n,onGetTextSuccess:r,onRenderTextLayerError:s,onRenderTextLayerSuccess:i,page:o,pageIndex:a,pageNumber:c,rotate:d,scale:h}=e;yr(o);const[u,f]=yx(),{value:g,error:v}=u,m=C.useRef(null),x=C.useRef(void 0);to(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 y(){g&&r&&r(g)}function b(){v&&(to(!1,v.toString()),n&&n(v))}C.useEffect(function(){f({type:"RESET"})},[o,f]),C.useEffect(function(){if(!o)return;const D=wR(o.getTextContent()),O=D;return D.promise.then(I=>{f({type:"RESOLVE",value:I})}).catch(I=>{f({type:"REJECT",error:I})}),()=>Jv(O)},[o,f]),C.useEffect(()=>{if(g!==void 0){if(g===!1){b();return}y()}},[g]);const w=C.useCallback(()=>{i&&i()},[i]),E=C.useCallback(A=>{to(!1,A.toString()),s&&s(A)},[s]);function R(){const A=x.current;A&&A.classList.add("active")}function T(){const A=x.current;A&&A.classList.remove("active")}const N=C.useMemo(()=>o.getViewport({scale:h,rotation:d}),[o,d,h]);return C.useLayoutEffect(function(){if(!o||!g)return;const{current:D}=m;if(!D)return;D.innerHTML="";const O=o.streamTextContent({includeMarkedContent:!0}),I={container:D,textContentSource:O,viewport:N},$=new ihe(I),F=$;return $.render().then(()=>{const B=document.createElement("div");B.className="endOfContent",D.append(B),x.current=B;const W=D.querySelectorAll('[role="presentation"]');if(t){let Z=0;g.items.forEach((Y,H)=>{if(!PHe(Y))return;const se=W[Z];if(!se)return;const he=t(Object.assign({pageIndex:a,pageNumber:c,itemIndex:H},Y));se.innerHTML=he,Z+=Y.str&&Y.hasEOL?2:1})}w()}).catch(E),()=>Jv(F)},[t,E,w,o,a,c,g,N]),_.jsx("div",{className:oy("react-pdf__Page__textContent","textLayer"),onMouseUp:T,onMouseDown:R,ref:m})}function THe(){const e=fhe(),t=YO();yr(t);const n=Object.assign(Object.assign({},e),t),{imageResourcesPath:r,linkService:s,onGetAnnotationsError:i,onGetAnnotationsSuccess:o,onRenderAnnotationLayerError:a,onRenderAnnotationLayerSuccess:c,page:d,pdf:h,renderForms:u,rotate:f,scale:g=1}=n;yr(h),yr(d),yr(s);const[v,m]=yx(),{value:x,error:y}=v,b=C.useRef(null);to(Number.parseInt(window.getComputedStyle(document.body).getPropertyValue("--react-pdf-annotation-layer"),10)===1,"AnnotationLayer styles not found. Read more: https://github.com/wojtekmaj/react-pdf#support-for-annotations");function w(){x&&o&&o(x)}function E(){y&&(to(!1,y.toString()),i&&i(y))}C.useEffect(function(){m({type:"RESET"})},[m,d]),C.useEffect(function(){if(!d)return;const D=wR(d.getAnnotations()),O=D;return D.promise.then(I=>{m({type:"RESOLVE",value:I})}).catch(I=>{m({type:"REJECT",error:I})}),()=>{Jv(O)}},[m,d]),C.useEffect(()=>{if(x!==void 0){if(x===!1){E();return}w()}},[x]);function R(){c&&c()}function T(A){to(!1,`${A}`),a&&a(A)}const N=C.useMemo(()=>d.getViewport({scale:g,rotation:f}),[d,f,g]);return C.useEffect(function(){if(!h||!d||!s||!x)return;const{current:D}=b;if(!D)return;const O=N.clone({dontFlip:!0}),I={accessibilityManager:null,annotationCanvasMap:null,annotationEditorUIManager:null,div:D,l10n:null,page:d,viewport:O},$={annotations:x,annotationStorage:h.annotationStorage,div:D,imageResourcesPath:r,linkService:s,page:d,renderForms:u,viewport:O};D.innerHTML="";try{new rhe(I).render($),R()}catch(F){T(F)}return()=>{}},[x,r,s,d,h,u,N]),_.jsx("div",{className:oy("react-pdf__Page__annotations","annotationLayer"),ref:b})}var kHe=function(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&typeof Object.getOwnPropertySymbols=="function")for(var s=0,r=Object.getOwnPropertySymbols(e);s<r.length;s++)t.indexOf(r[s])<0&&Object.prototype.propertyIsEnumerable.call(e,r[s])&&(n[r[s]]=e[r[s]]);return n};const dY=1;function fY(e){const t=fhe(),n=Object.assign(Object.assign({},t),e),{_className:r="react-pdf__Page",_enableRegisterUnregisterPage:s=!0,canvasBackground:i,canvasRef:o,children:a,className:c,customRenderer:d,customTextRenderer:h,devicePixelRatio:u,error:f="Failed to load the page.",height:g,inputRef:v,loading:m="Loading page…",noData:x="No page specified.",onGetAnnotationsError:y,onGetAnnotationsSuccess:b,onGetStructTreeError:w,onGetStructTreeSuccess:E,onGetTextError:R,onGetTextSuccess:T,onLoadError:N,onLoadSuccess:A,onRenderAnnotationLayerError:D,onRenderAnnotationLayerSuccess:O,onRenderError:I,onRenderSuccess:$,onRenderTextLayerError:F,onRenderTextLayerSuccess:B,pageIndex:W,pageNumber:Z,pdf:Y,registerPage:H,renderAnnotationLayer:se=!0,renderForms:he=!1,renderMode:re="canvas",renderTextLayer:J=!0,rotate:te,scale:ae=dY,unregisterPage:be,width:xe}=n,ve=kHe(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"]),[Pe,Oe]=yx(),{value:ke,error:ze}=Pe,$e=C.useRef(null);yr(Y);const Te=Zm(Z)?Z-1:W??null,Ue=Z??(Zm(W)?W+1:null),wt=te??(ke?ke.rotate:null),ut=C.useMemo(()=>{if(!ke)return null;let pe=1;const Se=ae??dY;if(xe||g){const Fe=ke.getViewport({scale:1,rotation:wt});xe?pe=xe/Fe.width:g&&(pe=g/Fe.height)}return Se*pe},[g,ke,wt,ae,xe]);C.useEffect(function(){return()=>{Zm(Te)&&s&&be&&be(Te)}},[s,Y,Te,be]);function St(){if(A){if(!ke||!ut)return;A(fV(ke,ut))}if(s&&H){if(!Zm(Te)||!$e.current)return;H(Te,$e.current)}}function Nn(){ze&&(to(!1,ze.toString()),N&&N(ze))}C.useEffect(function(){Oe({type:"RESET"})},[Oe,Y,Te]),C.useEffect(function(){if(!Y||!Ue)return;const Se=wR(Y.getPage(Ue)),Fe=Se;return Se.promise.then(ft=>{Oe({type:"RESOLVE",value:ft})}).catch(ft=>{Oe({type:"REJECT",error:ft})}),()=>Jv(Fe)},[Oe,Y,Ue]),C.useEffect(()=>{if(ke!==void 0){if(ke===!1){Nn();return}St()}},[ke,ut]);const cn=C.useMemo(()=>ke&&Zm(Te)&&Ue&&Zm(wt)&&Zm(ut)?{_className:r,canvasBackground:i,customTextRenderer:h,devicePixelRatio:u,onGetAnnotationsError:y,onGetAnnotationsSuccess:b,onGetStructTreeError:w,onGetStructTreeSuccess:E,onGetTextError:R,onGetTextSuccess:T,onRenderAnnotationLayerError:D,onRenderAnnotationLayerSuccess:O,onRenderError:I,onRenderSuccess:$,onRenderTextLayerError:F,onRenderTextLayerSuccess:B,page:ke,pageIndex:Te,pageNumber:Ue,renderForms:he,renderTextLayer:J,rotate:wt,scale:ut}:null,[r,i,h,u,y,b,w,E,R,T,D,O,I,$,F,B,ke,Te,Ue,he,J,wt,ut]),hn=C.useMemo(()=>lhe(ve,()=>ke&&(ut?fV(ke,ut):void 0)),[ve,ke,ut]),It=`${Te}@${ut}/${wt}`;function U(){switch(re){case"custom":return yr(d),_.jsx(d,{},`${It}_custom`);case"none":return null;case"canvas":default:return _.jsx(RHe,{canvasRef:o},`${It}_canvas`)}}function ee(){return J?_.jsx(NHe,{},`${It}_text`):null}function ie(){return se?_.jsx(THe,{},`${It}_annotations`):null}function _e(){return _.jsxs(phe.Provider,{value:cn,children:[U(),ee(),ie(),a]})}function we(){return Ue?Y===null||ke===void 0||ke===null?_.jsx(Bb,{type:"loading",children:typeof m=="function"?m():m}):Y===!1||ke===!1?_.jsx(Bb,{type:"error",children:typeof f=="function"?f():f}):_e():_.jsx(Bb,{type:"no-data",children:typeof x=="function"?x():x})}return _.jsx("div",Object.assign({className:oy(r,c),"data-page-number":Ue,ref:hhe(v,$e),style:{"--scale-factor":`${ut}`,backgroundColor:i||"white",position:"relative",minWidth:"min-content",minHeight:"min-content"}},hn,{children:we()}))}pHe();jW.workerSrc="pdf.worker.mjs";jW.workerSrc=`//unpkg.com/pdfjs-dist@${ahe}/build/pdf.worker.min.mjs`;const Hy=800,DHe={},OHe=({file:e,onThumbnailClick:t,className:n})=>{const[r,s]=C.useState(0),[i,o]=C.useState(1),[a,c]=C.useState(void 0),[d,h]=C.useState(null),[u,f]=C.useState(),g=C.useCallback(R=>{const[T]=R;T&&f(T.contentRect.width)},[]);XBe(d,DHe,g);const v=C.useCallback(()=>{c(i)},[c,i]);function m({numPages:R}){o(1),s(R)}const x=C.useCallback(R=>o(T=>R>0?Math.min(T+R,r):Math.max(T+R,1)),[r]),y=C.useCallback(()=>x(1),[x]),b=C.useCallback(()=>x(-1),[x]),w=C.useMemo(()=>a!==i,[a,i]),E=C.useMemo(()=>({cMapUrl:"/cmaps/",standardFontDataUrl:"/standard_fonts/"}),[]);return _.jsxs("div",{className:ge("flex flex-col cursor-default text-center",n),ref:h,children:[_.jsxs(_He,{file:e,onLoadSuccess:m,loading:_.jsx(ode,{className:"w-full mx-auto mt-32"}),options:E,className:ge(`w-full aspect-[3/4] relative bg-white shadow w-[${u?Math.min(u,Hy):Hy}]`,t?"cursor-pointer":""),children:[_.jsx(fY,{className:w&&a?"visible":"hidden",pageNumber:a,canvasBackground:"white",width:u?Math.min(u,Hy):Hy,onClick:()=>t?t():null},`page_${a}`),_.jsx(fY,{className:ge(w&&a?"hidden":"visible","text-center"),pageNumber:i,canvasBackground:"white",onRenderSuccess:v,width:u?Math.min(u,Hy):Hy,onClick:()=>t?t():null},i)]}),_.jsxs("div",{className:"flex flex-row justify-center w-full mt-4 space-x-4",children:[_.jsxs(at,{type:"button",variant:"outline",className:"w-8 h-8 p-0",onClick:b,disabled:w,children:[_.jsx("span",{className:"sr-only",children:ue("common.go_to_prev_page")}),_.jsx(lD,{className:"w-4 h-4"})]}),_.jsxs(at,{type:"button",variant:"outline",className:"w-8 h-8 p-0",onClick:y,disabled:w,children:[_.jsx("span",{className:"sr-only",children:ue("common.go_to_next_page")}),_.jsx(Tx,{className:"w-4 h-4"})]})]}),_.jsx("p",{className:"mt-4 text-sm font-medium text-center",children:ue("common.num_page_of_total",{count:i,total:r})})]})},bx=({children:e})=>{const t=Mp(),n=C.useId(),{isSuccess:r,isLoading:s,data:{authenticated:i=!1,redirectTo:o="/login"}={}}=dye(),{isSuccess:a,isLoading:c,error:d,data:h}=SH({enabled:r&&i});return s||c?_.jsx(Ou,{}):d?(console.error("Error loading profile:",d),_.jsx(Ip,{subtitle:d.message})):r&&!i||a&&!(h!=null&&h.id)?(console.debug("Not authenticated, redirecting to:",o),_.jsx(Bce,{to:o,state:{from:t},replace:!0})):_.jsx("div",{id:`${n}-${h==null?void 0:h.lang_code}`,children:e??null})},DP={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"}},MHe=C.forwardRef(({status:e,isEditable:t,className:n,...r},s)=>_.jsx("div",{ref:s,children:_.jsxs(_D,{className:ge(DP[e].bgColor,DP[e].color,DP[e].hoverBgColor,DP[e].hoverColor,"transition-colors duration-200 cursor-pointer flex items-center group",n),...r,children:[ue(`quotes.status.${e}`),t&&_.jsx(EJ,{className:"w-3 h-3 ml-2 transition-opacity opacity-0 group-hover:opacity-100"})]})}));function IHe(){return null}const Ey=()=>{const e=C.useContext(nue);if(e===null)throw new Error("useDataTableContext must be used within a DataTableProvider");return e};function XO({data:e,columns:t,pageCount:n,enableSorting:r=!1,enableHiding:s=!1,enableRowSelection:i=!1,initialState:o,onPaginationChange:a}){const{pagination:c,setPagination:d,sorting:h}=Ey(),[u,f]=fe.useState({}),[g,v]=fe.useState((o==null?void 0:o.columnVisibility)||{}),m=w=>{if(typeof w=="function"){const E=w(c);d(E)}a&&a(w)},x=w=>{},y=C.useCallback(()=>{const w=t;return i&&w.unshift(Gze()),w},[t,i]);return{table:pue({data:e,columns:y(),pageCount:n??-1,getCoreRowModel:fue(),initialState:o,state:{pagination:c,sorting:h,columnVisibility:g,rowSelection:u},enableRowSelection:i,onRowSelectionChange:f,manualSorting:!0,enableSorting:r,getSortedRowModel:G3e(),onSortingChange:x,enableHiding:s,onColumnVisibilityChange:v,manualPagination:!0,onPaginationChange:m,manualFiltering:!0,getFilteredRowModel:q3e(),getFacetedRowModel:H3e(),getFacetedUniqueValues:W3e(),debugTable:!1,debugHeaders:!1,debugColumns:!1,defaultColumn:{minSize:0,size:Number.MAX_SAFE_INTEGER,maxSize:Number.MAX_SAFE_INTEGER}})}}const LHe=({setSize:e,setControllerCallback:t,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);e(()=>c);let d=0;const h=new ReadableStream({start(u){t(u);const f=i.getReader();async function g(){return f.read().then(({done:v,value:m})=>v?u.close():(d+=(m==null?void 0:m.byteLength)||0,m&&u.enqueue(m),n({loaded:d,total:c}),g())).catch(v=>(r(v),f.cancel("Cancelled"),u.error(v)))}return g()}});return new Response(h)},hY=(e,t,n)=>{const r=[e],s=new Blob(r,{type:n||"application/octet-stream"});if(typeof window.navigator.msSaveBlob<"u")return window.navigator.msSaveBlob(s,t);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",t),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 pY({customHandleDownload:e,...t}={}){var E;let n=!1;try{n=process?!!((E=process==null?void 0:process.env)!=null&&E.REACT_APP_DEBUG_MODE):!1}catch{n=!1}const[r,s]=C.useState(0),[i,o]=C.useState(0),[a,c]=C.useState(0),[d,h]=C.useState(null),[u,f]=C.useState(!1),g=C.useRef(null),v=C.useCallback(({loaded:R,total:T})=>{const N=Math.round(R/T*100);o(()=>N)},[]),m=C.useCallback(R=>{const T={"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"};h(()=>({errorMessage:T[R.message]?T[R.message]:R.message}))},[]),x=C.useCallback(R=>{g.current=R},[]),y=C.useCallback(()=>{g.current&&g.current.error()},[]),b=C.useCallback(()=>{x(null),s(()=>0),o(()=>0),c(()=>0),f(()=>!1)},[x]),w=C.useCallback(async(R,T,N=0,A={})=>{if(u)return null;b(),h(()=>null),f(()=>!0);const D=setInterval(()=>s(B=>B+1),n?1:1e3),O=LHe({setSize:c,setControllerCallback:x,setPercentageCallback:v,setErrorCallback:m}),I=new AbortController,$=setTimeout(()=>{N>0&&I.abort()},N),F=e||hY;try{const B=await fetch(R,{method:"GET",...t,...A,signal:I.signal}),Z=await O(B).blob();F(Z,T),b()}catch(B){b(),h(W=>{const{message:Z}=B;return Z!=="Failed to fetch"?{errorMessage:Z}:W}),clearTimeout($)}finally{clearInterval(D)}},[u,b,n,x,v,m,t,e]);return C.useMemo(()=>({elapsed:r,percentage:i,size:a,download:w,cancel:y,error:d,isInProgress:u,jsDownload:hY}),[r,i,a,w,y,d,u])}const jHe=()=>{const{i18n:e}=AW();return bhe({locale:e.language})},bhe=e=>{const{locale:t}=e,n=C.useCallback(i=>{if(i==null)return"";const{amount:o,scale:a,currency_code:c}=i;return new Intl.NumberFormat(t??"ES",{style:"currency",currency:c,currencyDisplay:"symbol",useGrouping:!0,maximumFractionDigits:a}).format(o===null?0:IU({amount:o,scale:a}))},[t]),r=C.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:IU({amount:o,scale:a}))},[t]),s=C.useCallback(i=>{if(i==null)return"";const{amount:o,scale:a}=i;return new Intl.NumberFormat(t,{style:"decimal",minimumFractionDigits:a}).format(o===null?0:o)},[t]);return{formatCurrency:n,formatNumber:r,formatPercentage:s}};function xhe(e){const[t,n]=C.useState(!1);return C.useEffect(()=>{function r(i){n(i.matches)}const s=matchMedia(e);return s.addEventListener("change",r),n(s.matches),()=>s.removeEventListener("change",r)},[e]),t}var $W={},SR={},_he={exports:{}};function $He(e){throw new Error('Could not dynamically require "'+e+'". Please configure the dynamicRequireTargets or/and ignoreDynamicRequires option of @rollup/plugin-commonjs appropriately for this require call to work.')}var fz={exports:{}};const FHe={},N1=Object.freeze(Object.defineProperty({__proto__:null,default:FHe},Symbol.toStringTag,{value:"Module"})),zHe=Kpe(N1);var mY;function jp(){return mY||(mY=1,function(e,t){(function(n,r){e.exports=r()})(xr,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 xr<"u"&&xr.crypto&&(i=xr.crypto),!i&&typeof $He=="function")try{i=zHe}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 b(){}return function(w){var E;return b.prototype=w,E=new b,b.prototype=null,E}}(),c={},d=c.lib={},h=d.Base=function(){return{extend:function(b){var w=a(this);return b&&w.mixIn(b),(!w.hasOwnProperty("init")||this.init===w.init)&&(w.init=function(){w.$super.init.apply(this,arguments)}),w.init.prototype=w,w.$super=this,w},create:function(){var b=this.extend();return b.init.apply(b,arguments),b},init:function(){},mixIn:function(b){for(var w in b)b.hasOwnProperty(w)&&(this[w]=b[w]);b.hasOwnProperty("toString")&&(this.toString=b.toString)},clone:function(){return this.init.prototype.extend(this)}}}(),u=d.WordArray=h.extend({init:function(b,w){b=this.words=b||[],w!=s?this.sigBytes=w:this.sigBytes=b.length*4},toString:function(b){return(b||g).stringify(this)},concat:function(b){var w=this.words,E=b.words,R=this.sigBytes,T=b.sigBytes;if(this.clamp(),R%4)for(var N=0;N<T;N++){var A=E[N>>>2]>>>24-N%4*8&255;w[R+N>>>2]|=A<<24-(R+N)%4*8}else for(var D=0;D<T;D+=4)w[R+D>>>2]=E[D>>>2];return this.sigBytes+=T,this},clamp:function(){var b=this.words,w=this.sigBytes;b[w>>>2]&=4294967295<<32-w%4*8,b.length=r.ceil(w/4)},clone:function(){var b=h.clone.call(this);return b.words=this.words.slice(0),b},random:function(b){for(var w=[],E=0;E<b;E+=4)w.push(o());return new u.init(w,b)}}),f=c.enc={},g=f.Hex={stringify:function(b){for(var w=b.words,E=b.sigBytes,R=[],T=0;T<E;T++){var N=w[T>>>2]>>>24-T%4*8&255;R.push((N>>>4).toString(16)),R.push((N&15).toString(16))}return R.join("")},parse:function(b){for(var w=b.length,E=[],R=0;R<w;R+=2)E[R>>>3]|=parseInt(b.substr(R,2),16)<<24-R%8*4;return new u.init(E,w/2)}},v=f.Latin1={stringify:function(b){for(var w=b.words,E=b.sigBytes,R=[],T=0;T<E;T++){var N=w[T>>>2]>>>24-T%4*8&255;R.push(String.fromCharCode(N))}return R.join("")},parse:function(b){for(var w=b.length,E=[],R=0;R<w;R++)E[R>>>2]|=(b.charCodeAt(R)&255)<<24-R%4*8;return new u.init(E,w)}},m=f.Utf8={stringify:function(b){try{return decodeURIComponent(escape(v.stringify(b)))}catch{throw new Error("Malformed UTF-8 data")}},parse:function(b){return v.parse(unescape(encodeURIComponent(b)))}},x=d.BufferedBlockAlgorithm=h.extend({reset:function(){this._data=new u.init,this._nDataBytes=0},_append:function(b){typeof b=="string"&&(b=m.parse(b)),this._data.concat(b),this._nDataBytes+=b.sigBytes},_process:function(b){var w,E=this._data,R=E.words,T=E.sigBytes,N=this.blockSize,A=N*4,D=T/A;b?D=r.ceil(D):D=r.max((D|0)-this._minBufferSize,0);var O=D*N,I=r.min(O*4,T);if(O){for(var $=0;$<O;$+=N)this._doProcessBlock(R,$);w=R.splice(0,O),E.sigBytes-=I}return new u.init(w,I)},clone:function(){var b=h.clone.call(this);return b._data=this._data.clone(),b},_minBufferSize:0});d.Hasher=x.extend({cfg:h.extend(),init:function(b){this.cfg=this.cfg.extend(b),this.reset()},reset:function(){x.reset.call(this),this._doReset()},update:function(b){return this._append(b),this._process(),this},finalize:function(b){b&&this._append(b);var w=this._doFinalize();return w},blockSize:16,_createHelper:function(b){return function(w,E){return new b.init(E).finalize(w)}},_createHmacHelper:function(b){return function(w,E){return new y.HMAC.init(b,E).finalize(w)}}});var y=c.algo={};return c}(Math);return n})}(fz)),fz.exports}(function(e,t){(function(n,r){e.exports=r(jp())})(xr,function(n){return n.enc.Utf8})})(_he);var BHe=_he.exports,whe={exports:{}},hz={exports:{}},gY;function UHe(){return gY||(gY=1,function(e,t){(function(n,r){e.exports=r(jp())})(xr,function(n){return function(){var r=n,s=r.lib,i=s.WordArray,o=r.enc;o.Base64={stringify:function(c){var d=c.words,h=c.sigBytes,u=this._map;c.clamp();for(var f=[],g=0;g<h;g+=3)for(var v=d[g>>>2]>>>24-g%4*8&255,m=d[g+1>>>2]>>>24-(g+1)%4*8&255,x=d[g+2>>>2]>>>24-(g+2)%4*8&255,y=v<<16|m<<8|x,b=0;b<4&&g+b*.75<h;b++)f.push(u.charAt(y>>>6*(3-b)&63));var w=u.charAt(64);if(w)for(;f.length%4;)f.push(w);return f.join("")},parse:function(c){var d=c.length,h=this._map,u=this._reverseMap;if(!u){u=this._reverseMap=[];for(var f=0;f<h.length;f++)u[h.charCodeAt(f)]=f}var g=h.charAt(64);if(g){var v=c.indexOf(g);v!==-1&&(d=v)}return a(c,d,u)},_map:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/="};function a(c,d,h){for(var u=[],f=0,g=0;g<d;g++)if(g%4){var v=h[c.charCodeAt(g-1)]<<g%4*2,m=h[c.charCodeAt(g)]>>>6-g%4*2,x=v|m;u[f>>>2]|=x<<24-f%4*8,f++}return i.create(u,f)}}(),n.enc.Base64})}(hz)),hz.exports}var pz={exports:{}},vY;function VHe(){return vY||(vY=1,function(e,t){(function(n,r){e.exports=r(jp())})(xr,function(n){return function(r){var s=n,i=s.lib,o=i.WordArray,a=i.Hasher,c=s.algo,d=[];(function(){for(var m=0;m<64;m++)d[m]=r.abs(r.sin(m+1))*4294967296|0})();var h=c.MD5=a.extend({_doReset:function(){this._hash=new o.init([1732584193,4023233417,2562383102,271733878])},_doProcessBlock:function(m,x){for(var y=0;y<16;y++){var b=x+y,w=m[b];m[b]=(w<<8|w>>>24)&16711935|(w<<24|w>>>8)&4278255360}var E=this._hash.words,R=m[x+0],T=m[x+1],N=m[x+2],A=m[x+3],D=m[x+4],O=m[x+5],I=m[x+6],$=m[x+7],F=m[x+8],B=m[x+9],W=m[x+10],Z=m[x+11],Y=m[x+12],H=m[x+13],se=m[x+14],he=m[x+15],re=E[0],J=E[1],te=E[2],ae=E[3];re=u(re,J,te,ae,R,7,d[0]),ae=u(ae,re,J,te,T,12,d[1]),te=u(te,ae,re,J,N,17,d[2]),J=u(J,te,ae,re,A,22,d[3]),re=u(re,J,te,ae,D,7,d[4]),ae=u(ae,re,J,te,O,12,d[5]),te=u(te,ae,re,J,I,17,d[6]),J=u(J,te,ae,re,$,22,d[7]),re=u(re,J,te,ae,F,7,d[8]),ae=u(ae,re,J,te,B,12,d[9]),te=u(te,ae,re,J,W,17,d[10]),J=u(J,te,ae,re,Z,22,d[11]),re=u(re,J,te,ae,Y,7,d[12]),ae=u(ae,re,J,te,H,12,d[13]),te=u(te,ae,re,J,se,17,d[14]),J=u(J,te,ae,re,he,22,d[15]),re=f(re,J,te,ae,T,5,d[16]),ae=f(ae,re,J,te,I,9,d[17]),te=f(te,ae,re,J,Z,14,d[18]),J=f(J,te,ae,re,R,20,d[19]),re=f(re,J,te,ae,O,5,d[20]),ae=f(ae,re,J,te,W,9,d[21]),te=f(te,ae,re,J,he,14,d[22]),J=f(J,te,ae,re,D,20,d[23]),re=f(re,J,te,ae,B,5,d[24]),ae=f(ae,re,J,te,se,9,d[25]),te=f(te,ae,re,J,A,14,d[26]),J=f(J,te,ae,re,F,20,d[27]),re=f(re,J,te,ae,H,5,d[28]),ae=f(ae,re,J,te,N,9,d[29]),te=f(te,ae,re,J,$,14,d[30]),J=f(J,te,ae,re,Y,20,d[31]),re=g(re,J,te,ae,O,4,d[32]),ae=g(ae,re,J,te,F,11,d[33]),te=g(te,ae,re,J,Z,16,d[34]),J=g(J,te,ae,re,se,23,d[35]),re=g(re,J,te,ae,T,4,d[36]),ae=g(ae,re,J,te,D,11,d[37]),te=g(te,ae,re,J,$,16,d[38]),J=g(J,te,ae,re,W,23,d[39]),re=g(re,J,te,ae,H,4,d[40]),ae=g(ae,re,J,te,R,11,d[41]),te=g(te,ae,re,J,A,16,d[42]),J=g(J,te,ae,re,I,23,d[43]),re=g(re,J,te,ae,B,4,d[44]),ae=g(ae,re,J,te,Y,11,d[45]),te=g(te,ae,re,J,he,16,d[46]),J=g(J,te,ae,re,N,23,d[47]),re=v(re,J,te,ae,R,6,d[48]),ae=v(ae,re,J,te,$,10,d[49]),te=v(te,ae,re,J,se,15,d[50]),J=v(J,te,ae,re,O,21,d[51]),re=v(re,J,te,ae,Y,6,d[52]),ae=v(ae,re,J,te,A,10,d[53]),te=v(te,ae,re,J,W,15,d[54]),J=v(J,te,ae,re,T,21,d[55]),re=v(re,J,te,ae,F,6,d[56]),ae=v(ae,re,J,te,he,10,d[57]),te=v(te,ae,re,J,I,15,d[58]),J=v(J,te,ae,re,H,21,d[59]),re=v(re,J,te,ae,D,6,d[60]),ae=v(ae,re,J,te,Z,10,d[61]),te=v(te,ae,re,J,N,15,d[62]),J=v(J,te,ae,re,B,21,d[63]),E[0]=E[0]+re|0,E[1]=E[1]+J|0,E[2]=E[2]+te|0,E[3]=E[3]+ae|0},_doFinalize:function(){var m=this._data,x=m.words,y=this._nDataBytes*8,b=m.sigBytes*8;x[b>>>5]|=128<<24-b%32;var w=r.floor(y/4294967296),E=y;x[(b+64>>>9<<4)+15]=(w<<8|w>>>24)&16711935|(w<<24|w>>>8)&4278255360,x[(b+64>>>9<<4)+14]=(E<<8|E>>>24)&16711935|(E<<24|E>>>8)&4278255360,m.sigBytes=(x.length+1)*4,this._process();for(var R=this._hash,T=R.words,N=0;N<4;N++){var A=T[N];T[N]=(A<<8|A>>>24)&16711935|(A<<24|A>>>8)&4278255360}return R},clone:function(){var m=a.clone.call(this);return m._hash=this._hash.clone(),m}});function u(m,x,y,b,w,E,R){var T=m+(x&y|~x&b)+w+R;return(T<<E|T>>>32-E)+x}function f(m,x,y,b,w,E,R){var T=m+(x&b|y&~b)+w+R;return(T<<E|T>>>32-E)+x}function g(m,x,y,b,w,E,R){var T=m+(x^y^b)+w+R;return(T<<E|T>>>32-E)+x}function v(m,x,y,b,w,E,R){var T=m+(y^(x|~b))+w+R;return(T<<E|T>>>32-E)+x}s.MD5=a._createHelper(h),s.HmacMD5=a._createHmacHelper(h)}(Math),n.MD5})}(pz)),pz.exports}var mz={exports:{}},gz={exports:{}},yY;function HHe(){return yY||(yY=1,function(e,t){(function(n,r){e.exports=r(jp())})(xr,function(n){return function(){var r=n,s=r.lib,i=s.WordArray,o=s.Hasher,a=r.algo,c=[],d=a.SHA1=o.extend({_doReset:function(){this._hash=new i.init([1732584193,4023233417,2562383102,271733878,3285377520])},_doProcessBlock:function(h,u){for(var f=this._hash.words,g=f[0],v=f[1],m=f[2],x=f[3],y=f[4],b=0;b<80;b++){if(b<16)c[b]=h[u+b]|0;else{var w=c[b-3]^c[b-8]^c[b-14]^c[b-16];c[b]=w<<1|w>>>31}var E=(g<<5|g>>>27)+y+c[b];b<20?E+=(v&m|~v&x)+1518500249:b<40?E+=(v^m^x)+1859775393:b<60?E+=(v&m|v&x|m&x)-1894007588:E+=(v^m^x)-899497514,y=x,x=m,m=v<<30|v>>>2,v=g,g=E}f[0]=f[0]+g|0,f[1]=f[1]+v|0,f[2]=f[2]+m|0,f[3]=f[3]+x|0,f[4]=f[4]+y|0},_doFinalize:function(){var h=this._data,u=h.words,f=this._nDataBytes*8,g=h.sigBytes*8;return u[g>>>5]|=128<<24-g%32,u[(g+64>>>9<<4)+14]=Math.floor(f/4294967296),u[(g+64>>>9<<4)+15]=f,h.sigBytes=u.length*4,this._process(),this._hash},clone:function(){var h=o.clone.call(this);return h._hash=this._hash.clone(),h}});r.SHA1=o._createHelper(d),r.HmacSHA1=o._createHmacHelper(d)}(),n.SHA1})}(gz)),gz.exports}var vz={exports:{}},bY;function WHe(){return bY||(bY=1,function(e,t){(function(n,r){e.exports=r(jp())})(xr,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(d,h){d=this._hasher=new d.init,typeof h=="string"&&(h=a.parse(h));var u=d.blockSize,f=u*4;h.sigBytes>f&&(h=d.finalize(h)),h.clamp();for(var g=this._oKey=h.clone(),v=this._iKey=h.clone(),m=g.words,x=v.words,y=0;y<u;y++)m[y]^=1549556828,x[y]^=909522486;g.sigBytes=v.sigBytes=f,this.reset()},reset:function(){var d=this._hasher;d.reset(),d.update(this._iKey)},update:function(d){return this._hasher.update(d),this},finalize:function(d){var h=this._hasher,u=h.finalize(d);h.reset();var f=h.finalize(this._oKey.clone().concat(u));return f}})})()})}(vz)),vz.exports}var xY;function She(){return xY||(xY=1,function(e,t){(function(n,r,s){e.exports=r(jp(),HHe(),WHe())})(xr,function(n){return function(){var r=n,s=r.lib,i=s.Base,o=s.WordArray,a=r.algo,c=a.MD5,d=a.EvpKDF=i.extend({cfg:i.extend({keySize:128/32,hasher:c,iterations:1}),init:function(h){this.cfg=this.cfg.extend(h)},compute:function(h,u){for(var f,g=this.cfg,v=g.hasher.create(),m=o.create(),x=m.words,y=g.keySize,b=g.iterations;x.length<y;){f&&v.update(f),f=v.update(h).finalize(u),v.reset();for(var w=1;w<b;w++)f=v.finalize(f),v.reset();m.concat(f)}return m.sigBytes=y*4,m}});r.EvpKDF=function(h,u,f){return d.create(f).compute(h,u)}}(),n.EvpKDF})}(mz)),mz.exports}var yz={exports:{}},_Y;function qHe(){return _Y||(_Y=1,function(e,t){(function(n,r,s){e.exports=r(jp(),She())})(xr,function(n){n.lib.Cipher||function(r){var s=n,i=s.lib,o=i.Base,a=i.WordArray,c=i.BufferedBlockAlgorithm,d=s.enc;d.Utf8;var h=d.Base64,u=s.algo,f=u.EvpKDF,g=i.Cipher=c.extend({cfg:o.extend(),createEncryptor:function(O,I){return this.create(this._ENC_XFORM_MODE,O,I)},createDecryptor:function(O,I){return this.create(this._DEC_XFORM_MODE,O,I)},init:function(O,I,$){this.cfg=this.cfg.extend($),this._xformMode=O,this._key=I,this.reset()},reset:function(){c.reset.call(this),this._doReset()},process:function(O){return this._append(O),this._process()},finalize:function(O){O&&this._append(O);var I=this._doFinalize();return I},keySize:128/32,ivSize:128/32,_ENC_XFORM_MODE:1,_DEC_XFORM_MODE:2,_createHelper:function(){function O(I){return typeof I=="string"?D:T}return function(I){return{encrypt:function($,F,B){return O(F).encrypt(I,$,F,B)},decrypt:function($,F,B){return O(F).decrypt(I,$,F,B)}}}}()});i.StreamCipher=g.extend({_doFinalize:function(){var O=this._process(!0);return O},blockSize:1});var v=s.mode={},m=i.BlockCipherMode=o.extend({createEncryptor:function(O,I){return this.Encryptor.create(O,I)},createDecryptor:function(O,I){return this.Decryptor.create(O,I)},init:function(O,I){this._cipher=O,this._iv=I}}),x=v.CBC=function(){var O=m.extend();O.Encryptor=O.extend({processBlock:function($,F){var B=this._cipher,W=B.blockSize;I.call(this,$,F,W),B.encryptBlock($,F),this._prevBlock=$.slice(F,F+W)}}),O.Decryptor=O.extend({processBlock:function($,F){var B=this._cipher,W=B.blockSize,Z=$.slice(F,F+W);B.decryptBlock($,F),I.call(this,$,F,W),this._prevBlock=Z}});function I($,F,B){var W,Z=this._iv;Z?(W=Z,this._iv=r):W=this._prevBlock;for(var Y=0;Y<B;Y++)$[F+Y]^=W[Y]}return O}(),y=s.pad={},b=y.Pkcs7={pad:function(O,I){for(var $=I*4,F=$-O.sigBytes%$,B=F<<24|F<<16|F<<8|F,W=[],Z=0;Z<F;Z+=4)W.push(B);var Y=a.create(W,F);O.concat(Y)},unpad:function(O){var I=O.words[O.sigBytes-1>>>2]&255;O.sigBytes-=I}};i.BlockCipher=g.extend({cfg:g.cfg.extend({mode:x,padding:b}),reset:function(){var O;g.reset.call(this);var I=this.cfg,$=I.iv,F=I.mode;this._xformMode==this._ENC_XFORM_MODE?O=F.createEncryptor:(O=F.createDecryptor,this._minBufferSize=1),this._mode&&this._mode.__creator==O?this._mode.init(this,$&&$.words):(this._mode=O.call(F,this,$&&$.words),this._mode.__creator=O)},_doProcessBlock:function(O,I){this._mode.processBlock(O,I)},_doFinalize:function(){var O,I=this.cfg.padding;return this._xformMode==this._ENC_XFORM_MODE?(I.pad(this._data,this.blockSize),O=this._process(!0)):(O=this._process(!0),I.unpad(O)),O},blockSize:128/32});var w=i.CipherParams=o.extend({init:function(O){this.mixIn(O)},toString:function(O){return(O||this.formatter).stringify(this)}}),E=s.format={},R=E.OpenSSL={stringify:function(O){var I,$=O.ciphertext,F=O.salt;return F?I=a.create([1398893684,1701076831]).concat(F).concat($):I=$,I.toString(h)},parse:function(O){var I,$=h.parse(O),F=$.words;return F[0]==1398893684&&F[1]==1701076831&&(I=a.create(F.slice(2,4)),F.splice(0,4),$.sigBytes-=16),w.create({ciphertext:$,salt:I})}},T=i.SerializableCipher=o.extend({cfg:o.extend({format:R}),encrypt:function(O,I,$,F){F=this.cfg.extend(F);var B=O.createEncryptor($,F),W=B.finalize(I),Z=B.cfg;return w.create({ciphertext:W,key:$,iv:Z.iv,algorithm:O,mode:Z.mode,padding:Z.padding,blockSize:O.blockSize,formatter:F.format})},decrypt:function(O,I,$,F){F=this.cfg.extend(F),I=this._parse(I,F.format);var B=O.createDecryptor($,F).finalize(I.ciphertext);return B},_parse:function(O,I){return typeof O=="string"?I.parse(O,this):O}}),N=s.kdf={},A=N.OpenSSL={execute:function(O,I,$,F,B){if(F||(F=a.random(64/8)),B)var W=f.create({keySize:I+$,hasher:B}).compute(O,F);else var W=f.create({keySize:I+$}).compute(O,F);var Z=a.create(W.words.slice(I),$*4);return W.sigBytes=I*4,w.create({key:W,iv:Z,salt:F})}},D=i.PasswordBasedCipher=T.extend({cfg:T.cfg.extend({kdf:A}),encrypt:function(O,I,$,F){F=this.cfg.extend(F);var B=F.kdf.execute($,O.keySize,O.ivSize,F.salt,F.hasher);F.iv=B.iv;var W=T.encrypt.call(this,O,I,B.key,F);return W.mixIn(B),W},decrypt:function(O,I,$,F){F=this.cfg.extend(F),I=this._parse(I,F.format);var B=F.kdf.execute($,O.keySize,O.ivSize,I.salt,F.hasher);F.iv=B.iv;var W=T.decrypt.call(this,O,I,B.key,F);return W}})}()})}(yz)),yz.exports}(function(e,t){(function(n,r,s){e.exports=r(jp(),UHe(),VHe(),She(),qHe())})(xr,function(n){return function(){var r=n,s=r.lib,i=s.BlockCipher,o=r.algo,a=[],c=[],d=[],h=[],u=[],f=[],g=[],v=[],m=[],x=[];(function(){for(var w=[],E=0;E<256;E++)E<128?w[E]=E<<1:w[E]=E<<1^283;for(var R=0,T=0,E=0;E<256;E++){var N=T^T<<1^T<<2^T<<3^T<<4;N=N>>>8^N&255^99,a[R]=N,c[N]=R;var A=w[R],D=w[A],O=w[D],I=w[N]*257^N*16843008;d[R]=I<<24|I>>>8,h[R]=I<<16|I>>>16,u[R]=I<<8|I>>>24,f[R]=I;var I=O*16843009^D*65537^A*257^R*16843008;g[N]=I<<24|I>>>8,v[N]=I<<16|I>>>16,m[N]=I<<8|I>>>24,x[N]=I,R?(R=A^w[w[w[O^A]]],T^=w[w[T]]):R=T=1}})();var y=[0,1,2,4,8,16,32,64,128,27,54],b=o.AES=i.extend({_doReset:function(){var w;if(!(this._nRounds&&this._keyPriorReset===this._key)){for(var E=this._keyPriorReset=this._key,R=E.words,T=E.sigBytes/4,N=this._nRounds=T+6,A=(N+1)*4,D=this._keySchedule=[],O=0;O<A;O++)O<T?D[O]=R[O]:(w=D[O-1],O%T?T>6&&O%T==4&&(w=a[w>>>24]<<24|a[w>>>16&255]<<16|a[w>>>8&255]<<8|a[w&255]):(w=w<<8|w>>>24,w=a[w>>>24]<<24|a[w>>>16&255]<<16|a[w>>>8&255]<<8|a[w&255],w^=y[O/T|0]<<24),D[O]=D[O-T]^w);for(var I=this._invKeySchedule=[],$=0;$<A;$++){var O=A-$;if($%4)var w=D[O];else var w=D[O-4];$<4||O<=4?I[$]=w:I[$]=g[a[w>>>24]]^v[a[w>>>16&255]]^m[a[w>>>8&255]]^x[a[w&255]]}}},encryptBlock:function(w,E){this._doCryptBlock(w,E,this._keySchedule,d,h,u,f,a)},decryptBlock:function(w,E){var R=w[E+1];w[E+1]=w[E+3],w[E+3]=R,this._doCryptBlock(w,E,this._invKeySchedule,g,v,m,x,c);var R=w[E+1];w[E+1]=w[E+3],w[E+3]=R},_doCryptBlock:function(w,E,R,T,N,A,D,O){for(var I=this._nRounds,$=w[E]^R[0],F=w[E+1]^R[1],B=w[E+2]^R[2],W=w[E+3]^R[3],Z=4,Y=1;Y<I;Y++){var H=T[$>>>24]^N[F>>>16&255]^A[B>>>8&255]^D[W&255]^R[Z++],se=T[F>>>24]^N[B>>>16&255]^A[W>>>8&255]^D[$&255]^R[Z++],he=T[B>>>24]^N[W>>>16&255]^A[$>>>8&255]^D[F&255]^R[Z++],re=T[W>>>24]^N[$>>>16&255]^A[F>>>8&255]^D[B&255]^R[Z++];$=H,F=se,B=he,W=re}var H=(O[$>>>24]<<24|O[F>>>16&255]<<16|O[B>>>8&255]<<8|O[W&255])^R[Z++],se=(O[F>>>24]<<24|O[B>>>16&255]<<16|O[W>>>8&255]<<8|O[$&255])^R[Z++],he=(O[B>>>24]<<24|O[W>>>16&255]<<16|O[$>>>8&255]<<8|O[F&255])^R[Z++],re=(O[W>>>24]<<24|O[$>>>16&255]<<16|O[F>>>8&255]<<8|O[B&255])^R[Z++];w[E]=H,w[E+1]=se,w[E+2]=he,w[E+3]=re},keySize:256/32});r.AES=i._createHelper(b)}(),n.AES})})(whe);var GHe=whe.exports,QO={},CR={},Po={};Object.defineProperty(CR,"__esModule",{value:!0});CR.default=void 0;var KHe=function(){var t=null;try{typeof Cypress<"u"?t=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 Po<"u"?t=Po.SECURE_LOCAL_STORAGE_HASH_KEY||Po.REACT_APP_SECURE_LOCAL_STORAGE_HASH_KEY||Po.NEXT_PUBLIC_SECURE_LOCAL_STORAGE_HASH_KEY||Po.VITE_SECURE_LOCAL_STORAGE_HASH_KEY:console.warn("react-secure-storage : process is not defined! Just a warning!")}catch{return null}return t},YHe=function(){var t=null;try{typeof Cypress<"u"?t=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 Po<"u"?t=Po.SECURE_LOCAL_STORAGE_PREFIX||Po.REACT_APP_SECURE_LOCAL_STORAGE_PREFIX||Po.NEXT_PUBLIC_SECURE_LOCAL_STORAGE_PREFIX||Po.VITE_SECURE_LOCAL_STORAGE_PREFIX:console.warn("react-secure-storage : process is not defined! Just a warning!")}catch{return null}return t},XHe=function(){var t=null;try{typeof Cypress<"u"?t=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 Po<"u"?t=Po.SECURE_LOCAL_STORAGE_DISABLED_KEYS||Po.REACT_APP_SECURE_LOCAL_STORAGE_DISABLED_KEYS||Po.NEXT_PUBLIC_SECURE_LOCAL_STORAGE_DISABLED_KEYS||Po.VITE_SECURE_LOCAL_STORAGE_DISABLED_KEYS:console.warn("react-secure-storage : process is not defined! Just a warning!")}catch{return null}return t},QHe={getHashKey:KHe,getStoragePrefix:YHe,getDisabledKeys:XHe},ZHe=QHe;CR.default=ZHe;var ZO={},Che={exports:{}};(function(e){function t(n,r){var s,i,o,a,c,d,h,u;for(s=n.length&3,i=n.length-s,o=r,c=3432918353,d=461845907,u=0;u<i;)h=n.charCodeAt(u)&255|(n.charCodeAt(++u)&255)<<8|(n.charCodeAt(++u)&255)<<16|(n.charCodeAt(++u)&255)<<24,++u,h=(h&65535)*c+(((h>>>16)*c&65535)<<16)&4294967295,h=h<<15|h>>>17,h=(h&65535)*d+(((h>>>16)*d&65535)<<16)&4294967295,o^=h,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(h=0,s){case 3:h^=(n.charCodeAt(u+2)&255)<<16;case 2:h^=(n.charCodeAt(u+1)&255)<<8;case 1:h^=n.charCodeAt(u)&255,h=(h&65535)*c+(((h>>>16)*c&65535)<<16)&4294967295,h=h<<15|h>>>17,h=(h&65535)*d+(((h>>>16)*d&65535)<<16)&4294967295,o^=h}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}e.exports=t})(Che);var JHe=Che.exports,Su={};Object.defineProperty(Su,"__esModule",{value:!0});Su.getSecurePrefix=Su.getDisabledKeys=Su.FINGERPRINT_KEYS=void 0;var Ehe=e6e(CR);function e6e(e){return e&&e.__esModule?e:{default:e}}var t6e=function(){var t=Ehe.default.getStoragePrefix()||"@secure.";return t.endsWith(".")?t:t+"."};Su.getSecurePrefix=t6e;var Ta={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"};Su.FINGERPRINT_KEYS=Ta;var n6e=function(){var t=Ehe.default.getDisabledKeys()||"";if(t==="")return[];var n=[Ta.USERAGENT,Ta.SCREEN_PRINT,Ta.PLUGINS,Ta.FONTS,Ta.LOCAL_STORAGE,Ta.SESSION_STORAGE,Ta.TIMEZONE,Ta.LANGUAGE,Ta.SYSTEM_LANGUAGE,Ta.COOKIE,Ta.CANVAS,Ta.HOSTNAME],r=[];return t.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};Su.getDisabledKeys=n6e;Object.defineProperty(ZO,"__esModule",{value:!0});ZO.default=void 0;var r6e=s6e(JHe),Pa=Su;function s6e(e){return e&&e.__esModule?e:{default:e}}function i6e(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function o6e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}function a6e(e,t,n){return t&&o6e(e.prototype,t),Object.defineProperty(e,"prototype",{writable:!1}),e}var l6e=function(){function e(){i6e(this,e)}return a6e(e,[{key:"getFingerprint",value:function(){var n="|",r=(0,Pa.getDisabledKeys)(),s="";r.includes(Pa.FINGERPRINT_KEYS.USERAGENT)||(s+=navigator.userAgent+n),r.includes(Pa.FINGERPRINT_KEYS.HOSTNAME)||(s+=window.location.hostname+n),r.includes(Pa.FINGERPRINT_KEYS.SCREEN_PRINT)||(s+=this.getScreenPrint()+n),r.includes(Pa.FINGERPRINT_KEYS.PLUGINS)||(s+=this.getPlugins()+n),r.includes(Pa.FINGERPRINT_KEYS.FONTS)||(s+=this.getFonts()+n),r.includes(Pa.FINGERPRINT_KEYS.LOCAL_STORAGE)||(s+=this.isLocalStorage()+n),r.includes(Pa.FINGERPRINT_KEYS.SESSION_STORAGE)||(s+=this.isSessionStorage()+n),r.includes(Pa.FINGERPRINT_KEYS.TIMEZONE)||(s+=this.getTimeZone()+n),r.includes(Pa.FINGERPRINT_KEYS.LANGUAGE)||(s+=this.getLanguage()+n),r.includes(Pa.FINGERPRINT_KEYS.SYSTEM_LANGUAGE)||(s+=this.getSystemLanguage()+n),r.includes(Pa.FINGERPRINT_KEYS.COOKIE)||(s+=this.isCookie()+n),r.includes(Pa.FINGERPRINT_KEYS.CANVAS)||(s+=this.getCanvasPrint()),s.endsWith(n)&&(s=s.substring(0,s.length-1));var i=256;return(0,r6e.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()}}]),e}(),c6e=new l6e,u6e=c6e;ZO.default=u6e;Object.defineProperty(QO,"__esModule",{value:!0});QO.default=void 0;var d6e=Ahe(CR),f6e=Ahe(ZO);function Ahe(e){return e&&e.__esModule?e:{default:e}}var h6e="E86E2612010258B35137",p6e=function(){var t=d6e.default.getHashKey()||h6e;return typeof window>"u"?t:f6e.default.getFingerprint()+t},m6e=p6e;QO.default=m6e;Object.defineProperty(SR,"__esModule",{value:!0});SR.default=void 0;var g6e=FW(BHe),wY=FW(GHe),v6e=FW(QO);function FW(e){return e&&e.__esModule?e:{default:e}}function y6e(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function b6e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}function x6e(e,t,n){return t&&b6e(e.prototype,t),Object.defineProperty(e,"prototype",{writable:!1}),e}function _6e(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}var w6e=function(){function e(){y6e(this,e),_6e(this,"secureKey",""),this.secureKey=(0,v6e.default)()}return x6e(e,[{key:"encrypt",value:function(n){return wY.default.encrypt(n,this.secureKey).toString()}},{key:"decrypt",value:function(n){try{var r=wY.default.decrypt(n,this.secureKey);return r.toString(g6e.default)||null}catch{return null}}}]),e}(),S6e=w6e;SR.default=S6e;var JO={};Object.defineProperty(JO,"__esModule",{value:!0});JO.default=void 0;var C6e=A6e(SR),E6e=Su;function A6e(e){return e&&e.__esModule?e:{default:e}}function R6e(e,t){return k6e(e)||T6e(e,t)||N6e(e,t)||P6e()}function P6e(){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 N6e(e,t){if(e){if(typeof e=="string")return SY(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);if(n==="Object"&&e.constructor&&(n=e.constructor.name),n==="Map"||n==="Set")return Array.from(e);if(n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return SY(e,t)}}function SY(e,t){(t==null||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function T6e(e,t){var n=e==null?null:typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(n!=null){var r=[],s=!0,i=!1,o,a;try{for(n=n.call(e);!(s=(o=n.next()).done)&&(r.push(o.value),!(t&&r.length===t));s=!0);}catch(c){i=!0,a=c}finally{try{!s&&n.return!=null&&n.return()}finally{if(i)throw a}}return r}}function k6e(e){if(Array.isArray(e))return e}var CY=(0,E6e.getSecurePrefix)(),D6e=function(){var t={};if(typeof window<"u")for(var n=new C6e.default,r=0,s=Object.entries(localStorage);r<s.length;r++){var i=R6e(s[r],2),o=i[0],a=i[1];if(o.startsWith(CY)){var c=o.replace(CY,"")[0],d=o.replace(/[.][bjns][.]/,"."),h=n.decrypt(a),u=null;if(h!=null)switch(c){case"b":u=h==="true";break;case"j":try{u=JSON.parse(h)}catch{u=null}break;case"n":try{u=Number(h)}catch{u=null}break;default:u=h}t[d]=u}}return t},O6e=D6e;JO.default=O6e;Object.defineProperty($W,"__esModule",{value:!0});var dl=$W.default=void 0,M6e=Rhe(SR),I6e=Rhe(JO),L6e=Su;function Rhe(e){return e&&e.__esModule?e:{default:e}}function j6e(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function $6e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}function F6e(e,t,n){return t&&$6e(e.prototype,t),Object.defineProperty(e,"prototype",{writable:!1}),e}function z6e(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function hk(e){"@babel/helpers - typeof";return hk=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},hk(e)}var ON=(0,L6e.getSecurePrefix)(),B6e=function(t){return hk(t)==="object"?"j":typeof t=="boolean"?"b":typeof t=="number"?"n":"s"},EY=function(t,n){var r=B6e(n);return ON+"".concat(r,".")+t},U6e=function(){function e(){j6e(this,e),z6e(this,"_localStorageItems",{}),this._localStorageItems=(0,I6e.default)()}return F6e(e,[{key:"setItem",value:function(n,r){if(r==null)this.removeItem(n);else{var s=hk(r)==="object"?JSON.stringify(r):r+"",i=EY(n,r),o=ON+n;n!=null&&(this._localStorageItems[o]=r);var a=new M6e.default;localStorage.setItem(i,a.encrypt(s))}}},{key:"getItem",value:function(n){var r,s=ON+n;return(r=this._localStorageItems[s])!==null&&r!==void 0?r:null}},{key:"removeItem",value:function(n){var r=ON+n,s=this._localStorageItems[r],i=EY(n,s);this._localStorageItems[r]!==void 0&&delete this._localStorageItems[r],localStorage.removeItem(i)}},{key:"clear",value:function(){this._localStorageItems={},localStorage.clear()}}]),e}(),V6e=new U6e,H6e=V6e;dl=$W.default=H6e;const W6e={theme:"system",setTheme:()=>null},q6e=C.createContext(W6e);function G6e({children:e,defaultTheme:t="system",storageKey:n="vite-ui-theme",...r}){const[s,i]=C.useState(()=>dl.getItem(n)||t);C.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=>{dl.setItem(n,a),i(a)}};return _.jsx(q6e.Provider,{...r,value:o,children:e})}const Phe=C.createContext(null),K6e=()=>{const e=C.useContext(Phe);if(e===null)throw new Error("useWarnAboutChange must be used within a UnsavedWarnProvider");return e},zW=({isDirty:e=!1,title:t=ue("hooks.use_unsaved_changes_notifier.title"),subtitle:n=ue("hooks.use_unsaved_changes_notifier.subtitle"),confirmText:r=ue("hooks.use_unsaved_changes_notifier.confirm_text"),cancelText:s=ue("hooks.use_unsaved_changes_notifier.cancel_text"),onConfirm:i,onCancel:o,type:a="warning"})=>{const c=w$e(e),{show:d}=K6e(),h=C.useCallback(()=>e?new Promise(u=>{d({title:t,subtitle:n,confirmText:r,cancelText:s,type:a,onConfirm:()=>{u(!0),i==null||i()},onCancel:()=>{u(!1),o==null||o()}})}):Promise.resolve(!0),[s,r,e,o,i,d,n,t,a]);return C.useEffect(()=>{c.state==="blocked"&&h().then(u=>{u?c.proceed():c.reset()})},[c,h]),C.useEffect(()=>(e&&(window.onbeforeunload=()=>n),()=>{window.onbeforeunload=null}),[e,n]),{confirm:h}},Nhe=({children:e})=>{const[t,n]=C.useState(null),[r,s]=C.useState(!1),i=C.useCallback(d=>{n(d),s(!0)},[s,n]),o=()=>{var d;(d=t==null?void 0:t.onConfirm)==null||d.call(t),s(!1)},a=()=>{var d;(d=t==null?void 0:t.onCancel)==null||d.call(t),s(!1)},c=C.useMemo(()=>({show:i}),[i]);return _.jsxs(Phe.Provider,{value:c,children:[e,_.jsx(Uce,{onCancel:()=>{a()},onConfirm:()=>o(),title:t==null?void 0:t.title,description:t==null?void 0:t.subtitle,confirmLabel:t==null?void 0:t.confirmText,cancelLabel:t==null?void 0:t.cancelText,isOpen:r})]})};var Y6e=function(){return null};const The=e=>{const{isSubmitting:t,isLoading:n,isValidating:r}=Pse();return _.jsx(RO,{disabled:t||n||r,...e})};The.displayName="FormSubmitButton";const khe={"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}}"},OP=[{code:"en",name:"English",flag:()=>_.jsx("span",{className:"fi fi-gb"})},{code:"es",name:"Español",flag:()=>_.jsx("span",{className:"fi fi-es"})}],X6e=()=>{var u,f,g,v;const{t:e,i18n:t}=AW(),[n,r]=C.useState(t.language),s=io(),{toast:i}=Fu();C.useEffect(()=>{const m=navigator.language.split("-")[0],x=OP.find(y=>y.code===m);x&&o(x.code)},[]);const o=m=>{t.changeLanguage(m),r(m)},{mutate:a,status:c}=fye({onSuccess:m=>{const{success:x,error:y}=m;!x&&y&&d.setError("root",y),x&&s("/quotes",{replace:!0})},onError:m=>{const{message:x}=m;i({description:x,title:"Error"}),console.log(m)}}),d=aR({mode:"onBlur",defaultValues:{email:"",password:""},resolver:SW(wf.object({email:wf.string().email({tlds:{allow:!1}}).required(),password:wf.string().min(4).alphanum().required()}),{messages:khe})}),h=async m=>{a({email:m.email,password:m.password},{})};return _.jsxs(yue,{variant:"full",className:"p-0 lg:grid lg:min-h-[600px] lg:grid-cols-2 xl:min-h-[800px] h-screen ",children:[_.jsx("div",{className:"flex items-center justify-center py-12 ",children:_.jsxs("div",{className:"mx-auto grid w-[650px] gap-6 relative ",children:[_.jsx("div",{className:"absolute flex space-x-2 top-4 right-4 ",children:_.jsxs(rR,{children:[_.jsx(sR,{asChild:!0,children:_.jsxs(at,{variant:"outline",className:"w-[140px] justify-start",children:[_.jsx("span",{className:"mr-2",children:(u=OP.find(m=>m.code===n))==null?void 0:u.flag()}),(f=OP.find(m=>m.code===n))==null?void 0:f.name,_.jsx(Nx,{className:"w-4 h-4 ml-auto opacity-50"})]})}),_.jsx(Vx,{className:"w-[140px]",children:OP.map(m=>_.jsxs(up,{onSelect:()=>o(m.code),children:[_.jsx("span",{className:"mr-2",children:m.flag()}),m.name]},m.code))})]})}),_.jsxs(bs,{className:"px-12 py-6 bg-muted/50",children:[_.jsxs(Go,{children:[_.jsx(KU,{className:"inline-block m-auto mb-6 align-middle max-w-32"}),c,_.jsx(ui,{children:_.jsx(Zt,{i18nKey:"login_page.title"})}),_.jsx(Di,{children:_.jsx(Zt,{i18nKey:"login_page.description"})})]}),_.jsx(xs,{children:_.jsx(lR,{...d,children:_.jsx("form",{onSubmit:d.handleSubmit(h),children:_.jsxs("div",{className:"grid items-start gap-6",children:[_.jsx("div",{className:"grid gap-6",children:_.jsx(mg,{required:!0,disabled:c==="pending",name:"email",label:e("login_page.email_label"),type:"email",placeholder:e("login_page.email_placeholder")})}),_.jsxs("div",{className:"grid gap-6",children:[_.jsx(mg,{required:!0,disabled:c==="pending",name:"password",label:e("login_page.password_label"),type:"password"}),_.jsxs("div",{className:"mb-4 -mt-2 text-sm",children:[_.jsx(Zt,{i18nKey:"login_page.forgotten_password"}),_.jsx("br",{}),_.jsx(bf,{to:"https://uecko.com/distribuidores",className:"underline",children:_.jsx(Zt,{i18nKey:"login_page.contact_us"})})]})]}),((g=d.formState.errors.root)==null?void 0:g.message)&&_.jsxs(jH,{variant:"destructive",children:[_.jsx(xJ,{className:"w-4 h-4"}),_.jsx($H,{children:_.jsx(Zt,{i18nKey:"common.error"})}),_.jsx(FH,{children:(v=d.formState.errors.root)==null?void 0:v.message})]}),_.jsx(The,{className:"w-full",disabled:c==="pending"}),_.jsxs("div",{className:"mt-4 text-sm text-center",children:[_.jsx(Zt,{i18nKey:"login_page.become_dealer"}),_.jsx("br",{}),_.jsx(bf,{to:"https://uecko.com/distribuidores",className:"underline",children:_.jsx(Zt,{i18nKey:"login_page.contact_us"})})]})]})})})})]}),_.jsx("img",{className:"block w-11/12 mx-auto aspect-auto",src:"/img/uecko-footer_logos.jpg"})]})}),_.jsx("div",{className:"hidden bg-muted lg:block",children:_.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"})})]})},Q6e=e=>{const{onSuccess:t,onError:n,...r}=e||{},s=pu(),i=Lf(),{logout:o}=sD(),a=io(),{toast:c}=Fu();return mu({mutationKey:i().auth().action("logout").get(),mutationFn:o,onSuccess:async(d,h,u)=>{s.clear();const{success:f,redirectTo:g}=d;f&&g&&a(g||"/"),t&&t(d,h,u)},onError:(d,h,u)=>{const{message:f}=d;c({title:"Error",description:f,variant:"destructive"}),n&&n(d,h,u)},...r})},Z6e=()=>{const{mutate:e}=Q6e({});return C.useEffect(()=>e(),[e]),_.jsx(Ou,{})},J6e=C.createContext(null),e8e=({children:e})=>{const[t,n]=EO();return _.jsx(J6e.Provider,{value:{pagination:t,setPagination:n},children:e})},t8e=({children:e})=>_.jsx(bx,{children:_.jsx(e8e,{children:_.jsxs(e_,{className:"catalog-layout",children:[_.jsx(n_,{}),_.jsx(t_,{children:e})]})})}),Dhe=e=>{const t=vx(),n=Lf(),{pagination:r,searchTerm:s=[],enabled:i=!0,queryOptions:o}=e;return lW({queryKey:n().data().resource("catalog").action("list").params(e).get(),queryFn:()=>t.getList({resource:"catalog",quickSearchTerm:s,pagination:r}),enabled:i,queryOptions:o})};function Ohe({table:e,className:t,children:n,...r}){const{globalFilter:s,isFiltered:i,setGlobalFilter:o,resetGlobalFilter:a}=Ey(),c=fe.useRef(null),[d,h]=fe.useState(""),u=fe.useCallback(v=>{v.key==="Enter"&&d.trim()&&(v.preventDefault(),o(m=>[...m,d.trim()]),h("")),v.key==="Backspace"&&!d&&s.length>0&&(v.preventDefault(),o(m=>m.slice(0,-1)))},[s,d]),f=fe.useCallback(v=>{o(m=>m.filter(x=>x!==v))},[]),g=fe.useCallback(()=>{var v;d.trim()&&(o(m=>[...m,d.trim()]),h(""),(v=c.current)==null||v.focus())},[d]);return _.jsx(wce,{children:_.jsxs("div",{className:"w-full space-y-2",...r,children:[_.jsxs("div",{className:ge("relative flex items-center flex-1 p-2 space-x-2 border rounded-md",i?"border-primary":"border-input"),children:[_.jsx(IH,{className:ge("w-4 h-4 text-gray-500")}),_.jsxs("div",{className:"flex flex-wrap items-center flex-1 gap-2",children:[s&&s.map(v=>_.jsxs(_D,{variant:"default",className:"px-1 text-base font-normal rounded-sm",children:[v,_.jsxs(at,{variant:"ghost",onClick:()=>f(v),className:"h-auto p-0 px-1 ml-1 hover:bg-transparent",children:[_.jsxs(Mi,{children:[_.jsx(Ii,{asChild:!0,children:_.jsx(sx,{className:"w-4 h-4"})}),_.jsx(di,{children:_.jsx("p",{children:ue("catalog.filter.badget_remove_tooltip")})})]}),_.jsx("span",{className:"sr-only",children:ue("catalog.filter.badget_remove_tooltip")})]})]},v)),_.jsxs("div",{className:"flex-1 flex items-center min-w-[300px]",children:[_.jsx("input",{ref:c,value:d,onChange:v=>h(v.target.value),onKeyDown:u,placeholder:ue("common.filter.input_placeholder"),className:"flex-1 w-full h-8 bg-transparent outline-none placeholder:text-muted-foreground"}),_.jsxs(Yv,{children:[i&&_.jsxs(Mi,{children:[_.jsx(Ii,{asChild:!0,children:_.jsxs(at,{variant:"ghost",onClick:()=>a(),className:"h-8 px-2 transition-all lg:px-3 text-primary",children:[_.jsx(sx,{className:"w-4 h-4 mr-2"}),ue("common.filter.reset_filter")]})}),_.jsx(di,{children:_.jsx("p",{children:ue("common.filter.reset_filter")})})]}),_.jsxs(Mi,{children:[_.jsx(Ii,{asChild:!0,children:_.jsxs(at,{variant:"outline",size:"icon",onClick:g,className:"w-8 h-8 p-0 hover:bg-muted",children:[_.jsx(MH,{className:"w-4 h-4"}),_.jsx("span",{className:"sr-only",children:ue("common.filter.button_add_term")})]})}),_.jsx(di,{children:_.jsx("p",{children:ue("common.filter.button_add_term_tooltip")})})]})]})]})]})]}),_.jsx("p",{className:"text-sm text-muted-foreground",children:ue("common.filter.help_text")})]})})}const n8e=()=>{const e=io(),{pagination:t,globalFilter:n,isFiltered:r}=Ey(),{data:s,isPending:i,isError:o,error:a}=Dhe({pagination:{pageIndex:t.pageIndex,pageSize:t.pageSize},searchTerm:n}),c=C.useMemo(()=>[{id:"id",accessorKey:"id"},{id:"id_article",accessorKey:"id_article"},{id:"catalog_name",accessorKey:"catalog_name"},{id:"description",accessorKey:"description",header:()=>_.jsx(_.Fragment,{children:ue("catalog.list.columns.description")})},{id:"points",accessorKey:"points",header:()=>_.jsx("div",{className:"text-right",children:ue("catalog.list.columns.points")}),cell:({renderValue:h})=>_.jsx("div",{className:"text-right",children:h()})},{id:"retail_price",accessorKey:"retail_price",header:()=>_.jsx("div",{className:"text-right",children:ue("catalog.list.columns.retail_price")}),cell:({row:h})=>{const u=No.create(h.original.retail_price).object;return _.jsx("div",{className:"text-right",children:u.toFormat()})}}],[]),{table:d}=XO({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?_.jsx(Ip,{subtitle:a.message}):i?_.jsx(bs,{children:_.jsx(xs,{children:_.jsx(MO,{columnCount:6,searchableColumnCount:1,filterableColumnCount:2,shrinkZero:!0})})}):(s==null?void 0:s.total_items)===0&&!r?_.jsx(IO,{subtitle:"Empieza cargando los artículos del catálogo",buttonText:"",onButtonClick:()=>e("/catalog/add")}):_.jsx(PO,{table:d,paginationOptions:{visible:!0},children:_.jsx(Ohe,{table:d})})},r8e=()=>_.jsxs(mx,{children:[_.jsx("div",{className:"flex items-center justify-between space-y-2",children:_.jsx("div",{children:_.jsx("h2",{className:"text-2xl font-bold tracking-tight",children:_.jsx(Zt,{i18nKey:"catalog.list.title"})})})}),_.jsx(n8e,{})]}),s8e=()=>{const{data:e,status:t}=SH();return _.jsxs(e_,{children:[_.jsx(n_,{}),_.jsx(t_,{children:t==="success"?_.jsx("div",{className:"flex items-center",children:_.jsx("h1",{className:"text-lg font-semibold md:text-2xl",children:`${ue("dashboard.welcome")}, ${e==null?void 0:e.name}`})}):_.jsx(zo,{className:"w-[100px] h-[20px] rounded-full"})})]})},i8e=({children:e})=>_.jsx(bx,{children:_.jsxs(e_,{className:"dealers-layout",children:[_.jsx(n_,{}),_.jsx(t_,{children:e})]})});function o8e({table:e}){return _.jsxs(rR,{children:[_.jsx(sR,{asChild:!0,children:_.jsxs(at,{variant:"outline",size:"sm",className:"hidden h-8 ml-auto lg:flex",children:[_.jsx(hbe,{className:"w-4 h-4 mr-2"}),"Columnas"]})}),_.jsxs(Vx,{align:"end",className:"w-[150px]",children:[_.jsx(XD,{children:"Columnas"}),_.jsx(ax,{}),e.getAllColumns().filter(t=>typeof t.accessorFn<"u"&&t.getCanHide()).map(t=>_.jsx(xse,{className:"capitalize",checked:t.getIsVisible(),onCheckedChange:n=>t.toggleVisibility(!!n),children:_.jsx(_.Fragment,{children:t.columnDef.header})},t.id))]})]})}function Mhe({table:e,className:t,children:n,...r}){const{globalFilter:s,isFiltered:i,setGlobalFilter:o,resetGlobalFilter:a}=Ey(),c=d=>{const h=String(d.target.value);h===""?a():o([h])};return _.jsxs("div",{className:ge("flex w-full items-center justify-between space-x-2 overflow-auto p-1",t),...r,children:[_.jsxs("div",{className:"flex items-center flex-1 space-x-2",children:[_.jsx(IH,{className:"w-4 h-4 text-gray-500"}),_.jsx(cR,{placeholder:ue("common.filter.input_placeholder"),value:s,onChange:c,className:ge("h-8 w-full transition-all")},"global-filter"),i&&_.jsxs(at,{variant:"outline",onClick:()=>a(),className:"h-8 px-2 transition-all lg:px-3",children:[_.jsx(sx,{className:"w-4 h-4 mr-2"}),ue("common.filter.reset_filter")]})]}),_.jsxs("div",{className:"flex items-center gap-2",children:[n,e.options.enableHiding&&_.jsx(o8e,{table:e})]})]})}const a8e=e=>{const t=vx(),n=Lf(),{pagination:r,searchTerm:s=void 0,enabled:i=!0,queryOptions:o}=e;return lW({queryKey:n().data().resource("dealer").action("list").params(e).get(),queryFn:()=>t.getList({resource:"dealers",quickSearchTerm:s,pagination:r}),enabled:i,queryOptions:o})},l8e=()=>{const e=io(),{pagination:t,globalFilter:n,isFiltered:r}=Ey(),{data:s,isPending:i,isError:o,error:a}=a8e({pagination:{pageIndex:t.pageIndex,pageSize:t.pageSize},searchTerm:n}),c=C.useMemo(()=>[{id:"id",accessorKey:"id",enableResizing:!1,size:10},{id:"name",accessorKey:"name",enableResizing:!1,size:10}],[]),{table:d}=XO({data:(s==null?void 0:s.items)??[],columns:c,pageCount:(s==null?void 0:s.total_pages)??-1});return o?_.jsx(Ip,{subtitle:a.message}):i?_.jsx(bs,{children:_.jsx(xs,{children:_.jsx(MO,{columnCount:6,searchableColumnCount:1,filterableColumnCount:2,shrinkZero:!0})})}):(s==null?void 0:s.total_items)===0&&!r?_.jsx(IO,{subtitle:"Empieza cargando los artículos del catálogo",buttonText:"",onButtonClick:()=>e("/catalog/add")}):_.jsx(_.Fragment,{children:_.jsx(PO,{table:d,paginationOptions:{visible:!0},children:_.jsx(Mhe,{table:d})})})},c8e=()=>_.jsx(mx,{children:_.jsx(l8e,{})}),u8e=()=>_.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:_.jsxs("div",{className:"max-w-md mx-auto text-center",children:[_.jsx("div",{className:"w-12 h-12 mx-auto text-primary"}),_.jsx("h1",{className:"mt-4 text-3xl font-bold tracking-tight text-foreground sm:text-4xl",children:"Oops, page not found!"}),_.jsx("p",{className:"mt-4 text-muted-foreground",children:"The page you're looking for doesn't exist or has been moved."}),_.jsx("div",{className:"mt-6",children:_.jsx(at,{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 d8e(e,t={}){const{enableDragHandleColumn:n=!1,enableSelectionColumn:r=!1,enableActionsColumn:s=!1,rowActionFn:i=void 0}=t;return C.useMemo(()=>(n&&e.unshift({id:"row_drag_handle",header:()=>null,cell:o=>_.jsx(qze,{rowId:o.row.id}),enableSorting:!1,enableHiding:!1,size:40}),r&&e.unshift({id:"select",header:({table:o})=>_.jsx(_C,{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})=>_.jsx(_C,{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&&e.push({id:"row_actions",cell:o=>_.jsx(n4e,{rowContext:o,actions:i}),enableSorting:!1,enableHiding:!1,size:48}),e),[s,n,r])}var Ihe={exports:{}};(function(e,t){(function(n,r,s){e.exports=s(),e.exports.default=s()})("slugify",xr,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,d=o.trim===void 0?!0:o.trim,h=i.normalize().split("").reduce(function(u,f){var g=a[f];return g===void 0&&(g=n[f]),g===void 0&&(g=f),g===c&&(g=" "),u+g.replace(o.remove||/[^\w\s$*_+~.()'"!\-:@]+/g,"")},"");return o.strict&&(h=h.replace(/[^A-Za-z0-9\s]/g,"")),d&&(h=h.trim()),h=h.replace(/\s+/g,c),o.lower&&(h=h.toLowerCase()),h}return s.extend=function(i){Object.assign(n,i)},s})})(Ihe);var f8e=Ihe.exports;const h8e=Al(f8e),ER=()=>{const e=vx(),t=Lf(),n=C.useCallback(i=>`${e.getApiUrl()}/quotes/${i}/report`,[e]),r=C.useCallback(i=>`quote-${h8e(i.reference,{lower:!0,strict:!0,locale:"en",trim:!0})}.pdf`,[]),s={useList:i=>{const o=vx(),a=Lf(),{pagination:c,status:d="draft",quickSearchTerm:h=void 0,enabled:u=!0,queryOptions:f}=i;return lW({queryKey:a().data().resource("quotes").action("list").params(i).get(),queryFn:()=>o.getList({resource:"quotes",quickSearchTerm:h,filters:d!=="all"?[{field:"status",operator:"eq",value:d}]:[{field:"status",operator:"ne",value:"archived"}],pagination:c}),enabled:u,queryOptions:f})},useCreate:()=>{const i=pu();return ZFe({mutationFn:o=>{const{date:a}=o,c=uh.generateNewID().object.toString();return e.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=pu();return mu({mutationKey:t().data().resource("quotes").action("one").id(i).params().get(),mutationFn:a=>e.updateOne({resource:"quotes",id:i,data:a}),onSuccess:()=>{o.invalidateQueries({queryKey:["data","default","quotes"]})}})},useSetStatus:()=>{const i=pu();return mu({mutationFn:o=>{const{id:a,newStatus:c}=o;return e.custom({url:`${e.getApiUrl()}/quotes/${a}/setStatus`,method:"put",data:{newStatus:c}})},onSuccess:()=>{i.invalidateQueries({queryKey:["data","default","quotes"]})}})},useDuplicate:()=>{const i=pu();return mu({mutationFn:o=>{const{id:a}=o;return e.custom({url:`${e.getApiUrl()}/quotes/${a}/duplicate`,method:"post"})},onSuccess:()=>{i.invalidateQueries({queryKey:["data","default","quotes"]})}})},useSentTo:i=>{const o=pu();return mu({mutationKey:t().data().resource("quotes").action("one").id(i).params().get(),mutationFn:a=>{const{sent_date:c}=a;return e.custom({url:`${e.getApiUrl()}/quotes/${i}/send`,method:"put",data:{sent_date:c}})},onSuccess:()=>{o.invalidateQueries({queryKey:["data","default","quotes"]})}})},useOne:(i,o)=>eue({queryKey:t().data().resource("quotes").action("one").id(i).params().get(),queryFn:()=>e.getOne({resource:"quotes",id:String(i)}),enabled:!!i,...o}),getQuotePDFDownloadURL:n,getQuotePDFFilename:r,useReport:()=>{const i=e.getApiAuthorization(),[o,a]=C.useState(void 0),{download:c,...d}=pY({headers:{Authorization:i},customHandleDownload:C.useCallback(u=>{const f=[u],g=new Blob(f,{type:"application/octet-stream"});return a(g),!0},[a])}),h=C.useCallback(u=>c(s.getQuotePDFDownloadURL(u),""),[c]);return{...d,preview:h,report:o}},useDownloader:()=>{const i=e.getApiAuthorization(),o=pY({headers:{Authorization:i}});return{...o,download:(c,d)=>{const h=s.getQuotePDFDownloadURL(c);return o.download(h,d)}}}};return s},p8e=()=>{const e=io(),{toast:t}=Fu(),{useCreate:n}=ER(),{mutate:r,isPending:s}=n(),i=C.useMemo(()=>({date:new Date(Date.now()).toUTCString(),customer_reference:"",customer_information:""}),[]),o=aR({mode:"onBlur",defaultValues:i,resolver:SW(wf.object({customer_reference:wf.string(),date:wf.date().required(),customer_information:wf.string().required()}),{messages:{es:khe}})}),{formState:a,reset:c,getValues:d,handleSubmit:h}=o,{isSubmitting:u,isDirty:f}=a;zW({isDirty:f});const g=async v=>{try{r(v,{onError:m=>{console.debug(m),t({title:"Error",description:m.message,variant:"destructive"})},onSuccess:m=>{c(d()),t({title:"Cotización creada",variant:"default"}),e(`/quotes/edit/${m.id}`,{relative:"path"})}})}finally{}};return u?_.jsx(Ou,{title:"Guardando ajustes"}):s?_.jsx(Ou,{}):_.jsx(lR,{...o,children:_.jsx("form",{onSubmit:h(g),children:_.jsxs("div",{className:"mx-auto grid max-w-[90rem] flex-1 auto-rows-max gap-6",children:[_.jsxs("div",{className:"flex items-center gap-4",children:[_.jsx(hW,{}),_.jsx("h1",{className:"flex-1 text-xl font-semibold tracking-tight shrink-0 whitespace-nowrap sm:grow-0",children:ue("quotes.create.title")})]}),_.jsx("div",{className:"grid w-6/12 gap-6 mx-auto",children:_.jsxs(rk,{className:"md:col-span-4",title:ue("quotes.create.form_groups.general.title"),description:ue("quotes.create.form_groups.general.desc"),footerActions:_.jsxs("div",{className:"flex items-stretch justify-between flex-1",children:[_.jsx(at,{size:"sm",variant:"outline",onClick:()=>e("/quotes"),children:ue("common.discard")}),_.jsx(RO,{size:"sm",label:ue("common.continue")})]}),children:[_.jsx(mg,{required:!0,name:"customer_reference",label:ue("quotes.form_fields.customer_reference.label"),description:ue("quotes.form_fields.customer_reference.desc"),placeholder:ue("quotes.form_fields.customer_reference.placeholder")}),_.jsx(Yue,{required:!0,label:ue("quotes.form_fields.date.label"),description:ue("quotes.form_fields.date.desc"),placeholder:ue("quotes.form_fields.date.placeholder"),name:"date"}),_.jsx(Ef,{}),_.jsx(gc,{rows:4,className:"row-span-2",name:"customer_information",required:!0,label:ue("quotes.form_fields.customer_information.label"),description:ue("quotes.form_fields.customer_information.desc"),placeholder:ue("quotes.form_fields.customer_information.placeholder")})]})})]})})})},bz=(e,t=!1)=>{const{discount:n,tax:r,subtotal_price:s}=e||{},i=Tu.create(n||{amount:null,scale:2});if(i.isFailure)throw i.error;const o=i.object,a=Tu.create(r||{amount:null,scale:2});if(a.isFailure)throw a.error;const c=a.object,d=No.create(s||{amount:null,scale:2});if(d.isFailure)throw d.error;const h=t?m8e(e.items).convertScale(2):d.object,u=h.percentage(o.toNumber()).convertScale(2),f=h.subtract(u).convertScale(2),g=f.percentage(c.toNumber()).convertScale(2),v=f.add(g).convertScale(2);return{subtotal_price:h,discount:e.discount,discount_price:u,before_tax_price:f,tax:c,tax_price:g,total_price:v}},m8e=e=>{let t=No.create({amount:0,scale:2}).object;return e&&e.map(n=>{const r=hV(n);t=t.add(r.total_price)}),t},hV=e=>{const{quantity:t,unit_price:n,discount:r}=e||{};if((!t||t&&t.amount===null)&&(!n||n&&n.amount===null)&&(!r||r&&r.amount===null))return{quantity:xp.create({amount:null,scale:0}).object,unit_price:No.create({amount:null,scale:2}).object,subtotal_price:No.create({amount:null,scale:2}).object,discount:Tu.create({amount:null,scale:2}).object,total_price:No.create({amount:null,scale:2}).object};const s=xp.create(t);if(s.isFailure)throw s.error;const i=s.object,o=No.create(n);if(o.isFailure)throw o.error;const a=o.object,c=Tu.create(r);if(c.isFailure)throw c.error;const d=c.object,h=a.multiply(i.toNumber()),u=h.subtract(h.percentage(d.toNumber()));return{quantity:i,unit_price:a,subtotal_price:h,discount:d,total_price:u}},g8e=()=>{const{id:e}=f$e();return e};var Qs=function(){var e={name:"__LSM__",middleWares:[],persist:"action"},t={};try{e.storageType=typeof sessionStorage<"u"?window.sessionStorage:void 0}catch{}return{updateStore:function(n){try{t=e.storageType&&JSON.parse(e.storageType.getItem(e.name)||"")||n}catch{t=n}},saveStore:function(){e.storageType&&e.storageType.setItem(e.name,JSON.stringify(t))},get state(){return t},set state(n){t=n},get options(){return e},set options(n){e=n}}}(),Lhe=C.createContext(void 0),v8e=function(e){var t=e.children,n=C.useState(Qs.state),r=n[0],s=n[1];return C.useEffect(function(){Qs.options.persist==="beforeUnload"&&(window.onbeforeunload=function(){return Qs.saveStore()},Qs.options.storageType&&Qs.options.storageType.removeItem(Qs.options.name))},[]),C.createElement(Lhe.Provider,{value:{state:r,setState:s}},t)};function pV(){return pV=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},pV.apply(this,arguments)}function y8e(e,t){t&&(Qs.options=pV({},Qs.options,t)),Qs.updateStore(e)}function jhe(e){var t=C.useContext(Lhe),n=t.state,r=t.setState,s=C.useRef(Object.entries(e||{}).reduce(function(i,o){var a;return Object.assign({},i,((a={})[o[0]]=function(c,d){return function(h,u){Qs.state=d(Qs.state,h),Qs.options.middleWares&&(Qs.state=Qs.options.middleWares.reduce(function(f,g){return g(f,d.name,h)||f},Qs.state)),(!u||!u.skipRender)&&c(Qs.state),Qs.options.persist==="action"&&Qs.saveStore()}}(r,o[1]),a))},{}));return{actions:s.current,state:n,getState:C.useCallback(function(){return Qs.state},[])}}var MP,b8e=new Uint8Array(16);function x8e(){if(!MP&&(MP=typeof crypto<"u"&&crypto.getRandomValues&&crypto.getRandomValues.bind(crypto)||typeof msCrypto<"u"&&typeof msCrypto.getRandomValues=="function"&&msCrypto.getRandomValues.bind(msCrypto),!MP))throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");return MP(b8e)}const _8e=/^(?:[0-9a-f]{8}-[0-9a-f]{4}-[1-5][0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}|00000000-0000-0000-0000-000000000000)$/i;function w8e(e){return typeof e=="string"&&_8e.test(e)}var Si=[];for(var xz=0;xz<256;++xz)Si.push((xz+256).toString(16).substr(1));function S8e(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0,n=(Si[e[t+0]]+Si[e[t+1]]+Si[e[t+2]]+Si[e[t+3]]+"-"+Si[e[t+4]]+Si[e[t+5]]+"-"+Si[e[t+6]]+Si[e[t+7]]+"-"+Si[e[t+8]]+Si[e[t+9]]+"-"+Si[e[t+10]]+Si[e[t+11]]+Si[e[t+12]]+Si[e[t+13]]+Si[e[t+14]]+Si[e[t+15]]).toLowerCase();if(!w8e(n))throw TypeError("Stringified UUID is invalid");return n}function C8e(e,t,n){e=e||{};var r=e.random||(e.rng||x8e)();return r[6]=r[6]&15|64,r[8]=r[8]&63|128,S8e(r)}var Ay={};Object.defineProperty(Ay,"__esModule",{value:!0});var E8e=C;function A8e(e){if(e&&e.__esModule)return e;var t=Object.create(null);return e&&Object.keys(e).forEach(function(n){if(n!=="default"){var r=Object.getOwnPropertyDescriptor(e,n);Object.defineProperty(t,n,r.get?r:{enumerable:!0,get:function(){return e[n]}})}}),t.default=e,Object.freeze(t)}var fn=A8e(E8e);const Ry=.3,AR="linear",BW="normal",UW="none",$he="running",R8e="paused",VW="all";var Fhe=({duration:e=Ry,delay:t=0,overlay:n=0})=>e+t-n||0,FC=e=>e===void 0;function pk(e,t,n){return FC(t)&&FC(e)?n||0:e&&e>=0?e:t||0}const eM=fn.createContext({animationStates:{},register:()=>{}});function P8e({play:e,sequences:t=[],children:n}){const[r,s]=fn.useState({}),i=fn.useRef({}),o=fn.useCallback(a=>{const{sequenceIndex:c,sequenceId:d}=a;(!FC(d)||!FC(c))&&(i.current[pk(c,d)]=a)},[]);return fn.useEffect(()=>{const a=Array.isArray(t)&&t.length?t:Object.values(i.current),c={};(e?a:[...a].reverse()).reduce((d,{sequenceId:h,sequenceIndex:u,duration:f=Ry,delay:g,overlay:v},m)=>{const x=pk(u,h,m),b=Fhe({duration:f,delay:g,overlay:v})+d;return c[x]={play:e,pause:!e,delay:(g||0)+d,controlled:!0},b},0),s(c)},[e]),fn.createElement(eM.Provider,{value:{animationStates:r,register:o}},n)}var zhe=e=>(e||0)*1e3;function N8e(e){const{play:t,children:n,render:r,start:s,end:i,complete:o="",onComplete:a,delay:c=0,duration:d=Ry,easeType:h=AR,sequenceId:u,sequenceIndex:f}=e,g=fn.useRef(),[v,m]=fn.useState(s||{}),{register:x,animationStates:y={}}=fn.useContext(eM),b=pk(f,u);return fn.useEffect(()=>{(!FC(f)&&f>=0||u)&&x(e)},[]),fn.useEffect(()=>{const w=y[b]||{};return m({...t||w.play?i:s,transition:`${VW} ${d}s ${h} ${w.delay||c}s`}),t&&(o||a)&&(g.current=setTimeout(()=>{o&&m(o),a&&a()},zhe((w.delay||c)+d))),()=>g.current&&clearTimeout(g.current)},[b,y,t,d,h,c,a,s,i,o]),r?r({style:v}):fn.createElement("div",{style:v},n)}var T8e=e=>e?e.replace(/[A-Z]/g,t=>`-${t.toLowerCase()}`):"";const k8e=e=>{const t=e.length;return e.reduce((n,r,s)=>{const i=parseFloat((100/(t-1)).toFixed(2))*s;if(typeof r=="string")return`${n} ${i}% {${r}}`;const o=Object.keys(r);if(o.length&&isNaN(+o[0])){const a=o.reduce((c,d)=>`${c} ${T8e(d)}: ${r[d]};`,"");return`${n} ${i}% {${a}}`}return`${n} ${o[0]}% {${r[o[0]]}}`},"")};function D8e({keyframes:e,animationName:t}){return`@keyframes ${t} {${k8e(e)}}`}function xx({keyframes:e,animationName:t}){var n,r,s,i;let o=document.querySelector("style[data-id=rsi]");o||(o=document.createElement("style"),o.setAttribute("data-id","rsi"),document.head.appendChild(o));const a=(s=(r=(n=o.sheet)===null||n===void 0?void 0:n.cssRules)===null||r===void 0?void 0:r.length)!==null&&s!==void 0?s:0;try{(i=o.sheet)===null||i===void 0||i.insertRule(D8e({keyframes:e,animationName:t}),a)}catch(c){console.error("react simple animate, error found during insert style ",c)}return{styleTag:o,index:a}}var _x=(e,t)=>{if(!e)return;const n=Object.values(e.cssRules).findIndex(({name:r})=>r===t);n>=0&&e.deleteRule(n)},wx=()=>`RSI-${Math.random().toString(36).substr(2,9)}`,Bhe=e=>e?R8e:$he;function O8e(e){const{children:t,play:n=!1,pause:r=!1,render:s,duration:i=Ry,delay:o=0,easeType:a=AR,direction:c=BW,fillMode:d=UW,iterationCount:h=1,sequenceIndex:u,keyframes:f,sequenceId:g}=e;let v;const m=fn.useRef({forward:"",reverse:""}),x=fn.useRef(!1),y=fn.useRef({forward:null,reverse:null}),b=pk(u,g),{register:w,animationStates:E={}}=fn.useContext(eM),R=E[b]||{},[,T]=fn.useState(!1);fn.useEffect(()=>{const A=y.current,D=m.current;m.current.forward=wx();let O=xx({animationName:m.current.forward,keyframes:f});return y.current.forward=O.styleTag,m.current.reverse=wx(),O=xx({animationName:m.current.reverse,keyframes:f.reverse()}),y.current.reverse=O.styleTag,w(e),n&&T(!0),()=>{var I,$;_x((I=A.forward)===null||I===void 0?void 0:I.sheet,D.forward),_x(($=A.reverse)===null||$===void 0?void 0:$.sheet,D.reverse)}},[]),R.controlled&&!x.current?(v=R.pause,R.pause||(x.current=!0)):v=r;const N={animation:`${i}s ${a} ${R.delay||o}s ${h} ${c} ${d} ${Bhe(v)} ${((R.controlled?R.play:n)?m.current.forward:m.current.reverse)||""}`};return s?s({style:N}):fn.createElement("div",{style:N||{}},t)}function M8e(e){const{start:t,end:n,complete:r,onComplete:s,delay:i=0,duration:o=Ry,easeType:a=AR}=e,c=fn.useMemo(()=>`${VW} ${o}s ${a} ${i}s`,[o,a,i]),[d,h]=fn.useState({isPlaying:!1,style:{...t,transition:c}}),{isPlaying:u,style:f}=d,g=fn.useRef();return fn.useEffect(()=>((s||r)&&u&&(g.current=setTimeout(()=>{s&&s(),r&&h(v=>({...v,style:r}))},zhe(i+o))),()=>g.current&&clearTimeout(g.current)),[d,r,i,o,u,s]),{isPlaying:u,style:f,play:fn.useCallback(v=>{h(m=>({...m,style:{...v?n:t,transition:c},isPlaying:v}))},[n,t,c])}}function I8e(e){const{duration:t=Ry,delay:n=0,easeType:r=AR,direction:s=BW,fillMode:i=UW,iterationCount:o=1,keyframes:a}=e,c=fn.useRef({forward:"",reverse:""}),d=fn.useRef({forward:null,reverse:null}),{register:h}=fn.useContext(eM),[u,f]=fn.useState(null),[g,v]=fn.useState(!1);return fn.useEffect(()=>{const x=d.current,y=c.current;c.current.forward=wx();let b=xx({animationName:c.current.forward,keyframes:a});return d.current.forward=b.styleTag,c.current.reverse=wx(),b=xx({animationName:c.current.reverse,keyframes:a.reverse()}),d.current.reverse=b.styleTag,h(e),()=>{var w,E;_x((w=x.forward)===null||w===void 0?void 0:w.sheet,y.forward),_x((E=x.reverse)===null||E===void 0?void 0:E.sheet,y.reverse)}},[]),{style:{animation:`${t}s ${r} ${n}s ${o} ${s} ${i} ${Bhe(g)} ${u===null?"":u?c.current.forward:c.current.reverse}`},play:f,pause:v,isPlaying:!!u}}function L8e(e){return Array.from({length:e},()=>null)}function j8e(e){const{sequences:t=[]}=e,n=L8e(t.length).map((h,u)=>e.sequences[u].start),[r,s]=fn.useState(n),[i,o]=fn.useState(!1),a=fn.useRef([]),c=fn.useRef([]);fn.useEffect(()=>{t.forEach(({keyframes:f},g)=>{if(!Array.isArray(f))return;a.current[g]||(a.current[g]={},c.current[g]={}),a.current[g].forward=wx();let v=xx({animationName:a.current[g].forward,keyframes:f});c.current[g].forward=v.styleTag,a.current[g].reverse=wx(),v=xx({animationName:a.current[g].reverse,keyframes:f.reverse()}),c.current[g].reverse=v.styleTag});const h=c.current,u=a.current;return()=>Object.values(u).forEach(({forward:f,reverse:g},v)=>{var m,x;_x((m=h[v].forward)===null||m===void 0?void 0:m.sheet,f),_x((x=h[v].reverse)===null||x===void 0?void 0:x.sheet,g)})},[]);const d=fn.useCallback(h=>{let u=0;const f=h?a.current:[...a.current].reverse(),g=(h?t:[...t].reverse()).map((v,m)=>{const{duration:x=Ry,delay:y=0,overlay:b,keyframes:w,iterationCount:E=1,easeType:R=AR,direction:T=BW,fillMode:N=UW,end:A={},start:D={}}=v,O=m===0?y:u,I=`${VW} ${x}s ${R} ${O}s`;return u=Fhe({duration:x,delay:y,overlay:b})+u,w?{animation:`${x}s ${R} ${O}s ${E} ${T} ${N} ${$he} ${h?f[m].forward:f[m].reverse}`}:{...h?A:D,transition:I}});s(h?g:[...g].reverse()),o(h)},[]);return{styles:r,play:d,isPlaying:i}}var Uhe=Ay.Animate=N8e;Ay.AnimateGroup=P8e;Ay.AnimateKeyframes=O8e;Ay.useAnimate=M8e;Ay.useAnimateGroup=j8e;Ay.useAnimateKeyframes=I8e;function $8e(e){if(e.sheet)return e.sheet;for(var t=0;t<document.styleSheets.length;t++)if(document.styleSheets[t].ownerNode===e)return document.styleSheets[t]}function F8e(e){var t=document.createElement("style");return t.setAttribute("data-emotion",e.key),e.nonce!==void 0&&t.setAttribute("nonce",e.nonce),t.appendChild(document.createTextNode("")),t.setAttribute("data-s",""),t}var z8e=function(){function e(n){var r=this;this._insertTag=function(s){var i;r.tags.length===0?r.insertionPoint?i=r.insertionPoint.nextSibling:r.prepend?i=r.container.firstChild:i=r.before:i=r.tags[r.tags.length-1].nextSibling,r.container.insertBefore(s,i),r.tags.push(s)},this.isSpeedy=n.speedy===void 0?!0:n.speedy,this.tags=[],this.ctr=0,this.nonce=n.nonce,this.key=n.key,this.container=n.container,this.prepend=n.prepend,this.insertionPoint=n.insertionPoint,this.before=null}var t=e.prototype;return t.hydrate=function(r){r.forEach(this._insertTag)},t.insert=function(r){this.ctr%(this.isSpeedy?65e3:1)===0&&this._insertTag(F8e(this));var s=this.tags[this.tags.length-1];if(this.isSpeedy){var i=$8e(s);try{i.insertRule(r,i.cssRules.length)}catch{}}else s.appendChild(document.createTextNode(r));this.ctr++},t.flush=function(){this.tags.forEach(function(r){var s;return(s=r.parentNode)==null?void 0:s.removeChild(r)}),this.tags=[],this.ctr=0},e}(),Ki="-ms-",mk="-moz-",Fn="-webkit-",Vhe="comm",HW="rule",WW="decl",B8e="@import",Hhe="@keyframes",U8e="@layer",V8e=Math.abs,tM=String.fromCharCode,H8e=Object.assign;function W8e(e,t){return Oi(e,0)^45?(((t<<2^Oi(e,0))<<2^Oi(e,1))<<2^Oi(e,2))<<2^Oi(e,3):0}function Whe(e){return e.trim()}function q8e(e,t){return(e=t.exec(e))?e[0]:e}function Bn(e,t,n){return e.replace(t,n)}function mV(e,t){return e.indexOf(t)}function Oi(e,t){return e.charCodeAt(t)|0}function zC(e,t,n){return e.slice(t,n)}function du(e){return e.length}function qW(e){return e.length}function IP(e,t){return t.push(e),e}function G8e(e,t){return e.map(t).join("")}var nM=1,Sx=1,qhe=0,aa=0,ks=0,r_="";function rM(e,t,n,r,s,i,o){return{value:e,root:t,parent:n,type:r,props:s,children:i,line:nM,column:Sx,length:o,return:""}}function JS(e,t){return H8e(rM("",null,null,"",null,null,0),e,{length:-e.length},t)}function K8e(){return ks}function Y8e(){return ks=aa>0?Oi(r_,--aa):0,Sx--,ks===10&&(Sx=1,nM--),ks}function Ya(){return ks=aa<qhe?Oi(r_,aa++):0,Sx++,ks===10&&(Sx=1,nM++),ks}function Cu(){return Oi(r_,aa)}function MN(){return aa}function RR(e,t){return zC(r_,e,t)}function BC(e){switch(e){case 0:case 9:case 10:case 13:case 32:return 5;case 33:case 43:case 44:case 47:case 62:case 64:case 126:case 59:case 123:case 125:return 4;case 58:return 3;case 34:case 39:case 40:case 91:return 2;case 41:case 93:return 1}return 0}function Ghe(e){return nM=Sx=1,qhe=du(r_=e),aa=0,[]}function Khe(e){return r_="",e}function IN(e){return Whe(RR(aa-1,gV(e===91?e+2:e===40?e+1:e)))}function X8e(e){for(;(ks=Cu())&&ks<33;)Ya();return BC(e)>2||BC(ks)>3?"":" "}function Q8e(e,t){for(;--t&&Ya()&&!(ks<48||ks>102||ks>57&&ks<65||ks>70&&ks<97););return RR(e,MN()+(t<6&&Cu()==32&&Ya()==32))}function gV(e){for(;Ya();)switch(ks){case e:return aa;case 34:case 39:e!==34&&e!==39&&gV(ks);break;case 40:e===41&&gV(e);break;case 92:Ya();break}return aa}function Z8e(e,t){for(;Ya()&&e+ks!==57;)if(e+ks===84&&Cu()===47)break;return"/*"+RR(t,aa-1)+"*"+tM(e===47?e:Ya())}function J8e(e){for(;!BC(Cu());)Ya();return RR(e,aa)}function eWe(e){return Khe(LN("",null,null,null,[""],e=Ghe(e),0,[0],e))}function LN(e,t,n,r,s,i,o,a,c){for(var d=0,h=0,u=o,f=0,g=0,v=0,m=1,x=1,y=1,b=0,w="",E=s,R=i,T=r,N=w;x;)switch(v=b,b=Ya()){case 40:if(v!=108&&Oi(N,u-1)==58){mV(N+=Bn(IN(b),"&","&\f"),"&\f")!=-1&&(y=-1);break}case 34:case 39:case 91:N+=IN(b);break;case 9:case 10:case 13:case 32:N+=X8e(v);break;case 92:N+=Q8e(MN()-1,7);continue;case 47:switch(Cu()){case 42:case 47:IP(tWe(Z8e(Ya(),MN()),t,n),c);break;default:N+="/"}break;case 123*m:a[d++]=du(N)*y;case 125*m:case 59:case 0:switch(b){case 0:case 125:x=0;case 59+h:y==-1&&(N=Bn(N,/\f/g,"")),g>0&&du(N)-u&&IP(g>32?RY(N+";",r,n,u-1):RY(Bn(N," ","")+";",r,n,u-2),c);break;case 59:N+=";";default:if(IP(T=AY(N,t,n,d,h,s,a,w,E=[],R=[],u),i),b===123)if(h===0)LN(N,t,T,T,E,i,u,a,R);else switch(f===99&&Oi(N,3)===110?100:f){case 100:case 108:case 109:case 115:LN(e,T,T,r&&IP(AY(e,T,T,0,0,s,a,w,s,E=[],u),R),s,R,u,a,r?E:R);break;default:LN(N,T,T,T,[""],R,0,a,R)}}d=h=g=0,m=y=1,w=N="",u=o;break;case 58:u=1+du(N),g=v;default:if(m<1){if(b==123)--m;else if(b==125&&m++==0&&Y8e()==125)continue}switch(N+=tM(b),b*m){case 38:y=h>0?1:(N+="\f",-1);break;case 44:a[d++]=(du(N)-1)*y,y=1;break;case 64:Cu()===45&&(N+=IN(Ya())),f=Cu(),h=u=du(w=N+=J8e(MN())),b++;break;case 45:v===45&&du(N)==2&&(m=0)}}return i}function AY(e,t,n,r,s,i,o,a,c,d,h){for(var u=s-1,f=s===0?i:[""],g=qW(f),v=0,m=0,x=0;v<r;++v)for(var y=0,b=zC(e,u+1,u=V8e(m=o[v])),w=e;y<g;++y)(w=Whe(m>0?f[y]+" "+b:Bn(b,/&\f/g,f[y])))&&(c[x++]=w);return rM(e,t,n,s===0?HW:a,c,d,h)}function tWe(e,t,n){return rM(e,t,n,Vhe,tM(K8e()),zC(e,2,-2),0)}function RY(e,t,n,r){return rM(e,t,n,WW,zC(e,0,r),zC(e,r+1,-1),r)}function Ub(e,t){for(var n="",r=qW(e),s=0;s<r;s++)n+=t(e[s],s,e,t)||"";return n}function nWe(e,t,n,r){switch(e.type){case U8e:if(e.children.length)break;case B8e:case WW:return e.return=e.return||e.value;case Vhe:return"";case Hhe:return e.return=e.value+"{"+Ub(e.children,r)+"}";case HW:e.value=e.props.join(",")}return du(n=Ub(e.children,r))?e.return=e.value+"{"+n+"}":""}function rWe(e){var t=qW(e);return function(n,r,s,i){for(var o="",a=0;a<t;a++)o+=e[a](n,r,s,i)||"";return o}}function sWe(e){return function(t){t.root||(t=t.return)&&e(t)}}function Yhe(e){var t=Object.create(null);return function(n){return t[n]===void 0&&(t[n]=e(n)),t[n]}}var iWe=function(t,n,r){for(var s=0,i=0;s=i,i=Cu(),s===38&&i===12&&(n[r]=1),!BC(i);)Ya();return RR(t,aa)},oWe=function(t,n){var r=-1,s=44;do switch(BC(s)){case 0:s===38&&Cu()===12&&(n[r]=1),t[r]+=iWe(aa-1,n,r);break;case 2:t[r]+=IN(s);break;case 4:if(s===44){t[++r]=Cu()===58?"&\f":"",n[r]=t[r].length;break}default:t[r]+=tM(s)}while(s=Ya());return t},aWe=function(t,n){return Khe(oWe(Ghe(t),n))},PY=new WeakMap,lWe=function(t){if(!(t.type!=="rule"||!t.parent||t.length<1)){for(var n=t.value,r=t.parent,s=t.column===r.column&&t.line===r.line;r.type!=="rule";)if(r=r.parent,!r)return;if(!(t.props.length===1&&n.charCodeAt(0)!==58&&!PY.get(r))&&!s){PY.set(t,!0);for(var i=[],o=aWe(n,i),a=r.props,c=0,d=0;c<o.length;c++)for(var h=0;h<a.length;h++,d++)t.props[d]=i[c]?o[c].replace(/&\f/g,a[h]):a[h]+" "+o[c]}}},cWe=function(t){if(t.type==="decl"){var n=t.value;n.charCodeAt(0)===108&&n.charCodeAt(2)===98&&(t.return="",t.value="")}};function Xhe(e,t){switch(W8e(e,t)){case 5103:return Fn+"print-"+e+e;case 5737:case 4201:case 3177:case 3433:case 1641:case 4457:case 2921:case 5572:case 6356:case 5844:case 3191:case 6645:case 3005:case 6391:case 5879:case 5623:case 6135:case 4599:case 4855:case 4215:case 6389:case 5109:case 5365:case 5621:case 3829:return Fn+e+e;case 5349:case 4246:case 4810:case 6968:case 2756:return Fn+e+mk+e+Ki+e+e;case 6828:case 4268:return Fn+e+Ki+e+e;case 6165:return Fn+e+Ki+"flex-"+e+e;case 5187:return Fn+e+Bn(e,/(\w+).+(:[^]+)/,Fn+"box-$1$2"+Ki+"flex-$1$2")+e;case 5443:return Fn+e+Ki+"flex-item-"+Bn(e,/flex-|-self/,"")+e;case 4675:return Fn+e+Ki+"flex-line-pack"+Bn(e,/align-content|flex-|-self/,"")+e;case 5548:return Fn+e+Ki+Bn(e,"shrink","negative")+e;case 5292:return Fn+e+Ki+Bn(e,"basis","preferred-size")+e;case 6060:return Fn+"box-"+Bn(e,"-grow","")+Fn+e+Ki+Bn(e,"grow","positive")+e;case 4554:return Fn+Bn(e,/([^-])(transform)/g,"$1"+Fn+"$2")+e;case 6187:return Bn(Bn(Bn(e,/(zoom-|grab)/,Fn+"$1"),/(image-set)/,Fn+"$1"),e,"")+e;case 5495:case 3959:return Bn(e,/(image-set\([^]*)/,Fn+"$1$`$1");case 4968:return Bn(Bn(e,/(.+:)(flex-)?(.*)/,Fn+"box-pack:$3"+Ki+"flex-pack:$3"),/s.+-b[^;]+/,"justify")+Fn+e+e;case 4095:case 3583:case 4068:case 2532:return Bn(e,/(.+)-inline(.+)/,Fn+"$1$2")+e;case 8116:case 7059:case 5753:case 5535:case 5445:case 5701:case 4933:case 4677:case 5533:case 5789:case 5021:case 4765:if(du(e)-1-t>6)switch(Oi(e,t+1)){case 109:if(Oi(e,t+4)!==45)break;case 102:return Bn(e,/(.+:)(.+)-([^]+)/,"$1"+Fn+"$2-$3$1"+mk+(Oi(e,t+3)==108?"$3":"$2-$3"))+e;case 115:return~mV(e,"stretch")?Xhe(Bn(e,"stretch","fill-available"),t)+e:e}break;case 4949:if(Oi(e,t+1)!==115)break;case 6444:switch(Oi(e,du(e)-3-(~mV(e,"!important")&&10))){case 107:return Bn(e,":",":"+Fn)+e;case 101:return Bn(e,/(.+:)([^;!]+)(;|!.+)?/,"$1"+Fn+(Oi(e,14)===45?"inline-":"")+"box$3$1"+Fn+"$2$3$1"+Ki+"$2box$3")+e}break;case 5936:switch(Oi(e,t+11)){case 114:return Fn+e+Ki+Bn(e,/[svh]\w+-[tblr]{2}/,"tb")+e;case 108:return Fn+e+Ki+Bn(e,/[svh]\w+-[tblr]{2}/,"tb-rl")+e;case 45:return Fn+e+Ki+Bn(e,/[svh]\w+-[tblr]{2}/,"lr")+e}return Fn+e+Ki+e+e}return e}var uWe=function(t,n,r,s){if(t.length>-1&&!t.return)switch(t.type){case WW:t.return=Xhe(t.value,t.length);break;case Hhe:return Ub([JS(t,{value:Bn(t.value,"@","@"+Fn)})],s);case HW:if(t.length)return G8e(t.props,function(i){switch(q8e(i,/(::plac\w+|:read-\w+)/)){case":read-only":case":read-write":return Ub([JS(t,{props:[Bn(i,/:(read-\w+)/,":"+mk+"$1")]})],s);case"::placeholder":return Ub([JS(t,{props:[Bn(i,/:(plac\w+)/,":"+Fn+"input-$1")]}),JS(t,{props:[Bn(i,/:(plac\w+)/,":"+mk+"$1")]}),JS(t,{props:[Bn(i,/:(plac\w+)/,Ki+"input-$1")]})],s)}return""})}},dWe=[uWe],fWe=function(t){var n=t.key;if(n==="css"){var r=document.querySelectorAll("style[data-emotion]:not([data-s])");Array.prototype.forEach.call(r,function(m){var x=m.getAttribute("data-emotion");x.indexOf(" ")!==-1&&(document.head.appendChild(m),m.setAttribute("data-s",""))})}var s=t.stylisPlugins||dWe,i={},o,a=[];o=t.container||document.head,Array.prototype.forEach.call(document.querySelectorAll('style[data-emotion^="'+n+' "]'),function(m){for(var x=m.getAttribute("data-emotion").split(" "),y=1;y<x.length;y++)i[x[y]]=!0;a.push(m)});var c,d=[lWe,cWe];{var h,u=[nWe,sWe(function(m){h.insert(m)})],f=rWe(d.concat(s,u)),g=function(x){return Ub(eWe(x),f)};c=function(x,y,b,w){h=b,g(x?x+"{"+y.styles+"}":y.styles),w&&(v.inserted[y.name]=!0)}}var v={key:n,sheet:new z8e({key:n,container:o,nonce:t.nonce,speedy:t.speedy,prepend:t.prepend,insertionPoint:t.insertionPoint}),nonce:t.nonce,inserted:i,registered:{},insert:c};return v.sheet.hydrate(a),v},hWe=!0;function pWe(e,t,n){var r="";return n.split(" ").forEach(function(s){e[s]!==void 0?t.push(e[s]+";"):s&&(r+=s+" ")}),r}var Qhe=function(t,n,r){var s=t.key+"-"+n.name;(r===!1||hWe===!1)&&t.registered[s]===void 0&&(t.registered[s]=n.styles)},mWe=function(t,n,r){Qhe(t,n,r);var s=t.key+"-"+n.name;if(t.inserted[n.name]===void 0){var i=n;do t.insert(n===i?"."+s:"",i,t.sheet,!0),i=i.next;while(i!==void 0)}};function gWe(e){for(var t=0,n,r=0,s=e.length;s>=4;++r,s-=4)n=e.charCodeAt(r)&255|(e.charCodeAt(++r)&255)<<8|(e.charCodeAt(++r)&255)<<16|(e.charCodeAt(++r)&255)<<24,n=(n&65535)*1540483477+((n>>>16)*59797<<16),n^=n>>>24,t=(n&65535)*1540483477+((n>>>16)*59797<<16)^(t&65535)*1540483477+((t>>>16)*59797<<16);switch(s){case 3:t^=(e.charCodeAt(r+2)&255)<<16;case 2:t^=(e.charCodeAt(r+1)&255)<<8;case 1:t^=e.charCodeAt(r)&255,t=(t&65535)*1540483477+((t>>>16)*59797<<16)}return t^=t>>>13,t=(t&65535)*1540483477+((t>>>16)*59797<<16),((t^t>>>15)>>>0).toString(36)}var vWe={animationIterationCount:1,aspectRatio:1,borderImageOutset:1,borderImageSlice:1,borderImageWidth:1,boxFlex:1,boxFlexGroup:1,boxOrdinalGroup:1,columnCount:1,columns:1,flex:1,flexGrow:1,flexPositive:1,flexShrink:1,flexNegative:1,flexOrder:1,gridRow:1,gridRowEnd:1,gridRowSpan:1,gridRowStart:1,gridColumn:1,gridColumnEnd:1,gridColumnSpan:1,gridColumnStart:1,msGridRow:1,msGridRowSpan:1,msGridColumn:1,msGridColumnSpan:1,fontWeight:1,lineHeight:1,opacity:1,order:1,orphans:1,scale:1,tabSize:1,widows:1,zIndex:1,zoom:1,WebkitLineClamp:1,fillOpacity:1,floodOpacity:1,stopOpacity:1,strokeDasharray:1,strokeDashoffset:1,strokeMiterlimit:1,strokeOpacity:1,strokeWidth:1},yWe=/[A-Z]|^ms/g,bWe=/_EMO_([^_]+?)_([^]*?)_EMO_/g,Zhe=function(t){return t.charCodeAt(1)===45},NY=function(t){return t!=null&&typeof t!="boolean"},_z=Yhe(function(e){return Zhe(e)?e:e.replace(yWe,"-$&").toLowerCase()}),TY=function(t,n){switch(t){case"animation":case"animationName":if(typeof n=="string")return n.replace(bWe,function(r,s,i){return fu={name:s,styles:i,next:fu},s})}return vWe[t]!==1&&!Zhe(t)&&typeof n=="number"&&n!==0?n+"px":n};function UC(e,t,n){if(n==null)return"";var r=n;if(r.__emotion_styles!==void 0)return r;switch(typeof n){case"boolean":return"";case"object":{var s=n;if(s.anim===1)return fu={name:s.name,styles:s.styles,next:fu},s.name;var i=n;if(i.styles!==void 0){var o=i.next;if(o!==void 0)for(;o!==void 0;)fu={name:o.name,styles:o.styles,next:fu},o=o.next;var a=i.styles+";";return a}return xWe(e,t,n)}case"function":{if(e!==void 0){var c=fu,d=n(e);return fu=c,UC(e,t,d)}break}}var h=n;if(t==null)return h;var u=t[h];return u!==void 0?u:h}function xWe(e,t,n){var r="";if(Array.isArray(n))for(var s=0;s<n.length;s++)r+=UC(e,t,n[s])+";";else for(var i in n){var o=n[i];if(typeof o!="object"){var a=o;t!=null&&t[a]!==void 0?r+=i+"{"+t[a]+"}":NY(a)&&(r+=_z(i)+":"+TY(i,a)+";")}else if(Array.isArray(o)&&typeof o[0]=="string"&&(t==null||t[o[0]]===void 0))for(var c=0;c<o.length;c++)NY(o[c])&&(r+=_z(i)+":"+TY(i,o[c])+";");else{var d=UC(e,t,o);switch(i){case"animation":case"animationName":{r+=_z(i)+":"+d+";";break}default:r+=i+"{"+d+"}"}}}return r}var kY=/label:\s*([^\s;{]+)\s*(;|$)/g,fu;function _We(e,t,n){if(e.length===1&&typeof e[0]=="object"&&e[0]!==null&&e[0].styles!==void 0)return e[0];var r=!0,s="";fu=void 0;var i=e[0];if(i==null||i.raw===void 0)r=!1,s+=UC(n,t,i);else{var o=i;s+=o[0]}for(var a=1;a<e.length;a++)if(s+=UC(n,t,e[a]),r){var c=i;s+=c[a]}kY.lastIndex=0;for(var d="",h;(h=kY.exec(s))!==null;)d+="-"+h[1];var u=gWe(s)+d;return{name:u,styles:s,next:fu}}var wWe=function(t){return t()},SWe=Tv.useInsertionEffect?Tv.useInsertionEffect:!1,CWe=SWe||wWe,Jhe=C.createContext(typeof HTMLElement<"u"?fWe({key:"css"}):null);Jhe.Provider;var EWe=function(t){return C.forwardRef(function(n,r){var s=C.useContext(Jhe);return t(n,s,r)})},AWe=C.createContext({}),RWe=/^((children|dangerouslySetInnerHTML|key|ref|autoFocus|defaultValue|defaultChecked|innerHTML|suppressContentEditableWarning|suppressHydrationWarning|valueLink|abbr|accept|acceptCharset|accessKey|action|allow|allowUserMedia|allowPaymentRequest|allowFullScreen|allowTransparency|alt|async|autoComplete|autoPlay|capture|cellPadding|cellSpacing|challenge|charSet|checked|cite|classID|className|cols|colSpan|content|contentEditable|contextMenu|controls|controlsList|coords|crossOrigin|data|dateTime|decoding|default|defer|dir|disabled|disablePictureInPicture|disableRemotePlayback|download|draggable|encType|enterKeyHint|fetchpriority|fetchPriority|form|formAction|formEncType|formMethod|formNoValidate|formTarget|frameBorder|headers|height|hidden|high|href|hrefLang|htmlFor|httpEquiv|id|inputMode|integrity|is|keyParams|keyType|kind|label|lang|list|loading|loop|low|marginHeight|marginWidth|max|maxLength|media|mediaGroup|method|min|minLength|multiple|muted|name|nonce|noValidate|open|optimum|pattern|placeholder|playsInline|poster|preload|profile|radioGroup|readOnly|referrerPolicy|rel|required|reversed|role|rows|rowSpan|sandbox|scope|scoped|scrolling|seamless|selected|shape|size|sizes|slot|span|spellCheck|src|srcDoc|srcLang|srcSet|start|step|style|summary|tabIndex|target|title|translate|type|useMap|value|width|wmode|wrap|about|datatype|inlist|prefix|property|resource|typeof|vocab|autoCapitalize|autoCorrect|autoSave|color|incremental|fallback|inert|itemProp|itemScope|itemType|itemID|itemRef|on|option|results|security|unselectable|accentHeight|accumulate|additive|alignmentBaseline|allowReorder|alphabetic|amplitude|arabicForm|ascent|attributeName|attributeType|autoReverse|azimuth|baseFrequency|baselineShift|baseProfile|bbox|begin|bias|by|calcMode|capHeight|clip|clipPathUnits|clipPath|clipRule|colorInterpolation|colorInterpolationFilters|colorProfile|colorRendering|contentScriptType|contentStyleType|cursor|cx|cy|d|decelerate|descent|diffuseConstant|direction|display|divisor|dominantBaseline|dur|dx|dy|edgeMode|elevation|enableBackground|end|exponent|externalResourcesRequired|fill|fillOpacity|fillRule|filter|filterRes|filterUnits|floodColor|floodOpacity|focusable|fontFamily|fontSize|fontSizeAdjust|fontStretch|fontStyle|fontVariant|fontWeight|format|from|fr|fx|fy|g1|g2|glyphName|glyphOrientationHorizontal|glyphOrientationVertical|glyphRef|gradientTransform|gradientUnits|hanging|horizAdvX|horizOriginX|ideographic|imageRendering|in|in2|intercept|k|k1|k2|k3|k4|kernelMatrix|kernelUnitLength|kerning|keyPoints|keySplines|keyTimes|lengthAdjust|letterSpacing|lightingColor|limitingConeAngle|local|markerEnd|markerMid|markerStart|markerHeight|markerUnits|markerWidth|mask|maskContentUnits|maskUnits|mathematical|mode|numOctaves|offset|opacity|operator|order|orient|orientation|origin|overflow|overlinePosition|overlineThickness|panose1|paintOrder|pathLength|patternContentUnits|patternTransform|patternUnits|pointerEvents|points|pointsAtX|pointsAtY|pointsAtZ|preserveAlpha|preserveAspectRatio|primitiveUnits|r|radius|refX|refY|renderingIntent|repeatCount|repeatDur|requiredExtensions|requiredFeatures|restart|result|rotate|rx|ry|scale|seed|shapeRendering|slope|spacing|specularConstant|specularExponent|speed|spreadMethod|startOffset|stdDeviation|stemh|stemv|stitchTiles|stopColor|stopOpacity|strikethroughPosition|strikethroughThickness|string|stroke|strokeDasharray|strokeDashoffset|strokeLinecap|strokeLinejoin|strokeMiterlimit|strokeOpacity|strokeWidth|surfaceScale|systemLanguage|tableValues|targetX|targetY|textAnchor|textDecoration|textRendering|textLength|to|transform|u1|u2|underlinePosition|underlineThickness|unicode|unicodeBidi|unicodeRange|unitsPerEm|vAlphabetic|vHanging|vIdeographic|vMathematical|values|vectorEffect|version|vertAdvY|vertOriginX|vertOriginY|viewBox|viewTarget|visibility|widths|wordSpacing|writingMode|x|xHeight|x1|x2|xChannelSelector|xlinkActuate|xlinkArcrole|xlinkHref|xlinkRole|xlinkShow|xlinkTitle|xlinkType|xmlBase|xmlns|xmlnsXlink|xmlLang|xmlSpace|y|y1|y2|yChannelSelector|z|zoomAndPan|for|class|autofocus)|(([Dd][Aa][Tt][Aa]|[Aa][Rr][Ii][Aa]|x)-.*))$/,PWe=Yhe(function(e){return RWe.test(e)||e.charCodeAt(0)===111&&e.charCodeAt(1)===110&&e.charCodeAt(2)<91}),NWe=PWe,TWe=function(t){return t!=="theme"},DY=function(t){return typeof t=="string"&&t.charCodeAt(0)>96?NWe:TWe},OY=function(t,n,r){var s;if(n){var i=n.shouldForwardProp;s=t.__emotion_forwardProp&&i?function(o){return t.__emotion_forwardProp(o)&&i(o)}:i}return typeof s!="function"&&r&&(s=t.__emotion_forwardProp),s},kWe=function(t){var n=t.cache,r=t.serialized,s=t.isStringTag;return Qhe(n,r,s),CWe(function(){return mWe(n,r,s)}),null},DWe=function e(t,n){var r=t.__emotion_real===t,s=r&&t.__emotion_base||t,i,o;n!==void 0&&(i=n.label,o=n.target);var a=OY(t,n,r),c=a||DY(s),d=!c("as");return function(){var h=arguments,u=r&&t.__emotion_styles!==void 0?t.__emotion_styles.slice(0):[];if(i!==void 0&&u.push("label:"+i+";"),h[0]==null||h[0].raw===void 0)u.push.apply(u,h);else{var f=h[0];u.push(f[0]);for(var g=h.length,v=1;v<g;v++)u.push(h[v],f[v])}var m=EWe(function(x,y,b){var w=d&&x.as||s,E="",R=[],T=x;if(x.theme==null){T={};for(var N in x)T[N]=x[N];T.theme=C.useContext(AWe)}typeof x.className=="string"?E=pWe(y.registered,R,x.className):x.className!=null&&(E=x.className+" ");var A=_We(u.concat(R),y.registered,T);E+=y.key+"-"+A.name,o!==void 0&&(E+=" "+o);var D=d&&a===void 0?DY(w):c,O={};for(var I in x)d&&I==="as"||D(I)&&(O[I]=x[I]);return O.className=E,b&&(O.ref=b),C.createElement(C.Fragment,null,C.createElement(kWe,{cache:y,serialized:A,isStringTag:typeof w=="string"}),C.createElement(w,O))});return m.displayName=i!==void 0?i:"Styled("+(typeof s=="string"?s:s.displayName||s.name||"Component")+")",m.defaultProps=t.defaultProps,m.__emotion_real=m,m.__emotion_base=s,m.__emotion_styles=u,m.__emotion_forwardProp=a,Object.defineProperty(m,"toString",{value:function(){return"."+o}}),m.withComponent=function(x,y){var b=e(x,UB({},n,y,{shouldForwardProp:OY(m,y,!0)}));return b.apply(void 0,u)},m}},OWe=["a","abbr","address","area","article","aside","audio","b","base","bdi","bdo","big","blockquote","body","br","button","canvas","caption","cite","code","col","colgroup","data","datalist","dd","del","details","dfn","dialog","div","dl","dt","em","embed","fieldset","figcaption","figure","footer","form","h1","h2","h3","h4","h5","h6","head","header","hgroup","hr","html","i","iframe","img","input","ins","kbd","keygen","label","legend","li","link","main","map","mark","marquee","menu","menuitem","meta","meter","nav","noscript","object","ol","optgroup","option","output","p","param","picture","pre","progress","q","rp","rt","ruby","s","samp","script","section","select","small","source","span","strong","style","sub","summary","sup","table","tbody","td","textarea","tfoot","th","thead","time","title","tr","track","u","ul","var","video","wbr","circle","clipPath","defs","ellipse","foreignObject","g","image","line","linearGradient","mask","path","pattern","polygon","polyline","radialGradient","rect","stop","svg","text","tspan"],Cx=DWe.bind(null);OWe.forEach(function(e){Cx[e]=Cx(e)});function MWe(e){return e===void 0}var IWe=MWe;const MY=Al(IWe);function LWe(e){var t=C.useRef(e),n=C.useRef(0);return Pv(e,t.current)||(t.current=e,n.current+=1),C.useMemo(function(){return t.current},[n.current])}function jWe(e,t){return C.useEffect(e,LWe(t))}var PR=e=>e.type==="checkbox",vg=e=>e instanceof Date,Ao=e=>e==null;const epe=e=>typeof e=="object";var Ss=e=>!Ao(e)&&!Array.isArray(e)&&epe(e)&&!vg(e),$We=e=>Ss(e)&&e.target?PR(e.target)?e.target.checked:e.target.value:e,FWe=e=>e.substring(0,e.search(/\.\d+(\.|$)/))||e,zWe=(e,t)=>e.has(FWe(t)),BWe=e=>{const t=e.constructor&&e.constructor.prototype;return Ss(t)&&t.hasOwnProperty("isPrototypeOf")},GW=typeof window<"u"&&typeof window.HTMLElement<"u"&&typeof document<"u";function Yi(e){let t;const n=Array.isArray(e),r=typeof FileList<"u"?e instanceof FileList:!1;if(e instanceof Date)t=new Date(e);else if(e instanceof Set)t=new Set(e);else if(!(GW&&(e instanceof Blob||r))&&(n||Ss(e)))if(t=n?[]:{},!n&&!BWe(e))t=e;else for(const s in e)e.hasOwnProperty(s)&&(t[s]=Yi(e[s]));else return e;return t}var sM=e=>Array.isArray(e)?e.filter(Boolean):[],Ts=e=>e===void 0,it=(e,t,n)=>{if(!t||!Ss(e))return n;const r=sM(t.split(/[,[\].]+?/)).reduce((s,i)=>Ao(s)?s:s[i],e);return Ts(r)||r===e?Ts(e[t])?n:e[t]:r},Hc=e=>typeof e=="boolean",KW=e=>/^\w*$/.test(e),tpe=e=>sM(e.replace(/["|']|\]/g,"").split(/\.|\[/)),zr=(e,t,n)=>{let r=-1;const s=KW(t)?[t]:tpe(t),i=s.length,o=i-1;for(;++r<i;){const a=s[r];let c=n;if(r!==o){const d=e[a];c=Ss(d)||Array.isArray(d)?d:isNaN(+s[r+1])?{}:[]}if(a==="__proto__"||a==="constructor"||a==="prototype")return;e[a]=c,e=e[a]}};const IY={BLUR:"blur",FOCUS_OUT:"focusout"},vc={onBlur:"onBlur",onChange:"onChange",onSubmit:"onSubmit",onTouched:"onTouched",all:"all"},Md={max:"max",min:"min",maxLength:"maxLength",minLength:"minLength",pattern:"pattern",required:"required",validate:"validate"},UWe=fe.createContext(null),YW=()=>fe.useContext(UWe);var npe=(e,t,n,r=!0)=>{const s={defaultValues:t._defaultValues};for(const i in e)Object.defineProperty(s,i,{get:()=>{const o=i;return t._proxyFormState[o]!==vc.all&&(t._proxyFormState[o]=!r||vc.all),n&&(n[o]=!0),e[o]}});return s};function XW(e){const t=YW(),{control:n=t.control,disabled:r,name:s,exact:i}=e||{},[o,a]=fe.useState(n._formState),c=fe.useRef({isDirty:!1,isLoading:!1,dirtyFields:!1,touchedFields:!1,validatingFields:!1,isValidating:!1,isValid:!1,errors:!1}),d=fe.useRef(s);return d.current=s,fe.useEffect(()=>n._subscribe({name:d.current,formState:c.current,exact:i,callback:h=>{!r&&a({...n._formState,...h})}}),[n,r,i]),fe.useEffect(()=>{c.current.isValid&&n._setValid(!0)},[n]),fe.useMemo(()=>npe(o,n,c.current,!1),[o,n])}var xu=e=>typeof e=="string",rpe=(e,t,n,r,s)=>xu(e)?(r&&t.watch.add(e),it(n,e,s)):Array.isArray(e)?e.map(i=>(r&&t.watch.add(i),it(n,i))):(r&&(t.watchAll=!0),n);function spe(e){const t=YW(),{control:n=t.control,name:r,defaultValue:s,disabled:i,exact:o}=e||{},a=fe.useRef(r),c=fe.useRef(s);a.current=r,fe.useEffect(()=>n._subscribe({name:a.current,formState:{values:!0},exact:o,callback:u=>!i&&h(rpe(a.current,n._names,u.values||n._formValues,!1,c.current))}),[n,i,o]);const[d,h]=fe.useState(n._getWatch(r,s));return fe.useEffect(()=>n._removeUnmounted()),d}var VWe=(e,t,n,r,s)=>t?{...n[e],types:{...n[e]&&n[e].types?n[e].types:{},[r]:s||!0}}:{},X1=e=>Array.isArray(e)?e:[e],LY=()=>{let e=[];return{get observers(){return e},next:s=>{for(const i of e)i.next&&i.next(s)},subscribe:s=>(e.push(s),{unsubscribe:()=>{e=e.filter(i=>i!==s)}}),unsubscribe:()=>{e=[]}}},vV=e=>Ao(e)||!epe(e);function bh(e,t){if(vV(e)||vV(t))return e===t;if(vg(e)&&vg(t))return e.getTime()===t.getTime();const n=Object.keys(e),r=Object.keys(t);if(n.length!==r.length)return!1;for(const s of n){const i=e[s];if(!r.includes(s))return!1;if(s!=="ref"){const o=t[s];if(vg(i)&&vg(o)||Ss(i)&&Ss(o)||Array.isArray(i)&&Array.isArray(o)?!bh(i,o):i!==o)return!1}}return!0}var wo=e=>Ss(e)&&!Object.keys(e).length,QW=e=>e.type==="file",yc=e=>typeof e=="function",gk=e=>{if(!GW)return!1;const t=e?e.ownerDocument:0;return e instanceof(t&&t.defaultView?t.defaultView.HTMLElement:HTMLElement)},ipe=e=>e.type==="select-multiple",ZW=e=>e.type==="radio",HWe=e=>ZW(e)||PR(e),wz=e=>gk(e)&&e.isConnected;function WWe(e,t){const n=t.slice(0,-1).length;let r=0;for(;r<n;)e=Ts(e)?r++:e[t[r++]];return e}function qWe(e){for(const t in e)if(e.hasOwnProperty(t)&&!Ts(e[t]))return!1;return!0}function Hs(e,t){const n=Array.isArray(t)?t:KW(t)?[t]:tpe(t),r=n.length===1?e:WWe(e,n),s=n.length-1,i=n[s];return r&&delete r[i],s!==0&&(Ss(r)&&wo(r)||Array.isArray(r)&&qWe(r))&&Hs(e,n.slice(0,-1)),e}var ope=e=>{for(const t in e)if(yc(e[t]))return!0;return!1};function vk(e,t={}){const n=Array.isArray(e);if(Ss(e)||n)for(const r in e)Array.isArray(e[r])||Ss(e[r])&&!ope(e[r])?(t[r]=Array.isArray(e[r])?[]:{},vk(e[r],t[r])):Ao(e[r])||(t[r]=!0);return t}function ape(e,t,n){const r=Array.isArray(e);if(Ss(e)||r)for(const s in e)Array.isArray(e[s])||Ss(e[s])&&!ope(e[s])?Ts(t)||vV(n[s])?n[s]=Array.isArray(e[s])?vk(e[s],[]):{...vk(e[s])}:ape(e[s],Ao(t)?{}:t[s],n[s]):n[s]=!bh(e[s],t[s]);return n}var e1=(e,t)=>ape(e,t,vk(t));const jY={value:!1,isValid:!1},$Y={value:!0,isValid:!0};var lpe=e=>{if(Array.isArray(e)){if(e.length>1){const t=e.filter(n=>n&&n.checked&&!n.disabled).map(n=>n.value);return{value:t,isValid:!!t.length}}return e[0].checked&&!e[0].disabled?e[0].attributes&&!Ts(e[0].attributes.value)?Ts(e[0].value)||e[0].value===""?$Y:{value:e[0].value,isValid:!0}:$Y:jY}return jY},cpe=(e,{valueAsNumber:t,valueAsDate:n,setValueAs:r})=>Ts(e)?e:t?e===""?NaN:e&&+e:n&&xu(e)?new Date(e):r?r(e):e;const FY={isValid:!1,value:null};var upe=e=>Array.isArray(e)?e.reduce((t,n)=>n&&n.checked&&!n.disabled?{isValid:!0,value:n.value}:t,FY):FY;function zY(e){const t=e.ref;return QW(t)?t.files:ZW(t)?upe(e.refs).value:ipe(t)?[...t.selectedOptions].map(({value:n})=>n):PR(t)?lpe(e.refs).value:cpe(Ts(t.value)?e.ref.value:t.value,e)}var GWe=(e,t,n,r)=>{const s={};for(const i of e){const o=it(t,i);o&&zr(s,i,o._f)}return{criteriaMode:n,names:[...e],fields:s,shouldUseNativeValidation:r}},yk=e=>e instanceof RegExp,t1=e=>Ts(e)?e:yk(e)?e.source:Ss(e)?yk(e.value)?e.value.source:e.value:e,BY=e=>({isOnSubmit:!e||e===vc.onSubmit,isOnBlur:e===vc.onBlur,isOnChange:e===vc.onChange,isOnAll:e===vc.all,isOnTouch:e===vc.onTouched});const UY="AsyncFunction";var KWe=e=>!!e&&!!e.validate&&!!(yc(e.validate)&&e.validate.constructor.name===UY||Ss(e.validate)&&Object.values(e.validate).find(t=>t.constructor.name===UY)),YWe=e=>e.mount&&(e.required||e.min||e.max||e.maxLength||e.minLength||e.pattern||e.validate),VY=(e,t,n)=>!n&&(t.watchAll||t.watch.has(e)||[...t.watch].some(r=>e.startsWith(r)&&/^\.\w+/.test(e.slice(r.length))));const Q1=(e,t,n,r)=>{for(const s of n||Object.keys(e)){const i=it(e,s);if(i){const{_f:o,...a}=i;if(o){if(o.refs&&o.refs[0]&&t(o.refs[0],s)&&!r)return!0;if(o.ref&&t(o.ref,o.name)&&!r)return!0;if(Q1(a,t))break}else if(Ss(a)&&Q1(a,t))break}}};function HY(e,t,n){const r=it(e,n);if(r||KW(n))return{error:r,name:n};const s=n.split(".");for(;s.length;){const i=s.join("."),o=it(t,i),a=it(e,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 XWe=(e,t,n,r)=>{n(e);const{name:s,...i}=e;return wo(i)||Object.keys(i).length>=Object.keys(t).length||Object.keys(i).find(o=>t[o]===(!r||vc.all))},QWe=(e,t,n)=>!e||!t||e===t||X1(e).some(r=>r&&(n?r===t:r.startsWith(t)||t.startsWith(r))),ZWe=(e,t,n,r,s)=>s.isOnAll?!1:!n&&s.isOnTouch?!(t||e):(n?r.isOnBlur:s.isOnBlur)?!e:(n?r.isOnChange:s.isOnChange)?e:!0,JWe=(e,t)=>!sM(it(e,t)).length&&Hs(e,t),eqe=(e,t,n)=>{const r=X1(it(e,n));return zr(r,"root",t[n]),zr(e,n,r),e},jN=e=>xu(e);function WY(e,t,n="validate"){if(jN(e)||Array.isArray(e)&&e.every(jN)||Hc(e)&&!e)return{type:n,message:jN(e)?e:"",ref:t}}var Wy=e=>Ss(e)&&!yk(e)?e:{value:e,message:""},qY=async(e,t,n,r,s,i)=>{const{ref:o,refs:a,required:c,maxLength:d,minLength:h,min:u,max:f,pattern:g,validate:v,name:m,valueAsNumber:x,mount:y}=e._f,b=it(n,m);if(!y||t.has(m))return{};const w=a?a[0]:o,E=$=>{s&&w.reportValidity&&(w.setCustomValidity(Hc($)?"":$||""),w.reportValidity())},R={},T=ZW(o),N=PR(o),A=T||N,D=(x||QW(o))&&Ts(o.value)&&Ts(b)||gk(o)&&o.value===""||b===""||Array.isArray(b)&&!b.length,O=VWe.bind(null,m,r,R),I=($,F,B,W=Md.maxLength,Z=Md.minLength)=>{const Y=$?F:B;R[m]={type:$?W:Z,message:Y,ref:o,...O($?W:Z,Y)}};if(i?!Array.isArray(b)||!b.length:c&&(!A&&(D||Ao(b))||Hc(b)&&!b||N&&!lpe(a).isValid||T&&!upe(a).isValid)){const{value:$,message:F}=jN(c)?{value:!!c,message:c}:Wy(c);if($&&(R[m]={type:Md.required,message:F,ref:w,...O(Md.required,F)},!r))return E(F),R}if(!D&&(!Ao(u)||!Ao(f))){let $,F;const B=Wy(f),W=Wy(u);if(!Ao(b)&&!isNaN(b)){const Z=o.valueAsNumber||b&&+b;Ao(B.value)||($=Z>B.value),Ao(W.value)||(F=Z<W.value)}else{const Z=o.valueAsDate||new Date(b),Y=he=>new Date(new Date().toDateString()+" "+he),H=o.type=="time",se=o.type=="week";xu(B.value)&&b&&($=H?Y(b)>Y(B.value):se?b>B.value:Z>new Date(B.value)),xu(W.value)&&b&&(F=H?Y(b)<Y(W.value):se?b<W.value:Z<new Date(W.value))}if(($||F)&&(I(!!$,B.message,W.message,Md.max,Md.min),!r))return E(R[m].message),R}if((d||h)&&!D&&(xu(b)||i&&Array.isArray(b))){const $=Wy(d),F=Wy(h),B=!Ao($.value)&&b.length>+$.value,W=!Ao(F.value)&&b.length<+F.value;if((B||W)&&(I(B,$.message,F.message),!r))return E(R[m].message),R}if(g&&!D&&xu(b)){const{value:$,message:F}=Wy(g);if(yk($)&&!b.match($)&&(R[m]={type:Md.pattern,message:F,ref:o,...O(Md.pattern,F)},!r))return E(F),R}if(v){if(yc(v)){const $=await v(b,n),F=WY($,w);if(F&&(R[m]={...F,...O(Md.validate,F.message)},!r))return E(F.message),R}else if(Ss(v)){let $={};for(const F in v){if(!wo($)&&!r)break;const B=WY(await v[F](b,n),w,F);B&&($={...B,...O(F,B.message)},E(B.message),r&&(R[m]=$))}if(!wo($)&&(R[m]={ref:w,...$},!r))return R}}return E(!0),R};const tqe={mode:vc.onSubmit,reValidateMode:vc.onChange,shouldFocusError:!0};function nqe(e={}){let t={...tqe,...e},n={submitCount:0,isDirty:!1,isLoading:yc(t.defaultValues),isValidating:!1,isSubmitted:!1,isSubmitting:!1,isSubmitSuccessful:!1,isValid:!1,touchedFields:{},dirtyFields:{},validatingFields:{},errors:t.errors||{},disabled:t.disabled||!1};const r={};let s=Ss(t.defaultValues)||Ss(t.values)?Yi(t.values||t.defaultValues)||{}:{},i=t.shouldUnregister?{}:Yi(s),o={action:!1,mount:!1,watch:!1},a={mount:new Set,disabled:new Set,unMount:new Set,array:new Set,watch:new Set},c,d=0;const h={isDirty:!1,dirtyFields:!1,validatingFields:!1,touchedFields:!1,isValidating:!1,isValid:!1,errors:!1};let u={...h};const f={array:LY(),state:LY()},g=BY(t.mode),v=BY(t.reValidateMode),m=t.criteriaMode===vc.all,x=U=>ee=>{clearTimeout(d),d=setTimeout(U,ee)},y=async U=>{if(!t.disabled&&(h.isValid||u.isValid||U)){const ee=t.resolver?wo((await D()).errors):await I(r,!0);ee!==n.isValid&&f.state.next({isValid:ee})}},b=(U,ee)=>{!t.disabled&&(h.isValidating||h.validatingFields||u.isValidating||u.validatingFields)&&((U||Array.from(a.mount)).forEach(ie=>{ie&&(ee?zr(n.validatingFields,ie,ee):Hs(n.validatingFields,ie))}),f.state.next({validatingFields:n.validatingFields,isValidating:!wo(n.validatingFields)}))},w=(U,ee=[],ie,_e,we=!0,pe=!0)=>{if(_e&&ie&&!t.disabled){if(o.action=!0,pe&&Array.isArray(it(r,U))){const Se=ie(it(r,U),_e.argA,_e.argB);we&&zr(r,U,Se)}if(pe&&Array.isArray(it(n.errors,U))){const Se=ie(it(n.errors,U),_e.argA,_e.argB);we&&zr(n.errors,U,Se),JWe(n.errors,U)}if((h.touchedFields||u.touchedFields)&&pe&&Array.isArray(it(n.touchedFields,U))){const Se=ie(it(n.touchedFields,U),_e.argA,_e.argB);we&&zr(n.touchedFields,U,Se)}(h.dirtyFields||u.dirtyFields)&&(n.dirtyFields=e1(s,i)),f.state.next({name:U,isDirty:F(U,ee),dirtyFields:n.dirtyFields,errors:n.errors,isValid:n.isValid})}else zr(i,U,ee)},E=(U,ee)=>{zr(n.errors,U,ee),f.state.next({errors:n.errors})},R=U=>{n.errors=U,f.state.next({errors:n.errors,isValid:!1})},T=(U,ee,ie,_e)=>{const we=it(r,U);if(we){const pe=it(i,U,Ts(ie)?it(s,U):ie);Ts(pe)||_e&&_e.defaultChecked||ee?zr(i,U,ee?pe:zY(we._f)):Z(U,pe),o.mount&&y()}},N=(U,ee,ie,_e,we)=>{let pe=!1,Se=!1;const Fe={name:U};if(!t.disabled){if(!ie||_e){(h.isDirty||u.isDirty)&&(Se=n.isDirty,n.isDirty=Fe.isDirty=F(),pe=Se!==Fe.isDirty);const ft=bh(it(s,U),ee);Se=!!it(n.dirtyFields,U),ft?Hs(n.dirtyFields,U):zr(n.dirtyFields,U,!0),Fe.dirtyFields=n.dirtyFields,pe=pe||(h.dirtyFields||u.dirtyFields)&&Se!==!ft}if(ie){const ft=it(n.touchedFields,U);ft||(zr(n.touchedFields,U,ie),Fe.touchedFields=n.touchedFields,pe=pe||(h.touchedFields||u.touchedFields)&&ft!==ie)}pe&&we&&f.state.next(Fe)}return pe?Fe:{}},A=(U,ee,ie,_e)=>{const we=it(n.errors,U),pe=(h.isValid||u.isValid)&&Hc(ee)&&n.isValid!==ee;if(t.delayError&&ie?(c=x(()=>E(U,ie)),c(t.delayError)):(clearTimeout(d),c=null,ie?zr(n.errors,U,ie):Hs(n.errors,U)),(ie?!bh(we,ie):we)||!wo(_e)||pe){const Se={..._e,...pe&&Hc(ee)?{isValid:ee}:{},errors:n.errors,name:U};n={...n,...Se},f.state.next(Se)}},D=async U=>{b(U,!0);const ee=await t.resolver(i,t.context,GWe(U||a.mount,r,t.criteriaMode,t.shouldUseNativeValidation));return b(U),ee},O=async U=>{const{errors:ee}=await D(U);if(U)for(const ie of U){const _e=it(ee,ie);_e?zr(n.errors,ie,_e):Hs(n.errors,ie)}else n.errors=ee;return ee},I=async(U,ee,ie={valid:!0})=>{for(const _e in U){const we=U[_e];if(we){const{_f:pe,...Se}=we;if(pe){const Fe=a.array.has(pe.name),ft=we._f&&KWe(we._f);ft&&h.validatingFields&&b([_e],!0);const ht=await qY(we,a.disabled,i,m,t.shouldUseNativeValidation&&!ee,Fe);if(ft&&h.validatingFields&&b([_e]),ht[pe.name]&&(ie.valid=!1,ee))break;!ee&&(it(ht,pe.name)?Fe?eqe(n.errors,ht,pe.name):zr(n.errors,pe.name,ht[pe.name]):Hs(n.errors,pe.name))}!wo(Se)&&await I(Se,ee,ie)}}return ie.valid},$=()=>{for(const U of a.unMount){const ee=it(r,U);ee&&(ee._f.refs?ee._f.refs.every(ie=>!wz(ie)):!wz(ee._f.ref))&&Oe(U)}a.unMount=new Set},F=(U,ee)=>!t.disabled&&(U&&ee&&zr(i,U,ee),!bh(J(),s)),B=(U,ee,ie)=>rpe(U,a,{...o.mount?i:Ts(ee)?s:xu(U)?{[U]:ee}:ee},ie,ee),W=U=>sM(it(o.mount?i:s,U,t.shouldUnregister?it(s,U,[]):[])),Z=(U,ee,ie={})=>{const _e=it(r,U);let we=ee;if(_e){const pe=_e._f;pe&&(!pe.disabled&&zr(i,U,cpe(ee,pe)),we=gk(pe.ref)&&Ao(ee)?"":ee,ipe(pe.ref)?[...pe.ref.options].forEach(Se=>Se.selected=we.includes(Se.value)):pe.refs?PR(pe.ref)?pe.refs.length>1?pe.refs.forEach(Se=>(!Se.defaultChecked||!Se.disabled)&&(Se.checked=Array.isArray(we)?!!we.find(Fe=>Fe===Se.value):we===Se.value)):pe.refs[0]&&(pe.refs[0].checked=!!we):pe.refs.forEach(Se=>Se.checked=Se.value===we):QW(pe.ref)?pe.ref.value="":(pe.ref.value=we,pe.ref.type||f.state.next({name:U,values:Yi(i)})))}(ie.shouldDirty||ie.shouldTouch)&&N(U,we,ie.shouldTouch,ie.shouldDirty,!0),ie.shouldValidate&&re(U)},Y=(U,ee,ie)=>{for(const _e in ee){const we=ee[_e],pe=`${U}.${_e}`,Se=it(r,pe);(a.array.has(U)||Ss(we)||Se&&!Se._f)&&!vg(we)?Y(pe,we,ie):Z(pe,we,ie)}},H=(U,ee,ie={})=>{const _e=it(r,U),we=a.array.has(U),pe=Yi(ee);zr(i,U,pe),we?(f.array.next({name:U,values:Yi(i)}),(h.isDirty||h.dirtyFields||u.isDirty||u.dirtyFields)&&ie.shouldDirty&&f.state.next({name:U,dirtyFields:e1(s,i),isDirty:F(U,pe)})):_e&&!_e._f&&!Ao(pe)?Y(U,pe,ie):Z(U,pe,ie),VY(U,a)&&f.state.next({...n}),f.state.next({name:o.mount?U:void 0,values:Yi(i)})},se=async U=>{o.mount=!0;const ee=U.target;let ie=ee.name,_e=!0;const we=it(r,ie),pe=Se=>{_e=Number.isNaN(Se)||vg(Se)&&isNaN(Se.getTime())||bh(Se,it(i,ie,Se))};if(we){let Se,Fe;const ft=ee.type?zY(we._f):$We(U),ht=U.type===IY.BLUR||U.type===IY.FOCUS_OUT,hs=!YWe(we._f)&&!t.resolver&&!it(n.errors,ie)&&!we._f.deps||ZWe(ht,it(n.touchedFields,ie),n.isSubmitted,v,g),Mn=VY(ie,a,ht);zr(i,ie,ft),ht?(we._f.onBlur&&we._f.onBlur(U),c&&c(0)):we._f.onChange&&we._f.onChange(U);const Hr=N(ie,ft,ht),Yt=!wo(Hr)||Mn;if(!ht&&f.state.next({name:ie,type:U.type,values:Yi(i)}),hs)return(h.isValid||u.isValid)&&(t.mode==="onBlur"?ht&&y():ht||y()),Yt&&f.state.next({name:ie,...Mn?{}:Hr});if(!ht&&Mn&&f.state.next({...n}),t.resolver){const{errors:un}=await D([ie]);if(pe(ft),_e){const xn=HY(n.errors,r,ie),Ze=HY(un,r,xn.name||ie);Se=Ze.error,ie=Ze.name,Fe=wo(un)}}else b([ie],!0),Se=(await qY(we,a.disabled,i,m,t.shouldUseNativeValidation))[ie],b([ie]),pe(ft),_e&&(Se?Fe=!1:(h.isValid||u.isValid)&&(Fe=await I(r,!0)));_e&&(we._f.deps&&re(we._f.deps),A(ie,Fe,Se,Hr))}},he=(U,ee)=>{if(it(n.errors,ee)&&U.focus)return U.focus(),1},re=async(U,ee={})=>{let ie,_e;const we=X1(U);if(t.resolver){const pe=await O(Ts(U)?U:we);ie=wo(pe),_e=U?!we.some(Se=>it(pe,Se)):ie}else U?(_e=(await Promise.all(we.map(async pe=>{const Se=it(r,pe);return await I(Se&&Se._f?{[pe]:Se}:Se)}))).every(Boolean),!(!_e&&!n.isValid)&&y()):_e=ie=await I(r);return f.state.next({...!xu(U)||(h.isValid||u.isValid)&&ie!==n.isValid?{}:{name:U},...t.resolver||!U?{isValid:ie}:{},errors:n.errors}),ee.shouldFocus&&!_e&&Q1(r,he,U?we:a.mount),_e},J=U=>{const ee={...o.mount?i:s};return Ts(U)?ee:xu(U)?it(ee,U):U.map(ie=>it(ee,ie))},te=(U,ee)=>({invalid:!!it((ee||n).errors,U),isDirty:!!it((ee||n).dirtyFields,U),error:it((ee||n).errors,U),isValidating:!!it(n.validatingFields,U),isTouched:!!it((ee||n).touchedFields,U)}),ae=U=>{U&&X1(U).forEach(ee=>Hs(n.errors,ee)),f.state.next({errors:U?n.errors:{}})},be=(U,ee,ie)=>{const _e=(it(r,U,{_f:{}})._f||{}).ref,we=it(n.errors,U)||{},{ref:pe,message:Se,type:Fe,...ft}=we;zr(n.errors,U,{...ft,...ee,ref:_e}),f.state.next({name:U,errors:n.errors,isValid:!1}),ie&&ie.shouldFocus&&_e&&_e.focus&&_e.focus()},xe=(U,ee)=>yc(U)?f.state.subscribe({next:ie=>U(B(void 0,ee),ie)}):B(U,ee,!0),ve=U=>f.state.subscribe({next:ee=>{QWe(U.name,ee.name,U.exact)&&XWe(ee,U.formState||h,cn,U.reRenderRoot)&&U.callback({values:{...i},...n,...ee})}}).unsubscribe,Pe=U=>(o.mount=!0,u={...u,...U.formState},ve({...U,formState:u})),Oe=(U,ee={})=>{for(const ie of U?X1(U):a.mount)a.mount.delete(ie),a.array.delete(ie),ee.keepValue||(Hs(r,ie),Hs(i,ie)),!ee.keepError&&Hs(n.errors,ie),!ee.keepDirty&&Hs(n.dirtyFields,ie),!ee.keepTouched&&Hs(n.touchedFields,ie),!ee.keepIsValidating&&Hs(n.validatingFields,ie),!t.shouldUnregister&&!ee.keepDefaultValue&&Hs(s,ie);f.state.next({values:Yi(i)}),f.state.next({...n,...ee.keepDirty?{isDirty:F()}:{}}),!ee.keepIsValid&&y()},ke=({disabled:U,name:ee})=>{(Hc(U)&&o.mount||U||a.disabled.has(ee))&&(U?a.disabled.add(ee):a.disabled.delete(ee))},ze=(U,ee={})=>{let ie=it(r,U);const _e=Hc(ee.disabled)||Hc(t.disabled);return zr(r,U,{...ie||{},_f:{...ie&&ie._f?ie._f:{ref:{name:U}},name:U,mount:!0,...ee}}),a.mount.add(U),ie?ke({disabled:Hc(ee.disabled)?ee.disabled:t.disabled,name:U}):T(U,!0,ee.value),{..._e?{disabled:ee.disabled||t.disabled}:{},...t.progressive?{required:!!ee.required,min:t1(ee.min),max:t1(ee.max),minLength:t1(ee.minLength),maxLength:t1(ee.maxLength),pattern:t1(ee.pattern)}:{},name:U,onChange:se,onBlur:se,ref:we=>{if(we){ze(U,ee),ie=it(r,U);const pe=Ts(we.value)&&we.querySelectorAll&&we.querySelectorAll("input,select,textarea")[0]||we,Se=HWe(pe),Fe=ie._f.refs||[];if(Se?Fe.find(ft=>ft===pe):pe===ie._f.ref)return;zr(r,U,{_f:{...ie._f,...Se?{refs:[...Fe.filter(wz),pe,...Array.isArray(it(s,U))?[{}]:[]],ref:{type:pe.type,name:U}}:{ref:pe}}}),T(U,!1,void 0,pe)}else ie=it(r,U,{}),ie._f&&(ie._f.mount=!1),(t.shouldUnregister||ee.shouldUnregister)&&!(zWe(a.array,U)&&o.action)&&a.unMount.add(U)}}},$e=()=>t.shouldFocusError&&Q1(r,he,a.mount),Te=U=>{Hc(U)&&(f.state.next({disabled:U}),Q1(r,(ee,ie)=>{const _e=it(r,ie);_e&&(ee.disabled=_e._f.disabled||U,Array.isArray(_e._f.refs)&&_e._f.refs.forEach(we=>{we.disabled=_e._f.disabled||U}))},0,!1))},Ue=(U,ee)=>async ie=>{let _e;ie&&(ie.preventDefault&&ie.preventDefault(),ie.persist&&ie.persist());let we=Yi(i);if(f.state.next({isSubmitting:!0}),t.resolver){const{errors:pe,values:Se}=await D();n.errors=pe,we=Se}else await I(r);if(a.disabled.size)for(const pe of a.disabled)zr(we,pe,void 0);if(Hs(n.errors,"root"),wo(n.errors)){f.state.next({errors:{}});try{await U(we,ie)}catch(pe){_e=pe}}else ee&&await ee({...n.errors},ie),$e(),setTimeout($e);if(f.state.next({isSubmitted:!0,isSubmitting:!1,isSubmitSuccessful:wo(n.errors)&&!_e,submitCount:n.submitCount+1,errors:n.errors}),_e)throw _e},wt=(U,ee={})=>{it(r,U)&&(Ts(ee.defaultValue)?H(U,Yi(it(s,U))):(H(U,ee.defaultValue),zr(s,U,Yi(ee.defaultValue))),ee.keepTouched||Hs(n.touchedFields,U),ee.keepDirty||(Hs(n.dirtyFields,U),n.isDirty=ee.defaultValue?F(U,Yi(it(s,U))):F()),ee.keepError||(Hs(n.errors,U),h.isValid&&y()),f.state.next({...n}))},ut=(U,ee={})=>{const ie=U?Yi(U):s,_e=Yi(ie),we=wo(U),pe=we?s:_e;if(ee.keepDefaultValues||(s=ie),!ee.keepValues){if(ee.keepDirtyValues){const Se=new Set([...a.mount,...Object.keys(e1(s,i))]);for(const Fe of Array.from(Se))it(n.dirtyFields,Fe)?zr(pe,Fe,it(i,Fe)):H(Fe,it(pe,Fe))}else{if(GW&&Ts(U))for(const Se of a.mount){const Fe=it(r,Se);if(Fe&&Fe._f){const ft=Array.isArray(Fe._f.refs)?Fe._f.refs[0]:Fe._f.ref;if(gk(ft)){const ht=ft.closest("form");if(ht){ht.reset();break}}}}for(const Se of a.mount)H(Se,it(pe,Se))}i=Yi(pe),f.array.next({values:{...pe}}),f.state.next({values:{...pe}})}a={mount:ee.keepDirtyValues?a.mount:new Set,unMount:new Set,array:new Set,disabled:new Set,watch:new Set,watchAll:!1,focus:""},o.mount=!h.isValid||!!ee.keepIsValid||!!ee.keepDirtyValues,o.watch=!!t.shouldUnregister,f.state.next({submitCount:ee.keepSubmitCount?n.submitCount:0,isDirty:we?!1:ee.keepDirty?n.isDirty:!!(ee.keepDefaultValues&&!bh(U,s)),isSubmitted:ee.keepIsSubmitted?n.isSubmitted:!1,dirtyFields:we?{}:ee.keepDirtyValues?ee.keepDefaultValues&&i?e1(s,i):n.dirtyFields:ee.keepDefaultValues&&U?e1(s,U):ee.keepDirty?n.dirtyFields:{},touchedFields:ee.keepTouched?n.touchedFields:{},errors:ee.keepErrors?n.errors:{},isSubmitSuccessful:ee.keepIsSubmitSuccessful?n.isSubmitSuccessful:!1,isSubmitting:!1})},St=(U,ee)=>ut(yc(U)?U(i):U,ee),Nn=(U,ee={})=>{const ie=it(r,U),_e=ie&&ie._f;if(_e){const we=_e.refs?_e.refs[0]:_e.ref;we.focus&&(we.focus(),ee.shouldSelect&&yc(we.select)&&we.select())}},cn=U=>{n={...n,...U}},It={control:{register:ze,unregister:Oe,getFieldState:te,handleSubmit:Ue,setError:be,_subscribe:ve,_runSchema:D,_getWatch:B,_getDirty:F,_setValid:y,_setFieldArray:w,_setDisabledField:ke,_setErrors:R,_getFieldArray:W,_reset:ut,_resetDefaultValues:()=>yc(t.defaultValues)&&t.defaultValues().then(U=>{St(U,t.resetOptions),f.state.next({isLoading:!1})}),_removeUnmounted:$,_disableForm:Te,_subjects:f,_proxyFormState:h,get _fields(){return r},get _formValues(){return i},get _state(){return o},set _state(U){o=U},get _defaultValues(){return s},get _names(){return a},set _names(U){a=U},get _formState(){return n},get _options(){return t},set _options(U){t={...t,...U}}},subscribe:Pe,trigger:re,register:ze,handleSubmit:Ue,watch:xe,setValue:H,getValues:J,reset:St,resetField:wt,clearErrors:ae,unregister:Oe,setError:be,setFocus:Nn,getFieldState:te};return{...It,formControl:It}}function rqe(e={}){const t=fe.useRef(void 0),n=fe.useRef(void 0),[r,s]=fe.useState({isDirty:!1,isValidating:!1,isLoading:yc(e.defaultValues),isSubmitted:!1,isSubmitting:!1,isSubmitSuccessful:!1,isValid:!1,submitCount:0,dirtyFields:{},touchedFields:{},validatingFields:{},errors:e.errors||{},disabled:e.disabled||!1,defaultValues:yc(e.defaultValues)?void 0:e.defaultValues});t.current||(t.current={...e.formControl?e.formControl:nqe(e),formState:r},e.formControl&&e.defaultValues&&!yc(e.defaultValues)&&e.formControl.reset(e.defaultValues,e.resetOptions));const i=t.current.control;return i._options=e,fe.useLayoutEffect(()=>i._subscribe({formState:i._proxyFormState,callback:()=>s({...i._formState}),reRenderRoot:!0}),[i]),fe.useEffect(()=>i._disableForm(e.disabled),[i,e.disabled]),fe.useEffect(()=>{if(i._proxyFormState.isDirty){const o=i._getDirty();o!==r.isDirty&&i._subjects.state.next({isDirty:o})}},[i,r.isDirty]),fe.useEffect(()=>{e.values&&!bh(e.values,n.current)?(i._reset(e.values,i._options.resetOptions),n.current=e.values,s(o=>({...o}))):i._resetDefaultValues()},[e.values,i]),fe.useEffect(()=>{e.errors&&!wo(e.errors)&&i._setErrors(e.errors)},[e.errors,i]),fe.useEffect(()=>{i._state.mount||(i._setValid(),i._state.mount=!0),i._state.watch&&(i._state.watch=!1,i._subjects.state.next({...i._formState})),i._removeUnmounted()}),fe.useEffect(()=>{e.shouldUnregister&&i._subjects.state.next({values:i._getWatch()})},[e.shouldUnregister,i]),t.current.formState=npe(r,i),t.current}var En={primary:"#0e101c",secondary:"#bf1650",lightBlue:"#516391",blue:"#1e2a4a",lightPink:"#ec5990",buttonBlue:"#191d3a",green:"#1bda2b"};const Er={fontSize:13,lineHeight:"20px"},ey=Cx.button`
|
||
appearance: none;
|
||
margin: 0;
|
||
border: 0;
|
||
color: white;
|
||
padding: 5px !important;
|
||
border-radius: 0 !important;
|
||
background: ${e=>e.hideBackground?"":`${En.blue} !important`};
|
||
transition: 0.2s all;
|
||
|
||
&:hover {
|
||
background: ${En.lightBlue};
|
||
}
|
||
`,sqe=Cx(ey)`
|
||
font-size: 14px;
|
||
font-weight: bold;
|
||
margin: 0 4px 0 auto;
|
||
background: none !important;
|
||
display: flex;
|
||
width: 25px;
|
||
height: 25px;
|
||
justify-content: center;
|
||
line-height: 14px !important;
|
||
border-radius: 50% !important;
|
||
padding: 0 !important;
|
||
transition: 0.2s all;
|
||
|
||
&:hover {
|
||
background: ${En.lightBlue};
|
||
}
|
||
|
||
&:active {
|
||
background: black;
|
||
}
|
||
`,iqe=Cx.input`
|
||
&::placeholder {
|
||
color: #b3b3b3;
|
||
}
|
||
|
||
&:focus::placeholder {
|
||
color: white;
|
||
}
|
||
`,oqe=Cx.table`
|
||
transition: 0.3s all;
|
||
|
||
&:hover {
|
||
background: ${En.primary};
|
||
}
|
||
`,aqe=({setVisible:e,control:t})=>{const{isValid:n}=XW({control:t});return C.createElement("header",{style:{display:"flex",alignItems:"center",paddingLeft:10,backgroundColor:"transparent"}},C.createElement("p",{style:Object.assign(Object.assign({},Er),{margin:0,padding:0,fontWeight:400,fontSize:12})},C.createElement("span",{style:{transition:"0.5s all",color:n?En.green:En.lightPink}},"■")," ","React Hook Form"),C.createElement(sqe,{title:"Close dev panel",onClick:()=>e(!1)},"✕"))},lqe=({refObject:e,hasError:t,isDirty:n,fieldsValues:r,isNative:s,errorMessage:i,errorType:o,type:a,isTouched:c,name:d,collapseAll:h})=>{const[u,f]=C.useState(!1);C.useEffect(()=>{f(!h)},[h]);let g=r?it(r,d):"",v=!1;if(!MY(g))if(GSe(g))try{g=C.createElement("pre",{style:{margin:0}},C.createElement("code",{style:{fontSize:12}},JSON.stringify(g,null,2))),v=!0}catch{g=C.createElement("span",null,"[Nested Object]")}else typeof g!="string"&&(g=String(g));return C.createElement(oqe,{style:{padding:"5px 8px",width:"100%",transition:".3s all",borderLeft:`2px solid ${t?En.secondary:En.buttonBlue}`,background:"none"}},C.createElement("thead",null,C.createElement("tr",null,C.createElement("td",{valign:"top",style:{width:85,lineHeight:"22px"}},C.createElement(ey,{onClick:()=>f(!u),title:"Toggle field table",style:{border:`1px solid ${En.lightBlue}`,borderRadius:2,padding:"3px 5px",display:"inline-block",fontSize:9,lineHeight:"13px",width:20,textAlign:"center",marginRight:8},type:"button"},u?"+":"-"),C.createElement(ey,{onClick:()=>{e.scrollIntoView&&e.scrollIntoView({behavior:"smooth"})},title:"Scroll into view",style:Object.assign({border:`1px solid ${En.lightBlue}`,borderRadius:2,padding:"3px 5px",display:"inline-block",fontSize:9,lineHeight:"13px",textAlign:"center",width:"calc(100% - 30px)"},s?{}:{cursor:"not-allowed",background:En.lightBlue}),type:"button"},s?"Native":"Custom")),C.createElement("td",{style:{display:"block",maxWidth:140}},C.createElement("p",{style:Object.assign(Object.assign({margin:0,padding:0,top:0,position:"relative",whiteSpace:"nowrap",overflow:"hidden",textOverflow:"ellipsis"},Er),{lineHeight:"24px"}),title:d},d)))),!u&&C.createElement("tbody",null,a&&C.createElement("tr",null,C.createElement("td",{align:"right",style:Object.assign({paddingRight:5,fontWeight:500,verticalAlign:"top"},Er)},"Type:"),C.createElement("td",{style:Object.assign({display:"block",maxWidth:100},Er)},a)),o&&C.createElement("tr",null,C.createElement("td",{align:"right",style:Object.assign({paddingRight:5,fontWeight:500,verticalAlign:"top"},Er)},"ERROR Type:"),C.createElement("td",{style:Object.assign({display:"block",maxWidth:100},Er)},o)),i&&C.createElement("tr",null,C.createElement("td",{align:"right",style:Object.assign({paddingRight:5,fontWeight:500,verticalAlign:"top"},Er)},"MESSAGE:"),C.createElement("td",{style:Object.assign({display:"block",maxWidth:100},Er)},typeof i=="string"?i.trim():JSON.stringify(i))),!MY(g)&&C.createElement("tr",null,C.createElement("td",{align:"right",style:Object.assign({paddingRight:5,fontWeight:500,verticalAlign:"top"},Er)},"Value:"),C.createElement("td",{"data-testid":`${d}-field-value`,style:Object.assign({display:"block",maxWidth:100},Er)},!v&&C.createElement("p",{title:g,style:Object.assign(Object.assign({},Er),{margin:0,padding:0})},g),v&&C.createElement("div",{style:Object.assign(Object.assign({},Er),{margin:0,padding:0})},g))),C.createElement("tr",null,C.createElement("td",{align:"right",style:Object.assign({paddingRight:5,fontWeight:500,verticalAlign:"top"},Er)},"Touched:"),C.createElement("td",null,C.createElement("code",{style:Object.assign(Object.assign({color:c?En.green:En.lightPink},Er),{fontSize:12})},c?"true":"false"))),C.createElement("tr",null,C.createElement("td",{align:"right",style:Object.assign({paddingRight:5,fontWeight:500,verticalAlign:"top"},Er)},"Dirty:"),C.createElement("td",null,C.createElement("code",{style:Object.assign(Object.assign({color:n?En.green:En.lightPink},Er),{fontSize:12})},n?"true":"false")))))},cqe=({formState:e,showFormState:t,setShowFormState:n})=>C.createElement("div",{style:{alignSelf:"end"}},C.createElement(Uhe,{play:t,start:{opacity:0},end:{opacity:1},render:({style:r})=>C.createElement("table",{style:Object.assign({padding:"5px 10px",display:"block",background:"black",borderTop:`1px solid ${En.lightPink}`,pointerEvents:"none"},r)},C.createElement("tbody",null,C.createElement("tr",null,C.createElement("td",{align:"right",style:Object.assign({width:90},Er)},"Valid:"),C.createElement("td",{style:Object.assign({color:e.isValid?En.green:En.lightPink},Er)},e.isValid?"true":"false")),C.createElement("tr",null,C.createElement("td",{align:"right",style:Object.assign({},Er)},"Dirty:"),C.createElement("td",{style:Object.assign({color:e.isDirty?En.green:En.lightPink},Er)},e.isDirty?"true":"false")),C.createElement("tr",null,C.createElement("td",{align:"right",style:Object.assign({},Er)},"Submitted:"),C.createElement("td",{style:Object.assign({color:e.isSubmitted?En.green:En.lightPink},Er)},e.isSubmitted?"true":"false")),C.createElement("tr",null,C.createElement("td",{align:"right",style:Object.assign({},Er)},"Count:"),C.createElement("td",{style:Object.assign({color:e.submitCount?En.green:En.lightPink},Er)},e.submitCount)),C.createElement("tr",null,C.createElement("td",{align:"right",style:Object.assign({},Er)},"Submitting:"),C.createElement("td",{style:Object.assign({color:e.isSubmitting?En.green:En.lightPink},Er)},e.isSubmitting?"true":"false"))))}),C.createElement(ey,{style:{margin:0,width:"100%",padding:"8px 10px",textTransform:"none",fontSize:12,lineHeight:"14px",cursor:"pointer"},title:"Toggle form state panel",onClick:()=>{n(!t)},type:"button"},C.createElement("span",{style:{transition:"0.5s all",color:e.isValid?En.green:En.lightPink}},"■")," ","Form State: ",t?"OFF":"ON"));function uqe(e,t){return Object.assign(Object.assign({},e),{visible:t})}function dqe(e,t){return Object.assign(Object.assign({},e),{isCollapse:t})}let Sz=0;function dpe({fields:e,searchTerm:t,touchedFields:n,errors:r,dirtyFields:s,state:i,fieldsValues:o}){return C.createElement(C.Fragment,null,e&&Object.entries(e).filter(([a])=>(a&&a.toLowerCase&&a.toLowerCase().includes(t)||!a&&!t||t==="")&&a).map(([a,c],d)=>{if(Sz++,c!=null&&c._f){const h=it(r,c._f.name),u=it(h,"message",void 0),f=it(h,"type",void 0),g=it(c,"ref.type",void 0),v=!!it(n,c._f.name),m=!!(c&&c._f.ref.type),x=!!it(s,c._f.name),y=!!h,b=it(c,"_f.ref");return C.createElement("section",{key:(c==null?void 0:c._f.name)+Sz,style:{borderBottom:`1px dashed ${En.secondary}`,margin:0}},C.createElement(lqe,{refObject:b,index:d,collapseAll:i.isCollapse,name:c==null?void 0:c._f.name,isTouched:v,type:g,hasError:y,isNative:m,errorMessage:u,errorType:f,isDirty:x,fieldsValues:o}))}else return C.createElement(dpe,Object.assign({key:a+Sz},{fields:c,searchTerm:t,touchedFields:n,errors:r,dirtyFields:s,state:i,fieldsValues:o}))}))}const fqe=({control:e,control:{_fields:t}})=>{const n=XW({control:e}),{dirtyFields:r,touchedFields:s,errors:i}=n;n.isDirty;const{state:o,actions:a}=jhe({setCollapse:dqe}),[,c]=C.useState({}),[d,h]=C.useState(!1),u=spe({control:e}),{register:f,watch:g}=rqe(),v=g("search","");return C.useEffect(()=>{c({})},[]),C.createElement("div",{style:{display:"grid",gridTemplateRows:"56px auto",height:"calc(100vh - 40px)"}},C.createElement("div",{style:{display:"grid",gridTemplateColumns:"1fr 1fr",gridTemplateRows:"28px 28px"}},C.createElement(ey,{style:{borderRight:`1px solid ${En.primary}`,textTransform:"none",fontSize:11,lineHeight:1},title:"Update values and state the form",onClick:()=>c({}),type:"button"},"♺ REFRESH"),C.createElement(ey,{style:{borderRight:`1px solid ${En.primary}`,textTransform:"none",fontSize:11,lineHeight:1},title:"Toggle entire fields",onClick:()=>{a.setCollapse(!o.isCollapse)},type:"button"},o.isCollapse?"[-] COLLAPSE":"[+] EXPAND"),C.createElement(iqe,Object.assign({style:{display:"inline-block",borderRadius:0,width:"100%",margin:0,padding:"5px 10px",WebkitAppearance:"none",appearance:"none",fontSize:14,border:0,color:"white",gridColumnStart:1,gridColumnEnd:4,background:"black"}},f("search"),{placeholder:"Filter name...",type:"search"}))),C.createElement("div",{style:{overflow:"auto"}},C.createElement(dpe,{fields:t,searchTerm:v,errors:i,touchedFields:s,dirtyFields:r,fieldsValues:u,state:o})),C.createElement(cqe,{formState:n,showFormState:d,setShowFormState:h}))},hqe=({style:e,actions:t})=>C.createElement("svg",{fill:"white",viewBox:"0 0 100 100",style:Object.assign({height:14,padding:3,borderRadius:2,background:En.lightPink},e),onClick:()=>{t.setVisible(!0)},"aria-label":"React Hook Form Logo"},C.createElement("path",{d:"M73.56,13.32H58.14a8.54,8.54,0,0,0-16.27,0H26.44a11,11,0,0,0-11,11V81.63a11,11,0,0,0,11,11H73.56a11,11,0,0,0,11-11V24.32A11,11,0,0,0,73.56,13.32Zm-30.92,2a1,1,0,0,0,1-.79,6.54,6.54,0,0,1,12.78,0,1,1,0,0,0,1,.79h5.38v6.55a3,3,0,0,1-3,3H40.25a3,3,0,0,1-3-3V15.32ZM82.56,81.63a9,9,0,0,1-9,9H26.44a9,9,0,0,1-9-9V24.32a9,9,0,0,1,9-9h8.81v6.55a5,5,0,0,0,5,5h19.5a5,5,0,0,0,5-5V15.32h8.81a9,9,0,0,1,9,9Z"}),C.createElement("path",{style:{transform:"translateX(-25px)"},d:"M71.6,45.92H54a1,1,0,0,0,0,2H71.6a1,1,0,0,0,0-2Z"}),C.createElement("path",{d:"M71.6,45.92H54a1,1,0,0,0,0,2H71.6a1,1,0,0,0,0-2Z"}),C.createElement("path",{style:{transform:"translateX(-25px)"},d:"M71.1,69.49H53.45a1,1,0,1,0,0,2H71.1a1,1,0,0,0,0-2Z"}),C.createElement("path",{d:"M71.1,69.49H53.45a1,1,0,1,0,0,2H71.1a1,1,0,0,0,0-2Z"}));function GY(e,t=0,n=0){const[r,s]=e.split("-");return{[r]:t,[s]:n}}const pqe=({control:e,placement:t="top-right",styles:n})=>{const{state:r,actions:s}=jhe({setVisible:uqe}),i=GY(t,0,0);return C.createElement(C.Fragment,null,C.createElement(Uhe,{play:r.visible,duration:.2,start:Object.assign(Object.assign({},i),{position:"fixed",transform:t.includes("right")?"translateX(280px)":"translateX(-280px)",zIndex:99999}),end:Object.assign(Object.assign({},i),{position:"fixed",transform:"translateX(0)",zIndex:99999})},C.createElement("div",{style:Object.assign(Object.assign(Object.assign({},i),{position:"fixed",height:"100vh",width:250,zIndex:99999,background:En.buttonBlue,display:"grid",textAlign:"left",color:"white",fontSize:14,gridTemplateRows:"40px auto",fontFamily:"-apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Oxygen', 'Ubuntu', 'Cantarell', 'Fira Sans', 'Droid Sans', 'Helvetica Neue', sans-serif"}),n==null?void 0:n.panel)},C.createElement(aqe,{setVisible:s.setVisible,control:e}),C.createElement(fqe,{control:e}))),!r.visible&&C.createElement(ey,{title:"Show dev panel",hideBackground:!0,style:Object.assign(Object.assign(Object.assign({position:"fixed",zIndex:99999},GY(t,3,3)),{padding:3,margin:0,background:"none"}),n==null?void 0:n.button),type:"button"},C.createElement(hqe,{actions:s})))};/*! *****************************************************************************
|
||
Copyright (c) Microsoft Corporation.
|
||
|
||
Permission to use, copy, modify, and/or distribute this software for any
|
||
purpose with or without fee is hereby granted.
|
||
|
||
THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
|
||
REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
|
||
AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
|
||
INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
|
||
LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
|
||
OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
|
||
PERFORMANCE OF THIS SOFTWARE.
|
||
***************************************************************************** */function mqe(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&typeof Object.getOwnPropertySymbols=="function")for(var s=0,r=Object.getOwnPropertySymbols(e);s<r.length;s++)t.indexOf(r[s])<0&&Object.prototype.propertyIsEnumerable.call(e,r[s])&&(n[r[s]]=e[r[s]]);return n}function KY(e){return Reflect.ownKeys(e).reduce((t,n)=>(t[n]=e[n],t),{})}function LP(e,t,n){return e.reduce((r,s)=>(r[s]=BB(t,s)||n,r),{})}function gqe({id:e,control:t}){const n=spe({control:t}),r=XW({control:t}),[s,i]=C.useState(!1),o=a=>{a.data.source!=="react-hook-form-bridge"||a.data.type!=="INIT"||(window.postMessage({source:"react-hook-form-bridge",type:"WELCOME"}),i(!0))};return C.useEffect(()=>(window.addEventListener("message",o),()=>window.removeEventListener("message",o)),[]),jWe(()=>{if(!s)return;const a=KY(r),{errors:c,dirtyFields:d,touchedFields:h}=a,u=mqe(a,["errors","dirtyFields","touchedFields"]),f=[...t._names.mount],g=LP(f,n,""),v=LP(f,d,!1),m=LP(f,h,!1),x=LP(f,c),y=Object.entries(x).reduce((E,[R,T])=>(E[R]={type:T==null?void 0:T.type,message:T==null?void 0:T.message},E),{}),b=f.reduce((E,R)=>{var T,N;const A=(T=BB(t._fields,R))===null||T===void 0?void 0:T._f;return E[R]=(N=BB(A,"ref"))===null||N===void 0?void 0:N.type,E},{}),w={id:e,data:{formValues:g,formState:Object.assign({errors:y,dirtyFields:v,touchedFields:m,nativeFields:b},u)}};window.postMessage({source:"react-hook-form-bridge",type:"UPDATE",payload:w})},[s,n,KY(r)]),{isExtensionEnabled:s}}typeof window<"u"&&y8e({visible:!1,isCollapse:!1,filterName:""},{name:"__REACT_HOOK_FORM_DEVTOOLS__",middleWares:[],storageType:window.localStorage});const vqe=e=>{var t,n,r;const s=YW(),i=C.useRef("");C.useEffect(()=>{i.current=C8e()},[]);const{isExtensionEnabled:o}=gqe({id:(t=e==null?void 0:e.id)!==null&&t!==void 0?t:i.current,control:(n=e==null?void 0:e.control)!==null&&n!==void 0?n:s.control});return o?null:C.createElement(v8e,null,C.createElement(pqe,{control:(r=e==null?void 0:e.control)!==null&&r!==void 0?r:s.control,placement:e==null?void 0:e.placement,styles:e==null?void 0:e.styles}))};var bk={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
|
||
*/bk.exports;(function(e,t){(function(){var n,r="4.17.21",s=200,i="Unsupported core-js use. Try https://npms.io/search?q=ponyfill.",o="Expected a function",a="Invalid `variable` option passed into `_.template`",c="__lodash_hash_undefined__",d=500,h="__lodash_placeholder__",u=1,f=2,g=4,v=1,m=2,x=1,y=2,b=4,w=8,E=16,R=32,T=64,N=128,A=256,D=512,O=30,I="...",$=800,F=16,B=1,W=2,Z=3,Y=1/0,H=9007199254740991,se=17976931348623157e292,he=NaN,re=4294967295,J=re-1,te=re>>>1,ae=[["ary",N],["bind",x],["bindKey",y],["curry",w],["curryRight",E],["flip",D],["partial",R],["partialRight",T],["rearg",A]],be="[object Arguments]",xe="[object Array]",ve="[object AsyncFunction]",Pe="[object Boolean]",Oe="[object Date]",ke="[object DOMException]",ze="[object Error]",$e="[object Function]",Te="[object GeneratorFunction]",Ue="[object Map]",wt="[object Number]",ut="[object Null]",St="[object Object]",Nn="[object Promise]",cn="[object Proxy]",hn="[object RegExp]",It="[object Set]",U="[object String]",ee="[object Symbol]",ie="[object Undefined]",_e="[object WeakMap]",we="[object WeakSet]",pe="[object ArrayBuffer]",Se="[object DataView]",Fe="[object Float32Array]",ft="[object Float64Array]",ht="[object Int8Array]",hs="[object Int16Array]",Mn="[object Int32Array]",Hr="[object Uint8Array]",Yt="[object Uint8ClampedArray]",un="[object Uint16Array]",xn="[object Uint32Array]",Ze=/\b__p \+= '';/g,Rt=/\b(__p \+=) '' \+/g,Pt=/(__e\(.*?\)|\b__t\)) \+\n'';/g,Ut=/&(?:amp|lt|gt|quot|#39);/g,yt=/[&<>"']/g,dn=RegExp(Ut.source),Gt=RegExp(yt.source),Hn=/<%-([\s\S]+?)%>/g,In=/<%([\s\S]+?)%>/g,Tn=/<%=([\s\S]+?)%>/g,sr=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,Kr=/^\w*$/,ir=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,de=/[\\^$.*+?()[\]{}|]/g,ye=RegExp(de.source),Ce=/^\s+/,Me=/\s/,Ge=/\{(?:\n\/\* \[wrapped with .+\] \*\/)?\n?/,lt=/\{\n\/\* \[wrapped with (.+)\] \*/,Ct=/,? & /,st=/[^\x00-\x2f\x3a-\x40\x5b-\x60\x7b-\x7f]+/g,dt=/[()=,{}\[\]\/\s]/,ot=/\\(\\)?/g,gt=/\$\{([^\\}]*(?:\\.[^\\}]*)*)\}/g,Lt=/\w*$/,Jt=/^[-+]0x[0-9a-f]+$/i,ps=/^0b[01]+$/i,Wn=/^\[object .+?Constructor\]$/,pn=/^0o[0-7]+$/i,wr=/^(?:0|[1-9]\d*)$/,Lc=/[\xc0-\xd6\xd8-\xf6\xf8-\xff\u0100-\u017f]/g,oo=/($^)/,fa=/['\n\r\u2028\u2029\\]/g,As="\\ud800-\\udfff",$p="\\u0300-\\u036f",Bu="\\ufe20-\\ufe2f",Tl="\\u20d0-\\u20ff",jc=$p+Bu+Tl,$c="\\u2700-\\u27bf",en="a-z\\xdf-\\xf6\\xf8-\\xff",Sr="\\xac\\xb1\\xd7\\xf7",Fc="\\x00-\\x2f\\x3a-\\x40\\x5b-\\x60\\x7b-\\xbf",Uu="\\u2000-\\u206f",Wr=" \\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",nl="A-Z\\xc0-\\xd6\\xd8-\\xde",Kf="\\ufe0e\\ufe0f",Fp=Sr+Fc+Uu+Wr,zp="['’]",dM="["+As+"]",o_="["+Fp+"]",Vu="["+jc+"]",a_="\\d+",fM="["+$c+"]",l_="["+en+"]",c_="[^"+As+Fp+a_+$c+en+nl+"]",Bp="\\ud83c[\\udffb-\\udfff]",hM="(?:"+Vu+"|"+Bp+")",u_="[^"+As+"]",Up="(?:\\ud83c[\\udde6-\\uddff]){2}",Vp="[\\ud800-\\udbff][\\udc00-\\udfff]",ha="["+nl+"]",d_="\\u200d",f_="(?:"+l_+"|"+c_+")",pM="(?:"+ha+"|"+c_+")",h_="(?:"+zp+"(?:d|ll|m|re|s|t|ve))?",p_="(?:"+zp+"(?:D|LL|M|RE|S|T|VE))?",m_=hM+"?",g_="["+Kf+"]?",mM="(?:"+d_+"(?:"+[u_,Up,Vp].join("|")+")"+g_+m_+")*",gM="\\d*(?:1st|2nd|3rd|(?![123])\\dth)(?=\\b|[A-Z_])",vM="\\d*(?:1ST|2ND|3RD|(?![123])\\dTH)(?=\\b|[a-z_])",v_=g_+m_+mM,yM="(?:"+[fM,Up,Vp].join("|")+")"+v_,bM="(?:"+[u_+Vu+"?",Vu,Up,Vp,dM].join("|")+")",xM=RegExp(zp,"g"),_M=RegExp(Vu,"g"),Hp=RegExp(Bp+"(?="+Bp+")|"+bM+v_,"g"),wM=RegExp([ha+"?"+l_+"+"+h_+"(?="+[o_,ha,"$"].join("|")+")",pM+"+"+p_+"(?="+[o_,ha+f_,"$"].join("|")+")",ha+"?"+f_+"+"+h_,ha+"+"+p_,vM,gM,a_,yM].join("|"),"g"),SM=RegExp("["+d_+As+jc+Kf+"]"),CM=/[a-z][A-Z]|[A-Z]{2}[a-z]|[0-9][a-zA-Z]|[a-zA-Z][0-9]|[^a-zA-Z0-9 ]/,EM=["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"],AM=-1,Tt={};Tt[Fe]=Tt[ft]=Tt[ht]=Tt[hs]=Tt[Mn]=Tt[Hr]=Tt[Yt]=Tt[un]=Tt[xn]=!0,Tt[be]=Tt[xe]=Tt[pe]=Tt[Pe]=Tt[Se]=Tt[Oe]=Tt[ze]=Tt[$e]=Tt[Ue]=Tt[wt]=Tt[St]=Tt[hn]=Tt[It]=Tt[U]=Tt[_e]=!1;var Nt={};Nt[be]=Nt[xe]=Nt[pe]=Nt[Se]=Nt[Pe]=Nt[Oe]=Nt[Fe]=Nt[ft]=Nt[ht]=Nt[hs]=Nt[Mn]=Nt[Ue]=Nt[wt]=Nt[St]=Nt[hn]=Nt[It]=Nt[U]=Nt[ee]=Nt[Hr]=Nt[Yt]=Nt[un]=Nt[xn]=!0,Nt[ze]=Nt[$e]=Nt[_e]=!1;var RM={À:"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"},PM={"&":"&","<":"<",">":">",'"':""","'":"'"},NM={"&":"&","<":"<",">":">",""":'"',"'":"'"},TM={"\\":"\\","'":"'","\n":"n","\r":"r","\u2028":"u2028","\u2029":"u2029"},kM=parseFloat,DM=parseInt,y_=typeof xr=="object"&&xr&&xr.Object===Object&&xr,OM=typeof self=="object"&&self&&self.Object===Object&&self,mn=y_||OM||Function("return this")(),Wp=t&&!t.nodeType&&t,ao=Wp&&!0&&e&&!e.nodeType&&e,b_=ao&&ao.exports===Wp,qp=b_&&y_.process,Nr=function(){try{var X=ao&&ao.require&&ao.require("util").types;return X||qp&&qp.binding&&qp.binding("util")}catch{}}(),x_=Nr&&Nr.isArrayBuffer,__=Nr&&Nr.isDate,w_=Nr&&Nr.isMap,S_=Nr&&Nr.isRegExp,C_=Nr&&Nr.isSet,E_=Nr&&Nr.isTypedArray;function dr(X,oe,ne){switch(ne.length){case 0:return X.call(oe);case 1:return X.call(oe,ne[0]);case 2:return X.call(oe,ne[0],ne[1]);case 3:return X.call(oe,ne[0],ne[1],ne[2])}return X.apply(oe,ne)}function MM(X,oe,ne,Re){for(var We=-1,pt=X==null?0:X.length;++We<pt;){var Xt=X[We];oe(Re,Xt,ne(Xt),X)}return Re}function Tr(X,oe){for(var ne=-1,Re=X==null?0:X.length;++ne<Re&&oe(X[ne],ne,X)!==!1;);return X}function IM(X,oe){for(var ne=X==null?0:X.length;ne--&&oe(X[ne],ne,X)!==!1;);return X}function A_(X,oe){for(var ne=-1,Re=X==null?0:X.length;++ne<Re;)if(!oe(X[ne],ne,X))return!1;return!0}function hi(X,oe){for(var ne=-1,Re=X==null?0:X.length,We=0,pt=[];++ne<Re;){var Xt=X[ne];oe(Xt,ne,X)&&(pt[We++]=Xt)}return pt}function Hu(X,oe){var ne=X==null?0:X.length;return!!ne&&pa(X,oe,0)>-1}function Gp(X,oe,ne){for(var Re=-1,We=X==null?0:X.length;++Re<We;)if(ne(oe,X[Re]))return!0;return!1}function Ot(X,oe){for(var ne=-1,Re=X==null?0:X.length,We=Array(Re);++ne<Re;)We[ne]=oe(X[ne],ne,X);return We}function pi(X,oe){for(var ne=-1,Re=oe.length,We=X.length;++ne<Re;)X[We+ne]=oe[ne];return X}function Kp(X,oe,ne,Re){var We=-1,pt=X==null?0:X.length;for(Re&&pt&&(ne=X[++We]);++We<pt;)ne=oe(ne,X[We],We,X);return ne}function LM(X,oe,ne,Re){var We=X==null?0:X.length;for(Re&&We&&(ne=X[--We]);We--;)ne=oe(ne,X[We],We,X);return ne}function Yp(X,oe){for(var ne=-1,Re=X==null?0:X.length;++ne<Re;)if(oe(X[ne],ne,X))return!0;return!1}var jM=Xp("length");function $M(X){return X.split("")}function FM(X){return X.match(st)||[]}function R_(X,oe,ne){var Re;return ne(X,function(We,pt,Xt){if(oe(We,pt,Xt))return Re=pt,!1}),Re}function Wu(X,oe,ne,Re){for(var We=X.length,pt=ne+(Re?1:-1);Re?pt--:++pt<We;)if(oe(X[pt],pt,X))return pt;return-1}function pa(X,oe,ne){return oe===oe?QM(X,oe,ne):Wu(X,P_,ne)}function zM(X,oe,ne,Re){for(var We=ne-1,pt=X.length;++We<pt;)if(Re(X[We],oe))return We;return-1}function P_(X){return X!==X}function N_(X,oe){var ne=X==null?0:X.length;return ne?Zp(X,oe)/ne:he}function Xp(X){return function(oe){return oe==null?n:oe[X]}}function Qp(X){return function(oe){return X==null?n:X[oe]}}function T_(X,oe,ne,Re,We){return We(X,function(pt,Xt,Et){ne=Re?(Re=!1,pt):oe(ne,pt,Xt,Et)}),ne}function BM(X,oe){var ne=X.length;for(X.sort(oe);ne--;)X[ne]=X[ne].value;return X}function Zp(X,oe){for(var ne,Re=-1,We=X.length;++Re<We;){var pt=oe(X[Re]);pt!==n&&(ne=ne===n?pt:ne+pt)}return ne}function Jp(X,oe){for(var ne=-1,Re=Array(X);++ne<X;)Re[ne]=oe(ne);return Re}function UM(X,oe){return Ot(oe,function(ne){return[ne,X[ne]]})}function k_(X){return X&&X.slice(0,I_(X)+1).replace(Ce,"")}function fr(X){return function(oe){return X(oe)}}function em(X,oe){return Ot(oe,function(ne){return X[ne]})}function kl(X,oe){return X.has(oe)}function D_(X,oe){for(var ne=-1,Re=X.length;++ne<Re&&pa(oe,X[ne],0)>-1;);return ne}function O_(X,oe){for(var ne=X.length;ne--&&pa(oe,X[ne],0)>-1;);return ne}function VM(X,oe){for(var ne=X.length,Re=0;ne--;)X[ne]===oe&&++Re;return Re}var HM=Qp(RM),WM=Qp(PM);function qM(X){return"\\"+TM[X]}function GM(X,oe){return X==null?n:X[oe]}function ma(X){return SM.test(X)}function KM(X){return CM.test(X)}function YM(X){for(var oe,ne=[];!(oe=X.next()).done;)ne.push(oe.value);return ne}function tm(X){var oe=-1,ne=Array(X.size);return X.forEach(function(Re,We){ne[++oe]=[We,Re]}),ne}function M_(X,oe){return function(ne){return X(oe(ne))}}function mi(X,oe){for(var ne=-1,Re=X.length,We=0,pt=[];++ne<Re;){var Xt=X[ne];(Xt===oe||Xt===h)&&(X[ne]=h,pt[We++]=ne)}return pt}function qu(X){var oe=-1,ne=Array(X.size);return X.forEach(function(Re){ne[++oe]=Re}),ne}function XM(X){var oe=-1,ne=Array(X.size);return X.forEach(function(Re){ne[++oe]=[Re,Re]}),ne}function QM(X,oe,ne){for(var Re=ne-1,We=X.length;++Re<We;)if(X[Re]===oe)return Re;return-1}function ZM(X,oe,ne){for(var Re=ne+1;Re--;)if(X[Re]===oe)return Re;return Re}function ga(X){return ma(X)?eI(X):jM(X)}function Yr(X){return ma(X)?tI(X):$M(X)}function I_(X){for(var oe=X.length;oe--&&Me.test(X.charAt(oe)););return oe}var JM=Qp(NM);function eI(X){for(var oe=Hp.lastIndex=0;Hp.test(X);)++oe;return oe}function tI(X){return X.match(Hp)||[]}function nI(X){return X.match(wM)||[]}var rI=function X(oe){oe=oe==null?mn:va.defaults(mn.Object(),oe,va.pick(mn,EM));var ne=oe.Array,Re=oe.Date,We=oe.Error,pt=oe.Function,Xt=oe.Math,Et=oe.Object,nm=oe.RegExp,sI=oe.String,kr=oe.TypeError,Gu=ne.prototype,iI=pt.prototype,ya=Et.prototype,Ku=oe["__core-js_shared__"],Yu=iI.toString,bt=ya.hasOwnProperty,oI=0,L_=function(){var l=/[^.]+$/.exec(Ku&&Ku.keys&&Ku.keys.IE_PROTO||"");return l?"Symbol(src)_1."+l:""}(),Xu=ya.toString,aI=Yu.call(Et),lI=mn._,cI=nm("^"+Yu.call(bt).replace(de,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),Qu=b_?oe.Buffer:n,gi=oe.Symbol,Zu=oe.Uint8Array,j_=Qu?Qu.allocUnsafe:n,Ju=M_(Et.getPrototypeOf,Et),$_=Et.create,F_=ya.propertyIsEnumerable,ed=Gu.splice,z_=gi?gi.isConcatSpreadable:n,Dl=gi?gi.iterator:n,lo=gi?gi.toStringTag:n,td=function(){try{var l=po(Et,"defineProperty");return l({},"",{}),l}catch{}}(),uI=oe.clearTimeout!==mn.clearTimeout&&oe.clearTimeout,dI=Re&&Re.now!==mn.Date.now&&Re.now,fI=oe.setTimeout!==mn.setTimeout&&oe.setTimeout,nd=Xt.ceil,rd=Xt.floor,rm=Et.getOwnPropertySymbols,hI=Qu?Qu.isBuffer:n,B_=oe.isFinite,pI=Gu.join,mI=M_(Et.keys,Et),Qt=Xt.max,Sn=Xt.min,gI=Re.now,vI=oe.parseInt,U_=Xt.random,yI=Gu.reverse,sm=po(oe,"DataView"),Ol=po(oe,"Map"),im=po(oe,"Promise"),ba=po(oe,"Set"),Ml=po(oe,"WeakMap"),Il=po(Et,"create"),sd=Ml&&new Ml,xa={},bI=mo(sm),xI=mo(Ol),_I=mo(im),wI=mo(ba),SI=mo(Ml),id=gi?gi.prototype:n,Ll=id?id.valueOf:n,V_=id?id.toString:n;function L(l){if(Ft(l)&&!qe(l)&&!(l instanceof et)){if(l instanceof Dr)return l;if(bt.call(l,"__wrapped__"))return Hw(l)}return new Dr(l)}var _a=function(){function l(){}return function(p){if(!jt(p))return{};if($_)return $_(p);l.prototype=p;var S=new l;return l.prototype=n,S}}();function od(){}function Dr(l,p){this.__wrapped__=l,this.__actions__=[],this.__chain__=!!p,this.__index__=0,this.__values__=n}L.templateSettings={escape:Hn,evaluate:In,interpolate:Tn,variable:"",imports:{_:L}},L.prototype=od.prototype,L.prototype.constructor=L,Dr.prototype=_a(od.prototype),Dr.prototype.constructor=Dr;function et(l){this.__wrapped__=l,this.__actions__=[],this.__dir__=1,this.__filtered__=!1,this.__iteratees__=[],this.__takeCount__=re,this.__views__=[]}function CI(){var l=new et(this.__wrapped__);return l.__actions__=Gn(this.__actions__),l.__dir__=this.__dir__,l.__filtered__=this.__filtered__,l.__iteratees__=Gn(this.__iteratees__),l.__takeCount__=this.__takeCount__,l.__views__=Gn(this.__views__),l}function EI(){if(this.__filtered__){var l=new et(this);l.__dir__=-1,l.__filtered__=!0}else l=this.clone(),l.__dir__*=-1;return l}function AI(){var l=this.__wrapped__.value(),p=this.__dir__,S=qe(l),k=p<0,M=S?l.length:0,j=$L(0,M,this.__views__),z=j.start,q=j.end,Q=q-z,le=k?q:z-1,ce=this.__iteratees__,me=ce.length,Ee=0,De=Sn(Q,this.__takeCount__);if(!S||!k&&M==Q&&De==Q)return hw(l,this.__actions__);var Le=[];e:for(;Q--&&Ee<De;){le+=p;for(var Xe=-1,je=l[le];++Xe<me;){var Je=ce[Xe],rt=Je.iteratee,mr=Je.type,$n=rt(je);if(mr==W)je=$n;else if(!$n){if(mr==B)continue e;break e}}Le[Ee++]=je}return Le}et.prototype=_a(od.prototype),et.prototype.constructor=et;function co(l){var p=-1,S=l==null?0:l.length;for(this.clear();++p<S;){var k=l[p];this.set(k[0],k[1])}}function RI(){this.__data__=Il?Il(null):{},this.size=0}function PI(l){var p=this.has(l)&&delete this.__data__[l];return this.size-=p?1:0,p}function NI(l){var p=this.__data__;if(Il){var S=p[l];return S===c?n:S}return bt.call(p,l)?p[l]:n}function TI(l){var p=this.__data__;return Il?p[l]!==n:bt.call(p,l)}function kI(l,p){var S=this.__data__;return this.size+=this.has(l)?0:1,S[l]=Il&&p===n?c:p,this}co.prototype.clear=RI,co.prototype.delete=PI,co.prototype.get=NI,co.prototype.has=TI,co.prototype.set=kI;function Ms(l){var p=-1,S=l==null?0:l.length;for(this.clear();++p<S;){var k=l[p];this.set(k[0],k[1])}}function DI(){this.__data__=[],this.size=0}function OI(l){var p=this.__data__,S=ad(p,l);if(S<0)return!1;var k=p.length-1;return S==k?p.pop():ed.call(p,S,1),--this.size,!0}function MI(l){var p=this.__data__,S=ad(p,l);return S<0?n:p[S][1]}function II(l){return ad(this.__data__,l)>-1}function LI(l,p){var S=this.__data__,k=ad(S,l);return k<0?(++this.size,S.push([l,p])):S[k][1]=p,this}Ms.prototype.clear=DI,Ms.prototype.delete=OI,Ms.prototype.get=MI,Ms.prototype.has=II,Ms.prototype.set=LI;function Is(l){var p=-1,S=l==null?0:l.length;for(this.clear();++p<S;){var k=l[p];this.set(k[0],k[1])}}function jI(){this.size=0,this.__data__={hash:new co,map:new(Ol||Ms),string:new co}}function $I(l){var p=bd(this,l).delete(l);return this.size-=p?1:0,p}function FI(l){return bd(this,l).get(l)}function zI(l){return bd(this,l).has(l)}function BI(l,p){var S=bd(this,l),k=S.size;return S.set(l,p),this.size+=S.size==k?0:1,this}Is.prototype.clear=jI,Is.prototype.delete=$I,Is.prototype.get=FI,Is.prototype.has=zI,Is.prototype.set=BI;function uo(l){var p=-1,S=l==null?0:l.length;for(this.__data__=new Is;++p<S;)this.add(l[p])}function UI(l){return this.__data__.set(l,c),this}function VI(l){return this.__data__.has(l)}uo.prototype.add=uo.prototype.push=UI,uo.prototype.has=VI;function Xr(l){var p=this.__data__=new Ms(l);this.size=p.size}function HI(){this.__data__=new Ms,this.size=0}function WI(l){var p=this.__data__,S=p.delete(l);return this.size=p.size,S}function qI(l){return this.__data__.get(l)}function GI(l){return this.__data__.has(l)}function KI(l,p){var S=this.__data__;if(S instanceof Ms){var k=S.__data__;if(!Ol||k.length<s-1)return k.push([l,p]),this.size=++S.size,this;S=this.__data__=new Is(k)}return S.set(l,p),this.size=S.size,this}Xr.prototype.clear=HI,Xr.prototype.delete=WI,Xr.prototype.get=qI,Xr.prototype.has=GI,Xr.prototype.set=KI;function H_(l,p){var S=qe(l),k=!S&&go(l),M=!S&&!k&&_i(l),j=!S&&!k&&!M&&Ea(l),z=S||k||M||j,q=z?Jp(l.length,sI):[],Q=q.length;for(var le in l)(p||bt.call(l,le))&&!(z&&(le=="length"||M&&(le=="offset"||le=="parent")||j&&(le=="buffer"||le=="byteLength"||le=="byteOffset")||Fs(le,Q)))&&q.push(le);return q}function W_(l){var p=l.length;return p?l[gm(0,p-1)]:n}function YI(l,p){return xd(Gn(l),fo(p,0,l.length))}function XI(l){return xd(Gn(l))}function om(l,p,S){(S!==n&&!Qr(l[p],S)||S===n&&!(p in l))&&Ls(l,p,S)}function jl(l,p,S){var k=l[p];(!(bt.call(l,p)&&Qr(k,S))||S===n&&!(p in l))&&Ls(l,p,S)}function ad(l,p){for(var S=l.length;S--;)if(Qr(l[S][0],p))return S;return-1}function QI(l,p,S,k){return vi(l,function(M,j,z){p(k,M,S(M),z)}),k}function q_(l,p){return l&&gs(p,rn(p),l)}function ZI(l,p){return l&&gs(p,Yn(p),l)}function Ls(l,p,S){p=="__proto__"&&td?td(l,p,{configurable:!0,enumerable:!0,value:S,writable:!0}):l[p]=S}function am(l,p){for(var S=-1,k=p.length,M=ne(k),j=l==null;++S<k;)M[S]=j?n:Bm(l,p[S]);return M}function fo(l,p,S){return l===l&&(S!==n&&(l=l<=S?l:S),p!==n&&(l=l>=p?l:p)),l}function Or(l,p,S,k,M,j){var z,q=p&u,Q=p&f,le=p&g;if(S&&(z=M?S(l,k,M,j):S(l)),z!==n)return z;if(!jt(l))return l;var ce=qe(l);if(ce){if(z=zL(l),!q)return Gn(l,z)}else{var me=Cn(l),Ee=me==$e||me==Te;if(_i(l))return gw(l,q);if(me==St||me==be||Ee&&!M){if(z=Q||Ee?{}:Iw(l),!q)return Q?NL(l,ZI(z,l)):PL(l,q_(z,l))}else{if(!Nt[me])return M?l:{};z=BL(l,me,q)}}j||(j=new Xr);var De=j.get(l);if(De)return De;j.set(l,z),uS(l)?l.forEach(function(je){z.add(Or(je,p,S,je,l,j))}):lS(l)&&l.forEach(function(je,Je){z.set(Je,Or(je,p,S,Je,l,j))});var Le=le?Q?Rm:Am:Q?Yn:rn,Xe=ce?n:Le(l);return Tr(Xe||l,function(je,Je){Xe&&(Je=je,je=l[Je]),jl(z,Je,Or(je,p,S,Je,l,j))}),z}function JI(l){var p=rn(l);return function(S){return G_(S,l,p)}}function G_(l,p,S){var k=S.length;if(l==null)return!k;for(l=Et(l);k--;){var M=S[k],j=p[M],z=l[M];if(z===n&&!(M in l)||!j(z))return!1}return!0}function K_(l,p,S){if(typeof l!="function")throw new kr(o);return Hl(function(){l.apply(n,S)},p)}function $l(l,p,S,k){var M=-1,j=Hu,z=!0,q=l.length,Q=[],le=p.length;if(!q)return Q;S&&(p=Ot(p,fr(S))),k?(j=Gp,z=!1):p.length>=s&&(j=kl,z=!1,p=new uo(p));e:for(;++M<q;){var ce=l[M],me=S==null?ce:S(ce);if(ce=k||ce!==0?ce:0,z&&me===me){for(var Ee=le;Ee--;)if(p[Ee]===me)continue e;Q.push(ce)}else j(p,me,k)||Q.push(ce)}return Q}var vi=_w(ms),Y_=_w(cm,!0);function eL(l,p){var S=!0;return vi(l,function(k,M,j){return S=!!p(k,M,j),S}),S}function ld(l,p,S){for(var k=-1,M=l.length;++k<M;){var j=l[k],z=p(j);if(z!=null&&(q===n?z===z&&!pr(z):S(z,q)))var q=z,Q=j}return Q}function tL(l,p,S,k){var M=l.length;for(S=Ke(S),S<0&&(S=-S>M?0:M+S),k=k===n||k>M?M:Ke(k),k<0&&(k+=M),k=S>k?0:fS(k);S<k;)l[S++]=p;return l}function X_(l,p){var S=[];return vi(l,function(k,M,j){p(k,M,j)&&S.push(k)}),S}function gn(l,p,S,k,M){var j=-1,z=l.length;for(S||(S=VL),M||(M=[]);++j<z;){var q=l[j];p>0&&S(q)?p>1?gn(q,p-1,S,k,M):pi(M,q):k||(M[M.length]=q)}return M}var lm=ww(),Q_=ww(!0);function ms(l,p){return l&&lm(l,p,rn)}function cm(l,p){return l&&Q_(l,p,rn)}function cd(l,p){return hi(p,function(S){return zs(l[S])})}function ho(l,p){p=bi(p,l);for(var S=0,k=p.length;l!=null&&S<k;)l=l[vs(p[S++])];return S&&S==k?l:n}function Z_(l,p,S){var k=p(l);return qe(l)?k:pi(k,S(l))}function Ln(l){return l==null?l===n?ie:ut:lo&&lo in Et(l)?jL(l):XL(l)}function um(l,p){return l>p}function nL(l,p){return l!=null&&bt.call(l,p)}function rL(l,p){return l!=null&&p in Et(l)}function sL(l,p,S){return l>=Sn(p,S)&&l<Qt(p,S)}function dm(l,p,S){for(var k=S?Gp:Hu,M=l[0].length,j=l.length,z=j,q=ne(j),Q=1/0,le=[];z--;){var ce=l[z];z&&p&&(ce=Ot(ce,fr(p))),Q=Sn(ce.length,Q),q[z]=!S&&(p||M>=120&&ce.length>=120)?new uo(z&&ce):n}ce=l[0];var me=-1,Ee=q[0];e:for(;++me<M&&le.length<Q;){var De=ce[me],Le=p?p(De):De;if(De=S||De!==0?De:0,!(Ee?kl(Ee,Le):k(le,Le,S))){for(z=j;--z;){var Xe=q[z];if(!(Xe?kl(Xe,Le):k(l[z],Le,S)))continue e}Ee&&Ee.push(Le),le.push(De)}}return le}function iL(l,p,S,k){return ms(l,function(M,j,z){p(k,S(M),j,z)}),k}function Fl(l,p,S){p=bi(p,l),l=Fw(l,p);var k=l==null?l:l[vs(Ir(p))];return k==null?n:dr(k,l,S)}function J_(l){return Ft(l)&&Ln(l)==be}function oL(l){return Ft(l)&&Ln(l)==pe}function aL(l){return Ft(l)&&Ln(l)==Oe}function zl(l,p,S,k,M){return l===p?!0:l==null||p==null||!Ft(l)&&!Ft(p)?l!==l&&p!==p:lL(l,p,S,k,zl,M)}function lL(l,p,S,k,M,j){var z=qe(l),q=qe(p),Q=z?xe:Cn(l),le=q?xe:Cn(p);Q=Q==be?St:Q,le=le==be?St:le;var ce=Q==St,me=le==St,Ee=Q==le;if(Ee&&_i(l)){if(!_i(p))return!1;z=!0,ce=!1}if(Ee&&!ce)return j||(j=new Xr),z||Ea(l)?Dw(l,p,S,k,M,j):IL(l,p,Q,S,k,M,j);if(!(S&v)){var De=ce&&bt.call(l,"__wrapped__"),Le=me&&bt.call(p,"__wrapped__");if(De||Le){var Xe=De?l.value():l,je=Le?p.value():p;return j||(j=new Xr),M(Xe,je,S,k,j)}}return Ee?(j||(j=new Xr),LL(l,p,S,k,M,j)):!1}function cL(l){return Ft(l)&&Cn(l)==Ue}function fm(l,p,S,k){var M=S.length,j=M,z=!k;if(l==null)return!j;for(l=Et(l);M--;){var q=S[M];if(z&&q[2]?q[1]!==l[q[0]]:!(q[0]in l))return!1}for(;++M<j;){q=S[M];var Q=q[0],le=l[Q],ce=q[1];if(z&&q[2]){if(le===n&&!(Q in l))return!1}else{var me=new Xr;if(k)var Ee=k(le,ce,Q,l,p,me);if(!(Ee===n?zl(ce,le,v|m,k,me):Ee))return!1}}return!0}function ew(l){if(!jt(l)||WL(l))return!1;var p=zs(l)?cI:Wn;return p.test(mo(l))}function uL(l){return Ft(l)&&Ln(l)==hn}function dL(l){return Ft(l)&&Cn(l)==It}function fL(l){return Ft(l)&&Ad(l.length)&&!!Tt[Ln(l)]}function tw(l){return typeof l=="function"?l:l==null?Xn:typeof l=="object"?qe(l)?sw(l[0],l[1]):rw(l):SS(l)}function hm(l){if(!Vl(l))return mI(l);var p=[];for(var S in Et(l))bt.call(l,S)&&S!="constructor"&&p.push(S);return p}function hL(l){if(!jt(l))return YL(l);var p=Vl(l),S=[];for(var k in l)k=="constructor"&&(p||!bt.call(l,k))||S.push(k);return S}function pm(l,p){return l<p}function nw(l,p){var S=-1,k=Kn(l)?ne(l.length):[];return vi(l,function(M,j,z){k[++S]=p(M,j,z)}),k}function rw(l){var p=Nm(l);return p.length==1&&p[0][2]?jw(p[0][0],p[0][1]):function(S){return S===l||fm(S,l,p)}}function sw(l,p){return km(l)&&Lw(p)?jw(vs(l),p):function(S){var k=Bm(S,l);return k===n&&k===p?Um(S,l):zl(p,k,v|m)}}function ud(l,p,S,k,M){l!==p&&lm(p,function(j,z){if(M||(M=new Xr),jt(j))pL(l,p,z,S,ud,k,M);else{var q=k?k(Om(l,z),j,z+"",l,p,M):n;q===n&&(q=j),om(l,z,q)}},Yn)}function pL(l,p,S,k,M,j,z){var q=Om(l,S),Q=Om(p,S),le=z.get(Q);if(le){om(l,S,le);return}var ce=j?j(q,Q,S+"",l,p,z):n,me=ce===n;if(me){var Ee=qe(Q),De=!Ee&&_i(Q),Le=!Ee&&!De&&Ea(Q);ce=Q,Ee||De||Le?qe(q)?ce=q:Vt(q)?ce=Gn(q):De?(me=!1,ce=gw(Q,!0)):Le?(me=!1,ce=vw(Q,!0)):ce=[]:Wl(Q)||go(Q)?(ce=q,go(q)?ce=hS(q):(!jt(q)||zs(q))&&(ce=Iw(Q))):me=!1}me&&(z.set(Q,ce),M(ce,Q,k,j,z),z.delete(Q)),om(l,S,ce)}function iw(l,p){var S=l.length;if(S)return p+=p<0?S:0,Fs(p,S)?l[p]:n}function ow(l,p,S){p.length?p=Ot(p,function(j){return qe(j)?function(z){return ho(z,j.length===1?j[0]:j)}:j}):p=[Xn];var k=-1;p=Ot(p,fr(Ie()));var M=nw(l,function(j,z,q){var Q=Ot(p,function(le){return le(j)});return{criteria:Q,index:++k,value:j}});return BM(M,function(j,z){return RL(j,z,S)})}function mL(l,p){return aw(l,p,function(S,k){return Um(l,k)})}function aw(l,p,S){for(var k=-1,M=p.length,j={};++k<M;){var z=p[k],q=ho(l,z);S(q,z)&&Bl(j,bi(z,l),q)}return j}function gL(l){return function(p){return ho(p,l)}}function mm(l,p,S,k){var M=k?zM:pa,j=-1,z=p.length,q=l;for(l===p&&(p=Gn(p)),S&&(q=Ot(l,fr(S)));++j<z;)for(var Q=0,le=p[j],ce=S?S(le):le;(Q=M(q,ce,Q,k))>-1;)q!==l&&ed.call(q,Q,1),ed.call(l,Q,1);return l}function lw(l,p){for(var S=l?p.length:0,k=S-1;S--;){var M=p[S];if(S==k||M!==j){var j=M;Fs(M)?ed.call(l,M,1):bm(l,M)}}return l}function gm(l,p){return l+rd(U_()*(p-l+1))}function vL(l,p,S,k){for(var M=-1,j=Qt(nd((p-l)/(S||1)),0),z=ne(j);j--;)z[k?j:++M]=l,l+=S;return z}function vm(l,p){var S="";if(!l||p<1||p>H)return S;do p%2&&(S+=l),p=rd(p/2),p&&(l+=l);while(p);return S}function Qe(l,p){return Mm($w(l,p,Xn),l+"")}function yL(l){return W_(Aa(l))}function bL(l,p){var S=Aa(l);return xd(S,fo(p,0,S.length))}function Bl(l,p,S,k){if(!jt(l))return l;p=bi(p,l);for(var M=-1,j=p.length,z=j-1,q=l;q!=null&&++M<j;){var Q=vs(p[M]),le=S;if(Q==="__proto__"||Q==="constructor"||Q==="prototype")return l;if(M!=z){var ce=q[Q];le=k?k(ce,Q,q):n,le===n&&(le=jt(ce)?ce:Fs(p[M+1])?[]:{})}jl(q,Q,le),q=q[Q]}return l}var cw=sd?function(l,p){return sd.set(l,p),l}:Xn,xL=td?function(l,p){return td(l,"toString",{configurable:!0,enumerable:!1,value:Hm(p),writable:!0})}:Xn;function _L(l){return xd(Aa(l))}function Mr(l,p,S){var k=-1,M=l.length;p<0&&(p=-p>M?0:M+p),S=S>M?M:S,S<0&&(S+=M),M=p>S?0:S-p>>>0,p>>>=0;for(var j=ne(M);++k<M;)j[k]=l[k+p];return j}function wL(l,p){var S;return vi(l,function(k,M,j){return S=p(k,M,j),!S}),!!S}function dd(l,p,S){var k=0,M=l==null?k:l.length;if(typeof p=="number"&&p===p&&M<=te){for(;k<M;){var j=k+M>>>1,z=l[j];z!==null&&!pr(z)&&(S?z<=p:z<p)?k=j+1:M=j}return M}return ym(l,p,Xn,S)}function ym(l,p,S,k){var M=0,j=l==null?0:l.length;if(j===0)return 0;p=S(p);for(var z=p!==p,q=p===null,Q=pr(p),le=p===n;M<j;){var ce=rd((M+j)/2),me=S(l[ce]),Ee=me!==n,De=me===null,Le=me===me,Xe=pr(me);if(z)var je=k||Le;else le?je=Le&&(k||Ee):q?je=Le&&Ee&&(k||!De):Q?je=Le&&Ee&&!De&&(k||!Xe):De||Xe?je=!1:je=k?me<=p:me<p;je?M=ce+1:j=ce}return Sn(j,J)}function uw(l,p){for(var S=-1,k=l.length,M=0,j=[];++S<k;){var z=l[S],q=p?p(z):z;if(!S||!Qr(q,Q)){var Q=q;j[M++]=z===0?0:z}}return j}function dw(l){return typeof l=="number"?l:pr(l)?he:+l}function hr(l){if(typeof l=="string")return l;if(qe(l))return Ot(l,hr)+"";if(pr(l))return V_?V_.call(l):"";var p=l+"";return p=="0"&&1/l==-1/0?"-0":p}function yi(l,p,S){var k=-1,M=Hu,j=l.length,z=!0,q=[],Q=q;if(S)z=!1,M=Gp;else if(j>=s){var le=p?null:OL(l);if(le)return qu(le);z=!1,M=kl,Q=new uo}else Q=p?[]:q;e:for(;++k<j;){var ce=l[k],me=p?p(ce):ce;if(ce=S||ce!==0?ce:0,z&&me===me){for(var Ee=Q.length;Ee--;)if(Q[Ee]===me)continue e;p&&Q.push(me),q.push(ce)}else M(Q,me,S)||(Q!==q&&Q.push(me),q.push(ce))}return q}function bm(l,p){return p=bi(p,l),l=Fw(l,p),l==null||delete l[vs(Ir(p))]}function fw(l,p,S,k){return Bl(l,p,S(ho(l,p)),k)}function fd(l,p,S,k){for(var M=l.length,j=k?M:-1;(k?j--:++j<M)&&p(l[j],j,l););return S?Mr(l,k?0:j,k?j+1:M):Mr(l,k?j+1:0,k?M:j)}function hw(l,p){var S=l;return S instanceof et&&(S=S.value()),Kp(p,function(k,M){return M.func.apply(M.thisArg,pi([k],M.args))},S)}function xm(l,p,S){var k=l.length;if(k<2)return k?yi(l[0]):[];for(var M=-1,j=ne(k);++M<k;)for(var z=l[M],q=-1;++q<k;)q!=M&&(j[M]=$l(j[M]||z,l[q],p,S));return yi(gn(j,1),p,S)}function pw(l,p,S){for(var k=-1,M=l.length,j=p.length,z={};++k<M;){var q=k<j?p[k]:n;S(z,l[k],q)}return z}function _m(l){return Vt(l)?l:[]}function wm(l){return typeof l=="function"?l:Xn}function bi(l,p){return qe(l)?l:km(l,p)?[l]:Vw(vt(l))}var SL=Qe;function xi(l,p,S){var k=l.length;return S=S===n?k:S,!p&&S>=k?l:Mr(l,p,S)}var mw=uI||function(l){return mn.clearTimeout(l)};function gw(l,p){if(p)return l.slice();var S=l.length,k=j_?j_(S):new l.constructor(S);return l.copy(k),k}function Sm(l){var p=new l.constructor(l.byteLength);return new Zu(p).set(new Zu(l)),p}function CL(l,p){var S=p?Sm(l.buffer):l.buffer;return new l.constructor(S,l.byteOffset,l.byteLength)}function EL(l){var p=new l.constructor(l.source,Lt.exec(l));return p.lastIndex=l.lastIndex,p}function AL(l){return Ll?Et(Ll.call(l)):{}}function vw(l,p){var S=p?Sm(l.buffer):l.buffer;return new l.constructor(S,l.byteOffset,l.length)}function yw(l,p){if(l!==p){var S=l!==n,k=l===null,M=l===l,j=pr(l),z=p!==n,q=p===null,Q=p===p,le=pr(p);if(!q&&!le&&!j&&l>p||j&&z&&Q&&!q&&!le||k&&z&&Q||!S&&Q||!M)return 1;if(!k&&!j&&!le&&l<p||le&&S&&M&&!k&&!j||q&&S&&M||!z&&M||!Q)return-1}return 0}function RL(l,p,S){for(var k=-1,M=l.criteria,j=p.criteria,z=M.length,q=S.length;++k<z;){var Q=yw(M[k],j[k]);if(Q){if(k>=q)return Q;var le=S[k];return Q*(le=="desc"?-1:1)}}return l.index-p.index}function bw(l,p,S,k){for(var M=-1,j=l.length,z=S.length,q=-1,Q=p.length,le=Qt(j-z,0),ce=ne(Q+le),me=!k;++q<Q;)ce[q]=p[q];for(;++M<z;)(me||M<j)&&(ce[S[M]]=l[M]);for(;le--;)ce[q++]=l[M++];return ce}function xw(l,p,S,k){for(var M=-1,j=l.length,z=-1,q=S.length,Q=-1,le=p.length,ce=Qt(j-q,0),me=ne(ce+le),Ee=!k;++M<ce;)me[M]=l[M];for(var De=M;++Q<le;)me[De+Q]=p[Q];for(;++z<q;)(Ee||M<j)&&(me[De+S[z]]=l[M++]);return me}function Gn(l,p){var S=-1,k=l.length;for(p||(p=ne(k));++S<k;)p[S]=l[S];return p}function gs(l,p,S,k){var M=!S;S||(S={});for(var j=-1,z=p.length;++j<z;){var q=p[j],Q=k?k(S[q],l[q],q,S,l):n;Q===n&&(Q=l[q]),M?Ls(S,q,Q):jl(S,q,Q)}return S}function PL(l,p){return gs(l,Tm(l),p)}function NL(l,p){return gs(l,Ow(l),p)}function hd(l,p){return function(S,k){var M=qe(S)?MM:QI,j=p?p():{};return M(S,l,Ie(k,2),j)}}function wa(l){return Qe(function(p,S){var k=-1,M=S.length,j=M>1?S[M-1]:n,z=M>2?S[2]:n;for(j=l.length>3&&typeof j=="function"?(M--,j):n,z&&jn(S[0],S[1],z)&&(j=M<3?n:j,M=1),p=Et(p);++k<M;){var q=S[k];q&&l(p,q,k,j)}return p})}function _w(l,p){return function(S,k){if(S==null)return S;if(!Kn(S))return l(S,k);for(var M=S.length,j=p?M:-1,z=Et(S);(p?j--:++j<M)&&k(z[j],j,z)!==!1;);return S}}function ww(l){return function(p,S,k){for(var M=-1,j=Et(p),z=k(p),q=z.length;q--;){var Q=z[l?q:++M];if(S(j[Q],Q,j)===!1)break}return p}}function TL(l,p,S){var k=p&x,M=Ul(l);function j(){var z=this&&this!==mn&&this instanceof j?M:l;return z.apply(k?S:this,arguments)}return j}function Sw(l){return function(p){p=vt(p);var S=ma(p)?Yr(p):n,k=S?S[0]:p.charAt(0),M=S?xi(S,1).join(""):p.slice(1);return k[l]()+M}}function Sa(l){return function(p){return Kp(_S(xS(p).replace(xM,"")),l,"")}}function Ul(l){return function(){var p=arguments;switch(p.length){case 0:return new l;case 1:return new l(p[0]);case 2:return new l(p[0],p[1]);case 3:return new l(p[0],p[1],p[2]);case 4:return new l(p[0],p[1],p[2],p[3]);case 5:return new l(p[0],p[1],p[2],p[3],p[4]);case 6:return new l(p[0],p[1],p[2],p[3],p[4],p[5]);case 7:return new l(p[0],p[1],p[2],p[3],p[4],p[5],p[6])}var S=_a(l.prototype),k=l.apply(S,p);return jt(k)?k:S}}function kL(l,p,S){var k=Ul(l);function M(){for(var j=arguments.length,z=ne(j),q=j,Q=Ca(M);q--;)z[q]=arguments[q];var le=j<3&&z[0]!==Q&&z[j-1]!==Q?[]:mi(z,Q);if(j-=le.length,j<S)return Pw(l,p,pd,M.placeholder,n,z,le,n,n,S-j);var ce=this&&this!==mn&&this instanceof M?k:l;return dr(ce,this,z)}return M}function Cw(l){return function(p,S,k){var M=Et(p);if(!Kn(p)){var j=Ie(S,3);p=rn(p),S=function(q){return j(M[q],q,M)}}var z=l(p,S,k);return z>-1?M[j?p[z]:z]:n}}function Ew(l){return $s(function(p){var S=p.length,k=S,M=Dr.prototype.thru;for(l&&p.reverse();k--;){var j=p[k];if(typeof j!="function")throw new kr(o);if(M&&!z&&yd(j)=="wrapper")var z=new Dr([],!0)}for(k=z?k:S;++k<S;){j=p[k];var q=yd(j),Q=q=="wrapper"?Pm(j):n;Q&&Dm(Q[0])&&Q[1]==(N|w|R|A)&&!Q[4].length&&Q[9]==1?z=z[yd(Q[0])].apply(z,Q[3]):z=j.length==1&&Dm(j)?z[q]():z.thru(j)}return function(){var le=arguments,ce=le[0];if(z&&le.length==1&&qe(ce))return z.plant(ce).value();for(var me=0,Ee=S?p[me].apply(this,le):ce;++me<S;)Ee=p[me].call(this,Ee);return Ee}})}function pd(l,p,S,k,M,j,z,q,Q,le){var ce=p&N,me=p&x,Ee=p&y,De=p&(w|E),Le=p&D,Xe=Ee?n:Ul(l);function je(){for(var Je=arguments.length,rt=ne(Je),mr=Je;mr--;)rt[mr]=arguments[mr];if(De)var $n=Ca(je),gr=VM(rt,$n);if(k&&(rt=bw(rt,k,M,De)),j&&(rt=xw(rt,j,z,De)),Je-=gr,De&&Je<le){var Ht=mi(rt,$n);return Pw(l,p,pd,je.placeholder,S,rt,Ht,q,Q,le-Je)}var Zr=me?S:this,Us=Ee?Zr[l]:l;return Je=rt.length,q?rt=QL(rt,q):Le&&Je>1&&rt.reverse(),ce&&Q<Je&&(rt.length=Q),this&&this!==mn&&this instanceof je&&(Us=Xe||Ul(Us)),Us.apply(Zr,rt)}return je}function Aw(l,p){return function(S,k){return iL(S,l,p(k),{})}}function md(l,p){return function(S,k){var M;if(S===n&&k===n)return p;if(S!==n&&(M=S),k!==n){if(M===n)return k;typeof S=="string"||typeof k=="string"?(S=hr(S),k=hr(k)):(S=dw(S),k=dw(k)),M=l(S,k)}return M}}function Cm(l){return $s(function(p){return p=Ot(p,fr(Ie())),Qe(function(S){var k=this;return l(p,function(M){return dr(M,k,S)})})})}function gd(l,p){p=p===n?" ":hr(p);var S=p.length;if(S<2)return S?vm(p,l):p;var k=vm(p,nd(l/ga(p)));return ma(p)?xi(Yr(k),0,l).join(""):k.slice(0,l)}function DL(l,p,S,k){var M=p&x,j=Ul(l);function z(){for(var q=-1,Q=arguments.length,le=-1,ce=k.length,me=ne(ce+Q),Ee=this&&this!==mn&&this instanceof z?j:l;++le<ce;)me[le]=k[le];for(;Q--;)me[le++]=arguments[++q];return dr(Ee,M?S:this,me)}return z}function Rw(l){return function(p,S,k){return k&&typeof k!="number"&&jn(p,S,k)&&(S=k=n),p=Bs(p),S===n?(S=p,p=0):S=Bs(S),k=k===n?p<S?1:-1:Bs(k),vL(p,S,k,l)}}function vd(l){return function(p,S){return typeof p=="string"&&typeof S=="string"||(p=Lr(p),S=Lr(S)),l(p,S)}}function Pw(l,p,S,k,M,j,z,q,Q,le){var ce=p&w,me=ce?z:n,Ee=ce?n:z,De=ce?j:n,Le=ce?n:j;p|=ce?R:T,p&=~(ce?T:R),p&b||(p&=-4);var Xe=[l,p,M,De,me,Le,Ee,q,Q,le],je=S.apply(n,Xe);return Dm(l)&&zw(je,Xe),je.placeholder=k,Bw(je,l,p)}function Em(l){var p=Xt[l];return function(S,k){if(S=Lr(S),k=k==null?0:Sn(Ke(k),292),k&&B_(S)){var M=(vt(S)+"e").split("e"),j=p(M[0]+"e"+(+M[1]+k));return M=(vt(j)+"e").split("e"),+(M[0]+"e"+(+M[1]-k))}return p(S)}}var OL=ba&&1/qu(new ba([,-0]))[1]==Y?function(l){return new ba(l)}:Gm;function Nw(l){return function(p){var S=Cn(p);return S==Ue?tm(p):S==It?XM(p):UM(p,l(p))}}function js(l,p,S,k,M,j,z,q){var Q=p&y;if(!Q&&typeof l!="function")throw new kr(o);var le=k?k.length:0;if(le||(p&=-97,k=M=n),z=z===n?z:Qt(Ke(z),0),q=q===n?q:Ke(q),le-=M?M.length:0,p&T){var ce=k,me=M;k=M=n}var Ee=Q?n:Pm(l),De=[l,p,S,k,M,ce,me,j,z,q];if(Ee&&KL(De,Ee),l=De[0],p=De[1],S=De[2],k=De[3],M=De[4],q=De[9]=De[9]===n?Q?0:l.length:Qt(De[9]-le,0),!q&&p&(w|E)&&(p&=-25),!p||p==x)var Le=TL(l,p,S);else p==w||p==E?Le=kL(l,p,q):(p==R||p==(x|R))&&!M.length?Le=DL(l,p,S,k):Le=pd.apply(n,De);var Xe=Ee?cw:zw;return Bw(Xe(Le,De),l,p)}function Tw(l,p,S,k){return l===n||Qr(l,ya[S])&&!bt.call(k,S)?p:l}function kw(l,p,S,k,M,j){return jt(l)&&jt(p)&&(j.set(p,l),ud(l,p,n,kw,j),j.delete(p)),l}function ML(l){return Wl(l)?n:l}function Dw(l,p,S,k,M,j){var z=S&v,q=l.length,Q=p.length;if(q!=Q&&!(z&&Q>q))return!1;var le=j.get(l),ce=j.get(p);if(le&&ce)return le==p&&ce==l;var me=-1,Ee=!0,De=S&m?new uo:n;for(j.set(l,p),j.set(p,l);++me<q;){var Le=l[me],Xe=p[me];if(k)var je=z?k(Xe,Le,me,p,l,j):k(Le,Xe,me,l,p,j);if(je!==n){if(je)continue;Ee=!1;break}if(De){if(!Yp(p,function(Je,rt){if(!kl(De,rt)&&(Le===Je||M(Le,Je,S,k,j)))return De.push(rt)})){Ee=!1;break}}else if(!(Le===Xe||M(Le,Xe,S,k,j))){Ee=!1;break}}return j.delete(l),j.delete(p),Ee}function IL(l,p,S,k,M,j,z){switch(S){case Se:if(l.byteLength!=p.byteLength||l.byteOffset!=p.byteOffset)return!1;l=l.buffer,p=p.buffer;case pe:return!(l.byteLength!=p.byteLength||!j(new Zu(l),new Zu(p)));case Pe:case Oe:case wt:return Qr(+l,+p);case ze:return l.name==p.name&&l.message==p.message;case hn:case U:return l==p+"";case Ue:var q=tm;case It:var Q=k&v;if(q||(q=qu),l.size!=p.size&&!Q)return!1;var le=z.get(l);if(le)return le==p;k|=m,z.set(l,p);var ce=Dw(q(l),q(p),k,M,j,z);return z.delete(l),ce;case ee:if(Ll)return Ll.call(l)==Ll.call(p)}return!1}function LL(l,p,S,k,M,j){var z=S&v,q=Am(l),Q=q.length,le=Am(p),ce=le.length;if(Q!=ce&&!z)return!1;for(var me=Q;me--;){var Ee=q[me];if(!(z?Ee in p:bt.call(p,Ee)))return!1}var De=j.get(l),Le=j.get(p);if(De&&Le)return De==p&&Le==l;var Xe=!0;j.set(l,p),j.set(p,l);for(var je=z;++me<Q;){Ee=q[me];var Je=l[Ee],rt=p[Ee];if(k)var mr=z?k(rt,Je,Ee,p,l,j):k(Je,rt,Ee,l,p,j);if(!(mr===n?Je===rt||M(Je,rt,S,k,j):mr)){Xe=!1;break}je||(je=Ee=="constructor")}if(Xe&&!je){var $n=l.constructor,gr=p.constructor;$n!=gr&&"constructor"in l&&"constructor"in p&&!(typeof $n=="function"&&$n instanceof $n&&typeof gr=="function"&&gr instanceof gr)&&(Xe=!1)}return j.delete(l),j.delete(p),Xe}function $s(l){return Mm($w(l,n,Gw),l+"")}function Am(l){return Z_(l,rn,Tm)}function Rm(l){return Z_(l,Yn,Ow)}var Pm=sd?function(l){return sd.get(l)}:Gm;function yd(l){for(var p=l.name+"",S=xa[p],k=bt.call(xa,p)?S.length:0;k--;){var M=S[k],j=M.func;if(j==null||j==l)return M.name}return p}function Ca(l){var p=bt.call(L,"placeholder")?L:l;return p.placeholder}function Ie(){var l=L.iteratee||Wm;return l=l===Wm?tw:l,arguments.length?l(arguments[0],arguments[1]):l}function bd(l,p){var S=l.__data__;return HL(p)?S[typeof p=="string"?"string":"hash"]:S.map}function Nm(l){for(var p=rn(l),S=p.length;S--;){var k=p[S],M=l[k];p[S]=[k,M,Lw(M)]}return p}function po(l,p){var S=GM(l,p);return ew(S)?S:n}function jL(l){var p=bt.call(l,lo),S=l[lo];try{l[lo]=n;var k=!0}catch{}var M=Xu.call(l);return k&&(p?l[lo]=S:delete l[lo]),M}var Tm=rm?function(l){return l==null?[]:(l=Et(l),hi(rm(l),function(p){return F_.call(l,p)}))}:Km,Ow=rm?function(l){for(var p=[];l;)pi(p,Tm(l)),l=Ju(l);return p}:Km,Cn=Ln;(sm&&Cn(new sm(new ArrayBuffer(1)))!=Se||Ol&&Cn(new Ol)!=Ue||im&&Cn(im.resolve())!=Nn||ba&&Cn(new ba)!=It||Ml&&Cn(new Ml)!=_e)&&(Cn=function(l){var p=Ln(l),S=p==St?l.constructor:n,k=S?mo(S):"";if(k)switch(k){case bI:return Se;case xI:return Ue;case _I:return Nn;case wI:return It;case SI:return _e}return p});function $L(l,p,S){for(var k=-1,M=S.length;++k<M;){var j=S[k],z=j.size;switch(j.type){case"drop":l+=z;break;case"dropRight":p-=z;break;case"take":p=Sn(p,l+z);break;case"takeRight":l=Qt(l,p-z);break}}return{start:l,end:p}}function FL(l){var p=l.match(lt);return p?p[1].split(Ct):[]}function Mw(l,p,S){p=bi(p,l);for(var k=-1,M=p.length,j=!1;++k<M;){var z=vs(p[k]);if(!(j=l!=null&&S(l,z)))break;l=l[z]}return j||++k!=M?j:(M=l==null?0:l.length,!!M&&Ad(M)&&Fs(z,M)&&(qe(l)||go(l)))}function zL(l){var p=l.length,S=new l.constructor(p);return p&&typeof l[0]=="string"&&bt.call(l,"index")&&(S.index=l.index,S.input=l.input),S}function Iw(l){return typeof l.constructor=="function"&&!Vl(l)?_a(Ju(l)):{}}function BL(l,p,S){var k=l.constructor;switch(p){case pe:return Sm(l);case Pe:case Oe:return new k(+l);case Se:return CL(l,S);case Fe:case ft:case ht:case hs:case Mn:case Hr:case Yt:case un:case xn:return vw(l,S);case Ue:return new k;case wt:case U:return new k(l);case hn:return EL(l);case It:return new k;case ee:return AL(l)}}function UL(l,p){var S=p.length;if(!S)return l;var k=S-1;return p[k]=(S>1?"& ":"")+p[k],p=p.join(S>2?", ":" "),l.replace(Ge,`{
|
||
/* [wrapped with `+p+`] */
|
||
`)}function VL(l){return qe(l)||go(l)||!!(z_&&l&&l[z_])}function Fs(l,p){var S=typeof l;return p=p??H,!!p&&(S=="number"||S!="symbol"&&wr.test(l))&&l>-1&&l%1==0&&l<p}function jn(l,p,S){if(!jt(S))return!1;var k=typeof p;return(k=="number"?Kn(S)&&Fs(p,S.length):k=="string"&&p in S)?Qr(S[p],l):!1}function km(l,p){if(qe(l))return!1;var S=typeof l;return S=="number"||S=="symbol"||S=="boolean"||l==null||pr(l)?!0:Kr.test(l)||!sr.test(l)||p!=null&&l in Et(p)}function HL(l){var p=typeof l;return p=="string"||p=="number"||p=="symbol"||p=="boolean"?l!=="__proto__":l===null}function Dm(l){var p=yd(l),S=L[p];if(typeof S!="function"||!(p in et.prototype))return!1;if(l===S)return!0;var k=Pm(S);return!!k&&l===k[0]}function WL(l){return!!L_&&L_ in l}var qL=Ku?zs:Ym;function Vl(l){var p=l&&l.constructor,S=typeof p=="function"&&p.prototype||ya;return l===S}function Lw(l){return l===l&&!jt(l)}function jw(l,p){return function(S){return S==null?!1:S[l]===p&&(p!==n||l in Et(S))}}function GL(l){var p=Cd(l,function(k){return S.size===d&&S.clear(),k}),S=p.cache;return p}function KL(l,p){var S=l[1],k=p[1],M=S|k,j=M<(x|y|N),z=k==N&&S==w||k==N&&S==A&&l[7].length<=p[8]||k==(N|A)&&p[7].length<=p[8]&&S==w;if(!(j||z))return l;k&x&&(l[2]=p[2],M|=S&x?0:b);var q=p[3];if(q){var Q=l[3];l[3]=Q?bw(Q,q,p[4]):q,l[4]=Q?mi(l[3],h):p[4]}return q=p[5],q&&(Q=l[5],l[5]=Q?xw(Q,q,p[6]):q,l[6]=Q?mi(l[5],h):p[6]),q=p[7],q&&(l[7]=q),k&N&&(l[8]=l[8]==null?p[8]:Sn(l[8],p[8])),l[9]==null&&(l[9]=p[9]),l[0]=p[0],l[1]=M,l}function YL(l){var p=[];if(l!=null)for(var S in Et(l))p.push(S);return p}function XL(l){return Xu.call(l)}function $w(l,p,S){return p=Qt(p===n?l.length-1:p,0),function(){for(var k=arguments,M=-1,j=Qt(k.length-p,0),z=ne(j);++M<j;)z[M]=k[p+M];M=-1;for(var q=ne(p+1);++M<p;)q[M]=k[M];return q[p]=S(z),dr(l,this,q)}}function Fw(l,p){return p.length<2?l:ho(l,Mr(p,0,-1))}function QL(l,p){for(var S=l.length,k=Sn(p.length,S),M=Gn(l);k--;){var j=p[k];l[k]=Fs(j,S)?M[j]:n}return l}function Om(l,p){if(!(p==="constructor"&&typeof l[p]=="function")&&p!="__proto__")return l[p]}var zw=Uw(cw),Hl=fI||function(l,p){return mn.setTimeout(l,p)},Mm=Uw(xL);function Bw(l,p,S){var k=p+"";return Mm(l,UL(k,ZL(FL(k),S)))}function Uw(l){var p=0,S=0;return function(){var k=gI(),M=F-(k-S);if(S=k,M>0){if(++p>=$)return arguments[0]}else p=0;return l.apply(n,arguments)}}function xd(l,p){var S=-1,k=l.length,M=k-1;for(p=p===n?k:p;++S<p;){var j=gm(S,M),z=l[j];l[j]=l[S],l[S]=z}return l.length=p,l}var Vw=GL(function(l){var p=[];return l.charCodeAt(0)===46&&p.push(""),l.replace(ir,function(S,k,M,j){p.push(M?j.replace(ot,"$1"):k||S)}),p});function vs(l){if(typeof l=="string"||pr(l))return l;var p=l+"";return p=="0"&&1/l==-1/0?"-0":p}function mo(l){if(l!=null){try{return Yu.call(l)}catch{}try{return l+""}catch{}}return""}function ZL(l,p){return Tr(ae,function(S){var k="_."+S[0];p&S[1]&&!Hu(l,k)&&l.push(k)}),l.sort()}function Hw(l){if(l instanceof et)return l.clone();var p=new Dr(l.__wrapped__,l.__chain__);return p.__actions__=Gn(l.__actions__),p.__index__=l.__index__,p.__values__=l.__values__,p}function JL(l,p,S){(S?jn(l,p,S):p===n)?p=1:p=Qt(Ke(p),0);var k=l==null?0:l.length;if(!k||p<1)return[];for(var M=0,j=0,z=ne(nd(k/p));M<k;)z[j++]=Mr(l,M,M+=p);return z}function ej(l){for(var p=-1,S=l==null?0:l.length,k=0,M=[];++p<S;){var j=l[p];j&&(M[k++]=j)}return M}function tj(){var l=arguments.length;if(!l)return[];for(var p=ne(l-1),S=arguments[0],k=l;k--;)p[k-1]=arguments[k];return pi(qe(S)?Gn(S):[S],gn(p,1))}var nj=Qe(function(l,p){return Vt(l)?$l(l,gn(p,1,Vt,!0)):[]}),rj=Qe(function(l,p){var S=Ir(p);return Vt(S)&&(S=n),Vt(l)?$l(l,gn(p,1,Vt,!0),Ie(S,2)):[]}),sj=Qe(function(l,p){var S=Ir(p);return Vt(S)&&(S=n),Vt(l)?$l(l,gn(p,1,Vt,!0),n,S):[]});function ij(l,p,S){var k=l==null?0:l.length;return k?(p=S||p===n?1:Ke(p),Mr(l,p<0?0:p,k)):[]}function oj(l,p,S){var k=l==null?0:l.length;return k?(p=S||p===n?1:Ke(p),p=k-p,Mr(l,0,p<0?0:p)):[]}function aj(l,p){return l&&l.length?fd(l,Ie(p,3),!0,!0):[]}function lj(l,p){return l&&l.length?fd(l,Ie(p,3),!0):[]}function cj(l,p,S,k){var M=l==null?0:l.length;return M?(S&&typeof S!="number"&&jn(l,p,S)&&(S=0,k=M),tL(l,p,S,k)):[]}function Ww(l,p,S){var k=l==null?0:l.length;if(!k)return-1;var M=S==null?0:Ke(S);return M<0&&(M=Qt(k+M,0)),Wu(l,Ie(p,3),M)}function qw(l,p,S){var k=l==null?0:l.length;if(!k)return-1;var M=k-1;return S!==n&&(M=Ke(S),M=S<0?Qt(k+M,0):Sn(M,k-1)),Wu(l,Ie(p,3),M,!0)}function Gw(l){var p=l==null?0:l.length;return p?gn(l,1):[]}function uj(l){var p=l==null?0:l.length;return p?gn(l,Y):[]}function dj(l,p){var S=l==null?0:l.length;return S?(p=p===n?1:Ke(p),gn(l,p)):[]}function fj(l){for(var p=-1,S=l==null?0:l.length,k={};++p<S;){var M=l[p];k[M[0]]=M[1]}return k}function Kw(l){return l&&l.length?l[0]:n}function hj(l,p,S){var k=l==null?0:l.length;if(!k)return-1;var M=S==null?0:Ke(S);return M<0&&(M=Qt(k+M,0)),pa(l,p,M)}function pj(l){var p=l==null?0:l.length;return p?Mr(l,0,-1):[]}var mj=Qe(function(l){var p=Ot(l,_m);return p.length&&p[0]===l[0]?dm(p):[]}),gj=Qe(function(l){var p=Ir(l),S=Ot(l,_m);return p===Ir(S)?p=n:S.pop(),S.length&&S[0]===l[0]?dm(S,Ie(p,2)):[]}),vj=Qe(function(l){var p=Ir(l),S=Ot(l,_m);return p=typeof p=="function"?p:n,p&&S.pop(),S.length&&S[0]===l[0]?dm(S,n,p):[]});function yj(l,p){return l==null?"":pI.call(l,p)}function Ir(l){var p=l==null?0:l.length;return p?l[p-1]:n}function bj(l,p,S){var k=l==null?0:l.length;if(!k)return-1;var M=k;return S!==n&&(M=Ke(S),M=M<0?Qt(k+M,0):Sn(M,k-1)),p===p?ZM(l,p,M):Wu(l,P_,M,!0)}function xj(l,p){return l&&l.length?iw(l,Ke(p)):n}var _j=Qe(Yw);function Yw(l,p){return l&&l.length&&p&&p.length?mm(l,p):l}function wj(l,p,S){return l&&l.length&&p&&p.length?mm(l,p,Ie(S,2)):l}function Sj(l,p,S){return l&&l.length&&p&&p.length?mm(l,p,n,S):l}var Cj=$s(function(l,p){var S=l==null?0:l.length,k=am(l,p);return lw(l,Ot(p,function(M){return Fs(M,S)?+M:M}).sort(yw)),k});function Ej(l,p){var S=[];if(!(l&&l.length))return S;var k=-1,M=[],j=l.length;for(p=Ie(p,3);++k<j;){var z=l[k];p(z,k,l)&&(S.push(z),M.push(k))}return lw(l,M),S}function Im(l){return l==null?l:yI.call(l)}function Aj(l,p,S){var k=l==null?0:l.length;return k?(S&&typeof S!="number"&&jn(l,p,S)?(p=0,S=k):(p=p==null?0:Ke(p),S=S===n?k:Ke(S)),Mr(l,p,S)):[]}function Rj(l,p){return dd(l,p)}function Pj(l,p,S){return ym(l,p,Ie(S,2))}function Nj(l,p){var S=l==null?0:l.length;if(S){var k=dd(l,p);if(k<S&&Qr(l[k],p))return k}return-1}function Tj(l,p){return dd(l,p,!0)}function kj(l,p,S){return ym(l,p,Ie(S,2),!0)}function Dj(l,p){var S=l==null?0:l.length;if(S){var k=dd(l,p,!0)-1;if(Qr(l[k],p))return k}return-1}function Oj(l){return l&&l.length?uw(l):[]}function Mj(l,p){return l&&l.length?uw(l,Ie(p,2)):[]}function Ij(l){var p=l==null?0:l.length;return p?Mr(l,1,p):[]}function Lj(l,p,S){return l&&l.length?(p=S||p===n?1:Ke(p),Mr(l,0,p<0?0:p)):[]}function jj(l,p,S){var k=l==null?0:l.length;return k?(p=S||p===n?1:Ke(p),p=k-p,Mr(l,p<0?0:p,k)):[]}function $j(l,p){return l&&l.length?fd(l,Ie(p,3),!1,!0):[]}function Fj(l,p){return l&&l.length?fd(l,Ie(p,3)):[]}var zj=Qe(function(l){return yi(gn(l,1,Vt,!0))}),Bj=Qe(function(l){var p=Ir(l);return Vt(p)&&(p=n),yi(gn(l,1,Vt,!0),Ie(p,2))}),Uj=Qe(function(l){var p=Ir(l);return p=typeof p=="function"?p:n,yi(gn(l,1,Vt,!0),n,p)});function Vj(l){return l&&l.length?yi(l):[]}function Hj(l,p){return l&&l.length?yi(l,Ie(p,2)):[]}function Wj(l,p){return p=typeof p=="function"?p:n,l&&l.length?yi(l,n,p):[]}function Lm(l){if(!(l&&l.length))return[];var p=0;return l=hi(l,function(S){if(Vt(S))return p=Qt(S.length,p),!0}),Jp(p,function(S){return Ot(l,Xp(S))})}function Xw(l,p){if(!(l&&l.length))return[];var S=Lm(l);return p==null?S:Ot(S,function(k){return dr(p,n,k)})}var qj=Qe(function(l,p){return Vt(l)?$l(l,p):[]}),Gj=Qe(function(l){return xm(hi(l,Vt))}),Kj=Qe(function(l){var p=Ir(l);return Vt(p)&&(p=n),xm(hi(l,Vt),Ie(p,2))}),Yj=Qe(function(l){var p=Ir(l);return p=typeof p=="function"?p:n,xm(hi(l,Vt),n,p)}),Xj=Qe(Lm);function Qj(l,p){return pw(l||[],p||[],jl)}function Zj(l,p){return pw(l||[],p||[],Bl)}var Jj=Qe(function(l){var p=l.length,S=p>1?l[p-1]:n;return S=typeof S=="function"?(l.pop(),S):n,Xw(l,S)});function Qw(l){var p=L(l);return p.__chain__=!0,p}function e2(l,p){return p(l),l}function _d(l,p){return p(l)}var t2=$s(function(l){var p=l.length,S=p?l[0]:0,k=this.__wrapped__,M=function(j){return am(j,l)};return p>1||this.__actions__.length||!(k instanceof et)||!Fs(S)?this.thru(M):(k=k.slice(S,+S+(p?1:0)),k.__actions__.push({func:_d,args:[M],thisArg:n}),new Dr(k,this.__chain__).thru(function(j){return p&&!j.length&&j.push(n),j}))});function n2(){return Qw(this)}function r2(){return new Dr(this.value(),this.__chain__)}function s2(){this.__values__===n&&(this.__values__=dS(this.value()));var l=this.__index__>=this.__values__.length,p=l?n:this.__values__[this.__index__++];return{done:l,value:p}}function i2(){return this}function o2(l){for(var p,S=this;S instanceof od;){var k=Hw(S);k.__index__=0,k.__values__=n,p?M.__wrapped__=k:p=k;var M=k;S=S.__wrapped__}return M.__wrapped__=l,p}function a2(){var l=this.__wrapped__;if(l instanceof et){var p=l;return this.__actions__.length&&(p=new et(this)),p=p.reverse(),p.__actions__.push({func:_d,args:[Im],thisArg:n}),new Dr(p,this.__chain__)}return this.thru(Im)}function l2(){return hw(this.__wrapped__,this.__actions__)}var c2=hd(function(l,p,S){bt.call(l,S)?++l[S]:Ls(l,S,1)});function u2(l,p,S){var k=qe(l)?A_:eL;return S&&jn(l,p,S)&&(p=n),k(l,Ie(p,3))}function d2(l,p){var S=qe(l)?hi:X_;return S(l,Ie(p,3))}var f2=Cw(Ww),h2=Cw(qw);function p2(l,p){return gn(wd(l,p),1)}function m2(l,p){return gn(wd(l,p),Y)}function g2(l,p,S){return S=S===n?1:Ke(S),gn(wd(l,p),S)}function Zw(l,p){var S=qe(l)?Tr:vi;return S(l,Ie(p,3))}function Jw(l,p){var S=qe(l)?IM:Y_;return S(l,Ie(p,3))}var v2=hd(function(l,p,S){bt.call(l,S)?l[S].push(p):Ls(l,S,[p])});function y2(l,p,S,k){l=Kn(l)?l:Aa(l),S=S&&!k?Ke(S):0;var M=l.length;return S<0&&(S=Qt(M+S,0)),Rd(l)?S<=M&&l.indexOf(p,S)>-1:!!M&&pa(l,p,S)>-1}var b2=Qe(function(l,p,S){var k=-1,M=typeof p=="function",j=Kn(l)?ne(l.length):[];return vi(l,function(z){j[++k]=M?dr(p,z,S):Fl(z,p,S)}),j}),x2=hd(function(l,p,S){Ls(l,S,p)});function wd(l,p){var S=qe(l)?Ot:nw;return S(l,Ie(p,3))}function _2(l,p,S,k){return l==null?[]:(qe(p)||(p=p==null?[]:[p]),S=k?n:S,qe(S)||(S=S==null?[]:[S]),ow(l,p,S))}var w2=hd(function(l,p,S){l[S?0:1].push(p)},function(){return[[],[]]});function S2(l,p,S){var k=qe(l)?Kp:T_,M=arguments.length<3;return k(l,Ie(p,4),S,M,vi)}function C2(l,p,S){var k=qe(l)?LM:T_,M=arguments.length<3;return k(l,Ie(p,4),S,M,Y_)}function E2(l,p){var S=qe(l)?hi:X_;return S(l,Ed(Ie(p,3)))}function A2(l){var p=qe(l)?W_:yL;return p(l)}function R2(l,p,S){(S?jn(l,p,S):p===n)?p=1:p=Ke(p);var k=qe(l)?YI:bL;return k(l,p)}function P2(l){var p=qe(l)?XI:_L;return p(l)}function N2(l){if(l==null)return 0;if(Kn(l))return Rd(l)?ga(l):l.length;var p=Cn(l);return p==Ue||p==It?l.size:hm(l).length}function T2(l,p,S){var k=qe(l)?Yp:wL;return S&&jn(l,p,S)&&(p=n),k(l,Ie(p,3))}var k2=Qe(function(l,p){if(l==null)return[];var S=p.length;return S>1&&jn(l,p[0],p[1])?p=[]:S>2&&jn(p[0],p[1],p[2])&&(p=[p[0]]),ow(l,gn(p,1),[])}),Sd=dI||function(){return mn.Date.now()};function D2(l,p){if(typeof p!="function")throw new kr(o);return l=Ke(l),function(){if(--l<1)return p.apply(this,arguments)}}function eS(l,p,S){return p=S?n:p,p=l&&p==null?l.length:p,js(l,N,n,n,n,n,p)}function tS(l,p){var S;if(typeof p!="function")throw new kr(o);return l=Ke(l),function(){return--l>0&&(S=p.apply(this,arguments)),l<=1&&(p=n),S}}var jm=Qe(function(l,p,S){var k=x;if(S.length){var M=mi(S,Ca(jm));k|=R}return js(l,k,p,S,M)}),nS=Qe(function(l,p,S){var k=x|y;if(S.length){var M=mi(S,Ca(nS));k|=R}return js(p,k,l,S,M)});function rS(l,p,S){p=S?n:p;var k=js(l,w,n,n,n,n,n,p);return k.placeholder=rS.placeholder,k}function sS(l,p,S){p=S?n:p;var k=js(l,E,n,n,n,n,n,p);return k.placeholder=sS.placeholder,k}function iS(l,p,S){var k,M,j,z,q,Q,le=0,ce=!1,me=!1,Ee=!0;if(typeof l!="function")throw new kr(o);p=Lr(p)||0,jt(S)&&(ce=!!S.leading,me="maxWait"in S,j=me?Qt(Lr(S.maxWait)||0,p):j,Ee="trailing"in S?!!S.trailing:Ee);function De(Ht){var Zr=k,Us=M;return k=M=n,le=Ht,z=l.apply(Us,Zr),z}function Le(Ht){return le=Ht,q=Hl(Je,p),ce?De(Ht):z}function Xe(Ht){var Zr=Ht-Q,Us=Ht-le,CS=p-Zr;return me?Sn(CS,j-Us):CS}function je(Ht){var Zr=Ht-Q,Us=Ht-le;return Q===n||Zr>=p||Zr<0||me&&Us>=j}function Je(){var Ht=Sd();if(je(Ht))return rt(Ht);q=Hl(Je,Xe(Ht))}function rt(Ht){return q=n,Ee&&k?De(Ht):(k=M=n,z)}function mr(){q!==n&&mw(q),le=0,k=Q=M=q=n}function $n(){return q===n?z:rt(Sd())}function gr(){var Ht=Sd(),Zr=je(Ht);if(k=arguments,M=this,Q=Ht,Zr){if(q===n)return Le(Q);if(me)return mw(q),q=Hl(Je,p),De(Q)}return q===n&&(q=Hl(Je,p)),z}return gr.cancel=mr,gr.flush=$n,gr}var O2=Qe(function(l,p){return K_(l,1,p)}),M2=Qe(function(l,p,S){return K_(l,Lr(p)||0,S)});function I2(l){return js(l,D)}function Cd(l,p){if(typeof l!="function"||p!=null&&typeof p!="function")throw new kr(o);var S=function(){var k=arguments,M=p?p.apply(this,k):k[0],j=S.cache;if(j.has(M))return j.get(M);var z=l.apply(this,k);return S.cache=j.set(M,z)||j,z};return S.cache=new(Cd.Cache||Is),S}Cd.Cache=Is;function Ed(l){if(typeof l!="function")throw new kr(o);return function(){var p=arguments;switch(p.length){case 0:return!l.call(this);case 1:return!l.call(this,p[0]);case 2:return!l.call(this,p[0],p[1]);case 3:return!l.call(this,p[0],p[1],p[2])}return!l.apply(this,p)}}function L2(l){return tS(2,l)}var j2=SL(function(l,p){p=p.length==1&&qe(p[0])?Ot(p[0],fr(Ie())):Ot(gn(p,1),fr(Ie()));var S=p.length;return Qe(function(k){for(var M=-1,j=Sn(k.length,S);++M<j;)k[M]=p[M].call(this,k[M]);return dr(l,this,k)})}),$m=Qe(function(l,p){var S=mi(p,Ca($m));return js(l,R,n,p,S)}),oS=Qe(function(l,p){var S=mi(p,Ca(oS));return js(l,T,n,p,S)}),$2=$s(function(l,p){return js(l,A,n,n,n,p)});function F2(l,p){if(typeof l!="function")throw new kr(o);return p=p===n?p:Ke(p),Qe(l,p)}function z2(l,p){if(typeof l!="function")throw new kr(o);return p=p==null?0:Qt(Ke(p),0),Qe(function(S){var k=S[p],M=xi(S,0,p);return k&&pi(M,k),dr(l,this,M)})}function B2(l,p,S){var k=!0,M=!0;if(typeof l!="function")throw new kr(o);return jt(S)&&(k="leading"in S?!!S.leading:k,M="trailing"in S?!!S.trailing:M),iS(l,p,{leading:k,maxWait:p,trailing:M})}function U2(l){return eS(l,1)}function V2(l,p){return $m(wm(p),l)}function H2(){if(!arguments.length)return[];var l=arguments[0];return qe(l)?l:[l]}function W2(l){return Or(l,g)}function q2(l,p){return p=typeof p=="function"?p:n,Or(l,g,p)}function G2(l){return Or(l,u|g)}function K2(l,p){return p=typeof p=="function"?p:n,Or(l,u|g,p)}function Y2(l,p){return p==null||G_(l,p,rn(p))}function Qr(l,p){return l===p||l!==l&&p!==p}var X2=vd(um),Q2=vd(function(l,p){return l>=p}),go=J_(function(){return arguments}())?J_:function(l){return Ft(l)&&bt.call(l,"callee")&&!F_.call(l,"callee")},qe=ne.isArray,Z2=x_?fr(x_):oL;function Kn(l){return l!=null&&Ad(l.length)&&!zs(l)}function Vt(l){return Ft(l)&&Kn(l)}function J2(l){return l===!0||l===!1||Ft(l)&&Ln(l)==Pe}var _i=hI||Ym,e$=__?fr(__):aL;function t$(l){return Ft(l)&&l.nodeType===1&&!Wl(l)}function n$(l){if(l==null)return!0;if(Kn(l)&&(qe(l)||typeof l=="string"||typeof l.splice=="function"||_i(l)||Ea(l)||go(l)))return!l.length;var p=Cn(l);if(p==Ue||p==It)return!l.size;if(Vl(l))return!hm(l).length;for(var S in l)if(bt.call(l,S))return!1;return!0}function r$(l,p){return zl(l,p)}function s$(l,p,S){S=typeof S=="function"?S:n;var k=S?S(l,p):n;return k===n?zl(l,p,n,S):!!k}function Fm(l){if(!Ft(l))return!1;var p=Ln(l);return p==ze||p==ke||typeof l.message=="string"&&typeof l.name=="string"&&!Wl(l)}function i$(l){return typeof l=="number"&&B_(l)}function zs(l){if(!jt(l))return!1;var p=Ln(l);return p==$e||p==Te||p==ve||p==cn}function aS(l){return typeof l=="number"&&l==Ke(l)}function Ad(l){return typeof l=="number"&&l>-1&&l%1==0&&l<=H}function jt(l){var p=typeof l;return l!=null&&(p=="object"||p=="function")}function Ft(l){return l!=null&&typeof l=="object"}var lS=w_?fr(w_):cL;function o$(l,p){return l===p||fm(l,p,Nm(p))}function a$(l,p,S){return S=typeof S=="function"?S:n,fm(l,p,Nm(p),S)}function l$(l){return cS(l)&&l!=+l}function c$(l){if(qL(l))throw new We(i);return ew(l)}function u$(l){return l===null}function d$(l){return l==null}function cS(l){return typeof l=="number"||Ft(l)&&Ln(l)==wt}function Wl(l){if(!Ft(l)||Ln(l)!=St)return!1;var p=Ju(l);if(p===null)return!0;var S=bt.call(p,"constructor")&&p.constructor;return typeof S=="function"&&S instanceof S&&Yu.call(S)==aI}var zm=S_?fr(S_):uL;function f$(l){return aS(l)&&l>=-9007199254740991&&l<=H}var uS=C_?fr(C_):dL;function Rd(l){return typeof l=="string"||!qe(l)&&Ft(l)&&Ln(l)==U}function pr(l){return typeof l=="symbol"||Ft(l)&&Ln(l)==ee}var Ea=E_?fr(E_):fL;function h$(l){return l===n}function p$(l){return Ft(l)&&Cn(l)==_e}function m$(l){return Ft(l)&&Ln(l)==we}var g$=vd(pm),v$=vd(function(l,p){return l<=p});function dS(l){if(!l)return[];if(Kn(l))return Rd(l)?Yr(l):Gn(l);if(Dl&&l[Dl])return YM(l[Dl]());var p=Cn(l),S=p==Ue?tm:p==It?qu:Aa;return S(l)}function Bs(l){if(!l)return l===0?l:0;if(l=Lr(l),l===Y||l===-1/0){var p=l<0?-1:1;return p*se}return l===l?l:0}function Ke(l){var p=Bs(l),S=p%1;return p===p?S?p-S:p:0}function fS(l){return l?fo(Ke(l),0,re):0}function Lr(l){if(typeof l=="number")return l;if(pr(l))return he;if(jt(l)){var p=typeof l.valueOf=="function"?l.valueOf():l;l=jt(p)?p+"":p}if(typeof l!="string")return l===0?l:+l;l=k_(l);var S=ps.test(l);return S||pn.test(l)?DM(l.slice(2),S?2:8):Jt.test(l)?he:+l}function hS(l){return gs(l,Yn(l))}function y$(l){return l?fo(Ke(l),-9007199254740991,H):l===0?l:0}function vt(l){return l==null?"":hr(l)}var b$=wa(function(l,p){if(Vl(p)||Kn(p)){gs(p,rn(p),l);return}for(var S in p)bt.call(p,S)&&jl(l,S,p[S])}),pS=wa(function(l,p){gs(p,Yn(p),l)}),Pd=wa(function(l,p,S,k){gs(p,Yn(p),l,k)}),x$=wa(function(l,p,S,k){gs(p,rn(p),l,k)}),_$=$s(am);function w$(l,p){var S=_a(l);return p==null?S:q_(S,p)}var S$=Qe(function(l,p){l=Et(l);var S=-1,k=p.length,M=k>2?p[2]:n;for(M&&jn(p[0],p[1],M)&&(k=1);++S<k;)for(var j=p[S],z=Yn(j),q=-1,Q=z.length;++q<Q;){var le=z[q],ce=l[le];(ce===n||Qr(ce,ya[le])&&!bt.call(l,le))&&(l[le]=j[le])}return l}),C$=Qe(function(l){return l.push(n,kw),dr(mS,n,l)});function E$(l,p){return R_(l,Ie(p,3),ms)}function A$(l,p){return R_(l,Ie(p,3),cm)}function R$(l,p){return l==null?l:lm(l,Ie(p,3),Yn)}function P$(l,p){return l==null?l:Q_(l,Ie(p,3),Yn)}function N$(l,p){return l&&ms(l,Ie(p,3))}function T$(l,p){return l&&cm(l,Ie(p,3))}function k$(l){return l==null?[]:cd(l,rn(l))}function D$(l){return l==null?[]:cd(l,Yn(l))}function Bm(l,p,S){var k=l==null?n:ho(l,p);return k===n?S:k}function O$(l,p){return l!=null&&Mw(l,p,nL)}function Um(l,p){return l!=null&&Mw(l,p,rL)}var M$=Aw(function(l,p,S){p!=null&&typeof p.toString!="function"&&(p=Xu.call(p)),l[p]=S},Hm(Xn)),I$=Aw(function(l,p,S){p!=null&&typeof p.toString!="function"&&(p=Xu.call(p)),bt.call(l,p)?l[p].push(S):l[p]=[S]},Ie),L$=Qe(Fl);function rn(l){return Kn(l)?H_(l):hm(l)}function Yn(l){return Kn(l)?H_(l,!0):hL(l)}function j$(l,p){var S={};return p=Ie(p,3),ms(l,function(k,M,j){Ls(S,p(k,M,j),k)}),S}function $$(l,p){var S={};return p=Ie(p,3),ms(l,function(k,M,j){Ls(S,M,p(k,M,j))}),S}var F$=wa(function(l,p,S){ud(l,p,S)}),mS=wa(function(l,p,S,k){ud(l,p,S,k)}),z$=$s(function(l,p){var S={};if(l==null)return S;var k=!1;p=Ot(p,function(j){return j=bi(j,l),k||(k=j.length>1),j}),gs(l,Rm(l),S),k&&(S=Or(S,u|f|g,ML));for(var M=p.length;M--;)bm(S,p[M]);return S});function B$(l,p){return gS(l,Ed(Ie(p)))}var U$=$s(function(l,p){return l==null?{}:mL(l,p)});function gS(l,p){if(l==null)return{};var S=Ot(Rm(l),function(k){return[k]});return p=Ie(p),aw(l,S,function(k,M){return p(k,M[0])})}function V$(l,p,S){p=bi(p,l);var k=-1,M=p.length;for(M||(M=1,l=n);++k<M;){var j=l==null?n:l[vs(p[k])];j===n&&(k=M,j=S),l=zs(j)?j.call(l):j}return l}function H$(l,p,S){return l==null?l:Bl(l,p,S)}function W$(l,p,S,k){return k=typeof k=="function"?k:n,l==null?l:Bl(l,p,S,k)}var vS=Nw(rn),yS=Nw(Yn);function q$(l,p,S){var k=qe(l),M=k||_i(l)||Ea(l);if(p=Ie(p,4),S==null){var j=l&&l.constructor;M?S=k?new j:[]:jt(l)?S=zs(j)?_a(Ju(l)):{}:S={}}return(M?Tr:ms)(l,function(z,q,Q){return p(S,z,q,Q)}),S}function G$(l,p){return l==null?!0:bm(l,p)}function K$(l,p,S){return l==null?l:fw(l,p,wm(S))}function Y$(l,p,S,k){return k=typeof k=="function"?k:n,l==null?l:fw(l,p,wm(S),k)}function Aa(l){return l==null?[]:em(l,rn(l))}function X$(l){return l==null?[]:em(l,Yn(l))}function Q$(l,p,S){return S===n&&(S=p,p=n),S!==n&&(S=Lr(S),S=S===S?S:0),p!==n&&(p=Lr(p),p=p===p?p:0),fo(Lr(l),p,S)}function Z$(l,p,S){return p=Bs(p),S===n?(S=p,p=0):S=Bs(S),l=Lr(l),sL(l,p,S)}function J$(l,p,S){if(S&&typeof S!="boolean"&&jn(l,p,S)&&(p=S=n),S===n&&(typeof p=="boolean"?(S=p,p=n):typeof l=="boolean"&&(S=l,l=n)),l===n&&p===n?(l=0,p=1):(l=Bs(l),p===n?(p=l,l=0):p=Bs(p)),l>p){var k=l;l=p,p=k}if(S||l%1||p%1){var M=U_();return Sn(l+M*(p-l+kM("1e-"+((M+"").length-1))),p)}return gm(l,p)}var eF=Sa(function(l,p,S){return p=p.toLowerCase(),l+(S?bS(p):p)});function bS(l){return Vm(vt(l).toLowerCase())}function xS(l){return l=vt(l),l&&l.replace(Lc,HM).replace(_M,"")}function tF(l,p,S){l=vt(l),p=hr(p);var k=l.length;S=S===n?k:fo(Ke(S),0,k);var M=S;return S-=p.length,S>=0&&l.slice(S,M)==p}function nF(l){return l=vt(l),l&&Gt.test(l)?l.replace(yt,WM):l}function rF(l){return l=vt(l),l&&ye.test(l)?l.replace(de,"\\$&"):l}var sF=Sa(function(l,p,S){return l+(S?"-":"")+p.toLowerCase()}),iF=Sa(function(l,p,S){return l+(S?" ":"")+p.toLowerCase()}),oF=Sw("toLowerCase");function aF(l,p,S){l=vt(l),p=Ke(p);var k=p?ga(l):0;if(!p||k>=p)return l;var M=(p-k)/2;return gd(rd(M),S)+l+gd(nd(M),S)}function lF(l,p,S){l=vt(l),p=Ke(p);var k=p?ga(l):0;return p&&k<p?l+gd(p-k,S):l}function cF(l,p,S){l=vt(l),p=Ke(p);var k=p?ga(l):0;return p&&k<p?gd(p-k,S)+l:l}function uF(l,p,S){return S||p==null?p=0:p&&(p=+p),vI(vt(l).replace(Ce,""),p||0)}function dF(l,p,S){return(S?jn(l,p,S):p===n)?p=1:p=Ke(p),vm(vt(l),p)}function fF(){var l=arguments,p=vt(l[0]);return l.length<3?p:p.replace(l[1],l[2])}var hF=Sa(function(l,p,S){return l+(S?"_":"")+p.toLowerCase()});function pF(l,p,S){return S&&typeof S!="number"&&jn(l,p,S)&&(p=S=n),S=S===n?re:S>>>0,S?(l=vt(l),l&&(typeof p=="string"||p!=null&&!zm(p))&&(p=hr(p),!p&&ma(l))?xi(Yr(l),0,S):l.split(p,S)):[]}var mF=Sa(function(l,p,S){return l+(S?" ":"")+Vm(p)});function gF(l,p,S){return l=vt(l),S=S==null?0:fo(Ke(S),0,l.length),p=hr(p),l.slice(S,S+p.length)==p}function vF(l,p,S){var k=L.templateSettings;S&&jn(l,p,S)&&(p=n),l=vt(l),p=Pd({},p,k,Tw);var M=Pd({},p.imports,k.imports,Tw),j=rn(M),z=em(M,j),q,Q,le=0,ce=p.interpolate||oo,me="__p += '",Ee=nm((p.escape||oo).source+"|"+ce.source+"|"+(ce===Tn?gt:oo).source+"|"+(p.evaluate||oo).source+"|$","g"),De="//# sourceURL="+(bt.call(p,"sourceURL")?(p.sourceURL+"").replace(/\s/g," "):"lodash.templateSources["+ ++AM+"]")+`
|
||
`;l.replace(Ee,function(je,Je,rt,mr,$n,gr){return rt||(rt=mr),me+=l.slice(le,gr).replace(fa,qM),Je&&(q=!0,me+=`' +
|
||
__e(`+Je+`) +
|
||
'`),$n&&(Q=!0,me+=`';
|
||
`+$n+`;
|
||
__p += '`),rt&&(me+=`' +
|
||
((__t = (`+rt+`)) == null ? '' : __t) +
|
||
'`),le=gr+je.length,je}),me+=`';
|
||
`;var Le=bt.call(p,"variable")&&p.variable;if(!Le)me=`with (obj) {
|
||
`+me+`
|
||
}
|
||
`;else if(dt.test(Le))throw new We(a);me=(Q?me.replace(Ze,""):me).replace(Rt,"$1").replace(Pt,"$1;"),me="function("+(Le||"obj")+`) {
|
||
`+(Le?"":`obj || (obj = {});
|
||
`)+"var __t, __p = ''"+(q?", __e = _.escape":"")+(Q?`, __j = Array.prototype.join;
|
||
function print() { __p += __j.call(arguments, '') }
|
||
`:`;
|
||
`)+me+`return __p
|
||
}`;var Xe=wS(function(){return pt(j,De+"return "+me).apply(n,z)});if(Xe.source=me,Fm(Xe))throw Xe;return Xe}function yF(l){return vt(l).toLowerCase()}function bF(l){return vt(l).toUpperCase()}function xF(l,p,S){if(l=vt(l),l&&(S||p===n))return k_(l);if(!l||!(p=hr(p)))return l;var k=Yr(l),M=Yr(p),j=D_(k,M),z=O_(k,M)+1;return xi(k,j,z).join("")}function _F(l,p,S){if(l=vt(l),l&&(S||p===n))return l.slice(0,I_(l)+1);if(!l||!(p=hr(p)))return l;var k=Yr(l),M=O_(k,Yr(p))+1;return xi(k,0,M).join("")}function wF(l,p,S){if(l=vt(l),l&&(S||p===n))return l.replace(Ce,"");if(!l||!(p=hr(p)))return l;var k=Yr(l),M=D_(k,Yr(p));return xi(k,M).join("")}function SF(l,p){var S=O,k=I;if(jt(p)){var M="separator"in p?p.separator:M;S="length"in p?Ke(p.length):S,k="omission"in p?hr(p.omission):k}l=vt(l);var j=l.length;if(ma(l)){var z=Yr(l);j=z.length}if(S>=j)return l;var q=S-ga(k);if(q<1)return k;var Q=z?xi(z,0,q).join(""):l.slice(0,q);if(M===n)return Q+k;if(z&&(q+=Q.length-q),zm(M)){if(l.slice(q).search(M)){var le,ce=Q;for(M.global||(M=nm(M.source,vt(Lt.exec(M))+"g")),M.lastIndex=0;le=M.exec(ce);)var me=le.index;Q=Q.slice(0,me===n?q:me)}}else if(l.indexOf(hr(M),q)!=q){var Ee=Q.lastIndexOf(M);Ee>-1&&(Q=Q.slice(0,Ee))}return Q+k}function CF(l){return l=vt(l),l&&dn.test(l)?l.replace(Ut,JM):l}var EF=Sa(function(l,p,S){return l+(S?" ":"")+p.toUpperCase()}),Vm=Sw("toUpperCase");function _S(l,p,S){return l=vt(l),p=S?n:p,p===n?KM(l)?nI(l):FM(l):l.match(p)||[]}var wS=Qe(function(l,p){try{return dr(l,n,p)}catch(S){return Fm(S)?S:new We(S)}}),AF=$s(function(l,p){return Tr(p,function(S){S=vs(S),Ls(l,S,jm(l[S],l))}),l});function RF(l){var p=l==null?0:l.length,S=Ie();return l=p?Ot(l,function(k){if(typeof k[1]!="function")throw new kr(o);return[S(k[0]),k[1]]}):[],Qe(function(k){for(var M=-1;++M<p;){var j=l[M];if(dr(j[0],this,k))return dr(j[1],this,k)}})}function PF(l){return JI(Or(l,u))}function Hm(l){return function(){return l}}function NF(l,p){return l==null||l!==l?p:l}var TF=Ew(),kF=Ew(!0);function Xn(l){return l}function Wm(l){return tw(typeof l=="function"?l:Or(l,u))}function DF(l){return rw(Or(l,u))}function OF(l,p){return sw(l,Or(p,u))}var MF=Qe(function(l,p){return function(S){return Fl(S,l,p)}}),IF=Qe(function(l,p){return function(S){return Fl(l,S,p)}});function qm(l,p,S){var k=rn(p),M=cd(p,k);S==null&&!(jt(p)&&(M.length||!k.length))&&(S=p,p=l,l=this,M=cd(p,rn(p)));var j=!(jt(S)&&"chain"in S)||!!S.chain,z=zs(l);return Tr(M,function(q){var Q=p[q];l[q]=Q,z&&(l.prototype[q]=function(){var le=this.__chain__;if(j||le){var ce=l(this.__wrapped__),me=ce.__actions__=Gn(this.__actions__);return me.push({func:Q,args:arguments,thisArg:l}),ce.__chain__=le,ce}return Q.apply(l,pi([this.value()],arguments))})}),l}function LF(){return mn._===this&&(mn._=lI),this}function Gm(){}function jF(l){return l=Ke(l),Qe(function(p){return iw(p,l)})}var $F=Cm(Ot),FF=Cm(A_),zF=Cm(Yp);function SS(l){return km(l)?Xp(vs(l)):gL(l)}function BF(l){return function(p){return l==null?n:ho(l,p)}}var UF=Rw(),VF=Rw(!0);function Km(){return[]}function Ym(){return!1}function HF(){return{}}function WF(){return""}function qF(){return!0}function GF(l,p){if(l=Ke(l),l<1||l>H)return[];var S=re,k=Sn(l,re);p=Ie(p),l-=re;for(var M=Jp(k,p);++S<l;)p(S);return M}function KF(l){return qe(l)?Ot(l,vs):pr(l)?[l]:Gn(Vw(vt(l)))}function YF(l){var p=++oI;return vt(l)+p}var XF=md(function(l,p){return l+p},0),QF=Em("ceil"),ZF=md(function(l,p){return l/p},1),JF=Em("floor");function e3(l){return l&&l.length?ld(l,Xn,um):n}function t3(l,p){return l&&l.length?ld(l,Ie(p,2),um):n}function n3(l){return N_(l,Xn)}function r3(l,p){return N_(l,Ie(p,2))}function s3(l){return l&&l.length?ld(l,Xn,pm):n}function i3(l,p){return l&&l.length?ld(l,Ie(p,2),pm):n}var o3=md(function(l,p){return l*p},1),a3=Em("round"),l3=md(function(l,p){return l-p},0);function c3(l){return l&&l.length?Zp(l,Xn):0}function u3(l,p){return l&&l.length?Zp(l,Ie(p,2)):0}return L.after=D2,L.ary=eS,L.assign=b$,L.assignIn=pS,L.assignInWith=Pd,L.assignWith=x$,L.at=_$,L.before=tS,L.bind=jm,L.bindAll=AF,L.bindKey=nS,L.castArray=H2,L.chain=Qw,L.chunk=JL,L.compact=ej,L.concat=tj,L.cond=RF,L.conforms=PF,L.constant=Hm,L.countBy=c2,L.create=w$,L.curry=rS,L.curryRight=sS,L.debounce=iS,L.defaults=S$,L.defaultsDeep=C$,L.defer=O2,L.delay=M2,L.difference=nj,L.differenceBy=rj,L.differenceWith=sj,L.drop=ij,L.dropRight=oj,L.dropRightWhile=aj,L.dropWhile=lj,L.fill=cj,L.filter=d2,L.flatMap=p2,L.flatMapDeep=m2,L.flatMapDepth=g2,L.flatten=Gw,L.flattenDeep=uj,L.flattenDepth=dj,L.flip=I2,L.flow=TF,L.flowRight=kF,L.fromPairs=fj,L.functions=k$,L.functionsIn=D$,L.groupBy=v2,L.initial=pj,L.intersection=mj,L.intersectionBy=gj,L.intersectionWith=vj,L.invert=M$,L.invertBy=I$,L.invokeMap=b2,L.iteratee=Wm,L.keyBy=x2,L.keys=rn,L.keysIn=Yn,L.map=wd,L.mapKeys=j$,L.mapValues=$$,L.matches=DF,L.matchesProperty=OF,L.memoize=Cd,L.merge=F$,L.mergeWith=mS,L.method=MF,L.methodOf=IF,L.mixin=qm,L.negate=Ed,L.nthArg=jF,L.omit=z$,L.omitBy=B$,L.once=L2,L.orderBy=_2,L.over=$F,L.overArgs=j2,L.overEvery=FF,L.overSome=zF,L.partial=$m,L.partialRight=oS,L.partition=w2,L.pick=U$,L.pickBy=gS,L.property=SS,L.propertyOf=BF,L.pull=_j,L.pullAll=Yw,L.pullAllBy=wj,L.pullAllWith=Sj,L.pullAt=Cj,L.range=UF,L.rangeRight=VF,L.rearg=$2,L.reject=E2,L.remove=Ej,L.rest=F2,L.reverse=Im,L.sampleSize=R2,L.set=H$,L.setWith=W$,L.shuffle=P2,L.slice=Aj,L.sortBy=k2,L.sortedUniq=Oj,L.sortedUniqBy=Mj,L.split=pF,L.spread=z2,L.tail=Ij,L.take=Lj,L.takeRight=jj,L.takeRightWhile=$j,L.takeWhile=Fj,L.tap=e2,L.throttle=B2,L.thru=_d,L.toArray=dS,L.toPairs=vS,L.toPairsIn=yS,L.toPath=KF,L.toPlainObject=hS,L.transform=q$,L.unary=U2,L.union=zj,L.unionBy=Bj,L.unionWith=Uj,L.uniq=Vj,L.uniqBy=Hj,L.uniqWith=Wj,L.unset=G$,L.unzip=Lm,L.unzipWith=Xw,L.update=K$,L.updateWith=Y$,L.values=Aa,L.valuesIn=X$,L.without=qj,L.words=_S,L.wrap=V2,L.xor=Gj,L.xorBy=Kj,L.xorWith=Yj,L.zip=Xj,L.zipObject=Qj,L.zipObjectDeep=Zj,L.zipWith=Jj,L.entries=vS,L.entriesIn=yS,L.extend=pS,L.extendWith=Pd,qm(L,L),L.add=XF,L.attempt=wS,L.camelCase=eF,L.capitalize=bS,L.ceil=QF,L.clamp=Q$,L.clone=W2,L.cloneDeep=G2,L.cloneDeepWith=K2,L.cloneWith=q2,L.conformsTo=Y2,L.deburr=xS,L.defaultTo=NF,L.divide=ZF,L.endsWith=tF,L.eq=Qr,L.escape=nF,L.escapeRegExp=rF,L.every=u2,L.find=f2,L.findIndex=Ww,L.findKey=E$,L.findLast=h2,L.findLastIndex=qw,L.findLastKey=A$,L.floor=JF,L.forEach=Zw,L.forEachRight=Jw,L.forIn=R$,L.forInRight=P$,L.forOwn=N$,L.forOwnRight=T$,L.get=Bm,L.gt=X2,L.gte=Q2,L.has=O$,L.hasIn=Um,L.head=Kw,L.identity=Xn,L.includes=y2,L.indexOf=hj,L.inRange=Z$,L.invoke=L$,L.isArguments=go,L.isArray=qe,L.isArrayBuffer=Z2,L.isArrayLike=Kn,L.isArrayLikeObject=Vt,L.isBoolean=J2,L.isBuffer=_i,L.isDate=e$,L.isElement=t$,L.isEmpty=n$,L.isEqual=r$,L.isEqualWith=s$,L.isError=Fm,L.isFinite=i$,L.isFunction=zs,L.isInteger=aS,L.isLength=Ad,L.isMap=lS,L.isMatch=o$,L.isMatchWith=a$,L.isNaN=l$,L.isNative=c$,L.isNil=d$,L.isNull=u$,L.isNumber=cS,L.isObject=jt,L.isObjectLike=Ft,L.isPlainObject=Wl,L.isRegExp=zm,L.isSafeInteger=f$,L.isSet=uS,L.isString=Rd,L.isSymbol=pr,L.isTypedArray=Ea,L.isUndefined=h$,L.isWeakMap=p$,L.isWeakSet=m$,L.join=yj,L.kebabCase=sF,L.last=Ir,L.lastIndexOf=bj,L.lowerCase=iF,L.lowerFirst=oF,L.lt=g$,L.lte=v$,L.max=e3,L.maxBy=t3,L.mean=n3,L.meanBy=r3,L.min=s3,L.minBy=i3,L.stubArray=Km,L.stubFalse=Ym,L.stubObject=HF,L.stubString=WF,L.stubTrue=qF,L.multiply=o3,L.nth=xj,L.noConflict=LF,L.noop=Gm,L.now=Sd,L.pad=aF,L.padEnd=lF,L.padStart=cF,L.parseInt=uF,L.random=J$,L.reduce=S2,L.reduceRight=C2,L.repeat=dF,L.replace=fF,L.result=V$,L.round=a3,L.runInContext=X,L.sample=A2,L.size=N2,L.snakeCase=hF,L.some=T2,L.sortedIndex=Rj,L.sortedIndexBy=Pj,L.sortedIndexOf=Nj,L.sortedLastIndex=Tj,L.sortedLastIndexBy=kj,L.sortedLastIndexOf=Dj,L.startCase=mF,L.startsWith=gF,L.subtract=l3,L.sum=c3,L.sumBy=u3,L.template=vF,L.times=GF,L.toFinite=Bs,L.toInteger=Ke,L.toLength=fS,L.toLower=yF,L.toNumber=Lr,L.toSafeInteger=y$,L.toString=vt,L.toUpper=bF,L.trim=xF,L.trimEnd=_F,L.trimStart=wF,L.truncate=SF,L.unescape=CF,L.uniqueId=YF,L.upperCase=EF,L.upperFirst=Vm,L.each=Zw,L.eachRight=Jw,L.first=Kw,qm(L,function(){var l={};return ms(L,function(p,S){bt.call(L.prototype,S)||(l[S]=p)}),l}(),{chain:!1}),L.VERSION=r,Tr(["bind","bindKey","curry","curryRight","partial","partialRight"],function(l){L[l].placeholder=L}),Tr(["drop","take"],function(l,p){et.prototype[l]=function(S){S=S===n?1:Qt(Ke(S),0);var k=this.__filtered__&&!p?new et(this):this.clone();return k.__filtered__?k.__takeCount__=Sn(S,k.__takeCount__):k.__views__.push({size:Sn(S,re),type:l+(k.__dir__<0?"Right":"")}),k},et.prototype[l+"Right"]=function(S){return this.reverse()[l](S).reverse()}}),Tr(["filter","map","takeWhile"],function(l,p){var S=p+1,k=S==B||S==Z;et.prototype[l]=function(M){var j=this.clone();return j.__iteratees__.push({iteratee:Ie(M,3),type:S}),j.__filtered__=j.__filtered__||k,j}}),Tr(["head","last"],function(l,p){var S="take"+(p?"Right":"");et.prototype[l]=function(){return this[S](1).value()[0]}}),Tr(["initial","tail"],function(l,p){var S="drop"+(p?"":"Right");et.prototype[l]=function(){return this.__filtered__?new et(this):this[S](1)}}),et.prototype.compact=function(){return this.filter(Xn)},et.prototype.find=function(l){return this.filter(l).head()},et.prototype.findLast=function(l){return this.reverse().find(l)},et.prototype.invokeMap=Qe(function(l,p){return typeof l=="function"?new et(this):this.map(function(S){return Fl(S,l,p)})}),et.prototype.reject=function(l){return this.filter(Ed(Ie(l)))},et.prototype.slice=function(l,p){l=Ke(l);var S=this;return S.__filtered__&&(l>0||p<0)?new et(S):(l<0?S=S.takeRight(-l):l&&(S=S.drop(l)),p!==n&&(p=Ke(p),S=p<0?S.dropRight(-p):S.take(p-l)),S)},et.prototype.takeRightWhile=function(l){return this.reverse().takeWhile(l).reverse()},et.prototype.toArray=function(){return this.take(re)},ms(et.prototype,function(l,p){var S=/^(?:filter|find|map|reject)|While$/.test(p),k=/^(?:head|last)$/.test(p),M=L[k?"take"+(p=="last"?"Right":""):p],j=k||/^find/.test(p);M&&(L.prototype[p]=function(){var z=this.__wrapped__,q=k?[1]:arguments,Q=z instanceof et,le=q[0],ce=Q||qe(z),me=function(Je){var rt=M.apply(L,pi([Je],q));return k&&Ee?rt[0]:rt};ce&&S&&typeof le=="function"&&le.length!=1&&(Q=ce=!1);var Ee=this.__chain__,De=!!this.__actions__.length,Le=j&&!Ee,Xe=Q&&!De;if(!j&&ce){z=Xe?z:new et(this);var je=l.apply(z,q);return je.__actions__.push({func:_d,args:[me],thisArg:n}),new Dr(je,Ee)}return Le&&Xe?l.apply(this,q):(je=this.thru(me),Le?k?je.value()[0]:je.value():je)})}),Tr(["pop","push","shift","sort","splice","unshift"],function(l){var p=Gu[l],S=/^(?:push|sort|unshift)$/.test(l)?"tap":"thru",k=/^(?:pop|shift)$/.test(l);L.prototype[l]=function(){var M=arguments;if(k&&!this.__chain__){var j=this.value();return p.apply(qe(j)?j:[],M)}return this[S](function(z){return p.apply(qe(z)?z:[],M)})}}),ms(et.prototype,function(l,p){var S=L[p];if(S){var k=S.name+"";bt.call(xa,k)||(xa[k]=[]),xa[k].push({name:p,func:S})}}),xa[pd(n,y).name]=[{name:"wrapper",func:n}],et.prototype.clone=CI,et.prototype.reverse=EI,et.prototype.value=AI,L.prototype.at=t2,L.prototype.chain=n2,L.prototype.commit=r2,L.prototype.next=s2,L.prototype.plant=o2,L.prototype.reverse=a2,L.prototype.toJSON=L.prototype.valueOf=L.prototype.value=l2,L.prototype.first=L.prototype.head,Dl&&(L.prototype[Dl]=i2),L},va=rI();ao?((ao.exports=va)._=va,Wp._=va):mn._=va}).call(xr)})(bk,bk.exports);var as=bk.exports;const yqe=e=>{console.debug("calculateQuoteTotals",e);const t=Tu.create(e[1]||{amount:null,scale:2});if(t.isFailure)throw t.error;const n=t.object,r=Tu.create(e[2]||{amount:null,scale:2});if(r.isFailure)throw r.error;const s=r.object,i=No.create(e[0]||{amount:null,scale:2});if(i.isFailure)throw i.error;const o=i.object,a=o.percentage(n.toNumber()).convertScale(2),c=o.subtract(a).convertScale(2),d=c.percentage(s.toNumber()).convertScale(2),h=c.add(d).convertScale(2);return{subtotalPrice:o.toObject(),discount:n.toObject(),discountPrice:a.toObject(),priceBeforeTaxes:c.toObject(),tax:s.toObject(),taxesPrice:d.toObject(),totalPrice:h.toObject()}},bqe=({currency:e})=>{const{register:t,formState:n,control:r}=ua(),{formatNumber:s}=jHe(),i=Tse({control:r,name:["subtotal_price","discount","tax"]}),o=yqe(i),a=s(o.subtotalPrice),c=s(o.discountPrice),d=s(o.taxesPrice),h=s(o.totalPrice),u=C.useMemo(()=>e.symbol||"",[e]);return _.jsx(bs,{className:"w-full bg-muted",children:_.jsxs(xs,{className:"flex flex-row items-end gap-2 p-4 border-t",children:[_.jsx("div",{className:"grid flex-1 h-16 grid-cols-1 auto-rows-max",children:_.jsxs("div",{className:"grid gap-1 font-semibold text-right text-muted-foreground",children:[_.jsx(Di,{className:"text-sm",children:ue("quotes.form_fields.subtotal_price.label")}),_.jsxs(ui,{className:"flex items-baseline justify-end text-2xl tabular-nums",children:[a,_.jsx("span",{className:"ml-1 text-lg tracking-normal",children:u})]})]})}),_.jsx(Ef,{orientation:"vertical",className:"w-px h-16 mx-2"}),_.jsxs("div",{className:"grid flex-1 h-16 grid-cols-2 gap-6 auto-rows-max",children:[_.jsxs("div",{className:"grid gap-1 font-medium text-muted-foreground",children:[_.jsx(Di,{className:"text-sm",children:ue("quotes.form_fields.discount.label")}),_.jsx(sk,{scale:2,disabled:n.disabled,placeholder:ue("quotes.form_fields.discount.placeholder"),...t("discount",{required:!1}),onChange:f=>{console.log("discount",f)}})]}),_.jsxs("div",{className:"grid gap-1 font-semibold text-muted-foreground",children:[_.jsx(Di,{className:"text-sm text-right",children:ue("quotes.form_fields.discount_price.label")}),_.jsxs(ui,{className:"flex items-baseline justify-end text-2xl tabular-nums",children:[c,_.jsx("span",{className:"ml-1 text-lg tracking-normal",children:u})]})]})]}),_.jsx(Ef,{orientation:"vertical",className:"w-px h-16 mx-2"}),_.jsxs("div",{className:"grid flex-1 h-16 grid-cols-2 gap-6 auto-rows-max",children:[_.jsxs("div",{className:"grid gap-1 font-medium text-muted-foreground",children:[_.jsx(Di,{className:"text-sm",children:ue("quotes.form_fields.tax.label")}),_.jsx(sk,{scale:2,disabled:n.disabled,placeholder:ue("quotes.form_fields.tax.placeholder"),...t("tax",{required:!1})})]}),_.jsxs("div",{className:"grid gap-1 font-semibold text-muted-foreground",children:[_.jsx(Di,{className:"text-sm text-right",children:ue("quotes.form_fields.tax_price.label")}),_.jsxs(ui,{className:"flex items-baseline justify-end gap-1 text-2xl tabular-nums",children:[d,_.jsx("span",{className:"text-base font-medium tracking-normal",children:u})]})]})]})," ",_.jsx(Ef,{orientation:"vertical",className:"w-px h-16 mx-2"}),_.jsx("div",{className:"grid flex-1 h-16 grid-cols-1 auto-rows-max",children:_.jsxs("div",{className:"grid gap-0",children:[_.jsx(Di,{className:"text-sm font-semibold text-right text-foreground",children:ue("quotes.form_fields.total_price.label")}),_.jsxs(ui,{className:"flex items-baseline justify-end gap-1 text-3xl tabular-nums",children:[h,_.jsx("span",{className:"ml-1 text-lg tracking-normal",children:u})]})]})})]})})},fpe=e=>{const{percentage:t,cancel:n,error:r,isInProgress:s,onFinishDownload:i}=e,o=C.useId();return C.useEffect(()=>{s&&!r&&t===100&&i&&i()},[t,s,r,i]),_.jsx(Fx,{open:s,children:_.jsxs(cy,{className:"sm:max-w-md",children:[_.jsxs(uy,{children:[_.jsx(fy,{children:ue("quotes.downloading_dialog.title")}),_.jsx(GA,{children:ue("quotes.downloading_dialog.description")})]}),_.jsxs("div",{className:"mb-4 space-y-2",id:o,children:[_.jsx(gy,{children:ue("quotes.downloading_dialog.progress.label",{status:ue(s?"quotes.downloading_dialog.progress.status_in_progress":"quotes.downloading_dialog.progress.status_stopped")})}),_.jsx(T8,{value:t,max:100,getValueLabel:()=>ue("quotes.downloading_dialog.progress.label",{})}),r&&_.jsxs("p",{children:["Error: ",JSON.stringify(r)]})]}),_.jsx(dy,{className:"sm:justify-end",children:_.jsx(bT,{asChild:!0,children:_.jsx(at,{type:"button",variant:"secondary",onClick:()=>n(),children:ue("quotes.downloading_dialog.cancel_button")})})})]})})},xqe=({isInProgress:e,percentage:t,elapsed:n,cancel:r,error:s,className:i})=>{const[o,a]=C.useState(10);return C.useEffect(()=>{if(e&&t>0){const c=n/t*100;a(Math.max(0,Math.round(c-n)))}},[e,t,n]),!e&&!(s!=null&&s.errorMessage)?null:_.jsxs(bs,{className:ge("overflow-hidden",i),children:[_.jsx(Go,{children:_.jsxs(ui,{className:"flex items-center justify-between",children:[s!=null&&s.errorMessage?"Error en la generación del PDF":"Generando PDF",e&&_.jsx(obe,{className:"w-4 h-4 animate-spin"}),(s==null?void 0:s.errorMessage)&&_.jsx(ebe,{className:"w-4 h-4 text-destructive"})]})}),_.jsx(xs,{children:s!=null&&s.errorMessage?_.jsx("div",{className:"text-destructive",children:s==null?void 0:s.errorMessage}):_.jsxs("div",{className:"flex flex-col items-center space-y-4",children:[_.jsxs("div",{className:"relative w-32 h-40 overflow-hidden rounded-lg bg-muted",children:[_.jsx("div",{className:"absolute bottom-0 left-0 right-0 transition-all duration-1000 ease-out bg-primary",style:{height:`${t}%`}}),_.jsx(sbe,{className:"absolute transform -translate-x-1/2 -translate-y-1/2 animate-pulse top-1/2 left-1/2 text-muted-foreground",size:48})]}),_.jsx(T8,{value:t,className:"w-full"}),_.jsxs("div",{className:"text-sm text-center text-muted-foreground",children:[_.jsxs("p",{children:["Progreso: ",t,"%"]}),_.jsxs("div",{className:"hidden",children:[_.jsxs("p",{children:["Tiempo transcurrido: ",n," segundos"]}),o>0&&_.jsxs("p",{children:["Tiempo estimado restante: ",o," segundos"]})]})]}),_.jsx(at,{variant:"destructive",onClick:r,className:"hidden",children:"Cancelar generación"})]})})]})},hpe=({quote:e,className:t})=>{const{useReport:n,getQuotePDFFilename:r,useDownloader:s}=ER(),{download:i}=s(),{report:o,preview:a,isInProgress:c,...d}=n(),[h,u]=C.useState(void 0),f=C.useCallback(()=>{e&&i(e.id,r(e))},[e]);return C.useEffect(()=>{const g=setTimeout(()=>{e&&e.id&&a(e.id)},200);return()=>clearTimeout(g)},[e]),C.useEffect(()=>{if(!c&&o){const g=window.URL&&window.URL.createObjectURL?window.URL.createObjectURL(o):window.webkitURL.createObjectURL(o);return u(g),()=>{u(void 0),window.URL.revokeObjectURL(g)}}},[o,c]),e?c?_.jsx(xqe,{isInProgress:c,...d}):_.jsx(OHe,{file:h,className:"object-contain",onThumbnailClick:f}):_.jsx(bs,{className:ge("overflow-hidden",t),children:_.jsx(xs,{className:"px-4 py-6 text-center",children:_.jsx("p",{className:"mx-auto",children:"Select a quote"})})})};hpe.whyDidYouRender=!0;const yV=({onSelect:e})=>{const t=io(),{pagination:n,globalFilter:r,isFiltered:s}=Ey(),[i,o]=C.useState([]),a=(x,y)=>{o(b=>{const w=[...b];return w[x]=y,w})},c=()=>{o([])},{data:d,isPending:h,isError:u,error:f}=Dhe({pagination:{pageIndex:n.pageIndex,pageSize:n.pageSize},searchTerm:r});C.useEffect(()=>{c()},[n,r,s]),console.log(i);const g=r3e(),v=[g.accessor("description",{id:"description",header:()=>_.jsx(_.Fragment,{children:ue("catalog.list.columns.description")})}),g.accessor("points",{id:"points",header:()=>_.jsx("div",{className:"text-right",children:ue("catalog.list.columns.points")}),cell:({renderValue:x})=>_.jsx("div",{className:"text-right",children:x()})}),g.accessor("retail_price",{id:"retail_price",header:()=>_.jsx("div",{className:"text-right",children:ue("catalog.list.columns.retail_price")}),cell:({row:x})=>{const y=No.create(x.original.retail_price).object;return _.jsx("div",{className:"text-right",children:y.toFormat()})}}),g.display({id:"quantity",header:()=>_.jsx("div",{className:"font-medium text-right text-foreground",children:ue("catalog.list.columns.quantity")}),cell:({row:{index:x}})=>_.jsx(cR,{type:"number",name:"quantity",defaultValue:1,min:1,className:"w-24",value:i[x],onChange:y=>{y.preventDefault(),a(x,parseInt(y.target.value))}})}),g.display({id:"row-actions",header:()=>null,cell:({row:x})=>_.jsxs(at,{size:"sm",variant:"outline",className:"h-8 gap-1",onClick:y=>{y.preventDefault(),e&&e(x.original,i[x.index])},children:[_.jsx(OH,{className:"h-3.5 w-3.5"}),_.jsx("span",{className:"sr-only xl:not-sr-only xl:whitespace-nowrap",children:ue("common.add")})]})})],{table:m}=XO({data:[...(d==null?void 0:d.items)||[]],columns:v,pageCount:(d==null?void 0:d.total_pages)??-1});return u?_.jsx(Ip,{subtitle:f.message}):h?_.jsx(MO,{columnCount:6,searchableColumnCount:1,filterableColumnCount:2,shrinkZero:!0}):(d==null?void 0:d.total_items)===0&&!s?_.jsx(IO,{subtitle:"Empieza cargando los artículos del catálogo",buttonText:"",onButtonClick:()=>t("/catalog/add")}):_.jsx(PO,{className:"bg-transparent border-0 shadow-none",table:m,paginationOptions:{visible:!0,enablePageSizeSelector:!1},footerClassName:"px-10 pt-2 border-t",children:_.jsx(Ohe,{table:m})})},JW=C.forwardRef(({label:e=ue("common.append_block"),className:t,...n},r)=>_.jsxs(at,{type:"button",variant:"outline",ref:r,...n,children:[" ",_.jsx(OH,{className:e?"w-4 h-4 mr-2":"w-4 h-4"}),e&&_.jsx(_.Fragment,{children:e})]}));JW.displayName="AppendBlockRowButton";const eq=C.forwardRef(({label:e=ue("common.append_article"),className:t,...n},r)=>_.jsxs(at,{type:"button",variant:"outline",ref:r,...n,children:[" ",_.jsx(OH,{className:e?"w-4 h-4 mr-2":"w-4 h-4"}),e&&_.jsx(_.Fragment,{children:e})]}));eq.displayName="AppendCatalogArticleRowButton";const tq=C.forwardRef(({label:e=ue("common.append_empty_row"),className:t,...n},r)=>_.jsxs(at,{type:"button",variant:"outline",ref:r,...n,children:[_.jsx(Zye,{className:e?"w-4 h-4 mr-2":"w-4 h-4"}),e&&_.jsx(_.Fragment,{children:e})]}));tq.displayName="AppendEmptyRowButton";const _qe=({table:e})=>{const t=e.getSelectedRowModel().rows.length;return t?_.jsx("nav",{className:"flex items-center h-12 p-1 rounded-md text-muted-foreground bg-muted ",children:_.jsxs("div",{className:"flex items-center gap-2",children:[_.jsxs(Mi,{children:[_.jsx(Ii,{asChild:!0,children:_.jsxs(at,{type:"button",variant:"link",disabled:!e.getSelectedRowModel().rows.length,onClick:()=>{var n;return(n=e.options.meta)==null?void 0:n.duplicateItems()},children:[_.jsx(tbe,{className:"w-4 h-4 sm:mr-2"}),_.jsx("span",{className:"sr-only sm:not-sr-only",children:ue("common.duplicate_selected_rows")})]})}),_.jsx(di,{children:ue("common.duplicate_selected_rows_tooltip")})]}),_.jsxs(Mi,{children:[_.jsx(Ii,{asChild:!0,children:_.jsxs(at,{type:"button",variant:"link",disabled:!e.getSelectedRowModel().rows.length,onClick:()=>{var n;return(n=e.options.meta)==null?void 0:n.deleteItems()},children:[_.jsx(RJ,{className:"w-4 h-4 sm:mr-2"}),_.jsx("span",{className:"sr-only sm:not-sr-only",children:ue("common.remove_selected_rows")})]})}),_.jsx(di,{children:ue("common.remove_selected_rows_tooltip")})]}),_.jsxs(Mi,{children:[_.jsx(Ii,{asChild:!0,children:_.jsxs(at,{type:"button",variant:"link",disabled:!e.getSelectedRowModel().rows.length,onClick:()=>e.resetRowSelection(),children:[_.jsx(dbe,{className:"w-4 h-4 sm:mr-2"}),_.jsx("span",{className:"sr-only sm:not-sr-only",children:ue("common.reset_selected_rows")})]})}),_.jsx(di,{children:ue("common.reset_selected_rows_tooltip")})]}),_.jsx(Ef,{orientation:"vertical",className:"h-6 ml-1 mr-4"}),_.jsx("p",{className:"text-sm font-normal",children:ue("common.rows_selected",{count:t})})]})}):_.jsxs("nav",{className:"flex items-center h-12 p-1 rounded-md bg-accent/75 text-muted-foreground",children:[_.jsxs("div",{className:"flex space-x-2",children:[_.jsxs(Mi,{children:[_.jsx(Ii,{asChild:!0,children:_.jsx(tq,{variant:"ghost",onClick:()=>{var n;return(n=e.options.meta)==null?void 0:n.appendItem()}})}),_.jsx(di,{children:ue("common.append_empty_row_tooltip")})]}),_.jsxs(Mi,{children:[_.jsx(Ii,{asChild:!0,children:_.jsx(eq,{variant:"ghost",onClick:()=>{var n;e.options.meta&&e.options.meta.pickCatalogArticle&&((n=e.options.meta)==null||n.pickCatalogArticle())}})}),_.jsx(di,{children:ue("common.append_article_tooltip")})]}),_.jsxs(Mi,{children:[_.jsx(Ii,{asChild:!0,children:_.jsx(JW,{variant:"ghost",onClick:()=>{var n;e.options.meta&&e.options.meta.pickBlock&&((n=e.options.meta)==null||n.pickBlock())}})}),_.jsx(di,{children:ue("common.append_block_tooltip")})]})]}),_.jsx("div",{className:"flex items-center gap-2 ml-auto"})]})},wqe=C.createContext({attributes:{},listeners:void 0,ref(){}});function Sqe(e){return e.isSorting||e.wasDragging?Wue(e):!0}function Cqe({id:e,children:t}){const{attributes:n,isDragging:r,listeners:s,setNodeRef:i,setActivatorNodeRef:o,transform:a,transition:c}=Gue({animateLayoutChanges:Sqe,id:e}),d={transform:ku.Translate.toString(a),transition:c},h=C.useMemo(()=>({attributes:n,listeners:s,ref:o}),[n,s,o]);return _.jsx(wqe.Provider,{value:h,children:_.jsx(dp,{id:String(e),className:ge(r?"opacity-60":"opacity-100","m-0 hover:bg-muted hover:focus-within:bg-accent focus-within:bg-accent"),ref:i,style:d,children:t},e)})}const Eqe={droppable:{strategy:gx.Always}},Aqe={keyframes({transform:e}){return[{opacity:1,transform:ku.Transform.toString(e.initial)},{opacity:0,transform:ku.Transform.toString({...e.final,x:e.final.x+5,y:e.final.y+5})}]},easing:"ease-out",sideEffects({active:e}){e.node.animate([{opacity:0},{opacity:1}],{duration:WU.duration,easing:WU.easing})}};function YY({columns:e,data:t,defaultValues:n,initialState:r,actions:s}){const[i,o]=C.useState({}),[a,c]=C.useState(),[d,h]=C.useState((r==null?void 0:r.columnVisibility)||{}),u=C.useMemo(()=>t.map(b=>b.id),[t]),f=pue({data:t,columns:e,enableColumnResizing:!1,columnResizeMode:"onChange",autoResetAll:!1,initialState:r,state:{rowSelection:i,columnVisibility:d},enableRowSelection:!0,enableMultiRowSelection:!0,enableSorting:!1,enableHiding:!0,onRowSelectionChange:o,getCoreRowModel:fue(),getRowId:b=>b==null?void 0:b.id,debugTable:!1,debugHeaders:!1,debugColumns:!1,defaultColumn:{minSize:0,size:Number.MAX_SAFE_INTEGER,maxSize:Number.MAX_SAFE_INTEGER},meta:{insertItem:(b,w)=>{s.insert(b,w||(n==null?void 0:n.items[0]),{shouldFocus:!0})},appendItem:b=>{s.append(b||(n==null?void 0:n.items[0]),{shouldFocus:!0})},pickCatalogArticle:()=>{s.pickCatalogArticle&&(s==null||s.pickCatalogArticle())},pickBlock:()=>{s.pickBlock&&(s==null||s.pickBlock())},duplicateItems:b=>{if(b!=null){const w=f.getRowModel().rows[b].original;s.insert(b+1,w,{shouldFocus:!0})}else if(f.getSelectedRowModel().rows.length){const w=f.getSelectedRowModel().rows[f.getSelectedRowModel().rows.length-1].index,E=f.getSelectedRowModel().rows.map(R=>({...R.original,id:void 0}));f.getRowModel().rows.length<w+1?s.append(E):s.insert(w+1,E,{shouldFocus:!0}),f.resetRowSelection()}},deleteItems:b=>{if(b!=null)s.remove(b);else if(f.getSelectedRowModel().rows.length>0){let w=f.getSelectedRowModel().rows.length-1;for(;w>=0;w--){const E=u.indexOf(String(f.getSelectedRowModel().rows[w].id));s.remove(E),u.splice(E,1)}f.resetRowSelection()}else s.remove()},updateItem:(b,w,E,R)=>{s.update(b,{...w,[`${E}`]:R})}}}),g=v4e(SP(Oue,{}),SP(Mue,{}),SP(yW,{}),SP(xW,{}));function v(b){var R;let w=b.active.id,E=(R=b.over)==null?void 0:R.id;if(E!==void 0&&w!==E){let T=u.indexOf(String(E));if(f.getSelectedRowModel().rows.length>1)f.getSelectedRowModel().rows.forEach((N,A)=>{const D=u.indexOf(String(N.id));A>0&&(w=N.id,T=u.indexOf(String(E)),T<D&&(T=T+1)),s.move(D,T),u.splice(T,0,u.splice(D,1)[0]),E=N.id});else{const N=u.indexOf(String(w));s.move(N,T)}}c(null)}function m({active:b}){f.getSelectedRowModel().rowsById[b.id]||f.resetRowSelection(),c(b.id)}function x(){c(null)}function y(b){return a?b.filter(w=>{const E=typeof w=="string"?w:w.id;return E===a||!f.getSelectedRowModel().rowsById[E]}):b}return _.jsx(mze,{measuring:Eqe,sensors:g,onDragEnd:v,onDragStart:m,onDragCancel:x,collisionDetection:S4e,children:_.jsxs(bs,{children:[_.jsx(Go,{className:"sticky z-10 top-16 bg-card/90",children:_.jsx(ui,{children:_.jsx(_qe,{table:f})})}),_.jsxs(xs,{children:[_.jsxs(dO,{className:"table-fixed",children:[_.jsx(fO,{className:"sticky top-0 z-10 bg-background",children:f.getHeaderGroups().map(b=>_.jsx(dp,{className:"hover:bg-transparent",children:b.headers.map(w=>_.jsx(pO,{className:"px-2 py-1",style:{width:w.getSize()===Number.MAX_SAFE_INTEGER?"auto":w.getSize()},children:w.isPlaceholder?null:_.jsx(bue,{table:f,header:w})},w.id))},b.id))}),_.jsx(hO,{children:_.jsx(Fze,{items:y(u),strategy:jze,children:y(f.getRowModel().rows).map(b=>_.jsx(Cqe,{id:b.id,children:b.getVisibleCells().map(w=>_.jsx(TC,{className:"px-2 py-2 align-top",style:{width:w.column.getSize()===Number.MAX_SAFE_INTEGER?"auto":w.column.getSize()},children:XT(w.column.columnDef.cell,w.getContext())},w.id))},b.id))})})]}),Li.createPortal(_.jsx(Oze,{dropAnimation:Aqe,className:"z-40 opacity-100",children:a&&_.jsx("div",{className:"relative flex flex-wrap",children:f.getSelectedRowModel().rows.length?_.jsx(_D,{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:f.getSelectedRowModel().rows.length}):null})}),document.body),!1]}),_.jsx(fl,{children:_.jsxs(Yv,{children:[_.jsx(tq,{onClick:()=>{var b;return(b=f.options.meta)==null?void 0:b.appendItem()}}),_.jsx(eq,{onClick:()=>{var b;f.options.meta&&f.options.meta.pickCatalogArticle&&((b=f.options.meta)==null||b.pickCatalogArticle())}}),_.jsx(JW,{onClick:()=>{var b;f.options.meta&&f.options.meta.pickBlock&&((b=f.options.meta)==null||b.pickBlock())}})]})})]})})}const Rqe={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`}]},XY=({onSelect:e})=>{const{i18n:t}=AW(),[n]=C.useState(t.resolvedLanguage||"es"),[r]=C.useState(Rqe[n.toLowerCase()]);return console.log(n),_.jsx(sO,{className:"h-96",children:_.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)=>_.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:()=>e&&e(s,1),children:_.jsxs("div",{className:"flex flex-col w-full gap-1",children:[_.jsx("div",{className:"flex items-center",children:_.jsx("div",{className:"flex items-center gap-2",children:_.jsx("div",{className:"font-semibold",children:s.title})})}),_.jsx("div",{className:"text-xs line-clamp-2 text-muted-foreground",children:_.jsx("p",{dangerouslySetInnerHTML:{__html:s.body.substring(0,300).replace(`\r
|
||
`,"<br>")}})})]})},s.id))})})},Pqe=({isOpen:e,onOpenChange:t,onSelect:n})=>xhe("(min-width: 768px)")?_.jsx(Fx,{modal:!0,open:e,onOpenChange:t,children:_.jsxs(cy,{className:"w-full max-w-full md:w-9/12 lg:w-10/12",children:[_.jsxs(uy,{children:[_.jsx(fy,{children:ue("quotes.blocks_picker_dialog.title")}),_.jsx(GA,{children:ue("quotes.blocks_picker_dialog.description")})]}),_.jsx(XY,{onSelect:n}),_.jsx(dy,{children:_.jsx(at,{type:"submit",onClick:()=>t(!1),children:ue("common.close")})})]})}):_.jsx(a8,{open:e,onOpenChange:t,children:_.jsxs(l8,{children:[_.jsxs(c8,{className:"text-left",children:[_.jsx(d8,{children:ue("quotes.blocks_picker_dialog.title")}),_.jsx(f8,{children:ue("quotes.blocks_picker_dialog.description")})]}),_.jsx(XY,{onSelect:n}),_.jsx(u8,{className:"pt-2",children:_.jsx(Gre,{asChild:!0,children:_.jsx(at,{variant:"outline",children:ue("common.close")})})})]})}),Nqe=({isOpen:e,onOpenChange:t,onSelect:n})=>xhe("(min-width: 768px)")?_.jsx(Fx,{modal:!0,open:e,onOpenChange:t,children:_.jsxs(cy,{className:"w-full max-w-full md:w-9/12 lg:w-10/12",children:[_.jsxs(uy,{children:[_.jsx(fy,{children:ue("quotes.catalog_picker_dialog.title")}),_.jsx(GA,{children:ue("quotes.catalog_picker_dialog.description")})]}),_.jsx(mx,{syncWithLocation:!1,initialPageSize:5,children:_.jsx(yV,{onSelect:n})}),_.jsx(dy,{children:_.jsx(at,{type:"submit",onClick:()=>t(!1),children:ue("common.close")})})]})}):_.jsx(a8,{open:e,onOpenChange:t,children:_.jsxs(l8,{children:[_.jsxs(c8,{className:"text-left",children:[_.jsx(d8,{children:ue("quotes.catalog_picker_dialog.title")}),_.jsx(f8,{children:ue("quotes.catalog_picker_dialog.description")})]}),_.jsx(mx,{syncWithLocation:!1,initialPageSize:5,children:_.jsx(yV,{onSelect:n})}),_.jsx(u8,{className:"pt-2",children:_.jsx(Gre,{asChild:!0,children:_.jsx(at,{variant:"outline",children:ue("common.close")})})})]})}),Tqe=({currency:e,language:t,defaultValues:n})=>{const{toast:r}=Fu(),{control:s,register:i}=ua(),[o]=C.useState("dialog"),[a,c]=C.useState(!1),[d,h]=C.useState(!1),{fields:u,...f}=fOe({control:s,name:"items"}),g=d8e([{id:"description",accessorKey:"description",header:ue("quotes.form_fields.items.description.label"),cell:({row:{index:E,original:R}})=>_.jsx(gc,{readOnly:R==null?void 0:R.id_article,autoSize:!0,...i(`items.${E}.description`)}),minSize:200,size:400},{id:"quantity",accessorKey:"quantity",header:()=>_.jsx("div",{className:"text-right",children:ue("quotes.form_fields.items.quantity.label")}),cell:({row:{index:E}})=>_.jsx(lBe,{scale:0,className:"text-right",...i(`items.${E}.quantity`)}),size:75},{id:"unit_price",accessorKey:"unit_price",header:()=>_.jsx("div",{className:"text-right",children:ue("quotes.form_fields.items.unit_price.label")}),cell:({row:{index:E}})=>_.jsx(iN,{currency:e,language:t,scale:2,className:"text-right",...i(`items.${E}.unit_price`)}),size:125},{id:"subtotal_price",accessorKey:"subtotal_price",header:()=>_.jsx("div",{className:"text-right",children:ue("quotes.form_fields.items.subtotal_price.label")}),cell:({row:{index:E}})=>_.jsx(iN,{variant:"ghost",currency:e,language:t,scale:2,readOnly:!0,className:"text-right",...i(`items.${E}.subtotal_price`)}),size:150},{id:"discount",accessorKey:"discount",header:()=>_.jsx("div",{className:"text-right",children:ue("quotes.form_fields.items.discount.label")}),cell:({row:{index:E}})=>_.jsx(sk,{scale:2,className:"text-right",...i(`items.${E}.discount`)}),size:100},{id:"total_price",accessorKey:"total_price",header:()=>_.jsx("div",{className:"text-right",children:ue("quotes.form_fields.items.total_price.label")}),cell:({row:{index:E}})=>_.jsx(iN,{variant:"ghost",currency:e,language:t,scale:2,readOnly:!0,className:"font-semibold text-right",...i(`items.${E}.total_price`)}),size:150}],{enableDragHandleColumn:!0,enableSelectionColumn:!0,enableActionsColumn:!0,rowActionFn:E=>{const{table:R,row:T}=E;return[{label:ue("common.duplicate_row"),icon:_.jsx(DH,{className:"w-4 h-4 mr-2"}),onClick:()=>{var N;return(N=R.options.meta)==null?void 0:N.duplicateItems(T.index)}},{label:ue("common.insert_row_above"),icon:_.jsx(bJ,{className:"w-4 h-4 mr-2"}),onClick:()=>{var N;return(N=R.options.meta)==null?void 0:N.insertItem(T.index)}},{label:ue("common.insert_row_below"),icon:_.jsx(Nx,{className:"w-4 h-4 mr-2"}),onClick:()=>{var N;return(N=R.options.meta)==null?void 0:N.insertItem(T.index+1)}},{label:"-"},{label:ue("common.remove_row"),icon:_.jsx(RJ,{className:"w-4 h-4 mr-2"}),onClick:()=>{var N;(N=R.options.meta)==null||N.deleteItems(T.index)}}]}}),v=C.useCallback((E,R=1)=>{f.append({...E,quantity:{amount:100*R,scale:xp.DEFAULT_SCALE},unit_price:E.retail_price,discount:{amount:null,scale:2}}),r({title:ue("quotes.catalog_picker_dialog.toast_article_added"),description:E.description})},[f]),m=C.useCallback(E=>{f.append({description:`${E.title}
|
||
${E.body}`,quantity:{amount:null,scale:xp.DEFAULT_SCALE},unit_price:{amount:null,scale:KFe.DEFAULT_SCALE},discount:{amount:null,scale:2}}),r({title:ue("quotes.blocks_picker_dialog.toast_article_added"),description:E.title})},[f]),[x,y]=C.useState(!1),b=[265,440,655],w=4;return o==="dialog"?_.jsxs("div",{className:"relative",children:[_.jsx(YY,{actions:{...f,pickCatalogArticle:()=>c(!0),pickBlock:()=>h(!0)},columns:g,data:u,defaultValues:n}),_.jsx(Nqe,{onSelect:v,isOpen:a,onOpenChange:c}),_.jsx(Pqe,{onSelect:m,isOpen:d,onOpenChange:h})]}):_.jsxs(qIe,{direction:"horizontal",autoSaveId:"uecko.quotes.details_layout",className:"items-stretch h-full",children:[_.jsx(A7,{defaultSize:b[0],collapsedSize:w,collapsible:!0,minSize:50,maxSize:90,onCollapse:()=>{y(!0)},onExpand:()=>{y(!1)},className:ge(x&&"min-w-[50px] transition-all duration-300 ease-in-out"),children:_.jsx(YY,{actions:f,columns:g,data:u,defaultValues:n})}),_.jsx(GIe,{withHandle:!0,className:"mx-3"}),_.jsx(A7,{defaultSize:b[1],minSize:10,children:_.jsx(mx,{syncWithLocation:!1,children:_.jsx(yV,{onSelect:v})})})]})},kqe=()=>{const{register:e,formState:t}=ua();return _.jsxs("div",{className:"grid gap-6 md:grid-cols-6",children:[_.jsxs(rk,{className:"md:col-span-6",title:ue("quotes.create.form_groups.general.title"),description:ue("quotes.create.form_groups.general.desc"),children:[_.jsxs("div",{className:"grid grid-cols-6 gap-6",children:[_.jsx(mg,{required:!0,className:"col-span-2",label:ue("quotes.form_fields.customer_reference.label"),description:ue("quotes.form_fields.customer_reference.desc"),disabled:t.disabled,placeholder:ue("quotes.form_fields.customer_reference.placeholder"),...e("customer_reference")}),_.jsx(Yue,{required:!0,label:ue("quotes.form_fields.date.label"),description:ue("quotes.form_fields.date.desc"),disabled:t.disabled,placeholder:ue("quotes.form_fields.date.placeholder"),...e("date",{required:!0})}),_.jsx(mg,{label:ue("quotes.form_fields.validity.label"),description:ue("quotes.form_fields.validity.desc"),disabled:t.disabled,placeholder:ue("quotes.form_fields.validity.placeholder"),...e("validity",{required:!1})}),_.jsx(gc,{className:"col-span-2",label:ue("quotes.form_fields.payment_method.label"),description:ue("quotes.form_fields.payment_method.desc"),disabled:t.disabled,placeholder:ue("quotes.form_fields.payment_method.placeholder"),...e("payment_method",{required:!1})})]}),_.jsxs("div",{className:"grid grid-cols-6 gap-6",children:[_.jsx(gc,{className:"col-span-3",required:!0,label:ue("quotes.form_fields.customer_information.label"),description:ue("quotes.form_fields.customer_information.desc"),disabled:t.disabled,placeholder:ue("quotes.form_fields.customer_information.placeholder"),...e("customer_information",{required:!0}),errors:t.errors}),_.jsx(gc,{className:"col-span-3",label:ue("quotes.form_fields.notes.label"),description:ue("quotes.form_fields.notes.desc"),disabled:t.disabled,placeholder:ue("quotes.form_fields.notes.placeholder"),...e("notes",{required:!1})})]})]}),_.jsx(rk,{className:"hidden md:col-span-2",title:ue("quotes.create.form_groups.status.title"),description:ue("quotes.create.form_groups.status.desc"),children:_.jsxs("div",{className:"grid gap-6",children:[_.jsxs("div",{className:"grid gap-3",children:[_.jsx(gy,{htmlFor:"status",children:"Status"}),_.jsxs(U8,{children:[_.jsx(lO,{id:"status","aria-label":"Select status",children:_.jsx(V8,{placeholder:"Select status"})}),_.jsxs(cO,{children:[_.jsx(Ib,{value:"draft",children:"Draft"}),_.jsx(Ib,{value:"published",children:"Active"}),_.jsx(Ib,{value:"archived",children:"Archived"})]})]})]}),_.jsx(mg,{required:!0,label:ue("quotes.form_fields.lang_code.label"),description:ue("quotes.form_fields.lang_code.desc"),placeholder:ue("quotes.form_fields.lang_code.placeholder"),...e("lang_code",{required:!0})}),_.jsx(mg,{required:!0,label:ue("quotes.form_fields.currency_code.label"),description:ue("quotes.form_fields.currency_code.desc"),placeholder:ue("quotes.form_fields.currency_code.placeholder"),...e("currency_code",{required:!0})})]})})]})},ppe=({id:e,onSentTo:t,disabled:n})=>{const r=()=>{t(e)};return _.jsxs(JH,{children:[_.jsx(hxe,{asChild:!0,disabled:n,children:_.jsxs(at,{variant:"ghost",className:"h-10 gap-1 text-primary disabled:text-secondary-foreground",children:[_.jsx(fbe,{className:"w-4 h-4"}),ue("quotes.quote_sent_to_editor.trigger_button")]})}),_.jsxs(pD,{children:[_.jsxs(mD,{children:[_.jsx(vD,{children:ue("quotes.quote_sent_to_editor.title")}),_.jsx(yD,{children:ue("quotes.quote_sent_to_editor.description")})]}),_.jsxs(gD,{children:[_.jsx(xD,{children:ue("common.cancel")}),_.jsx(bD,{asChild:!0,children:_.jsx(at,{onClick:r,children:ue("common.continue")})})]})]})]})},Dqe=["draft","ready","delivered","accepted","rejected","archived"],Oqe={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"]},mpe=({type:e="button",status:t,onChangeStatus:n})=>{const[r,s]=C.useState(t),i=a=>s(a);C.useEffect(()=>{t&&s(t)},[t]);const o=()=>{r!==t&&n(r,t)};return _.jsxs(Fx,{children:[_.jsx(E6,{asChild:!0,children:e==="button"?_.jsxs(at,{size:"sm",variant:"outline",className:"h-8 gap-1",children:[_.jsx(EJ,{className:"h-3.5 w-3.5"}),_.jsx("span",{className:"sr-only md:not-sr-only md:whitespace-nowrap",children:ue("quotes.quote_status_editor.trigger_button")})]}):_.jsx(MHe,{status:t,isEditable:!0})}),_.jsxs(cy,{children:[_.jsx(uy,{children:_.jsx(fy,{children:ue("quotes.quote_status_editor.title")})}),_.jsx(KH,{}),_.jsx("div",{className:"grid gap-4 py-4",children:Dqe.map(a=>{const c=!Oqe[t].includes(a);return _.jsxs("div",{className:"flex items-start space-x-4",children:[_.jsx(ple,{id:a,checked:r===a,onCheckedChange:()=>i(a),disabled:c}),_.jsxs("div",{className:"grid gap-1.5 leading-none",children:[_.jsx(gy,{htmlFor:a,className:ge("font-medium",c?"text-input":"text-foreground"),children:ue(`quotes.quote_status_editor.status.${a}.title`)}),_.jsx("p",{className:ge("text-sm",c?"text-input":"text-muted-foreground"),children:ue(`quotes.quote_status_editor.status.${a}.description`)})]})]},a)})}),_.jsxs(dy,{className:"pt-6 border-t",children:[_.jsx(bT,{asChild:!0,children:_.jsx(at,{type:"button",variant:"secondary",children:ue("common.cancel")})}),_.jsx(bT,{asChild:!0,children:_.jsx(at,{onClick:o,disabled:r===t,children:ue("quotes.quote_status_editor.submit_button")})})]})]})]})},Mqe=({quoteId:e,className:t})=>{const n=io(),{toast:r}=Fu(),{useOne:s,useSetStatus:i,useSentTo:o,useDownloader:a,useDuplicate:c,getQuotePDFFilename:d}=ER(),{data:h,status:u}=s(e),{mutate:f}=i(),{mutate:g}=o(e),{mutate:v}=c(),{download:m,...x}=a(),{formatCurrency:y,formatNumber:b}=bhe({locale:(h==null?void 0:h.lang_code)||"ES"}),w=C.useMemo(()=>h?{subtotal_price:y(h.subtotal_price),discount:b(h.discount),discount_price:y(h.discount_price),tax:b(h.tax),tax_price:y(h.tax_price),total_price:y(h.total_price)}:{subtotal_price:"0,00 €",discount:"0",discount_price:"0,00 €",tax:"0",tax_price:"0,00 €",total_price:"0,00 €"},[h]),E=C.useMemo(()=>(h==null?void 0:h.status)==="accepted"&&!(h!=null&&h.date_sent),[h]),R=C.useMemo(()=>(h==null?void 0:h.status)==="accepted"&&!!(h!=null&&h.date_sent),[h]),T=$=>{f({id:h.id,newStatus:$},{onSuccess:()=>{r({description:ue("quotes.quote_status_editor.toast_status_changed"),variant:"success"})}})},N=$=>{g({sent_date:GFe(new Date)},{onSuccess:()=>{r({description:ue("quotes.quote_sent_to_editor.toast_status_changed"),variant:"success"})}})},A=C.useCallback(()=>{r({description:ue("quotes.downloading_dialog.toast_success"),variant:"success"})},[r]),D=C.useCallback(()=>{h&&m(h.id,d(h))},[h]);if(u==="error"||u!=="success")return null;if(!h)return _.jsx(bs,{className:ge("overflow-hidden",t),children:_.jsx(xs,{className:"px-4 py-6 text-center",children:_.jsx("p",{className:"mx-auto",children:"Select a quote"})})});const O=$=>{v({id:$},{onSuccess(F){r({description:ue("quotes.duplicate_action.toast_success"),variant:"success"}),n(`/quotes/edit/${F.id}`,{relative:"path"})}})},I=$=>{f({id:$,newStatus:"archived"},{onSuccess:()=>{r({description:ue("quotes.quote_status_editor.toast_status_changed",{newStatus:ue("quotes.status.archived")}),variant:"success"})}})};return _.jsxs(_.Fragment,{children:[_.jsx(fpe,{...x,onFinishDownload:A}),_.jsx(Nle,{defaultValue:"resume",children:_.jsxs(bs,{className:"w-[390px] overflow-hidden",children:[_.jsxs(Go,{className:"gap-3 border-b bg-accent",children:[_.jsxs(ui,{className:"flex items-center justify-between text-lg",children:[_.jsx("span",{children:ue("quotes.list.resume.title")}),_.jsx(mpe,{status:h.status,onChangeStatus:T,type:"badge"})]}),_.jsx("div",{className:"flex w-full mr-auto text-foreground",children:_.jsxs("div",{className:"flex justify-between w-full",children:[_.jsxs(Yv,{className:"gap-0",children:[_.jsxs(Mi,{children:[_.jsx(Ii,{asChild:!0,children:_.jsxs(at,{variant:"outline",size:"icon",disabled:R,onClick:$=>{$.preventDefault(),n(`/quotes/edit/${h.id}`,{relative:"path"})},children:[_.jsx(AJ,{className:"w-4 h-4"}),_.jsx("span",{className:"sr-only",children:"Editar"})]})}),_.jsx(di,{children:_.jsx("p",{children:"Editar"})})]}),_.jsxs(Mi,{children:[_.jsx(Ii,{asChild:!0,children:_.jsxs(at,{variant:"outline",size:"icon",onClick:$=>{$.preventDefault(),O(h.id)},children:[_.jsx(DH,{className:"w-4 h-4"}),_.jsx("span",{className:"sr-only",children:"Duplicar"})]})}),_.jsx(di,{children:_.jsx("p",{children:"Duplicar"})})]}),_.jsxs(Mi,{children:[_.jsx(Ii,{asChild:!0,children:_.jsxs(at,{variant:"outline",size:"icon",onClick:D,children:[_.jsx(wJ,{className:"w-4 h-4"}),_.jsx("span",{className:"sr-only",children:"Descargar"})]})}),_.jsx(di,{children:_.jsx("p",{children:"Descargar"})})]}),_.jsxs(Mi,{children:[_.jsx(Ii,{asChild:!0,children:_.jsxs(at,{variant:"outline",size:"icon",disabled:R,onClick:$=>{$.preventDefault(),I(h.id)},children:[_.jsx(yJ,{className:"w-4 h-4"}),_.jsx("span",{className:"sr-only",children:"Archivar"})]})}),_.jsx(di,{children:_.jsx("p",{children:"Archivar"})})]})]}),_.jsx(Yv,{children:_.jsx(ppe,{disabled:R||!E,id:h.id,onSentTo:N})})]})})]}),_.jsxs(xs,{className:"p-6 text-sm",children:[_.jsxs(K8,{className:"grid w-full grid-cols-2",children:[_.jsx(zT,{value:"resume",children:ue("quotes.list.resume.tabs.resume")}),_.jsx(zT,{value:"preview",children:ue("quotes.list.resume.tabs.preview")})]}),_.jsx(BT,{value:"resume",className:"pt-4",children:_.jsxs("div",{className:"grid gap-3",children:[_.jsxs("div",{className:"grid gap-3",children:[_.jsx("div",{className:"font-semibold",children:ue("quotes.list.resume.quote_information")}),_.jsxs("dl",{className:"grid gap-3",children:[_.jsxs("div",{className:"flex items-center justify-between",children:[_.jsx("dt",{className:"text-muted-foreground",children:ue("quotes.form_fields.reference.label")}),_.jsx("dd",{className:"font-medium",children:h.reference})]}),_.jsxs("div",{className:"flex items-center justify-between",children:[_.jsx("dt",{className:"text-muted-foreground",children:ue("quotes.form_fields.date.label")}),_.jsx("dd",{className:"font-medium",children:new Date(h.date).toLocaleDateString()})]}),_.jsxs("div",{className:"flex items-start justify-between",children:[_.jsx("dt",{className:"text-muted-foreground whitespace-nowrap",children:ue("quotes.form_fields.customer_reference.label")}),_.jsx("dd",{className:"font-medium text-right whitespace-break-spaces",children:h.customer_reference})]})]})]}),_.jsx(Ef,{className:"my-4"}),_.jsxs("div",{className:"grid gap-3",children:[_.jsx("div",{className:"font-semibold",children:ue("quotes.list.resume.customer_information")}),_.jsx("div",{children:h.customer_information})]}),_.jsx(Ef,{className:"my-4"}),_.jsx("div",{className:"font-semibold",children:ue("quotes.list.resume.price_information")}),_.jsxs("ul",{className:"grid gap-3",children:[_.jsxs("li",{className:"flex items-center justify-between",children:[_.jsx("span",{className:"text-muted-foreground",children:ue("quotes.form_fields.subtotal_price.label")}),_.jsx("span",{children:w.subtotal_price})]}),_.jsxs("li",{className:"flex items-center justify-between",children:[_.jsx("span",{className:"text-muted-foreground",children:ue("quotes.form_fields.discount_value.label",{value:w.discount})}),_.jsx("span",{children:w.discount_price})]}),_.jsxs("li",{className:"flex items-center justify-between",children:[_.jsx("span",{className:"text-muted-foreground",children:ue("quotes.form_fields.tax_value.label",{value:w.tax})}),_.jsx("span",{children:w.tax_price})]}),_.jsxs("li",{className:"flex items-center justify-between font-semibold",children:[_.jsx("span",{className:"text-muted-foreground",children:ue("quotes.form_fields.total_price.label")}),_.jsx("span",{children:w.total_price})]})]})]})}),_.jsx(BT,{value:"preview",children:_.jsx(hpe,{quote:h})})]}),_.jsx(fl,{className:"flex flex-row items-center px-6 py-3 border-t bg-accent",children:_.jsx("div",{className:"text-xs text-muted-foreground"})})]})})]})},Iqe=({status:e="all",preview:t=!1})=>{const n=io(),{toast:r}=Fu(),s=C.useId(),i=C.useId(),{pagination:o,globalFilter:a,isFiltered:c}=Ey(),[d,h]=C.useState(void 0),{useList:u,useDownloader:f,useSetStatus:g,useDuplicate:v,getQuotePDFFilename:m}=ER(),{mutate:x}=g(),{mutate:y}=v(),{data:b,isPending:w,isError:E,error:R}=u({pagination:{pageIndex:o.pageIndex,pageSize:o.pageSize},status:e,quickSearchTerm:a}),{download:T,...N}=f(),A=Z=>{h(Z)},D=C.useCallback(()=>{r({description:ue("quotes.downloading_dialog.toast_success")})},[r]),O=C.useCallback(Z=>{n(`/quotes/edit/${Z.id}`,{relative:"path"})},[n,r]),I=Z=>{y({id:Z},{onSuccess(Y){r({description:ue("quotes.duplicate_action.toast_success"),variant:"success"}),n(`/quotes/edit/${Y.id}`,{relative:"path"})}})},$=Z=>{x({id:Z,newStatus:"archived"},{onSuccess:()=>{r({description:ue("quotes.quote_status_editor.toast_status_changed",{newStatus:ue("quotes.status.archived")}),variant:"success"})}})},F=(Z,Y)=>{x({id:Z,newStatus:Y},{onSuccess:()=>{r({description:ue("quotes.quote_status_editor.toast_status_changed",{newStatus:ue(`quotes.status.${Y}`)}),variant:"success"})}})},B=C.useMemo(()=>{const Z=[{id:"reference",accessorKey:"reference",header:()=>_.jsx(_.Fragment,{children:ue("quotes.list.columns.reference")}),cell:({row:{original:H},renderValue:se})=>{const he=!!((H==null?void 0:H.status)==="accepted"&&(H!=null&&H.date_sent));return _.jsx(at,{size:"sm",variant:"link",disabled:he,className:"h-8 gap-1 px-0 text-left text-ellipsis",onClick:re=>{re.preventDefault(),O(H)},children:_.jsx("div",{className:"",children:se()})})}},{id:"status",accessorKey:"status",header:()=>_.jsx(_.Fragment,{children:ue("quotes.list.columns.status")}),cell:({row:{original:H}})=>_.jsx(mpe,{type:"badge",status:H.status,onChangeStatus:se=>F(H.id,se)})},{id:"date_sent",accessor:"date_sent",header:()=>_.jsx("div",{className:"text-left text-ellipsis",children:ue("quotes.list.columns.date_sent")}),cell:({row:{original:H}})=>{const se=Lb.create(H.date_sent),he=se.isSuccess&&!se.object.isEmpty();return _.jsx("div",{className:"text-left text-ellipsis",children:he?_.jsx(vue,{label:se.object.toLocaleDateString("es-ES"),className:"text-green-800 bg-green-100 hover:text-green-800 hover:bg-green-100"}):_.jsx(_.Fragment,{})})}},{id:"date",accessor:"date",header:()=>_.jsx("div",{className:"text-left text-ellipsis",children:ue("quotes.list.columns.date")}),cell:({row:{original:H}})=>{const se=Lb.create(H.date);return _.jsx("div",{className:"text-left text-ellipsis",children:se.isSuccess?se.object.toLocaleDateString("es-ES"):"-"})}},{id:"customer_reference",accessorKey:"customer_reference",header:()=>_.jsx(_.Fragment,{children:ue("quotes.list.columns.customer_reference")}),cell:({renderValue:H})=>_.jsx("div",{className:"text-left text-ellipsis",children:H()})},{id:"customer_information",accessorKey:"customer_information",header:()=>_.jsx(_.Fragment,{children:ue("quotes.list.columns.customer_information")}),cell:({row:{original:H}})=>_.jsx("div",{className:"text-left text-ellipsis",children:H.customer_information.split(`
|
||
`).map((se,he)=>_.jsxs("span",{className:he===0?"font-medium":"hidden text-sm text-muted-foreground md:inline",children:[se,_.jsx("br",{})]},he))}),size:500}],Y=[{id:"row-actions",header:()=>null,cell:({row:{original:H}})=>{const se=(H==null?void 0:H.status)==="accepted"&&!(H!=null&&H.date_sent),he=(H==null?void 0:H.status)==="accepted"&&!!(H!=null&&H.date_sent),re=(H==null?void 0:H.status)==="archived";return _.jsxs("div",{className:"flex gap-1",children:[_.jsxs(Yv,{className:"gap-0",children:[_.jsxs(Mi,{children:[_.jsx(Ii,{asChild:!0,children:_.jsxs(at,{variant:"ghost",size:"icon",disabled:he,onClick:J=>{J.preventDefault(),O(H)},children:[_.jsx(AJ,{className:"w-4 h-4"}),_.jsx("span",{className:"sr-only",children:"Editar"})]})}),_.jsx(di,{children:_.jsx("p",{children:"Editar"})})]}),_.jsxs(Mi,{children:[_.jsx(Ii,{asChild:!0,children:_.jsxs(at,{variant:"ghost",size:"icon",onClick:J=>{J.preventDefault(),I(H.id)},children:[_.jsx(DH,{className:"w-4 h-4"}),_.jsx("span",{className:"sr-only",children:"Duplicar"})]})}),_.jsx(di,{children:_.jsx("p",{children:"Duplicar"})})]}),_.jsxs(Mi,{children:[_.jsx(Ii,{asChild:!0,children:_.jsxs(at,{variant:"ghost",size:"icon",onClick:()=>{T(H.id,m(H))},children:[_.jsx(wJ,{className:"w-4 h-4"}),_.jsx("span",{className:"sr-only",children:"Descargar"})]})}),_.jsx(di,{children:_.jsx("p",{children:"Descargar"})})]}),_.jsxs(Mi,{children:[_.jsx(Ii,{asChild:!0,children:_.jsxs(at,{variant:"ghost",size:"icon",disabled:re||he,onClick:J=>{J.preventDefault(),$(H.id)},children:[_.jsx(yJ,{className:"w-4 h-4"}),_.jsx("span",{className:"sr-only",children:"Archivar"})]})}),_.jsx(di,{children:_.jsx("p",{children:"Archivar"})})]})]}),_.jsx(Yv,{children:_.jsx(ppe,{id:H.id,onSentTo:()=>null,disabled:he||!se})})]})}}];return t?Z:[...Z,...Y]},[t]),{table:W}=XO({data:(b==null?void 0:b.items)??[],columns:B,pageCount:(b==null?void 0:b.total_pages)??-1});return C.useEffect(()=>{W&&b&&(b==null?void 0:b.total_pages)>0&&h(W.getRowModel().rows[0])},[b,W]),E?_.jsx(Ip,{subtitle:R.message}):w?_.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:[_.jsx(bs,{className:"grid items-start gap-4 auto-rows-max md:gap-8 lg:col-span-2",children:_.jsx(xs,{children:_.jsx(MO,{columnCount:6,searchableColumnCount:1,filterableColumnCount:2,shrinkZero:!0})})}),_.jsx("div",{})]}):(b==null?void 0:b.total_items)===0&&!c?_.jsx(bs,{children:_.jsx(xs,{children:_.jsx(IO,{subtitle:"Empieza creando alguna cotización",buttonText:ue("quotes.create.title"),onButtonClick:()=>n("add",{relative:"path"})})})}):_.jsxs(_.Fragment,{children:[_.jsxs("div",{className:"flex flex-col items-stretch flex-1 gap-4 xl:flex-row",children:[_.jsx("div",{id:s,className:"flex items-stretch flex-1",children:_.jsx(PO,{table:W,paginationOptions:{visible:!0},className:"grid items-start flex-1 gap-4 auto-rows-max md:gap-8 lg:col-span-2",onRowClick:A,activeRowIndex:d==null?void 0:d.index,children:_.jsx(Mhe,{table:W})})}),t&&_.jsx("div",{id:i,className:"flex items-stretch ",children:_.jsx(Mqe,{quoteId:d==null?void 0:d.original.id})})]}),_.jsx(fpe,{...N,onFinishDownload:D})]})},Lqe=()=>{const e=io(),t=g8e(),{toast:n}=Fu(),[r,s]=C.useState(Rv.createDefaultCode().object),[i,o]=C.useState(U1.createDefaultCode().object),a=C.useMemo(()=>({date:"",reference:"",customer_reference:"",customer_information:"",lang_code:"",currency_code:"",payment_method:"",notes:"",validity:"",subtotal_price:{amount:void 0,scale:2,currency_code:""},discount:{amount:0,scale:0},discount_price:{amount:0,scale:0,currency_code:""},before_tax_price:{amount:void 0,scale:2,currency_code:""},tax:{amount:void 0,scale:0},tax_price:{amount:void 0,scale:2,currency_code:""},total_price:{amount:void 0,scale:2,currency_code:""},items:[{id_article:"",description:"",quantity:{amount:void 0,scale:2},unit_price:{amount:void 0,scale:2,currency_code:""},subtotal_price:{amount:void 0,scale:2,currency_code:""},discount:{amount:void 0,scale:2},total_price:{amount:void 0,scale:2,currency_code:""}}]}),[]),{useOne:c,useUpdate:d}=ER(),{data:h,status:u,error:f}=c(t),{mutate:g,isPending:v}=d(String(t)),m=aR({mode:"onBlur",defaultValues:a}),{getValues:x,reset:y,handleSubmit:b,formState:w,control:E,watch:R,setValue:T}=m,{isSubmitting:N,isDirty:A}=w;zW({isDirty:A}),C.useEffect(()=>{if(!A)return;const{unsubscribe:I}=R(($,{name:F,type:B})=>{if(F==="items"){$.items&&$.items.map((Z,Y)=>{if(Z){const H=hV(Z);as.isEqual(H.subtotal_price.toObject(),Z.subtotal_price)||T(`items.${Y}.subtotal_price`,H.subtotal_price.toObject()),as.isEqual(H.total_price.toObject(),Z.total_price)||T(`items.${Y}.total_price`,H.total_price.toObject())}});const W=bz($,!0);as.isEqual(W.subtotal_price.toObject(),$.total_price)||T("subtotal_price",W.subtotal_price.toObject()),as.isEqual(W.discount_price.toObject(),$.total_price)||T("discount_price",W.discount_price.toObject()),as.isEqual(W.before_tax_price.toObject(),$.before_tax_price)||T("before_tax_price",W.before_tax_price.toObject()),as.isEqual(W.tax_price.toObject(),$.tax_price)||T("tax_price",W.tax_price.toObject()),as.isEqual(W.total_price.toObject(),$.total_price)||T("total_price",W.total_price.toObject())}else if(F&&B==="change"){if(F==="currency_code"){const W=Rv.createFromCode($.currency_code??Rv.DEFAULT_CURRENCY_CODE);if(W.isFailure)throw console.error(W.error),W.error;s(W.object)}if(F==="lang_code"){const W=U1.createFromCode($.lang_code??U1.DEFAULT_LANGUAGE_CODE);if(W.isFailure)throw console.error(W.error),W.error;o(W.object)}if(["discount","tax"].includes(F)){const W=bz($,!0);as.isEqual(W.subtotal_price.toObject(),$.total_price)||T("subtotal_price",W.subtotal_price.toObject()),as.isEqual(W.discount_price.toObject(),$.total_price)||T("discount_price",W.discount_price.toObject()),as.isEqual(W.before_tax_price.toObject(),$.before_tax_price)||T("before_tax_price",W.before_tax_price.toObject()),as.isEqual(W.tax_price.toObject(),$.tax_price)||T("tax_price",W.tax_price.toObject()),as.isEqual(W.total_price.toObject(),$.total_price)||T("total_price",W.total_price.toObject())}if(F!=null&&F.startsWith("items")){const W=Number(F.split(".")[1]),Z=F.split(".")[2];if(["quantity","unit_price","discount"].includes(Z)&&$.items&&$.items[W]){const Y=$.items[W],H=hV(Y);as.isEqual(H.quantity.toObject(),Y.quantity)||T(`items.${W}.quantity`,H.quantity.toObject()),as.isEqual(H.unit_price.toObject(),Y.unit_price)||T(`items.${W}.unit_price`,H.unit_price.toObject()),as.isEqual(H.discount.toObject(),Y.discount)||T(`items.${W}.discount`,H.discount.toObject()),as.isEqual(H.subtotal_price.toObject(),Y.subtotal_price)||T(`items.${W}.subtotal_price`,H.subtotal_price.toObject()),as.isEqual(H.total_price.toObject(),Y.total_price)||T(`items.${W}.total_price`,H.total_price.toObject());const se=bz($,!0);as.isEqual(se.subtotal_price.toObject(),$.total_price)||T("subtotal_price",se.subtotal_price.toObject()),as.isEqual(se.discount_price.toObject(),$.total_price)||T("discount_price",se.discount_price.toObject()),as.isEqual(se.before_tax_price.toObject(),$.before_tax_price)||T("before_tax_price",se.before_tax_price.toObject()),as.isEqual(se.tax_price.toObject(),$.tax_price)||T("tax_price",se.tax_price.toObject()),as.isEqual(se.total_price.toObject(),$.total_price)||T("total_price",se.total_price.toObject())}}}});return()=>I()},[R,A,T]);const D=async(I,$)=>{g(I,{onError:F=>{console.error(F),n({title:"Error",description:F.message,variant:"destructive"})},onSuccess:()=>{y(x()),n({title:"Cotización guardada",variant:"success"}),$&&e("/quotes")}})},O=C.useCallback(()=>{e("/quotes",{state:{id:t}})},[e,t]);return C.useEffect(()=>{u==="success"&&h&&y(h)},[u,h,y]),u==="error"?_.jsx(Ip,{errorMessage:f.message}):u!=="success"?_.jsx(Ou,{}):_.jsxs(_.Fragment,{children:[(N||v)&&_.jsx(Ou,{title:"Guardando cotización"}),_.jsx(lR,{...m,children:_.jsx("form",{onSubmit:b(I=>D(I,!1)),children:_.jsxs("div",{className:"mx-auto grid max-w-[90rem] flex-1 auto-rows-max gap-6",children:[_.jsxs("div",{className:"flex items-center gap-4",children:[_.jsx(hW,{}),_.jsxs("h1",{className:"flex-1 text-xl font-semibold tracking-tight shrink-0 whitespace-nowrap sm:grow-0",children:[ue("quotes.edit.title")," ",h.reference]}),_.jsx(vue,{label:ue(`quotes.status.${h.status}`),className:"ml-auto sm:ml-0"}),_.jsxs("div",{className:"items-center hidden gap-2 md:ml-auto md:flex",children:[_.jsx(mue,{label:ue("common.close"),variant:"secondary",size:"sm",onClick:O}),_.jsx(RO,{label:ue("common.save"),size:"sm",disabled:w.isSubmitting||w.isLoading||w.isValidating}),_.jsx(at,{size:"sm",disabled:w.isSubmitting||w.isLoading||w.isValidating,onClick:b(I=>D(I,!0)),children:ue("common.save_close")})]})]}),_.jsx(kqe,{}),_.jsx(bqe,{currency:r}),_.jsx(Tqe,{currency:r,language:i,defaultValues:a}),_.jsxs("div",{className:"flex items-center justify-center gap-2 md:hidden",children:[_.jsx(at,{variant:"outline",size:"sm",children:ue("common.discard")}),_.jsx(at,{onClick:b(I=>D(I,!1)),size:"sm",children:ue("quotes.edit.buttons.save_quote")})]})]})})}),_.jsx(vqe,{control:E})]})},jqe=C.createContext(null),$qe=({children:e})=>{const[t,n]=EO();return _.jsx(jqe.Provider,{value:{pagination:t,setPagination:n},children:e})},Fqe=({children:e})=>_.jsx(bx,{children:_.jsx($qe,{children:_.jsxs(e_,{className:"quotes-layout",children:[_.jsx(n_,{}),_.jsx(t_,{children:e})]})})}),zqe=()=>{const e=io(),[t,n]=C.useState("all"),[r,s]=QBe(!0),i=[{value:"all",label:ue("quotes.list.tabs.all")},{value:"draft",label:ue("quotes.list.tabs.draft")},{value:"ready",label:ue("quotes.list.tabs.ready")},{value:"delivered",label:ue("quotes.list.tabs.delivered")},{value:"accepted",label:ue("quotes.list.tabs.accepted")},{value:"rejected",label:ue("quotes.list.tabs.rejected")},{value:"archived",label:ue("quotes.list.tabs.archived")}];return _.jsxs(mx,{children:[_.jsxs("div",{className:"flex items-center justify-between space-y-2",children:[_.jsxs("div",{children:[_.jsx("h2",{className:"text-2xl font-bold tracking-tight",children:_.jsx(Zt,{i18nKey:"quotes.list.title"})}),_.jsx("p",{className:"text-muted-foreground",children:_.jsx(Zt,{i18nKey:"quotes.list.subtitle"})})]}),_.jsx("div",{className:"flex items-center space-x-2",children:_.jsxs(at,{onClick:()=>e("/quotes/add"),children:[_.jsx(MH,{className:"w-4 h-4 mr-2"}),ue("quotes.create.title")]})})]}),_.jsxs(Nle,{value:t,onValueChange:n,children:[_.jsxs("div",{className:"flex flex-col items-start justify-between mb-4 sm:flex-row sm:items-center",children:[_.jsxs("div",{className:"w-full mb-4 sm:w-auto sm:mb-0",children:[_.jsx(K8,{className:"hidden sm:flex",children:i.map(o=>_.jsx(zT,{value:o.value,children:o.label},o.value))}),_.jsxs("div",{className:"flex items-center w-full space-x-2 sm:hidden",children:[_.jsx(gy,{children:ue("quotes.list.tabs_title")}),_.jsxs(U8,{value:t,onValueChange:n,children:[_.jsx(lO,{children:_.jsx(V8,{placeholder:"Seleccionar estado"})}),_.jsx(cO,{children:i.map(o=>_.jsx(Ib,{value:o.value,children:o.label},o.value))})]})]})]}),_.jsx("div",{className:"flex items-baseline justify-center mr-4 font-medium",children:_.jsx(Q3e,{buttonText:"Ayuda",title:"Ayuda sobre el Estado de Cotizaciones",content:Bqe})}),_.jsx("div",{className:"flex items-center gap-2 ml-auto",children:_.jsx(sce,{"aria-label":"Show quote preview",variant:"outline",defaultPressed:!1,pressed:r,onPressedChange:s,children:r?_.jsxs(_.Fragment,{children:[_.jsx(SJ,{className:"w-4 h-4 mr-2"}),ue("common.disable_preview")]}):_.jsxs(_.Fragment,{children:[_.jsx(rbe,{className:"w-4 h-4 mr-2"}),ue("common.enable_preview")]})})})]}),i.map(o=>_.jsx(BT,{value:o.value,children:_.jsx(Iqe,{status:o.value,preview:r})},o.value))]})]})},Bqe=_.jsxs(sO,{className:"grid gap-4 py-4",children:[_.jsx("p",{children:"El estado de una cotización indica su posición actual en el proceso de negocio."}),_.jsx("p",{children:"Los estados posibles son:"}),_.jsxs("ul",{className:"pl-6 space-y-2 list-disc",children:[_.jsxs("li",{children:[_.jsx("strong",{children:"Borrador:"})," La cotización está en proceso de creación o edición."]}),_.jsxs("li",{children:[_.jsx("strong",{children:"Preparado:"})," La cotización está lista para ser enviada al cliente."]}),_.jsxs("li",{children:[_.jsx("strong",{children:"Entregado:"})," La cotización ha sido enviada al cliente."]}),_.jsxs("li",{children:[_.jsx("strong",{children:"Aceptado:"})," El cliente ha aprobado la cotización."]}),_.jsxs("li",{children:[_.jsx("strong",{children:"Rechazado:"})," El cliente no ha aceptado la cotización."]}),_.jsxs("li",{children:[_.jsx("strong",{children:"Arcivado:"})," La cotización ha sido guardada para referencia futura y ya no está activa."]})]}),_.jsxs("p",{children:["Utiliza estos estados para hacer un seguimiento eficiente de tus cotizaciones y optimizar tu proceso de ventas. El estado ",_.jsx("strong",{children:"Archivado"})," es útil para mantener un historial de cotizaciones pasadas sin que interfieran con las cotizaciones activas."]})]}),Uqe=e=>{const t=vx(),n=Lf();return{useOne:()=>eue({queryKey:n().data().resource("settings").action("one").id("me").params().get(),queryFn:()=>t.getOne({resource:"profile",id:""}),...e}),useUpdate:()=>{const r=pu();return mu({mutationKey:n().data().resource("settings").action("one").id("me").params().get(),mutationFn:s=>t.updateOne({resource:"profile",data:s,id:""}),onSuccess:()=>{r.invalidateQueries({queryKey:["data","default","settings"]})}})},useUploadLogo:()=>{const r=pu(),{mutate:s,mutateAsync:i,...o}=mu({mutationKey:["data","default","settings"],mutationFn:a=>t.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}}}},Vqe=()=>{var R,T;const[e,t]=C.useState("profile"),{useOne:n,useUpdate:r,useUploadLogo:s}=Uqe(),{toast:i}=Fu(),{data:o,status:a,error:c}=n(),d=C.useMemo(()=>({contact_information:"",default_payment_method:"",default_notes:"",default_legal_terms:"",default_quote_validity:"",default_tax:{amount:void 0,scale:2}}),[]),{mutate:h}=r(),{upload:u}=s(),f=aR({mode:"onBlur",values:o==null?void 0:o.dealer,defaultValues:d}),{formState:g,reset:v,getValues:m,handleSubmit:x}=f,{isSubmitting:y,isDirty:b}=g,w=N=>{var D;const A=(D=N.target.files)==null?void 0:D[0];if(A){if(A.type!=="image/png"&&A.type!=="image/jpeg"){alert(ue("settings.form_fields.logo.invalid_format"));return}const O=new FileReader;O.onloadend=()=>{const I=new Image;I.onload=()=>{const $=I.width,F=I.height,B=$/F===2;$<200||F<100||!B?alert(ue("settings.form_fields.logo.invalid_dimensions")):u(A)},I.src=O.result},O.readAsDataURL(A)}};zW({isDirty:b});const E=async N=>{h(N,{onError:A=>{console.debug(A),i({title:"Error",description:A.message,variant:"destructive"})},onSuccess:()=>{v(m()),i({description:"Ajustes guardados",variant:"success"})}})};return y?_.jsx(Ou,{title:"Guardando ajustes"}):a==="error"?_.jsx(Ip,{errorMessage:c.message}):a!=="success"?_.jsx(Ou,{}):_.jsx(lR,{...f,children:_.jsx("form",{onSubmit:x(E),children:_.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:[((R=f.formState.errors.root)==null?void 0:R.message)&&_.jsxs(jH,{variant:"destructive",children:[_.jsx(xJ,{className:"w-4 h-4"}),_.jsx($H,{children:_.jsx(Zt,{i18nKey:"common.error"})}),_.jsx(FH,{children:(T=f.formState.errors.root)==null?void 0:T.message})]}),_.jsxs("nav",{className:"grid gap-4 text-sm text-muted-foreground",children:[_.jsx("a",{onClick:()=>t("profile"),className:e==="profile"?"font-semibold text-primary":"cursor-pointer",children:_.jsx(Zt,{i18nKey:"settings.edit.tabs.profile"})}),_.jsx("a",{onClick:()=>t("quotes"),className:e==="quotes"?"font-semibold text-primary":"cursor-pointer ",children:_.jsx(Zt,{i18nKey:"settings.edit.tabs.quotes"})}),_.jsx("a",{onClick:()=>t("legal"),className:e==="legal"?"font-semibold text-primary":"cursor-pointer ",children:_.jsx(Zt,{i18nKey:"settings.edit.tabs.legal"})})]}),_.jsxs("div",{className:ge("grid gap-6",e==="profile"?"visible":"hidden"),children:[_.jsxs(bs,{children:[_.jsxs(Go,{children:[_.jsx(ui,{children:_.jsx(Zt,{i18nKey:"settings.form_fields.contact_information.label"})}),_.jsx(Di,{children:_.jsx(Zt,{i18nKey:"settings.form_fields.contact_information.desc"})})]}),_.jsx(xs,{children:_.jsx(gc,{rows:8,placeholder:ue("settings.form_fields.contact_information.placeholder"),name:"contact_information",required:!0})}),_.jsx(fl,{className:"px-6 py-4 border-t",children:_.jsx(at,{children:_.jsx(Zt,{i18nKey:"common.save"})})})]}),_.jsxs(bs,{children:[_.jsxs(Go,{children:[_.jsx(ui,{children:_.jsx(Zt,{i18nKey:"settings.form_fields.logo.label"})}),_.jsx(Di,{children:_.jsx(Zt,{i18nKey:"settings.form_fields.logo.desc"})})]}),_.jsx(xs,{children:_.jsxs("div",{className:"flex items-center space-x-4",children:[_.jsx("div",{className:"w-[400px] h-[200px] border border-gray-300 flex items-center justify-center overflow-hidden",children:_.jsx("img",{src:o.dealer.logo?o.dealer.logo:"https://via.placeholder.com/200x100",width:400,height:200,style:{objectFit:"contain"}})}),_.jsx("div",{children:_.jsx("p",{className:"mt-2 text-sm text-gray-500",children:_.jsx(Zt,{i18nKey:"settings.form_fields.logo.requirements"})})})]})}),_.jsxs(fl,{className:"px-6 py-4 border-t",children:[_.jsx(gy,{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:_.jsx(Zt,{i18nKey:"settings.form_fields.logo.upload"})}),_.jsx(cR,{id:"logo-upload",type:"file",accept:".png,.jpg,.jpeg",onChange:w,className:"hidden"})]})]})]}),_.jsxs("div",{className:ge("grid gap-6",e==="quotes"?"visible":"hidden"),children:[_.jsxs(bs,{children:[_.jsxs(Go,{children:[_.jsx(ui,{children:_.jsx(Zt,{i18nKey:"settings.form_fields.default_tax.label"})}),_.jsx(Di,{children:_.jsx(Zt,{i18nKey:"settings.form_fields.default_tax.desc"})})]}),_.jsx(xs,{children:_.jsx(sk,{scale:2,disabled:g.disabled,placeholder:ue("settings.form_fields.default_tax.desc"),name:"default_tax",required:!0})}),_.jsx(fl,{className:"px-6 py-4 border-t",children:_.jsx(at,{children:_.jsx(Zt,{i18nKey:"common.save"})})})]}),_.jsxs(bs,{children:[_.jsxs(Go,{children:[_.jsx(ui,{children:_.jsx(Zt,{i18nKey:"settings.form_fields.default_payment_method.label"})}),_.jsx(Di,{children:_.jsx(Zt,{i18nKey:"settings.form_fields.default_payment_method.desc"})})]}),_.jsx(xs,{children:_.jsx(gc,{autoSize:!0,placeholder:ue("settings.form_fields.default_payment_method.placeholder"),name:"default_payment_method",required:!0,errors:f.formState.errors})}),_.jsx(fl,{className:"px-6 py-4 border-t",children:_.jsx(at,{children:_.jsx(Zt,{i18nKey:"common.save"})})})]}),_.jsxs(bs,{children:[_.jsxs(Go,{children:[_.jsx(ui,{children:_.jsx(Zt,{i18nKey:"settings.form_fields.default_quote_validity.label"})}),_.jsx(Di,{children:_.jsx(Zt,{i18nKey:"settings.form_fields.default_quote_validity.desc"})})]}),_.jsx(xs,{children:_.jsx(gc,{autoSize:!0,placeholder:ue("settings.form_fields.default_quote_validity.placeholder"),name:"default_quote_validity",required:!0})}),_.jsx(fl,{className:"px-6 py-4 border-t",children:_.jsx(at,{children:_.jsx(Zt,{i18nKey:"common.save"})})})]}),_.jsxs(bs,{children:[_.jsxs(Go,{children:[_.jsx(ui,{children:_.jsx(Zt,{i18nKey:"settings.form_fields.default_notes.label"})}),_.jsx(Di,{children:_.jsx(Zt,{i18nKey:"settings.form_fields.default_notes.desc"})})]}),_.jsx(xs,{children:_.jsx(gc,{autoSize:!0,placeholder:ue("settings.form_fields.default_notes.placeholder"),name:"default_notes"})}),_.jsx(fl,{className:"px-6 py-4 border-t",children:_.jsx(at,{children:_.jsx(Zt,{i18nKey:"common.save"})})})]})]}),_.jsx("div",{className:ge("grid gap-6",e==="legal"?"visible":"hidden"),children:_.jsxs(bs,{className:"h-",children:[_.jsxs(Go,{children:[_.jsx(ui,{children:_.jsx(Zt,{i18nKey:"settings.form_fields.default_legal_terms.label"})}),_.jsx(Di,{children:_.jsx(Zt,{i18nKey:"settings.form_fields.default_legal_terms.desc"})})]}),_.jsx(xs,{children:_.jsx(gc,{rows:25,placeholder:ue("settings.form_fields.default_legal_terms.placeholder"),name:"default_legal_terms"})}),_.jsx(fl,{className:"px-6 py-4 border-t",children:_.jsx(at,{children:_.jsx(Zt,{i18nKey:"common.save"})})})]})})]})})})},Hqe=C.createContext(null),Wqe=({children:e})=>_.jsx(Hqe.Provider,{value:{},children:e}),qqe=({children:e})=>_.jsx(bx,{children:_.jsx(Wqe,{children:_.jsxs(e_,{className:"settings-layout",children:[_.jsx(n_,{}),_.jsxs(t_,{children:[_.jsx("div",{className:"grid w-full max-w-6xl gap-2 mx-auto",children:_.jsx("h1",{className:"text-2xl font-semibold md:text-3xl",children:_.jsx(Zt,{i18nKey:"settings.edit.title"})})}),e]})]})})}),Gqe=()=>{const e=[{path:"*",Component:u8e}],t=[{path:"/",element:_.jsx(bx,{children:_.jsx(Bce,{to:"/quotes",replace:!0})})},{path:"/home",element:_.jsx(bx,{children:_.jsx(s8e,{})})},{path:"/catalog",element:_.jsx(t8e,{children:_.jsx(gP,{})}),children:[{index:!0,element:_.jsx(r8e,{})}]},{path:"/dealers",element:_.jsx(i8e,{children:_.jsx(gP,{})}),children:[{index:!0,element:_.jsx(c8e,{})}]},{path:"/quotes",element:_.jsx(Fqe,{children:_.jsx(gP,{})}),children:[{index:!0,element:_.jsx(zqe,{})},{path:"add",element:_.jsx(p8e,{})},{path:"edit/:id",element:_.jsx(Lqe,{})}]},{path:"/settings",element:_.jsx(qqe,{children:_.jsx(gP,{})}),children:[{index:!0,element:_.jsx(Vqe,{})}]},{path:"/logout",element:_.jsx(Z6e,{})}],n=[{path:"/login",Component:X6e}],r=M$e([...t,...n,...e],{});return _.jsx(V$e,{router:r})};function gpe(e,t){return function(){return e.apply(t,arguments)}}const{toString:Kqe}=Object.prototype,{getPrototypeOf:nq}=Object,iM=(e=>t=>{const n=Kqe.call(t);return e[n]||(e[n]=n.slice(8,-1).toLowerCase())})(Object.create(null)),Ic=e=>(e=e.toLowerCase(),t=>iM(t)===e),oM=e=>t=>typeof t===e,{isArray:s_}=Array,VC=oM("undefined");function Yqe(e){return e!==null&&!VC(e)&&e.constructor!==null&&!VC(e.constructor)&&Xa(e.constructor.isBuffer)&&e.constructor.isBuffer(e)}const vpe=Ic("ArrayBuffer");function Xqe(e){let t;return typeof ArrayBuffer<"u"&&ArrayBuffer.isView?t=ArrayBuffer.isView(e):t=e&&e.buffer&&vpe(e.buffer),t}const Qqe=oM("string"),Xa=oM("function"),ype=oM("number"),aM=e=>e!==null&&typeof e=="object",Zqe=e=>e===!0||e===!1,$N=e=>{if(iM(e)!=="object")return!1;const t=nq(e);return(t===null||t===Object.prototype||Object.getPrototypeOf(t)===null)&&!(Symbol.toStringTag in e)&&!(Symbol.iterator in e)},Jqe=Ic("Date"),eGe=Ic("File"),tGe=Ic("Blob"),nGe=Ic("FileList"),rGe=e=>aM(e)&&Xa(e.pipe),sGe=e=>{let t;return e&&(typeof FormData=="function"&&e instanceof FormData||Xa(e.append)&&((t=iM(e))==="formdata"||t==="object"&&Xa(e.toString)&&e.toString()==="[object FormData]"))},iGe=Ic("URLSearchParams"),[oGe,aGe,lGe,cGe]=["ReadableStream","Request","Response","Headers"].map(Ic),uGe=e=>e.trim?e.trim():e.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,"");function NR(e,t,{allOwnKeys:n=!1}={}){if(e===null||typeof e>"u")return;let r,s;if(typeof e!="object"&&(e=[e]),s_(e))for(r=0,s=e.length;r<s;r++)t.call(null,e[r],r,e);else{const i=n?Object.getOwnPropertyNames(e):Object.keys(e),o=i.length;let a;for(r=0;r<o;r++)a=i[r],t.call(null,e[a],a,e)}}function bpe(e,t){t=t.toLowerCase();const n=Object.keys(e);let r=n.length,s;for(;r-- >0;)if(s=n[r],t===s.toLowerCase())return s;return null}const yg=typeof globalThis<"u"?globalThis:typeof self<"u"?self:typeof window<"u"?window:global,xpe=e=>!VC(e)&&e!==yg;function bV(){const{caseless:e}=xpe(this)&&this||{},t={},n=(r,s)=>{const i=e&&bpe(t,s)||s;$N(t[i])&&$N(r)?t[i]=bV(t[i],r):$N(r)?t[i]=bV({},r):s_(r)?t[i]=r.slice():t[i]=r};for(let r=0,s=arguments.length;r<s;r++)arguments[r]&&NR(arguments[r],n);return t}const dGe=(e,t,n,{allOwnKeys:r}={})=>(NR(t,(s,i)=>{n&&Xa(s)?e[i]=gpe(s,n):e[i]=s},{allOwnKeys:r}),e),fGe=e=>(e.charCodeAt(0)===65279&&(e=e.slice(1)),e),hGe=(e,t,n,r)=>{e.prototype=Object.create(t.prototype,r),e.prototype.constructor=e,Object.defineProperty(e,"super",{value:t.prototype}),n&&Object.assign(e.prototype,n)},pGe=(e,t,n,r)=>{let s,i,o;const a={};if(t=t||{},e==null)return t;do{for(s=Object.getOwnPropertyNames(e),i=s.length;i-- >0;)o=s[i],(!r||r(o,e,t))&&!a[o]&&(t[o]=e[o],a[o]=!0);e=n!==!1&&nq(e)}while(e&&(!n||n(e,t))&&e!==Object.prototype);return t},mGe=(e,t,n)=>{e=String(e),(n===void 0||n>e.length)&&(n=e.length),n-=t.length;const r=e.indexOf(t,n);return r!==-1&&r===n},gGe=e=>{if(!e)return null;if(s_(e))return e;let t=e.length;if(!ype(t))return null;const n=new Array(t);for(;t-- >0;)n[t]=e[t];return n},vGe=(e=>t=>e&&t instanceof e)(typeof Uint8Array<"u"&&nq(Uint8Array)),yGe=(e,t)=>{const r=(e&&e[Symbol.iterator]).call(e);let s;for(;(s=r.next())&&!s.done;){const i=s.value;t.call(e,i[0],i[1])}},bGe=(e,t)=>{let n;const r=[];for(;(n=e.exec(t))!==null;)r.push(n);return r},xGe=Ic("HTMLFormElement"),_Ge=e=>e.toLowerCase().replace(/[-_\s]([a-z\d])(\w*)/g,function(n,r,s){return r.toUpperCase()+s}),QY=(({hasOwnProperty:e})=>(t,n)=>e.call(t,n))(Object.prototype),wGe=Ic("RegExp"),_pe=(e,t)=>{const n=Object.getOwnPropertyDescriptors(e),r={};NR(n,(s,i)=>{let o;(o=t(s,i,e))!==!1&&(r[i]=o||s)}),Object.defineProperties(e,r)},SGe=e=>{_pe(e,(t,n)=>{if(Xa(e)&&["arguments","caller","callee"].indexOf(n)!==-1)return!1;const r=e[n];if(Xa(r)){if(t.enumerable=!1,"writable"in t){t.writable=!1;return}t.set||(t.set=()=>{throw Error("Can not rewrite read-only method '"+n+"'")})}})},CGe=(e,t)=>{const n={},r=s=>{s.forEach(i=>{n[i]=!0})};return s_(e)?r(e):r(String(e).split(t)),n},EGe=()=>{},AGe=(e,t)=>e!=null&&Number.isFinite(e=+e)?e:t;function RGe(e){return!!(e&&Xa(e.append)&&e[Symbol.toStringTag]==="FormData"&&e[Symbol.iterator])}const PGe=e=>{const t=new Array(10),n=(r,s)=>{if(aM(r)){if(t.indexOf(r)>=0)return;if(!("toJSON"in r)){t[s]=r;const i=s_(r)?[]:{};return NR(r,(o,a)=>{const c=n(o,s+1);!VC(c)&&(i[a]=c)}),t[s]=void 0,i}}return r};return n(e,0)},NGe=Ic("AsyncFunction"),TGe=e=>e&&(aM(e)||Xa(e))&&Xa(e.then)&&Xa(e.catch),wpe=((e,t)=>e?setImmediate:t?((n,r)=>(yg.addEventListener("message",({source:s,data:i})=>{s===yg&&i===n&&r.length&&r.shift()()},!1),s=>{r.push(s),yg.postMessage(n,"*")}))(`axios@${Math.random()}`,[]):n=>setTimeout(n))(typeof setImmediate=="function",Xa(yg.postMessage)),kGe=typeof queueMicrotask<"u"?queueMicrotask.bind(yg):typeof process<"u"&&process.nextTick||wpe,Ne={isArray:s_,isArrayBuffer:vpe,isBuffer:Yqe,isFormData:sGe,isArrayBufferView:Xqe,isString:Qqe,isNumber:ype,isBoolean:Zqe,isObject:aM,isPlainObject:$N,isReadableStream:oGe,isRequest:aGe,isResponse:lGe,isHeaders:cGe,isUndefined:VC,isDate:Jqe,isFile:eGe,isBlob:tGe,isRegExp:wGe,isFunction:Xa,isStream:rGe,isURLSearchParams:iGe,isTypedArray:vGe,isFileList:nGe,forEach:NR,merge:bV,extend:dGe,trim:uGe,stripBOM:fGe,inherits:hGe,toFlatObject:pGe,kindOf:iM,kindOfTest:Ic,endsWith:mGe,toArray:gGe,forEachEntry:yGe,matchAll:bGe,isHTMLForm:xGe,hasOwnProperty:QY,hasOwnProp:QY,reduceDescriptors:_pe,freezeMethods:SGe,toObjectSet:CGe,toCamelCase:_Ge,noop:EGe,toFiniteNumber:AGe,findKey:bpe,global:yg,isContextDefined:xpe,isSpecCompliantForm:RGe,toJSONObject:PGe,isAsyncFn:NGe,isThenable:TGe,setImmediate:wpe,asap:kGe};function qt(e,t,n,r,s){Error.call(this),Error.captureStackTrace?Error.captureStackTrace(this,this.constructor):this.stack=new Error().stack,this.message=e,this.name="AxiosError",t&&(this.code=t),n&&(this.config=n),r&&(this.request=r),s&&(this.response=s,this.status=s.status?s.status:null)}Ne.inherits(qt,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:Ne.toJSONObject(this.config),code:this.code,status:this.status}}});const Spe=qt.prototype,Cpe={};["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(e=>{Cpe[e]={value:e}});Object.defineProperties(qt,Cpe);Object.defineProperty(Spe,"isAxiosError",{value:!0});qt.from=(e,t,n,r,s,i)=>{const o=Object.create(Spe);return Ne.toFlatObject(e,o,function(c){return c!==Error.prototype},a=>a!=="isAxiosError"),qt.call(o,e.message,t,n,r,s),o.cause=e,o.name=e.name,i&&Object.assign(o,i),o};const DGe=null;function xV(e){return Ne.isPlainObject(e)||Ne.isArray(e)}function Epe(e){return Ne.endsWith(e,"[]")?e.slice(0,-2):e}function ZY(e,t,n){return e?e.concat(t).map(function(s,i){return s=Epe(s),!n&&i?"["+s+"]":s}).join(n?".":""):t}function OGe(e){return Ne.isArray(e)&&!e.some(xV)}const MGe=Ne.toFlatObject(Ne,{},null,function(t){return/^is[A-Z]/.test(t)});function lM(e,t,n){if(!Ne.isObject(e))throw new TypeError("target must be an object");t=t||new FormData,n=Ne.toFlatObject(n,{metaTokens:!0,dots:!1,indexes:!1},!1,function(m,x){return!Ne.isUndefined(x[m])});const r=n.metaTokens,s=n.visitor||h,i=n.dots,o=n.indexes,c=(n.Blob||typeof Blob<"u"&&Blob)&&Ne.isSpecCompliantForm(t);if(!Ne.isFunction(s))throw new TypeError("visitor must be a function");function d(v){if(v===null)return"";if(Ne.isDate(v))return v.toISOString();if(!c&&Ne.isBlob(v))throw new qt("Blob is not supported. Use a Buffer instead.");return Ne.isArrayBuffer(v)||Ne.isTypedArray(v)?c&&typeof Blob=="function"?new Blob([v]):Buffer.from(v):v}function h(v,m,x){let y=v;if(v&&!x&&typeof v=="object"){if(Ne.endsWith(m,"{}"))m=r?m:m.slice(0,-2),v=JSON.stringify(v);else if(Ne.isArray(v)&&OGe(v)||(Ne.isFileList(v)||Ne.endsWith(m,"[]"))&&(y=Ne.toArray(v)))return m=Epe(m),y.forEach(function(w,E){!(Ne.isUndefined(w)||w===null)&&t.append(o===!0?ZY([m],E,i):o===null?m:m+"[]",d(w))}),!1}return xV(v)?!0:(t.append(ZY(x,m,i),d(v)),!1)}const u=[],f=Object.assign(MGe,{defaultVisitor:h,convertValue:d,isVisitable:xV});function g(v,m){if(!Ne.isUndefined(v)){if(u.indexOf(v)!==-1)throw Error("Circular reference detected in "+m.join("."));u.push(v),Ne.forEach(v,function(y,b){(!(Ne.isUndefined(y)||y===null)&&s.call(t,y,Ne.isString(b)?b.trim():b,m,f))===!0&&g(y,m?m.concat(b):[b])}),u.pop()}}if(!Ne.isObject(e))throw new TypeError("data must be an object");return g(e),t}function JY(e){const t={"!":"%21","'":"%27","(":"%28",")":"%29","~":"%7E","%20":"+","%00":"\0"};return encodeURIComponent(e).replace(/[!'()~]|%20|%00/g,function(r){return t[r]})}function rq(e,t){this._pairs=[],e&&lM(e,this,t)}const Ape=rq.prototype;Ape.append=function(t,n){this._pairs.push([t,n])};Ape.toString=function(t){const n=t?function(r){return t.call(this,r,JY)}:JY;return this._pairs.map(function(s){return n(s[0])+"="+n(s[1])},"").join("&")};function IGe(e){return encodeURIComponent(e).replace(/%3A/gi,":").replace(/%24/g,"$").replace(/%2C/gi,",").replace(/%20/g,"+").replace(/%5B/gi,"[").replace(/%5D/gi,"]")}function Rpe(e,t,n){if(!t)return e;const r=n&&n.encode||IGe;Ne.isFunction(n)&&(n={serialize:n});const s=n&&n.serialize;let i;if(s?i=s(t,n):i=Ne.isURLSearchParams(t)?t.toString():new rq(t,n).toString(r),i){const o=e.indexOf("#");o!==-1&&(e=e.slice(0,o)),e+=(e.indexOf("?")===-1?"?":"&")+i}return e}class eX{constructor(){this.handlers=[]}use(t,n,r){return this.handlers.push({fulfilled:t,rejected:n,synchronous:r?r.synchronous:!1,runWhen:r?r.runWhen:null}),this.handlers.length-1}eject(t){this.handlers[t]&&(this.handlers[t]=null)}clear(){this.handlers&&(this.handlers=[])}forEach(t){Ne.forEach(this.handlers,function(r){r!==null&&t(r)})}}const Ppe={silentJSONParsing:!0,forcedJSONParsing:!0,clarifyTimeoutError:!1},LGe=typeof URLSearchParams<"u"?URLSearchParams:rq,jGe=typeof FormData<"u"?FormData:null,$Ge=typeof Blob<"u"?Blob:null,FGe={isBrowser:!0,classes:{URLSearchParams:LGe,FormData:jGe,Blob:$Ge},protocols:["http","https","file","blob","url","data"]},sq=typeof window<"u"&&typeof document<"u",_V=typeof navigator=="object"&&navigator||void 0,zGe=sq&&(!_V||["ReactNative","NativeScript","NS"].indexOf(_V.product)<0),BGe=typeof WorkerGlobalScope<"u"&&self instanceof WorkerGlobalScope&&typeof self.importScripts=="function",UGe=sq&&window.location.href||"http://localhost",VGe=Object.freeze(Object.defineProperty({__proto__:null,hasBrowserEnv:sq,hasStandardBrowserEnv:zGe,hasStandardBrowserWebWorkerEnv:BGe,navigator:_V,origin:UGe},Symbol.toStringTag,{value:"Module"})),no={...VGe,...FGe};function HGe(e,t){return lM(e,new no.classes.URLSearchParams,Object.assign({visitor:function(n,r,s,i){return no.isNode&&Ne.isBuffer(n)?(this.append(r,n.toString("base64")),!1):i.defaultVisitor.apply(this,arguments)}},t))}function WGe(e){return Ne.matchAll(/\w+|\[(\w*)]/g,e).map(t=>t[0]==="[]"?"":t[1]||t[0])}function qGe(e){const t={},n=Object.keys(e);let r;const s=n.length;let i;for(r=0;r<s;r++)i=n[r],t[i]=e[i];return t}function Npe(e){function t(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&&Ne.isArray(s)?s.length:o,c?(Ne.hasOwnProp(s,o)?s[o]=[s[o],r]:s[o]=r,!a):((!s[o]||!Ne.isObject(s[o]))&&(s[o]=[]),t(n,r,s[o],i)&&Ne.isArray(s[o])&&(s[o]=qGe(s[o])),!a)}if(Ne.isFormData(e)&&Ne.isFunction(e.entries)){const n={};return Ne.forEachEntry(e,(r,s)=>{t(WGe(r),s,n,0)}),n}return null}function GGe(e,t,n){if(Ne.isString(e))try{return(t||JSON.parse)(e),Ne.trim(e)}catch(r){if(r.name!=="SyntaxError")throw r}return(n||JSON.stringify)(e)}const TR={transitional:Ppe,adapter:["xhr","http","fetch"],transformRequest:[function(t,n){const r=n.getContentType()||"",s=r.indexOf("application/json")>-1,i=Ne.isObject(t);if(i&&Ne.isHTMLForm(t)&&(t=new FormData(t)),Ne.isFormData(t))return s?JSON.stringify(Npe(t)):t;if(Ne.isArrayBuffer(t)||Ne.isBuffer(t)||Ne.isStream(t)||Ne.isFile(t)||Ne.isBlob(t)||Ne.isReadableStream(t))return t;if(Ne.isArrayBufferView(t))return t.buffer;if(Ne.isURLSearchParams(t))return n.setContentType("application/x-www-form-urlencoded;charset=utf-8",!1),t.toString();let a;if(i){if(r.indexOf("application/x-www-form-urlencoded")>-1)return HGe(t,this.formSerializer).toString();if((a=Ne.isFileList(t))||r.indexOf("multipart/form-data")>-1){const c=this.env&&this.env.FormData;return lM(a?{"files[]":t}:t,c&&new c,this.formSerializer)}}return i||s?(n.setContentType("application/json",!1),GGe(t)):t}],transformResponse:[function(t){const n=this.transitional||TR.transitional,r=n&&n.forcedJSONParsing,s=this.responseType==="json";if(Ne.isResponse(t)||Ne.isReadableStream(t))return t;if(t&&Ne.isString(t)&&(r&&!this.responseType||s)){const o=!(n&&n.silentJSONParsing)&&s;try{return JSON.parse(t)}catch(a){if(o)throw a.name==="SyntaxError"?qt.from(a,qt.ERR_BAD_RESPONSE,this,null,this.response):a}}return t}],timeout:0,xsrfCookieName:"XSRF-TOKEN",xsrfHeaderName:"X-XSRF-TOKEN",maxContentLength:-1,maxBodyLength:-1,env:{FormData:no.classes.FormData,Blob:no.classes.Blob},validateStatus:function(t){return t>=200&&t<300},headers:{common:{Accept:"application/json, text/plain, */*","Content-Type":void 0}}};Ne.forEach(["delete","get","head","post","put","patch"],e=>{TR.headers[e]={}});const KGe=Ne.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"]),YGe=e=>{const t={};let n,r,s;return e&&e.split(`
|
||
`).forEach(function(o){s=o.indexOf(":"),n=o.substring(0,s).trim().toLowerCase(),r=o.substring(s+1).trim(),!(!n||t[n]&&KGe[n])&&(n==="set-cookie"?t[n]?t[n].push(r):t[n]=[r]:t[n]=t[n]?t[n]+", "+r:r)}),t},tX=Symbol("internals");function n1(e){return e&&String(e).trim().toLowerCase()}function FN(e){return e===!1||e==null?e:Ne.isArray(e)?e.map(FN):String(e)}function XGe(e){const t=Object.create(null),n=/([^\s,;=]+)\s*(?:=\s*([^,;]+))?/g;let r;for(;r=n.exec(e);)t[r[1]]=r[2];return t}const QGe=e=>/^[-_a-zA-Z0-9^`|~,!#$%&'*+.]+$/.test(e.trim());function Cz(e,t,n,r,s){if(Ne.isFunction(r))return r.call(this,t,n);if(s&&(t=n),!!Ne.isString(t)){if(Ne.isString(r))return t.indexOf(r)!==-1;if(Ne.isRegExp(r))return r.test(t)}}function ZGe(e){return e.trim().toLowerCase().replace(/([a-z\d])(\w*)/g,(t,n,r)=>n.toUpperCase()+r)}function JGe(e,t){const n=Ne.toCamelCase(" "+t);["get","set","has"].forEach(r=>{Object.defineProperty(e,r+n,{value:function(s,i,o){return this[r].call(this,t,s,i,o)},configurable:!0})})}let oa=class{constructor(t){t&&this.set(t)}set(t,n,r){const s=this;function i(a,c,d){const h=n1(c);if(!h)throw new Error("header name must be a non-empty string");const u=Ne.findKey(s,h);(!u||s[u]===void 0||d===!0||d===void 0&&s[u]!==!1)&&(s[u||c]=FN(a))}const o=(a,c)=>Ne.forEach(a,(d,h)=>i(d,h,c));if(Ne.isPlainObject(t)||t instanceof this.constructor)o(t,n);else if(Ne.isString(t)&&(t=t.trim())&&!QGe(t))o(YGe(t),n);else if(Ne.isHeaders(t))for(const[a,c]of t.entries())i(c,a,r);else t!=null&&i(n,t,r);return this}get(t,n){if(t=n1(t),t){const r=Ne.findKey(this,t);if(r){const s=this[r];if(!n)return s;if(n===!0)return XGe(s);if(Ne.isFunction(n))return n.call(this,s,r);if(Ne.isRegExp(n))return n.exec(s);throw new TypeError("parser must be boolean|regexp|function")}}}has(t,n){if(t=n1(t),t){const r=Ne.findKey(this,t);return!!(r&&this[r]!==void 0&&(!n||Cz(this,this[r],r,n)))}return!1}delete(t,n){const r=this;let s=!1;function i(o){if(o=n1(o),o){const a=Ne.findKey(r,o);a&&(!n||Cz(r,r[a],a,n))&&(delete r[a],s=!0)}}return Ne.isArray(t)?t.forEach(i):i(t),s}clear(t){const n=Object.keys(this);let r=n.length,s=!1;for(;r--;){const i=n[r];(!t||Cz(this,this[i],i,t,!0))&&(delete this[i],s=!0)}return s}normalize(t){const n=this,r={};return Ne.forEach(this,(s,i)=>{const o=Ne.findKey(r,i);if(o){n[o]=FN(s),delete n[i];return}const a=t?ZGe(i):String(i).trim();a!==i&&delete n[i],n[a]=FN(s),r[a]=!0}),this}concat(...t){return this.constructor.concat(this,...t)}toJSON(t){const n=Object.create(null);return Ne.forEach(this,(r,s)=>{r!=null&&r!==!1&&(n[s]=t&&Ne.isArray(r)?r.join(", "):r)}),n}[Symbol.iterator](){return Object.entries(this.toJSON())[Symbol.iterator]()}toString(){return Object.entries(this.toJSON()).map(([t,n])=>t+": "+n).join(`
|
||
`)}get[Symbol.toStringTag](){return"AxiosHeaders"}static from(t){return t instanceof this?t:new this(t)}static concat(t,...n){const r=new this(t);return n.forEach(s=>r.set(s)),r}static accessor(t){const r=(this[tX]=this[tX]={accessors:{}}).accessors,s=this.prototype;function i(o){const a=n1(o);r[a]||(JGe(s,o),r[a]=!0)}return Ne.isArray(t)?t.forEach(i):i(t),this}};oa.accessor(["Content-Type","Content-Length","Accept","Accept-Encoding","User-Agent","Authorization"]);Ne.reduceDescriptors(oa.prototype,({value:e},t)=>{let n=t[0].toUpperCase()+t.slice(1);return{get:()=>e,set(r){this[n]=r}}});Ne.freezeMethods(oa);function Ez(e,t){const n=this||TR,r=t||n,s=oa.from(r.headers);let i=r.data;return Ne.forEach(e,function(a){i=a.call(n,i,s.normalize(),t?t.status:void 0)}),s.normalize(),i}function Tpe(e){return!!(e&&e.__CANCEL__)}function i_(e,t,n){qt.call(this,e??"canceled",qt.ERR_CANCELED,t,n),this.name="CanceledError"}Ne.inherits(i_,qt,{__CANCEL__:!0});function kpe(e,t,n){const r=n.config.validateStatus;!n.status||!r||r(n.status)?e(n):t(new qt("Request failed with status code "+n.status,[qt.ERR_BAD_REQUEST,qt.ERR_BAD_RESPONSE][Math.floor(n.status/100)-4],n.config,n.request,n))}function e9e(e){const t=/^([-+\w]{1,25})(:?\/\/|:)/.exec(e);return t&&t[1]||""}function t9e(e,t){e=e||10;const n=new Array(e),r=new Array(e);let s=0,i=0,o;return t=t!==void 0?t:1e3,function(c){const d=Date.now(),h=r[i];o||(o=d),n[s]=c,r[s]=d;let u=i,f=0;for(;u!==s;)f+=n[u++],u=u%e;if(s=(s+1)%e,s===i&&(i=(i+1)%e),d-o<t)return;const g=h&&d-h;return g?Math.round(f*1e3/g):void 0}}function n9e(e,t){let n=0,r=1e3/t,s,i;const o=(d,h=Date.now())=>{n=h,s=null,i&&(clearTimeout(i),i=null),e.apply(null,d)};return[(...d)=>{const h=Date.now(),u=h-n;u>=r?o(d,h):(s=d,i||(i=setTimeout(()=>{i=null,o(s)},r-u)))},()=>s&&o(s)]}const xk=(e,t,n=3)=>{let r=0;const s=t9e(50,250);return n9e(i=>{const o=i.loaded,a=i.lengthComputable?i.total:void 0,c=o-r,d=s(c),h=o<=a;r=o;const u={loaded:o,total:a,progress:a?o/a:void 0,bytes:c,rate:d||void 0,estimated:d&&a&&h?(a-o)/d:void 0,event:i,lengthComputable:a!=null,[t?"download":"upload"]:!0};e(u)},n)},nX=(e,t)=>{const n=e!=null;return[r=>t[0]({lengthComputable:n,total:e,loaded:r}),t[1]]},rX=e=>(...t)=>Ne.asap(()=>e(...t)),r9e=no.hasStandardBrowserEnv?((e,t)=>n=>(n=new URL(n,no.origin),e.protocol===n.protocol&&e.host===n.host&&(t||e.port===n.port)))(new URL(no.origin),no.navigator&&/(msie|trident)/i.test(no.navigator.userAgent)):()=>!0,s9e=no.hasStandardBrowserEnv?{write(e,t,n,r,s,i){const o=[e+"="+encodeURIComponent(t)];Ne.isNumber(n)&&o.push("expires="+new Date(n).toGMTString()),Ne.isString(r)&&o.push("path="+r),Ne.isString(s)&&o.push("domain="+s),i===!0&&o.push("secure"),document.cookie=o.join("; ")},read(e){const t=document.cookie.match(new RegExp("(^|;\\s*)("+e+")=([^;]*)"));return t?decodeURIComponent(t[3]):null},remove(e){this.write(e,"",Date.now()-864e5)}}:{write(){},read(){return null},remove(){}};function i9e(e){return/^([a-z][a-z\d+\-.]*:)?\/\//i.test(e)}function o9e(e,t){return t?e.replace(/\/?\/$/,"")+"/"+t.replace(/^\/+/,""):e}function Dpe(e,t,n){let r=!i9e(t);return e&&(r||n==!1)?o9e(e,t):t}const sX=e=>e instanceof oa?{...e}:e;function ty(e,t){t=t||{};const n={};function r(d,h,u,f){return Ne.isPlainObject(d)&&Ne.isPlainObject(h)?Ne.merge.call({caseless:f},d,h):Ne.isPlainObject(h)?Ne.merge({},h):Ne.isArray(h)?h.slice():h}function s(d,h,u,f){if(Ne.isUndefined(h)){if(!Ne.isUndefined(d))return r(void 0,d,u,f)}else return r(d,h,u,f)}function i(d,h){if(!Ne.isUndefined(h))return r(void 0,h)}function o(d,h){if(Ne.isUndefined(h)){if(!Ne.isUndefined(d))return r(void 0,d)}else return r(void 0,h)}function a(d,h,u){if(u in t)return r(d,h);if(u in e)return r(void 0,d)}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:(d,h,u)=>s(sX(d),sX(h),u,!0)};return Ne.forEach(Object.keys(Object.assign({},e,t)),function(h){const u=c[h]||s,f=u(e[h],t[h],h);Ne.isUndefined(f)&&u!==a||(n[h]=f)}),n}const Ope=e=>{const t=ty({},e);let{data:n,withXSRFToken:r,xsrfHeaderName:s,xsrfCookieName:i,headers:o,auth:a}=t;t.headers=o=oa.from(o),t.url=Rpe(Dpe(t.baseURL,t.url,t.allowAbsoluteUrls),e.params,e.paramsSerializer),a&&o.set("Authorization","Basic "+btoa((a.username||"")+":"+(a.password?unescape(encodeURIComponent(a.password)):"")));let c;if(Ne.isFormData(n)){if(no.hasStandardBrowserEnv||no.hasStandardBrowserWebWorkerEnv)o.setContentType(void 0);else if((c=o.getContentType())!==!1){const[d,...h]=c?c.split(";").map(u=>u.trim()).filter(Boolean):[];o.setContentType([d||"multipart/form-data",...h].join("; "))}}if(no.hasStandardBrowserEnv&&(r&&Ne.isFunction(r)&&(r=r(t)),r||r!==!1&&r9e(t.url))){const d=s&&i&&s9e.read(i);d&&o.set(s,d)}return t},a9e=typeof XMLHttpRequest<"u",l9e=a9e&&function(e){return new Promise(function(n,r){const s=Ope(e);let i=s.data;const o=oa.from(s.headers).normalize();let{responseType:a,onUploadProgress:c,onDownloadProgress:d}=s,h,u,f,g,v;function m(){g&&g(),v&&v(),s.cancelToken&&s.cancelToken.unsubscribe(h),s.signal&&s.signal.removeEventListener("abort",h)}let x=new XMLHttpRequest;x.open(s.method.toUpperCase(),s.url,!0),x.timeout=s.timeout;function y(){if(!x)return;const w=oa.from("getAllResponseHeaders"in x&&x.getAllResponseHeaders()),R={data:!a||a==="text"||a==="json"?x.responseText:x.response,status:x.status,statusText:x.statusText,headers:w,config:e,request:x};kpe(function(N){n(N),m()},function(N){r(N),m()},R),x=null}"onloadend"in x?x.onloadend=y:x.onreadystatechange=function(){!x||x.readyState!==4||x.status===0&&!(x.responseURL&&x.responseURL.indexOf("file:")===0)||setTimeout(y)},x.onabort=function(){x&&(r(new qt("Request aborted",qt.ECONNABORTED,e,x)),x=null)},x.onerror=function(){r(new qt("Network Error",qt.ERR_NETWORK,e,x)),x=null},x.ontimeout=function(){let E=s.timeout?"timeout of "+s.timeout+"ms exceeded":"timeout exceeded";const R=s.transitional||Ppe;s.timeoutErrorMessage&&(E=s.timeoutErrorMessage),r(new qt(E,R.clarifyTimeoutError?qt.ETIMEDOUT:qt.ECONNABORTED,e,x)),x=null},i===void 0&&o.setContentType(null),"setRequestHeader"in x&&Ne.forEach(o.toJSON(),function(E,R){x.setRequestHeader(R,E)}),Ne.isUndefined(s.withCredentials)||(x.withCredentials=!!s.withCredentials),a&&a!=="json"&&(x.responseType=s.responseType),d&&([f,v]=xk(d,!0),x.addEventListener("progress",f)),c&&x.upload&&([u,g]=xk(c),x.upload.addEventListener("progress",u),x.upload.addEventListener("loadend",g)),(s.cancelToken||s.signal)&&(h=w=>{x&&(r(!w||w.type?new i_(null,e,x):w),x.abort(),x=null)},s.cancelToken&&s.cancelToken.subscribe(h),s.signal&&(s.signal.aborted?h():s.signal.addEventListener("abort",h)));const b=e9e(s.url);if(b&&no.protocols.indexOf(b)===-1){r(new qt("Unsupported protocol "+b+":",qt.ERR_BAD_REQUEST,e));return}x.send(i||null)})},c9e=(e,t)=>{const{length:n}=e=e?e.filter(Boolean):[];if(t||n){let r=new AbortController,s;const i=function(d){if(!s){s=!0,a();const h=d instanceof Error?d:this.reason;r.abort(h instanceof qt?h:new i_(h instanceof Error?h.message:h))}};let o=t&&setTimeout(()=>{o=null,i(new qt(`timeout ${t} of ms exceeded`,qt.ETIMEDOUT))},t);const a=()=>{e&&(o&&clearTimeout(o),o=null,e.forEach(d=>{d.unsubscribe?d.unsubscribe(i):d.removeEventListener("abort",i)}),e=null)};e.forEach(d=>d.addEventListener("abort",i));const{signal:c}=r;return c.unsubscribe=()=>Ne.asap(a),c}},u9e=function*(e,t){let n=e.byteLength;if(n<t){yield e;return}let r=0,s;for(;r<n;)s=r+t,yield e.slice(r,s),r=s},d9e=async function*(e,t){for await(const n of f9e(e))yield*u9e(n,t)},f9e=async function*(e){if(e[Symbol.asyncIterator]){yield*e;return}const t=e.getReader();try{for(;;){const{done:n,value:r}=await t.read();if(n)break;yield r}}finally{await t.cancel()}},iX=(e,t,n,r)=>{const s=d9e(e,t);let i=0,o,a=c=>{o||(o=!0,r&&r(c))};return new ReadableStream({async pull(c){try{const{done:d,value:h}=await s.next();if(d){a(),c.close();return}let u=h.byteLength;if(n){let f=i+=u;n(f)}c.enqueue(new Uint8Array(h))}catch(d){throw a(d),d}},cancel(c){return a(c),s.return()}},{highWaterMark:2})},cM=typeof fetch=="function"&&typeof Request=="function"&&typeof Response=="function",Mpe=cM&&typeof ReadableStream=="function",h9e=cM&&(typeof TextEncoder=="function"?(e=>t=>e.encode(t))(new TextEncoder):async e=>new Uint8Array(await new Response(e).arrayBuffer())),Ipe=(e,...t)=>{try{return!!e(...t)}catch{return!1}},p9e=Mpe&&Ipe(()=>{let e=!1;const t=new Request(no.origin,{body:new ReadableStream,method:"POST",get duplex(){return e=!0,"half"}}).headers.has("Content-Type");return e&&!t}),oX=64*1024,wV=Mpe&&Ipe(()=>Ne.isReadableStream(new Response("").body)),_k={stream:wV&&(e=>e.body)};cM&&(e=>{["text","arrayBuffer","blob","formData","stream"].forEach(t=>{!_k[t]&&(_k[t]=Ne.isFunction(e[t])?n=>n[t]():(n,r)=>{throw new qt(`Response type '${t}' is not supported`,qt.ERR_NOT_SUPPORT,r)})})})(new Response);const m9e=async e=>{if(e==null)return 0;if(Ne.isBlob(e))return e.size;if(Ne.isSpecCompliantForm(e))return(await new Request(no.origin,{method:"POST",body:e}).arrayBuffer()).byteLength;if(Ne.isArrayBufferView(e)||Ne.isArrayBuffer(e))return e.byteLength;if(Ne.isURLSearchParams(e)&&(e=e+""),Ne.isString(e))return(await h9e(e)).byteLength},g9e=async(e,t)=>{const n=Ne.toFiniteNumber(e.getContentLength());return n??m9e(t)},v9e=cM&&(async e=>{let{url:t,method:n,data:r,signal:s,cancelToken:i,timeout:o,onDownloadProgress:a,onUploadProgress:c,responseType:d,headers:h,withCredentials:u="same-origin",fetchOptions:f}=Ope(e);d=d?(d+"").toLowerCase():"text";let g=c9e([s,i&&i.toAbortSignal()],o),v;const m=g&&g.unsubscribe&&(()=>{g.unsubscribe()});let x;try{if(c&&p9e&&n!=="get"&&n!=="head"&&(x=await g9e(h,r))!==0){let R=new Request(t,{method:"POST",body:r,duplex:"half"}),T;if(Ne.isFormData(r)&&(T=R.headers.get("content-type"))&&h.setContentType(T),R.body){const[N,A]=nX(x,xk(rX(c)));r=iX(R.body,oX,N,A)}}Ne.isString(u)||(u=u?"include":"omit");const y="credentials"in Request.prototype;v=new Request(t,{...f,signal:g,method:n.toUpperCase(),headers:h.normalize().toJSON(),body:r,duplex:"half",credentials:y?u:void 0});let b=await fetch(v);const w=wV&&(d==="stream"||d==="response");if(wV&&(a||w&&m)){const R={};["status","statusText","headers"].forEach(D=>{R[D]=b[D]});const T=Ne.toFiniteNumber(b.headers.get("content-length")),[N,A]=a&&nX(T,xk(rX(a),!0))||[];b=new Response(iX(b.body,oX,N,()=>{A&&A(),m&&m()}),R)}d=d||"text";let E=await _k[Ne.findKey(_k,d)||"text"](b,e);return!w&&m&&m(),await new Promise((R,T)=>{kpe(R,T,{data:E,headers:oa.from(b.headers),status:b.status,statusText:b.statusText,config:e,request:v})})}catch(y){throw m&&m(),y&&y.name==="TypeError"&&/fetch/i.test(y.message)?Object.assign(new qt("Network Error",qt.ERR_NETWORK,e,v),{cause:y.cause||y}):qt.from(y,y&&y.code,e,v)}}),SV={http:DGe,xhr:l9e,fetch:v9e};Ne.forEach(SV,(e,t)=>{if(e){try{Object.defineProperty(e,"name",{value:t})}catch{}Object.defineProperty(e,"adapterName",{value:t})}});const aX=e=>`- ${e}`,y9e=e=>Ne.isFunction(e)||e===null||e===!1,Lpe={getAdapter:e=>{e=Ne.isArray(e)?e:[e];const{length:t}=e;let n,r;const s={};for(let i=0;i<t;i++){n=e[i];let o;if(r=n,!y9e(n)&&(r=SV[(o=String(n)).toLowerCase()],r===void 0))throw new qt(`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=t?i.length>1?`since :
|
||
`+i.map(aX).join(`
|
||
`):" "+aX(i[0]):"as no adapter specified";throw new qt("There is no suitable adapter to dispatch the request "+o,"ERR_NOT_SUPPORT")}return r},adapters:SV};function Az(e){if(e.cancelToken&&e.cancelToken.throwIfRequested(),e.signal&&e.signal.aborted)throw new i_(null,e)}function lX(e){return Az(e),e.headers=oa.from(e.headers),e.data=Ez.call(e,e.transformRequest),["post","put","patch"].indexOf(e.method)!==-1&&e.headers.setContentType("application/x-www-form-urlencoded",!1),Lpe.getAdapter(e.adapter||TR.adapter)(e).then(function(r){return Az(e),r.data=Ez.call(e,e.transformResponse,r),r.headers=oa.from(r.headers),r},function(r){return Tpe(r)||(Az(e),r&&r.response&&(r.response.data=Ez.call(e,e.transformResponse,r.response),r.response.headers=oa.from(r.response.headers))),Promise.reject(r)})}const jpe="1.8.4",uM={};["object","boolean","number","function","string","symbol"].forEach((e,t)=>{uM[e]=function(r){return typeof r===e||"a"+(t<1?"n ":" ")+e}});const cX={};uM.transitional=function(t,n,r){function s(i,o){return"[Axios v"+jpe+"] Transitional option '"+i+"'"+o+(r?". "+r:"")}return(i,o,a)=>{if(t===!1)throw new qt(s(o," has been removed"+(n?" in "+n:"")),qt.ERR_DEPRECATED);return n&&!cX[o]&&(cX[o]=!0,console.warn(s(o," has been deprecated since v"+n+" and will be removed in the near future"))),t?t(i,o,a):!0}};uM.spelling=function(t){return(n,r)=>(console.warn(`${r} is likely a misspelling of ${t}`),!0)};function b9e(e,t,n){if(typeof e!="object")throw new qt("options must be an object",qt.ERR_BAD_OPTION_VALUE);const r=Object.keys(e);let s=r.length;for(;s-- >0;){const i=r[s],o=t[i];if(o){const a=e[i],c=a===void 0||o(a,i,e);if(c!==!0)throw new qt("option "+i+" must be "+c,qt.ERR_BAD_OPTION_VALUE);continue}if(n!==!0)throw new qt("Unknown option "+i,qt.ERR_BAD_OPTION)}}const zN={assertOptions:b9e,validators:uM},Uc=zN.validators;let Nv=class{constructor(t){this.defaults=t,this.interceptors={request:new eX,response:new eX}}async request(t,n){try{return await this._request(t,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(t,n){typeof t=="string"?(n=n||{},n.url=t):n=t||{},n=ty(this.defaults,n);const{transitional:r,paramsSerializer:s,headers:i}=n;r!==void 0&&zN.assertOptions(r,{silentJSONParsing:Uc.transitional(Uc.boolean),forcedJSONParsing:Uc.transitional(Uc.boolean),clarifyTimeoutError:Uc.transitional(Uc.boolean)},!1),s!=null&&(Ne.isFunction(s)?n.paramsSerializer={serialize:s}:zN.assertOptions(s,{encode:Uc.function,serialize:Uc.function},!0)),n.allowAbsoluteUrls!==void 0||(this.defaults.allowAbsoluteUrls!==void 0?n.allowAbsoluteUrls=this.defaults.allowAbsoluteUrls:n.allowAbsoluteUrls=!0),zN.assertOptions(n,{baseUrl:Uc.spelling("baseURL"),withXsrfToken:Uc.spelling("withXSRFToken")},!0),n.method=(n.method||this.defaults.method||"get").toLowerCase();let o=i&&Ne.merge(i.common,i[n.method]);i&&Ne.forEach(["delete","get","head","post","put","patch","common"],v=>{delete i[v]}),n.headers=oa.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 d=[];this.interceptors.response.forEach(function(m){d.push(m.fulfilled,m.rejected)});let h,u=0,f;if(!c){const v=[lX.bind(this),void 0];for(v.unshift.apply(v,a),v.push.apply(v,d),f=v.length,h=Promise.resolve(n);u<f;)h=h.then(v[u++],v[u++]);return h}f=a.length;let g=n;for(u=0;u<f;){const v=a[u++],m=a[u++];try{g=v(g)}catch(x){m.call(this,x);break}}try{h=lX.call(this,g)}catch(v){return Promise.reject(v)}for(u=0,f=d.length;u<f;)h=h.then(d[u++],d[u++]);return h}getUri(t){t=ty(this.defaults,t);const n=Dpe(t.baseURL,t.url,t.allowAbsoluteUrls);return Rpe(n,t.params,t.paramsSerializer)}};Ne.forEach(["delete","get","head","options"],function(t){Nv.prototype[t]=function(n,r){return this.request(ty(r||{},{method:t,url:n,data:(r||{}).data}))}});Ne.forEach(["post","put","patch"],function(t){function n(r){return function(i,o,a){return this.request(ty(a||{},{method:t,headers:r?{"Content-Type":"multipart/form-data"}:{},url:i,data:o}))}}Nv.prototype[t]=n(),Nv.prototype[t+"Form"]=n(!0)});let x9e=class $pe{constructor(t){if(typeof t!="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},t(function(i,o,a){r.reason||(r.reason=new i_(i,o,a),n(r.reason))})}throwIfRequested(){if(this.reason)throw this.reason}subscribe(t){if(this.reason){t(this.reason);return}this._listeners?this._listeners.push(t):this._listeners=[t]}unsubscribe(t){if(!this._listeners)return;const n=this._listeners.indexOf(t);n!==-1&&this._listeners.splice(n,1)}toAbortSignal(){const t=new AbortController,n=r=>{t.abort(r)};return this.subscribe(n),t.signal.unsubscribe=()=>this.unsubscribe(n),t.signal}static source(){let t;return{token:new $pe(function(s){t=s}),cancel:t}}};function _9e(e){return function(n){return e.apply(null,n)}}function w9e(e){return Ne.isObject(e)&&e.isAxiosError===!0}const CV={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(CV).forEach(([e,t])=>{CV[t]=e});function Fpe(e){const t=new Nv(e),n=gpe(Nv.prototype.request,t);return Ne.extend(n,Nv.prototype,t,{allOwnKeys:!0}),Ne.extend(n,t,null,{allOwnKeys:!0}),n.create=function(s){return Fpe(ty(e,s))},n}const Es=Fpe(TR);Es.Axios=Nv;Es.CanceledError=i_;Es.CancelToken=x9e;Es.isCancel=Tpe;Es.VERSION=jpe;Es.toFormData=lM;Es.AxiosError=qt;Es.Cancel=Es.CanceledError;Es.all=function(t){return Promise.all(t)};Es.spread=_9e;Es.isAxiosError=w9e;Es.mergeConfig=ty;Es.AxiosHeaders=oa;Es.formToJSON=e=>Npe(Ne.isHTMLForm(e)?new FormData(e):e);Es.getAdapter=Lpe.getAdapter;Es.HttpStatusCode=CV;Es.default=Es;const{Axios:q7e,AxiosError:G7e,CanceledError:K7e,isCancel:Y7e,CancelToken:X7e,VERSION:Q7e,all:Z7e,Cancel:J7e,isAxiosError:eKe,spread:tKe,toFormData:nKe,AxiosHeaders:rKe,HttpStatusCode:sKe,formToJSON:iKe,getAdapter:oKe,mergeConfig:aKe}=Es,zpe=()=>{const e=dl.getItem("uecko.auth");return e&&e.token?`Bearer ${e.token}`:""},S9e=e=>(e.headers.Authorization=zpe(),e),C9e=e=>Promise.reject(e),E9e=e=>((e==null?void 0:e.config).raw,e),A9e=e=>{if(console.debug("[response error]"),e.response){console.debug("1 => El servidor respondió con un código de estado > 200");const t=e.response.data,n=e.response.status;switch(console.debug(t),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(t)}else e.request?(console.debug("2 => El servidor no respondió"),console.error(e)):e.code==="ERR_CANCELED"?console.debug("3 => Petición cancelada"):(console.debug("4 => Error desconocido"),console.error(e));return console.groupEnd(),Promise.reject(e)};function R9e(e){return e.interceptors.request.use(S9e,C9e),e.interceptors.response.use(E9e,A9e),e}const Bpe={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":"*"}},Upe=()=>R9e(Es.create(Bpe)),P9e=(e,t=Upe())=>({login:async({email:n,password:r})=>{dl.clear();try{const s=await t.request({url:`${e}/auth/login`,method:"POST",data:{email:n,password:r}}),{data:i}=s;return dl.setItem("uecko.auth",i),{success:!0,data:i}}catch{return{success:!1,error:{message:"Login failed",name:"Invalid email or password"}}}},logout:()=>(dl.clear(),Promise.resolve({success:!0,redirectTo:"/login"})),check:()=>{const n=dl.getItem("uecko.auth"),r=!!(n!=null&&n.token);return r||dl.clear(),Promise.resolve(r?{authenticated:!0}:{authenticated:!1,redirectTo:"/login"})},getProfile:async()=>{try{const n=await t.request({url:`${e}/profile`,method:"GET"}),{data:r}=n,s=dl.getItem("uecko.auth");return(s==null?void 0:s.id)===(r==null?void 0:r.id)?(dl.setItem("uecko.profile",r),Promise.resolve(r)):Promise.resolve(null)}catch{return Promise.resolve(null)}},onError:n=>(dl.clear(),Promise.resolve({error:n,logout:!0}))}),N9e=(e,t=Upe())=>({name:()=>"AxiosDataProvider",getApiUrl:()=>e,getApiAuthorization:zpe,getList:async n=>{const{resource:r,quickSearchTerm:s,pagination:i,filters:o=[],sort:a=[]}=n,c=`${e}/${r}`,d=new URLSearchParams,{page:h,limit:u}=O9e(i);d.append("page",String(h)),d.append("limit",String(u));const f=T9e(a);f.length&&d.append("$sort_by",f.join(","));const g=D9e(s,o);g.length&&d.append("q",g.join(","));const v=k9e(o);return v.length&&d.append("$filters",v.join(",")),(await t.request({url:`${c}?${d.toString()}`,method:"GET"})).data},getOne:async n=>{const{resource:r,id:s}=n;return(await t.request({url:`${e}/${r}/${s}`,method:"GET"})).data},createOne:async n=>{const{resource:r,data:s}=n;return(await t.request({url:`${e}/${r}`,method:"POST",data:s})).data},updateOne:async n=>{const{resource:r,data:s,id:i}=n;return(await t.request({url:`${e}/${r}/${i}`,method:"PUT",data:s})).data},removeOne:async n=>{const{resource:r,id:s}=n;await t.request({url:`${e}/${r}/${s}`,method:"DELETE"})},uploadFile:async n=>{const{path:r,file:s,key:i,onUploadProgress:o}=n,a=`${e}/${r}`,c=new FormData;return c.append(i||"file",s),(await t.post(a,c,{headers:{"Content-Type":"multipart/form-data"},onUploadProgress:o})).data},downloadPDF:async n=>{const{url:r,config:s}=n,i=await t.get(r,{responseType:"arraybuffer",...s}),o=i.headers["content-disposition"];let a="downloaded-file.pdf";if(o){const d=o.match(/filename="?(.+)"?/);d&&d[1]&&(a=d[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:d,...h}=n;let u;if(s)u=`${e}/${s}`;else if(r)u=r;else throw new Error('"url" or "path" param is missing');let f;const g={url:u.toString(),method:i,responseType:o,signal:c,...h,...Bpe};switch(i){case"put":case"post":case"patch":f=await t.request({...g,data:d});break;case"delete":f=await t.delete(u.toString(),{responseType:o,headers:a,...h});break;default:f=await t.get(u.toString(),{responseType:o,signal:c,headers:a,...h});break}return f.data}}),T9e=(e=[])=>e.map(({field:t,order:n})=>`${n==="DESC"?"-":"+"}${t}`),k9e=(e=[])=>e.filter(({field:t})=>t!=="q").map(({field:t,operator:n,value:r})=>`${t}[${n}]${r}`),D9e=(e=[],t=[])=>{var n;return(n=t.find(({field:r})=>r==="q"))!=null&&n.value?[t.find(({field:r})=>r==="q").value]:e},O9e=e=>{const{pageIndex:t=jb,pageSize:n=aW}=e||{};return{page:t,limit:n}},{slice:M9e,forEach:I9e}=[];function L9e(e){return I9e.call(M9e.call(arguments,1),t=>{if(t)for(const n in t)e[n]===void 0&&(e[n]=t[n])}),e}const uX=/^[\u0009\u0020-\u007e\u0080-\u00ff]+$/,j9e=function(e,t){const r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{path:"/"},s=encodeURIComponent(t);let i=`${e}=${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(!uX.test(r.domain))throw new TypeError("option domain is invalid");i+=`; Domain=${r.domain}`}if(r.path){if(!uX.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},dX={create(e,t,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=j9e(e,encodeURIComponent(t),s)},read(e){const t=`${e}=`,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(t)===0)return s.substring(t.length,s.length)}return null},remove(e){this.create(e,"",-1)}};var $9e={name:"cookie",lookup(e){let{lookupCookie:t}=e;if(t&&typeof document<"u")return dX.read(t)||void 0},cacheUserLanguage(e,t){let{lookupCookie:n,cookieMinutes:r,cookieDomain:s,cookieOptions:i}=t;n&&typeof document<"u"&&dX.create(n,e,r,s,i)}},F9e={name:"querystring",lookup(e){var r;let{lookupQuerystring:t}=e,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)===t&&(n=o[a].substring(c+1))}}return n}};let qy=null;const fX=()=>{if(qy!==null)return qy;try{if(qy=typeof window<"u"&&window.localStorage!==null,!qy)return!1;const e="i18next.translate.boo";window.localStorage.setItem(e,"foo"),window.localStorage.removeItem(e)}catch{qy=!1}return qy};var z9e={name:"localStorage",lookup(e){let{lookupLocalStorage:t}=e;if(t&&fX())return window.localStorage.getItem(t)||void 0},cacheUserLanguage(e,t){let{lookupLocalStorage:n}=t;n&&fX()&&window.localStorage.setItem(n,e)}};let Gy=null;const hX=()=>{if(Gy!==null)return Gy;try{if(Gy=typeof window<"u"&&window.sessionStorage!==null,!Gy)return!1;const e="i18next.translate.boo";window.sessionStorage.setItem(e,"foo"),window.sessionStorage.removeItem(e)}catch{Gy=!1}return Gy};var B9e={name:"sessionStorage",lookup(e){let{lookupSessionStorage:t}=e;if(t&&hX())return window.sessionStorage.getItem(t)||void 0},cacheUserLanguage(e,t){let{lookupSessionStorage:n}=t;n&&hX()&&window.sessionStorage.setItem(n,e)}},U9e={name:"navigator",lookup(e){const t=[];if(typeof navigator<"u"){const{languages:n,userLanguage:r,language:s}=navigator;if(n)for(let i=0;i<n.length;i++)t.push(n[i]);r&&t.push(r),s&&t.push(s)}return t.length>0?t:void 0}},V9e={name:"htmlTag",lookup(e){let{htmlTag:t}=e,n;const r=t||(typeof document<"u"?document.documentElement:null);return r&&typeof r.getAttribute=="function"&&(n=r.getAttribute("lang")),n}},H9e={name:"path",lookup(e){var s;let{lookupFromPathIndex:t}=e;if(typeof window>"u")return;const n=window.location.pathname.match(/\/([a-zA-Z-]*)/g);return Array.isArray(n)?(s=n[typeof t=="number"?t:0])==null?void 0:s.replace("/",""):void 0}},W9e={name:"subdomain",lookup(e){var s,i;let{lookupFromSubdomainIndex:t}=e;const n=typeof t=="number"?t+1:1,r=typeof window<"u"&&((i=(s=window.location)==null?void 0:s.hostname)==null?void 0:i.match(/^(\w{2,5})\.(([a-z0-9-]{1,63}\.[a-z]{2,6})|localhost)/i));if(r)return r[n]}};let Vpe=!1;try{document.cookie,Vpe=!0}catch{}const Hpe=["querystring","cookie","localStorage","sessionStorage","navigator","htmlTag"];Vpe||Hpe.splice(1,1);const q9e=()=>({order:Hpe,lookupQuerystring:"lng",lookupCookie:"i18next",lookupLocalStorage:"i18nextLng",lookupSessionStorage:"i18nextLng",caches:["localStorage"],excludeCacheFor:["cimode"],convertDetectedLanguage:e=>e});class Wpe{constructor(t){let n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};this.type="languageDetector",this.detectors={},this.init(t,n)}init(){let t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{languageUtils:{}},n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};this.services=t,this.options=L9e(n,this.options||{},q9e()),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($9e),this.addDetector(F9e),this.addDetector(z9e),this.addDetector(B9e),this.addDetector(U9e),this.addDetector(V9e),this.addDetector(H9e),this.addDetector(W9e)}addDetector(t){return this.detectors[t.name]=t,this}detect(){let t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:this.options.order,n=[];return t.forEach(r=>{if(this.detectors[r]){let s=this.detectors[r].lookup(this.options);s&&typeof s=="string"&&(s=[s]),s&&(n=n.concat(s))}}),n=n.map(r=>this.options.convertDetectedLanguage(r)),this.services&&this.services.languageUtils&&this.services.languageUtils.getBestMatchFromCodes?n:n.length>0?n[0]:null}cacheUserLanguage(t){let n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:this.options.caches;n&&(this.options.excludeCacheFor&&this.options.excludeCacheFor.indexOf(t)>-1||n.forEach(r=>{this.detectors[r]&&this.detectors[r].cacheUserLanguage(t,this.options)}))}}Wpe.type="languageDetector";const G9e={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"}},K9e={translation:G9e},Y9e={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"}}}},X9e={translation:Y9e},Q9e={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:"Forma de pago que se utilizará en esta cotización"},notes:{label:"Notas",placeholder:"",desc:"Notas a incluir en la cotización"},validity:{label:"Validez de la cotización",placeholder:"",desc:"Validez de la cotización"},subtotal_price:{label:"Importe neto",placeholder:"",desc:""},discount:{label:"Descuento (%)",placeholder:"",desc:"Porcentaje de descuento"},discount_value:{label:"Descuento ({{value}}%)",placeholder:"",desc:"Porcentaje de descuento"},discount_price:{label:"Imp. descuento",placeholder:"",desc:"Importe del descuento"},before_tax_price:{label:"Base imponible",placeholder:"",desc:""},tax:{label:"IVA (%)",placeholder:"",desc:"Porcentaje de IVA"},tax_value:{label:"IVA ({{value}}%)",placeholder:"",desc:"Porcentaje de IVA"},tax_price:{label:"Imp. IVA",placeholder:"",desc:"Importe del IVA"},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:{}}},Z9e={translation:Q9e};Bi.use(Wpe).use(jBe).init({detection:{order:["navigator"]},debug:!1,fallbackLng:"es",interpolation:{escapeValue:!1},resources:{ca:K9e,en:X9e,es:Z9e}});function J9e(){const e=new jve({defaultOptions:{queries:{retry:!1,staleTime:1e4}}});return _.jsx(BBe,{i18n:Bi,children:_.jsx(Uve,{client:e,children:_.jsx(JFe,{dataSource:N9e("https://presupuestos.uecko.com:13001/api/v1"),children:_.jsx(_ve,{authActions:P9e("https://presupuestos.uecko.com:13001/api/v1"),children:_.jsxs(G6e,{defaultTheme:"light",storageKey:"vite-ui-theme",children:[_.jsx(wce,{delayDuration:0,children:_.jsx(Nhe,{children:_.jsx(C.Suspense,{fallback:_.jsx(Ou,{}),children:_.jsx(Gqe,{})})})}),_.jsx(tce,{}),_.jsx(IHe,{}),_.jsx(Y6e,{initialIsOpen:!1})]})})})})})}Rz.createRoot(document.getElementById("uecko")).render(_.jsx(fe.StrictMode,{children:_.jsx(J9e,{})}));
|