diff --git a/assets/Latin-Merriweather-Bold-398a4098.woff2 b/assets/Latin-Merriweather-Bold-398a4098.woff2 new file mode 100644 index 00000000..b71dc5a0 Binary files /dev/null and b/assets/Latin-Merriweather-Bold-398a4098.woff2 differ diff --git a/assets/Latin-Merriweather-BoldItalic-47048032.woff2 b/assets/Latin-Merriweather-BoldItalic-47048032.woff2 new file mode 100644 index 00000000..36d3abfc Binary files /dev/null and b/assets/Latin-Merriweather-BoldItalic-47048032.woff2 differ diff --git a/assets/Latin-Merriweather-Italic-a0e8dae2.woff2 b/assets/Latin-Merriweather-Italic-a0e8dae2.woff2 new file mode 100644 index 00000000..09916326 Binary files /dev/null and b/assets/Latin-Merriweather-Italic-a0e8dae2.woff2 differ diff --git a/assets/Latin-Merriweather-Light-85e700ae.woff2 b/assets/Latin-Merriweather-Light-85e700ae.woff2 new file mode 100644 index 00000000..a0eadc33 Binary files /dev/null and b/assets/Latin-Merriweather-Light-85e700ae.woff2 differ diff --git a/assets/Latin-Merriweather-LightItalic-d755b836.woff2 b/assets/Latin-Merriweather-LightItalic-d755b836.woff2 new file mode 100644 index 00000000..5112dab4 Binary files /dev/null and b/assets/Latin-Merriweather-LightItalic-d755b836.woff2 differ diff --git a/assets/Latin-Merriweather-Regular-928176d9.woff2 b/assets/Latin-Merriweather-Regular-928176d9.woff2 new file mode 100644 index 00000000..9a9bd644 Binary files /dev/null and b/assets/Latin-Merriweather-Regular-928176d9.woff2 differ diff --git a/assets/add-4dc55478.svg b/assets/add-4dc55478.svg new file mode 100644 index 00000000..58f73e96 --- /dev/null +++ b/assets/add-4dc55478.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/assets/arrow_back-ad23ffb6.svg b/assets/arrow_back-ad23ffb6.svg new file mode 100644 index 00000000..00d44bf5 --- /dev/null +++ b/assets/arrow_back-ad23ffb6.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/assets/calendar_today-cc23d005.svg b/assets/calendar_today-cc23d005.svg new file mode 100644 index 00000000..9c40555f --- /dev/null +++ b/assets/calendar_today-cc23d005.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/assets/check--blue-60v-2fa4117a.svg b/assets/check--blue-60v-2fa4117a.svg new file mode 100644 index 00000000..ed101a94 --- /dev/null +++ b/assets/check--blue-60v-2fa4117a.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/assets/check_circle-2222ca5b.svg b/assets/check_circle-2222ca5b.svg new file mode 100644 index 00000000..1775c862 --- /dev/null +++ b/assets/check_circle-2222ca5b.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/assets/close-1abf0e0a.svg b/assets/close-1abf0e0a.svg new file mode 100644 index 00000000..c3f7c2fd --- /dev/null +++ b/assets/close-1abf0e0a.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/assets/correct8-7d30903a.svg b/assets/correct8-7d30903a.svg new file mode 100644 index 00000000..3270fdb2 --- /dev/null +++ b/assets/correct8-7d30903a.svg @@ -0,0 +1 @@ +correct8 \ No newline at end of file diff --git a/assets/correct8-alt-68c4a313.svg b/assets/correct8-alt-68c4a313.svg new file mode 100644 index 00000000..cba03c31 --- /dev/null +++ b/assets/correct8-alt-68c4a313.svg @@ -0,0 +1 @@ +correct8-alt \ No newline at end of file diff --git a/assets/error--white-d55dac06.svg b/assets/error--white-d55dac06.svg new file mode 100644 index 00000000..442cca50 --- /dev/null +++ b/assets/error--white-d55dac06.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/assets/error-4ab47484.svg b/assets/error-4ab47484.svg new file mode 100644 index 00000000..d30cc3a7 --- /dev/null +++ b/assets/error-4ab47484.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/assets/expand_less-e364a85f.svg b/assets/expand_less-e364a85f.svg new file mode 100644 index 00000000..53985246 --- /dev/null +++ b/assets/expand_less-e364a85f.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/assets/expand_more-bc1d8378.svg b/assets/expand_more-bc1d8378.svg new file mode 100644 index 00000000..4428af00 --- /dev/null +++ b/assets/expand_more-bc1d8378.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/assets/facebook-1522ea1f.svg b/assets/facebook-1522ea1f.svg new file mode 100644 index 00000000..f4feccc0 --- /dev/null +++ b/assets/facebook-1522ea1f.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/assets/file-2b1fcfa0.svg b/assets/file-2b1fcfa0.svg new file mode 100644 index 00000000..8469c7e9 --- /dev/null +++ b/assets/file-2b1fcfa0.svg @@ -0,0 +1 @@ + diff --git a/assets/file-excel-89c8dce1.svg b/assets/file-excel-89c8dce1.svg new file mode 100644 index 00000000..9bf512ad --- /dev/null +++ b/assets/file-excel-89c8dce1.svg @@ -0,0 +1 @@ + diff --git a/assets/file-pdf-186ca8c6.svg b/assets/file-pdf-186ca8c6.svg new file mode 100644 index 00000000..c40ec126 --- /dev/null +++ b/assets/file-pdf-186ca8c6.svg @@ -0,0 +1 @@ + diff --git a/assets/file-video-98ea6ce4.svg b/assets/file-video-98ea6ce4.svg new file mode 100644 index 00000000..d3933c88 --- /dev/null +++ b/assets/file-video-98ea6ce4.svg @@ -0,0 +1 @@ + diff --git a/assets/file-word-52d8af54.svg b/assets/file-word-52d8af54.svg new file mode 100644 index 00000000..214b55a1 --- /dev/null +++ b/assets/file-word-52d8af54.svg @@ -0,0 +1 @@ + diff --git a/assets/hero-d5779c5c.jpg b/assets/hero-d5779c5c.jpg new file mode 100644 index 00000000..62320c42 Binary files /dev/null and b/assets/hero-d5779c5c.jpg differ diff --git a/assets/icon-dot-gov-54f6653a.svg b/assets/icon-dot-gov-54f6653a.svg new file mode 100644 index 00000000..3bf04789 --- /dev/null +++ b/assets/icon-dot-gov-54f6653a.svg @@ -0,0 +1 @@ +icon-dot-gov \ No newline at end of file diff --git a/assets/icon-https-912daff9.svg b/assets/icon-https-912daff9.svg new file mode 100644 index 00000000..19ad04fc --- /dev/null +++ b/assets/icon-https-912daff9.svg @@ -0,0 +1 @@ +icon-https \ No newline at end of file diff --git a/assets/index-04ae9528.js b/assets/index-04ae9528.js new file mode 100644 index 00000000..f0cd8918 --- /dev/null +++ b/assets/index-04ae9528.js @@ -0,0 +1,573 @@ +function RM(e,t){for(var n=0;nr[o]})}}}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 o of document.querySelectorAll('link[rel="modulepreload"]'))r(o);new MutationObserver(o=>{for(const i of o)if(i.type==="childList")for(const a of i.addedNodes)a.tagName==="LINK"&&a.rel==="modulepreload"&&r(a)}).observe(document,{childList:!0,subtree:!0});function n(o){const i={};return o.integrity&&(i.integrity=o.integrity),o.referrerPolicy&&(i.referrerPolicy=o.referrerPolicy),o.crossOrigin==="use-credentials"?i.credentials="include":o.crossOrigin==="anonymous"?i.credentials="omit":i.credentials="same-origin",i}function r(o){if(o.ep)return;o.ep=!0;const i=n(o);fetch(o.href,i)}})();var Ci=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function uo(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}function kM(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 o=Object.getOwnPropertyDescriptor(e,r);Object.defineProperty(n,r,o.get?o:{enumerable:!0,get:function(){return e[r]}})}),n}var BA={exports:{}},Hp={},HA={exports:{}},Re={};/** + * @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 Yu=Symbol.for("react.element"),TM=Symbol.for("react.portal"),$M=Symbol.for("react.fragment"),PM=Symbol.for("react.strict_mode"),MM=Symbol.for("react.profiler"),NM=Symbol.for("react.provider"),LM=Symbol.for("react.context"),DM=Symbol.for("react.forward_ref"),IM=Symbol.for("react.suspense"),jM=Symbol.for("react.memo"),FM=Symbol.for("react.lazy"),nx=Symbol.iterator;function UM(e){return e===null||typeof e!="object"?null:(e=nx&&e[nx]||e["@@iterator"],typeof e=="function"?e:null)}var qA={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},WA=Object.assign,GA={};function Ns(e,t,n){this.props=e,this.context=t,this.refs=GA,this.updater=n||qA}Ns.prototype.isReactComponent={};Ns.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")};Ns.prototype.forceUpdate=function(e){this.updater.enqueueForceUpdate(this,e,"forceUpdate")};function KA(){}KA.prototype=Ns.prototype;function E1(e,t,n){this.props=e,this.context=t,this.refs=GA,this.updater=n||qA}var A1=E1.prototype=new KA;A1.constructor=E1;WA(A1,Ns.prototype);A1.isPureReactComponent=!0;var rx=Array.isArray,YA=Object.prototype.hasOwnProperty,C1={current:null},QA={key:!0,ref:!0,__self:!0,__source:!0};function XA(e,t,n){var r,o={},i=null,a=null;if(t!=null)for(r in t.ref!==void 0&&(a=t.ref),t.key!==void 0&&(i=""+t.key),t)YA.call(t,r)&&!QA.hasOwnProperty(r)&&(o[r]=t[r]);var s=arguments.length-2;if(s===1)o.children=n;else if(1>>1,M=V[oe];if(0>>1;oeo(ee,Y))Zo(ae,ee)?(V[oe]=ae,V[Z]=Y,oe=Z):(V[oe]=ee,V[B]=Y,oe=B);else if(Zo(ae,Y))V[oe]=ae,V[Z]=Y,oe=Z;else break e}}return K}function o(V,K){var Y=V.sortIndex-K.sortIndex;return Y!==0?Y:V.id-K.id}if(typeof performance=="object"&&typeof performance.now=="function"){var i=performance;e.unstable_now=function(){return i.now()}}else{var a=Date,s=a.now();e.unstable_now=function(){return a.now()-s}}var l=[],u=[],c=1,d=null,f=3,p=!1,g=!1,v=!1,b=typeof setTimeout=="function"?setTimeout:null,y=typeof clearTimeout=="function"?clearTimeout:null,h=typeof setImmediate<"u"?setImmediate:null;typeof navigator<"u"&&navigator.scheduling!==void 0&&navigator.scheduling.isInputPending!==void 0&&navigator.scheduling.isInputPending.bind(navigator.scheduling);function _(V){for(var K=n(u);K!==null;){if(K.callback===null)r(u);else if(K.startTime<=V)r(u),K.sortIndex=K.expirationTime,t(l,K);else break;K=n(u)}}function x(V){if(v=!1,_(V),!g)if(n(l)!==null)g=!0,G(w);else{var K=n(u);K!==null&&W(x,K.startTime-V)}}function w(V,K){g=!1,v&&(v=!1,y(C),C=-1),p=!0;var Y=f;try{for(_(K),d=n(l);d!==null&&(!(d.expirationTime>K)||V&&!k());){var oe=d.callback;if(typeof oe=="function"){d.callback=null,f=d.priorityLevel;var M=oe(d.expirationTime<=K);K=e.unstable_now(),typeof M=="function"?d.callback=M:d===n(l)&&r(l),_(K)}else r(l);d=n(l)}if(d!==null)var U=!0;else{var B=n(u);B!==null&&W(x,B.startTime-K),U=!1}return U}finally{d=null,f=Y,p=!1}}var S=!1,A=null,C=-1,R=5,O=-1;function k(){return!(e.unstable_now()-OV||125oe?(V.sortIndex=Y,t(u,V),n(l)===null&&V===n(u)&&(v?(y(C),C=-1):v=!0,W(x,Y-oe))):(V.sortIndex=M,t(l,V),g||p||(g=!0,G(w))),V},e.unstable_shouldYield=k,e.unstable_wrapCallback=function(V){var K=f;return function(){var Y=f;f=K;try{return V.apply(this,arguments)}finally{f=Y}}}})(tC);eC.exports=tC;var ZM=eC.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 nC=H,_n=ZM;function X(e){for(var t="https://reactjs.org/docs/error-decoder.html?invariant="+e,n=1;n"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),Ry=Object.prototype.hasOwnProperty,JM=/^[: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]*$/,ix={},ax={};function e4(e){return Ry.call(ax,e)?!0:Ry.call(ix,e)?!1:JM.test(e)?ax[e]=!0:(ix[e]=!0,!1)}function t4(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 n4(e,t,n,r){if(t===null||typeof t>"u"||t4(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 Wt(e,t,n,r,o,i,a){this.acceptsBooleans=t===2||t===3||t===4,this.attributeName=r,this.attributeNamespace=o,this.mustUseProperty=n,this.propertyName=e,this.type=t,this.sanitizeURL=i,this.removeEmptyString=a}var Tt={};"children dangerouslySetInnerHTML defaultValue defaultChecked innerHTML suppressContentEditableWarning suppressHydrationWarning style".split(" ").forEach(function(e){Tt[e]=new Wt(e,0,!1,e,null,!1,!1)});[["acceptCharset","accept-charset"],["className","class"],["htmlFor","for"],["httpEquiv","http-equiv"]].forEach(function(e){var t=e[0];Tt[t]=new Wt(t,1,!1,e[1],null,!1,!1)});["contentEditable","draggable","spellCheck","value"].forEach(function(e){Tt[e]=new Wt(e,2,!1,e.toLowerCase(),null,!1,!1)});["autoReverse","externalResourcesRequired","focusable","preserveAlpha"].forEach(function(e){Tt[e]=new Wt(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){Tt[e]=new Wt(e,3,!1,e.toLowerCase(),null,!1,!1)});["checked","multiple","muted","selected"].forEach(function(e){Tt[e]=new Wt(e,3,!0,e,null,!1,!1)});["capture","download"].forEach(function(e){Tt[e]=new Wt(e,4,!1,e,null,!1,!1)});["cols","rows","size","span"].forEach(function(e){Tt[e]=new Wt(e,6,!1,e,null,!1,!1)});["rowSpan","start"].forEach(function(e){Tt[e]=new Wt(e,5,!1,e.toLowerCase(),null,!1,!1)});var R1=/[\-:]([a-z])/g;function k1(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(R1,k1);Tt[t]=new Wt(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(R1,k1);Tt[t]=new Wt(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(R1,k1);Tt[t]=new Wt(t,1,!1,e,"http://www.w3.org/XML/1998/namespace",!1,!1)});["tabIndex","crossOrigin"].forEach(function(e){Tt[e]=new Wt(e,1,!1,e.toLowerCase(),null,!1,!1)});Tt.xlinkHref=new Wt("xlinkHref",1,!1,"xlink:href","http://www.w3.org/1999/xlink",!0,!1);["src","href","action","formAction"].forEach(function(e){Tt[e]=new Wt(e,1,!1,e.toLowerCase(),null,!0,!0)});function T1(e,t,n,r){var o=Tt.hasOwnProperty(t)?Tt[t]:null;(o!==null?o.type!==0:r||!(2s||o[a]!==i[s]){var l=` +`+o[a].replace(" at new "," at ");return e.displayName&&l.includes("")&&(l=l.replace("",e.displayName)),l}while(1<=a&&0<=s);break}}}finally{_g=!1,Error.prepareStackTrace=n}return(e=e?e.displayName||e.name:"")?$l(e):""}function r4(e){switch(e.tag){case 5:return $l(e.type);case 16:return $l("Lazy");case 13:return $l("Suspense");case 19:return $l("SuspenseList");case 0:case 2:case 15:return e=bg(e.type,!1),e;case 11:return e=bg(e.type.render,!1),e;case 1:return e=bg(e.type,!0),e;default:return""}}function Py(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 $a:return"Fragment";case Ta:return"Portal";case ky:return"Profiler";case $1:return"StrictMode";case Ty:return"Suspense";case $y:return"SuspenseList"}if(typeof e=="object")switch(e.$$typeof){case iC:return(e.displayName||"Context")+".Consumer";case oC:return(e._context.displayName||"Context")+".Provider";case P1:var t=e.render;return e=e.displayName,e||(e=t.displayName||t.name||"",e=e!==""?"ForwardRef("+e+")":"ForwardRef"),e;case M1:return t=e.displayName||null,t!==null?t:Py(e.type)||"Memo";case xo:t=e._payload,e=e._init;try{return Py(e(t))}catch{}}return null}function o4(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 Py(t);case 8:return t===$1?"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 Jo(e){switch(typeof e){case"boolean":case"number":case"string":case"undefined":return e;case"object":return e;default:return""}}function sC(e){var t=e.type;return(e=e.nodeName)&&e.toLowerCase()==="input"&&(t==="checkbox"||t==="radio")}function i4(e){var t=sC(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 o=n.get,i=n.set;return Object.defineProperty(e,t,{configurable:!0,get:function(){return o.call(this)},set:function(a){r=""+a,i.call(this,a)}}),Object.defineProperty(e,t,{enumerable:n.enumerable}),{getValue:function(){return r},setValue:function(a){r=""+a},stopTracking:function(){e._valueTracker=null,delete e[t]}}}}function Pc(e){e._valueTracker||(e._valueTracker=i4(e))}function lC(e){if(!e)return!1;var t=e._valueTracker;if(!t)return!0;var n=t.getValue(),r="";return e&&(r=sC(e)?e.checked?"true":"false":e.value),e=r,e!==n?(t.setValue(e),!0):!1}function Qd(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 My(e,t){var n=t.checked;return Je({},t,{defaultChecked:void 0,defaultValue:void 0,value:void 0,checked:n??e._wrapperState.initialChecked})}function lx(e,t){var n=t.defaultValue==null?"":t.defaultValue,r=t.checked!=null?t.checked:t.defaultChecked;n=Jo(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 uC(e,t){t=t.checked,t!=null&&T1(e,"checked",t,!1)}function Ny(e,t){uC(e,t);var n=Jo(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")?Ly(e,t.type,n):t.hasOwnProperty("defaultValue")&&Ly(e,t.type,Jo(t.defaultValue)),t.checked==null&&t.defaultChecked!=null&&(e.defaultChecked=!!t.defaultChecked)}function ux(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 Ly(e,t,n){(t!=="number"||Qd(e.ownerDocument)!==e)&&(n==null?e.defaultValue=""+e._wrapperState.initialValue:e.defaultValue!==""+n&&(e.defaultValue=""+n))}var Pl=Array.isArray;function Qa(e,t,n,r){if(e=e.options,t){t={};for(var o=0;o"+t.valueOf().toString()+"",t=Mc.firstChild;e.firstChild;)e.removeChild(e.firstChild);for(;t.firstChild;)e.appendChild(t.firstChild)}});function cu(e,t){if(t){var n=e.firstChild;if(n&&n===e.lastChild&&n.nodeType===3){n.nodeValue=t;return}}e.textContent=t}var Hl={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},a4=["Webkit","ms","Moz","O"];Object.keys(Hl).forEach(function(e){a4.forEach(function(t){t=t+e.charAt(0).toUpperCase()+e.substring(1),Hl[t]=Hl[e]})});function pC(e,t,n){return t==null||typeof t=="boolean"||t===""?"":n||typeof t!="number"||t===0||Hl.hasOwnProperty(e)&&Hl[e]?(""+t).trim():t+"px"}function hC(e,t){e=e.style;for(var n in t)if(t.hasOwnProperty(n)){var r=n.indexOf("--")===0,o=pC(n,t[n],r);n==="float"&&(n="cssFloat"),r?e.setProperty(n,o):e[n]=o}}var s4=Je({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 jy(e,t){if(t){if(s4[e]&&(t.children!=null||t.dangerouslySetInnerHTML!=null))throw Error(X(137,e));if(t.dangerouslySetInnerHTML!=null){if(t.children!=null)throw Error(X(60));if(typeof t.dangerouslySetInnerHTML!="object"||!("__html"in t.dangerouslySetInnerHTML))throw Error(X(61))}if(t.style!=null&&typeof t.style!="object")throw Error(X(62))}}function Fy(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 Uy=null;function N1(e){return e=e.target||e.srcElement||window,e.correspondingUseElement&&(e=e.correspondingUseElement),e.nodeType===3?e.parentNode:e}var Vy=null,Xa=null,Za=null;function fx(e){if(e=Zu(e)){if(typeof Vy!="function")throw Error(X(280));var t=e.stateNode;t&&(t=Yp(t),Vy(e.stateNode,e.type,t))}}function gC(e){Xa?Za?Za.push(e):Za=[e]:Xa=e}function mC(){if(Xa){var e=Xa,t=Za;if(Za=Xa=null,fx(e),t)for(e=0;e>>=0,e===0?32:31-(v4(e)/_4|0)|0}var Nc=64,Lc=4194304;function Ml(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 ef(e,t){var n=e.pendingLanes;if(n===0)return 0;var r=0,o=e.suspendedLanes,i=e.pingedLanes,a=n&268435455;if(a!==0){var s=a&~o;s!==0?r=Ml(s):(i&=a,i!==0&&(r=Ml(i)))}else a=n&~o,a!==0?r=Ml(a):i!==0&&(r=Ml(i));if(r===0)return 0;if(t!==0&&t!==r&&!(t&o)&&(o=r&-r,i=t&-t,o>=i||o===16&&(i&4194240)!==0))return t;if(r&4&&(r|=n&16),t=e.entangledLanes,t!==0)for(e=e.entanglements,t&=r;0n;n++)t.push(e);return t}function Qu(e,t,n){e.pendingLanes|=t,t!==536870912&&(e.suspendedLanes=0,e.pingedLanes=0),e=e.eventTimes,t=31-lr(t),e[t]=n}function S4(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=Wl),xx=String.fromCharCode(32),wx=!1;function DC(e,t){switch(e){case"keyup":return X4.indexOf(t.keyCode)!==-1;case"keydown":return t.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function IC(e){return e=e.detail,typeof e=="object"&&"data"in e?e.data:null}var Pa=!1;function J4(e,t){switch(e){case"compositionend":return IC(t);case"keypress":return t.which!==32?null:(wx=!0,xx);case"textInput":return e=t.data,e===xx&&wx?null:e;default:return null}}function e8(e,t){if(Pa)return e==="compositionend"||!z1&&DC(e,t)?(e=NC(),vd=F1=Po=null,Pa=!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)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=Cx(n)}}function VC(e,t){return e&&t?e===t?!0:e&&e.nodeType===3?!1:t&&t.nodeType===3?VC(e,t.parentNode):"contains"in e?e.contains(t):e.compareDocumentPosition?!!(e.compareDocumentPosition(t)&16):!1:!1}function zC(){for(var e=window,t=Qd();t instanceof e.HTMLIFrameElement;){try{var n=typeof t.contentWindow.location.href=="string"}catch{n=!1}if(n)e=t.contentWindow;else break;t=Qd(e.document)}return t}function B1(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 u8(e){var t=zC(),n=e.focusedElem,r=e.selectionRange;if(t!==n&&n&&n.ownerDocument&&VC(n.ownerDocument.documentElement,n)){if(r!==null&&B1(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 o=n.textContent.length,i=Math.min(r.start,o);r=r.end===void 0?i:Math.min(r.end,o),!e.extend&&i>r&&(o=r,r=i,i=o),o=Ox(n,i);var a=Ox(n,r);o&&a&&(e.rangeCount!==1||e.anchorNode!==o.node||e.anchorOffset!==o.offset||e.focusNode!==a.node||e.focusOffset!==a.offset)&&(t=t.createRange(),t.setStart(o.node,o.offset),e.removeAllRanges(),i>r?(e.addRange(t),e.extend(a.node,a.offset)):(t.setEnd(a.node,a.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=document.documentMode,Ma=null,Gy=null,Kl=null,Ky=!1;function Rx(e,t,n){var r=n.window===n?n.document:n.nodeType===9?n:n.ownerDocument;Ky||Ma==null||Ma!==Qd(r)||(r=Ma,"selectionStart"in r&&B1(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}),Kl&&mu(Kl,r)||(Kl=r,r=rf(Gy,"onSelect"),0Da||(e.current=e0[Da],e0[Da]=null,Da--)}function Ue(e,t){Da++,e0[Da]=e.current,e.current=t}var ei={},Dt=ai(ei),rn=ai(!1),Hi=ei;function ds(e,t){var n=e.type.contextTypes;if(!n)return ei;var r=e.stateNode;if(r&&r.__reactInternalMemoizedUnmaskedChildContext===t)return r.__reactInternalMemoizedMaskedChildContext;var o={},i;for(i in n)o[i]=t[i];return r&&(e=e.stateNode,e.__reactInternalMemoizedUnmaskedChildContext=t,e.__reactInternalMemoizedMaskedChildContext=o),o}function on(e){return e=e.childContextTypes,e!=null}function af(){qe(rn),qe(Dt)}function Lx(e,t,n){if(Dt.current!==ei)throw Error(X(168));Ue(Dt,t),Ue(rn,n)}function XC(e,t,n){var r=e.stateNode;if(t=t.childContextTypes,typeof r.getChildContext!="function")return n;r=r.getChildContext();for(var o in r)if(!(o in t))throw Error(X(108,o4(e)||"Unknown",o));return Je({},n,r)}function sf(e){return e=(e=e.stateNode)&&e.__reactInternalMemoizedMergedChildContext||ei,Hi=Dt.current,Ue(Dt,e),Ue(rn,rn.current),!0}function Dx(e,t,n){var r=e.stateNode;if(!r)throw Error(X(169));n?(e=XC(e,t,Hi),r.__reactInternalMemoizedMergedChildContext=e,qe(rn),qe(Dt),Ue(Dt,e)):qe(rn),Ue(rn,n)}var Wr=null,Qp=!1,Ng=!1;function ZC(e){Wr===null?Wr=[e]:Wr.push(e)}function x8(e){Qp=!0,ZC(e)}function si(){if(!Ng&&Wr!==null){Ng=!0;var e=0,t=Ne;try{var n=Wr;for(Ne=1;e>=a,o-=a,Gr=1<<32-lr(t)+o|n<C?(R=A,A=null):R=A.sibling;var O=f(y,A,_[C],x);if(O===null){A===null&&(A=R);break}e&&A&&O.alternate===null&&t(y,A),h=i(O,h,C),S===null?w=O:S.sibling=O,S=O,A=R}if(C===_.length)return n(y,A),Ke&&mi(y,C),w;if(A===null){for(;C<_.length;C++)A=d(y,_[C],x),A!==null&&(h=i(A,h,C),S===null?w=A:S.sibling=A,S=A);return Ke&&mi(y,C),w}for(A=r(y,A);C<_.length;C++)R=p(A,y,C,_[C],x),R!==null&&(e&&R.alternate!==null&&A.delete(R.key===null?C:R.key),h=i(R,h,C),S===null?w=R:S.sibling=R,S=R);return e&&A.forEach(function(k){return t(y,k)}),Ke&&mi(y,C),w}function v(y,h,_,x){var w=sl(_);if(typeof w!="function")throw Error(X(150));if(_=w.call(_),_==null)throw Error(X(151));for(var S=w=null,A=h,C=h=0,R=null,O=_.next();A!==null&&!O.done;C++,O=_.next()){A.index>C?(R=A,A=null):R=A.sibling;var k=f(y,A,O.value,x);if(k===null){A===null&&(A=R);break}e&&A&&k.alternate===null&&t(y,A),h=i(k,h,C),S===null?w=k:S.sibling=k,S=k,A=R}if(O.done)return n(y,A),Ke&&mi(y,C),w;if(A===null){for(;!O.done;C++,O=_.next())O=d(y,O.value,x),O!==null&&(h=i(O,h,C),S===null?w=O:S.sibling=O,S=O);return Ke&&mi(y,C),w}for(A=r(y,A);!O.done;C++,O=_.next())O=p(A,y,C,O.value,x),O!==null&&(e&&O.alternate!==null&&A.delete(O.key===null?C:O.key),h=i(O,h,C),S===null?w=O:S.sibling=O,S=O);return e&&A.forEach(function(T){return t(y,T)}),Ke&&mi(y,C),w}function b(y,h,_,x){if(typeof _=="object"&&_!==null&&_.type===$a&&_.key===null&&(_=_.props.children),typeof _=="object"&&_!==null){switch(_.$$typeof){case $c:e:{for(var w=_.key,S=h;S!==null;){if(S.key===w){if(w=_.type,w===$a){if(S.tag===7){n(y,S.sibling),h=o(S,_.props.children),h.return=y,y=h;break e}}else if(S.elementType===w||typeof w=="object"&&w!==null&&w.$$typeof===xo&&Bx(w)===S.type){n(y,S.sibling),h=o(S,_.props),h.ref=fl(y,S,_),h.return=y,y=h;break e}n(y,S);break}else t(y,S);S=S.sibling}_.type===$a?(h=Ii(_.props.children,y.mode,x,_.key),h.return=y,y=h):(x=Cd(_.type,_.key,_.props,null,y.mode,x),x.ref=fl(y,h,_),x.return=y,y=x)}return a(y);case Ta:e:{for(S=_.key;h!==null;){if(h.key===S)if(h.tag===4&&h.stateNode.containerInfo===_.containerInfo&&h.stateNode.implementation===_.implementation){n(y,h.sibling),h=o(h,_.children||[]),h.return=y,y=h;break e}else{n(y,h);break}else t(y,h);h=h.sibling}h=zg(_,y.mode,x),h.return=y,y=h}return a(y);case xo:return S=_._init,b(y,h,S(_._payload),x)}if(Pl(_))return g(y,h,_,x);if(sl(_))return v(y,h,_,x);zc(y,_)}return typeof _=="string"&&_!==""||typeof _=="number"?(_=""+_,h!==null&&h.tag===6?(n(y,h.sibling),h=o(h,_),h.return=y,y=h):(n(y,h),h=Vg(_,y.mode,x),h.return=y,y=h),a(y)):n(y,h)}return b}var ps=a7(!0),s7=a7(!1),Ju={},Or=ai(Ju),bu=ai(Ju),xu=ai(Ju);function ki(e){if(e===Ju)throw Error(X(174));return e}function Z1(e,t){switch(Ue(xu,t),Ue(bu,e),Ue(Or,Ju),e=t.nodeType,e){case 9:case 11:t=(t=t.documentElement)?t.namespaceURI:Iy(null,"");break;default:e=e===8?t.parentNode:t,t=e.namespaceURI||null,e=e.tagName,t=Iy(t,e)}qe(Or),Ue(Or,t)}function hs(){qe(Or),qe(bu),qe(xu)}function l7(e){ki(xu.current);var t=ki(Or.current),n=Iy(t,e.type);t!==n&&(Ue(bu,e),Ue(Or,n))}function J1(e){bu.current===e&&(qe(Or),qe(bu))}var Xe=ai(0);function pf(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 Lg=[];function e5(){for(var e=0;en?n:4,e(!0);var r=Dg.transition;Dg.transition={};try{e(!1),t()}finally{Ne=n,Dg.transition=r}}function E7(){return Fn().memoizedState}function A8(e,t,n){var r=Ho(e);if(n={lane:r,action:n,hasEagerState:!1,eagerState:null,next:null},A7(e))C7(t,n);else if(n=n7(e,t,n,r),n!==null){var o=Bt();ur(n,e,r,o),O7(n,t,r)}}function C8(e,t,n){var r=Ho(e),o={lane:r,action:n,hasEagerState:!1,eagerState:null,next:null};if(A7(e))C7(t,o);else{var i=e.alternate;if(e.lanes===0&&(i===null||i.lanes===0)&&(i=t.lastRenderedReducer,i!==null))try{var a=t.lastRenderedState,s=i(a,n);if(o.hasEagerState=!0,o.eagerState=s,dr(s,a)){var l=t.interleaved;l===null?(o.next=o,Q1(t)):(o.next=l.next,l.next=o),t.interleaved=o;return}}catch{}finally{}n=n7(e,t,o,r),n!==null&&(o=Bt(),ur(n,e,r,o),O7(n,t,r))}}function A7(e){var t=e.alternate;return e===Ze||t!==null&&t===Ze}function C7(e,t){Yl=hf=!0;var n=e.pending;n===null?t.next=t:(t.next=n.next,n.next=t),e.pending=t}function O7(e,t,n){if(n&4194240){var r=t.lanes;r&=e.pendingLanes,n|=r,t.lanes=n,D1(e,n)}}var gf={readContext:jn,useCallback:$t,useContext:$t,useEffect:$t,useImperativeHandle:$t,useInsertionEffect:$t,useLayoutEffect:$t,useMemo:$t,useReducer:$t,useRef:$t,useState:$t,useDebugValue:$t,useDeferredValue:$t,useTransition:$t,useMutableSource:$t,useSyncExternalStore:$t,useId:$t,unstable_isNewReconciler:!1},O8={readContext:jn,useCallback:function(e,t){return yr().memoizedState=[e,t===void 0?null:t],e},useContext:jn,useEffect:qx,useImperativeHandle:function(e,t,n){return n=n!=null?n.concat([e]):null,wd(4194308,4,_7.bind(null,t,e),n)},useLayoutEffect:function(e,t){return wd(4194308,4,e,t)},useInsertionEffect:function(e,t){return wd(4,2,e,t)},useMemo:function(e,t){var n=yr();return t=t===void 0?null:t,e=e(),n.memoizedState=[e,t],e},useReducer:function(e,t,n){var r=yr();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=A8.bind(null,Ze,e),[r.memoizedState,e]},useRef:function(e){var t=yr();return e={current:e},t.memoizedState=e},useState:Hx,useDebugValue:i5,useDeferredValue:function(e){return yr().memoizedState=e},useTransition:function(){var e=Hx(!1),t=e[0];return e=E8.bind(null,e[1]),yr().memoizedState=e,[t,e]},useMutableSource:function(){},useSyncExternalStore:function(e,t,n){var r=Ze,o=yr();if(Ke){if(n===void 0)throw Error(X(407));n=n()}else{if(n=t(),St===null)throw Error(X(349));Wi&30||d7(r,t,n)}o.memoizedState=n;var i={value:n,getSnapshot:t};return o.queue=i,qx(p7.bind(null,r,i,e),[e]),r.flags|=2048,Eu(9,f7.bind(null,r,i,n,t),void 0,null),n},useId:function(){var e=yr(),t=St.identifierPrefix;if(Ke){var n=Kr,r=Gr;n=(r&~(1<<32-lr(r)-1)).toString(32)+n,t=":"+t+"R"+n,n=wu++,0<\/script>",e=e.removeChild(e.firstChild)):typeof r.is=="string"?e=a.createElement(n,{is:r.is}):(e=a.createElement(n),n==="select"&&(a=e,r.multiple?a.multiple=!0:r.size&&(a.size=r.size))):e=a.createElementNS(e,n),e[xr]=t,e[_u]=r,D7(e,t,!1,!1),t.stateNode=e;e:{switch(a=Fy(n,r),n){case"dialog":ze("cancel",e),ze("close",e),o=r;break;case"iframe":case"object":case"embed":ze("load",e),o=r;break;case"video":case"audio":for(o=0;oms&&(t.flags|=128,r=!0,pl(i,!1),t.lanes=4194304)}else{if(!r)if(e=pf(a),e!==null){if(t.flags|=128,r=!0,n=e.updateQueue,n!==null&&(t.updateQueue=n,t.flags|=4),pl(i,!0),i.tail===null&&i.tailMode==="hidden"&&!a.alternate&&!Ke)return Pt(t),null}else 2*ot()-i.renderingStartTime>ms&&n!==1073741824&&(t.flags|=128,r=!0,pl(i,!1),t.lanes=4194304);i.isBackwards?(a.sibling=t.child,t.child=a):(n=i.last,n!==null?n.sibling=a:t.child=a,i.last=a)}return i.tail!==null?(t=i.tail,i.rendering=t,i.tail=t.sibling,i.renderingStartTime=ot(),t.sibling=null,n=Xe.current,Ue(Xe,r?n&1|2:n&1),t):(Pt(t),null);case 22:case 23:return d5(),r=t.memoizedState!==null,e!==null&&e.memoizedState!==null!==r&&(t.flags|=8192),r&&t.mode&1?mn&1073741824&&(Pt(t),t.subtreeFlags&6&&(t.flags|=8192)):Pt(t),null;case 24:return null;case 25:return null}throw Error(X(156,t.tag))}function L8(e,t){switch(q1(t),t.tag){case 1:return on(t.type)&&af(),e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 3:return hs(),qe(rn),qe(Dt),e5(),e=t.flags,e&65536&&!(e&128)?(t.flags=e&-65537|128,t):null;case 5:return J1(t),null;case 13:if(qe(Xe),e=t.memoizedState,e!==null&&e.dehydrated!==null){if(t.alternate===null)throw Error(X(340));fs()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 19:return qe(Xe),null;case 4:return hs(),null;case 10:return Y1(t.type._context),null;case 22:case 23:return d5(),null;case 24:return null;default:return null}}var Hc=!1,Lt=!1,D8=typeof WeakSet=="function"?WeakSet:Set,ue=null;function Ua(e,t){var n=e.ref;if(n!==null)if(typeof n=="function")try{n(null)}catch(r){et(e,t,r)}else n.current=null}function f0(e,t,n){try{n()}catch(r){et(e,t,r)}}var e2=!1;function I8(e,t){if(Yy=tf,e=zC(),B1(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 o=r.anchorOffset,i=r.focusNode;r=r.focusOffset;try{n.nodeType,i.nodeType}catch{n=null;break e}var a=0,s=-1,l=-1,u=0,c=0,d=e,f=null;t:for(;;){for(var p;d!==n||o!==0&&d.nodeType!==3||(s=a+o),d!==i||r!==0&&d.nodeType!==3||(l=a+r),d.nodeType===3&&(a+=d.nodeValue.length),(p=d.firstChild)!==null;)f=d,d=p;for(;;){if(d===e)break t;if(f===n&&++u===o&&(s=a),f===i&&++c===r&&(l=a),(p=d.nextSibling)!==null)break;d=f,f=d.parentNode}d=p}n=s===-1||l===-1?null:{start:s,end:l}}else n=null}n=n||{start:0,end:0}}else n=null;for(Qy={focusedElem:e,selectionRange:n},tf=!1,ue=t;ue!==null;)if(t=ue,e=t.child,(t.subtreeFlags&1028)!==0&&e!==null)e.return=t,ue=e;else for(;ue!==null;){t=ue;try{var g=t.alternate;if(t.flags&1024)switch(t.tag){case 0:case 11:case 15:break;case 1:if(g!==null){var v=g.memoizedProps,b=g.memoizedState,y=t.stateNode,h=y.getSnapshotBeforeUpdate(t.elementType===t.type?v:Zn(t.type,v),b);y.__reactInternalSnapshotBeforeUpdate=h}break;case 3:var _=t.stateNode.containerInfo;_.nodeType===1?_.textContent="":_.nodeType===9&&_.documentElement&&_.removeChild(_.documentElement);break;case 5:case 6:case 4:case 17:break;default:throw Error(X(163))}}catch(x){et(t,t.return,x)}if(e=t.sibling,e!==null){e.return=t.return,ue=e;break}ue=t.return}return g=e2,e2=!1,g}function Ql(e,t,n){var r=t.updateQueue;if(r=r!==null?r.lastEffect:null,r!==null){var o=r=r.next;do{if((o.tag&e)===e){var i=o.destroy;o.destroy=void 0,i!==void 0&&f0(t,n,i)}o=o.next}while(o!==r)}}function Jp(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 p0(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 F7(e){var t=e.alternate;t!==null&&(e.alternate=null,F7(t)),e.child=null,e.deletions=null,e.sibling=null,e.tag===5&&(t=e.stateNode,t!==null&&(delete t[xr],delete t[_u],delete t[Jy],delete t[_8],delete t[b8])),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 U7(e){return e.tag===5||e.tag===3||e.tag===4}function t2(e){e:for(;;){for(;e.sibling===null;){if(e.return===null||U7(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 h0(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=of));else if(r!==4&&(e=e.child,e!==null))for(h0(e,t,n),e=e.sibling;e!==null;)h0(e,t,n),e=e.sibling}function g0(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(g0(e,t,n),e=e.sibling;e!==null;)g0(e,t,n),e=e.sibling}var Rt=null,er=!1;function _o(e,t,n){for(n=n.child;n!==null;)V7(e,t,n),n=n.sibling}function V7(e,t,n){if(Cr&&typeof Cr.onCommitFiberUnmount=="function")try{Cr.onCommitFiberUnmount(qp,n)}catch{}switch(n.tag){case 5:Lt||Ua(n,t);case 6:var r=Rt,o=er;Rt=null,_o(e,t,n),Rt=r,er=o,Rt!==null&&(er?(e=Rt,n=n.stateNode,e.nodeType===8?e.parentNode.removeChild(n):e.removeChild(n)):Rt.removeChild(n.stateNode));break;case 18:Rt!==null&&(er?(e=Rt,n=n.stateNode,e.nodeType===8?Mg(e.parentNode,n):e.nodeType===1&&Mg(e,n),hu(e)):Mg(Rt,n.stateNode));break;case 4:r=Rt,o=er,Rt=n.stateNode.containerInfo,er=!0,_o(e,t,n),Rt=r,er=o;break;case 0:case 11:case 14:case 15:if(!Lt&&(r=n.updateQueue,r!==null&&(r=r.lastEffect,r!==null))){o=r=r.next;do{var i=o,a=i.destroy;i=i.tag,a!==void 0&&(i&2||i&4)&&f0(n,t,a),o=o.next}while(o!==r)}_o(e,t,n);break;case 1:if(!Lt&&(Ua(n,t),r=n.stateNode,typeof r.componentWillUnmount=="function"))try{r.props=n.memoizedProps,r.state=n.memoizedState,r.componentWillUnmount()}catch(s){et(n,t,s)}_o(e,t,n);break;case 21:_o(e,t,n);break;case 22:n.mode&1?(Lt=(r=Lt)||n.memoizedState!==null,_o(e,t,n),Lt=r):_o(e,t,n);break;default:_o(e,t,n)}}function n2(e){var t=e.updateQueue;if(t!==null){e.updateQueue=null;var n=e.stateNode;n===null&&(n=e.stateNode=new D8),t.forEach(function(r){var o=W8.bind(null,e,r);n.has(r)||(n.add(r),r.then(o,o))})}}function Kn(e,t){var n=t.deletions;if(n!==null)for(var r=0;ro&&(o=a),r&=~i}if(r=o,r=ot()-r,r=(120>r?120:480>r?480:1080>r?1080:1920>r?1920:3e3>r?3e3:4320>r?4320:1960*F8(r/1960))-r,10e?16:e,Mo===null)var r=!1;else{if(e=Mo,Mo=null,vf=0,Te&6)throw Error(X(331));var o=Te;for(Te|=4,ue=e.current;ue!==null;){var i=ue,a=i.child;if(ue.flags&16){var s=i.deletions;if(s!==null){for(var l=0;lot()-u5?Di(e,0):l5|=n),an(e,t)}function Y7(e,t){t===0&&(e.mode&1?(t=Lc,Lc<<=1,!(Lc&130023424)&&(Lc=4194304)):t=1);var n=Bt();e=eo(e,t),e!==null&&(Qu(e,t,n),an(e,n))}function q8(e){var t=e.memoizedState,n=0;t!==null&&(n=t.retryLane),Y7(e,n)}function W8(e,t){var n=0;switch(e.tag){case 13:var r=e.stateNode,o=e.memoizedState;o!==null&&(n=o.retryLane);break;case 19:r=e.stateNode;break;default:throw Error(X(314))}r!==null&&r.delete(t),Y7(e,n)}var Q7;Q7=function(e,t,n){if(e!==null)if(e.memoizedProps!==t.pendingProps||rn.current)nn=!0;else{if(!(e.lanes&n)&&!(t.flags&128))return nn=!1,M8(e,t,n);nn=!!(e.flags&131072)}else nn=!1,Ke&&t.flags&1048576&&JC(t,uf,t.index);switch(t.lanes=0,t.tag){case 2:var r=t.type;Sd(e,t),e=t.pendingProps;var o=ds(t,Dt.current);es(t,n),o=n5(null,t,r,e,o,n);var i=r5();return t.flags|=1,typeof o=="object"&&o!==null&&typeof o.render=="function"&&o.$$typeof===void 0?(t.tag=1,t.memoizedState=null,t.updateQueue=null,on(r)?(i=!0,sf(t)):i=!1,t.memoizedState=o.state!==null&&o.state!==void 0?o.state:null,X1(t),o.updater=Xp,t.stateNode=o,o._reactInternals=t,i0(t,r,e,n),t=l0(null,t,r,!0,i,n)):(t.tag=0,Ke&&i&&H1(t),Ft(null,t,o,n),t=t.child),t;case 16:r=t.elementType;e:{switch(Sd(e,t),e=t.pendingProps,o=r._init,r=o(r._payload),t.type=r,o=t.tag=K8(r),e=Zn(r,e),o){case 0:t=s0(null,t,r,e,n);break e;case 1:t=Xx(null,t,r,e,n);break e;case 11:t=Yx(null,t,r,e,n);break e;case 14:t=Qx(null,t,r,Zn(r.type,e),n);break e}throw Error(X(306,r,""))}return t;case 0:return r=t.type,o=t.pendingProps,o=t.elementType===r?o:Zn(r,o),s0(e,t,r,o,n);case 1:return r=t.type,o=t.pendingProps,o=t.elementType===r?o:Zn(r,o),Xx(e,t,r,o,n);case 3:e:{if(M7(t),e===null)throw Error(X(387));r=t.pendingProps,i=t.memoizedState,o=i.element,r7(e,t),ff(t,r,null,n);var a=t.memoizedState;if(r=a.element,i.isDehydrated)if(i={element:r,isDehydrated:!1,cache:a.cache,pendingSuspenseBoundaries:a.pendingSuspenseBoundaries,transitions:a.transitions},t.updateQueue.baseState=i,t.memoizedState=i,t.flags&256){o=gs(Error(X(423)),t),t=Zx(e,t,r,n,o);break e}else if(r!==o){o=gs(Error(X(424)),t),t=Zx(e,t,r,n,o);break e}else for(yn=Vo(t.stateNode.containerInfo.firstChild),vn=t,Ke=!0,nr=null,n=s7(t,null,r,n),t.child=n;n;)n.flags=n.flags&-3|4096,n=n.sibling;else{if(fs(),r===o){t=to(e,t,n);break e}Ft(e,t,r,n)}t=t.child}return t;case 5:return l7(t),e===null&&n0(t),r=t.type,o=t.pendingProps,i=e!==null?e.memoizedProps:null,a=o.children,Xy(r,o)?a=null:i!==null&&Xy(r,i)&&(t.flags|=32),P7(e,t),Ft(e,t,a,n),t.child;case 6:return e===null&&n0(t),null;case 13:return N7(e,t,n);case 4:return Z1(t,t.stateNode.containerInfo),r=t.pendingProps,e===null?t.child=ps(t,null,r,n):Ft(e,t,r,n),t.child;case 11:return r=t.type,o=t.pendingProps,o=t.elementType===r?o:Zn(r,o),Yx(e,t,r,o,n);case 7:return Ft(e,t,t.pendingProps,n),t.child;case 8:return Ft(e,t,t.pendingProps.children,n),t.child;case 12:return Ft(e,t,t.pendingProps.children,n),t.child;case 10:e:{if(r=t.type._context,o=t.pendingProps,i=t.memoizedProps,a=o.value,Ue(cf,r._currentValue),r._currentValue=a,i!==null)if(dr(i.value,a)){if(i.children===o.children&&!rn.current){t=to(e,t,n);break e}}else for(i=t.child,i!==null&&(i.return=t);i!==null;){var s=i.dependencies;if(s!==null){a=i.child;for(var l=s.firstContext;l!==null;){if(l.context===r){if(i.tag===1){l=Xr(-1,n&-n),l.tag=2;var u=i.updateQueue;if(u!==null){u=u.shared;var c=u.pending;c===null?l.next=l:(l.next=c.next,c.next=l),u.pending=l}}i.lanes|=n,l=i.alternate,l!==null&&(l.lanes|=n),r0(i.return,n,t),s.lanes|=n;break}l=l.next}}else if(i.tag===10)a=i.type===t.type?null:i.child;else if(i.tag===18){if(a=i.return,a===null)throw Error(X(341));a.lanes|=n,s=a.alternate,s!==null&&(s.lanes|=n),r0(a,n,t),a=i.sibling}else a=i.child;if(a!==null)a.return=i;else for(a=i;a!==null;){if(a===t){a=null;break}if(i=a.sibling,i!==null){i.return=a.return,a=i;break}a=a.return}i=a}Ft(e,t,o.children,n),t=t.child}return t;case 9:return o=t.type,r=t.pendingProps.children,es(t,n),o=jn(o),r=r(o),t.flags|=1,Ft(e,t,r,n),t.child;case 14:return r=t.type,o=Zn(r,t.pendingProps),o=Zn(r.type,o),Qx(e,t,r,o,n);case 15:return T7(e,t,t.type,t.pendingProps,n);case 17:return r=t.type,o=t.pendingProps,o=t.elementType===r?o:Zn(r,o),Sd(e,t),t.tag=1,on(r)?(e=!0,sf(t)):e=!1,es(t,n),i7(t,r,o),i0(t,r,o,n),l0(null,t,r,!0,e,n);case 19:return L7(e,t,n);case 22:return $7(e,t,n)}throw Error(X(156,t.tag))};function X7(e,t){return SC(e,t)}function G8(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 Ln(e,t,n,r){return new G8(e,t,n,r)}function p5(e){return e=e.prototype,!(!e||!e.isReactComponent)}function K8(e){if(typeof e=="function")return p5(e)?1:0;if(e!=null){if(e=e.$$typeof,e===P1)return 11;if(e===M1)return 14}return 2}function qo(e,t){var n=e.alternate;return n===null?(n=Ln(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 Cd(e,t,n,r,o,i){var a=2;if(r=e,typeof e=="function")p5(e)&&(a=1);else if(typeof e=="string")a=5;else e:switch(e){case $a:return Ii(n.children,o,i,t);case $1:a=8,o|=8;break;case ky:return e=Ln(12,n,t,o|2),e.elementType=ky,e.lanes=i,e;case Ty:return e=Ln(13,n,t,o),e.elementType=Ty,e.lanes=i,e;case $y:return e=Ln(19,n,t,o),e.elementType=$y,e.lanes=i,e;case aC:return th(n,o,i,t);default:if(typeof e=="object"&&e!==null)switch(e.$$typeof){case oC:a=10;break e;case iC:a=9;break e;case P1:a=11;break e;case M1:a=14;break e;case xo:a=16,r=null;break e}throw Error(X(130,e==null?e:typeof e,""))}return t=Ln(a,n,t,o),t.elementType=e,t.type=r,t.lanes=i,t}function Ii(e,t,n,r){return e=Ln(7,e,r,t),e.lanes=n,e}function th(e,t,n,r){return e=Ln(22,e,r,t),e.elementType=aC,e.lanes=n,e.stateNode={isHidden:!1},e}function Vg(e,t,n){return e=Ln(6,e,null,t),e.lanes=n,e}function zg(e,t,n){return t=Ln(4,e.children!==null?e.children:[],e.key,t),t.lanes=n,t.stateNode={containerInfo:e.containerInfo,pendingChildren:null,implementation:e.implementation},t}function Y8(e,t,n,r,o){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=wg(0),this.expirationTimes=wg(-1),this.entangledLanes=this.finishedLanes=this.mutableReadLanes=this.expiredLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=wg(0),this.identifierPrefix=r,this.onRecoverableError=o,this.mutableSourceEagerHydrationData=null}function h5(e,t,n,r,o,i,a,s,l){return e=new Y8(e,t,n,s,l),t===1?(t=1,i===!0&&(t|=8)):t=0,i=Ln(3,null,null,t),e.current=i,i.stateNode=e,i.memoizedState={element:r,isDehydrated:n,cache:null,transitions:null,pendingSuspenseBoundaries:null},X1(i),e}function Q8(e,t,n){var r=3"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(tO)}catch(e){console.error(e)}}tO(),JA.exports=bn;var nO=JA.exports;const tN=uo(nO);var c2=nO;Oy.createRoot=c2.createRoot,Oy.hydrateRoot=c2.hydrateRoot;function nN(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 rO={exports:{}};const rN={},oN=Object.freeze(Object.defineProperty({__proto__:null,default:rN},Symbol.toStringTag,{value:"Module"})),iN=kM(oN);(function(e,t){(function(n,r){e.exports=r()})(Ci,function(){var n=n||function(r,o){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 Ci<"u"&&Ci.crypto&&(i=Ci.crypto),!i&&typeof nN=="function")try{i=iN}catch{}var a=function(){if(i){if(typeof i.getRandomValues=="function")try{return i.getRandomValues(new Uint32Array(1))[0]}catch{}if(typeof i.randomBytes=="function")try{return i.randomBytes(4).readInt32LE()}catch{}}throw new Error("Native crypto module could not be used to get secure random number.")},s=Object.create||function(){function h(){}return function(_){var x;return h.prototype=_,x=new h,h.prototype=null,x}}(),l={},u=l.lib={},c=u.Base=function(){return{extend:function(h){var _=s(this);return h&&_.mixIn(h),(!_.hasOwnProperty("init")||this.init===_.init)&&(_.init=function(){_.$super.init.apply(this,arguments)}),_.init.prototype=_,_.$super=this,_},create:function(){var h=this.extend();return h.init.apply(h,arguments),h},init:function(){},mixIn:function(h){for(var _ in h)h.hasOwnProperty(_)&&(this[_]=h[_]);h.hasOwnProperty("toString")&&(this.toString=h.toString)},clone:function(){return this.init.prototype.extend(this)}}}(),d=u.WordArray=c.extend({init:function(h,_){h=this.words=h||[],_!=o?this.sigBytes=_:this.sigBytes=h.length*4},toString:function(h){return(h||p).stringify(this)},concat:function(h){var _=this.words,x=h.words,w=this.sigBytes,S=h.sigBytes;if(this.clamp(),w%4)for(var A=0;A>>2]>>>24-A%4*8&255;_[w+A>>>2]|=C<<24-(w+A)%4*8}else for(var R=0;R>>2]=x[R>>>2];return this.sigBytes+=S,this},clamp:function(){var h=this.words,_=this.sigBytes;h[_>>>2]&=4294967295<<32-_%4*8,h.length=r.ceil(_/4)},clone:function(){var h=c.clone.call(this);return h.words=this.words.slice(0),h},random:function(h){for(var _=[],x=0;x>>2]>>>24-S%4*8&255;w.push((A>>>4).toString(16)),w.push((A&15).toString(16))}return w.join("")},parse:function(h){for(var _=h.length,x=[],w=0;w<_;w+=2)x[w>>>3]|=parseInt(h.substr(w,2),16)<<24-w%8*4;return new d.init(x,_/2)}},g=f.Latin1={stringify:function(h){for(var _=h.words,x=h.sigBytes,w=[],S=0;S>>2]>>>24-S%4*8&255;w.push(String.fromCharCode(A))}return w.join("")},parse:function(h){for(var _=h.length,x=[],w=0;w<_;w++)x[w>>>2]|=(h.charCodeAt(w)&255)<<24-w%4*8;return new d.init(x,_)}},v=f.Utf8={stringify:function(h){try{return decodeURIComponent(escape(g.stringify(h)))}catch{throw new Error("Malformed UTF-8 data")}},parse:function(h){return g.parse(unescape(encodeURIComponent(h)))}},b=u.BufferedBlockAlgorithm=c.extend({reset:function(){this._data=new d.init,this._nDataBytes=0},_append:function(h){typeof h=="string"&&(h=v.parse(h)),this._data.concat(h),this._nDataBytes+=h.sigBytes},_process:function(h){var _,x=this._data,w=x.words,S=x.sigBytes,A=this.blockSize,C=A*4,R=S/C;h?R=r.ceil(R):R=r.max((R|0)-this._minBufferSize,0);var O=R*A,k=r.min(O*4,S);if(O){for(var T=0;T>>7)^(R<<14|R>>>18)^R>>>3,k=d[C-2],T=(k<<15|k>>>17)^(k<<13|k>>>19)^k>>>10;d[C]=O+d[C-7]+T+d[C-16]}var $=x&w^~x&S,j=b&y^b&h^y&h,L=(b<<30|b>>>2)^(b<<19|b>>>13)^(b<<10|b>>>22),G=(x<<26|x>>>6)^(x<<21|x>>>11)^(x<<7|x>>>25),W=A+G+$+c[C]+d[C],V=L+j;A=S,S=w,w=x,x=_+W|0,_=h,h=y,y=b,b=W+V|0}v[0]=v[0]+b|0,v[1]=v[1]+y|0,v[2]=v[2]+h|0,v[3]=v[3]+_|0,v[4]=v[4]+x|0,v[5]=v[5]+w|0,v[6]=v[6]+S|0,v[7]=v[7]+A|0},_doFinalize:function(){var p=this._data,g=p.words,v=this._nDataBytes*8,b=p.sigBytes*8;return g[b>>>5]|=128<<24-b%32,g[(b+64>>>9<<4)+14]=r.floor(v/4294967296),g[(b+64>>>9<<4)+15]=v,p.sigBytes=g.length*4,this._process(),this._hash},clone:function(){var p=s.clone.call(this);return p._hash=this._hash.clone(),p}});o.SHA256=s._createHelper(f),o.HmacSHA256=s._createHmacHelper(f)}(Math),n.SHA256})})(oO);var sN=oO.exports;const lN=uo(sN);var iO={exports:{}};(function(e,t){(function(n,r){e.exports=r(ah)})(Ci,function(n){return function(){var r=n,o=r.lib,i=o.WordArray,a=r.enc;a.Base64={stringify:function(l){var u=l.words,c=l.sigBytes,d=this._map;l.clamp();for(var f=[],p=0;p>>2]>>>24-p%4*8&255,v=u[p+1>>>2]>>>24-(p+1)%4*8&255,b=u[p+2>>>2]>>>24-(p+2)%4*8&255,y=g<<16|v<<8|b,h=0;h<4&&p+h*.75>>6*(3-h)&63));var _=d.charAt(64);if(_)for(;f.length%4;)f.push(_);return f.join("")},parse:function(l){var u=l.length,c=this._map,d=this._reverseMap;if(!d){d=this._reverseMap=[];for(var f=0;f>>6-p%4*2,b=g|v;d[f>>>2]|=b<<24-f%4*8,f++}return i.create(d,f)}}(),n.enc.Base64})})(iO);var uN=iO.exports;const d2=uo(uN);var aO={exports:{}};(function(e,t){(function(n,r){e.exports=r(ah)})(Ci,function(n){return n.enc.Utf8})})(aO);var cN=aO.exports;const dN=uo(cN);function b0(e){this.message=e}b0.prototype=new Error,b0.prototype.name="InvalidCharacterError";var f2=typeof window<"u"&&window.atob&&window.atob.bind(window)||function(e){var t=String(e).replace(/=+$/,"");if(t.length%4==1)throw new b0("'atob' failed: The string to be decoded is not correctly encoded.");for(var n,r,o=0,i=0,a="";r=t.charAt(i++);~r&&(n=o%4?64*n+r:r,o++%4)?a+=String.fromCharCode(255&n>>(-2*o&6)):0)r="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=".indexOf(r);return a};function fN(e){var t=e.replace(/-/g,"+").replace(/_/g,"/");switch(t.length%4){case 0:break;case 2:t+="==";break;case 3:t+="=";break;default:throw"Illegal base64url string!"}try{return function(n){return decodeURIComponent(f2(n).replace(/(.)/g,function(r,o){var i=o.charCodeAt(0).toString(16).toUpperCase();return i.length<2&&(i="0"+i),"%"+i}))}(t)}catch{return f2(t)}}function xf(e){this.message=e}function pN(e,t){if(typeof e!="string")throw new xf("Invalid token specified");var n=(t=t||{}).header===!0?0:1;try{return JSON.parse(fN(e.split(".")[n]))}catch(r){throw new xf("Invalid token specified: "+r.message)}}xf.prototype=new Error,xf.prototype.name="InvalidTokenError";var hN={debug:()=>{},info:()=>{},warn:()=>{},error:()=>{}},vr,_r,wf=(e=>(e[e.NONE=0]="NONE",e[e.ERROR=1]="ERROR",e[e.WARN=2]="WARN",e[e.INFO=3]="INFO",e[e.DEBUG=4]="DEBUG",e))(wf||{});(e=>{function t(){vr=3,_r=hN}e.reset=t;function n(o){if(!(0<=o&&o<=4))throw new Error("Invalid log level");vr=o}e.setLevel=n;function r(o){_r=o}e.setLogger=r})(wf||(wf={}));var be=class{constructor(e){this._name=e}debug(...e){vr>=4&&_r.debug(be._format(this._name,this._method),...e)}info(...e){vr>=3&&_r.info(be._format(this._name,this._method),...e)}warn(...e){vr>=2&&_r.warn(be._format(this._name,this._method),...e)}error(...e){vr>=1&&_r.error(be._format(this._name,this._method),...e)}throw(e){throw this.error(e),e}create(e){const t=Object.create(this);return t._method=e,t.debug("begin"),t}static createStatic(e,t){const n=new be(`${e}.${t}`);return n.debug("begin"),n}static _format(e,t){const n=`[${e}]`;return t?`${n} ${t}:`:n}static debug(e,...t){vr>=4&&_r.debug(be._format(e),...t)}static info(e,...t){vr>=3&&_r.info(be._format(e),...t)}static warn(e,...t){vr>=2&&_r.warn(be._format(e),...t)}static error(e,...t){vr>=1&&_r.error(be._format(e),...t)}};wf.reset();var gN="10000000-1000-4000-8000-100000000000",Sr=class{static _randomWord(){return aN.lib.WordArray.random(1).words[0]}static generateUUIDv4(){return gN.replace(/[018]/g,t=>(+t^Sr._randomWord()&15>>+t/4).toString(16)).replace(/-/g,"")}static generateCodeVerifier(){return Sr.generateUUIDv4()+Sr.generateUUIDv4()+Sr.generateUUIDv4()}static generateCodeChallenge(e){try{const t=lN(e);return d2.stringify(t).replace(/\+/g,"-").replace(/\//g,"_").replace(/=+$/,"")}catch(t){throw be.error("CryptoUtils.generateCodeChallenge",t),t}}static generateBasicAuth(e,t){const n=dN.parse([e,t].join(":"));return d2.stringify(n)}},So=class{constructor(e){this._name=e,this._logger=new be(`Event('${this._name}')`),this._callbacks=[]}addHandler(e){return this._callbacks.push(e),()=>this.removeHandler(e)}removeHandler(e){const t=this._callbacks.lastIndexOf(e);t>=0&&this._callbacks.splice(t,1)}raise(...e){this._logger.debug("raise:",...e);for(const t of this._callbacks)t(...e)}},x0=class{static decode(e){try{return pN(e)}catch(t){throw be.error("JwtUtils.decode",t),t}}},p2=class{static center({...e}){var t,n,r;return e.width==null&&(e.width=(t=[800,720,600,480].find(o=>o<=window.outerWidth/1.618))!=null?t:360),(n=e.left)!=null||(e.left=Math.max(0,Math.round(window.screenX+(window.outerWidth-e.width)/2))),e.height!=null&&((r=e.top)!=null||(e.top=Math.max(0,Math.round(window.screenY+(window.outerHeight-e.height)/2)))),e}static serialize(e){return Object.entries(e).filter(([,t])=>t!=null).map(([t,n])=>`${t}=${typeof n!="boolean"?n:n?"yes":"no"}`).join(",")}},In=class extends So{constructor(){super(...arguments),this._logger=new be(`Timer('${this._name}')`),this._timerHandle=null,this._expiration=0,this._callback=()=>{const e=this._expiration-In.getEpochTime();this._logger.debug("timer completes in",e),this._expiration<=In.getEpochTime()&&(this.cancel(),super.raise())}}static getEpochTime(){return Math.floor(Date.now()/1e3)}init(e){const t=this._logger.create("init");e=Math.max(Math.floor(e),1);const n=In.getEpochTime()+e;if(this.expiration===n&&this._timerHandle){t.debug("skipping since already initialized for expiration at",this.expiration);return}this.cancel(),t.debug("using duration",e),this._expiration=n;const r=Math.min(e,5);this._timerHandle=setInterval(this._callback,r*1e3)}get expiration(){return this._expiration}cancel(){this._logger.create("cancel"),this._timerHandle&&(clearInterval(this._timerHandle),this._timerHandle=null)}},w0=class{static readParams(e,t="query"){if(!e)throw new TypeError("Invalid URL");const r=new URL(e,"http://127.0.0.1")[t==="fragment"?"hash":"search"];return new URLSearchParams(r.slice(1))}},S0=";",Yi=class extends Error{constructor(e,t){var n,r,o;if(super(e.error_description||e.error||""),this.form=t,this.name="ErrorResponse",!e.error)throw be.error("ErrorResponse","No error passed"),new Error("No error passed");this.error=e.error,this.error_description=(n=e.error_description)!=null?n:null,this.error_uri=(r=e.error_uri)!=null?r:null,this.state=e.userState,this.session_state=(o=e.session_state)!=null?o:null,this.url_state=e.url_state}},v5=class extends Error{constructor(e){super(e),this.name="ErrorTimeout"}},mN=class{constructor(e){this._logger=new be("AccessTokenEvents"),this._expiringTimer=new In("Access token expiring"),this._expiredTimer=new In("Access token expired"),this._expiringNotificationTimeInSeconds=e.expiringNotificationTimeInSeconds}load(e){const t=this._logger.create("load");if(e.access_token&&e.expires_in!==void 0){const n=e.expires_in;if(t.debug("access token present, remaining duration:",n),n>0){let o=n-this._expiringNotificationTimeInSeconds;o<=0&&(o=1),t.debug("registering expiring timer, raising in",o,"seconds"),this._expiringTimer.init(o)}else t.debug("canceling existing expiring timer because we're past expiration."),this._expiringTimer.cancel();const r=n+1;t.debug("registering expired timer, raising in",r,"seconds"),this._expiredTimer.init(r)}else this._expiringTimer.cancel(),this._expiredTimer.cancel()}unload(){this._logger.debug("unload: canceling existing access token timers"),this._expiringTimer.cancel(),this._expiredTimer.cancel()}addAccessTokenExpiring(e){return this._expiringTimer.addHandler(e)}removeAccessTokenExpiring(e){this._expiringTimer.removeHandler(e)}addAccessTokenExpired(e){return this._expiredTimer.addHandler(e)}removeAccessTokenExpired(e){this._expiredTimer.removeHandler(e)}},yN=class{constructor(e,t,n,r,o){this._callback=e,this._client_id=t,this._intervalInSeconds=r,this._stopOnError=o,this._logger=new be("CheckSessionIFrame"),this._timer=null,this._session_state=null,this._message=a=>{a.origin===this._frame_origin&&a.source===this._frame.contentWindow&&(a.data==="error"?(this._logger.error("error message from check session op iframe"),this._stopOnError&&this.stop()):a.data==="changed"?(this._logger.debug("changed message from check session op iframe"),this.stop(),this._callback()):this._logger.debug(a.data+" message from check session op iframe"))};const i=new URL(n);this._frame_origin=i.origin,this._frame=window.document.createElement("iframe"),this._frame.style.visibility="hidden",this._frame.style.position="fixed",this._frame.style.left="-1000px",this._frame.style.top="0",this._frame.width="0",this._frame.height="0",this._frame.src=i.href}load(){return new Promise(e=>{this._frame.onload=()=>{e()},window.document.body.appendChild(this._frame),window.addEventListener("message",this._message,!1)})}start(e){if(this._session_state===e)return;this._logger.create("start"),this.stop(),this._session_state=e;const t=()=>{!this._frame.contentWindow||!this._session_state||this._frame.contentWindow.postMessage(this._client_id+" "+this._session_state,this._frame_origin)};t(),this._timer=setInterval(t,this._intervalInSeconds*1e3)}stop(){this._logger.create("stop"),this._session_state=null,this._timer&&(clearInterval(this._timer),this._timer=null)}},sO=class{constructor(){this._logger=new be("InMemoryWebStorage"),this._data={}}clear(){this._logger.create("clear"),this._data={}}getItem(e){return this._logger.create(`getItem('${e}')`),this._data[e]}setItem(e,t){this._logger.create(`setItem('${e}')`),this._data[e]=t}removeItem(e){this._logger.create(`removeItem('${e}')`),delete this._data[e]}get length(){return Object.getOwnPropertyNames(this._data).length}key(e){return Object.getOwnPropertyNames(this._data)[e]}},_5=class{constructor(e=[],t=null,n={}){this._jwtHandler=t,this._extraHeaders=n,this._logger=new be("JsonService"),this._contentTypes=[],this._contentTypes.push(...e,"application/json"),t&&this._contentTypes.push("application/jwt")}async fetchWithTimeout(e,t={}){const{timeoutInSeconds:n,...r}=t;if(!n)return await fetch(e,r);const o=new AbortController,i=setTimeout(()=>o.abort(),n*1e3);try{return await fetch(e,{...t,signal:o.signal})}catch(a){throw a instanceof DOMException&&a.name==="AbortError"?new v5("Network timed out"):a}finally{clearTimeout(i)}}async getJson(e,{token:t,credentials:n}={}){const r=this._logger.create("getJson"),o={Accept:this._contentTypes.join(", ")};t&&(r.debug("token passed, setting Authorization header"),o.Authorization="Bearer "+t),this.appendExtraHeaders(o);let i;try{r.debug("url:",e),i=await this.fetchWithTimeout(e,{method:"GET",headers:o,credentials:n})}catch(l){throw r.error("Network Error"),l}r.debug("HTTP response received, status",i.status);const a=i.headers.get("Content-Type");if(a&&!this._contentTypes.find(l=>a.startsWith(l))&&r.throw(new Error(`Invalid response Content-Type: ${a??"undefined"}, from URL: ${e}`)),i.ok&&this._jwtHandler&&(a!=null&&a.startsWith("application/jwt")))return await this._jwtHandler(await i.text());let s;try{s=await i.json()}catch(l){throw r.error("Error parsing JSON response",l),i.ok?l:new Error(`${i.statusText} (${i.status})`)}if(!i.ok)throw r.error("Error from server:",s),s.error?new Yi(s):new Error(`${i.statusText} (${i.status}): ${JSON.stringify(s)}`);return s}async postForm(e,{body:t,basicAuth:n,timeoutInSeconds:r,initCredentials:o}){const i=this._logger.create("postForm"),a={Accept:this._contentTypes.join(", "),"Content-Type":"application/x-www-form-urlencoded"};n!==void 0&&(a.Authorization="Basic "+n),this.appendExtraHeaders(a);let s;try{i.debug("url:",e),s=await this.fetchWithTimeout(e,{method:"POST",headers:a,body:t,timeoutInSeconds:r,credentials:o})}catch(d){throw i.error("Network error"),d}i.debug("HTTP response received, status",s.status);const l=s.headers.get("Content-Type");if(l&&!this._contentTypes.find(d=>l.startsWith(d)))throw new Error(`Invalid response Content-Type: ${l??"undefined"}, from URL: ${e}`);const u=await s.text();let c={};if(u)try{c=JSON.parse(u)}catch(d){throw i.error("Error parsing JSON response",d),s.ok?d:new Error(`${s.statusText} (${s.status})`)}if(!s.ok)throw i.error("Error from server:",c),c.error?new Yi(c,t):new Error(`${s.statusText} (${s.status}): ${JSON.stringify(c)}`);return c}appendExtraHeaders(e){const t=this._logger.create("appendExtraHeaders"),n=Object.keys(this._extraHeaders),r=["authorization","accept","content-type"];n.length!==0&&n.forEach(o=>{if(r.includes(o.toLocaleLowerCase())){t.warn("Protected header could not be overridden",o,r);return}const i=typeof this._extraHeaders[o]=="function"?this._extraHeaders[o]():this._extraHeaders[o];i&&i!==""&&(e[o]=i)})}},vN=class{constructor(e){this._settings=e,this._logger=new be("MetadataService"),this._signingKeys=null,this._metadata=null,this._metadataUrl=this._settings.metadataUrl,this._jsonService=new _5(["application/jwk-set+json"],null,this._settings.extraHeaders),this._settings.signingKeys&&(this._logger.debug("using signingKeys from settings"),this._signingKeys=this._settings.signingKeys),this._settings.metadata&&(this._logger.debug("using metadata from settings"),this._metadata=this._settings.metadata),this._settings.fetchRequestCredentials&&(this._logger.debug("using fetchRequestCredentials from settings"),this._fetchRequestCredentials=this._settings.fetchRequestCredentials)}resetSigningKeys(){this._signingKeys=null}async getMetadata(){const e=this._logger.create("getMetadata");if(this._metadata)return e.debug("using cached values"),this._metadata;if(!this._metadataUrl)throw e.throw(new Error("No authority or metadataUrl configured on settings")),null;e.debug("getting metadata from",this._metadataUrl);const t=await this._jsonService.getJson(this._metadataUrl,{credentials:this._fetchRequestCredentials});return e.debug("merging remote JSON with seed metadata"),this._metadata=Object.assign({},this._settings.metadataSeed,t),this._metadata}getIssuer(){return this._getMetadataProperty("issuer")}getAuthorizationEndpoint(){return this._getMetadataProperty("authorization_endpoint")}getUserInfoEndpoint(){return this._getMetadataProperty("userinfo_endpoint")}getTokenEndpoint(e=!0){return this._getMetadataProperty("token_endpoint",e)}getCheckSessionIframe(){return this._getMetadataProperty("check_session_iframe",!0)}getEndSessionEndpoint(){return this._getMetadataProperty("end_session_endpoint",!0)}getRevocationEndpoint(e=!0){return this._getMetadataProperty("revocation_endpoint",e)}getKeysEndpoint(e=!0){return this._getMetadataProperty("jwks_uri",e)}async _getMetadataProperty(e,t=!1){const n=this._logger.create(`_getMetadataProperty('${e}')`),r=await this.getMetadata();if(n.debug("resolved"),r[e]===void 0){if(t===!0){n.warn("Metadata does not contain optional property");return}n.throw(new Error("Metadata does not contain property "+e))}return r[e]}async getSigningKeys(){const e=this._logger.create("getSigningKeys");if(this._signingKeys)return e.debug("returning signingKeys from cache"),this._signingKeys;const t=await this.getKeysEndpoint(!1);e.debug("got jwks_uri",t);const n=await this._jsonService.getJson(t);if(e.debug("got key set",n),!Array.isArray(n.keys))throw e.throw(new Error("Missing keys on keyset")),null;return this._signingKeys=n.keys,this._signingKeys}},lO=class{constructor({prefix:e="oidc.",store:t=localStorage}={}){this._logger=new be("WebStorageStateStore"),this._store=t,this._prefix=e}async set(e,t){this._logger.create(`set('${e}')`),e=this._prefix+e,await this._store.setItem(e,t)}async get(e){return this._logger.create(`get('${e}')`),e=this._prefix+e,await this._store.getItem(e)}async remove(e){this._logger.create(`remove('${e}')`),e=this._prefix+e;const t=await this._store.getItem(e);return await this._store.removeItem(e),t}async getAllKeys(){this._logger.create("getAllKeys");const e=await this._store.length,t=[];for(let n=0;n{const r=this._logger.create("_getClaimsFromJwt");try{const o=x0.decode(n);return r.debug("JWT decoding successful"),o}catch(o){throw r.error("Error parsing JWT response"),o}},this._jsonService=new _5(void 0,this._getClaimsFromJwt,this._settings.extraHeaders)}async getClaims(e){const t=this._logger.create("getClaims");e||this._logger.throw(new Error("No token passed"));const n=await this._metadataService.getUserInfoEndpoint();t.debug("got userinfo url",n);const r=await this._jsonService.getJson(n,{token:e,credentials:this._settings.fetchRequestCredentials});return t.debug("got claims",r),r}},uO=class{constructor(e,t){this._settings=e,this._metadataService=t,this._logger=new be("TokenClient"),this._jsonService=new _5(this._settings.revokeTokenAdditionalContentTypes,null,this._settings.extraHeaders)}async exchangeCode({grant_type:e="authorization_code",redirect_uri:t=this._settings.redirect_uri,client_id:n=this._settings.client_id,client_secret:r=this._settings.client_secret,...o}){const i=this._logger.create("exchangeCode");n||i.throw(new Error("A client_id is required")),t||i.throw(new Error("A redirect_uri is required")),o.code||i.throw(new Error("A code is required"));const a=new URLSearchParams({grant_type:e,redirect_uri:t});for(const[c,d]of Object.entries(o))d!=null&&a.set(c,d);let s;switch(this._settings.client_authentication){case"client_secret_basic":if(!r)throw i.throw(new Error("A client_secret is required")),null;s=Sr.generateBasicAuth(n,r);break;case"client_secret_post":a.append("client_id",n),r&&a.append("client_secret",r);break}const l=await this._metadataService.getTokenEndpoint(!1);i.debug("got token endpoint");const u=await this._jsonService.postForm(l,{body:a,basicAuth:s,initCredentials:this._settings.fetchRequestCredentials});return i.debug("got response"),u}async exchangeCredentials({grant_type:e="password",client_id:t=this._settings.client_id,client_secret:n=this._settings.client_secret,scope:r=this._settings.scope,...o}){const i=this._logger.create("exchangeCredentials");t||i.throw(new Error("A client_id is required"));const a=new URLSearchParams({grant_type:e,scope:r});for(const[c,d]of Object.entries(o))d!=null&&a.set(c,d);let s;switch(this._settings.client_authentication){case"client_secret_basic":if(!n)throw i.throw(new Error("A client_secret is required")),null;s=Sr.generateBasicAuth(t,n);break;case"client_secret_post":a.append("client_id",t),n&&a.append("client_secret",n);break}const l=await this._metadataService.getTokenEndpoint(!1);i.debug("got token endpoint");const u=await this._jsonService.postForm(l,{body:a,basicAuth:s,initCredentials:this._settings.fetchRequestCredentials});return i.debug("got response"),u}async exchangeRefreshToken({grant_type:e="refresh_token",client_id:t=this._settings.client_id,client_secret:n=this._settings.client_secret,timeoutInSeconds:r,...o}){const i=this._logger.create("exchangeRefreshToken");t||i.throw(new Error("A client_id is required")),o.refresh_token||i.throw(new Error("A refresh_token is required"));const a=new URLSearchParams({grant_type:e});for(const[c,d]of Object.entries(o))Array.isArray(d)?d.forEach(f=>a.append(c,f)):d!=null&&a.set(c,d);let s;switch(this._settings.client_authentication){case"client_secret_basic":if(!n)throw i.throw(new Error("A client_secret is required")),null;s=Sr.generateBasicAuth(t,n);break;case"client_secret_post":a.append("client_id",t),n&&a.append("client_secret",n);break}const l=await this._metadataService.getTokenEndpoint(!1);i.debug("got token endpoint");const u=await this._jsonService.postForm(l,{body:a,basicAuth:s,timeoutInSeconds:r,initCredentials:this._settings.fetchRequestCredentials});return i.debug("got response"),u}async revoke(e){var t;const n=this._logger.create("revoke");e.token||n.throw(new Error("A token is required"));const r=await this._metadataService.getRevocationEndpoint(!1);n.debug(`got revocation endpoint, revoking ${(t=e.token_type_hint)!=null?t:"default token type"}`);const o=new URLSearchParams;for(const[i,a]of Object.entries(e))a!=null&&o.set(i,a);o.set("client_id",this._settings.client_id),this._settings.client_secret&&o.set("client_secret",this._settings.client_secret),await this._jsonService.postForm(r,{body:o}),n.debug("got response")}},CN=class{constructor(e,t,n){this._settings=e,this._metadataService=t,this._claimsService=n,this._logger=new be("ResponseValidator"),this._userInfoService=new AN(this._settings,this._metadataService),this._tokenClient=new uO(this._settings,this._metadataService)}async validateSigninResponse(e,t){const n=this._logger.create("validateSigninResponse");this._processSigninState(e,t),n.debug("state processed"),await this._processCode(e,t),n.debug("code processed"),e.isOpenId&&this._validateIdTokenAttributes(e),n.debug("tokens validated"),await this._processClaims(e,t==null?void 0:t.skipUserInfo,e.isOpenId),n.debug("claims processed")}async validateCredentialsResponse(e,t){const n=this._logger.create("validateCredentialsResponse");e.isOpenId&&e.id_token&&this._validateIdTokenAttributes(e),n.debug("tokens validated"),await this._processClaims(e,t,e.isOpenId),n.debug("claims processed")}async validateRefreshResponse(e,t){var n,r;const o=this._logger.create("validateRefreshResponse");e.userState=t.data,(n=e.session_state)!=null||(e.session_state=t.session_state),(r=e.scope)!=null||(e.scope=t.scope),e.isOpenId&&e.id_token&&(this._validateIdTokenAttributes(e,t.id_token),o.debug("ID Token validated")),e.id_token||(e.id_token=t.id_token,e.profile=t.profile);const i=e.isOpenId&&!!e.id_token;await this._processClaims(e,!1,i),o.debug("claims processed")}validateSignoutResponse(e,t){const n=this._logger.create("validateSignoutResponse");if(t.id!==e.state&&n.throw(new Error("State does not match")),n.debug("state validated"),e.userState=t.data,e.error)throw n.warn("Response was error",e.error),new Yi(e)}_processSigninState(e,t){var n;const r=this._logger.create("_processSigninState");if(t.id!==e.state&&r.throw(new Error("State does not match")),t.client_id||r.throw(new Error("No client_id on state")),t.authority||r.throw(new Error("No authority on state")),this._settings.authority!==t.authority&&r.throw(new Error("authority mismatch on settings vs. signin state")),this._settings.client_id&&this._settings.client_id!==t.client_id&&r.throw(new Error("client_id mismatch on settings vs. signin state")),r.debug("state validated"),e.userState=t.data,e.url_state=t.url_state,(n=e.scope)!=null||(e.scope=t.scope),e.error)throw r.warn("Response was error",e.error),new Yi(e);t.code_verifier&&!e.code&&r.throw(new Error("Expected code in response"))}async _processClaims(e,t=!1,n=!0){const r=this._logger.create("_processClaims");if(e.profile=this._claimsService.filterProtocolClaims(e.profile),t||!this._settings.loadUserInfo||!e.access_token){r.debug("not loading user info");return}r.debug("loading user info");const o=await this._userInfoService.getClaims(e.access_token);r.debug("user info claims received from user info endpoint"),n&&o.sub!==e.profile.sub&&r.throw(new Error("subject from UserInfo response does not match subject in ID Token")),e.profile=this._claimsService.mergeClaims(e.profile,this._claimsService.filterProtocolClaims(o)),r.debug("user info claims received, updated profile:",e.profile)}async _processCode(e,t){const n=this._logger.create("_processCode");if(e.code){n.debug("Validating code");const r=await this._tokenClient.exchangeCode({client_id:t.client_id,client_secret:t.client_secret,code:e.code,redirect_uri:t.redirect_uri,code_verifier:t.code_verifier,...t.extraTokenParams});Object.assign(e,r)}else n.debug("No code to process")}_validateIdTokenAttributes(e,t){var n;const r=this._logger.create("_validateIdTokenAttributes");r.debug("decoding ID Token JWT");const o=x0.decode((n=e.id_token)!=null?n:"");if(o.sub||r.throw(new Error("ID Token is missing a subject claim")),t){const i=x0.decode(t);o.sub!==i.sub&&r.throw(new Error("sub in id_token does not match current sub")),o.auth_time&&o.auth_time!==i.auth_time&&r.throw(new Error("auth_time in id_token does not match original auth_time")),o.azp&&o.azp!==i.azp&&r.throw(new Error("azp in id_token does not match original azp")),!o.azp&&i.azp&&r.throw(new Error("azp not in id_token, but present in original id_token"))}e.profile=o}},ys=class{constructor(e){this.id=e.id||Sr.generateUUIDv4(),this.data=e.data,e.created&&e.created>0?this.created=e.created:this.created=In.getEpochTime(),this.request_type=e.request_type,this.url_state=e.url_state}toStorageString(){return new be("State").create("toStorageString"),JSON.stringify({id:this.id,data:this.data,created:this.created,request_type:this.request_type,url_state:this.url_state})}static fromStorageString(e){return be.createStatic("State","fromStorageString"),new ys(JSON.parse(e))}static async clearStaleState(e,t){const n=be.createStatic("State","clearStaleState"),r=In.getEpochTime()-t,o=await e.getAllKeys();n.debug("got keys",o);for(let i=0;ih.searchParams.append("resource",w));for(const[x,w]of Object.entries({response_mode:s,...y,...g}))w!=null&&h.searchParams.append(x,w.toString());this.url=h.href}},RN="openid",Bg=class{constructor(e){if(this.access_token="",this.token_type="",this.profile={},this.state=e.get("state"),this.session_state=e.get("session_state"),this.state){const t=decodeURIComponent(this.state).split(S0);this.state=t[0],t.length>1&&(this.url_state=t.slice(1).join(S0))}this.error=e.get("error"),this.error_description=e.get("error_description"),this.error_uri=e.get("error_uri"),this.code=e.get("code")}get expires_in(){if(this.expires_at!==void 0)return this.expires_at-In.getEpochTime()}set expires_in(e){typeof e=="string"&&(e=Number(e)),e!==void 0&&e>=0&&(this.expires_at=Math.floor(e)+In.getEpochTime())}get isOpenId(){var e;return((e=this.scope)==null?void 0:e.split(" ").includes(RN))||!!this.id_token}},kN=class{constructor({url:e,state_data:t,id_token_hint:n,post_logout_redirect_uri:r,extraQueryParams:o,request_type:i,client_id:a}){if(this._logger=new be("SignoutRequest"),!e)throw this._logger.error("ctor: No url passed"),new Error("url");const s=new URL(e);n&&s.searchParams.append("id_token_hint",n),a&&s.searchParams.append("client_id",a),r&&(s.searchParams.append("post_logout_redirect_uri",r),t&&(this.state=new ys({data:t,request_type:i}),s.searchParams.append("state",this.state.id)));for(const[l,u]of Object.entries({...o}))u!=null&&s.searchParams.append(l,u.toString());this.url=s.href}},TN=class{constructor(e){this.state=e.get("state"),this.error=e.get("error"),this.error_description=e.get("error_description"),this.error_uri=e.get("error_uri")}},$N=["nbf","jti","auth_time","nonce","acr","amr","azp","at_hash"],PN=["sub","iss","aud","exp","iat"],MN=class{constructor(e){this._settings=e,this._logger=new be("ClaimsService")}filterProtocolClaims(e){const t={...e};if(this._settings.filterProtocolClaims){let n;Array.isArray(this._settings.filterProtocolClaims)?n=this._settings.filterProtocolClaims:n=$N;for(const r of n)PN.includes(r)||delete t[r]}return t}mergeClaims(e,t){const n={...e};for(const[r,o]of Object.entries(t))for(const i of Array.isArray(o)?o:[o]){const a=n[r];a===void 0?n[r]=i:Array.isArray(a)?a.includes(i)||a.push(i):n[r]!==i&&(typeof i=="object"&&this._settings.mergeClaims?n[r]=this.mergeClaims(a,i):n[r]=[a,i])}return n}},NN=class{constructor(e,t){this._logger=new be("OidcClient"),this.settings=e instanceof E0?e:new E0(e),this.metadataService=t??new vN(this.settings),this._claimsService=new MN(this.settings),this._validator=new CN(this.settings,this.metadataService,this._claimsService),this._tokenClient=new uO(this.settings,this.metadataService)}async createSigninRequest({state:e,request:t,request_uri:n,request_type:r,id_token_hint:o,login_hint:i,skipUserInfo:a,nonce:s,url_state:l,response_type:u=this.settings.response_type,scope:c=this.settings.scope,redirect_uri:d=this.settings.redirect_uri,prompt:f=this.settings.prompt,display:p=this.settings.display,max_age:g=this.settings.max_age,ui_locales:v=this.settings.ui_locales,acr_values:b=this.settings.acr_values,resource:y=this.settings.resource,response_mode:h=this.settings.response_mode,extraQueryParams:_=this.settings.extraQueryParams,extraTokenParams:x=this.settings.extraTokenParams}){const w=this._logger.create("createSigninRequest");if(u!=="code")throw new Error("Only the Authorization Code flow (with PKCE) is supported");const S=await this.metadataService.getAuthorizationEndpoint();w.debug("Received authorization endpoint",S);const A=new ON({url:S,authority:this.settings.authority,client_id:this.settings.client_id,redirect_uri:d,response_type:u,scope:c,state_data:e,url_state:l,prompt:f,display:p,max_age:g,ui_locales:v,id_token_hint:o,login_hint:i,acr_values:b,resource:y,request:t,request_uri:n,extraQueryParams:_,extraTokenParams:x,request_type:r,response_mode:h,client_secret:this.settings.client_secret,skipUserInfo:a,nonce:s,disablePKCE:this.settings.disablePKCE});await this.clearStaleState();const C=A.state;return await this.settings.stateStore.set(C.id,C.toStorageString()),A}async readSigninResponseState(e,t=!1){const n=this._logger.create("readSigninResponseState"),r=new Bg(w0.readParams(e,this.settings.response_mode));if(!r.state)throw n.throw(new Error("No state in response")),null;const o=await this.settings.stateStore[t?"remove":"get"](r.state);if(!o)throw n.throw(new Error("No matching state found in storage")),null;return{state:b5.fromStorageString(o),response:r}}async processSigninResponse(e){const t=this._logger.create("processSigninResponse"),{state:n,response:r}=await this.readSigninResponseState(e,!0);return t.debug("received state from storage; validating response"),await this._validator.validateSigninResponse(r,n),r}async processResourceOwnerPasswordCredentials({username:e,password:t,skipUserInfo:n=!1,extraTokenParams:r={}}){const o=await this._tokenClient.exchangeCredentials({username:e,password:t,...r}),i=new Bg(new URLSearchParams);return Object.assign(i,o),await this._validator.validateCredentialsResponse(i,n),i}async useRefreshToken({state:e,timeoutInSeconds:t}){var n;const r=this._logger.create("useRefreshToken");let o;if(this.settings.refreshTokenAllowedScope===void 0)o=e.scope;else{const s=this.settings.refreshTokenAllowedScope.split(" ");o=(((n=e.scope)==null?void 0:n.split(" "))||[]).filter(u=>s.includes(u)).join(" ")}const i=await this._tokenClient.exchangeRefreshToken({refresh_token:e.refresh_token,resource:e.resource,scope:o,timeoutInSeconds:t}),a=new Bg(new URLSearchParams);return Object.assign(a,i),r.debug("validating response",a),await this._validator.validateRefreshResponse(a,{...e,scope:o}),a}async createSignoutRequest({state:e,id_token_hint:t,client_id:n,request_type:r,post_logout_redirect_uri:o=this.settings.post_logout_redirect_uri,extraQueryParams:i=this.settings.extraQueryParams}={}){const a=this._logger.create("createSignoutRequest"),s=await this.metadataService.getEndSessionEndpoint();if(!s)throw a.throw(new Error("No end session endpoint")),null;a.debug("Received end session endpoint",s),!n&&o&&!t&&(n=this.settings.client_id);const l=new kN({url:s,id_token_hint:t,client_id:n,post_logout_redirect_uri:o,state_data:e,extraQueryParams:i,request_type:r});await this.clearStaleState();const u=l.state;return u&&(a.debug("Signout request has state to persist"),await this.settings.stateStore.set(u.id,u.toStorageString())),l}async readSignoutResponseState(e,t=!1){const n=this._logger.create("readSignoutResponseState"),r=new TN(w0.readParams(e,this.settings.response_mode));if(!r.state){if(n.debug("No state in response"),r.error)throw n.warn("Response was error:",r.error),new Yi(r);return{state:void 0,response:r}}const o=await this.settings.stateStore[t?"remove":"get"](r.state);if(!o)throw n.throw(new Error("No matching state found in storage")),null;return{state:ys.fromStorageString(o),response:r}}async processSignoutResponse(e){const t=this._logger.create("processSignoutResponse"),{state:n,response:r}=await this.readSignoutResponseState(e,!0);return n?(t.debug("Received state from storage; validating response"),this._validator.validateSignoutResponse(r,n)):t.debug("No state from storage; skipping response validation"),r}clearStaleState(){return this._logger.create("clearStaleState"),ys.clearStaleState(this.settings.stateStore,this.settings.staleStateAgeInSeconds)}async revokeToken(e,t){return this._logger.create("revokeToken"),await this._tokenClient.revoke({token:e,token_type_hint:t})}},LN=class{constructor(e){this._userManager=e,this._logger=new be("SessionMonitor"),this._start=async t=>{const n=t.session_state;if(!n)return;const r=this._logger.create("_start");if(t.profile?(this._sub=t.profile.sub,this._sid=t.profile.sid,r.debug("session_state",n,", sub",this._sub)):(this._sub=void 0,this._sid=void 0,r.debug("session_state",n,", anonymous user")),this._checkSessionIFrame){this._checkSessionIFrame.start(n);return}try{const o=await this._userManager.metadataService.getCheckSessionIframe();if(o){r.debug("initializing check session iframe");const i=this._userManager.settings.client_id,a=this._userManager.settings.checkSessionIntervalInSeconds,s=this._userManager.settings.stopCheckSessionOnError,l=new yN(this._callback,i,o,a,s);await l.load(),this._checkSessionIFrame=l,l.start(n)}else r.warn("no check session iframe found in the metadata")}catch(o){r.error("Error from getCheckSessionIframe:",o instanceof Error?o.message:o)}},this._stop=()=>{const t=this._logger.create("_stop");if(this._sub=void 0,this._sid=void 0,this._checkSessionIFrame&&this._checkSessionIFrame.stop(),this._userManager.settings.monitorAnonymousSession){const n=setInterval(async()=>{clearInterval(n);try{const r=await this._userManager.querySessionStatus();if(r){const o={session_state:r.session_state,profile:r.sub&&r.sid?{sub:r.sub,sid:r.sid}:null};this._start(o)}}catch(r){t.error("error from querySessionStatus",r instanceof Error?r.message:r)}},1e3)}},this._callback=async()=>{const t=this._logger.create("_callback");try{const n=await this._userManager.querySessionStatus();let r=!0;n&&this._checkSessionIFrame?n.sub===this._sub?(r=!1,this._checkSessionIFrame.start(n.session_state),n.sid===this._sid?t.debug("same sub still logged in at OP, restarting check session iframe; session_state",n.session_state):(t.debug("same sub still logged in at OP, session state has changed, restarting check session iframe; session_state",n.session_state),this._userManager.events._raiseUserSessionChanged())):t.debug("different subject signed into OP",n.sub):t.debug("subject no longer signed into OP"),r?this._sub?this._userManager.events._raiseUserSignedOut():this._userManager.events._raiseUserSignedIn():t.debug("no change in session detected, no event to raise")}catch(n){this._sub&&(t.debug("Error calling queryCurrentSigninSession; raising signed out event",n),this._userManager.events._raiseUserSignedOut())}},e||this._logger.throw(new Error("No user manager passed")),this._userManager.events.addUserLoaded(this._start),this._userManager.events.addUserUnloaded(this._stop),this._init().catch(t=>{this._logger.error(t)})}async _init(){this._logger.create("_init");const e=await this._userManager.getUser();if(e)this._start(e);else if(this._userManager.settings.monitorAnonymousSession){const t=await this._userManager.querySessionStatus();if(t){const n={session_state:t.session_state,profile:t.sub&&t.sid?{sub:t.sub,sid:t.sid}:null};this._start(n)}}}},Od=class{constructor(e){var t;this.id_token=e.id_token,this.session_state=(t=e.session_state)!=null?t:null,this.access_token=e.access_token,this.refresh_token=e.refresh_token,this.token_type=e.token_type,this.scope=e.scope,this.profile=e.profile,this.expires_at=e.expires_at,this.state=e.userState,this.url_state=e.url_state}get expires_in(){if(this.expires_at!==void 0)return this.expires_at-In.getEpochTime()}set expires_in(e){e!==void 0&&(this.expires_at=Math.floor(e)+In.getEpochTime())}get expired(){const e=this.expires_in;if(e!==void 0)return e<=0}get scopes(){var e,t;return(t=(e=this.scope)==null?void 0:e.split(" "))!=null?t:[]}toStorageString(){return new be("User").create("toStorageString"),JSON.stringify({id_token:this.id_token,session_state:this.session_state,access_token:this.access_token,refresh_token:this.refresh_token,token_type:this.token_type,scope:this.scope,profile:this.profile,expires_at:this.expires_at})}static fromStorageString(e){return be.createStatic("User","fromStorageString"),new Od(JSON.parse(e))}},h2="oidc-client",cO=class{constructor(){this._abort=new So("Window navigation aborted"),this._disposeHandlers=new Set,this._window=null}async navigate(e){const t=this._logger.create("navigate");if(!this._window)throw new Error("Attempted to navigate on a disposed window");t.debug("setting URL in window"),this._window.location.replace(e.url);const{url:n,keepOpen:r}=await new Promise((o,i)=>{const a=s=>{var l;const u=s.data,c=(l=e.scriptOrigin)!=null?l:window.location.origin;if(!(s.origin!==c||(u==null?void 0:u.source)!==h2)){try{const d=w0.readParams(u.url,e.response_mode).get("state");if(d||t.warn("no state found in response url"),s.source!==this._window&&d!==e.state)return}catch{this._dispose(),i(new Error("Invalid response from window"))}o(u)}};window.addEventListener("message",a,!1),this._disposeHandlers.add(()=>window.removeEventListener("message",a,!1)),this._disposeHandlers.add(this._abort.addHandler(s=>{this._dispose(),i(s)}))});return t.debug("got response from window"),this._dispose(),r||this.close(),{url:n}}_dispose(){this._logger.create("_dispose");for(const e of this._disposeHandlers)e();this._disposeHandlers.clear()}static _notifyParent(e,t,n=!1,r=window.location.origin){e.postMessage({source:h2,url:t,keepOpen:n},r)}},dO={location:!1,toolbar:!1,height:640,closePopupWindowAfterInSeconds:-1},fO="_blank",DN=60,IN=2,pO=10,jN=class extends E0{constructor(e){const{popup_redirect_uri:t=e.redirect_uri,popup_post_logout_redirect_uri:n=e.post_logout_redirect_uri,popupWindowFeatures:r=dO,popupWindowTarget:o=fO,redirectMethod:i="assign",redirectTarget:a="self",iframeNotifyParentOrigin:s=e.iframeNotifyParentOrigin,iframeScriptOrigin:l=e.iframeScriptOrigin,silent_redirect_uri:u=e.redirect_uri,silentRequestTimeoutInSeconds:c=pO,automaticSilentRenew:d=!0,validateSubOnSilentRenew:f=!0,includeIdTokenInSilentRenew:p=!1,monitorSession:g=!1,monitorAnonymousSession:v=!1,checkSessionIntervalInSeconds:b=IN,query_status_response_type:y="code",stopCheckSessionOnError:h=!0,revokeTokenTypes:_=["access_token","refresh_token"],revokeTokensOnSignout:x=!1,includeIdTokenInSilentSignout:w=!1,accessTokenExpiringNotificationTimeInSeconds:S=DN,userStore:A}=e;if(super(e),this.popup_redirect_uri=t,this.popup_post_logout_redirect_uri=n,this.popupWindowFeatures=r,this.popupWindowTarget=o,this.redirectMethod=i,this.redirectTarget=a,this.iframeNotifyParentOrigin=s,this.iframeScriptOrigin=l,this.silent_redirect_uri=u,this.silentRequestTimeoutInSeconds=c,this.automaticSilentRenew=d,this.validateSubOnSilentRenew=f,this.includeIdTokenInSilentRenew=p,this.monitorSession=g,this.monitorAnonymousSession=v,this.checkSessionIntervalInSeconds=b,this.stopCheckSessionOnError=h,this.query_status_response_type=y,this.revokeTokenTypes=_,this.revokeTokensOnSignout=x,this.includeIdTokenInSilentSignout=w,this.accessTokenExpiringNotificationTimeInSeconds=S,A)this.userStore=A;else{const C=typeof window<"u"?window.sessionStorage:new sO;this.userStore=new lO({store:C})}}},A0=class extends cO{constructor({silentRequestTimeoutInSeconds:e=pO}){super(),this._logger=new be("IFrameWindow"),this._timeoutInSeconds=e,this._frame=A0.createHiddenIframe(),this._window=this._frame.contentWindow}static createHiddenIframe(){const e=window.document.createElement("iframe");return e.style.visibility="hidden",e.style.position="fixed",e.style.left="-1000px",e.style.top="0",e.width="0",e.height="0",window.document.body.appendChild(e),e}async navigate(e){this._logger.debug("navigate: Using timeout of:",this._timeoutInSeconds);const t=setTimeout(()=>this._abort.raise(new v5("IFrame timed out without a response")),this._timeoutInSeconds*1e3);return this._disposeHandlers.add(()=>clearTimeout(t)),await super.navigate(e)}close(){var e;this._frame&&(this._frame.parentNode&&(this._frame.addEventListener("load",t=>{var n;const r=t.target;(n=r.parentNode)==null||n.removeChild(r),this._abort.raise(new Error("IFrame removed from DOM"))},!0),(e=this._frame.contentWindow)==null||e.location.replace("about:blank")),this._frame=null),this._window=null}static notifyParent(e,t){return super._notifyParent(window.parent,e,!1,t)}},FN=class{constructor(e){this._settings=e,this._logger=new be("IFrameNavigator")}async prepare({silentRequestTimeoutInSeconds:e=this._settings.silentRequestTimeoutInSeconds}){return new A0({silentRequestTimeoutInSeconds:e})}async callback(e){this._logger.create("callback"),A0.notifyParent(e,this._settings.iframeNotifyParentOrigin)}},UN=500,VN=1e3,g2=class extends cO{constructor({popupWindowTarget:e=fO,popupWindowFeatures:t={}}){super(),this._logger=new be("PopupWindow");const n=p2.center({...dO,...t});this._window=window.open(void 0,e,p2.serialize(n)),t.closePopupWindowAfterInSeconds&&t.closePopupWindowAfterInSeconds>0&&setTimeout(()=>{if(!this._window||typeof this._window.closed!="boolean"||this._window.closed){this._abort.raise(new Error("Popup blocked by user"));return}this.close()},t.closePopupWindowAfterInSeconds*VN)}async navigate(e){var t;(t=this._window)==null||t.focus();const n=setInterval(()=>{(!this._window||this._window.closed)&&this._abort.raise(new Error("Popup closed by user"))},UN);return this._disposeHandlers.add(()=>clearInterval(n)),await super.navigate(e)}close(){this._window&&(this._window.closed||(this._window.close(),this._abort.raise(new Error("Popup closed")))),this._window=null}static notifyOpener(e,t){if(!window.opener)throw new Error("No window.opener. Can't complete notification.");return super._notifyParent(window.opener,e,t)}},zN=class{constructor(e){this._settings=e,this._logger=new be("PopupNavigator")}async prepare({popupWindowFeatures:e=this._settings.popupWindowFeatures,popupWindowTarget:t=this._settings.popupWindowTarget}){return new g2({popupWindowFeatures:e,popupWindowTarget:t})}async callback(e,{keepOpen:t=!1}){this._logger.create("callback"),g2.notifyOpener(e,t)}},BN=class{constructor(e){this._settings=e,this._logger=new be("RedirectNavigator")}async prepare({redirectMethod:e=this._settings.redirectMethod,redirectTarget:t=this._settings.redirectTarget}){var n;this._logger.create("prepare");let r=window.self;t==="top"&&(r=(n=window.top)!=null?n:window.self);const o=r.location[e].bind(r.location);let i;return{navigate:async a=>{this._logger.create("navigate");const s=new Promise((l,u)=>{i=u});return o(a.url),await s},close:()=>{this._logger.create("close"),i==null||i(new Error("Redirect aborted")),r.stop()}}}async callback(){}},HN=class extends mN{constructor(e){super({expiringNotificationTimeInSeconds:e.accessTokenExpiringNotificationTimeInSeconds}),this._logger=new be("UserManagerEvents"),this._userLoaded=new So("User loaded"),this._userUnloaded=new So("User unloaded"),this._silentRenewError=new So("Silent renew error"),this._userSignedIn=new So("User signed in"),this._userSignedOut=new So("User signed out"),this._userSessionChanged=new So("User session changed")}load(e,t=!0){super.load(e),t&&this._userLoaded.raise(e)}unload(){super.unload(),this._userUnloaded.raise()}addUserLoaded(e){return this._userLoaded.addHandler(e)}removeUserLoaded(e){return this._userLoaded.removeHandler(e)}addUserUnloaded(e){return this._userUnloaded.addHandler(e)}removeUserUnloaded(e){return this._userUnloaded.removeHandler(e)}addSilentRenewError(e){return this._silentRenewError.addHandler(e)}removeSilentRenewError(e){return this._silentRenewError.removeHandler(e)}_raiseSilentRenewError(e){this._silentRenewError.raise(e)}addUserSignedIn(e){return this._userSignedIn.addHandler(e)}removeUserSignedIn(e){this._userSignedIn.removeHandler(e)}_raiseUserSignedIn(){this._userSignedIn.raise()}addUserSignedOut(e){return this._userSignedOut.addHandler(e)}removeUserSignedOut(e){this._userSignedOut.removeHandler(e)}_raiseUserSignedOut(){this._userSignedOut.raise()}addUserSessionChanged(e){return this._userSessionChanged.addHandler(e)}removeUserSessionChanged(e){this._userSessionChanged.removeHandler(e)}_raiseUserSessionChanged(){this._userSessionChanged.raise()}},qN=class{constructor(e){this._userManager=e,this._logger=new be("SilentRenewService"),this._isStarted=!1,this._retryTimer=new In("Retry Silent Renew"),this._tokenExpiring=async()=>{const t=this._logger.create("_tokenExpiring");try{await this._userManager.signinSilent(),t.debug("silent token renewal successful")}catch(n){if(n instanceof v5){t.warn("ErrorTimeout from signinSilent:",n,"retry in 5s"),this._retryTimer.init(5);return}t.error("Error from signinSilent:",n),this._userManager.events._raiseSilentRenewError(n)}}}async start(){const e=this._logger.create("start");if(!this._isStarted){this._isStarted=!0,this._userManager.events.addAccessTokenExpiring(this._tokenExpiring),this._retryTimer.addHandler(this._tokenExpiring);try{await this._userManager.getUser()}catch(t){e.error("getUser error",t)}}}stop(){this._isStarted&&(this._retryTimer.cancel(),this._retryTimer.removeHandler(this._tokenExpiring),this._userManager.events.removeAccessTokenExpiring(this._tokenExpiring),this._isStarted=!1)}},WN=class{constructor(e,t){this.refresh_token=e.refresh_token,this.id_token=e.id_token,this.session_state=e.session_state,this.scope=e.scope,this.profile=e.profile,this.resource=t,this.data=e.state}},GN=class{constructor(e,t,n,r){this._logger=new be("UserManager"),this.settings=new jN(e),this._client=new NN(e),this._redirectNavigator=t??new BN(this.settings),this._popupNavigator=n??new zN(this.settings),this._iframeNavigator=r??new FN(this.settings),this._events=new HN(this.settings),this._silentRenewService=new qN(this),this.settings.automaticSilentRenew&&this.startSilentRenew(),this._sessionMonitor=null,this.settings.monitorSession&&(this._sessionMonitor=new LN(this))}get events(){return this._events}get metadataService(){return this._client.metadataService}async getUser(){const e=this._logger.create("getUser"),t=await this._loadUser();return t?(e.info("user loaded"),this._events.load(t,!1),t):(e.info("user not found in storage"),null)}async removeUser(){const e=this._logger.create("removeUser");await this.storeUser(null),e.info("user removed from storage"),this._events.unload()}async signinRedirect(e={}){this._logger.create("signinRedirect");const{redirectMethod:t,...n}=e,r=await this._redirectNavigator.prepare({redirectMethod:t});await this._signinStart({request_type:"si:r",...n},r)}async signinRedirectCallback(e=window.location.href){const t=this._logger.create("signinRedirectCallback"),n=await this._signinEnd(e);return n.profile&&n.profile.sub?t.info("success, signed in subject",n.profile.sub):t.info("no subject"),n}async signinResourceOwnerCredentials({username:e,password:t,skipUserInfo:n=!1}){const r=this._logger.create("signinResourceOwnerCredential"),o=await this._client.processResourceOwnerPasswordCredentials({username:e,password:t,skipUserInfo:n,extraTokenParams:this.settings.extraTokenParams});r.debug("got signin response");const i=await this._buildUser(o);return i.profile&&i.profile.sub?r.info("success, signed in subject",i.profile.sub):r.info("no subject"),i}async signinPopup(e={}){const t=this._logger.create("signinPopup"),{popupWindowFeatures:n,popupWindowTarget:r,...o}=e,i=this.settings.popup_redirect_uri;i||t.throw(new Error("No popup_redirect_uri configured"));const a=await this._popupNavigator.prepare({popupWindowFeatures:n,popupWindowTarget:r}),s=await this._signin({request_type:"si:p",redirect_uri:i,display:"popup",...o},a);return s&&(s.profile&&s.profile.sub?t.info("success, signed in subject",s.profile.sub):t.info("no subject")),s}async signinPopupCallback(e=window.location.href,t=!1){const n=this._logger.create("signinPopupCallback");await this._popupNavigator.callback(e,{keepOpen:t}),n.info("success")}async signinSilent(e={}){var t;const n=this._logger.create("signinSilent"),{silentRequestTimeoutInSeconds:r,resource:o,...i}=e;let a=await this._loadUser();if(a!=null&&a.refresh_token){n.debug("using refresh token");const c=new WN(a,o);return await this._useRefreshToken(c)}const s=this.settings.silent_redirect_uri;s||n.throw(new Error("No silent_redirect_uri configured"));let l;a&&this.settings.validateSubOnSilentRenew&&(n.debug("subject prior to silent renew:",a.profile.sub),l=a.profile.sub);const u=await this._iframeNavigator.prepare({silentRequestTimeoutInSeconds:r});return a=await this._signin({request_type:"si:s",redirect_uri:s,prompt:"none",id_token_hint:this.settings.includeIdTokenInSilentRenew?a==null?void 0:a.id_token:void 0,...i},u,l),a&&((t=a.profile)!=null&&t.sub?n.info("success, signed in subject",a.profile.sub):n.info("no subject")),a}async _useRefreshToken(e){const t=await this._client.useRefreshToken({state:e,timeoutInSeconds:this.settings.silentRequestTimeoutInSeconds}),n=new Od({...e,...t});return await this.storeUser(n),this._events.load(n),n}async signinSilentCallback(e=window.location.href){const t=this._logger.create("signinSilentCallback");await this._iframeNavigator.callback(e),t.info("success")}async signinCallback(e=window.location.href){const{state:t}=await this._client.readSigninResponseState(e);switch(t.request_type){case"si:r":return await this.signinRedirectCallback(e);case"si:p":return await this.signinPopupCallback(e);case"si:s":return await this.signinSilentCallback(e);default:throw new Error("invalid response_type in state")}}async signoutCallback(e=window.location.href,t=!1){const{state:n}=await this._client.readSignoutResponseState(e);if(n)switch(n.request_type){case"so:r":await this.signoutRedirectCallback(e);break;case"so:p":await this.signoutPopupCallback(e,t);break;case"so:s":await this.signoutSilentCallback(e);break;default:throw new Error("invalid response_type in state")}}async querySessionStatus(e={}){const t=this._logger.create("querySessionStatus"),{silentRequestTimeoutInSeconds:n,...r}=e,o=this.settings.silent_redirect_uri;o||t.throw(new Error("No silent_redirect_uri configured"));const i=await this._loadUser(),a=await this._iframeNavigator.prepare({silentRequestTimeoutInSeconds:n}),s=await this._signinStart({request_type:"si:s",redirect_uri:o,prompt:"none",id_token_hint:this.settings.includeIdTokenInSilentRenew?i==null?void 0:i.id_token:void 0,response_type:this.settings.query_status_response_type,scope:"openid",skipUserInfo:!0,...r},a);try{const l=await this._client.processSigninResponse(s.url);return t.debug("got signin response"),l.session_state&&l.profile.sub?(t.info("success for subject",l.profile.sub),{session_state:l.session_state,sub:l.profile.sub,sid:l.profile.sid}):(t.info("success, user not authenticated"),null)}catch(l){if(this.settings.monitorAnonymousSession&&l instanceof Yi)switch(l.error){case"login_required":case"consent_required":case"interaction_required":case"account_selection_required":return t.info("success for anonymous user"),{session_state:l.session_state}}throw l}}async _signin(e,t,n){const r=await this._signinStart(e,t);return await this._signinEnd(r.url,n)}async _signinStart(e,t){const n=this._logger.create("_signinStart");try{const r=await this._client.createSigninRequest(e);return n.debug("got signin request"),await t.navigate({url:r.url,state:r.state.id,response_mode:r.state.response_mode,scriptOrigin:this.settings.iframeScriptOrigin})}catch(r){throw n.debug("error after preparing navigator, closing navigator window"),t.close(),r}}async _signinEnd(e,t){const n=this._logger.create("_signinEnd"),r=await this._client.processSigninResponse(e);return n.debug("got signin response"),await this._buildUser(r,t)}async _buildUser(e,t){const n=this._logger.create("_buildUser"),r=new Od(e);if(t){if(t!==r.profile.sub)throw n.debug("current user does not match user returned from signin. sub from signin:",r.profile.sub),new Yi({...e,error:"login_required"});n.debug("current user matches user returned from signin")}return await this.storeUser(r),n.debug("user stored"),this._events.load(r),r}async signoutRedirect(e={}){const t=this._logger.create("signoutRedirect"),{redirectMethod:n,...r}=e,o=await this._redirectNavigator.prepare({redirectMethod:n});await this._signoutStart({request_type:"so:r",post_logout_redirect_uri:this.settings.post_logout_redirect_uri,...r},o),t.info("success")}async signoutRedirectCallback(e=window.location.href){const t=this._logger.create("signoutRedirectCallback"),n=await this._signoutEnd(e);return t.info("success"),n}async signoutPopup(e={}){const t=this._logger.create("signoutPopup"),{popupWindowFeatures:n,popupWindowTarget:r,...o}=e,i=this.settings.popup_post_logout_redirect_uri,a=await this._popupNavigator.prepare({popupWindowFeatures:n,popupWindowTarget:r});await this._signout({request_type:"so:p",post_logout_redirect_uri:i,state:i==null?void 0:{},...o},a),t.info("success")}async signoutPopupCallback(e=window.location.href,t=!1){const n=this._logger.create("signoutPopupCallback");await this._popupNavigator.callback(e,{keepOpen:t}),n.info("success")}async _signout(e,t){const n=await this._signoutStart(e,t);return await this._signoutEnd(n.url)}async _signoutStart(e={},t){var n;const r=this._logger.create("_signoutStart");try{const o=await this._loadUser();r.debug("loaded current user from storage"),this.settings.revokeTokensOnSignout&&await this._revokeInternal(o);const i=e.id_token_hint||o&&o.id_token;i&&(r.debug("setting id_token_hint in signout request"),e.id_token_hint=i),await this.removeUser(),r.debug("user removed, creating signout request");const a=await this._client.createSignoutRequest(e);return r.debug("got signout request"),await t.navigate({url:a.url,state:(n=a.state)==null?void 0:n.id,scriptOrigin:this.settings.iframeScriptOrigin})}catch(o){throw r.debug("error after preparing navigator, closing navigator window"),t.close(),o}}async _signoutEnd(e){const t=this._logger.create("_signoutEnd"),n=await this._client.processSignoutResponse(e);return t.debug("got signout response"),n}async signoutSilent(e={}){var t;const n=this._logger.create("signoutSilent"),{silentRequestTimeoutInSeconds:r,...o}=e,i=this.settings.includeIdTokenInSilentSignout?(t=await this._loadUser())==null?void 0:t.id_token:void 0,a=this.settings.popup_post_logout_redirect_uri,s=await this._iframeNavigator.prepare({silentRequestTimeoutInSeconds:r});await this._signout({request_type:"so:s",post_logout_redirect_uri:a,id_token_hint:i,...o},s),n.info("success")}async signoutSilentCallback(e=window.location.href){const t=this._logger.create("signoutSilentCallback");await this._iframeNavigator.callback(e),t.info("success")}async revokeTokens(e){const t=await this._loadUser();await this._revokeInternal(t,e)}async _revokeInternal(e,t=this.settings.revokeTokenTypes){const n=this._logger.create("_revokeInternal");if(!e)return;const r=t.filter(o=>typeof e[o]=="string");if(!r.length){n.debug("no need to revoke due to no token(s)");return}for(const o of r)await this._client.revokeToken(e[o],o),n.info(`${o} revoked successfully`),o!=="access_token"&&(e[o]=null);await this.storeUser(e),n.debug("user stored"),this._events.load(e)}startSilentRenew(){this._logger.create("startSilentRenew"),this._silentRenewService.start()}stopSilentRenew(){this._silentRenewService.stop()}get _userStoreKey(){return`user:${this.settings.authority}:${this.settings.client_id}`}async _loadUser(){const e=this._logger.create("_loadUser"),t=await this.settings.userStore.get(this._userStoreKey);return t?(e.debug("user storageString loaded"),Od.fromStorageString(t)):(e.debug("no user storageString"),null)}async storeUser(e){const t=this._logger.create("storeUser");if(e){t.debug("storing user");const n=e.toStorageString();await this.settings.userStore.set(this._userStoreKey,n)}else this._logger.debug("removing user"),await this.settings.userStore.remove(this._userStoreKey)}async clearStaleState(){await this._client.clearStaleState()}},x5=E.createContext(void 0);x5.displayName="AuthContext";var KN={isLoading:!0,isAuthenticated:!1},YN=(e,t)=>{switch(t.type){case"INITIALISED":case"USER_LOADED":return{...e,user:t.user,isLoading:!1,isAuthenticated:t.user?!t.user.expired:!1,error:void 0};case"USER_UNLOADED":return{...e,user:void 0,isAuthenticated:!1};case"NAVIGATOR_INIT":return{...e,isLoading:!0,activeNavigator:t.method};case"NAVIGATOR_CLOSE":return{...e,isLoading:!1,activeNavigator:void 0};case"ERROR":return{...e,isLoading:!1,error:t.error};default:return{...e,isLoading:!1,error:new Error(`unknown type ${t.type}`)}}},QN=(e=window.location)=>{let t=new URLSearchParams(e.search);return!!((t.get("code")||t.get("error"))&&t.get("state")||(t=new URLSearchParams(e.hash.replace("#","?")),(t.get("code")||t.get("error"))&&t.get("state")))},XN=e=>t=>t instanceof Error?t:new Error(e),ZN=XN("Login failed"),JN=["clearStaleState","querySessionStatus","revokeTokens","startSilentRenew","stopSilentRenew"],eL=["signinPopup","signinSilent","signinRedirect","signinResourceOwnerCredentials","signoutPopup","signoutRedirect","signoutSilent"],Hg=e=>()=>{throw new Error(`UserManager#${e} was called from an unsupported context. If this is a server-rendered page, defer this call with useEffect() or pass a custom UserManager implementation.`)},tL=typeof window>"u"?null:GN,nL=e=>{const{children:t,onSigninCallback:n,skipSigninCallback:r,onRemoveUser:o,onSignoutRedirect:i,onSignoutPopup:a,implementation:s=tL,userManager:l,...u}=e,[c]=H.useState(()=>l??(s?new s(u):{settings:u})),[d,f]=H.useReducer(YN,KN),p=H.useMemo(()=>Object.assign({settings:c.settings,events:c.events},Object.fromEntries(JN.map(_=>{var x,w;return[_,(w=(x=c[_])==null?void 0:x.bind(c))!=null?w:Hg(_)]})),Object.fromEntries(eL.map(_=>[_,c[_]?async x=>{f({type:"NAVIGATOR_INIT",method:_});try{return await c[_](x)}catch(w){return f({type:"ERROR",error:w}),null}finally{f({type:"NAVIGATOR_CLOSE"})}}:Hg(_)]))),[c]),g=H.useRef(!1);H.useEffect(()=>{!c||g.current||(g.current=!0,(async()=>{let _=null;try{QN()&&!r&&(_=await c.signinCallback(),n&&await n(_)),_=_||await c.getUser(),f({type:"INITIALISED",user:_})}catch(x){f({type:"ERROR",error:ZN(x)})}})())},[c,r,n]),H.useEffect(()=>{if(!c)return;const _=S=>{f({type:"USER_LOADED",user:S})};c.events.addUserLoaded(_);const x=()=>{f({type:"USER_UNLOADED"})};c.events.addUserUnloaded(x);const w=S=>{f({type:"ERROR",error:S})};return c.events.addSilentRenewError(w),()=>{c.events.removeUserLoaded(_),c.events.removeUserUnloaded(x),c.events.removeSilentRenewError(w)}},[c]);const v=H.useCallback(c?()=>c.removeUser().then(o):Hg("removeUser"),[c,o]),b=H.useCallback(_=>p.signoutRedirect(_).then(i),[p.signoutRedirect,i]),y=H.useCallback(_=>p.signoutPopup(_).then(a),[p.signoutPopup,a]),h=H.useCallback(_=>p.signoutSilent(_),[p.signoutSilent]);return E.createElement(x5.Provider,{value:{...d,...p,removeUser:v,signoutRedirect:b,signoutPopup:y,signoutSilent:h}},t)},rL=()=>{const e=E.useContext(x5);return e||console.warn("AuthProvider context is undefined, please verify you are calling useAuth() as child of a component."),e};/** + * @remix-run/router v1.7.2 + * + * 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 Cu(){return Cu=Object.assign?Object.assign.bind():function(e){for(var t=1;t"u")throw new Error(t)}function w5(e,t){if(!e){typeof console<"u"&&console.warn(t);try{throw new Error(t)}catch{}}}function iL(){return Math.random().toString(36).substr(2,8)}function y2(e,t){return{usr:e.state,key:e.key,idx:t}}function C0(e,t,n,r){return n===void 0&&(n=null),Cu({pathname:typeof e=="string"?e:e.pathname,search:"",hash:""},typeof t=="string"?Is(t):t,{state:n,key:t&&t.key||r||iL()})}function Sf(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 Is(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 aL(e,t,n,r){r===void 0&&(r={});let{window:o=document.defaultView,v5Compat:i=!1}=r,a=o.history,s=No.Pop,l=null,u=c();u==null&&(u=0,a.replaceState(Cu({},a.state,{idx:u}),""));function c(){return(a.state||{idx:null}).idx}function d(){s=No.Pop;let b=c(),y=b==null?null:b-u;u=b,l&&l({action:s,location:v.location,delta:y})}function f(b,y){s=No.Push;let h=C0(v.location,b,y);n&&n(h,b),u=c()+1;let _=y2(h,u),x=v.createHref(h);try{a.pushState(_,"",x)}catch(w){if(w instanceof DOMException&&w.name==="DataCloneError")throw w;o.location.assign(x)}i&&l&&l({action:s,location:v.location,delta:1})}function p(b,y){s=No.Replace;let h=C0(v.location,b,y);n&&n(h,b),u=c();let _=y2(h,u),x=v.createHref(h);a.replaceState(_,"",x),i&&l&&l({action:s,location:v.location,delta:0})}function g(b){let y=o.location.origin!=="null"?o.location.origin:o.location.href,h=typeof b=="string"?b:Sf(b);return it(y,"No window.location.(origin|href) available to create URL for href: "+h),new URL(h,y)}let v={get action(){return s},get location(){return e(o,a)},listen(b){if(l)throw new Error("A history only accepts one active listener");return o.addEventListener(m2,d),l=b,()=>{o.removeEventListener(m2,d),l=null}},createHref(b){return t(o,b)},createURL:g,encodeLocation(b){let y=g(b);return{pathname:y.pathname,search:y.search,hash:y.hash}},push:f,replace:p,go(b){return a.go(b)}};return v}var v2;(function(e){e.data="data",e.deferred="deferred",e.redirect="redirect",e.error="error"})(v2||(v2={}));function sL(e,t,n){n===void 0&&(n="/");let r=typeof t=="string"?Is(t):t,o=S5(r.pathname||"/",n);if(o==null)return null;let i=hO(e);lL(i);let a=null;for(let s=0;a==null&&s{let l={relativePath:s===void 0?i.path||"":s,caseSensitive:i.caseSensitive===!0,childrenIndex:a,route:i};l.relativePath.startsWith("/")&&(it(l.relativePath.startsWith(r),'Absolute route path "'+l.relativePath+'" nested under path '+('"'+r+'" is not valid. An absolute child route path ')+"must start with the combined path of all its parent routes."),l.relativePath=l.relativePath.slice(r.length));let u=Wo([r,l.relativePath]),c=n.concat(l);i.children&&i.children.length>0&&(it(i.index!==!0,"Index routes must not have child routes. Please remove "+('all child routes from route path "'+u+'".')),hO(i.children,t,c,u)),!(i.path==null&&!i.index)&&t.push({path:u,score:gL(u,i.index),routesMeta:c})};return e.forEach((i,a)=>{var s;if(i.path===""||!((s=i.path)!=null&&s.includes("?")))o(i,a);else for(let l of gO(i.path))o(i,a,l)}),t}function gO(e){let t=e.split("/");if(t.length===0)return[];let[n,...r]=t,o=n.endsWith("?"),i=n.replace(/\?$/,"");if(r.length===0)return o?[i,""]:[i];let a=gO(r.join("/")),s=[];return s.push(...a.map(l=>l===""?i:[i,l].join("/"))),o&&s.push(...a),s.map(l=>e.startsWith("/")&&l===""?"/":l)}function lL(e){e.sort((t,n)=>t.score!==n.score?n.score-t.score:mL(t.routesMeta.map(r=>r.childrenIndex),n.routesMeta.map(r=>r.childrenIndex)))}const uL=/^:\w+$/,cL=3,dL=2,fL=1,pL=10,hL=-2,_2=e=>e==="*";function gL(e,t){let n=e.split("/"),r=n.length;return n.some(_2)&&(r+=hL),t&&(r+=dL),n.filter(o=>!_2(o)).reduce((o,i)=>o+(uL.test(i)?cL:i===""?fL:pL),r)}function mL(e,t){return e.length===t.length&&e.slice(0,-1).every((r,o)=>r===t[o])?e[e.length-1]-t[t.length-1]:0}function yL(e,t){let{routesMeta:n}=e,r={},o="/",i=[];for(let a=0;a{if(c==="*"){let f=s[d]||"";a=i.slice(0,i.length-f.length).replace(/(.)\/+$/,"$1")}return u[c]=xL(s[d]||"",c),u},{}),pathname:i,pathnameBase:a,pattern:e}}function _L(e,t,n){t===void 0&&(t=!1),n===void 0&&(n=!0),w5(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=[],o="^"+e.replace(/\/*\*?$/,"").replace(/^\/*/,"/").replace(/[\\.*+^$?{}|()[\]]/g,"\\$&").replace(/\/:(\w+)/g,(a,s)=>(r.push(s),"/([^\\/]+)"));return e.endsWith("*")?(r.push("*"),o+=e==="*"||e==="/*"?"(.*)$":"(?:\\/(.+)|\\/*)$"):n?o+="\\/*$":e!==""&&e!=="/"&&(o+="(?:(?=\\/|$))"),[new RegExp(o,t?void 0:"i"),r]}function bL(e){try{return decodeURI(e)}catch(t){return w5(!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 xL(e,t){try{return decodeURIComponent(e)}catch(n){return w5(!1,'The value for the URL param "'+t+'" will not be decoded because'+(' the string "'+e+'" is a malformed URL segment. This is probably')+(" due to a bad percent encoding ("+n+").")),e}}function S5(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 wL(e,t){t===void 0&&(t="/");let{pathname:n,search:r="",hash:o=""}=typeof e=="string"?Is(e):e;return{pathname:n?n.startsWith("/")?n:SL(n,t):t,search:AL(r),hash:CL(o)}}function SL(e,t){let n=t.replace(/\/+$/,"").split("/");return e.split("/").forEach(o=>{o===".."?n.length>1&&n.pop():o!=="."&&n.push(o)}),n.length>1?n.join("/"):"/"}function qg(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 and the router will parse it for you.'}function E5(e){return e.filter((t,n)=>n===0||t.route.path&&t.route.path.length>0)}function A5(e,t,n,r){r===void 0&&(r=!1);let o;typeof e=="string"?o=Is(e):(o=Cu({},e),it(!o.pathname||!o.pathname.includes("?"),qg("?","pathname","search",o)),it(!o.pathname||!o.pathname.includes("#"),qg("#","pathname","hash",o)),it(!o.search||!o.search.includes("#"),qg("#","search","hash",o)));let i=e===""||o.pathname==="",a=i?"/":o.pathname,s;if(r||a==null)s=n;else{let d=t.length-1;if(a.startsWith("..")){let f=a.split("/");for(;f[0]==="..";)f.shift(),d-=1;o.pathname=f.join("/")}s=d>=0?t[d]:"/"}let l=wL(o,s),u=a&&a!=="/"&&a.endsWith("/"),c=(i||a===".")&&n.endsWith("/");return!l.pathname.endsWith("/")&&(u||c)&&(l.pathname+="/"),l}const Wo=e=>e.join("/").replace(/\/\/+/g,"/"),EL=e=>e.replace(/\/+$/,"").replace(/^\/*/,"/"),AL=e=>!e||e==="?"?"":e.startsWith("?")?e:"?"+e,CL=e=>!e||e==="#"?"":e.startsWith("#")?e:"#"+e;function OL(e){return e!=null&&typeof e.status=="number"&&typeof e.statusText=="string"&&typeof e.internal=="boolean"&&"data"in e}const mO=["post","put","patch","delete"];new Set(mO);const RL=["get",...mO];new Set(RL);/** + * React Router v6.14.2 + * + * 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 Ef(){return Ef=Object.assign?Object.assign.bind():function(e){for(var t=1;tl.pathnameBase)),a=H.useRef(!1);return _O(()=>{a.current=!0}),H.useCallback(function(l,u){if(u===void 0&&(u={}),!a.current)return;if(typeof l=="number"){n.go(l);return}let c=A5(l,JSON.parse(i),o,u.relative==="path");e==null&&t!=="/"&&(c.pathname=c.pathname==="/"?t:Wo([t,c.pathname])),(u.replace?n.replace:n.push)(c,u.state,u)},[t,n,i,o,e])}const $L=H.createContext(null);function PL(e){let t=H.useContext(Pr).outlet;return t&&H.createElement($L.Provider,{value:e},t)}function ML(){let{matches:e}=H.useContext(Pr),t=e[e.length-1];return t?t.params:{}}function O5(e,t){let{relative:n}=t===void 0?{}:t,{matches:r}=H.useContext(Pr),{pathname:o}=aa(),i=JSON.stringify(E5(r).map(a=>a.pathnameBase));return H.useMemo(()=>A5(e,JSON.parse(i),o,n==="path"),[e,i,o,n])}function NL(e,t){return LL(e,t)}function LL(e,t,n){js()||it(!1);let{navigator:r}=H.useContext(ia),{matches:o}=H.useContext(Pr),i=o[o.length-1],a=i?i.params:{};i&&i.pathname;let s=i?i.pathnameBase:"/";i&&i.route;let l=aa(),u;if(t){var c;let v=typeof t=="string"?Is(t):t;s==="/"||(c=v.pathname)!=null&&c.startsWith(s)||it(!1),u=v}else u=l;let d=u.pathname||"/",f=s==="/"?d:d.slice(s.length)||"/",p=sL(e,{pathname:f}),g=UL(p&&p.map(v=>Object.assign({},v,{params:Object.assign({},a,v.params),pathname:Wo([s,r.encodeLocation?r.encodeLocation(v.pathname).pathname:v.pathname]),pathnameBase:v.pathnameBase==="/"?s:Wo([s,r.encodeLocation?r.encodeLocation(v.pathnameBase).pathname:v.pathnameBase])})),o,n);return t&&g?H.createElement(sh.Provider,{value:{location:Ef({pathname:"/",search:"",hash:"",state:null,key:"default"},u),navigationType:No.Pop}},g):g}function DL(){let e=HL(),t=OL(e)?e.status+" "+e.statusText:e instanceof Error?e.message:JSON.stringify(e),n=e instanceof Error?e.stack:null,o={padding:"0.5rem",backgroundColor:"rgba(200,200,200, 0.5)"},i=null;return H.createElement(H.Fragment,null,H.createElement("h2",null,"Unexpected Application Error!"),H.createElement("h3",{style:{fontStyle:"italic"}},t),n?H.createElement("pre",{style:o},n):null,i)}const IL=H.createElement(DL,null);class jL extends H.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||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?H.createElement(Pr.Provider,{value:this.props.routeContext},H.createElement(vO.Provider,{value:this.state.error,children:this.props.component})):this.props.children}}function FL(e){let{routeContext:t,match:n,children:r}=e,o=H.useContext(C5);return o&&o.static&&o.staticContext&&(n.route.errorElement||n.route.ErrorBoundary)&&(o.staticContext._deepestRenderedBoundaryId=n.route.id),H.createElement(Pr.Provider,{value:t},r)}function UL(e,t,n){var r;if(t===void 0&&(t=[]),n===void 0&&(n=null),e==null){var o;if((o=n)!=null&&o.errors)e=n.matches;else return null}let i=e,a=(r=n)==null?void 0:r.errors;if(a!=null){let s=i.findIndex(l=>l.route.id&&(a==null?void 0:a[l.route.id]));s>=0||it(!1),i=i.slice(0,Math.min(i.length,s+1))}return i.reduceRight((s,l,u)=>{let c=l.route.id?a==null?void 0:a[l.route.id]:null,d=null;n&&(d=l.route.errorElement||IL);let f=t.concat(i.slice(0,u+1)),p=()=>{let g;return c?g=d:l.route.Component?g=H.createElement(l.route.Component,null):l.route.element?g=l.route.element:g=s,H.createElement(FL,{match:l,routeContext:{outlet:s,matches:f,isDataRoute:n!=null},children:g})};return n&&(l.route.ErrorBoundary||l.route.errorElement||u===0)?H.createElement(jL,{location:n.location,revalidation:n.revalidation,component:d,error:c,children:p(),routeContext:{outlet:null,matches:f,isDataRoute:!0}}):p()},null)}var O0;(function(e){e.UseBlocker="useBlocker",e.UseRevalidator="useRevalidator",e.UseNavigateStable="useNavigate"})(O0||(O0={}));var Ou;(function(e){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"})(Ou||(Ou={}));function VL(e){let t=H.useContext(C5);return t||it(!1),t}function zL(e){let t=H.useContext(yO);return t||it(!1),t}function BL(e){let t=H.useContext(Pr);return t||it(!1),t}function bO(e){let t=BL(),n=t.matches[t.matches.length-1];return n.route.id||it(!1),n.route.id}function HL(){var e;let t=H.useContext(vO),n=zL(Ou.UseRouteError),r=bO(Ou.UseRouteError);return t||((e=n.errors)==null?void 0:e[r])}function qL(){let{router:e}=VL(O0.UseNavigateStable),t=bO(Ou.UseNavigateStable),n=H.useRef(!1);return _O(()=>{n.current=!0}),H.useCallback(function(o,i){i===void 0&&(i={}),n.current&&(typeof o=="number"?e.navigate(o):e.navigate(o,Ef({fromRouteId:t},i)))},[e,t])}function WL(e){let{to:t,replace:n,state:r,relative:o}=e;js()||it(!1);let{matches:i}=H.useContext(Pr),{pathname:a}=aa(),s=lh(),l=A5(t,E5(i).map(c=>c.pathnameBase),a,o==="path"),u=JSON.stringify(l);return H.useEffect(()=>s(JSON.parse(u),{replace:n,state:r,relative:o}),[s,u,o,n,r]),null}function GL(e){return PL(e.context)}function vi(e){it(!1)}function KL(e){let{basename:t="/",children:n=null,location:r,navigationType:o=No.Pop,navigator:i,static:a=!1}=e;js()&&it(!1);let s=t.replace(/^\/*/,"/"),l=H.useMemo(()=>({basename:s,navigator:i,static:a}),[s,i,a]);typeof r=="string"&&(r=Is(r));let{pathname:u="/",search:c="",hash:d="",state:f=null,key:p="default"}=r,g=H.useMemo(()=>{let v=S5(u,s);return v==null?null:{location:{pathname:v,search:c,hash:d,state:f,key:p},navigationType:o}},[s,u,c,d,f,p,o]);return g==null?null:H.createElement(ia.Provider,{value:l},H.createElement(sh.Provider,{children:n,value:g}))}function YL(e){let{children:t,location:n}=e;return NL(R0(t),n)}var b2;(function(e){e[e.pending=0]="pending",e[e.success=1]="success",e[e.error=2]="error"})(b2||(b2={}));new Promise(()=>{});function R0(e,t){t===void 0&&(t=[]);let n=[];return H.Children.forEach(e,(r,o)=>{if(!H.isValidElement(r))return;let i=[...t,o];if(r.type===H.Fragment){n.push.apply(n,R0(r.props.children,i));return}r.type!==vi&&it(!1),!r.props.index||!r.props.children||it(!1);let a={id:r.props.id||i.join("-"),caseSensitive:r.props.caseSensitive,element:r.props.element,Component:r.props.Component,index:r.props.index,path:r.props.path,loader:r.props.loader,action:r.props.action,errorElement:r.props.errorElement,ErrorBoundary:r.props.ErrorBoundary,hasErrorBoundary:r.props.ErrorBoundary!=null||r.props.errorElement!=null,shouldRevalidate:r.props.shouldRevalidate,handle:r.props.handle,lazy:r.props.lazy};r.props.children&&(a.children=R0(r.props.children,i)),n.push(a)}),n}/** + * React Router DOM v6.14.2 + * + * 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 Af(){return Af=Object.assign?Object.assign.bind():function(e){for(var t=1;t=0)&&(n[o]=e[o]);return n}function QL(e){return!!(e.metaKey||e.altKey||e.ctrlKey||e.shiftKey)}function XL(e,t){return e.button===0&&(!t||t==="_self")&&!QL(e)}const ZL=["onClick","relative","reloadDocument","replace","state","target","to","preventScrollReset"],JL=["aria-current","caseSensitive","className","end","style","to","children"],eD="startTransition",x2=qM[eD];function tD(e){let{basename:t,children:n,future:r,window:o}=e,i=H.useRef();i.current==null&&(i.current=oL({window:o,v5Compat:!0}));let a=i.current,[s,l]=H.useState({action:a.action,location:a.location}),{v7_startTransition:u}=r||{},c=H.useCallback(d=>{u&&x2?x2(()=>l(d)):l(d)},[l,u]);return H.useLayoutEffect(()=>a.listen(c),[a,c]),H.createElement(KL,{basename:t,children:n,location:s.location,navigationType:s.action,navigator:a})}const nD=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u",rD=/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i,wO=H.forwardRef(function(t,n){let{onClick:r,relative:o,reloadDocument:i,replace:a,state:s,target:l,to:u,preventScrollReset:c}=t,d=xO(t,ZL),{basename:f}=H.useContext(ia),p,g=!1;if(typeof u=="string"&&rD.test(u)&&(p=u,nD))try{let h=new URL(window.location.href),_=u.startsWith("//")?new URL(h.protocol+u):new URL(u),x=S5(_.pathname,f);_.origin===h.origin&&x!=null?u=x+_.search+_.hash:g=!0}catch{}let v=kL(u,{relative:o}),b=oD(u,{replace:a,state:s,target:l,preventScrollReset:c,relative:o});function y(h){r&&r(h),h.defaultPrevented||b(h)}return H.createElement("a",Af({},d,{href:p||v,onClick:g||i?r:y,ref:n,target:l}))}),Rd=H.forwardRef(function(t,n){let{"aria-current":r="page",caseSensitive:o=!1,className:i="",end:a=!1,style:s,to:l,children:u}=t,c=xO(t,JL),d=O5(l,{relative:c.relative}),f=aa(),p=H.useContext(yO),{navigator:g}=H.useContext(ia),v=g.encodeLocation?g.encodeLocation(d).pathname:d.pathname,b=f.pathname,y=p&&p.navigation&&p.navigation.location?p.navigation.location.pathname:null;o||(b=b.toLowerCase(),y=y?y.toLowerCase():null,v=v.toLowerCase());let h=b===v||!a&&b.startsWith(v)&&b.charAt(v.length)==="/",_=y!=null&&(y===v||!a&&y.startsWith(v)&&y.charAt(v.length)==="/"),x=h?r:void 0,w;typeof i=="function"?w=i({isActive:h,isPending:_}):w=[i,h?"active":null,_?"pending":null].filter(Boolean).join(" ");let S=typeof s=="function"?s({isActive:h,isPending:_}):s;return H.createElement(wO,Af({},c,{"aria-current":x,className:w,ref:n,style:S,to:l}),typeof u=="function"?u({isActive:h,isPending:_}):u)});var w2;(function(e){e.UseScrollRestoration="useScrollRestoration",e.UseSubmit="useSubmit",e.UseSubmitFetcher="useSubmitFetcher",e.UseFetcher="useFetcher"})(w2||(w2={}));var S2;(function(e){e.UseFetchers="useFetchers",e.UseScrollRestoration="useScrollRestoration"})(S2||(S2={}));function oD(e,t){let{target:n,replace:r,state:o,preventScrollReset:i,relative:a}=t===void 0?{}:t,s=lh(),l=aa(),u=O5(e,{relative:a});return H.useCallback(c=>{if(XL(c,n)){c.preventDefault();let d=r!==void 0?r:Sf(l)===Sf(u);s(e,{replace:d,state:o,preventScrollReset:i,relative:a})}},[l,s,u,r,o,n,e,i,a])}function iD(e){const t=new Error(e);if(t.stack===void 0)try{throw t}catch{}return t}var aD=iD,Ee=aD;function sD(e){return!!e&&typeof e.then=="function"}var He=sD;function lD(e,t){if(e!=null)return e;throw Ee(t??"Got unexpected null or undefined")}var Qe=lD;function we(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}class uh{getValue(){throw Ee("BaseLoadable")}toPromise(){throw Ee("BaseLoadable")}valueMaybe(){throw Ee("BaseLoadable")}valueOrThrow(){throw Ee(`Loadable expected value, but in "${this.state}" state`)}promiseMaybe(){throw Ee("BaseLoadable")}promiseOrThrow(){throw Ee(`Loadable expected promise, but in "${this.state}" state`)}errorMaybe(){throw Ee("BaseLoadable")}errorOrThrow(){throw Ee(`Loadable expected error, but in "${this.state}" state`)}is(t){return t.state===this.state&&t.contents===this.contents}map(t){throw Ee("BaseLoadable")}}class uD extends uh{constructor(t){super(),we(this,"state","hasValue"),we(this,"contents",void 0),this.contents=t}getValue(){return this.contents}toPromise(){return Promise.resolve(this.contents)}valueMaybe(){return this.contents}valueOrThrow(){return this.contents}promiseMaybe(){}errorMaybe(){}map(t){try{const n=t(this.contents);return He(n)?Qi(n):vs(n)?n:ec(n)}catch(n){return He(n)?Qi(n.next(()=>this.map(t))):ch(n)}}}class cD extends uh{constructor(t){super(),we(this,"state","hasError"),we(this,"contents",void 0),this.contents=t}getValue(){throw this.contents}toPromise(){return Promise.reject(this.contents)}valueMaybe(){}promiseMaybe(){}errorMaybe(){return this.contents}errorOrThrow(){return this.contents}map(t){return this}}class SO extends uh{constructor(t){super(),we(this,"state","loading"),we(this,"contents",void 0),this.contents=t}getValue(){throw this.contents}toPromise(){return this.contents}valueMaybe(){}promiseMaybe(){return this.contents}promiseOrThrow(){return this.contents}errorMaybe(){}map(t){return Qi(this.contents.then(n=>{const r=t(n);if(vs(r)){const o=r;switch(o.state){case"hasValue":return o.contents;case"hasError":throw o.contents;case"loading":return o.contents}}return r}).catch(n=>{if(He(n))return n.then(()=>this.map(t).contents);throw n}))}}function ec(e){return Object.freeze(new uD(e))}function ch(e){return Object.freeze(new cD(e))}function Qi(e){return Object.freeze(new SO(e))}function EO(){return Object.freeze(new SO(new Promise(()=>{})))}function dD(e){return e.every(t=>t.state==="hasValue")?ec(e.map(t=>t.contents)):e.some(t=>t.state==="hasError")?ch(Qe(e.find(t=>t.state==="hasError"),"Invalid loadable passed to loadableAll").contents):Qi(Promise.all(e.map(t=>t.contents)))}function AO(e){const n=(Array.isArray(e)?e:Object.getOwnPropertyNames(e).map(o=>e[o])).map(o=>vs(o)?o:He(o)?Qi(o):ec(o)),r=dD(n);return Array.isArray(e)?r:r.map(o=>Object.getOwnPropertyNames(e).reduce((i,a,s)=>({...i,[a]:o[s]}),{}))}function vs(e){return e instanceof uh}const fD={of:e=>He(e)?Qi(e):vs(e)?e:ec(e),error:e=>ch(e),loading:()=>EO(),all:AO,isLoadable:vs};var sa={loadableWithValue:ec,loadableWithError:ch,loadableWithPromise:Qi,loadableLoading:EO,loadableAll:AO,isLoadable:vs,RecoilLoadable:fD},pD=sa.loadableWithValue,hD=sa.loadableWithError,gD=sa.loadableWithPromise,mD=sa.loadableLoading,yD=sa.loadableAll,vD=sa.isLoadable,_D=sa.RecoilLoadable,tc=Object.freeze({__proto__:null,loadableWithValue:pD,loadableWithError:hD,loadableWithPromise:gD,loadableLoading:mD,loadableAll:yD,isLoadable:vD,RecoilLoadable:_D});const k0={RECOIL_DUPLICATE_ATOM_KEY_CHECKING_ENABLED:!0,RECOIL_GKS_ENABLED:new Set(["recoil_hamt_2020","recoil_sync_external_store","recoil_suppress_rerender_in_callback","recoil_memory_managament_2020"])};function bD(e,t){var n,r;const o=(n=process.env[e])===null||n===void 0||(r=n.toLowerCase())===null||r===void 0?void 0:r.trim();if(o==null||o==="")return;if(!["true","false"].includes(o))throw Ee(`({}).${e} value must be 'true', 'false', or empty: ${o}`);t(o==="true")}function xD(e,t){var n;const r=(n=process.env[e])===null||n===void 0?void 0:n.trim();r==null||r===""||t(r.split(/\s*,\s*|\s+/))}function wD(){var e;typeof process>"u"||((e=process)===null||e===void 0?void 0:e.env)!=null&&(bD("RECOIL_DUPLICATE_ATOM_KEY_CHECKING_ENABLED",t=>{k0.RECOIL_DUPLICATE_ATOM_KEY_CHECKING_ENABLED=t}),xD("RECOIL_GKS_ENABLED",t=>{t.forEach(n=>{k0.RECOIL_GKS_ENABLED.add(n)})}))}wD();var Fs=k0;function dh(e){return Fs.RECOIL_GKS_ENABLED.has(e)}dh.setPass=e=>{Fs.RECOIL_GKS_ENABLED.add(e)};dh.setFail=e=>{Fs.RECOIL_GKS_ENABLED.delete(e)};dh.clear=()=>{Fs.RECOIL_GKS_ENABLED.clear()};var Ie=dh;function SD(e,t,{error:n}={}){return null}var ED=SD,R5=ED,Wg,Gg,Kg;const AD=(Wg=E.createMutableSource)!==null&&Wg!==void 0?Wg:E.unstable_createMutableSource,CO=(Gg=E.useMutableSource)!==null&&Gg!==void 0?Gg:E.unstable_useMutableSource,OO=(Kg=E.useSyncExternalStore)!==null&&Kg!==void 0?Kg:E.unstable_useSyncExternalStore;function CD(){var e;const{ReactCurrentDispatcher:t,ReactCurrentOwner:n}=E.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED;return((e=t==null?void 0:t.current)!==null&&e!==void 0?e:n.currentDispatcher).useSyncExternalStore!=null}function OD(){return Ie("recoil_transition_support")?{mode:"TRANSITION_SUPPORT",early:!0,concurrent:!0}:Ie("recoil_sync_external_store")&&OO!=null?{mode:"SYNC_EXTERNAL_STORE",early:!0,concurrent:!1}:Ie("recoil_mutable_source")&&CO!=null&&typeof window<"u"&&!window.$disableRecoilValueMutableSource_TEMP_HACK_DO_NOT_USE?Ie("recoil_suppress_rerender_in_callback")?{mode:"MUTABLE_SOURCE",early:!0,concurrent:!0}:{mode:"MUTABLE_SOURCE",early:!1,concurrent:!1}:Ie("recoil_suppress_rerender_in_callback")?{mode:"LEGACY",early:!0,concurrent:!1}:{mode:"LEGACY",early:!1,concurrent:!1}}function RD(){return!1}var nc={createMutableSource:AD,useMutableSource:CO,useSyncExternalStore:OO,currentRendererSupportsUseSyncExternalStore:CD,reactMode:OD,isFastRefreshEnabled:RD};class k5{constructor(t){we(this,"key",void 0),this.key=t}toJSON(){return{key:this.key}}}class RO extends k5{}class kO extends k5{}function kD(e){return e instanceof RO||e instanceof kO}var fh={AbstractRecoilValue:k5,RecoilState:RO,RecoilValueReadOnly:kO,isRecoilValue:kD},TD=fh.AbstractRecoilValue,$D=fh.RecoilState,PD=fh.RecoilValueReadOnly,MD=fh.isRecoilValue,_s=Object.freeze({__proto__:null,AbstractRecoilValue:TD,RecoilState:$D,RecoilValueReadOnly:PD,isRecoilValue:MD});function ND(e,t){return function*(){let n=0;for(const r of e)yield t(r,n++)}()}var ph=ND;class TO{}const LD=new TO,Xi=new Map,T5=new Map;function DD(e){return ph(e,t=>Qe(T5.get(t)))}function ID(e){if(Xi.has(e)){const t=`Duplicate atom key "${e}". This is a FATAL ERROR in + production. But it is safe to ignore this warning if it occurred because of + hot module replacement.`;console.warn(t)}}function jD(e){Fs.RECOIL_DUPLICATE_ATOM_KEY_CHECKING_ENABLED&&ID(e.key),Xi.set(e.key,e);const t=e.set==null?new _s.RecoilValueReadOnly(e.key):new _s.RecoilState(e.key);return T5.set(e.key,t),t}class $O extends Error{}function FD(e){const t=Xi.get(e);if(t==null)throw new $O(`Missing definition for RecoilValue: "${e}""`);return t}function UD(e){return Xi.get(e)}const Cf=new Map;function VD(e){var t;if(!Ie("recoil_memory_managament_2020"))return;const n=Xi.get(e);if(n!=null&&(t=n.shouldDeleteConfigOnRelease)!==null&&t!==void 0&&t.call(n)){var r;Xi.delete(e),(r=PO(e))===null||r===void 0||r(),Cf.delete(e)}}function zD(e,t){Ie("recoil_memory_managament_2020")&&(t===void 0?Cf.delete(e):Cf.set(e,t))}function PO(e){return Cf.get(e)}var cn={nodes:Xi,recoilValues:T5,registerNode:jD,getNode:FD,getNodeMaybe:UD,deleteNodeConfigIfPossible:VD,setConfigDeletionHandler:zD,getConfigDeletionHandler:PO,recoilValuesForKeys:DD,NodeMissingError:$O,DefaultValue:TO,DEFAULT_VALUE:LD};function BD(e,t){t()}var HD={enqueueExecution:BD};function qD(e,t){return t={exports:{}},e(t,t.exports),t.exports}var WD=qD(function(e){var t=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(F){return typeof F}:function(F){return F&&typeof Symbol=="function"&&F.constructor===Symbol&&F!==Symbol.prototype?"symbol":typeof F},n={},r=5,o=Math.pow(2,r),i=o-1,a=o/2,s=o/4,l={},u=function(D){return function(){return D}},c=n.hash=function(F){var D=typeof F>"u"?"undefined":t(F);if(D==="number")return F;D!=="string"&&(F+="");for(var Q=0,ne=0,re=F.length;ne>1&1431655765,D=(D&858993459)+(D>>2&858993459),D=D+(D>>4)&252645135,D+=D>>8,D+=D>>16,D&127},f=function(D,Q){return Q>>>D&i},p=function(D){return 1<=Q;)re[ve--]=re[ve];return re[Q]=ne,re}for(var me=0,ye=0,Ae=new Array(de+1);me>>=1;return ve[Q]=ne,k(D,ye+1,ve)},j=function(D,Q,ne,re){for(var de=new Array(Q-1),ve=0,me=0,ye=0,Ae=re.length;ye1?R(D,this.hash,Ae):Ae[0]}var Ge=re();return Ge===l?this:(++me.value,L(D,ne,this.hash,this,de,C(D,de,ve,Ge)))},Y=function(D,Q,ne,re,de,ve,me){var ye=this.mask,Ae=this.children,Ge=f(ne,de),Kt=p(Ge),bt=g(ye,Kt),En=ye&Kt,Gn=En?Ae[bt]:S,ma=Gn._modify(D,Q,ne+r,re,de,ve,me);if(Gn===ma)return this;var kc=W(D,this),il=ye,al=void 0;if(En&&A(ma)){if(il&=~Kt,!il)return S;if(Ae.length<=2&&T(Ae[bt^1]))return Ae[bt^1];al=b(kc,bt,Ae)}else if(!En&&!A(ma)){if(Ae.length>=a)return $(D,Ge,ma,ye,Ae);il|=Kt,al=y(kc,bt,ma,Ae)}else al=v(kc,bt,ma,Ae);return kc?(this.mask=il,this.children=al,this):O(D,il,al)},oe=function(D,Q,ne,re,de,ve,me){var ye=this.size,Ae=this.children,Ge=f(ne,de),Kt=Ae[Ge],bt=(Kt||S)._modify(D,Q,ne+r,re,de,ve,me);if(Kt===bt)return this;var En=W(D,this),Gn=void 0;if(A(Kt)&&!A(bt))++ye,Gn=v(En,Ge,bt,Ae);else if(!A(Kt)&&A(bt)){if(--ye,ye<=s)return j(D,ye,Ge,Ae);Gn=v(En,Ge,S,Ae)}else Gn=v(En,Ge,bt,Ae);return En?(this.size=ye,this.children=Gn,this):k(D,ye,Gn)};S._modify=function(F,D,Q,ne,re,de,ve){var me=ne();return me===l?S:(++ve.value,C(F,re,de,me))};function M(F,D,Q,ne,re){this._editable=F,this._edit=D,this._config=Q,this._root=ne,this._size=re}M.prototype.setTree=function(F,D){return this._editable?(this._root=F,this._size=D,this):F===this._root?this:new M(this._editable,this._edit,this._config,F,D)};var U=n.tryGetHash=function(F,D,Q,ne){for(var re=ne._root,de=0,ve=ne._config.keyEq;;)switch(re.type){case h:return ve(Q,re.key)?re.value:F;case _:{if(D===re.hash)for(var me=re.children,ye=0,Ae=me.length;ye{n.set(o,t(r,o))}),n}var Of=ZD;function JD(){return{nodeDeps:new Map,nodeToNodeSubscriptions:new Map}}function eI(e){return{nodeDeps:Of(e.nodeDeps,t=>new Set(t)),nodeToNodeSubscriptions:Of(e.nodeToNodeSubscriptions,t=>new Set(t))}}function Yg(e,t,n,r){const{nodeDeps:o,nodeToNodeSubscriptions:i}=n,a=o.get(e);if(a&&r&&a!==r.nodeDeps.get(e))return;o.set(e,t);const s=a==null?t:Jl(t,a);for(const l of s)i.has(l)||i.set(l,new Set),Qe(i.get(l)).add(e);if(a){const l=Jl(a,t);for(const u of l){if(!i.has(u))return;const c=Qe(i.get(u));c.delete(e),c.size===0&&i.delete(u)}}}function tI(e,t,n,r){var o,i,a,s;const l=n.getState();r===l.currentTree.version||r===((o=l.nextTree)===null||o===void 0?void 0:o.version)||((i=l.previousTree)===null||i===void 0||i.version);const u=n.getGraph(r);if(Yg(e,t,u),r===((a=l.previousTree)===null||a===void 0?void 0:a.version)){const d=n.getGraph(l.currentTree.version);Yg(e,t,d,u)}if(r===((s=l.previousTree)===null||s===void 0?void 0:s.version)||r===l.currentTree.version){var c;const d=(c=l.nextTree)===null||c===void 0?void 0:c.version;if(d!==void 0){const f=n.getGraph(d);Yg(e,t,f,u)}}}var rc={cloneGraph:eI,graph:JD,saveDepsToStore:tI};let nI=0;const rI=()=>nI++;let oI=0;const iI=()=>oI++;let aI=0;const sI=()=>aI++;var hh={getNextTreeStateVersion:rI,getNextStoreID:iI,getNextComponentID:sI};const{persistentMap:E2}=QD,{graph:lI}=rc,{getNextTreeStateVersion:MO}=hh;function NO(){const e=MO();return{version:e,stateID:e,transactionMetadata:{},dirtyAtoms:new Set,atomValues:E2(),nonvalidatedAtoms:E2()}}function uI(){const e=NO();return{currentTree:e,nextTree:null,previousTree:null,commitDepth:0,knownAtoms:new Set,knownSelectors:new Set,transactionSubscriptions:new Map,nodeTransactionSubscriptions:new Map,nodeToComponentSubscriptions:new Map,queuedComponentCallbacks_DEPRECATED:[],suspendedComponentResolvers:new Set,graphsByVersion:new Map().set(e.version,lI()),retention:{referenceCounts:new Map,nodesRetainedByZone:new Map,retainablesToCheckForRelease:new Set},nodeCleanupFunctions:new Map}}var LO={makeEmptyTreeState:NO,makeEmptyStoreState:uI,getNextTreeStateVersion:MO};class DO{}function cI(){return new DO}var gh={RetentionZone:DO,retentionZone:cI};function dI(e,t){const n=new Set(e);return n.add(t),n}function fI(e,t){const n=new Set(e);return n.delete(t),n}function pI(e,t,n){const r=new Map(e);return r.set(t,n),r}function hI(e,t,n){const r=new Map(e);return r.set(t,n(r.get(t))),r}function gI(e,t){const n=new Map(e);return n.delete(t),n}function mI(e,t){const n=new Map(e);return t.forEach(r=>n.delete(r)),n}var IO={setByAddingToSet:dI,setByDeletingFromSet:fI,mapBySettingInMap:pI,mapByUpdatingInMap:hI,mapByDeletingFromMap:gI,mapByDeletingMultipleFromMap:mI};function*yI(e,t){let n=0;for(const r of e)t(r,n++)&&(yield r)}var M5=yI;function vI(e,t){return new Proxy(e,{get:(r,o)=>(!(o in r)&&o in t&&(r[o]=t[o]()),r[o]),ownKeys:r=>Object.keys(r)})}var jO=vI;const{getNode:oc,getNodeMaybe:_I,recoilValuesForKeys:A2}=cn,{RetentionZone:C2}=gh,{setByAddingToSet:bI}=IO,xI=Object.freeze(new Set);class wI extends Error{}function SI(e,t,n){if(!Ie("recoil_memory_managament_2020"))return()=>{};const{nodesRetainedByZone:r}=e.getState().retention;function o(i){let a=r.get(i);a||r.set(i,a=new Set),a.add(t)}if(n instanceof C2)o(n);else if(Array.isArray(n))for(const i of n)o(i);return()=>{if(!Ie("recoil_memory_managament_2020"))return;const{retention:i}=e.getState();function a(s){const l=i.nodesRetainedByZone.get(s);l==null||l.delete(t),l&&l.size===0&&i.nodesRetainedByZone.delete(s)}if(n instanceof C2)a(n);else if(Array.isArray(n))for(const s of n)a(s)}}function N5(e,t,n,r){const o=e.getState();if(o.nodeCleanupFunctions.has(n))return;const i=oc(n),a=SI(e,n,i.retainedBy),s=i.init(e,t,r);o.nodeCleanupFunctions.set(n,()=>{s(),a()})}function EI(e,t,n){N5(e,e.getState().currentTree,t,n)}function AI(e,t){var n;const r=e.getState();(n=r.nodeCleanupFunctions.get(t))===null||n===void 0||n(),r.nodeCleanupFunctions.delete(t)}function CI(e,t,n){return N5(e,t,n,"get"),oc(n).get(e,t)}function FO(e,t,n){return oc(n).peek(e,t)}function OI(e,t,n){var r;const o=_I(t);return o==null||(r=o.invalidate)===null||r===void 0||r.call(o,e),{...e,atomValues:e.atomValues.clone().delete(t),nonvalidatedAtoms:e.nonvalidatedAtoms.clone().set(t,n),dirtyAtoms:bI(e.dirtyAtoms,t)}}function RI(e,t,n,r){const o=oc(n);if(o.set==null)throw new wI(`Attempt to set read-only RecoilValue: ${n}`);const i=o.set;return N5(e,t,n,"set"),i(e,t,r)}function kI(e,t,n){const r=e.getState(),o=e.getGraph(t.version),i=oc(n).nodeType;return jO({type:i},{loadable:()=>FO(e,t,n),isActive:()=>r.knownAtoms.has(n)||r.knownSelectors.has(n),isSet:()=>i==="selector"?!1:t.atomValues.has(n),isModified:()=>t.dirtyAtoms.has(n),deps:()=>{var a;return A2((a=o.nodeDeps.get(n))!==null&&a!==void 0?a:[])},subscribers:()=>{var a,s;return{nodes:A2(M5(UO(e,t,new Set([n])),l=>l!==n)),components:ph((a=(s=r.nodeToComponentSubscriptions.get(n))===null||s===void 0?void 0:s.values())!==null&&a!==void 0?a:[],([l])=>({name:l}))}}})}function UO(e,t,n){const r=new Set,o=Array.from(n),i=e.getGraph(t.version);for(let s=o.pop();s;s=o.pop()){var a;r.add(s);const l=(a=i.nodeToNodeSubscriptions.get(s))!==null&&a!==void 0?a:xI;for(const u of l)r.has(u)||o.push(u)}return r}var li={getNodeLoadable:CI,peekNodeLoadable:FO,setNodeValue:RI,initializeNode:EI,cleanUpNode:AI,setUnvalidatedAtomValue_DEPRECATED:OI,peekNodeInfo:kI,getDownstreamNodes:UO};let VO=null;function TI(e){VO=e}function $I(){var e;(e=VO)===null||e===void 0||e()}var zO={setInvalidateMemoizedSnapshot:TI,invalidateMemoizedSnapshot:$I};const{getDownstreamNodes:PI,getNodeLoadable:BO,setNodeValue:MI}=li,{getNextComponentID:NI}=hh,{getNode:LI,getNodeMaybe:HO}=cn,{DefaultValue:L5}=cn,{reactMode:DI}=nc,{AbstractRecoilValue:II,RecoilState:jI,RecoilValueReadOnly:FI,isRecoilValue:UI}=_s,{invalidateMemoizedSnapshot:VI}=zO;function zI(e,{key:t},n=e.getState().currentTree){var r,o;const i=e.getState();n.version===i.currentTree.version||n.version===((r=i.nextTree)===null||r===void 0?void 0:r.version)||(n.version,(o=i.previousTree)===null||o===void 0||o.version);const a=BO(e,n,t);return a.state==="loading"&&a.contents.catch(()=>{}),a}function BI(e,t){const n=e.clone();return t.forEach((r,o)=>{r.state==="hasValue"&&r.contents instanceof L5?n.delete(o):n.set(o,r)}),n}function HI(e,t,{key:n},r){if(typeof r=="function"){const o=BO(e,t,n);if(o.state==="loading"){const i=`Tried to set atom or selector "${n}" using an updater function while the current state is pending, this is not currently supported.`;throw Ee(i)}else if(o.state==="hasError")throw o.contents;return r(o.contents)}else return r}function qI(e,t,n){if(n.type==="set"){const{recoilValue:o,valueOrUpdater:i}=n,a=HI(e,t,o,i),s=MI(e,t,o.key,a);for(const[l,u]of s.entries())T0(t,l,u)}else if(n.type==="setLoadable"){const{recoilValue:{key:o},loadable:i}=n;T0(t,o,i)}else if(n.type==="markModified"){const{recoilValue:{key:o}}=n;t.dirtyAtoms.add(o)}else if(n.type==="setUnvalidated"){var r;const{recoilValue:{key:o},unvalidatedValue:i}=n,a=HO(o);a==null||(r=a.invalidate)===null||r===void 0||r.call(a,t),t.atomValues.delete(o),t.nonvalidatedAtoms.set(o,i),t.dirtyAtoms.add(o)}else R5(`Unknown action ${n.type}`)}function T0(e,t,n){n.state==="hasValue"&&n.contents instanceof L5?e.atomValues.delete(t):e.atomValues.set(t,n),e.dirtyAtoms.add(t),e.nonvalidatedAtoms.delete(t)}function qO(e,t){e.replaceState(n=>{const r=WO(n);for(const o of t)qI(e,r,o);return GO(e,r),VI(),r})}function mh(e,t){if(eu.length){const n=eu[eu.length-1];let r=n.get(e);r||n.set(e,r=[]),r.push(t)}else qO(e,[t])}const eu=[];function WI(){const e=new Map;return eu.push(e),()=>{for(const[t,n]of e)qO(t,n);eu.pop()}}function WO(e){return{...e,atomValues:e.atomValues.clone(),nonvalidatedAtoms:e.nonvalidatedAtoms.clone(),dirtyAtoms:new Set(e.dirtyAtoms)}}function GO(e,t){const n=PI(e,t,t.dirtyAtoms);for(const i of n){var r,o;(r=HO(i))===null||r===void 0||(o=r.invalidate)===null||o===void 0||o.call(r,t)}}function KO(e,t,n){mh(e,{type:"set",recoilValue:t,valueOrUpdater:n})}function GI(e,t,n){if(n instanceof L5)return KO(e,t,n);mh(e,{type:"setLoadable",recoilValue:t,loadable:n})}function KI(e,t){mh(e,{type:"markModified",recoilValue:t})}function YI(e,t,n){mh(e,{type:"setUnvalidated",recoilValue:t,unvalidatedValue:n})}function QI(e,{key:t},n,r=null){const o=NI(),i=e.getState();i.nodeToComponentSubscriptions.has(t)||i.nodeToComponentSubscriptions.set(t,new Map),Qe(i.nodeToComponentSubscriptions.get(t)).set(o,[r??"",n]);const a=DI();if(a.early&&(a.mode==="LEGACY"||a.mode==="MUTABLE_SOURCE")){const s=e.getState().nextTree;s&&s.dirtyAtoms.has(t)&&n(s)}return{release:()=>{const s=e.getState(),l=s.nodeToComponentSubscriptions.get(t);l===void 0||!l.has(o)||(l.delete(o),l.size===0&&s.nodeToComponentSubscriptions.delete(t))}}}function XI(e,t){var n;const{currentTree:r}=e.getState(),o=LI(t.key);(n=o.clearCache)===null||n===void 0||n.call(o,e,r)}var Mr={RecoilValueReadOnly:FI,AbstractRecoilValue:II,RecoilState:jI,getRecoilValueAsLoadable:zI,setRecoilValue:KO,setRecoilValueLoadable:GI,markRecoilValueModified:KI,setUnvalidatedRecoilValue:YI,subscribeToRecoilValue:QI,isRecoilValue:UI,applyAtomValueWrites:BI,batchStart:WI,writeLoadableToTreeState:T0,invalidateDownstreams:GO,copyTreeState:WO,refreshRecoilValue:XI};function ZI(e,t,n){const r=e.entries();let o=r.next();for(;!o.done;){const i=o.value;if(t.call(n,i[1],i[0],e))return!0;o=r.next()}return!1}var JI=ZI;const{cleanUpNode:ej}=li,{deleteNodeConfigIfPossible:tj,getNode:YO}=cn,{RetentionZone:QO}=gh,nj=12e4,XO=new Set;function ZO(e,t){const n=e.getState(),r=n.currentTree;if(n.nextTree)return;const o=new Set;for(const a of t)if(a instanceof QO)for(const s of aj(n,a))o.add(s);else o.add(a);const i=rj(e,o);for(const a of i)ij(e,r,a)}function rj(e,t){const n=e.getState(),r=n.currentTree,o=e.getGraph(r.version),i=new Set,a=new Set;return s(t),i;function s(l){const u=new Set,c=oj(e,r,l,i,a);for(const g of c){var d;if(YO(g).retainedBy==="recoilRoot"){a.add(g);continue}if(((d=n.retention.referenceCounts.get(g))!==null&&d!==void 0?d:0)>0){a.add(g);continue}if(JO(g).some(b=>n.retention.referenceCounts.get(b))){a.add(g);continue}const v=o.nodeToNodeSubscriptions.get(g);if(v&&JI(v,b=>a.has(b))){a.add(g);continue}i.add(g),u.add(g)}const f=new Set;for(const g of u)for(const v of(p=o.nodeDeps.get(g))!==null&&p!==void 0?p:XO){var p;i.has(v)||f.add(v)}f.size&&s(f)}}function oj(e,t,n,r,o){const i=e.getGraph(t.version),a=[],s=new Set;for(;n.size>0;)l(Qe(n.values().next().value));return a;function l(u){if(r.has(u)||o.has(u)){n.delete(u);return}if(s.has(u))return;const c=i.nodeToNodeSubscriptions.get(u);if(c)for(const d of c)l(d);s.add(u),n.delete(u),a.push(u)}}function ij(e,t,n){if(!Ie("recoil_memory_managament_2020"))return;ej(e,n);const r=e.getState();r.knownAtoms.delete(n),r.knownSelectors.delete(n),r.nodeTransactionSubscriptions.delete(n),r.retention.referenceCounts.delete(n);const o=JO(n);for(const l of o){var i;(i=r.retention.nodesRetainedByZone.get(l))===null||i===void 0||i.delete(n)}t.atomValues.delete(n),t.dirtyAtoms.delete(n),t.nonvalidatedAtoms.delete(n);const a=r.graphsByVersion.get(t.version);if(a){const l=a.nodeDeps.get(n);if(l!==void 0){a.nodeDeps.delete(n);for(const u of l){var s;(s=a.nodeToNodeSubscriptions.get(u))===null||s===void 0||s.delete(n)}}a.nodeToNodeSubscriptions.delete(n)}tj(n)}function aj(e,t){var n;return(n=e.retention.nodesRetainedByZone.get(t))!==null&&n!==void 0?n:XO}function JO(e){const t=YO(e).retainedBy;return t===void 0||t==="components"||t==="recoilRoot"?[]:t instanceof QO?[t]:t}function sj(e,t){const n=e.getState();n.nextTree?n.retention.retainablesToCheckForRelease.add(t):ZO(e,new Set([t]))}function lj(e,t,n){var r;if(!Ie("recoil_memory_managament_2020"))return;const o=e.getState().retention.referenceCounts,i=((r=o.get(t))!==null&&r!==void 0?r:0)+n;i===0?e3(e,t):o.set(t,i)}function e3(e,t){if(!Ie("recoil_memory_managament_2020"))return;e.getState().retention.referenceCounts.delete(t),sj(e,t)}function uj(e){if(!Ie("recoil_memory_managament_2020"))return;const t=e.getState();ZO(e,t.retention.retainablesToCheckForRelease),t.retention.retainablesToCheckForRelease.clear()}function cj(e){return e===void 0?"recoilRoot":e}var la={SUSPENSE_TIMEOUT_MS:nj,updateRetainCount:lj,updateRetainCountToZero:e3,releaseScheduledRetainablesNow:uj,retainedByOptionWithDefault:cj};const{unstable_batchedUpdates:dj}=tN;var fj={unstable_batchedUpdates:dj};const{unstable_batchedUpdates:pj}=fj;var hj={unstable_batchedUpdates:pj};const{batchStart:gj}=Mr,{unstable_batchedUpdates:mj}=hj;let D5=mj||(e=>e());const yj=e=>{D5=e},vj=()=>D5,_j=e=>{D5(()=>{let t=()=>{};try{t=gj(),e()}finally{t()}})};var yh={getBatcher:vj,setBatcher:yj,batchUpdates:_j};function*bj(e){for(const t of e)for(const n of t)yield n}var t3=bj;const n3=typeof Window>"u"||typeof window>"u",xj=e=>!n3&&(e===window||e instanceof Window),wj=typeof navigator<"u"&&navigator.product==="ReactNative";var vh={isSSR:n3,isReactNative:wj,isWindow:xj};function Sj(e,t){let n;return(...r)=>{n||(n={});const o=t(...r);return Object.hasOwnProperty.call(n,o)||(n[o]=e(...r)),n[o]}}function Ej(e,t){let n,r;return(...o)=>{const i=t(...o);return n===i||(n=i,r=e(...o)),r}}function Aj(e,t){let n,r;return[(...a)=>{const s=t(...a);return n===s||(n=s,r=e(...a)),r},()=>{n=null}]}var Cj={memoizeWithArgsHash:Sj,memoizeOneWithArgsHash:Ej,memoizeOneWithArgsHashAndInvalidation:Aj};const{batchUpdates:$0}=yh,{initializeNode:Oj,peekNodeInfo:Rj}=li,{graph:kj}=rc,{getNextStoreID:Tj}=hh,{DEFAULT_VALUE:$j,recoilValues:O2,recoilValuesForKeys:R2}=cn,{AbstractRecoilValue:Pj,getRecoilValueAsLoadable:Mj,setRecoilValue:k2,setUnvalidatedRecoilValue:Nj}=Mr,{updateRetainCount:kd}=la,{setInvalidateMemoizedSnapshot:Lj}=zO,{getNextTreeStateVersion:Dj,makeEmptyStoreState:Ij}=LO,{isSSR:jj}=vh,{memoizeOneWithArgsHashAndInvalidation:Fj}=Cj;class _h{constructor(t,n){we(this,"_store",void 0),we(this,"_refCount",1),we(this,"getLoadable",r=>(this.checkRefCount_INTERNAL(),Mj(this._store,r))),we(this,"getPromise",r=>(this.checkRefCount_INTERNAL(),this.getLoadable(r).toPromise())),we(this,"getNodes_UNSTABLE",r=>{if(this.checkRefCount_INTERNAL(),(r==null?void 0:r.isModified)===!0){if((r==null?void 0:r.isInitialized)===!1)return[];const a=this._store.getState().currentTree;return R2(a.dirtyAtoms)}const o=this._store.getState().knownAtoms,i=this._store.getState().knownSelectors;return(r==null?void 0:r.isInitialized)==null?O2.values():r.isInitialized===!0?R2(t3([o,i])):M5(O2.values(),({key:a})=>!o.has(a)&&!i.has(a))}),we(this,"getInfo_UNSTABLE",({key:r})=>(this.checkRefCount_INTERNAL(),Rj(this._store,this._store.getState().currentTree,r))),we(this,"map",r=>{this.checkRefCount_INTERNAL();const o=new P0(this,$0);return r(o),o}),we(this,"asyncMap",async r=>{this.checkRefCount_INTERNAL();const o=new P0(this,$0);return o.retain(),await r(o),o.autoRelease_INTERNAL(),o}),this._store={storeID:Tj(),parentStoreID:n,getState:()=>t,replaceState:r=>{t.currentTree=r(t.currentTree)},getGraph:r=>{const o=t.graphsByVersion;if(o.has(r))return Qe(o.get(r));const i=kj();return o.set(r,i),i},subscribeToTransactions:()=>({release:()=>{}}),addTransactionMetadata:()=>{throw Ee("Cannot subscribe to Snapshots")}};for(const r of this._store.getState().knownAtoms)Oj(this._store,r,"get"),kd(this._store,r,1);this.autoRelease_INTERNAL()}retain(){this._refCount<=0,this._refCount++;let t=!1;return()=>{t||(t=!0,this._release())}}autoRelease_INTERNAL(){jj||window.setTimeout(()=>this._release(),10)}_release(){if(this._refCount--,this._refCount===0){if(this._store.getState().nodeCleanupFunctions.forEach(t=>t()),this._store.getState().nodeCleanupFunctions.clear(),!Ie("recoil_memory_managament_2020"))return}else this._refCount<0}isRetained(){return this._refCount>0}checkRefCount_INTERNAL(){Ie("recoil_memory_managament_2020")&&this._refCount<=0}getStore_INTERNAL(){return this.checkRefCount_INTERNAL(),this._store}getID(){return this.checkRefCount_INTERNAL(),this._store.getState().currentTree.stateID}getStoreID(){return this.checkRefCount_INTERNAL(),this._store.storeID}}function r3(e,t,n=!1){const r=e.getState(),o=n?Dj():t.version;return{currentTree:{version:n?o:t.version,stateID:n?o:t.stateID,transactionMetadata:{...t.transactionMetadata},dirtyAtoms:new Set(t.dirtyAtoms),atomValues:t.atomValues.clone(),nonvalidatedAtoms:t.nonvalidatedAtoms.clone()},commitDepth:0,nextTree:null,previousTree:null,knownAtoms:new Set(r.knownAtoms),knownSelectors:new Set(r.knownSelectors),transactionSubscriptions:new Map,nodeTransactionSubscriptions:new Map,nodeToComponentSubscriptions:new Map,queuedComponentCallbacks_DEPRECATED:[],suspendedComponentResolvers:new Set,graphsByVersion:new Map().set(o,e.getGraph(t.version)),retention:{referenceCounts:new Map,nodesRetainedByZone:new Map,retainablesToCheckForRelease:new Set},nodeCleanupFunctions:new Map(ph(r.nodeCleanupFunctions.entries(),([i])=>[i,()=>{}]))}}function Uj(e){const t=new _h(Ij());return e!=null?t.map(e):t}const[T2,o3]=Fj((e,t)=>{var n;const r=e.getState(),o=t==="latest"?(n=r.nextTree)!==null&&n!==void 0?n:r.currentTree:Qe(r.previousTree);return new _h(r3(e,o),e.storeID)},(e,t)=>{var n,r;return String(t)+String(e.storeID)+String((n=e.getState().nextTree)===null||n===void 0?void 0:n.version)+String(e.getState().currentTree.version)+String((r=e.getState().previousTree)===null||r===void 0?void 0:r.version)});Lj(o3);function Vj(e,t="latest"){const n=T2(e,t);return n.isRetained()?n:(o3(),T2(e,t))}class P0 extends _h{constructor(t,n){super(r3(t.getStore_INTERNAL(),t.getStore_INTERNAL().getState().currentTree,!0),t.getStoreID()),we(this,"_batch",void 0),we(this,"set",(r,o)=>{this.checkRefCount_INTERNAL();const i=this.getStore_INTERNAL();this._batch(()=>{kd(i,r.key,1),k2(this.getStore_INTERNAL(),r,o)})}),we(this,"reset",r=>{this.checkRefCount_INTERNAL();const o=this.getStore_INTERNAL();this._batch(()=>{kd(o,r.key,1),k2(this.getStore_INTERNAL(),r,$j)})}),we(this,"setUnvalidatedAtomValues_DEPRECATED",r=>{this.checkRefCount_INTERNAL();const o=this.getStore_INTERNAL();$0(()=>{for(const[i,a]of r.entries())kd(o,i,1),Nj(o,new Pj(i),a)})}),this._batch=n}}var bh={Snapshot:_h,MutableSnapshot:P0,freshSnapshot:Uj,cloneSnapshot:Vj},zj=bh.Snapshot,Bj=bh.MutableSnapshot,Hj=bh.freshSnapshot,qj=bh.cloneSnapshot,xh=Object.freeze({__proto__:null,Snapshot:zj,MutableSnapshot:Bj,freshSnapshot:Hj,cloneSnapshot:qj});function Wj(...e){const t=new Set;for(const n of e)for(const r of n)t.add(r);return t}var Gj=Wj;const{useRef:Kj}=E;function Yj(e){const t=Kj(e);return t.current===e&&typeof e=="function"&&(t.current=e()),t}var $2=Yj;const{getNextTreeStateVersion:Qj,makeEmptyStoreState:i3}=LO,{cleanUpNode:Xj,getDownstreamNodes:Zj,initializeNode:Jj,setNodeValue:e9,setUnvalidatedAtomValue_DEPRECATED:t9}=li,{graph:n9}=rc,{cloneGraph:r9}=rc,{getNextStoreID:a3}=hh,{createMutableSource:Qg,reactMode:s3}=nc,{applyAtomValueWrites:o9}=Mr,{releaseScheduledRetainablesNow:l3}=la,{freshSnapshot:i9}=xh,{useCallback:a9,useContext:u3,useEffect:M0,useMemo:s9,useRef:l9,useState:u9}=E;function gl(){throw Ee("This component must be used inside a component.")}const c3=Object.freeze({storeID:a3(),getState:gl,replaceState:gl,getGraph:gl,subscribeToTransactions:gl,addTransactionMetadata:gl});let N0=!1;function P2(e){if(N0)throw Ee("An atom update was triggered within the execution of a state updater function. State updater functions provided to Recoil must be pure functions.");const t=e.getState();if(t.nextTree===null){Ie("recoil_memory_managament_2020")&&Ie("recoil_release_on_cascading_update_killswitch_2021")&&t.commitDepth>0&&l3(e);const n=t.currentTree.version,r=Qj();t.nextTree={...t.currentTree,version:r,stateID:r,dirtyAtoms:new Set,transactionMetadata:{}},t.graphsByVersion.set(r,r9(Qe(t.graphsByVersion.get(n))))}}const d3=E.createContext({current:c3}),wh=()=>u3(d3),f3=E.createContext(null);function c9(){return u3(f3)}function I5(e,t,n){const r=Zj(e,n,n.dirtyAtoms);for(const o of r){const i=t.nodeToComponentSubscriptions.get(o);if(i)for(const[a,[s,l]]of i)l(n)}}function p3(e){const t=e.getState(),n=t.currentTree,r=n.dirtyAtoms;if(r.size){for(const[o,i]of t.nodeTransactionSubscriptions)if(r.has(o))for(const[a,s]of i)s(e);for(const[o,i]of t.transactionSubscriptions)i(e);(!s3().early||t.suspendedComponentResolvers.size>0)&&(I5(e,t,n),t.suspendedComponentResolvers.forEach(o=>o()),t.suspendedComponentResolvers.clear())}t.queuedComponentCallbacks_DEPRECATED.forEach(o=>o(n)),t.queuedComponentCallbacks_DEPRECATED.splice(0,t.queuedComponentCallbacks_DEPRECATED.length)}function d9(e){const t=e.getState();t.commitDepth++;try{const{nextTree:n}=t;if(n==null)return;t.previousTree=t.currentTree,t.currentTree=n,t.nextTree=null,p3(e),t.previousTree!=null?t.graphsByVersion.delete(t.previousTree.version):R5("Ended batch with no previous state, which is unexpected","recoil"),t.previousTree=null,Ie("recoil_memory_managament_2020")&&n==null&&l3(e)}finally{t.commitDepth--}}function f9({setNotifyBatcherOfChange:e}){const t=wh(),[,n]=u9([]);return e(()=>n({})),M0(()=>(e(()=>n({})),()=>{e(()=>{})}),[e]),M0(()=>{HD.enqueueExecution("Batcher",()=>{d9(t.current)})}),null}function p9(e,t){const n=i3();return t({set:(r,o)=>{const i=n.currentTree,a=e9(e,i,r.key,o),s=new Set(a.keys()),l=i.nonvalidatedAtoms.clone();for(const u of s)l.delete(u);n.currentTree={...i,dirtyAtoms:Gj(i.dirtyAtoms,s),atomValues:o9(i.atomValues,a),nonvalidatedAtoms:l}},setUnvalidatedAtomValues:r=>{r.forEach((o,i)=>{n.currentTree=t9(n.currentTree,i,o)})}}),n}function h9(e){const t=i9(e),n=t.getStore_INTERNAL().getState();return t.retain(),n.nodeCleanupFunctions.forEach(r=>r()),n.nodeCleanupFunctions.clear(),n}let M2=0;function g9({initializeState_DEPRECATED:e,initializeState:t,store_INTERNAL:n,children:r}){let o;const i=p=>{const g=o.current.graphsByVersion;if(g.has(p))return Qe(g.get(p));const v=n9();return g.set(p,v),v},a=(p,g)=>{if(g==null){const{transactionSubscriptions:v}=d.current.getState(),b=M2++;return v.set(b,p),{release:()=>{v.delete(b)}}}else{const{nodeTransactionSubscriptions:v}=d.current.getState();v.has(g)||v.set(g,new Map);const b=M2++;return Qe(v.get(g)).set(b,p),{release:()=>{const y=v.get(g);y&&(y.delete(b),y.size===0&&v.delete(g))}}}},s=p=>{P2(d.current);for(const g of Object.keys(p))Qe(d.current.getState().nextTree).transactionMetadata[g]=p[g]},l=p=>{P2(d.current);const g=Qe(o.current.nextTree);let v;try{N0=!0,v=p(g)}finally{N0=!1}v!==g&&(o.current.nextTree=v,s3().early&&I5(d.current,o.current,v),Qe(u.current)())},u=l9(null),c=a9(p=>{u.current=p},[u]),d=$2(()=>n??{storeID:a3(),getState:()=>o.current,replaceState:l,getGraph:i,subscribeToTransactions:a,addTransactionMetadata:s});n!=null&&(d.current=n),o=$2(()=>e!=null?p9(d.current,e):t!=null?h9(t):i3());const f=s9(()=>Qg==null?void 0:Qg(o,()=>o.current.currentTree.version),[o]);return M0(()=>{const p=d.current;for(const g of new Set(p.getState().knownAtoms))Jj(p,g,"get");return()=>{for(const g of p.getState().knownAtoms)Xj(p,g)}},[d]),E.createElement(d3.Provider,{value:d},E.createElement(f3.Provider,{value:f},E.createElement(f9,{setNotifyBatcherOfChange:c}),r))}function m9(e){const{override:t,...n}=e,r=wh();return t===!1&&r.current!==c3?e.children:E.createElement(g9,n)}function y9(){return wh().current.storeID}var fo={RecoilRoot:m9,useStoreRef:wh,useRecoilMutableSource:c9,useRecoilStoreID:y9,notifyComponents_FOR_TESTING:I5,sendEndOfBatchNotifications_FOR_TESTING:p3};function v9(e,t){if(e===t)return!0;if(e.length!==t.length)return!1;for(let n=0,r=e.length;n{t.current=e}),t.current}var h3=w9;const{useStoreRef:S9}=fo,{SUSPENSE_TIMEOUT_MS:E9}=la,{updateRetainCount:ml}=la,{RetentionZone:A9}=gh,{useEffect:C9,useRef:O9}=E,{isSSR:N2}=vh;function R9(e){if(Ie("recoil_memory_managament_2020"))return k9(e)}function k9(e){const n=(Array.isArray(e)?e:[e]).map(a=>a instanceof A9?a:a.key),r=S9();C9(()=>{if(!Ie("recoil_memory_managament_2020"))return;const a=r.current;if(o.current&&!N2)window.clearTimeout(o.current),o.current=null;else for(const s of n)ml(a,s,1);return()=>{for(const s of n)ml(a,s,-1)}},[r,...n]);const o=O9(),i=h3(n);if(!N2&&(i===void 0||!_9(i,n))){const a=r.current;for(const s of n)ml(a,s,1);if(i)for(const s of i)ml(a,s,-1);o.current&&window.clearTimeout(o.current),o.current=window.setTimeout(()=>{o.current=null;for(const s of n)ml(a,s,-1)},E9)}}var j5=R9;function T9(){return""}var ic=T9;const{batchUpdates:$9}=yh,{DEFAULT_VALUE:g3}=cn,{currentRendererSupportsUseSyncExternalStore:P9,reactMode:Us,useMutableSource:M9,useSyncExternalStore:N9}=nc,{useRecoilMutableSource:L9,useStoreRef:Nr}=fo,{AbstractRecoilValue:L0,getRecoilValueAsLoadable:ac,setRecoilValue:Rf,setUnvalidatedRecoilValue:D9,subscribeToRecoilValue:bs}=Mr,{useCallback:sn,useEffect:xs,useMemo:m3,useRef:tu,useState:F5}=E,{setByAddingToSet:I9}=IO,{isSSR:j9}=vh;function U5(e,t,n){if(e.state==="hasValue")return e.contents;throw e.state==="loading"?new Promise(o=>{const i=n.current.getState().suspendedComponentResolvers;i.add(o),j9&&He(e.contents)&&e.contents.finally(()=>{i.delete(o)})}):e.state==="hasError"?e.contents:Ee(`Invalid value of loadable atom "${t.key}"`)}function F9(){const e=ic(),t=Nr(),[,n]=F5([]),r=tu(new Set);r.current=new Set;const o=tu(new Set),i=tu(new Map),a=sn(l=>{const u=i.current.get(l);u&&(u.release(),i.current.delete(l))},[i]),s=sn((l,u)=>{i.current.has(u)&&n([])},[]);return xs(()=>{const l=t.current;Jl(r.current,o.current).forEach(u=>{if(i.current.has(u))return;const c=bs(l,new L0(u),f=>s(f,u),e);i.current.set(u,c),l.getState().nextTree?l.getState().queuedComponentCallbacks_DEPRECATED.push(()=>{s(l.getState(),u)}):s(l.getState(),u)}),Jl(o.current,r.current).forEach(u=>{a(u)}),o.current=r.current}),xs(()=>{const l=i.current;return Jl(r.current,new Set(l.keys())).forEach(u=>{const c=bs(t.current,new L0(u),d=>s(d,u),e);l.set(u,c)}),()=>l.forEach((u,c)=>a(c))},[e,t,a,s]),m3(()=>{function l(g){return v=>{Rf(t.current,g,v)}}function u(g){return()=>Rf(t.current,g,g3)}function c(g){var v;r.current.has(g.key)||(r.current=I9(r.current,g.key));const b=t.current.getState();return ac(t.current,g,Us().early&&(v=b.nextTree)!==null&&v!==void 0?v:b.currentTree)}function d(g){const v=c(g);return U5(v,g,t)}function f(g){return[d(g),l(g)]}function p(g){return[c(g),l(g)]}return{getRecoilValue:d,getRecoilValueLoadable:c,getRecoilState:f,getRecoilStateLoadable:p,getSetRecoilState:l,getResetRecoilState:u}},[r,t])}const U9={current:0};function V9(e){const t=Nr(),n=ic(),r=sn(()=>{var s;const l=t.current,u=l.getState(),c=Us().early&&(s=u.nextTree)!==null&&s!==void 0?s:u.currentTree;return{loadable:ac(l,e,c),key:e.key}},[t,e]),o=sn(s=>{let l;return()=>{var u,c;const d=s();return(u=l)!==null&&u!==void 0&&u.loadable.is(d.loadable)&&((c=l)===null||c===void 0?void 0:c.key)===d.key?l:(l=d,d)}},[]),i=m3(()=>o(r),[r,o]),a=sn(s=>{const l=t.current;return bs(l,e,s,n).release},[t,e,n]);return N9(a,i,i).loadable}function z9(e){const t=Nr(),n=sn(()=>{var u;const c=t.current,d=c.getState(),f=Us().early&&(u=d.nextTree)!==null&&u!==void 0?u:d.currentTree;return ac(c,e,f)},[t,e]),r=sn(()=>n(),[n]),o=ic(),i=sn((u,c)=>{const d=t.current;return bs(d,e,()=>{if(!Ie("recoil_suppress_rerender_in_callback"))return c();const p=n();l.current.is(p)||c(),l.current=p},o).release},[t,e,o,n]),a=L9();if(a==null)throw Ee("Recoil hooks must be used in components contained within a component.");const s=M9(a,r,i),l=tu(s);return xs(()=>{l.current=s}),s}function D0(e){const t=Nr(),n=ic(),r=sn(()=>{var l;const u=t.current,c=u.getState(),d=Us().early&&(l=c.nextTree)!==null&&l!==void 0?l:c.currentTree;return ac(u,e,d)},[t,e]),o=sn(()=>({loadable:r(),key:e.key}),[r,e.key]),i=sn(l=>{const u=o();return l.loadable.is(u.loadable)&&l.key===u.key?l:u},[o]);xs(()=>{const l=bs(t.current,e,u=>{s(i)},n);return s(i),l.release},[n,e,t,i]);const[a,s]=F5(o);return a.key!==e.key?o().loadable:a.loadable}function B9(e){const t=Nr(),[,n]=F5([]),r=ic(),o=sn(()=>{var s;const l=t.current,u=l.getState(),c=Us().early&&(s=u.nextTree)!==null&&s!==void 0?s:u.currentTree;return ac(l,e,c)},[t,e]),i=o(),a=tu(i);return xs(()=>{a.current=i}),xs(()=>{const s=t.current,l=s.getState(),u=bs(s,e,d=>{var f;if(!Ie("recoil_suppress_rerender_in_callback"))return n([]);const p=o();(f=a.current)!==null&&f!==void 0&&f.is(p)||n(p),a.current=p},r);if(l.nextTree)s.getState().queuedComponentCallbacks_DEPRECATED.push(()=>{a.current=null,n([])});else{var c;if(!Ie("recoil_suppress_rerender_in_callback"))return n([]);const d=o();(c=a.current)!==null&&c!==void 0&&c.is(d)||n(d),a.current=d}return u.release},[r,o,e,t]),i}function V5(e){return Ie("recoil_memory_managament_2020")&&j5(e),{TRANSITION_SUPPORT:D0,SYNC_EXTERNAL_STORE:P9()?V9:D0,MUTABLE_SOURCE:z9,LEGACY:B9}[Us().mode](e)}function y3(e){const t=Nr(),n=V5(e);return U5(n,e,t)}function Sh(e){const t=Nr();return sn(n=>{Rf(t.current,e,n)},[t,e])}function H9(e){const t=Nr();return sn(()=>{Rf(t.current,e,g3)},[t,e])}function q9(e){return[y3(e),Sh(e)]}function W9(e){return[V5(e),Sh(e)]}function G9(){const e=Nr();return(t,n={})=>{$9(()=>{e.current.addTransactionMetadata(n),t.forEach((r,o)=>D9(e.current,new L0(o),r))})}}function v3(e){return Ie("recoil_memory_managament_2020")&&j5(e),D0(e)}function _3(e){const t=Nr(),n=v3(e);return U5(n,e,t)}function K9(e){return[_3(e),Sh(e)]}var Y9={recoilComponentGetRecoilValueCount_FOR_TESTING:U9,useRecoilInterface:F9,useRecoilState:q9,useRecoilStateLoadable:W9,useRecoilValue:y3,useRecoilValueLoadable:V5,useResetRecoilState:H9,useSetRecoilState:Sh,useSetUnvalidatedAtomValues:G9,useRecoilValueLoadable_TRANSITION_SUPPORT_UNSTABLE:v3,useRecoilValue_TRANSITION_SUPPORT_UNSTABLE:_3,useRecoilState_TRANSITION_SUPPORT_UNSTABLE:K9};function Q9(e,t){const n=new Map;for(const[r,o]of e)t(o,r)&&n.set(r,o);return n}var X9=Q9;function Z9(e,t){const n=new Set;for(const r of e)t(r)&&n.add(r);return n}var J9=Z9;function eF(...e){const t=new Map;for(let n=0;nt.current.subscribeToTransactions(e).release,[e,t])}function I2(e){const t=e.atomValues.toMap(),n=Of(X9(t,(r,o)=>{const a=b3(o).persistence_UNSTABLE;return a!=null&&a.type!=="none"&&r.state==="hasValue"}),r=>r.contents);return tF(e.nonvalidatedAtoms.toMap(),n)}function uF(e){Ah(Eh(t=>{let n=t.getState().previousTree;const r=t.getState().currentTree;n||(n=t.getState().currentTree);const o=I2(r),i=I2(n),a=Of(oF,l=>{var u,c,d,f;return{persistence_UNSTABLE:{type:(u=(c=l.persistence_UNSTABLE)===null||c===void 0?void 0:c.type)!==null&&u!==void 0?u:"none",backButton:(d=(f=l.persistence_UNSTABLE)===null||f===void 0?void 0:f.backButton)!==null&&d!==void 0?d:!1}}}),s=J9(r.dirtyAtoms,l=>o.has(l)||i.has(l));e({atomValues:o,previousAtomValues:i,atomInfo:a,modifiedAtoms:s,transactionMetadata:{...r.transactionMetadata}})},[e]))}function cF(e){Ah(Eh(t=>{const n=kf(t,"latest"),r=kf(t,"previous");e({snapshot:n,previousSnapshot:r})},[e]))}function dF(){const e=z5(),[t,n]=lF(()=>kf(e.current)),r=h3(t),o=L2(),i=L2();if(Ah(Eh(s=>n(kf(s)),[])),x3(()=>{const s=t.retain();if(o.current&&!D2){var l;window.clearTimeout(o.current),o.current=null,(l=i.current)===null||l===void 0||l.call(i),i.current=null}return()=>{window.setTimeout(s,10)}},[t]),r!==t&&!D2){if(o.current){var a;window.clearTimeout(o.current),o.current=null,(a=i.current)===null||a===void 0||a.call(i),i.current=null}i.current=t.retain(),o.current=window.setTimeout(()=>{var s;o.current=null,(s=i.current)===null||s===void 0||s.call(i),i.current=null},sF)}return t}function w3(e,t){var n;const r=e.getState(),o=(n=r.nextTree)!==null&&n!==void 0?n:r.currentTree,i=t.getStore_INTERNAL().getState().currentTree;nF(()=>{const a=new Set;for(const u of[o.atomValues.keys(),i.atomValues.keys()])for(const c of u){var s,l;((s=o.atomValues.get(c))===null||s===void 0?void 0:s.contents)!==((l=i.atomValues.get(c))===null||l===void 0?void 0:l.contents)&&b3(c).shouldRestoreFromSnapshots&&a.add(c)}a.forEach(u=>{aF(e,new iF(u),i.atomValues.has(u)?Qe(i.atomValues.get(u)):rF)}),e.replaceState(u=>({...u,stateID:t.getID()}))})}function fF(){const e=z5();return Eh(t=>w3(e.current,t),[e])}var S3={useRecoilSnapshot:dF,gotoSnapshot:w3,useGotoRecoilSnapshot:fF,useRecoilTransactionObserver:cF,useTransactionObservation_DEPRECATED:uF,useTransactionSubscription_DEPRECATED:Ah};const{peekNodeInfo:pF}=li,{useStoreRef:hF}=fo;function gF(){const e=hF();return({key:t})=>pF(e.current,e.current.getState().currentTree,t)}var mF=gF;const{reactMode:yF}=nc,{RecoilRoot:vF,useStoreRef:_F}=fo,{useMemo:bF}=E;function xF(){yF().mode==="MUTABLE_SOURCE"&&console.warn("Warning: There are known issues using useRecoilBridgeAcrossReactRoots() in recoil_mutable_source rendering mode. Please consider upgrading to recoil_sync_external_store mode.");const e=_F().current;return bF(()=>{function t({children:n}){return E.createElement(vF,{store_INTERNAL:e},n)}return t},[e])}var wF=xF;const{loadableWithValue:SF}=tc,{initializeNode:EF}=li,{DEFAULT_VALUE:AF,getNode:CF}=cn,{copyTreeState:OF,getRecoilValueAsLoadable:RF,invalidateDownstreams:kF,writeLoadableToTreeState:TF}=Mr;function j2(e){return CF(e.key).nodeType==="atom"}class $F{constructor(t,n){we(this,"_store",void 0),we(this,"_treeState",void 0),we(this,"_changes",void 0),we(this,"get",r=>{if(this._changes.has(r.key))return this._changes.get(r.key);if(!j2(r))throw Ee("Reading selectors within atomicUpdate is not supported");const o=RF(this._store,r,this._treeState);if(o.state==="hasValue")return o.contents;throw o.state==="hasError"?o.contents:Ee(`Expected Recoil atom ${r.key} to have a value, but it is in a loading state.`)}),we(this,"set",(r,o)=>{if(!j2(r))throw Ee("Setting selectors within atomicUpdate is not supported");if(typeof o=="function"){const i=this.get(r);this._changes.set(r.key,o(i))}else EF(this._store,r.key,"set"),this._changes.set(r.key,o)}),we(this,"reset",r=>{this.set(r,AF)}),this._store=t,this._treeState=n,this._changes=new Map}newTreeState_INTERNAL(){if(this._changes.size===0)return this._treeState;const t=OF(this._treeState);for(const[n,r]of this._changes)TF(t,n,SF(r));return kF(this._store,t),t}}function PF(e){return t=>{e.replaceState(n=>{const r=new $F(e,n);return t(r),r.newTreeState_INTERNAL()})}}var MF={atomicUpdater:PF},NF=MF.atomicUpdater,E3=Object.freeze({__proto__:null,atomicUpdater:NF});function LF(e,t){if(!e)throw new Error(t)}var DF=LF,Ll=DF;const{atomicUpdater:IF}=E3,{batchUpdates:jF}=yh,{DEFAULT_VALUE:FF}=cn,{useStoreRef:UF}=fo,{refreshRecoilValue:VF,setRecoilValue:F2}=Mr,{cloneSnapshot:zF}=xh,{gotoSnapshot:BF}=S3,{useCallback:HF}=E;class A3{}const qF=new A3;function C3(e,t,n,r){let o=qF,i;if(jF(()=>{const s="useRecoilCallback() expects a function that returns a function: it accepts a function of the type (RecoilInterface) => (Args) => ReturnType and returns a callback function (Args) => ReturnType, where RecoilInterface is an object {snapshot, set, ...} and Args and ReturnType are the argument and return types of the callback you want to create. Please see the docs at recoiljs.org for details.";if(typeof t!="function")throw Ee(s);const l=jO({...r??{},set:(c,d)=>F2(e,c,d),reset:c=>F2(e,c,FF),refresh:c=>VF(e,c),gotoSnapshot:c=>BF(e,c),transact_UNSTABLE:c=>IF(e)(c)},{snapshot:()=>{const c=zF(e);return i=c.retain(),c}}),u=t(l);if(typeof u!="function")throw Ee(s);o=u(...n)}),o instanceof A3&&Ll(!1),He(o))o=o.finally(()=>{var s;(s=i)===null||s===void 0||s()});else{var a;(a=i)===null||a===void 0||a()}return o}function WF(e,t){const n=UF();return HF((...r)=>C3(n.current,e,r),t!=null?[...t,n]:void 0)}var O3={recoilCallback:C3,useRecoilCallback:WF};const{useStoreRef:GF}=fo,{refreshRecoilValue:KF}=Mr,{useCallback:YF}=E;function QF(e){const t=GF();return YF(()=>{const n=t.current;KF(n,e)},[e,t])}var XF=QF;const{atomicUpdater:ZF}=E3,{useStoreRef:JF}=fo,{useMemo:eU}=E;function tU(e,t){const n=JF();return eU(()=>(...r)=>{ZF(n.current)(i=>{e(i)(...r)})},t!=null?[...t,n]:void 0)}var nU=tU;class rU{constructor(t){we(this,"value",void 0),this.value=t}}var oU={WrappedValue:rU},iU=oU.WrappedValue,R3=Object.freeze({__proto__:null,WrappedValue:iU});const{isFastRefreshEnabled:aU}=nc;class U2 extends Error{}class sU{constructor(t){var n,r,o;we(this,"_name",void 0),we(this,"_numLeafs",void 0),we(this,"_root",void 0),we(this,"_onHit",void 0),we(this,"_onSet",void 0),we(this,"_mapNodeValue",void 0),this._name=t==null?void 0:t.name,this._numLeafs=0,this._root=null,this._onHit=(n=t==null?void 0:t.onHit)!==null&&n!==void 0?n:()=>{},this._onSet=(r=t==null?void 0:t.onSet)!==null&&r!==void 0?r:()=>{},this._mapNodeValue=(o=t==null?void 0:t.mapNodeValue)!==null&&o!==void 0?o:i=>i}size(){return this._numLeafs}root(){return this._root}get(t,n){var r;return(r=this.getLeafNode(t,n))===null||r===void 0?void 0:r.value}getLeafNode(t,n){if(this._root==null)return;let r=this._root;for(;r;){if(n==null||n.onNodeVisit(r),r.type==="leaf")return this._onHit(r),r;const o=this._mapNodeValue(t(r.nodeKey));r=r.branches.get(o)}}set(t,n,r){const o=()=>{var i,a,s,l;let u,c;for(const[b,y]of t){var d,f,p;const h=this._root;if((h==null?void 0:h.type)==="leaf")throw this.invalidCacheError();const _=u;if(u=_?_.branches.get(c):h,u=(d=u)!==null&&d!==void 0?d:{type:"branch",nodeKey:b,parent:_,branches:new Map,branchKey:c},u.type!=="branch"||u.nodeKey!==b)throw this.invalidCacheError();_==null||_.branches.set(c,u),r==null||(f=r.onNodeVisit)===null||f===void 0||f.call(r,u),c=this._mapNodeValue(y),this._root=(p=this._root)!==null&&p!==void 0?p:u}const g=u?(i=u)===null||i===void 0?void 0:i.branches.get(c):this._root;if(g!=null&&(g.type!=="leaf"||g.branchKey!==c))throw this.invalidCacheError();const v={type:"leaf",value:n,parent:u,branchKey:c};(a=u)===null||a===void 0||a.branches.set(c,v),this._root=(s=this._root)!==null&&s!==void 0?s:v,this._numLeafs++,this._onSet(v),r==null||(l=r.onNodeVisit)===null||l===void 0||l.call(r,v)};try{o()}catch(i){if(i instanceof U2)this.clear(),o();else throw i}}delete(t){const n=this.root();if(!n)return!1;if(t===n)return this._root=null,this._numLeafs=0,!0;let r=t.parent,o=t.branchKey;for(;r;){var i;if(r.branches.delete(o),r===n)return r.branches.size===0?(this._root=null,this._numLeafs=0):this._numLeafs--,!0;if(r.branches.size>0)break;o=(i=r)===null||i===void 0?void 0:i.branchKey,r=r.parent}for(;r!==n;r=r.parent)if(r==null)return!1;return this._numLeafs--,!0}clear(){this._numLeafs=0,this._root=null}invalidCacheError(){const t=aU()?"Possible Fast Refresh module reload detected. This may also be caused by an selector returning inconsistent values. Resetting cache.":"Invalid cache values. This happens when selectors do not return consistent values for the same input dependency values. That may also be caused when using Fast Refresh to change a selector implementation. Resetting cache.";throw R5(t+(this._name!=null?` - ${this._name}`:"")),new U2}}var lU={TreeCache:sU},uU=lU.TreeCache,k3=Object.freeze({__proto__:null,TreeCache:uU});class cU{constructor(t){var n;we(this,"_maxSize",void 0),we(this,"_size",void 0),we(this,"_head",void 0),we(this,"_tail",void 0),we(this,"_map",void 0),we(this,"_keyMapper",void 0),this._maxSize=t.maxSize,this._size=0,this._head=null,this._tail=null,this._map=new Map,this._keyMapper=(n=t.mapKey)!==null&&n!==void 0?n:r=>r}head(){return this._head}tail(){return this._tail}size(){return this._size}maxSize(){return this._maxSize}has(t){return this._map.has(this._keyMapper(t))}get(t){const n=this._keyMapper(t),r=this._map.get(n);if(r)return this.set(t,r.value),r.value}set(t,n){const r=this._keyMapper(t);this._map.get(r)&&this.delete(t);const i=this.head(),a={key:t,right:i,left:null,value:n};i?i.left=a:this._tail=a,this._map.set(r,a),this._head=a,this._size++,this._maybeDeleteLRU()}_maybeDeleteLRU(){this.size()>this.maxSize()&&this.deleteLru()}deleteLru(){const t=this.tail();t&&this.delete(t.key)}delete(t){const n=this._keyMapper(t);if(!this._size||!this._map.has(n))return;const r=Qe(this._map.get(n)),o=r.right,i=r.left;o&&(o.left=r.left),i&&(i.right=r.right),r===this.head()&&(this._head=o),r===this.tail()&&(this._tail=i),this._map.delete(n),this._size--}clear(){this._size=0,this._head=null,this._tail=null,this._map=new Map}}var dU={LRUCache:cU},fU=dU.LRUCache,T3=Object.freeze({__proto__:null,LRUCache:fU});const{LRUCache:pU}=T3,{TreeCache:hU}=k3;function gU({name:e,maxSize:t,mapNodeValue:n=r=>r}){const r=new pU({maxSize:t}),o=new hU({name:e,mapNodeValue:n,onHit:i=>{r.set(i,!0)},onSet:i=>{const a=r.tail();r.set(i,!0),a&&o.size()>t&&o.delete(a.key)}});return o}var V2=gU;function Yn(e,t,n){if(typeof e=="string"&&!e.includes('"')&&!e.includes("\\"))return`"${e}"`;switch(typeof e){case"undefined":return"";case"boolean":return e?"true":"false";case"number":case"symbol":return String(e);case"string":return JSON.stringify(e);case"function":if((t==null?void 0:t.allowFunctions)!==!0)throw Ee("Attempt to serialize function in a Recoil cache key");return`__FUNCTION(${e.name})__`}if(e===null)return"null";if(typeof e!="object"){var r;return(r=JSON.stringify(e))!==null&&r!==void 0?r:""}if(He(e))return"__PROMISE__";if(Array.isArray(e))return`[${e.map((o,i)=>Yn(o,t,i.toString()))}]`;if(typeof e.toJSON=="function")return Yn(e.toJSON(n),t,n);if(e instanceof Map){const o={};for(const[i,a]of e)o[typeof i=="string"?i:Yn(i,t)]=a;return Yn(o,t,n)}return e instanceof Set?Yn(Array.from(e).sort((o,i)=>Yn(o,t).localeCompare(Yn(i,t))),t,n):Symbol!==void 0&&e[Symbol.iterator]!=null&&typeof e[Symbol.iterator]=="function"?Yn(Array.from(e),t,n):`{${Object.keys(e).filter(o=>e[o]!==void 0).sort().map(o=>`${Yn(o,t)}:${Yn(e[o],t,o)}`).join(",")}}`}function mU(e,t={allowFunctions:!1}){return Yn(e,t)}var Ch=mU;const{TreeCache:yU}=k3,Gc={equality:"reference",eviction:"keep-all",maxSize:1/0};function vU({equality:e=Gc.equality,eviction:t=Gc.eviction,maxSize:n=Gc.maxSize}=Gc,r){const o=_U(e);return bU(t,n,o,r)}function _U(e){switch(e){case"reference":return t=>t;case"value":return t=>Ch(t)}throw Ee(`Unrecognized equality policy ${e}`)}function bU(e,t,n,r){switch(e){case"keep-all":return new yU({name:r,mapNodeValue:n});case"lru":return V2({name:r,maxSize:Qe(t),mapNodeValue:n});case"most-recent":return V2({name:r,maxSize:1,mapNodeValue:n})}throw Ee(`Unrecognized eviction policy ${e}`)}var xU=vU;function wU(e){return()=>null}var SU={startPerfBlock:wU};const{isLoadable:EU,loadableWithError:Kc,loadableWithPromise:AU,loadableWithValue:Xg}=tc,{WrappedValue:$3}=R3,{getNodeLoadable:Yc,peekNodeLoadable:CU,setNodeValue:OU}=li,{saveDepsToStore:RU}=rc,{DEFAULT_VALUE:kU,getConfigDeletionHandler:TU,getNode:$U,registerNode:z2}=cn,{isRecoilValue:PU}=_s,{markRecoilValueModified:B2}=Mr,{retainedByOptionWithDefault:MU}=la,{recoilCallback:NU}=O3,{startPerfBlock:LU}=SU;class P3{}const yl=new P3,vl=[],Qc=new Map,DU=(()=>{let e=0;return()=>e++})();function M3(e){let t=null;const{key:n,get:r,cachePolicy_UNSTABLE:o}=e,i=e.set!=null?e.set:void 0,a=new Set,s=xU(o??{equality:"reference",eviction:"keep-all"},n),l=MU(e.retainedBy_UNSTABLE),u=new Map;let c=0;function d(){return!Ie("recoil_memory_managament_2020")||c>0}function f(M){return M.getState().knownSelectors.add(n),c++,()=>{c--}}function p(){return TU(n)!==void 0&&!d()}function g(M,U,B,ee,Z){G(U,ee,Z),v(M,B)}function v(M,U){j(M,U)&&$(M),y(U,!0)}function b(M,U){j(M,U)&&(Qe(O(M)).stateVersions.clear(),y(U,!1))}function y(M,U){const B=Qc.get(M);if(B!=null){for(const ee of B)B2(ee,Qe(t));U&&Qc.delete(M)}}function h(M,U){let B=Qc.get(U);B==null&&Qc.set(U,B=new Set),B.add(M)}function _(M,U,B,ee,Z,ae){return U.then(he=>{if(!d())throw $(M),yl;const se=Xg(he);return g(M,B,Z,se,ee),he}).catch(he=>{if(!d())throw $(M),yl;if(He(he))return x(M,he,B,ee,Z,ae);const se=Kc(he);throw g(M,B,Z,se,ee),he})}function x(M,U,B,ee,Z,ae){return U.then(he=>{if(!d())throw $(M),yl;ae.loadingDepKey!=null&&ae.loadingDepPromise===U?B.atomValues.set(ae.loadingDepKey,Xg(he)):M.getState().knownSelectors.forEach(Se=>{B.atomValues.delete(Se)});const se=A(M,B);if(se&&se.state!=="loading"){if((j(M,Z)||O(M)==null)&&v(M,Z),se.state==="hasValue")return se.contents;throw se.contents}if(!j(M,Z)){const Se=R(M,B);if(Se!=null)return Se.loadingLoadable.contents}const[Ce,je]=S(M,B,Z);if(Ce.state!=="loading"&&g(M,B,Z,Ce,je),Ce.state==="hasError")throw Ce.contents;return Ce.contents}).catch(he=>{if(he instanceof P3)throw yl;if(!d())throw $(M),yl;const se=Kc(he);throw g(M,B,Z,se,ee),he})}function w(M,U,B,ee){var Z,ae,he,se;if(j(M,ee)||U.version===((Z=M.getState())===null||Z===void 0||(ae=Z.currentTree)===null||ae===void 0?void 0:ae.version)||U.version===((he=M.getState())===null||he===void 0||(se=he.nextTree)===null||se===void 0?void 0:se.version)){var Ce,je,Se;RU(n,B,M,(Ce=(je=M.getState())===null||je===void 0||(Se=je.nextTree)===null||Se===void 0?void 0:Se.version)!==null&&Ce!==void 0?Ce:M.getState().currentTree.version)}for(const ke of B)a.add(ke)}function S(M,U,B){const ee=LU(n);let Z=!0,ae=!0;const he=()=>{ee(),ae=!1};let se,Ce=!1,je;const Se={loadingDepKey:null,loadingDepPromise:null},ke=new Map;function Le({key:ft}){const P=Yc(M,U,ft);switch(ke.set(ft,P),Z||(w(M,U,new Set(ke.keys()),B),b(M,B)),P.state){case"hasValue":return P.contents;case"hasError":throw P.contents;case"loading":throw Se.loadingDepKey=ft,Se.loadingDepPromise=P.contents,P.contents}throw Ee("Invalid Loadable state")}const Sn=ft=>(...P)=>{if(ae)throw Ee("Callbacks from getCallback() should only be called asynchronously after the selector is evalutated. It can be used for selectors to return objects with callbacks that can work with Recoil state without a subscription.");return t==null&&Ll(!1),NU(M,ft,P,{node:t})};try{se=r({get:Le,getCallback:Sn}),se=PU(se)?Le(se):se,EU(se)&&(se.state==="hasError"&&(Ce=!0),se=se.contents),He(se)?se=_(M,se,U,ke,B,Se).finally(he):he(),se=se instanceof $3?se.value:se}catch(ft){se=ft,He(se)?se=x(M,se,U,ke,B,Se).finally(he):(Ce=!0,he())}return Ce?je=Kc(se):He(se)?je=AU(se):je=Xg(se),Z=!1,T(M,B,ke),w(M,U,new Set(ke.keys()),B),[je,ke]}function A(M,U){let B=U.atomValues.get(n);if(B!=null)return B;const ee=new Set;try{B=s.get(ae=>(typeof ae!="string"&&Ll(!1),Yc(M,U,ae).contents),{onNodeVisit:ae=>{ae.type==="branch"&&ae.nodeKey!==n&&ee.add(ae.nodeKey)}})}catch(ae){throw Ee(`Problem with cache lookup for selector "${n}": ${ae.message}`)}if(B){var Z;U.atomValues.set(n,B),w(M,U,ee,(Z=O(M))===null||Z===void 0?void 0:Z.executionID)}return B}function C(M,U){const B=A(M,U);if(B!=null)return $(M),B;const ee=R(M,U);if(ee!=null){var Z;return((Z=ee.loadingLoadable)===null||Z===void 0?void 0:Z.state)==="loading"&&h(M,ee.executionID),ee.loadingLoadable}const ae=DU(),[he,se]=S(M,U,ae);return he.state==="loading"?(k(M,ae,he,se,U),h(M,ae)):($(M),G(U,he,se)),he}function R(M,U){const B=t3([u.has(M)?[Qe(u.get(M))]:[],ph(M5(u,([Z])=>Z!==M),([,Z])=>Z)]);function ee(Z){for(const[ae,he]of Z)if(!Yc(M,U,ae).is(he))return!0;return!1}for(const Z of B){if(Z.stateVersions.get(U.version)||!ee(Z.depValuesDiscoveredSoFarDuringAsyncWork))return Z.stateVersions.set(U.version,!0),Z;Z.stateVersions.set(U.version,!1)}}function O(M){return u.get(M)}function k(M,U,B,ee,Z){u.set(M,{depValuesDiscoveredSoFarDuringAsyncWork:ee,executionID:U,loadingLoadable:B,stateVersions:new Map([[Z.version,!0]])})}function T(M,U,B){if(j(M,U)){const ee=O(M);ee!=null&&(ee.depValuesDiscoveredSoFarDuringAsyncWork=B)}}function $(M){u.delete(M)}function j(M,U){var B;return U===((B=O(M))===null||B===void 0?void 0:B.executionID)}function L(M){return Array.from(M.entries()).map(([U,B])=>[U,B.contents])}function G(M,U,B){M.atomValues.set(n,U);try{s.set(L(B),U)}catch(ee){throw Ee(`Problem with setting cache for selector "${n}": ${ee.message}`)}}function W(M){if(vl.includes(n)){const U=`Recoil selector has circular dependencies: ${vl.slice(vl.indexOf(n)).join(" → ")}`;return Kc(Ee(U))}vl.push(n);try{return M()}finally{vl.pop()}}function V(M,U){const B=U.atomValues.get(n);return B??s.get(ee=>{var Z;return typeof ee!="string"&&Ll(!1),(Z=CU(M,U,ee))===null||Z===void 0?void 0:Z.contents})}function K(M,U){return W(()=>C(M,U))}function Y(M){M.atomValues.delete(n)}function oe(M,U){t==null&&Ll(!1);for(const ee of a){var B;const Z=$U(ee);(B=Z.clearCache)===null||B===void 0||B.call(Z,M,U)}a.clear(),Y(U),s.clear(),B2(M,t)}return i!=null?t=z2({key:n,nodeType:"selector",peek:V,get:K,set:(U,B,ee)=>{let Z=!1;const ae=new Map;function he({key:Se}){if(Z)throw Ee("Recoil: Async selector sets are not currently supported.");const ke=Yc(U,B,Se);if(ke.state==="hasValue")return ke.contents;if(ke.state==="loading"){const Le=`Getting value of asynchronous atom or selector "${Se}" in a pending state while setting selector "${n}" is not yet supported.`;throw Ee(Le)}else throw ke.contents}function se(Se,ke){if(Z)throw Ee("Recoil: Async selector sets are not currently supported.");const Le=typeof ke=="function"?ke(he(Se)):ke;OU(U,B,Se.key,Le).forEach((ft,P)=>ae.set(P,ft))}function Ce(Se){se(Se,kU)}const je=i({set:se,get:he,reset:Ce},ee);if(je!==void 0)throw He(je)?Ee("Recoil: Async selector sets are not currently supported."):Ee("Recoil: selector set should be a void function.");return Z=!0,ae},init:f,invalidate:Y,clearCache:oe,shouldDeleteConfigOnRelease:p,dangerouslyAllowMutability:e.dangerouslyAllowMutability,shouldRestoreFromSnapshots:!1,retainedBy:l}):t=z2({key:n,nodeType:"selector",peek:V,get:K,init:f,invalidate:Y,clearCache:oe,shouldDeleteConfigOnRelease:p,dangerouslyAllowMutability:e.dangerouslyAllowMutability,shouldRestoreFromSnapshots:!1,retainedBy:l})}M3.value=e=>new $3(e);var ws=M3;const{isLoadable:IU,loadableWithError:Zg,loadableWithPromise:Jg,loadableWithValue:va}=tc,{WrappedValue:N3}=R3,{peekNodeInfo:jU}=li,{DEFAULT_VALUE:xi,DefaultValue:Eo,getConfigDeletionHandler:L3,registerNode:FU,setConfigDeletionHandler:UU}=cn,{isRecoilValue:VU}=_s,{getRecoilValueAsLoadable:zU,markRecoilValueModified:BU,setRecoilValue:H2,setRecoilValueLoadable:HU}=Mr,{retainedByOptionWithDefault:qU}=la,_l=e=>e instanceof N3?e.value:e;function WU(e){const{key:t,persistence_UNSTABLE:n}=e,r=qU(e.retainedBy_UNSTABLE);let o=0;function i(h){return Jg(h.then(_=>(a=va(_),_)).catch(_=>{throw a=Zg(_),_}))}let a=He(e.default)?i(e.default):IU(e.default)?e.default.state==="loading"?i(e.default.contents):e.default:va(_l(e.default));a.contents;let s;const l=new Map;function u(h){return h}function c(h,_){const x=_.then(w=>{var S,A;return((A=((S=h.getState().nextTree)!==null&&S!==void 0?S:h.getState().currentTree).atomValues.get(t))===null||A===void 0?void 0:A.contents)===x&&H2(h,y,w),w}).catch(w=>{var S,A;throw((A=((S=h.getState().nextTree)!==null&&S!==void 0?S:h.getState().currentTree).atomValues.get(t))===null||A===void 0?void 0:A.contents)===x&&HU(h,y,Zg(w)),w});return x}function d(h,_,x){var w;o++;const S=()=>{var $;o--,($=l.get(h))===null||$===void 0||$.forEach(j=>j()),l.delete(h)};if(h.getState().knownAtoms.add(t),a.state==="loading"){const $=()=>{var j;((j=h.getState().nextTree)!==null&&j!==void 0?j:h.getState().currentTree).atomValues.has(t)||BU(h,y)};a.contents.finally($)}const A=(w=e.effects)!==null&&w!==void 0?w:e.effects_UNSTABLE;if(A!=null){let W=function(U){if(j&&U.key===t){const B=$;return B instanceof Eo?f(h,_):He(B)?Jg(B.then(ee=>ee instanceof Eo?a.toPromise():ee)):va(B)}return zU(h,U)},V=function(U){return W(U).toPromise()},K=function(U){var B;const ee=jU(h,(B=h.getState().nextTree)!==null&&B!==void 0?B:h.getState().currentTree,U.key);return j&&U.key===t&&!($ instanceof Eo)?{...ee,isSet:!0,loadable:W(U)}:ee};var O=W,k=V,T=K;let $=xi,j=!0,L=!1,G=null;const Y=U=>B=>{if(j){const ee=W(y),Z=ee.state==="hasValue"?ee.contents:xi;$=typeof B=="function"?B(Z):B,He($)&&($=$.then(ae=>(G={effect:U,value:ae},ae)))}else{if(He(B))throw Ee("Setting atoms to async values is not implemented.");typeof B!="function"&&(G={effect:U,value:_l(B)}),H2(h,y,typeof B=="function"?ee=>{const Z=_l(B(ee));return G={effect:U,value:Z},Z}:_l(B))}},oe=U=>()=>Y(U)(xi),M=U=>B=>{var ee;const{release:Z}=h.subscribeToTransactions(ae=>{var he;let{currentTree:se,previousTree:Ce}=ae.getState();Ce||(Ce=se);const je=(he=se.atomValues.get(t))!==null&&he!==void 0?he:a;if(je.state==="hasValue"){var Se,ke,Le,Sn;const ft=je.contents,P=(Se=Ce.atomValues.get(t))!==null&&Se!==void 0?Se:a,z=P.state==="hasValue"?P.contents:xi;((ke=G)===null||ke===void 0?void 0:ke.effect)!==U||((Le=G)===null||Le===void 0?void 0:Le.value)!==ft?B(ft,z,!se.atomValues.has(t)):((Sn=G)===null||Sn===void 0?void 0:Sn.effect)===U&&(G=null)}},t);l.set(h,[...(ee=l.get(h))!==null&&ee!==void 0?ee:[],Z])};for(const U of A)try{const B=U({node:y,storeID:h.storeID,parentStoreID_UNSTABLE:h.parentStoreID,trigger:x,setSelf:Y(U),resetSelf:oe(U),onSet:M(U),getPromise:V,getLoadable:W,getInfo_UNSTABLE:K});if(B!=null){var C;l.set(h,[...(C=l.get(h))!==null&&C!==void 0?C:[],B])}}catch(B){$=B,L=!0}if(j=!1,!($ instanceof Eo)){var R;const U=L?Zg($):He($)?Jg(c(h,$)):va(_l($));U.contents,_.atomValues.set(t,U),(R=h.getState().nextTree)===null||R===void 0||R.atomValues.set(t,U)}}return S}function f(h,_){var x,w;return(x=(w=_.atomValues.get(t))!==null&&w!==void 0?w:s)!==null&&x!==void 0?x:a}function p(h,_){if(_.atomValues.has(t))return Qe(_.atomValues.get(t));if(_.nonvalidatedAtoms.has(t)){if(s!=null)return s;if(n==null)return a;const x=_.nonvalidatedAtoms.get(t),w=n.validator(x,xi);return s=w instanceof Eo?a:va(w),s}else return a}function g(){s=void 0}function v(h,_,x){if(_.atomValues.has(t)){const w=Qe(_.atomValues.get(t));if(w.state==="hasValue"&&x===w.contents)return new Map}else if(!_.nonvalidatedAtoms.has(t)&&x instanceof Eo)return new Map;return s=void 0,new Map().set(t,va(x))}function b(){return L3(t)!==void 0&&o<=0}const y=FU({key:t,nodeType:"atom",peek:f,get:p,set:v,init:d,invalidate:g,shouldDeleteConfigOnRelease:b,dangerouslyAllowMutability:e.dangerouslyAllowMutability,persistence_UNSTABLE:e.persistence_UNSTABLE?{type:e.persistence_UNSTABLE.type,backButton:e.persistence_UNSTABLE.backButton}:void 0,shouldRestoreFromSnapshots:!0,retainedBy:r});return y}function B5(e){const{...t}=e,n="default"in e?e.default:new Promise(()=>{});return VU(n)?GU({...t,default:n}):WU({...t,default:n})}function GU(e){const t=B5({...e,default:xi,persistence_UNSTABLE:e.persistence_UNSTABLE===void 0?void 0:{...e.persistence_UNSTABLE,validator:r=>r instanceof Eo?r:Qe(e.persistence_UNSTABLE).validator(r,xi)},effects:e.effects,effects_UNSTABLE:e.effects_UNSTABLE}),n=ws({key:`${e.key}__withFallback`,get:({get:r})=>{const o=r(t);return o instanceof Eo?e.default:o},set:({set:r},o)=>r(t,o),cachePolicy_UNSTABLE:{eviction:"most-recent"},dangerouslyAllowMutability:e.dangerouslyAllowMutability});return UU(n.key,L3(e.key)),n}B5.value=e=>new N3(e);var D3=B5;class KU{constructor(t){var n;we(this,"_map",void 0),we(this,"_keyMapper",void 0),this._map=new Map,this._keyMapper=(n=t==null?void 0:t.mapKey)!==null&&n!==void 0?n:r=>r}size(){return this._map.size}has(t){return this._map.has(this._keyMapper(t))}get(t){return this._map.get(this._keyMapper(t))}set(t,n){this._map.set(this._keyMapper(t),n)}delete(t){this._map.delete(this._keyMapper(t))}clear(){this._map.clear()}}var YU={MapCache:KU},QU=YU.MapCache,XU=Object.freeze({__proto__:null,MapCache:QU});const{LRUCache:q2}=T3,{MapCache:ZU}=XU,Xc={equality:"reference",eviction:"none",maxSize:1/0};function JU({equality:e=Xc.equality,eviction:t=Xc.eviction,maxSize:n=Xc.maxSize}=Xc){const r=eV(e);return tV(t,n,r)}function eV(e){switch(e){case"reference":return t=>t;case"value":return t=>Ch(t)}throw Ee(`Unrecognized equality policy ${e}`)}function tV(e,t,n){switch(e){case"keep-all":return new ZU({mapKey:n});case"lru":return new q2({mapKey:n,maxSize:Qe(t)});case"most-recent":return new q2({mapKey:n,maxSize:1})}throw Ee(`Unrecognized eviction policy ${e}`)}var I3=JU;const{setConfigDeletionHandler:nV}=cn;function rV(e){var t,n;const r=I3({equality:(t=(n=e.cachePolicyForParams_UNSTABLE)===null||n===void 0?void 0:n.equality)!==null&&t!==void 0?t:"value",eviction:"keep-all"});return o=>{var i,a;const s=r.get(o);if(s!=null)return s;const{cachePolicyForParams_UNSTABLE:l,...u}=e,c="default"in e?e.default:new Promise(()=>{}),d=D3({...u,key:`${e.key}__${(i=Ch(o))!==null&&i!==void 0?i:"void"}`,default:typeof c=="function"?c(o):c,retainedBy_UNSTABLE:typeof e.retainedBy_UNSTABLE=="function"?e.retainedBy_UNSTABLE(o):e.retainedBy_UNSTABLE,effects:typeof e.effects=="function"?e.effects(o):typeof e.effects_UNSTABLE=="function"?e.effects_UNSTABLE(o):(a=e.effects)!==null&&a!==void 0?a:e.effects_UNSTABLE});return r.set(o,d),nV(d.key,()=>{r.delete(o)}),d}}var oV=rV;const{setConfigDeletionHandler:iV}=cn;let aV=0;function sV(e){var t,n;const r=I3({equality:(t=(n=e.cachePolicyForParams_UNSTABLE)===null||n===void 0?void 0:n.equality)!==null&&t!==void 0?t:"value",eviction:"keep-all"});return o=>{var i;let a;try{a=r.get(o)}catch(f){throw Ee(`Problem with cache lookup for selector ${e.key}: ${f.message}`)}if(a!=null)return a;const s=`${e.key}__selectorFamily/${(i=Ch(o,{allowFunctions:!0}))!==null&&i!==void 0?i:"void"}/${aV++}`,l=f=>e.get(o)(f),u=e.cachePolicy_UNSTABLE,c=typeof e.retainedBy_UNSTABLE=="function"?e.retainedBy_UNSTABLE(o):e.retainedBy_UNSTABLE;let d;if(e.set!=null){const f=e.set;d=ws({key:s,get:l,set:(g,v)=>f(o)(g,v),cachePolicy_UNSTABLE:u,dangerouslyAllowMutability:e.dangerouslyAllowMutability,retainedBy_UNSTABLE:c})}else d=ws({key:s,get:l,cachePolicy_UNSTABLE:u,dangerouslyAllowMutability:e.dangerouslyAllowMutability,retainedBy_UNSTABLE:c});return r.set(o,d),iV(d.key,()=>{r.delete(o)}),d}}var ui=sV;const lV=ui({key:"__constant",get:e=>()=>e,cachePolicyForParams_UNSTABLE:{equality:"reference"}});function uV(e){return lV(e)}var cV=uV;const dV=ui({key:"__error",get:e=>()=>{throw Ee(e)},cachePolicyForParams_UNSTABLE:{equality:"reference"}});function fV(e){return dV(e)}var pV=fV;function hV(e){return e}var gV=hV;const{loadableWithError:j3,loadableWithPromise:F3,loadableWithValue:U3}=tc;function Oh(e,t){const n=Array(t.length).fill(void 0),r=Array(t.length).fill(void 0);for(const[o,i]of t.entries())try{n[o]=e(i)}catch(a){r[o]=a}return[n,r]}function mV(e){return e!=null&&!He(e)}function Rh(e){return Array.isArray(e)?e:Object.getOwnPropertyNames(e).map(t=>e[t])}function I0(e,t){return Array.isArray(e)?t:Object.getOwnPropertyNames(e).reduce((n,r,o)=>({...n,[r]:t[o]}),{})}function ns(e,t,n){const r=n.map((o,i)=>o==null?U3(t[i]):He(o)?F3(o):j3(o));return I0(e,r)}function yV(e,t){return t.map((n,r)=>n===void 0?e[r]:n)}const vV=ui({key:"__waitForNone",get:e=>({get:t})=>{const n=Rh(e),[r,o]=Oh(t,n);return ns(e,r,o)},dangerouslyAllowMutability:!0}),_V=ui({key:"__waitForAny",get:e=>({get:t})=>{const n=Rh(e),[r,o]=Oh(t,n);return o.some(i=>!He(i))?ns(e,r,o):new Promise(i=>{for(const[a,s]of o.entries())He(s)&&s.then(l=>{r[a]=l,o[a]=void 0,i(ns(e,r,o))}).catch(l=>{o[a]=l,i(ns(e,r,o))})})},dangerouslyAllowMutability:!0}),bV=ui({key:"__waitForAll",get:e=>({get:t})=>{const n=Rh(e),[r,o]=Oh(t,n);if(o.every(a=>a==null))return I0(e,r);const i=o.find(mV);if(i!=null)throw i;return Promise.all(o).then(a=>I0(e,yV(r,a)))},dangerouslyAllowMutability:!0}),xV=ui({key:"__waitForAllSettled",get:e=>({get:t})=>{const n=Rh(e),[r,o]=Oh(t,n);return o.every(i=>!He(i))?ns(e,r,o):Promise.all(o.map((i,a)=>He(i)?i.then(s=>{r[a]=s,o[a]=void 0}).catch(s=>{r[a]=void 0,o[a]=s}):null)).then(()=>ns(e,r,o))},dangerouslyAllowMutability:!0}),wV=ui({key:"__noWait",get:e=>({get:t})=>{try{return ws.value(U3(t(e)))}catch(n){return ws.value(He(n)?F3(n):j3(n))}},dangerouslyAllowMutability:!0});var SV={waitForNone:vV,waitForAny:_V,waitForAll:bV,waitForAllSettled:xV,noWait:wV};const{RecoilLoadable:EV}=tc,{DefaultValue:AV}=cn,{RecoilRoot:CV,useRecoilStoreID:OV}=fo,{isRecoilValue:RV}=_s,{retentionZone:kV}=gh,{freshSnapshot:TV}=xh,{useRecoilState:$V,useRecoilState_TRANSITION_SUPPORT_UNSTABLE:PV,useRecoilStateLoadable:MV,useRecoilValue:NV,useRecoilValue_TRANSITION_SUPPORT_UNSTABLE:LV,useRecoilValueLoadable:DV,useRecoilValueLoadable_TRANSITION_SUPPORT_UNSTABLE:IV,useResetRecoilState:jV,useSetRecoilState:FV}=Y9,{useGotoRecoilSnapshot:UV,useRecoilSnapshot:VV,useRecoilTransactionObserver:zV}=S3,{useRecoilCallback:BV}=O3,{noWait:HV,waitForAll:qV,waitForAllSettled:WV,waitForAny:GV,waitForNone:KV}=SV;var H5={DefaultValue:AV,isRecoilValue:RV,RecoilLoadable:EV,RecoilEnv:Fs,RecoilRoot:CV,useRecoilStoreID:OV,useRecoilBridgeAcrossReactRoots_UNSTABLE:wF,atom:D3,selector:ws,atomFamily:oV,selectorFamily:ui,constSelector:cV,errorSelector:pV,readOnlySelector:gV,noWait:HV,waitForNone:KV,waitForAny:GV,waitForAll:qV,waitForAllSettled:WV,useRecoilValue:NV,useRecoilValueLoadable:DV,useRecoilState:$V,useRecoilStateLoadable:MV,useSetRecoilState:FV,useResetRecoilState:jV,useGetRecoilValueInfo_UNSTABLE:mF,useRecoilRefresher_UNSTABLE:XF,useRecoilValueLoadable_TRANSITION_SUPPORT_UNSTABLE:IV,useRecoilValue_TRANSITION_SUPPORT_UNSTABLE:LV,useRecoilState_TRANSITION_SUPPORT_UNSTABLE:PV,useRecoilCallback:BV,useRecoilTransaction_UNSTABLE:nU,useGotoRecoilSnapshot:UV,useRecoilSnapshot:VV,useRecoilTransactionObserver_UNSTABLE:zV,snapshot_UNSTABLE:TV,useRetain:j5,retentionZone:kV},YV=H5.RecoilRoot,V3=H5.atom,W2=H5.useRecoilState;class sc{constructor(){this.listeners=new Set,this.subscribe=this.subscribe.bind(this)}subscribe(t){const n={listener:t};return this.listeners.add(n),this.onSubscribe(),()=>{this.listeners.delete(n),this.onUnsubscribe()}}hasListeners(){return this.listeners.size>0}onSubscribe(){}onUnsubscribe(){}}const Ru=typeof window>"u"||"Deno"in window;function kn(){}function QV(e,t){return typeof e=="function"?e(t):e}function j0(e){return typeof e=="number"&&e>=0&&e!==1/0}function z3(e,t){return Math.max(e+(t||0)-Date.now(),0)}function Dl(e,t,n){return kh(e)?typeof t=="function"?{...n,queryKey:e,queryFn:t}:{...t,queryKey:e}:e}function Ao(e,t,n){return kh(e)?[{...t,queryKey:e},n]:[e||{},t]}function G2(e,t){const{type:n="all",exact:r,fetchStatus:o,predicate:i,queryKey:a,stale:s}=e;if(kh(a)){if(r){if(t.queryHash!==q5(a,t.options))return!1}else if(!Tf(t.queryKey,a))return!1}if(n!=="all"){const l=t.isActive();if(n==="active"&&!l||n==="inactive"&&l)return!1}return!(typeof s=="boolean"&&t.isStale()!==s||typeof o<"u"&&o!==t.state.fetchStatus||i&&!i(t))}function K2(e,t){const{exact:n,fetching:r,predicate:o,mutationKey:i}=e;if(kh(i)){if(!t.options.mutationKey)return!1;if(n){if(Ti(t.options.mutationKey)!==Ti(i))return!1}else if(!Tf(t.options.mutationKey,i))return!1}return!(typeof r=="boolean"&&t.state.status==="loading"!==r||o&&!o(t))}function q5(e,t){return((t==null?void 0:t.queryKeyHashFn)||Ti)(e)}function Ti(e){return JSON.stringify(e,(t,n)=>U0(n)?Object.keys(n).sort().reduce((r,o)=>(r[o]=n[o],r),{}):n)}function Tf(e,t){return B3(e,t)}function B3(e,t){return e===t?!0:typeof e!=typeof t?!1:e&&t&&typeof e=="object"&&typeof t=="object"?!Object.keys(t).some(n=>!B3(e[n],t[n])):!1}function H3(e,t){if(e===t)return e;const n=Y2(e)&&Y2(t);if(n||U0(e)&&U0(t)){const r=n?e.length:Object.keys(e).length,o=n?t:Object.keys(t),i=o.length,a=n?[]:{};let s=0;for(let l=0;l"u")return!0;const n=t.prototype;return!(!Q2(n)||!n.hasOwnProperty("isPrototypeOf"))}function Q2(e){return Object.prototype.toString.call(e)==="[object Object]"}function kh(e){return Array.isArray(e)}function q3(e){return new Promise(t=>{setTimeout(t,e)})}function X2(e){q3(0).then(e)}function XV(){if(typeof AbortController=="function")return new AbortController}function V0(e,t,n){return n.isDataEqual!=null&&n.isDataEqual(e,t)?e:typeof n.structuralSharing=="function"?n.structuralSharing(e,t):n.structuralSharing!==!1?H3(e,t):t}class ZV extends sc{constructor(){super(),this.setup=t=>{if(!Ru&&window.addEventListener){const n=()=>t();return window.addEventListener("visibilitychange",n,!1),window.addEventListener("focus",n,!1),()=>{window.removeEventListener("visibilitychange",n),window.removeEventListener("focus",n)}}}}onSubscribe(){this.cleanup||this.setEventListener(this.setup)}onUnsubscribe(){if(!this.hasListeners()){var t;(t=this.cleanup)==null||t.call(this),this.cleanup=void 0}}setEventListener(t){var n;this.setup=t,(n=this.cleanup)==null||n.call(this),this.cleanup=t(r=>{typeof r=="boolean"?this.setFocused(r):this.onFocus()})}setFocused(t){this.focused!==t&&(this.focused=t,this.onFocus())}onFocus(){this.listeners.forEach(({listener:t})=>{t()})}isFocused(){return typeof this.focused=="boolean"?this.focused:typeof document>"u"?!0:[void 0,"visible","prerender"].includes(document.visibilityState)}}const $f=new ZV,Z2=["online","offline"];class JV extends sc{constructor(){super(),this.setup=t=>{if(!Ru&&window.addEventListener){const n=()=>t();return Z2.forEach(r=>{window.addEventListener(r,n,!1)}),()=>{Z2.forEach(r=>{window.removeEventListener(r,n)})}}}}onSubscribe(){this.cleanup||this.setEventListener(this.setup)}onUnsubscribe(){if(!this.hasListeners()){var t;(t=this.cleanup)==null||t.call(this),this.cleanup=void 0}}setEventListener(t){var n;this.setup=t,(n=this.cleanup)==null||n.call(this),this.cleanup=t(r=>{typeof r=="boolean"?this.setOnline(r):this.onOnline()})}setOnline(t){this.online!==t&&(this.online=t,this.onOnline())}onOnline(){this.listeners.forEach(({listener:t})=>{t()})}isOnline(){return typeof this.online=="boolean"?this.online:typeof navigator>"u"||typeof navigator.onLine>"u"?!0:navigator.onLine}}const Pf=new JV;function ez(e){return Math.min(1e3*2**e,3e4)}function Th(e){return(e??"online")==="online"?Pf.isOnline():!0}class W3{constructor(t){this.revert=t==null?void 0:t.revert,this.silent=t==null?void 0:t.silent}}function Td(e){return e instanceof W3}function G3(e){let t=!1,n=0,r=!1,o,i,a;const s=new Promise((b,y)=>{i=b,a=y}),l=b=>{r||(p(new W3(b)),e.abort==null||e.abort())},u=()=>{t=!0},c=()=>{t=!1},d=()=>!$f.isFocused()||e.networkMode!=="always"&&!Pf.isOnline(),f=b=>{r||(r=!0,e.onSuccess==null||e.onSuccess(b),o==null||o(),i(b))},p=b=>{r||(r=!0,e.onError==null||e.onError(b),o==null||o(),a(b))},g=()=>new Promise(b=>{o=y=>{const h=r||!d();return h&&b(y),h},e.onPause==null||e.onPause()}).then(()=>{o=void 0,r||e.onContinue==null||e.onContinue()}),v=()=>{if(r)return;let b;try{b=e.fn()}catch(y){b=Promise.reject(y)}Promise.resolve(b).then(f).catch(y=>{var h,_;if(r)return;const x=(h=e.retry)!=null?h:3,w=(_=e.retryDelay)!=null?_:ez,S=typeof w=="function"?w(n,y):w,A=x===!0||typeof x=="number"&&n{if(d())return g()}).then(()=>{t?p(y):v()})})};return Th(e.networkMode)?v():g().then(v),{promise:s,cancel:l,continue:()=>(o==null?void 0:o())?s:Promise.resolve(),cancelRetry:u,continueRetry:c}}const W5=console;function tz(){let e=[],t=0,n=c=>{c()},r=c=>{c()};const o=c=>{let d;t++;try{d=c()}finally{t--,t||s()}return d},i=c=>{t?e.push(c):X2(()=>{n(c)})},a=c=>(...d)=>{i(()=>{c(...d)})},s=()=>{const c=e;e=[],c.length&&X2(()=>{r(()=>{c.forEach(d=>{n(d)})})})};return{batch:o,batchCalls:a,schedule:i,setNotifyFunction:c=>{n=c},setBatchNotifyFunction:c=>{r=c}}}const ut=tz();class K3{destroy(){this.clearGcTimeout()}scheduleGc(){this.clearGcTimeout(),j0(this.cacheTime)&&(this.gcTimeout=setTimeout(()=>{this.optionalRemove()},this.cacheTime))}updateCacheTime(t){this.cacheTime=Math.max(this.cacheTime||0,t??(Ru?1/0:5*60*1e3))}clearGcTimeout(){this.gcTimeout&&(clearTimeout(this.gcTimeout),this.gcTimeout=void 0)}}class nz extends K3{constructor(t){super(),this.abortSignalConsumed=!1,this.defaultOptions=t.defaultOptions,this.setOptions(t.options),this.observers=[],this.cache=t.cache,this.logger=t.logger||W5,this.queryKey=t.queryKey,this.queryHash=t.queryHash,this.initialState=t.state||rz(this.options),this.state=this.initialState,this.scheduleGc()}get meta(){return this.options.meta}setOptions(t){this.options={...this.defaultOptions,...t},this.updateCacheTime(this.options.cacheTime)}optionalRemove(){!this.observers.length&&this.state.fetchStatus==="idle"&&this.cache.remove(this)}setData(t,n){const r=V0(this.state.data,t,this.options);return this.dispatch({data:r,type:"success",dataUpdatedAt:n==null?void 0:n.updatedAt,manual:n==null?void 0:n.manual}),r}setState(t,n){this.dispatch({type:"setState",state:t,setStateOptions:n})}cancel(t){var n;const r=this.promise;return(n=this.retryer)==null||n.cancel(t),r?r.then(kn).catch(kn):Promise.resolve()}destroy(){super.destroy(),this.cancel({silent:!0})}reset(){this.destroy(),this.setState(this.initialState)}isActive(){return this.observers.some(t=>t.options.enabled!==!1)}isDisabled(){return this.getObserversCount()>0&&!this.isActive()}isStale(){return this.state.isInvalidated||!this.state.dataUpdatedAt||this.observers.some(t=>t.getCurrentResult().isStale)}isStaleByTime(t=0){return this.state.isInvalidated||!this.state.dataUpdatedAt||!z3(this.state.dataUpdatedAt,t)}onFocus(){var t;const n=this.observers.find(r=>r.shouldFetchOnWindowFocus());n&&n.refetch({cancelRefetch:!1}),(t=this.retryer)==null||t.continue()}onOnline(){var t;const n=this.observers.find(r=>r.shouldFetchOnReconnect());n&&n.refetch({cancelRefetch:!1}),(t=this.retryer)==null||t.continue()}addObserver(t){this.observers.includes(t)||(this.observers.push(t),this.clearGcTimeout(),this.cache.notify({type:"observerAdded",query:this,observer:t}))}removeObserver(t){this.observers.includes(t)&&(this.observers=this.observers.filter(n=>n!==t),this.observers.length||(this.retryer&&(this.abortSignalConsumed?this.retryer.cancel({revert:!0}):this.retryer.cancelRetry()),this.scheduleGc()),this.cache.notify({type:"observerRemoved",query:this,observer:t}))}getObserversCount(){return this.observers.length}invalidate(){this.state.isInvalidated||this.dispatch({type:"invalidate"})}fetch(t,n){var r,o;if(this.state.fetchStatus!=="idle"){if(this.state.dataUpdatedAt&&n!=null&&n.cancelRefetch)this.cancel({silent:!0});else if(this.promise){var i;return(i=this.retryer)==null||i.continueRetry(),this.promise}}if(t&&this.setOptions(t),!this.options.queryFn){const p=this.observers.find(g=>g.options.queryFn);p&&this.setOptions(p.options)}const a=XV(),s={queryKey:this.queryKey,pageParam:void 0,meta:this.meta},l=p=>{Object.defineProperty(p,"signal",{enumerable:!0,get:()=>{if(a)return this.abortSignalConsumed=!0,a.signal}})};l(s);const u=()=>this.options.queryFn?(this.abortSignalConsumed=!1,this.options.queryFn(s)):Promise.reject("Missing queryFn for queryKey '"+this.options.queryHash+"'"),c={fetchOptions:n,options:this.options,queryKey:this.queryKey,state:this.state,fetchFn:u};if(l(c),(r=this.options.behavior)==null||r.onFetch(c),this.revertState=this.state,this.state.fetchStatus==="idle"||this.state.fetchMeta!==((o=c.fetchOptions)==null?void 0:o.meta)){var d;this.dispatch({type:"fetch",meta:(d=c.fetchOptions)==null?void 0:d.meta})}const f=p=>{if(Td(p)&&p.silent||this.dispatch({type:"error",error:p}),!Td(p)){var g,v,b,y;(g=(v=this.cache.config).onError)==null||g.call(v,p,this),(b=(y=this.cache.config).onSettled)==null||b.call(y,this.state.data,p,this)}this.isFetchingOptimistic||this.scheduleGc(),this.isFetchingOptimistic=!1};return this.retryer=G3({fn:c.fetchFn,abort:a==null?void 0:a.abort.bind(a),onSuccess:p=>{var g,v,b,y;if(typeof p>"u"){f(new Error(this.queryHash+" data is undefined"));return}this.setData(p),(g=(v=this.cache.config).onSuccess)==null||g.call(v,p,this),(b=(y=this.cache.config).onSettled)==null||b.call(y,p,this.state.error,this),this.isFetchingOptimistic||this.scheduleGc(),this.isFetchingOptimistic=!1},onError:f,onFail:(p,g)=>{this.dispatch({type:"failed",failureCount:p,error:g})},onPause:()=>{this.dispatch({type:"pause"})},onContinue:()=>{this.dispatch({type:"continue"})},retry:c.options.retry,retryDelay:c.options.retryDelay,networkMode:c.options.networkMode}),this.promise=this.retryer.promise,this.promise}dispatch(t){const n=r=>{var o,i;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,fetchFailureCount:0,fetchFailureReason:null,fetchMeta:(o=t.meta)!=null?o:null,fetchStatus:Th(this.options.networkMode)?"fetching":"paused",...!r.dataUpdatedAt&&{error:null,status:"loading"}};case"success":return{...r,data:t.data,dataUpdateCount:r.dataUpdateCount+1,dataUpdatedAt:(i=t.dataUpdatedAt)!=null?i:Date.now(),error:null,isInvalidated:!1,status:"success",...!t.manual&&{fetchStatus:"idle",fetchFailureCount:0,fetchFailureReason:null}};case"error":const a=t.error;return Td(a)&&a.revert&&this.revertState?{...this.revertState,fetchStatus:"idle"}:{...r,error:a,errorUpdateCount:r.errorUpdateCount+1,errorUpdatedAt:Date.now(),fetchFailureCount:r.fetchFailureCount+1,fetchFailureReason:a,fetchStatus:"idle",status:"error"};case"invalidate":return{...r,isInvalidated:!0};case"setState":return{...r,...t.state}}};this.state=n(this.state),ut.batch(()=>{this.observers.forEach(r=>{r.onQueryUpdate(t)}),this.cache.notify({query:this,type:"updated",action:t})})}}function rz(e){const t=typeof e.initialData=="function"?e.initialData():e.initialData,n=typeof t<"u",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":"loading",fetchStatus:"idle"}}class oz extends sc{constructor(t){super(),this.config=t||{},this.queries=[],this.queriesMap={}}build(t,n,r){var o;const i=n.queryKey,a=(o=n.queryHash)!=null?o:q5(i,n);let s=this.get(a);return s||(s=new nz({cache:this,logger:t.getLogger(),queryKey:i,queryHash:a,options:t.defaultQueryOptions(n),state:r,defaultOptions:t.getQueryDefaults(i)}),this.add(s)),s}add(t){this.queriesMap[t.queryHash]||(this.queriesMap[t.queryHash]=t,this.queries.push(t),this.notify({type:"added",query:t}))}remove(t){const n=this.queriesMap[t.queryHash];n&&(t.destroy(),this.queries=this.queries.filter(r=>r!==t),n===t&&delete this.queriesMap[t.queryHash],this.notify({type:"removed",query:t}))}clear(){ut.batch(()=>{this.queries.forEach(t=>{this.remove(t)})})}get(t){return this.queriesMap[t]}getAll(){return this.queries}find(t,n){const[r]=Ao(t,n);return typeof r.exact>"u"&&(r.exact=!0),this.queries.find(o=>G2(r,o))}findAll(t,n){const[r]=Ao(t,n);return Object.keys(r).length>0?this.queries.filter(o=>G2(r,o)):this.queries}notify(t){ut.batch(()=>{this.listeners.forEach(({listener:n})=>{n(t)})})}onFocus(){ut.batch(()=>{this.queries.forEach(t=>{t.onFocus()})})}onOnline(){ut.batch(()=>{this.queries.forEach(t=>{t.onOnline()})})}}class iz extends K3{constructor(t){super(),this.defaultOptions=t.defaultOptions,this.mutationId=t.mutationId,this.mutationCache=t.mutationCache,this.logger=t.logger||W5,this.observers=[],this.state=t.state||az(),this.setOptions(t.options),this.scheduleGc()}setOptions(t){this.options={...this.defaultOptions,...t},this.updateCacheTime(this.options.cacheTime)}get meta(){return this.options.meta}setState(t){this.dispatch({type:"setState",state:t})}addObserver(t){this.observers.includes(t)||(this.observers.push(t),this.clearGcTimeout(),this.mutationCache.notify({type:"observerAdded",mutation:this,observer:t}))}removeObserver(t){this.observers=this.observers.filter(n=>n!==t),this.scheduleGc(),this.mutationCache.notify({type:"observerRemoved",mutation:this,observer:t})}optionalRemove(){this.observers.length||(this.state.status==="loading"?this.scheduleGc():this.mutationCache.remove(this))}continue(){var t,n;return(t=(n=this.retryer)==null?void 0:n.continue())!=null?t:this.execute()}async execute(){const t=()=>{var A;return this.retryer=G3({fn:()=>this.options.mutationFn?this.options.mutationFn(this.state.variables):Promise.reject("No mutationFn found"),onFail:(C,R)=>{this.dispatch({type:"failed",failureCount:C,error:R})},onPause:()=>{this.dispatch({type:"pause"})},onContinue:()=>{this.dispatch({type:"continue"})},retry:(A=this.options.retry)!=null?A:0,retryDelay:this.options.retryDelay,networkMode:this.options.networkMode}),this.retryer.promise},n=this.state.status==="loading";try{var r,o,i,a,s,l,u,c;if(!n){var d,f,p,g;this.dispatch({type:"loading",variables:this.options.variables}),await((d=(f=this.mutationCache.config).onMutate)==null?void 0:d.call(f,this.state.variables,this));const C=await((p=(g=this.options).onMutate)==null?void 0:p.call(g,this.state.variables));C!==this.state.context&&this.dispatch({type:"loading",context:C,variables:this.state.variables})}const A=await t();return await((r=(o=this.mutationCache.config).onSuccess)==null?void 0:r.call(o,A,this.state.variables,this.state.context,this)),await((i=(a=this.options).onSuccess)==null?void 0:i.call(a,A,this.state.variables,this.state.context)),await((s=(l=this.mutationCache.config).onSettled)==null?void 0:s.call(l,A,null,this.state.variables,this.state.context,this)),await((u=(c=this.options).onSettled)==null?void 0:u.call(c,A,null,this.state.variables,this.state.context)),this.dispatch({type:"success",data:A}),A}catch(A){try{var v,b,y,h,_,x,w,S;throw await((v=(b=this.mutationCache.config).onError)==null?void 0:v.call(b,A,this.state.variables,this.state.context,this)),await((y=(h=this.options).onError)==null?void 0:y.call(h,A,this.state.variables,this.state.context)),await((_=(x=this.mutationCache.config).onSettled)==null?void 0:_.call(x,void 0,A,this.state.variables,this.state.context,this)),await((w=(S=this.options).onSettled)==null?void 0:w.call(S,void 0,A,this.state.variables,this.state.context)),A}finally{this.dispatch({type:"error",error:A})}}}dispatch(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"loading":return{...r,context:t.context,data:void 0,failureCount:0,failureReason:null,error:null,isPaused:!Th(this.options.networkMode),status:"loading",variables:t.variables};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"};case"setState":return{...r,...t.state}}};this.state=n(this.state),ut.batch(()=>{this.observers.forEach(r=>{r.onMutationUpdate(t)}),this.mutationCache.notify({mutation:this,type:"updated",action:t})})}}function az(){return{context:void 0,data:void 0,error:null,failureCount:0,failureReason:null,isPaused:!1,status:"idle",variables:void 0}}class sz extends sc{constructor(t){super(),this.config=t||{},this.mutations=[],this.mutationId=0}build(t,n,r){const o=new iz({mutationCache:this,logger:t.getLogger(),mutationId:++this.mutationId,options:t.defaultMutationOptions(n),state:r,defaultOptions:n.mutationKey?t.getMutationDefaults(n.mutationKey):void 0});return this.add(o),o}add(t){this.mutations.push(t),this.notify({type:"added",mutation:t})}remove(t){this.mutations=this.mutations.filter(n=>n!==t),this.notify({type:"removed",mutation:t})}clear(){ut.batch(()=>{this.mutations.forEach(t=>{this.remove(t)})})}getAll(){return this.mutations}find(t){return typeof t.exact>"u"&&(t.exact=!0),this.mutations.find(n=>K2(t,n))}findAll(t){return this.mutations.filter(n=>K2(t,n))}notify(t){ut.batch(()=>{this.listeners.forEach(({listener:n})=>{n(t)})})}resumePausedMutations(){var t;return this.resuming=((t=this.resuming)!=null?t:Promise.resolve()).then(()=>{const n=this.mutations.filter(r=>r.state.isPaused);return ut.batch(()=>n.reduce((r,o)=>r.then(()=>o.continue().catch(kn)),Promise.resolve()))}).then(()=>{this.resuming=void 0}),this.resuming}}function lz(){return{onFetch:e=>{e.fetchFn=()=>{var t,n,r,o,i,a;const s=(t=e.fetchOptions)==null||(n=t.meta)==null?void 0:n.refetchPage,l=(r=e.fetchOptions)==null||(o=r.meta)==null?void 0:o.fetchMore,u=l==null?void 0:l.pageParam,c=(l==null?void 0:l.direction)==="forward",d=(l==null?void 0:l.direction)==="backward",f=((i=e.state.data)==null?void 0:i.pages)||[],p=((a=e.state.data)==null?void 0:a.pageParams)||[];let g=p,v=!1;const b=S=>{Object.defineProperty(S,"signal",{enumerable:!0,get:()=>{var A;if((A=e.signal)!=null&&A.aborted)v=!0;else{var C;(C=e.signal)==null||C.addEventListener("abort",()=>{v=!0})}return e.signal}})},y=e.options.queryFn||(()=>Promise.reject("Missing queryFn for queryKey '"+e.options.queryHash+"'")),h=(S,A,C,R)=>(g=R?[A,...g]:[...g,A],R?[C,...S]:[...S,C]),_=(S,A,C,R)=>{if(v)return Promise.reject("Cancelled");if(typeof C>"u"&&!A&&S.length)return Promise.resolve(S);const O={queryKey:e.queryKey,pageParam:C,meta:e.options.meta};b(O);const k=y(O);return Promise.resolve(k).then($=>h(S,C,$,R))};let x;if(!f.length)x=_([]);else if(c){const S=typeof u<"u",A=S?u:J2(e.options,f);x=_(f,S,A)}else if(d){const S=typeof u<"u",A=S?u:uz(e.options,f);x=_(f,S,A,!0)}else{g=[];const S=typeof e.options.getNextPageParam>"u";x=(s&&f[0]?s(f[0],0,f):!0)?_([],S,p[0]):Promise.resolve(h([],p[0],f[0]));for(let C=1;C{if(s&&f[C]?s(f[C],C,f):!0){const k=S?p[C]:J2(e.options,R);return _(R,S,k)}return Promise.resolve(h(R,p[C],f[C]))})}return x.then(S=>({pages:S,pageParams:g}))}}}}function J2(e,t){return e.getNextPageParam==null?void 0:e.getNextPageParam(t[t.length-1],t)}function uz(e,t){return e.getPreviousPageParam==null?void 0:e.getPreviousPageParam(t[0],t)}class cz{constructor(t={}){this.queryCache=t.queryCache||new oz,this.mutationCache=t.mutationCache||new sz,this.logger=t.logger||W5,this.defaultOptions=t.defaultOptions||{},this.queryDefaults=[],this.mutationDefaults=[],this.mountCount=0}mount(){this.mountCount++,this.mountCount===1&&(this.unsubscribeFocus=$f.subscribe(()=>{$f.isFocused()&&(this.resumePausedMutations(),this.queryCache.onFocus())}),this.unsubscribeOnline=Pf.subscribe(()=>{Pf.isOnline()&&(this.resumePausedMutations(),this.queryCache.onOnline())}))}unmount(){var t,n;this.mountCount--,this.mountCount===0&&((t=this.unsubscribeFocus)==null||t.call(this),this.unsubscribeFocus=void 0,(n=this.unsubscribeOnline)==null||n.call(this),this.unsubscribeOnline=void 0)}isFetching(t,n){const[r]=Ao(t,n);return r.fetchStatus="fetching",this.queryCache.findAll(r).length}isMutating(t){return this.mutationCache.findAll({...t,fetching:!0}).length}getQueryData(t,n){var r;return(r=this.queryCache.find(t,n))==null?void 0:r.state.data}ensureQueryData(t,n,r){const o=Dl(t,n,r),i=this.getQueryData(o.queryKey);return i?Promise.resolve(i):this.fetchQuery(o)}getQueriesData(t){return this.getQueryCache().findAll(t).map(({queryKey:n,state:r})=>{const o=r.data;return[n,o]})}setQueryData(t,n,r){const o=this.queryCache.find(t),i=o==null?void 0:o.state.data,a=QV(n,i);if(typeof a>"u")return;const s=Dl(t),l=this.defaultQueryOptions(s);return this.queryCache.build(this,l).setData(a,{...r,manual:!0})}setQueriesData(t,n,r){return ut.batch(()=>this.getQueryCache().findAll(t).map(({queryKey:o})=>[o,this.setQueryData(o,n,r)]))}getQueryState(t,n){var r;return(r=this.queryCache.find(t,n))==null?void 0:r.state}removeQueries(t,n){const[r]=Ao(t,n),o=this.queryCache;ut.batch(()=>{o.findAll(r).forEach(i=>{o.remove(i)})})}resetQueries(t,n,r){const[o,i]=Ao(t,n,r),a=this.queryCache,s={type:"active",...o};return ut.batch(()=>(a.findAll(o).forEach(l=>{l.reset()}),this.refetchQueries(s,i)))}cancelQueries(t,n,r){const[o,i={}]=Ao(t,n,r);typeof i.revert>"u"&&(i.revert=!0);const a=ut.batch(()=>this.queryCache.findAll(o).map(s=>s.cancel(i)));return Promise.all(a).then(kn).catch(kn)}invalidateQueries(t,n,r){const[o,i]=Ao(t,n,r);return ut.batch(()=>{var a,s;if(this.queryCache.findAll(o).forEach(u=>{u.invalidate()}),o.refetchType==="none")return Promise.resolve();const l={...o,type:(a=(s=o.refetchType)!=null?s:o.type)!=null?a:"active"};return this.refetchQueries(l,i)})}refetchQueries(t,n,r){const[o,i]=Ao(t,n,r),a=ut.batch(()=>this.queryCache.findAll(o).filter(l=>!l.isDisabled()).map(l=>{var u;return l.fetch(void 0,{...i,cancelRefetch:(u=i==null?void 0:i.cancelRefetch)!=null?u:!0,meta:{refetchPage:o.refetchPage}})}));let s=Promise.all(a).then(kn);return i!=null&&i.throwOnError||(s=s.catch(kn)),s}fetchQuery(t,n,r){const o=Dl(t,n,r),i=this.defaultQueryOptions(o);typeof i.retry>"u"&&(i.retry=!1);const a=this.queryCache.build(this,i);return a.isStaleByTime(i.staleTime)?a.fetch(i):Promise.resolve(a.state.data)}prefetchQuery(t,n,r){return this.fetchQuery(t,n,r).then(kn).catch(kn)}fetchInfiniteQuery(t,n,r){const o=Dl(t,n,r);return o.behavior=lz(),this.fetchQuery(o)}prefetchInfiniteQuery(t,n,r){return this.fetchInfiniteQuery(t,n,r).then(kn).catch(kn)}resumePausedMutations(){return this.mutationCache.resumePausedMutations()}getQueryCache(){return this.queryCache}getMutationCache(){return this.mutationCache}getLogger(){return this.logger}getDefaultOptions(){return this.defaultOptions}setDefaultOptions(t){this.defaultOptions=t}setQueryDefaults(t,n){const r=this.queryDefaults.find(o=>Ti(t)===Ti(o.queryKey));r?r.defaultOptions=n:this.queryDefaults.push({queryKey:t,defaultOptions:n})}getQueryDefaults(t){if(!t)return;const n=this.queryDefaults.find(r=>Tf(t,r.queryKey));return n==null?void 0:n.defaultOptions}setMutationDefaults(t,n){const r=this.mutationDefaults.find(o=>Ti(t)===Ti(o.mutationKey));r?r.defaultOptions=n:this.mutationDefaults.push({mutationKey:t,defaultOptions:n})}getMutationDefaults(t){if(!t)return;const n=this.mutationDefaults.find(r=>Tf(t,r.mutationKey));return n==null?void 0:n.defaultOptions}defaultQueryOptions(t){if(t!=null&&t._defaulted)return t;const n={...this.defaultOptions.queries,...this.getQueryDefaults(t==null?void 0:t.queryKey),...t,_defaulted:!0};return!n.queryHash&&n.queryKey&&(n.queryHash=q5(n.queryKey,n)),typeof n.refetchOnReconnect>"u"&&(n.refetchOnReconnect=n.networkMode!=="always"),typeof n.useErrorBoundary>"u"&&(n.useErrorBoundary=!!n.suspense),n}defaultMutationOptions(t){return t!=null&&t._defaulted?t:{...this.defaultOptions.mutations,...this.getMutationDefaults(t==null?void 0:t.mutationKey),...t,_defaulted:!0}}clear(){this.queryCache.clear(),this.mutationCache.clear()}}class dz extends sc{constructor(t,n){super(),this.client=t,this.options=n,this.trackedProps=new Set,this.selectError=null,this.bindMethods(),this.setOptions(n)}bindMethods(){this.remove=this.remove.bind(this),this.refetch=this.refetch.bind(this)}onSubscribe(){this.listeners.size===1&&(this.currentQuery.addObserver(this),ew(this.currentQuery,this.options)&&this.executeFetch(),this.updateTimers())}onUnsubscribe(){this.hasListeners()||this.destroy()}shouldFetchOnReconnect(){return z0(this.currentQuery,this.options,this.options.refetchOnReconnect)}shouldFetchOnWindowFocus(){return z0(this.currentQuery,this.options,this.options.refetchOnWindowFocus)}destroy(){this.listeners=new Set,this.clearStaleTimeout(),this.clearRefetchInterval(),this.currentQuery.removeObserver(this)}setOptions(t,n){const r=this.options,o=this.currentQuery;if(this.options=this.client.defaultQueryOptions(t),F0(r,this.options)||this.client.getQueryCache().notify({type:"observerOptionsUpdated",query:this.currentQuery,observer:this}),typeof this.options.enabled<"u"&&typeof this.options.enabled!="boolean")throw new Error("Expected enabled to be a boolean");this.options.queryKey||(this.options.queryKey=r.queryKey),this.updateQuery();const i=this.hasListeners();i&&tw(this.currentQuery,o,this.options,r)&&this.executeFetch(),this.updateResult(n),i&&(this.currentQuery!==o||this.options.enabled!==r.enabled||this.options.staleTime!==r.staleTime)&&this.updateStaleTimeout();const a=this.computeRefetchInterval();i&&(this.currentQuery!==o||this.options.enabled!==r.enabled||a!==this.currentRefetchInterval)&&this.updateRefetchInterval(a)}getOptimisticResult(t){const n=this.client.getQueryCache().build(this.client,t),r=this.createResult(n,t);return pz(this,r,t)&&(this.currentResult=r,this.currentResultOptions=this.options,this.currentResultState=this.currentQuery.state),r}getCurrentResult(){return this.currentResult}trackResult(t){const n={};return Object.keys(t).forEach(r=>{Object.defineProperty(n,r,{configurable:!1,enumerable:!0,get:()=>(this.trackedProps.add(r),t[r])})}),n}getCurrentQuery(){return this.currentQuery}remove(){this.client.getQueryCache().remove(this.currentQuery)}refetch({refetchPage:t,...n}={}){return this.fetch({...n,meta:{refetchPage:t}})}fetchOptimistic(t){const n=this.client.defaultQueryOptions(t),r=this.client.getQueryCache().build(this.client,n);return r.isFetchingOptimistic=!0,r.fetch().then(()=>this.createResult(r,n))}fetch(t){var n;return this.executeFetch({...t,cancelRefetch:(n=t.cancelRefetch)!=null?n:!0}).then(()=>(this.updateResult(),this.currentResult))}executeFetch(t){this.updateQuery();let n=this.currentQuery.fetch(this.options,t);return t!=null&&t.throwOnError||(n=n.catch(kn)),n}updateStaleTimeout(){if(this.clearStaleTimeout(),Ru||this.currentResult.isStale||!j0(this.options.staleTime))return;const n=z3(this.currentResult.dataUpdatedAt,this.options.staleTime)+1;this.staleTimeoutId=setTimeout(()=>{this.currentResult.isStale||this.updateResult()},n)}computeRefetchInterval(){var t;return typeof this.options.refetchInterval=="function"?this.options.refetchInterval(this.currentResult.data,this.currentQuery):(t=this.options.refetchInterval)!=null?t:!1}updateRefetchInterval(t){this.clearRefetchInterval(),this.currentRefetchInterval=t,!(Ru||this.options.enabled===!1||!j0(this.currentRefetchInterval)||this.currentRefetchInterval===0)&&(this.refetchIntervalId=setInterval(()=>{(this.options.refetchIntervalInBackground||$f.isFocused())&&this.executeFetch()},this.currentRefetchInterval))}updateTimers(){this.updateStaleTimeout(),this.updateRefetchInterval(this.computeRefetchInterval())}clearStaleTimeout(){this.staleTimeoutId&&(clearTimeout(this.staleTimeoutId),this.staleTimeoutId=void 0)}clearRefetchInterval(){this.refetchIntervalId&&(clearInterval(this.refetchIntervalId),this.refetchIntervalId=void 0)}createResult(t,n){const r=this.currentQuery,o=this.options,i=this.currentResult,a=this.currentResultState,s=this.currentResultOptions,l=t!==r,u=l?t.state:this.currentQueryInitialState,c=l?this.currentResult:this.previousQueryResult,{state:d}=t;let{dataUpdatedAt:f,error:p,errorUpdatedAt:g,fetchStatus:v,status:b}=d,y=!1,h=!1,_;if(n._optimisticResults){const C=this.hasListeners(),R=!C&&ew(t,n),O=C&&tw(t,r,n,o);(R||O)&&(v=Th(t.options.networkMode)?"fetching":"paused",f||(b="loading")),n._optimisticResults==="isRestoring"&&(v="idle")}if(n.keepPreviousData&&!d.dataUpdatedAt&&c!=null&&c.isSuccess&&b!=="error")_=c.data,f=c.dataUpdatedAt,b=c.status,y=!0;else if(n.select&&typeof d.data<"u")if(i&&d.data===(a==null?void 0:a.data)&&n.select===this.selectFn)_=this.selectResult;else try{this.selectFn=n.select,_=n.select(d.data),_=V0(i==null?void 0:i.data,_,n),this.selectResult=_,this.selectError=null}catch(C){this.selectError=C}else _=d.data;if(typeof n.placeholderData<"u"&&typeof _>"u"&&b==="loading"){let C;if(i!=null&&i.isPlaceholderData&&n.placeholderData===(s==null?void 0:s.placeholderData))C=i.data;else if(C=typeof n.placeholderData=="function"?n.placeholderData():n.placeholderData,n.select&&typeof C<"u")try{C=n.select(C),this.selectError=null}catch(R){this.selectError=R}typeof C<"u"&&(b="success",_=V0(i==null?void 0:i.data,C,n),h=!0)}this.selectError&&(p=this.selectError,_=this.selectResult,g=Date.now(),b="error");const x=v==="fetching",w=b==="loading",S=b==="error";return{status:b,fetchStatus:v,isLoading:w,isSuccess:b==="success",isError:S,isInitialLoading:w&&x,data:_,dataUpdatedAt:f,error:p,errorUpdatedAt:g,failureCount:d.fetchFailureCount,failureReason:d.fetchFailureReason,errorUpdateCount:d.errorUpdateCount,isFetched:d.dataUpdateCount>0||d.errorUpdateCount>0,isFetchedAfterMount:d.dataUpdateCount>u.dataUpdateCount||d.errorUpdateCount>u.errorUpdateCount,isFetching:x,isRefetching:x&&!w,isLoadingError:S&&d.dataUpdatedAt===0,isPaused:v==="paused",isPlaceholderData:h,isPreviousData:y,isRefetchError:S&&d.dataUpdatedAt!==0,isStale:G5(t,n),refetch:this.refetch,remove:this.remove}}updateResult(t){const n=this.currentResult,r=this.createResult(this.currentQuery,this.options);if(this.currentResultState=this.currentQuery.state,this.currentResultOptions=this.options,F0(r,n))return;this.currentResult=r;const o={cache:!0},i=()=>{if(!n)return!0;const{notifyOnChangeProps:a}=this.options,s=typeof a=="function"?a():a;if(s==="all"||!s&&!this.trackedProps.size)return!0;const l=new Set(s??this.trackedProps);return this.options.useErrorBoundary&&l.add("error"),Object.keys(this.currentResult).some(u=>{const c=u;return this.currentResult[c]!==n[c]&&l.has(c)})};(t==null?void 0:t.listeners)!==!1&&i()&&(o.listeners=!0),this.notify({...o,...t})}updateQuery(){const t=this.client.getQueryCache().build(this.client,this.options);if(t===this.currentQuery)return;const n=this.currentQuery;this.currentQuery=t,this.currentQueryInitialState=t.state,this.previousQueryResult=this.currentResult,this.hasListeners()&&(n==null||n.removeObserver(this),t.addObserver(this))}onQueryUpdate(t){const n={};t.type==="success"?n.onSuccess=!t.manual:t.type==="error"&&!Td(t.error)&&(n.onError=!0),this.updateResult(n),this.hasListeners()&&this.updateTimers()}notify(t){ut.batch(()=>{if(t.onSuccess){var n,r,o,i;(n=(r=this.options).onSuccess)==null||n.call(r,this.currentResult.data),(o=(i=this.options).onSettled)==null||o.call(i,this.currentResult.data,null)}else if(t.onError){var a,s,l,u;(a=(s=this.options).onError)==null||a.call(s,this.currentResult.error),(l=(u=this.options).onSettled)==null||l.call(u,void 0,this.currentResult.error)}t.listeners&&this.listeners.forEach(({listener:c})=>{c(this.currentResult)}),t.cache&&this.client.getQueryCache().notify({query:this.currentQuery,type:"observerResultsUpdated"})})}}function fz(e,t){return t.enabled!==!1&&!e.state.dataUpdatedAt&&!(e.state.status==="error"&&t.retryOnMount===!1)}function ew(e,t){return fz(e,t)||e.state.dataUpdatedAt>0&&z0(e,t,t.refetchOnMount)}function z0(e,t,n){if(t.enabled!==!1){const r=typeof n=="function"?n(e):n;return r==="always"||r!==!1&&G5(e,t)}return!1}function tw(e,t,n,r){return n.enabled!==!1&&(e!==t||r.enabled===!1)&&(!n.suspense||e.state.status!=="error")&&G5(e,n)}function G5(e,t){return e.isStaleByTime(t.staleTime)}function pz(e,t,n){return n.keepPreviousData?!1:n.placeholderData!==void 0?t.isPlaceholderData:!F0(e.getCurrentResult(),t)}var Y3={exports:{}},Q3={};/** + * @license React + * use-sync-external-store-shim.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 Ss=H;function hz(e,t){return e===t&&(e!==0||1/e===1/t)||e!==e&&t!==t}var gz=typeof Object.is=="function"?Object.is:hz,mz=Ss.useState,yz=Ss.useEffect,vz=Ss.useLayoutEffect,_z=Ss.useDebugValue;function bz(e,t){var n=t(),r=mz({inst:{value:n,getSnapshot:t}}),o=r[0].inst,i=r[1];return vz(function(){o.value=n,o.getSnapshot=t,em(o)&&i({inst:o})},[e,n,t]),yz(function(){return em(o)&&i({inst:o}),e(function(){em(o)&&i({inst:o})})},[e]),_z(n),n}function em(e){var t=e.getSnapshot;e=e.value;try{var n=t();return!gz(e,n)}catch{return!0}}function xz(e,t){return t()}var wz=typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"?xz:bz;Q3.useSyncExternalStore=Ss.useSyncExternalStore!==void 0?Ss.useSyncExternalStore:wz;Y3.exports=Q3;var Sz=Y3.exports;const Ez=Sz.useSyncExternalStore,nw=H.createContext(void 0),X3=H.createContext(!1);function Z3(e,t){return e||(t&&typeof window<"u"?(window.ReactQueryClientContext||(window.ReactQueryClientContext=nw),window.ReactQueryClientContext):nw)}const Az=({context:e}={})=>{const t=H.useContext(Z3(e,H.useContext(X3)));if(!t)throw new Error("No QueryClient set, use QueryClientProvider to set one");return t},Cz=({client:e,children:t,context:n,contextSharing:r=!1})=>{H.useEffect(()=>(e.mount(),()=>{e.unmount()}),[e]);const o=Z3(n,r);return H.createElement(X3.Provider,{value:!n&&r},H.createElement(o.Provider,{value:e},t))},J3=H.createContext(!1),Oz=()=>H.useContext(J3);J3.Provider;function Rz(){let e=!1;return{clearReset:()=>{e=!1},reset:()=>{e=!0},isReset:()=>e}}const kz=H.createContext(Rz()),Tz=()=>H.useContext(kz);function $z(e,t){return typeof e=="function"?e(...t):!!e}const Pz=(e,t)=>{(e.suspense||e.useErrorBoundary)&&(t.isReset()||(e.retryOnMount=!1))},Mz=e=>{H.useEffect(()=>{e.clearReset()},[e])},Nz=({result:e,errorResetBoundary:t,useErrorBoundary:n,query:r})=>e.isError&&!t.isReset()&&!e.isFetching&&$z(n,[e.error,r]),Lz=e=>{e.suspense&&typeof e.staleTime!="number"&&(e.staleTime=1e3)},Dz=(e,t)=>e.isLoading&&e.isFetching&&!t,Iz=(e,t,n)=>(e==null?void 0:e.suspense)&&Dz(t,n),jz=(e,t,n)=>t.fetchOptimistic(e).then(({data:r})=>{e.onSuccess==null||e.onSuccess(r),e.onSettled==null||e.onSettled(r,null)}).catch(r=>{n.clearReset(),e.onError==null||e.onError(r),e.onSettled==null||e.onSettled(void 0,r)});function Fz(e,t){const n=Az({context:e.context}),r=Oz(),o=Tz(),i=n.defaultQueryOptions(e);i._optimisticResults=r?"isRestoring":"optimistic",i.onError&&(i.onError=ut.batchCalls(i.onError)),i.onSuccess&&(i.onSuccess=ut.batchCalls(i.onSuccess)),i.onSettled&&(i.onSettled=ut.batchCalls(i.onSettled)),Lz(i),Pz(i,o),Mz(o);const[a]=H.useState(()=>new t(n,i)),s=a.getOptimisticResult(i);if(Ez(H.useCallback(l=>{const u=r?()=>{}:a.subscribe(ut.batchCalls(l));return a.updateResult(),u},[a,r]),()=>a.getCurrentResult(),()=>a.getCurrentResult()),H.useEffect(()=>{a.setOptions(i,{listeners:!1})},[i,a]),Iz(i,s,r))throw jz(i,a,o);if(Nz({result:s,errorResetBoundary:o,useErrorBoundary:i.useErrorBoundary,query:a.getCurrentQuery()}))throw s.error;return i.notifyOnChangeProps?s:a.trackResult(s)}function eR(e,t,n){const r=Dl(e,t,n);return Fz(r,dz)}const tR="Starter App",Uz="This field is required.",nR=8,Vz=`Password must be at least ${nR} characters long`,rR={required:Uz},zz={...rR,minLength:{value:nR,message:Vz}},Bz="/comet-starter/assets/facebook-1522ea1f.svg",Hz="/comet-starter/assets/instagram-8f8ac081.svg",qz="/comet-starter/assets/rss_feed-99a55869.svg",Wz="/comet-starter/assets/twitter-0314c487.svg",Gz="/comet-starter/assets/youtube-7659b4fd.svg",Kz="/comet-starter/img/logo.png",Yz=()=>{const e=t=>{t.preventDefault(),window.scrollTo(0,0)};return N.jsxs("footer",{className:"usa-footer",children:[N.jsx("div",{className:"grid-container usa-footer__return-to-top",children:N.jsx("a",{href:"/#",onClick:t=>{e(t)},children:"Return to top"})}),N.jsx("div",{className:"usa-footer__primary-section",children:N.jsx("nav",{className:"usa-footer__nav","aria-label":"Footer navigation",children:N.jsxs("ul",{className:"grid-row grid-gap",children:[N.jsx("li",{className:` + mobile-lg:grid-col-4 + desktop:grid-col-auto + usa-footer__primary-content + `,children:N.jsx("a",{className:"usa-footer__primary-link",href:"/#",children:""})}),N.jsx("li",{className:` + mobile-lg:grid-col-4 + desktop:grid-col-auto + usa-footer__primary-content + `,children:N.jsx("a",{className:"usa-footer__primary-link",href:"/#",children:""})}),N.jsx("li",{className:` + mobile-lg:grid-col-4 + desktop:grid-col-auto + usa-footer__primary-content + `,children:N.jsx("a",{className:"usa-footer__primary-link",href:"/#",children:""})}),N.jsx("li",{className:` + mobile-lg:grid-col-4 + desktop:grid-col-auto + usa-footer__primary-content + `,children:N.jsx("a",{className:"usa-footer__primary-link",href:"/#",children:""})}),N.jsx("li",{className:` + mobile-lg:grid-col-4 + desktop:grid-col-auto + usa-footer__primary-content + `,children:N.jsx("a",{className:"usa-footer__primary-link",href:"/#",children:""})})]})})}),N.jsx("div",{className:"usa-footer__secondary-section",children:N.jsx("div",{className:"grid-container",children:N.jsxs("div",{className:"grid-row grid-gap",children:[N.jsxs("div",{className:` + usa-footer__logo + grid-row + mobile-lg:grid-col-6 mobile-lg:grid-gap-2 + `,children:[N.jsx("div",{className:"mobile-lg:grid-col-auto",children:N.jsx("img",{className:"usa-footer__logo-img",src:Kz,alt:"US Flag"})}),N.jsx("div",{className:"mobile-lg:grid-col-auto",children:N.jsx("p",{className:"usa-footer__logo-heading",children:tR})})]}),N.jsxs("div",{className:"usa-footer__contact-links mobile-lg:grid-col-6",children:[N.jsxs("div",{className:"usa-footer__social-links grid-row grid-gap-1",children:[N.jsx("div",{className:"grid-col-auto",children:N.jsx("a",{className:"usa-social-link",href:"/#",children:N.jsx("img",{className:"usa-social-link__icon",src:Bz,alt:"Facebook"})})}),N.jsx("div",{className:"grid-col-auto",children:N.jsx("a",{className:"usa-social-link",href:"/#",children:N.jsx("img",{className:"usa-social-link__icon",src:Wz,alt:"Twitter"})})}),N.jsx("div",{className:"grid-col-auto",children:N.jsx("a",{className:"usa-social-link",href:"/#",children:N.jsx("img",{className:"usa-social-link__icon",src:Gz,alt:"YouTube"})})}),N.jsx("div",{className:"grid-col-auto",children:N.jsx("a",{className:"usa-social-link",href:"/#",children:N.jsx("img",{className:"usa-social-link__icon",src:Hz,alt:"Instagram"})})}),N.jsx("div",{className:"grid-col-auto",children:N.jsx("a",{className:"usa-social-link",href:"/#",children:N.jsx("img",{className:"usa-social-link__icon",src:qz,alt:"RSS"})})})]}),N.jsx("h2",{className:"usa-footer__contact-heading",children:""}),N.jsx("address",{className:"usa-footer__address",children:N.jsxs("div",{className:"usa-footer__contact-info grid-row grid-gap",children:[N.jsx("div",{className:"grid-col-auto",children:N.jsx("a",{href:"tel:1-800-555-5555",children:" <(800) 555-GOVT> "})}),N.jsx("div",{className:"grid-col-auto",children:N.jsx("a",{href:"mailto:",children:""})})]})})]})]})})})]})},Qz=e=>e&&typeof e=="object"&&e.nodeType===1;var ci=(e,t)=>{if(typeof e!="string")return[];(!t||!Qz(t))&&(t=window.document);const n=t.querySelectorAll(e);return Array.prototype.slice.call(n)};/* +object-assign +(c) Sindre Sorhus +@license MIT +*/var rw=Object.getOwnPropertySymbols,Xz=Object.prototype.hasOwnProperty,Zz=Object.prototype.propertyIsEnumerable;function Jz(e){if(e==null)throw new TypeError("Object.assign cannot be called with null or undefined");return Object(e)}function eB(){try{if(!Object.assign)return!1;var e=new String("abc");if(e[5]="de",Object.getOwnPropertyNames(e)[0]==="5")return!1;for(var t={},n=0;n<10;n++)t["_"+String.fromCharCode(n)]=n;var r=Object.getOwnPropertyNames(t).map(function(i){return t[i]});if(r.join("")!=="0123456789")return!1;var o={};return"abcdefghijklmnopqrst".split("").forEach(function(i){o[i]=i}),Object.keys(Object.assign({},o)).join("")==="abcdefghijklmnopqrst"}catch{return!1}}var K5=eB()?Object.assign:function(e,t){for(var n,r=Jz(e),o,i=1;i-1?e.split(iw).map(function(a){return iR({type:a},i)}):(i.type=e,[i])};var aw=function(e,t){var n=e[t];return delete e[t],n},aR=function(t,n){const r=Object.keys(t).reduce(function(o,i){var a=sB(i,t[i]);return o.concat(a)},[]);return iR({add:function(i){r.forEach(function(a){i.addEventListener(a.type,a.delegate,a.options)})},remove:function(i){r.forEach(function(a){i.removeEventListener(a.type,a.delegate,a.options)})}},n)};const lB=K5,uB=aR,sw=(...e)=>function(n=document.body){e.forEach(r=>{typeof this[r]=="function"&&this[r].call(this,n)})};var qn=(e,t)=>uB(e,lB({on:sw("init","add"),off:sw("teardown","remove")},t));const lw="aria-expanded",cB="aria-controls",uw="hidden";var sR=(e,t)=>{let n=t;typeof n!="boolean"&&(n=e.getAttribute(lw)==="false"),e.setAttribute(lw,n);const r=e.getAttribute(cB),o=document.getElementById(r);if(!o)throw new Error(`No toggle target found with id: "${r}"`);return n?o.removeAttribute(uw):o.setAttribute(uw,""),n};function dB(e,t=window,n=document.documentElement){const r=e.getBoundingClientRect();return r.top>=0&&r.left>=0&&r.bottom<=(t.innerHeight||n.clientHeight)&&r.right<=(t.innerWidth||n.clientWidth)}var lR=dB,Vs={CLICK:"click"},fr={prefix:"usa"};const uR=ci,fB=qn,cw=sR,pB=lR,{CLICK:hB}=Vs,{prefix:B0}=fr,Mf=`.${B0}-accordion, .${B0}-accordion--bordered`,nu=`.${B0}-accordion__button[aria-controls]`,dw="aria-expanded",gB="data-allow-multiple",cR=e=>uR(nu,e).filter(n=>n.closest(Mf)===e),ru=(e,t)=>{const n=e.closest(Mf);let r=t;if(!n)throw new Error(`${nu} is missing outer ${Mf}`);r=cw(e,t);const o=n.hasAttribute(gB);r&&!o&&cR(n).forEach(i=>{i!==e&&cw(i,!1)})},mB=e=>ru(e,!0),yB=e=>ru(e,!1),vB=fB({[hB]:{[nu](){ru(this),this.getAttribute(dw)==="true"&&(pB(this)||this.scrollIntoView())}}},{init(e){uR(nu,e).forEach(t=>{const n=t.getAttribute(dw)==="true";ru(t,n)})},ACCORDION:Mf,BUTTON:nu,show:mB,hide:yB,toggle:ru,getButtons:cR});var dR=vB;const fw=uo(dR),_B=qn,{CLICK:bB}=Vs,{prefix:fR}=fr,pR=`.${fR}-banner__header`,xB=`${fR}-banner__header--expanded`,wB=function(t){t.preventDefault(),this.closest(pR).classList.toggle(xB)};var SB=_B({[bB]:{[`${pR} [aria-controls]`]:wB}});const pw=uo(SB),EB="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAEAAAAAsCAIAAABaPSmoAAAABGdBTUEAALGPC/xhBQAAADhlWElmTU0AKgAAAAgAAYdpAAQAAAABAAAAGgAAAAAAAqACAAQAAAABAAAAQKADAAQAAAABAAAALAAAAAA5W/rGAAABlElEQVRoBe2ZTU4DMQyFYzTLXoHOhhsAW24AR4GzFdb8iC2cABaoPUYXDFKlJt+TSJtZpFEkd+W4jhPnOX5Jxs4vV2H/M7O9GMI0JRkStbAOooef98V97L39pVVUh7yfZJOZTjhLJn1KHkBr3Abm3/rjNs5nvHqM8vrzLspZ/fVTtOH+GV9/kr6C5ClUYVFnueweAVuCByR01HLmtNgUNJ4XD9FqQjHn3vufHWK3nZCbTvcIeAAK9OlbQ0ByMUc3BZywBFdsyBXghIs354GDsPoeOLg8J/jTmMfcA6zTnAdrtthgL5E3yAPUix9xlEYDbWTvDJ5Cab3aSN0jMDAvpZajxhfdB2BPbnEeOJKZ3adQ9wGYvAsBLqnTBXqYyBvRC96FpK6j9lNPPyVy9wh4ACUw17Qxnn9qDlTLt6dQrZUt9ds9AvZ1Mx4NVr4boMrPrd+ZKwOPTjyaybxyfbtHwAMQnBs0nAcaLLoM6XtAlqNBw77BA3IHyJzXhRNyRIC+oI3Agj/3DMZx2ddTqEHWyJDdI/AHdI1y3pPhjf8AAAAASUVORK5CYII=",AB="/comet-starter/assets/icon-https-912daff9.svg",CB="/comet-starter/assets/icon-dot-gov-54f6653a.svg";var OB=function(t,n=500){let r=null;return(...o)=>{window.clearTimeout(r),r=window.setTimeout(()=>{t.apply(this,o)},n)}};const RB=ci,kB=qn,TB=OB,{prefix:$h}=fr,Q5=`${$h}-character-count`,tm=`.${Q5}`,H0=`.${$h}-character-count__field`,hw=`.${$h}-character-count__message`,q0="The content is too long.",hR=`${$h}-character-count__status--invalid`,X5=`${Q5}__status`,Z5=`${Q5}__sr-status`,$B=`.${X5}`,PB=`.${Z5}`,J5="characters allowed",e_=e=>{const t=e.closest(tm);if(!t)throw new Error(`${H0} is missing outer ${tm}`);const n=t.querySelector(hw);if(!n)throw new Error(`${tm} is missing inner ${hw}`);return{characterCountEl:t,messageEl:n}},MB=e=>{const{characterCountEl:t}=e_(e),n=e.getAttribute("maxlength");n&&(e.removeAttribute("maxlength"),t.setAttribute("data-maxlength",n))},gR=e=>{const t=document.createElement("div"),n=document.createElement("div"),o=`${e.dataset.maxlength} ${J5}`;t.classList.add(`${X5}`,"usa-hint"),n.classList.add(`${Z5}`,"usa-sr-only"),t.setAttribute("aria-hidden",!0),n.setAttribute("aria-live","polite"),t.textContent=o,n.textContent=o,e.append(t,n)},mR=(e,t)=>{let n="";if(e===0)n=`${t} ${J5}`;else{const r=Math.abs(t-e),o=`character${r===1?"":"s"}`,i=e>t?"over limit":"left";n=`${r} ${o} ${i}`}return n},NB=TB((e,t)=>{const n=e;n.textContent=t},1e3),gw=e=>{const{characterCountEl:t}=e_(e),n=e.value.length,r=parseInt(t.getAttribute("data-maxlength"),10),o=t.querySelector($B),i=t.querySelector(PB),a=mR(n,r);if(!r)return;const s=n&&n>r;o.textContent=a,NB(i,a),s&&!e.validationMessage&&e.setCustomValidity(q0),!s&&e.validationMessage===q0&&e.setCustomValidity(""),o.classList.toggle(hR,s)},LB=e=>{const{characterCountEl:t,messageEl:n}=e_(e);n.classList.add("usa-sr-only"),n.removeAttribute("aria-live"),MB(e),gR(t)};kB({input:{[H0](){gw(this)}}},{init(e){RB(H0,e).forEach(t=>LB(t))},MESSAGE_INVALID_CLASS:hR,VALIDATION_MESSAGE:q0,STATUS_MESSAGE_CLASS:X5,STATUS_MESSAGE_SR_ONLY_CLASS:Z5,DEFAULT_STATUS_LABEL:J5,createStatusMessages:gR,getCountMessage:mR,updateCountMessage:gw});var t_={exports:{}},DB={exports:{}};(function(e,t){(function(){var n={polyfill:i,keys:{3:"Cancel",6:"Help",8:"Backspace",9:"Tab",12:"Clear",13:"Enter",16:"Shift",17:"Control",18:"Alt",19:"Pause",20:"CapsLock",27:"Escape",28:"Convert",29:"NonConvert",30:"Accept",31:"ModeChange",32:" ",33:"PageUp",34:"PageDown",35:"End",36:"Home",37:"ArrowLeft",38:"ArrowUp",39:"ArrowRight",40:"ArrowDown",41:"Select",42:"Print",43:"Execute",44:"PrintScreen",45:"Insert",46:"Delete",48:["0",")"],49:["1","!"],50:["2","@"],51:["3","#"],52:["4","$"],53:["5","%"],54:["6","^"],55:["7","&"],56:["8","*"],57:["9","("],91:"OS",93:"ContextMenu",144:"NumLock",145:"ScrollLock",181:"VolumeMute",182:"VolumeDown",183:"VolumeUp",186:[";",":"],187:["=","+"],188:[",","<"],189:["-","_"],190:[".",">"],191:["/","?"],192:["`","~"],219:["[","{"],220:["\\","|"],221:["]","}"],222:["'",'"'],224:"Meta",225:"AltGraph",246:"Attn",247:"CrSel",248:"ExSel",249:"EraseEof",250:"Play",251:"ZoomOut"}},r;for(r=1;r<25;r++)n.keys[111+r]="F"+r;var o="";for(r=65;r<91;r++)o=String.fromCharCode(r),n.keys[r]=[o.toLowerCase(),o.toUpperCase()];function i(){if(!("KeyboardEvent"in window)||"key"in KeyboardEvent.prototype)return!1;var a={get:function(s){var l=n.keys[this.which||this.keyCode];return Array.isArray(l)&&(l=l[+this.shiftKey]),l}};return Object.defineProperty(KeyboardEvent.prototype,"key",a),a}e.exports=n})()})(DB);const W0={Alt:"altKey",Control:"ctrlKey",Ctrl:"ctrlKey",Shift:"shiftKey"},yR="+",IB=function(e,t){var n=e.key;if(t)for(var r in W0)e[W0[r]]===!0&&(n=[r,n].join(yR));return n};t_.exports=function(t){const n=Object.keys(t).some(function(r){return r.indexOf(yR)>-1});return function(r){var o=IB(r,n);return[o,o.toLowerCase()].reduce(function(i,a){return a in t&&(i=t[o].call(this,r)),i},void 0)}};t_.exports.MODIFIERS=W0;var Ph=t_.exports;const jB=ci,FB=e=>e&&typeof e=="object"&&e.nodeType===1;var zs=(e,t)=>{const n=jB(e,t);return typeof e!="string"||FB(t)&&t.matches(e)&&n.push(t),n},vR={exports:{}};(function(e){vR.exports=e()})(function(){var e={_entity:/[&<>"'/]/g,_entities:{"&":"&","<":"<",">":">",'"':""","'":"'","/":"/"},getEntity:function(t){return e._entities[t]},escapeHTML:function(t){for(var n="",r=0;r1?n-1:0),o=1;o{},Tr=(e,t="")=>{const n=e;n.value=t;const r=new CustomEvent("change",{bubbles:!0,cancelable:!0,detail:{value:t}});n.dispatchEvent(r)},At=e=>{const t=e.closest(Yr);if(!t)throw new Error(`Element is missing outer ${Yr}`);const n=t.querySelector(GB),r=t.querySelector($d),o=t.querySelector(KB),i=t.querySelector(QB),a=t.querySelector(CR),s=t.querySelector(YB),l=t.querySelector(AR),u=t.querySelector(ER),c=t.classList.contains(ua),d=t.dataset.disableFiltering==="true";return{comboBoxEl:t,selectEl:n,inputEl:r,listEl:o,statusEl:i,focusedOptionEl:a,selectedOptionEl:s,toggleListBtnEl:l,clearInputBtnEl:u,isPristine:c,disableFiltering:d}},OR=e=>{const{inputEl:t,toggleListBtnEl:n,clearInputBtnEl:r}=At(e);r.hidden=!0,r.disabled=!0,n.disabled=!0,t.disabled=!0},JB=e=>{const{inputEl:t,toggleListBtnEl:n,clearInputBtnEl:r}=At(e);r.hidden=!0,r.setAttribute("aria-disabled",!0),n.setAttribute("aria-disabled",!0),t.setAttribute("aria-disabled",!0)},eH=e=>{const{inputEl:t,toggleListBtnEl:n,clearInputBtnEl:r}=At(e);r.hidden=!1,r.disabled=!1,n.disabled=!1,t.disabled=!1},yw=e=>{const t=e.closest(Yr);if(t.dataset.enhanced)return;const n=t.querySelector("select");if(!n)throw new Error(`${Yr} is missing inner select`);const r=n.id,o=document.querySelector(`label[for="${r}"]`),i=`${r}--list`,a=`${r}-label`,s=`${r}--assistiveHint`,l=[],{defaultValue:u}=t.dataset,{placeholder:c}=t.dataset;let d;if(c&&l.push({placeholder:c}),u)for(let p=0,g=n.options.length;p{if(n.hasAttribute(p)){const g=n.getAttribute(p);l.push({[p]:g}),n.removeAttribute(p)}});const f=document.createElement("input");if(f.setAttribute("id",r),f.setAttribute("aria-owns",i),f.setAttribute("aria-controls",i),f.setAttribute("aria-autocomplete","list"),f.setAttribute("aria-describedby",s),f.setAttribute("aria-expanded","false"),f.setAttribute("autocapitalize","off"),f.setAttribute("autocomplete","off"),f.setAttribute("class",bR),f.setAttribute("type","text"),f.setAttribute("role","combobox"),l.forEach(p=>Object.keys(p).forEach(g=>{const v=mw.escapeHTML`${p[g]}`;f.setAttribute(g,v)})),t.insertAdjacentElement("beforeend",f),t.insertAdjacentHTML("beforeend",mw.escapeHTML` + + + +   + + + + +
+ + When autocomplete results are available use up and down arrows to review and enter to select. + Touch device users, explore by touch or with swipe gestures. + `),d){const{inputEl:p}=At(t);Tr(n,d.value),Tr(p,d.text),t.classList.add(ua)}n.disabled&&(OR(t),n.disabled=!1),n.hasAttribute("aria-disabled")&&(JB(t),n.removeAttribute("aria-disabled")),t.dataset.enhanced="true"},lc=(e,t,{skipFocus:n,preventScroll:r}={})=>{const{inputEl:o,listEl:i,focusedOptionEl:a}=At(e);if(a&&(a.classList.remove(Zi),a.setAttribute("tabIndex","-1")),t){if(o.setAttribute("aria-activedescendant",t.id),t.setAttribute("tabIndex","0"),t.classList.add(Zi),!r){const s=t.offsetTop+t.offsetHeight,l=i.scrollTop+i.offsetHeight;s>l&&(i.scrollTop=s-i.offsetHeight),t.offsetTop{const r=i=>i.replace(/[-[\]{}()*+?.,\\^$|#\s]/g,"\\$&");let o=e.replace(/{{(.*?)}}/g,(i,a)=>{const s=a.trim(),l=n[s];if(s!=="query"&&l){const u=new RegExp(l,"i"),c=t.match(u);return c?r(c[1]):""}return r(t)});return o=`^(?:${o})$`,new RegExp(o,"i")},Es=e=>{const{comboBoxEl:t,selectEl:n,inputEl:r,listEl:o,statusEl:i,isPristine:a,disableFiltering:s}=At(e);let l,u;const c=`${o.id}--option-`,d=(r.value||"").toLowerCase(),f=t.dataset.filter||XB,p=RR(f,d,t.dataset),g=[];for(let _=0,x=n.options.length;_{const w=`${c}${x}`,S=[ku];let A="-1",C="false";w===l&&(S.push(wR,Zi),A="0",C="true"),!l&&x===0&&(S.push(Zi),A="0");const R=document.createElement("li");return R.setAttribute("aria-setsize",g.length),R.setAttribute("aria-posinset",x+1),R.setAttribute("aria-selected",C),R.setAttribute("id",w),R.setAttribute("class",S.join(" ")),R.setAttribute("tabindex",A),R.setAttribute("role","option"),R.setAttribute("data-value",_.value),R.textContent=_.text,R}),y=document.createElement("li");y.setAttribute("class",`${ku}--no-results`),y.textContent="No results found",o.hidden=!1,v?(o.innerHTML="",b.forEach(_=>o.insertAdjacentElement("beforeend",_))):(o.innerHTML="",o.insertAdjacentElement("beforeend",y)),r.setAttribute("aria-expanded","true"),i.textContent=v?`${v} result${v>1?"s":""} available.`:"No results.";let h;a&&l?h=o.querySelector(`#${l}`):s&&u&&(h=o.querySelector(`#${u}`)),h&&lc(o,h,{skipFocus:!0})},Ji=e=>{const{inputEl:t,listEl:n,statusEl:r,focusedOptionEl:o}=At(e);r.innerHTML="",t.setAttribute("aria-expanded","false"),t.setAttribute("aria-activedescendant",""),o&&o.classList.remove(Zi),n.scrollTop=0,n.hidden=!0},o_=e=>{const{comboBoxEl:t,selectEl:n,inputEl:r}=At(e);Tr(n,e.dataset.value),Tr(r,e.textContent),t.classList.add(ua),Ji(t),r.focus()},tH=e=>{const{comboBoxEl:t,listEl:n,selectEl:r,inputEl:o}=At(e),i=!n.hidden;r.value&&Tr(r),o.value&&Tr(o),t.classList.remove(ua),i&&Es(t),o.focus()},i_=e=>{const{comboBoxEl:t,selectEl:n,inputEl:r}=At(e),o=n.value,i=(r.value||"").toLowerCase();if(o)for(let a=0,s=n.options.length;a{const{comboBoxEl:t,selectEl:n,inputEl:r,statusEl:o}=At(e);o.textContent="";const i=(r.value||"").toLowerCase();if(i)for(let a=0,s=n.options.length;a{const{comboBoxEl:t,inputEl:n}=At(e.target);Ji(t),i_(t),n.focus()},vw=e=>{const{comboBoxEl:t,listEl:n}=At(e.target);n.hidden&&Es(t);const r=n.querySelector(CR)||n.querySelector(Pd);r&&lc(t,r),e.preventDefault()},oH=e=>{const{comboBoxEl:t,listEl:n}=At(e.target),r=!n.hidden;nH(t),r&&Ji(t),e.preventDefault()},_w=e=>{const t=e.target,n=t.nextSibling;n&&lc(t,n),e.preventDefault()},iH=e=>{o_(e.target),e.preventDefault()},aH=e=>{o_(e.target),e.preventDefault()},bw=e=>{const{comboBoxEl:t,listEl:n,focusedOptionEl:r}=At(e.target),o=r&&r.previousSibling,i=!n.hidden;lc(t,o),i&&e.preventDefault(),o||Ji(t)},sH=e=>{e.classList.contains(Zi)||lc(e,e,{preventScroll:!0})},lH=e=>{const{comboBoxEl:t,listEl:n,inputEl:r}=At(e);n.hidden?Es(t):Ji(t),r.focus()},uH=e=>{const{comboBoxEl:t,listEl:n}=At(e);n.hidden&&Es(t)},cH=VB({[BB]:{[$d](){this.disabled||uH(this)},[AR](){this.disabled||lH(this)},[Pd](){this.disabled||o_(this)},[ER](){this.disabled||tH(this)}},focusout:{[Yr](e){this.contains(e.relatedTarget)||(i_(this),Ji(this))}},keydown:{[Yr]:nm({Escape:rH}),[$d]:nm({Enter:oH,ArrowDown:vw,Down:vw}),[Pd]:nm({ArrowUp:bw,Up:bw,ArrowDown:_w,Down:_w,Enter:aH," ":iH,"Shift+Tab":ZB})},input:{[$d](){this.closest(Yr).classList.remove(ua),Es(this)}},mouseover:{[Pd](){sH(this)}}},{init(e){UB(Yr,e).forEach(t=>{yw(t)})},getComboBoxContext:At,enhanceComboBox:yw,generateDynamicRegExp:RR,disable:OR,enable:eH,displayList:Es,hideList:Ji,COMBO_BOX_CLASS:pr});var dH=cH,kR=(e=document)=>e.activeElement;function fH(){return typeof navigator<"u"&&(navigator.userAgent.match(/(iPod|iPhone|iPad)/g)||navigator.platform==="MacIntel"&&navigator.maxTouchPoints>1)&&!window.MSStream}var pH=fH;const hi=Ph,hH=qn,gH=ci,mH=zs,{prefix:yH}=fr,{CLICK:vH}=Vs,_H=kR,bH=pH,rs=Mh,po=`${yH}-date-picker`,xH=`${po}__wrapper`,wH=`${po}--initialized`,TR=`${po}--active`,$R=`${po}__internal-input`,PR=`${po}__external-input`,MR=`${po}__button`,st=`${po}__calendar`,NR=`${po}__status`,Wn=`${st}__date`,LR=`${Wn}--focused`,SH=`${Wn}--selected`,EH=`${Wn}--previous-month`,DR=`${Wn}--current-month`,AH=`${Wn}--next-month`,CH=`${Wn}--range-date`,OH=`${Wn}--today`,RH=`${Wn}--range-date-start`,kH=`${Wn}--range-date-end`,TH=`${Wn}--within-range`,IR=`${st}__previous-year`,jR=`${st}__previous-month`,FR=`${st}__next-year`,UR=`${st}__next-month`,VR=`${st}__month-selection`,zR=`${st}__year-selection`,Nh=`${st}__month`,a_=`${Nh}--focused`,$H=`${Nh}--selected`,Lh=`${st}__year`,s_=`${Lh}--focused`,PH=`${Lh}--selected`,BR=`${st}__previous-year-chunk`,HR=`${st}__next-year-chunk`,qR=`${st}__date-picker`,WR=`${st}__month-picker`,GR=`${st}__year-picker`,Nf=`${st}__table`,MH=`${st}__row`,Ea=`${st}__cell`,Zc=`${Ea}--center-items`,NH=`${st}__month-label`,LH=`${st}__day-of-week`,ea=`.${po}`,KR=`.${MR}`,DH=`.${$R}`,Md=`.${PR}`,Lf=`.${st}`,IH=`.${NR}`,xw=`.${Wn}`,Bs=`.${LR}`,jH=`.${DR}`,l_=`.${IR}`,u_=`.${jR}`,c_=`.${FR}`,d_=`.${UR}`,YR=`.${zR}`,QR=`.${VR}`,G0=`.${Nh}`,Df=`.${Lh}`,f_=`.${BR}`,p_=`.${HR}`,Hs=`.${qR}`,FH=`.${WR}`,h_=`.${GR}`,Dh=`.${a_}`,qs=`.${s_}`,ww="Please enter a valid date",K0=["January","February","March","April","May","June","July","August","September","October","November","December"],UH=["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],VH=13,br=12,zH="0000-01-01",Ih="MM/DD/YYYY",XR="YYYY-MM-DD",BH=":not([disabled])",g_=(...e)=>e.map(t=>t+BH).join(", "),HH=g_(l_,u_,YR,QR,c_,d_,Bs),qH=g_(Dh),WH=g_(f_,p_,qs),m_=(e,t)=>(t!==e.getMonth()&&e.setDate(0),e),If=(e,t,n)=>{const r=new Date(0);return r.setFullYear(e,t,n),r},y_=()=>{const e=new Date,t=e.getDate(),n=e.getMonth(),r=e.getFullYear();return If(r,n,t)},v_=e=>{const t=new Date(0);return t.setFullYear(e.getFullYear(),e.getMonth(),1),t},ZR=e=>{const t=new Date(0);return t.setFullYear(e.getFullYear(),e.getMonth()+1,0),t},ji=(e,t)=>{const n=new Date(e.getTime());return n.setDate(n.getDate()+t),n},__=(e,t)=>ji(e,-t),JR=(e,t)=>ji(e,t*7),GH=(e,t)=>JR(e,-t),ek=e=>{const t=e.getDay();return __(e,t)},KH=e=>{const t=e.getDay();return ji(e,6-t)},uc=(e,t)=>{const n=new Date(e.getTime()),r=(n.getMonth()+12+t)%12;return n.setMonth(n.getMonth()+t),m_(n,r),n},b_=(e,t)=>uc(e,-t),x_=(e,t)=>uc(e,t*12),tk=(e,t)=>x_(e,-t),As=(e,t)=>{const n=new Date(e.getTime());return n.setMonth(t),m_(n,t),n},Go=(e,t)=>{const n=new Date(e.getTime()),r=n.getMonth();return n.setFullYear(t),m_(n,r),n},YH=(e,t)=>{let n=e;return t{let n=e;return t>e&&(n=t),new Date(n.getTime())},nk=(e,t)=>e&&t&&e.getFullYear()===t.getFullYear(),wi=(e,t)=>nk(e,t)&&e.getMonth()===t.getMonth(),bo=(e,t)=>wi(e,t)&&e.getDate()===t.getDate(),wn=(e,t,n)=>{let r=e;return en&&(r=n),new Date(r.getTime())},Y0=(e,t,n)=>e>=t&&(!n||e<=n),XH=(e,t,n)=>ZR(e)n,rm=(e,t,n)=>ZR(As(e,11))n,tr=(e,t=XR,n=!1)=>{let r,o,i,a,s;if(e){let l,u,c;if(t===Ih?[l,u,c]=e.split("/"):[c,l,u]=e.split("-"),c&&(s=parseInt(c,10),!Number.isNaN(s)&&(a=s,n&&(a=Math.max(0,a),c.length<3)))){const d=y_().getFullYear();a=d-d%10**c.length+s}if(l&&(s=parseInt(l,10),Number.isNaN(s)||(o=s,n&&(o=Math.max(1,o),o=Math.min(12,o)))),o&&u&&a!=null&&(s=parseInt(u,10),!Number.isNaN(s)&&(i=s,n))){const d=If(a,o,0).getDate();i=Math.max(1,i),i=Math.min(d,i)}o&&i&&a!=null&&(r=If(a,o-1,i))}return r},Cs=(e,t=XR)=>{const n=(a,s)=>`0000${a}`.slice(-s),r=e.getMonth()+1,o=e.getDate(),i=e.getFullYear();return t===Ih?[n(r,2),n(o,2),n(i,4)].join("/"):[n(i,4),n(r,2),n(o,2)].join("-")},w_=(e,t)=>{const n=[];let r=[],o=0;for(;o{i.insertAdjacentElement("beforeend",a)}),n.push(i)}return n},S_=e=>{const t=document.createElement("tbody");return e.forEach(n=>{t.insertAdjacentElement("beforeend",n)}),t},Q0=(e,t="")=>{const n=e;n.value=t;const r=new CustomEvent("change",{bubbles:!0,cancelable:!0,detail:{value:t}});n.dispatchEvent(r)},De=e=>{const t=e.closest(ea);if(!t)throw new Error(`Element is missing outer ${ea}`);const n=t.querySelector(DH),r=t.querySelector(Md),o=t.querySelector(Lf),i=t.querySelector(KR),a=t.querySelector(IH),s=t.querySelector(Df),l=tr(r.value,Ih,!0),u=tr(n.value),c=tr(o.dataset.value),d=tr(t.dataset.minDate),f=tr(t.dataset.maxDate),p=tr(t.dataset.rangeDate),g=tr(t.dataset.defaultDate);if(d&&f&&d>f)throw new Error("Minimum date cannot be after maximum date");return{calendarDate:c,minDate:d,toggleBtnEl:i,selectedDate:u,maxDate:f,firstYearChunkEl:s,datePickerEl:t,inputDate:l,internalInputEl:n,externalInputEl:r,calendarEl:o,rangeDate:p,defaultDate:g,statusEl:a}},rk=e=>{const{externalInputEl:t,toggleBtnEl:n}=De(e);n.disabled=!0,t.disabled=!0},ok=e=>{const{externalInputEl:t,toggleBtnEl:n}=De(e);n.setAttribute("aria-disabled",!0),t.setAttribute("aria-disabled",!0)},ZH=e=>{const{externalInputEl:t,toggleBtnEl:n}=De(e);n.disabled=!1,t.disabled=!1},E_=e=>{const{externalInputEl:t,minDate:n,maxDate:r}=De(e),o=t.value;let i=!1;if(o){i=!0;const a=o.split("/"),[s,l,u]=a.map(c=>{let d;const f=parseInt(c,10);return Number.isNaN(f)||(d=f),d});if(s&&l&&u!=null){const c=If(u,s-1,l);c.getMonth()===s-1&&c.getDate()===l&&c.getFullYear()===u&&a[2].length===4&&Y0(c,n,r)&&(i=!1)}}return i},jf=e=>{const{externalInputEl:t}=De(e),n=E_(t);n&&!t.validationMessage&&t.setCustomValidity(ww),!n&&t.validationMessage===ww&&t.setCustomValidity("")},JH=e=>{const{internalInputEl:t,inputDate:n}=De(e);let r="";n&&!E_(e)&&(r=Cs(n)),t.value!==r&&Q0(t,r)},A_=(e,t)=>{const n=tr(t);if(n){const r=Cs(n,Ih),{datePickerEl:o,internalInputEl:i,externalInputEl:a}=De(e);Q0(i,t),Q0(a,r),jf(o)}},eq=e=>{const t=e.closest(ea),{defaultValue:n}=t.dataset,r=t.querySelector("input");if(!r)throw new Error(`${ea} is missing inner input`);r.value&&(r.value="");const o=tr(t.dataset.minDate||r.getAttribute("min"));t.dataset.minDate=o?Cs(o):zH;const i=tr(t.dataset.maxDate||r.getAttribute("max"));i&&(t.dataset.maxDate=Cs(i));const a=document.createElement("div");a.classList.add(xH);const s=r.cloneNode();s.classList.add(PR),s.type="text",a.appendChild(s),a.insertAdjacentHTML("beforeend",rs.escapeHTML` + + +
`),r.setAttribute("aria-hidden","true"),r.setAttribute("tabindex","-1"),r.style.display="none",r.classList.add($R),r.removeAttribute("id"),r.removeAttribute("name"),r.required=!1,t.appendChild(a),t.classList.add(wH),n&&A_(t,n),r.disabled&&(rk(t),r.disabled=!1),r.hasAttribute("aria-disabled")&&(ok(t),r.removeAttribute("aria-disabled"))},hr=(e,t)=>{const{datePickerEl:n,calendarEl:r,statusEl:o,selectedDate:i,maxDate:a,minDate:s,rangeDate:l}=De(e),u=y_();let c=t||u;const d=r.hidden,f=ji(c,0),p=c.getMonth(),g=c.getFullYear(),v=b_(c,1),b=uc(c,1),y=Cs(c),h=v_(c),_=wi(c,s),x=wi(c,a),w=i||c,S=l&&YH(w,l),A=l&&QH(w,l),C=l&&ji(S,1),R=l&&__(A,1),O=K0[p],k=M=>{const U=[Wn],B=M.getDate(),ee=M.getMonth(),Z=M.getFullYear(),ae=M.getDay(),he=Cs(M);let se="-1";const Ce=!Y0(M,s,a),je=bo(M,i);wi(M,v)&&U.push(EH),wi(M,f)&&U.push(DR),wi(M,b)&&U.push(AH),je&&U.push(SH),bo(M,u)&&U.push(OH),l&&(bo(M,l)&&U.push(CH),bo(M,S)&&U.push(RH),bo(M,A)&&U.push(kH),Y0(M,C,R)&&U.push(TH)),bo(M,f)&&(se="0",U.push(LR));const Se=K0[ee],ke=UH[ae],Le=document.createElement("button");return Le.setAttribute("type","button"),Le.setAttribute("tabindex",se),Le.setAttribute("class",U.join(" ")),Le.setAttribute("data-day",B),Le.setAttribute("data-month",ee+1),Le.setAttribute("data-year",Z),Le.setAttribute("data-value",he),Le.setAttribute("aria-label",rs.escapeHTML`${B} ${Se} ${Z} ${ke}`),Le.setAttribute("aria-selected",je?"true":"false"),Ce===!0&&(Le.disabled=!0),Le.textContent=B,Le};c=ek(h);const T=[];for(;T.length<28||c.getMonth()===p||T.length%7!==0;)T.push(k(c)),c=ji(c,1);const $=w_(T,7),j=r.cloneNode();j.dataset.value=y,j.style.top=`${n.offsetHeight}px`,j.hidden=!1,j.innerHTML=rs.escapeHTML` +
+
+
+ +
+
+ +
+
+ + +
+
+ +
+
+ +
+
+
+ `;const L=document.createElement("table");L.setAttribute("class",Nf),L.setAttribute("role","presentation");const G=document.createElement("thead");L.insertAdjacentElement("beforeend",G);const W=document.createElement("tr");G.insertAdjacentElement("beforeend",W);const V={Sunday:"S",Monday:"M",Tuesday:"T",Wednesday:"W",Thursday:"Th",Friday:"Fr",Saturday:"S"};Object.keys(V).forEach(M=>{const U=document.createElement("th");U.setAttribute("class",LH),U.setAttribute("scope","presentation"),U.setAttribute("aria-label",M),U.textContent=V[M],W.insertAdjacentElement("beforeend",U)});const K=S_($);L.insertAdjacentElement("beforeend",K),j.querySelector(Hs).insertAdjacentElement("beforeend",L),r.parentNode.replaceChild(j,r),n.classList.add(TR);const oe=[];return bo(i,f)&&oe.push("Selected date"),d?(oe.push("You can navigate by day using left and right arrows","Weeks by using up and down arrows","Months by using page up and page down keys","Years by using shift plus page up and shift plus page down","Home and end keys navigate to the beginning and end of a week"),o.textContent=""):oe.push(`${O} ${g}`),o.textContent=oe.join(". "),j},tq=e=>{if(e.disabled)return;const{calendarEl:t,calendarDate:n,minDate:r,maxDate:o}=De(e);let i=tk(n,1);i=wn(i,r,o);const a=hr(t,i);let s=a.querySelector(l_);s.disabled&&(s=a.querySelector(Hs)),s.focus()},nq=e=>{if(e.disabled)return;const{calendarEl:t,calendarDate:n,minDate:r,maxDate:o}=De(e);let i=b_(n,1);i=wn(i,r,o);const a=hr(t,i);let s=a.querySelector(u_);s.disabled&&(s=a.querySelector(Hs)),s.focus()},rq=e=>{if(e.disabled)return;const{calendarEl:t,calendarDate:n,minDate:r,maxDate:o}=De(e);let i=uc(n,1);i=wn(i,r,o);const a=hr(t,i);let s=a.querySelector(d_);s.disabled&&(s=a.querySelector(Hs)),s.focus()},oq=e=>{if(e.disabled)return;const{calendarEl:t,calendarDate:n,minDate:r,maxDate:o}=De(e);let i=x_(n,1);i=wn(i,r,o);const a=hr(t,i);let s=a.querySelector(c_);s.disabled&&(s=a.querySelector(Hs)),s.focus()},jh=e=>{const{datePickerEl:t,calendarEl:n,statusEl:r}=De(e);t.classList.remove(TR),n.hidden=!0,r.textContent=""},iq=e=>{if(e.disabled)return;const{datePickerEl:t,externalInputEl:n}=De(e);A_(e,e.dataset.value),jh(t),n.focus()},aq=e=>{if(e.disabled)return;const{calendarEl:t,inputDate:n,minDate:r,maxDate:o,defaultDate:i}=De(e);if(t.hidden){const a=wn(n||i||y_(),r,o);hr(t,a).querySelector(Bs).focus()}else jh(e)},ik=e=>{const{calendarEl:t,inputDate:n,minDate:r,maxDate:o}=De(e);if(!t.hidden&&n){const a=wn(n,r,o);hr(t,a)}},C_=(e,t)=>{const{calendarEl:n,statusEl:r,calendarDate:o,minDate:i,maxDate:a}=De(e),s=o.getMonth(),l=t??s,u=K0.map((v,b)=>{const y=As(o,b),h=XH(y,i,a);let _="-1";const x=[Nh],w=b===s;b===l&&(_="0",x.push(a_)),w&&x.push($H);const S=document.createElement("button");return S.setAttribute("type","button"),S.setAttribute("tabindex",_),S.setAttribute("class",x.join(" ")),S.setAttribute("data-value",b),S.setAttribute("data-label",v),S.setAttribute("aria-selected",w?"true":"false"),h===!0&&(S.disabled=!0),S.textContent=v,S}),c=document.createElement("div");c.setAttribute("tabindex","-1"),c.setAttribute("class",WR);const d=document.createElement("table");d.setAttribute("class",Nf),d.setAttribute("role","presentation");const f=w_(u,3),p=S_(f);d.insertAdjacentElement("beforeend",p),c.insertAdjacentElement("beforeend",d);const g=n.cloneNode();return g.insertAdjacentElement("beforeend",c),n.parentNode.replaceChild(g,n),r.textContent="Select a month.",g},sq=e=>{if(e.disabled)return;const{calendarEl:t,calendarDate:n,minDate:r,maxDate:o}=De(e),i=parseInt(e.dataset.value,10);let a=As(n,i);a=wn(a,r,o),hr(t,a).querySelector(Bs).focus()},cc=(e,t)=>{const{calendarEl:n,statusEl:r,calendarDate:o,minDate:i,maxDate:a}=De(e),s=o.getFullYear(),l=t??s;let u=l;u-=u%br,u=Math.max(0,u);const c=rm(Go(o,u-1),i,a),d=rm(Go(o,u+br),i,a),f=[];let p=u;for(;f.length{if(e.disabled)return;const{calendarEl:t,calendarDate:n,minDate:r,maxDate:o}=De(e),i=t.querySelector(qs);let s=parseInt(i.textContent,10)-br;s=Math.max(0,s);const l=Go(n,s),u=wn(l,r,o),c=cc(t,u.getFullYear());let d=c.querySelector(f_);d.disabled&&(d=c.querySelector(h_)),d.focus()},uq=e=>{if(e.disabled)return;const{calendarEl:t,calendarDate:n,minDate:r,maxDate:o}=De(e),i=t.querySelector(qs);let s=parseInt(i.textContent,10)+br;s=Math.max(0,s);const l=Go(n,s),u=wn(l,r,o),c=cc(t,u.getFullYear());let d=c.querySelector(p_);d.disabled&&(d=c.querySelector(h_)),d.focus()},cq=e=>{if(e.disabled)return;const{calendarEl:t,calendarDate:n,minDate:r,maxDate:o}=De(e),i=parseInt(e.innerHTML,10);let a=Go(n,i);a=wn(a,r,o),hr(t,a).querySelector(Bs).focus()},dq=e=>{const{datePickerEl:t,externalInputEl:n}=De(e.target);jh(t),n.focus(),e.preventDefault()},Lr=e=>t=>{const{calendarEl:n,calendarDate:r,minDate:o,maxDate:i}=De(t.target),a=e(r),s=wn(a,o,i);bo(r,s)||hr(n,s).querySelector(Bs).focus(),t.preventDefault()},Sw=Lr(e=>GH(e,1)),Ew=Lr(e=>JR(e,1)),Aw=Lr(e=>__(e,1)),Cw=Lr(e=>ji(e,1)),fq=Lr(e=>ek(e)),pq=Lr(e=>KH(e)),hq=Lr(e=>uc(e,1)),gq=Lr(e=>b_(e,1)),mq=Lr(e=>x_(e,1)),yq=Lr(e=>tk(e,1)),vq=e=>{if(e.disabled)return;const t=e.closest(Lf),n=t.dataset.value,r=e.dataset.value;if(r===n)return;const o=tr(r);hr(t,o).querySelector(Bs).focus()},di=e=>t=>{const n=t.target,r=parseInt(n.dataset.value,10),{calendarEl:o,calendarDate:i,minDate:a,maxDate:s}=De(n),l=As(i,r);let u=e(r);u=Math.max(0,Math.min(11,u));const c=As(i,u),d=wn(c,a,s);wi(l,d)||C_(o,d.getMonth()).querySelector(Dh).focus(),t.preventDefault()},Ow=di(e=>e-3),Rw=di(e=>e+3),kw=di(e=>e-1),Tw=di(e=>e+1),_q=di(e=>e-e%3),bq=di(e=>e+2-e%3),xq=di(()=>11),wq=di(()=>0),Sq=e=>{if(e.disabled||e.classList.contains(a_))return;const t=parseInt(e.dataset.value,10);C_(e,t).querySelector(Dh).focus()},fi=e=>t=>{const n=t.target,r=parseInt(n.dataset.value,10),{calendarEl:o,calendarDate:i,minDate:a,maxDate:s}=De(n),l=Go(i,r);let u=e(r);u=Math.max(0,u);const c=Go(i,u),d=wn(c,a,s);nk(l,d)||cc(o,d.getFullYear()).querySelector(qs).focus(),t.preventDefault()},$w=fi(e=>e-3),Pw=fi(e=>e+3),Mw=fi(e=>e-1),Nw=fi(e=>e+1),Eq=fi(e=>e-e%3),Aq=fi(e=>e+2-e%3),Cq=fi(e=>e-br),Oq=fi(e=>e+br),Rq=e=>{if(e.disabled||e.classList.contains(s_))return;const t=parseInt(e.dataset.value,10);cc(e,t).querySelector(qs).focus()},O_=e=>{const t=n=>{const{calendarEl:r}=De(n),o=gH(e,r),i=0,a=o.length-1,s=o[i],l=o[a],u=o.indexOf(_H());return{focusableElements:o,isNotFound:u===-1,firstTabStop:s,isFirstTab:u===i,lastTabStop:l,isLastTab:u===a}};return{tabAhead(n){const{firstTabStop:r,isLastTab:o,isNotFound:i}=t(n.target);(o||i)&&(n.preventDefault(),r.focus())},tabBack(n){const{lastTabStop:r,isFirstTab:o,isNotFound:i}=t(n.target);(o||i)&&(n.preventDefault(),r.focus())}}},om=O_(HH),Lw=O_(qH),Dw=O_(WH),ak={[vH]:{[KR](){aq(this)},[xw](){iq(this)},[G0](){sq(this)},[Df](){cq(this)},[u_](){nq(this)},[d_](){rq(this)},[l_](){tq(this)},[c_](){oq(this)},[f_](){lq(this)},[p_](){uq(this)},[QR](){C_(this).querySelector(Dh).focus()},[YR](){cc(this).querySelector(qs).focus()}},keyup:{[Lf](e){const t=this.dataset.keydownKeyCode;`${e.keyCode}`!==t&&e.preventDefault()}},keydown:{[Md](e){e.keyCode===VH&&jf(this)},[xw]:hi({Up:Sw,ArrowUp:Sw,Down:Ew,ArrowDown:Ew,Left:Aw,ArrowLeft:Aw,Right:Cw,ArrowRight:Cw,Home:fq,End:pq,PageDown:hq,PageUp:gq,"Shift+PageDown":mq,"Shift+PageUp":yq,Tab:om.tabAhead}),[Hs]:hi({Tab:om.tabAhead,"Shift+Tab":om.tabBack}),[G0]:hi({Up:Ow,ArrowUp:Ow,Down:Rw,ArrowDown:Rw,Left:kw,ArrowLeft:kw,Right:Tw,ArrowRight:Tw,Home:_q,End:bq,PageDown:xq,PageUp:wq}),[FH]:hi({Tab:Lw.tabAhead,"Shift+Tab":Lw.tabBack}),[Df]:hi({Up:$w,ArrowUp:$w,Down:Pw,ArrowDown:Pw,Left:Mw,ArrowLeft:Mw,Right:Nw,ArrowRight:Nw,Home:Eq,End:Aq,PageDown:Oq,PageUp:Cq}),[h_]:hi({Tab:Dw.tabAhead,"Shift+Tab":Dw.tabBack}),[Lf](e){this.dataset.keydownKeyCode=e.keyCode},[ea](e){hi({Escape:dq})(e)}},focusout:{[Md](){jf(this)},[ea](e){this.contains(e.relatedTarget)||jh(this)}},input:{[Md](){JH(this),ik(this)}}};bH()||(ak.mouseover={[jH](){vq(this)},[G0](){Sq(this)},[Df](){Rq(this)}});const kq=hH(ak,{init(e){mH(ea,e).forEach(t=>{eq(t)})},getDatePickerContext:De,disable:rk,ariaDisable:ok,enable:ZH,isDateInputInvalid:E_,setCalendarValue:A_,validateDateInput:jf,renderCalendar:hr,updateCalendarIfVisible:ik});var Tq=kq;const $q=qn,Pq=ci,Mq=zs,{prefix:sk}=fr,{getDatePickerContext:lk,isDateInputInvalid:uk,updateCalendarIfVisible:ck}=Tq,Nq=`${sk}-date-picker`,R_=`${sk}-date-range-picker`,dk=`${R_}__range-start`,fk=`${R_}__range-end`,im=`.${Nq}`,os=`.${R_}`,pk=`.${dk}`,hk=`.${fk}`,Lq="0000-01-01",gk=e=>{const t=e.closest(os);if(!t)throw new Error(`Element is missing outer ${os}`);const n=t.querySelector(pk),r=t.querySelector(hk);return{dateRangePickerEl:t,rangeStartEl:n,rangeEndEl:r}},mk=e=>{const{dateRangePickerEl:t,rangeStartEl:n,rangeEndEl:r}=gk(e),{internalInputEl:o}=lk(n),i=o.value;i&&!uk(o)?(r.dataset.minDate=i,r.dataset.rangeDate=i,r.dataset.defaultDate=i):(r.dataset.minDate=t.dataset.minDate||"",r.dataset.rangeDate="",r.dataset.defaultDate=""),ck(r)},yk=e=>{const{dateRangePickerEl:t,rangeStartEl:n,rangeEndEl:r}=gk(e),{internalInputEl:o}=lk(r),i=o.value;i&&!uk(o)?(n.dataset.maxDate=i,n.dataset.rangeDate=i,n.dataset.defaultDate=i):(n.dataset.maxDate=t.dataset.maxDate||"",n.dataset.rangeDate="",n.dataset.defaultDate=""),ck(n)},Dq=e=>{const t=e.closest(os),[n,r]=Pq(im,t);if(!n)throw new Error(`${os} is missing inner two '${im}' elements`);if(!r)throw new Error(`${os} is missing second '${im}' element`);n.classList.add(dk),r.classList.add(fk),t.dataset.minDate||(t.dataset.minDate=Lq);const{minDate:o}=t.dataset;n.dataset.minDate=o,r.dataset.minDate=o;const{maxDate:i}=t.dataset;i&&(n.dataset.maxDate=i,r.dataset.maxDate=i),mk(t),yk(t)};$q({"input change":{[pk](){mk(this)},[hk](){yk(this)}}},{init(e){Mq(os,e).forEach(t=>{Dq(t)})}});const Iw=zs,Iq=qn,Ff=Mh,{prefix:dn}=fr,Tu=`${dn}-file-input`,$u=`.${Tu}`,vk=`${dn}-file-input__input`,k_=`${dn}-file-input__target`,_k=`.${vk}`,jq=`${dn}-file-input__box`,bk=`${dn}-file-input__instructions`,xk=`${dn}-file-input__preview`,wk=`${dn}-file-input__preview-heading`,Fh=`${dn}-file-input--disabled`,Fq=`${dn}-file-input__choose`,Sk=`${dn}-file-input__accepted-files-message`,jw=`${dn}-file-input__drag-text`,am=`${dn}-file-input--drag`,Fw="is-loading",X0="has-invalid-file",Ws=`${dn}-file-input__preview-image`,Uq=`${Ws}--generic`,Vq=`${Ws}--pdf`,zq=`${Ws}--word`,Bq=`${Ws}--video`,Hq=`${Ws}--excel`,Ek=`${dn}-sr-only`,_a="data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7";let Z0=!0,J0="",ev="";const dc=e=>{const t=e.closest($u);if(!t)throw new Error(`Element is missing outer ${$u}`);const n=t.querySelector(_k);return{dropZoneEl:t,inputEl:n}},qq=e=>{const{dropZoneEl:t,inputEl:n}=dc(e);n.disabled=!0,t.classList.add(Fh)},Wq=e=>{const{dropZoneEl:t}=dc(e);t.classList.add(Fh)},Gq=e=>{const{dropZoneEl:t,inputEl:n}=dc(e);n.disabled=!1,t.classList.remove(Fh),t.removeAttribute("aria-disabled")},Kq=e=>{const t=e.charCodeAt(0);return t===32?"-":t>=65&&t<=90?`img_${e.toLowerCase()}`:`__${t.toString(16).slice(-4)}`},Yq=e=>e.replace(/[^a-z0-9]/g,Kq),Qq=e=>`${e}-${Math.floor(Date.now().toString()/1e3)}`,Ak=e=>e.hasAttribute("multiple")?"files":"file",Xq=e=>{const t=document.createElement("div"),n=document.createElement("div"),r=document.createElement("div");return e.classList.remove(Tu),e.classList.add(vk),t.classList.add(Tu),r.classList.add(jq),n.classList.add(k_),n.prepend(r),e.parentNode.insertBefore(n,e),e.parentNode.insertBefore(t,n),n.appendChild(e),t.appendChild(n),n},Zq=e=>{const t=e.closest($u),n=Ak(e),r=document.createElement("div"),o=`Drag ${n} here or`,i="choose from folder";return J0=`${o} ${i}`,r.classList.add(bk),r.setAttribute("aria-hidden","true"),e.setAttribute("aria-label",J0),r.innerHTML=Ff.escapeHTML`${o} ${i}`,e.parentNode.insertBefore(r,e),(/rv:11.0/i.test(navigator.userAgent)||/Edge\/\d./i.test(navigator.userAgent))&&(t.querySelector(`.${jw}`).outerHTML=""),r},Jq=e=>{const t=document.createElement("div"),n=Ak(e),r=e.closest($u),o=e.closest(`.${k_}`);ev=`No ${n} selected.`,t.classList.add(Ek),t.setAttribute("aria-live","polite"),t.textContent=ev,r.insertBefore(t,o)},eW=e=>{const t=e.hasAttribute("aria-disabled")||e.hasAttribute("disabled"),n=Xq(e),r=Zq(e),{dropZoneEl:o}=dc(e);return t?o.classList.add(Fh):Jq(e),{instructions:r,dropTarget:n}},Ck=(e,t)=>{const n=e.querySelectorAll(`.${xk}`),r=e.querySelector(`.${wk}`),o=e.querySelector(`.${Sk}`),i=a=>{a.parentNode.removeChild(a)};r&&(r.outerHTML=""),o&&(o.outerHTML="",e.classList.remove(X0)),n!==null&&(t&&t.removeAttribute("hidden"),Array.prototype.forEach.call(n,i))},tW=(e,t,n)=>{const r=e;let o=ev;t.length===1?o=`You have selected the file: ${n}`:t.length>1&&(o=`You have selected ${t.length} files: ${n.join(", ")}`),setTimeout(()=>{r.textContent=o},1e3)},nW=(e,t)=>{const n=document.createElement("div"),r=e.closest(`.${k_}`),o=r.querySelector(`.${bk}`);let i="Change file",a="";t.length===1?a=Ff.escapeHTML`Selected file ${i}`:t.length>1&&(i="Change files",a=Ff.escapeHTML`${t.length} files selected ${i}`),o.setAttribute("hidden","true"),n.classList.add(wk),n.innerHTML=a,r.insertBefore(n,o),e.setAttribute("aria-label",i)},rW=(e,t,n,r)=>{const o=e.target.files,a=r.closest(`.${Tu}`).querySelector(`.${Ek}`),s=[];Ck(r,n);for(let l=0;l