var C0e=Object.defineProperty;var T0e=(t,e,n)=>e in t?C0e(t,e,{enumerable:!0,configurable:!0,writable:!0,value:n}):t[e]=n;var Yt=(t,e,n)=>T0e(t,typeof e!="symbol"?e+"":e,n);function E0e(t,e){for(var n=0;n<e.length;n++){const r=e[n];if(typeof r!="string"&&!Array.isArray(r)){for(const i in r)if(i!=="default"&&!(i in t)){const o=Object.getOwnPropertyDescriptor(r,i);o&&Object.defineProperty(t,i,o.get?o:{enumerable:!0,get:()=>r[i]})}}}return Object.freeze(Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}))}(function(){const e=document.createElement("link").relList;if(e&&e.supports&&e.supports("modulepreload"))return;for(const i of document.querySelectorAll('link[rel="modulepreload"]'))r(i);new MutationObserver(i=>{for(const o of i)if(o.type==="childList")for(const a of o.addedNodes)a.tagName==="LINK"&&a.rel==="modulepreload"&&r(a)}).observe(document,{childList:!0,subtree:!0});function n(i){const o={};return i.integrity&&(o.integrity=i.integrity),i.referrerPolicy&&(o.referrerPolicy=i.referrerPolicy),i.crossOrigin==="use-credentials"?o.credentials="include":i.crossOrigin==="anonymous"?o.credentials="omit":o.credentials="same-origin",o}function r(i){if(i.ep)return;i.ep=!0;const o=n(i);fetch(i.href,o)}})();var Zn=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function $t(t){return t&&t.__esModule&&Object.prototype.hasOwnProperty.call(t,"default")?t.default:t}function Ea(t){if(t.__esModule)return t;var e=t.default;if(typeof e=="function"){var n=function r(){return this instanceof r?Reflect.construct(e,arguments,this.constructor):e.apply(this,arguments)};n.prototype=e.prototype}else n={};return Object.defineProperty(n,"__esModule",{value:!0}),Object.keys(t).forEach(function(r){var i=Object.getOwnPropertyDescriptor(t,r);Object.defineProperty(n,r,i.get?i:{enumerable:!0,get:function(){return t[r]}})}),n}var QJ={exports:{}},s1={};/*
object-assign
(c) Sindre Sorhus
@license MIT
*/var Q6=Object.getOwnPropertySymbols,P0e=Object.prototype.hasOwnProperty,M0e=Object.prototype.propertyIsEnumerable;function k0e(t){if(t==null)throw new TypeError("Object.assign cannot be called with null or undefined");return Object(t)}function A0e(){try{if(!Object.assign)return!1;var t=new String("abc");if(t[5]="de",Object.getOwnPropertyNames(t)[0]==="5")return!1;for(var e={},n=0;n<10;n++)e["_"+String.fromCharCode(n)]=n;var r=Object.getOwnPropertyNames(e).map(function(o){return e[o]});if(r.join("")!=="0123456789")return!1;var i={};return"abcdefghijklmnopqrst".split("").forEach(function(o){i[o]=o}),Object.keys(Object.assign({},i)).join("")==="abcdefghijklmnopqrst"}catch{return!1}}var YJ=A0e()?Object.assign:function(t,e){for(var n,r=k0e(t),i,o=1;o<arguments.length;o++){n=Object(arguments[o]);for(var a in n)P0e.call(n,a)&&(r[a]=n[a]);if(Q6){i=Q6(n);for(var s=0;s<i.length;s++)M0e.call(n,i[s])&&(r[i[s]]=n[i[s]])}}return r},KJ={exports:{}},ln={};/** @license React v17.0.2
 * 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 NF=YJ,Bv=60103,ZJ=60106;ln.Fragment=60107;ln.StrictMode=60108;ln.Profiler=60114;var JJ=60109,eee=60110,tee=60112;ln.Suspense=60113;var nee=60115,ree=60116;if(typeof Symbol=="function"&&Symbol.for){var Es=Symbol.for;Bv=Es("react.element"),ZJ=Es("react.portal"),ln.Fragment=Es("react.fragment"),ln.StrictMode=Es("react.strict_mode"),ln.Profiler=Es("react.profiler"),JJ=Es("react.provider"),eee=Es("react.context"),tee=Es("react.forward_ref"),ln.Suspense=Es("react.suspense"),nee=Es("react.memo"),ree=Es("react.lazy")}var Y6=typeof Symbol=="function"&&Symbol.iterator;function R0e(t){return t===null||typeof t!="object"?null:(t=Y6&&t[Y6]||t["@@iterator"],typeof t=="function"?t:null)}function l1(t){for(var e="https://reactjs.org/docs/error-decoder.html?invariant="+t,n=1;n<arguments.length;n++)e+="&args[]="+encodeURIComponent(arguments[n]);return"Minified React error #"+t+"; visit "+e+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}var iee={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},oee={};function zv(t,e,n){this.props=t,this.context=e,this.refs=oee,this.updater=n||iee}zv.prototype.isReactComponent={};zv.prototype.setState=function(t,e){if(typeof t!="object"&&typeof t!="function"&&t!=null)throw Error(l1(85));this.updater.enqueueSetState(this,t,e,"setState")};zv.prototype.forceUpdate=function(t){this.updater.enqueueForceUpdate(this,t,"forceUpdate")};function aee(){}aee.prototype=zv.prototype;function $F(t,e,n){this.props=t,this.context=e,this.refs=oee,this.updater=n||iee}var FF=$F.prototype=new aee;FF.constructor=$F;NF(FF,zv.prototype);FF.isPureReactComponent=!0;var jF={current:null},see=Object.prototype.hasOwnProperty,lee={key:!0,ref:!0,__self:!0,__source:!0};function cee(t,e,n){var r,i={},o=null,a=null;if(e!=null)for(r in e.ref!==void 0&&(a=e.ref),e.key!==void 0&&(o=""+e.key),e)see.call(e,r)&&!lee.hasOwnProperty(r)&&(i[r]=e[r]);var s=arguments.length-2;if(s===1)i.children=n;else if(1<s){for(var l=Array(s),c=0;c<s;c++)l[c]=arguments[c+2];i.children=l}if(t&&t.defaultProps)for(r in s=t.defaultProps,s)i[r]===void 0&&(i[r]=s[r]);return{$$typeof:Bv,type:t,key:o,ref:a,props:i,_owner:jF.current}}function I0e(t,e){return{$$typeof:Bv,type:t.type,key:e,ref:t.ref,props:t.props,_owner:t._owner}}function BF(t){return typeof t=="object"&&t!==null&&t.$$typeof===Bv}function D0e(t){var e={"=":"=0",":":"=2"};return"$"+t.replace(/[=:]/g,function(n){return e[n]})}var K6=/\/+/g;function Xk(t,e){return typeof t=="object"&&t!==null&&t.key!=null?D0e(""+t.key):e.toString(36)}function fC(t,e,n,r,i){var o=typeof t;(o==="undefined"||o==="boolean")&&(t=null);var a=!1;if(t===null)a=!0;else switch(o){case"string":case"number":a=!0;break;case"object":switch(t.$$typeof){case Bv:case ZJ:a=!0}}if(a)return a=t,i=i(a),t=r===""?"."+Xk(a,0):r,Array.isArray(i)?(n="",t!=null&&(n=t.replace(K6,"$&/")+"/"),fC(i,e,n,"",function(c){return c})):i!=null&&(BF(i)&&(i=I0e(i,n+(!i.key||a&&a.key===i.key?"":(""+i.key).replace(K6,"$&/")+"/")+t)),e.push(i)),1;if(a=0,r=r===""?".":r+":",Array.isArray(t))for(var s=0;s<t.length;s++){o=t[s];var l=r+Xk(o,s);a+=fC(o,e,n,l,i)}else if(l=R0e(t),typeof l=="function")for(t=l.call(t),s=0;!(o=t.next()).done;)o=o.value,l=r+Xk(o,s++),a+=fC(o,e,n,l,i);else if(o==="object")throw e=""+t,Error(l1(31,e==="[object Object]"?"object with keys {"+Object.keys(t).join(", ")+"}":e));return a}function zw(t,e,n){if(t==null)return t;var r=[],i=0;return fC(t,r,"","",function(o){return e.call(n,o,i++)}),r}function L0e(t){if(t._status===-1){var e=t._result;e=e(),t._status=0,t._result=e,e.then(function(n){t._status===0&&(n=n.default,t._status=1,t._result=n)},function(n){t._status===0&&(t._status=2,t._result=n)})}if(t._status===1)return t._result;throw t._result}var uee={current:null};function _u(){var t=uee.current;if(t===null)throw Error(l1(321));return t}var N0e={ReactCurrentDispatcher:uee,ReactCurrentBatchConfig:{transition:0},ReactCurrentOwner:jF,IsSomeRendererActing:{current:!1},assign:NF};ln.Children={map:zw,forEach:function(t,e,n){zw(t,function(){e.apply(this,arguments)},n)},count:function(t){var e=0;return zw(t,function(){e++}),e},toArray:function(t){return zw(t,function(e){return e})||[]},only:function(t){if(!BF(t))throw Error(l1(143));return t}};ln.Component=zv;ln.PureComponent=$F;ln.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED=N0e;ln.cloneElement=function(t,e,n){if(t==null)throw Error(l1(267,t));var r=NF({},t.props),i=t.key,o=t.ref,a=t._owner;if(e!=null){if(e.ref!==void 0&&(o=e.ref,a=jF.current),e.key!==void 0&&(i=""+e.key),t.type&&t.type.defaultProps)var s=t.type.defaultProps;for(l in e)see.call(e,l)&&!lee.hasOwnProperty(l)&&(r[l]=e[l]===void 0&&s!==void 0?s[l]:e[l])}var l=arguments.length-2;if(l===1)r.children=n;else if(1<l){s=Array(l);for(var c=0;c<l;c++)s[c]=arguments[c+2];r.children=s}return{$$typeof:Bv,type:t.type,key:i,ref:o,props:r,_owner:a}};ln.createContext=function(t,e){return e===void 0&&(e=null),t={$$typeof:eee,_calculateChangedBits:e,_currentValue:t,_currentValue2:t,_threadCount:0,Provider:null,Consumer:null},t.Provider={$$typeof:JJ,_context:t},t.Consumer=t};ln.createElement=cee;ln.createFactory=function(t){var e=cee.bind(null,t);return e.type=t,e};ln.createRef=function(){return{current:null}};ln.forwardRef=function(t){return{$$typeof:tee,render:t}};ln.isValidElement=BF;ln.lazy=function(t){return{$$typeof:ree,_payload:{_status:-1,_result:t},_init:L0e}};ln.memo=function(t,e){return{$$typeof:nee,type:t,compare:e===void 0?null:e}};ln.useCallback=function(t,e){return _u().useCallback(t,e)};ln.useContext=function(t,e){return _u().useContext(t,e)};ln.useDebugValue=function(){};ln.useEffect=function(t,e){return _u().useEffect(t,e)};ln.useImperativeHandle=function(t,e,n){return _u().useImperativeHandle(t,e,n)};ln.useLayoutEffect=function(t,e){return _u().useLayoutEffect(t,e)};ln.useMemo=function(t,e){return _u().useMemo(t,e)};ln.useReducer=function(t,e,n){return _u().useReducer(t,e,n)};ln.useRef=function(t){return _u().useRef(t)};ln.useState=function(t){return _u().useState(t)};ln.version="17.0.2";KJ.exports=ln;var M=KJ.exports;const ue=$t(M),zD=E0e({__proto__:null,default:ue},[M]);/** @license React v17.0.2
 * react-jsx-runtime.production.min.js
 *
 * Copyright (c) Facebook, Inc. and its affiliates.
 *
 * This source code is licensed under the MIT license found in the
 * LICENSE file in the root directory of this source tree.
 */var $0e=M,fee=60103;s1.Fragment=60107;if(typeof Symbol=="function"&&Symbol.for){var Z6=Symbol.for;fee=Z6("react.element"),s1.Fragment=Z6("react.fragment")}var F0e=$0e.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,j0e=Object.prototype.hasOwnProperty,B0e={key:!0,ref:!0,__self:!0,__source:!0};function dee(t,e,n){var r,i={},o=null,a=null;n!==void 0&&(o=""+n),e.key!==void 0&&(o=""+e.key),e.ref!==void 0&&(a=e.ref);for(r in e)j0e.call(e,r)&&!B0e.hasOwnProperty(r)&&(i[r]=e[r]);if(t&&t.defaultProps)for(r in e=t.defaultProps,e)i[r]===void 0&&(i[r]=e[r]);return{$$typeof:fee,type:t,key:o,ref:a,props:i,_owner:F0e.current}}s1.jsx=dee;s1.jsxs=dee;QJ.exports=s1;var w=QJ.exports,hee={exports:{}},vs={},pee={exports:{}},mee={};/** @license React v0.20.2
 * scheduler.production.min.js
 *
 * Copyright (c) Facebook, Inc. and its affiliates.
 *
 * This source code is licensed under the MIT license found in the
 * LICENSE file in the root directory of this source tree.
 */(function(t){var e,n,r,i;if(typeof performance=="object"&&typeof performance.now=="function"){var o=performance;t.unstable_now=function(){return o.now()}}else{var a=Date,s=a.now();t.unstable_now=function(){return a.now()-s}}if(typeof window>"u"||typeof MessageChannel!="function"){var l=null,c=null,u=function(){if(l!==null)try{var N=t.unstable_now();l(!0,N),l=null}catch(D){throw setTimeout(u,0),D}};e=function(N){l!==null?setTimeout(e,0,N):(l=N,setTimeout(u,0))},n=function(N,D){c=setTimeout(N,D)},r=function(){clearTimeout(c)},t.unstable_shouldYield=function(){return!1},i=t.unstable_forceFrameRate=function(){}}else{var f=window.setTimeout,d=window.clearTimeout;if(typeof console<"u"){var h=window.cancelAnimationFrame;typeof window.requestAnimationFrame!="function"&&console.error("This browser doesn't support requestAnimationFrame. Make sure that you load a polyfill in older browsers. https://reactjs.org/link/react-polyfills"),typeof h!="function"&&console.error("This browser doesn't support cancelAnimationFrame. Make sure that you load a polyfill in older browsers. https://reactjs.org/link/react-polyfills")}var p=!1,m=null,g=-1,v=5,y=0;t.unstable_shouldYield=function(){return t.unstable_now()>=y},i=function(){},t.unstable_forceFrameRate=function(N){0>N||125<N?console.error("forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported"):v=0<N?Math.floor(1e3/N):5};var x=new MessageChannel,b=x.port2;x.port1.onmessage=function(){if(m!==null){var N=t.unstable_now();y=N+v;try{m(!0,N)?b.postMessage(null):(p=!1,m=null)}catch(D){throw b.postMessage(null),D}}else p=!1},e=function(N){m=N,p||(p=!0,b.postMessage(null))},n=function(N,D){g=f(function(){N(t.unstable_now())},D)},r=function(){d(g),g=-1}}function _(N,D){var A=N.length;N.push(D);e:for(;;){var q=A-1>>>1,Y=N[q];if(Y!==void 0&&0<C(Y,D))N[q]=D,N[A]=Y,A=q;else break e}}function S(N){return N=N[0],N===void 0?null:N}function O(N){var D=N[0];if(D!==void 0){var A=N.pop();if(A!==D){N[0]=A;e:for(var q=0,Y=N.length;q<Y;){var K=2*(q+1)-1,se=N[K],te=K+1,J=N[te];if(se!==void 0&&0>C(se,A))J!==void 0&&0>C(J,se)?(N[q]=J,N[te]=A,q=te):(N[q]=se,N[K]=A,q=K);else if(J!==void 0&&0>C(J,A))N[q]=J,N[te]=A,q=te;else break e}}return D}return null}function C(N,D){var A=N.sortIndex-D.sortIndex;return A!==0?A:N.id-D.id}var E=[],k=[],I=1,P=null,R=3,T=!1,L=!1,z=!1;function B(N){for(var D=S(k);D!==null;){if(D.callback===null)O(k);else if(D.startTime<=N)O(k),D.sortIndex=D.expirationTime,_(E,D);else break;D=S(k)}}function U(N){if(z=!1,B(N),!L)if(S(E)!==null)L=!0,e(W);else{var D=S(k);D!==null&&n(U,D.startTime-N)}}function W(N,D){L=!1,z&&(z=!1,r()),T=!0;var A=R;try{for(B(D),P=S(E);P!==null&&(!(P.expirationTime>D)||N&&!t.unstable_shouldYield());){var q=P.callback;if(typeof q=="function"){P.callback=null,R=P.priorityLevel;var Y=q(P.expirationTime<=D);D=t.unstable_now(),typeof Y=="function"?P.callback=Y:P===S(E)&&O(E),B(D)}else O(E);P=S(E)}if(P!==null)var K=!0;else{var se=S(k);se!==null&&n(U,se.startTime-D),K=!1}return K}finally{P=null,R=A,T=!1}}var $=i;t.unstable_IdlePriority=5,t.unstable_ImmediatePriority=1,t.unstable_LowPriority=4,t.unstable_NormalPriority=3,t.unstable_Profiling=null,t.unstable_UserBlockingPriority=2,t.unstable_cancelCallback=function(N){N.callback=null},t.unstable_continueExecution=function(){L||T||(L=!0,e(W))},t.unstable_getCurrentPriorityLevel=function(){return R},t.unstable_getFirstCallbackNode=function(){return S(E)},t.unstable_next=function(N){switch(R){case 1:case 2:case 3:var D=3;break;default:D=R}var A=R;R=D;try{return N()}finally{R=A}},t.unstable_pauseExecution=function(){},t.unstable_requestPaint=$,t.unstable_runWithPriority=function(N,D){switch(N){case 1:case 2:case 3:case 4:case 5:break;default:N=3}var A=R;R=N;try{return D()}finally{R=A}},t.unstable_scheduleCallback=function(N,D,A){var q=t.unstable_now();switch(typeof A=="object"&&A!==null?(A=A.delay,A=typeof A=="number"&&0<A?q+A:q):A=q,N){case 1:var Y=-1;break;case 2:Y=250;break;case 5:Y=1073741823;break;case 4:Y=1e4;break;default:Y=5e3}return Y=A+Y,N={id:I++,callback:D,priorityLevel:N,startTime:A,expirationTime:Y,sortIndex:-1},A>q?(N.sortIndex=A,_(k,N),S(E)===null&&N===S(k)&&(z?r():z=!0,n(U,A-q))):(N.sortIndex=Y,_(E,N),L||T||(L=!0,e(W))),N},t.unstable_wrapCallback=function(N){var D=R;return function(){var A=R;R=D;try{return N.apply(this,arguments)}finally{R=A}}}})(mee);pee.exports=mee;var z0e=pee.exports;/** @license React v17.0.2
 * 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 jP=M,hr=YJ,ui=z0e;function Xe(t){for(var e="https://reactjs.org/docs/error-decoder.html?invariant="+t,n=1;n<arguments.length;n++)e+="&args[]="+encodeURIComponent(arguments[n]);return"Minified React error #"+t+"; visit "+e+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}if(!jP)throw Error(Xe(227));var gee=new Set,hb={};function wp(t,e){Wg(t,e),Wg(t+"Capture",e)}function Wg(t,e){for(hb[t]=e,t=0;t<e.length;t++)gee.add(e[t])}var cu=!(typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),U0e=/^[: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]*$/,J6=Object.prototype.hasOwnProperty,eW={},tW={};function W0e(t){return J6.call(tW,t)?!0:J6.call(eW,t)?!1:U0e.test(t)?tW[t]=!0:(eW[t]=!0,!1)}function V0e(t,e,n,r){if(n!==null&&n.type===0)return!1;switch(typeof e){case"function":case"symbol":return!0;case"boolean":return r?!1:n!==null?!n.acceptsBooleans:(t=t.toLowerCase().slice(0,5),t!=="data-"&&t!=="aria-");default:return!1}}function G0e(t,e,n,r){if(e===null||typeof e>"u"||V0e(t,e,n,r))return!0;if(r)return!1;if(n!==null)switch(n.type){case 3:return!e;case 4:return e===!1;case 5:return isNaN(e);case 6:return isNaN(e)||1>e}return!1}function go(t,e,n,r,i,o,a){this.acceptsBooleans=e===2||e===3||e===4,this.attributeName=r,this.attributeNamespace=i,this.mustUseProperty=n,this.propertyName=t,this.type=e,this.sanitizeURL=o,this.removeEmptyString=a}var Di={};"children dangerouslySetInnerHTML defaultValue defaultChecked innerHTML suppressContentEditableWarning suppressHydrationWarning style".split(" ").forEach(function(t){Di[t]=new go(t,0,!1,t,null,!1,!1)});[["acceptCharset","accept-charset"],["className","class"],["htmlFor","for"],["httpEquiv","http-equiv"]].forEach(function(t){var e=t[0];Di[e]=new go(e,1,!1,t[1],null,!1,!1)});["contentEditable","draggable","spellCheck","value"].forEach(function(t){Di[t]=new go(t,2,!1,t.toLowerCase(),null,!1,!1)});["autoReverse","externalResourcesRequired","focusable","preserveAlpha"].forEach(function(t){Di[t]=new go(t,2,!1,t,null,!1,!1)});"allowFullScreen async autoFocus autoPlay controls default defer disabled disablePictureInPicture disableRemotePlayback formNoValidate hidden loop noModule noValidate open playsInline readOnly required reversed scoped seamless itemScope".split(" ").forEach(function(t){Di[t]=new go(t,3,!1,t.toLowerCase(),null,!1,!1)});["checked","multiple","muted","selected"].forEach(function(t){Di[t]=new go(t,3,!0,t,null,!1,!1)});["capture","download"].forEach(function(t){Di[t]=new go(t,4,!1,t,null,!1,!1)});["cols","rows","size","span"].forEach(function(t){Di[t]=new go(t,6,!1,t,null,!1,!1)});["rowSpan","start"].forEach(function(t){Di[t]=new go(t,5,!1,t.toLowerCase(),null,!1,!1)});var zF=/[\-:]([a-z])/g;function UF(t){return t[1].toUpperCase()}"accent-height alignment-baseline arabic-form baseline-shift cap-height clip-path clip-rule color-interpolation color-interpolation-filters color-profile color-rendering dominant-baseline enable-background fill-opacity fill-rule flood-color flood-opacity font-family font-size font-size-adjust font-stretch font-style font-variant font-weight glyph-name glyph-orientation-horizontal glyph-orientation-vertical horiz-adv-x horiz-origin-x image-rendering letter-spacing lighting-color marker-end marker-mid marker-start overline-position overline-thickness paint-order panose-1 pointer-events rendering-intent shape-rendering stop-color stop-opacity strikethrough-position strikethrough-thickness stroke-dasharray stroke-dashoffset stroke-linecap stroke-linejoin stroke-miterlimit stroke-opacity stroke-width text-anchor text-decoration text-rendering underline-position underline-thickness unicode-bidi unicode-range units-per-em v-alphabetic v-hanging v-ideographic v-mathematical vector-effect vert-adv-y vert-origin-x vert-origin-y word-spacing writing-mode xmlns:xlink x-height".split(" ").forEach(function(t){var e=t.replace(zF,UF);Di[e]=new go(e,1,!1,t,null,!1,!1)});"xlink:actuate xlink:arcrole xlink:role xlink:show xlink:title xlink:type".split(" ").forEach(function(t){var e=t.replace(zF,UF);Di[e]=new go(e,1,!1,t,"http://www.w3.org/1999/xlink",!1,!1)});["xml:base","xml:lang","xml:space"].forEach(function(t){var e=t.replace(zF,UF);Di[e]=new go(e,1,!1,t,"http://www.w3.org/XML/1998/namespace",!1,!1)});["tabIndex","crossOrigin"].forEach(function(t){Di[t]=new go(t,1,!1,t.toLowerCase(),null,!1,!1)});Di.xlinkHref=new go("xlinkHref",1,!1,"xlink:href","http://www.w3.org/1999/xlink",!0,!1);["src","href","action","formAction"].forEach(function(t){Di[t]=new go(t,1,!1,t.toLowerCase(),null,!0,!0)});function WF(t,e,n,r){var i=Di.hasOwnProperty(e)?Di[e]:null,o=i!==null?i.type===0:r?!1:!(!(2<e.length)||e[0]!=="o"&&e[0]!=="O"||e[1]!=="n"&&e[1]!=="N");o||(G0e(e,n,i,r)&&(n=null),r||i===null?W0e(e)&&(n===null?t.removeAttribute(e):t.setAttribute(e,""+n)):i.mustUseProperty?t[i.propertyName]=n===null?i.type===3?!1:"":n:(e=i.attributeName,r=i.attributeNamespace,n===null?t.removeAttribute(e):(i=i.type,n=i===3||i===4&&n===!0?"":""+n,r?t.setAttributeNS(r,e,n):t.setAttribute(e,n))))}var Sp=jP.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED,nx=60103,hh=60106,df=60107,VF=60108,Ox=60114,GF=60109,HF=60110,BP=60112,Cx=60113,ZC=60120,zP=60115,qF=60116,XF=60121,QF=60128,vee=60129,YF=60130,UD=60131;if(typeof Symbol=="function"&&Symbol.for){var ii=Symbol.for;nx=ii("react.element"),hh=ii("react.portal"),df=ii("react.fragment"),VF=ii("react.strict_mode"),Ox=ii("react.profiler"),GF=ii("react.provider"),HF=ii("react.context"),BP=ii("react.forward_ref"),Cx=ii("react.suspense"),ZC=ii("react.suspense_list"),zP=ii("react.memo"),qF=ii("react.lazy"),XF=ii("react.block"),ii("react.scope"),QF=ii("react.opaque.id"),vee=ii("react.debug_trace_mode"),YF=ii("react.offscreen"),UD=ii("react.legacy_hidden")}var nW=typeof Symbol=="function"&&Symbol.iterator;function Jy(t){return t===null||typeof t!="object"?null:(t=nW&&t[nW]||t["@@iterator"],typeof t=="function"?t:null)}var Qk;function rx(t){if(Qk===void 0)try{throw Error()}catch(n){var e=n.stack.trim().match(/\n( *(at )?)/);Qk=e&&e[1]||""}return`
`+Qk+t}var Yk=!1;function Uw(t,e){if(!t||Yk)return"";Yk=!0;var n=Error.prepareStackTrace;Error.prepareStackTrace=void 0;try{if(e)if(e=function(){throw Error()},Object.defineProperty(e.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(e,[])}catch(l){var r=l}Reflect.construct(t,[],e)}else{try{e.call()}catch(l){r=l}t.call(e.prototype)}else{try{throw Error()}catch(l){r=l}t()}}catch(l){if(l&&r&&typeof l.stack=="string"){for(var i=l.stack.split(`
`),o=r.stack.split(`
`),a=i.length-1,s=o.length-1;1<=a&&0<=s&&i[a]!==o[s];)s--;for(;1<=a&&0<=s;a--,s--)if(i[a]!==o[s]){if(a!==1||s!==1)do if(a--,s--,0>s||i[a]!==o[s])return`
`+i[a].replace(" at new "," at ");while(1<=a&&0<=s);break}}}finally{Yk=!1,Error.prepareStackTrace=n}return(t=t?t.displayName||t.name:"")?rx(t):""}function H0e(t){switch(t.tag){case 5:return rx(t.type);case 16:return rx("Lazy");case 13:return rx("Suspense");case 19:return rx("SuspenseList");case 0:case 2:case 15:return t=Uw(t.type,!1),t;case 11:return t=Uw(t.type.render,!1),t;case 22:return t=Uw(t.type._render,!1),t;case 1:return t=Uw(t.type,!0),t;default:return""}}function dg(t){if(t==null)return null;if(typeof t=="function")return t.displayName||t.name||null;if(typeof t=="string")return t;switch(t){case df:return"Fragment";case hh:return"Portal";case Ox:return"Profiler";case VF:return"StrictMode";case Cx:return"Suspense";case ZC:return"SuspenseList"}if(typeof t=="object")switch(t.$$typeof){case HF:return(t.displayName||"Context")+".Consumer";case GF:return(t._context.displayName||"Context")+".Provider";case BP:var e=t.render;return e=e.displayName||e.name||"",t.displayName||(e!==""?"ForwardRef("+e+")":"ForwardRef");case zP:return dg(t.type);case XF:return dg(t._render);case qF:e=t._payload,t=t._init;try{return dg(t(e))}catch{}}return null}function qf(t){switch(typeof t){case"boolean":case"number":case"object":case"string":case"undefined":return t;default:return""}}function yee(t){var e=t.type;return(t=t.nodeName)&&t.toLowerCase()==="input"&&(e==="checkbox"||e==="radio")}function q0e(t){var e=yee(t)?"checked":"value",n=Object.getOwnPropertyDescriptor(t.constructor.prototype,e),r=""+t[e];if(!t.hasOwnProperty(e)&&typeof n<"u"&&typeof n.get=="function"&&typeof n.set=="function"){var i=n.get,o=n.set;return Object.defineProperty(t,e,{configurable:!0,get:function(){return i.call(this)},set:function(a){r=""+a,o.call(this,a)}}),Object.defineProperty(t,e,{enumerable:n.enumerable}),{getValue:function(){return r},setValue:function(a){r=""+a},stopTracking:function(){t._valueTracker=null,delete t[e]}}}}function Ww(t){t._valueTracker||(t._valueTracker=q0e(t))}function xee(t){if(!t)return!1;var e=t._valueTracker;if(!e)return!0;var n=e.getValue(),r="";return t&&(r=yee(t)?t.checked?"true":"false":t.value),t=r,t!==n?(e.setValue(t),!0):!1}function JC(t){if(t=t||(typeof document<"u"?document:void 0),typeof t>"u")return null;try{return t.activeElement||t.body}catch{return t.body}}function WD(t,e){var n=e.checked;return hr({},e,{defaultChecked:void 0,defaultValue:void 0,value:void 0,checked:n??t._wrapperState.initialChecked})}function rW(t,e){var n=e.defaultValue==null?"":e.defaultValue,r=e.checked!=null?e.checked:e.defaultChecked;n=qf(e.value!=null?e.value:n),t._wrapperState={initialChecked:r,initialValue:n,controlled:e.type==="checkbox"||e.type==="radio"?e.checked!=null:e.value!=null}}function bee(t,e){e=e.checked,e!=null&&WF(t,"checked",e,!1)}function VD(t,e){bee(t,e);var n=qf(e.value),r=e.type;if(n!=null)r==="number"?(n===0&&t.value===""||t.value!=n)&&(t.value=""+n):t.value!==""+n&&(t.value=""+n);else if(r==="submit"||r==="reset"){t.removeAttribute("value");return}e.hasOwnProperty("value")?GD(t,e.type,n):e.hasOwnProperty("defaultValue")&&GD(t,e.type,qf(e.defaultValue)),e.checked==null&&e.defaultChecked!=null&&(t.defaultChecked=!!e.defaultChecked)}function iW(t,e,n){if(e.hasOwnProperty("value")||e.hasOwnProperty("defaultValue")){var r=e.type;if(!(r!=="submit"&&r!=="reset"||e.value!==void 0&&e.value!==null))return;e=""+t._wrapperState.initialValue,n||e===t.value||(t.value=e),t.defaultValue=e}n=t.name,n!==""&&(t.name=""),t.defaultChecked=!!t._wrapperState.initialChecked,n!==""&&(t.name=n)}function GD(t,e,n){(e!=="number"||JC(t.ownerDocument)!==t)&&(n==null?t.defaultValue=""+t._wrapperState.initialValue:t.defaultValue!==""+n&&(t.defaultValue=""+n))}function X0e(t){var e="";return jP.Children.forEach(t,function(n){n!=null&&(e+=n)}),e}function HD(t,e){return t=hr({children:void 0},e),(e=X0e(e.children))&&(t.children=e),t}function hg(t,e,n,r){if(t=t.options,e){e={};for(var i=0;i<n.length;i++)e["$"+n[i]]=!0;for(n=0;n<t.length;n++)i=e.hasOwnProperty("$"+t[n].value),t[n].selected!==i&&(t[n].selected=i),i&&r&&(t[n].defaultSelected=!0)}else{for(n=""+qf(n),e=null,i=0;i<t.length;i++){if(t[i].value===n){t[i].selected=!0,r&&(t[i].defaultSelected=!0);return}e!==null||t[i].disabled||(e=t[i])}e!==null&&(e.selected=!0)}}function qD(t,e){if(e.dangerouslySetInnerHTML!=null)throw Error(Xe(91));return hr({},e,{value:void 0,defaultValue:void 0,children:""+t._wrapperState.initialValue})}function oW(t,e){var n=e.value;if(n==null){if(n=e.children,e=e.defaultValue,n!=null){if(e!=null)throw Error(Xe(92));if(Array.isArray(n)){if(!(1>=n.length))throw Error(Xe(93));n=n[0]}e=n}e==null&&(e=""),n=e}t._wrapperState={initialValue:qf(n)}}function _ee(t,e){var n=qf(e.value),r=qf(e.defaultValue);n!=null&&(n=""+n,n!==t.value&&(t.value=n),e.defaultValue==null&&t.defaultValue!==n&&(t.defaultValue=n)),r!=null&&(t.defaultValue=""+r)}function aW(t){var e=t.textContent;e===t._wrapperState.initialValue&&e!==""&&e!==null&&(t.value=e)}var XD={html:"http://www.w3.org/1999/xhtml",mathml:"http://www.w3.org/1998/Math/MathML",svg:"http://www.w3.org/2000/svg"};function wee(t){switch(t){case"svg":return"http://www.w3.org/2000/svg";case"math":return"http://www.w3.org/1998/Math/MathML";default:return"http://www.w3.org/1999/xhtml"}}function QD(t,e){return t==null||t==="http://www.w3.org/1999/xhtml"?wee(e):t==="http://www.w3.org/2000/svg"&&e==="foreignObject"?"http://www.w3.org/1999/xhtml":t}var Vw,See=function(t){return typeof MSApp<"u"&&MSApp.execUnsafeLocalFunction?function(e,n,r,i){MSApp.execUnsafeLocalFunction(function(){return t(e,n,r,i)})}:t}(function(t,e){if(t.namespaceURI!==XD.svg||"innerHTML"in t)t.innerHTML=e;else{for(Vw=Vw||document.createElement("div"),Vw.innerHTML="<svg>"+e.valueOf().toString()+"</svg>",e=Vw.firstChild;t.firstChild;)t.removeChild(t.firstChild);for(;e.firstChild;)t.appendChild(e.firstChild)}});function pb(t,e){if(e){var n=t.firstChild;if(n&&n===t.lastChild&&n.nodeType===3){n.nodeValue=e;return}}t.textContent=e}var Tx={animationIterationCount:!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},Q0e=["Webkit","ms","Moz","O"];Object.keys(Tx).forEach(function(t){Q0e.forEach(function(e){e=e+t.charAt(0).toUpperCase()+t.substring(1),Tx[e]=Tx[t]})});function Oee(t,e,n){return e==null||typeof e=="boolean"||e===""?"":n||typeof e!="number"||e===0||Tx.hasOwnProperty(t)&&Tx[t]?(""+e).trim():e+"px"}function Cee(t,e){t=t.style;for(var n in e)if(e.hasOwnProperty(n)){var r=n.indexOf("--")===0,i=Oee(n,e[n],r);n==="float"&&(n="cssFloat"),r?t.setProperty(n,i):t[n]=i}}var Y0e=hr({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 YD(t,e){if(e){if(Y0e[t]&&(e.children!=null||e.dangerouslySetInnerHTML!=null))throw Error(Xe(137,t));if(e.dangerouslySetInnerHTML!=null){if(e.children!=null)throw Error(Xe(60));if(!(typeof e.dangerouslySetInnerHTML=="object"&&"__html"in e.dangerouslySetInnerHTML))throw Error(Xe(61))}if(e.style!=null&&typeof e.style!="object")throw Error(Xe(62))}}function KD(t,e){if(t.indexOf("-")===-1)return typeof e.is=="string";switch(t){case"annotation-xml":case"color-profile":case"font-face":case"font-face-src":case"font-face-uri":case"font-face-format":case"font-face-name":case"missing-glyph":return!1;default:return!0}}function KF(t){return t=t.target||t.srcElement||window,t.correspondingUseElement&&(t=t.correspondingUseElement),t.nodeType===3?t.parentNode:t}var ZD=null,pg=null,mg=null;function sW(t){if(t=u1(t)){if(typeof ZD!="function")throw Error(Xe(280));var e=t.stateNode;e&&(e=qP(e),ZD(t.stateNode,t.type,e))}}function Tee(t){pg?mg?mg.push(t):mg=[t]:pg=t}function Eee(){if(pg){var t=pg,e=mg;if(mg=pg=null,sW(t),e)for(t=0;t<e.length;t++)sW(e[t])}}function ZF(t,e){return t(e)}function Pee(t,e,n,r,i){return t(e,n,r,i)}function JF(){}var Mee=ZF,ph=!1,Kk=!1;function ej(){(pg!==null||mg!==null)&&(JF(),Eee())}function K0e(t,e,n){if(Kk)return t(e,n);Kk=!0;try{return Mee(t,e,n)}finally{Kk=!1,ej()}}function mb(t,e){var n=t.stateNode;if(n===null)return null;var r=qP(n);if(r===null)return null;n=r[e];e:switch(e){case"onClick":case"onClickCapture":case"onDoubleClick":case"onDoubleClickCapture":case"onMouseDown":case"onMouseDownCapture":case"onMouseMove":case"onMouseMoveCapture":case"onMouseUp":case"onMouseUpCapture":case"onMouseEnter":(r=!r.disabled)||(t=t.type,r=!(t==="button"||t==="input"||t==="select"||t==="textarea")),t=!r;break e;default:t=!1}if(t)return null;if(n&&typeof n!="function")throw Error(Xe(231,e,typeof n));return n}var JD=!1;if(cu)try{var e0={};Object.defineProperty(e0,"passive",{get:function(){JD=!0}}),window.addEventListener("test",e0,e0),window.removeEventListener("test",e0,e0)}catch{JD=!1}function Z0e(t,e,n,r,i,o,a,s,l){var c=Array.prototype.slice.call(arguments,3);try{e.apply(n,c)}catch(u){this.onError(u)}}var Ex=!1,eT=null,tT=!1,eL=null,J0e={onError:function(t){Ex=!0,eT=t}};function exe(t,e,n,r,i,o,a,s,l){Ex=!1,eT=null,Z0e.apply(J0e,arguments)}function txe(t,e,n,r,i,o,a,s,l){if(exe.apply(this,arguments),Ex){if(Ex){var c=eT;Ex=!1,eT=null}else throw Error(Xe(198));tT||(tT=!0,eL=c)}}function Op(t){var e=t,n=t;if(t.alternate)for(;e.return;)e=e.return;else{t=e;do e=t,e.flags&1026&&(n=e.return),t=e.return;while(t)}return e.tag===3?n:null}function kee(t){if(t.tag===13){var e=t.memoizedState;if(e===null&&(t=t.alternate,t!==null&&(e=t.memoizedState)),e!==null)return e.dehydrated}return null}function lW(t){if(Op(t)!==t)throw Error(Xe(188))}function nxe(t){var e=t.alternate;if(!e){if(e=Op(t),e===null)throw Error(Xe(188));return e!==t?null:t}for(var n=t,r=e;;){var i=n.return;if(i===null)break;var o=i.alternate;if(o===null){if(r=i.return,r!==null){n=r;continue}break}if(i.child===o.child){for(o=i.child;o;){if(o===n)return lW(i),t;if(o===r)return lW(i),e;o=o.sibling}throw Error(Xe(188))}if(n.return!==r.return)n=i,r=o;else{for(var a=!1,s=i.child;s;){if(s===n){a=!0,n=i,r=o;break}if(s===r){a=!0,r=i,n=o;break}s=s.sibling}if(!a){for(s=o.child;s;){if(s===n){a=!0,n=o,r=i;break}if(s===r){a=!0,r=o,n=i;break}s=s.sibling}if(!a)throw Error(Xe(189))}}if(n.alternate!==r)throw Error(Xe(190))}if(n.tag!==3)throw Error(Xe(188));return n.stateNode.current===n?t:e}function Aee(t){if(t=nxe(t),!t)return null;for(var e=t;;){if(e.tag===5||e.tag===6)return e;if(e.child)e.child.return=e,e=e.child;else{if(e===t)break;for(;!e.sibling;){if(!e.return||e.return===t)return null;e=e.return}e.sibling.return=e.return,e=e.sibling}}return null}function cW(t,e){for(var n=t.alternate;e!==null;){if(e===t||e===n)return!0;e=e.return}return!1}var Ree,tj,Iee,Dee,tL=!1,Pl=[],Af=null,Rf=null,If=null,gb=new Map,vb=new Map,t0=[],uW="mousedown mouseup touchcancel touchend touchstart auxclick dblclick pointercancel pointerdown pointerup dragend dragstart drop compositionend compositionstart keydown keypress keyup input textInput copy cut paste click change contextmenu reset submit".split(" ");function nL(t,e,n,r,i){return{blockedOn:t,domEventName:e,eventSystemFlags:n|16,nativeEvent:i,targetContainers:[r]}}function fW(t,e){switch(t){case"focusin":case"focusout":Af=null;break;case"dragenter":case"dragleave":Rf=null;break;case"mouseover":case"mouseout":If=null;break;case"pointerover":case"pointerout":gb.delete(e.pointerId);break;case"gotpointercapture":case"lostpointercapture":vb.delete(e.pointerId)}}function n0(t,e,n,r,i,o){return t===null||t.nativeEvent!==o?(t=nL(e,n,r,i,o),e!==null&&(e=u1(e),e!==null&&tj(e)),t):(t.eventSystemFlags|=r,e=t.targetContainers,i!==null&&e.indexOf(i)===-1&&e.push(i),t)}function rxe(t,e,n,r,i){switch(e){case"focusin":return Af=n0(Af,t,e,n,r,i),!0;case"dragenter":return Rf=n0(Rf,t,e,n,r,i),!0;case"mouseover":return If=n0(If,t,e,n,r,i),!0;case"pointerover":var o=i.pointerId;return gb.set(o,n0(gb.get(o)||null,t,e,n,r,i)),!0;case"gotpointercapture":return o=i.pointerId,vb.set(o,n0(vb.get(o)||null,t,e,n,r,i)),!0}return!1}function ixe(t){var e=mh(t.target);if(e!==null){var n=Op(e);if(n!==null){if(e=n.tag,e===13){if(e=kee(n),e!==null){t.blockedOn=e,Dee(t.lanePriority,function(){ui.unstable_runWithPriority(t.priority,function(){Iee(n)})});return}}else if(e===3&&n.stateNode.hydrate){t.blockedOn=n.tag===3?n.stateNode.containerInfo:null;return}}}t.blockedOn=null}function dC(t){if(t.blockedOn!==null)return!1;for(var e=t.targetContainers;0<e.length;){var n=oj(t.domEventName,t.eventSystemFlags,e[0],t.nativeEvent);if(n!==null)return e=u1(n),e!==null&&tj(e),t.blockedOn=n,!1;e.shift()}return!0}function dW(t,e,n){dC(t)&&n.delete(e)}function oxe(){for(tL=!1;0<Pl.length;){var t=Pl[0];if(t.blockedOn!==null){t=u1(t.blockedOn),t!==null&&Ree(t);break}for(var e=t.targetContainers;0<e.length;){var n=oj(t.domEventName,t.eventSystemFlags,e[0],t.nativeEvent);if(n!==null){t.blockedOn=n;break}e.shift()}t.blockedOn===null&&Pl.shift()}Af!==null&&dC(Af)&&(Af=null),Rf!==null&&dC(Rf)&&(Rf=null),If!==null&&dC(If)&&(If=null),gb.forEach(dW),vb.forEach(dW)}function r0(t,e){t.blockedOn===e&&(t.blockedOn=null,tL||(tL=!0,ui.unstable_scheduleCallback(ui.unstable_NormalPriority,oxe)))}function Lee(t){function e(i){return r0(i,t)}if(0<Pl.length){r0(Pl[0],t);for(var n=1;n<Pl.length;n++){var r=Pl[n];r.blockedOn===t&&(r.blockedOn=null)}}for(Af!==null&&r0(Af,t),Rf!==null&&r0(Rf,t),If!==null&&r0(If,t),gb.forEach(e),vb.forEach(e),n=0;n<t0.length;n++)r=t0[n],r.blockedOn===t&&(r.blockedOn=null);for(;0<t0.length&&(n=t0[0],n.blockedOn===null);)ixe(n),n.blockedOn===null&&t0.shift()}function Gw(t,e){var n={};return n[t.toLowerCase()]=e.toLowerCase(),n["Webkit"+t]="webkit"+e,n["Moz"+t]="moz"+e,n}var Hm={animationend:Gw("Animation","AnimationEnd"),animationiteration:Gw("Animation","AnimationIteration"),animationstart:Gw("Animation","AnimationStart"),transitionend:Gw("Transition","TransitionEnd")},Zk={},Nee={};cu&&(Nee=document.createElement("div").style,"AnimationEvent"in window||(delete Hm.animationend.animation,delete Hm.animationiteration.animation,delete Hm.animationstart.animation),"TransitionEvent"in window||delete Hm.transitionend.transition);function UP(t){if(Zk[t])return Zk[t];if(!Hm[t])return t;var e=Hm[t],n;for(n in e)if(e.hasOwnProperty(n)&&n in Nee)return Zk[t]=e[n];return t}var $ee=UP("animationend"),Fee=UP("animationiteration"),jee=UP("animationstart"),Bee=UP("transitionend"),zee=new Map,nj=new Map,axe=["abort","abort",$ee,"animationEnd",Fee,"animationIteration",jee,"animationStart","canplay","canPlay","canplaythrough","canPlayThrough","durationchange","durationChange","emptied","emptied","encrypted","encrypted","ended","ended","error","error","gotpointercapture","gotPointerCapture","load","load","loadeddata","loadedData","loadedmetadata","loadedMetadata","loadstart","loadStart","lostpointercapture","lostPointerCapture","playing","playing","progress","progress","seeking","seeking","stalled","stalled","suspend","suspend","timeupdate","timeUpdate",Bee,"transitionEnd","waiting","waiting"];function rj(t,e){for(var n=0;n<t.length;n+=2){var r=t[n],i=t[n+1];i="on"+(i[0].toUpperCase()+i.slice(1)),nj.set(r,e),zee.set(r,i),wp(i,[r])}}var sxe=ui.unstable_now;sxe();var jn=8;function Im(t){if(1&t)return jn=15,1;if(2&t)return jn=14,2;if(4&t)return jn=13,4;var e=24&t;return e!==0?(jn=12,e):t&32?(jn=11,32):(e=192&t,e!==0?(jn=10,e):t&256?(jn=9,256):(e=3584&t,e!==0?(jn=8,e):t&4096?(jn=7,4096):(e=4186112&t,e!==0?(jn=6,e):(e=62914560&t,e!==0?(jn=5,e):t&67108864?(jn=4,67108864):t&134217728?(jn=3,134217728):(e=805306368&t,e!==0?(jn=2,e):1073741824&t?(jn=1,1073741824):(jn=8,t))))))}function lxe(t){switch(t){case 99:return 15;case 98:return 10;case 97:case 96:return 8;case 95:return 2;default:return 0}}function cxe(t){switch(t){case 15:case 14:return 99;case 13:case 12:case 11:case 10:return 98;case 9:case 8:case 7:case 6:case 4:case 5:return 97;case 3:case 2:case 1:return 95;case 0:return 90;default:throw Error(Xe(358,t))}}function yb(t,e){var n=t.pendingLanes;if(n===0)return jn=0;var r=0,i=0,o=t.expiredLanes,a=t.suspendedLanes,s=t.pingedLanes;if(o!==0)r=o,i=jn=15;else if(o=n&134217727,o!==0){var l=o&~a;l!==0?(r=Im(l),i=jn):(s&=o,s!==0&&(r=Im(s),i=jn))}else o=n&~a,o!==0?(r=Im(o),i=jn):s!==0&&(r=Im(s),i=jn);if(r===0)return 0;if(r=31-Xf(r),r=n&((0>r?0:1<<r)<<1)-1,e!==0&&e!==r&&!(e&a)){if(Im(e),i<=jn)return e;jn=i}if(e=t.entangledLanes,e!==0)for(t=t.entanglements,e&=r;0<e;)n=31-Xf(e),i=1<<n,r|=t[n],e&=~i;return r}function Uee(t){return t=t.pendingLanes&-1073741825,t!==0?t:t&1073741824?1073741824:0}function nT(t,e){switch(t){case 15:return 1;case 14:return 2;case 12:return t=Dm(24&~e),t===0?nT(10,e):t;case 10:return t=Dm(192&~e),t===0?nT(8,e):t;case 8:return t=Dm(3584&~e),t===0&&(t=Dm(4186112&~e),t===0&&(t=512)),t;case 2:return e=Dm(805306368&~e),e===0&&(e=268435456),e}throw Error(Xe(358,t))}function Dm(t){return t&-t}function Jk(t){for(var e=[],n=0;31>n;n++)e.push(t);return e}function WP(t,e,n){t.pendingLanes|=e;var r=e-1;t.suspendedLanes&=r,t.pingedLanes&=r,t=t.eventTimes,e=31-Xf(e),t[e]=n}var Xf=Math.clz32?Math.clz32:dxe,uxe=Math.log,fxe=Math.LN2;function dxe(t){return t===0?32:31-(uxe(t)/fxe|0)|0}var hxe=ui.unstable_UserBlockingPriority,pxe=ui.unstable_runWithPriority,hC=!0;function mxe(t,e,n,r){ph||JF();var i=ij,o=ph;ph=!0;try{Pee(i,t,e,n,r)}finally{(ph=o)||ej()}}function gxe(t,e,n,r){pxe(hxe,ij.bind(null,t,e,n,r))}function ij(t,e,n,r){if(hC){var i;if((i=(e&4)===0)&&0<Pl.length&&-1<uW.indexOf(t))t=nL(null,t,e,n,r),Pl.push(t);else{var o=oj(t,e,n,r);if(o===null)i&&fW(t,r);else{if(i){if(-1<uW.indexOf(t)){t=nL(o,t,e,n,r),Pl.push(t);return}if(rxe(o,t,e,n,r))return;fW(t,r)}ete(t,e,r,null,n)}}}}function oj(t,e,n,r){var i=KF(r);if(i=mh(i),i!==null){var o=Op(i);if(o===null)i=null;else{var a=o.tag;if(a===13){if(i=kee(o),i!==null)return i;i=null}else if(a===3){if(o.stateNode.hydrate)return o.tag===3?o.stateNode.containerInfo:null;i=null}else o!==i&&(i=null)}}return ete(t,e,r,i,n),null}var vf=null,aj=null,pC=null;function Wee(){if(pC)return pC;var t,e=aj,n=e.length,r,i="value"in vf?vf.value:vf.textContent,o=i.length;for(t=0;t<n&&e[t]===i[t];t++);var a=n-t;for(r=1;r<=a&&e[n-r]===i[o-r];r++);return pC=i.slice(t,1<r?1-r:void 0)}function mC(t){var e=t.keyCode;return"charCode"in t?(t=t.charCode,t===0&&e===13&&(t=13)):t=e,t===10&&(t=13),32<=t||t===13?t:0}function Hw(){return!0}function hW(){return!1}function Pa(t){function e(n,r,i,o,a){this._reactName=n,this._targetInst=i,this.type=r,this.nativeEvent=o,this.target=a,this.currentTarget=null;for(var s in t)t.hasOwnProperty(s)&&(n=t[s],this[s]=n?n(o):o[s]);return this.isDefaultPrevented=(o.defaultPrevented!=null?o.defaultPrevented:o.returnValue===!1)?Hw:hW,this.isPropagationStopped=hW,this}return hr(e.prototype,{preventDefault:function(){this.defaultPrevented=!0;var n=this.nativeEvent;n&&(n.preventDefault?n.preventDefault():typeof n.returnValue!="unknown"&&(n.returnValue=!1),this.isDefaultPrevented=Hw)},stopPropagation:function(){var n=this.nativeEvent;n&&(n.stopPropagation?n.stopPropagation():typeof n.cancelBubble!="unknown"&&(n.cancelBubble=!0),this.isPropagationStopped=Hw)},persist:function(){},isPersistent:Hw}),e}var Uv={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(t){return t.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},sj=Pa(Uv),c1=hr({},Uv,{view:0,detail:0}),vxe=Pa(c1),eA,tA,i0,VP=hr({},c1,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:lj,button:0,buttons:0,relatedTarget:function(t){return t.relatedTarget===void 0?t.fromElement===t.srcElement?t.toElement:t.fromElement:t.relatedTarget},movementX:function(t){return"movementX"in t?t.movementX:(t!==i0&&(i0&&t.type==="mousemove"?(eA=t.screenX-i0.screenX,tA=t.screenY-i0.screenY):tA=eA=0,i0=t),eA)},movementY:function(t){return"movementY"in t?t.movementY:tA}}),pW=Pa(VP),yxe=hr({},VP,{dataTransfer:0}),xxe=Pa(yxe),bxe=hr({},c1,{relatedTarget:0}),nA=Pa(bxe),_xe=hr({},Uv,{animationName:0,elapsedTime:0,pseudoElement:0}),wxe=Pa(_xe),Sxe=hr({},Uv,{clipboardData:function(t){return"clipboardData"in t?t.clipboardData:window.clipboardData}}),Oxe=Pa(Sxe),Cxe=hr({},Uv,{data:0}),mW=Pa(Cxe),Txe={Esc:"Escape",Spacebar:" ",Left:"ArrowLeft",Up:"ArrowUp",Right:"ArrowRight",Down:"ArrowDown",Del:"Delete",Win:"OS",Menu:"ContextMenu",Apps:"ContextMenu",Scroll:"ScrollLock",MozPrintableKey:"Unidentified"},Exe={8:"Backspace",9:"Tab",12:"Clear",13:"Enter",16:"Shift",17:"Control",18:"Alt",19:"Pause",20:"CapsLock",27:"Escape",32:" ",33:"PageUp",34:"PageDown",35:"End",36:"Home",37:"ArrowLeft",38:"ArrowUp",39:"ArrowRight",40:"ArrowDown",45:"Insert",46:"Delete",112:"F1",113:"F2",114:"F3",115:"F4",116:"F5",117:"F6",118:"F7",119:"F8",120:"F9",121:"F10",122:"F11",123:"F12",144:"NumLock",145:"ScrollLock",224:"Meta"},Pxe={Alt:"altKey",Control:"ctrlKey",Meta:"metaKey",Shift:"shiftKey"};function Mxe(t){var e=this.nativeEvent;return e.getModifierState?e.getModifierState(t):(t=Pxe[t])?!!e[t]:!1}function lj(){return Mxe}var kxe=hr({},c1,{key:function(t){if(t.key){var e=Txe[t.key]||t.key;if(e!=="Unidentified")return e}return t.type==="keypress"?(t=mC(t),t===13?"Enter":String.fromCharCode(t)):t.type==="keydown"||t.type==="keyup"?Exe[t.keyCode]||"Unidentified":""},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:lj,charCode:function(t){return t.type==="keypress"?mC(t):0},keyCode:function(t){return t.type==="keydown"||t.type==="keyup"?t.keyCode:0},which:function(t){return t.type==="keypress"?mC(t):t.type==="keydown"||t.type==="keyup"?t.keyCode:0}}),Axe=Pa(kxe),Rxe=hr({},VP,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0}),gW=Pa(Rxe),Ixe=hr({},c1,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:lj}),Dxe=Pa(Ixe),Lxe=hr({},Uv,{propertyName:0,elapsedTime:0,pseudoElement:0}),Nxe=Pa(Lxe),$xe=hr({},VP,{deltaX:function(t){return"deltaX"in t?t.deltaX:"wheelDeltaX"in t?-t.wheelDeltaX:0},deltaY:function(t){return"deltaY"in t?t.deltaY:"wheelDeltaY"in t?-t.wheelDeltaY:"wheelDelta"in t?-t.wheelDelta:0},deltaZ:0,deltaMode:0}),Fxe=Pa($xe),jxe=[9,13,27,32],cj=cu&&"CompositionEvent"in window,Px=null;cu&&"documentMode"in document&&(Px=document.documentMode);var Bxe=cu&&"TextEvent"in window&&!Px,Vee=cu&&(!cj||Px&&8<Px&&11>=Px),vW=" ",yW=!1;function Gee(t,e){switch(t){case"keyup":return jxe.indexOf(e.keyCode)!==-1;case"keydown":return e.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function Hee(t){return t=t.detail,typeof t=="object"&&"data"in t?t.data:null}var qm=!1;function zxe(t,e){switch(t){case"compositionend":return Hee(e);case"keypress":return e.which!==32?null:(yW=!0,vW);case"textInput":return t=e.data,t===vW&&yW?null:t;default:return null}}function Uxe(t,e){if(qm)return t==="compositionend"||!cj&&Gee(t,e)?(t=Wee(),pC=aj=vf=null,qm=!1,t):null;switch(t){case"paste":return null;case"keypress":if(!(e.ctrlKey||e.altKey||e.metaKey)||e.ctrlKey&&e.altKey){if(e.char&&1<e.char.length)return e.char;if(e.which)return String.fromCharCode(e.which)}return null;case"compositionend":return Vee&&e.locale!=="ko"?null:e.data;default:return null}}var Wxe={color:!0,date:!0,datetime:!0,"datetime-local":!0,email:!0,month:!0,number:!0,password:!0,range:!0,search:!0,tel:!0,text:!0,time:!0,url:!0,week:!0};function xW(t){var e=t&&t.nodeName&&t.nodeName.toLowerCase();return e==="input"?!!Wxe[t.type]:e==="textarea"}function qee(t,e,n,r){Tee(r),e=rT(e,"onChange"),0<e.length&&(n=new sj("onChange","change",null,n,r),t.push({event:n,listeners:e}))}var Mx=null,xb=null;function Vxe(t){Kee(t,0)}function GP(t){var e=Qm(t);if(xee(e))return t}function Gxe(t,e){if(t==="change")return e}var Xee=!1;if(cu){var rA;if(cu){var iA="oninput"in document;if(!iA){var bW=document.createElement("div");bW.setAttribute("oninput","return;"),iA=typeof bW.oninput=="function"}rA=iA}else rA=!1;Xee=rA&&(!document.documentMode||9<document.documentMode)}function _W(){Mx&&(Mx.detachEvent("onpropertychange",Qee),xb=Mx=null)}function Qee(t){if(t.propertyName==="value"&&GP(xb)){var e=[];if(qee(e,xb,t,KF(t)),t=Vxe,ph)t(e);else{ph=!0;try{ZF(t,e)}finally{ph=!1,ej()}}}}function Hxe(t,e,n){t==="focusin"?(_W(),Mx=e,xb=n,Mx.attachEvent("onpropertychange",Qee)):t==="focusout"&&_W()}function qxe(t){if(t==="selectionchange"||t==="keyup"||t==="keydown")return GP(xb)}function Xxe(t,e){if(t==="click")return GP(e)}function Qxe(t,e){if(t==="input"||t==="change")return GP(e)}function Yxe(t,e){return t===e&&(t!==0||1/t===1/e)||t!==t&&e!==e}var Wa=typeof Object.is=="function"?Object.is:Yxe,Kxe=Object.prototype.hasOwnProperty;function bb(t,e){if(Wa(t,e))return!0;if(typeof t!="object"||t===null||typeof e!="object"||e===null)return!1;var n=Object.keys(t),r=Object.keys(e);if(n.length!==r.length)return!1;for(r=0;r<n.length;r++)if(!Kxe.call(e,n[r])||!Wa(t[n[r]],e[n[r]]))return!1;return!0}function wW(t){for(;t&&t.firstChild;)t=t.firstChild;return t}function SW(t,e){var n=wW(t);t=0;for(var r;n;){if(n.nodeType===3){if(r=t+n.textContent.length,t<=e&&r>=e)return{node:n,offset:e-t};t=r}e:{for(;n;){if(n.nextSibling){n=n.nextSibling;break e}n=n.parentNode}n=void 0}n=wW(n)}}function Yee(t,e){return t&&e?t===e?!0:t&&t.nodeType===3?!1:e&&e.nodeType===3?Yee(t,e.parentNode):"contains"in t?t.contains(e):t.compareDocumentPosition?!!(t.compareDocumentPosition(e)&16):!1:!1}function OW(){for(var t=window,e=JC();e instanceof t.HTMLIFrameElement;){try{var n=typeof e.contentWindow.location.href=="string"}catch{n=!1}if(n)t=e.contentWindow;else break;e=JC(t.document)}return e}function rL(t){var e=t&&t.nodeName&&t.nodeName.toLowerCase();return e&&(e==="input"&&(t.type==="text"||t.type==="search"||t.type==="tel"||t.type==="url"||t.type==="password")||e==="textarea"||t.contentEditable==="true")}var Zxe=cu&&"documentMode"in document&&11>=document.documentMode,Xm=null,iL=null,kx=null,oL=!1;function CW(t,e,n){var r=n.window===n?n.document:n.nodeType===9?n:n.ownerDocument;oL||Xm==null||Xm!==JC(r)||(r=Xm,"selectionStart"in r&&rL(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}),kx&&bb(kx,r)||(kx=r,r=rT(iL,"onSelect"),0<r.length&&(e=new sj("onSelect","select",null,e,n),t.push({event:e,listeners:r}),e.target=Xm)))}rj("cancel cancel click click close close contextmenu contextMenu copy copy cut cut auxclick auxClick dblclick doubleClick dragend dragEnd dragstart dragStart drop drop focusin focus focusout blur input input invalid invalid keydown keyDown keypress keyPress keyup keyUp mousedown mouseDown mouseup mouseUp paste paste pause pause play play pointercancel pointerCancel pointerdown pointerDown pointerup pointerUp ratechange rateChange reset reset seeked seeked submit submit touchcancel touchCancel touchend touchEnd touchstart touchStart volumechange volumeChange".split(" "),0);rj("drag drag dragenter dragEnter dragexit dragExit dragleave dragLeave dragover dragOver mousemove mouseMove mouseout mouseOut mouseover mouseOver pointermove pointerMove pointerout pointerOut pointerover pointerOver scroll scroll toggle toggle touchmove touchMove wheel wheel".split(" "),1);rj(axe,2);for(var TW="change selectionchange textInput compositionstart compositionend compositionupdate".split(" "),oA=0;oA<TW.length;oA++)nj.set(TW[oA],0);Wg("onMouseEnter",["mouseout","mouseover"]);Wg("onMouseLeave",["mouseout","mouseover"]);Wg("onPointerEnter",["pointerout","pointerover"]);Wg("onPointerLeave",["pointerout","pointerover"]);wp("onChange","change click focusin focusout input keydown keyup selectionchange".split(" "));wp("onSelect","focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange".split(" "));wp("onBeforeInput",["compositionend","keypress","textInput","paste"]);wp("onCompositionEnd","compositionend focusout keydown keypress keyup mousedown".split(" "));wp("onCompositionStart","compositionstart focusout keydown keypress keyup mousedown".split(" "));wp("onCompositionUpdate","compositionupdate focusout keydown keypress keyup mousedown".split(" "));var ix="abort canplay canplaythrough durationchange emptied encrypted ended error loadeddata loadedmetadata loadstart pause play playing progress ratechange seeked seeking stalled suspend timeupdate volumechange waiting".split(" "),Jxe=new Set("cancel close invalid load scroll toggle".split(" ").concat(ix));function EW(t,e,n){var r=t.type||"unknown-event";t.currentTarget=n,txe(r,e,void 0,t),t.currentTarget=null}function Kee(t,e){e=(e&4)!==0;for(var n=0;n<t.length;n++){var r=t[n],i=r.event;r=r.listeners;e:{var o=void 0;if(e)for(var a=r.length-1;0<=a;a--){var s=r[a],l=s.instance,c=s.currentTarget;if(s=s.listener,l!==o&&i.isPropagationStopped())break e;EW(i,s,c),o=l}else for(a=0;a<r.length;a++){if(s=r[a],l=s.instance,c=s.currentTarget,s=s.listener,l!==o&&i.isPropagationStopped())break e;EW(i,s,c),o=l}}}if(tT)throw t=eL,tT=!1,eL=null,t}function qn(t,e){var n=nte(e),r=t+"__bubble";n.has(r)||(Jee(e,t,2,!1),n.add(r))}var PW="_reactListening"+Math.random().toString(36).slice(2);function Zee(t){t[PW]||(t[PW]=!0,gee.forEach(function(e){Jxe.has(e)||MW(e,!1,t,null),MW(e,!0,t,null)}))}function MW(t,e,n,r){var i=4<arguments.length&&arguments[4]!==void 0?arguments[4]:0,o=n;t==="selectionchange"&&n.nodeType!==9&&(o=n.ownerDocument);var a=nte(o),s=t+"__"+(e?"capture":"bubble");a.has(s)||(e&&(i|=4),Jee(o,t,i,e),a.add(s))}function Jee(t,e,n,r){var i=nj.get(e);switch(i===void 0?2:i){case 0:i=mxe;break;case 1:i=gxe;break;default:i=ij}n=i.bind(null,e,n,t),i=void 0,!JD||e!=="touchstart"&&e!=="touchmove"&&e!=="wheel"||(i=!0),r?i!==void 0?t.addEventListener(e,n,{capture:!0,passive:i}):t.addEventListener(e,n,!0):i!==void 0?t.addEventListener(e,n,{passive:i}):t.addEventListener(e,n,!1)}function ete(t,e,n,r,i){var o=r;if(!(e&1)&&!(e&2)&&r!==null)e:for(;;){if(r===null)return;var a=r.tag;if(a===3||a===4){var s=r.stateNode.containerInfo;if(s===i||s.nodeType===8&&s.parentNode===i)break;if(a===4)for(a=r.return;a!==null;){var l=a.tag;if((l===3||l===4)&&(l=a.stateNode.containerInfo,l===i||l.nodeType===8&&l.parentNode===i))return;a=a.return}for(;s!==null;){if(a=mh(s),a===null)return;if(l=a.tag,l===5||l===6){r=o=a;continue e}s=s.parentNode}}r=r.return}K0e(function(){var c=o,u=KF(n),f=[];e:{var d=zee.get(t);if(d!==void 0){var h=sj,p=t;switch(t){case"keypress":if(mC(n)===0)break e;case"keydown":case"keyup":h=Axe;break;case"focusin":p="focus",h=nA;break;case"focusout":p="blur",h=nA;break;case"beforeblur":case"afterblur":h=nA;break;case"click":if(n.button===2)break e;case"auxclick":case"dblclick":case"mousedown":case"mousemove":case"mouseup":case"mouseout":case"mouseover":case"contextmenu":h=pW;break;case"drag":case"dragend":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"dragstart":case"drop":h=xxe;break;case"touchcancel":case"touchend":case"touchmove":case"touchstart":h=Dxe;break;case $ee:case Fee:case jee:h=wxe;break;case Bee:h=Nxe;break;case"scroll":h=vxe;break;case"wheel":h=Fxe;break;case"copy":case"cut":case"paste":h=Oxe;break;case"gotpointercapture":case"lostpointercapture":case"pointercancel":case"pointerdown":case"pointermove":case"pointerout":case"pointerover":case"pointerup":h=gW}var m=(e&4)!==0,g=!m&&t==="scroll",v=m?d!==null?d+"Capture":null:d;m=[];for(var y=c,x;y!==null;){x=y;var b=x.stateNode;if(x.tag===5&&b!==null&&(x=b,v!==null&&(b=mb(y,v),b!=null&&m.push(_b(y,b,x)))),g)break;y=y.return}0<m.length&&(d=new h(d,p,null,n,u),f.push({event:d,listeners:m}))}}if(!(e&7)){e:{if(d=t==="mouseover"||t==="pointerover",h=t==="mouseout"||t==="pointerout",d&&!(e&16)&&(p=n.relatedTarget||n.fromElement)&&(mh(p)||p[Wv]))break e;if((h||d)&&(d=u.window===u?u:(d=u.ownerDocument)?d.defaultView||d.parentWindow:window,h?(p=n.relatedTarget||n.toElement,h=c,p=p?mh(p):null,p!==null&&(g=Op(p),p!==g||p.tag!==5&&p.tag!==6)&&(p=null)):(h=null,p=c),h!==p)){if(m=pW,b="onMouseLeave",v="onMouseEnter",y="mouse",(t==="pointerout"||t==="pointerover")&&(m=gW,b="onPointerLeave",v="onPointerEnter",y="pointer"),g=h==null?d:Qm(h),x=p==null?d:Qm(p),d=new m(b,y+"leave",h,n,u),d.target=g,d.relatedTarget=x,b=null,mh(u)===c&&(m=new m(v,y+"enter",p,n,u),m.target=x,m.relatedTarget=g,b=m),g=b,h&&p)t:{for(m=h,v=p,y=0,x=m;x;x=Kp(x))y++;for(x=0,b=v;b;b=Kp(b))x++;for(;0<y-x;)m=Kp(m),y--;for(;0<x-y;)v=Kp(v),x--;for(;y--;){if(m===v||v!==null&&m===v.alternate)break t;m=Kp(m),v=Kp(v)}m=null}else m=null;h!==null&&kW(f,d,h,m,!1),p!==null&&g!==null&&kW(f,g,p,m,!0)}}e:{if(d=c?Qm(c):window,h=d.nodeName&&d.nodeName.toLowerCase(),h==="select"||h==="input"&&d.type==="file")var _=Gxe;else if(xW(d))if(Xee)_=Qxe;else{_=qxe;var S=Hxe}else(h=d.nodeName)&&h.toLowerCase()==="input"&&(d.type==="checkbox"||d.type==="radio")&&(_=Xxe);if(_&&(_=_(t,c))){qee(f,_,n,u);break e}S&&S(t,d,c),t==="focusout"&&(S=d._wrapperState)&&S.controlled&&d.type==="number"&&GD(d,"number",d.value)}switch(S=c?Qm(c):window,t){case"focusin":(xW(S)||S.contentEditable==="true")&&(Xm=S,iL=c,kx=null);break;case"focusout":kx=iL=Xm=null;break;case"mousedown":oL=!0;break;case"contextmenu":case"mouseup":case"dragend":oL=!1,CW(f,n,u);break;case"selectionchange":if(Zxe)break;case"keydown":case"keyup":CW(f,n,u)}var O;if(cj)e:{switch(t){case"compositionstart":var C="onCompositionStart";break e;case"compositionend":C="onCompositionEnd";break e;case"compositionupdate":C="onCompositionUpdate";break e}C=void 0}else qm?Gee(t,n)&&(C="onCompositionEnd"):t==="keydown"&&n.keyCode===229&&(C="onCompositionStart");C&&(Vee&&n.locale!=="ko"&&(qm||C!=="onCompositionStart"?C==="onCompositionEnd"&&qm&&(O=Wee()):(vf=u,aj="value"in vf?vf.value:vf.textContent,qm=!0)),S=rT(c,C),0<S.length&&(C=new mW(C,t,null,n,u),f.push({event:C,listeners:S}),O?C.data=O:(O=Hee(n),O!==null&&(C.data=O)))),(O=Bxe?zxe(t,n):Uxe(t,n))&&(c=rT(c,"onBeforeInput"),0<c.length&&(u=new mW("onBeforeInput","beforeinput",null,n,u),f.push({event:u,listeners:c}),u.data=O))}Kee(f,e)})}function _b(t,e,n){return{instance:t,listener:e,currentTarget:n}}function rT(t,e){for(var n=e+"Capture",r=[];t!==null;){var i=t,o=i.stateNode;i.tag===5&&o!==null&&(i=o,o=mb(t,n),o!=null&&r.unshift(_b(t,o,i)),o=mb(t,e),o!=null&&r.push(_b(t,o,i))),t=t.return}return r}function Kp(t){if(t===null)return null;do t=t.return;while(t&&t.tag!==5);return t||null}function kW(t,e,n,r,i){for(var o=e._reactName,a=[];n!==null&&n!==r;){var s=n,l=s.alternate,c=s.stateNode;if(l!==null&&l===r)break;s.tag===5&&c!==null&&(s=c,i?(l=mb(n,o),l!=null&&a.unshift(_b(n,l,s))):i||(l=mb(n,o),l!=null&&a.push(_b(n,l,s)))),n=n.return}a.length!==0&&t.push({event:e,listeners:a})}function iT(){}var aA=null,sA=null;function tte(t,e){switch(t){case"button":case"input":case"select":case"textarea":return!!e.autoFocus}return!1}function aL(t,e){return t==="textarea"||t==="option"||t==="noscript"||typeof e.children=="string"||typeof e.children=="number"||typeof e.dangerouslySetInnerHTML=="object"&&e.dangerouslySetInnerHTML!==null&&e.dangerouslySetInnerHTML.__html!=null}var AW=typeof setTimeout=="function"?setTimeout:void 0,ebe=typeof clearTimeout=="function"?clearTimeout:void 0;function uj(t){t.nodeType===1?t.textContent="":t.nodeType===9&&(t=t.body,t!=null&&(t.textContent=""))}function gg(t){for(;t!=null;t=t.nextSibling){var e=t.nodeType;if(e===1||e===3)break}return t}function RW(t){t=t.previousSibling;for(var e=0;t;){if(t.nodeType===8){var n=t.data;if(n==="$"||n==="$!"||n==="$?"){if(e===0)return t;e--}else n==="/$"&&e++}t=t.previousSibling}return null}var lA=0;function tbe(t){return{$$typeof:QF,toString:t,valueOf:t}}var HP=Math.random().toString(36).slice(2),yf="__reactFiber$"+HP,oT="__reactProps$"+HP,Wv="__reactContainer$"+HP,IW="__reactEvents$"+HP;function mh(t){var e=t[yf];if(e)return e;for(var n=t.parentNode;n;){if(e=n[Wv]||n[yf]){if(n=e.alternate,e.child!==null||n!==null&&n.child!==null)for(t=RW(t);t!==null;){if(n=t[yf])return n;t=RW(t)}return e}t=n,n=t.parentNode}return null}function u1(t){return t=t[yf]||t[Wv],!t||t.tag!==5&&t.tag!==6&&t.tag!==13&&t.tag!==3?null:t}function Qm(t){if(t.tag===5||t.tag===6)return t.stateNode;throw Error(Xe(33))}function qP(t){return t[oT]||null}function nte(t){var e=t[IW];return e===void 0&&(e=t[IW]=new Set),e}var sL=[],Ym=-1;function fd(t){return{current:t}}function er(t){0>Ym||(t.current=sL[Ym],sL[Ym]=null,Ym--)}function br(t,e){Ym++,sL[Ym]=t.current,t.current=e}var Qf={},Ji=fd(Qf),Do=fd(!1),Xh=Qf;function Vg(t,e){var n=t.type.contextTypes;if(!n)return Qf;var r=t.stateNode;if(r&&r.__reactInternalMemoizedUnmaskedChildContext===e)return r.__reactInternalMemoizedMaskedChildContext;var i={},o;for(o in n)i[o]=e[o];return r&&(t=t.stateNode,t.__reactInternalMemoizedUnmaskedChildContext=e,t.__reactInternalMemoizedMaskedChildContext=i),i}function Lo(t){return t=t.childContextTypes,t!=null}function aT(){er(Do),er(Ji)}function DW(t,e,n){if(Ji.current!==Qf)throw Error(Xe(168));br(Ji,e),br(Do,n)}function rte(t,e,n){var r=t.stateNode;if(t=e.childContextTypes,typeof r.getChildContext!="function")return n;r=r.getChildContext();for(var i in r)if(!(i in t))throw Error(Xe(108,dg(e)||"Unknown",i));return hr({},n,r)}function gC(t){return t=(t=t.stateNode)&&t.__reactInternalMemoizedMergedChildContext||Qf,Xh=Ji.current,br(Ji,t),br(Do,Do.current),!0}function LW(t,e,n){var r=t.stateNode;if(!r)throw Error(Xe(169));n?(t=rte(t,e,Xh),r.__reactInternalMemoizedMergedChildContext=t,er(Do),er(Ji),br(Ji,t)):er(Do),br(Do,n)}var fj=null,Ih=null,nbe=ui.unstable_runWithPriority,dj=ui.unstable_scheduleCallback,lL=ui.unstable_cancelCallback,rbe=ui.unstable_shouldYield,NW=ui.unstable_requestPaint,cL=ui.unstable_now,ibe=ui.unstable_getCurrentPriorityLevel,XP=ui.unstable_ImmediatePriority,ite=ui.unstable_UserBlockingPriority,ote=ui.unstable_NormalPriority,ate=ui.unstable_LowPriority,ste=ui.unstable_IdlePriority,cA={},obe=NW!==void 0?NW:function(){},Dc=null,vC=null,uA=!1,$W=cL(),Ki=1e4>$W?cL:function(){return cL()-$W};function Gg(){switch(ibe()){case XP:return 99;case ite:return 98;case ote:return 97;case ate:return 96;case ste:return 95;default:throw Error(Xe(332))}}function lte(t){switch(t){case 99:return XP;case 98:return ite;case 97:return ote;case 96:return ate;case 95:return ste;default:throw Error(Xe(332))}}function Qh(t,e){return t=lte(t),nbe(t,e)}function wb(t,e,n){return t=lte(t),dj(t,e,n)}function ic(){if(vC!==null){var t=vC;vC=null,lL(t)}cte()}function cte(){if(!uA&&Dc!==null){uA=!0;var t=0;try{var e=Dc;Qh(99,function(){for(;t<e.length;t++){var n=e[t];do n=n(!0);while(n!==null)}}),Dc=null}catch(n){throw Dc!==null&&(Dc=Dc.slice(t+1)),dj(XP,ic),n}finally{uA=!1}}}var abe=Sp.ReactCurrentBatchConfig;function Fs(t,e){if(t&&t.defaultProps){e=hr({},e),t=t.defaultProps;for(var n in t)e[n]===void 0&&(e[n]=t[n]);return e}return e}var sT=fd(null),lT=null,Km=null,cT=null;function hj(){cT=Km=lT=null}function pj(t){var e=sT.current;er(sT),t.type._context._currentValue=e}function ute(t,e){for(;t!==null;){var n=t.alternate;if((t.childLanes&e)===e){if(n===null||(n.childLanes&e)===e)break;n.childLanes|=e}else t.childLanes|=e,n!==null&&(n.childLanes|=e);t=t.return}}function vg(t,e){lT=t,cT=Km=null,t=t.dependencies,t!==null&&t.firstContext!==null&&(t.lanes&e&&(Gs=!0),t.firstContext=null)}function ss(t,e){if(cT!==t&&e!==!1&&e!==0)if((typeof e!="number"||e===1073741823)&&(cT=t,e=1073741823),e={context:t,observedBits:e,next:null},Km===null){if(lT===null)throw Error(Xe(308));Km=e,lT.dependencies={lanes:0,firstContext:e,responders:null}}else Km=Km.next=e;return t._currentValue}var ef=!1;function mj(t){t.updateQueue={baseState:t.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null},effects:null}}function fte(t,e){t=t.updateQueue,e.updateQueue===t&&(e.updateQueue={baseState:t.baseState,firstBaseUpdate:t.firstBaseUpdate,lastBaseUpdate:t.lastBaseUpdate,shared:t.shared,effects:t.effects})}function Df(t,e){return{eventTime:t,lane:e,tag:0,payload:null,callback:null,next:null}}function Lf(t,e){if(t=t.updateQueue,t!==null){t=t.shared;var n=t.pending;n===null?e.next=e:(e.next=n.next,n.next=e),t.pending=e}}function FW(t,e){var n=t.updateQueue,r=t.alternate;if(r!==null&&(r=r.updateQueue,n===r)){var i=null,o=null;if(n=n.firstBaseUpdate,n!==null){do{var a={eventTime:n.eventTime,lane:n.lane,tag:n.tag,payload:n.payload,callback:n.callback,next:null};o===null?i=o=a:o=o.next=a,n=n.next}while(n!==null);o===null?i=o=e:o=o.next=e}else i=o=e;n={baseState:r.baseState,firstBaseUpdate:i,lastBaseUpdate:o,shared:r.shared,effects:r.effects},t.updateQueue=n;return}t=n.lastBaseUpdate,t===null?n.firstBaseUpdate=e:t.next=e,n.lastBaseUpdate=e}function Sb(t,e,n,r){var i=t.updateQueue;ef=!1;var o=i.firstBaseUpdate,a=i.lastBaseUpdate,s=i.shared.pending;if(s!==null){i.shared.pending=null;var l=s,c=l.next;l.next=null,a===null?o=c:a.next=c,a=l;var u=t.alternate;if(u!==null){u=u.updateQueue;var f=u.lastBaseUpdate;f!==a&&(f===null?u.firstBaseUpdate=c:f.next=c,u.lastBaseUpdate=l)}}if(o!==null){f=i.baseState,a=0,u=c=l=null;do{s=o.lane;var d=o.eventTime;if((r&s)===s){u!==null&&(u=u.next={eventTime:d,lane:0,tag:o.tag,payload:o.payload,callback:o.callback,next:null});e:{var h=t,p=o;switch(s=e,d=n,p.tag){case 1:if(h=p.payload,typeof h=="function"){f=h.call(d,f,s);break e}f=h;break e;case 3:h.flags=h.flags&-4097|64;case 0:if(h=p.payload,s=typeof h=="function"?h.call(d,f,s):h,s==null)break e;f=hr({},f,s);break e;case 2:ef=!0}}o.callback!==null&&(t.flags|=32,s=i.effects,s===null?i.effects=[o]:s.push(o))}else d={eventTime:d,lane:s,tag:o.tag,payload:o.payload,callback:o.callback,next:null},u===null?(c=u=d,l=f):u=u.next=d,a|=s;if(o=o.next,o===null){if(s=i.shared.pending,s===null)break;o=s.next,s.next=null,i.lastBaseUpdate=s,i.shared.pending=null}}while(!0);u===null&&(l=f),i.baseState=l,i.firstBaseUpdate=c,i.lastBaseUpdate=u,d1|=a,t.lanes=a,t.memoizedState=f}}function jW(t,e,n){if(t=e.effects,e.effects=null,t!==null)for(e=0;e<t.length;e++){var r=t[e],i=r.callback;if(i!==null){if(r.callback=null,r=n,typeof i!="function")throw Error(Xe(191,i));i.call(r)}}}var dte=new jP.Component().refs;function uT(t,e,n,r){e=t.memoizedState,n=n(r,e),n=n==null?e:hr({},e,n),t.memoizedState=n,t.lanes===0&&(t.updateQueue.baseState=n)}var QP={isMounted:function(t){return(t=t._reactInternals)?Op(t)===t:!1},enqueueSetState:function(t,e,n){t=t._reactInternals;var r=ya(),i=Nf(t),o=Df(r,i);o.payload=e,n!=null&&(o.callback=n),Lf(t,o),$f(t,i,r)},enqueueReplaceState:function(t,e,n){t=t._reactInternals;var r=ya(),i=Nf(t),o=Df(r,i);o.tag=1,o.payload=e,n!=null&&(o.callback=n),Lf(t,o),$f(t,i,r)},enqueueForceUpdate:function(t,e){t=t._reactInternals;var n=ya(),r=Nf(t),i=Df(n,r);i.tag=2,e!=null&&(i.callback=e),Lf(t,i),$f(t,r,n)}};function BW(t,e,n,r,i,o,a){return t=t.stateNode,typeof t.shouldComponentUpdate=="function"?t.shouldComponentUpdate(r,o,a):e.prototype&&e.prototype.isPureReactComponent?!bb(n,r)||!bb(i,o):!0}function hte(t,e,n){var r=!1,i=Qf,o=e.contextType;return typeof o=="object"&&o!==null?o=ss(o):(i=Lo(e)?Xh:Ji.current,r=e.contextTypes,o=(r=r!=null)?Vg(t,i):Qf),e=new e(n,o),t.memoizedState=e.state!==null&&e.state!==void 0?e.state:null,e.updater=QP,t.stateNode=e,e._reactInternals=t,r&&(t=t.stateNode,t.__reactInternalMemoizedUnmaskedChildContext=i,t.__reactInternalMemoizedMaskedChildContext=o),e}function zW(t,e,n,r){t=e.state,typeof e.componentWillReceiveProps=="function"&&e.componentWillReceiveProps(n,r),typeof e.UNSAFE_componentWillReceiveProps=="function"&&e.UNSAFE_componentWillReceiveProps(n,r),e.state!==t&&QP.enqueueReplaceState(e,e.state,null)}function uL(t,e,n,r){var i=t.stateNode;i.props=n,i.state=t.memoizedState,i.refs=dte,mj(t);var o=e.contextType;typeof o=="object"&&o!==null?i.context=ss(o):(o=Lo(e)?Xh:Ji.current,i.context=Vg(t,o)),Sb(t,n,i,r),i.state=t.memoizedState,o=e.getDerivedStateFromProps,typeof o=="function"&&(uT(t,e,o,n),i.state=t.memoizedState),typeof e.getDerivedStateFromProps=="function"||typeof i.getSnapshotBeforeUpdate=="function"||typeof i.UNSAFE_componentWillMount!="function"&&typeof i.componentWillMount!="function"||(e=i.state,typeof i.componentWillMount=="function"&&i.componentWillMount(),typeof i.UNSAFE_componentWillMount=="function"&&i.UNSAFE_componentWillMount(),e!==i.state&&QP.enqueueReplaceState(i,i.state,null),Sb(t,n,i,r),i.state=t.memoizedState),typeof i.componentDidMount=="function"&&(t.flags|=4)}var qw=Array.isArray;function o0(t,e,n){if(t=n.ref,t!==null&&typeof t!="function"&&typeof t!="object"){if(n._owner){if(n=n._owner,n){if(n.tag!==1)throw Error(Xe(309));var r=n.stateNode}if(!r)throw Error(Xe(147,t));var i=""+t;return e!==null&&e.ref!==null&&typeof e.ref=="function"&&e.ref._stringRef===i?e.ref:(e=function(o){var a=r.refs;a===dte&&(a=r.refs={}),o===null?delete a[i]:a[i]=o},e._stringRef=i,e)}if(typeof t!="string")throw Error(Xe(284));if(!n._owner)throw Error(Xe(290,t))}return t}function Xw(t,e){if(t.type!=="textarea")throw Error(Xe(31,Object.prototype.toString.call(e)==="[object Object]"?"object with keys {"+Object.keys(e).join(", ")+"}":e))}function pte(t){function e(g,v){if(t){var y=g.lastEffect;y!==null?(y.nextEffect=v,g.lastEffect=v):g.firstEffect=g.lastEffect=v,v.nextEffect=null,v.flags=8}}function n(g,v){if(!t)return null;for(;v!==null;)e(g,v),v=v.sibling;return null}function r(g,v){for(g=new Map;v!==null;)v.key!==null?g.set(v.key,v):g.set(v.index,v),v=v.sibling;return g}function i(g,v){return g=Kf(g,v),g.index=0,g.sibling=null,g}function o(g,v,y){return g.index=y,t?(y=g.alternate,y!==null?(y=y.index,y<v?(g.flags=2,v):y):(g.flags=2,v)):v}function a(g){return t&&g.alternate===null&&(g.flags=2),g}function s(g,v,y,x){return v===null||v.tag!==6?(v=mA(y,g.mode,x),v.return=g,v):(v=i(v,y),v.return=g,v)}function l(g,v,y,x){return v!==null&&v.elementType===y.type?(x=i(v,y.props),x.ref=o0(g,v,y),x.return=g,x):(x=_C(y.type,y.key,y.props,null,g.mode,x),x.ref=o0(g,v,y),x.return=g,x)}function c(g,v,y,x){return v===null||v.tag!==4||v.stateNode.containerInfo!==y.containerInfo||v.stateNode.implementation!==y.implementation?(v=gA(y,g.mode,x),v.return=g,v):(v=i(v,y.children||[]),v.return=g,v)}function u(g,v,y,x,b){return v===null||v.tag!==7?(v=_g(y,g.mode,x,b),v.return=g,v):(v=i(v,y),v.return=g,v)}function f(g,v,y){if(typeof v=="string"||typeof v=="number")return v=mA(""+v,g.mode,y),v.return=g,v;if(typeof v=="object"&&v!==null){switch(v.$$typeof){case nx:return y=_C(v.type,v.key,v.props,null,g.mode,y),y.ref=o0(g,null,v),y.return=g,y;case hh:return v=gA(v,g.mode,y),v.return=g,v}if(qw(v)||Jy(v))return v=_g(v,g.mode,y,null),v.return=g,v;Xw(g,v)}return null}function d(g,v,y,x){var b=v!==null?v.key:null;if(typeof y=="string"||typeof y=="number")return b!==null?null:s(g,v,""+y,x);if(typeof y=="object"&&y!==null){switch(y.$$typeof){case nx:return y.key===b?y.type===df?u(g,v,y.props.children,x,b):l(g,v,y,x):null;case hh:return y.key===b?c(g,v,y,x):null}if(qw(y)||Jy(y))return b!==null?null:u(g,v,y,x,null);Xw(g,y)}return null}function h(g,v,y,x,b){if(typeof x=="string"||typeof x=="number")return g=g.get(y)||null,s(v,g,""+x,b);if(typeof x=="object"&&x!==null){switch(x.$$typeof){case nx:return g=g.get(x.key===null?y:x.key)||null,x.type===df?u(v,g,x.props.children,b,x.key):l(v,g,x,b);case hh:return g=g.get(x.key===null?y:x.key)||null,c(v,g,x,b)}if(qw(x)||Jy(x))return g=g.get(y)||null,u(v,g,x,b,null);Xw(v,x)}return null}function p(g,v,y,x){for(var b=null,_=null,S=v,O=v=0,C=null;S!==null&&O<y.length;O++){S.index>O?(C=S,S=null):C=S.sibling;var E=d(g,S,y[O],x);if(E===null){S===null&&(S=C);break}t&&S&&E.alternate===null&&e(g,S),v=o(E,v,O),_===null?b=E:_.sibling=E,_=E,S=C}if(O===y.length)return n(g,S),b;if(S===null){for(;O<y.length;O++)S=f(g,y[O],x),S!==null&&(v=o(S,v,O),_===null?b=S:_.sibling=S,_=S);return b}for(S=r(g,S);O<y.length;O++)C=h(S,g,O,y[O],x),C!==null&&(t&&C.alternate!==null&&S.delete(C.key===null?O:C.key),v=o(C,v,O),_===null?b=C:_.sibling=C,_=C);return t&&S.forEach(function(k){return e(g,k)}),b}function m(g,v,y,x){var b=Jy(y);if(typeof b!="function")throw Error(Xe(150));if(y=b.call(y),y==null)throw Error(Xe(151));for(var _=b=null,S=v,O=v=0,C=null,E=y.next();S!==null&&!E.done;O++,E=y.next()){S.index>O?(C=S,S=null):C=S.sibling;var k=d(g,S,E.value,x);if(k===null){S===null&&(S=C);break}t&&S&&k.alternate===null&&e(g,S),v=o(k,v,O),_===null?b=k:_.sibling=k,_=k,S=C}if(E.done)return n(g,S),b;if(S===null){for(;!E.done;O++,E=y.next())E=f(g,E.value,x),E!==null&&(v=o(E,v,O),_===null?b=E:_.sibling=E,_=E);return b}for(S=r(g,S);!E.done;O++,E=y.next())E=h(S,g,O,E.value,x),E!==null&&(t&&E.alternate!==null&&S.delete(E.key===null?O:E.key),v=o(E,v,O),_===null?b=E:_.sibling=E,_=E);return t&&S.forEach(function(I){return e(g,I)}),b}return function(g,v,y,x){var b=typeof y=="object"&&y!==null&&y.type===df&&y.key===null;b&&(y=y.props.children);var _=typeof y=="object"&&y!==null;if(_)switch(y.$$typeof){case nx:e:{for(_=y.key,b=v;b!==null;){if(b.key===_){switch(b.tag){case 7:if(y.type===df){n(g,b.sibling),v=i(b,y.props.children),v.return=g,g=v;break e}break;default:if(b.elementType===y.type){n(g,b.sibling),v=i(b,y.props),v.ref=o0(g,b,y),v.return=g,g=v;break e}}n(g,b);break}else e(g,b);b=b.sibling}y.type===df?(v=_g(y.props.children,g.mode,x,y.key),v.return=g,g=v):(x=_C(y.type,y.key,y.props,null,g.mode,x),x.ref=o0(g,v,y),x.return=g,g=x)}return a(g);case hh:e:{for(b=y.key;v!==null;){if(v.key===b)if(v.tag===4&&v.stateNode.containerInfo===y.containerInfo&&v.stateNode.implementation===y.implementation){n(g,v.sibling),v=i(v,y.children||[]),v.return=g,g=v;break e}else{n(g,v);break}else e(g,v);v=v.sibling}v=gA(y,g.mode,x),v.return=g,g=v}return a(g)}if(typeof y=="string"||typeof y=="number")return y=""+y,v!==null&&v.tag===6?(n(g,v.sibling),v=i(v,y),v.return=g,g=v):(n(g,v),v=mA(y,g.mode,x),v.return=g,g=v),a(g);if(qw(y))return p(g,v,y,x);if(Jy(y))return m(g,v,y,x);if(_&&Xw(g,y),typeof y>"u"&&!b)switch(g.tag){case 1:case 22:case 0:case 11:case 15:throw Error(Xe(152,dg(g.type)||"Component"))}return n(g,v)}}var fT=pte(!0),mte=pte(!1),f1={},zl=fd(f1),Ob=fd(f1),Cb=fd(f1);function gh(t){if(t===f1)throw Error(Xe(174));return t}function fL(t,e){switch(br(Cb,e),br(Ob,t),br(zl,f1),t=e.nodeType,t){case 9:case 11:e=(e=e.documentElement)?e.namespaceURI:QD(null,"");break;default:t=t===8?e.parentNode:e,e=t.namespaceURI||null,t=t.tagName,e=QD(e,t)}er(zl),br(zl,e)}function Hg(){er(zl),er(Ob),er(Cb)}function UW(t){gh(Cb.current);var e=gh(zl.current),n=QD(e,t.type);e!==n&&(br(Ob,t),br(zl,n))}function gj(t){Ob.current===t&&(er(zl),er(Ob))}var xr=fd(0);function dT(t){for(var e=t;e!==null;){if(e.tag===13){var n=e.memoizedState;if(n!==null&&(n=n.dehydrated,n===null||n.data==="$?"||n.data==="$!"))return e}else if(e.tag===19&&e.memoizedProps.revealOrder!==void 0){if(e.flags&64)return e}else if(e.child!==null){e.child.return=e,e=e.child;continue}if(e===t)break;for(;e.sibling===null;){if(e.return===null||e.return===t)return null;e=e.return}e.sibling.return=e.return,e=e.sibling}return null}var Vc=null,xf=null,Ul=!1;function gte(t,e){var n=Va(5,null,null,0);n.elementType="DELETED",n.type="DELETED",n.stateNode=e,n.return=t,n.flags=8,t.lastEffect!==null?(t.lastEffect.nextEffect=n,t.lastEffect=n):t.firstEffect=t.lastEffect=n}function WW(t,e){switch(t.tag){case 5:var n=t.type;return e=e.nodeType!==1||n.toLowerCase()!==e.nodeName.toLowerCase()?null:e,e!==null?(t.stateNode=e,!0):!1;case 6:return e=t.pendingProps===""||e.nodeType!==3?null:e,e!==null?(t.stateNode=e,!0):!1;case 13:return!1;default:return!1}}function dL(t){if(Ul){var e=xf;if(e){var n=e;if(!WW(t,e)){if(e=gg(n.nextSibling),!e||!WW(t,e)){t.flags=t.flags&-1025|2,Ul=!1,Vc=t;return}gte(Vc,n)}Vc=t,xf=gg(e.firstChild)}else t.flags=t.flags&-1025|2,Ul=!1,Vc=t}}function VW(t){for(t=t.return;t!==null&&t.tag!==5&&t.tag!==3&&t.tag!==13;)t=t.return;Vc=t}function Qw(t){if(t!==Vc)return!1;if(!Ul)return VW(t),Ul=!0,!1;var e=t.type;if(t.tag!==5||e!=="head"&&e!=="body"&&!aL(e,t.memoizedProps))for(e=xf;e;)gte(t,e),e=gg(e.nextSibling);if(VW(t),t.tag===13){if(t=t.memoizedState,t=t!==null?t.dehydrated:null,!t)throw Error(Xe(317));e:{for(t=t.nextSibling,e=0;t;){if(t.nodeType===8){var n=t.data;if(n==="/$"){if(e===0){xf=gg(t.nextSibling);break e}e--}else n!=="$"&&n!=="$!"&&n!=="$?"||e++}t=t.nextSibling}xf=null}}else xf=Vc?gg(t.stateNode.nextSibling):null;return!0}function fA(){xf=Vc=null,Ul=!1}var yg=[];function vj(){for(var t=0;t<yg.length;t++)yg[t]._workInProgressVersionPrimary=null;yg.length=0}var Ax=Sp.ReactCurrentDispatcher,Ja=Sp.ReactCurrentBatchConfig,Tb=0,Mr=null,Gi=null,wi=null,hT=!1,Rx=!1;function xo(){throw Error(Xe(321))}function yj(t,e){if(e===null)return!1;for(var n=0;n<e.length&&n<t.length;n++)if(!Wa(t[n],e[n]))return!1;return!0}function xj(t,e,n,r,i,o){if(Tb=o,Mr=e,e.memoizedState=null,e.updateQueue=null,e.lanes=0,Ax.current=t===null||t.memoizedState===null?lbe:cbe,t=n(r,i),Rx){o=0;do{if(Rx=!1,!(25>o))throw Error(Xe(301));o+=1,wi=Gi=null,e.updateQueue=null,Ax.current=ube,t=n(r,i)}while(Rx)}if(Ax.current=vT,e=Gi!==null&&Gi.next!==null,Tb=0,wi=Gi=Mr=null,hT=!1,e)throw Error(Xe(300));return t}function vh(){var t={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return wi===null?Mr.memoizedState=wi=t:wi=wi.next=t,wi}function Cp(){if(Gi===null){var t=Mr.alternate;t=t!==null?t.memoizedState:null}else t=Gi.next;var e=wi===null?Mr.memoizedState:wi.next;if(e!==null)wi=e,Gi=t;else{if(t===null)throw Error(Xe(310));Gi=t,t={memoizedState:Gi.memoizedState,baseState:Gi.baseState,baseQueue:Gi.baseQueue,queue:Gi.queue,next:null},wi===null?Mr.memoizedState=wi=t:wi=wi.next=t}return wi}function Ml(t,e){return typeof e=="function"?e(t):e}function a0(t){var e=Cp(),n=e.queue;if(n===null)throw Error(Xe(311));n.lastRenderedReducer=t;var r=Gi,i=r.baseQueue,o=n.pending;if(o!==null){if(i!==null){var a=i.next;i.next=o.next,o.next=a}r.baseQueue=i=o,n.pending=null}if(i!==null){i=i.next,r=r.baseState;var s=a=o=null,l=i;do{var c=l.lane;if((Tb&c)===c)s!==null&&(s=s.next={lane:0,action:l.action,eagerReducer:l.eagerReducer,eagerState:l.eagerState,next:null}),r=l.eagerReducer===t?l.eagerState:t(r,l.action);else{var u={lane:c,action:l.action,eagerReducer:l.eagerReducer,eagerState:l.eagerState,next:null};s===null?(a=s=u,o=r):s=s.next=u,Mr.lanes|=c,d1|=c}l=l.next}while(l!==null&&l!==i);s===null?o=r:s.next=a,Wa(r,e.memoizedState)||(Gs=!0),e.memoizedState=r,e.baseState=o,e.baseQueue=s,n.lastRenderedState=r}return[e.memoizedState,n.dispatch]}function s0(t){var e=Cp(),n=e.queue;if(n===null)throw Error(Xe(311));n.lastRenderedReducer=t;var r=n.dispatch,i=n.pending,o=e.memoizedState;if(i!==null){n.pending=null;var a=i=i.next;do o=t(o,a.action),a=a.next;while(a!==i);Wa(o,e.memoizedState)||(Gs=!0),e.memoizedState=o,e.baseQueue===null&&(e.baseState=o),n.lastRenderedState=o}return[o,r]}function GW(t,e,n){var r=e._getVersion;r=r(e._source);var i=e._workInProgressVersionPrimary;if(i!==null?t=i===r:(t=t.mutableReadLanes,(t=(Tb&t)===t)&&(e._workInProgressVersionPrimary=r,yg.push(e))),t)return n(e._source);throw yg.push(e),Error(Xe(350))}function vte(t,e,n,r){var i=co;if(i===null)throw Error(Xe(349));var o=e._getVersion,a=o(e._source),s=Ax.current,l=s.useState(function(){return GW(i,e,n)}),c=l[1],u=l[0];l=wi;var f=t.memoizedState,d=f.refs,h=d.getSnapshot,p=f.source;f=f.subscribe;var m=Mr;return t.memoizedState={refs:d,source:e,subscribe:r},s.useEffect(function(){d.getSnapshot=n,d.setSnapshot=c;var g=o(e._source);if(!Wa(a,g)){g=n(e._source),Wa(u,g)||(c(g),g=Nf(m),i.mutableReadLanes|=g&i.pendingLanes),g=i.mutableReadLanes,i.entangledLanes|=g;for(var v=i.entanglements,y=g;0<y;){var x=31-Xf(y),b=1<<x;v[x]|=g,y&=~b}}},[n,e,r]),s.useEffect(function(){return r(e._source,function(){var g=d.getSnapshot,v=d.setSnapshot;try{v(g(e._source));var y=Nf(m);i.mutableReadLanes|=y&i.pendingLanes}catch(x){v(function(){throw x})}})},[e,r]),Wa(h,n)&&Wa(p,e)&&Wa(f,r)||(t={pending:null,dispatch:null,lastRenderedReducer:Ml,lastRenderedState:u},t.dispatch=c=wj.bind(null,Mr,t),l.queue=t,l.baseQueue=null,u=GW(i,e,n),l.memoizedState=l.baseState=u),u}function yte(t,e,n){var r=Cp();return vte(r,t,e,n)}function l0(t){var e=vh();return typeof t=="function"&&(t=t()),e.memoizedState=e.baseState=t,t=e.queue={pending:null,dispatch:null,lastRenderedReducer:Ml,lastRenderedState:t},t=t.dispatch=wj.bind(null,Mr,t),[e.memoizedState,t]}function pT(t,e,n,r){return t={tag:t,create:e,destroy:n,deps:r,next:null},e=Mr.updateQueue,e===null?(e={lastEffect:null},Mr.updateQueue=e,e.lastEffect=t.next=t):(n=e.lastEffect,n===null?e.lastEffect=t.next=t:(r=n.next,n.next=t,t.next=r,e.lastEffect=t)),t}function HW(t){var e=vh();return t={current:t},e.memoizedState=t}function mT(){return Cp().memoizedState}function hL(t,e,n,r){var i=vh();Mr.flags|=t,i.memoizedState=pT(1|e,n,void 0,r===void 0?null:r)}function bj(t,e,n,r){var i=Cp();r=r===void 0?null:r;var o=void 0;if(Gi!==null){var a=Gi.memoizedState;if(o=a.destroy,r!==null&&yj(r,a.deps)){pT(e,n,o,r);return}}Mr.flags|=t,i.memoizedState=pT(1|e,n,o,r)}function qW(t,e){return hL(516,4,t,e)}function gT(t,e){return bj(516,4,t,e)}function xte(t,e){return bj(4,2,t,e)}function bte(t,e){if(typeof e=="function")return t=t(),e(t),function(){e(null)};if(e!=null)return t=t(),e.current=t,function(){e.current=null}}function _te(t,e,n){return n=n!=null?n.concat([t]):null,bj(4,2,bte.bind(null,e,t),n)}function _j(){}function wte(t,e){var n=Cp();e=e===void 0?null:e;var r=n.memoizedState;return r!==null&&e!==null&&yj(e,r[1])?r[0]:(n.memoizedState=[t,e],t)}function Ste(t,e){var n=Cp();e=e===void 0?null:e;var r=n.memoizedState;return r!==null&&e!==null&&yj(e,r[1])?r[0]:(t=t(),n.memoizedState=[t,e],t)}function sbe(t,e){var n=Gg();Qh(98>n?98:n,function(){t(!0)}),Qh(97<n?97:n,function(){var r=Ja.transition;Ja.transition=1;try{t(!1),e()}finally{Ja.transition=r}})}function wj(t,e,n){var r=ya(),i=Nf(t),o={lane:i,action:n,eagerReducer:null,eagerState:null,next:null},a=e.pending;if(a===null?o.next=o:(o.next=a.next,a.next=o),e.pending=o,a=t.alternate,t===Mr||a!==null&&a===Mr)Rx=hT=!0;else{if(t.lanes===0&&(a===null||a.lanes===0)&&(a=e.lastRenderedReducer,a!==null))try{var s=e.lastRenderedState,l=a(s,n);if(o.eagerReducer=a,o.eagerState=l,Wa(l,s))return}catch{}finally{}$f(t,i,r)}}var vT={readContext:ss,useCallback:xo,useContext:xo,useEffect:xo,useImperativeHandle:xo,useLayoutEffect:xo,useMemo:xo,useReducer:xo,useRef:xo,useState:xo,useDebugValue:xo,useDeferredValue:xo,useTransition:xo,useMutableSource:xo,useOpaqueIdentifier:xo,unstable_isNewReconciler:!1},lbe={readContext:ss,useCallback:function(t,e){return vh().memoizedState=[t,e===void 0?null:e],t},useContext:ss,useEffect:qW,useImperativeHandle:function(t,e,n){return n=n!=null?n.concat([t]):null,hL(4,2,bte.bind(null,e,t),n)},useLayoutEffect:function(t,e){return hL(4,2,t,e)},useMemo:function(t,e){var n=vh();return e=e===void 0?null:e,t=t(),n.memoizedState=[t,e],t},useReducer:function(t,e,n){var r=vh();return e=n!==void 0?n(e):e,r.memoizedState=r.baseState=e,t=r.queue={pending:null,dispatch:null,lastRenderedReducer:t,lastRenderedState:e},t=t.dispatch=wj.bind(null,Mr,t),[r.memoizedState,t]},useRef:HW,useState:l0,useDebugValue:_j,useDeferredValue:function(t){var e=l0(t),n=e[0],r=e[1];return qW(function(){var i=Ja.transition;Ja.transition=1;try{r(t)}finally{Ja.transition=i}},[t]),n},useTransition:function(){var t=l0(!1),e=t[0];return t=sbe.bind(null,t[1]),HW(t),[t,e]},useMutableSource:function(t,e,n){var r=vh();return r.memoizedState={refs:{getSnapshot:e,setSnapshot:null},source:t,subscribe:n},vte(r,t,e,n)},useOpaqueIdentifier:function(){if(Ul){var t=!1,e=tbe(function(){throw t||(t=!0,n("r:"+(lA++).toString(36))),Error(Xe(355))}),n=l0(e)[1];return!(Mr.mode&2)&&(Mr.flags|=516,pT(5,function(){n("r:"+(lA++).toString(36))},void 0,null)),e}return e="r:"+(lA++).toString(36),l0(e),e},unstable_isNewReconciler:!1},cbe={readContext:ss,useCallback:wte,useContext:ss,useEffect:gT,useImperativeHandle:_te,useLayoutEffect:xte,useMemo:Ste,useReducer:a0,useRef:mT,useState:function(){return a0(Ml)},useDebugValue:_j,useDeferredValue:function(t){var e=a0(Ml),n=e[0],r=e[1];return gT(function(){var i=Ja.transition;Ja.transition=1;try{r(t)}finally{Ja.transition=i}},[t]),n},useTransition:function(){var t=a0(Ml)[0];return[mT().current,t]},useMutableSource:yte,useOpaqueIdentifier:function(){return a0(Ml)[0]},unstable_isNewReconciler:!1},ube={readContext:ss,useCallback:wte,useContext:ss,useEffect:gT,useImperativeHandle:_te,useLayoutEffect:xte,useMemo:Ste,useReducer:s0,useRef:mT,useState:function(){return s0(Ml)},useDebugValue:_j,useDeferredValue:function(t){var e=s0(Ml),n=e[0],r=e[1];return gT(function(){var i=Ja.transition;Ja.transition=1;try{r(t)}finally{Ja.transition=i}},[t]),n},useTransition:function(){var t=s0(Ml)[0];return[mT().current,t]},useMutableSource:yte,useOpaqueIdentifier:function(){return s0(Ml)[0]},unstable_isNewReconciler:!1},fbe=Sp.ReactCurrentOwner,Gs=!1;function wo(t,e,n,r){e.child=t===null?mte(e,null,n,r):fT(e,t.child,n,r)}function XW(t,e,n,r,i){n=n.render;var o=e.ref;return vg(e,i),r=xj(t,e,n,r,o,i),t!==null&&!Gs?(e.updateQueue=t.updateQueue,e.flags&=-517,t.lanes&=~i,Gc(t,e,i)):(e.flags|=1,wo(t,e,r,i),e.child)}function QW(t,e,n,r,i,o){if(t===null){var a=n.type;return typeof a=="function"&&!Pj(a)&&a.defaultProps===void 0&&n.compare===null&&n.defaultProps===void 0?(e.tag=15,e.type=a,Ote(t,e,a,r,i,o)):(t=_C(n.type,null,r,e,e.mode,o),t.ref=e.ref,t.return=e,e.child=t)}return a=t.child,!(i&o)&&(i=a.memoizedProps,n=n.compare,n=n!==null?n:bb,n(i,r)&&t.ref===e.ref)?Gc(t,e,o):(e.flags|=1,t=Kf(a,r),t.ref=e.ref,t.return=e,e.child=t)}function Ote(t,e,n,r,i,o){if(t!==null&&bb(t.memoizedProps,r)&&t.ref===e.ref)if(Gs=!1,(o&i)!==0)t.flags&16384&&(Gs=!0);else return e.lanes=t.lanes,Gc(t,e,o);return pL(t,e,n,r,o)}function dA(t,e,n){var r=e.pendingProps,i=r.children,o=t!==null?t.memoizedState:null;if(r.mode==="hidden"||r.mode==="unstable-defer-without-hiding")if(!(e.mode&4))e.memoizedState={baseLanes:0},Kw(e,n);else if(n&1073741824)e.memoizedState={baseLanes:0},Kw(e,o!==null?o.baseLanes:n);else return t=o!==null?o.baseLanes|n:n,e.lanes=e.childLanes=1073741824,e.memoizedState={baseLanes:t},Kw(e,t),null;else o!==null?(r=o.baseLanes|n,e.memoizedState=null):r=n,Kw(e,r);return wo(t,e,i,n),e.child}function Cte(t,e){var n=e.ref;(t===null&&n!==null||t!==null&&t.ref!==n)&&(e.flags|=128)}function pL(t,e,n,r,i){var o=Lo(n)?Xh:Ji.current;return o=Vg(e,o),vg(e,i),n=xj(t,e,n,r,o,i),t!==null&&!Gs?(e.updateQueue=t.updateQueue,e.flags&=-517,t.lanes&=~i,Gc(t,e,i)):(e.flags|=1,wo(t,e,n,i),e.child)}function YW(t,e,n,r,i){if(Lo(n)){var o=!0;gC(e)}else o=!1;if(vg(e,i),e.stateNode===null)t!==null&&(t.alternate=null,e.alternate=null,e.flags|=2),hte(e,n,r),uL(e,n,r,i),r=!0;else if(t===null){var a=e.stateNode,s=e.memoizedProps;a.props=s;var l=a.context,c=n.contextType;typeof c=="object"&&c!==null?c=ss(c):(c=Lo(n)?Xh:Ji.current,c=Vg(e,c));var u=n.getDerivedStateFromProps,f=typeof u=="function"||typeof a.getSnapshotBeforeUpdate=="function";f||typeof a.UNSAFE_componentWillReceiveProps!="function"&&typeof a.componentWillReceiveProps!="function"||(s!==r||l!==c)&&zW(e,a,r,c),ef=!1;var d=e.memoizedState;a.state=d,Sb(e,r,a,i),l=e.memoizedState,s!==r||d!==l||Do.current||ef?(typeof u=="function"&&(uT(e,n,u,r),l=e.memoizedState),(s=ef||BW(e,n,s,r,d,l,c))?(f||typeof a.UNSAFE_componentWillMount!="function"&&typeof a.componentWillMount!="function"||(typeof a.componentWillMount=="function"&&a.componentWillMount(),typeof a.UNSAFE_componentWillMount=="function"&&a.UNSAFE_componentWillMount()),typeof a.componentDidMount=="function"&&(e.flags|=4)):(typeof a.componentDidMount=="function"&&(e.flags|=4),e.memoizedProps=r,e.memoizedState=l),a.props=r,a.state=l,a.context=c,r=s):(typeof a.componentDidMount=="function"&&(e.flags|=4),r=!1)}else{a=e.stateNode,fte(t,e),s=e.memoizedProps,c=e.type===e.elementType?s:Fs(e.type,s),a.props=c,f=e.pendingProps,d=a.context,l=n.contextType,typeof l=="object"&&l!==null?l=ss(l):(l=Lo(n)?Xh:Ji.current,l=Vg(e,l));var h=n.getDerivedStateFromProps;(u=typeof h=="function"||typeof a.getSnapshotBeforeUpdate=="function")||typeof a.UNSAFE_componentWillReceiveProps!="function"&&typeof a.componentWillReceiveProps!="function"||(s!==f||d!==l)&&zW(e,a,r,l),ef=!1,d=e.memoizedState,a.state=d,Sb(e,r,a,i);var p=e.memoizedState;s!==f||d!==p||Do.current||ef?(typeof h=="function"&&(uT(e,n,h,r),p=e.memoizedState),(c=ef||BW(e,n,c,r,d,p,l))?(u||typeof a.UNSAFE_componentWillUpdate!="function"&&typeof a.componentWillUpdate!="function"||(typeof a.componentWillUpdate=="function"&&a.componentWillUpdate(r,p,l),typeof a.UNSAFE_componentWillUpdate=="function"&&a.UNSAFE_componentWillUpdate(r,p,l)),typeof a.componentDidUpdate=="function"&&(e.flags|=4),typeof a.getSnapshotBeforeUpdate=="function"&&(e.flags|=256)):(typeof a.componentDidUpdate!="function"||s===t.memoizedProps&&d===t.memoizedState||(e.flags|=4),typeof a.getSnapshotBeforeUpdate!="function"||s===t.memoizedProps&&d===t.memoizedState||(e.flags|=256),e.memoizedProps=r,e.memoizedState=p),a.props=r,a.state=p,a.context=l,r=c):(typeof a.componentDidUpdate!="function"||s===t.memoizedProps&&d===t.memoizedState||(e.flags|=4),typeof a.getSnapshotBeforeUpdate!="function"||s===t.memoizedProps&&d===t.memoizedState||(e.flags|=256),r=!1)}return mL(t,e,n,r,o,i)}function mL(t,e,n,r,i,o){Cte(t,e);var a=(e.flags&64)!==0;if(!r&&!a)return i&&LW(e,n,!1),Gc(t,e,o);r=e.stateNode,fbe.current=e;var s=a&&typeof n.getDerivedStateFromError!="function"?null:r.render();return e.flags|=1,t!==null&&a?(e.child=fT(e,t.child,null,o),e.child=fT(e,null,s,o)):wo(t,e,s,o),e.memoizedState=r.state,i&&LW(e,n,!0),e.child}function KW(t){var e=t.stateNode;e.pendingContext?DW(t,e.pendingContext,e.pendingContext!==e.context):e.context&&DW(t,e.context,!1),fL(t,e.containerInfo)}var Yw={dehydrated:null,retryLane:0};function ZW(t,e,n){var r=e.pendingProps,i=xr.current,o=!1,a;return(a=(e.flags&64)!==0)||(a=t!==null&&t.memoizedState===null?!1:(i&2)!==0),a?(o=!0,e.flags&=-65):t!==null&&t.memoizedState===null||r.fallback===void 0||r.unstable_avoidThisFallback===!0||(i|=1),br(xr,i&1),t===null?(r.fallback!==void 0&&dL(e),t=r.children,i=r.fallback,o?(t=JW(e,t,i,n),e.child.memoizedState={baseLanes:n},e.memoizedState=Yw,t):typeof r.unstable_expectedLoadTime=="number"?(t=JW(e,t,i,n),e.child.memoizedState={baseLanes:n},e.memoizedState=Yw,e.lanes=33554432,t):(n=Mj({mode:"visible",children:t},e.mode,n,null),n.return=e,e.child=n)):t.memoizedState!==null?o?(r=tV(t,e,r.children,r.fallback,n),o=e.child,i=t.child.memoizedState,o.memoizedState=i===null?{baseLanes:n}:{baseLanes:i.baseLanes|n},o.childLanes=t.childLanes&~n,e.memoizedState=Yw,r):(n=eV(t,e,r.children,n),e.memoizedState=null,n):o?(r=tV(t,e,r.children,r.fallback,n),o=e.child,i=t.child.memoizedState,o.memoizedState=i===null?{baseLanes:n}:{baseLanes:i.baseLanes|n},o.childLanes=t.childLanes&~n,e.memoizedState=Yw,r):(n=eV(t,e,r.children,n),e.memoizedState=null,n)}function JW(t,e,n,r){var i=t.mode,o=t.child;return e={mode:"hidden",children:e},!(i&2)&&o!==null?(o.childLanes=0,o.pendingProps=e):o=Mj(e,i,0,null),n=_g(n,i,r,null),o.return=t,n.return=t,o.sibling=n,t.child=o,n}function eV(t,e,n,r){var i=t.child;return t=i.sibling,n=Kf(i,{mode:"visible",children:n}),!(e.mode&2)&&(n.lanes=r),n.return=e,n.sibling=null,t!==null&&(t.nextEffect=null,t.flags=8,e.firstEffect=e.lastEffect=t),e.child=n}function tV(t,e,n,r,i){var o=e.mode,a=t.child;t=a.sibling;var s={mode:"hidden",children:n};return!(o&2)&&e.child!==a?(n=e.child,n.childLanes=0,n.pendingProps=s,a=n.lastEffect,a!==null?(e.firstEffect=n.firstEffect,e.lastEffect=a,a.nextEffect=null):e.firstEffect=e.lastEffect=null):n=Kf(a,s),t!==null?r=Kf(t,r):(r=_g(r,o,i,null),r.flags|=2),r.return=e,n.return=e,n.sibling=r,e.child=n,r}function nV(t,e){t.lanes|=e;var n=t.alternate;n!==null&&(n.lanes|=e),ute(t.return,e)}function hA(t,e,n,r,i,o){var a=t.memoizedState;a===null?t.memoizedState={isBackwards:e,rendering:null,renderingStartTime:0,last:r,tail:n,tailMode:i,lastEffect:o}:(a.isBackwards=e,a.rendering=null,a.renderingStartTime=0,a.last=r,a.tail=n,a.tailMode=i,a.lastEffect=o)}function rV(t,e,n){var r=e.pendingProps,i=r.revealOrder,o=r.tail;if(wo(t,e,r.children,n),r=xr.current,r&2)r=r&1|2,e.flags|=64;else{if(t!==null&&t.flags&64)e:for(t=e.child;t!==null;){if(t.tag===13)t.memoizedState!==null&&nV(t,n);else if(t.tag===19)nV(t,n);else if(t.child!==null){t.child.return=t,t=t.child;continue}if(t===e)break e;for(;t.sibling===null;){if(t.return===null||t.return===e)break e;t=t.return}t.sibling.return=t.return,t=t.sibling}r&=1}if(br(xr,r),!(e.mode&2))e.memoizedState=null;else switch(i){case"forwards":for(n=e.child,i=null;n!==null;)t=n.alternate,t!==null&&dT(t)===null&&(i=n),n=n.sibling;n=i,n===null?(i=e.child,e.child=null):(i=n.sibling,n.sibling=null),hA(e,!1,i,n,o,e.lastEffect);break;case"backwards":for(n=null,i=e.child,e.child=null;i!==null;){if(t=i.alternate,t!==null&&dT(t)===null){e.child=i;break}t=i.sibling,i.sibling=n,n=i,i=t}hA(e,!0,n,null,o,e.lastEffect);break;case"together":hA(e,!1,null,null,void 0,e.lastEffect);break;default:e.memoizedState=null}return e.child}function Gc(t,e,n){if(t!==null&&(e.dependencies=t.dependencies),d1|=e.lanes,n&e.childLanes){if(t!==null&&e.child!==t.child)throw Error(Xe(153));if(e.child!==null){for(t=e.child,n=Kf(t,t.pendingProps),e.child=n,n.return=e;t.sibling!==null;)t=t.sibling,n=n.sibling=Kf(t,t.pendingProps),n.return=e;n.sibling=null}return e.child}return null}var Tte,gL,Ete,Pte;Tte=function(t,e){for(var n=e.child;n!==null;){if(n.tag===5||n.tag===6)t.appendChild(n.stateNode);else if(n.tag!==4&&n.child!==null){n.child.return=n,n=n.child;continue}if(n===e)break;for(;n.sibling===null;){if(n.return===null||n.return===e)return;n=n.return}n.sibling.return=n.return,n=n.sibling}};gL=function(){};Ete=function(t,e,n,r){var i=t.memoizedProps;if(i!==r){t=e.stateNode,gh(zl.current);var o=null;switch(n){case"input":i=WD(t,i),r=WD(t,r),o=[];break;case"option":i=HD(t,i),r=HD(t,r),o=[];break;case"select":i=hr({},i,{value:void 0}),r=hr({},r,{value:void 0}),o=[];break;case"textarea":i=qD(t,i),r=qD(t,r),o=[];break;default:typeof i.onClick!="function"&&typeof r.onClick=="function"&&(t.onclick=iT)}YD(n,r);var a;n=null;for(c in i)if(!r.hasOwnProperty(c)&&i.hasOwnProperty(c)&&i[c]!=null)if(c==="style"){var s=i[c];for(a in s)s.hasOwnProperty(a)&&(n||(n={}),n[a]="")}else c!=="dangerouslySetInnerHTML"&&c!=="children"&&c!=="suppressContentEditableWarning"&&c!=="suppressHydrationWarning"&&c!=="autoFocus"&&(hb.hasOwnProperty(c)?o||(o=[]):(o=o||[]).push(c,null));for(c in r){var l=r[c];if(s=i!=null?i[c]:void 0,r.hasOwnProperty(c)&&l!==s&&(l!=null||s!=null))if(c==="style")if(s){for(a in s)!s.hasOwnProperty(a)||l&&l.hasOwnProperty(a)||(n||(n={}),n[a]="");for(a in l)l.hasOwnProperty(a)&&s[a]!==l[a]&&(n||(n={}),n[a]=l[a])}else n||(o||(o=[]),o.push(c,n)),n=l;else c==="dangerouslySetInnerHTML"?(l=l?l.__html:void 0,s=s?s.__html:void 0,l!=null&&s!==l&&(o=o||[]).push(c,l)):c==="children"?typeof l!="string"&&typeof l!="number"||(o=o||[]).push(c,""+l):c!=="suppressContentEditableWarning"&&c!=="suppressHydrationWarning"&&(hb.hasOwnProperty(c)?(l!=null&&c==="onScroll"&&qn("scroll",t),o||s===l||(o=[])):typeof l=="object"&&l!==null&&l.$$typeof===QF?l.toString():(o=o||[]).push(c,l))}n&&(o=o||[]).push("style",n);var c=o;(e.updateQueue=c)&&(e.flags|=4)}};Pte=function(t,e,n,r){n!==r&&(e.flags|=4)};function c0(t,e){if(!Ul)switch(t.tailMode){case"hidden":e=t.tail;for(var n=null;e!==null;)e.alternate!==null&&(n=e),e=e.sibling;n===null?t.tail=null:n.sibling=null;break;case"collapsed":n=t.tail;for(var r=null;n!==null;)n.alternate!==null&&(r=n),n=n.sibling;r===null?e||t.tail===null?t.tail=null:t.tail.sibling=null:r.sibling=null}}function dbe(t,e,n){var r=e.pendingProps;switch(e.tag){case 2:case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return null;case 1:return Lo(e.type)&&aT(),null;case 3:return Hg(),er(Do),er(Ji),vj(),r=e.stateNode,r.pendingContext&&(r.context=r.pendingContext,r.pendingContext=null),(t===null||t.child===null)&&(Qw(e)?e.flags|=4:r.hydrate||(e.flags|=256)),gL(e),null;case 5:gj(e);var i=gh(Cb.current);if(n=e.type,t!==null&&e.stateNode!=null)Ete(t,e,n,r,i),t.ref!==e.ref&&(e.flags|=128);else{if(!r){if(e.stateNode===null)throw Error(Xe(166));return null}if(t=gh(zl.current),Qw(e)){r=e.stateNode,n=e.type;var o=e.memoizedProps;switch(r[yf]=e,r[oT]=o,n){case"dialog":qn("cancel",r),qn("close",r);break;case"iframe":case"object":case"embed":qn("load",r);break;case"video":case"audio":for(t=0;t<ix.length;t++)qn(ix[t],r);break;case"source":qn("error",r);break;case"img":case"image":case"link":qn("error",r),qn("load",r);break;case"details":qn("toggle",r);break;case"input":rW(r,o),qn("invalid",r);break;case"select":r._wrapperState={wasMultiple:!!o.multiple},qn("invalid",r);break;case"textarea":oW(r,o),qn("invalid",r)}YD(n,o),t=null;for(var a in o)o.hasOwnProperty(a)&&(i=o[a],a==="children"?typeof i=="string"?r.textContent!==i&&(t=["children",i]):typeof i=="number"&&r.textContent!==""+i&&(t=["children",""+i]):hb.hasOwnProperty(a)&&i!=null&&a==="onScroll"&&qn("scroll",r));switch(n){case"input":Ww(r),iW(r,o,!0);break;case"textarea":Ww(r),aW(r);break;case"select":case"option":break;default:typeof o.onClick=="function"&&(r.onclick=iT)}r=t,e.updateQueue=r,r!==null&&(e.flags|=4)}else{switch(a=i.nodeType===9?i:i.ownerDocument,t===XD.html&&(t=wee(n)),t===XD.html?n==="script"?(t=a.createElement("div"),t.innerHTML="<script><\/script>",t=t.removeChild(t.firstChild)):typeof r.is=="string"?t=a.createElement(n,{is:r.is}):(t=a.createElement(n),n==="select"&&(a=t,r.multiple?a.multiple=!0:r.size&&(a.size=r.size))):t=a.createElementNS(t,n),t[yf]=e,t[oT]=r,Tte(t,e,!1,!1),e.stateNode=t,a=KD(n,r),n){case"dialog":qn("cancel",t),qn("close",t),i=r;break;case"iframe":case"object":case"embed":qn("load",t),i=r;break;case"video":case"audio":for(i=0;i<ix.length;i++)qn(ix[i],t);i=r;break;case"source":qn("error",t),i=r;break;case"img":case"image":case"link":qn("error",t),qn("load",t),i=r;break;case"details":qn("toggle",t),i=r;break;case"input":rW(t,r),i=WD(t,r),qn("invalid",t);break;case"option":i=HD(t,r);break;case"select":t._wrapperState={wasMultiple:!!r.multiple},i=hr({},r,{value:void 0}),qn("invalid",t);break;case"textarea":oW(t,r),i=qD(t,r),qn("invalid",t);break;default:i=r}YD(n,i);var s=i;for(o in s)if(s.hasOwnProperty(o)){var l=s[o];o==="style"?Cee(t,l):o==="dangerouslySetInnerHTML"?(l=l?l.__html:void 0,l!=null&&See(t,l)):o==="children"?typeof l=="string"?(n!=="textarea"||l!=="")&&pb(t,l):typeof l=="number"&&pb(t,""+l):o!=="suppressContentEditableWarning"&&o!=="suppressHydrationWarning"&&o!=="autoFocus"&&(hb.hasOwnProperty(o)?l!=null&&o==="onScroll"&&qn("scroll",t):l!=null&&WF(t,o,l,a))}switch(n){case"input":Ww(t),iW(t,r,!1);break;case"textarea":Ww(t),aW(t);break;case"option":r.value!=null&&t.setAttribute("value",""+qf(r.value));break;case"select":t.multiple=!!r.multiple,o=r.value,o!=null?hg(t,!!r.multiple,o,!1):r.defaultValue!=null&&hg(t,!!r.multiple,r.defaultValue,!0);break;default:typeof i.onClick=="function"&&(t.onclick=iT)}tte(n,r)&&(e.flags|=4)}e.ref!==null&&(e.flags|=128)}return null;case 6:if(t&&e.stateNode!=null)Pte(t,e,t.memoizedProps,r);else{if(typeof r!="string"&&e.stateNode===null)throw Error(Xe(166));n=gh(Cb.current),gh(zl.current),Qw(e)?(r=e.stateNode,n=e.memoizedProps,r[yf]=e,r.nodeValue!==n&&(e.flags|=4)):(r=(n.nodeType===9?n:n.ownerDocument).createTextNode(r),r[yf]=e,e.stateNode=r)}return null;case 13:return er(xr),r=e.memoizedState,e.flags&64?(e.lanes=n,e):(r=r!==null,n=!1,t===null?e.memoizedProps.fallback!==void 0&&Qw(e):n=t.memoizedState!==null,r&&!n&&e.mode&2&&(t===null&&e.memoizedProps.unstable_avoidThisFallback!==!0||xr.current&1?Oi===0&&(Oi=3):((Oi===0||Oi===3)&&(Oi=4),co===null||!(d1&134217727)&&!(Gv&134217727)||xg(co,Zi))),(r||n)&&(e.flags|=4),null);case 4:return Hg(),gL(e),t===null&&Zee(e.stateNode.containerInfo),null;case 10:return pj(e),null;case 17:return Lo(e.type)&&aT(),null;case 19:if(er(xr),r=e.memoizedState,r===null)return null;if(o=(e.flags&64)!==0,a=r.rendering,a===null)if(o)c0(r,!1);else{if(Oi!==0||t!==null&&t.flags&64)for(t=e.child;t!==null;){if(a=dT(t),a!==null){for(e.flags|=64,c0(r,!1),o=a.updateQueue,o!==null&&(e.updateQueue=o,e.flags|=4),r.lastEffect===null&&(e.firstEffect=null),e.lastEffect=r.lastEffect,r=n,n=e.child;n!==null;)o=n,t=r,o.flags&=2,o.nextEffect=null,o.firstEffect=null,o.lastEffect=null,a=o.alternate,a===null?(o.childLanes=0,o.lanes=t,o.child=null,o.memoizedProps=null,o.memoizedState=null,o.updateQueue=null,o.dependencies=null,o.stateNode=null):(o.childLanes=a.childLanes,o.lanes=a.lanes,o.child=a.child,o.memoizedProps=a.memoizedProps,o.memoizedState=a.memoizedState,o.updateQueue=a.updateQueue,o.type=a.type,t=a.dependencies,o.dependencies=t===null?null:{lanes:t.lanes,firstContext:t.firstContext}),n=n.sibling;return br(xr,xr.current&1|2),e.child}t=t.sibling}r.tail!==null&&Ki()>wL&&(e.flags|=64,o=!0,c0(r,!1),e.lanes=33554432)}else{if(!o)if(t=dT(a),t!==null){if(e.flags|=64,o=!0,n=t.updateQueue,n!==null&&(e.updateQueue=n,e.flags|=4),c0(r,!0),r.tail===null&&r.tailMode==="hidden"&&!a.alternate&&!Ul)return e=e.lastEffect=r.lastEffect,e!==null&&(e.nextEffect=null),null}else 2*Ki()-r.renderingStartTime>wL&&n!==1073741824&&(e.flags|=64,o=!0,c0(r,!1),e.lanes=33554432);r.isBackwards?(a.sibling=e.child,e.child=a):(n=r.last,n!==null?n.sibling=a:e.child=a,r.last=a)}return r.tail!==null?(n=r.tail,r.rendering=n,r.tail=n.sibling,r.lastEffect=e.lastEffect,r.renderingStartTime=Ki(),n.sibling=null,e=xr.current,br(xr,o?e&1|2:e&1),n):null;case 23:case 24:return Ej(),t!==null&&t.memoizedState!==null!=(e.memoizedState!==null)&&r.mode!=="unstable-defer-without-hiding"&&(e.flags|=4),null}throw Error(Xe(156,e.tag))}function hbe(t){switch(t.tag){case 1:Lo(t.type)&&aT();var e=t.flags;return e&4096?(t.flags=e&-4097|64,t):null;case 3:if(Hg(),er(Do),er(Ji),vj(),e=t.flags,e&64)throw Error(Xe(285));return t.flags=e&-4097|64,t;case 5:return gj(t),null;case 13:return er(xr),e=t.flags,e&4096?(t.flags=e&-4097|64,t):null;case 19:return er(xr),null;case 4:return Hg(),null;case 10:return pj(t),null;case 23:case 24:return Ej(),null;default:return null}}function Sj(t,e){try{var n="",r=e;do n+=H0e(r),r=r.return;while(r);var i=n}catch(o){i=`
Error generating stack: `+o.message+`
`+o.stack}return{value:t,source:e,stack:i}}function vL(t,e){try{console.error(e.value)}catch(n){setTimeout(function(){throw n})}}var pbe=typeof WeakMap=="function"?WeakMap:Map;function Mte(t,e,n){n=Df(-1,n),n.tag=3,n.payload={element:null};var r=e.value;return n.callback=function(){xT||(xT=!0,SL=r),vL(t,e)},n}function kte(t,e,n){n=Df(-1,n),n.tag=3;var r=t.type.getDerivedStateFromError;if(typeof r=="function"){var i=e.value;n.payload=function(){return vL(t,e),r(i)}}var o=t.stateNode;return o!==null&&typeof o.componentDidCatch=="function"&&(n.callback=function(){typeof r!="function"&&(kl===null?kl=new Set([this]):kl.add(this),vL(t,e));var a=e.stack;this.componentDidCatch(e.value,{componentStack:a!==null?a:""})}),n}var mbe=typeof WeakSet=="function"?WeakSet:Set;function iV(t){var e=t.ref;if(e!==null)if(typeof e=="function")try{e(null)}catch(n){Ff(t,n)}else e.current=null}function gbe(t,e){switch(e.tag){case 0:case 11:case 15:case 22:return;case 1:if(e.flags&256&&t!==null){var n=t.memoizedProps,r=t.memoizedState;t=e.stateNode,e=t.getSnapshotBeforeUpdate(e.elementType===e.type?n:Fs(e.type,n),r),t.__reactInternalSnapshotBeforeUpdate=e}return;case 3:e.flags&256&&uj(e.stateNode.containerInfo);return;case 5:case 6:case 4:case 17:return}throw Error(Xe(163))}function vbe(t,e,n){switch(n.tag){case 0:case 11:case 15:case 22:if(e=n.updateQueue,e=e!==null?e.lastEffect:null,e!==null){t=e=e.next;do{if((t.tag&3)===3){var r=t.create;t.destroy=r()}t=t.next}while(t!==e)}if(e=n.updateQueue,e=e!==null?e.lastEffect:null,e!==null){t=e=e.next;do{var i=t;r=i.next,i=i.tag,i&4&&i&1&&(jte(n,t),Cbe(n,t)),t=r}while(t!==e)}return;case 1:t=n.stateNode,n.flags&4&&(e===null?t.componentDidMount():(r=n.elementType===n.type?e.memoizedProps:Fs(n.type,e.memoizedProps),t.componentDidUpdate(r,e.memoizedState,t.__reactInternalSnapshotBeforeUpdate))),e=n.updateQueue,e!==null&&jW(n,e,t);return;case 3:if(e=n.updateQueue,e!==null){if(t=null,n.child!==null)switch(n.child.tag){case 5:t=n.child.stateNode;break;case 1:t=n.child.stateNode}jW(n,e,t)}return;case 5:t=n.stateNode,e===null&&n.flags&4&&tte(n.type,n.memoizedProps)&&t.focus();return;case 6:return;case 4:return;case 12:return;case 13:n.memoizedState===null&&(n=n.alternate,n!==null&&(n=n.memoizedState,n!==null&&(n=n.dehydrated,n!==null&&Lee(n))));return;case 19:case 17:case 20:case 21:case 23:case 24:return}throw Error(Xe(163))}function oV(t,e){for(var n=t;;){if(n.tag===5){var r=n.stateNode;if(e)r=r.style,typeof r.setProperty=="function"?r.setProperty("display","none","important"):r.display="none";else{r=n.stateNode;var i=n.memoizedProps.style;i=i!=null&&i.hasOwnProperty("display")?i.display:null,r.style.display=Oee("display",i)}}else if(n.tag===6)n.stateNode.nodeValue=e?"":n.memoizedProps;else if((n.tag!==23&&n.tag!==24||n.memoizedState===null||n===t)&&n.child!==null){n.child.return=n,n=n.child;continue}if(n===t)break;for(;n.sibling===null;){if(n.return===null||n.return===t)return;n=n.return}n.sibling.return=n.return,n=n.sibling}}function aV(t,e){if(Ih&&typeof Ih.onCommitFiberUnmount=="function")try{Ih.onCommitFiberUnmount(fj,e)}catch{}switch(e.tag){case 0:case 11:case 14:case 15:case 22:if(t=e.updateQueue,t!==null&&(t=t.lastEffect,t!==null)){var n=t=t.next;do{var r=n,i=r.destroy;if(r=r.tag,i!==void 0)if(r&4)jte(e,n);else{r=e;try{i()}catch(o){Ff(r,o)}}n=n.next}while(n!==t)}break;case 1:if(iV(e),t=e.stateNode,typeof t.componentWillUnmount=="function")try{t.props=e.memoizedProps,t.state=e.memoizedState,t.componentWillUnmount()}catch(o){Ff(e,o)}break;case 5:iV(e);break;case 4:Ate(t,e)}}function sV(t){t.alternate=null,t.child=null,t.dependencies=null,t.firstEffect=null,t.lastEffect=null,t.memoizedProps=null,t.memoizedState=null,t.pendingProps=null,t.return=null,t.updateQueue=null}function lV(t){return t.tag===5||t.tag===3||t.tag===4}function cV(t){e:{for(var e=t.return;e!==null;){if(lV(e))break e;e=e.return}throw Error(Xe(160))}var n=e;switch(e=n.stateNode,n.tag){case 5:var r=!1;break;case 3:e=e.containerInfo,r=!0;break;case 4:e=e.containerInfo,r=!0;break;default:throw Error(Xe(161))}n.flags&16&&(pb(e,""),n.flags&=-17);e:t:for(n=t;;){for(;n.sibling===null;){if(n.return===null||lV(n.return)){n=null;break e}n=n.return}for(n.sibling.return=n.return,n=n.sibling;n.tag!==5&&n.tag!==6&&n.tag!==18;){if(n.flags&2||n.child===null||n.tag===4)continue t;n.child.return=n,n=n.child}if(!(n.flags&2)){n=n.stateNode;break e}}r?yL(t,n,e):xL(t,n,e)}function yL(t,e,n){var r=t.tag,i=r===5||r===6;if(i)t=i?t.stateNode:t.stateNode.instance,e?n.nodeType===8?n.parentNode.insertBefore(t,e):n.insertBefore(t,e):(n.nodeType===8?(e=n.parentNode,e.insertBefore(t,n)):(e=n,e.appendChild(t)),n=n._reactRootContainer,n!=null||e.onclick!==null||(e.onclick=iT));else if(r!==4&&(t=t.child,t!==null))for(yL(t,e,n),t=t.sibling;t!==null;)yL(t,e,n),t=t.sibling}function xL(t,e,n){var r=t.tag,i=r===5||r===6;if(i)t=i?t.stateNode:t.stateNode.instance,e?n.insertBefore(t,e):n.appendChild(t);else if(r!==4&&(t=t.child,t!==null))for(xL(t,e,n),t=t.sibling;t!==null;)xL(t,e,n),t=t.sibling}function Ate(t,e){for(var n=e,r=!1,i,o;;){if(!r){r=n.return;e:for(;;){if(r===null)throw Error(Xe(160));switch(i=r.stateNode,r.tag){case 5:o=!1;break e;case 3:i=i.containerInfo,o=!0;break e;case 4:i=i.containerInfo,o=!0;break e}r=r.return}r=!0}if(n.tag===5||n.tag===6){e:for(var a=t,s=n,l=s;;)if(aV(a,l),l.child!==null&&l.tag!==4)l.child.return=l,l=l.child;else{if(l===s)break e;for(;l.sibling===null;){if(l.return===null||l.return===s)break e;l=l.return}l.sibling.return=l.return,l=l.sibling}o?(a=i,s=n.stateNode,a.nodeType===8?a.parentNode.removeChild(s):a.removeChild(s)):i.removeChild(n.stateNode)}else if(n.tag===4){if(n.child!==null){i=n.stateNode.containerInfo,o=!0,n.child.return=n,n=n.child;continue}}else if(aV(t,n),n.child!==null){n.child.return=n,n=n.child;continue}if(n===e)break;for(;n.sibling===null;){if(n.return===null||n.return===e)return;n=n.return,n.tag===4&&(r=!1)}n.sibling.return=n.return,n=n.sibling}}function pA(t,e){switch(e.tag){case 0:case 11:case 14:case 15:case 22:var n=e.updateQueue;if(n=n!==null?n.lastEffect:null,n!==null){var r=n=n.next;do(r.tag&3)===3&&(t=r.destroy,r.destroy=void 0,t!==void 0&&t()),r=r.next;while(r!==n)}return;case 1:return;case 5:if(n=e.stateNode,n!=null){r=e.memoizedProps;var i=t!==null?t.memoizedProps:r;t=e.type;var o=e.updateQueue;if(e.updateQueue=null,o!==null){for(n[oT]=r,t==="input"&&r.type==="radio"&&r.name!=null&&bee(n,r),KD(t,i),e=KD(t,r),i=0;i<o.length;i+=2){var a=o[i],s=o[i+1];a==="style"?Cee(n,s):a==="dangerouslySetInnerHTML"?See(n,s):a==="children"?pb(n,s):WF(n,a,s,e)}switch(t){case"input":VD(n,r);break;case"textarea":_ee(n,r);break;case"select":t=n._wrapperState.wasMultiple,n._wrapperState.wasMultiple=!!r.multiple,o=r.value,o!=null?hg(n,!!r.multiple,o,!1):t!==!!r.multiple&&(r.defaultValue!=null?hg(n,!!r.multiple,r.defaultValue,!0):hg(n,!!r.multiple,r.multiple?[]:"",!1))}}}return;case 6:if(e.stateNode===null)throw Error(Xe(162));e.stateNode.nodeValue=e.memoizedProps;return;case 3:n=e.stateNode,n.hydrate&&(n.hydrate=!1,Lee(n.containerInfo));return;case 12:return;case 13:e.memoizedState!==null&&(Tj=Ki(),oV(e.child,!0)),uV(e);return;case 19:uV(e);return;case 17:return;case 23:case 24:oV(e,e.memoizedState!==null);return}throw Error(Xe(163))}function uV(t){var e=t.updateQueue;if(e!==null){t.updateQueue=null;var n=t.stateNode;n===null&&(n=t.stateNode=new mbe),e.forEach(function(r){var i=Pbe.bind(null,t,r);n.has(r)||(n.add(r),r.then(i,i))})}}function ybe(t,e){return t!==null&&(t=t.memoizedState,t===null||t.dehydrated!==null)?(e=e.memoizedState,e!==null&&e.dehydrated===null):!1}var xbe=Math.ceil,yT=Sp.ReactCurrentDispatcher,Oj=Sp.ReactCurrentOwner,Et=0,co=null,ei=null,Zi=0,Yh=0,bL=fd(0),Oi=0,YP=null,Vv=0,d1=0,Gv=0,Cj=0,_L=null,Tj=0,wL=1/0;function Hv(){wL=Ki()+500}var ht=null,xT=!1,SL=null,kl=null,Yf=!1,Ix=null,ox=90,OL=[],CL=[],Kc=null,Dx=0,TL=null,yC=-1,jc=0,xC=0,Lx=null,bC=!1;function ya(){return Et&48?Ki():yC!==-1?yC:yC=Ki()}function Nf(t){if(t=t.mode,!(t&2))return 1;if(!(t&4))return Gg()===99?1:2;if(jc===0&&(jc=Vv),abe.transition!==0){xC!==0&&(xC=_L!==null?_L.pendingLanes:0),t=jc;var e=4186112&~xC;return e&=-e,e===0&&(t=4186112&~t,e=t&-t,e===0&&(e=8192)),e}return t=Gg(),Et&4&&t===98?t=nT(12,jc):(t=lxe(t),t=nT(t,jc)),t}function $f(t,e,n){if(50<Dx)throw Dx=0,TL=null,Error(Xe(185));if(t=KP(t,e),t===null)return null;WP(t,e,n),t===co&&(Gv|=e,Oi===4&&xg(t,Zi));var r=Gg();e===1?Et&8&&!(Et&48)?EL(t):(ls(t,n),Et===0&&(Hv(),ic())):(!(Et&4)||r!==98&&r!==99||(Kc===null?Kc=new Set([t]):Kc.add(t)),ls(t,n)),_L=t}function KP(t,e){t.lanes|=e;var n=t.alternate;for(n!==null&&(n.lanes|=e),n=t,t=t.return;t!==null;)t.childLanes|=e,n=t.alternate,n!==null&&(n.childLanes|=e),n=t,t=t.return;return n.tag===3?n.stateNode:null}function ls(t,e){for(var n=t.callbackNode,r=t.suspendedLanes,i=t.pingedLanes,o=t.expirationTimes,a=t.pendingLanes;0<a;){var s=31-Xf(a),l=1<<s,c=o[s];if(c===-1){if(!(l&r)||l&i){c=e,Im(l);var u=jn;o[s]=10<=u?c+250:6<=u?c+5e3:-1}}else c<=e&&(t.expiredLanes|=l);a&=~l}if(r=yb(t,t===co?Zi:0),e=jn,r===0)n!==null&&(n!==cA&&lL(n),t.callbackNode=null,t.callbackPriority=0);else{if(n!==null){if(t.callbackPriority===e)return;n!==cA&&lL(n)}e===15?(n=EL.bind(null,t),Dc===null?(Dc=[n],vC=dj(XP,cte)):Dc.push(n),n=cA):e===14?n=wb(99,EL.bind(null,t)):(n=cxe(e),n=wb(n,Rte.bind(null,t))),t.callbackPriority=e,t.callbackNode=n}}function Rte(t){if(yC=-1,xC=jc=0,Et&48)throw Error(Xe(327));var e=t.callbackNode;if(dd()&&t.callbackNode!==e)return null;var n=yb(t,t===co?Zi:0);if(n===0)return null;var r=n,i=Et;Et|=16;var o=Nte();(co!==t||Zi!==r)&&(Hv(),bg(t,r));do try{wbe();break}catch(s){Lte(t,s)}while(!0);if(hj(),yT.current=o,Et=i,ei!==null?r=0:(co=null,Zi=0,r=Oi),Vv&Gv)bg(t,0);else if(r!==0){if(r===2&&(Et|=64,t.hydrate&&(t.hydrate=!1,uj(t.containerInfo)),n=Uee(t),n!==0&&(r=ax(t,n))),r===1)throw e=YP,bg(t,0),xg(t,n),ls(t,Ki()),e;switch(t.finishedWork=t.current.alternate,t.finishedLanes=n,r){case 0:case 1:throw Error(Xe(345));case 2:Qd(t);break;case 3:if(xg(t,n),(n&62914560)===n&&(r=Tj+500-Ki(),10<r)){if(yb(t,0)!==0)break;if(i=t.suspendedLanes,(i&n)!==n){ya(),t.pingedLanes|=t.suspendedLanes&i;break}t.timeoutHandle=AW(Qd.bind(null,t),r);break}Qd(t);break;case 4:if(xg(t,n),(n&4186112)===n)break;for(r=t.eventTimes,i=-1;0<n;){var a=31-Xf(n);o=1<<a,a=r[a],a>i&&(i=a),n&=~o}if(n=i,n=Ki()-n,n=(120>n?120:480>n?480:1080>n?1080:1920>n?1920:3e3>n?3e3:4320>n?4320:1960*xbe(n/1960))-n,10<n){t.timeoutHandle=AW(Qd.bind(null,t),n);break}Qd(t);break;case 5:Qd(t);break;default:throw Error(Xe(329))}}return ls(t,Ki()),t.callbackNode===e?Rte.bind(null,t):null}function xg(t,e){for(e&=~Cj,e&=~Gv,t.suspendedLanes|=e,t.pingedLanes&=~e,t=t.expirationTimes;0<e;){var n=31-Xf(e),r=1<<n;t[n]=-1,e&=~r}}function EL(t){if(Et&48)throw Error(Xe(327));if(dd(),t===co&&t.expiredLanes&Zi){var e=Zi,n=ax(t,e);Vv&Gv&&(e=yb(t,e),n=ax(t,e))}else e=yb(t,0),n=ax(t,e);if(t.tag!==0&&n===2&&(Et|=64,t.hydrate&&(t.hydrate=!1,uj(t.containerInfo)),e=Uee(t),e!==0&&(n=ax(t,e))),n===1)throw n=YP,bg(t,0),xg(t,e),ls(t,Ki()),n;return t.finishedWork=t.current.alternate,t.finishedLanes=e,Qd(t),ls(t,Ki()),null}function bbe(){if(Kc!==null){var t=Kc;Kc=null,t.forEach(function(e){e.expiredLanes|=24&e.pendingLanes,ls(e,Ki())})}ic()}function Ite(t,e){var n=Et;Et|=1;try{return t(e)}finally{Et=n,Et===0&&(Hv(),ic())}}function Dte(t,e){var n=Et;Et&=-2,Et|=8;try{return t(e)}finally{Et=n,Et===0&&(Hv(),ic())}}function Kw(t,e){br(bL,Yh),Yh|=e,Vv|=e}function Ej(){Yh=bL.current,er(bL)}function bg(t,e){t.finishedWork=null,t.finishedLanes=0;var n=t.timeoutHandle;if(n!==-1&&(t.timeoutHandle=-1,ebe(n)),ei!==null)for(n=ei.return;n!==null;){var r=n;switch(r.tag){case 1:r=r.type.childContextTypes,r!=null&&aT();break;case 3:Hg(),er(Do),er(Ji),vj();break;case 5:gj(r);break;case 4:Hg();break;case 13:er(xr);break;case 19:er(xr);break;case 10:pj(r);break;case 23:case 24:Ej()}n=n.return}co=t,ei=Kf(t.current,null),Zi=Yh=Vv=e,Oi=0,YP=null,Cj=Gv=d1=0}function Lte(t,e){do{var n=ei;try{if(hj(),Ax.current=vT,hT){for(var r=Mr.memoizedState;r!==null;){var i=r.queue;i!==null&&(i.pending=null),r=r.next}hT=!1}if(Tb=0,wi=Gi=Mr=null,Rx=!1,Oj.current=null,n===null||n.return===null){Oi=1,YP=e,ei=null;break}e:{var o=t,a=n.return,s=n,l=e;if(e=Zi,s.flags|=2048,s.firstEffect=s.lastEffect=null,l!==null&&typeof l=="object"&&typeof l.then=="function"){var c=l;if(!(s.mode&2)){var u=s.alternate;u?(s.updateQueue=u.updateQueue,s.memoizedState=u.memoizedState,s.lanes=u.lanes):(s.updateQueue=null,s.memoizedState=null)}var f=(xr.current&1)!==0,d=a;do{var h;if(h=d.tag===13){var p=d.memoizedState;if(p!==null)h=p.dehydrated!==null;else{var m=d.memoizedProps;h=m.fallback===void 0?!1:m.unstable_avoidThisFallback!==!0?!0:!f}}if(h){var g=d.updateQueue;if(g===null){var v=new Set;v.add(c),d.updateQueue=v}else g.add(c);if(!(d.mode&2)){if(d.flags|=64,s.flags|=16384,s.flags&=-2981,s.tag===1)if(s.alternate===null)s.tag=17;else{var y=Df(-1,1);y.tag=2,Lf(s,y)}s.lanes|=1;break e}l=void 0,s=e;var x=o.pingCache;if(x===null?(x=o.pingCache=new pbe,l=new Set,x.set(c,l)):(l=x.get(c),l===void 0&&(l=new Set,x.set(c,l))),!l.has(s)){l.add(s);var b=Ebe.bind(null,o,c,s);c.then(b,b)}d.flags|=4096,d.lanes=e;break e}d=d.return}while(d!==null);l=Error((dg(s.type)||"A React component")+` suspended while rendering, but no fallback UI was specified.

Add a <Suspense fallback=...> component higher in the tree to provide a loading indicator or placeholder to display.`)}Oi!==5&&(Oi=2),l=Sj(l,s),d=a;do{switch(d.tag){case 3:o=l,d.flags|=4096,e&=-e,d.lanes|=e;var _=Mte(d,o,e);FW(d,_);break e;case 1:o=l;var S=d.type,O=d.stateNode;if(!(d.flags&64)&&(typeof S.getDerivedStateFromError=="function"||O!==null&&typeof O.componentDidCatch=="function"&&(kl===null||!kl.has(O)))){d.flags|=4096,e&=-e,d.lanes|=e;var C=kte(d,o,e);FW(d,C);break e}}d=d.return}while(d!==null)}Fte(n)}catch(E){e=E,ei===n&&n!==null&&(ei=n=n.return);continue}break}while(!0)}function Nte(){var t=yT.current;return yT.current=vT,t===null?vT:t}function ax(t,e){var n=Et;Et|=16;var r=Nte();co===t&&Zi===e||bg(t,e);do try{_be();break}catch(i){Lte(t,i)}while(!0);if(hj(),Et=n,yT.current=r,ei!==null)throw Error(Xe(261));return co=null,Zi=0,Oi}function _be(){for(;ei!==null;)$te(ei)}function wbe(){for(;ei!==null&&!rbe();)$te(ei)}function $te(t){var e=Bte(t.alternate,t,Yh);t.memoizedProps=t.pendingProps,e===null?Fte(t):ei=e,Oj.current=null}function Fte(t){var e=t;do{var n=e.alternate;if(t=e.return,e.flags&2048){if(n=hbe(e),n!==null){n.flags&=2047,ei=n;return}t!==null&&(t.firstEffect=t.lastEffect=null,t.flags|=2048)}else{if(n=dbe(n,e,Yh),n!==null){ei=n;return}if(n=e,n.tag!==24&&n.tag!==23||n.memoizedState===null||Yh&1073741824||!(n.mode&4)){for(var r=0,i=n.child;i!==null;)r|=i.lanes|i.childLanes,i=i.sibling;n.childLanes=r}t!==null&&!(t.flags&2048)&&(t.firstEffect===null&&(t.firstEffect=e.firstEffect),e.lastEffect!==null&&(t.lastEffect!==null&&(t.lastEffect.nextEffect=e.firstEffect),t.lastEffect=e.lastEffect),1<e.flags&&(t.lastEffect!==null?t.lastEffect.nextEffect=e:t.firstEffect=e,t.lastEffect=e))}if(e=e.sibling,e!==null){ei=e;return}ei=e=t}while(e!==null);Oi===0&&(Oi=5)}function Qd(t){var e=Gg();return Qh(99,Sbe.bind(null,t,e)),null}function Sbe(t,e){do dd();while(Ix!==null);if(Et&48)throw Error(Xe(327));var n=t.finishedWork;if(n===null)return null;if(t.finishedWork=null,t.finishedLanes=0,n===t.current)throw Error(Xe(177));t.callbackNode=null;var r=n.lanes|n.childLanes,i=r,o=t.pendingLanes&~i;t.pendingLanes=i,t.suspendedLanes=0,t.pingedLanes=0,t.expiredLanes&=i,t.mutableReadLanes&=i,t.entangledLanes&=i,i=t.entanglements;for(var a=t.eventTimes,s=t.expirationTimes;0<o;){var l=31-Xf(o),c=1<<l;i[l]=0,a[l]=-1,s[l]=-1,o&=~c}if(Kc!==null&&!(r&24)&&Kc.has(t)&&Kc.delete(t),t===co&&(ei=co=null,Zi=0),1<n.flags?n.lastEffect!==null?(n.lastEffect.nextEffect=n,r=n.firstEffect):r=n:r=n.firstEffect,r!==null){if(i=Et,Et|=32,Oj.current=null,aA=hC,a=OW(),rL(a)){if("selectionStart"in a)s={start:a.selectionStart,end:a.selectionEnd};else e:if(s=(s=a.ownerDocument)&&s.defaultView||window,(c=s.getSelection&&s.getSelection())&&c.rangeCount!==0){s=c.anchorNode,o=c.anchorOffset,l=c.focusNode,c=c.focusOffset;try{s.nodeType,l.nodeType}catch{s=null;break e}var u=0,f=-1,d=-1,h=0,p=0,m=a,g=null;t:for(;;){for(var v;m!==s||o!==0&&m.nodeType!==3||(f=u+o),m!==l||c!==0&&m.nodeType!==3||(d=u+c),m.nodeType===3&&(u+=m.nodeValue.length),(v=m.firstChild)!==null;)g=m,m=v;for(;;){if(m===a)break t;if(g===s&&++h===o&&(f=u),g===l&&++p===c&&(d=u),(v=m.nextSibling)!==null)break;m=g,g=m.parentNode}m=v}s=f===-1||d===-1?null:{start:f,end:d}}else s=null;s=s||{start:0,end:0}}else s=null;sA={focusedElem:a,selectionRange:s},hC=!1,Lx=null,bC=!1,ht=r;do try{Obe()}catch(E){if(ht===null)throw Error(Xe(330));Ff(ht,E),ht=ht.nextEffect}while(ht!==null);Lx=null,ht=r;do try{for(a=t;ht!==null;){var y=ht.flags;if(y&16&&pb(ht.stateNode,""),y&128){var x=ht.alternate;if(x!==null){var b=x.ref;b!==null&&(typeof b=="function"?b(null):b.current=null)}}switch(y&1038){case 2:cV(ht),ht.flags&=-3;break;case 6:cV(ht),ht.flags&=-3,pA(ht.alternate,ht);break;case 1024:ht.flags&=-1025;break;case 1028:ht.flags&=-1025,pA(ht.alternate,ht);break;case 4:pA(ht.alternate,ht);break;case 8:s=ht,Ate(a,s);var _=s.alternate;sV(s),_!==null&&sV(_)}ht=ht.nextEffect}}catch(E){if(ht===null)throw Error(Xe(330));Ff(ht,E),ht=ht.nextEffect}while(ht!==null);if(b=sA,x=OW(),y=b.focusedElem,a=b.selectionRange,x!==y&&y&&y.ownerDocument&&Yee(y.ownerDocument.documentElement,y)){for(a!==null&&rL(y)&&(x=a.start,b=a.end,b===void 0&&(b=x),"selectionStart"in y?(y.selectionStart=x,y.selectionEnd=Math.min(b,y.value.length)):(b=(x=y.ownerDocument||document)&&x.defaultView||window,b.getSelection&&(b=b.getSelection(),s=y.textContent.length,_=Math.min(a.start,s),a=a.end===void 0?_:Math.min(a.end,s),!b.extend&&_>a&&(s=a,a=_,_=s),s=SW(y,_),o=SW(y,a),s&&o&&(b.rangeCount!==1||b.anchorNode!==s.node||b.anchorOffset!==s.offset||b.focusNode!==o.node||b.focusOffset!==o.offset)&&(x=x.createRange(),x.setStart(s.node,s.offset),b.removeAllRanges(),_>a?(b.addRange(x),b.extend(o.node,o.offset)):(x.setEnd(o.node,o.offset),b.addRange(x)))))),x=[],b=y;b=b.parentNode;)b.nodeType===1&&x.push({element:b,left:b.scrollLeft,top:b.scrollTop});for(typeof y.focus=="function"&&y.focus(),y=0;y<x.length;y++)b=x[y],b.element.scrollLeft=b.left,b.element.scrollTop=b.top}hC=!!aA,sA=aA=null,t.current=n,ht=r;do try{for(y=t;ht!==null;){var S=ht.flags;if(S&36&&vbe(y,ht.alternate,ht),S&128){x=void 0;var O=ht.ref;if(O!==null){var C=ht.stateNode;switch(ht.tag){case 5:x=C;break;default:x=C}typeof O=="function"?O(x):O.current=x}}ht=ht.nextEffect}}catch(E){if(ht===null)throw Error(Xe(330));Ff(ht,E),ht=ht.nextEffect}while(ht!==null);ht=null,obe(),Et=i}else t.current=n;if(Yf)Yf=!1,Ix=t,ox=e;else for(ht=r;ht!==null;)e=ht.nextEffect,ht.nextEffect=null,ht.flags&8&&(S=ht,S.sibling=null,S.stateNode=null),ht=e;if(r=t.pendingLanes,r===0&&(kl=null),r===1?t===TL?Dx++:(Dx=0,TL=t):Dx=0,n=n.stateNode,Ih&&typeof Ih.onCommitFiberRoot=="function")try{Ih.onCommitFiberRoot(fj,n,void 0,(n.current.flags&64)===64)}catch{}if(ls(t,Ki()),xT)throw xT=!1,t=SL,SL=null,t;return Et&8||ic(),null}function Obe(){for(;ht!==null;){var t=ht.alternate;bC||Lx===null||(ht.flags&8?cW(ht,Lx)&&(bC=!0):ht.tag===13&&ybe(t,ht)&&cW(ht,Lx)&&(bC=!0));var e=ht.flags;e&256&&gbe(t,ht),!(e&512)||Yf||(Yf=!0,wb(97,function(){return dd(),null})),ht=ht.nextEffect}}function dd(){if(ox!==90){var t=97<ox?97:ox;return ox=90,Qh(t,Tbe)}return!1}function Cbe(t,e){OL.push(e,t),Yf||(Yf=!0,wb(97,function(){return dd(),null}))}function jte(t,e){CL.push(e,t),Yf||(Yf=!0,wb(97,function(){return dd(),null}))}function Tbe(){if(Ix===null)return!1;var t=Ix;if(Ix=null,Et&48)throw Error(Xe(331));var e=Et;Et|=32;var n=CL;CL=[];for(var r=0;r<n.length;r+=2){var i=n[r],o=n[r+1],a=i.destroy;if(i.destroy=void 0,typeof a=="function")try{a()}catch(l){if(o===null)throw Error(Xe(330));Ff(o,l)}}for(n=OL,OL=[],r=0;r<n.length;r+=2){i=n[r],o=n[r+1];try{var s=i.create;i.destroy=s()}catch(l){if(o===null)throw Error(Xe(330));Ff(o,l)}}for(s=t.current.firstEffect;s!==null;)t=s.nextEffect,s.nextEffect=null,s.flags&8&&(s.sibling=null,s.stateNode=null),s=t;return Et=e,ic(),!0}function fV(t,e,n){e=Sj(n,e),e=Mte(t,e,1),Lf(t,e),e=ya(),t=KP(t,1),t!==null&&(WP(t,1,e),ls(t,e))}function Ff(t,e){if(t.tag===3)fV(t,t,e);else for(var n=t.return;n!==null;){if(n.tag===3){fV(n,t,e);break}else if(n.tag===1){var r=n.stateNode;if(typeof n.type.getDerivedStateFromError=="function"||typeof r.componentDidCatch=="function"&&(kl===null||!kl.has(r))){t=Sj(e,t);var i=kte(n,t,1);if(Lf(n,i),i=ya(),n=KP(n,1),n!==null)WP(n,1,i),ls(n,i);else if(typeof r.componentDidCatch=="function"&&(kl===null||!kl.has(r)))try{r.componentDidCatch(e,t)}catch{}break}}n=n.return}}function Ebe(t,e,n){var r=t.pingCache;r!==null&&r.delete(e),e=ya(),t.pingedLanes|=t.suspendedLanes&n,co===t&&(Zi&n)===n&&(Oi===4||Oi===3&&(Zi&62914560)===Zi&&500>Ki()-Tj?bg(t,0):Cj|=n),ls(t,e)}function Pbe(t,e){var n=t.stateNode;n!==null&&n.delete(e),e=0,e===0&&(e=t.mode,e&2?e&4?(jc===0&&(jc=Vv),e=Dm(62914560&~jc),e===0&&(e=4194304)):e=Gg()===99?1:2:e=1),n=ya(),t=KP(t,e),t!==null&&(WP(t,e,n),ls(t,n))}var Bte;Bte=function(t,e,n){var r=e.lanes;if(t!==null)if(t.memoizedProps!==e.pendingProps||Do.current)Gs=!0;else if(n&r)Gs=!!(t.flags&16384);else{switch(Gs=!1,e.tag){case 3:KW(e),fA();break;case 5:UW(e);break;case 1:Lo(e.type)&&gC(e);break;case 4:fL(e,e.stateNode.containerInfo);break;case 10:r=e.memoizedProps.value;var i=e.type._context;br(sT,i._currentValue),i._currentValue=r;break;case 13:if(e.memoizedState!==null)return n&e.child.childLanes?ZW(t,e,n):(br(xr,xr.current&1),e=Gc(t,e,n),e!==null?e.sibling:null);br(xr,xr.current&1);break;case 19:if(r=(n&e.childLanes)!==0,t.flags&64){if(r)return rV(t,e,n);e.flags|=64}if(i=e.memoizedState,i!==null&&(i.rendering=null,i.tail=null,i.lastEffect=null),br(xr,xr.current),r)break;return null;case 23:case 24:return e.lanes=0,dA(t,e,n)}return Gc(t,e,n)}else Gs=!1;switch(e.lanes=0,e.tag){case 2:if(r=e.type,t!==null&&(t.alternate=null,e.alternate=null,e.flags|=2),t=e.pendingProps,i=Vg(e,Ji.current),vg(e,n),i=xj(null,e,r,t,i,n),e.flags|=1,typeof i=="object"&&i!==null&&typeof i.render=="function"&&i.$$typeof===void 0){if(e.tag=1,e.memoizedState=null,e.updateQueue=null,Lo(r)){var o=!0;gC(e)}else o=!1;e.memoizedState=i.state!==null&&i.state!==void 0?i.state:null,mj(e);var a=r.getDerivedStateFromProps;typeof a=="function"&&uT(e,r,a,t),i.updater=QP,e.stateNode=i,i._reactInternals=e,uL(e,r,t,n),e=mL(null,e,r,!0,o,n)}else e.tag=0,wo(null,e,i,n),e=e.child;return e;case 16:i=e.elementType;e:{switch(t!==null&&(t.alternate=null,e.alternate=null,e.flags|=2),t=e.pendingProps,o=i._init,i=o(i._payload),e.type=i,o=e.tag=kbe(i),t=Fs(i,t),o){case 0:e=pL(null,e,i,t,n);break e;case 1:e=YW(null,e,i,t,n);break e;case 11:e=XW(null,e,i,t,n);break e;case 14:e=QW(null,e,i,Fs(i.type,t),r,n);break e}throw Error(Xe(306,i,""))}return e;case 0:return r=e.type,i=e.pendingProps,i=e.elementType===r?i:Fs(r,i),pL(t,e,r,i,n);case 1:return r=e.type,i=e.pendingProps,i=e.elementType===r?i:Fs(r,i),YW(t,e,r,i,n);case 3:if(KW(e),r=e.updateQueue,t===null||r===null)throw Error(Xe(282));if(r=e.pendingProps,i=e.memoizedState,i=i!==null?i.element:null,fte(t,e),Sb(e,r,null,n),r=e.memoizedState.element,r===i)fA(),e=Gc(t,e,n);else{if(i=e.stateNode,(o=i.hydrate)&&(xf=gg(e.stateNode.containerInfo.firstChild),Vc=e,o=Ul=!0),o){if(t=i.mutableSourceEagerHydrationData,t!=null)for(i=0;i<t.length;i+=2)o=t[i],o._workInProgressVersionPrimary=t[i+1],yg.push(o);for(n=mte(e,null,r,n),e.child=n;n;)n.flags=n.flags&-3|1024,n=n.sibling}else wo(t,e,r,n),fA();e=e.child}return e;case 5:return UW(e),t===null&&dL(e),r=e.type,i=e.pendingProps,o=t!==null?t.memoizedProps:null,a=i.children,aL(r,i)?a=null:o!==null&&aL(r,o)&&(e.flags|=16),Cte(t,e),wo(t,e,a,n),e.child;case 6:return t===null&&dL(e),null;case 13:return ZW(t,e,n);case 4:return fL(e,e.stateNode.containerInfo),r=e.pendingProps,t===null?e.child=fT(e,null,r,n):wo(t,e,r,n),e.child;case 11:return r=e.type,i=e.pendingProps,i=e.elementType===r?i:Fs(r,i),XW(t,e,r,i,n);case 7:return wo(t,e,e.pendingProps,n),e.child;case 8:return wo(t,e,e.pendingProps.children,n),e.child;case 12:return wo(t,e,e.pendingProps.children,n),e.child;case 10:e:{r=e.type._context,i=e.pendingProps,a=e.memoizedProps,o=i.value;var s=e.type._context;if(br(sT,s._currentValue),s._currentValue=o,a!==null)if(s=a.value,o=Wa(s,o)?0:(typeof r._calculateChangedBits=="function"?r._calculateChangedBits(s,o):1073741823)|0,o===0){if(a.children===i.children&&!Do.current){e=Gc(t,e,n);break e}}else for(s=e.child,s!==null&&(s.return=e);s!==null;){var l=s.dependencies;if(l!==null){a=s.child;for(var c=l.firstContext;c!==null;){if(c.context===r&&c.observedBits&o){s.tag===1&&(c=Df(-1,n&-n),c.tag=2,Lf(s,c)),s.lanes|=n,c=s.alternate,c!==null&&(c.lanes|=n),ute(s.return,n),l.lanes|=n;break}c=c.next}}else a=s.tag===10&&s.type===e.type?null:s.child;if(a!==null)a.return=s;else for(a=s;a!==null;){if(a===e){a=null;break}if(s=a.sibling,s!==null){s.return=a.return,a=s;break}a=a.return}s=a}wo(t,e,i.children,n),e=e.child}return e;case 9:return i=e.type,o=e.pendingProps,r=o.children,vg(e,n),i=ss(i,o.unstable_observedBits),r=r(i),e.flags|=1,wo(t,e,r,n),e.child;case 14:return i=e.type,o=Fs(i,e.pendingProps),o=Fs(i.type,o),QW(t,e,i,o,r,n);case 15:return Ote(t,e,e.type,e.pendingProps,r,n);case 17:return r=e.type,i=e.pendingProps,i=e.elementType===r?i:Fs(r,i),t!==null&&(t.alternate=null,e.alternate=null,e.flags|=2),e.tag=1,Lo(r)?(t=!0,gC(e)):t=!1,vg(e,n),hte(e,r,i),uL(e,r,i,n),mL(null,e,r,!0,t,n);case 19:return rV(t,e,n);case 23:return dA(t,e,n);case 24:return dA(t,e,n)}throw Error(Xe(156,e.tag))};function Mbe(t,e,n,r){this.tag=t,this.key=n,this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null,this.index=0,this.ref=null,this.pendingProps=e,this.dependencies=this.memoizedState=this.updateQueue=this.memoizedProps=null,this.mode=r,this.flags=0,this.lastEffect=this.firstEffect=this.nextEffect=null,this.childLanes=this.lanes=0,this.alternate=null}function Va(t,e,n,r){return new Mbe(t,e,n,r)}function Pj(t){return t=t.prototype,!(!t||!t.isReactComponent)}function kbe(t){if(typeof t=="function")return Pj(t)?1:0;if(t!=null){if(t=t.$$typeof,t===BP)return 11;if(t===zP)return 14}return 2}function Kf(t,e){var n=t.alternate;return n===null?(n=Va(t.tag,e,t.key,t.mode),n.elementType=t.elementType,n.type=t.type,n.stateNode=t.stateNode,n.alternate=t,t.alternate=n):(n.pendingProps=e,n.type=t.type,n.flags=0,n.nextEffect=null,n.firstEffect=null,n.lastEffect=null),n.childLanes=t.childLanes,n.lanes=t.lanes,n.child=t.child,n.memoizedProps=t.memoizedProps,n.memoizedState=t.memoizedState,n.updateQueue=t.updateQueue,e=t.dependencies,n.dependencies=e===null?null:{lanes:e.lanes,firstContext:e.firstContext},n.sibling=t.sibling,n.index=t.index,n.ref=t.ref,n}function _C(t,e,n,r,i,o){var a=2;if(r=t,typeof t=="function")Pj(t)&&(a=1);else if(typeof t=="string")a=5;else e:switch(t){case df:return _g(n.children,i,o,e);case vee:a=8,i|=16;break;case VF:a=8,i|=1;break;case Ox:return t=Va(12,n,e,i|8),t.elementType=Ox,t.type=Ox,t.lanes=o,t;case Cx:return t=Va(13,n,e,i),t.type=Cx,t.elementType=Cx,t.lanes=o,t;case ZC:return t=Va(19,n,e,i),t.elementType=ZC,t.lanes=o,t;case YF:return Mj(n,i,o,e);case UD:return t=Va(24,n,e,i),t.elementType=UD,t.lanes=o,t;default:if(typeof t=="object"&&t!==null)switch(t.$$typeof){case GF:a=10;break e;case HF:a=9;break e;case BP:a=11;break e;case zP:a=14;break e;case qF:a=16,r=null;break e;case XF:a=22;break e}throw Error(Xe(130,t==null?t:typeof t,""))}return e=Va(a,n,e,i),e.elementType=t,e.type=r,e.lanes=o,e}function _g(t,e,n,r){return t=Va(7,t,r,e),t.lanes=n,t}function Mj(t,e,n,r){return t=Va(23,t,r,e),t.elementType=YF,t.lanes=n,t}function mA(t,e,n){return t=Va(6,t,null,e),t.lanes=n,t}function gA(t,e,n){return e=Va(4,t.children!==null?t.children:[],t.key,e),e.lanes=n,e.stateNode={containerInfo:t.containerInfo,pendingChildren:null,implementation:t.implementation},e}function Abe(t,e,n){this.tag=e,this.containerInfo=t,this.finishedWork=this.pingCache=this.current=this.pendingChildren=null,this.timeoutHandle=-1,this.pendingContext=this.context=null,this.hydrate=n,this.callbackNode=null,this.callbackPriority=0,this.eventTimes=Jk(0),this.expirationTimes=Jk(-1),this.entangledLanes=this.finishedLanes=this.mutableReadLanes=this.expiredLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=Jk(0),this.mutableSourceEagerHydrationData=null}function Rbe(t,e,n){var r=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:hh,key:r==null?null:""+r,children:t,containerInfo:e,implementation:n}}function bT(t,e,n,r){var i=e.current,o=ya(),a=Nf(i);e:if(n){n=n._reactInternals;t:{if(Op(n)!==n||n.tag!==1)throw Error(Xe(170));var s=n;do{switch(s.tag){case 3:s=s.stateNode.context;break t;case 1:if(Lo(s.type)){s=s.stateNode.__reactInternalMemoizedMergedChildContext;break t}}s=s.return}while(s!==null);throw Error(Xe(171))}if(n.tag===1){var l=n.type;if(Lo(l)){n=rte(n,l,s);break e}}n=s}else n=Qf;return e.context===null?e.context=n:e.pendingContext=n,e=Df(o,a),e.payload={element:t},r=r===void 0?null:r,r!==null&&(e.callback=r),Lf(i,e),$f(i,a,o),a}function vA(t){if(t=t.current,!t.child)return null;switch(t.child.tag){case 5:return t.child.stateNode;default:return t.child.stateNode}}function dV(t,e){if(t=t.memoizedState,t!==null&&t.dehydrated!==null){var n=t.retryLane;t.retryLane=n!==0&&n<e?n:e}}function kj(t,e){dV(t,e),(t=t.alternate)&&dV(t,e)}function Ibe(){return null}function Aj(t,e,n){var r=n!=null&&n.hydrationOptions!=null&&n.hydrationOptions.mutableSources||null;if(n=new Abe(t,e,n!=null&&n.hydrate===!0),e=Va(3,null,null,e===2?7:e===1?3:0),n.current=e,e.stateNode=n,mj(e),t[Wv]=n.current,Zee(t.nodeType===8?t.parentNode:t),r)for(t=0;t<r.length;t++){e=r[t];var i=e._getVersion;i=i(e._source),n.mutableSourceEagerHydrationData==null?n.mutableSourceEagerHydrationData=[e,i]:n.mutableSourceEagerHydrationData.push(e,i)}this._internalRoot=n}Aj.prototype.render=function(t){bT(t,this._internalRoot,null,null)};Aj.prototype.unmount=function(){var t=this._internalRoot,e=t.containerInfo;bT(null,t,null,function(){e[Wv]=null})};function h1(t){return!(!t||t.nodeType!==1&&t.nodeType!==9&&t.nodeType!==11&&(t.nodeType!==8||t.nodeValue!==" react-mount-point-unstable "))}function Dbe(t,e){if(e||(e=t?t.nodeType===9?t.documentElement:t.firstChild:null,e=!(!e||e.nodeType!==1||!e.hasAttribute("data-reactroot"))),!e)for(var n;n=t.lastChild;)t.removeChild(n);return new Aj(t,0,e?{hydrate:!0}:void 0)}function ZP(t,e,n,r,i){var o=n._reactRootContainer;if(o){var a=o._internalRoot;if(typeof i=="function"){var s=i;i=function(){var c=vA(a);s.call(c)}}bT(e,a,t,i)}else{if(o=n._reactRootContainer=Dbe(n,r),a=o._internalRoot,typeof i=="function"){var l=i;i=function(){var c=vA(a);l.call(c)}}Dte(function(){bT(e,a,t,i)})}return vA(a)}Ree=function(t){if(t.tag===13){var e=ya();$f(t,4,e),kj(t,4)}};tj=function(t){if(t.tag===13){var e=ya();$f(t,67108864,e),kj(t,67108864)}};Iee=function(t){if(t.tag===13){var e=ya(),n=Nf(t);$f(t,n,e),kj(t,n)}};Dee=function(t,e){return e()};ZD=function(t,e,n){switch(e){case"input":if(VD(t,n),e=n.name,n.type==="radio"&&e!=null){for(n=t;n.parentNode;)n=n.parentNode;for(n=n.querySelectorAll("input[name="+JSON.stringify(""+e)+'][type="radio"]'),e=0;e<n.length;e++){var r=n[e];if(r!==t&&r.form===t.form){var i=qP(r);if(!i)throw Error(Xe(90));xee(r),VD(r,i)}}}break;case"textarea":_ee(t,n);break;case"select":e=n.value,e!=null&&hg(t,!!n.multiple,e,!1)}};ZF=Ite;Pee=function(t,e,n,r,i){var o=Et;Et|=4;try{return Qh(98,t.bind(null,e,n,r,i))}finally{Et=o,Et===0&&(Hv(),ic())}};JF=function(){!(Et&49)&&(bbe(),dd())};Mee=function(t,e){var n=Et;Et|=2;try{return t(e)}finally{Et=n,Et===0&&(Hv(),ic())}};function zte(t,e){var n=2<arguments.length&&arguments[2]!==void 0?arguments[2]:null;if(!h1(e))throw Error(Xe(200));return Rbe(t,e,null,n)}var Lbe={Events:[u1,Qm,qP,Tee,Eee,dd,{current:!1}]},u0={findFiberByHostInstance:mh,bundleType:0,version:"17.0.2",rendererPackageName:"react-dom"},Nbe={bundleType:u0.bundleType,version:u0.version,rendererPackageName:u0.rendererPackageName,rendererConfig:u0.rendererConfig,overrideHookState:null,overrideHookStateDeletePath:null,overrideHookStateRenamePath:null,overrideProps:null,overridePropsDeletePath:null,overridePropsRenamePath:null,setSuspenseHandler:null,scheduleUpdate:null,currentDispatcherRef:Sp.ReactCurrentDispatcher,findHostInstanceByFiber:function(t){return t=Aee(t),t===null?null:t.stateNode},findFiberByHostInstance:u0.findFiberByHostInstance||Ibe,findHostInstancesForRefresh:null,scheduleRefresh:null,scheduleRoot:null,setRefreshHandler:null,getCurrentFiber:null};if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"){var Zw=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!Zw.isDisabled&&Zw.supportsFiber)try{fj=Zw.inject(Nbe),Ih=Zw}catch{}}vs.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED=Lbe;vs.createPortal=zte;vs.findDOMNode=function(t){if(t==null)return null;if(t.nodeType===1)return t;var e=t._reactInternals;if(e===void 0)throw typeof t.render=="function"?Error(Xe(188)):Error(Xe(268,Object.keys(t)));return t=Aee(e),t=t===null?null:t.stateNode,t};vs.flushSync=function(t,e){var n=Et;if(n&48)return t(e);Et|=1;try{if(t)return Qh(99,t.bind(null,e))}finally{Et=n,ic()}};vs.hydrate=function(t,e,n){if(!h1(e))throw Error(Xe(200));return ZP(null,t,e,!0,n)};vs.render=function(t,e,n){if(!h1(e))throw Error(Xe(200));return ZP(null,t,e,!1,n)};vs.unmountComponentAtNode=function(t){if(!h1(t))throw Error(Xe(40));return t._reactRootContainer?(Dte(function(){ZP(null,null,t,!1,function(){t._reactRootContainer=null,t[Wv]=null})}),!0):!1};vs.unstable_batchedUpdates=Ite;vs.unstable_createPortal=function(t,e){return zte(t,e,2<arguments.length&&arguments[2]!==void 0?arguments[2]:null)};vs.unstable_renderSubtreeIntoContainer=function(t,e,n,r){if(!h1(n))throw Error(Xe(200));if(t==null||t._reactInternals===void 0)throw Error(Xe(38));return ZP(t,e,n,!1,r)};vs.version="17.0.2";function Ute(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(Ute)}catch(t){console.error(t)}}Ute(),hee.exports=vs;var qv=hee.exports;const Jw=$t(qv);var Wte={exports:{}},$be="SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED",Fbe=$be,jbe=Fbe;function Vte(){}function Gte(){}Gte.resetWarningCache=Vte;var Bbe=function(){function t(r,i,o,a,s,l){if(l!==jbe){var c=new Error("Calling PropTypes validators directly is not supported by the `prop-types` package. Use PropTypes.checkPropTypes() to call them. Read more at http://fb.me/use-check-prop-types");throw c.name="Invariant Violation",c}}t.isRequired=t;function e(){return t}var n={array:t,bigint:t,bool:t,func:t,number:t,object:t,string:t,symbol:t,any:t,arrayOf:e,element:t,elementType:t,instanceOf:e,node:t,objectOf:e,oneOf:e,oneOfType:e,shape:e,exact:e,checkPropTypes:Gte,resetWarningCache:Vte};return n.PropTypes=n,n};Wte.exports=Bbe();var p1=Wte.exports;const Qe=$t(p1);var Hte=ue.createContext(null);function zbe(t){t()}var qte=zbe,Ube=function(e){return qte=e},Wbe=function(){return qte};function Vbe(){var t=Wbe(),e=null,n=null;return{clear:function(){e=null,n=null},notify:function(){t(function(){for(var i=e;i;)i.callback(),i=i.next})},get:function(){for(var i=[],o=e;o;)i.push(o),o=o.next;return i},subscribe:function(i){var o=!0,a=n={callback:i,next:null,prev:n};return a.prev?a.prev.next=a:e=a,function(){!o||e===null||(o=!1,a.next?a.next.prev=a.prev:n=a.prev,a.prev?a.prev.next=a.next:e=a.next)}}}}var hV={notify:function(){},get:function(){return[]}};function Xte(t,e){var n,r=hV;function i(f){return l(),r.subscribe(f)}function o(){r.notify()}function a(){u.onStateChange&&u.onStateChange()}function s(){return!!n}function l(){n||(n=e?e.addNestedSub(a):t.subscribe(a),r=Vbe())}function c(){n&&(n(),n=void 0,r.clear(),r=hV)}var u={addNestedSub:i,notifyNestedSubs:o,handleChangeWrapper:a,isSubscribed:s,trySubscribe:l,tryUnsubscribe:c,getListeners:function(){return r}};return u}var Qte=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u"?M.useLayoutEffect:M.useEffect;function Gbe(t){var e=t.store,n=t.context,r=t.children,i=M.useMemo(function(){var s=Xte(e);return{store:e,subscription:s}},[e]),o=M.useMemo(function(){return e.getState()},[e]);Qte(function(){var s=i.subscription;return s.onStateChange=s.notifyNestedSubs,s.trySubscribe(),o!==e.getState()&&s.notifyNestedSubs(),function(){s.tryUnsubscribe(),s.onStateChange=null}},[i,o]);var a=n||Hte;return ue.createElement(a.Provider,{value:i},r)}function j(){return j=Object.assign?Object.assign.bind():function(t){for(var e=1;e<arguments.length;e++){var n=arguments[e];for(var r in n)({}).hasOwnProperty.call(n,r)&&(t[r]=n[r])}return t},j.apply(null,arguments)}const Hbe=Object.freeze(Object.defineProperty({__proto__:null,get default(){return j}},Symbol.toStringTag,{value:"Module"}));function Ae(t,e){if(t==null)return{};var n={};for(var r in t)if({}.hasOwnProperty.call(t,r)){if(e.includes(r))continue;n[r]=t[r]}return n}const qbe=Object.freeze(Object.defineProperty({__proto__:null,default:Ae},Symbol.toStringTag,{value:"Module"}));var Yte={exports:{}},Mn={};/** @license React v16.13.1
 * react-is.production.min.js
 *
 * Copyright (c) Facebook, Inc. and its affiliates.
 *
 * This source code is licensed under the MIT license found in the
 * LICENSE file in the root directory of this source tree.
 */var di=typeof Symbol=="function"&&Symbol.for,Rj=di?Symbol.for("react.element"):60103,Ij=di?Symbol.for("react.portal"):60106,JP=di?Symbol.for("react.fragment"):60107,eM=di?Symbol.for("react.strict_mode"):60108,tM=di?Symbol.for("react.profiler"):60114,nM=di?Symbol.for("react.provider"):60109,rM=di?Symbol.for("react.context"):60110,Dj=di?Symbol.for("react.async_mode"):60111,iM=di?Symbol.for("react.concurrent_mode"):60111,oM=di?Symbol.for("react.forward_ref"):60112,aM=di?Symbol.for("react.suspense"):60113,Xbe=di?Symbol.for("react.suspense_list"):60120,sM=di?Symbol.for("react.memo"):60115,lM=di?Symbol.for("react.lazy"):60116,Qbe=di?Symbol.for("react.block"):60121,Ybe=di?Symbol.for("react.fundamental"):60117,Kbe=di?Symbol.for("react.responder"):60118,Zbe=di?Symbol.for("react.scope"):60119;function Ma(t){if(typeof t=="object"&&t!==null){var e=t.$$typeof;switch(e){case Rj:switch(t=t.type,t){case Dj:case iM:case JP:case tM:case eM:case aM:return t;default:switch(t=t&&t.$$typeof,t){case rM:case oM:case lM:case sM:case nM:return t;default:return e}}case Ij:return e}}}function Kte(t){return Ma(t)===iM}Mn.AsyncMode=Dj;Mn.ConcurrentMode=iM;Mn.ContextConsumer=rM;Mn.ContextProvider=nM;Mn.Element=Rj;Mn.ForwardRef=oM;Mn.Fragment=JP;Mn.Lazy=lM;Mn.Memo=sM;Mn.Portal=Ij;Mn.Profiler=tM;Mn.StrictMode=eM;Mn.Suspense=aM;Mn.isAsyncMode=function(t){return Kte(t)||Ma(t)===Dj};Mn.isConcurrentMode=Kte;Mn.isContextConsumer=function(t){return Ma(t)===rM};Mn.isContextProvider=function(t){return Ma(t)===nM};Mn.isElement=function(t){return typeof t=="object"&&t!==null&&t.$$typeof===Rj};Mn.isForwardRef=function(t){return Ma(t)===oM};Mn.isFragment=function(t){return Ma(t)===JP};Mn.isLazy=function(t){return Ma(t)===lM};Mn.isMemo=function(t){return Ma(t)===sM};Mn.isPortal=function(t){return Ma(t)===Ij};Mn.isProfiler=function(t){return Ma(t)===tM};Mn.isStrictMode=function(t){return Ma(t)===eM};Mn.isSuspense=function(t){return Ma(t)===aM};Mn.isValidElementType=function(t){return typeof t=="string"||typeof t=="function"||t===JP||t===iM||t===tM||t===eM||t===aM||t===Xbe||typeof t=="object"&&t!==null&&(t.$$typeof===lM||t.$$typeof===sM||t.$$typeof===nM||t.$$typeof===rM||t.$$typeof===oM||t.$$typeof===Ybe||t.$$typeof===Kbe||t.$$typeof===Zbe||t.$$typeof===Qbe)};Mn.typeOf=Ma;Yte.exports=Mn;var _T=Yte.exports,Lj=_T,Jbe={childContextTypes:!0,contextType:!0,contextTypes:!0,defaultProps:!0,displayName:!0,getDefaultProps:!0,getDerivedStateFromError:!0,getDerivedStateFromProps:!0,mixins:!0,propTypes:!0,type:!0},e_e={name:!0,length:!0,prototype:!0,caller:!0,callee:!0,arguments:!0,arity:!0},t_e={$$typeof:!0,render:!0,defaultProps:!0,displayName:!0,propTypes:!0},Zte={$$typeof:!0,compare:!0,defaultProps:!0,displayName:!0,propTypes:!0,type:!0},Nj={};Nj[Lj.ForwardRef]=t_e;Nj[Lj.Memo]=Zte;function pV(t){return Lj.isMemo(t)?Zte:Nj[t.$$typeof]||Jbe}var n_e=Object.defineProperty,r_e=Object.getOwnPropertyNames,mV=Object.getOwnPropertySymbols,i_e=Object.getOwnPropertyDescriptor,o_e=Object.getPrototypeOf,gV=Object.prototype;function Jte(t,e,n){if(typeof e!="string"){if(gV){var r=o_e(e);r&&r!==gV&&Jte(t,r,n)}var i=r_e(e);mV&&(i=i.concat(mV(e)));for(var o=pV(t),a=pV(e),s=0;s<i.length;++s){var l=i[s];if(!e_e[l]&&!(n&&n[l])&&!(a&&a[l])&&!(o&&o[l])){var c=i_e(e,l);try{n_e(t,l,c)}catch{}}}}return t}var a_e=Jte;const PL=$t(a_e);var ene={exports:{}},Fn={};/** @license React v17.0.2
 * react-is.production.min.js
 *
 * Copyright (c) Facebook, Inc. and its affiliates.
 *
 * This source code is licensed under the MIT license found in the
 * LICENSE file in the root directory of this source tree.
 */var cM=60103,uM=60106,m1=60107,g1=60108,v1=60114,y1=60109,x1=60110,b1=60112,_1=60113,$j=60120,w1=60115,S1=60116,tne=60121,nne=60122,rne=60117,ine=60129,one=60131;if(typeof Symbol=="function"&&Symbol.for){var xi=Symbol.for;cM=xi("react.element"),uM=xi("react.portal"),m1=xi("react.fragment"),g1=xi("react.strict_mode"),v1=xi("react.profiler"),y1=xi("react.provider"),x1=xi("react.context"),b1=xi("react.forward_ref"),_1=xi("react.suspense"),$j=xi("react.suspense_list"),w1=xi("react.memo"),S1=xi("react.lazy"),tne=xi("react.block"),nne=xi("react.server.block"),rne=xi("react.fundamental"),ine=xi("react.debug_trace_mode"),one=xi("react.legacy_hidden")}function nl(t){if(typeof t=="object"&&t!==null){var e=t.$$typeof;switch(e){case cM:switch(t=t.type,t){case m1:case v1:case g1:case _1:case $j:return t;default:switch(t=t&&t.$$typeof,t){case x1:case b1:case S1:case w1:case y1:return t;default:return e}}case uM:return e}}}var s_e=y1,l_e=cM,c_e=b1,u_e=m1,f_e=S1,d_e=w1,h_e=uM,p_e=v1,m_e=g1,g_e=_1;Fn.ContextConsumer=x1;Fn.ContextProvider=s_e;Fn.Element=l_e;Fn.ForwardRef=c_e;Fn.Fragment=u_e;Fn.Lazy=f_e;Fn.Memo=d_e;Fn.Portal=h_e;Fn.Profiler=p_e;Fn.StrictMode=m_e;Fn.Suspense=g_e;Fn.isAsyncMode=function(){return!1};Fn.isConcurrentMode=function(){return!1};Fn.isContextConsumer=function(t){return nl(t)===x1};Fn.isContextProvider=function(t){return nl(t)===y1};Fn.isElement=function(t){return typeof t=="object"&&t!==null&&t.$$typeof===cM};Fn.isForwardRef=function(t){return nl(t)===b1};Fn.isFragment=function(t){return nl(t)===m1};Fn.isLazy=function(t){return nl(t)===S1};Fn.isMemo=function(t){return nl(t)===w1};Fn.isPortal=function(t){return nl(t)===uM};Fn.isProfiler=function(t){return nl(t)===v1};Fn.isStrictMode=function(t){return nl(t)===g1};Fn.isSuspense=function(t){return nl(t)===_1};Fn.isValidElementType=function(t){return typeof t=="string"||typeof t=="function"||t===m1||t===v1||t===ine||t===g1||t===_1||t===$j||t===one||typeof t=="object"&&t!==null&&(t.$$typeof===S1||t.$$typeof===w1||t.$$typeof===y1||t.$$typeof===x1||t.$$typeof===b1||t.$$typeof===rne||t.$$typeof===tne||t[0]===nne)};Fn.typeOf=nl;ene.exports=Fn;var v_e=ene.exports,y_e=["getDisplayName","methodName","renderCountProp","shouldHandleStateChanges","storeKey","withRef","forwardRef","context"],x_e=["reactReduxForwardedRef"],b_e=[],__e=[null,null];function w_e(t,e){var n=t[1];return[e.payload,n+1]}function vV(t,e,n){Qte(function(){return t.apply(void 0,e)},n)}function S_e(t,e,n,r,i,o,a){t.current=r,e.current=i,n.current=!1,o.current&&(o.current=null,a())}function O_e(t,e,n,r,i,o,a,s,l,c){if(t){var u=!1,f=null,d=function(){if(!u){var m=e.getState(),g,v;try{g=r(m,i.current)}catch(y){v=y,f=y}v||(f=null),g===o.current?a.current||l():(o.current=g,s.current=g,a.current=!0,c({type:"STORE_UPDATED",payload:{error:v}}))}};n.onStateChange=d,n.trySubscribe(),d();var h=function(){if(u=!0,n.tryUnsubscribe(),n.onStateChange=null,f)throw f};return h}}var C_e=function(){return[null,0]};function T_e(t,e){e===void 0&&(e={});var n=e,r=n.getDisplayName,i=r===void 0?function(x){return"ConnectAdvanced("+x+")"}:r,o=n.methodName,a=o===void 0?"connectAdvanced":o,s=n.renderCountProp,l=s===void 0?void 0:s,c=n.shouldHandleStateChanges,u=c===void 0?!0:c,f=n.storeKey,d=f===void 0?"store":f;n.withRef;var h=n.forwardRef,p=h===void 0?!1:h,m=n.context,g=m===void 0?Hte:m,v=Ae(n,y_e),y=g;return function(b){var _=b.displayName||b.name||"Component",S=i(_),O=j({},v,{getDisplayName:i,methodName:a,renderCountProp:l,shouldHandleStateChanges:u,storeKey:d,displayName:S,wrappedComponentName:_,WrappedComponent:b}),C=v.pure;function E(T){return t(T.dispatch,O)}var k=C?M.useMemo:function(T){return T()};function I(T){var L=M.useMemo(function(){var ee=T.reactReduxForwardedRef,ge=Ae(T,x_e);return[T.context,ee,ge]},[T]),z=L[0],B=L[1],U=L[2],W=M.useMemo(function(){return z&&z.Consumer&&v_e.isContextConsumer(ue.createElement(z.Consumer,null))?z:y},[z,y]),$=M.useContext(W),N=!!T.store&&!!T.store.getState&&!!T.store.dispatch;$&&$.store;var D=N?T.store:$.store,A=M.useMemo(function(){return E(D)},[D]),q=M.useMemo(function(){if(!u)return __e;var ee=Xte(D,N?null:$.subscription),ge=ee.notifyNestedSubs.bind(ee);return[ee,ge]},[D,N,$]),Y=q[0],K=q[1],se=M.useMemo(function(){return N?$:j({},$,{subscription:Y})},[N,$,Y]),te=M.useReducer(w_e,b_e,C_e),J=te[0],pe=J[0],be=te[1];if(pe&&pe.error)throw pe.error;var re=M.useRef(),ve=M.useRef(U),F=M.useRef(),ce=M.useRef(!1),le=k(function(){return F.current&&U===ve.current?F.current:A(D.getState(),U)},[D,pe,U]);vV(S_e,[ve,re,ce,U,le,F,K]),vV(O_e,[u,D,Y,A,ve,re,ce,F,K,be],[D,Y,A]);var Q=M.useMemo(function(){return ue.createElement(b,j({},le,{ref:B}))},[B,b,le]),X=M.useMemo(function(){return u?ue.createElement(W.Provider,{value:se},Q):Q},[W,Q,se]);return X}var P=C?ue.memo(I):I;if(P.WrappedComponent=b,P.displayName=I.displayName=S,p){var R=ue.forwardRef(function(L,z){return ue.createElement(P,j({},L,{reactReduxForwardedRef:z}))});return R.displayName=S,R.WrappedComponent=b,PL(R,b)}return PL(P,b)}}function yV(t,e){return t===e?t!==0||e!==0||1/t===1/e:t!==t&&e!==e}function yA(t,e){if(yV(t,e))return!0;if(typeof t!="object"||t===null||typeof e!="object"||e===null)return!1;var n=Object.keys(t),r=Object.keys(e);if(n.length!==r.length)return!1;for(var i=0;i<n.length;i++)if(!Object.prototype.hasOwnProperty.call(e,n[i])||!yV(t[n[i]],e[n[i]]))return!1;return!0}function E_e(t,e){var n={},r=function(a){var s=t[a];typeof s=="function"&&(n[a]=function(){return e(s.apply(void 0,arguments))})};for(var i in t)r(i);return n}function Fj(t){return function(n,r){var i=t(n,r);function o(){return i}return o.dependsOnOwnProps=!1,o}}function xV(t){return t.dependsOnOwnProps!==null&&t.dependsOnOwnProps!==void 0?!!t.dependsOnOwnProps:t.length!==1}function ane(t,e){return function(r,i){i.displayName;var o=function(s,l){return o.dependsOnOwnProps?o.mapToProps(s,l):o.mapToProps(s)};return o.dependsOnOwnProps=!0,o.mapToProps=function(s,l){o.mapToProps=t,o.dependsOnOwnProps=xV(t);var c=o(s,l);return typeof c=="function"&&(o.mapToProps=c,o.dependsOnOwnProps=xV(c),c=o(s,l)),c},o}}function P_e(t){return typeof t=="function"?ane(t):void 0}function M_e(t){return t?void 0:Fj(function(e){return{dispatch:e}})}function k_e(t){return t&&typeof t=="object"?Fj(function(e){return E_e(t,e)}):void 0}const A_e=[P_e,M_e,k_e];function R_e(t){return typeof t=="function"?ane(t):void 0}function I_e(t){return t?void 0:Fj(function(){return{}})}const D_e=[R_e,I_e];function L_e(t,e,n){return j({},n,t,e)}function N_e(t){return function(n,r){r.displayName;var i=r.pure,o=r.areMergedPropsEqual,a=!1,s;return function(c,u,f){var d=t(c,u,f);return a?(!i||!o(d,s))&&(s=d):(a=!0,s=d),s}}}function $_e(t){return typeof t=="function"?N_e(t):void 0}function F_e(t){return t?void 0:function(){return L_e}}const j_e=[$_e,F_e];var B_e=["initMapStateToProps","initMapDispatchToProps","initMergeProps"];function z_e(t,e,n,r){return function(o,a){return n(t(o,a),e(r,a),a)}}function U_e(t,e,n,r,i){var o=i.areStatesEqual,a=i.areOwnPropsEqual,s=i.areStatePropsEqual,l=!1,c,u,f,d,h;function p(x,b){return c=x,u=b,f=t(c,u),d=e(r,u),h=n(f,d,u),l=!0,h}function m(){return f=t(c,u),e.dependsOnOwnProps&&(d=e(r,u)),h=n(f,d,u),h}function g(){return t.dependsOnOwnProps&&(f=t(c,u)),e.dependsOnOwnProps&&(d=e(r,u)),h=n(f,d,u),h}function v(){var x=t(c,u),b=!s(x,f);return f=x,b&&(h=n(f,d,u)),h}function y(x,b){var _=!a(b,u),S=!o(x,c,b,u);return c=x,u=b,_&&S?m():_?g():S?v():h}return function(b,_){return l?y(b,_):p(b,_)}}function W_e(t,e){var n=e.initMapStateToProps,r=e.initMapDispatchToProps,i=e.initMergeProps,o=Ae(e,B_e),a=n(t,o),s=r(t,o),l=i(t,o),c=o.pure?U_e:z_e;return c(a,s,l,t,o)}var V_e=["pure","areStatesEqual","areOwnPropsEqual","areStatePropsEqual","areMergedPropsEqual"];function xA(t,e,n){for(var r=e.length-1;r>=0;r--){var i=e[r](t);if(i)return i}return function(o,a){throw new Error("Invalid value of type "+typeof t+" for "+n+" argument when connecting component "+a.wrappedComponentName+".")}}function G_e(t,e){return t===e}function H_e(t){var e={},n=e.connectHOC,r=n===void 0?T_e:n,i=e.mapStateToPropsFactories,o=i===void 0?D_e:i,a=e.mapDispatchToPropsFactories,s=a===void 0?A_e:a,l=e.mergePropsFactories,c=l===void 0?j_e:l,u=e.selectorFactory,f=u===void 0?W_e:u;return function(h,p,m,g){g===void 0&&(g={});var v=g,y=v.pure,x=y===void 0?!0:y,b=v.areStatesEqual,_=b===void 0?G_e:b,S=v.areOwnPropsEqual,O=S===void 0?yA:S,C=v.areStatePropsEqual,E=C===void 0?yA:C,k=v.areMergedPropsEqual,I=k===void 0?yA:k,P=Ae(v,V_e),R=xA(h,o,"mapStateToProps"),T=xA(p,s,"mapDispatchToProps"),L=xA(m,c,"mergeProps");return r(f,j({methodName:"connect",getDisplayName:function(B){return"Connect("+B+")"},shouldHandleStateChanges:!!h,initMapStateToProps:R,initMapDispatchToProps:T,initMergeProps:L,pure:x,areStatesEqual:_,areOwnPropsEqual:O,areStatePropsEqual:E,areMergedPropsEqual:I},P))}}const Jt=H_e();Ube(qv.unstable_batchedUpdates);function uu(t){"@babel/helpers - typeof";return uu=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(e){return typeof e}:function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},uu(t)}function q_e(t,e){if(uu(t)!="object"||!t)return t;var n=t[Symbol.toPrimitive];if(n!==void 0){var r=n.call(t,e||"default");if(uu(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}function sne(t){var e=q_e(t,"string");return uu(e)=="symbol"?e:e+""}function it(t,e,n){return(e=sne(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function bV(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(t,i).enumerable})),n.push.apply(n,r)}return n}function _V(t){for(var e=1;e<arguments.length;e++){var n=arguments[e]!=null?arguments[e]:{};e%2?bV(Object(n),!0).forEach(function(r){it(t,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):bV(Object(n)).forEach(function(r){Object.defineProperty(t,r,Object.getOwnPropertyDescriptor(n,r))})}return t}function na(t){return"Minified Redux error #"+t+"; visit https://redux.js.org/Errors?code="+t+" for the full message or use the non-minified dev environment for full errors. "}var wV=function(){return typeof Symbol=="function"&&Symbol.observable||"@@observable"}(),bA=function(){return Math.random().toString(36).substring(7).split("").join(".")},SV={INIT:"@@redux/INIT"+bA(),REPLACE:"@@redux/REPLACE"+bA(),PROBE_UNKNOWN_ACTION:function(){return"@@redux/PROBE_UNKNOWN_ACTION"+bA()}};function X_e(t){if(typeof t!="object"||t===null)return!1;for(var e=t;Object.getPrototypeOf(e)!==null;)e=Object.getPrototypeOf(e);return Object.getPrototypeOf(t)===e}function lne(t,e,n){var r;if(typeof e=="function"&&typeof n=="function"||typeof n=="function"&&typeof arguments[3]=="function")throw new Error(na(0));if(typeof e=="function"&&typeof n>"u"&&(n=e,e=void 0),typeof n<"u"){if(typeof n!="function")throw new Error(na(1));return n(lne)(t,e)}if(typeof t!="function")throw new Error(na(2));var i=t,o=e,a=[],s=a,l=!1;function c(){s===a&&(s=a.slice())}function u(){if(l)throw new Error(na(3));return o}function f(m){if(typeof m!="function")throw new Error(na(4));if(l)throw new Error(na(5));var g=!0;return c(),s.push(m),function(){if(g){if(l)throw new Error(na(6));g=!1,c();var y=s.indexOf(m);s.splice(y,1),a=null}}}function d(m){if(!X_e(m))throw new Error(na(7));if(typeof m.type>"u")throw new Error(na(8));if(l)throw new Error(na(9));try{l=!0,o=i(o,m)}finally{l=!1}for(var g=a=s,v=0;v<g.length;v++){var y=g[v];y()}return m}function h(m){if(typeof m!="function")throw new Error(na(10));i=m,d({type:SV.REPLACE})}function p(){var m,g=f;return m={subscribe:function(y){if(typeof y!="object"||y===null)throw new Error(na(11));function x(){y.next&&y.next(u())}x();var b=g(x);return{unsubscribe:b}}},m[wV]=function(){return this},m}return d({type:SV.INIT}),r={dispatch:d,subscribe:f,getState:u,replaceReducer:h},r[wV]=p,r}function Q_e(){for(var t=arguments.length,e=new Array(t),n=0;n<t;n++)e[n]=arguments[n];return e.length===0?function(r){return r}:e.length===1?e[0]:e.reduce(function(r,i){return function(){return r(i.apply(void 0,arguments))}})}function Y_e(){for(var t=arguments.length,e=new Array(t),n=0;n<t;n++)e[n]=arguments[n];return function(r){return function(){var i=r.apply(void 0,arguments),o=function(){throw new Error(na(15))},a={getState:i.getState,dispatch:function(){return o.apply(void 0,arguments)}},s=e.map(function(l){return l(a)});return o=Q_e.apply(void 0,s)(i.dispatch),_V(_V({},i),{},{dispatch:o})}}}var ML={exports:{}};(function(t,e){(function(n,r){r(e)})(Zn,function(n){function r(N,D){N.super_=D,N.prototype=Object.create(D.prototype,{constructor:{value:N,enumerable:!1,writable:!0,configurable:!0}})}function i(N,D){Object.defineProperty(this,"kind",{value:N,enumerable:!0}),D&&D.length&&Object.defineProperty(this,"path",{value:D,enumerable:!0})}function o(N,D,A){o.super_.call(this,"E",N),Object.defineProperty(this,"lhs",{value:D,enumerable:!0}),Object.defineProperty(this,"rhs",{value:A,enumerable:!0})}function a(N,D){a.super_.call(this,"N",N),Object.defineProperty(this,"rhs",{value:D,enumerable:!0})}function s(N,D){s.super_.call(this,"D",N),Object.defineProperty(this,"lhs",{value:D,enumerable:!0})}function l(N,D,A){l.super_.call(this,"A",N),Object.defineProperty(this,"index",{value:D,enumerable:!0}),Object.defineProperty(this,"item",{value:A,enumerable:!0})}function c(N,D,A){var q=N.slice(D+1||N.length);return N.length=D<0?N.length+D:D,N.push.apply(N,q),N}function u(N){var D=typeof N>"u"?"undefined":L(N);return D!=="object"?D:N===Math?"math":N===null?"null":Array.isArray(N)?"array":Object.prototype.toString.call(N)==="[object Date]"?"date":typeof N.toString=="function"&&/^\/.*\//.test(N.toString())?"regexp":"object"}function f(N,D,A,q,Y,K,se){Y=Y||[],se=se||[];var te=Y.slice(0);if(typeof K<"u"){if(q){if(typeof q=="function"&&q(te,K))return;if((typeof q>"u"?"undefined":L(q))==="object"){if(q.prefilter&&q.prefilter(te,K))return;if(q.normalize){var J=q.normalize(te,K,N,D);J&&(N=J[0],D=J[1])}}}te.push(K)}u(N)==="regexp"&&u(D)==="regexp"&&(N=N.toString(),D=D.toString());var pe=typeof N>"u"?"undefined":L(N),be=typeof D>"u"?"undefined":L(D),re=pe!=="undefined"||se&&se[se.length-1].lhs&&se[se.length-1].lhs.hasOwnProperty(K),ve=be!=="undefined"||se&&se[se.length-1].rhs&&se[se.length-1].rhs.hasOwnProperty(K);if(!re&&ve)A(new a(te,D));else if(!ve&&re)A(new s(te,N));else if(u(N)!==u(D))A(new o(te,N,D));else if(u(N)==="date"&&N-D!==0)A(new o(te,N,D));else if(pe==="object"&&N!==null&&D!==null)if(se.filter(function(Q){return Q.lhs===N}).length)N!==D&&A(new o(te,N,D));else{if(se.push({lhs:N,rhs:D}),Array.isArray(N)){var F;for(N.length,F=0;F<N.length;F++)F>=D.length?A(new l(te,F,new s(void 0,N[F]))):f(N[F],D[F],A,q,te,F,se);for(;F<D.length;)A(new l(te,F,new a(void 0,D[F++])))}else{var ce=Object.keys(N),le=Object.keys(D);ce.forEach(function(Q,X){var ee=le.indexOf(Q);ee>=0?(f(N[Q],D[Q],A,q,te,Q,se),le=c(le,ee)):f(N[Q],void 0,A,q,te,Q,se)}),le.forEach(function(Q){f(void 0,D[Q],A,q,te,Q,se)})}se.length=se.length-1}else N!==D&&(pe==="number"&&isNaN(N)&&isNaN(D)||A(new o(te,N,D)))}function d(N,D,A,q){return q=q||[],f(N,D,function(Y){Y&&q.push(Y)},A),q.length?q:void 0}function h(N,D,A){if(A.path&&A.path.length){var q,Y=N[D],K=A.path.length-1;for(q=0;q<K;q++)Y=Y[A.path[q]];switch(A.kind){case"A":h(Y[A.path[q]],A.index,A.item);break;case"D":delete Y[A.path[q]];break;case"E":case"N":Y[A.path[q]]=A.rhs}}else switch(A.kind){case"A":h(N[D],A.index,A.item);break;case"D":N=c(N,D);break;case"E":case"N":N[D]=A.rhs}return N}function p(N,D,A){if(N&&D&&A&&A.kind){for(var q=N,Y=-1,K=A.path?A.path.length-1:0;++Y<K;)typeof q[A.path[Y]]>"u"&&(q[A.path[Y]]=typeof A.path[Y]=="number"?[]:{}),q=q[A.path[Y]];switch(A.kind){case"A":h(A.path?q[A.path[Y]]:q,A.index,A.item);break;case"D":delete q[A.path[Y]];break;case"E":case"N":q[A.path[Y]]=A.rhs}}}function m(N,D,A){if(A.path&&A.path.length){var q,Y=N[D],K=A.path.length-1;for(q=0;q<K;q++)Y=Y[A.path[q]];switch(A.kind){case"A":m(Y[A.path[q]],A.index,A.item);break;case"D":Y[A.path[q]]=A.lhs;break;case"E":Y[A.path[q]]=A.lhs;break;case"N":delete Y[A.path[q]]}}else switch(A.kind){case"A":m(N[D],A.index,A.item);break;case"D":N[D]=A.lhs;break;case"E":N[D]=A.lhs;break;case"N":N=c(N,D)}return N}function g(N,D,A){if(N&&D&&A&&A.kind){var q,Y,K=N;for(Y=A.path.length-1,q=0;q<Y;q++)typeof K[A.path[q]]>"u"&&(K[A.path[q]]={}),K=K[A.path[q]];switch(A.kind){case"A":m(K[A.path[q]],A.index,A.item);break;case"D":K[A.path[q]]=A.lhs;break;case"E":K[A.path[q]]=A.lhs;break;case"N":delete K[A.path[q]]}}}function v(N,D,A){if(N&&D){var q=function(Y){A&&!A(N,D,Y)||p(N,D,Y)};f(N,D,q)}}function y(N){return"color: "+U[N].color+"; font-weight: bold"}function x(N){var D=N.kind,A=N.path,q=N.lhs,Y=N.rhs,K=N.index,se=N.item;switch(D){case"E":return[A.join("."),q,"→",Y];case"N":return[A.join("."),Y];case"D":return[A.join(".")];case"A":return[A.join(".")+"["+K+"]",se];default:return[]}}function b(N,D,A,q){var Y=d(N,D);try{q?A.groupCollapsed("diff"):A.group("diff")}catch{A.log("diff")}Y?Y.forEach(function(K){var se=K.kind,te=x(K);A.log.apply(A,["%c "+U[se].text,y(se)].concat(z(te)))}):A.log("—— no diff ——");try{A.groupEnd()}catch{A.log("—— diff end —— ")}}function _(N,D,A,q){switch(typeof N>"u"?"undefined":L(N)){case"object":return typeof N[q]=="function"?N[q].apply(N,z(A)):N[q];case"function":return N(D);default:return N}}function S(N){var D=N.timestamp,A=N.duration;return function(q,Y,K){var se=["action"];return se.push("%c"+String(q.type)),D&&se.push("%c@ "+Y),A&&se.push("%c(in "+K.toFixed(2)+" ms)"),se.join(" ")}}function O(N,D){var A=D.logger,q=D.actionTransformer,Y=D.titleFormatter,K=Y===void 0?S(D):Y,se=D.collapsed,te=D.colors,J=D.level,pe=D.diff,be=typeof D.titleFormatter>"u";N.forEach(function(re,ve){var F=re.started,ce=re.startedTime,le=re.action,Q=re.prevState,X=re.error,ee=re.took,ge=re.nextState,ye=N[ve+1];ye&&(ge=ye.prevState,ee=ye.started-F);var H=q(le),G=typeof se=="function"?se(function(){return ge},le,re):se,ie=R(ce),he=te.title?"color: "+te.title(H)+";":"",_e=["color: gray; font-weight: lighter;"];_e.push(he),D.timestamp&&_e.push("color: gray; font-weight: lighter;"),D.duration&&_e.push("color: gray; font-weight: lighter;");var oe=K(H,ie,ee);try{G?te.title&&be?A.groupCollapsed.apply(A,["%c "+oe].concat(_e)):A.groupCollapsed(oe):te.title&&be?A.group.apply(A,["%c "+oe].concat(_e)):A.group(oe)}catch{A.log(oe)}var Z=_(J,H,[Q],"prevState"),V=_(J,H,[H],"action"),de=_(J,H,[X,Q],"error"),xe=_(J,H,[ge],"nextState");if(Z)if(te.prevState){var Me="color: "+te.prevState(Q)+"; font-weight: bold";A[Z]("%c prev state",Me,Q)}else A[Z]("prev state",Q);if(V)if(te.action){var me="color: "+te.action(H)+"; font-weight: bold";A[V]("%c action    ",me,H)}else A[V]("action    ",H);if(X&&de)if(te.error){var $e="color: "+te.error(X,Q)+"; font-weight: bold;";A[de]("%c error     ",$e,X)}else A[de]("error     ",X);if(xe)if(te.nextState){var Te="color: "+te.nextState(ge)+"; font-weight: bold";A[xe]("%c next state",Te,ge)}else A[xe]("next state",ge);pe&&b(Q,ge,A,G);try{A.groupEnd()}catch{A.log("—— log end ——")}})}function C(){var N=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},D=Object.assign({},W,N),A=D.logger,q=D.stateTransformer,Y=D.errorTransformer,K=D.predicate,se=D.logErrors,te=D.diffPredicate;if(typeof A>"u")return function(){return function(pe){return function(be){return pe(be)}}};if(N.getState&&N.dispatch)return console.error(`[redux-logger] redux-logger not installed. Make sure to pass logger instance as middleware:
// Logger with default options
import { logger } from 'redux-logger'
const store = createStore(
  reducer,
  applyMiddleware(logger)
)
// Or you can create your own logger with custom options http://bit.ly/redux-logger-options
import createLogger from 'redux-logger'
const logger = createLogger({
  // ...options
});
const store = createStore(
  reducer,
  applyMiddleware(logger)
)
`),function(){return function(pe){return function(be){return pe(be)}}};var J=[];return function(pe){var be=pe.getState;return function(re){return function(ve){if(typeof K=="function"&&!K(be,ve))return re(ve);var F={};J.push(F),F.started=T.now(),F.startedTime=new Date,F.prevState=q(be()),F.action=ve;var ce=void 0;if(se)try{ce=re(ve)}catch(Q){F.error=Y(Q)}else ce=re(ve);F.took=T.now()-F.started,F.nextState=q(be());var le=D.diff&&typeof te=="function"?te(be,ve):D.diff;if(O(J,Object.assign({},D,{diff:le})),J.length=0,F.error)throw F.error;return ce}}}}var E,k,I=function(N,D){return new Array(D+1).join(N)},P=function(N,D){return I("0",D-N.toString().length)+N},R=function(N){return P(N.getHours(),2)+":"+P(N.getMinutes(),2)+":"+P(N.getSeconds(),2)+"."+P(N.getMilliseconds(),3)},T=typeof performance<"u"&&performance!==null&&typeof performance.now=="function"?performance:Date,L=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(N){return typeof N}:function(N){return N&&typeof Symbol=="function"&&N.constructor===Symbol&&N!==Symbol.prototype?"symbol":typeof N},z=function(N){if(Array.isArray(N)){for(var D=0,A=Array(N.length);D<N.length;D++)A[D]=N[D];return A}return Array.from(N)},B=[];E=(typeof Zn>"u"?"undefined":L(Zn))==="object"&&Zn?Zn:typeof window<"u"?window:{},k=E.DeepDiff,k&&B.push(function(){typeof k<"u"&&E.DeepDiff===d&&(E.DeepDiff=k,k=void 0)}),r(o,i),r(a,i),r(s,i),r(l,i),Object.defineProperties(d,{diff:{value:d,enumerable:!0},observableDiff:{value:f,enumerable:!0},applyDiff:{value:v,enumerable:!0},applyChange:{value:p,enumerable:!0},revertChange:{value:g,enumerable:!0},isConflict:{value:function(){return typeof k<"u"},enumerable:!0},noConflict:{value:function(){return B&&(B.forEach(function(N){N()}),B=null),d},enumerable:!0}});var U={E:{color:"#2196F3",text:"CHANGED:"},N:{color:"#4CAF50",text:"ADDED:"},D:{color:"#F44336",text:"DELETED:"},A:{color:"#2196F3",text:"ARRAY:"}},W={level:"log",logger:console,logErrors:!0,collapsed:void 0,predicate:void 0,duration:!1,timestamp:!0,stateTransformer:function(N){return N},actionTransformer:function(N){return N},errorTransformer:function(N){return N},colors:{title:function(){return"inherit"},prevState:function(){return"#9E9E9E"},action:function(){return"#03A9F4"},nextState:function(){return"#4CAF50"},error:function(){return"#F20404"}},diff:!1,diffPredicate:void 0,transformer:void 0},$=function(){var N=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},D=N.dispatch,A=N.getState;return typeof D=="function"||typeof A=="function"?C()({dispatch:D,getState:A}):void console.error(`
[redux-logger v3] BREAKING CHANGE
[redux-logger v3] Since 3.0.0 redux-logger exports by default logger with default settings.
[redux-logger v3] Change
[redux-logger v3] import createLogger from 'redux-logger'
[redux-logger v3] to
[redux-logger v3] import { createLogger } from 'redux-logger'
`)};n.defaults=W,n.createLogger=C,n.logger=$,n.default=$,Object.defineProperty(n,"__esModule",{value:!0})})})(ML,ML.exports);var K_e=ML.exports;function cne(t){var e=function(r){var i=r.dispatch,o=r.getState;return function(a){return function(s){return typeof s=="function"?s(i,o,t):a(s)}}};return e}var une=cne();une.withExtraArgument=cne;const Eb={black:"#000",white:"#fff"},tf={50:"#ffebee",100:"#ffcdd2",200:"#ef9a9a",300:"#e57373",400:"#ef5350",500:"#f44336",600:"#e53935",700:"#d32f2f",800:"#c62828",900:"#b71c1c",A100:"#ff8a80",A200:"#ff5252",A400:"#ff1744",A700:"#d50000"},fne={50:"#fce4ec",100:"#f8bbd0",200:"#f48fb1",300:"#f06292",400:"#ec407a",500:"#e91e63",600:"#d81b60",700:"#c2185b",800:"#ad1457",900:"#880e4f",A100:"#ff80ab",A200:"#ff4081",A400:"#f50057",A700:"#c51162"},nf={50:"#f3e5f5",100:"#e1bee7",200:"#ce93d8",300:"#ba68c8",400:"#ab47bc",500:"#9c27b0",600:"#8e24aa",700:"#7b1fa2",800:"#6a1b9a",900:"#4a148c",A100:"#ea80fc",A200:"#e040fb",A400:"#d500f9",A700:"#aa00ff"},Z_e={50:"#ede7f6",100:"#d1c4e9",200:"#b39ddb",300:"#9575cd",400:"#7e57c2",500:"#673ab7",600:"#5e35b1",700:"#512da8",800:"#4527a0",900:"#311b92",A100:"#b388ff",A200:"#7c4dff",A400:"#651fff",A700:"#6200ea"},dne={50:"#e8eaf6",100:"#c5cae9",200:"#9fa8da",300:"#7986cb",400:"#5c6bc0",500:"#3f51b5",600:"#3949ab",700:"#303f9f",800:"#283593",900:"#1a237e",A100:"#8c9eff",A200:"#536dfe",A400:"#3d5afe",A700:"#304ffe"},rf={50:"#e3f2fd",100:"#bbdefb",200:"#90caf9",300:"#64b5f6",400:"#42a5f5",500:"#2196f3",600:"#1e88e5",700:"#1976d2",800:"#1565c0",900:"#0d47a1",A100:"#82b1ff",A200:"#448aff",A400:"#2979ff",A700:"#2962ff"},of={50:"#e1f5fe",100:"#b3e5fc",200:"#81d4fa",300:"#4fc3f7",400:"#29b6f6",500:"#03a9f4",600:"#039be5",700:"#0288d1",800:"#0277bd",900:"#01579b",A100:"#80d8ff",A200:"#40c4ff",A400:"#00b0ff",A700:"#0091ea"},hne={50:"#e0f7fa",100:"#b2ebf2",200:"#80deea",300:"#4dd0e1",400:"#26c6da",500:"#00bcd4",600:"#00acc1",700:"#0097a7",800:"#00838f",900:"#006064",A100:"#84ffff",A200:"#18ffff",A400:"#00e5ff",A700:"#00b8d4"},pne={50:"#e0f2f1",100:"#b2dfdb",200:"#80cbc4",300:"#4db6ac",400:"#26a69a",500:"#009688",600:"#00897b",700:"#00796b",800:"#00695c",900:"#004d40",A100:"#a7ffeb",A200:"#64ffda",A400:"#1de9b6",A700:"#00bfa5"},Lc={50:"#e8f5e9",100:"#c8e6c9",200:"#a5d6a7",300:"#81c784",400:"#66bb6a",500:"#4caf50",600:"#43a047",700:"#388e3c",800:"#2e7d32",900:"#1b5e20",A100:"#b9f6ca",A200:"#69f0ae",A400:"#00e676",A700:"#00c853"},J_e={50:"#f1f8e9",100:"#dcedc8",200:"#c5e1a5",300:"#aed581",400:"#9ccc65",500:"#8bc34a",600:"#7cb342",700:"#689f38",800:"#558b2f",900:"#33691e",A100:"#ccff90",A200:"#b2ff59",A400:"#76ff03",A700:"#64dd17"},mne={50:"#f9fbe7",100:"#f0f4c3",200:"#e6ee9c",300:"#dce775",400:"#d4e157",500:"#cddc39",600:"#c0ca33",700:"#afb42b",800:"#9e9d24",900:"#827717",A100:"#f4ff81",A200:"#eeff41",A400:"#c6ff00",A700:"#aeea00"},gne={50:"#fffde7",100:"#fff9c4",200:"#fff59d",300:"#fff176",400:"#ffee58",500:"#ffeb3b",600:"#fdd835",700:"#fbc02d",800:"#f9a825",900:"#f57f17",A100:"#ffff8d",A200:"#ffff00",A400:"#ffea00",A700:"#ffd600"},vne={50:"#fff8e1",100:"#ffecb3",200:"#ffe082",300:"#ffd54f",400:"#ffca28",500:"#ffc107",600:"#ffb300",700:"#ffa000",800:"#ff8f00",900:"#ff6f00",A100:"#ffe57f",A200:"#ffd740",A400:"#ffc400",A700:"#ffab00"},oh={50:"#fff3e0",100:"#ffe0b2",200:"#ffcc80",300:"#ffb74d",400:"#ffa726",500:"#ff9800",600:"#fb8c00",700:"#f57c00",800:"#ef6c00",900:"#e65100",A100:"#ffd180",A200:"#ffab40",A400:"#ff9100",A700:"#ff6d00"},Dh={50:"#fbe9e7",100:"#ffccbc",200:"#ffab91",300:"#ff8a65",400:"#ff7043",500:"#ff5722",600:"#f4511e",700:"#e64a19",800:"#d84315",900:"#bf360c",A100:"#ff9e80",A200:"#ff6e40",A400:"#ff3d00",A700:"#dd2c00"},yne={50:"#efebe9",100:"#d7ccc8",200:"#bcaaa4",300:"#a1887f",400:"#8d6e63",500:"#795548",600:"#6d4c41",700:"#5d4037",800:"#4e342e",900:"#3e2723",A100:"#d7ccc8",A200:"#bcaaa4",A400:"#8d6e63",A700:"#5d4037"},xne={50:"#fafafa",100:"#f5f5f5",200:"#eeeeee",300:"#e0e0e0",400:"#bdbdbd",500:"#9e9e9e",600:"#757575",700:"#616161",800:"#424242",900:"#212121",A100:"#f5f5f5",A200:"#eeeeee",A400:"#bdbdbd",A700:"#616161"},e1e={50:"#eceff1",100:"#cfd8dc",200:"#b0bec5",300:"#90a4ae",400:"#78909c",500:"#607d8b",600:"#546e7a",700:"#455a64",800:"#37474f",900:"#263238",A100:"#cfd8dc",A200:"#b0bec5",A400:"#78909c",A700:"#455a64"};function fu(t){let e="https://mui.com/production-error/?code="+t;for(let n=1;n<arguments.length;n+=1)e+="&args[]="+encodeURIComponent(arguments[n]);return"Minified MUI error #"+t+"; visit "+e+" for the full message."}const t1e=Object.freeze(Object.defineProperty({__proto__:null,default:fu},Symbol.toStringTag,{value:"Module"})),Kh="$$material";function bne(t){var e=Object.create(null);return function(n){return e[n]===void 0&&(e[n]=t(n)),e[n]}}var n1e=/^((children|dangerouslySetInnerHTML|key|ref|autoFocus|defaultValue|defaultChecked|innerHTML|suppressContentEditableWarning|suppressHydrationWarning|valueLink|abbr|accept|acceptCharset|accessKey|action|allow|allowUserMedia|allowPaymentRequest|allowFullScreen|allowTransparency|alt|async|autoComplete|autoPlay|capture|cellPadding|cellSpacing|challenge|charSet|checked|cite|classID|className|cols|colSpan|content|contentEditable|contextMenu|controls|controlsList|coords|crossOrigin|data|dateTime|decoding|default|defer|dir|disabled|disablePictureInPicture|disableRemotePlayback|download|draggable|encType|enterKeyHint|form|formAction|formEncType|formMethod|formNoValidate|formTarget|frameBorder|headers|height|hidden|high|href|hrefLang|htmlFor|httpEquiv|id|inputMode|integrity|is|keyParams|keyType|kind|label|lang|list|loading|loop|low|marginHeight|marginWidth|max|maxLength|media|mediaGroup|method|min|minLength|multiple|muted|name|nonce|noValidate|open|optimum|pattern|placeholder|playsInline|poster|preload|profile|radioGroup|readOnly|referrerPolicy|rel|required|reversed|role|rows|rowSpan|sandbox|scope|scoped|scrolling|seamless|selected|shape|size|sizes|slot|span|spellCheck|src|srcDoc|srcLang|srcSet|start|step|style|summary|tabIndex|target|title|translate|type|useMap|value|width|wmode|wrap|about|datatype|inlist|prefix|property|resource|typeof|vocab|autoCapitalize|autoCorrect|autoSave|color|incremental|fallback|inert|itemProp|itemScope|itemType|itemID|itemRef|on|option|results|security|unselectable|accentHeight|accumulate|additive|alignmentBaseline|allowReorder|alphabetic|amplitude|arabicForm|ascent|attributeName|attributeType|autoReverse|azimuth|baseFrequency|baselineShift|baseProfile|bbox|begin|bias|by|calcMode|capHeight|clip|clipPathUnits|clipPath|clipRule|colorInterpolation|colorInterpolationFilters|colorProfile|colorRendering|contentScriptType|contentStyleType|cursor|cx|cy|d|decelerate|descent|diffuseConstant|direction|display|divisor|dominantBaseline|dur|dx|dy|edgeMode|elevation|enableBackground|end|exponent|externalResourcesRequired|fill|fillOpacity|fillRule|filter|filterRes|filterUnits|floodColor|floodOpacity|focusable|fontFamily|fontSize|fontSizeAdjust|fontStretch|fontStyle|fontVariant|fontWeight|format|from|fr|fx|fy|g1|g2|glyphName|glyphOrientationHorizontal|glyphOrientationVertical|glyphRef|gradientTransform|gradientUnits|hanging|horizAdvX|horizOriginX|ideographic|imageRendering|in|in2|intercept|k|k1|k2|k3|k4|kernelMatrix|kernelUnitLength|kerning|keyPoints|keySplines|keyTimes|lengthAdjust|letterSpacing|lightingColor|limitingConeAngle|local|markerEnd|markerMid|markerStart|markerHeight|markerUnits|markerWidth|mask|maskContentUnits|maskUnits|mathematical|mode|numOctaves|offset|opacity|operator|order|orient|orientation|origin|overflow|overlinePosition|overlineThickness|panose1|paintOrder|pathLength|patternContentUnits|patternTransform|patternUnits|pointerEvents|points|pointsAtX|pointsAtY|pointsAtZ|preserveAlpha|preserveAspectRatio|primitiveUnits|r|radius|refX|refY|renderingIntent|repeatCount|repeatDur|requiredExtensions|requiredFeatures|restart|result|rotate|rx|ry|scale|seed|shapeRendering|slope|spacing|specularConstant|specularExponent|speed|spreadMethod|startOffset|stdDeviation|stemh|stemv|stitchTiles|stopColor|stopOpacity|strikethroughPosition|strikethroughThickness|string|stroke|strokeDasharray|strokeDashoffset|strokeLinecap|strokeLinejoin|strokeMiterlimit|strokeOpacity|strokeWidth|surfaceScale|systemLanguage|tableValues|targetX|targetY|textAnchor|textDecoration|textRendering|textLength|to|transform|u1|u2|underlinePosition|underlineThickness|unicode|unicodeBidi|unicodeRange|unitsPerEm|vAlphabetic|vHanging|vIdeographic|vMathematical|values|vectorEffect|version|vertAdvY|vertOriginX|vertOriginY|viewBox|viewTarget|visibility|widths|wordSpacing|writingMode|x|xHeight|x1|x2|xChannelSelector|xlinkActuate|xlinkArcrole|xlinkHref|xlinkRole|xlinkShow|xlinkTitle|xlinkType|xmlBase|xmlns|xmlnsXlink|xmlLang|xmlSpace|y|y1|y2|yChannelSelector|z|zoomAndPan|for|class|autofocus)|(([Dd][Aa][Tt][Aa]|[Aa][Rr][Ii][Aa]|x)-.*))$/,r1e=bne(function(t){return n1e.test(t)||t.charCodeAt(0)===111&&t.charCodeAt(1)===110&&t.charCodeAt(2)<91}),i1e=!1;function o1e(t){if(t.sheet)return t.sheet;for(var e=0;e<document.styleSheets.length;e++)if(document.styleSheets[e].ownerNode===t)return document.styleSheets[e]}function a1e(t){var e=document.createElement("style");return e.setAttribute("data-emotion",t.key),t.nonce!==void 0&&e.setAttribute("nonce",t.nonce),e.appendChild(document.createTextNode("")),e.setAttribute("data-s",""),e}var s1e=function(){function t(n){var r=this;this._insertTag=function(i){var o;r.tags.length===0?r.insertionPoint?o=r.insertionPoint.nextSibling:r.prepend?o=r.container.firstChild:o=r.before:o=r.tags[r.tags.length-1].nextSibling,r.container.insertBefore(i,o),r.tags.push(i)},this.isSpeedy=n.speedy===void 0?!i1e:n.speedy,this.tags=[],this.ctr=0,this.nonce=n.nonce,this.key=n.key,this.container=n.container,this.prepend=n.prepend,this.insertionPoint=n.insertionPoint,this.before=null}var e=t.prototype;return e.hydrate=function(r){r.forEach(this._insertTag)},e.insert=function(r){this.ctr%(this.isSpeedy?65e3:1)===0&&this._insertTag(a1e(this));var i=this.tags[this.tags.length-1];if(this.isSpeedy){var o=o1e(i);try{o.insertRule(r,o.cssRules.length)}catch{}}else i.appendChild(document.createTextNode(r));this.ctr++},e.flush=function(){this.tags.forEach(function(r){var i;return(i=r.parentNode)==null?void 0:i.removeChild(r)}),this.tags=[],this.ctr=0},t}(),Bi="-ms-",wT="-moz-",pn="-webkit-",_ne="comm",jj="rule",Bj="decl",l1e="@import",wne="@keyframes",c1e="@layer",u1e=Math.abs,fM=String.fromCharCode,f1e=Object.assign;function d1e(t,e){return Si(t,0)^45?(((e<<2^Si(t,0))<<2^Si(t,1))<<2^Si(t,2))<<2^Si(t,3):0}function Sne(t){return t.trim()}function h1e(t,e){return(t=e.exec(t))?t[0]:t}function gn(t,e,n){return t.replace(e,n)}function kL(t,e){return t.indexOf(e)}function Si(t,e){return t.charCodeAt(e)|0}function Pb(t,e,n){return t.slice(e,n)}function xl(t){return t.length}function zj(t){return t.length}function eS(t,e){return e.push(t),t}function p1e(t,e){return t.map(e).join("")}var dM=1,qg=1,One=0,Uo=0,Fr=0,Xv="";function hM(t,e,n,r,i,o,a){return{value:t,root:e,parent:n,type:r,props:i,children:o,line:dM,column:qg,length:a,return:""}}function f0(t,e){return f1e(hM("",null,null,"",null,null,0),t,{length:-t.length},e)}function m1e(){return Fr}function g1e(){return Fr=Uo>0?Si(Xv,--Uo):0,qg--,Fr===10&&(qg=1,dM--),Fr}function xa(){return Fr=Uo<One?Si(Xv,Uo++):0,qg++,Fr===10&&(qg=1,dM++),Fr}function Wl(){return Si(Xv,Uo)}function wC(){return Uo}function O1(t,e){return Pb(Xv,t,e)}function Mb(t){switch(t){case 0:case 9:case 10:case 13:case 32:return 5;case 33:case 43:case 44:case 47:case 62:case 64:case 126:case 59:case 123:case 125:return 4;case 58:return 3;case 34:case 39:case 40:case 91:return 2;case 41:case 93:return 1}return 0}function Cne(t){return dM=qg=1,One=xl(Xv=t),Uo=0,[]}function Tne(t){return Xv="",t}function SC(t){return Sne(O1(Uo-1,AL(t===91?t+2:t===40?t+1:t)))}function v1e(t){for(;(Fr=Wl())&&Fr<33;)xa();return Mb(t)>2||Mb(Fr)>3?"":" "}function y1e(t,e){for(;--e&&xa()&&!(Fr<48||Fr>102||Fr>57&&Fr<65||Fr>70&&Fr<97););return O1(t,wC()+(e<6&&Wl()==32&&xa()==32))}function AL(t){for(;xa();)switch(Fr){case t:return Uo;case 34:case 39:t!==34&&t!==39&&AL(Fr);break;case 40:t===41&&AL(t);break;case 92:xa();break}return Uo}function x1e(t,e){for(;xa()&&t+Fr!==57;)if(t+Fr===84&&Wl()===47)break;return"/*"+O1(e,Uo-1)+"*"+fM(t===47?t:xa())}function b1e(t){for(;!Mb(Wl());)xa();return O1(t,Uo)}function _1e(t){return Tne(OC("",null,null,null,[""],t=Cne(t),0,[0],t))}function OC(t,e,n,r,i,o,a,s,l){for(var c=0,u=0,f=a,d=0,h=0,p=0,m=1,g=1,v=1,y=0,x="",b=i,_=o,S=r,O=x;g;)switch(p=y,y=xa()){case 40:if(p!=108&&Si(O,f-1)==58){kL(O+=gn(SC(y),"&","&\f"),"&\f")!=-1&&(v=-1);break}case 34:case 39:case 91:O+=SC(y);break;case 9:case 10:case 13:case 32:O+=v1e(p);break;case 92:O+=y1e(wC()-1,7);continue;case 47:switch(Wl()){case 42:case 47:eS(w1e(x1e(xa(),wC()),e,n),l);break;default:O+="/"}break;case 123*m:s[c++]=xl(O)*v;case 125*m:case 59:case 0:switch(y){case 0:case 125:g=0;case 59+u:v==-1&&(O=gn(O,/\f/g,"")),h>0&&xl(O)-f&&eS(h>32?CV(O+";",r,n,f-1):CV(gn(O," ","")+";",r,n,f-2),l);break;case 59:O+=";";default:if(eS(S=OV(O,e,n,c,u,i,s,x,b=[],_=[],f),o),y===123)if(u===0)OC(O,e,S,S,b,o,f,s,_);else switch(d===99&&Si(O,3)===110?100:d){case 100:case 108:case 109:case 115:OC(t,S,S,r&&eS(OV(t,S,S,0,0,i,s,x,i,b=[],f),_),i,_,f,s,r?b:_);break;default:OC(O,S,S,S,[""],_,0,s,_)}}c=u=h=0,m=v=1,x=O="",f=a;break;case 58:f=1+xl(O),h=p;default:if(m<1){if(y==123)--m;else if(y==125&&m++==0&&g1e()==125)continue}switch(O+=fM(y),y*m){case 38:v=u>0?1:(O+="\f",-1);break;case 44:s[c++]=(xl(O)-1)*v,v=1;break;case 64:Wl()===45&&(O+=SC(xa())),d=Wl(),u=f=xl(x=O+=b1e(wC())),y++;break;case 45:p===45&&xl(O)==2&&(m=0)}}return o}function OV(t,e,n,r,i,o,a,s,l,c,u){for(var f=i-1,d=i===0?o:[""],h=zj(d),p=0,m=0,g=0;p<r;++p)for(var v=0,y=Pb(t,f+1,f=u1e(m=a[p])),x=t;v<h;++v)(x=Sne(m>0?d[v]+" "+y:gn(y,/&\f/g,d[v])))&&(l[g++]=x);return hM(t,e,n,i===0?jj:s,l,c,u)}function w1e(t,e,n){return hM(t,e,n,_ne,fM(m1e()),Pb(t,2,-2),0)}function CV(t,e,n,r){return hM(t,e,n,Bj,Pb(t,0,r),Pb(t,r+1,-1),r)}function wg(t,e){for(var n="",r=zj(t),i=0;i<r;i++)n+=e(t[i],i,t,e)||"";return n}function S1e(t,e,n,r){switch(t.type){case c1e:if(t.children.length)break;case l1e:case Bj:return t.return=t.return||t.value;case _ne:return"";case wne:return t.return=t.value+"{"+wg(t.children,r)+"}";case jj:t.value=t.props.join(",")}return xl(n=wg(t.children,r))?t.return=t.value+"{"+n+"}":""}function O1e(t){var e=zj(t);return function(n,r,i,o){for(var a="",s=0;s<e;s++)a+=t[s](n,r,i,o)||"";return a}}function C1e(t){return function(e){e.root||(e=e.return)&&t(e)}}var T1e=function(e,n,r){for(var i=0,o=0;i=o,o=Wl(),i===38&&o===12&&(n[r]=1),!Mb(o);)xa();return O1(e,Uo)},E1e=function(e,n){var r=-1,i=44;do switch(Mb(i)){case 0:i===38&&Wl()===12&&(n[r]=1),e[r]+=T1e(Uo-1,n,r);break;case 2:e[r]+=SC(i);break;case 4:if(i===44){e[++r]=Wl()===58?"&\f":"",n[r]=e[r].length;break}default:e[r]+=fM(i)}while(i=xa());return e},P1e=function(e,n){return Tne(E1e(Cne(e),n))},TV=new WeakMap,M1e=function(e){if(!(e.type!=="rule"||!e.parent||e.length<1)){for(var n=e.value,r=e.parent,i=e.column===r.column&&e.line===r.line;r.type!=="rule";)if(r=r.parent,!r)return;if(!(e.props.length===1&&n.charCodeAt(0)!==58&&!TV.get(r))&&!i){TV.set(e,!0);for(var o=[],a=P1e(n,o),s=r.props,l=0,c=0;l<a.length;l++)for(var u=0;u<s.length;u++,c++)e.props[c]=o[l]?a[l].replace(/&\f/g,s[u]):s[u]+" "+a[l]}}},k1e=function(e){if(e.type==="decl"){var n=e.value;n.charCodeAt(0)===108&&n.charCodeAt(2)===98&&(e.return="",e.value="")}};function Ene(t,e){switch(d1e(t,e)){case 5103:return pn+"print-"+t+t;case 5737:case 4201:case 3177:case 3433:case 1641:case 4457:case 2921:case 5572:case 6356:case 5844:case 3191:case 6645:case 3005:case 6391:case 5879:case 5623:case 6135:case 4599:case 4855:case 4215:case 6389:case 5109:case 5365:case 5621:case 3829:return pn+t+t;case 5349:case 4246:case 4810:case 6968:case 2756:return pn+t+wT+t+Bi+t+t;case 6828:case 4268:return pn+t+Bi+t+t;case 6165:return pn+t+Bi+"flex-"+t+t;case 5187:return pn+t+gn(t,/(\w+).+(:[^]+)/,pn+"box-$1$2"+Bi+"flex-$1$2")+t;case 5443:return pn+t+Bi+"flex-item-"+gn(t,/flex-|-self/,"")+t;case 4675:return pn+t+Bi+"flex-line-pack"+gn(t,/align-content|flex-|-self/,"")+t;case 5548:return pn+t+Bi+gn(t,"shrink","negative")+t;case 5292:return pn+t+Bi+gn(t,"basis","preferred-size")+t;case 6060:return pn+"box-"+gn(t,"-grow","")+pn+t+Bi+gn(t,"grow","positive")+t;case 4554:return pn+gn(t,/([^-])(transform)/g,"$1"+pn+"$2")+t;case 6187:return gn(gn(gn(t,/(zoom-|grab)/,pn+"$1"),/(image-set)/,pn+"$1"),t,"")+t;case 5495:case 3959:return gn(t,/(image-set\([^]*)/,pn+"$1$`$1");case 4968:return gn(gn(t,/(.+:)(flex-)?(.*)/,pn+"box-pack:$3"+Bi+"flex-pack:$3"),/s.+-b[^;]+/,"justify")+pn+t+t;case 4095:case 3583:case 4068:case 2532:return gn(t,/(.+)-inline(.+)/,pn+"$1$2")+t;case 8116:case 7059:case 5753:case 5535:case 5445:case 5701:case 4933:case 4677:case 5533:case 5789:case 5021:case 4765:if(xl(t)-1-e>6)switch(Si(t,e+1)){case 109:if(Si(t,e+4)!==45)break;case 102:return gn(t,/(.+:)(.+)-([^]+)/,"$1"+pn+"$2-$3$1"+wT+(Si(t,e+3)==108?"$3":"$2-$3"))+t;case 115:return~kL(t,"stretch")?Ene(gn(t,"stretch","fill-available"),e)+t:t}break;case 4949:if(Si(t,e+1)!==115)break;case 6444:switch(Si(t,xl(t)-3-(~kL(t,"!important")&&10))){case 107:return gn(t,":",":"+pn)+t;case 101:return gn(t,/(.+:)([^;!]+)(;|!.+)?/,"$1"+pn+(Si(t,14)===45?"inline-":"")+"box$3$1"+pn+"$2$3$1"+Bi+"$2box$3")+t}break;case 5936:switch(Si(t,e+11)){case 114:return pn+t+Bi+gn(t,/[svh]\w+-[tblr]{2}/,"tb")+t;case 108:return pn+t+Bi+gn(t,/[svh]\w+-[tblr]{2}/,"tb-rl")+t;case 45:return pn+t+Bi+gn(t,/[svh]\w+-[tblr]{2}/,"lr")+t}return pn+t+Bi+t+t}return t}var A1e=function(e,n,r,i){if(e.length>-1&&!e.return)switch(e.type){case Bj:e.return=Ene(e.value,e.length);break;case wne:return wg([f0(e,{value:gn(e.value,"@","@"+pn)})],i);case jj:if(e.length)return p1e(e.props,function(o){switch(h1e(o,/(::plac\w+|:read-\w+)/)){case":read-only":case":read-write":return wg([f0(e,{props:[gn(o,/:(read-\w+)/,":"+wT+"$1")]})],i);case"::placeholder":return wg([f0(e,{props:[gn(o,/:(plac\w+)/,":"+pn+"input-$1")]}),f0(e,{props:[gn(o,/:(plac\w+)/,":"+wT+"$1")]}),f0(e,{props:[gn(o,/:(plac\w+)/,Bi+"input-$1")]})],i)}return""})}},R1e=[A1e],Pne=function(e){var n=e.key;if(n==="css"){var r=document.querySelectorAll("style[data-emotion]:not([data-s])");Array.prototype.forEach.call(r,function(m){var g=m.getAttribute("data-emotion");g.indexOf(" ")!==-1&&(document.head.appendChild(m),m.setAttribute("data-s",""))})}var i=e.stylisPlugins||R1e,o={},a,s=[];a=e.container||document.head,Array.prototype.forEach.call(document.querySelectorAll('style[data-emotion^="'+n+' "]'),function(m){for(var g=m.getAttribute("data-emotion").split(" "),v=1;v<g.length;v++)o[g[v]]=!0;s.push(m)});var l,c=[M1e,k1e];{var u,f=[S1e,C1e(function(m){u.insert(m)})],d=O1e(c.concat(i,f)),h=function(g){return wg(_1e(g),d)};l=function(g,v,y,x){u=y,h(g?g+"{"+v.styles+"}":v.styles),x&&(p.inserted[v.name]=!0)}}var p={key:n,sheet:new s1e({key:n,container:a,nonce:e.nonce,speedy:e.speedy,prepend:e.prepend,insertionPoint:e.insertionPoint}),nonce:e.nonce,inserted:o,registered:{},insert:l};return p.sheet.hydrate(s),p},I1e=!0;function D1e(t,e,n){var r="";return n.split(" ").forEach(function(i){t[i]!==void 0?e.push(t[i]+";"):r+=i+" "}),r}var Mne=function(e,n,r){var i=e.key+"-"+n.name;(r===!1||I1e===!1)&&e.registered[i]===void 0&&(e.registered[i]=n.styles)},kne=function(e,n,r){Mne(e,n,r);var i=e.key+"-"+n.name;if(e.inserted[n.name]===void 0){var o=n;do e.insert(n===o?"."+i:"",o,e.sheet,!0),o=o.next;while(o!==void 0)}};function L1e(t){for(var e=0,n,r=0,i=t.length;i>=4;++r,i-=4)n=t.charCodeAt(r)&255|(t.charCodeAt(++r)&255)<<8|(t.charCodeAt(++r)&255)<<16|(t.charCodeAt(++r)&255)<<24,n=(n&65535)*1540483477+((n>>>16)*59797<<16),n^=n>>>24,e=(n&65535)*1540483477+((n>>>16)*59797<<16)^(e&65535)*1540483477+((e>>>16)*59797<<16);switch(i){case 3:e^=(t.charCodeAt(r+2)&255)<<16;case 2:e^=(t.charCodeAt(r+1)&255)<<8;case 1:e^=t.charCodeAt(r)&255,e=(e&65535)*1540483477+((e>>>16)*59797<<16)}return e^=e>>>13,e=(e&65535)*1540483477+((e>>>16)*59797<<16),((e^e>>>15)>>>0).toString(36)}var N1e={animationIterationCount:1,aspectRatio:1,borderImageOutset:1,borderImageSlice:1,borderImageWidth:1,boxFlex:1,boxFlexGroup:1,boxOrdinalGroup:1,columnCount:1,columns:1,flex:1,flexGrow:1,flexPositive:1,flexShrink:1,flexNegative:1,flexOrder:1,gridRow:1,gridRowEnd:1,gridRowSpan:1,gridRowStart:1,gridColumn:1,gridColumnEnd:1,gridColumnSpan:1,gridColumnStart:1,msGridRow:1,msGridRowSpan:1,msGridColumn:1,msGridColumnSpan:1,fontWeight:1,lineHeight:1,opacity:1,order:1,orphans:1,scale:1,tabSize:1,widows:1,zIndex:1,zoom:1,WebkitLineClamp:1,fillOpacity:1,floodOpacity:1,stopOpacity:1,strokeDasharray:1,strokeDashoffset:1,strokeMiterlimit:1,strokeOpacity:1,strokeWidth:1},$1e=!1,F1e=/[A-Z]|^ms/g,j1e=/_EMO_([^_]+?)_([^]*?)_EMO_/g,Ane=function(e){return e.charCodeAt(1)===45},EV=function(e){return e!=null&&typeof e!="boolean"},_A=bne(function(t){return Ane(t)?t:t.replace(F1e,"-$&").toLowerCase()}),PV=function(e,n){switch(e){case"animation":case"animationName":if(typeof n=="string")return n.replace(j1e,function(r,i,o){return bl={name:i,styles:o,next:bl},i})}return N1e[e]!==1&&!Ane(e)&&typeof n=="number"&&n!==0?n+"px":n},B1e="Component selectors can only be used in conjunction with @emotion/babel-plugin, the swc Emotion plugin, or another Emotion-aware compiler transform.";function kb(t,e,n){if(n==null)return"";var r=n;if(r.__emotion_styles!==void 0)return r;switch(typeof n){case"boolean":return"";case"object":{var i=n;if(i.anim===1)return bl={name:i.name,styles:i.styles,next:bl},i.name;var o=n;if(o.styles!==void 0){var a=o.next;if(a!==void 0)for(;a!==void 0;)bl={name:a.name,styles:a.styles,next:bl},a=a.next;var s=o.styles+";";return s}return z1e(t,e,n)}case"function":{if(t!==void 0){var l=bl,c=n(t);return bl=l,kb(t,e,c)}break}}var u=n;if(e==null)return u;var f=e[u];return f!==void 0?f:u}function z1e(t,e,n){var r="";if(Array.isArray(n))for(var i=0;i<n.length;i++)r+=kb(t,e,n[i])+";";else for(var o in n){var a=n[o];if(typeof a!="object"){var s=a;e!=null&&e[s]!==void 0?r+=o+"{"+e[s]+"}":EV(s)&&(r+=_A(o)+":"+PV(o,s)+";")}else{if(o==="NO_COMPONENT_SELECTOR"&&$1e)throw new Error(B1e);if(Array.isArray(a)&&typeof a[0]=="string"&&(e==null||e[a[0]]===void 0))for(var l=0;l<a.length;l++)EV(a[l])&&(r+=_A(o)+":"+PV(o,a[l])+";");else{var c=kb(t,e,a);switch(o){case"animation":case"animationName":{r+=_A(o)+":"+c+";";break}default:r+=o+"{"+c+"}"}}}}return r}var MV=/label:\s*([^\s;\n{]+)\s*(;|$)/g,bl;function Uj(t,e,n){if(t.length===1&&typeof t[0]=="object"&&t[0]!==null&&t[0].styles!==void 0)return t[0];var r=!0,i="";bl=void 0;var o=t[0];if(o==null||o.raw===void 0)r=!1,i+=kb(n,e,o);else{var a=o;i+=a[0]}for(var s=1;s<t.length;s++)if(i+=kb(n,e,t[s]),r){var l=o;i+=l[s]}MV.lastIndex=0;for(var c="",u;(u=MV.exec(i))!==null;)c+="-"+u[1];var f=L1e(i)+c;return{name:f,styles:i,next:bl}}var U1e=function(e){return e()},Rne=zD.useInsertionEffect?zD.useInsertionEffect:!1,W1e=Rne||U1e,kV=Rne||M.useLayoutEffect,Ine=M.createContext(typeof HTMLElement<"u"?Pne({key:"css"}):null),V1e=Ine.Provider,Dne=function(e){return M.forwardRef(function(n,r){var i=M.useContext(Ine);return e(n,i,r)})},C1=M.createContext({}),G1e=Dne(function(t,e){var n=t.styles,r=Uj([n],void 0,M.useContext(C1)),i=M.useRef();return kV(function(){var o=e.key+"-global",a=new e.sheet.constructor({key:o,nonce:e.sheet.nonce,container:e.sheet.container,speedy:e.sheet.isSpeedy}),s=!1,l=document.querySelector('style[data-emotion="'+o+" "+r.name+'"]');return e.sheet.tags.length&&(a.before=e.sheet.tags[0]),l!==null&&(s=!0,l.setAttribute("data-emotion",o),a.hydrate([l])),i.current=[a,s],function(){a.flush()}},[e]),kV(function(){var o=i.current,a=o[0],s=o[1];if(s){o[1]=!1;return}if(r.next!==void 0&&kne(e,r.next,!0),a.tags.length){var l=a.tags[a.tags.length-1].nextElementSibling;a.before=l,a.flush()}e.insert("",r,a,!1)},[e,r.name]),null});function pM(){for(var t=arguments.length,e=new Array(t),n=0;n<t;n++)e[n]=arguments[n];return Uj(e)}var Qv=function(){var e=pM.apply(void 0,arguments),n="animation-"+e.name;return{name:n,styles:"@keyframes "+n+"{"+e.styles+"}",anim:1,toString:function(){return"_EMO_"+this.name+"_"+this.styles+"_EMO_"}}},H1e=r1e,q1e=function(e){return e!=="theme"},AV=function(e){return typeof e=="string"&&e.charCodeAt(0)>96?H1e:q1e},RV=function(e,n,r){var i;if(n){var o=n.shouldForwardProp;i=e.__emotion_forwardProp&&o?function(a){return e.__emotion_forwardProp(a)&&o(a)}:o}return typeof i!="function"&&r&&(i=e.__emotion_forwardProp),i},X1e=!1,Q1e=function(e){var n=e.cache,r=e.serialized,i=e.isStringTag;return Mne(n,r,i),W1e(function(){return kne(n,r,i)}),null},Y1e=function t(e,n){var r=e.__emotion_real===e,i=r&&e.__emotion_base||e,o,a;n!==void 0&&(o=n.label,a=n.target);var s=RV(e,n,r),l=s||AV(i),c=!l("as");return function(){var u=arguments,f=r&&e.__emotion_styles!==void 0?e.__emotion_styles.slice(0):[];if(o!==void 0&&f.push("label:"+o+";"),u[0]==null||u[0].raw===void 0)f.push.apply(f,u);else{f.push(u[0][0]);for(var d=u.length,h=1;h<d;h++)f.push(u[h],u[0][h])}var p=Dne(function(m,g,v){var y=c&&m.as||i,x="",b=[],_=m;if(m.theme==null){_={};for(var S in m)_[S]=m[S];_.theme=M.useContext(C1)}typeof m.className=="string"?x=D1e(g.registered,b,m.className):m.className!=null&&(x=m.className+" ");var O=Uj(f.concat(b),g.registered,_);x+=g.key+"-"+O.name,a!==void 0&&(x+=" "+a);var C=c&&s===void 0?AV(y):l,E={};for(var k in m)c&&k==="as"||C(k)&&(E[k]=m[k]);return E.className=x,v&&(E.ref=v),M.createElement(M.Fragment,null,M.createElement(Q1e,{cache:g,serialized:O,isStringTag:typeof y=="string"}),M.createElement(y,E))});return p.displayName=o!==void 0?o:"Styled("+(typeof i=="string"?i:i.displayName||i.name||"Component")+")",p.defaultProps=e.defaultProps,p.__emotion_real=p,p.__emotion_base=i,p.__emotion_styles=f,p.__emotion_forwardProp=s,Object.defineProperty(p,"toString",{value:function(){return a===void 0&&X1e?"NO_COMPONENT_SELECTOR":"."+a}}),p.withComponent=function(m,g){return t(m,j({},n,g,{shouldForwardProp:RV(p,g,!0)})).apply(void 0,f)},p}},K1e=["a","abbr","address","area","article","aside","audio","b","base","bdi","bdo","big","blockquote","body","br","button","canvas","caption","cite","code","col","colgroup","data","datalist","dd","del","details","dfn","dialog","div","dl","dt","em","embed","fieldset","figcaption","figure","footer","form","h1","h2","h3","h4","h5","h6","head","header","hgroup","hr","html","i","iframe","img","input","ins","kbd","keygen","label","legend","li","link","main","map","mark","marquee","menu","menuitem","meta","meter","nav","noscript","object","ol","optgroup","option","output","p","param","picture","pre","progress","q","rp","rt","ruby","s","samp","script","section","select","small","source","span","strong","style","sub","summary","sup","table","tbody","td","textarea","tfoot","th","thead","time","title","tr","track","u","ul","var","video","wbr","circle","clipPath","defs","ellipse","foreignObject","g","image","line","linearGradient","mask","path","pattern","polygon","polyline","radialGradient","rect","stop","svg","text","tspan"],RL=Y1e.bind();K1e.forEach(function(t){RL[t]=RL(t)});let IL;typeof document=="object"&&(IL=Pne({key:"css",prepend:!0}));function Lne(t){const{injectFirst:e,children:n}=t;return e&&IL?w.jsx(V1e,{value:IL,children:n}):n}function Z1e(t){return t==null||Object.keys(t).length===0}function Nne(t){const{styles:e,defaultTheme:n={}}=t,r=typeof e=="function"?i=>e(Z1e(i)?n:i):e;return w.jsx(G1e,{styles:r})}function Wj(t,e){return RL(t,e)}const $ne=(t,e)=>{Array.isArray(t.__emotion_styles)&&(t.__emotion_styles=e(t.__emotion_styles))},J1e=Object.freeze(Object.defineProperty({__proto__:null,GlobalStyles:Nne,StyledEngineProvider:Lne,ThemeContext:C1,css:pM,default:Wj,internal_processStyles:$ne,keyframes:Qv},Symbol.toStringTag,{value:"Module"}));function Bc(t){if(typeof t!="object"||t===null)return!1;const e=Object.getPrototypeOf(t);return(e===null||e===Object.prototype||Object.getPrototypeOf(e)===null)&&!(Symbol.toStringTag in t)&&!(Symbol.iterator in t)}function Fne(t){if(!Bc(t))return t;const e={};return Object.keys(t).forEach(n=>{e[n]=Fne(t[n])}),e}function Ii(t,e,n={clone:!0}){const r=n.clone?j({},t):t;return Bc(t)&&Bc(e)&&Object.keys(e).forEach(i=>{Bc(e[i])&&Object.prototype.hasOwnProperty.call(t,i)&&Bc(t[i])?r[i]=Ii(t[i],e[i],n):n.clone?r[i]=Bc(e[i])?Fne(e[i]):e[i]:r[i]=e[i]}),r}const ewe=Object.freeze(Object.defineProperty({__proto__:null,default:Ii,isPlainObject:Bc},Symbol.toStringTag,{value:"Module"})),twe=["values","unit","step"],nwe=t=>{const e=Object.keys(t).map(n=>({key:n,val:t[n]}))||[];return e.sort((n,r)=>n.val-r.val),e.reduce((n,r)=>j({},n,{[r.key]:r.val}),{})};function jne(t){const{values:e={xs:0,sm:600,md:900,lg:1200,xl:1536},unit:n="px",step:r=5}=t,i=Ae(t,twe),o=nwe(e),a=Object.keys(o);function s(d){return`@media (min-width:${typeof e[d]=="number"?e[d]:d}${n})`}function l(d){return`@media (max-width:${(typeof e[d]=="number"?e[d]:d)-r/100}${n})`}function c(d,h){const p=a.indexOf(h);return`@media (min-width:${typeof e[d]=="number"?e[d]:d}${n}) and (max-width:${(p!==-1&&typeof e[a[p]]=="number"?e[a[p]]:h)-r/100}${n})`}function u(d){return a.indexOf(d)+1<a.length?c(d,a[a.indexOf(d)+1]):s(d)}function f(d){const h=a.indexOf(d);return h===0?s(a[1]):h===a.length-1?l(a[h]):c(d,a[a.indexOf(d)+1]).replace("@media","@media not all and")}return j({keys:a,values:o,up:s,down:l,between:c,only:u,not:f,unit:n},i)}const rwe={borderRadius:4};function Nx(t,e){return e?Ii(t,e,{clone:!1}):t}const Vj={xs:0,sm:600,md:900,lg:1200,xl:1536},IV={keys:["xs","sm","md","lg","xl"],up:t=>`@media (min-width:${Vj[t]}px)`};function Wo(t,e,n){const r=t.theme||{};if(Array.isArray(e)){const o=r.breakpoints||IV;return e.reduce((a,s,l)=>(a[o.up(o.keys[l])]=n(e[l]),a),{})}if(typeof e=="object"){const o=r.breakpoints||IV;return Object.keys(e).reduce((a,s)=>{if(Object.keys(o.values||Vj).indexOf(s)!==-1){const l=o.up(s);a[l]=n(e[s],s)}else{const l=s;a[l]=e[l]}return a},{})}return n(e)}function Bne(t={}){var e;return((e=t.keys)==null?void 0:e.reduce((r,i)=>{const o=t.up(i);return r[o]={},r},{}))||{}}function zne(t,e){return t.reduce((n,r)=>{const i=n[r];return(!i||Object.keys(i).length===0)&&delete n[r],n},e)}function iwe(t,...e){const n=Bne(t),r=[n,...e].reduce((i,o)=>Ii(i,o),{});return zne(Object.keys(n),r)}function owe(t,e){if(typeof t!="object")return{};const n={},r=Object.keys(e);return Array.isArray(t)?r.forEach((i,o)=>{o<t.length&&(n[i]=!0)}):r.forEach(i=>{t[i]!=null&&(n[i]=!0)}),n}function Lh({values:t,breakpoints:e,base:n}){const r=n||owe(t,e),i=Object.keys(r);if(i.length===0)return t;let o;return i.reduce((a,s,l)=>(Array.isArray(t)?(a[s]=t[l]!=null?t[l]:t[o],o=l):typeof t=="object"?(a[s]=t[s]!=null?t[s]:t[o],o=s):a[s]=t,a),{})}function De(t){if(typeof t!="string")throw new Error(fu(7));return t.charAt(0).toUpperCase()+t.slice(1)}const awe=Object.freeze(Object.defineProperty({__proto__:null,default:De},Symbol.toStringTag,{value:"Module"}));function Xg(t,e,n=!0){if(!e||typeof e!="string")return null;if(t&&t.vars&&n){const r=`vars.${e}`.split(".").reduce((i,o)=>i&&i[o]?i[o]:null,t);if(r!=null)return r}return e.split(".").reduce((r,i)=>r&&r[i]!=null?r[i]:null,t)}function ST(t,e,n,r=n){let i;return typeof t=="function"?i=t(n):Array.isArray(t)?i=t[n]||r:i=Xg(t,n)||r,e&&(i=e(i,r,t)),i}function Ar(t){const{prop:e,cssProperty:n=t.prop,themeKey:r,transform:i}=t,o=a=>{if(a[e]==null)return null;const s=a[e],l=a.theme,c=Xg(l,r)||{};return Wo(a,s,f=>{let d=ST(c,i,f);return f===d&&typeof f=="string"&&(d=ST(c,i,`${e}${f==="default"?"":De(f)}`,f)),n===!1?d:{[n]:d}})};return o.propTypes={},o.filterProps=[e],o}function swe(t){const e={};return n=>(e[n]===void 0&&(e[n]=t(n)),e[n])}const lwe={m:"margin",p:"padding"},cwe={t:"Top",r:"Right",b:"Bottom",l:"Left",x:["Left","Right"],y:["Top","Bottom"]},DV={marginX:"mx",marginY:"my",paddingX:"px",paddingY:"py"},uwe=swe(t=>{if(t.length>2)if(DV[t])t=DV[t];else return[t];const[e,n]=t.split(""),r=lwe[e],i=cwe[n]||"";return Array.isArray(i)?i.map(o=>r+o):[r+i]}),Gj=["m","mt","mr","mb","ml","mx","my","margin","marginTop","marginRight","marginBottom","marginLeft","marginX","marginY","marginInline","marginInlineStart","marginInlineEnd","marginBlock","marginBlockStart","marginBlockEnd"],Hj=["p","pt","pr","pb","pl","px","py","padding","paddingTop","paddingRight","paddingBottom","paddingLeft","paddingX","paddingY","paddingInline","paddingInlineStart","paddingInlineEnd","paddingBlock","paddingBlockStart","paddingBlockEnd"];[...Gj,...Hj];function T1(t,e,n,r){var i;const o=(i=Xg(t,e,!1))!=null?i:n;return typeof o=="number"?a=>typeof a=="string"?a:o*a:Array.isArray(o)?a=>typeof a=="string"?a:o[a]:typeof o=="function"?o:()=>{}}function qj(t){return T1(t,"spacing",8)}function Zh(t,e){if(typeof e=="string"||e==null)return e;const n=Math.abs(e),r=t(n);return e>=0?r:typeof r=="number"?-r:`-${r}`}function fwe(t,e){return n=>t.reduce((r,i)=>(r[i]=Zh(e,n),r),{})}function dwe(t,e,n,r){if(e.indexOf(n)===-1)return null;const i=uwe(n),o=fwe(i,r),a=t[n];return Wo(t,a,o)}function Une(t,e){const n=qj(t.theme);return Object.keys(t).map(r=>dwe(t,e,r,n)).reduce(Nx,{})}function gr(t){return Une(t,Gj)}gr.propTypes={};gr.filterProps=Gj;function vr(t){return Une(t,Hj)}vr.propTypes={};vr.filterProps=Hj;function hwe(t=8){if(t.mui)return t;const e=qj({spacing:t}),n=(...r)=>(r.length===0?[1]:r).map(o=>{const a=e(o);return typeof a=="number"?`${a}px`:a}).join(" ");return n.mui=!0,n}function mM(...t){const e=t.reduce((r,i)=>(i.filterProps.forEach(o=>{r[o]=i}),r),{}),n=r=>Object.keys(r).reduce((i,o)=>e[o]?Nx(i,e[o](r)):i,{});return n.propTypes={},n.filterProps=t.reduce((r,i)=>r.concat(i.filterProps),[]),n}function ja(t){return typeof t!="number"?t:`${t}px solid`}function ys(t,e){return Ar({prop:t,themeKey:"borders",transform:e})}const pwe=ys("border",ja),mwe=ys("borderTop",ja),gwe=ys("borderRight",ja),vwe=ys("borderBottom",ja),ywe=ys("borderLeft",ja),xwe=ys("borderColor"),bwe=ys("borderTopColor"),_we=ys("borderRightColor"),wwe=ys("borderBottomColor"),Swe=ys("borderLeftColor"),Owe=ys("outline",ja),Cwe=ys("outlineColor"),gM=t=>{if(t.borderRadius!==void 0&&t.borderRadius!==null){const e=T1(t.theme,"shape.borderRadius",4),n=r=>({borderRadius:Zh(e,r)});return Wo(t,t.borderRadius,n)}return null};gM.propTypes={};gM.filterProps=["borderRadius"];mM(pwe,mwe,gwe,vwe,ywe,xwe,bwe,_we,wwe,Swe,gM,Owe,Cwe);const vM=t=>{if(t.gap!==void 0&&t.gap!==null){const e=T1(t.theme,"spacing",8),n=r=>({gap:Zh(e,r)});return Wo(t,t.gap,n)}return null};vM.propTypes={};vM.filterProps=["gap"];const yM=t=>{if(t.columnGap!==void 0&&t.columnGap!==null){const e=T1(t.theme,"spacing",8),n=r=>({columnGap:Zh(e,r)});return Wo(t,t.columnGap,n)}return null};yM.propTypes={};yM.filterProps=["columnGap"];const xM=t=>{if(t.rowGap!==void 0&&t.rowGap!==null){const e=T1(t.theme,"spacing",8),n=r=>({rowGap:Zh(e,r)});return Wo(t,t.rowGap,n)}return null};xM.propTypes={};xM.filterProps=["rowGap"];const Twe=Ar({prop:"gridColumn"}),Ewe=Ar({prop:"gridRow"}),Pwe=Ar({prop:"gridAutoFlow"}),Mwe=Ar({prop:"gridAutoColumns"}),kwe=Ar({prop:"gridAutoRows"}),Awe=Ar({prop:"gridTemplateColumns"}),Rwe=Ar({prop:"gridTemplateRows"}),Iwe=Ar({prop:"gridTemplateAreas"}),Dwe=Ar({prop:"gridArea"});mM(vM,yM,xM,Twe,Ewe,Pwe,Mwe,kwe,Awe,Rwe,Iwe,Dwe);function Sg(t,e){return e==="grey"?e:t}const Lwe=Ar({prop:"color",themeKey:"palette",transform:Sg}),Nwe=Ar({prop:"bgcolor",cssProperty:"backgroundColor",themeKey:"palette",transform:Sg}),$we=Ar({prop:"backgroundColor",themeKey:"palette",transform:Sg});mM(Lwe,Nwe,$we);function ua(t){return t<=1&&t!==0?`${t*100}%`:t}const Fwe=Ar({prop:"width",transform:ua}),Xj=t=>{if(t.maxWidth!==void 0&&t.maxWidth!==null){const e=n=>{var r,i;const o=((r=t.theme)==null||(r=r.breakpoints)==null||(r=r.values)==null?void 0:r[n])||Vj[n];return o?((i=t.theme)==null||(i=i.breakpoints)==null?void 0:i.unit)!=="px"?{maxWidth:`${o}${t.theme.breakpoints.unit}`}:{maxWidth:o}:{maxWidth:ua(n)}};return Wo(t,t.maxWidth,e)}return null};Xj.filterProps=["maxWidth"];const jwe=Ar({prop:"minWidth",transform:ua}),Bwe=Ar({prop:"height",transform:ua}),zwe=Ar({prop:"maxHeight",transform:ua}),Uwe=Ar({prop:"minHeight",transform:ua});Ar({prop:"size",cssProperty:"width",transform:ua});Ar({prop:"size",cssProperty:"height",transform:ua});const Wwe=Ar({prop:"boxSizing"});mM(Fwe,Xj,jwe,Bwe,zwe,Uwe,Wwe);const E1={border:{themeKey:"borders",transform:ja},borderTop:{themeKey:"borders",transform:ja},borderRight:{themeKey:"borders",transform:ja},borderBottom:{themeKey:"borders",transform:ja},borderLeft:{themeKey:"borders",transform:ja},borderColor:{themeKey:"palette"},borderTopColor:{themeKey:"palette"},borderRightColor:{themeKey:"palette"},borderBottomColor:{themeKey:"palette"},borderLeftColor:{themeKey:"palette"},outline:{themeKey:"borders",transform:ja},outlineColor:{themeKey:"palette"},borderRadius:{themeKey:"shape.borderRadius",style:gM},color:{themeKey:"palette",transform:Sg},bgcolor:{themeKey:"palette",cssProperty:"backgroundColor",transform:Sg},backgroundColor:{themeKey:"palette",transform:Sg},p:{style:vr},pt:{style:vr},pr:{style:vr},pb:{style:vr},pl:{style:vr},px:{style:vr},py:{style:vr},padding:{style:vr},paddingTop:{style:vr},paddingRight:{style:vr},paddingBottom:{style:vr},paddingLeft:{style:vr},paddingX:{style:vr},paddingY:{style:vr},paddingInline:{style:vr},paddingInlineStart:{style:vr},paddingInlineEnd:{style:vr},paddingBlock:{style:vr},paddingBlockStart:{style:vr},paddingBlockEnd:{style:vr},m:{style:gr},mt:{style:gr},mr:{style:gr},mb:{style:gr},ml:{style:gr},mx:{style:gr},my:{style:gr},margin:{style:gr},marginTop:{style:gr},marginRight:{style:gr},marginBottom:{style:gr},marginLeft:{style:gr},marginX:{style:gr},marginY:{style:gr},marginInline:{style:gr},marginInlineStart:{style:gr},marginInlineEnd:{style:gr},marginBlock:{style:gr},marginBlockStart:{style:gr},marginBlockEnd:{style:gr},displayPrint:{cssProperty:!1,transform:t=>({"@media print":{display:t}})},display:{},overflow:{},textOverflow:{},visibility:{},whiteSpace:{},flexBasis:{},flexDirection:{},flexWrap:{},justifyContent:{},alignItems:{},alignContent:{},order:{},flex:{},flexGrow:{},flexShrink:{},alignSelf:{},justifyItems:{},justifySelf:{},gap:{style:vM},rowGap:{style:xM},columnGap:{style:yM},gridColumn:{},gridRow:{},gridAutoFlow:{},gridAutoColumns:{},gridAutoRows:{},gridTemplateColumns:{},gridTemplateRows:{},gridTemplateAreas:{},gridArea:{},position:{},zIndex:{themeKey:"zIndex"},top:{},right:{},bottom:{},left:{},boxShadow:{themeKey:"shadows"},width:{transform:ua},maxWidth:{style:Xj},minWidth:{transform:ua},height:{transform:ua},maxHeight:{transform:ua},minHeight:{transform:ua},boxSizing:{},fontFamily:{themeKey:"typography"},fontSize:{themeKey:"typography"},fontStyle:{themeKey:"typography"},fontWeight:{themeKey:"typography"},letterSpacing:{},textTransform:{},lineHeight:{},textAlign:{},typography:{cssProperty:!1,themeKey:"typography"}};function Vwe(...t){const e=t.reduce((r,i)=>r.concat(Object.keys(i)),[]),n=new Set(e);return t.every(r=>n.size===Object.keys(r).length)}function Gwe(t,e){return typeof t=="function"?t(e):t}function Wne(){function t(n,r,i,o){const a={[n]:r,theme:i},s=o[n];if(!s)return{[n]:r};const{cssProperty:l=n,themeKey:c,transform:u,style:f}=s;if(r==null)return null;if(c==="typography"&&r==="inherit")return{[n]:r};const d=Xg(i,c)||{};return f?f(a):Wo(a,r,p=>{let m=ST(d,u,p);return p===m&&typeof p=="string"&&(m=ST(d,u,`${n}${p==="default"?"":De(p)}`,p)),l===!1?m:{[l]:m}})}function e(n){var r;const{sx:i,theme:o={}}=n||{};if(!i)return null;const a=(r=o.unstable_sxConfig)!=null?r:E1;function s(l){let c=l;if(typeof l=="function")c=l(o);else if(typeof l!="object")return l;if(!c)return null;const u=Bne(o.breakpoints),f=Object.keys(u);let d=u;return Object.keys(c).forEach(h=>{const p=Gwe(c[h],o);if(p!=null)if(typeof p=="object")if(a[h])d=Nx(d,t(h,p,o,a));else{const m=Wo({theme:o},p,g=>({[h]:g}));Vwe(m,p)?d[h]=e({sx:p,theme:o}):d=Nx(d,m)}else d=Nx(d,t(h,p,o,a))}),zne(f,d)}return Array.isArray(i)?i.map(s):s(i)}return e}const Yv=Wne();Yv.filterProps=["sx"];function Vne(t,e){const n=this;return n.vars&&typeof n.getColorSchemeSelector=="function"?{[n.getColorSchemeSelector(t).replace(/(\[[^\]]+\])/,"*:where($1)")]:e}:n.palette.mode===t?e:{}}const Hwe=["breakpoints","palette","spacing","shape"];function P1(t={},...e){const{breakpoints:n={},palette:r={},spacing:i,shape:o={}}=t,a=Ae(t,Hwe),s=jne(n),l=hwe(i);let c=Ii({breakpoints:s,direction:"ltr",components:{},palette:j({mode:"light"},r),spacing:l,shape:j({},rwe,o)},a);return c.applyStyles=Vne,c=e.reduce((u,f)=>Ii(u,f),c),c.unstable_sxConfig=j({},E1,a==null?void 0:a.unstable_sxConfig),c.unstable_sx=function(f){return Yv({sx:f,theme:this})},c}const qwe=Object.freeze(Object.defineProperty({__proto__:null,default:P1,private_createBreakpoints:jne,unstable_applyStyles:Vne},Symbol.toStringTag,{value:"Module"}));function Xwe(t){return Object.keys(t).length===0}function Qj(t=null){const e=M.useContext(C1);return!e||Xwe(e)?t:e}const Qwe=P1();function hd(t=Qwe){return Qj(t)}function Ywe({styles:t,themeId:e,defaultTheme:n={}}){const r=hd(n),i=typeof t=="function"?t(e&&r[e]||r):t;return w.jsx(Nne,{styles:i})}const Kwe=["sx"],Zwe=t=>{var e,n;const r={systemProps:{},otherProps:{}},i=(e=t==null||(n=t.theme)==null?void 0:n.unstable_sxConfig)!=null?e:E1;return Object.keys(t).forEach(o=>{i[o]?r.systemProps[o]=t[o]:r.otherProps[o]=t[o]}),r};function M1(t){const{sx:e}=t,n=Ae(t,Kwe),{systemProps:r,otherProps:i}=Zwe(n);let o;return Array.isArray(e)?o=[r,...e]:typeof e=="function"?o=(...a)=>{const s=e(...a);return Bc(s)?j({},r,s):r}:o=j({},r,e),j({},i,{sx:o})}const Jwe=Object.freeze(Object.defineProperty({__proto__:null,default:Yv,extendSxProp:M1,unstable_createStyleFunctionSx:Wne,unstable_defaultSxConfig:E1},Symbol.toStringTag,{value:"Module"})),LV=t=>t,eSe=()=>{let t=LV;return{configure(e){t=e},generate(e){return t(e)},reset(){t=LV}}},Yj=eSe();function Gne(t){var e,n,r="";if(typeof t=="string"||typeof t=="number")r+=t;else if(typeof t=="object")if(Array.isArray(t)){var i=t.length;for(e=0;e<i;e++)t[e]&&(n=Gne(t[e]))&&(r&&(r+=" "),r+=n)}else for(n in t)t[n]&&(r&&(r+=" "),r+=n);return r}function ke(){for(var t,e,n=0,r="",i=arguments.length;n<i;n++)(t=arguments[n])&&(e=Gne(t))&&(r&&(r+=" "),r+=e);return r}const tSe=["className","component"];function nSe(t={}){const{themeId:e,defaultTheme:n,defaultClassName:r="MuiBox-root",generateClassName:i}=t,o=Wj("div",{shouldForwardProp:s=>s!=="theme"&&s!=="sx"&&s!=="as"})(Yv);return M.forwardRef(function(l,c){const u=hd(n),f=M1(l),{className:d,component:h="div"}=f,p=Ae(f,tSe);return w.jsx(o,j({as:h,ref:c,className:ke(d,i?i(r):r),theme:e&&u[e]||u},p))})}const Hne={active:"active",checked:"checked",completed:"completed",disabled:"disabled",error:"error",expanded:"expanded",focused:"focused",focusVisible:"focusVisible",open:"open",readOnly:"readOnly",required:"required",selected:"selected"};function We(t,e,n="Mui"){const r=Hne[e];return r?`${n}-${r}`:`${Yj.generate(t)}-${e}`}function Ve(t,e,n="Mui"){const r={};return e.forEach(i=>{r[i]=We(t,i,n)}),r}var qne={exports:{}},kn={};/**
 * @license React
 * react-is.production.min.js
 *
 * Copyright (c) Facebook, Inc. and its affiliates.
 *
 * This source code is licensed under the MIT license found in the
 * LICENSE file in the root directory of this source tree.
 */var Kj=Symbol.for("react.element"),Zj=Symbol.for("react.portal"),bM=Symbol.for("react.fragment"),_M=Symbol.for("react.strict_mode"),wM=Symbol.for("react.profiler"),SM=Symbol.for("react.provider"),OM=Symbol.for("react.context"),rSe=Symbol.for("react.server_context"),CM=Symbol.for("react.forward_ref"),TM=Symbol.for("react.suspense"),EM=Symbol.for("react.suspense_list"),PM=Symbol.for("react.memo"),MM=Symbol.for("react.lazy"),iSe=Symbol.for("react.offscreen"),Xne;Xne=Symbol.for("react.module.reference");function xs(t){if(typeof t=="object"&&t!==null){var e=t.$$typeof;switch(e){case Kj:switch(t=t.type,t){case bM:case wM:case _M:case TM:case EM:return t;default:switch(t=t&&t.$$typeof,t){case rSe:case OM:case CM:case MM:case PM:case SM:return t;default:return e}}case Zj:return e}}}kn.ContextConsumer=OM;kn.ContextProvider=SM;kn.Element=Kj;kn.ForwardRef=CM;kn.Fragment=bM;kn.Lazy=MM;kn.Memo=PM;kn.Portal=Zj;kn.Profiler=wM;kn.StrictMode=_M;kn.Suspense=TM;kn.SuspenseList=EM;kn.isAsyncMode=function(){return!1};kn.isConcurrentMode=function(){return!1};kn.isContextConsumer=function(t){return xs(t)===OM};kn.isContextProvider=function(t){return xs(t)===SM};kn.isElement=function(t){return typeof t=="object"&&t!==null&&t.$$typeof===Kj};kn.isForwardRef=function(t){return xs(t)===CM};kn.isFragment=function(t){return xs(t)===bM};kn.isLazy=function(t){return xs(t)===MM};kn.isMemo=function(t){return xs(t)===PM};kn.isPortal=function(t){return xs(t)===Zj};kn.isProfiler=function(t){return xs(t)===wM};kn.isStrictMode=function(t){return xs(t)===_M};kn.isSuspense=function(t){return xs(t)===TM};kn.isSuspenseList=function(t){return xs(t)===EM};kn.isValidElementType=function(t){return typeof t=="string"||typeof t=="function"||t===bM||t===wM||t===_M||t===TM||t===EM||t===iSe||typeof t=="object"&&t!==null&&(t.$$typeof===MM||t.$$typeof===PM||t.$$typeof===SM||t.$$typeof===OM||t.$$typeof===CM||t.$$typeof===Xne||t.getModuleId!==void 0)};kn.typeOf=xs;qne.exports=kn;var NV=qne.exports;const oSe=/^\s*function(?:\s|\s*\/\*.*\*\/\s*)+([^(\s/]*)\s*/;function Qne(t){const e=`${t}`.match(oSe);return e&&e[1]||""}function Yne(t,e=""){return t.displayName||t.name||Qne(t)||e}function $V(t,e,n){const r=Yne(e);return t.displayName||(r!==""?`${n}(${r})`:n)}function aSe(t){if(t!=null){if(typeof t=="string")return t;if(typeof t=="function")return Yne(t,"Component");if(typeof t=="object")switch(t.$$typeof){case NV.ForwardRef:return $V(t,t.render,"ForwardRef");case NV.Memo:return $V(t,t.type,"memo");default:return}}}const sSe=Object.freeze(Object.defineProperty({__proto__:null,default:aSe,getFunctionName:Qne},Symbol.toStringTag,{value:"Module"})),lSe=["ownerState"],cSe=["variants"],uSe=["name","slot","skipVariantsResolver","skipSx","overridesResolver"];function fSe(t){return Object.keys(t).length===0}function dSe(t){return typeof t=="string"&&t.charCodeAt(0)>96}function wA(t){return t!=="ownerState"&&t!=="theme"&&t!=="sx"&&t!=="as"}const hSe=P1(),pSe=t=>t&&t.charAt(0).toLowerCase()+t.slice(1);function tS({defaultTheme:t,theme:e,themeId:n}){return fSe(e)?t:e[n]||e}function mSe(t){return t?(e,n)=>n[t]:null}function CC(t,e){let{ownerState:n}=e,r=Ae(e,lSe);const i=typeof t=="function"?t(j({ownerState:n},r)):t;if(Array.isArray(i))return i.flatMap(o=>CC(o,j({ownerState:n},r)));if(i&&typeof i=="object"&&Array.isArray(i.variants)){const{variants:o=[]}=i;let s=Ae(i,cSe);return o.forEach(l=>{let c=!0;typeof l.props=="function"?c=l.props(j({ownerState:n},r,n)):Object.keys(l.props).forEach(u=>{(n==null?void 0:n[u])!==l.props[u]&&r[u]!==l.props[u]&&(c=!1)}),c&&(Array.isArray(s)||(s=[s]),s.push(typeof l.style=="function"?l.style(j({ownerState:n},r,n)):l.style))}),s}return i}function gSe(t={}){const{themeId:e,defaultTheme:n=hSe,rootShouldForwardProp:r=wA,slotShouldForwardProp:i=wA}=t,o=a=>Yv(j({},a,{theme:tS(j({},a,{defaultTheme:n,themeId:e}))}));return o.__mui_systemSx=!0,(a,s={})=>{$ne(a,_=>_.filter(S=>!(S!=null&&S.__mui_systemSx)));const{name:l,slot:c,skipVariantsResolver:u,skipSx:f,overridesResolver:d=mSe(pSe(c))}=s,h=Ae(s,uSe),p=u!==void 0?u:c&&c!=="Root"&&c!=="root"||!1,m=f||!1;let g,v=wA;c==="Root"||c==="root"?v=r:c?v=i:dSe(a)&&(v=void 0);const y=Wj(a,j({shouldForwardProp:v,label:g},h)),x=_=>typeof _=="function"&&_.__emotion_real!==_||Bc(_)?S=>CC(_,j({},S,{theme:tS({theme:S.theme,defaultTheme:n,themeId:e})})):_,b=(_,...S)=>{let O=x(_);const C=S?S.map(x):[];l&&d&&C.push(I=>{const P=tS(j({},I,{defaultTheme:n,themeId:e}));if(!P.components||!P.components[l]||!P.components[l].styleOverrides)return null;const R=P.components[l].styleOverrides,T={};return Object.entries(R).forEach(([L,z])=>{T[L]=CC(z,j({},I,{theme:P}))}),d(I,T)}),l&&!p&&C.push(I=>{var P;const R=tS(j({},I,{defaultTheme:n,themeId:e})),T=R==null||(P=R.components)==null||(P=P[l])==null?void 0:P.variants;return CC({variants:T},j({},I,{theme:R}))}),m||C.push(o);const E=C.length-S.length;if(Array.isArray(_)&&E>0){const I=new Array(E).fill("");O=[..._,...I],O.raw=[..._.raw,...I]}const k=y(O,...C);return a.muiName&&(k.muiName=a.muiName),k};return y.withConfig&&(b.withConfig=y.withConfig),b}}const Li=gSe();function kM(t,e){const n=j({},e);return Object.keys(t).forEach(r=>{if(r.toString().match(/^(components|slots)$/))n[r]=j({},t[r],n[r]);else if(r.toString().match(/^(componentsProps|slotProps)$/)){const i=t[r]||{},o=e[r];n[r]={},!o||!Object.keys(o)?n[r]=i:!i||!Object.keys(i)?n[r]=o:(n[r]=j({},o),Object.keys(i).forEach(a=>{n[r][a]=kM(i[a],o[a])}))}else n[r]===void 0&&(n[r]=t[r])}),n}function Kne(t){const{theme:e,name:n,props:r}=t;return!e||!e.components||!e.components[n]||!e.components[n].defaultProps?r:kM(e.components[n].defaultProps,r)}function Zne({props:t,name:e,defaultTheme:n,themeId:r}){let i=hd(n);return r&&(i=i[r]||i),Kne({theme:i,name:e,props:t})}const Hr=typeof window<"u"?M.useLayoutEffect:M.useEffect;function vSe(t,e,n,r,i){const[o,a]=M.useState(()=>i&&n?n(t).matches:r?r(t).matches:e);return Hr(()=>{let s=!0;if(!n)return;const l=n(t),c=()=>{s&&a(l.matches)};return c(),l.addListener(c),()=>{s=!1,l.removeListener(c)}},[t,n]),o}const Jne=M.useSyncExternalStore;function ySe(t,e,n,r,i){const o=M.useCallback(()=>e,[e]),a=M.useMemo(()=>{if(i&&n)return()=>n(t).matches;if(r!==null){const{matches:u}=r(t);return()=>u}return o},[o,t,r,i,n]),[s,l]=M.useMemo(()=>{if(n===null)return[o,()=>()=>{}];const u=n(t);return[()=>u.matches,f=>(u.addListener(f),()=>{u.removeListener(f)})]},[o,n,t]);return Jne(l,s,a)}function xSe(t,e={}){const n=Qj(),r=typeof window<"u"&&typeof window.matchMedia<"u",{defaultMatches:i=!1,matchMedia:o=r?window.matchMedia:null,ssrMatchMedia:a=null,noSsr:s=!1}=Kne({name:"MuiUseMediaQuery",props:e,theme:n});let l=typeof t=="function"?t(n):t;return l=l.replace(/^@media( ?)/m,""),(Jne!==void 0?ySe:vSe)(l,i,o,a,s)}function ah(t,e=Number.MIN_SAFE_INTEGER,n=Number.MAX_SAFE_INTEGER){return Math.max(e,Math.min(t,n))}const bSe=Object.freeze(Object.defineProperty({__proto__:null,default:ah},Symbol.toStringTag,{value:"Module"}));function Jj(t,e=0,n=1){return ah(t,e,n)}function _Se(t){t=t.slice(1);const e=new RegExp(`.{1,${t.length>=6?2:1}}`,"g");let n=t.match(e);return n&&n[0].length===1&&(n=n.map(r=>r+r)),n?`rgb${n.length===4?"a":""}(${n.map((r,i)=>i<3?parseInt(r,16):Math.round(parseInt(r,16)/255*1e3)/1e3).join(", ")})`:""}function AM(t){if(t.type)return t;if(t.charAt(0)==="#")return AM(_Se(t));const e=t.indexOf("("),n=t.substring(0,e);if(["rgb","rgba","hsl","hsla","color"].indexOf(n)===-1)throw new Error(fu(9,t));let r=t.substring(e+1,t.length-1),i;if(n==="color"){if(r=r.split(" "),i=r.shift(),r.length===4&&r[3].charAt(0)==="/"&&(r[3]=r[3].slice(1)),["srgb","display-p3","a98-rgb","prophoto-rgb","rec-2020"].indexOf(i)===-1)throw new Error(fu(10,i))}else r=r.split(",");return r=r.map(o=>parseFloat(o)),{type:n,values:r,colorSpace:i}}function e5(t){const{type:e,colorSpace:n}=t;let{values:r}=t;return e.indexOf("rgb")!==-1?r=r.map((i,o)=>o<3?parseInt(i,10):i):e.indexOf("hsl")!==-1&&(r[1]=`${r[1]}%`,r[2]=`${r[2]}%`),e.indexOf("color")!==-1?r=`${n} ${r.join(" ")}`:r=`${r.join(", ")}`,`${e}(${r})`}function Hc(t,e){return t=AM(t),e=Jj(e),(t.type==="rgb"||t.type==="hsl")&&(t.type+="a"),t.type==="color"?t.values[3]=`/${e}`:t.values[3]=e,e5(t)}function ere(t,e){if(t=AM(t),e=Jj(e),t.type.indexOf("hsl")!==-1)t.values[2]*=1-e;else if(t.type.indexOf("rgb")!==-1||t.type.indexOf("color")!==-1)for(let n=0;n<3;n+=1)t.values[n]*=1-e;return e5(t)}function tre(t,e){if(t=AM(t),e=Jj(e),t.type.indexOf("hsl")!==-1)t.values[2]+=(100-t.values[2])*e;else if(t.type.indexOf("rgb")!==-1)for(let n=0;n<3;n+=1)t.values[n]+=(255-t.values[n])*e;else if(t.type.indexOf("color")!==-1)for(let n=0;n<3;n+=1)t.values[n]+=(1-t.values[n])*e;return e5(t)}function OT(...t){return t.reduce((e,n)=>n==null?e:function(...i){e.apply(this,i),n.apply(this,i)},()=>{})}function Kv(t,e=166){let n;function r(...i){const o=()=>{t.apply(this,i)};clearTimeout(n),n=setTimeout(o,e)}return r.clear=()=>{clearTimeout(n)},r}function wSe(t,e){return()=>null}function $x(t,e){var n,r;return M.isValidElement(t)&&e.indexOf((n=t.type.muiName)!=null?n:(r=t.type)==null||(r=r._payload)==null||(r=r.value)==null?void 0:r.muiName)!==-1}function $n(t){return t&&t.ownerDocument||document}function cs(t){return $n(t).defaultView||window}function SSe(t,e){return()=>null}function CT(t,e){typeof t=="function"?t(e):t&&(t.current=e)}let FV=0;function OSe(t){const[e,n]=M.useState(t),r=t||e;return M.useEffect(()=>{e==null&&(FV+=1,n(`mui-${FV}`))},[e]),r}const jV=zD.useId;function pd(t){if(jV!==void 0){const e=jV();return t??e}return OSe(t)}function CSe(t,e,n,r,i){return null}function Qs({controlled:t,default:e,name:n,state:r="value"}){const{current:i}=M.useRef(t!==void 0),[o,a]=M.useState(e),s=i?t:o,l=M.useCallback(c=>{i||a(c)},[]);return[s,l]}function _r(t){const e=M.useRef(t);return Hr(()=>{e.current=t}),M.useRef((...n)=>(0,e.current)(...n)).current}function Zt(...t){return M.useMemo(()=>t.every(e=>e==null)?null:e=>{t.forEach(n=>{CT(n,e)})},t)}const BV={};function TSe(t,e){const n=M.useRef(BV);return n.current===BV&&(n.current=t(e)),n}const ESe=[];function PSe(t){M.useEffect(t,ESe)}class k1{constructor(){this.currentId=null,this.clear=()=>{this.currentId!==null&&(clearTimeout(this.currentId),this.currentId=null)},this.disposeEffect=()=>this.clear}static create(){return new k1}start(e,n){this.clear(),this.currentId=setTimeout(()=>{this.currentId=null,n()},e)}}function bf(){const t=TSe(k1.create).current;return PSe(t.disposeEffect),t}let RM=!0,DL=!1;const MSe=new k1,kSe={text:!0,search:!0,url:!0,tel:!0,email:!0,password:!0,number:!0,date:!0,month:!0,week:!0,time:!0,datetime:!0,"datetime-local":!0};function ASe(t){const{type:e,tagName:n}=t;return!!(n==="INPUT"&&kSe[e]&&!t.readOnly||n==="TEXTAREA"&&!t.readOnly||t.isContentEditable)}function RSe(t){t.metaKey||t.altKey||t.ctrlKey||(RM=!0)}function SA(){RM=!1}function ISe(){this.visibilityState==="hidden"&&DL&&(RM=!0)}function DSe(t){t.addEventListener("keydown",RSe,!0),t.addEventListener("mousedown",SA,!0),t.addEventListener("pointerdown",SA,!0),t.addEventListener("touchstart",SA,!0),t.addEventListener("visibilitychange",ISe,!0)}function LSe(t){const{target:e}=t;try{return e.matches(":focus-visible")}catch{}return RM||ASe(e)}function A1(){const t=M.useCallback(i=>{i!=null&&DSe(i.ownerDocument)},[]),e=M.useRef(!1);function n(){return e.current?(DL=!0,MSe.start(100,()=>{DL=!1}),e.current=!1,!0):!1}function r(i){return LSe(i)?(e.current=!0,!0):!1}return{isFocusVisibleRef:e,onFocus:r,onBlur:n,ref:t}}function nre(t){const e=t.documentElement.clientWidth;return Math.abs(window.innerWidth-e)}let Zp;function rre(){if(Zp)return Zp;const t=document.createElement("div"),e=document.createElement("div");return e.style.width="10px",e.style.height="1px",t.appendChild(e),t.dir="rtl",t.style.fontSize="14px",t.style.width="4px",t.style.height="1px",t.style.position="absolute",t.style.top="-1000px",t.style.overflow="scroll",document.body.appendChild(t),Zp="reverse",t.scrollLeft>0?Zp="default":(t.scrollLeft=1,t.scrollLeft===0&&(Zp="negative")),document.body.removeChild(t),Zp}function NSe(t,e){const n=t.scrollLeft;if(e!=="rtl")return n;switch(rre()){case"negative":return t.scrollWidth-t.clientWidth+n;case"reverse":return t.scrollWidth-t.clientWidth-n;default:return n}}function $Se(t){return M.Children.toArray(t).filter(e=>M.isValidElement(e))}const FSe={border:0,clip:"rect(0 0 0 0)",height:"1px",margin:"-1px",overflow:"hidden",padding:0,position:"absolute",whiteSpace:"nowrap",width:"1px"};function Ue(t,e,n=void 0){const r={};return Object.keys(t).forEach(i=>{r[i]=t[i].reduce((o,a)=>{if(a){const s=e(a);s!==""&&o.push(s),n&&n[a]&&o.push(n[a])}return o},[]).join(" ")}),r}const ire=M.createContext(null);function t5(){return M.useContext(ire)}const jSe=typeof Symbol=="function"&&Symbol.for,ore=jSe?Symbol.for("mui.nested"):"__THEME_NESTED__";function BSe(t,e){return typeof e=="function"?e(t):j({},t,e)}function zSe(t){const{children:e,theme:n}=t,r=t5(),i=M.useMemo(()=>{const o=r===null?n:BSe(r,n);return o!=null&&(o[ore]=r!==null),o},[n,r]);return w.jsx(ire.Provider,{value:i,children:e})}const USe=["value"],are=M.createContext();function WSe(t){let{value:e}=t,n=Ae(t,USe);return w.jsx(are.Provider,j({value:e??!0},n))}const R1=()=>{const t=M.useContext(are);return t??!1},VSe=M.createContext(void 0);function GSe({value:t,children:e}){return w.jsx(VSe.Provider,{value:t,children:e})}const zV={};function UV(t,e,n,r=!1){return M.useMemo(()=>{const i=t&&e[t]||e;if(typeof n=="function"){const o=n(i),a=t?j({},e,{[t]:o}):o;return r?()=>a:a}return t?j({},e,{[t]:n}):j({},e,n)},[t,e,n,r])}function HSe(t){const{children:e,theme:n,themeId:r}=t,i=Qj(zV),o=t5()||zV,a=UV(r,i,n),s=UV(r,o,n,!0),l=a.direction==="rtl";return w.jsx(zSe,{theme:s,children:w.jsx(C1.Provider,{value:a,children:w.jsx(WSe,{value:l,children:w.jsx(GSe,{value:a==null?void 0:a.components,children:e})})})})}const qSe=["component","direction","spacing","divider","children","className","useFlexGap"],XSe=P1(),QSe=Li("div",{name:"MuiStack",slot:"Root",overridesResolver:(t,e)=>e.root});function YSe(t){return Zne({props:t,name:"MuiStack",defaultTheme:XSe})}function KSe(t,e){const n=M.Children.toArray(t).filter(Boolean);return n.reduce((r,i,o)=>(r.push(i),o<n.length-1&&r.push(M.cloneElement(e,{key:`separator-${o}`})),r),[])}const ZSe=t=>({row:"Left","row-reverse":"Right",column:"Top","column-reverse":"Bottom"})[t],JSe=({ownerState:t,theme:e})=>{let n=j({display:"flex",flexDirection:"column"},Wo({theme:e},Lh({values:t.direction,breakpoints:e.breakpoints.values}),r=>({flexDirection:r})));if(t.spacing){const r=qj(e),i=Object.keys(e.breakpoints.values).reduce((l,c)=>((typeof t.spacing=="object"&&t.spacing[c]!=null||typeof t.direction=="object"&&t.direction[c]!=null)&&(l[c]=!0),l),{}),o=Lh({values:t.direction,base:i}),a=Lh({values:t.spacing,base:i});typeof o=="object"&&Object.keys(o).forEach((l,c,u)=>{if(!o[l]){const d=c>0?o[u[c-1]]:"column";o[l]=d}}),n=Ii(n,Wo({theme:e},a,(l,c)=>t.useFlexGap?{gap:Zh(r,l)}:{"& > :not(style):not(style)":{margin:0},"& > :not(style) ~ :not(style)":{[`margin${ZSe(c?o[c]:t.direction)}`]:Zh(r,l)}}))}return n=iwe(e.breakpoints,n),n};function eOe(t={}){const{createStyledComponent:e=QSe,useThemeProps:n=YSe,componentName:r="MuiStack"}=t,i=()=>Ue({root:["root"]},l=>We(r,l),{}),o=e(JSe);return M.forwardRef(function(l,c){const u=n(l),f=M1(u),{component:d="div",direction:h="column",spacing:p=0,divider:m,children:g,className:v,useFlexGap:y=!1}=f,x=Ae(f,qSe),b={direction:h,spacing:p,useFlexGap:y},_=i();return w.jsx(o,j({as:d,ownerState:b,ref:c,className:ke(_.root,v)},x,{children:m?KSe(g,m):g}))})}function tOe(t,e){return j({toolbar:{minHeight:56,[t.up("xs")]:{"@media (orientation: landscape)":{minHeight:48}},[t.up("sm")]:{minHeight:64}}},e)}var Rr={},sre={exports:{}};(function(t){function e(n){return n&&n.__esModule?n:{default:n}}t.exports=e,t.exports.__esModule=!0,t.exports.default=t.exports})(sre);var ft=sre.exports;const nOe=Ea(t1e),rOe=Ea(bSe);var lre=ft;Object.defineProperty(Rr,"__esModule",{value:!0});var kt=Rr.alpha=dre;Rr.blend=mOe;Rr.colorChannel=void 0;var Ab=Rr.darken=r5;Rr.decomposeColor=us;var iOe=Rr.emphasize=hre,oOe=Rr.getContrastRatio=uOe;Rr.getLuminance=TT;Rr.hexToRgb=cre;Rr.hslToRgb=fre;var Rb=Rr.lighten=i5;Rr.private_safeAlpha=fOe;Rr.private_safeColorChannel=void 0;Rr.private_safeDarken=dOe;Rr.private_safeEmphasize=pOe;Rr.private_safeLighten=hOe;Rr.recomposeColor=Zv;Rr.rgbToHex=cOe;var WV=lre(nOe),aOe=lre(rOe);function n5(t,e=0,n=1){return(0,aOe.default)(t,e,n)}function cre(t){t=t.slice(1);const e=new RegExp(`.{1,${t.length>=6?2:1}}`,"g");let n=t.match(e);return n&&n[0].length===1&&(n=n.map(r=>r+r)),n?`rgb${n.length===4?"a":""}(${n.map((r,i)=>i<3?parseInt(r,16):Math.round(parseInt(r,16)/255*1e3)/1e3).join(", ")})`:""}function sOe(t){const e=t.toString(16);return e.length===1?`0${e}`:e}function us(t){if(t.type)return t;if(t.charAt(0)==="#")return us(cre(t));const e=t.indexOf("("),n=t.substring(0,e);if(["rgb","rgba","hsl","hsla","color"].indexOf(n)===-1)throw new Error((0,WV.default)(9,t));let r=t.substring(e+1,t.length-1),i;if(n==="color"){if(r=r.split(" "),i=r.shift(),r.length===4&&r[3].charAt(0)==="/"&&(r[3]=r[3].slice(1)),["srgb","display-p3","a98-rgb","prophoto-rgb","rec-2020"].indexOf(i)===-1)throw new Error((0,WV.default)(10,i))}else r=r.split(",");return r=r.map(o=>parseFloat(o)),{type:n,values:r,colorSpace:i}}const ure=t=>{const e=us(t);return e.values.slice(0,3).map((n,r)=>e.type.indexOf("hsl")!==-1&&r!==0?`${n}%`:n).join(" ")};Rr.colorChannel=ure;const lOe=(t,e)=>{try{return ure(t)}catch{return t}};Rr.private_safeColorChannel=lOe;function Zv(t){const{type:e,colorSpace:n}=t;let{values:r}=t;return e.indexOf("rgb")!==-1?r=r.map((i,o)=>o<3?parseInt(i,10):i):e.indexOf("hsl")!==-1&&(r[1]=`${r[1]}%`,r[2]=`${r[2]}%`),e.indexOf("color")!==-1?r=`${n} ${r.join(" ")}`:r=`${r.join(", ")}`,`${e}(${r})`}function cOe(t){if(t.indexOf("#")===0)return t;const{values:e}=us(t);return`#${e.map((n,r)=>sOe(r===3?Math.round(255*n):n)).join("")}`}function fre(t){t=us(t);const{values:e}=t,n=e[0],r=e[1]/100,i=e[2]/100,o=r*Math.min(i,1-i),a=(c,u=(c+n/30)%12)=>i-o*Math.max(Math.min(u-3,9-u,1),-1);let s="rgb";const l=[Math.round(a(0)*255),Math.round(a(8)*255),Math.round(a(4)*255)];return t.type==="hsla"&&(s+="a",l.push(e[3])),Zv({type:s,values:l})}function TT(t){t=us(t);let e=t.type==="hsl"||t.type==="hsla"?us(fre(t)).values:t.values;return e=e.map(n=>(t.type!=="color"&&(n/=255),n<=.03928?n/12.92:((n+.055)/1.055)**2.4)),Number((.2126*e[0]+.7152*e[1]+.0722*e[2]).toFixed(3))}function uOe(t,e){const n=TT(t),r=TT(e);return(Math.max(n,r)+.05)/(Math.min(n,r)+.05)}function dre(t,e){return t=us(t),e=n5(e),(t.type==="rgb"||t.type==="hsl")&&(t.type+="a"),t.type==="color"?t.values[3]=`/${e}`:t.values[3]=e,Zv(t)}function fOe(t,e,n){try{return dre(t,e)}catch{return t}}function r5(t,e){if(t=us(t),e=n5(e),t.type.indexOf("hsl")!==-1)t.values[2]*=1-e;else if(t.type.indexOf("rgb")!==-1||t.type.indexOf("color")!==-1)for(let n=0;n<3;n+=1)t.values[n]*=1-e;return Zv(t)}function dOe(t,e,n){try{return r5(t,e)}catch{return t}}function i5(t,e){if(t=us(t),e=n5(e),t.type.indexOf("hsl")!==-1)t.values[2]+=(100-t.values[2])*e;else if(t.type.indexOf("rgb")!==-1)for(let n=0;n<3;n+=1)t.values[n]+=(255-t.values[n])*e;else if(t.type.indexOf("color")!==-1)for(let n=0;n<3;n+=1)t.values[n]+=(1-t.values[n])*e;return Zv(t)}function hOe(t,e,n){try{return i5(t,e)}catch{return t}}function hre(t,e=.15){return TT(t)>.5?r5(t,e):i5(t,e)}function pOe(t,e,n){try{return hre(t,e)}catch{return t}}function mOe(t,e,n,r=1){const i=(l,c)=>Math.round((l**(1/r)*(1-n)+c**(1/r)*n)**r),o=us(t),a=us(e),s=[i(o.values[0],a.values[0]),i(o.values[1],a.values[1]),i(o.values[2],a.values[2])];return Zv({type:"rgb",values:s})}const gOe=["mode","contrastThreshold","tonalOffset"],VV={text:{primary:"rgba(0, 0, 0, 0.87)",secondary:"rgba(0, 0, 0, 0.6)",disabled:"rgba(0, 0, 0, 0.38)"},divider:"rgba(0, 0, 0, 0.12)",background:{paper:Eb.white,default:Eb.white},action:{active:"rgba(0, 0, 0, 0.54)",hover:"rgba(0, 0, 0, 0.04)",hoverOpacity:.04,selected:"rgba(0, 0, 0, 0.08)",selectedOpacity:.08,disabled:"rgba(0, 0, 0, 0.26)",disabledBackground:"rgba(0, 0, 0, 0.12)",disabledOpacity:.38,focus:"rgba(0, 0, 0, 0.12)",focusOpacity:.12,activatedOpacity:.12}},OA={text:{primary:Eb.white,secondary:"rgba(255, 255, 255, 0.7)",disabled:"rgba(255, 255, 255, 0.5)",icon:"rgba(255, 255, 255, 0.5)"},divider:"rgba(255, 255, 255, 0.12)",background:{paper:"#121212",default:"#121212"},action:{active:Eb.white,hover:"rgba(255, 255, 255, 0.08)",hoverOpacity:.08,selected:"rgba(255, 255, 255, 0.16)",selectedOpacity:.16,disabled:"rgba(255, 255, 255, 0.3)",disabledBackground:"rgba(255, 255, 255, 0.12)",disabledOpacity:.38,focus:"rgba(255, 255, 255, 0.12)",focusOpacity:.12,activatedOpacity:.24}};function GV(t,e,n,r){const i=r.light||r,o=r.dark||r*1.5;t[e]||(t.hasOwnProperty(n)?t[e]=t[n]:e==="light"?t.light=Rb(t.main,i):e==="dark"&&(t.dark=Ab(t.main,o)))}function vOe(t="light"){return t==="dark"?{main:rf[200],light:rf[50],dark:rf[400]}:{main:rf[700],light:rf[400],dark:rf[800]}}function yOe(t="light"){return t==="dark"?{main:nf[200],light:nf[50],dark:nf[400]}:{main:nf[500],light:nf[300],dark:nf[700]}}function xOe(t="light"){return t==="dark"?{main:tf[500],light:tf[300],dark:tf[700]}:{main:tf[700],light:tf[400],dark:tf[800]}}function bOe(t="light"){return t==="dark"?{main:of[400],light:of[300],dark:of[700]}:{main:of[700],light:of[500],dark:of[900]}}function _Oe(t="light"){return t==="dark"?{main:Lc[400],light:Lc[300],dark:Lc[700]}:{main:Lc[800],light:Lc[500],dark:Lc[900]}}function wOe(t="light"){return t==="dark"?{main:oh[400],light:oh[300],dark:oh[700]}:{main:"#ed6c02",light:oh[500],dark:oh[900]}}function SOe(t){const{mode:e="light",contrastThreshold:n=3,tonalOffset:r=.2}=t,i=Ae(t,gOe),o=t.primary||vOe(e),a=t.secondary||yOe(e),s=t.error||xOe(e),l=t.info||bOe(e),c=t.success||_Oe(e),u=t.warning||wOe(e);function f(m){return oOe(m,OA.text.primary)>=n?OA.text.primary:VV.text.primary}const d=({color:m,name:g,mainShade:v=500,lightShade:y=300,darkShade:x=700})=>{if(m=j({},m),!m.main&&m[v]&&(m.main=m[v]),!m.hasOwnProperty("main"))throw new Error(fu(11,g?` (${g})`:"",v));if(typeof m.main!="string")throw new Error(fu(12,g?` (${g})`:"",JSON.stringify(m.main)));return GV(m,"light",y,r),GV(m,"dark",x,r),m.contrastText||(m.contrastText=f(m.main)),m},h={dark:OA,light:VV};return Ii(j({common:j({},Eb),mode:e,primary:d({color:o,name:"primary"}),secondary:d({color:a,name:"secondary",mainShade:"A400",lightShade:"A200",darkShade:"A700"}),error:d({color:s,name:"error"}),warning:d({color:u,name:"warning"}),info:d({color:l,name:"info"}),success:d({color:c,name:"success"}),grey:xne,contrastThreshold:n,getContrastText:f,augmentColor:d,tonalOffset:r},h[e]),i)}const OOe=["fontFamily","fontSize","fontWeightLight","fontWeightRegular","fontWeightMedium","fontWeightBold","htmlFontSize","allVariants","pxToRem"];function COe(t){return Math.round(t*1e5)/1e5}const HV={textTransform:"uppercase"},qV='"Roboto", "Helvetica", "Arial", sans-serif';function TOe(t,e){const n=typeof e=="function"?e(t):e,{fontFamily:r=qV,fontSize:i=14,fontWeightLight:o=300,fontWeightRegular:a=400,fontWeightMedium:s=500,fontWeightBold:l=700,htmlFontSize:c=16,allVariants:u,pxToRem:f}=n,d=Ae(n,OOe),h=i/14,p=f||(v=>`${v/c*h}rem`),m=(v,y,x,b,_)=>j({fontFamily:r,fontWeight:v,fontSize:p(y),lineHeight:x},r===qV?{letterSpacing:`${COe(b/y)}em`}:{},_,u),g={h1:m(o,96,1.167,-1.5),h2:m(o,60,1.2,-.5),h3:m(a,48,1.167,0),h4:m(a,34,1.235,.25),h5:m(a,24,1.334,0),h6:m(s,20,1.6,.15),subtitle1:m(a,16,1.75,.15),subtitle2:m(s,14,1.57,.1),body1:m(a,16,1.5,.15),body2:m(a,14,1.43,.15),button:m(s,14,1.75,.4,HV),caption:m(a,12,1.66,.4),overline:m(a,12,2.66,1,HV),inherit:{fontFamily:"inherit",fontWeight:"inherit",fontSize:"inherit",lineHeight:"inherit",letterSpacing:"inherit"}};return Ii(j({htmlFontSize:c,pxToRem:p,fontFamily:r,fontSize:i,fontWeightLight:o,fontWeightRegular:a,fontWeightMedium:s,fontWeightBold:l},g),d,{clone:!1})}const EOe=.2,POe=.14,MOe=.12;function or(...t){return[`${t[0]}px ${t[1]}px ${t[2]}px ${t[3]}px rgba(0,0,0,${EOe})`,`${t[4]}px ${t[5]}px ${t[6]}px ${t[7]}px rgba(0,0,0,${POe})`,`${t[8]}px ${t[9]}px ${t[10]}px ${t[11]}px rgba(0,0,0,${MOe})`].join(",")}const kOe=["none",or(0,2,1,-1,0,1,1,0,0,1,3,0),or(0,3,1,-2,0,2,2,0,0,1,5,0),or(0,3,3,-2,0,3,4,0,0,1,8,0),or(0,2,4,-1,0,4,5,0,0,1,10,0),or(0,3,5,-1,0,5,8,0,0,1,14,0),or(0,3,5,-1,0,6,10,0,0,1,18,0),or(0,4,5,-2,0,7,10,1,0,2,16,1),or(0,5,5,-3,0,8,10,1,0,3,14,2),or(0,5,6,-3,0,9,12,1,0,3,16,2),or(0,6,6,-3,0,10,14,1,0,4,18,3),or(0,6,7,-4,0,11,15,1,0,4,20,3),or(0,7,8,-4,0,12,17,2,0,5,22,4),or(0,7,8,-4,0,13,19,2,0,5,24,4),or(0,7,9,-4,0,14,21,2,0,5,26,4),or(0,8,9,-5,0,15,22,2,0,6,28,5),or(0,8,10,-5,0,16,24,2,0,6,30,5),or(0,8,11,-5,0,17,26,2,0,6,32,5),or(0,9,11,-5,0,18,28,2,0,7,34,6),or(0,9,12,-6,0,19,29,2,0,7,36,6),or(0,10,13,-6,0,20,31,3,0,8,38,7),or(0,10,13,-6,0,21,33,3,0,8,40,7),or(0,10,14,-6,0,22,35,3,0,8,42,7),or(0,11,14,-7,0,23,36,3,0,9,44,8),or(0,11,15,-7,0,24,38,3,0,9,46,8)],AOe=["duration","easing","delay"],ROe={easeInOut:"cubic-bezier(0.4, 0, 0.2, 1)",easeOut:"cubic-bezier(0.0, 0, 0.2, 1)",easeIn:"cubic-bezier(0.4, 0, 1, 1)",sharp:"cubic-bezier(0.4, 0, 0.6, 1)"},pre={shortest:150,shorter:200,short:250,standard:300,complex:375,enteringScreen:225,leavingScreen:195};function XV(t){return`${Math.round(t)}ms`}function IOe(t){if(!t)return 0;const e=t/36;return Math.round((4+15*e**.25+e/5)*10)}function DOe(t){const e=j({},ROe,t.easing),n=j({},pre,t.duration);return j({getAutoHeightDuration:IOe,create:(i=["all"],o={})=>{const{duration:a=n.standard,easing:s=e.easeInOut,delay:l=0}=o;return Ae(o,AOe),(Array.isArray(i)?i:[i]).map(c=>`${c} ${typeof a=="string"?a:XV(a)} ${s} ${typeof l=="string"?l:XV(l)}`).join(",")}},t,{easing:e,duration:n})}const LOe={mobileStepper:1e3,fab:1050,speedDial:1050,appBar:1100,drawer:1200,modal:1300,snackbar:1400,tooltip:1500},NOe=["breakpoints","mixins","spacing","palette","transitions","typography","shape"];function o5(t={},...e){const{mixins:n={},palette:r={},transitions:i={},typography:o={}}=t,a=Ae(t,NOe);if(t.vars)throw new Error(fu(18));const s=SOe(r),l=P1(t);let c=Ii(l,{mixins:tOe(l.breakpoints,n),palette:s,shadows:kOe.slice(),typography:TOe(s,o),transitions:DOe(i),zIndex:j({},LOe)});return c=Ii(c,a),c=e.reduce((u,f)=>Ii(u,f),c),c.unstable_sxConfig=j({},E1,a==null?void 0:a.unstable_sxConfig),c.unstable_sx=function(f){return Yv({sx:f,theme:this})},c}const IM=o5();function Go(){const t=hd(IM);return t[Kh]||t}function qe({props:t,name:e}){return Zne({props:t,name:e,defaultTheme:IM,themeId:Kh})}var I1={};const $Oe=Ea(Hbe),FOe=Ea(qbe),mre=Ea(J1e),jOe=Ea(ewe),BOe=Ea(awe),zOe=Ea(sSe),UOe=Ea(qwe),WOe=Ea(Jwe);var Jv=ft;Object.defineProperty(I1,"__esModule",{value:!0});var VOe=I1.default=rCe;I1.shouldForwardProp=TC;I1.systemDefaultTheme=void 0;var $a=Jv($Oe),LL=Jv(FOe),QV=KOe(mre),GOe=jOe;Jv(BOe);Jv(zOe);var HOe=Jv(UOe),qOe=Jv(WOe);const XOe=["ownerState"],QOe=["variants"],YOe=["name","slot","skipVariantsResolver","skipSx","overridesResolver"];function gre(t){if(typeof WeakMap!="function")return null;var e=new WeakMap,n=new WeakMap;return(gre=function(r){return r?n:e})(t)}function KOe(t,e){if(t&&t.__esModule)return t;if(t===null||typeof t!="object"&&typeof t!="function")return{default:t};var n=gre(e);if(n&&n.has(t))return n.get(t);var r={__proto__:null},i=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var o in t)if(o!=="default"&&Object.prototype.hasOwnProperty.call(t,o)){var a=i?Object.getOwnPropertyDescriptor(t,o):null;a&&(a.get||a.set)?Object.defineProperty(r,o,a):r[o]=t[o]}return r.default=t,n&&n.set(t,r),r}function ZOe(t){return Object.keys(t).length===0}function JOe(t){return typeof t=="string"&&t.charCodeAt(0)>96}function TC(t){return t!=="ownerState"&&t!=="theme"&&t!=="sx"&&t!=="as"}const eCe=I1.systemDefaultTheme=(0,HOe.default)(),tCe=t=>t&&t.charAt(0).toLowerCase()+t.slice(1);function nS({defaultTheme:t,theme:e,themeId:n}){return ZOe(e)?t:e[n]||e}function nCe(t){return t?(e,n)=>n[t]:null}function EC(t,e){let{ownerState:n}=e,r=(0,LL.default)(e,XOe);const i=typeof t=="function"?t((0,$a.default)({ownerState:n},r)):t;if(Array.isArray(i))return i.flatMap(o=>EC(o,(0,$a.default)({ownerState:n},r)));if(i&&typeof i=="object"&&Array.isArray(i.variants)){const{variants:o=[]}=i;let s=(0,LL.default)(i,QOe);return o.forEach(l=>{let c=!0;typeof l.props=="function"?c=l.props((0,$a.default)({ownerState:n},r,n)):Object.keys(l.props).forEach(u=>{(n==null?void 0:n[u])!==l.props[u]&&r[u]!==l.props[u]&&(c=!1)}),c&&(Array.isArray(s)||(s=[s]),s.push(typeof l.style=="function"?l.style((0,$a.default)({ownerState:n},r,n)):l.style))}),s}return i}function rCe(t={}){const{themeId:e,defaultTheme:n=eCe,rootShouldForwardProp:r=TC,slotShouldForwardProp:i=TC}=t,o=a=>(0,qOe.default)((0,$a.default)({},a,{theme:nS((0,$a.default)({},a,{defaultTheme:n,themeId:e}))}));return o.__mui_systemSx=!0,(a,s={})=>{(0,QV.internal_processStyles)(a,_=>_.filter(S=>!(S!=null&&S.__mui_systemSx)));const{name:l,slot:c,skipVariantsResolver:u,skipSx:f,overridesResolver:d=nCe(tCe(c))}=s,h=(0,LL.default)(s,YOe),p=u!==void 0?u:c&&c!=="Root"&&c!=="root"||!1,m=f||!1;let g,v=TC;c==="Root"||c==="root"?v=r:c?v=i:JOe(a)&&(v=void 0);const y=(0,QV.default)(a,(0,$a.default)({shouldForwardProp:v,label:g},h)),x=_=>typeof _=="function"&&_.__emotion_real!==_||(0,GOe.isPlainObject)(_)?S=>EC(_,(0,$a.default)({},S,{theme:nS({theme:S.theme,defaultTheme:n,themeId:e})})):_,b=(_,...S)=>{let O=x(_);const C=S?S.map(x):[];l&&d&&C.push(I=>{const P=nS((0,$a.default)({},I,{defaultTheme:n,themeId:e}));if(!P.components||!P.components[l]||!P.components[l].styleOverrides)return null;const R=P.components[l].styleOverrides,T={};return Object.entries(R).forEach(([L,z])=>{T[L]=EC(z,(0,$a.default)({},I,{theme:P}))}),d(I,T)}),l&&!p&&C.push(I=>{var P;const R=nS((0,$a.default)({},I,{defaultTheme:n,themeId:e})),T=R==null||(P=R.components)==null||(P=P[l])==null?void 0:P.variants;return EC({variants:T},(0,$a.default)({},I,{theme:R}))}),m||C.push(o);const E=C.length-S.length;if(Array.isArray(_)&&E>0){const I=new Array(E).fill("");O=[..._,...I],O.raw=[..._.raw,...I]}const k=y(O,...C);return a.muiName&&(k.muiName=a.muiName),k};return y.withConfig&&(b.withConfig=y.withConfig),b}}function DM(t){return t!=="ownerState"&&t!=="theme"&&t!=="sx"&&t!=="as"}const hi=t=>DM(t)&&t!=="classes",we=VOe({themeId:Kh,defaultTheme:IM,rootShouldForwardProp:hi}),iCe=["theme"];function oCe(t){let{theme:e}=t,n=Ae(t,iCe);const r=e[Kh];return w.jsx(HSe,j({},n,{themeId:r?Kh:void 0,theme:r||e}))}const YV=t=>{let e;return t<1?e=5.11916*t**2:e=4.5*Math.log(t+1)+2,(e/100).toFixed(2)};function aCe(t){return We("MuiSvgIcon",t)}Ve("MuiSvgIcon",["root","colorPrimary","colorSecondary","colorAction","colorError","colorDisabled","fontSizeInherit","fontSizeSmall","fontSizeMedium","fontSizeLarge"]);const sCe=["children","className","color","component","fontSize","htmlColor","inheritViewBox","titleAccess","viewBox"],lCe=t=>{const{color:e,fontSize:n,classes:r}=t,i={root:["root",e!=="inherit"&&`color${De(e)}`,`fontSize${De(n)}`]};return Ue(i,aCe,r)},cCe=we("svg",{name:"MuiSvgIcon",slot:"Root",overridesResolver:(t,e)=>{const{ownerState:n}=t;return[e.root,n.color!=="inherit"&&e[`color${De(n.color)}`],e[`fontSize${De(n.fontSize)}`]]}})(({theme:t,ownerState:e})=>{var n,r,i,o,a,s,l,c,u,f,d,h,p;return{userSelect:"none",width:"1em",height:"1em",display:"inline-block",fill:e.hasSvgAsChild?void 0:"currentColor",flexShrink:0,transition:(n=t.transitions)==null||(r=n.create)==null?void 0:r.call(n,"fill",{duration:(i=t.transitions)==null||(i=i.duration)==null?void 0:i.shorter}),fontSize:{inherit:"inherit",small:((o=t.typography)==null||(a=o.pxToRem)==null?void 0:a.call(o,20))||"1.25rem",medium:((s=t.typography)==null||(l=s.pxToRem)==null?void 0:l.call(s,24))||"1.5rem",large:((c=t.typography)==null||(u=c.pxToRem)==null?void 0:u.call(c,35))||"2.1875rem"}[e.fontSize],color:(f=(d=(t.vars||t).palette)==null||(d=d[e.color])==null?void 0:d.main)!=null?f:{action:(h=(t.vars||t).palette)==null||(h=h.action)==null?void 0:h.active,disabled:(p=(t.vars||t).palette)==null||(p=p.action)==null?void 0:p.disabled,inherit:void 0}[e.color]}}),NL=M.forwardRef(function(e,n){const r=qe({props:e,name:"MuiSvgIcon"}),{children:i,className:o,color:a="inherit",component:s="svg",fontSize:l="medium",htmlColor:c,inheritViewBox:u=!1,titleAccess:f,viewBox:d="0 0 24 24"}=r,h=Ae(r,sCe),p=M.isValidElement(i)&&i.type==="svg",m=j({},r,{color:a,component:s,fontSize:l,instanceFontSize:e.fontSize,inheritViewBox:u,viewBox:d,hasSvgAsChild:p}),g={};u||(g.viewBox=d);const v=lCe(m);return w.jsxs(cCe,j({as:s,className:ke(v.root,o),focusable:"false",color:c,"aria-hidden":f?void 0:!0,role:f?"img":void 0,ref:n},g,h,p&&i.props,{ownerState:m,children:[p?i.props.children:i,f?w.jsx("title",{children:f}):null]}))});NL.muiName="SvgIcon";function ni(t,e){function n(r,i){return w.jsx(NL,j({"data-testid":`${e}Icon`,ref:i},r,{children:t}))}return n.muiName=NL.muiName,M.memo(M.forwardRef(n))}const uCe={configure:t=>{Yj.configure(t)}},fCe=Object.freeze(Object.defineProperty({__proto__:null,capitalize:De,createChainedFunction:OT,createSvgIcon:ni,debounce:Kv,deprecatedPropType:wSe,isMuiElement:$x,ownerDocument:$n,ownerWindow:cs,requirePropFactory:SSe,setRef:CT,unstable_ClassNameGenerator:uCe,unstable_useEnhancedEffect:Hr,unstable_useId:pd,unsupportedProp:CSe,useControlled:Qs,useEventCallback:_r,useForkRef:Zt,useIsFocusVisible:A1},Symbol.toStringTag,{value:"Module"}));var In={};/**
 * @license React
 * react-is.production.min.js
 *
 * Copyright (c) Facebook, Inc. and its affiliates.
 *
 * This source code is licensed under the MIT license found in the
 * LICENSE file in the root directory of this source tree.
 */var a5=Symbol.for("react.element"),s5=Symbol.for("react.portal"),LM=Symbol.for("react.fragment"),NM=Symbol.for("react.strict_mode"),$M=Symbol.for("react.profiler"),FM=Symbol.for("react.provider"),jM=Symbol.for("react.context"),dCe=Symbol.for("react.server_context"),BM=Symbol.for("react.forward_ref"),zM=Symbol.for("react.suspense"),UM=Symbol.for("react.suspense_list"),WM=Symbol.for("react.memo"),VM=Symbol.for("react.lazy"),hCe=Symbol.for("react.offscreen"),vre;vre=Symbol.for("react.module.reference");function bs(t){if(typeof t=="object"&&t!==null){var e=t.$$typeof;switch(e){case a5:switch(t=t.type,t){case LM:case $M:case NM:case zM:case UM:return t;default:switch(t=t&&t.$$typeof,t){case dCe:case jM:case BM:case VM:case WM:case FM:return t;default:return e}}case s5:return e}}}In.ContextConsumer=jM;In.ContextProvider=FM;In.Element=a5;In.ForwardRef=BM;In.Fragment=LM;In.Lazy=VM;In.Memo=WM;In.Portal=s5;In.Profiler=$M;In.StrictMode=NM;In.Suspense=zM;In.SuspenseList=UM;In.isAsyncMode=function(){return!1};In.isConcurrentMode=function(){return!1};In.isContextConsumer=function(t){return bs(t)===jM};In.isContextProvider=function(t){return bs(t)===FM};In.isElement=function(t){return typeof t=="object"&&t!==null&&t.$$typeof===a5};In.isForwardRef=function(t){return bs(t)===BM};In.isFragment=function(t){return bs(t)===LM};In.isLazy=function(t){return bs(t)===VM};In.isMemo=function(t){return bs(t)===WM};In.isPortal=function(t){return bs(t)===s5};In.isProfiler=function(t){return bs(t)===$M};In.isStrictMode=function(t){return bs(t)===NM};In.isSuspense=function(t){return bs(t)===zM};In.isSuspenseList=function(t){return bs(t)===UM};In.isValidElementType=function(t){return typeof t=="string"||typeof t=="function"||t===LM||t===$M||t===NM||t===zM||t===UM||t===hCe||typeof t=="object"&&t!==null&&(t.$$typeof===VM||t.$$typeof===WM||t.$$typeof===FM||t.$$typeof===jM||t.$$typeof===BM||t.$$typeof===vre||t.getModuleId!==void 0)};In.typeOf=bs;function l5(t){return qe}function ET(t,e){return ET=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(n,r){return n.__proto__=r,n},ET(t,e)}function D1(t,e){t.prototype=Object.create(e.prototype),t.prototype.constructor=t,ET(t,e)}function pCe(t,e){return t.classList?!!e&&t.classList.contains(e):(" "+(t.className.baseVal||t.className)+" ").indexOf(" "+e+" ")!==-1}function mCe(t,e){t.classList?t.classList.add(e):pCe(t,e)||(typeof t.className=="string"?t.className=t.className+" "+e:t.setAttribute("class",(t.className&&t.className.baseVal||"")+" "+e))}function KV(t,e){return t.replace(new RegExp("(^|\\s)"+e+"(?:\\s|$)","g"),"$1").replace(/\s+/g," ").replace(/^\s*|\s*$/g,"")}function gCe(t,e){t.classList?t.classList.remove(e):typeof t.className=="string"?t.className=KV(t.className,e):t.setAttribute("class",KV(t.className&&t.className.baseVal||"",e))}const ZV={disabled:!1},PT=ue.createContext(null);var yre=function(e){return e.scrollTop},sx="unmounted",Yd="exited",Kd="entering",Lm="entered",$L="exiting",ka=function(t){D1(e,t);function e(r,i){var o;o=t.call(this,r,i)||this;var a=i,s=a&&!a.isMounting?r.enter:r.appear,l;return o.appearStatus=null,r.in?s?(l=Yd,o.appearStatus=Kd):l=Lm:r.unmountOnExit||r.mountOnEnter?l=sx:l=Yd,o.state={status:l},o.nextCallback=null,o}e.getDerivedStateFromProps=function(i,o){var a=i.in;return a&&o.status===sx?{status:Yd}:null};var n=e.prototype;return n.componentDidMount=function(){this.updateStatus(!0,this.appearStatus)},n.componentDidUpdate=function(i){var o=null;if(i!==this.props){var a=this.state.status;this.props.in?a!==Kd&&a!==Lm&&(o=Kd):(a===Kd||a===Lm)&&(o=$L)}this.updateStatus(!1,o)},n.componentWillUnmount=function(){this.cancelNextCallback()},n.getTimeouts=function(){var i=this.props.timeout,o,a,s;return o=a=s=i,i!=null&&typeof i!="number"&&(o=i.exit,a=i.enter,s=i.appear!==void 0?i.appear:a),{exit:o,enter:a,appear:s}},n.updateStatus=function(i,o){if(i===void 0&&(i=!1),o!==null)if(this.cancelNextCallback(),o===Kd){if(this.props.unmountOnExit||this.props.mountOnEnter){var a=this.props.nodeRef?this.props.nodeRef.current:Jw.findDOMNode(this);a&&yre(a)}this.performEnter(i)}else this.performExit();else this.props.unmountOnExit&&this.state.status===Yd&&this.setState({status:sx})},n.performEnter=function(i){var o=this,a=this.props.enter,s=this.context?this.context.isMounting:i,l=this.props.nodeRef?[s]:[Jw.findDOMNode(this),s],c=l[0],u=l[1],f=this.getTimeouts(),d=s?f.appear:f.enter;if(!i&&!a||ZV.disabled){this.safeSetState({status:Lm},function(){o.props.onEntered(c)});return}this.props.onEnter(c,u),this.safeSetState({status:Kd},function(){o.props.onEntering(c,u),o.onTransitionEnd(d,function(){o.safeSetState({status:Lm},function(){o.props.onEntered(c,u)})})})},n.performExit=function(){var i=this,o=this.props.exit,a=this.getTimeouts(),s=this.props.nodeRef?void 0:Jw.findDOMNode(this);if(!o||ZV.disabled){this.safeSetState({status:Yd},function(){i.props.onExited(s)});return}this.props.onExit(s),this.safeSetState({status:$L},function(){i.props.onExiting(s),i.onTransitionEnd(a.exit,function(){i.safeSetState({status:Yd},function(){i.props.onExited(s)})})})},n.cancelNextCallback=function(){this.nextCallback!==null&&(this.nextCallback.cancel(),this.nextCallback=null)},n.safeSetState=function(i,o){o=this.setNextCallback(o),this.setState(i,o)},n.setNextCallback=function(i){var o=this,a=!0;return this.nextCallback=function(s){a&&(a=!1,o.nextCallback=null,i(s))},this.nextCallback.cancel=function(){a=!1},this.nextCallback},n.onTransitionEnd=function(i,o){this.setNextCallback(o);var a=this.props.nodeRef?this.props.nodeRef.current:Jw.findDOMNode(this),s=i==null&&!this.props.addEndListener;if(!a||s){setTimeout(this.nextCallback,0);return}if(this.props.addEndListener){var l=this.props.nodeRef?[this.nextCallback]:[a,this.nextCallback],c=l[0],u=l[1];this.props.addEndListener(c,u)}i!=null&&setTimeout(this.nextCallback,i)},n.render=function(){var i=this.state.status;if(i===sx)return null;var o=this.props,a=o.children;o.in,o.mountOnEnter,o.unmountOnExit,o.appear,o.enter,o.exit,o.timeout,o.addEndListener,o.onEnter,o.onEntering,o.onEntered,o.onExit,o.onExiting,o.onExited,o.nodeRef;var s=Ae(o,["children","in","mountOnEnter","unmountOnExit","appear","enter","exit","timeout","addEndListener","onEnter","onEntering","onEntered","onExit","onExiting","onExited","nodeRef"]);return ue.createElement(PT.Provider,{value:null},typeof a=="function"?a(i,s):ue.cloneElement(ue.Children.only(a),s))},e}(ue.Component);ka.contextType=PT;ka.propTypes={};function Jp(){}ka.defaultProps={in:!1,mountOnEnter:!1,unmountOnExit:!1,appear:!1,enter:!0,exit:!0,onEnter:Jp,onEntering:Jp,onEntered:Jp,onExit:Jp,onExiting:Jp,onExited:Jp};ka.UNMOUNTED=sx;ka.EXITED=Yd;ka.ENTERING=Kd;ka.ENTERED=Lm;ka.EXITING=$L;var vCe=function(e,n){return e&&n&&n.split(" ").forEach(function(r){return mCe(e,r)})},CA=function(e,n){return e&&n&&n.split(" ").forEach(function(r){return gCe(e,r)})},c5=function(t){D1(e,t);function e(){for(var r,i=arguments.length,o=new Array(i),a=0;a<i;a++)o[a]=arguments[a];return r=t.call.apply(t,[this].concat(o))||this,r.appliedClasses={appear:{},enter:{},exit:{}},r.onEnter=function(s,l){var c=r.resolveArguments(s,l),u=c[0],f=c[1];r.removeClasses(u,"exit"),r.addClass(u,f?"appear":"enter","base"),r.props.onEnter&&r.props.onEnter(s,l)},r.onEntering=function(s,l){var c=r.resolveArguments(s,l),u=c[0],f=c[1],d=f?"appear":"enter";r.addClass(u,d,"active"),r.props.onEntering&&r.props.onEntering(s,l)},r.onEntered=function(s,l){var c=r.resolveArguments(s,l),u=c[0],f=c[1],d=f?"appear":"enter";r.removeClasses(u,d),r.addClass(u,d,"done"),r.props.onEntered&&r.props.onEntered(s,l)},r.onExit=function(s){var l=r.resolveArguments(s),c=l[0];r.removeClasses(c,"appear"),r.removeClasses(c,"enter"),r.addClass(c,"exit","base"),r.props.onExit&&r.props.onExit(s)},r.onExiting=function(s){var l=r.resolveArguments(s),c=l[0];r.addClass(c,"exit","active"),r.props.onExiting&&r.props.onExiting(s)},r.onExited=function(s){var l=r.resolveArguments(s),c=l[0];r.removeClasses(c,"exit"),r.addClass(c,"exit","done"),r.props.onExited&&r.props.onExited(s)},r.resolveArguments=function(s,l){return r.props.nodeRef?[r.props.nodeRef.current,s]:[s,l]},r.getClassNames=function(s){var l=r.props.classNames,c=typeof l=="string",u=c&&l?l+"-":"",f=c?""+u+s:l[s],d=c?f+"-active":l[s+"Active"],h=c?f+"-done":l[s+"Done"];return{baseClassName:f,activeClassName:d,doneClassName:h}},r}var n=e.prototype;return n.addClass=function(i,o,a){var s=this.getClassNames(o)[a+"ClassName"],l=this.getClassNames("enter"),c=l.doneClassName;o==="appear"&&a==="done"&&c&&(s+=" "+c),a==="active"&&i&&yre(i),s&&(this.appliedClasses[o][a]=s,vCe(i,s))},n.removeClasses=function(i,o){var a=this.appliedClasses[o],s=a.base,l=a.active,c=a.done;this.appliedClasses[o]={},s&&CA(i,s),l&&CA(i,l),c&&CA(i,c)},n.render=function(){var i=this.props;i.classNames;var o=Ae(i,["classNames"]);return ue.createElement(ka,j({},o,{onEnter:this.onEnter,onEntered:this.onEntered,onEntering:this.onEntering,onExit:this.onExit,onExiting:this.onExiting,onExited:this.onExited}))},e}(ue.Component);c5.defaultProps={classNames:""};c5.propTypes={};function lt(t){if(t===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}function u5(t,e){var n=function(o){return e&&M.isValidElement(o)?e(o):o},r=Object.create(null);return t&&M.Children.map(t,function(i){return i}).forEach(function(i){r[i.key]=n(i)}),r}function yCe(t,e){t=t||{},e=e||{};function n(u){return u in e?e[u]:t[u]}var r=Object.create(null),i=[];for(var o in t)o in e?i.length&&(r[o]=i,i=[]):i.push(o);var a,s={};for(var l in e){if(r[l])for(a=0;a<r[l].length;a++){var c=r[l][a];s[r[l][a]]=n(c)}s[l]=n(l)}for(a=0;a<i.length;a++)s[i[a]]=n(i[a]);return s}function yh(t,e,n){return n[e]!=null?n[e]:t.props[e]}function xCe(t,e){return u5(t.children,function(n){return M.cloneElement(n,{onExited:e.bind(null,n),in:!0,appear:yh(n,"appear",t),enter:yh(n,"enter",t),exit:yh(n,"exit",t)})})}function bCe(t,e,n){var r=u5(t.children),i=yCe(e,r);return Object.keys(i).forEach(function(o){var a=i[o];if(M.isValidElement(a)){var s=o in e,l=o in r,c=e[o],u=M.isValidElement(c)&&!c.props.in;l&&(!s||u)?i[o]=M.cloneElement(a,{onExited:n.bind(null,a),in:!0,exit:yh(a,"exit",t),enter:yh(a,"enter",t)}):!l&&s&&!u?i[o]=M.cloneElement(a,{in:!1}):l&&s&&M.isValidElement(c)&&(i[o]=M.cloneElement(a,{onExited:n.bind(null,a),in:c.props.in,exit:yh(a,"exit",t),enter:yh(a,"enter",t)}))}}),i}var _Ce=Object.values||function(t){return Object.keys(t).map(function(e){return t[e]})},wCe={component:"div",childFactory:function(e){return e}},L1=function(t){D1(e,t);function e(r,i){var o;o=t.call(this,r,i)||this;var a=o.handleExited.bind(lt(o));return o.state={contextValue:{isMounting:!0},handleExited:a,firstRender:!0},o}var n=e.prototype;return n.componentDidMount=function(){this.mounted=!0,this.setState({contextValue:{isMounting:!1}})},n.componentWillUnmount=function(){this.mounted=!1},e.getDerivedStateFromProps=function(i,o){var a=o.children,s=o.handleExited,l=o.firstRender;return{children:l?xCe(i,s):bCe(i,a,s),firstRender:!1}},n.handleExited=function(i,o){var a=u5(this.props.children);i.key in a||(i.props.onExited&&i.props.onExited(o),this.mounted&&this.setState(function(s){var l=j({},s.children);return delete l[i.key],{children:l}}))},n.render=function(){var i=this.props,o=i.component,a=i.childFactory,s=Ae(i,["component","childFactory"]),l=this.state.contextValue,c=_Ce(this.state.children).map(a);return delete s.appear,delete s.enter,delete s.exit,o===null?ue.createElement(PT.Provider,{value:l},c):ue.createElement(PT.Provider,{value:l},ue.createElement(o,s,c))},e}(ue.Component);L1.propTypes={};L1.defaultProps=wCe;const f5=t=>t.scrollTop;function Zf(t,e){var n,r;const{timeout:i,easing:o,style:a={}}=t;return{duration:(n=a.transitionDuration)!=null?n:typeof i=="number"?i:i[e.mode]||0,easing:(r=a.transitionTimingFunction)!=null?r:typeof o=="object"?o[e.mode]:o,delay:a.transitionDelay}}function SCe(t){return We("MuiCollapse",t)}Ve("MuiCollapse",["root","horizontal","vertical","entered","hidden","wrapper","wrapperInner"]);const OCe=["addEndListener","children","className","collapsedSize","component","easing","in","onEnter","onEntered","onEntering","onExit","onExited","onExiting","orientation","style","timeout","TransitionComponent"],CCe=t=>{const{orientation:e,classes:n}=t,r={root:["root",`${e}`],entered:["entered"],hidden:["hidden"],wrapper:["wrapper",`${e}`],wrapperInner:["wrapperInner",`${e}`]};return Ue(r,SCe,n)},TCe=we("div",{name:"MuiCollapse",slot:"Root",overridesResolver:(t,e)=>{const{ownerState:n}=t;return[e.root,e[n.orientation],n.state==="entered"&&e.entered,n.state==="exited"&&!n.in&&n.collapsedSize==="0px"&&e.hidden]}})(({theme:t,ownerState:e})=>j({height:0,overflow:"hidden",transition:t.transitions.create("height")},e.orientation==="horizontal"&&{height:"auto",width:0,transition:t.transitions.create("width")},e.state==="entered"&&j({height:"auto",overflow:"visible"},e.orientation==="horizontal"&&{width:"auto"}),e.state==="exited"&&!e.in&&e.collapsedSize==="0px"&&{visibility:"hidden"})),ECe=we("div",{name:"MuiCollapse",slot:"Wrapper",overridesResolver:(t,e)=>e.wrapper})(({ownerState:t})=>j({display:"flex",width:"100%"},t.orientation==="horizontal"&&{width:"auto",height:"100%"})),PCe=we("div",{name:"MuiCollapse",slot:"WrapperInner",overridesResolver:(t,e)=>e.wrapperInner})(({ownerState:t})=>j({width:"100%"},t.orientation==="horizontal"&&{width:"auto",height:"100%"})),d5=M.forwardRef(function(e,n){const r=qe({props:e,name:"MuiCollapse"}),{addEndListener:i,children:o,className:a,collapsedSize:s="0px",component:l,easing:c,in:u,onEnter:f,onEntered:d,onEntering:h,onExit:p,onExited:m,onExiting:g,orientation:v="vertical",style:y,timeout:x=pre.standard,TransitionComponent:b=ka}=r,_=Ae(r,OCe),S=j({},r,{orientation:v,collapsedSize:s}),O=CCe(S),C=Go(),E=bf(),k=M.useRef(null),I=M.useRef(),P=typeof s=="number"?`${s}px`:s,R=v==="horizontal",T=R?"width":"height",L=M.useRef(null),z=Zt(n,L),B=K=>se=>{if(K){const te=L.current;se===void 0?K(te):K(te,se)}},U=()=>k.current?k.current[R?"clientWidth":"clientHeight"]:0,W=B((K,se)=>{k.current&&R&&(k.current.style.position="absolute"),K.style[T]=P,f&&f(K,se)}),$=B((K,se)=>{const te=U();k.current&&R&&(k.current.style.position="");const{duration:J,easing:pe}=Zf({style:y,timeout:x,easing:c},{mode:"enter"});if(x==="auto"){const be=C.transitions.getAutoHeightDuration(te);K.style.transitionDuration=`${be}ms`,I.current=be}else K.style.transitionDuration=typeof J=="string"?J:`${J}ms`;K.style[T]=`${te}px`,K.style.transitionTimingFunction=pe,h&&h(K,se)}),N=B((K,se)=>{K.style[T]="auto",d&&d(K,se)}),D=B(K=>{K.style[T]=`${U()}px`,p&&p(K)}),A=B(m),q=B(K=>{const se=U(),{duration:te,easing:J}=Zf({style:y,timeout:x,easing:c},{mode:"exit"});if(x==="auto"){const pe=C.transitions.getAutoHeightDuration(se);K.style.transitionDuration=`${pe}ms`,I.current=pe}else K.style.transitionDuration=typeof te=="string"?te:`${te}ms`;K.style[T]=P,K.style.transitionTimingFunction=J,g&&g(K)}),Y=K=>{x==="auto"&&E.start(I.current||0,K),i&&i(L.current,K)};return w.jsx(b,j({in:u,onEnter:W,onEntered:N,onEntering:$,onExit:D,onExited:A,onExiting:q,addEndListener:Y,nodeRef:L,timeout:x==="auto"?null:x},_,{children:(K,se)=>w.jsx(TCe,j({as:l,className:ke(O.root,a,{entered:O.entered,exited:!u&&P==="0px"&&O.hidden}[K]),style:j({[R?"minWidth":"minHeight"]:P},y),ref:z},se,{ownerState:j({},S,{state:K}),children:w.jsx(ECe,{ownerState:j({},S,{state:K}),className:O.wrapper,ref:k,children:w.jsx(PCe,{ownerState:j({},S,{state:K}),className:O.wrapperInner,children:o})})}))}))});d5.muiSupportAuto=!0;function MCe(t){return We("MuiPaper",t)}Ve("MuiPaper",["root","rounded","outlined","elevation","elevation0","elevation1","elevation2","elevation3","elevation4","elevation5","elevation6","elevation7","elevation8","elevation9","elevation10","elevation11","elevation12","elevation13","elevation14","elevation15","elevation16","elevation17","elevation18","elevation19","elevation20","elevation21","elevation22","elevation23","elevation24"]);const kCe=["className","component","elevation","square","variant"],ACe=t=>{const{square:e,elevation:n,variant:r,classes:i}=t,o={root:["root",r,!e&&"rounded",r==="elevation"&&`elevation${n}`]};return Ue(o,MCe,i)},RCe=we("div",{name:"MuiPaper",slot:"Root",overridesResolver:(t,e)=>{const{ownerState:n}=t;return[e.root,e[n.variant],!n.square&&e.rounded,n.variant==="elevation"&&e[`elevation${n.elevation}`]]}})(({theme:t,ownerState:e})=>{var n;return j({backgroundColor:(t.vars||t).palette.background.paper,color:(t.vars||t).palette.text.primary,transition:t.transitions.create("box-shadow")},!e.square&&{borderRadius:t.shape.borderRadius},e.variant==="outlined"&&{border:`1px solid ${(t.vars||t).palette.divider}`},e.variant==="elevation"&&j({boxShadow:(t.vars||t).shadows[e.elevation]},!t.vars&&t.palette.mode==="dark"&&{backgroundImage:`linear-gradient(${kt("#fff",YV(e.elevation))}, ${kt("#fff",YV(e.elevation))})`},t.vars&&{backgroundImage:(n=t.vars.overlays)==null?void 0:n[e.elevation]}))}),Ho=M.forwardRef(function(e,n){const r=qe({props:e,name:"MuiPaper"}),{className:i,component:o="div",elevation:a=1,square:s=!1,variant:l="elevation"}=r,c=Ae(r,kCe),u=j({},r,{component:o,elevation:a,square:s,variant:l}),f=ACe(u);return w.jsx(RCe,j({as:o,ownerState:u,className:ke(f.root,i),ref:n},c))});function Vl(t){return typeof t=="string"}function Zm(t,e,n){return t===void 0||Vl(t)?e:j({},e,{ownerState:j({},e.ownerState,n)})}function ICe(t,e,n=(r,i)=>r===i){return t.length===e.length&&t.every((r,i)=>n(r,e[i]))}const DCe={disableDefaultClasses:!1},LCe=M.createContext(DCe);function NCe(t){const{disableDefaultClasses:e}=M.useContext(LCe);return n=>e?"":t(n)}function Nh(t,e=[]){if(t===void 0)return{};const n={};return Object.keys(t).filter(r=>r.match(/^on[A-Z]/)&&typeof t[r]=="function"&&!e.includes(r)).forEach(r=>{n[r]=t[r]}),n}function xre(t,e,n){return typeof t=="function"?t(e,n):t}function JV(t){if(t===void 0)return{};const e={};return Object.keys(t).filter(n=>!(n.match(/^on[A-Z]/)&&typeof t[n]=="function")).forEach(n=>{e[n]=t[n]}),e}function bre(t){const{getSlotProps:e,additionalProps:n,externalSlotProps:r,externalForwardedProps:i,className:o}=t;if(!e){const h=ke(n==null?void 0:n.className,o,i==null?void 0:i.className,r==null?void 0:r.className),p=j({},n==null?void 0:n.style,i==null?void 0:i.style,r==null?void 0:r.style),m=j({},n,i,r);return h.length>0&&(m.className=h),Object.keys(p).length>0&&(m.style=p),{props:m,internalRef:void 0}}const a=Nh(j({},i,r)),s=JV(r),l=JV(i),c=e(a),u=ke(c==null?void 0:c.className,n==null?void 0:n.className,o,i==null?void 0:i.className,r==null?void 0:r.className),f=j({},c==null?void 0:c.style,n==null?void 0:n.style,i==null?void 0:i.style,r==null?void 0:r.style),d=j({},c,n,l,s);return u.length>0&&(d.className=u),Object.keys(f).length>0&&(d.style=f),{props:d,internalRef:c.ref}}const $Ce=["elementType","externalSlotProps","ownerState","skipResolvingSlotProps"];function $r(t){var e;const{elementType:n,externalSlotProps:r,ownerState:i,skipResolvingSlotProps:o=!1}=t,a=Ae(t,$Ce),s=o?{}:xre(r,i),{props:l,internalRef:c}=bre(j({},a,{externalSlotProps:s})),u=Zt(c,s==null?void 0:s.ref,(e=t.additionalProps)==null?void 0:e.ref);return Zm(n,j({},l,{ref:u}),i)}const FCe=["className","elementType","ownerState","externalForwardedProps","getSlotOwnerState","internalForwardedProps"],jCe=["component","slots","slotProps"],BCe=["component"];function zCe(t,e){const{className:n,elementType:r,ownerState:i,externalForwardedProps:o,getSlotOwnerState:a,internalForwardedProps:s}=e,l=Ae(e,FCe),{component:c,slots:u={[t]:void 0},slotProps:f={[t]:void 0}}=o;Ae(o,jCe);const d=u[t]||r,h=xre(f[t],i),p=bre(j({className:n},l,{externalForwardedProps:void 0,externalSlotProps:h})),{props:{component:m},internalRef:g}=p,v=Ae(p.props,BCe),y=Zt(g,h==null?void 0:h.ref,e.ref),x=a?a(v):{},b=j({},i,x),_=m,S=Zm(d,j({},t==="root",!u[t]&&s,v,_&&{as:_},{ref:y}),b);return Object.keys(x).forEach(O=>{delete S[O]}),[d,S]}function UCe(t){const{className:e,classes:n,pulsate:r=!1,rippleX:i,rippleY:o,rippleSize:a,in:s,onExited:l,timeout:c}=t,[u,f]=M.useState(!1),d=ke(e,n.ripple,n.rippleVisible,r&&n.ripplePulsate),h={width:a,height:a,top:-(a/2)+o,left:-(a/2)+i},p=ke(n.child,u&&n.childLeaving,r&&n.childPulsate);return!s&&!u&&f(!0),M.useEffect(()=>{if(!s&&l!=null){const m=setTimeout(l,c);return()=>{clearTimeout(m)}}},[l,s,c]),w.jsx("span",{className:d,style:h,children:w.jsx("span",{className:p})})}const Fa=Ve("MuiTouchRipple",["root","ripple","rippleVisible","ripplePulsate","child","childLeaving","childPulsate"]),WCe=["center","classes","className"];let GM=t=>t,e8,t8,n8,r8;const FL=550,VCe=80,GCe=Qv(e8||(e8=GM`
  0% {
    transform: scale(0);
    opacity: 0.1;
  }

  100% {
    transform: scale(1);
    opacity: 0.3;
  }
`)),HCe=Qv(t8||(t8=GM`
  0% {
    opacity: 1;
  }

  100% {
    opacity: 0;
  }
`)),qCe=Qv(n8||(n8=GM`
  0% {
    transform: scale(1);
  }

  50% {
    transform: scale(0.92);
  }

  100% {
    transform: scale(1);
  }
`)),XCe=we("span",{name:"MuiTouchRipple",slot:"Root"})({overflow:"hidden",pointerEvents:"none",position:"absolute",zIndex:0,top:0,right:0,bottom:0,left:0,borderRadius:"inherit"}),QCe=we(UCe,{name:"MuiTouchRipple",slot:"Ripple"})(r8||(r8=GM`
  opacity: 0;
  position: absolute;

  &.${0} {
    opacity: 0.3;
    transform: scale(1);
    animation-name: ${0};
    animation-duration: ${0}ms;
    animation-timing-function: ${0};
  }

  &.${0} {
    animation-duration: ${0}ms;
  }

  & .${0} {
    opacity: 1;
    display: block;
    width: 100%;
    height: 100%;
    border-radius: 50%;
    background-color: currentColor;
  }

  & .${0} {
    opacity: 0;
    animation-name: ${0};
    animation-duration: ${0}ms;
    animation-timing-function: ${0};
  }

  & .${0} {
    position: absolute;
    /* @noflip */
    left: 0px;
    top: 0;
    animation-name: ${0};
    animation-duration: 2500ms;
    animation-timing-function: ${0};
    animation-iteration-count: infinite;
    animation-delay: 200ms;
  }
`),Fa.rippleVisible,GCe,FL,({theme:t})=>t.transitions.easing.easeInOut,Fa.ripplePulsate,({theme:t})=>t.transitions.duration.shorter,Fa.child,Fa.childLeaving,HCe,FL,({theme:t})=>t.transitions.easing.easeInOut,Fa.childPulsate,qCe,({theme:t})=>t.transitions.easing.easeInOut),YCe=M.forwardRef(function(e,n){const r=qe({props:e,name:"MuiTouchRipple"}),{center:i=!1,classes:o={},className:a}=r,s=Ae(r,WCe),[l,c]=M.useState([]),u=M.useRef(0),f=M.useRef(null);M.useEffect(()=>{f.current&&(f.current(),f.current=null)},[l]);const d=M.useRef(!1),h=bf(),p=M.useRef(null),m=M.useRef(null),g=M.useCallback(b=>{const{pulsate:_,rippleX:S,rippleY:O,rippleSize:C,cb:E}=b;c(k=>[...k,w.jsx(QCe,{classes:{ripple:ke(o.ripple,Fa.ripple),rippleVisible:ke(o.rippleVisible,Fa.rippleVisible),ripplePulsate:ke(o.ripplePulsate,Fa.ripplePulsate),child:ke(o.child,Fa.child),childLeaving:ke(o.childLeaving,Fa.childLeaving),childPulsate:ke(o.childPulsate,Fa.childPulsate)},timeout:FL,pulsate:_,rippleX:S,rippleY:O,rippleSize:C},u.current)]),u.current+=1,f.current=E},[o]),v=M.useCallback((b={},_={},S=()=>{})=>{const{pulsate:O=!1,center:C=i||_.pulsate,fakeElement:E=!1}=_;if((b==null?void 0:b.type)==="mousedown"&&d.current){d.current=!1;return}(b==null?void 0:b.type)==="touchstart"&&(d.current=!0);const k=E?null:m.current,I=k?k.getBoundingClientRect():{width:0,height:0,left:0,top:0};let P,R,T;if(C||b===void 0||b.clientX===0&&b.clientY===0||!b.clientX&&!b.touches)P=Math.round(I.width/2),R=Math.round(I.height/2);else{const{clientX:L,clientY:z}=b.touches&&b.touches.length>0?b.touches[0]:b;P=Math.round(L-I.left),R=Math.round(z-I.top)}if(C)T=Math.sqrt((2*I.width**2+I.height**2)/3),T%2===0&&(T+=1);else{const L=Math.max(Math.abs((k?k.clientWidth:0)-P),P)*2+2,z=Math.max(Math.abs((k?k.clientHeight:0)-R),R)*2+2;T=Math.sqrt(L**2+z**2)}b!=null&&b.touches?p.current===null&&(p.current=()=>{g({pulsate:O,rippleX:P,rippleY:R,rippleSize:T,cb:S})},h.start(VCe,()=>{p.current&&(p.current(),p.current=null)})):g({pulsate:O,rippleX:P,rippleY:R,rippleSize:T,cb:S})},[i,g,h]),y=M.useCallback(()=>{v({},{pulsate:!0})},[v]),x=M.useCallback((b,_)=>{if(h.clear(),(b==null?void 0:b.type)==="touchend"&&p.current){p.current(),p.current=null,h.start(0,()=>{x(b,_)});return}p.current=null,c(S=>S.length>0?S.slice(1):S),f.current=_},[h]);return M.useImperativeHandle(n,()=>({pulsate:y,start:v,stop:x}),[y,v,x]),w.jsx(XCe,j({className:ke(Fa.root,o.root,a),ref:m},s,{children:w.jsx(L1,{component:null,exit:!0,children:l})}))});function KCe(t){return We("MuiButtonBase",t)}const ZCe=Ve("MuiButtonBase",["root","disabled","focusVisible"]),JCe=["action","centerRipple","children","className","component","disabled","disableRipple","disableTouchRipple","focusRipple","focusVisibleClassName","LinkComponent","onBlur","onClick","onContextMenu","onDragLeave","onFocus","onFocusVisible","onKeyDown","onKeyUp","onMouseDown","onMouseLeave","onMouseUp","onTouchEnd","onTouchMove","onTouchStart","tabIndex","TouchRippleProps","touchRippleRef","type"],eTe=t=>{const{disabled:e,focusVisible:n,focusVisibleClassName:r,classes:i}=t,a=Ue({root:["root",e&&"disabled",n&&"focusVisible"]},KCe,i);return n&&r&&(a.root+=` ${r}`),a},tTe=we("button",{name:"MuiButtonBase",slot:"Root",overridesResolver:(t,e)=>e.root})({display:"inline-flex",alignItems:"center",justifyContent:"center",position:"relative",boxSizing:"border-box",WebkitTapHighlightColor:"transparent",backgroundColor:"transparent",outline:0,border:0,margin:0,borderRadius:0,padding:0,cursor:"pointer",userSelect:"none",verticalAlign:"middle",MozAppearance:"none",WebkitAppearance:"none",textDecoration:"none",color:"inherit","&::-moz-focus-inner":{borderStyle:"none"},[`&.${ZCe.disabled}`]:{pointerEvents:"none",cursor:"default"},"@media print":{colorAdjust:"exact"}}),fs=M.forwardRef(function(e,n){const r=qe({props:e,name:"MuiButtonBase"}),{action:i,centerRipple:o=!1,children:a,className:s,component:l="button",disabled:c=!1,disableRipple:u=!1,disableTouchRipple:f=!1,focusRipple:d=!1,LinkComponent:h="a",onBlur:p,onClick:m,onContextMenu:g,onDragLeave:v,onFocus:y,onFocusVisible:x,onKeyDown:b,onKeyUp:_,onMouseDown:S,onMouseLeave:O,onMouseUp:C,onTouchEnd:E,onTouchMove:k,onTouchStart:I,tabIndex:P=0,TouchRippleProps:R,touchRippleRef:T,type:L}=r,z=Ae(r,JCe),B=M.useRef(null),U=M.useRef(null),W=Zt(U,T),{isFocusVisibleRef:$,onFocus:N,onBlur:D,ref:A}=A1(),[q,Y]=M.useState(!1);c&&q&&Y(!1),M.useImperativeHandle(i,()=>({focusVisible:()=>{Y(!0),B.current.focus()}}),[]);const[K,se]=M.useState(!1);M.useEffect(()=>{se(!0)},[]);const te=K&&!u&&!c;M.useEffect(()=>{q&&d&&!u&&K&&U.current.pulsate()},[u,d,q,K]);function J(V,de,xe=f){return _r(Me=>(de&&de(Me),!xe&&U.current&&U.current[V](Me),!0))}const pe=J("start",S),be=J("stop",g),re=J("stop",v),ve=J("stop",C),F=J("stop",V=>{q&&V.preventDefault(),O&&O(V)}),ce=J("start",I),le=J("stop",E),Q=J("stop",k),X=J("stop",V=>{D(V),$.current===!1&&Y(!1),p&&p(V)},!1),ee=_r(V=>{B.current||(B.current=V.currentTarget),N(V),$.current===!0&&(Y(!0),x&&x(V)),y&&y(V)}),ge=()=>{const V=B.current;return l&&l!=="button"&&!(V.tagName==="A"&&V.href)},ye=M.useRef(!1),H=_r(V=>{d&&!ye.current&&q&&U.current&&V.key===" "&&(ye.current=!0,U.current.stop(V,()=>{U.current.start(V)})),V.target===V.currentTarget&&ge()&&V.key===" "&&V.preventDefault(),b&&b(V),V.target===V.currentTarget&&ge()&&V.key==="Enter"&&!c&&(V.preventDefault(),m&&m(V))}),G=_r(V=>{d&&V.key===" "&&U.current&&q&&!V.defaultPrevented&&(ye.current=!1,U.current.stop(V,()=>{U.current.pulsate(V)})),_&&_(V),m&&V.target===V.currentTarget&&ge()&&V.key===" "&&!V.defaultPrevented&&m(V)});let ie=l;ie==="button"&&(z.href||z.to)&&(ie=h);const he={};ie==="button"?(he.type=L===void 0?"button":L,he.disabled=c):(!z.href&&!z.to&&(he.role="button"),c&&(he["aria-disabled"]=c));const _e=Zt(n,A,B),oe=j({},r,{centerRipple:o,component:l,disabled:c,disableRipple:u,disableTouchRipple:f,focusRipple:d,tabIndex:P,focusVisible:q}),Z=eTe(oe);return w.jsxs(tTe,j({as:ie,className:ke(Z.root,s),ownerState:oe,onBlur:X,onClick:m,onContextMenu:be,onFocus:ee,onKeyDown:H,onKeyUp:G,onMouseDown:pe,onMouseLeave:F,onMouseUp:ve,onDragLeave:re,onTouchEnd:le,onTouchMove:Q,onTouchStart:ce,ref:_e,tabIndex:c?-1:P,type:L},he,z,{children:[a,te?w.jsx(YCe,j({ref:W,center:o},R)):null]}))});function nTe(t){return We("MuiIconButton",t)}const rTe=Ve("MuiIconButton",["root","disabled","colorInherit","colorPrimary","colorSecondary","colorError","colorInfo","colorSuccess","colorWarning","edgeStart","edgeEnd","sizeSmall","sizeMedium","sizeLarge"]),iTe=["edge","children","className","color","disabled","disableFocusRipple","size"],oTe=t=>{const{classes:e,disabled:n,color:r,edge:i,size:o}=t,a={root:["root",n&&"disabled",r!=="default"&&`color${De(r)}`,i&&`edge${De(i)}`,`size${De(o)}`]};return Ue(a,nTe,e)},aTe=we(fs,{name:"MuiIconButton",slot:"Root",overridesResolver:(t,e)=>{const{ownerState:n}=t;return[e.root,n.color!=="default"&&e[`color${De(n.color)}`],n.edge&&e[`edge${De(n.edge)}`],e[`size${De(n.size)}`]]}})(({theme:t,ownerState:e})=>j({textAlign:"center",flex:"0 0 auto",fontSize:t.typography.pxToRem(24),padding:8,borderRadius:"50%",overflow:"visible",color:(t.vars||t).palette.action.active,transition:t.transitions.create("background-color",{duration:t.transitions.duration.shortest})},!e.disableRipple&&{"&:hover":{backgroundColor:t.vars?`rgba(${t.vars.palette.action.activeChannel} / ${t.vars.palette.action.hoverOpacity})`:kt(t.palette.action.active,t.palette.action.hoverOpacity),"@media (hover: none)":{backgroundColor:"transparent"}}},e.edge==="start"&&{marginLeft:e.size==="small"?-3:-12},e.edge==="end"&&{marginRight:e.size==="small"?-3:-12}),({theme:t,ownerState:e})=>{var n;const r=(n=(t.vars||t).palette)==null?void 0:n[e.color];return j({},e.color==="inherit"&&{color:"inherit"},e.color!=="inherit"&&e.color!=="default"&&j({color:r==null?void 0:r.main},!e.disableRipple&&{"&:hover":j({},r&&{backgroundColor:t.vars?`rgba(${r.mainChannel} / ${t.vars.palette.action.hoverOpacity})`:kt(r.main,t.palette.action.hoverOpacity)},{"@media (hover: none)":{backgroundColor:"transparent"}})}),e.size==="small"&&{padding:5,fontSize:t.typography.pxToRem(18)},e.size==="large"&&{padding:12,fontSize:t.typography.pxToRem(28)},{[`&.${rTe.disabled}`]:{backgroundColor:"transparent",color:(t.vars||t).palette.action.disabled}})}),Ot=M.forwardRef(function(e,n){const r=qe({props:e,name:"MuiIconButton"}),{edge:i=!1,children:o,className:a,color:s="default",disabled:l=!1,disableFocusRipple:c=!1,size:u="medium"}=r,f=Ae(r,iTe),d=j({},r,{edge:i,color:s,disabled:l,disableFocusRipple:c,size:u}),h=oTe(d);return w.jsx(aTe,j({className:ke(h.root,a),centerRipple:!0,focusRipple:!c,disabled:l,ref:n},f,{ownerState:d,children:o}))});function sTe(t){return We("MuiTypography",t)}Ve("MuiTypography",["root","h1","h2","h3","h4","h5","h6","subtitle1","subtitle2","body1","body2","inherit","button","caption","overline","alignLeft","alignRight","alignCenter","alignJustify","noWrap","gutterBottom","paragraph"]);const lTe=["align","className","component","gutterBottom","noWrap","paragraph","variant","variantMapping"],cTe=t=>{const{align:e,gutterBottom:n,noWrap:r,paragraph:i,variant:o,classes:a}=t,s={root:["root",o,t.align!=="inherit"&&`align${De(e)}`,n&&"gutterBottom",r&&"noWrap",i&&"paragraph"]};return Ue(s,sTe,a)},uTe=we("span",{name:"MuiTypography",slot:"Root",overridesResolver:(t,e)=>{const{ownerState:n}=t;return[e.root,n.variant&&e[n.variant],n.align!=="inherit"&&e[`align${De(n.align)}`],n.noWrap&&e.noWrap,n.gutterBottom&&e.gutterBottom,n.paragraph&&e.paragraph]}})(({theme:t,ownerState:e})=>j({margin:0},e.variant==="inherit"&&{font:"inherit"},e.variant!=="inherit"&&t.typography[e.variant],e.align!=="inherit"&&{textAlign:e.align},e.noWrap&&{overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},e.gutterBottom&&{marginBottom:"0.35em"},e.paragraph&&{marginBottom:16})),i8={h1:"h1",h2:"h2",h3:"h3",h4:"h4",h5:"h5",h6:"h6",subtitle1:"h6",subtitle2:"h6",body1:"p",body2:"p",inherit:"p"},fTe={primary:"primary.main",textPrimary:"text.primary",secondary:"secondary.main",textSecondary:"text.secondary",error:"error.main"},dTe=t=>fTe[t]||t,At=M.forwardRef(function(e,n){const r=qe({props:e,name:"MuiTypography"}),i=dTe(r.color),o=M1(j({},r,{color:i})),{align:a="inherit",className:s,component:l,gutterBottom:c=!1,noWrap:u=!1,paragraph:f=!1,variant:d="body1",variantMapping:h=i8}=o,p=Ae(o,lTe),m=j({},o,{align:a,color:i,className:s,component:l,gutterBottom:c,noWrap:u,paragraph:f,variant:d,variantMapping:h}),g=l||(f?"p":h[d]||i8[d])||"span",v=cTe(m);return w.jsx(uTe,j({as:g,ref:n,ownerState:m,className:ke(v.root,s)},p))});function hTe(t){return We("MuiAppBar",t)}Ve("MuiAppBar",["root","positionFixed","positionAbsolute","positionSticky","positionStatic","positionRelative","colorDefault","colorPrimary","colorSecondary","colorInherit","colorTransparent","colorError","colorInfo","colorSuccess","colorWarning"]);const pTe=["className","color","enableColorOnDark","position"],mTe=t=>{const{color:e,position:n,classes:r}=t,i={root:["root",`color${De(e)}`,`position${De(n)}`]};return Ue(i,hTe,r)},rS=(t,e)=>t?`${t==null?void 0:t.replace(")","")}, ${e})`:e,gTe=we(Ho,{name:"MuiAppBar",slot:"Root",overridesResolver:(t,e)=>{const{ownerState:n}=t;return[e.root,e[`position${De(n.position)}`],e[`color${De(n.color)}`]]}})(({theme:t,ownerState:e})=>{const n=t.palette.mode==="light"?t.palette.grey[100]:t.palette.grey[900];return j({display:"flex",flexDirection:"column",width:"100%",boxSizing:"border-box",flexShrink:0},e.position==="fixed"&&{position:"fixed",zIndex:(t.vars||t).zIndex.appBar,top:0,left:"auto",right:0,"@media print":{position:"absolute"}},e.position==="absolute"&&{position:"absolute",zIndex:(t.vars||t).zIndex.appBar,top:0,left:"auto",right:0},e.position==="sticky"&&{position:"sticky",zIndex:(t.vars||t).zIndex.appBar,top:0,left:"auto",right:0},e.position==="static"&&{position:"static"},e.position==="relative"&&{position:"relative"},!t.vars&&j({},e.color==="default"&&{backgroundColor:n,color:t.palette.getContrastText(n)},e.color&&e.color!=="default"&&e.color!=="inherit"&&e.color!=="transparent"&&{backgroundColor:t.palette[e.color].main,color:t.palette[e.color].contrastText},e.color==="inherit"&&{color:"inherit"},t.palette.mode==="dark"&&!e.enableColorOnDark&&{backgroundColor:null,color:null},e.color==="transparent"&&j({backgroundColor:"transparent",color:"inherit"},t.palette.mode==="dark"&&{backgroundImage:"none"})),t.vars&&j({},e.color==="default"&&{"--AppBar-background":e.enableColorOnDark?t.vars.palette.AppBar.defaultBg:rS(t.vars.palette.AppBar.darkBg,t.vars.palette.AppBar.defaultBg),"--AppBar-color":e.enableColorOnDark?t.vars.palette.text.primary:rS(t.vars.palette.AppBar.darkColor,t.vars.palette.text.primary)},e.color&&!e.color.match(/^(default|inherit|transparent)$/)&&{"--AppBar-background":e.enableColorOnDark?t.vars.palette[e.color].main:rS(t.vars.palette.AppBar.darkBg,t.vars.palette[e.color].main),"--AppBar-color":e.enableColorOnDark?t.vars.palette[e.color].contrastText:rS(t.vars.palette.AppBar.darkColor,t.vars.palette[e.color].contrastText)},{backgroundColor:"var(--AppBar-background)",color:e.color==="inherit"?"inherit":"var(--AppBar-color)"},e.color==="transparent"&&{backgroundImage:"none",backgroundColor:"transparent",color:"inherit"}))}),_re=M.forwardRef(function(e,n){const r=qe({props:e,name:"MuiAppBar"}),{className:i,color:o="primary",enableColorOnDark:a=!1,position:s="fixed"}=r,l=Ae(r,pTe),c=j({},r,{color:o,position:s,enableColorOnDark:a}),u=mTe(c);return w.jsx(gTe,j({square:!0,component:"header",ownerState:c,elevation:4,className:ke(u.root,i,s==="fixed"&&"mui-fixed"),ref:n},l))}),wre="base";function vTe(t){return`${wre}--${t}`}function yTe(t,e){return`${wre}-${t}-${e}`}function Sre(t,e){const n=Hne[e];return n?vTe(n):yTe(t,e)}function xTe(t,e){const n={};return e.forEach(r=>{n[r]=Sre(t,r)}),n}function o8(t){return t.substring(2).toLowerCase()}function bTe(t,e){return e.documentElement.clientWidth<t.clientX||e.documentElement.clientHeight<t.clientY}function _Te(t){const{children:e,disableReactTree:n=!1,mouseEvent:r="onClick",onClickAway:i,touchEvent:o="onTouchEnd"}=t,a=M.useRef(!1),s=M.useRef(null),l=M.useRef(!1),c=M.useRef(!1);M.useEffect(()=>(setTimeout(()=>{l.current=!0},0),()=>{l.current=!1}),[]);const u=Zt(e.ref,s),f=_r(p=>{const m=c.current;c.current=!1;const g=$n(s.current);if(!l.current||!s.current||"clientX"in p&&bTe(p,g))return;if(a.current){a.current=!1;return}let v;p.composedPath?v=p.composedPath().indexOf(s.current)>-1:v=!g.documentElement.contains(p.target)||s.current.contains(p.target),!v&&(n||!m)&&i(p)}),d=p=>m=>{c.current=!0;const g=e.props[p];g&&g(m)},h={ref:u};return o!==!1&&(h[o]=d(o)),M.useEffect(()=>{if(o!==!1){const p=o8(o),m=$n(s.current),g=()=>{a.current=!0};return m.addEventListener(p,f),m.addEventListener("touchmove",g),()=>{m.removeEventListener(p,f),m.removeEventListener("touchmove",g)}}},[f,o]),r!==!1&&(h[r]=d(r)),M.useEffect(()=>{if(r!==!1){const p=o8(r),m=$n(s.current);return m.addEventListener(p,f),()=>{m.removeEventListener(p,f)}}},[f,r]),w.jsx(M.Fragment,{children:M.cloneElement(e,h)})}const wTe=["input","select","textarea","a[href]","button","[tabindex]","audio[controls]","video[controls]",'[contenteditable]:not([contenteditable="false"])'].join(",");function STe(t){const e=parseInt(t.getAttribute("tabindex")||"",10);return Number.isNaN(e)?t.contentEditable==="true"||(t.nodeName==="AUDIO"||t.nodeName==="VIDEO"||t.nodeName==="DETAILS")&&t.getAttribute("tabindex")===null?0:t.tabIndex:e}function OTe(t){if(t.tagName!=="INPUT"||t.type!=="radio"||!t.name)return!1;const e=r=>t.ownerDocument.querySelector(`input[type="radio"]${r}`);let n=e(`[name="${t.name}"]:checked`);return n||(n=e(`[name="${t.name}"]`)),n!==t}function CTe(t){return!(t.disabled||t.tagName==="INPUT"&&t.type==="hidden"||OTe(t))}function TTe(t){const e=[],n=[];return Array.from(t.querySelectorAll(wTe)).forEach((r,i)=>{const o=STe(r);o===-1||!CTe(r)||(o===0?e.push(r):n.push({documentOrder:i,tabIndex:o,node:r}))}),n.sort((r,i)=>r.tabIndex===i.tabIndex?r.documentOrder-i.documentOrder:r.tabIndex-i.tabIndex).map(r=>r.node).concat(e)}function ETe(){return!0}function Ore(t){const{children:e,disableAutoFocus:n=!1,disableEnforceFocus:r=!1,disableRestoreFocus:i=!1,getTabbable:o=TTe,isEnabled:a=ETe,open:s}=t,l=M.useRef(!1),c=M.useRef(null),u=M.useRef(null),f=M.useRef(null),d=M.useRef(null),h=M.useRef(!1),p=M.useRef(null),m=Zt(e.ref,p),g=M.useRef(null);M.useEffect(()=>{!s||!p.current||(h.current=!n)},[n,s]),M.useEffect(()=>{if(!s||!p.current)return;const x=$n(p.current);return p.current.contains(x.activeElement)||(p.current.hasAttribute("tabIndex")||p.current.setAttribute("tabIndex","-1"),h.current&&p.current.focus()),()=>{i||(f.current&&f.current.focus&&(l.current=!0,f.current.focus()),f.current=null)}},[s]),M.useEffect(()=>{if(!s||!p.current)return;const x=$n(p.current),b=O=>{g.current=O,!(r||!a()||O.key!=="Tab")&&x.activeElement===p.current&&O.shiftKey&&(l.current=!0,u.current&&u.current.focus())},_=()=>{const O=p.current;if(O===null)return;if(!x.hasFocus()||!a()||l.current){l.current=!1;return}if(O.contains(x.activeElement)||r&&x.activeElement!==c.current&&x.activeElement!==u.current)return;if(x.activeElement!==d.current)d.current=null;else if(d.current!==null)return;if(!h.current)return;let C=[];if((x.activeElement===c.current||x.activeElement===u.current)&&(C=o(p.current)),C.length>0){var E,k;const I=!!((E=g.current)!=null&&E.shiftKey&&((k=g.current)==null?void 0:k.key)==="Tab"),P=C[0],R=C[C.length-1];typeof P!="string"&&typeof R!="string"&&(I?R.focus():P.focus())}else O.focus()};x.addEventListener("focusin",_),x.addEventListener("keydown",b,!0);const S=setInterval(()=>{x.activeElement&&x.activeElement.tagName==="BODY"&&_()},50);return()=>{clearInterval(S),x.removeEventListener("focusin",_),x.removeEventListener("keydown",b,!0)}},[n,r,i,a,s,o]);const v=x=>{f.current===null&&(f.current=x.relatedTarget),h.current=!0,d.current=x.target;const b=e.props.onFocus;b&&b(x)},y=x=>{f.current===null&&(f.current=x.relatedTarget),h.current=!0};return w.jsxs(M.Fragment,{children:[w.jsx("div",{tabIndex:s?0:-1,onFocus:y,ref:c,"data-testid":"sentinelStart"}),M.cloneElement(e,{ref:m,onFocus:v}),w.jsx("div",{tabIndex:s?0:-1,onFocus:y,ref:u,"data-testid":"sentinelEnd"})]})}function PTe(t){return typeof t=="function"?t():t}const Cre=M.forwardRef(function(e,n){const{children:r,container:i,disablePortal:o=!1}=e,[a,s]=M.useState(null),l=Zt(M.isValidElement(r)?r.ref:null,n);if(Hr(()=>{o||s(PTe(i)||document.body)},[i,o]),Hr(()=>{if(a&&!o)return CT(n,a),()=>{CT(n,null)}},[n,a,o]),o){if(M.isValidElement(r)){const c={ref:l};return M.cloneElement(r,c)}return w.jsx(M.Fragment,{children:r})}return w.jsx(M.Fragment,{children:a&&qv.createPortal(r,a)})});function MTe(t){const e=$n(t);return e.body===t?cs(t).innerWidth>e.documentElement.clientWidth:t.scrollHeight>t.clientHeight}function Fx(t,e){e?t.setAttribute("aria-hidden","true"):t.removeAttribute("aria-hidden")}function a8(t){return parseInt(cs(t).getComputedStyle(t).paddingRight,10)||0}function kTe(t){const n=["TEMPLATE","SCRIPT","STYLE","LINK","MAP","META","NOSCRIPT","PICTURE","COL","COLGROUP","PARAM","SLOT","SOURCE","TRACK"].indexOf(t.tagName)!==-1,r=t.tagName==="INPUT"&&t.getAttribute("type")==="hidden";return n||r}function s8(t,e,n,r,i){const o=[e,n,...r];[].forEach.call(t.children,a=>{const s=o.indexOf(a)===-1,l=!kTe(a);s&&l&&Fx(a,i)})}function TA(t,e){let n=-1;return t.some((r,i)=>e(r)?(n=i,!0):!1),n}function ATe(t,e){const n=[],r=t.container;if(!e.disableScrollLock){if(MTe(r)){const a=nre($n(r));n.push({value:r.style.paddingRight,property:"padding-right",el:r}),r.style.paddingRight=`${a8(r)+a}px`;const s=$n(r).querySelectorAll(".mui-fixed");[].forEach.call(s,l=>{n.push({value:l.style.paddingRight,property:"padding-right",el:l}),l.style.paddingRight=`${a8(l)+a}px`})}let o;if(r.parentNode instanceof DocumentFragment)o=$n(r).body;else{const a=r.parentElement,s=cs(r);o=(a==null?void 0:a.nodeName)==="HTML"&&s.getComputedStyle(a).overflowY==="scroll"?a:r}n.push({value:o.style.overflow,property:"overflow",el:o},{value:o.style.overflowX,property:"overflow-x",el:o},{value:o.style.overflowY,property:"overflow-y",el:o}),o.style.overflow="hidden"}return()=>{n.forEach(({value:o,el:a,property:s})=>{o?a.style.setProperty(s,o):a.style.removeProperty(s)})}}function RTe(t){const e=[];return[].forEach.call(t.children,n=>{n.getAttribute("aria-hidden")==="true"&&e.push(n)}),e}class ITe{constructor(){this.containers=void 0,this.modals=void 0,this.modals=[],this.containers=[]}add(e,n){let r=this.modals.indexOf(e);if(r!==-1)return r;r=this.modals.length,this.modals.push(e),e.modalRef&&Fx(e.modalRef,!1);const i=RTe(n);s8(n,e.mount,e.modalRef,i,!0);const o=TA(this.containers,a=>a.container===n);return o!==-1?(this.containers[o].modals.push(e),r):(this.containers.push({modals:[e],container:n,restore:null,hiddenSiblings:i}),r)}mount(e,n){const r=TA(this.containers,o=>o.modals.indexOf(e)!==-1),i=this.containers[r];i.restore||(i.restore=ATe(i,n))}remove(e,n=!0){const r=this.modals.indexOf(e);if(r===-1)return r;const i=TA(this.containers,a=>a.modals.indexOf(e)!==-1),o=this.containers[i];if(o.modals.splice(o.modals.indexOf(e),1),this.modals.splice(r,1),o.modals.length===0)o.restore&&o.restore(),e.modalRef&&Fx(e.modalRef,n),s8(o.container,e.mount,e.modalRef,o.hiddenSiblings,!1),this.containers.splice(i,1);else{const a=o.modals[o.modals.length-1];a.modalRef&&Fx(a.modalRef,!1)}return r}isTopModal(e){return this.modals.length>0&&this.modals[this.modals.length-1]===e}}function DTe(t){return typeof t=="function"?t():t}function LTe(t){return t?t.props.hasOwnProperty("in"):!1}const NTe=new ITe;function $Te(t){const{container:e,disableEscapeKeyDown:n=!1,disableScrollLock:r=!1,manager:i=NTe,closeAfterTransition:o=!1,onTransitionEnter:a,onTransitionExited:s,children:l,onClose:c,open:u,rootRef:f}=t,d=M.useRef({}),h=M.useRef(null),p=M.useRef(null),m=Zt(p,f),[g,v]=M.useState(!u),y=LTe(l);let x=!0;(t["aria-hidden"]==="false"||t["aria-hidden"]===!1)&&(x=!1);const b=()=>$n(h.current),_=()=>(d.current.modalRef=p.current,d.current.mount=h.current,d.current),S=()=>{i.mount(_(),{disableScrollLock:r}),p.current&&(p.current.scrollTop=0)},O=_r(()=>{const z=DTe(e)||b().body;i.add(_(),z),p.current&&S()}),C=M.useCallback(()=>i.isTopModal(_()),[i]),E=_r(z=>{h.current=z,z&&(u&&C()?S():p.current&&Fx(p.current,x))}),k=M.useCallback(()=>{i.remove(_(),x)},[x,i]);M.useEffect(()=>()=>{k()},[k]),M.useEffect(()=>{u?O():(!y||!o)&&k()},[u,k,y,o,O]);const I=z=>B=>{var U;(U=z.onKeyDown)==null||U.call(z,B),!(B.key!=="Escape"||B.which===229||!C())&&(n||(B.stopPropagation(),c&&c(B,"escapeKeyDown")))},P=z=>B=>{var U;(U=z.onClick)==null||U.call(z,B),B.target===B.currentTarget&&c&&c(B,"backdropClick")};return{getRootProps:(z={})=>{const B=Nh(t);delete B.onTransitionEnter,delete B.onTransitionExited;const U=j({},B,z);return j({role:"presentation"},U,{onKeyDown:I(U),ref:m})},getBackdropProps:(z={})=>{const B=z;return j({"aria-hidden":!0},B,{onClick:P(B),open:u})},getTransitionProps:()=>{const z=()=>{v(!1),a&&a()},B=()=>{v(!0),s&&s(),o&&k()};return{onEnter:OT(z,l==null?void 0:l.props.onEnter),onExited:OT(B,l==null?void 0:l.props.onExited)}},rootRef:m,portalRef:E,isTopModal:C,exited:g,hasTransition:y}}var No="top",ds="bottom",hs="right",$o="left",h5="auto",N1=[No,ds,hs,$o],Qg="start",Ib="end",FTe="clippingParents",Tre="viewport",d0="popper",jTe="reference",l8=N1.reduce(function(t,e){return t.concat([e+"-"+Qg,e+"-"+Ib])},[]),Ere=[].concat(N1,[h5]).reduce(function(t,e){return t.concat([e,e+"-"+Qg,e+"-"+Ib])},[]),BTe="beforeRead",zTe="read",UTe="afterRead",WTe="beforeMain",VTe="main",GTe="afterMain",HTe="beforeWrite",qTe="write",XTe="afterWrite",QTe=[BTe,zTe,UTe,WTe,VTe,GTe,HTe,qTe,XTe];function Jl(t){return t?(t.nodeName||"").toLowerCase():null}function Sa(t){if(t==null)return window;if(t.toString()!=="[object Window]"){var e=t.ownerDocument;return e&&e.defaultView||window}return t}function Jh(t){var e=Sa(t).Element;return t instanceof e||t instanceof Element}function es(t){var e=Sa(t).HTMLElement;return t instanceof e||t instanceof HTMLElement}function p5(t){if(typeof ShadowRoot>"u")return!1;var e=Sa(t).ShadowRoot;return t instanceof e||t instanceof ShadowRoot}function YTe(t){var e=t.state;Object.keys(e.elements).forEach(function(n){var r=e.styles[n]||{},i=e.attributes[n]||{},o=e.elements[n];!es(o)||!Jl(o)||(Object.assign(o.style,r),Object.keys(i).forEach(function(a){var s=i[a];s===!1?o.removeAttribute(a):o.setAttribute(a,s===!0?"":s)}))})}function KTe(t){var e=t.state,n={popper:{position:e.options.strategy,left:"0",top:"0",margin:"0"},arrow:{position:"absolute"},reference:{}};return Object.assign(e.elements.popper.style,n.popper),e.styles=n,e.elements.arrow&&Object.assign(e.elements.arrow.style,n.arrow),function(){Object.keys(e.elements).forEach(function(r){var i=e.elements[r],o=e.attributes[r]||{},a=Object.keys(e.styles.hasOwnProperty(r)?e.styles[r]:n[r]),s=a.reduce(function(l,c){return l[c]="",l},{});!es(i)||!Jl(i)||(Object.assign(i.style,s),Object.keys(o).forEach(function(l){i.removeAttribute(l)}))})}}const ZTe={name:"applyStyles",enabled:!0,phase:"write",fn:YTe,effect:KTe,requires:["computeStyles"]};function Gl(t){return t.split("-")[0]}var $h=Math.max,MT=Math.min,Yg=Math.round;function jL(){var t=navigator.userAgentData;return t!=null&&t.brands&&Array.isArray(t.brands)?t.brands.map(function(e){return e.brand+"/"+e.version}).join(" "):navigator.userAgent}function Pre(){return!/^((?!chrome|android).)*safari/i.test(jL())}function Kg(t,e,n){e===void 0&&(e=!1),n===void 0&&(n=!1);var r=t.getBoundingClientRect(),i=1,o=1;e&&es(t)&&(i=t.offsetWidth>0&&Yg(r.width)/t.offsetWidth||1,o=t.offsetHeight>0&&Yg(r.height)/t.offsetHeight||1);var a=Jh(t)?Sa(t):window,s=a.visualViewport,l=!Pre()&&n,c=(r.left+(l&&s?s.offsetLeft:0))/i,u=(r.top+(l&&s?s.offsetTop:0))/o,f=r.width/i,d=r.height/o;return{width:f,height:d,top:u,right:c+f,bottom:u+d,left:c,x:c,y:u}}function m5(t){var e=Kg(t),n=t.offsetWidth,r=t.offsetHeight;return Math.abs(e.width-n)<=1&&(n=e.width),Math.abs(e.height-r)<=1&&(r=e.height),{x:t.offsetLeft,y:t.offsetTop,width:n,height:r}}function Mre(t,e){var n=e.getRootNode&&e.getRootNode();if(t.contains(e))return!0;if(n&&p5(n)){var r=e;do{if(r&&t.isSameNode(r))return!0;r=r.parentNode||r.host}while(r)}return!1}function du(t){return Sa(t).getComputedStyle(t)}function JTe(t){return["table","td","th"].indexOf(Jl(t))>=0}function md(t){return((Jh(t)?t.ownerDocument:t.document)||window.document).documentElement}function HM(t){return Jl(t)==="html"?t:t.assignedSlot||t.parentNode||(p5(t)?t.host:null)||md(t)}function c8(t){return!es(t)||du(t).position==="fixed"?null:t.offsetParent}function eEe(t){var e=/firefox/i.test(jL()),n=/Trident/i.test(jL());if(n&&es(t)){var r=du(t);if(r.position==="fixed")return null}var i=HM(t);for(p5(i)&&(i=i.host);es(i)&&["html","body"].indexOf(Jl(i))<0;){var o=du(i);if(o.transform!=="none"||o.perspective!=="none"||o.contain==="paint"||["transform","perspective"].indexOf(o.willChange)!==-1||e&&o.willChange==="filter"||e&&o.filter&&o.filter!=="none")return i;i=i.parentNode}return null}function $1(t){for(var e=Sa(t),n=c8(t);n&&JTe(n)&&du(n).position==="static";)n=c8(n);return n&&(Jl(n)==="html"||Jl(n)==="body"&&du(n).position==="static")?e:n||eEe(t)||e}function g5(t){return["top","bottom"].indexOf(t)>=0?"x":"y"}function jx(t,e,n){return $h(t,MT(e,n))}function tEe(t,e,n){var r=jx(t,e,n);return r>n?n:r}function kre(){return{top:0,right:0,bottom:0,left:0}}function Are(t){return Object.assign({},kre(),t)}function Rre(t,e){return e.reduce(function(n,r){return n[r]=t,n},{})}var nEe=function(e,n){return e=typeof e=="function"?e(Object.assign({},n.rects,{placement:n.placement})):e,Are(typeof e!="number"?e:Rre(e,N1))};function rEe(t){var e,n=t.state,r=t.name,i=t.options,o=n.elements.arrow,a=n.modifiersData.popperOffsets,s=Gl(n.placement),l=g5(s),c=[$o,hs].indexOf(s)>=0,u=c?"height":"width";if(!(!o||!a)){var f=nEe(i.padding,n),d=m5(o),h=l==="y"?No:$o,p=l==="y"?ds:hs,m=n.rects.reference[u]+n.rects.reference[l]-a[l]-n.rects.popper[u],g=a[l]-n.rects.reference[l],v=$1(o),y=v?l==="y"?v.clientHeight||0:v.clientWidth||0:0,x=m/2-g/2,b=f[h],_=y-d[u]-f[p],S=y/2-d[u]/2+x,O=jx(b,S,_),C=l;n.modifiersData[r]=(e={},e[C]=O,e.centerOffset=O-S,e)}}function iEe(t){var e=t.state,n=t.options,r=n.element,i=r===void 0?"[data-popper-arrow]":r;i!=null&&(typeof i=="string"&&(i=e.elements.popper.querySelector(i),!i)||Mre(e.elements.popper,i)&&(e.elements.arrow=i))}const oEe={name:"arrow",enabled:!0,phase:"main",fn:rEe,effect:iEe,requires:["popperOffsets"],requiresIfExists:["preventOverflow"]};function Zg(t){return t.split("-")[1]}var aEe={top:"auto",right:"auto",bottom:"auto",left:"auto"};function sEe(t,e){var n=t.x,r=t.y,i=e.devicePixelRatio||1;return{x:Yg(n*i)/i||0,y:Yg(r*i)/i||0}}function u8(t){var e,n=t.popper,r=t.popperRect,i=t.placement,o=t.variation,a=t.offsets,s=t.position,l=t.gpuAcceleration,c=t.adaptive,u=t.roundOffsets,f=t.isFixed,d=a.x,h=d===void 0?0:d,p=a.y,m=p===void 0?0:p,g=typeof u=="function"?u({x:h,y:m}):{x:h,y:m};h=g.x,m=g.y;var v=a.hasOwnProperty("x"),y=a.hasOwnProperty("y"),x=$o,b=No,_=window;if(c){var S=$1(n),O="clientHeight",C="clientWidth";if(S===Sa(n)&&(S=md(n),du(S).position!=="static"&&s==="absolute"&&(O="scrollHeight",C="scrollWidth")),S=S,i===No||(i===$o||i===hs)&&o===Ib){b=ds;var E=f&&S===_&&_.visualViewport?_.visualViewport.height:S[O];m-=E-r.height,m*=l?1:-1}if(i===$o||(i===No||i===ds)&&o===Ib){x=hs;var k=f&&S===_&&_.visualViewport?_.visualViewport.width:S[C];h-=k-r.width,h*=l?1:-1}}var I=Object.assign({position:s},c&&aEe),P=u===!0?sEe({x:h,y:m},Sa(n)):{x:h,y:m};if(h=P.x,m=P.y,l){var R;return Object.assign({},I,(R={},R[b]=y?"0":"",R[x]=v?"0":"",R.transform=(_.devicePixelRatio||1)<=1?"translate("+h+"px, "+m+"px)":"translate3d("+h+"px, "+m+"px, 0)",R))}return Object.assign({},I,(e={},e[b]=y?m+"px":"",e[x]=v?h+"px":"",e.transform="",e))}function lEe(t){var e=t.state,n=t.options,r=n.gpuAcceleration,i=r===void 0?!0:r,o=n.adaptive,a=o===void 0?!0:o,s=n.roundOffsets,l=s===void 0?!0:s,c={placement:Gl(e.placement),variation:Zg(e.placement),popper:e.elements.popper,popperRect:e.rects.popper,gpuAcceleration:i,isFixed:e.options.strategy==="fixed"};e.modifiersData.popperOffsets!=null&&(e.styles.popper=Object.assign({},e.styles.popper,u8(Object.assign({},c,{offsets:e.modifiersData.popperOffsets,position:e.options.strategy,adaptive:a,roundOffsets:l})))),e.modifiersData.arrow!=null&&(e.styles.arrow=Object.assign({},e.styles.arrow,u8(Object.assign({},c,{offsets:e.modifiersData.arrow,position:"absolute",adaptive:!1,roundOffsets:l})))),e.attributes.popper=Object.assign({},e.attributes.popper,{"data-popper-placement":e.placement})}const cEe={name:"computeStyles",enabled:!0,phase:"beforeWrite",fn:lEe,data:{}};var iS={passive:!0};function uEe(t){var e=t.state,n=t.instance,r=t.options,i=r.scroll,o=i===void 0?!0:i,a=r.resize,s=a===void 0?!0:a,l=Sa(e.elements.popper),c=[].concat(e.scrollParents.reference,e.scrollParents.popper);return o&&c.forEach(function(u){u.addEventListener("scroll",n.update,iS)}),s&&l.addEventListener("resize",n.update,iS),function(){o&&c.forEach(function(u){u.removeEventListener("scroll",n.update,iS)}),s&&l.removeEventListener("resize",n.update,iS)}}const fEe={name:"eventListeners",enabled:!0,phase:"write",fn:function(){},effect:uEe,data:{}};var dEe={left:"right",right:"left",bottom:"top",top:"bottom"};function PC(t){return t.replace(/left|right|bottom|top/g,function(e){return dEe[e]})}var hEe={start:"end",end:"start"};function f8(t){return t.replace(/start|end/g,function(e){return hEe[e]})}function v5(t){var e=Sa(t),n=e.pageXOffset,r=e.pageYOffset;return{scrollLeft:n,scrollTop:r}}function y5(t){return Kg(md(t)).left+v5(t).scrollLeft}function pEe(t,e){var n=Sa(t),r=md(t),i=n.visualViewport,o=r.clientWidth,a=r.clientHeight,s=0,l=0;if(i){o=i.width,a=i.height;var c=Pre();(c||!c&&e==="fixed")&&(s=i.offsetLeft,l=i.offsetTop)}return{width:o,height:a,x:s+y5(t),y:l}}function mEe(t){var e,n=md(t),r=v5(t),i=(e=t.ownerDocument)==null?void 0:e.body,o=$h(n.scrollWidth,n.clientWidth,i?i.scrollWidth:0,i?i.clientWidth:0),a=$h(n.scrollHeight,n.clientHeight,i?i.scrollHeight:0,i?i.clientHeight:0),s=-r.scrollLeft+y5(t),l=-r.scrollTop;return du(i||n).direction==="rtl"&&(s+=$h(n.clientWidth,i?i.clientWidth:0)-o),{width:o,height:a,x:s,y:l}}function x5(t){var e=du(t),n=e.overflow,r=e.overflowX,i=e.overflowY;return/auto|scroll|overlay|hidden/.test(n+i+r)}function Ire(t){return["html","body","#document"].indexOf(Jl(t))>=0?t.ownerDocument.body:es(t)&&x5(t)?t:Ire(HM(t))}function Bx(t,e){var n;e===void 0&&(e=[]);var r=Ire(t),i=r===((n=t.ownerDocument)==null?void 0:n.body),o=Sa(r),a=i?[o].concat(o.visualViewport||[],x5(r)?r:[]):r,s=e.concat(a);return i?s:s.concat(Bx(HM(a)))}function BL(t){return Object.assign({},t,{left:t.x,top:t.y,right:t.x+t.width,bottom:t.y+t.height})}function gEe(t,e){var n=Kg(t,!1,e==="fixed");return n.top=n.top+t.clientTop,n.left=n.left+t.clientLeft,n.bottom=n.top+t.clientHeight,n.right=n.left+t.clientWidth,n.width=t.clientWidth,n.height=t.clientHeight,n.x=n.left,n.y=n.top,n}function d8(t,e,n){return e===Tre?BL(pEe(t,n)):Jh(e)?gEe(e,n):BL(mEe(md(t)))}function vEe(t){var e=Bx(HM(t)),n=["absolute","fixed"].indexOf(du(t).position)>=0,r=n&&es(t)?$1(t):t;return Jh(r)?e.filter(function(i){return Jh(i)&&Mre(i,r)&&Jl(i)!=="body"}):[]}function yEe(t,e,n,r){var i=e==="clippingParents"?vEe(t):[].concat(e),o=[].concat(i,[n]),a=o[0],s=o.reduce(function(l,c){var u=d8(t,c,r);return l.top=$h(u.top,l.top),l.right=MT(u.right,l.right),l.bottom=MT(u.bottom,l.bottom),l.left=$h(u.left,l.left),l},d8(t,a,r));return s.width=s.right-s.left,s.height=s.bottom-s.top,s.x=s.left,s.y=s.top,s}function Dre(t){var e=t.reference,n=t.element,r=t.placement,i=r?Gl(r):null,o=r?Zg(r):null,a=e.x+e.width/2-n.width/2,s=e.y+e.height/2-n.height/2,l;switch(i){case No:l={x:a,y:e.y-n.height};break;case ds:l={x:a,y:e.y+e.height};break;case hs:l={x:e.x+e.width,y:s};break;case $o:l={x:e.x-n.width,y:s};break;default:l={x:e.x,y:e.y}}var c=i?g5(i):null;if(c!=null){var u=c==="y"?"height":"width";switch(o){case Qg:l[c]=l[c]-(e[u]/2-n[u]/2);break;case Ib:l[c]=l[c]+(e[u]/2-n[u]/2);break}}return l}function Db(t,e){e===void 0&&(e={});var n=e,r=n.placement,i=r===void 0?t.placement:r,o=n.strategy,a=o===void 0?t.strategy:o,s=n.boundary,l=s===void 0?FTe:s,c=n.rootBoundary,u=c===void 0?Tre:c,f=n.elementContext,d=f===void 0?d0:f,h=n.altBoundary,p=h===void 0?!1:h,m=n.padding,g=m===void 0?0:m,v=Are(typeof g!="number"?g:Rre(g,N1)),y=d===d0?jTe:d0,x=t.rects.popper,b=t.elements[p?y:d],_=yEe(Jh(b)?b:b.contextElement||md(t.elements.popper),l,u,a),S=Kg(t.elements.reference),O=Dre({reference:S,element:x,strategy:"absolute",placement:i}),C=BL(Object.assign({},x,O)),E=d===d0?C:S,k={top:_.top-E.top+v.top,bottom:E.bottom-_.bottom+v.bottom,left:_.left-E.left+v.left,right:E.right-_.right+v.right},I=t.modifiersData.offset;if(d===d0&&I){var P=I[i];Object.keys(k).forEach(function(R){var T=[hs,ds].indexOf(R)>=0?1:-1,L=[No,ds].indexOf(R)>=0?"y":"x";k[R]+=P[L]*T})}return k}function xEe(t,e){e===void 0&&(e={});var n=e,r=n.placement,i=n.boundary,o=n.rootBoundary,a=n.padding,s=n.flipVariations,l=n.allowedAutoPlacements,c=l===void 0?Ere:l,u=Zg(r),f=u?s?l8:l8.filter(function(p){return Zg(p)===u}):N1,d=f.filter(function(p){return c.indexOf(p)>=0});d.length===0&&(d=f);var h=d.reduce(function(p,m){return p[m]=Db(t,{placement:m,boundary:i,rootBoundary:o,padding:a})[Gl(m)],p},{});return Object.keys(h).sort(function(p,m){return h[p]-h[m]})}function bEe(t){if(Gl(t)===h5)return[];var e=PC(t);return[f8(t),e,f8(e)]}function _Ee(t){var e=t.state,n=t.options,r=t.name;if(!e.modifiersData[r]._skip){for(var i=n.mainAxis,o=i===void 0?!0:i,a=n.altAxis,s=a===void 0?!0:a,l=n.fallbackPlacements,c=n.padding,u=n.boundary,f=n.rootBoundary,d=n.altBoundary,h=n.flipVariations,p=h===void 0?!0:h,m=n.allowedAutoPlacements,g=e.options.placement,v=Gl(g),y=v===g,x=l||(y||!p?[PC(g)]:bEe(g)),b=[g].concat(x).reduce(function(q,Y){return q.concat(Gl(Y)===h5?xEe(e,{placement:Y,boundary:u,rootBoundary:f,padding:c,flipVariations:p,allowedAutoPlacements:m}):Y)},[]),_=e.rects.reference,S=e.rects.popper,O=new Map,C=!0,E=b[0],k=0;k<b.length;k++){var I=b[k],P=Gl(I),R=Zg(I)===Qg,T=[No,ds].indexOf(P)>=0,L=T?"width":"height",z=Db(e,{placement:I,boundary:u,rootBoundary:f,altBoundary:d,padding:c}),B=T?R?hs:$o:R?ds:No;_[L]>S[L]&&(B=PC(B));var U=PC(B),W=[];if(o&&W.push(z[P]<=0),s&&W.push(z[B]<=0,z[U]<=0),W.every(function(q){return q})){E=I,C=!1;break}O.set(I,W)}if(C)for(var $=p?3:1,N=function(Y){var K=b.find(function(se){var te=O.get(se);if(te)return te.slice(0,Y).every(function(J){return J})});if(K)return E=K,"break"},D=$;D>0;D--){var A=N(D);if(A==="break")break}e.placement!==E&&(e.modifiersData[r]._skip=!0,e.placement=E,e.reset=!0)}}const wEe={name:"flip",enabled:!0,phase:"main",fn:_Ee,requiresIfExists:["offset"],data:{_skip:!1}};function h8(t,e,n){return n===void 0&&(n={x:0,y:0}),{top:t.top-e.height-n.y,right:t.right-e.width+n.x,bottom:t.bottom-e.height+n.y,left:t.left-e.width-n.x}}function p8(t){return[No,hs,ds,$o].some(function(e){return t[e]>=0})}function SEe(t){var e=t.state,n=t.name,r=e.rects.reference,i=e.rects.popper,o=e.modifiersData.preventOverflow,a=Db(e,{elementContext:"reference"}),s=Db(e,{altBoundary:!0}),l=h8(a,r),c=h8(s,i,o),u=p8(l),f=p8(c);e.modifiersData[n]={referenceClippingOffsets:l,popperEscapeOffsets:c,isReferenceHidden:u,hasPopperEscaped:f},e.attributes.popper=Object.assign({},e.attributes.popper,{"data-popper-reference-hidden":u,"data-popper-escaped":f})}const OEe={name:"hide",enabled:!0,phase:"main",requiresIfExists:["preventOverflow"],fn:SEe};function CEe(t,e,n){var r=Gl(t),i=[$o,No].indexOf(r)>=0?-1:1,o=typeof n=="function"?n(Object.assign({},e,{placement:t})):n,a=o[0],s=o[1];return a=a||0,s=(s||0)*i,[$o,hs].indexOf(r)>=0?{x:s,y:a}:{x:a,y:s}}function TEe(t){var e=t.state,n=t.options,r=t.name,i=n.offset,o=i===void 0?[0,0]:i,a=Ere.reduce(function(u,f){return u[f]=CEe(f,e.rects,o),u},{}),s=a[e.placement],l=s.x,c=s.y;e.modifiersData.popperOffsets!=null&&(e.modifiersData.popperOffsets.x+=l,e.modifiersData.popperOffsets.y+=c),e.modifiersData[r]=a}const EEe={name:"offset",enabled:!0,phase:"main",requires:["popperOffsets"],fn:TEe};function PEe(t){var e=t.state,n=t.name;e.modifiersData[n]=Dre({reference:e.rects.reference,element:e.rects.popper,strategy:"absolute",placement:e.placement})}const MEe={name:"popperOffsets",enabled:!0,phase:"read",fn:PEe,data:{}};function kEe(t){return t==="x"?"y":"x"}function AEe(t){var e=t.state,n=t.options,r=t.name,i=n.mainAxis,o=i===void 0?!0:i,a=n.altAxis,s=a===void 0?!1:a,l=n.boundary,c=n.rootBoundary,u=n.altBoundary,f=n.padding,d=n.tether,h=d===void 0?!0:d,p=n.tetherOffset,m=p===void 0?0:p,g=Db(e,{boundary:l,rootBoundary:c,padding:f,altBoundary:u}),v=Gl(e.placement),y=Zg(e.placement),x=!y,b=g5(v),_=kEe(b),S=e.modifiersData.popperOffsets,O=e.rects.reference,C=e.rects.popper,E=typeof m=="function"?m(Object.assign({},e.rects,{placement:e.placement})):m,k=typeof E=="number"?{mainAxis:E,altAxis:E}:Object.assign({mainAxis:0,altAxis:0},E),I=e.modifiersData.offset?e.modifiersData.offset[e.placement]:null,P={x:0,y:0};if(S){if(o){var R,T=b==="y"?No:$o,L=b==="y"?ds:hs,z=b==="y"?"height":"width",B=S[b],U=B+g[T],W=B-g[L],$=h?-C[z]/2:0,N=y===Qg?O[z]:C[z],D=y===Qg?-C[z]:-O[z],A=e.elements.arrow,q=h&&A?m5(A):{width:0,height:0},Y=e.modifiersData["arrow#persistent"]?e.modifiersData["arrow#persistent"].padding:kre(),K=Y[T],se=Y[L],te=jx(0,O[z],q[z]),J=x?O[z]/2-$-te-K-k.mainAxis:N-te-K-k.mainAxis,pe=x?-O[z]/2+$+te+se+k.mainAxis:D+te+se+k.mainAxis,be=e.elements.arrow&&$1(e.elements.arrow),re=be?b==="y"?be.clientTop||0:be.clientLeft||0:0,ve=(R=I==null?void 0:I[b])!=null?R:0,F=B+J-ve-re,ce=B+pe-ve,le=jx(h?MT(U,F):U,B,h?$h(W,ce):W);S[b]=le,P[b]=le-B}if(s){var Q,X=b==="x"?No:$o,ee=b==="x"?ds:hs,ge=S[_],ye=_==="y"?"height":"width",H=ge+g[X],G=ge-g[ee],ie=[No,$o].indexOf(v)!==-1,he=(Q=I==null?void 0:I[_])!=null?Q:0,_e=ie?H:ge-O[ye]-C[ye]-he+k.altAxis,oe=ie?ge+O[ye]+C[ye]-he-k.altAxis:G,Z=h&&ie?tEe(_e,ge,oe):jx(h?_e:H,ge,h?oe:G);S[_]=Z,P[_]=Z-ge}e.modifiersData[r]=P}}const REe={name:"preventOverflow",enabled:!0,phase:"main",fn:AEe,requiresIfExists:["offset"]};function IEe(t){return{scrollLeft:t.scrollLeft,scrollTop:t.scrollTop}}function DEe(t){return t===Sa(t)||!es(t)?v5(t):IEe(t)}function LEe(t){var e=t.getBoundingClientRect(),n=Yg(e.width)/t.offsetWidth||1,r=Yg(e.height)/t.offsetHeight||1;return n!==1||r!==1}function NEe(t,e,n){n===void 0&&(n=!1);var r=es(e),i=es(e)&&LEe(e),o=md(e),a=Kg(t,i,n),s={scrollLeft:0,scrollTop:0},l={x:0,y:0};return(r||!r&&!n)&&((Jl(e)!=="body"||x5(o))&&(s=DEe(e)),es(e)?(l=Kg(e,!0),l.x+=e.clientLeft,l.y+=e.clientTop):o&&(l.x=y5(o))),{x:a.left+s.scrollLeft-l.x,y:a.top+s.scrollTop-l.y,width:a.width,height:a.height}}function $Ee(t){var e=new Map,n=new Set,r=[];t.forEach(function(o){e.set(o.name,o)});function i(o){n.add(o.name);var a=[].concat(o.requires||[],o.requiresIfExists||[]);a.forEach(function(s){if(!n.has(s)){var l=e.get(s);l&&i(l)}}),r.push(o)}return t.forEach(function(o){n.has(o.name)||i(o)}),r}function FEe(t){var e=$Ee(t);return QTe.reduce(function(n,r){return n.concat(e.filter(function(i){return i.phase===r}))},[])}function jEe(t){var e;return function(){return e||(e=new Promise(function(n){Promise.resolve().then(function(){e=void 0,n(t())})})),e}}function BEe(t){var e=t.reduce(function(n,r){var i=n[r.name];return n[r.name]=i?Object.assign({},i,r,{options:Object.assign({},i.options,r.options),data:Object.assign({},i.data,r.data)}):r,n},{});return Object.keys(e).map(function(n){return e[n]})}var m8={placement:"bottom",modifiers:[],strategy:"absolute"};function g8(){for(var t=arguments.length,e=new Array(t),n=0;n<t;n++)e[n]=arguments[n];return!e.some(function(r){return!(r&&typeof r.getBoundingClientRect=="function")})}function zEe(t){t===void 0&&(t={});var e=t,n=e.defaultModifiers,r=n===void 0?[]:n,i=e.defaultOptions,o=i===void 0?m8:i;return function(s,l,c){c===void 0&&(c=o);var u={placement:"bottom",orderedModifiers:[],options:Object.assign({},m8,o),modifiersData:{},elements:{reference:s,popper:l},attributes:{},styles:{}},f=[],d=!1,h={state:u,setOptions:function(v){var y=typeof v=="function"?v(u.options):v;m(),u.options=Object.assign({},o,u.options,y),u.scrollParents={reference:Jh(s)?Bx(s):s.contextElement?Bx(s.contextElement):[],popper:Bx(l)};var x=FEe(BEe([].concat(r,u.options.modifiers)));return u.orderedModifiers=x.filter(function(b){return b.enabled}),p(),h.update()},forceUpdate:function(){if(!d){var v=u.elements,y=v.reference,x=v.popper;if(g8(y,x)){u.rects={reference:NEe(y,$1(x),u.options.strategy==="fixed"),popper:m5(x)},u.reset=!1,u.placement=u.options.placement,u.orderedModifiers.forEach(function(k){return u.modifiersData[k.name]=Object.assign({},k.data)});for(var b=0;b<u.orderedModifiers.length;b++){if(u.reset===!0){u.reset=!1,b=-1;continue}var _=u.orderedModifiers[b],S=_.fn,O=_.options,C=O===void 0?{}:O,E=_.name;typeof S=="function"&&(u=S({state:u,options:C,name:E,instance:h})||u)}}}},update:jEe(function(){return new Promise(function(g){h.forceUpdate(),g(u)})}),destroy:function(){m(),d=!0}};if(!g8(s,l))return h;h.setOptions(c).then(function(g){!d&&c.onFirstUpdate&&c.onFirstUpdate(g)});function p(){u.orderedModifiers.forEach(function(g){var v=g.name,y=g.options,x=y===void 0?{}:y,b=g.effect;if(typeof b=="function"){var _=b({state:u,name:v,instance:h,options:x}),S=function(){};f.push(_||S)}})}function m(){f.forEach(function(g){return g()}),f=[]}return h}}var UEe=[fEe,MEe,cEe,ZTe,EEe,wEe,REe,oEe,OEe],WEe=zEe({defaultModifiers:UEe});const Lre="Popper";function VEe(t){return Sre(Lre,t)}xTe(Lre,["root"]);const GEe=["anchorEl","children","direction","disablePortal","modifiers","open","placement","popperOptions","popperRef","slotProps","slots","TransitionProps","ownerState"],HEe=["anchorEl","children","container","direction","disablePortal","keepMounted","modifiers","open","placement","popperOptions","popperRef","style","transition","slotProps","slots"];function qEe(t,e){if(e==="ltr")return t;switch(t){case"bottom-end":return"bottom-start";case"bottom-start":return"bottom-end";case"top-end":return"top-start";case"top-start":return"top-end";default:return t}}function zL(t){return typeof t=="function"?t():t}function XEe(t){return t.nodeType!==void 0}const QEe=()=>Ue({root:["root"]},NCe(VEe)),YEe={},KEe=M.forwardRef(function(e,n){var r;const{anchorEl:i,children:o,direction:a,disablePortal:s,modifiers:l,open:c,placement:u,popperOptions:f,popperRef:d,slotProps:h={},slots:p={},TransitionProps:m}=e,g=Ae(e,GEe),v=M.useRef(null),y=Zt(v,n),x=M.useRef(null),b=Zt(x,d),_=M.useRef(b);Hr(()=>{_.current=b},[b]),M.useImperativeHandle(d,()=>x.current,[]);const S=qEe(u,a),[O,C]=M.useState(S),[E,k]=M.useState(zL(i));M.useEffect(()=>{x.current&&x.current.forceUpdate()}),M.useEffect(()=>{i&&k(zL(i))},[i]),Hr(()=>{if(!E||!c)return;const L=U=>{C(U.placement)};let z=[{name:"preventOverflow",options:{altBoundary:s}},{name:"flip",options:{altBoundary:s}},{name:"onUpdate",enabled:!0,phase:"afterWrite",fn:({state:U})=>{L(U)}}];l!=null&&(z=z.concat(l)),f&&f.modifiers!=null&&(z=z.concat(f.modifiers));const B=WEe(E,v.current,j({placement:S},f,{modifiers:z}));return _.current(B),()=>{B.destroy(),_.current(null)}},[E,s,l,c,f,S]);const I={placement:O};m!==null&&(I.TransitionProps=m);const P=QEe(),R=(r=p.root)!=null?r:"div",T=$r({elementType:R,externalSlotProps:h.root,externalForwardedProps:g,additionalProps:{role:"tooltip",ref:y},ownerState:e,className:P.root});return w.jsx(R,j({},T,{children:typeof o=="function"?o(I):o}))}),ZEe=M.forwardRef(function(e,n){const{anchorEl:r,children:i,container:o,direction:a="ltr",disablePortal:s=!1,keepMounted:l=!1,modifiers:c,open:u,placement:f="bottom",popperOptions:d=YEe,popperRef:h,style:p,transition:m=!1,slotProps:g={},slots:v={}}=e,y=Ae(e,HEe),[x,b]=M.useState(!0),_=()=>{b(!1)},S=()=>{b(!0)};if(!l&&!u&&(!m||x))return null;let O;if(o)O=o;else if(r){const k=zL(r);O=k&&XEe(k)?$n(k).body:$n(null).body}const C=!u&&l&&(!m||x)?"none":void 0,E=m?{in:u,onEnter:_,onExited:S}:void 0;return w.jsx(Cre,{disablePortal:s,container:O,children:w.jsx(KEe,j({anchorEl:r,direction:a,disablePortal:s,modifiers:c,ref:n,open:m?!x:u,placement:f,popperOptions:d,popperRef:h,slotProps:g,slots:v},y,{style:j({position:"fixed",top:0,left:0,display:C},p),TransitionProps:E,children:i}))})}),JEe=2;function Nre(t,e){return t-e}function v8(t,e){var n;const{index:r}=(n=t.reduce((i,o,a)=>{const s=Math.abs(e-o);return i===null||s<i.distance||s===i.distance?{distance:s,index:a}:i},null))!=null?n:{};return r}function oS(t,e){if(e.current!==void 0&&t.changedTouches){const n=t;for(let r=0;r<n.changedTouches.length;r+=1){const i=n.changedTouches[r];if(i.identifier===e.current)return{x:i.clientX,y:i.clientY}}return!1}return{x:t.clientX,y:t.clientY}}function kT(t,e,n){return(t-e)*100/(n-e)}function ePe(t,e,n){return(n-e)*t+e}function tPe(t){if(Math.abs(t)<1){const n=t.toExponential().split("e-"),r=n[0].split(".")[1];return(r?r.length:0)+parseInt(n[1],10)}const e=t.toString().split(".")[1];return e?e.length:0}function nPe(t,e,n){const r=Math.round((t-n)/e)*e+n;return Number(r.toFixed(tPe(e)))}function y8({values:t,newValue:e,index:n}){const r=t.slice();return r[n]=e,r.sort(Nre)}function aS({sliderRef:t,activeIndex:e,setActive:n}){var r,i;const o=$n(t.current);if(!((r=t.current)!=null&&r.contains(o.activeElement))||Number(o==null||(i=o.activeElement)==null?void 0:i.getAttribute("data-index"))!==e){var a;(a=t.current)==null||a.querySelector(`[type="range"][data-index="${e}"]`).focus()}n&&n(e)}function sS(t,e){return typeof t=="number"&&typeof e=="number"?t===e:typeof t=="object"&&typeof e=="object"?ICe(t,e):!1}const rPe={horizontal:{offset:t=>({left:`${t}%`}),leap:t=>({width:`${t}%`})},"horizontal-reverse":{offset:t=>({right:`${t}%`}),leap:t=>({width:`${t}%`})},vertical:{offset:t=>({bottom:`${t}%`}),leap:t=>({height:`${t}%`})}},iPe=t=>t;let lS;function x8(){return lS===void 0&&(typeof CSS<"u"&&typeof CSS.supports=="function"?lS=CSS.supports("touch-action","none"):lS=!0),lS}function oPe(t){const{"aria-labelledby":e,defaultValue:n,disabled:r=!1,disableSwap:i=!1,isRtl:o=!1,marks:a=!1,max:s=100,min:l=0,name:c,onChange:u,onChangeCommitted:f,orientation:d="horizontal",rootRef:h,scale:p=iPe,step:m=1,shiftStep:g=10,tabIndex:v,value:y}=t,x=M.useRef(),[b,_]=M.useState(-1),[S,O]=M.useState(-1),[C,E]=M.useState(!1),k=M.useRef(0),[I,P]=Qs({controlled:y,default:n??l,name:"Slider"}),R=u&&((Z,V,de)=>{const xe=Z.nativeEvent||Z,Me=new xe.constructor(xe.type,xe);Object.defineProperty(Me,"target",{writable:!0,value:{value:V,name:c}}),u(Me,V,de)}),T=Array.isArray(I);let L=T?I.slice().sort(Nre):[I];L=L.map(Z=>Z==null?l:ah(Z,l,s));const z=a===!0&&m!==null?[...Array(Math.floor((s-l)/m)+1)].map((Z,V)=>({value:l+m*V})):a||[],B=z.map(Z=>Z.value),{isFocusVisibleRef:U,onBlur:W,onFocus:$,ref:N}=A1(),[D,A]=M.useState(-1),q=M.useRef(),Y=Zt(N,q),K=Zt(h,Y),se=Z=>V=>{var de;const xe=Number(V.currentTarget.getAttribute("data-index"));$(V),U.current===!0&&A(xe),O(xe),Z==null||(de=Z.onFocus)==null||de.call(Z,V)},te=Z=>V=>{var de;W(V),U.current===!1&&A(-1),O(-1),Z==null||(de=Z.onBlur)==null||de.call(Z,V)},J=(Z,V)=>{const de=Number(Z.currentTarget.getAttribute("data-index")),xe=L[de],Me=B.indexOf(xe);let me=V;if(z&&m==null){const $e=B[B.length-1];me>$e?me=$e:me<B[0]?me=B[0]:me=me<xe?B[Me-1]:B[Me+1]}if(me=ah(me,l,s),T){i&&(me=ah(me,L[de-1]||-1/0,L[de+1]||1/0));const $e=me;me=y8({values:L,newValue:me,index:de});let Te=de;i||(Te=me.indexOf($e)),aS({sliderRef:q,activeIndex:Te})}P(me),A(de),R&&!sS(me,I)&&R(Z,me,de),f&&f(Z,me)},pe=Z=>V=>{var de;if(m!==null){const xe=Number(V.currentTarget.getAttribute("data-index")),Me=L[xe];let me=null;(V.key==="ArrowLeft"||V.key==="ArrowDown")&&V.shiftKey||V.key==="PageDown"?me=Math.max(Me-g,l):((V.key==="ArrowRight"||V.key==="ArrowUp")&&V.shiftKey||V.key==="PageUp")&&(me=Math.min(Me+g,s)),me!==null&&(J(V,me),V.preventDefault())}Z==null||(de=Z.onKeyDown)==null||de.call(Z,V)};Hr(()=>{if(r&&q.current.contains(document.activeElement)){var Z;(Z=document.activeElement)==null||Z.blur()}},[r]),r&&b!==-1&&_(-1),r&&D!==-1&&A(-1);const be=Z=>V=>{var de;(de=Z.onChange)==null||de.call(Z,V),J(V,V.target.valueAsNumber)},re=M.useRef();let ve=d;o&&d==="horizontal"&&(ve+="-reverse");const F=({finger:Z,move:V=!1})=>{const{current:de}=q,{width:xe,height:Me,bottom:me,left:$e}=de.getBoundingClientRect();let Te;ve.indexOf("vertical")===0?Te=(me-Z.y)/Me:Te=(Z.x-$e)/xe,ve.indexOf("-reverse")!==-1&&(Te=1-Te);let Re;if(Re=ePe(Te,l,s),m)Re=nPe(Re,m,l);else{const Le=v8(B,Re);Re=B[Le]}Re=ah(Re,l,s);let ae=0;if(T){V?ae=re.current:ae=v8(L,Re),i&&(Re=ah(Re,L[ae-1]||-1/0,L[ae+1]||1/0));const Le=Re;Re=y8({values:L,newValue:Re,index:ae}),i&&V||(ae=Re.indexOf(Le),re.current=ae)}return{newValue:Re,activeIndex:ae}},ce=_r(Z=>{const V=oS(Z,x);if(!V)return;if(k.current+=1,Z.type==="mousemove"&&Z.buttons===0){le(Z);return}const{newValue:de,activeIndex:xe}=F({finger:V,move:!0});aS({sliderRef:q,activeIndex:xe,setActive:_}),P(de),!C&&k.current>JEe&&E(!0),R&&!sS(de,I)&&R(Z,de,xe)}),le=_r(Z=>{const V=oS(Z,x);if(E(!1),!V)return;const{newValue:de}=F({finger:V,move:!0});_(-1),Z.type==="touchend"&&O(-1),f&&f(Z,de),x.current=void 0,X()}),Q=_r(Z=>{if(r)return;x8()||Z.preventDefault();const V=Z.changedTouches[0];V!=null&&(x.current=V.identifier);const de=oS(Z,x);if(de!==!1){const{newValue:Me,activeIndex:me}=F({finger:de});aS({sliderRef:q,activeIndex:me,setActive:_}),P(Me),R&&!sS(Me,I)&&R(Z,Me,me)}k.current=0;const xe=$n(q.current);xe.addEventListener("touchmove",ce,{passive:!0}),xe.addEventListener("touchend",le,{passive:!0})}),X=M.useCallback(()=>{const Z=$n(q.current);Z.removeEventListener("mousemove",ce),Z.removeEventListener("mouseup",le),Z.removeEventListener("touchmove",ce),Z.removeEventListener("touchend",le)},[le,ce]);M.useEffect(()=>{const{current:Z}=q;return Z.addEventListener("touchstart",Q,{passive:x8()}),()=>{Z.removeEventListener("touchstart",Q),X()}},[X,Q]),M.useEffect(()=>{r&&X()},[r,X]);const ee=Z=>V=>{var de;if((de=Z.onMouseDown)==null||de.call(Z,V),r||V.defaultPrevented||V.button!==0)return;V.preventDefault();const xe=oS(V,x);if(xe!==!1){const{newValue:me,activeIndex:$e}=F({finger:xe});aS({sliderRef:q,activeIndex:$e,setActive:_}),P(me),R&&!sS(me,I)&&R(V,me,$e)}k.current=0;const Me=$n(q.current);Me.addEventListener("mousemove",ce,{passive:!0}),Me.addEventListener("mouseup",le)},ge=kT(T?L[0]:l,l,s),ye=kT(L[L.length-1],l,s)-ge,H=(Z={})=>{const V=Nh(Z),de={onMouseDown:ee(V||{})},xe=j({},V,de);return j({},Z,{ref:K},xe)},G=Z=>V=>{var de;(de=Z.onMouseOver)==null||de.call(Z,V);const xe=Number(V.currentTarget.getAttribute("data-index"));O(xe)},ie=Z=>V=>{var de;(de=Z.onMouseLeave)==null||de.call(Z,V),O(-1)};return{active:b,axis:ve,axisProps:rPe,dragging:C,focusedThumbIndex:D,getHiddenInputProps:(Z={})=>{var V;const de=Nh(Z),xe={onChange:be(de||{}),onFocus:se(de||{}),onBlur:te(de||{}),onKeyDown:pe(de||{})},Me=j({},de,xe);return j({tabIndex:v,"aria-labelledby":e,"aria-orientation":d,"aria-valuemax":p(s),"aria-valuemin":p(l),name:c,type:"range",min:t.min,max:t.max,step:t.step===null&&t.marks?"any":(V=t.step)!=null?V:void 0,disabled:r},Z,Me,{style:j({},FSe,{direction:o?"rtl":"ltr",width:"100%",height:"100%"})})},getRootProps:H,getThumbProps:(Z={})=>{const V=Nh(Z),de={onMouseOver:G(V||{}),onMouseLeave:ie(V||{})};return j({},Z,V,de)},marks:z,open:S,range:T,rootRef:K,trackLeap:ye,trackOffset:ge,values:L,getThumbStyle:Z=>({pointerEvents:b!==-1&&b!==Z?"none":void 0})}}function aPe(t={}){const{autoHideDuration:e=null,disableWindowBlurListener:n=!1,onClose:r,open:i,resumeHideDuration:o}=t,a=bf();M.useEffect(()=>{if(!i)return;function v(y){y.defaultPrevented||(y.key==="Escape"||y.key==="Esc")&&(r==null||r(y,"escapeKeyDown"))}return document.addEventListener("keydown",v),()=>{document.removeEventListener("keydown",v)}},[i,r]);const s=_r((v,y)=>{r==null||r(v,y)}),l=_r(v=>{!r||v==null||a.start(v,()=>{s(null,"timeout")})});M.useEffect(()=>(i&&l(e),a.clear),[i,e,l,a]);const c=v=>{r==null||r(v,"clickaway")},u=a.clear,f=M.useCallback(()=>{e!=null&&l(o??e*.5)},[e,o,l]),d=v=>y=>{const x=v.onBlur;x==null||x(y),f()},h=v=>y=>{const x=v.onFocus;x==null||x(y),u()},p=v=>y=>{const x=v.onMouseEnter;x==null||x(y),u()},m=v=>y=>{const x=v.onMouseLeave;x==null||x(y),f()};return M.useEffect(()=>{if(!n&&i)return window.addEventListener("focus",f),window.addEventListener("blur",u),()=>{window.removeEventListener("focus",f),window.removeEventListener("blur",u)}},[n,i,f,u]),{getRootProps:(v={})=>{const y=j({},Nh(t),Nh(v));return j({role:"presentation"},v,y,{onBlur:d(y),onFocus:h(y),onMouseEnter:p(y),onMouseLeave:m(y)})},onClickAway:c}}const sPe=["onChange","maxRows","minRows","style","value"];function cS(t){return parseInt(t,10)||0}const lPe={shadow:{visibility:"hidden",position:"absolute",overflow:"hidden",height:0,top:0,left:0,transform:"translateZ(0)"}};function cPe(t){return t==null||Object.keys(t).length===0||t.outerHeightStyle===0&&!t.overflowing}const uPe=M.forwardRef(function(e,n){const{onChange:r,maxRows:i,minRows:o=1,style:a,value:s}=e,l=Ae(e,sPe),{current:c}=M.useRef(s!=null),u=M.useRef(null),f=Zt(n,u),d=M.useRef(null),h=M.useCallback(()=>{const g=u.current,y=cs(g).getComputedStyle(g);if(y.width==="0px")return{outerHeightStyle:0,overflowing:!1};const x=d.current;x.style.width=y.width,x.value=g.value||e.placeholder||"x",x.value.slice(-1)===`
`&&(x.value+=" ");const b=y.boxSizing,_=cS(y.paddingBottom)+cS(y.paddingTop),S=cS(y.borderBottomWidth)+cS(y.borderTopWidth),O=x.scrollHeight;x.value="x";const C=x.scrollHeight;let E=O;o&&(E=Math.max(Number(o)*C,E)),i&&(E=Math.min(Number(i)*C,E)),E=Math.max(E,C);const k=E+(b==="border-box"?_+S:0),I=Math.abs(E-O)<=1;return{outerHeightStyle:k,overflowing:I}},[i,o,e.placeholder]),p=M.useCallback(()=>{const g=h();if(cPe(g))return;const v=u.current;v.style.height=`${g.outerHeightStyle}px`,v.style.overflow=g.overflowing?"hidden":""},[h]);Hr(()=>{const g=()=>{p()};let v;const y=Kv(g),x=u.current,b=cs(x);b.addEventListener("resize",y);let _;return typeof ResizeObserver<"u"&&(_=new ResizeObserver(g),_.observe(x)),()=>{y.clear(),cancelAnimationFrame(v),b.removeEventListener("resize",y),_&&_.disconnect()}},[h,p]),Hr(()=>{p()});const m=g=>{c||p(),r&&r(g)};return w.jsxs(M.Fragment,{children:[w.jsx("textarea",j({value:s,onChange:m,ref:f,rows:o,style:a},l)),w.jsx("textarea",{"aria-hidden":!0,className:e.className,readOnly:!0,ref:d,tabIndex:-1,style:j({},lPe.shadow,a,{paddingTop:0,paddingBottom:0})})]})});var b5={};Object.defineProperty(b5,"__esModule",{value:!0});var $re=b5.default=void 0,fPe=hPe(M),dPe=mre;function Fre(t){if(typeof WeakMap!="function")return null;var e=new WeakMap,n=new WeakMap;return(Fre=function(r){return r?n:e})(t)}function hPe(t,e){if(t&&t.__esModule)return t;if(t===null||typeof t!="object"&&typeof t!="function")return{default:t};var n=Fre(e);if(n&&n.has(t))return n.get(t);var r={__proto__:null},i=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var o in t)if(o!=="default"&&Object.prototype.hasOwnProperty.call(t,o)){var a=i?Object.getOwnPropertyDescriptor(t,o):null;a&&(a.get||a.set)?Object.defineProperty(r,o,a):r[o]=t[o]}return r.default=t,n&&n.set(t,r),r}function pPe(t){return Object.keys(t).length===0}function mPe(t=null){const e=fPe.useContext(dPe.ThemeContext);return!e||pPe(e)?t:e}$re=b5.default=mPe;const gPe=["anchorEl","component","components","componentsProps","container","disablePortal","keepMounted","modifiers","open","placement","popperOptions","popperRef","transition","slots","slotProps"],vPe=we(ZEe,{name:"MuiPopper",slot:"Root",overridesResolver:(t,e)=>e.root})({}),_5=M.forwardRef(function(e,n){var r;const i=$re(),o=qe({props:e,name:"MuiPopper"}),{anchorEl:a,component:s,components:l,componentsProps:c,container:u,disablePortal:f,keepMounted:d,modifiers:h,open:p,placement:m,popperOptions:g,popperRef:v,transition:y,slots:x,slotProps:b}=o,_=Ae(o,gPe),S=(r=x==null?void 0:x.root)!=null?r:l==null?void 0:l.Root,O=j({anchorEl:a,container:u,disablePortal:f,keepMounted:d,modifiers:h,open:p,placement:m,popperOptions:g,popperRef:v,transition:y},_);return w.jsx(vPe,j({as:s,direction:i==null?void 0:i.direction,slots:{root:S},slotProps:b??c},O,{ref:n}))}),yPe=ni(w.jsx("path",{d:"M12 2C6.47 2 2 6.47 2 12s4.47 10 10 10 10-4.47 10-10S17.53 2 12 2zm5 13.59L15.59 17 12 13.41 8.41 17 7 15.59 10.59 12 7 8.41 8.41 7 12 10.59 15.59 7 17 8.41 13.41 12 17 15.59z"}),"Cancel");function xPe(t){return We("MuiChip",t)}const fn=Ve("MuiChip",["root","sizeSmall","sizeMedium","colorError","colorInfo","colorPrimary","colorSecondary","colorSuccess","colorWarning","disabled","clickable","clickableColorPrimary","clickableColorSecondary","deletable","deletableColorPrimary","deletableColorSecondary","outlined","filled","outlinedPrimary","outlinedSecondary","filledPrimary","filledSecondary","avatar","avatarSmall","avatarMedium","avatarColorPrimary","avatarColorSecondary","icon","iconSmall","iconMedium","iconColorPrimary","iconColorSecondary","label","labelSmall","labelMedium","deleteIcon","deleteIconSmall","deleteIconMedium","deleteIconColorPrimary","deleteIconColorSecondary","deleteIconOutlinedColorPrimary","deleteIconOutlinedColorSecondary","deleteIconFilledColorPrimary","deleteIconFilledColorSecondary","focusVisible"]),bPe=["avatar","className","clickable","color","component","deleteIcon","disabled","icon","label","onClick","onDelete","onKeyDown","onKeyUp","size","variant","tabIndex","skipFocusWhenDisabled"],_Pe=t=>{const{classes:e,disabled:n,size:r,color:i,iconColor:o,onDelete:a,clickable:s,variant:l}=t,c={root:["root",l,n&&"disabled",`size${De(r)}`,`color${De(i)}`,s&&"clickable",s&&`clickableColor${De(i)}`,a&&"deletable",a&&`deletableColor${De(i)}`,`${l}${De(i)}`],label:["label",`label${De(r)}`],avatar:["avatar",`avatar${De(r)}`,`avatarColor${De(i)}`],icon:["icon",`icon${De(r)}`,`iconColor${De(o)}`],deleteIcon:["deleteIcon",`deleteIcon${De(r)}`,`deleteIconColor${De(i)}`,`deleteIcon${De(l)}Color${De(i)}`]};return Ue(c,xPe,e)},wPe=we("div",{name:"MuiChip",slot:"Root",overridesResolver:(t,e)=>{const{ownerState:n}=t,{color:r,iconColor:i,clickable:o,onDelete:a,size:s,variant:l}=n;return[{[`& .${fn.avatar}`]:e.avatar},{[`& .${fn.avatar}`]:e[`avatar${De(s)}`]},{[`& .${fn.avatar}`]:e[`avatarColor${De(r)}`]},{[`& .${fn.icon}`]:e.icon},{[`& .${fn.icon}`]:e[`icon${De(s)}`]},{[`& .${fn.icon}`]:e[`iconColor${De(i)}`]},{[`& .${fn.deleteIcon}`]:e.deleteIcon},{[`& .${fn.deleteIcon}`]:e[`deleteIcon${De(s)}`]},{[`& .${fn.deleteIcon}`]:e[`deleteIconColor${De(r)}`]},{[`& .${fn.deleteIcon}`]:e[`deleteIcon${De(l)}Color${De(r)}`]},e.root,e[`size${De(s)}`],e[`color${De(r)}`],o&&e.clickable,o&&r!=="default"&&e[`clickableColor${De(r)})`],a&&e.deletable,a&&r!=="default"&&e[`deletableColor${De(r)}`],e[l],e[`${l}${De(r)}`]]}})(({theme:t,ownerState:e})=>{const n=t.palette.mode==="light"?t.palette.grey[700]:t.palette.grey[300];return j({maxWidth:"100%",fontFamily:t.typography.fontFamily,fontSize:t.typography.pxToRem(13),display:"inline-flex",alignItems:"center",justifyContent:"center",height:32,color:(t.vars||t).palette.text.primary,backgroundColor:(t.vars||t).palette.action.selected,borderRadius:32/2,whiteSpace:"nowrap",transition:t.transitions.create(["background-color","box-shadow"]),cursor:"unset",outline:0,textDecoration:"none",border:0,padding:0,verticalAlign:"middle",boxSizing:"border-box",[`&.${fn.disabled}`]:{opacity:(t.vars||t).palette.action.disabledOpacity,pointerEvents:"none"},[`& .${fn.avatar}`]:{marginLeft:5,marginRight:-6,width:24,height:24,color:t.vars?t.vars.palette.Chip.defaultAvatarColor:n,fontSize:t.typography.pxToRem(12)},[`& .${fn.avatarColorPrimary}`]:{color:(t.vars||t).palette.primary.contrastText,backgroundColor:(t.vars||t).palette.primary.dark},[`& .${fn.avatarColorSecondary}`]:{color:(t.vars||t).palette.secondary.contrastText,backgroundColor:(t.vars||t).palette.secondary.dark},[`& .${fn.avatarSmall}`]:{marginLeft:4,marginRight:-4,width:18,height:18,fontSize:t.typography.pxToRem(10)},[`& .${fn.icon}`]:j({marginLeft:5,marginRight:-6},e.size==="small"&&{fontSize:18,marginLeft:4,marginRight:-4},e.iconColor===e.color&&j({color:t.vars?t.vars.palette.Chip.defaultIconColor:n},e.color!=="default"&&{color:"inherit"})),[`& .${fn.deleteIcon}`]:j({WebkitTapHighlightColor:"transparent",color:t.vars?`rgba(${t.vars.palette.text.primaryChannel} / 0.26)`:kt(t.palette.text.primary,.26),fontSize:22,cursor:"pointer",margin:"0 5px 0 -6px","&:hover":{color:t.vars?`rgba(${t.vars.palette.text.primaryChannel} / 0.4)`:kt(t.palette.text.primary,.4)}},e.size==="small"&&{fontSize:16,marginRight:4,marginLeft:-4},e.color!=="default"&&{color:t.vars?`rgba(${t.vars.palette[e.color].contrastTextChannel} / 0.7)`:kt(t.palette[e.color].contrastText,.7),"&:hover, &:active":{color:(t.vars||t).palette[e.color].contrastText}})},e.size==="small"&&{height:24},e.color!=="default"&&{backgroundColor:(t.vars||t).palette[e.color].main,color:(t.vars||t).palette[e.color].contrastText},e.onDelete&&{[`&.${fn.focusVisible}`]:{backgroundColor:t.vars?`rgba(${t.vars.palette.action.selectedChannel} / calc(${t.vars.palette.action.selectedOpacity} + ${t.vars.palette.action.focusOpacity}))`:kt(t.palette.action.selected,t.palette.action.selectedOpacity+t.palette.action.focusOpacity)}},e.onDelete&&e.color!=="default"&&{[`&.${fn.focusVisible}`]:{backgroundColor:(t.vars||t).palette[e.color].dark}})},({theme:t,ownerState:e})=>j({},e.clickable&&{userSelect:"none",WebkitTapHighlightColor:"transparent",cursor:"pointer","&:hover":{backgroundColor:t.vars?`rgba(${t.vars.palette.action.selectedChannel} / calc(${t.vars.palette.action.selectedOpacity} + ${t.vars.palette.action.hoverOpacity}))`:kt(t.palette.action.selected,t.palette.action.selectedOpacity+t.palette.action.hoverOpacity)},[`&.${fn.focusVisible}`]:{backgroundColor:t.vars?`rgba(${t.vars.palette.action.selectedChannel} / calc(${t.vars.palette.action.selectedOpacity} + ${t.vars.palette.action.focusOpacity}))`:kt(t.palette.action.selected,t.palette.action.selectedOpacity+t.palette.action.focusOpacity)},"&:active":{boxShadow:(t.vars||t).shadows[1]}},e.clickable&&e.color!=="default"&&{[`&:hover, &.${fn.focusVisible}`]:{backgroundColor:(t.vars||t).palette[e.color].dark}}),({theme:t,ownerState:e})=>j({},e.variant==="outlined"&&{backgroundColor:"transparent",border:t.vars?`1px solid ${t.vars.palette.Chip.defaultBorder}`:`1px solid ${t.palette.mode==="light"?t.palette.grey[400]:t.palette.grey[700]}`,[`&.${fn.clickable}:hover`]:{backgroundColor:(t.vars||t).palette.action.hover},[`&.${fn.focusVisible}`]:{backgroundColor:(t.vars||t).palette.action.focus},[`& .${fn.avatar}`]:{marginLeft:4},[`& .${fn.avatarSmall}`]:{marginLeft:2},[`& .${fn.icon}`]:{marginLeft:4},[`& .${fn.iconSmall}`]:{marginLeft:2},[`& .${fn.deleteIcon}`]:{marginRight:5},[`& .${fn.deleteIconSmall}`]:{marginRight:3}},e.variant==="outlined"&&e.color!=="default"&&{color:(t.vars||t).palette[e.color].main,border:`1px solid ${t.vars?`rgba(${t.vars.palette[e.color].mainChannel} / 0.7)`:kt(t.palette[e.color].main,.7)}`,[`&.${fn.clickable}:hover`]:{backgroundColor:t.vars?`rgba(${t.vars.palette[e.color].mainChannel} / ${t.vars.palette.action.hoverOpacity})`:kt(t.palette[e.color].main,t.palette.action.hoverOpacity)},[`&.${fn.focusVisible}`]:{backgroundColor:t.vars?`rgba(${t.vars.palette[e.color].mainChannel} / ${t.vars.palette.action.focusOpacity})`:kt(t.palette[e.color].main,t.palette.action.focusOpacity)},[`& .${fn.deleteIcon}`]:{color:t.vars?`rgba(${t.vars.palette[e.color].mainChannel} / 0.7)`:kt(t.palette[e.color].main,.7),"&:hover, &:active":{color:(t.vars||t).palette[e.color].main}}})),SPe=we("span",{name:"MuiChip",slot:"Label",overridesResolver:(t,e)=>{const{ownerState:n}=t,{size:r}=n;return[e.label,e[`label${De(r)}`]]}})(({ownerState:t})=>j({overflow:"hidden",textOverflow:"ellipsis",paddingLeft:12,paddingRight:12,whiteSpace:"nowrap"},t.variant==="outlined"&&{paddingLeft:11,paddingRight:11},t.size==="small"&&{paddingLeft:8,paddingRight:8},t.size==="small"&&t.variant==="outlined"&&{paddingLeft:7,paddingRight:7}));function b8(t){return t.key==="Backspace"||t.key==="Delete"}const OPe=M.forwardRef(function(e,n){const r=qe({props:e,name:"MuiChip"}),{avatar:i,className:o,clickable:a,color:s="default",component:l,deleteIcon:c,disabled:u=!1,icon:f,label:d,onClick:h,onDelete:p,onKeyDown:m,onKeyUp:g,size:v="medium",variant:y="filled",tabIndex:x,skipFocusWhenDisabled:b=!1}=r,_=Ae(r,bPe),S=M.useRef(null),O=Zt(S,n),C=W=>{W.stopPropagation(),p&&p(W)},E=W=>{W.currentTarget===W.target&&b8(W)&&W.preventDefault(),m&&m(W)},k=W=>{W.currentTarget===W.target&&(p&&b8(W)?p(W):W.key==="Escape"&&S.current&&S.current.blur()),g&&g(W)},I=a!==!1&&h?!0:a,P=I||p?fs:l||"div",R=j({},r,{component:P,disabled:u,size:v,color:s,iconColor:M.isValidElement(f)&&f.props.color||s,onDelete:!!p,clickable:I,variant:y}),T=_Pe(R),L=P===fs?j({component:l||"div",focusVisibleClassName:T.focusVisible},p&&{disableRipple:!0}):{};let z=null;p&&(z=c&&M.isValidElement(c)?M.cloneElement(c,{className:ke(c.props.className,T.deleteIcon),onClick:C}):w.jsx(yPe,{className:ke(T.deleteIcon),onClick:C}));let B=null;i&&M.isValidElement(i)&&(B=M.cloneElement(i,{className:ke(T.avatar,i.props.className)}));let U=null;return f&&M.isValidElement(f)&&(U=M.cloneElement(f,{className:ke(T.icon,f.props.className)})),w.jsxs(wPe,j({as:P,className:ke(T.root,o),disabled:I&&u?!0:void 0,onClick:h,onKeyDown:E,onKeyUp:k,ref:O,tabIndex:b&&u?-1:x,ownerState:R},L,_,{children:[B||U,w.jsx(SPe,{className:ke(T.label),ownerState:R,children:d}),z]}))});function gd({props:t,states:e,muiFormControl:n}){return e.reduce((r,i)=>(r[i]=t[i],n&&typeof t[i]>"u"&&(r[i]=n[i]),r),{})}const qM=M.createContext(void 0);function oc(){return M.useContext(qM)}function jre(t){return w.jsx(Ywe,j({},t,{defaultTheme:IM,themeId:Kh}))}function _8(t){return t!=null&&!(Array.isArray(t)&&t.length===0)}function AT(t,e=!1){return t&&(_8(t.value)&&t.value!==""||e&&_8(t.defaultValue)&&t.defaultValue!=="")}function CPe(t){return t.startAdornment}function TPe(t){return We("MuiInputBase",t)}const Jg=Ve("MuiInputBase",["root","formControl","focused","disabled","adornedStart","adornedEnd","error","sizeSmall","multiline","colorSecondary","fullWidth","hiddenLabel","readOnly","input","inputSizeSmall","inputMultiline","inputTypeSearch","inputAdornedStart","inputAdornedEnd","inputHiddenLabel"]),EPe=["aria-describedby","autoComplete","autoFocus","className","color","components","componentsProps","defaultValue","disabled","disableInjectingGlobalStyles","endAdornment","error","fullWidth","id","inputComponent","inputProps","inputRef","margin","maxRows","minRows","multiline","name","onBlur","onChange","onClick","onFocus","onKeyDown","onKeyUp","placeholder","readOnly","renderSuffix","rows","size","slotProps","slots","startAdornment","type","value"],XM=(t,e)=>{const{ownerState:n}=t;return[e.root,n.formControl&&e.formControl,n.startAdornment&&e.adornedStart,n.endAdornment&&e.adornedEnd,n.error&&e.error,n.size==="small"&&e.sizeSmall,n.multiline&&e.multiline,n.color&&e[`color${De(n.color)}`],n.fullWidth&&e.fullWidth,n.hiddenLabel&&e.hiddenLabel]},QM=(t,e)=>{const{ownerState:n}=t;return[e.input,n.size==="small"&&e.inputSizeSmall,n.multiline&&e.inputMultiline,n.type==="search"&&e.inputTypeSearch,n.startAdornment&&e.inputAdornedStart,n.endAdornment&&e.inputAdornedEnd,n.hiddenLabel&&e.inputHiddenLabel]},PPe=t=>{const{classes:e,color:n,disabled:r,error:i,endAdornment:o,focused:a,formControl:s,fullWidth:l,hiddenLabel:c,multiline:u,readOnly:f,size:d,startAdornment:h,type:p}=t,m={root:["root",`color${De(n)}`,r&&"disabled",i&&"error",l&&"fullWidth",a&&"focused",s&&"formControl",d&&d!=="medium"&&`size${De(d)}`,u&&"multiline",h&&"adornedStart",o&&"adornedEnd",c&&"hiddenLabel",f&&"readOnly"],input:["input",r&&"disabled",p==="search"&&"inputTypeSearch",u&&"inputMultiline",d==="small"&&"inputSizeSmall",c&&"inputHiddenLabel",h&&"inputAdornedStart",o&&"inputAdornedEnd",f&&"readOnly"]};return Ue(m,TPe,e)},YM=we("div",{name:"MuiInputBase",slot:"Root",overridesResolver:XM})(({theme:t,ownerState:e})=>j({},t.typography.body1,{color:(t.vars||t).palette.text.primary,lineHeight:"1.4375em",boxSizing:"border-box",position:"relative",cursor:"text",display:"inline-flex",alignItems:"center",[`&.${Jg.disabled}`]:{color:(t.vars||t).palette.text.disabled,cursor:"default"}},e.multiline&&j({padding:"4px 0 5px"},e.size==="small"&&{paddingTop:1}),e.fullWidth&&{width:"100%"})),KM=we("input",{name:"MuiInputBase",slot:"Input",overridesResolver:QM})(({theme:t,ownerState:e})=>{const n=t.palette.mode==="light",r=j({color:"currentColor"},t.vars?{opacity:t.vars.opacity.inputPlaceholder}:{opacity:n?.42:.5},{transition:t.transitions.create("opacity",{duration:t.transitions.duration.shorter})}),i={opacity:"0 !important"},o=t.vars?{opacity:t.vars.opacity.inputPlaceholder}:{opacity:n?.42:.5};return j({font:"inherit",letterSpacing:"inherit",color:"currentColor",padding:"4px 0 5px",border:0,boxSizing:"content-box",background:"none",height:"1.4375em",margin:0,WebkitTapHighlightColor:"transparent",display:"block",minWidth:0,width:"100%",animationName:"mui-auto-fill-cancel",animationDuration:"10ms","&::-webkit-input-placeholder":r,"&::-moz-placeholder":r,"&:-ms-input-placeholder":r,"&::-ms-input-placeholder":r,"&:focus":{outline:0},"&:invalid":{boxShadow:"none"},"&::-webkit-search-decoration":{WebkitAppearance:"none"},[`label[data-shrink=false] + .${Jg.formControl} &`]:{"&::-webkit-input-placeholder":i,"&::-moz-placeholder":i,"&:-ms-input-placeholder":i,"&::-ms-input-placeholder":i,"&:focus::-webkit-input-placeholder":o,"&:focus::-moz-placeholder":o,"&:focus:-ms-input-placeholder":o,"&:focus::-ms-input-placeholder":o},[`&.${Jg.disabled}`]:{opacity:1,WebkitTextFillColor:(t.vars||t).palette.text.disabled},"&:-webkit-autofill":{animationDuration:"5000s",animationName:"mui-auto-fill"}},e.size==="small"&&{paddingTop:1},e.multiline&&{height:"auto",resize:"none",padding:0,paddingTop:0},e.type==="search"&&{MozAppearance:"textfield"})}),MPe=w.jsx(jre,{styles:{"@keyframes mui-auto-fill":{from:{display:"block"}},"@keyframes mui-auto-fill-cancel":{from:{display:"block"}}}}),kPe=M.forwardRef(function(e,n){var r;const i=qe({props:e,name:"MuiInputBase"}),{"aria-describedby":o,autoComplete:a,autoFocus:s,className:l,components:c={},componentsProps:u={},defaultValue:f,disabled:d,disableInjectingGlobalStyles:h,endAdornment:p,fullWidth:m=!1,id:g,inputComponent:v="input",inputProps:y={},inputRef:x,maxRows:b,minRows:_,multiline:S=!1,name:O,onBlur:C,onChange:E,onClick:k,onFocus:I,onKeyDown:P,onKeyUp:R,placeholder:T,readOnly:L,renderSuffix:z,rows:B,slotProps:U={},slots:W={},startAdornment:$,type:N="text",value:D}=i,A=Ae(i,EPe),q=y.value!=null?y.value:D,{current:Y}=M.useRef(q!=null),K=M.useRef(),se=M.useCallback(Z=>{},[]),te=Zt(K,x,y.ref,se),[J,pe]=M.useState(!1),be=oc(),re=gd({props:i,muiFormControl:be,states:["color","disabled","error","hiddenLabel","size","required","filled"]});re.focused=be?be.focused:J,M.useEffect(()=>{!be&&d&&J&&(pe(!1),C&&C())},[be,d,J,C]);const ve=be&&be.onFilled,F=be&&be.onEmpty,ce=M.useCallback(Z=>{AT(Z)?ve&&ve():F&&F()},[ve,F]);Hr(()=>{Y&&ce({value:q})},[q,ce,Y]);const le=Z=>{if(re.disabled){Z.stopPropagation();return}I&&I(Z),y.onFocus&&y.onFocus(Z),be&&be.onFocus?be.onFocus(Z):pe(!0)},Q=Z=>{C&&C(Z),y.onBlur&&y.onBlur(Z),be&&be.onBlur?be.onBlur(Z):pe(!1)},X=(Z,...V)=>{if(!Y){const de=Z.target||K.current;if(de==null)throw new Error(fu(1));ce({value:de.value})}y.onChange&&y.onChange(Z,...V),E&&E(Z,...V)};M.useEffect(()=>{ce(K.current)},[]);const ee=Z=>{K.current&&Z.currentTarget===Z.target&&K.current.focus(),k&&k(Z)};let ge=v,ye=y;S&&ge==="input"&&(B?ye=j({type:void 0,minRows:B,maxRows:B},ye):ye=j({type:void 0,maxRows:b,minRows:_},ye),ge=uPe);const H=Z=>{ce(Z.animationName==="mui-auto-fill-cancel"?K.current:{value:"x"})};M.useEffect(()=>{be&&be.setAdornedStart(!!$)},[be,$]);const G=j({},i,{color:re.color||"primary",disabled:re.disabled,endAdornment:p,error:re.error,focused:re.focused,formControl:be,fullWidth:m,hiddenLabel:re.hiddenLabel,multiline:S,size:re.size,startAdornment:$,type:N}),ie=PPe(G),he=W.root||c.Root||YM,_e=U.root||u.root||{},oe=W.input||c.Input||KM;return ye=j({},ye,(r=U.input)!=null?r:u.input),w.jsxs(M.Fragment,{children:[!h&&MPe,w.jsxs(he,j({},_e,!Vl(he)&&{ownerState:j({},G,_e.ownerState)},{ref:n,onClick:ee},A,{className:ke(ie.root,_e.className,l,L&&"MuiInputBase-readOnly"),children:[$,w.jsx(qM.Provider,{value:null,children:w.jsx(oe,j({ownerState:G,"aria-invalid":re.error,"aria-describedby":o,autoComplete:a,autoFocus:s,defaultValue:f,disabled:re.disabled,id:g,onAnimationStart:H,name:O,placeholder:T,readOnly:L,required:re.required,rows:B,value:q,onKeyDown:P,onKeyUp:R,type:N},ye,!Vl(oe)&&{as:ge,ownerState:j({},G,ye.ownerState)},{ref:te,className:ke(ie.input,ye.className,L&&"MuiInputBase-readOnly"),onBlur:Q,onChange:X,onFocus:le}))}),p,z?z(j({},re,{startAdornment:$})):null]}))]})}),w5=kPe;function APe(t){return We("MuiInput",t)}const h0=j({},Jg,Ve("MuiInput",["root","underline","input"]));function RPe(t){return We("MuiOutlinedInput",t)}const Mu=j({},Jg,Ve("MuiOutlinedInput",["root","notchedOutline","input"]));function IPe(t){return We("MuiFilledInput",t)}const $d=j({},Jg,Ve("MuiFilledInput",["root","underline","input"])),DPe=ni(w.jsx("path",{d:"M7 10l5 5 5-5z"}),"ArrowDropDown"),LPe=ni(w.jsx("path",{d:"M12 12c2.21 0 4-1.79 4-4s-1.79-4-4-4-4 1.79-4 4 1.79 4 4 4zm0 2c-2.67 0-8 1.34-8 4v2h16v-2c0-2.66-5.33-4-8-4z"}),"Person");function NPe(t){return We("MuiAvatar",t)}Ve("MuiAvatar",["root","colorDefault","circular","rounded","square","img","fallback"]);const $Pe=["alt","children","className","component","slots","slotProps","imgProps","sizes","src","srcSet","variant"],FPe=l5(),jPe=t=>{const{classes:e,variant:n,colorDefault:r}=t;return Ue({root:["root",n,r&&"colorDefault"],img:["img"],fallback:["fallback"]},NPe,e)},BPe=we("div",{name:"MuiAvatar",slot:"Root",overridesResolver:(t,e)=>{const{ownerState:n}=t;return[e.root,e[n.variant],n.colorDefault&&e.colorDefault]}})(({theme:t})=>({position:"relative",display:"flex",alignItems:"center",justifyContent:"center",flexShrink:0,width:40,height:40,fontFamily:t.typography.fontFamily,fontSize:t.typography.pxToRem(20),lineHeight:1,borderRadius:"50%",overflow:"hidden",userSelect:"none",variants:[{props:{variant:"rounded"},style:{borderRadius:(t.vars||t).shape.borderRadius}},{props:{variant:"square"},style:{borderRadius:0}},{props:{colorDefault:!0},style:j({color:(t.vars||t).palette.background.default},t.vars?{backgroundColor:t.vars.palette.Avatar.defaultBg}:j({backgroundColor:t.palette.grey[400]},t.applyStyles("dark",{backgroundColor:t.palette.grey[600]})))}]})),zPe=we("img",{name:"MuiAvatar",slot:"Img",overridesResolver:(t,e)=>e.img})({width:"100%",height:"100%",textAlign:"center",objectFit:"cover",color:"transparent",textIndent:1e4}),UPe=we(LPe,{name:"MuiAvatar",slot:"Fallback",overridesResolver:(t,e)=>e.fallback})({width:"75%",height:"75%"});function WPe({crossOrigin:t,referrerPolicy:e,src:n,srcSet:r}){const[i,o]=M.useState(!1);return M.useEffect(()=>{if(!n&&!r)return;o(!1);let a=!0;const s=new Image;return s.onload=()=>{a&&o("loaded")},s.onerror=()=>{a&&o("error")},s.crossOrigin=t,s.referrerPolicy=e,s.src=n,r&&(s.srcset=r),()=>{a=!1}},[t,e,n,r]),i}const EA=M.forwardRef(function(e,n){const r=FPe({props:e,name:"MuiAvatar"}),{alt:i,children:o,className:a,component:s="div",slots:l={},slotProps:c={},imgProps:u,sizes:f,src:d,srcSet:h,variant:p="circular"}=r,m=Ae(r,$Pe);let g=null;const v=WPe(j({},u,{src:d,srcSet:h})),y=d||h,x=y&&v!=="error",b=j({},r,{colorDefault:!x,component:s,variant:p}),_=jPe(b),[S,O]=zCe("img",{className:_.img,elementType:zPe,externalForwardedProps:{slots:l,slotProps:{img:j({},u,c.img)}},additionalProps:{alt:i,src:d,srcSet:h,sizes:f},ownerState:b});return x?g=w.jsx(S,j({},O)):o||o===0?g=o:y&&i?g=i[0]:g=w.jsx(UPe,{ownerState:b,className:_.fallback}),w.jsx(BPe,j({as:s,ownerState:b,className:ke(_.root,a),ref:n},m,{children:g}))}),VPe=["addEndListener","appear","children","easing","in","onEnter","onEntered","onEntering","onExit","onExited","onExiting","style","timeout","TransitionComponent"],GPe={entering:{opacity:1},entered:{opacity:1}},ZM=M.forwardRef(function(e,n){const r=Go(),i={enter:r.transitions.duration.enteringScreen,exit:r.transitions.duration.leavingScreen},{addEndListener:o,appear:a=!0,children:s,easing:l,in:c,onEnter:u,onEntered:f,onEntering:d,onExit:h,onExited:p,onExiting:m,style:g,timeout:v=i,TransitionComponent:y=ka}=e,x=Ae(e,VPe),b=M.useRef(null),_=Zt(b,s.ref,n),S=T=>L=>{if(T){const z=b.current;L===void 0?T(z):T(z,L)}},O=S(d),C=S((T,L)=>{f5(T);const z=Zf({style:g,timeout:v,easing:l},{mode:"enter"});T.style.webkitTransition=r.transitions.create("opacity",z),T.style.transition=r.transitions.create("opacity",z),u&&u(T,L)}),E=S(f),k=S(m),I=S(T=>{const L=Zf({style:g,timeout:v,easing:l},{mode:"exit"});T.style.webkitTransition=r.transitions.create("opacity",L),T.style.transition=r.transitions.create("opacity",L),h&&h(T)}),P=S(p),R=T=>{o&&o(b.current,T)};return w.jsx(y,j({appear:a,in:c,nodeRef:b,onEnter:C,onEntered:E,onEntering:O,onExit:I,onExited:P,onExiting:k,addEndListener:R,timeout:v},x,{children:(T,L)=>M.cloneElement(s,j({style:j({opacity:0,visibility:T==="exited"&&!c?"hidden":void 0},GPe[T],g,s.props.style),ref:_},L))}))});function HPe(t){return We("MuiBackdrop",t)}Ve("MuiBackdrop",["root","invisible"]);const qPe=["children","className","component","components","componentsProps","invisible","open","slotProps","slots","TransitionComponent","transitionDuration"],XPe=t=>{const{classes:e,invisible:n}=t;return Ue({root:["root",n&&"invisible"]},HPe,e)},QPe=we("div",{name:"MuiBackdrop",slot:"Root",overridesResolver:(t,e)=>{const{ownerState:n}=t;return[e.root,n.invisible&&e.invisible]}})(({ownerState:t})=>j({position:"fixed",display:"flex",alignItems:"center",justifyContent:"center",right:0,bottom:0,top:0,left:0,backgroundColor:"rgba(0, 0, 0, 0.5)",WebkitTapHighlightColor:"transparent"},t.invisible&&{backgroundColor:"transparent"})),Bre=M.forwardRef(function(e,n){var r,i,o;const a=qe({props:e,name:"MuiBackdrop"}),{children:s,className:l,component:c="div",components:u={},componentsProps:f={},invisible:d=!1,open:h,slotProps:p={},slots:m={},TransitionComponent:g=ZM,transitionDuration:v}=a,y=Ae(a,qPe),x=j({},a,{component:c,invisible:d}),b=XPe(x),_=(r=p.root)!=null?r:f.root;return w.jsx(g,j({in:h,timeout:v},y,{children:w.jsx(QPe,j({"aria-hidden":!0},_,{as:(i=(o=m.root)!=null?o:u.Root)!=null?i:c,className:ke(b.root,l,_==null?void 0:_.className),ownerState:j({},x,_==null?void 0:_.ownerState),classes:b,ref:n,children:s}))}))}),YPe=Ve("MuiBox",["root"]),KPe=o5(),Ke=nSe({themeId:Kh,defaultTheme:KPe,defaultClassName:YPe.root,generateClassName:Yj.generate});function ZPe(t){return We("MuiButton",t)}const uS=Ve("MuiButton",["root","text","textInherit","textPrimary","textSecondary","textSuccess","textError","textInfo","textWarning","outlined","outlinedInherit","outlinedPrimary","outlinedSecondary","outlinedSuccess","outlinedError","outlinedInfo","outlinedWarning","contained","containedInherit","containedPrimary","containedSecondary","containedSuccess","containedError","containedInfo","containedWarning","disableElevation","focusVisible","disabled","colorInherit","colorPrimary","colorSecondary","colorSuccess","colorError","colorInfo","colorWarning","textSizeSmall","textSizeMedium","textSizeLarge","outlinedSizeSmall","outlinedSizeMedium","outlinedSizeLarge","containedSizeSmall","containedSizeMedium","containedSizeLarge","sizeMedium","sizeSmall","sizeLarge","fullWidth","startIcon","endIcon","icon","iconSizeSmall","iconSizeMedium","iconSizeLarge"]),JPe=M.createContext({}),eMe=M.createContext(void 0),tMe=["children","color","component","className","disabled","disableElevation","disableFocusRipple","endIcon","focusVisibleClassName","fullWidth","size","startIcon","type","variant"],nMe=t=>{const{color:e,disableElevation:n,fullWidth:r,size:i,variant:o,classes:a}=t,s={root:["root",o,`${o}${De(e)}`,`size${De(i)}`,`${o}Size${De(i)}`,`color${De(e)}`,n&&"disableElevation",r&&"fullWidth"],label:["label"],startIcon:["icon","startIcon",`iconSize${De(i)}`],endIcon:["icon","endIcon",`iconSize${De(i)}`]},l=Ue(s,ZPe,a);return j({},a,l)},zre=t=>j({},t.size==="small"&&{"& > *:nth-of-type(1)":{fontSize:18}},t.size==="medium"&&{"& > *:nth-of-type(1)":{fontSize:20}},t.size==="large"&&{"& > *:nth-of-type(1)":{fontSize:22}}),rMe=we(fs,{shouldForwardProp:t=>hi(t)||t==="classes",name:"MuiButton",slot:"Root",overridesResolver:(t,e)=>{const{ownerState:n}=t;return[e.root,e[n.variant],e[`${n.variant}${De(n.color)}`],e[`size${De(n.size)}`],e[`${n.variant}Size${De(n.size)}`],n.color==="inherit"&&e.colorInherit,n.disableElevation&&e.disableElevation,n.fullWidth&&e.fullWidth]}})(({theme:t,ownerState:e})=>{var n,r;const i=t.palette.mode==="light"?t.palette.grey[300]:t.palette.grey[800],o=t.palette.mode==="light"?t.palette.grey.A100:t.palette.grey[700];return j({},t.typography.button,{minWidth:64,padding:"6px 16px",borderRadius:(t.vars||t).shape.borderRadius,transition:t.transitions.create(["background-color","box-shadow","border-color","color"],{duration:t.transitions.duration.short}),"&:hover":j({textDecoration:"none",backgroundColor:t.vars?`rgba(${t.vars.palette.text.primaryChannel} / ${t.vars.palette.action.hoverOpacity})`:kt(t.palette.text.primary,t.palette.action.hoverOpacity),"@media (hover: none)":{backgroundColor:"transparent"}},e.variant==="text"&&e.color!=="inherit"&&{backgroundColor:t.vars?`rgba(${t.vars.palette[e.color].mainChannel} / ${t.vars.palette.action.hoverOpacity})`:kt(t.palette[e.color].main,t.palette.action.hoverOpacity),"@media (hover: none)":{backgroundColor:"transparent"}},e.variant==="outlined"&&e.color!=="inherit"&&{border:`1px solid ${(t.vars||t).palette[e.color].main}`,backgroundColor:t.vars?`rgba(${t.vars.palette[e.color].mainChannel} / ${t.vars.palette.action.hoverOpacity})`:kt(t.palette[e.color].main,t.palette.action.hoverOpacity),"@media (hover: none)":{backgroundColor:"transparent"}},e.variant==="contained"&&{backgroundColor:t.vars?t.vars.palette.Button.inheritContainedHoverBg:o,boxShadow:(t.vars||t).shadows[4],"@media (hover: none)":{boxShadow:(t.vars||t).shadows[2],backgroundColor:(t.vars||t).palette.grey[300]}},e.variant==="contained"&&e.color!=="inherit"&&{backgroundColor:(t.vars||t).palette[e.color].dark,"@media (hover: none)":{backgroundColor:(t.vars||t).palette[e.color].main}}),"&:active":j({},e.variant==="contained"&&{boxShadow:(t.vars||t).shadows[8]}),[`&.${uS.focusVisible}`]:j({},e.variant==="contained"&&{boxShadow:(t.vars||t).shadows[6]}),[`&.${uS.disabled}`]:j({color:(t.vars||t).palette.action.disabled},e.variant==="outlined"&&{border:`1px solid ${(t.vars||t).palette.action.disabledBackground}`},e.variant==="contained"&&{color:(t.vars||t).palette.action.disabled,boxShadow:(t.vars||t).shadows[0],backgroundColor:(t.vars||t).palette.action.disabledBackground})},e.variant==="text"&&{padding:"6px 8px"},e.variant==="text"&&e.color!=="inherit"&&{color:(t.vars||t).palette[e.color].main},e.variant==="outlined"&&{padding:"5px 15px",border:"1px solid currentColor"},e.variant==="outlined"&&e.color!=="inherit"&&{color:(t.vars||t).palette[e.color].main,border:t.vars?`1px solid rgba(${t.vars.palette[e.color].mainChannel} / 0.5)`:`1px solid ${kt(t.palette[e.color].main,.5)}`},e.variant==="contained"&&{color:t.vars?t.vars.palette.text.primary:(n=(r=t.palette).getContrastText)==null?void 0:n.call(r,t.palette.grey[300]),backgroundColor:t.vars?t.vars.palette.Button.inheritContainedBg:i,boxShadow:(t.vars||t).shadows[2]},e.variant==="contained"&&e.color!=="inherit"&&{color:(t.vars||t).palette[e.color].contrastText,backgroundColor:(t.vars||t).palette[e.color].main},e.color==="inherit"&&{color:"inherit",borderColor:"currentColor"},e.size==="small"&&e.variant==="text"&&{padding:"4px 5px",fontSize:t.typography.pxToRem(13)},e.size==="large"&&e.variant==="text"&&{padding:"8px 11px",fontSize:t.typography.pxToRem(15)},e.size==="small"&&e.variant==="outlined"&&{padding:"3px 9px",fontSize:t.typography.pxToRem(13)},e.size==="large"&&e.variant==="outlined"&&{padding:"7px 21px",fontSize:t.typography.pxToRem(15)},e.size==="small"&&e.variant==="contained"&&{padding:"4px 10px",fontSize:t.typography.pxToRem(13)},e.size==="large"&&e.variant==="contained"&&{padding:"8px 22px",fontSize:t.typography.pxToRem(15)},e.fullWidth&&{width:"100%"})},({ownerState:t})=>t.disableElevation&&{boxShadow:"none","&:hover":{boxShadow:"none"},[`&.${uS.focusVisible}`]:{boxShadow:"none"},"&:active":{boxShadow:"none"},[`&.${uS.disabled}`]:{boxShadow:"none"}}),iMe=we("span",{name:"MuiButton",slot:"StartIcon",overridesResolver:(t,e)=>{const{ownerState:n}=t;return[e.startIcon,e[`iconSize${De(n.size)}`]]}})(({ownerState:t})=>j({display:"inherit",marginRight:8,marginLeft:-4},t.size==="small"&&{marginLeft:-2},zre(t))),oMe=we("span",{name:"MuiButton",slot:"EndIcon",overridesResolver:(t,e)=>{const{ownerState:n}=t;return[e.endIcon,e[`iconSize${De(n.size)}`]]}})(({ownerState:t})=>j({display:"inherit",marginRight:-4,marginLeft:8},t.size==="small"&&{marginRight:-2},zre(t))),tr=M.forwardRef(function(e,n){const r=M.useContext(JPe),i=M.useContext(eMe),o=kM(r,e),a=qe({props:o,name:"MuiButton"}),{children:s,color:l="primary",component:c="button",className:u,disabled:f=!1,disableElevation:d=!1,disableFocusRipple:h=!1,endIcon:p,focusVisibleClassName:m,fullWidth:g=!1,size:v="medium",startIcon:y,type:x,variant:b="text"}=a,_=Ae(a,tMe),S=j({},a,{color:l,component:c,disabled:f,disableElevation:d,disableFocusRipple:h,fullWidth:g,size:v,type:x,variant:b}),O=nMe(S),C=y&&w.jsx(iMe,{className:O.startIcon,ownerState:S,children:y}),E=p&&w.jsx(oMe,{className:O.endIcon,ownerState:S,children:p}),k=i||"";return w.jsxs(rMe,j({ownerState:S,className:ke(r.className,O.root,u,k),component:c,disabled:f,focusRipple:!h,focusVisibleClassName:ke(O.focusVisible,m),ref:n,type:x},_,{classes:O,children:[C,s,E]}))});function aMe(t){return We("MuiCard",t)}Ve("MuiCard",["root"]);const sMe=["className","raised"],lMe=t=>{const{classes:e}=t;return Ue({root:["root"]},aMe,e)},cMe=we(Ho,{name:"MuiCard",slot:"Root",overridesResolver:(t,e)=>e.root})(()=>({overflow:"hidden"})),Ure=M.forwardRef(function(e,n){const r=qe({props:e,name:"MuiCard"}),{className:i,raised:o=!1}=r,a=Ae(r,sMe),s=j({},r,{raised:o}),l=lMe(s);return w.jsx(cMe,j({className:ke(l.root,i),elevation:o?8:void 0,ref:n,ownerState:s},a))});function uMe(t){return We("MuiCardActions",t)}Ve("MuiCardActions",["root","spacing"]);const fMe=["disableSpacing","className"],dMe=t=>{const{classes:e,disableSpacing:n}=t;return Ue({root:["root",!n&&"spacing"]},uMe,e)},hMe=we("div",{name:"MuiCardActions",slot:"Root",overridesResolver:(t,e)=>{const{ownerState:n}=t;return[e.root,!n.disableSpacing&&e.spacing]}})(({ownerState:t})=>j({display:"flex",alignItems:"center",padding:8},!t.disableSpacing&&{"& > :not(style) ~ :not(style)":{marginLeft:8}})),Wre=M.forwardRef(function(e,n){const r=qe({props:e,name:"MuiCardActions"}),{disableSpacing:i=!1,className:o}=r,a=Ae(r,fMe),s=j({},r,{disableSpacing:i}),l=dMe(s);return w.jsx(hMe,j({className:ke(l.root,o),ownerState:s,ref:n},a))});function pMe(t){return We("MuiCardContent",t)}Ve("MuiCardContent",["root"]);const mMe=["className","component"],gMe=t=>{const{classes:e}=t;return Ue({root:["root"]},pMe,e)},vMe=we("div",{name:"MuiCardContent",slot:"Root",overridesResolver:(t,e)=>e.root})(()=>({padding:16,"&:last-child":{paddingBottom:24}})),Vre=M.forwardRef(function(e,n){const r=qe({props:e,name:"MuiCardContent"}),{className:i,component:o="div"}=r,a=Ae(r,mMe),s=j({},r,{component:o}),l=gMe(s);return w.jsx(vMe,j({as:o,className:ke(l.root,i),ownerState:s,ref:n},a))});function yMe(t){return We("MuiCardHeader",t)}const w8=Ve("MuiCardHeader",["root","avatar","action","content","title","subheader"]),xMe=["action","avatar","className","component","disableTypography","subheader","subheaderTypographyProps","title","titleTypographyProps"],bMe=t=>{const{classes:e}=t;return Ue({root:["root"],avatar:["avatar"],action:["action"],content:["content"],title:["title"],subheader:["subheader"]},yMe,e)},_Me=we("div",{name:"MuiCardHeader",slot:"Root",overridesResolver:(t,e)=>j({[`& .${w8.title}`]:e.title,[`& .${w8.subheader}`]:e.subheader},e.root)})({display:"flex",alignItems:"center",padding:16}),wMe=we("div",{name:"MuiCardHeader",slot:"Avatar",overridesResolver:(t,e)=>e.avatar})({display:"flex",flex:"0 0 auto",marginRight:16}),SMe=we("div",{name:"MuiCardHeader",slot:"Action",overridesResolver:(t,e)=>e.action})({flex:"0 0 auto",alignSelf:"flex-start",marginTop:-4,marginRight:-8,marginBottom:-4}),OMe=we("div",{name:"MuiCardHeader",slot:"Content",overridesResolver:(t,e)=>e.content})({flex:"1 1 auto"}),CMe=M.forwardRef(function(e,n){const r=qe({props:e,name:"MuiCardHeader"}),{action:i,avatar:o,className:a,component:s="div",disableTypography:l=!1,subheader:c,subheaderTypographyProps:u,title:f,titleTypographyProps:d}=r,h=Ae(r,xMe),p=j({},r,{component:s,disableTypography:l}),m=bMe(p);let g=f;g!=null&&g.type!==At&&!l&&(g=w.jsx(At,j({variant:o?"body2":"h5",className:m.title,component:"span",display:"block"},d,{children:g})));let v=c;return v!=null&&v.type!==At&&!l&&(v=w.jsx(At,j({variant:o?"body2":"body1",className:m.subheader,color:"text.secondary",component:"span",display:"block"},u,{children:v}))),w.jsxs(_Me,j({className:ke(m.root,a),as:s,ref:n,ownerState:p},h,{children:[o&&w.jsx(wMe,{className:m.avatar,ownerState:p,children:o}),w.jsxs(OMe,{className:m.content,ownerState:p,children:[g,v]}),i&&w.jsx(SMe,{className:m.action,ownerState:p,children:i})]}))});function TMe(t){return We("MuiCardMedia",t)}Ve("MuiCardMedia",["root","media","img"]);const EMe=["children","className","component","image","src","style"],PMe=t=>{const{classes:e,isMediaComponent:n,isImageComponent:r}=t;return Ue({root:["root",n&&"media",r&&"img"]},TMe,e)},MMe=we("div",{name:"MuiCardMedia",slot:"Root",overridesResolver:(t,e)=>{const{ownerState:n}=t,{isMediaComponent:r,isImageComponent:i}=n;return[e.root,r&&e.media,i&&e.img]}})(({ownerState:t})=>j({display:"block",backgroundSize:"cover",backgroundRepeat:"no-repeat",backgroundPosition:"center"},t.isMediaComponent&&{width:"100%"},t.isImageComponent&&{objectFit:"cover"})),kMe=["video","audio","picture","iframe","img"],AMe=["picture","img"],RMe=M.forwardRef(function(e,n){const r=qe({props:e,name:"MuiCardMedia"}),{children:i,className:o,component:a="div",image:s,src:l,style:c}=r,u=Ae(r,EMe),f=kMe.indexOf(a)!==-1,d=!f&&s?j({backgroundImage:`url("${s}")`},c):c,h=j({},r,{component:a,isMediaComponent:f,isImageComponent:AMe.indexOf(a)!==-1}),p=PMe(h);return w.jsx(MMe,j({className:ke(p.root,o),as:a,role:!f&&s?"img":void 0,ref:n,style:d,ownerState:h,src:f?s||l:void 0},u,{children:i}))});function IMe(t){return We("PrivateSwitchBase",t)}Ve("PrivateSwitchBase",["root","checked","disabled","input","edgeStart","edgeEnd"]);const DMe=["autoFocus","checked","checkedIcon","className","defaultChecked","disabled","disableFocusRipple","edge","icon","id","inputProps","inputRef","name","onBlur","onChange","onFocus","readOnly","required","tabIndex","type","value"],LMe=t=>{const{classes:e,checked:n,disabled:r,edge:i}=t,o={root:["root",n&&"checked",r&&"disabled",i&&`edge${De(i)}`],input:["input"]};return Ue(o,IMe,e)},NMe=we(fs)(({ownerState:t})=>j({padding:9,borderRadius:"50%"},t.edge==="start"&&{marginLeft:t.size==="small"?-3:-12},t.edge==="end"&&{marginRight:t.size==="small"?-3:-12})),$Me=we("input",{shouldForwardProp:hi})({cursor:"inherit",position:"absolute",opacity:0,width:"100%",height:"100%",top:0,left:0,margin:0,padding:0,zIndex:1}),S5=M.forwardRef(function(e,n){const{autoFocus:r,checked:i,checkedIcon:o,className:a,defaultChecked:s,disabled:l,disableFocusRipple:c=!1,edge:u=!1,icon:f,id:d,inputProps:h,inputRef:p,name:m,onBlur:g,onChange:v,onFocus:y,readOnly:x,required:b=!1,tabIndex:_,type:S,value:O}=e,C=Ae(e,DMe),[E,k]=Qs({controlled:i,default:!!s,name:"SwitchBase",state:"checked"}),I=oc(),P=W=>{y&&y(W),I&&I.onFocus&&I.onFocus(W)},R=W=>{g&&g(W),I&&I.onBlur&&I.onBlur(W)},T=W=>{if(W.nativeEvent.defaultPrevented)return;const $=W.target.checked;k($),v&&v(W,$)};let L=l;I&&typeof L>"u"&&(L=I.disabled);const z=S==="checkbox"||S==="radio",B=j({},e,{checked:E,disabled:L,disableFocusRipple:c,edge:u}),U=LMe(B);return w.jsxs(NMe,j({component:"span",className:ke(U.root,a),centerRipple:!0,focusRipple:!c,disabled:L,tabIndex:null,role:void 0,onFocus:P,onBlur:R,ownerState:B,ref:n},C,{children:[w.jsx($Me,j({autoFocus:r,checked:i,defaultChecked:s,className:U.input,disabled:L,id:z?d:void 0,name:m,onChange:T,readOnly:x,ref:p,required:b,ownerState:B,tabIndex:_,type:S},S==="checkbox"&&O===void 0?{}:{value:O},h)),E?o:f]}))}),FMe=ni(w.jsx("path",{d:"M19 5v14H5V5h14m0-2H5c-1.1 0-2 .9-2 2v14c0 1.1.9 2 2 2h14c1.1 0 2-.9 2-2V5c0-1.1-.9-2-2-2z"}),"CheckBoxOutlineBlank"),jMe=ni(w.jsx("path",{d:"M19 3H5c-1.11 0-2 .9-2 2v14c0 1.1.89 2 2 2h14c1.11 0 2-.9 2-2V5c0-1.1-.89-2-2-2zm-9 14l-5-5 1.41-1.41L10 14.17l7.59-7.59L19 8l-9 9z"}),"CheckBox"),BMe=ni(w.jsx("path",{d:"M19 3H5c-1.1 0-2 .9-2 2v14c0 1.1.9 2 2 2h14c1.1 0 2-.9 2-2V5c0-1.1-.9-2-2-2zm-2 10H7v-2h10v2z"}),"IndeterminateCheckBox");function zMe(t){return We("MuiCheckbox",t)}const PA=Ve("MuiCheckbox",["root","checked","disabled","indeterminate","colorPrimary","colorSecondary","sizeSmall","sizeMedium"]),UMe=["checkedIcon","color","icon","indeterminate","indeterminateIcon","inputProps","size","className"],WMe=t=>{const{classes:e,indeterminate:n,color:r,size:i}=t,o={root:["root",n&&"indeterminate",`color${De(r)}`,`size${De(i)}`]},a=Ue(o,zMe,e);return j({},e,a)},VMe=we(S5,{shouldForwardProp:t=>hi(t)||t==="classes",name:"MuiCheckbox",slot:"Root",overridesResolver:(t,e)=>{const{ownerState:n}=t;return[e.root,n.indeterminate&&e.indeterminate,e[`size${De(n.size)}`],n.color!=="default"&&e[`color${De(n.color)}`]]}})(({theme:t,ownerState:e})=>j({color:(t.vars||t).palette.text.secondary},!e.disableRipple&&{"&:hover":{backgroundColor:t.vars?`rgba(${e.color==="default"?t.vars.palette.action.activeChannel:t.vars.palette[e.color].mainChannel} / ${t.vars.palette.action.hoverOpacity})`:kt(e.color==="default"?t.palette.action.active:t.palette[e.color].main,t.palette.action.hoverOpacity),"@media (hover: none)":{backgroundColor:"transparent"}}},e.color!=="default"&&{[`&.${PA.checked}, &.${PA.indeterminate}`]:{color:(t.vars||t).palette[e.color].main},[`&.${PA.disabled}`]:{color:(t.vars||t).palette.action.disabled}})),GMe=w.jsx(jMe,{}),HMe=w.jsx(FMe,{}),qMe=w.jsx(BMe,{}),UL=M.forwardRef(function(e,n){var r,i;const o=qe({props:e,name:"MuiCheckbox"}),{checkedIcon:a=GMe,color:s="primary",icon:l=HMe,indeterminate:c=!1,indeterminateIcon:u=qMe,inputProps:f,size:d="medium",className:h}=o,p=Ae(o,UMe),m=c?u:l,g=c?u:a,v=j({},o,{color:s,indeterminate:c,size:d}),y=WMe(v);return w.jsx(VMe,j({type:"checkbox",inputProps:j({"data-indeterminate":c},f),icon:M.cloneElement(m,{fontSize:(r=m.props.fontSize)!=null?r:d}),checkedIcon:M.cloneElement(g,{fontSize:(i=g.props.fontSize)!=null?i:d}),ownerState:v,ref:n,className:ke(y.root,h)},p,{classes:y}))});function XMe(t){return We("MuiCircularProgress",t)}Ve("MuiCircularProgress",["root","determinate","indeterminate","colorPrimary","colorSecondary","svg","circle","circleDeterminate","circleIndeterminate","circleDisableShrink"]);const QMe=["className","color","disableShrink","size","style","thickness","value","variant"];let JM=t=>t,S8,O8,C8,T8;const ku=44,YMe=Qv(S8||(S8=JM`
  0% {
    transform: rotate(0deg);
  }

  100% {
    transform: rotate(360deg);
  }
`)),KMe=Qv(O8||(O8=JM`
  0% {
    stroke-dasharray: 1px, 200px;
    stroke-dashoffset: 0;
  }

  50% {
    stroke-dasharray: 100px, 200px;
    stroke-dashoffset: -15px;
  }

  100% {
    stroke-dasharray: 100px, 200px;
    stroke-dashoffset: -125px;
  }
`)),ZMe=t=>{const{classes:e,variant:n,color:r,disableShrink:i}=t,o={root:["root",n,`color${De(r)}`],svg:["svg"],circle:["circle",`circle${De(n)}`,i&&"circleDisableShrink"]};return Ue(o,XMe,e)},JMe=we("span",{name:"MuiCircularProgress",slot:"Root",overridesResolver:(t,e)=>{const{ownerState:n}=t;return[e.root,e[n.variant],e[`color${De(n.color)}`]]}})(({ownerState:t,theme:e})=>j({display:"inline-block"},t.variant==="determinate"&&{transition:e.transitions.create("transform")},t.color!=="inherit"&&{color:(e.vars||e).palette[t.color].main}),({ownerState:t})=>t.variant==="indeterminate"&&pM(C8||(C8=JM`
      animation: ${0} 1.4s linear infinite;
    `),YMe)),e2e=we("svg",{name:"MuiCircularProgress",slot:"Svg",overridesResolver:(t,e)=>e.svg})({display:"block"}),t2e=we("circle",{name:"MuiCircularProgress",slot:"Circle",overridesResolver:(t,e)=>{const{ownerState:n}=t;return[e.circle,e[`circle${De(n.variant)}`],n.disableShrink&&e.circleDisableShrink]}})(({ownerState:t,theme:e})=>j({stroke:"currentColor"},t.variant==="determinate"&&{transition:e.transitions.create("stroke-dashoffset")},t.variant==="indeterminate"&&{strokeDasharray:"80px, 200px",strokeDashoffset:0}),({ownerState:t})=>t.variant==="indeterminate"&&!t.disableShrink&&pM(T8||(T8=JM`
      animation: ${0} 1.4s ease-in-out infinite;
    `),KMe)),ey=M.forwardRef(function(e,n){const r=qe({props:e,name:"MuiCircularProgress"}),{className:i,color:o="primary",disableShrink:a=!1,size:s=40,style:l,thickness:c=3.6,value:u=0,variant:f="indeterminate"}=r,d=Ae(r,QMe),h=j({},r,{color:o,disableShrink:a,size:s,thickness:c,value:u,variant:f}),p=ZMe(h),m={},g={},v={};if(f==="determinate"){const y=2*Math.PI*((ku-c)/2);m.strokeDasharray=y.toFixed(3),v["aria-valuenow"]=Math.round(u),m.strokeDashoffset=`${((100-u)/100*y).toFixed(3)}px`,g.transform="rotate(-90deg)"}return w.jsx(JMe,j({className:ke(p.root,i),style:j({width:s,height:s},g,l),ownerState:h,ref:n,role:"progressbar"},v,d,{children:w.jsx(e2e,{className:p.svg,ownerState:h,viewBox:`${ku/2} ${ku/2} ${ku} ${ku}`,children:w.jsx(t2e,{className:p.circle,style:m,ownerState:h,cx:ku,cy:ku,r:(ku-c)/2,fill:"none",strokeWidth:c})})}))}),n2e=(t,e)=>j({WebkitFontSmoothing:"antialiased",MozOsxFontSmoothing:"grayscale",boxSizing:"border-box",WebkitTextSizeAdjust:"100%"},e&&!t.vars&&{colorScheme:t.palette.mode}),r2e=t=>j({color:(t.vars||t).palette.text.primary},t.typography.body1,{backgroundColor:(t.vars||t).palette.background.default,"@media print":{backgroundColor:(t.vars||t).palette.common.white}}),i2e=(t,e=!1)=>{var n;const r={};e&&t.colorSchemes&&Object.entries(t.colorSchemes).forEach(([a,s])=>{var l;r[t.getColorSchemeSelector(a).replace(/\s*&/,"")]={colorScheme:(l=s.palette)==null?void 0:l.mode}});let i=j({html:n2e(t,e),"*, *::before, *::after":{boxSizing:"inherit"},"strong, b":{fontWeight:t.typography.fontWeightBold},body:j({margin:0},r2e(t),{"&::backdrop":{backgroundColor:(t.vars||t).palette.background.default}})},r);const o=(n=t.components)==null||(n=n.MuiCssBaseline)==null?void 0:n.styleOverrides;return o&&(i=[i,o]),i};function o2e(t){const e=qe({props:t,name:"MuiCssBaseline"}),{children:n,enableColorScheme:r=!1}=e;return w.jsxs(M.Fragment,{children:[w.jsx(jre,{styles:i=>i2e(i,r)}),n]})}function a2e(t){return We("MuiModal",t)}Ve("MuiModal",["root","hidden","backdrop"]);const s2e=["BackdropComponent","BackdropProps","classes","className","closeAfterTransition","children","container","component","components","componentsProps","disableAutoFocus","disableEnforceFocus","disableEscapeKeyDown","disablePortal","disableRestoreFocus","disableScrollLock","hideBackdrop","keepMounted","onBackdropClick","onClose","onTransitionEnter","onTransitionExited","open","slotProps","slots","theme"],l2e=t=>{const{open:e,exited:n,classes:r}=t;return Ue({root:["root",!e&&n&&"hidden"],backdrop:["backdrop"]},a2e,r)},c2e=we("div",{name:"MuiModal",slot:"Root",overridesResolver:(t,e)=>{const{ownerState:n}=t;return[e.root,!n.open&&n.exited&&e.hidden]}})(({theme:t,ownerState:e})=>j({position:"fixed",zIndex:(t.vars||t).zIndex.modal,right:0,bottom:0,top:0,left:0},!e.open&&e.exited&&{visibility:"hidden"})),u2e=we(Bre,{name:"MuiModal",slot:"Backdrop",overridesResolver:(t,e)=>e.backdrop})({zIndex:-1}),Gre=M.forwardRef(function(e,n){var r,i,o,a,s,l;const c=qe({name:"MuiModal",props:e}),{BackdropComponent:u=u2e,BackdropProps:f,className:d,closeAfterTransition:h=!1,children:p,container:m,component:g,components:v={},componentsProps:y={},disableAutoFocus:x=!1,disableEnforceFocus:b=!1,disableEscapeKeyDown:_=!1,disablePortal:S=!1,disableRestoreFocus:O=!1,disableScrollLock:C=!1,hideBackdrop:E=!1,keepMounted:k=!1,onBackdropClick:I,open:P,slotProps:R,slots:T}=c,L=Ae(c,s2e),z=j({},c,{closeAfterTransition:h,disableAutoFocus:x,disableEnforceFocus:b,disableEscapeKeyDown:_,disablePortal:S,disableRestoreFocus:O,disableScrollLock:C,hideBackdrop:E,keepMounted:k}),{getRootProps:B,getBackdropProps:U,getTransitionProps:W,portalRef:$,isTopModal:N,exited:D,hasTransition:A}=$Te(j({},z,{rootRef:n})),q=j({},z,{exited:D}),Y=l2e(q),K={};if(p.props.tabIndex===void 0&&(K.tabIndex="-1"),A){const{onEnter:ve,onExited:F}=W();K.onEnter=ve,K.onExited=F}const se=(r=(i=T==null?void 0:T.root)!=null?i:v.Root)!=null?r:c2e,te=(o=(a=T==null?void 0:T.backdrop)!=null?a:v.Backdrop)!=null?o:u,J=(s=R==null?void 0:R.root)!=null?s:y.root,pe=(l=R==null?void 0:R.backdrop)!=null?l:y.backdrop,be=$r({elementType:se,externalSlotProps:J,externalForwardedProps:L,getSlotProps:B,additionalProps:{ref:n,as:g},ownerState:q,className:ke(d,J==null?void 0:J.className,Y==null?void 0:Y.root,!q.open&&q.exited&&(Y==null?void 0:Y.hidden))}),re=$r({elementType:te,externalSlotProps:pe,additionalProps:f,getSlotProps:ve=>U(j({},ve,{onClick:F=>{I&&I(F),ve!=null&&ve.onClick&&ve.onClick(F)}})),className:ke(pe==null?void 0:pe.className,f==null?void 0:f.className,Y==null?void 0:Y.backdrop),ownerState:q});return!k&&!P&&(!A||D)?null:w.jsx(Cre,{ref:$,container:m,disablePortal:S,children:w.jsxs(se,j({},be,{children:[!E&&u?w.jsx(te,j({},re)):null,w.jsx(Ore,{disableEnforceFocus:b,disableAutoFocus:x,disableRestoreFocus:O,isEnabled:N,open:P,children:M.cloneElement(p,K)})]}))})});function f2e(t){return We("MuiDialog",t)}const zx=Ve("MuiDialog",["root","scrollPaper","scrollBody","container","paper","paperScrollPaper","paperScrollBody","paperWidthFalse","paperWidthXs","paperWidthSm","paperWidthMd","paperWidthLg","paperWidthXl","paperFullWidth","paperFullScreen"]),Hre=M.createContext({}),d2e=["aria-describedby","aria-labelledby","BackdropComponent","BackdropProps","children","className","disableEscapeKeyDown","fullScreen","fullWidth","maxWidth","onBackdropClick","onClick","onClose","open","PaperComponent","PaperProps","scroll","TransitionComponent","transitionDuration","TransitionProps"],h2e=we(Bre,{name:"MuiDialog",slot:"Backdrop",overrides:(t,e)=>e.backdrop})({zIndex:-1}),p2e=t=>{const{classes:e,scroll:n,maxWidth:r,fullWidth:i,fullScreen:o}=t,a={root:["root"],container:["container",`scroll${De(n)}`],paper:["paper",`paperScroll${De(n)}`,`paperWidth${De(String(r))}`,i&&"paperFullWidth",o&&"paperFullScreen"]};return Ue(a,f2e,e)},m2e=we(Gre,{name:"MuiDialog",slot:"Root",overridesResolver:(t,e)=>e.root})({"@media print":{position:"absolute !important"}}),g2e=we("div",{name:"MuiDialog",slot:"Container",overridesResolver:(t,e)=>{const{ownerState:n}=t;return[e.container,e[`scroll${De(n.scroll)}`]]}})(({ownerState:t})=>j({height:"100%","@media print":{height:"auto"},outline:0},t.scroll==="paper"&&{display:"flex",justifyContent:"center",alignItems:"center"},t.scroll==="body"&&{overflowY:"auto",overflowX:"hidden",textAlign:"center","&::after":{content:'""',display:"inline-block",verticalAlign:"middle",height:"100%",width:"0"}})),v2e=we(Ho,{name:"MuiDialog",slot:"Paper",overridesResolver:(t,e)=>{const{ownerState:n}=t;return[e.paper,e[`scrollPaper${De(n.scroll)}`],e[`paperWidth${De(String(n.maxWidth))}`],n.fullWidth&&e.paperFullWidth,n.fullScreen&&e.paperFullScreen]}})(({theme:t,ownerState:e})=>j({margin:32,position:"relative",overflowY:"auto","@media print":{overflowY:"visible",boxShadow:"none"}},e.scroll==="paper"&&{display:"flex",flexDirection:"column",maxHeight:"calc(100% - 64px)"},e.scroll==="body"&&{display:"inline-block",verticalAlign:"middle",textAlign:"left"},!e.maxWidth&&{maxWidth:"calc(100% - 64px)"},e.maxWidth==="xs"&&{maxWidth:t.breakpoints.unit==="px"?Math.max(t.breakpoints.values.xs,444):`max(${t.breakpoints.values.xs}${t.breakpoints.unit}, 444px)`,[`&.${zx.paperScrollBody}`]:{[t.breakpoints.down(Math.max(t.breakpoints.values.xs,444)+32*2)]:{maxWidth:"calc(100% - 64px)"}}},e.maxWidth&&e.maxWidth!=="xs"&&{maxWidth:`${t.breakpoints.values[e.maxWidth]}${t.breakpoints.unit}`,[`&.${zx.paperScrollBody}`]:{[t.breakpoints.down(t.breakpoints.values[e.maxWidth]+32*2)]:{maxWidth:"calc(100% - 64px)"}}},e.fullWidth&&{width:"calc(100% - 64px)"},e.fullScreen&&{margin:0,width:"100%",maxWidth:"100%",height:"100%",maxHeight:"none",borderRadius:0,[`&.${zx.paperScrollBody}`]:{margin:0,maxWidth:"100%"}})),rl=M.forwardRef(function(e,n){const r=qe({props:e,name:"MuiDialog"}),i=Go(),o={enter:i.transitions.duration.enteringScreen,exit:i.transitions.duration.leavingScreen},{"aria-describedby":a,"aria-labelledby":s,BackdropComponent:l,BackdropProps:c,children:u,className:f,disableEscapeKeyDown:d=!1,fullScreen:h=!1,fullWidth:p=!1,maxWidth:m="sm",onBackdropClick:g,onClick:v,onClose:y,open:x,PaperComponent:b=Ho,PaperProps:_={},scroll:S="paper",TransitionComponent:O=ZM,transitionDuration:C=o,TransitionProps:E}=r,k=Ae(r,d2e),I=j({},r,{disableEscapeKeyDown:d,fullScreen:h,fullWidth:p,maxWidth:m,scroll:S}),P=p2e(I),R=M.useRef(),T=U=>{R.current=U.target===U.currentTarget},L=U=>{v&&v(U),R.current&&(R.current=null,g&&g(U),y&&y(U,"backdropClick"))},z=pd(s),B=M.useMemo(()=>({titleId:z}),[z]);return w.jsx(m2e,j({className:ke(P.root,f),closeAfterTransition:!0,components:{Backdrop:h2e},componentsProps:{backdrop:j({transitionDuration:C,as:l},c)},disableEscapeKeyDown:d,onClose:y,open:x,ref:n,onClick:L,ownerState:I},k,{children:w.jsx(O,j({appear:!0,in:x,timeout:C,role:"presentation"},E,{children:w.jsx(g2e,{className:ke(P.container),onMouseDown:T,ownerState:I,children:w.jsx(v2e,j({as:b,elevation:24,role:"dialog","aria-describedby":a,"aria-labelledby":z},_,{className:ke(P.paper,_.className),ownerState:I,children:w.jsx(Hre.Provider,{value:B,children:u})}))})}))}))});function y2e(t){return We("MuiDialogActions",t)}Ve("MuiDialogActions",["root","spacing"]);const x2e=["className","disableSpacing"],b2e=t=>{const{classes:e,disableSpacing:n}=t;return Ue({root:["root",!n&&"spacing"]},y2e,e)},_2e=we("div",{name:"MuiDialogActions",slot:"Root",overridesResolver:(t,e)=>{const{ownerState:n}=t;return[e.root,!n.disableSpacing&&e.spacing]}})(({ownerState:t})=>j({display:"flex",alignItems:"center",padding:8,justifyContent:"flex-end",flex:"0 0 auto"},!t.disableSpacing&&{"& > :not(style) ~ :not(style)":{marginLeft:8}})),Tp=M.forwardRef(function(e,n){const r=qe({props:e,name:"MuiDialogActions"}),{className:i,disableSpacing:o=!1}=r,a=Ae(r,x2e),s=j({},r,{disableSpacing:o}),l=b2e(s);return w.jsx(_2e,j({className:ke(l.root,i),ownerState:s,ref:n},a))});function w2e(t){return We("MuiDialogContent",t)}Ve("MuiDialogContent",["root","dividers"]);function S2e(t){return We("MuiDialogTitle",t)}const O2e=Ve("MuiDialogTitle",["root"]),C2e=["className","dividers"],T2e=t=>{const{classes:e,dividers:n}=t;return Ue({root:["root",n&&"dividers"]},w2e,e)},E2e=we("div",{name:"MuiDialogContent",slot:"Root",overridesResolver:(t,e)=>{const{ownerState:n}=t;return[e.root,n.dividers&&e.dividers]}})(({theme:t,ownerState:e})=>j({flex:"1 1 auto",WebkitOverflowScrolling:"touch",overflowY:"auto",padding:"20px 24px"},e.dividers?{padding:"16px 24px",borderTop:`1px solid ${(t.vars||t).palette.divider}`,borderBottom:`1px solid ${(t.vars||t).palette.divider}`}:{[`.${O2e.root} + &`]:{paddingTop:0}})),Ys=M.forwardRef(function(e,n){const r=qe({props:e,name:"MuiDialogContent"}),{className:i,dividers:o=!1}=r,a=Ae(r,C2e),s=j({},r,{dividers:o}),l=T2e(s);return w.jsx(E2e,j({className:ke(l.root,i),ownerState:s,ref:n},a))});function P2e(t){return We("MuiDialogContentText",t)}Ve("MuiDialogContentText",["root"]);const M2e=["children","className"],k2e=t=>{const{classes:e}=t,r=Ue({root:["root"]},P2e,e);return j({},e,r)},A2e=we(At,{shouldForwardProp:t=>hi(t)||t==="classes",name:"MuiDialogContentText",slot:"Root",overridesResolver:(t,e)=>e.root})({}),R2e=M.forwardRef(function(e,n){const r=qe({props:e,name:"MuiDialogContentText"}),{className:i}=r,o=Ae(r,M2e),a=k2e(o);return w.jsx(A2e,j({component:"p",variant:"body1",color:"text.secondary",ref:n,ownerState:o,className:ke(a.root,i)},r,{classes:a}))}),I2e=["className","id"],D2e=t=>{const{classes:e}=t;return Ue({root:["root"]},S2e,e)},L2e=we(At,{name:"MuiDialogTitle",slot:"Root",overridesResolver:(t,e)=>e.root})({padding:"16px 24px",flex:"0 0 auto"}),vd=M.forwardRef(function(e,n){const r=qe({props:e,name:"MuiDialogTitle"}),{className:i,id:o}=r,a=Ae(r,I2e),s=r,l=D2e(s),{titleId:c=o}=M.useContext(Hre);return w.jsx(L2e,j({component:"h2",className:ke(l.root,i),ownerState:s,ref:n,variant:"h6",id:o??c},a))});function N2e(t){return We("MuiDivider",t)}const E8=Ve("MuiDivider",["root","absolute","fullWidth","inset","middle","flexItem","light","vertical","withChildren","withChildrenVertical","textAlignRight","textAlignLeft","wrapper","wrapperVertical"]),$2e=["absolute","children","className","component","flexItem","light","orientation","role","textAlign","variant"],F2e=t=>{const{absolute:e,children:n,classes:r,flexItem:i,light:o,orientation:a,textAlign:s,variant:l}=t;return Ue({root:["root",e&&"absolute",l,o&&"light",a==="vertical"&&"vertical",i&&"flexItem",n&&"withChildren",n&&a==="vertical"&&"withChildrenVertical",s==="right"&&a!=="vertical"&&"textAlignRight",s==="left"&&a!=="vertical"&&"textAlignLeft"],wrapper:["wrapper",a==="vertical"&&"wrapperVertical"]},N2e,r)},j2e=we("div",{name:"MuiDivider",slot:"Root",overridesResolver:(t,e)=>{const{ownerState:n}=t;return[e.root,n.absolute&&e.absolute,e[n.variant],n.light&&e.light,n.orientation==="vertical"&&e.vertical,n.flexItem&&e.flexItem,n.children&&e.withChildren,n.children&&n.orientation==="vertical"&&e.withChildrenVertical,n.textAlign==="right"&&n.orientation!=="vertical"&&e.textAlignRight,n.textAlign==="left"&&n.orientation!=="vertical"&&e.textAlignLeft]}})(({theme:t,ownerState:e})=>j({margin:0,flexShrink:0,borderWidth:0,borderStyle:"solid",borderColor:(t.vars||t).palette.divider,borderBottomWidth:"thin"},e.absolute&&{position:"absolute",bottom:0,left:0,width:"100%"},e.light&&{borderColor:t.vars?`rgba(${t.vars.palette.dividerChannel} / 0.08)`:kt(t.palette.divider,.08)},e.variant==="inset"&&{marginLeft:72},e.variant==="middle"&&e.orientation==="horizontal"&&{marginLeft:t.spacing(2),marginRight:t.spacing(2)},e.variant==="middle"&&e.orientation==="vertical"&&{marginTop:t.spacing(1),marginBottom:t.spacing(1)},e.orientation==="vertical"&&{height:"100%",borderBottomWidth:0,borderRightWidth:"thin"},e.flexItem&&{alignSelf:"stretch",height:"auto"}),({ownerState:t})=>j({},t.children&&{display:"flex",whiteSpace:"nowrap",textAlign:"center",border:0,"&::before, &::after":{content:'""',alignSelf:"center"}}),({theme:t,ownerState:e})=>j({},e.children&&e.orientation!=="vertical"&&{"&::before, &::after":{width:"100%",borderTop:`thin solid ${(t.vars||t).palette.divider}`}}),({theme:t,ownerState:e})=>j({},e.children&&e.orientation==="vertical"&&{flexDirection:"column","&::before, &::after":{height:"100%",borderLeft:`thin solid ${(t.vars||t).palette.divider}`}}),({ownerState:t})=>j({},t.textAlign==="right"&&t.orientation!=="vertical"&&{"&::before":{width:"90%"},"&::after":{width:"10%"}},t.textAlign==="left"&&t.orientation!=="vertical"&&{"&::before":{width:"10%"},"&::after":{width:"90%"}})),B2e=we("span",{name:"MuiDivider",slot:"Wrapper",overridesResolver:(t,e)=>{const{ownerState:n}=t;return[e.wrapper,n.orientation==="vertical"&&e.wrapperVertical]}})(({theme:t,ownerState:e})=>j({display:"inline-block",paddingLeft:`calc(${t.spacing(1)} * 1.2)`,paddingRight:`calc(${t.spacing(1)} * 1.2)`},e.orientation==="vertical"&&{paddingTop:`calc(${t.spacing(1)} * 1.2)`,paddingBottom:`calc(${t.spacing(1)} * 1.2)`})),ep=M.forwardRef(function(e,n){const r=qe({props:e,name:"MuiDivider"}),{absolute:i=!1,children:o,className:a,component:s=o?"div":"hr",flexItem:l=!1,light:c=!1,orientation:u="horizontal",role:f=s!=="hr"?"separator":void 0,textAlign:d="center",variant:h="fullWidth"}=r,p=Ae(r,$2e),m=j({},r,{absolute:i,component:s,flexItem:l,light:c,orientation:u,role:f,textAlign:d,variant:h}),g=F2e(m);return w.jsx(j2e,j({as:s,className:ke(g.root,a),role:f,ref:n,ownerState:m},p,{children:o?w.jsx(B2e,{className:g.wrapper,ownerState:m,children:o}):null}))});ep.muiSkipListHighlight=!0;const z2e=["addEndListener","appear","children","container","direction","easing","in","onEnter","onEntered","onEntering","onExit","onExited","onExiting","style","timeout","TransitionComponent"];function U2e(t,e,n){const r=e.getBoundingClientRect(),i=n&&n.getBoundingClientRect(),o=cs(e);let a;if(e.fakeTransform)a=e.fakeTransform;else{const c=o.getComputedStyle(e);a=c.getPropertyValue("-webkit-transform")||c.getPropertyValue("transform")}let s=0,l=0;if(a&&a!=="none"&&typeof a=="string"){const c=a.split("(")[1].split(")")[0].split(",");s=parseInt(c[4],10),l=parseInt(c[5],10)}return t==="left"?i?`translateX(${i.right+s-r.left}px)`:`translateX(${o.innerWidth+s-r.left}px)`:t==="right"?i?`translateX(-${r.right-i.left-s}px)`:`translateX(-${r.left+r.width-s}px)`:t==="up"?i?`translateY(${i.bottom+l-r.top}px)`:`translateY(${o.innerHeight+l-r.top}px)`:i?`translateY(-${r.top-i.top+r.height-l}px)`:`translateY(-${r.top+r.height-l}px)`}function W2e(t){return typeof t=="function"?t():t}function fS(t,e,n){const r=W2e(n),i=U2e(t,e,r);i&&(e.style.webkitTransform=i,e.style.transform=i)}const V2e=M.forwardRef(function(e,n){const r=Go(),i={enter:r.transitions.easing.easeOut,exit:r.transitions.easing.sharp},o={enter:r.transitions.duration.enteringScreen,exit:r.transitions.duration.leavingScreen},{addEndListener:a,appear:s=!0,children:l,container:c,direction:u="down",easing:f=i,in:d,onEnter:h,onEntered:p,onEntering:m,onExit:g,onExited:v,onExiting:y,style:x,timeout:b=o,TransitionComponent:_=ka}=e,S=Ae(e,z2e),O=M.useRef(null),C=Zt(l.ref,O,n),E=U=>W=>{U&&(W===void 0?U(O.current):U(O.current,W))},k=E((U,W)=>{fS(u,U,c),f5(U),h&&h(U,W)}),I=E((U,W)=>{const $=Zf({timeout:b,style:x,easing:f},{mode:"enter"});U.style.webkitTransition=r.transitions.create("-webkit-transform",j({},$)),U.style.transition=r.transitions.create("transform",j({},$)),U.style.webkitTransform="none",U.style.transform="none",m&&m(U,W)}),P=E(p),R=E(y),T=E(U=>{const W=Zf({timeout:b,style:x,easing:f},{mode:"exit"});U.style.webkitTransition=r.transitions.create("-webkit-transform",W),U.style.transition=r.transitions.create("transform",W),fS(u,U,c),g&&g(U)}),L=E(U=>{U.style.webkitTransition="",U.style.transition="",v&&v(U)}),z=U=>{a&&a(O.current,U)},B=M.useCallback(()=>{O.current&&fS(u,O.current,c)},[u,c]);return M.useEffect(()=>{if(d||u==="down"||u==="right")return;const U=Kv(()=>{O.current&&fS(u,O.current,c)}),W=cs(O.current);return W.addEventListener("resize",U),()=>{U.clear(),W.removeEventListener("resize",U)}},[u,d,c]),M.useEffect(()=>{d||B()},[d,B]),w.jsx(_,j({nodeRef:O,onEnter:k,onEntered:P,onEntering:I,onExit:T,onExited:L,onExiting:R,addEndListener:z,appear:s,in:d,timeout:b},S,{children:(U,W)=>M.cloneElement(l,j({ref:C,style:j({visibility:U==="exited"&&!d?"hidden":void 0},x,l.props.style)},W))}))}),G2e=["disableUnderline","components","componentsProps","fullWidth","hiddenLabel","inputComponent","multiline","slotProps","slots","type"],H2e=t=>{const{classes:e,disableUnderline:n}=t,i=Ue({root:["root",!n&&"underline"],input:["input"]},IPe,e);return j({},e,i)},q2e=we(YM,{shouldForwardProp:t=>hi(t)||t==="classes",name:"MuiFilledInput",slot:"Root",overridesResolver:(t,e)=>{const{ownerState:n}=t;return[...XM(t,e),!n.disableUnderline&&e.underline]}})(({theme:t,ownerState:e})=>{var n;const r=t.palette.mode==="light",i=r?"rgba(0, 0, 0, 0.42)":"rgba(255, 255, 255, 0.7)",o=r?"rgba(0, 0, 0, 0.06)":"rgba(255, 255, 255, 0.09)",a=r?"rgba(0, 0, 0, 0.09)":"rgba(255, 255, 255, 0.13)",s=r?"rgba(0, 0, 0, 0.12)":"rgba(255, 255, 255, 0.12)";return j({position:"relative",backgroundColor:t.vars?t.vars.palette.FilledInput.bg:o,borderTopLeftRadius:(t.vars||t).shape.borderRadius,borderTopRightRadius:(t.vars||t).shape.borderRadius,transition:t.transitions.create("background-color",{duration:t.transitions.duration.shorter,easing:t.transitions.easing.easeOut}),"&:hover":{backgroundColor:t.vars?t.vars.palette.FilledInput.hoverBg:a,"@media (hover: none)":{backgroundColor:t.vars?t.vars.palette.FilledInput.bg:o}},[`&.${$d.focused}`]:{backgroundColor:t.vars?t.vars.palette.FilledInput.bg:o},[`&.${$d.disabled}`]:{backgroundColor:t.vars?t.vars.palette.FilledInput.disabledBg:s}},!e.disableUnderline&&{"&::after":{borderBottom:`2px solid ${(n=(t.vars||t).palette[e.color||"primary"])==null?void 0:n.main}`,left:0,bottom:0,content:'""',position:"absolute",right:0,transform:"scaleX(0)",transition:t.transitions.create("transform",{duration:t.transitions.duration.shorter,easing:t.transitions.easing.easeOut}),pointerEvents:"none"},[`&.${$d.focused}:after`]:{transform:"scaleX(1) translateX(0)"},[`&.${$d.error}`]:{"&::before, &::after":{borderBottomColor:(t.vars||t).palette.error.main}},"&::before":{borderBottom:`1px solid ${t.vars?`rgba(${t.vars.palette.common.onBackgroundChannel} / ${t.vars.opacity.inputUnderline})`:i}`,left:0,bottom:0,content:'"\\00a0"',position:"absolute",right:0,transition:t.transitions.create("border-bottom-color",{duration:t.transitions.duration.shorter}),pointerEvents:"none"},[`&:hover:not(.${$d.disabled}, .${$d.error}):before`]:{borderBottom:`1px solid ${(t.vars||t).palette.text.primary}`},[`&.${$d.disabled}:before`]:{borderBottomStyle:"dotted"}},e.startAdornment&&{paddingLeft:12},e.endAdornment&&{paddingRight:12},e.multiline&&j({padding:"25px 12px 8px"},e.size==="small"&&{paddingTop:21,paddingBottom:4},e.hiddenLabel&&{paddingTop:16,paddingBottom:17},e.hiddenLabel&&e.size==="small"&&{paddingTop:8,paddingBottom:9}))}),X2e=we(KM,{name:"MuiFilledInput",slot:"Input",overridesResolver:QM})(({theme:t,ownerState:e})=>j({paddingTop:25,paddingRight:12,paddingBottom:8,paddingLeft:12},!t.vars&&{"&:-webkit-autofill":{WebkitBoxShadow:t.palette.mode==="light"?null:"0 0 0 100px #266798 inset",WebkitTextFillColor:t.palette.mode==="light"?null:"#fff",caretColor:t.palette.mode==="light"?null:"#fff",borderTopLeftRadius:"inherit",borderTopRightRadius:"inherit"}},t.vars&&{"&:-webkit-autofill":{borderTopLeftRadius:"inherit",borderTopRightRadius:"inherit"},[t.getColorSchemeSelector("dark")]:{"&:-webkit-autofill":{WebkitBoxShadow:"0 0 0 100px #266798 inset",WebkitTextFillColor:"#fff",caretColor:"#fff"}}},e.size==="small"&&{paddingTop:21,paddingBottom:4},e.hiddenLabel&&{paddingTop:16,paddingBottom:17},e.startAdornment&&{paddingLeft:0},e.endAdornment&&{paddingRight:0},e.hiddenLabel&&e.size==="small"&&{paddingTop:8,paddingBottom:9},e.multiline&&{paddingTop:0,paddingBottom:0,paddingLeft:0,paddingRight:0})),O5=M.forwardRef(function(e,n){var r,i,o,a;const s=qe({props:e,name:"MuiFilledInput"}),{components:l={},componentsProps:c,fullWidth:u=!1,inputComponent:f="input",multiline:d=!1,slotProps:h,slots:p={},type:m="text"}=s,g=Ae(s,G2e),v=j({},s,{fullWidth:u,inputComponent:f,multiline:d,type:m}),y=H2e(s),x={root:{ownerState:v},input:{ownerState:v}},b=h??c?Ii(x,h??c):x,_=(r=(i=p.root)!=null?i:l.Root)!=null?r:q2e,S=(o=(a=p.input)!=null?a:l.Input)!=null?o:X2e;return w.jsx(w5,j({slots:{root:_,input:S},componentsProps:b,fullWidth:u,inputComponent:f,multiline:d,ref:n,type:m},g,{classes:y}))});O5.muiName="Input";function Q2e(t){return We("MuiFormControl",t)}Ve("MuiFormControl",["root","marginNone","marginNormal","marginDense","fullWidth","disabled"]);const Y2e=["children","className","color","component","disabled","error","focused","fullWidth","hiddenLabel","margin","required","size","variant"],K2e=t=>{const{classes:e,margin:n,fullWidth:r}=t,i={root:["root",n!=="none"&&`margin${De(n)}`,r&&"fullWidth"]};return Ue(i,Q2e,e)},Z2e=we("div",{name:"MuiFormControl",slot:"Root",overridesResolver:({ownerState:t},e)=>j({},e.root,e[`margin${De(t.margin)}`],t.fullWidth&&e.fullWidth)})(({ownerState:t})=>j({display:"inline-flex",flexDirection:"column",position:"relative",minWidth:0,padding:0,margin:0,border:0,verticalAlign:"top"},t.margin==="normal"&&{marginTop:16,marginBottom:8},t.margin==="dense"&&{marginTop:8,marginBottom:4},t.fullWidth&&{width:"100%"})),ty=M.forwardRef(function(e,n){const r=qe({props:e,name:"MuiFormControl"}),{children:i,className:o,color:a="primary",component:s="div",disabled:l=!1,error:c=!1,focused:u,fullWidth:f=!1,hiddenLabel:d=!1,margin:h="none",required:p=!1,size:m="medium",variant:g="outlined"}=r,v=Ae(r,Y2e),y=j({},r,{color:a,component:s,disabled:l,error:c,fullWidth:f,hiddenLabel:d,margin:h,required:p,size:m,variant:g}),x=K2e(y),[b,_]=M.useState(()=>{let R=!1;return i&&M.Children.forEach(i,T=>{if(!$x(T,["Input","Select"]))return;const L=$x(T,["Select"])?T.props.input:T;L&&CPe(L.props)&&(R=!0)}),R}),[S,O]=M.useState(()=>{let R=!1;return i&&M.Children.forEach(i,T=>{$x(T,["Input","Select"])&&(AT(T.props,!0)||AT(T.props.inputProps,!0))&&(R=!0)}),R}),[C,E]=M.useState(!1);l&&C&&E(!1);const k=u!==void 0&&!l?u:C;let I;const P=M.useMemo(()=>({adornedStart:b,setAdornedStart:_,color:a,disabled:l,error:c,filled:S,focused:k,fullWidth:f,hiddenLabel:d,size:m,onBlur:()=>{E(!1)},onEmpty:()=>{O(!1)},onFilled:()=>{O(!0)},onFocus:()=>{E(!0)},registerEffect:I,required:p,variant:g}),[b,a,l,c,S,k,f,d,I,p,m,g]);return w.jsx(qM.Provider,{value:P,children:w.jsx(Z2e,j({as:s,ownerState:y,className:ke(x.root,o),ref:n},v,{children:i}))})}),J2e=eOe({createStyledComponent:we("div",{name:"MuiStack",slot:"Root",overridesResolver:(t,e)=>e.root}),useThemeProps:t=>qe({props:t,name:"MuiStack"})});function eke(t){return We("MuiFormControlLabel",t)}const lx=Ve("MuiFormControlLabel",["root","labelPlacementStart","labelPlacementTop","labelPlacementBottom","disabled","label","error","required","asterisk"]),tke=["checked","className","componentsProps","control","disabled","disableTypography","inputRef","label","labelPlacement","name","onChange","required","slotProps","value"],nke=t=>{const{classes:e,disabled:n,labelPlacement:r,error:i,required:o}=t,a={root:["root",n&&"disabled",`labelPlacement${De(r)}`,i&&"error",o&&"required"],label:["label",n&&"disabled"],asterisk:["asterisk",i&&"error"]};return Ue(a,eke,e)},rke=we("label",{name:"MuiFormControlLabel",slot:"Root",overridesResolver:(t,e)=>{const{ownerState:n}=t;return[{[`& .${lx.label}`]:e.label},e.root,e[`labelPlacement${De(n.labelPlacement)}`]]}})(({theme:t,ownerState:e})=>j({display:"inline-flex",alignItems:"center",cursor:"pointer",verticalAlign:"middle",WebkitTapHighlightColor:"transparent",marginLeft:-11,marginRight:16,[`&.${lx.disabled}`]:{cursor:"default"}},e.labelPlacement==="start"&&{flexDirection:"row-reverse",marginLeft:16,marginRight:-11},e.labelPlacement==="top"&&{flexDirection:"column-reverse",marginLeft:16},e.labelPlacement==="bottom"&&{flexDirection:"column",marginLeft:16},{[`& .${lx.label}`]:{[`&.${lx.disabled}`]:{color:(t.vars||t).palette.text.disabled}}})),ike=we("span",{name:"MuiFormControlLabel",slot:"Asterisk",overridesResolver:(t,e)=>e.asterisk})(({theme:t})=>({[`&.${lx.error}`]:{color:(t.vars||t).palette.error.main}})),Og=M.forwardRef(function(e,n){var r,i;const o=qe({props:e,name:"MuiFormControlLabel"}),{className:a,componentsProps:s={},control:l,disabled:c,disableTypography:u,label:f,labelPlacement:d="end",required:h,slotProps:p={}}=o,m=Ae(o,tke),g=oc(),v=(r=c??l.props.disabled)!=null?r:g==null?void 0:g.disabled,y=h??l.props.required,x={disabled:v,required:y};["checked","name","onChange","value","inputRef"].forEach(E=>{typeof l.props[E]>"u"&&typeof o[E]<"u"&&(x[E]=o[E])});const b=gd({props:o,muiFormControl:g,states:["error"]}),_=j({},o,{disabled:v,labelPlacement:d,required:y,error:b.error}),S=nke(_),O=(i=p.typography)!=null?i:s.typography;let C=f;return C!=null&&C.type!==At&&!u&&(C=w.jsx(At,j({component:"span"},O,{className:ke(S.label,O==null?void 0:O.className),children:C}))),w.jsxs(rke,j({className:ke(S.root,a),ownerState:_,ref:n},m,{children:[M.cloneElement(l,x),y?w.jsxs(J2e,{display:"block",children:[C,w.jsxs(ike,{ownerState:_,"aria-hidden":!0,className:S.asterisk,children:[" ","*"]})]}):C]}))});function oke(t){return We("MuiFormGroup",t)}Ve("MuiFormGroup",["root","row","error"]);const ake=["className","row"],ske=t=>{const{classes:e,row:n,error:r}=t;return Ue({root:["root",n&&"row",r&&"error"]},oke,e)},lke=we("div",{name:"MuiFormGroup",slot:"Root",overridesResolver:(t,e)=>{const{ownerState:n}=t;return[e.root,n.row&&e.row]}})(({ownerState:t})=>j({display:"flex",flexDirection:"column",flexWrap:"wrap"},t.row&&{flexDirection:"row"})),cke=M.forwardRef(function(e,n){const r=qe({props:e,name:"MuiFormGroup"}),{className:i,row:o=!1}=r,a=Ae(r,ake),s=oc(),l=gd({props:r,muiFormControl:s,states:["error"]}),c=j({},r,{row:o,error:l.error}),u=ske(c);return w.jsx(lke,j({className:ke(u.root,i),ownerState:c,ref:n},a))});function uke(t){return We("MuiFormHelperText",t)}const P8=Ve("MuiFormHelperText",["root","error","disabled","sizeSmall","sizeMedium","contained","focused","filled","required"]);var M8;const fke=["children","className","component","disabled","error","filled","focused","margin","required","variant"],dke=t=>{const{classes:e,contained:n,size:r,disabled:i,error:o,filled:a,focused:s,required:l}=t,c={root:["root",i&&"disabled",o&&"error",r&&`size${De(r)}`,n&&"contained",s&&"focused",a&&"filled",l&&"required"]};return Ue(c,uke,e)},hke=we("p",{name:"MuiFormHelperText",slot:"Root",overridesResolver:(t,e)=>{const{ownerState:n}=t;return[e.root,n.size&&e[`size${De(n.size)}`],n.contained&&e.contained,n.filled&&e.filled]}})(({theme:t,ownerState:e})=>j({color:(t.vars||t).palette.text.secondary},t.typography.caption,{textAlign:"left",marginTop:3,marginRight:0,marginBottom:0,marginLeft:0,[`&.${P8.disabled}`]:{color:(t.vars||t).palette.text.disabled},[`&.${P8.error}`]:{color:(t.vars||t).palette.error.main}},e.size==="small"&&{marginTop:4},e.contained&&{marginLeft:14,marginRight:14})),qre=M.forwardRef(function(e,n){const r=qe({props:e,name:"MuiFormHelperText"}),{children:i,className:o,component:a="p"}=r,s=Ae(r,fke),l=oc(),c=gd({props:r,muiFormControl:l,states:["variant","size","disabled","error","filled","focused","required"]}),u=j({},r,{component:a,contained:c.variant==="filled"||c.variant==="outlined",variant:c.variant,size:c.size,disabled:c.disabled,error:c.error,filled:c.filled,focused:c.focused,required:c.required}),f=dke(u);return w.jsx(hke,j({as:a,ownerState:u,className:ke(f.root,o),ref:n},s,{children:i===" "?M8||(M8=w.jsx("span",{className:"notranslate",children:"​"})):i}))});function pke(t){return We("MuiFormLabel",t)}const Ux=Ve("MuiFormLabel",["root","colorSecondary","focused","disabled","error","filled","required","asterisk"]),mke=["children","className","color","component","disabled","error","filled","focused","required"],gke=t=>{const{classes:e,color:n,focused:r,disabled:i,error:o,filled:a,required:s}=t,l={root:["root",`color${De(n)}`,i&&"disabled",o&&"error",a&&"filled",r&&"focused",s&&"required"],asterisk:["asterisk",o&&"error"]};return Ue(l,pke,e)},vke=we("label",{name:"MuiFormLabel",slot:"Root",overridesResolver:({ownerState:t},e)=>j({},e.root,t.color==="secondary"&&e.colorSecondary,t.filled&&e.filled)})(({theme:t,ownerState:e})=>j({color:(t.vars||t).palette.text.secondary},t.typography.body1,{lineHeight:"1.4375em",padding:0,position:"relative",[`&.${Ux.focused}`]:{color:(t.vars||t).palette[e.color].main},[`&.${Ux.disabled}`]:{color:(t.vars||t).palette.text.disabled},[`&.${Ux.error}`]:{color:(t.vars||t).palette.error.main}})),yke=we("span",{name:"MuiFormLabel",slot:"Asterisk",overridesResolver:(t,e)=>e.asterisk})(({theme:t})=>({[`&.${Ux.error}`]:{color:(t.vars||t).palette.error.main}})),xke=M.forwardRef(function(e,n){const r=qe({props:e,name:"MuiFormLabel"}),{children:i,className:o,component:a="label"}=r,s=Ae(r,mke),l=oc(),c=gd({props:r,muiFormControl:l,states:["color","required","focused","disabled","error","filled"]}),u=j({},r,{color:c.color||"primary",component:a,disabled:c.disabled,error:c.error,filled:c.filled,focused:c.focused,required:c.required}),f=gke(u);return w.jsxs(vke,j({as:a,ownerState:u,className:ke(f.root,o),ref:n},s,{children:[i,c.required&&w.jsxs(yke,{ownerState:u,"aria-hidden":!0,className:f.asterisk,children:[" ","*"]})]}))}),k8=M.createContext();function bke(t){return We("MuiGrid",t)}const _ke=[0,1,2,3,4,5,6,7,8,9,10],wke=["column-reverse","column","row-reverse","row"],Ske=["nowrap","wrap-reverse","wrap"],p0=["auto",!0,1,2,3,4,5,6,7,8,9,10,11,12],Lb=Ve("MuiGrid",["root","container","item","zeroMinWidth",..._ke.map(t=>`spacing-xs-${t}`),...wke.map(t=>`direction-xs-${t}`),...Ske.map(t=>`wrap-xs-${t}`),...p0.map(t=>`grid-xs-${t}`),...p0.map(t=>`grid-sm-${t}`),...p0.map(t=>`grid-md-${t}`),...p0.map(t=>`grid-lg-${t}`),...p0.map(t=>`grid-xl-${t}`)]),Oke=["className","columns","columnSpacing","component","container","direction","item","rowSpacing","spacing","wrap","zeroMinWidth"];function Cg(t){const e=parseFloat(t);return`${e}${String(t).replace(String(e),"")||"px"}`}function Cke({theme:t,ownerState:e}){let n;return t.breakpoints.keys.reduce((r,i)=>{let o={};if(e[i]&&(n=e[i]),!n)return r;if(n===!0)o={flexBasis:0,flexGrow:1,maxWidth:"100%"};else if(n==="auto")o={flexBasis:"auto",flexGrow:0,flexShrink:0,maxWidth:"none",width:"auto"};else{const a=Lh({values:e.columns,breakpoints:t.breakpoints.values}),s=typeof a=="object"?a[i]:a;if(s==null)return r;const l=`${Math.round(n/s*1e8)/1e6}%`;let c={};if(e.container&&e.item&&e.columnSpacing!==0){const u=t.spacing(e.columnSpacing);if(u!=="0px"){const f=`calc(${l} + ${Cg(u)})`;c={flexBasis:f,maxWidth:f}}}o=j({flexBasis:l,flexGrow:0,maxWidth:l},c)}return t.breakpoints.values[i]===0?Object.assign(r,o):r[t.breakpoints.up(i)]=o,r},{})}function Tke({theme:t,ownerState:e}){const n=Lh({values:e.direction,breakpoints:t.breakpoints.values});return Wo({theme:t},n,r=>{const i={flexDirection:r};return r.indexOf("column")===0&&(i[`& > .${Lb.item}`]={maxWidth:"none"}),i})}function Xre({breakpoints:t,values:e}){let n="";Object.keys(e).forEach(i=>{n===""&&e[i]!==0&&(n=i)});const r=Object.keys(t).sort((i,o)=>t[i]-t[o]);return r.slice(0,r.indexOf(n))}function Eke({theme:t,ownerState:e}){const{container:n,rowSpacing:r}=e;let i={};if(n&&r!==0){const o=Lh({values:r,breakpoints:t.breakpoints.values});let a;typeof o=="object"&&(a=Xre({breakpoints:t.breakpoints.values,values:o})),i=Wo({theme:t},o,(s,l)=>{var c;const u=t.spacing(s);return u!=="0px"?{marginTop:`-${Cg(u)}`,[`& > .${Lb.item}`]:{paddingTop:Cg(u)}}:(c=a)!=null&&c.includes(l)?{}:{marginTop:0,[`& > .${Lb.item}`]:{paddingTop:0}}})}return i}function Pke({theme:t,ownerState:e}){const{container:n,columnSpacing:r}=e;let i={};if(n&&r!==0){const o=Lh({values:r,breakpoints:t.breakpoints.values});let a;typeof o=="object"&&(a=Xre({breakpoints:t.breakpoints.values,values:o})),i=Wo({theme:t},o,(s,l)=>{var c;const u=t.spacing(s);return u!=="0px"?{width:`calc(100% + ${Cg(u)})`,marginLeft:`-${Cg(u)}`,[`& > .${Lb.item}`]:{paddingLeft:Cg(u)}}:(c=a)!=null&&c.includes(l)?{}:{width:"100%",marginLeft:0,[`& > .${Lb.item}`]:{paddingLeft:0}}})}return i}function Mke(t,e,n={}){if(!t||t<=0)return[];if(typeof t=="string"&&!Number.isNaN(Number(t))||typeof t=="number")return[n[`spacing-xs-${String(t)}`]];const r=[];return e.forEach(i=>{const o=t[i];Number(o)>0&&r.push(n[`spacing-${i}-${String(o)}`])}),r}const kke=we("div",{name:"MuiGrid",slot:"Root",overridesResolver:(t,e)=>{const{ownerState:n}=t,{container:r,direction:i,item:o,spacing:a,wrap:s,zeroMinWidth:l,breakpoints:c}=n;let u=[];r&&(u=Mke(a,c,e));const f=[];return c.forEach(d=>{const h=n[d];h&&f.push(e[`grid-${d}-${String(h)}`])}),[e.root,r&&e.container,o&&e.item,l&&e.zeroMinWidth,...u,i!=="row"&&e[`direction-xs-${String(i)}`],s!=="wrap"&&e[`wrap-xs-${String(s)}`],...f]}})(({ownerState:t})=>j({boxSizing:"border-box"},t.container&&{display:"flex",flexWrap:"wrap",width:"100%"},t.item&&{margin:0},t.zeroMinWidth&&{minWidth:0},t.wrap!=="wrap"&&{flexWrap:t.wrap}),Tke,Eke,Pke,Cke);function Ake(t,e){if(!t||t<=0)return[];if(typeof t=="string"&&!Number.isNaN(Number(t))||typeof t=="number")return[`spacing-xs-${String(t)}`];const n=[];return e.forEach(r=>{const i=t[r];if(Number(i)>0){const o=`spacing-${r}-${String(i)}`;n.push(o)}}),n}const Rke=t=>{const{classes:e,container:n,direction:r,item:i,spacing:o,wrap:a,zeroMinWidth:s,breakpoints:l}=t;let c=[];n&&(c=Ake(o,l));const u=[];l.forEach(d=>{const h=t[d];h&&u.push(`grid-${d}-${String(h)}`)});const f={root:["root",n&&"container",i&&"item",s&&"zeroMinWidth",...c,r!=="row"&&`direction-xs-${String(r)}`,a!=="wrap"&&`wrap-xs-${String(a)}`,...u]};return Ue(f,bke,e)},MC=M.forwardRef(function(e,n){const r=qe({props:e,name:"MuiGrid"}),{breakpoints:i}=Go(),o=M1(r),{className:a,columns:s,columnSpacing:l,component:c="div",container:u=!1,direction:f="row",item:d=!1,rowSpacing:h,spacing:p=0,wrap:m="wrap",zeroMinWidth:g=!1}=o,v=Ae(o,Oke),y=h||p,x=l||p,b=M.useContext(k8),_=u?s||12:b,S={},O=j({},v);i.keys.forEach(k=>{v[k]!=null&&(S[k]=v[k],delete O[k])});const C=j({},o,{columns:_,container:u,direction:f,item:d,rowSpacing:y,columnSpacing:x,wrap:m,zeroMinWidth:g,spacing:p},S,{breakpoints:i.keys}),E=Rke(C);return w.jsx(k8.Provider,{value:_,children:w.jsx(kke,j({ownerState:C,className:ke(E.root,a),as:c,ref:n},O))})}),Ike=["addEndListener","appear","children","easing","in","onEnter","onEntered","onEntering","onExit","onExited","onExiting","style","timeout","TransitionComponent"];function WL(t){return`scale(${t}, ${t**2})`}const Dke={entering:{opacity:1,transform:WL(1)},entered:{opacity:1,transform:"none"}},MA=typeof navigator<"u"&&/^((?!chrome|android).)*(safari|mobile)/i.test(navigator.userAgent)&&/(os |version\/)15(.|_)4/i.test(navigator.userAgent),ev=M.forwardRef(function(e,n){const{addEndListener:r,appear:i=!0,children:o,easing:a,in:s,onEnter:l,onEntered:c,onEntering:u,onExit:f,onExited:d,onExiting:h,style:p,timeout:m="auto",TransitionComponent:g=ka}=e,v=Ae(e,Ike),y=bf(),x=M.useRef(),b=Go(),_=M.useRef(null),S=Zt(_,o.ref,n),O=L=>z=>{if(L){const B=_.current;z===void 0?L(B):L(B,z)}},C=O(u),E=O((L,z)=>{f5(L);const{duration:B,delay:U,easing:W}=Zf({style:p,timeout:m,easing:a},{mode:"enter"});let $;m==="auto"?($=b.transitions.getAutoHeightDuration(L.clientHeight),x.current=$):$=B,L.style.transition=[b.transitions.create("opacity",{duration:$,delay:U}),b.transitions.create("transform",{duration:MA?$:$*.666,delay:U,easing:W})].join(","),l&&l(L,z)}),k=O(c),I=O(h),P=O(L=>{const{duration:z,delay:B,easing:U}=Zf({style:p,timeout:m,easing:a},{mode:"exit"});let W;m==="auto"?(W=b.transitions.getAutoHeightDuration(L.clientHeight),x.current=W):W=z,L.style.transition=[b.transitions.create("opacity",{duration:W,delay:B}),b.transitions.create("transform",{duration:MA?W:W*.666,delay:MA?B:B||W*.333,easing:U})].join(","),L.style.opacity=0,L.style.transform=WL(.75),f&&f(L)}),R=O(d),T=L=>{m==="auto"&&y.start(x.current||0,L),r&&r(_.current,L)};return w.jsx(g,j({appear:i,in:s,nodeRef:_,onEnter:E,onEntered:k,onEntering:C,onExit:P,onExited:R,onExiting:I,addEndListener:T,timeout:m==="auto"?null:m},v,{children:(L,z)=>M.cloneElement(o,j({style:j({opacity:0,transform:WL(.75),visibility:L==="exited"&&!s?"hidden":void 0},Dke[L],p,o.props.style),ref:S},z))}))});ev.muiSupportAuto=!0;const Lke=["disableUnderline","components","componentsProps","fullWidth","inputComponent","multiline","slotProps","slots","type"],Nke=t=>{const{classes:e,disableUnderline:n}=t,i=Ue({root:["root",!n&&"underline"],input:["input"]},APe,e);return j({},e,i)},$ke=we(YM,{shouldForwardProp:t=>hi(t)||t==="classes",name:"MuiInput",slot:"Root",overridesResolver:(t,e)=>{const{ownerState:n}=t;return[...XM(t,e),!n.disableUnderline&&e.underline]}})(({theme:t,ownerState:e})=>{let r=t.palette.mode==="light"?"rgba(0, 0, 0, 0.42)":"rgba(255, 255, 255, 0.7)";return t.vars&&(r=`rgba(${t.vars.palette.common.onBackgroundChannel} / ${t.vars.opacity.inputUnderline})`),j({position:"relative"},e.formControl&&{"label + &":{marginTop:16}},!e.disableUnderline&&{"&::after":{borderBottom:`2px solid ${(t.vars||t).palette[e.color].main}`,left:0,bottom:0,content:'""',position:"absolute",right:0,transform:"scaleX(0)",transition:t.transitions.create("transform",{duration:t.transitions.duration.shorter,easing:t.transitions.easing.easeOut}),pointerEvents:"none"},[`&.${h0.focused}:after`]:{transform:"scaleX(1) translateX(0)"},[`&.${h0.error}`]:{"&::before, &::after":{borderBottomColor:(t.vars||t).palette.error.main}},"&::before":{borderBottom:`1px solid ${r}`,left:0,bottom:0,content:'"\\00a0"',position:"absolute",right:0,transition:t.transitions.create("border-bottom-color",{duration:t.transitions.duration.shorter}),pointerEvents:"none"},[`&:hover:not(.${h0.disabled}, .${h0.error}):before`]:{borderBottom:`2px solid ${(t.vars||t).palette.text.primary}`,"@media (hover: none)":{borderBottom:`1px solid ${r}`}},[`&.${h0.disabled}:before`]:{borderBottomStyle:"dotted"}})}),Fke=we(KM,{name:"MuiInput",slot:"Input",overridesResolver:QM})({}),yd=M.forwardRef(function(e,n){var r,i,o,a;const s=qe({props:e,name:"MuiInput"}),{disableUnderline:l,components:c={},componentsProps:u,fullWidth:f=!1,inputComponent:d="input",multiline:h=!1,slotProps:p,slots:m={},type:g="text"}=s,v=Ae(s,Lke),y=Nke(s),b={root:{ownerState:{disableUnderline:l}}},_=p??u?Ii(p??u,b):b,S=(r=(i=m.root)!=null?i:c.Root)!=null?r:$ke,O=(o=(a=m.input)!=null?a:c.Input)!=null?o:Fke;return w.jsx(w5,j({slots:{root:S,input:O},slotProps:_,fullWidth:f,inputComponent:d,multiline:h,ref:n,type:g},v,{classes:y}))});yd.muiName="Input";function jke(t){return We("MuiInputAdornment",t)}const A8=Ve("MuiInputAdornment",["root","filled","standard","outlined","positionStart","positionEnd","disablePointerEvents","hiddenLabel","sizeSmall"]);var R8;const Bke=["children","className","component","disablePointerEvents","disableTypography","position","variant"],zke=(t,e)=>{const{ownerState:n}=t;return[e.root,e[`position${De(n.position)}`],n.disablePointerEvents===!0&&e.disablePointerEvents,e[n.variant]]},Uke=t=>{const{classes:e,disablePointerEvents:n,hiddenLabel:r,position:i,size:o,variant:a}=t,s={root:["root",n&&"disablePointerEvents",i&&`position${De(i)}`,a,r&&"hiddenLabel",o&&`size${De(o)}`]};return Ue(s,jke,e)},Wke=we("div",{name:"MuiInputAdornment",slot:"Root",overridesResolver:zke})(({theme:t,ownerState:e})=>j({display:"flex",height:"0.01em",maxHeight:"2em",alignItems:"center",whiteSpace:"nowrap",color:(t.vars||t).palette.action.active},e.variant==="filled"&&{[`&.${A8.positionStart}&:not(.${A8.hiddenLabel})`]:{marginTop:16}},e.position==="start"&&{marginRight:8},e.position==="end"&&{marginLeft:8},e.disablePointerEvents===!0&&{pointerEvents:"none"})),Vke=M.forwardRef(function(e,n){const r=qe({props:e,name:"MuiInputAdornment"}),{children:i,className:o,component:a="div",disablePointerEvents:s=!1,disableTypography:l=!1,position:c,variant:u}=r,f=Ae(r,Bke),d=oc()||{};let h=u;u&&d.variant,d&&!h&&(h=d.variant);const p=j({},r,{hiddenLabel:d.hiddenLabel,size:d.size,disablePointerEvents:s,position:c,variant:h}),m=Uke(p);return w.jsx(qM.Provider,{value:null,children:w.jsx(Wke,j({as:a,ownerState:p,className:ke(m.root,o),ref:n},f,{children:typeof i=="string"&&!l?w.jsx(At,{color:"text.secondary",children:i}):w.jsxs(M.Fragment,{children:[c==="start"?R8||(R8=w.jsx("span",{className:"notranslate",children:"​"})):null,i]})}))})});function Gke(t){return We("MuiInputLabel",t)}Ve("MuiInputLabel",["root","focused","disabled","error","required","asterisk","formControl","sizeSmall","shrink","animated","standard","filled","outlined"]);const Hke=["disableAnimation","margin","shrink","variant","className"],qke=t=>{const{classes:e,formControl:n,size:r,shrink:i,disableAnimation:o,variant:a,required:s}=t,l={root:["root",n&&"formControl",!o&&"animated",i&&"shrink",r&&r!=="normal"&&`size${De(r)}`,a],asterisk:[s&&"asterisk"]},c=Ue(l,Gke,e);return j({},e,c)},Xke=we(xke,{shouldForwardProp:t=>hi(t)||t==="classes",name:"MuiInputLabel",slot:"Root",overridesResolver:(t,e)=>{const{ownerState:n}=t;return[{[`& .${Ux.asterisk}`]:e.asterisk},e.root,n.formControl&&e.formControl,n.size==="small"&&e.sizeSmall,n.shrink&&e.shrink,!n.disableAnimation&&e.animated,n.focused&&e.focused,e[n.variant]]}})(({theme:t,ownerState:e})=>j({display:"block",transformOrigin:"top left",whiteSpace:"nowrap",overflow:"hidden",textOverflow:"ellipsis",maxWidth:"100%"},e.formControl&&{position:"absolute",left:0,top:0,transform:"translate(0, 20px) scale(1)"},e.size==="small"&&{transform:"translate(0, 17px) scale(1)"},e.shrink&&{transform:"translate(0, -1.5px) scale(0.75)",transformOrigin:"top left",maxWidth:"133%"},!e.disableAnimation&&{transition:t.transitions.create(["color","transform","max-width"],{duration:t.transitions.duration.shorter,easing:t.transitions.easing.easeOut})},e.variant==="filled"&&j({zIndex:1,pointerEvents:"none",transform:"translate(12px, 16px) scale(1)",maxWidth:"calc(100% - 24px)"},e.size==="small"&&{transform:"translate(12px, 13px) scale(1)"},e.shrink&&j({userSelect:"none",pointerEvents:"auto",transform:"translate(12px, 7px) scale(0.75)",maxWidth:"calc(133% - 24px)"},e.size==="small"&&{transform:"translate(12px, 4px) scale(0.75)"})),e.variant==="outlined"&&j({zIndex:1,pointerEvents:"none",transform:"translate(14px, 16px) scale(1)",maxWidth:"calc(100% - 24px)"},e.size==="small"&&{transform:"translate(14px, 9px) scale(1)"},e.shrink&&{userSelect:"none",pointerEvents:"auto",maxWidth:"calc(133% - 32px)",transform:"translate(14px, -9px) scale(0.75)"}))),ny=M.forwardRef(function(e,n){const r=qe({name:"MuiInputLabel",props:e}),{disableAnimation:i=!1,shrink:o,className:a}=r,s=Ae(r,Hke),l=oc();let c=o;typeof c>"u"&&l&&(c=l.filled||l.focused||l.adornedStart);const u=gd({props:r,muiFormControl:l,states:["size","variant","required","focused"]}),f=j({},r,{disableAnimation:i,formControl:l,shrink:c,size:u.size,variant:u.variant,required:u.required,focused:u.focused}),d=qke(f);return w.jsx(Xke,j({"data-shrink":c,ownerState:f,ref:n,className:ke(d.root,a)},s,{classes:d}))});function Qke(t){return We("MuiLink",t)}const Yke=Ve("MuiLink",["root","underlineNone","underlineHover","underlineAlways","button","focusVisible"]),Qre={primary:"primary.main",textPrimary:"text.primary",secondary:"secondary.main",textSecondary:"text.secondary",error:"error.main"},Kke=t=>Qre[t]||t,Zke=({theme:t,ownerState:e})=>{const n=Kke(e.color),r=Xg(t,`palette.${n}`,!1)||e.color,i=Xg(t,`palette.${n}Channel`);return"vars"in t&&i?`rgba(${i} / 0.4)`:kt(r,.4)},Jke=["className","color","component","onBlur","onFocus","TypographyClasses","underline","variant","sx"],eAe=t=>{const{classes:e,component:n,focusVisible:r,underline:i}=t,o={root:["root",`underline${De(i)}`,n==="button"&&"button",r&&"focusVisible"]};return Ue(o,Qke,e)},tAe=we(At,{name:"MuiLink",slot:"Root",overridesResolver:(t,e)=>{const{ownerState:n}=t;return[e.root,e[`underline${De(n.underline)}`],n.component==="button"&&e.button]}})(({theme:t,ownerState:e})=>j({},e.underline==="none"&&{textDecoration:"none"},e.underline==="hover"&&{textDecoration:"none","&:hover":{textDecoration:"underline"}},e.underline==="always"&&j({textDecoration:"underline"},e.color!=="inherit"&&{textDecorationColor:Zke({theme:t,ownerState:e})},{"&:hover":{textDecorationColor:"inherit"}}),e.component==="button"&&{position:"relative",WebkitTapHighlightColor:"transparent",backgroundColor:"transparent",outline:0,border:0,margin:0,borderRadius:0,padding:0,cursor:"pointer",userSelect:"none",verticalAlign:"middle",MozAppearance:"none",WebkitAppearance:"none","&::-moz-focus-inner":{borderStyle:"none"},[`&.${Yke.focusVisible}`]:{outline:"auto"}})),nAe=M.forwardRef(function(e,n){const r=qe({props:e,name:"MuiLink"}),{className:i,color:o="primary",component:a="a",onBlur:s,onFocus:l,TypographyClasses:c,underline:u="always",variant:f="inherit",sx:d}=r,h=Ae(r,Jke),{isFocusVisibleRef:p,onBlur:m,onFocus:g,ref:v}=A1(),[y,x]=M.useState(!1),b=Zt(n,v),_=E=>{m(E),p.current===!1&&x(!1),s&&s(E)},S=E=>{g(E),p.current===!0&&x(!0),l&&l(E)},O=j({},r,{color:o,component:a,focusVisible:y,underline:u,variant:f}),C=eAe(O);return w.jsx(tAe,j({color:o,className:ke(C.root,i),classes:c,component:a,onBlur:_,onFocus:S,ref:b,ownerState:O,variant:f,sx:[...Object.keys(Qre).includes(o)?[]:[{color:o}],...Array.isArray(d)?d:[d]]},h))}),Xs=M.createContext({});function rAe(t){return We("MuiList",t)}Ve("MuiList",["root","padding","dense","subheader"]);const iAe=["children","className","component","dense","disablePadding","subheader"],oAe=t=>{const{classes:e,disablePadding:n,dense:r,subheader:i}=t;return Ue({root:["root",!n&&"padding",r&&"dense",i&&"subheader"]},rAe,e)},aAe=we("ul",{name:"MuiList",slot:"Root",overridesResolver:(t,e)=>{const{ownerState:n}=t;return[e.root,!n.disablePadding&&e.padding,n.dense&&e.dense,n.subheader&&e.subheader]}})(({ownerState:t})=>j({listStyle:"none",margin:0,padding:0,position:"relative"},!t.disablePadding&&{paddingTop:8,paddingBottom:8},t.subheader&&{paddingTop:0})),e2=M.forwardRef(function(e,n){const r=qe({props:e,name:"MuiList"}),{children:i,className:o,component:a="ul",dense:s=!1,disablePadding:l=!1,subheader:c}=r,u=Ae(r,iAe),f=M.useMemo(()=>({dense:s}),[s]),d=j({},r,{component:a,dense:s,disablePadding:l}),h=oAe(d);return w.jsx(Xs.Provider,{value:f,children:w.jsxs(aAe,j({as:a,className:ke(h.root,o),ref:n,ownerState:d},u,{children:[c,i]}))})});function sAe(t){return We("MuiListItem",t)}const Nm=Ve("MuiListItem",["root","container","focusVisible","dense","alignItemsFlexStart","disabled","divider","gutters","padding","button","secondaryAction","selected"]);function lAe(t){return We("MuiListItemButton",t)}const $m=Ve("MuiListItemButton",["root","focusVisible","dense","alignItemsFlexStart","disabled","divider","gutters","selected"]),cAe=["alignItems","autoFocus","component","children","dense","disableGutters","divider","focusVisibleClassName","selected","className"],uAe=(t,e)=>{const{ownerState:n}=t;return[e.root,n.dense&&e.dense,n.alignItems==="flex-start"&&e.alignItemsFlexStart,n.divider&&e.divider,!n.disableGutters&&e.gutters]},fAe=t=>{const{alignItems:e,classes:n,dense:r,disabled:i,disableGutters:o,divider:a,selected:s}=t,c=Ue({root:["root",r&&"dense",!o&&"gutters",a&&"divider",i&&"disabled",e==="flex-start"&&"alignItemsFlexStart",s&&"selected"]},lAe,n);return j({},n,c)},dAe=we(fs,{shouldForwardProp:t=>hi(t)||t==="classes",name:"MuiListItemButton",slot:"Root",overridesResolver:uAe})(({theme:t,ownerState:e})=>j({display:"flex",flexGrow:1,justifyContent:"flex-start",alignItems:"center",position:"relative",textDecoration:"none",minWidth:0,boxSizing:"border-box",textAlign:"left",paddingTop:8,paddingBottom:8,transition:t.transitions.create("background-color",{duration:t.transitions.duration.shortest}),"&:hover":{textDecoration:"none",backgroundColor:(t.vars||t).palette.action.hover,"@media (hover: none)":{backgroundColor:"transparent"}},[`&.${$m.selected}`]:{backgroundColor:t.vars?`rgba(${t.vars.palette.primary.mainChannel} / ${t.vars.palette.action.selectedOpacity})`:kt(t.palette.primary.main,t.palette.action.selectedOpacity),[`&.${$m.focusVisible}`]:{backgroundColor:t.vars?`rgba(${t.vars.palette.primary.mainChannel} / calc(${t.vars.palette.action.selectedOpacity} + ${t.vars.palette.action.focusOpacity}))`:kt(t.palette.primary.main,t.palette.action.selectedOpacity+t.palette.action.focusOpacity)}},[`&.${$m.selected}:hover`]:{backgroundColor:t.vars?`rgba(${t.vars.palette.primary.mainChannel} / calc(${t.vars.palette.action.selectedOpacity} + ${t.vars.palette.action.hoverOpacity}))`:kt(t.palette.primary.main,t.palette.action.selectedOpacity+t.palette.action.hoverOpacity),"@media (hover: none)":{backgroundColor:t.vars?`rgba(${t.vars.palette.primary.mainChannel} / ${t.vars.palette.action.selectedOpacity})`:kt(t.palette.primary.main,t.palette.action.selectedOpacity)}},[`&.${$m.focusVisible}`]:{backgroundColor:(t.vars||t).palette.action.focus},[`&.${$m.disabled}`]:{opacity:(t.vars||t).palette.action.disabledOpacity}},e.divider&&{borderBottom:`1px solid ${(t.vars||t).palette.divider}`,backgroundClip:"padding-box"},e.alignItems==="flex-start"&&{alignItems:"flex-start"},!e.disableGutters&&{paddingLeft:16,paddingRight:16},e.dense&&{paddingTop:4,paddingBottom:4})),Yre=M.forwardRef(function(e,n){const r=qe({props:e,name:"MuiListItemButton"}),{alignItems:i="center",autoFocus:o=!1,component:a="div",children:s,dense:l=!1,disableGutters:c=!1,divider:u=!1,focusVisibleClassName:f,selected:d=!1,className:h}=r,p=Ae(r,cAe),m=M.useContext(Xs),g=M.useMemo(()=>({dense:l||m.dense||!1,alignItems:i,disableGutters:c}),[i,m.dense,l,c]),v=M.useRef(null);Hr(()=>{o&&v.current&&v.current.focus()},[o]);const y=j({},r,{alignItems:i,dense:g.dense,disableGutters:c,divider:u,selected:d}),x=fAe(y),b=Zt(v,n);return w.jsx(Xs.Provider,{value:g,children:w.jsx(dAe,j({ref:b,href:p.href||p.to,component:(p.href||p.to)&&a==="div"?"button":a,focusVisibleClassName:ke(x.focusVisible,f),ownerState:y,className:ke(x.root,h)},p,{classes:x,children:s}))})});function hAe(t){return We("MuiListItemSecondaryAction",t)}Ve("MuiListItemSecondaryAction",["root","disableGutters"]);const pAe=["className"],mAe=t=>{const{disableGutters:e,classes:n}=t;return Ue({root:["root",e&&"disableGutters"]},hAe,n)},gAe=we("div",{name:"MuiListItemSecondaryAction",slot:"Root",overridesResolver:(t,e)=>{const{ownerState:n}=t;return[e.root,n.disableGutters&&e.disableGutters]}})(({ownerState:t})=>j({position:"absolute",right:16,top:"50%",transform:"translateY(-50%)"},t.disableGutters&&{right:0})),Nb=M.forwardRef(function(e,n){const r=qe({props:e,name:"MuiListItemSecondaryAction"}),{className:i}=r,o=Ae(r,pAe),a=M.useContext(Xs),s=j({},r,{disableGutters:a.disableGutters}),l=mAe(s);return w.jsx(gAe,j({className:ke(l.root,i),ownerState:s,ref:n},o))});Nb.muiName="ListItemSecondaryAction";const vAe=["className"],yAe=["alignItems","autoFocus","button","children","className","component","components","componentsProps","ContainerComponent","ContainerProps","dense","disabled","disableGutters","disablePadding","divider","focusVisibleClassName","secondaryAction","selected","slotProps","slots"],xAe=(t,e)=>{const{ownerState:n}=t;return[e.root,n.dense&&e.dense,n.alignItems==="flex-start"&&e.alignItemsFlexStart,n.divider&&e.divider,!n.disableGutters&&e.gutters,!n.disablePadding&&e.padding,n.button&&e.button,n.hasSecondaryAction&&e.secondaryAction]},bAe=t=>{const{alignItems:e,button:n,classes:r,dense:i,disabled:o,disableGutters:a,disablePadding:s,divider:l,hasSecondaryAction:c,selected:u}=t;return Ue({root:["root",i&&"dense",!a&&"gutters",!s&&"padding",l&&"divider",o&&"disabled",n&&"button",e==="flex-start"&&"alignItemsFlexStart",c&&"secondaryAction",u&&"selected"],container:["container"]},sAe,r)},_Ae=we("div",{name:"MuiListItem",slot:"Root",overridesResolver:xAe})(({theme:t,ownerState:e})=>j({display:"flex",justifyContent:"flex-start",alignItems:"center",position:"relative",textDecoration:"none",width:"100%",boxSizing:"border-box",textAlign:"left"},!e.disablePadding&&j({paddingTop:8,paddingBottom:8},e.dense&&{paddingTop:4,paddingBottom:4},!e.disableGutters&&{paddingLeft:16,paddingRight:16},!!e.secondaryAction&&{paddingRight:48}),!!e.secondaryAction&&{[`& > .${$m.root}`]:{paddingRight:48}},{[`&.${Nm.focusVisible}`]:{backgroundColor:(t.vars||t).palette.action.focus},[`&.${Nm.selected}`]:{backgroundColor:t.vars?`rgba(${t.vars.palette.primary.mainChannel} / ${t.vars.palette.action.selectedOpacity})`:kt(t.palette.primary.main,t.palette.action.selectedOpacity),[`&.${Nm.focusVisible}`]:{backgroundColor:t.vars?`rgba(${t.vars.palette.primary.mainChannel} / calc(${t.vars.palette.action.selectedOpacity} + ${t.vars.palette.action.focusOpacity}))`:kt(t.palette.primary.main,t.palette.action.selectedOpacity+t.palette.action.focusOpacity)}},[`&.${Nm.disabled}`]:{opacity:(t.vars||t).palette.action.disabledOpacity}},e.alignItems==="flex-start"&&{alignItems:"flex-start"},e.divider&&{borderBottom:`1px solid ${(t.vars||t).palette.divider}`,backgroundClip:"padding-box"},e.button&&{transition:t.transitions.create("background-color",{duration:t.transitions.duration.shortest}),"&:hover":{textDecoration:"none",backgroundColor:(t.vars||t).palette.action.hover,"@media (hover: none)":{backgroundColor:"transparent"}},[`&.${Nm.selected}:hover`]:{backgroundColor:t.vars?`rgba(${t.vars.palette.primary.mainChannel} / calc(${t.vars.palette.action.selectedOpacity} + ${t.vars.palette.action.hoverOpacity}))`:kt(t.palette.primary.main,t.palette.action.selectedOpacity+t.palette.action.hoverOpacity),"@media (hover: none)":{backgroundColor:t.vars?`rgba(${t.vars.palette.primary.mainChannel} / ${t.vars.palette.action.selectedOpacity})`:kt(t.palette.primary.main,t.palette.action.selectedOpacity)}}},e.hasSecondaryAction&&{paddingRight:48})),wAe=we("li",{name:"MuiListItem",slot:"Container",overridesResolver:(t,e)=>e.container})({position:"relative"}),Wx=M.forwardRef(function(e,n){const r=qe({props:e,name:"MuiListItem"}),{alignItems:i="center",autoFocus:o=!1,button:a=!1,children:s,className:l,component:c,components:u={},componentsProps:f={},ContainerComponent:d="li",ContainerProps:{className:h}={},dense:p=!1,disabled:m=!1,disableGutters:g=!1,disablePadding:v=!1,divider:y=!1,focusVisibleClassName:x,secondaryAction:b,selected:_=!1,slotProps:S={},slots:O={}}=r,C=Ae(r.ContainerProps,vAe),E=Ae(r,yAe),k=M.useContext(Xs),I=M.useMemo(()=>({dense:p||k.dense||!1,alignItems:i,disableGutters:g}),[i,k.dense,p,g]),P=M.useRef(null);Hr(()=>{o&&P.current&&P.current.focus()},[o]);const R=M.Children.toArray(s),T=R.length&&$x(R[R.length-1],["ListItemSecondaryAction"]),L=j({},r,{alignItems:i,autoFocus:o,button:a,dense:I.dense,disabled:m,disableGutters:g,disablePadding:v,divider:y,hasSecondaryAction:T,selected:_}),z=bAe(L),B=Zt(P,n),U=O.root||u.Root||_Ae,W=S.root||f.root||{},$=j({className:ke(z.root,W.className,l),disabled:m},E);let N=c||"li";return a&&($.component=c||"div",$.focusVisibleClassName=ke(Nm.focusVisible,x),N=fs),T?(N=!$.component&&!c?"div":N,d==="li"&&(N==="li"?N="div":$.component==="li"&&($.component="div")),w.jsx(Xs.Provider,{value:I,children:w.jsxs(wAe,j({as:d,className:ke(z.container,h),ref:B,ownerState:L},C,{children:[w.jsx(U,j({},W,!Vl(U)&&{as:N,ownerState:j({},L,W.ownerState)},$,{children:R})),R.pop()]}))})):w.jsx(Xs.Provider,{value:I,children:w.jsxs(U,j({},W,{as:N,ref:B},!Vl(U)&&{ownerState:j({},L,W.ownerState)},$,{children:[R,b&&w.jsx(Nb,{children:b})]}))})});function SAe(t){return We("MuiListItemIcon",t)}const I8=Ve("MuiListItemIcon",["root","alignItemsFlexStart"]),OAe=["className"],CAe=t=>{const{alignItems:e,classes:n}=t;return Ue({root:["root",e==="flex-start"&&"alignItemsFlexStart"]},SAe,n)},TAe=we("div",{name:"MuiListItemIcon",slot:"Root",overridesResolver:(t,e)=>{const{ownerState:n}=t;return[e.root,n.alignItems==="flex-start"&&e.alignItemsFlexStart]}})(({theme:t,ownerState:e})=>j({minWidth:56,color:(t.vars||t).palette.action.active,flexShrink:0,display:"inline-flex"},e.alignItems==="flex-start"&&{marginTop:8})),Kre=M.forwardRef(function(e,n){const r=qe({props:e,name:"MuiListItemIcon"}),{className:i}=r,o=Ae(r,OAe),a=M.useContext(Xs),s=j({},r,{alignItems:a.alignItems}),l=CAe(s);return w.jsx(TAe,j({className:ke(l.root,i),ownerState:s,ref:n},o))});function EAe(t){return We("MuiListItemText",t)}const RT=Ve("MuiListItemText",["root","multiline","dense","inset","primary","secondary"]),PAe=["children","className","disableTypography","inset","primary","primaryTypographyProps","secondary","secondaryTypographyProps"],MAe=t=>{const{classes:e,inset:n,primary:r,secondary:i,dense:o}=t;return Ue({root:["root",n&&"inset",o&&"dense",r&&i&&"multiline"],primary:["primary"],secondary:["secondary"]},EAe,e)},kAe=we("div",{name:"MuiListItemText",slot:"Root",overridesResolver:(t,e)=>{const{ownerState:n}=t;return[{[`& .${RT.primary}`]:e.primary},{[`& .${RT.secondary}`]:e.secondary},e.root,n.inset&&e.inset,n.primary&&n.secondary&&e.multiline,n.dense&&e.dense]}})(({ownerState:t})=>j({flex:"1 1 auto",minWidth:0,marginTop:4,marginBottom:4},t.primary&&t.secondary&&{marginTop:6,marginBottom:6},t.inset&&{paddingLeft:56})),ts=M.forwardRef(function(e,n){const r=qe({props:e,name:"MuiListItemText"}),{children:i,className:o,disableTypography:a=!1,inset:s=!1,primary:l,primaryTypographyProps:c,secondary:u,secondaryTypographyProps:f}=r,d=Ae(r,PAe),{dense:h}=M.useContext(Xs);let p=l??i,m=u;const g=j({},r,{disableTypography:a,inset:s,primary:!!p,secondary:!!m,dense:h}),v=MAe(g);return p!=null&&p.type!==At&&!a&&(p=w.jsx(At,j({variant:h?"body2":"body1",className:v.primary,component:c!=null&&c.variant?void 0:"span",display:"block"},c,{children:p}))),m!=null&&m.type!==At&&!a&&(m=w.jsx(At,j({variant:"body2",className:v.secondary,color:"text.secondary",display:"block"},f,{children:m}))),w.jsxs(kAe,j({className:ke(v.root,o),ownerState:g,ref:n},d,{children:[p,m]}))}),AAe=["actions","autoFocus","autoFocusItem","children","className","disabledItemsFocusable","disableListWrap","onKeyDown","variant"];function kA(t,e,n){return t===e?t.firstChild:e&&e.nextElementSibling?e.nextElementSibling:n?null:t.firstChild}function D8(t,e,n){return t===e?n?t.firstChild:t.lastChild:e&&e.previousElementSibling?e.previousElementSibling:n?null:t.lastChild}function Zre(t,e){if(e===void 0)return!0;let n=t.innerText;return n===void 0&&(n=t.textContent),n=n.trim().toLowerCase(),n.length===0?!1:e.repeating?n[0]===e.keys[0]:n.indexOf(e.keys.join(""))===0}function m0(t,e,n,r,i,o){let a=!1,s=i(t,e,e?n:!1);for(;s;){if(s===t.firstChild){if(a)return!1;a=!0}const l=r?!1:s.disabled||s.getAttribute("aria-disabled")==="true";if(!s.hasAttribute("tabindex")||!Zre(s,o)||l)s=i(t,s,n);else return s.focus(),!0}return!1}const Jre=M.forwardRef(function(e,n){const{actions:r,autoFocus:i=!1,autoFocusItem:o=!1,children:a,className:s,disabledItemsFocusable:l=!1,disableListWrap:c=!1,onKeyDown:u,variant:f="selectedMenu"}=e,d=Ae(e,AAe),h=M.useRef(null),p=M.useRef({keys:[],repeating:!0,previousKeyMatched:!0,lastTime:null});Hr(()=>{i&&h.current.focus()},[i]),M.useImperativeHandle(r,()=>({adjustStyleForScrollbar:(x,{direction:b})=>{const _=!h.current.style.width;if(x.clientHeight<h.current.clientHeight&&_){const S=`${nre($n(x))}px`;h.current.style[b==="rtl"?"paddingLeft":"paddingRight"]=S,h.current.style.width=`calc(100% + ${S})`}return h.current}}),[]);const m=x=>{const b=h.current,_=x.key,S=$n(b).activeElement;if(_==="ArrowDown")x.preventDefault(),m0(b,S,c,l,kA);else if(_==="ArrowUp")x.preventDefault(),m0(b,S,c,l,D8);else if(_==="Home")x.preventDefault(),m0(b,null,c,l,kA);else if(_==="End")x.preventDefault(),m0(b,null,c,l,D8);else if(_.length===1){const O=p.current,C=_.toLowerCase(),E=performance.now();O.keys.length>0&&(E-O.lastTime>500?(O.keys=[],O.repeating=!0,O.previousKeyMatched=!0):O.repeating&&C!==O.keys[0]&&(O.repeating=!1)),O.lastTime=E,O.keys.push(C);const k=S&&!O.repeating&&Zre(S,O);O.previousKeyMatched&&(k||m0(b,S,!1,l,kA,O))?x.preventDefault():O.previousKeyMatched=!1}u&&u(x)},g=Zt(h,n);let v=-1;M.Children.forEach(a,(x,b)=>{if(!M.isValidElement(x)){v===b&&(v+=1,v>=a.length&&(v=-1));return}x.props.disabled||(f==="selectedMenu"&&x.props.selected||v===-1)&&(v=b),v===b&&(x.props.disabled||x.props.muiSkipListHighlight||x.type.muiSkipListHighlight)&&(v+=1,v>=a.length&&(v=-1))});const y=M.Children.map(a,(x,b)=>{if(b===v){const _={};return o&&(_.autoFocus=!0),x.props.tabIndex===void 0&&f==="selectedMenu"&&(_.tabIndex=0),M.cloneElement(x,_)}return x});return w.jsx(e2,j({role:"menu",ref:g,className:s,onKeyDown:m,tabIndex:i?0:-1},d,{children:y}))});function RAe(t){return We("MuiPopover",t)}Ve("MuiPopover",["root","paper"]);const IAe=["onEntering"],DAe=["action","anchorEl","anchorOrigin","anchorPosition","anchorReference","children","className","container","elevation","marginThreshold","open","PaperProps","slots","slotProps","transformOrigin","TransitionComponent","transitionDuration","TransitionProps","disableScrollLock"],LAe=["slotProps"];function L8(t,e){let n=0;return typeof e=="number"?n=e:e==="center"?n=t.height/2:e==="bottom"&&(n=t.height),n}function N8(t,e){let n=0;return typeof e=="number"?n=e:e==="center"?n=t.width/2:e==="right"&&(n=t.width),n}function $8(t){return[t.horizontal,t.vertical].map(e=>typeof e=="number"?`${e}px`:e).join(" ")}function AA(t){return typeof t=="function"?t():t}const NAe=t=>{const{classes:e}=t;return Ue({root:["root"],paper:["paper"]},RAe,e)},$Ae=we(Gre,{name:"MuiPopover",slot:"Root",overridesResolver:(t,e)=>e.root})({}),eie=we(Ho,{name:"MuiPopover",slot:"Paper",overridesResolver:(t,e)=>e.paper})({position:"absolute",overflowY:"auto",overflowX:"hidden",minWidth:16,minHeight:16,maxWidth:"calc(100% - 32px)",maxHeight:"calc(100% - 32px)",outline:0}),Ep=M.forwardRef(function(e,n){var r,i,o;const a=qe({props:e,name:"MuiPopover"}),{action:s,anchorEl:l,anchorOrigin:c={vertical:"top",horizontal:"left"},anchorPosition:u,anchorReference:f="anchorEl",children:d,className:h,container:p,elevation:m=8,marginThreshold:g=16,open:v,PaperProps:y={},slots:x,slotProps:b,transformOrigin:_={vertical:"top",horizontal:"left"},TransitionComponent:S=ev,transitionDuration:O="auto",TransitionProps:{onEntering:C}={},disableScrollLock:E=!1}=a,k=Ae(a.TransitionProps,IAe),I=Ae(a,DAe),P=(r=b==null?void 0:b.paper)!=null?r:y,R=M.useRef(),T=Zt(R,P.ref),L=j({},a,{anchorOrigin:c,anchorReference:f,elevation:m,marginThreshold:g,externalPaperSlotProps:P,transformOrigin:_,TransitionComponent:S,transitionDuration:O,TransitionProps:k}),z=NAe(L),B=M.useCallback(()=>{if(f==="anchorPosition")return u;const ve=AA(l),ce=(ve&&ve.nodeType===1?ve:$n(R.current).body).getBoundingClientRect();return{top:ce.top+L8(ce,c.vertical),left:ce.left+N8(ce,c.horizontal)}},[l,c.horizontal,c.vertical,u,f]),U=M.useCallback(ve=>({vertical:L8(ve,_.vertical),horizontal:N8(ve,_.horizontal)}),[_.horizontal,_.vertical]),W=M.useCallback(ve=>{const F={width:ve.offsetWidth,height:ve.offsetHeight},ce=U(F);if(f==="none")return{top:null,left:null,transformOrigin:$8(ce)};const le=B();let Q=le.top-ce.vertical,X=le.left-ce.horizontal;const ee=Q+F.height,ge=X+F.width,ye=cs(AA(l)),H=ye.innerHeight-g,G=ye.innerWidth-g;if(g!==null&&Q<g){const ie=Q-g;Q-=ie,ce.vertical+=ie}else if(g!==null&&ee>H){const ie=ee-H;Q-=ie,ce.vertical+=ie}if(g!==null&&X<g){const ie=X-g;X-=ie,ce.horizontal+=ie}else if(ge>G){const ie=ge-G;X-=ie,ce.horizontal+=ie}return{top:`${Math.round(Q)}px`,left:`${Math.round(X)}px`,transformOrigin:$8(ce)}},[l,f,B,U,g]),[$,N]=M.useState(v),D=M.useCallback(()=>{const ve=R.current;if(!ve)return;const F=W(ve);F.top!==null&&(ve.style.top=F.top),F.left!==null&&(ve.style.left=F.left),ve.style.transformOrigin=F.transformOrigin,N(!0)},[W]);M.useEffect(()=>(E&&window.addEventListener("scroll",D),()=>window.removeEventListener("scroll",D)),[l,E,D]);const A=(ve,F)=>{C&&C(ve,F),D()},q=()=>{N(!1)};M.useEffect(()=>{v&&D()}),M.useImperativeHandle(s,()=>v?{updatePosition:()=>{D()}}:null,[v,D]),M.useEffect(()=>{if(!v)return;const ve=Kv(()=>{D()}),F=cs(l);return F.addEventListener("resize",ve),()=>{ve.clear(),F.removeEventListener("resize",ve)}},[l,v,D]);let Y=O;O==="auto"&&!S.muiSupportAuto&&(Y=void 0);const K=p||(l?$n(AA(l)).body:void 0),se=(i=x==null?void 0:x.root)!=null?i:$Ae,te=(o=x==null?void 0:x.paper)!=null?o:eie,J=$r({elementType:te,externalSlotProps:j({},P,{style:$?P.style:j({},P.style,{opacity:0})}),additionalProps:{elevation:m,ref:T},ownerState:L,className:ke(z.paper,P==null?void 0:P.className)}),pe=$r({elementType:se,externalSlotProps:(b==null?void 0:b.root)||{},externalForwardedProps:I,additionalProps:{ref:n,slotProps:{backdrop:{invisible:!0}},container:K,open:v},ownerState:L,className:ke(z.root,h)}),{slotProps:be}=pe,re=Ae(pe,LAe);return w.jsx(se,j({},re,!Vl(se)&&{slotProps:be,disableScrollLock:E},{children:w.jsx(S,j({appear:!0,in:v,onEntering:A,onExited:q,timeout:Y},k,{children:w.jsx(te,j({},J,{children:d}))}))}))});function FAe(t){return We("MuiMenu",t)}Ve("MuiMenu",["root","paper","list"]);const jAe=["onEntering"],BAe=["autoFocus","children","className","disableAutoFocusItem","MenuListProps","onClose","open","PaperProps","PopoverClasses","transitionDuration","TransitionProps","variant","slots","slotProps"],zAe={vertical:"top",horizontal:"right"},UAe={vertical:"top",horizontal:"left"},WAe=t=>{const{classes:e}=t;return Ue({root:["root"],paper:["paper"],list:["list"]},FAe,e)},VAe=we(Ep,{shouldForwardProp:t=>hi(t)||t==="classes",name:"MuiMenu",slot:"Root",overridesResolver:(t,e)=>e.root})({}),GAe=we(eie,{name:"MuiMenu",slot:"Paper",overridesResolver:(t,e)=>e.paper})({maxHeight:"calc(100% - 96px)",WebkitOverflowScrolling:"touch"}),HAe=we(Jre,{name:"MuiMenu",slot:"List",overridesResolver:(t,e)=>e.list})({outline:0}),Pp=M.forwardRef(function(e,n){var r,i;const o=qe({props:e,name:"MuiMenu"}),{autoFocus:a=!0,children:s,className:l,disableAutoFocusItem:c=!1,MenuListProps:u={},onClose:f,open:d,PaperProps:h={},PopoverClasses:p,transitionDuration:m="auto",TransitionProps:{onEntering:g}={},variant:v="selectedMenu",slots:y={},slotProps:x={}}=o,b=Ae(o.TransitionProps,jAe),_=Ae(o,BAe),S=R1(),O=j({},o,{autoFocus:a,disableAutoFocusItem:c,MenuListProps:u,onEntering:g,PaperProps:h,transitionDuration:m,TransitionProps:b,variant:v}),C=WAe(O),E=a&&!c&&d,k=M.useRef(null),I=(U,W)=>{k.current&&k.current.adjustStyleForScrollbar(U,{direction:S?"rtl":"ltr"}),g&&g(U,W)},P=U=>{U.key==="Tab"&&(U.preventDefault(),f&&f(U,"tabKeyDown"))};let R=-1;M.Children.map(s,(U,W)=>{M.isValidElement(U)&&(U.props.disabled||(v==="selectedMenu"&&U.props.selected||R===-1)&&(R=W))});const T=(r=y.paper)!=null?r:GAe,L=(i=x.paper)!=null?i:h,z=$r({elementType:y.root,externalSlotProps:x.root,ownerState:O,className:[C.root,l]}),B=$r({elementType:T,externalSlotProps:L,ownerState:O,className:C.paper});return w.jsx(VAe,j({onClose:f,anchorOrigin:{vertical:"bottom",horizontal:S?"right":"left"},transformOrigin:S?zAe:UAe,slots:{paper:T,root:y.root},slotProps:{root:z,paper:B},open:d,ref:n,transitionDuration:m,TransitionProps:j({onEntering:I},b),ownerState:O},_,{classes:p,children:w.jsx(HAe,j({onKeyDown:P,actions:k,autoFocus:a&&(R===-1||c),autoFocusItem:E,variant:v},u,{className:ke(C.list,u.className),children:s}))}))});function qAe(t){return We("MuiMenuItem",t)}const g0=Ve("MuiMenuItem",["root","focusVisible","dense","disabled","divider","gutters","selected"]),XAe=["autoFocus","component","dense","divider","disableGutters","focusVisibleClassName","role","tabIndex","className"],QAe=(t,e)=>{const{ownerState:n}=t;return[e.root,n.dense&&e.dense,n.divider&&e.divider,!n.disableGutters&&e.gutters]},YAe=t=>{const{disabled:e,dense:n,divider:r,disableGutters:i,selected:o,classes:a}=t,l=Ue({root:["root",n&&"dense",e&&"disabled",!i&&"gutters",r&&"divider",o&&"selected"]},qAe,a);return j({},a,l)},KAe=we(fs,{shouldForwardProp:t=>hi(t)||t==="classes",name:"MuiMenuItem",slot:"Root",overridesResolver:QAe})(({theme:t,ownerState:e})=>j({},t.typography.body1,{display:"flex",justifyContent:"flex-start",alignItems:"center",position:"relative",textDecoration:"none",minHeight:48,paddingTop:6,paddingBottom:6,boxSizing:"border-box",whiteSpace:"nowrap"},!e.disableGutters&&{paddingLeft:16,paddingRight:16},e.divider&&{borderBottom:`1px solid ${(t.vars||t).palette.divider}`,backgroundClip:"padding-box"},{"&:hover":{textDecoration:"none",backgroundColor:(t.vars||t).palette.action.hover,"@media (hover: none)":{backgroundColor:"transparent"}},[`&.${g0.selected}`]:{backgroundColor:t.vars?`rgba(${t.vars.palette.primary.mainChannel} / ${t.vars.palette.action.selectedOpacity})`:kt(t.palette.primary.main,t.palette.action.selectedOpacity),[`&.${g0.focusVisible}`]:{backgroundColor:t.vars?`rgba(${t.vars.palette.primary.mainChannel} / calc(${t.vars.palette.action.selectedOpacity} + ${t.vars.palette.action.focusOpacity}))`:kt(t.palette.primary.main,t.palette.action.selectedOpacity+t.palette.action.focusOpacity)}},[`&.${g0.selected}:hover`]:{backgroundColor:t.vars?`rgba(${t.vars.palette.primary.mainChannel} / calc(${t.vars.palette.action.selectedOpacity} + ${t.vars.palette.action.hoverOpacity}))`:kt(t.palette.primary.main,t.palette.action.selectedOpacity+t.palette.action.hoverOpacity),"@media (hover: none)":{backgroundColor:t.vars?`rgba(${t.vars.palette.primary.mainChannel} / ${t.vars.palette.action.selectedOpacity})`:kt(t.palette.primary.main,t.palette.action.selectedOpacity)}},[`&.${g0.focusVisible}`]:{backgroundColor:(t.vars||t).palette.action.focus},[`&.${g0.disabled}`]:{opacity:(t.vars||t).palette.action.disabledOpacity},[`& + .${E8.root}`]:{marginTop:t.spacing(1),marginBottom:t.spacing(1)},[`& + .${E8.inset}`]:{marginLeft:52},[`& .${RT.root}`]:{marginTop:0,marginBottom:0},[`& .${RT.inset}`]:{paddingLeft:36},[`& .${I8.root}`]:{minWidth:36}},!e.dense&&{[t.breakpoints.up("sm")]:{minHeight:"auto"}},e.dense&&j({minHeight:32,paddingTop:4,paddingBottom:4},t.typography.body2,{[`& .${I8.root} svg`]:{fontSize:"1.25rem"}}))),jr=M.forwardRef(function(e,n){const r=qe({props:e,name:"MuiMenuItem"}),{autoFocus:i=!1,component:o="li",dense:a=!1,divider:s=!1,disableGutters:l=!1,focusVisibleClassName:c,role:u="menuitem",tabIndex:f,className:d}=r,h=Ae(r,XAe),p=M.useContext(Xs),m=M.useMemo(()=>({dense:a||p.dense||!1,disableGutters:l}),[p.dense,a,l]),g=M.useRef(null);Hr(()=>{i&&g.current&&g.current.focus()},[i]);const v=j({},r,{dense:m.dense,divider:s,disableGutters:l}),y=YAe(r),x=Zt(g,n);let b;return r.disabled||(b=f!==void 0?f:-1),w.jsx(Xs.Provider,{value:m,children:w.jsx(KAe,j({ref:x,role:u,tabIndex:b,component:o,focusVisibleClassName:ke(y.focusVisible,c),className:ke(y.root,d)},h,{ownerState:v,classes:y}))})});function ZAe(t){return We("MuiNativeSelect",t)}const C5=Ve("MuiNativeSelect",["root","select","multiple","filled","outlined","standard","disabled","icon","iconOpen","iconFilled","iconOutlined","iconStandard","nativeInput","error"]),JAe=["className","disabled","error","IconComponent","inputRef","variant"],eRe=t=>{const{classes:e,variant:n,disabled:r,multiple:i,open:o,error:a}=t,s={select:["select",n,r&&"disabled",i&&"multiple",a&&"error"],icon:["icon",`icon${De(n)}`,o&&"iconOpen",r&&"disabled"]};return Ue(s,ZAe,e)},tie=({ownerState:t,theme:e})=>j({MozAppearance:"none",WebkitAppearance:"none",userSelect:"none",borderRadius:0,cursor:"pointer","&:focus":j({},e.vars?{backgroundColor:`rgba(${e.vars.palette.common.onBackgroundChannel} / 0.05)`}:{backgroundColor:e.palette.mode==="light"?"rgba(0, 0, 0, 0.05)":"rgba(255, 255, 255, 0.05)"},{borderRadius:0}),"&::-ms-expand":{display:"none"},[`&.${C5.disabled}`]:{cursor:"default"},"&[multiple]":{height:"auto"},"&:not([multiple]) option, &:not([multiple]) optgroup":{backgroundColor:(e.vars||e).palette.background.paper},"&&&":{paddingRight:24,minWidth:16}},t.variant==="filled"&&{"&&&":{paddingRight:32}},t.variant==="outlined"&&{borderRadius:(e.vars||e).shape.borderRadius,"&:focus":{borderRadius:(e.vars||e).shape.borderRadius},"&&&":{paddingRight:32}}),tRe=we("select",{name:"MuiNativeSelect",slot:"Select",shouldForwardProp:hi,overridesResolver:(t,e)=>{const{ownerState:n}=t;return[e.select,e[n.variant],n.error&&e.error,{[`&.${C5.multiple}`]:e.multiple}]}})(tie),nie=({ownerState:t,theme:e})=>j({position:"absolute",right:0,top:"calc(50% - .5em)",pointerEvents:"none",color:(e.vars||e).palette.action.active,[`&.${C5.disabled}`]:{color:(e.vars||e).palette.action.disabled}},t.open&&{transform:"rotate(180deg)"},t.variant==="filled"&&{right:7},t.variant==="outlined"&&{right:7}),nRe=we("svg",{name:"MuiNativeSelect",slot:"Icon",overridesResolver:(t,e)=>{const{ownerState:n}=t;return[e.icon,n.variant&&e[`icon${De(n.variant)}`],n.open&&e.iconOpen]}})(nie),rRe=M.forwardRef(function(e,n){const{className:r,disabled:i,error:o,IconComponent:a,inputRef:s,variant:l="standard"}=e,c=Ae(e,JAe),u=j({},e,{disabled:i,variant:l,error:o}),f=eRe(u);return w.jsxs(M.Fragment,{children:[w.jsx(tRe,j({ownerState:u,className:ke(f.select,r),disabled:i,ref:s||n},c)),e.multiple?null:w.jsx(nRe,{as:a,ownerState:u,className:f.icon})]})});var F8;const iRe=["children","classes","className","label","notched"],oRe=we("fieldset",{shouldForwardProp:hi})({textAlign:"left",position:"absolute",bottom:0,right:0,top:-5,left:0,margin:0,padding:"0 8px",pointerEvents:"none",borderRadius:"inherit",borderStyle:"solid",borderWidth:1,overflow:"hidden",minWidth:"0%"}),aRe=we("legend",{shouldForwardProp:hi})(({ownerState:t,theme:e})=>j({float:"unset",width:"auto",overflow:"hidden"},!t.withLabel&&{padding:0,lineHeight:"11px",transition:e.transitions.create("width",{duration:150,easing:e.transitions.easing.easeOut})},t.withLabel&&j({display:"block",padding:0,height:11,fontSize:"0.75em",visibility:"hidden",maxWidth:.01,transition:e.transitions.create("max-width",{duration:50,easing:e.transitions.easing.easeOut}),whiteSpace:"nowrap","& > span":{paddingLeft:5,paddingRight:5,display:"inline-block",opacity:0,visibility:"visible"}},t.notched&&{maxWidth:"100%",transition:e.transitions.create("max-width",{duration:100,easing:e.transitions.easing.easeOut,delay:50})})));function sRe(t){const{className:e,label:n,notched:r}=t,i=Ae(t,iRe),o=n!=null&&n!=="",a=j({},t,{notched:r,withLabel:o});return w.jsx(oRe,j({"aria-hidden":!0,className:e,ownerState:a},i,{children:w.jsx(aRe,{ownerState:a,children:o?w.jsx("span",{children:n}):F8||(F8=w.jsx("span",{className:"notranslate",children:"​"}))})}))}const lRe=["components","fullWidth","inputComponent","label","multiline","notched","slots","type"],cRe=t=>{const{classes:e}=t,r=Ue({root:["root"],notchedOutline:["notchedOutline"],input:["input"]},RPe,e);return j({},e,r)},uRe=we(YM,{shouldForwardProp:t=>hi(t)||t==="classes",name:"MuiOutlinedInput",slot:"Root",overridesResolver:XM})(({theme:t,ownerState:e})=>{const n=t.palette.mode==="light"?"rgba(0, 0, 0, 0.23)":"rgba(255, 255, 255, 0.23)";return j({position:"relative",borderRadius:(t.vars||t).shape.borderRadius,[`&:hover .${Mu.notchedOutline}`]:{borderColor:(t.vars||t).palette.text.primary},"@media (hover: none)":{[`&:hover .${Mu.notchedOutline}`]:{borderColor:t.vars?`rgba(${t.vars.palette.common.onBackgroundChannel} / 0.23)`:n}},[`&.${Mu.focused} .${Mu.notchedOutline}`]:{borderColor:(t.vars||t).palette[e.color].main,borderWidth:2},[`&.${Mu.error} .${Mu.notchedOutline}`]:{borderColor:(t.vars||t).palette.error.main},[`&.${Mu.disabled} .${Mu.notchedOutline}`]:{borderColor:(t.vars||t).palette.action.disabled}},e.startAdornment&&{paddingLeft:14},e.endAdornment&&{paddingRight:14},e.multiline&&j({padding:"16.5px 14px"},e.size==="small"&&{padding:"8.5px 14px"}))}),fRe=we(sRe,{name:"MuiOutlinedInput",slot:"NotchedOutline",overridesResolver:(t,e)=>e.notchedOutline})(({theme:t})=>{const e=t.palette.mode==="light"?"rgba(0, 0, 0, 0.23)":"rgba(255, 255, 255, 0.23)";return{borderColor:t.vars?`rgba(${t.vars.palette.common.onBackgroundChannel} / 0.23)`:e}}),dRe=we(KM,{name:"MuiOutlinedInput",slot:"Input",overridesResolver:QM})(({theme:t,ownerState:e})=>j({padding:"16.5px 14px"},!t.vars&&{"&:-webkit-autofill":{WebkitBoxShadow:t.palette.mode==="light"?null:"0 0 0 100px #266798 inset",WebkitTextFillColor:t.palette.mode==="light"?null:"#fff",caretColor:t.palette.mode==="light"?null:"#fff",borderRadius:"inherit"}},t.vars&&{"&:-webkit-autofill":{borderRadius:"inherit"},[t.getColorSchemeSelector("dark")]:{"&:-webkit-autofill":{WebkitBoxShadow:"0 0 0 100px #266798 inset",WebkitTextFillColor:"#fff",caretColor:"#fff"}}},e.size==="small"&&{padding:"8.5px 14px"},e.multiline&&{padding:0},e.startAdornment&&{paddingLeft:0},e.endAdornment&&{paddingRight:0})),T5=M.forwardRef(function(e,n){var r,i,o,a,s;const l=qe({props:e,name:"MuiOutlinedInput"}),{components:c={},fullWidth:u=!1,inputComponent:f="input",label:d,multiline:h=!1,notched:p,slots:m={},type:g="text"}=l,v=Ae(l,lRe),y=cRe(l),x=oc(),b=gd({props:l,muiFormControl:x,states:["color","disabled","error","focused","hiddenLabel","size","required"]}),_=j({},l,{color:b.color||"primary",disabled:b.disabled,error:b.error,focused:b.focused,formControl:x,fullWidth:u,hiddenLabel:b.hiddenLabel,multiline:h,size:b.size,type:g}),S=(r=(i=m.root)!=null?i:c.Root)!=null?r:uRe,O=(o=(a=m.input)!=null?a:c.Input)!=null?o:dRe;return w.jsx(w5,j({slots:{root:S,input:O},renderSuffix:C=>w.jsx(fRe,{ownerState:_,className:y.notchedOutline,label:d!=null&&d!==""&&b.required?s||(s=w.jsxs(M.Fragment,{children:[d," ","*"]})):d,notched:typeof p<"u"?p:!!(C.startAdornment||C.filled||C.focused)}),fullWidth:u,inputComponent:f,multiline:h,ref:n,type:g},v,{classes:j({},y,{notchedOutline:null})}))});T5.muiName="Input";const hRe=ni(w.jsx("path",{d:"M12 2C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2zm0 18c-4.42 0-8-3.58-8-8s3.58-8 8-8 8 3.58 8 8-3.58 8-8 8z"}),"RadioButtonUnchecked"),pRe=ni(w.jsx("path",{d:"M8.465 8.465C9.37 7.56 10.62 7 12 7C14.76 7 17 9.24 17 12C17 13.38 16.44 14.63 15.535 15.535C14.63 16.44 13.38 17 12 17C9.24 17 7 14.76 7 12C7 10.62 7.56 9.37 8.465 8.465Z"}),"RadioButtonChecked"),mRe=we("span",{shouldForwardProp:hi})({position:"relative",display:"flex"}),gRe=we(hRe)({transform:"scale(1)"}),vRe=we(pRe)(({theme:t,ownerState:e})=>j({left:0,position:"absolute",transform:"scale(0)",transition:t.transitions.create("transform",{easing:t.transitions.easing.easeIn,duration:t.transitions.duration.shortest})},e.checked&&{transform:"scale(1)",transition:t.transitions.create("transform",{easing:t.transitions.easing.easeOut,duration:t.transitions.duration.shortest})}));function rie(t){const{checked:e=!1,classes:n={},fontSize:r}=t,i=j({},t,{checked:e});return w.jsxs(mRe,{className:n.root,ownerState:i,children:[w.jsx(gRe,{fontSize:r,className:n.background,ownerState:i}),w.jsx(vRe,{fontSize:r,className:n.dot,ownerState:i})]})}const iie=M.createContext(void 0);function yRe(){return M.useContext(iie)}function xRe(t){return We("MuiRadio",t)}const j8=Ve("MuiRadio",["root","checked","disabled","colorPrimary","colorSecondary","sizeSmall"]),bRe=["checked","checkedIcon","color","icon","name","onChange","size","className"],_Re=t=>{const{classes:e,color:n,size:r}=t,i={root:["root",`color${De(n)}`,r!=="medium"&&`size${De(r)}`]};return j({},e,Ue(i,xRe,e))},wRe=we(S5,{shouldForwardProp:t=>hi(t)||t==="classes",name:"MuiRadio",slot:"Root",overridesResolver:(t,e)=>{const{ownerState:n}=t;return[e.root,n.size!=="medium"&&e[`size${De(n.size)}`],e[`color${De(n.color)}`]]}})(({theme:t,ownerState:e})=>j({color:(t.vars||t).palette.text.secondary},!e.disableRipple&&{"&:hover":{backgroundColor:t.vars?`rgba(${e.color==="default"?t.vars.palette.action.activeChannel:t.vars.palette[e.color].mainChannel} / ${t.vars.palette.action.hoverOpacity})`:kt(e.color==="default"?t.palette.action.active:t.palette[e.color].main,t.palette.action.hoverOpacity),"@media (hover: none)":{backgroundColor:"transparent"}}},e.color!=="default"&&{[`&.${j8.checked}`]:{color:(t.vars||t).palette[e.color].main}},{[`&.${j8.disabled}`]:{color:(t.vars||t).palette.action.disabled}}));function SRe(t,e){return typeof e=="object"&&e!==null?t===e:String(t)===String(e)}const B8=w.jsx(rie,{checked:!0}),z8=w.jsx(rie,{}),Vx=M.forwardRef(function(e,n){var r,i;const o=qe({props:e,name:"MuiRadio"}),{checked:a,checkedIcon:s=B8,color:l="primary",icon:c=z8,name:u,onChange:f,size:d="medium",className:h}=o,p=Ae(o,bRe),m=j({},o,{color:l,size:d}),g=_Re(m),v=yRe();let y=a;const x=OT(f,v&&v.onChange);let b=u;return v&&(typeof y>"u"&&(y=SRe(v.value,o.value)),typeof b>"u"&&(b=v.name)),w.jsx(wRe,j({type:"radio",icon:M.cloneElement(c,{fontSize:(r=z8.props.fontSize)!=null?r:d}),checkedIcon:M.cloneElement(s,{fontSize:(i=B8.props.fontSize)!=null?i:d}),ownerState:m,classes:g,name:b,checked:y,onChange:x,ref:n,className:ke(g.root,h)},p))});function ORe(t){return We("MuiRadioGroup",t)}Ve("MuiRadioGroup",["root","row","error"]);const CRe=["actions","children","className","defaultValue","name","onChange","value"],TRe=t=>{const{classes:e,row:n,error:r}=t;return Ue({root:["root",n&&"row",r&&"error"]},ORe,e)},E5=M.forwardRef(function(e,n){const{actions:r,children:i,className:o,defaultValue:a,name:s,onChange:l,value:c}=e,u=Ae(e,CRe),f=M.useRef(null),d=TRe(e),[h,p]=Qs({controlled:c,default:a,name:"RadioGroup"});M.useImperativeHandle(r,()=>({focus:()=>{let y=f.current.querySelector("input:not(:disabled):checked");y||(y=f.current.querySelector("input:not(:disabled)")),y&&y.focus()}}),[]);const m=Zt(n,f),g=pd(s),v=M.useMemo(()=>({name:g,onChange(y){p(y.target.value),l&&l(y,y.target.value)},value:h}),[g,l,p,h]);return w.jsx(iie.Provider,{value:v,children:w.jsx(cke,j({role:"radiogroup",ref:m,className:ke(d.root,o)},u,{children:i}))})});function ERe(t){return We("MuiSelect",t)}const v0=Ve("MuiSelect",["root","select","multiple","filled","outlined","standard","disabled","focused","icon","iconOpen","iconFilled","iconOutlined","iconStandard","nativeInput","error"]);var U8;const PRe=["aria-describedby","aria-label","autoFocus","autoWidth","children","className","defaultOpen","defaultValue","disabled","displayEmpty","error","IconComponent","inputRef","labelId","MenuProps","multiple","name","onBlur","onChange","onClose","onFocus","onOpen","open","readOnly","renderValue","SelectDisplayProps","tabIndex","type","value","variant"],MRe=we("div",{name:"MuiSelect",slot:"Select",overridesResolver:(t,e)=>{const{ownerState:n}=t;return[{[`&.${v0.select}`]:e.select},{[`&.${v0.select}`]:e[n.variant]},{[`&.${v0.error}`]:e.error},{[`&.${v0.multiple}`]:e.multiple}]}})(tie,{[`&.${v0.select}`]:{height:"auto",minHeight:"1.4375em",textOverflow:"ellipsis",whiteSpace:"nowrap",overflow:"hidden"}}),kRe=we("svg",{name:"MuiSelect",slot:"Icon",overridesResolver:(t,e)=>{const{ownerState:n}=t;return[e.icon,n.variant&&e[`icon${De(n.variant)}`],n.open&&e.iconOpen]}})(nie),ARe=we("input",{shouldForwardProp:t=>DM(t)&&t!=="classes",name:"MuiSelect",slot:"NativeInput",overridesResolver:(t,e)=>e.nativeInput})({bottom:0,left:0,position:"absolute",opacity:0,pointerEvents:"none",width:"100%",boxSizing:"border-box"});function W8(t,e){return typeof e=="object"&&e!==null?t===e:String(t)===String(e)}function RRe(t){return t==null||typeof t=="string"&&!t.trim()}const IRe=t=>{const{classes:e,variant:n,disabled:r,multiple:i,open:o,error:a}=t,s={select:["select",n,r&&"disabled",i&&"multiple",a&&"error"],icon:["icon",`icon${De(n)}`,o&&"iconOpen",r&&"disabled"],nativeInput:["nativeInput"]};return Ue(s,ERe,e)},DRe=M.forwardRef(function(e,n){var r;const{"aria-describedby":i,"aria-label":o,autoFocus:a,autoWidth:s,children:l,className:c,defaultOpen:u,defaultValue:f,disabled:d,displayEmpty:h,error:p=!1,IconComponent:m,inputRef:g,labelId:v,MenuProps:y={},multiple:x,name:b,onBlur:_,onChange:S,onClose:O,onFocus:C,onOpen:E,open:k,readOnly:I,renderValue:P,SelectDisplayProps:R={},tabIndex:T,value:L,variant:z="standard"}=e,B=Ae(e,PRe),[U,W]=Qs({controlled:L,default:f,name:"Select"}),[$,N]=Qs({controlled:k,default:u,name:"Select"}),D=M.useRef(null),A=M.useRef(null),[q,Y]=M.useState(null),{current:K}=M.useRef(k!=null),[se,te]=M.useState(),J=Zt(n,g),pe=M.useCallback(me=>{A.current=me,me&&Y(me)},[]),be=q==null?void 0:q.parentNode;M.useImperativeHandle(J,()=>({focus:()=>{A.current.focus()},node:D.current,value:U}),[U]),M.useEffect(()=>{u&&$&&q&&!K&&(te(s?null:be.clientWidth),A.current.focus())},[q,s]),M.useEffect(()=>{a&&A.current.focus()},[a]),M.useEffect(()=>{if(!v)return;const me=$n(A.current).getElementById(v);if(me){const $e=()=>{getSelection().isCollapsed&&A.current.focus()};return me.addEventListener("click",$e),()=>{me.removeEventListener("click",$e)}}},[v]);const re=(me,$e)=>{me?E&&E($e):O&&O($e),K||(te(s?null:be.clientWidth),N(me))},ve=me=>{me.button===0&&(me.preventDefault(),A.current.focus(),re(!0,me))},F=me=>{re(!1,me)},ce=M.Children.toArray(l),le=me=>{const $e=ce.find(Te=>Te.props.value===me.target.value);$e!==void 0&&(W($e.props.value),S&&S(me,$e))},Q=me=>$e=>{let Te;if($e.currentTarget.hasAttribute("tabindex")){if(x){Te=Array.isArray(U)?U.slice():[];const Re=U.indexOf(me.props.value);Re===-1?Te.push(me.props.value):Te.splice(Re,1)}else Te=me.props.value;if(me.props.onClick&&me.props.onClick($e),U!==Te&&(W(Te),S)){const Re=$e.nativeEvent||$e,ae=new Re.constructor(Re.type,Re);Object.defineProperty(ae,"target",{writable:!0,value:{value:Te,name:b}}),S(ae,me)}x||re(!1,$e)}},X=me=>{I||[" ","ArrowUp","ArrowDown","Enter"].indexOf(me.key)!==-1&&(me.preventDefault(),re(!0,me))},ee=q!==null&&$,ge=me=>{!ee&&_&&(Object.defineProperty(me,"target",{writable:!0,value:{value:U,name:b}}),_(me))};delete B["aria-invalid"];let ye,H;const G=[];let ie=!1;(AT({value:U})||h)&&(P?ye=P(U):ie=!0);const he=ce.map(me=>{if(!M.isValidElement(me))return null;let $e;if(x){if(!Array.isArray(U))throw new Error(fu(2));$e=U.some(Te=>W8(Te,me.props.value)),$e&&ie&&G.push(me.props.children)}else $e=W8(U,me.props.value),$e&&ie&&(H=me.props.children);return M.cloneElement(me,{"aria-selected":$e?"true":"false",onClick:Q(me),onKeyUp:Te=>{Te.key===" "&&Te.preventDefault(),me.props.onKeyUp&&me.props.onKeyUp(Te)},role:"option",selected:$e,value:void 0,"data-value":me.props.value})});ie&&(x?G.length===0?ye=null:ye=G.reduce((me,$e,Te)=>(me.push($e),Te<G.length-1&&me.push(", "),me),[]):ye=H);let _e=se;!s&&K&&q&&(_e=be.clientWidth);let oe;typeof T<"u"?oe=T:oe=d?null:0;const Z=R.id||(b?`mui-component-select-${b}`:void 0),V=j({},e,{variant:z,value:U,open:ee,error:p}),de=IRe(V),xe=j({},y.PaperProps,(r=y.slotProps)==null?void 0:r.paper),Me=pd();return w.jsxs(M.Fragment,{children:[w.jsx(MRe,j({ref:pe,tabIndex:oe,role:"combobox","aria-controls":Me,"aria-disabled":d?"true":void 0,"aria-expanded":ee?"true":"false","aria-haspopup":"listbox","aria-label":o,"aria-labelledby":[v,Z].filter(Boolean).join(" ")||void 0,"aria-describedby":i,onKeyDown:X,onMouseDown:d||I?null:ve,onBlur:ge,onFocus:C},R,{ownerState:V,className:ke(R.className,de.select,c),id:Z,children:RRe(ye)?U8||(U8=w.jsx("span",{className:"notranslate",children:"​"})):ye})),w.jsx(ARe,j({"aria-invalid":p,value:Array.isArray(U)?U.join(","):U,name:b,ref:D,"aria-hidden":!0,onChange:le,tabIndex:-1,disabled:d,className:de.nativeInput,autoFocus:a,ownerState:V},B)),w.jsx(kRe,{as:m,className:de.icon,ownerState:V}),w.jsx(Pp,j({id:`menu-${b||""}`,anchorEl:be,open:ee,onClose:F,anchorOrigin:{vertical:"bottom",horizontal:"center"},transformOrigin:{vertical:"top",horizontal:"center"}},y,{MenuListProps:j({"aria-labelledby":v,role:"listbox","aria-multiselectable":x?"true":void 0,disableListWrap:!0,id:Me},y.MenuListProps),slotProps:j({},y.slotProps,{paper:j({},xe,{style:j({minWidth:_e},xe!=null?xe.style:null)})}),children:he}))]})}),LRe=["autoWidth","children","classes","className","defaultOpen","displayEmpty","IconComponent","id","input","inputProps","label","labelId","MenuProps","multiple","native","onClose","onOpen","open","renderValue","SelectDisplayProps","variant"],NRe=["root"],$Re=t=>{const{classes:e}=t;return e},P5={name:"MuiSelect",overridesResolver:(t,e)=>e.root,shouldForwardProp:t=>hi(t)&&t!=="variant",slot:"Root"},FRe=we(yd,P5)(""),jRe=we(T5,P5)(""),BRe=we(O5,P5)(""),xd=M.forwardRef(function(e,n){const r=qe({name:"MuiSelect",props:e}),{autoWidth:i=!1,children:o,classes:a={},className:s,defaultOpen:l=!1,displayEmpty:c=!1,IconComponent:u=DPe,id:f,input:d,inputProps:h,label:p,labelId:m,MenuProps:g,multiple:v=!1,native:y=!1,onClose:x,onOpen:b,open:_,renderValue:S,SelectDisplayProps:O,variant:C="outlined"}=r,E=Ae(r,LRe),k=y?rRe:DRe,I=oc(),P=gd({props:r,muiFormControl:I,states:["variant","error"]}),R=P.variant||C,T=j({},r,{variant:R,classes:a}),L=$Re(T),z=Ae(L,NRe),B=d||{standard:w.jsx(FRe,{ownerState:T}),outlined:w.jsx(jRe,{label:p,ownerState:T}),filled:w.jsx(BRe,{ownerState:T})}[R],U=Zt(n,B.ref);return w.jsx(M.Fragment,{children:M.cloneElement(B,j({inputComponent:k,inputProps:j({children:o,error:P.error,IconComponent:u,variant:R,type:void 0,multiple:v},y?{id:f}:{autoWidth:i,defaultOpen:l,displayEmpty:c,labelId:m,MenuProps:g,onClose:x,onOpen:b,open:_,renderValue:S,SelectDisplayProps:j({id:f},O)},h,{classes:h?Ii(z,h.classes):z},d?d.props.inputProps:{})},(v&&y||c)&&R==="outlined"?{notched:!0}:{},{ref:U,className:ke(B.props.className,s,L.root)},!d&&{variant:R},E))})});xd.muiName="Select";const zRe=t=>!t||!Vl(t);function URe(t){return We("MuiSlider",t)}const Xa=Ve("MuiSlider",["root","active","colorPrimary","colorSecondary","colorError","colorInfo","colorSuccess","colorWarning","disabled","dragging","focusVisible","mark","markActive","marked","markLabel","markLabelActive","rail","sizeSmall","thumb","thumbColorPrimary","thumbColorSecondary","thumbColorError","thumbColorSuccess","thumbColorInfo","thumbColorWarning","track","trackInverted","trackFalse","thumbSizeSmall","valueLabel","valueLabelOpen","valueLabelCircle","valueLabelLabel","vertical"]),WRe=t=>{const{open:e}=t;return{offset:ke(e&&Xa.valueLabelOpen),circle:Xa.valueLabelCircle,label:Xa.valueLabelLabel}};function VRe(t){const{children:e,className:n,value:r}=t,i=WRe(t);return e?M.cloneElement(e,{className:ke(e.props.className)},w.jsxs(M.Fragment,{children:[e.props.children,w.jsx("span",{className:ke(i.offset,n),"aria-hidden":!0,children:w.jsx("span",{className:i.circle,children:w.jsx("span",{className:i.label,children:r})})})]})):null}const GRe=["aria-label","aria-valuetext","aria-labelledby","component","components","componentsProps","color","classes","className","disableSwap","disabled","getAriaLabel","getAriaValueText","marks","max","min","name","onChange","onChangeCommitted","orientation","shiftStep","size","step","scale","slotProps","slots","tabIndex","track","value","valueLabelDisplay","valueLabelFormat"],HRe=l5();function V8(t){return t}const qRe=we("span",{name:"MuiSlider",slot:"Root",overridesResolver:(t,e)=>{const{ownerState:n}=t;return[e.root,e[`color${De(n.color)}`],n.size!=="medium"&&e[`size${De(n.size)}`],n.marked&&e.marked,n.orientation==="vertical"&&e.vertical,n.track==="inverted"&&e.trackInverted,n.track===!1&&e.trackFalse]}})(({theme:t})=>{var e;return{borderRadius:12,boxSizing:"content-box",display:"inline-block",position:"relative",cursor:"pointer",touchAction:"none",WebkitTapHighlightColor:"transparent","@media print":{colorAdjust:"exact"},[`&.${Xa.disabled}`]:{pointerEvents:"none",cursor:"default",color:(t.vars||t).palette.grey[400]},[`&.${Xa.dragging}`]:{[`& .${Xa.thumb}, & .${Xa.track}`]:{transition:"none"}},variants:[...Object.keys(((e=t.vars)!=null?e:t).palette).filter(n=>{var r;return((r=t.vars)!=null?r:t).palette[n].main}).map(n=>({props:{color:n},style:{color:(t.vars||t).palette[n].main}})),{props:{orientation:"horizontal"},style:{height:4,width:"100%",padding:"13px 0","@media (pointer: coarse)":{padding:"20px 0"}}},{props:{orientation:"horizontal",size:"small"},style:{height:2}},{props:{orientation:"horizontal",marked:!0},style:{marginBottom:20}},{props:{orientation:"vertical"},style:{height:"100%",width:4,padding:"0 13px","@media (pointer: coarse)":{padding:"0 20px"}}},{props:{orientation:"vertical",size:"small"},style:{width:2}},{props:{orientation:"vertical",marked:!0},style:{marginRight:44}}]}}),XRe=we("span",{name:"MuiSlider",slot:"Rail",overridesResolver:(t,e)=>e.rail})({display:"block",position:"absolute",borderRadius:"inherit",backgroundColor:"currentColor",opacity:.38,variants:[{props:{orientation:"horizontal"},style:{width:"100%",height:"inherit",top:"50%",transform:"translateY(-50%)"}},{props:{orientation:"vertical"},style:{height:"100%",width:"inherit",left:"50%",transform:"translateX(-50%)"}},{props:{track:"inverted"},style:{opacity:1}}]}),QRe=we("span",{name:"MuiSlider",slot:"Track",overridesResolver:(t,e)=>e.track})(({theme:t})=>{var e;return{display:"block",position:"absolute",borderRadius:"inherit",border:"1px solid currentColor",backgroundColor:"currentColor",transition:t.transitions.create(["left","width","bottom","height"],{duration:t.transitions.duration.shortest}),variants:[{props:{size:"small"},style:{border:"none"}},{props:{orientation:"horizontal"},style:{height:"inherit",top:"50%",transform:"translateY(-50%)"}},{props:{orientation:"vertical"},style:{width:"inherit",left:"50%",transform:"translateX(-50%)"}},{props:{track:!1},style:{display:"none"}},...Object.keys(((e=t.vars)!=null?e:t).palette).filter(n=>{var r;return((r=t.vars)!=null?r:t).palette[n].main}).map(n=>({props:{color:n,track:"inverted"},style:j({},t.vars?{backgroundColor:t.vars.palette.Slider[`${n}Track`],borderColor:t.vars.palette.Slider[`${n}Track`]}:j({backgroundColor:Rb(t.palette[n].main,.62),borderColor:Rb(t.palette[n].main,.62)},t.applyStyles("dark",{backgroundColor:Ab(t.palette[n].main,.5)}),t.applyStyles("dark",{borderColor:Ab(t.palette[n].main,.5)})))}))]}}),YRe=we("span",{name:"MuiSlider",slot:"Thumb",overridesResolver:(t,e)=>{const{ownerState:n}=t;return[e.thumb,e[`thumbColor${De(n.color)}`],n.size!=="medium"&&e[`thumbSize${De(n.size)}`]]}})(({theme:t})=>{var e;return{position:"absolute",width:20,height:20,boxSizing:"border-box",borderRadius:"50%",outline:0,backgroundColor:"currentColor",display:"flex",alignItems:"center",justifyContent:"center",transition:t.transitions.create(["box-shadow","left","bottom"],{duration:t.transitions.duration.shortest}),"&::before":{position:"absolute",content:'""',borderRadius:"inherit",width:"100%",height:"100%",boxShadow:(t.vars||t).shadows[2]},"&::after":{position:"absolute",content:'""',borderRadius:"50%",width:42,height:42,top:"50%",left:"50%",transform:"translate(-50%, -50%)"},[`&.${Xa.disabled}`]:{"&:hover":{boxShadow:"none"}},variants:[{props:{size:"small"},style:{width:12,height:12,"&::before":{boxShadow:"none"}}},{props:{orientation:"horizontal"},style:{top:"50%",transform:"translate(-50%, -50%)"}},{props:{orientation:"vertical"},style:{left:"50%",transform:"translate(-50%, 50%)"}},...Object.keys(((e=t.vars)!=null?e:t).palette).filter(n=>{var r;return((r=t.vars)!=null?r:t).palette[n].main}).map(n=>({props:{color:n},style:{[`&:hover, &.${Xa.focusVisible}`]:j({},t.vars?{boxShadow:`0px 0px 0px 8px rgba(${t.vars.palette[n].mainChannel} / 0.16)`}:{boxShadow:`0px 0px 0px 8px ${kt(t.palette[n].main,.16)}`},{"@media (hover: none)":{boxShadow:"none"}}),[`&.${Xa.active}`]:j({},t.vars?{boxShadow:`0px 0px 0px 14px rgba(${t.vars.palette[n].mainChannel} / 0.16)`}:{boxShadow:`0px 0px 0px 14px ${kt(t.palette[n].main,.16)}`})}}))]}}),KRe=we(VRe,{name:"MuiSlider",slot:"ValueLabel",overridesResolver:(t,e)=>e.valueLabel})(({theme:t})=>j({zIndex:1,whiteSpace:"nowrap"},t.typography.body2,{fontWeight:500,transition:t.transitions.create(["transform"],{duration:t.transitions.duration.shortest}),position:"absolute",backgroundColor:(t.vars||t).palette.grey[600],borderRadius:2,color:(t.vars||t).palette.common.white,display:"flex",alignItems:"center",justifyContent:"center",padding:"0.25rem 0.75rem",variants:[{props:{orientation:"horizontal"},style:{transform:"translateY(-100%) scale(0)",top:"-10px",transformOrigin:"bottom center","&::before":{position:"absolute",content:'""',width:8,height:8,transform:"translate(-50%, 50%) rotate(45deg)",backgroundColor:"inherit",bottom:0,left:"50%"},[`&.${Xa.valueLabelOpen}`]:{transform:"translateY(-100%) scale(1)"}}},{props:{orientation:"vertical"},style:{transform:"translateY(-50%) scale(0)",right:"30px",top:"50%",transformOrigin:"right center","&::before":{position:"absolute",content:'""',width:8,height:8,transform:"translate(-50%, -50%) rotate(45deg)",backgroundColor:"inherit",right:-8,top:"50%"},[`&.${Xa.valueLabelOpen}`]:{transform:"translateY(-50%) scale(1)"}}},{props:{size:"small"},style:{fontSize:t.typography.pxToRem(12),padding:"0.25rem 0.5rem"}},{props:{orientation:"vertical",size:"small"},style:{right:"20px"}}]})),ZRe=we("span",{name:"MuiSlider",slot:"Mark",shouldForwardProp:t=>DM(t)&&t!=="markActive",overridesResolver:(t,e)=>{const{markActive:n}=t;return[e.mark,n&&e.markActive]}})(({theme:t})=>({position:"absolute",width:2,height:2,borderRadius:1,backgroundColor:"currentColor",variants:[{props:{orientation:"horizontal"},style:{top:"50%",transform:"translate(-1px, -50%)"}},{props:{orientation:"vertical"},style:{left:"50%",transform:"translate(-50%, 1px)"}},{props:{markActive:!0},style:{backgroundColor:(t.vars||t).palette.background.paper,opacity:.8}}]})),JRe=we("span",{name:"MuiSlider",slot:"MarkLabel",shouldForwardProp:t=>DM(t)&&t!=="markLabelActive",overridesResolver:(t,e)=>e.markLabel})(({theme:t})=>j({},t.typography.body2,{color:(t.vars||t).palette.text.secondary,position:"absolute",whiteSpace:"nowrap",variants:[{props:{orientation:"horizontal"},style:{top:30,transform:"translateX(-50%)","@media (pointer: coarse)":{top:40}}},{props:{orientation:"vertical"},style:{left:36,transform:"translateY(50%)","@media (pointer: coarse)":{left:44}}},{props:{markLabelActive:!0},style:{color:(t.vars||t).palette.text.primary}}]})),eIe=t=>{const{disabled:e,dragging:n,marked:r,orientation:i,track:o,classes:a,color:s,size:l}=t,c={root:["root",e&&"disabled",n&&"dragging",r&&"marked",i==="vertical"&&"vertical",o==="inverted"&&"trackInverted",o===!1&&"trackFalse",s&&`color${De(s)}`,l&&`size${De(l)}`],rail:["rail"],track:["track"],mark:["mark"],markActive:["markActive"],markLabel:["markLabel"],markLabelActive:["markLabelActive"],valueLabel:["valueLabel"],thumb:["thumb",e&&"disabled",l&&`thumbSize${De(l)}`,s&&`thumbColor${De(s)}`],active:["active"],disabled:["disabled"],focusVisible:["focusVisible"]};return Ue(c,URe,a)},tIe=({children:t})=>t,ry=M.forwardRef(function(e,n){var r,i,o,a,s,l,c,u,f,d,h,p,m,g,v,y,x,b,_,S,O,C,E,k;const I=HRe({props:e,name:"MuiSlider"}),P=R1(),{"aria-label":R,"aria-valuetext":T,"aria-labelledby":L,component:z="span",components:B={},componentsProps:U={},color:W="primary",classes:$,className:N,disableSwap:D=!1,disabled:A=!1,getAriaLabel:q,getAriaValueText:Y,marks:K=!1,max:se=100,min:te=0,orientation:J="horizontal",shiftStep:pe=10,size:be="medium",step:re=1,scale:ve=V8,slotProps:F,slots:ce,track:le="normal",valueLabelDisplay:Q="off",valueLabelFormat:X=V8}=I,ee=Ae(I,GRe),ge=j({},I,{isRtl:P,max:se,min:te,classes:$,disabled:A,disableSwap:D,orientation:J,marks:K,color:W,size:be,step:re,shiftStep:pe,scale:ve,track:le,valueLabelDisplay:Q,valueLabelFormat:X}),{axisProps:ye,getRootProps:H,getHiddenInputProps:G,getThumbProps:ie,open:he,active:_e,axis:oe,focusedThumbIndex:Z,range:V,dragging:de,marks:xe,values:Me,trackOffset:me,trackLeap:$e,getThumbStyle:Te}=oPe(j({},ge,{rootRef:n}));ge.marked=xe.length>0&&xe.some(Ze=>Ze.label),ge.dragging=de,ge.focusedThumbIndex=Z;const Re=eIe(ge),ae=(r=(i=ce==null?void 0:ce.root)!=null?i:B.Root)!=null?r:qRe,Le=(o=(a=ce==null?void 0:ce.rail)!=null?a:B.Rail)!=null?o:XRe,Ee=(s=(l=ce==null?void 0:ce.track)!=null?l:B.Track)!=null?s:QRe,ze=(c=(u=ce==null?void 0:ce.thumb)!=null?u:B.Thumb)!=null?c:YRe,He=(f=(d=ce==null?void 0:ce.valueLabel)!=null?d:B.ValueLabel)!=null?f:KRe,xt=(h=(p=ce==null?void 0:ce.mark)!=null?p:B.Mark)!=null?h:ZRe,Dt=(m=(g=ce==null?void 0:ce.markLabel)!=null?g:B.MarkLabel)!=null?m:JRe,nn=(v=(y=ce==null?void 0:ce.input)!=null?y:B.Input)!=null?v:"input",Xr=(x=F==null?void 0:F.root)!=null?x:U.root,Cn=(b=F==null?void 0:F.rail)!=null?b:U.rail,Qr=(_=F==null?void 0:F.track)!=null?_:U.track,ir=(S=F==null?void 0:F.thumb)!=null?S:U.thumb,to=(O=F==null?void 0:F.valueLabel)!=null?O:U.valueLabel,yo=(C=F==null?void 0:F.mark)!=null?C:U.mark,Xo=(E=F==null?void 0:F.markLabel)!=null?E:U.markLabel,al=(k=F==null?void 0:F.input)!=null?k:U.input,yi=$r({elementType:ae,getSlotProps:H,externalSlotProps:Xr,externalForwardedProps:ee,additionalProps:j({},zRe(ae)&&{as:z}),ownerState:j({},ge,Xr==null?void 0:Xr.ownerState),className:[Re.root,N]}),Ts=$r({elementType:Le,externalSlotProps:Cn,ownerState:ge,className:Re.rail}),ne=$r({elementType:Ee,externalSlotProps:Qr,additionalProps:{style:j({},ye[oe].offset(me),ye[oe].leap($e))},ownerState:j({},ge,Qr==null?void 0:Qr.ownerState),className:Re.track}),Pe=$r({elementType:ze,getSlotProps:ie,externalSlotProps:ir,ownerState:j({},ge,ir==null?void 0:ir.ownerState),className:Re.thumb}),Ie=$r({elementType:He,externalSlotProps:to,ownerState:j({},ge,to==null?void 0:to.ownerState),className:Re.valueLabel}),Oe=$r({elementType:xt,externalSlotProps:yo,ownerState:ge,className:Re.mark}),Ne=$r({elementType:Dt,externalSlotProps:Xo,ownerState:ge,className:Re.markLabel}),ot=$r({elementType:nn,getSlotProps:G,externalSlotProps:al,ownerState:ge});return w.jsxs(ae,j({},yi,{children:[w.jsx(Le,j({},Ts)),w.jsx(Ee,j({},ne)),xe.filter(Ze=>Ze.value>=te&&Ze.value<=se).map((Ze,mt)=>{const wt=kT(Ze.value,te,se),zt=ye[oe].offset(wt);let Pt;return le===!1?Pt=Me.indexOf(Ze.value)!==-1:Pt=le==="normal"&&(V?Ze.value>=Me[0]&&Ze.value<=Me[Me.length-1]:Ze.value<=Me[0])||le==="inverted"&&(V?Ze.value<=Me[0]||Ze.value>=Me[Me.length-1]:Ze.value>=Me[0]),w.jsxs(M.Fragment,{children:[w.jsx(xt,j({"data-index":mt},Oe,!Vl(xt)&&{markActive:Pt},{style:j({},zt,Oe.style),className:ke(Oe.className,Pt&&Re.markActive)})),Ze.label!=null?w.jsx(Dt,j({"aria-hidden":!0,"data-index":mt},Ne,!Vl(Dt)&&{markLabelActive:Pt},{style:j({},zt,Ne.style),className:ke(Re.markLabel,Ne.className,Pt&&Re.markLabelActive),children:Ze.label})):null]},mt)}),Me.map((Ze,mt)=>{const wt=kT(Ze,te,se),zt=ye[oe].offset(wt),Pt=Q==="off"?tIe:He;return w.jsx(Pt,j({},!Vl(Pt)&&{valueLabelFormat:X,valueLabelDisplay:Q,value:typeof X=="function"?X(ve(Ze),mt):X,index:mt,open:he===mt||_e===mt||Q==="on",disabled:A},Ie,{children:w.jsx(ze,j({"data-index":mt},Pe,{className:ke(Re.thumb,Pe.className,_e===mt&&Re.active,Z===mt&&Re.focusVisible),style:j({},zt,Te(mt),Pe.style),children:w.jsx(nn,j({"data-index":mt,"aria-label":q?q(mt):R,"aria-valuenow":ve(Ze),"aria-labelledby":L,"aria-valuetext":Y?Y(ve(Ze),mt):T,value:Me[mt]},ot))}))}),mt)})]}))});function nIe(t){return We("MuiSnackbarContent",t)}Ve("MuiSnackbarContent",["root","message","action"]);const rIe=["action","className","message","role"],iIe=t=>{const{classes:e}=t;return Ue({root:["root"],action:["action"],message:["message"]},nIe,e)},oIe=we(Ho,{name:"MuiSnackbarContent",slot:"Root",overridesResolver:(t,e)=>e.root})(({theme:t})=>{const e=t.palette.mode==="light"?.8:.98,n=iOe(t.palette.background.default,e);return j({},t.typography.body2,{color:t.vars?t.vars.palette.SnackbarContent.color:t.palette.getContrastText(n),backgroundColor:t.vars?t.vars.palette.SnackbarContent.bg:n,display:"flex",alignItems:"center",flexWrap:"wrap",padding:"6px 16px",borderRadius:(t.vars||t).shape.borderRadius,flexGrow:1,[t.breakpoints.up("sm")]:{flexGrow:"initial",minWidth:288}})}),aIe=we("div",{name:"MuiSnackbarContent",slot:"Message",overridesResolver:(t,e)=>e.message})({padding:"8px 0"}),sIe=we("div",{name:"MuiSnackbarContent",slot:"Action",overridesResolver:(t,e)=>e.action})({display:"flex",alignItems:"center",marginLeft:"auto",paddingLeft:16,marginRight:-8}),oie=M.forwardRef(function(e,n){const r=qe({props:e,name:"MuiSnackbarContent"}),{action:i,className:o,message:a,role:s="alert"}=r,l=Ae(r,rIe),c=r,u=iIe(c);return w.jsxs(oIe,j({role:s,square:!0,elevation:6,className:ke(u.root,o),ownerState:c,ref:n},l,{children:[w.jsx(aIe,{className:u.message,ownerState:c,children:a}),i?w.jsx(sIe,{className:u.action,ownerState:c,children:i}):null]}))});function lIe(t){return We("MuiSnackbar",t)}Ve("MuiSnackbar",["root","anchorOriginTopCenter","anchorOriginBottomCenter","anchorOriginTopRight","anchorOriginBottomRight","anchorOriginTopLeft","anchorOriginBottomLeft"]);const cIe=["onEnter","onExited"],uIe=["action","anchorOrigin","autoHideDuration","children","className","ClickAwayListenerProps","ContentProps","disableWindowBlurListener","message","onBlur","onClose","onFocus","onMouseEnter","onMouseLeave","open","resumeHideDuration","TransitionComponent","transitionDuration","TransitionProps"],fIe=t=>{const{classes:e,anchorOrigin:n}=t,r={root:["root",`anchorOrigin${De(n.vertical)}${De(n.horizontal)}`]};return Ue(r,lIe,e)},G8=we("div",{name:"MuiSnackbar",slot:"Root",overridesResolver:(t,e)=>{const{ownerState:n}=t;return[e.root,e[`anchorOrigin${De(n.anchorOrigin.vertical)}${De(n.anchorOrigin.horizontal)}`]]}})(({theme:t,ownerState:e})=>{const n={left:"50%",right:"auto",transform:"translateX(-50%)"};return j({zIndex:(t.vars||t).zIndex.snackbar,position:"fixed",display:"flex",left:8,right:8,justifyContent:"center",alignItems:"center"},e.anchorOrigin.vertical==="top"?{top:8}:{bottom:8},e.anchorOrigin.horizontal==="left"&&{justifyContent:"flex-start"},e.anchorOrigin.horizontal==="right"&&{justifyContent:"flex-end"},{[t.breakpoints.up("sm")]:j({},e.anchorOrigin.vertical==="top"?{top:24}:{bottom:24},e.anchorOrigin.horizontal==="center"&&n,e.anchorOrigin.horizontal==="left"&&{left:24,right:"auto"},e.anchorOrigin.horizontal==="right"&&{right:24,left:"auto"})})}),dIe=M.forwardRef(function(e,n){const r=qe({props:e,name:"MuiSnackbar"}),i=Go(),o={enter:i.transitions.duration.enteringScreen,exit:i.transitions.duration.leavingScreen},{action:a,anchorOrigin:{vertical:s,horizontal:l}={vertical:"bottom",horizontal:"left"},autoHideDuration:c=null,children:u,className:f,ClickAwayListenerProps:d,ContentProps:h,disableWindowBlurListener:p=!1,message:m,open:g,TransitionComponent:v=ev,transitionDuration:y=o,TransitionProps:{onEnter:x,onExited:b}={}}=r,_=Ae(r.TransitionProps,cIe),S=Ae(r,uIe),O=j({},r,{anchorOrigin:{vertical:s,horizontal:l},autoHideDuration:c,disableWindowBlurListener:p,TransitionComponent:v,transitionDuration:y}),C=fIe(O),{getRootProps:E,onClickAway:k}=aPe(j({},O)),[I,P]=M.useState(!0),R=$r({elementType:G8,getSlotProps:E,externalForwardedProps:S,ownerState:O,additionalProps:{ref:n},className:[C.root,f]}),T=z=>{P(!0),b&&b(z)},L=(z,B)=>{P(!1),x&&x(z,B)};return!g&&I?null:w.jsx(_Te,j({onClickAway:k},d,{children:w.jsx(G8,j({},R,{children:w.jsx(v,j({appear:!0,in:g,timeout:y,direction:s==="top"?"down":"up",onEnter:L,onExited:T},_,{children:u||w.jsx(oie,j({message:m,action:a},h))}))}))}))});function hIe(t){return We("MuiTooltip",t)}const _f=Ve("MuiTooltip",["popper","popperInteractive","popperArrow","popperClose","tooltip","tooltipArrow","touch","tooltipPlacementLeft","tooltipPlacementRight","tooltipPlacementTop","tooltipPlacementBottom","arrow"]),pIe=["arrow","children","classes","components","componentsProps","describeChild","disableFocusListener","disableHoverListener","disableInteractive","disableTouchListener","enterDelay","enterNextDelay","enterTouchDelay","followCursor","id","leaveDelay","leaveTouchDelay","onClose","onOpen","open","placement","PopperComponent","PopperProps","slotProps","slots","title","TransitionComponent","TransitionProps"];function mIe(t){return Math.round(t*1e5)/1e5}const gIe=t=>{const{classes:e,disableInteractive:n,arrow:r,touch:i,placement:o}=t,a={popper:["popper",!n&&"popperInteractive",r&&"popperArrow"],tooltip:["tooltip",r&&"tooltipArrow",i&&"touch",`tooltipPlacement${De(o.split("-")[0])}`],arrow:["arrow"]};return Ue(a,hIe,e)},vIe=we(_5,{name:"MuiTooltip",slot:"Popper",overridesResolver:(t,e)=>{const{ownerState:n}=t;return[e.popper,!n.disableInteractive&&e.popperInteractive,n.arrow&&e.popperArrow,!n.open&&e.popperClose]}})(({theme:t,ownerState:e,open:n})=>j({zIndex:(t.vars||t).zIndex.tooltip,pointerEvents:"none"},!e.disableInteractive&&{pointerEvents:"auto"},!n&&{pointerEvents:"none"},e.arrow&&{[`&[data-popper-placement*="bottom"] .${_f.arrow}`]:{top:0,marginTop:"-0.71em","&::before":{transformOrigin:"0 100%"}},[`&[data-popper-placement*="top"] .${_f.arrow}`]:{bottom:0,marginBottom:"-0.71em","&::before":{transformOrigin:"100% 0"}},[`&[data-popper-placement*="right"] .${_f.arrow}`]:j({},e.isRtl?{right:0,marginRight:"-0.71em"}:{left:0,marginLeft:"-0.71em"},{height:"1em",width:"0.71em","&::before":{transformOrigin:"100% 100%"}}),[`&[data-popper-placement*="left"] .${_f.arrow}`]:j({},e.isRtl?{left:0,marginLeft:"-0.71em"}:{right:0,marginRight:"-0.71em"},{height:"1em",width:"0.71em","&::before":{transformOrigin:"0 0"}})})),yIe=we("div",{name:"MuiTooltip",slot:"Tooltip",overridesResolver:(t,e)=>{const{ownerState:n}=t;return[e.tooltip,n.touch&&e.touch,n.arrow&&e.tooltipArrow,e[`tooltipPlacement${De(n.placement.split("-")[0])}`]]}})(({theme:t,ownerState:e})=>j({backgroundColor:t.vars?t.vars.palette.Tooltip.bg:kt(t.palette.grey[700],.92),borderRadius:(t.vars||t).shape.borderRadius,color:(t.vars||t).palette.common.white,fontFamily:t.typography.fontFamily,padding:"4px 8px",fontSize:t.typography.pxToRem(11),maxWidth:300,margin:2,wordWrap:"break-word",fontWeight:t.typography.fontWeightMedium},e.arrow&&{position:"relative",margin:0},e.touch&&{padding:"8px 16px",fontSize:t.typography.pxToRem(14),lineHeight:`${mIe(16/14)}em`,fontWeight:t.typography.fontWeightRegular},{[`.${_f.popper}[data-popper-placement*="left"] &`]:j({transformOrigin:"right center"},e.isRtl?j({marginLeft:"14px"},e.touch&&{marginLeft:"24px"}):j({marginRight:"14px"},e.touch&&{marginRight:"24px"})),[`.${_f.popper}[data-popper-placement*="right"] &`]:j({transformOrigin:"left center"},e.isRtl?j({marginRight:"14px"},e.touch&&{marginRight:"24px"}):j({marginLeft:"14px"},e.touch&&{marginLeft:"24px"})),[`.${_f.popper}[data-popper-placement*="top"] &`]:j({transformOrigin:"center bottom",marginBottom:"14px"},e.touch&&{marginBottom:"24px"}),[`.${_f.popper}[data-popper-placement*="bottom"] &`]:j({transformOrigin:"center top",marginTop:"14px"},e.touch&&{marginTop:"24px"})})),xIe=we("span",{name:"MuiTooltip",slot:"Arrow",overridesResolver:(t,e)=>e.arrow})(({theme:t})=>({overflow:"hidden",position:"absolute",width:"1em",height:"0.71em",boxSizing:"border-box",color:t.vars?t.vars.palette.Tooltip.bg:kt(t.palette.grey[700],.9),"&::before":{content:'""',margin:"auto",display:"block",width:"100%",height:"100%",backgroundColor:"currentColor",transform:"rotate(45deg)"}}));let dS=!1;const H8=new k1;let y0={x:0,y:0};function hS(t,e){return(n,...r)=>{e&&e(n,...r),t(n,...r)}}const _t=M.forwardRef(function(e,n){var r,i,o,a,s,l,c,u,f,d,h,p,m,g,v,y,x,b,_;const S=qe({props:e,name:"MuiTooltip"}),{arrow:O=!1,children:C,components:E={},componentsProps:k={},describeChild:I=!1,disableFocusListener:P=!1,disableHoverListener:R=!1,disableInteractive:T=!1,disableTouchListener:L=!1,enterDelay:z=100,enterNextDelay:B=0,enterTouchDelay:U=700,followCursor:W=!1,id:$,leaveDelay:N=0,leaveTouchDelay:D=1500,onClose:A,onOpen:q,open:Y,placement:K="bottom",PopperComponent:se,PopperProps:te={},slotProps:J={},slots:pe={},title:be,TransitionComponent:re=ev,TransitionProps:ve}=S,F=Ae(S,pIe),ce=M.isValidElement(C)?C:w.jsx("span",{children:C}),le=Go(),Q=R1(),[X,ee]=M.useState(),[ge,ye]=M.useState(null),H=M.useRef(!1),G=T||W,ie=bf(),he=bf(),_e=bf(),oe=bf(),[Z,V]=Qs({controlled:Y,default:!1,name:"Tooltip",state:"open"});let de=Z;const xe=pd($),Me=M.useRef(),me=_r(()=>{Me.current!==void 0&&(document.body.style.WebkitUserSelect=Me.current,Me.current=void 0),oe.clear()});M.useEffect(()=>me,[me]);const $e=st=>{H8.clear(),dS=!0,V(!0),q&&!de&&q(st)},Te=_r(st=>{H8.start(800+N,()=>{dS=!1}),V(!1),A&&de&&A(st),ie.start(le.transitions.duration.shortest,()=>{H.current=!1})}),Re=st=>{H.current&&st.type!=="touchstart"||(X&&X.removeAttribute("title"),he.clear(),_e.clear(),z||dS&&B?he.start(dS?B:z,()=>{$e(st)}):$e(st))},ae=st=>{he.clear(),_e.start(N,()=>{Te(st)})},{isFocusVisibleRef:Le,onBlur:Ee,onFocus:ze,ref:He}=A1(),[,xt]=M.useState(!1),Dt=st=>{Ee(st),Le.current===!1&&(xt(!1),ae(st))},nn=st=>{X||ee(st.currentTarget),ze(st),Le.current===!0&&(xt(!0),Re(st))},Xr=st=>{H.current=!0;const Qt=ce.props;Qt.onTouchStart&&Qt.onTouchStart(st)},Cn=st=>{Xr(st),_e.clear(),ie.clear(),me(),Me.current=document.body.style.WebkitUserSelect,document.body.style.WebkitUserSelect="none",oe.start(U,()=>{document.body.style.WebkitUserSelect=Me.current,Re(st)})},Qr=st=>{ce.props.onTouchEnd&&ce.props.onTouchEnd(st),me(),_e.start(D,()=>{Te(st)})};M.useEffect(()=>{if(!de)return;function st(Qt){(Qt.key==="Escape"||Qt.key==="Esc")&&Te(Qt)}return document.addEventListener("keydown",st),()=>{document.removeEventListener("keydown",st)}},[Te,de]);const ir=Zt(ce.ref,He,ee,n);!be&&be!==0&&(de=!1);const to=M.useRef(),yo=st=>{const Qt=ce.props;Qt.onMouseMove&&Qt.onMouseMove(st),y0={x:st.clientX,y:st.clientY},to.current&&to.current.update()},Xo={},al=typeof be=="string";I?(Xo.title=!de&&al&&!R?be:null,Xo["aria-describedby"]=de?xe:null):(Xo["aria-label"]=al?be:null,Xo["aria-labelledby"]=de&&!al?xe:null);const yi=j({},Xo,F,ce.props,{className:ke(F.className,ce.props.className),onTouchStart:Xr,ref:ir},W?{onMouseMove:yo}:{}),Ts={};L||(yi.onTouchStart=Cn,yi.onTouchEnd=Qr),R||(yi.onMouseOver=hS(Re,yi.onMouseOver),yi.onMouseLeave=hS(ae,yi.onMouseLeave),G||(Ts.onMouseOver=Re,Ts.onMouseLeave=ae)),P||(yi.onFocus=hS(nn,yi.onFocus),yi.onBlur=hS(Dt,yi.onBlur),G||(Ts.onFocus=nn,Ts.onBlur=Dt));const ne=M.useMemo(()=>{var st;let Qt=[{name:"arrow",enabled:!!ge,options:{element:ge,padding:4}}];return(st=te.popperOptions)!=null&&st.modifiers&&(Qt=Qt.concat(te.popperOptions.modifiers)),j({},te.popperOptions,{modifiers:Qt})},[ge,te]),Pe=j({},S,{isRtl:Q,arrow:O,disableInteractive:G,placement:K,PopperComponentProp:se,touch:H.current}),Ie=gIe(Pe),Oe=(r=(i=pe.popper)!=null?i:E.Popper)!=null?r:vIe,Ne=(o=(a=(s=pe.transition)!=null?s:E.Transition)!=null?a:re)!=null?o:ev,ot=(l=(c=pe.tooltip)!=null?c:E.Tooltip)!=null?l:yIe,Ze=(u=(f=pe.arrow)!=null?f:E.Arrow)!=null?u:xIe,mt=Zm(Oe,j({},te,(d=J.popper)!=null?d:k.popper,{className:ke(Ie.popper,te==null?void 0:te.className,(h=(p=J.popper)!=null?p:k.popper)==null?void 0:h.className)}),Pe),wt=Zm(Ne,j({},ve,(m=J.transition)!=null?m:k.transition),Pe),zt=Zm(ot,j({},(g=J.tooltip)!=null?g:k.tooltip,{className:ke(Ie.tooltip,(v=(y=J.tooltip)!=null?y:k.tooltip)==null?void 0:v.className)}),Pe),Pt=Zm(Ze,j({},(x=J.arrow)!=null?x:k.arrow,{className:ke(Ie.arrow,(b=(_=J.arrow)!=null?_:k.arrow)==null?void 0:b.className)}),Pe);return w.jsxs(M.Fragment,{children:[M.cloneElement(ce,yi),w.jsx(Oe,j({as:se??_5,placement:K,anchorEl:W?{getBoundingClientRect:()=>({top:y0.y,left:y0.x,right:y0.x,bottom:y0.y,width:0,height:0})}:X,popperRef:to,open:X?de:!1,id:xe,transition:!0},Ts,mt,{popperOptions:ne,children:({TransitionProps:st})=>w.jsx(Ne,j({timeout:le.transitions.duration.shorter},st,wt,{children:w.jsxs(ot,j({},zt,{children:[be,O?w.jsx(Ze,j({},Pt,{ref:ye})):null]}))}))}))]})});function bIe(t){return We("MuiSwitch",t)}const oo=Ve("MuiSwitch",["root","edgeStart","edgeEnd","switchBase","colorPrimary","colorSecondary","sizeSmall","sizeMedium","checked","disabled","input","thumb","track"]),_Ie=["className","color","edge","size","sx"],wIe=l5(),SIe=t=>{const{classes:e,edge:n,size:r,color:i,checked:o,disabled:a}=t,s={root:["root",n&&`edge${De(n)}`,`size${De(r)}`],switchBase:["switchBase",`color${De(i)}`,o&&"checked",a&&"disabled"],thumb:["thumb"],track:["track"],input:["input"]},l=Ue(s,bIe,e);return j({},e,l)},OIe=we("span",{name:"MuiSwitch",slot:"Root",overridesResolver:(t,e)=>{const{ownerState:n}=t;return[e.root,n.edge&&e[`edge${De(n.edge)}`],e[`size${De(n.size)}`]]}})({display:"inline-flex",width:34+12*2,height:14+12*2,overflow:"hidden",padding:12,boxSizing:"border-box",position:"relative",flexShrink:0,zIndex:0,verticalAlign:"middle","@media print":{colorAdjust:"exact"},variants:[{props:{edge:"start"},style:{marginLeft:-8}},{props:{edge:"end"},style:{marginRight:-8}},{props:{size:"small"},style:{width:40,height:24,padding:7,[`& .${oo.thumb}`]:{width:16,height:16},[`& .${oo.switchBase}`]:{padding:4,[`&.${oo.checked}`]:{transform:"translateX(16px)"}}}}]}),CIe=we(S5,{name:"MuiSwitch",slot:"SwitchBase",overridesResolver:(t,e)=>{const{ownerState:n}=t;return[e.switchBase,{[`& .${oo.input}`]:e.input},n.color!=="default"&&e[`color${De(n.color)}`]]}})(({theme:t})=>({position:"absolute",top:0,left:0,zIndex:1,color:t.vars?t.vars.palette.Switch.defaultColor:`${t.palette.mode==="light"?t.palette.common.white:t.palette.grey[300]}`,transition:t.transitions.create(["left","transform"],{duration:t.transitions.duration.shortest}),[`&.${oo.checked}`]:{transform:"translateX(20px)"},[`&.${oo.disabled}`]:{color:t.vars?t.vars.palette.Switch.defaultDisabledColor:`${t.palette.mode==="light"?t.palette.grey[100]:t.palette.grey[600]}`},[`&.${oo.checked} + .${oo.track}`]:{opacity:.5},[`&.${oo.disabled} + .${oo.track}`]:{opacity:t.vars?t.vars.opacity.switchTrackDisabled:`${t.palette.mode==="light"?.12:.2}`},[`& .${oo.input}`]:{left:"-100%",width:"300%"}}),({theme:t})=>({"&:hover":{backgroundColor:t.vars?`rgba(${t.vars.palette.action.activeChannel} / ${t.vars.palette.action.hoverOpacity})`:kt(t.palette.action.active,t.palette.action.hoverOpacity),"@media (hover: none)":{backgroundColor:"transparent"}},variants:[...Object.entries(t.palette).filter(([,e])=>e.main&&e.light).map(([e])=>({props:{color:e},style:{[`&.${oo.checked}`]:{color:(t.vars||t).palette[e].main,"&:hover":{backgroundColor:t.vars?`rgba(${t.vars.palette[e].mainChannel} / ${t.vars.palette.action.hoverOpacity})`:kt(t.palette[e].main,t.palette.action.hoverOpacity),"@media (hover: none)":{backgroundColor:"transparent"}},[`&.${oo.disabled}`]:{color:t.vars?t.vars.palette.Switch[`${e}DisabledColor`]:`${t.palette.mode==="light"?Rb(t.palette[e].main,.62):Ab(t.palette[e].main,.55)}`}},[`&.${oo.checked} + .${oo.track}`]:{backgroundColor:(t.vars||t).palette[e].main}}}))]})),TIe=we("span",{name:"MuiSwitch",slot:"Track",overridesResolver:(t,e)=>e.track})(({theme:t})=>({height:"100%",width:"100%",borderRadius:14/2,zIndex:-1,transition:t.transitions.create(["opacity","background-color"],{duration:t.transitions.duration.shortest}),backgroundColor:t.vars?t.vars.palette.common.onBackground:`${t.palette.mode==="light"?t.palette.common.black:t.palette.common.white}`,opacity:t.vars?t.vars.opacity.switchTrack:`${t.palette.mode==="light"?.38:.3}`})),EIe=we("span",{name:"MuiSwitch",slot:"Thumb",overridesResolver:(t,e)=>e.thumb})(({theme:t})=>({boxShadow:(t.vars||t).shadows[1],backgroundColor:"currentColor",width:20,height:20,borderRadius:"50%"})),aie=M.forwardRef(function(e,n){const r=wIe({props:e,name:"MuiSwitch"}),{className:i,color:o="primary",edge:a=!1,size:s="medium",sx:l}=r,c=Ae(r,_Ie),u=j({},r,{color:o,edge:a,size:s}),f=SIe(u),d=w.jsx(EIe,{className:f.thumb,ownerState:u});return w.jsxs(OIe,{className:ke(f.root,i),sx:l,ownerState:u,children:[w.jsx(CIe,j({type:"checkbox",icon:d,checkedIcon:d,ref:n,ownerState:u},c,{classes:j({},f,{root:f.switchBase})})),w.jsx(TIe,{className:f.track,ownerState:u})]})});function PIe(t){return We("MuiTab",t)}const Au=Ve("MuiTab",["root","labelIcon","textColorInherit","textColorPrimary","textColorSecondary","selected","disabled","fullWidth","wrapped","iconWrapper"]),MIe=["className","disabled","disableFocusRipple","fullWidth","icon","iconPosition","indicator","label","onChange","onClick","onFocus","selected","selectionFollowsFocus","textColor","value","wrapped"],kIe=t=>{const{classes:e,textColor:n,fullWidth:r,wrapped:i,icon:o,label:a,selected:s,disabled:l}=t,c={root:["root",o&&a&&"labelIcon",`textColor${De(n)}`,r&&"fullWidth",i&&"wrapped",s&&"selected",l&&"disabled"],iconWrapper:["iconWrapper"]};return Ue(c,PIe,e)},AIe=we(fs,{name:"MuiTab",slot:"Root",overridesResolver:(t,e)=>{const{ownerState:n}=t;return[e.root,n.label&&n.icon&&e.labelIcon,e[`textColor${De(n.textColor)}`],n.fullWidth&&e.fullWidth,n.wrapped&&e.wrapped,{[`& .${Au.iconWrapper}`]:e.iconWrapper}]}})(({theme:t,ownerState:e})=>j({},t.typography.button,{maxWidth:360,minWidth:90,position:"relative",minHeight:48,flexShrink:0,padding:"12px 16px",overflow:"hidden",whiteSpace:"normal",textAlign:"center"},e.label&&{flexDirection:e.iconPosition==="top"||e.iconPosition==="bottom"?"column":"row"},{lineHeight:1.25},e.icon&&e.label&&{minHeight:72,paddingTop:9,paddingBottom:9,[`& > .${Au.iconWrapper}`]:j({},e.iconPosition==="top"&&{marginBottom:6},e.iconPosition==="bottom"&&{marginTop:6},e.iconPosition==="start"&&{marginRight:t.spacing(1)},e.iconPosition==="end"&&{marginLeft:t.spacing(1)})},e.textColor==="inherit"&&{color:"inherit",opacity:.6,[`&.${Au.selected}`]:{opacity:1},[`&.${Au.disabled}`]:{opacity:(t.vars||t).palette.action.disabledOpacity}},e.textColor==="primary"&&{color:(t.vars||t).palette.text.secondary,[`&.${Au.selected}`]:{color:(t.vars||t).palette.primary.main},[`&.${Au.disabled}`]:{color:(t.vars||t).palette.text.disabled}},e.textColor==="secondary"&&{color:(t.vars||t).palette.text.secondary,[`&.${Au.selected}`]:{color:(t.vars||t).palette.secondary.main},[`&.${Au.disabled}`]:{color:(t.vars||t).palette.text.disabled}},e.fullWidth&&{flexShrink:1,flexGrow:1,flexBasis:0,maxWidth:"none"},e.wrapped&&{fontSize:t.typography.pxToRem(12)})),$b=M.forwardRef(function(e,n){const r=qe({props:e,name:"MuiTab"}),{className:i,disabled:o=!1,disableFocusRipple:a=!1,fullWidth:s,icon:l,iconPosition:c="top",indicator:u,label:f,onChange:d,onClick:h,onFocus:p,selected:m,selectionFollowsFocus:g,textColor:v="inherit",value:y,wrapped:x=!1}=r,b=Ae(r,MIe),_=j({},r,{disabled:o,disableFocusRipple:a,selected:m,icon:!!l,iconPosition:c,label:!!f,fullWidth:s,textColor:v,wrapped:x}),S=kIe(_),O=l&&f&&M.isValidElement(l)?M.cloneElement(l,{className:ke(S.iconWrapper,l.props.className)}):l,C=k=>{!m&&d&&d(k,y),h&&h(k)},E=k=>{g&&!m&&d&&d(k,y),p&&p(k)};return w.jsxs(AIe,j({focusRipple:!a,className:ke(S.root,i),ref:n,role:"tab","aria-selected":m,disabled:o,onClick:C,onFocus:E,ownerState:_,tabIndex:m?0:-1},b,{children:[c==="top"||c==="start"?w.jsxs(M.Fragment,{children:[O,f]}):w.jsxs(M.Fragment,{children:[f,O]}),u]}))}),sie=M.createContext();function RIe(t){return We("MuiTable",t)}Ve("MuiTable",["root","stickyHeader"]);const IIe=["className","component","padding","size","stickyHeader"],DIe=t=>{const{classes:e,stickyHeader:n}=t;return Ue({root:["root",n&&"stickyHeader"]},RIe,e)},LIe=we("table",{name:"MuiTable",slot:"Root",overridesResolver:(t,e)=>{const{ownerState:n}=t;return[e.root,n.stickyHeader&&e.stickyHeader]}})(({theme:t,ownerState:e})=>j({display:"table",width:"100%",borderCollapse:"collapse",borderSpacing:0,"& caption":j({},t.typography.body2,{padding:t.spacing(2),color:(t.vars||t).palette.text.secondary,textAlign:"left",captionSide:"bottom"})},e.stickyHeader&&{borderCollapse:"separate"})),q8="table",M5=M.forwardRef(function(e,n){const r=qe({props:e,name:"MuiTable"}),{className:i,component:o=q8,padding:a="normal",size:s="medium",stickyHeader:l=!1}=r,c=Ae(r,IIe),u=j({},r,{component:o,padding:a,size:s,stickyHeader:l}),f=DIe(u),d=M.useMemo(()=>({padding:a,size:s,stickyHeader:l}),[a,s,l]);return w.jsx(sie.Provider,{value:d,children:w.jsx(LIe,j({as:o,role:o===q8?null:"table",ref:n,className:ke(f.root,i),ownerState:u},c))})}),t2=M.createContext();function NIe(t){return We("MuiTableBody",t)}Ve("MuiTableBody",["root"]);const $Ie=["className","component"],FIe=t=>{const{classes:e}=t;return Ue({root:["root"]},NIe,e)},jIe=we("tbody",{name:"MuiTableBody",slot:"Root",overridesResolver:(t,e)=>e.root})({display:"table-row-group"}),BIe={variant:"body"},X8="tbody",k5=M.forwardRef(function(e,n){const r=qe({props:e,name:"MuiTableBody"}),{className:i,component:o=X8}=r,a=Ae(r,$Ie),s=j({},r,{component:o}),l=FIe(s);return w.jsx(t2.Provider,{value:BIe,children:w.jsx(jIe,j({className:ke(l.root,i),as:o,ref:n,role:o===X8?null:"rowgroup",ownerState:s},a))})});function zIe(t){return We("MuiTableCell",t)}const UIe=Ve("MuiTableCell",["root","head","body","footer","sizeSmall","sizeMedium","paddingCheckbox","paddingNone","alignLeft","alignCenter","alignRight","alignJustify","stickyHeader"]),WIe=["align","className","component","padding","scope","size","sortDirection","variant"],VIe=t=>{const{classes:e,variant:n,align:r,padding:i,size:o,stickyHeader:a}=t,s={root:["root",n,a&&"stickyHeader",r!=="inherit"&&`align${De(r)}`,i!=="normal"&&`padding${De(i)}`,`size${De(o)}`]};return Ue(s,zIe,e)},GIe=we("td",{name:"MuiTableCell",slot:"Root",overridesResolver:(t,e)=>{const{ownerState:n}=t;return[e.root,e[n.variant],e[`size${De(n.size)}`],n.padding!=="normal"&&e[`padding${De(n.padding)}`],n.align!=="inherit"&&e[`align${De(n.align)}`],n.stickyHeader&&e.stickyHeader]}})(({theme:t,ownerState:e})=>j({},t.typography.body2,{display:"table-cell",verticalAlign:"inherit",borderBottom:t.vars?`1px solid ${t.vars.palette.TableCell.border}`:`1px solid
    ${t.palette.mode==="light"?Rb(kt(t.palette.divider,1),.88):Ab(kt(t.palette.divider,1),.68)}`,textAlign:"left",padding:16},e.variant==="head"&&{color:(t.vars||t).palette.text.primary,lineHeight:t.typography.pxToRem(24),fontWeight:t.typography.fontWeightMedium},e.variant==="body"&&{color:(t.vars||t).palette.text.primary},e.variant==="footer"&&{color:(t.vars||t).palette.text.secondary,lineHeight:t.typography.pxToRem(21),fontSize:t.typography.pxToRem(12)},e.size==="small"&&{padding:"6px 16px",[`&.${UIe.paddingCheckbox}`]:{width:24,padding:"0 12px 0 16px","& > *":{padding:0}}},e.padding==="checkbox"&&{width:48,padding:"0 0 0 4px"},e.padding==="none"&&{padding:0},e.align==="left"&&{textAlign:"left"},e.align==="center"&&{textAlign:"center"},e.align==="right"&&{textAlign:"right",flexDirection:"row-reverse"},e.align==="justify"&&{textAlign:"justify"},e.stickyHeader&&{position:"sticky",top:0,zIndex:2,backgroundColor:(t.vars||t).palette.background.default})),sr=M.forwardRef(function(e,n){const r=qe({props:e,name:"MuiTableCell"}),{align:i="inherit",className:o,component:a,padding:s,scope:l,size:c,sortDirection:u,variant:f}=r,d=Ae(r,WIe),h=M.useContext(sie),p=M.useContext(t2),m=p&&p.variant==="head";let g;a?g=a:g=m?"th":"td";let v=l;g==="td"?v=void 0:!v&&m&&(v="col");const y=f||p&&p.variant,x=j({},r,{align:i,component:g,padding:s||(h&&h.padding?h.padding:"normal"),size:c||(h&&h.size?h.size:"medium"),sortDirection:u,stickyHeader:y==="head"&&h&&h.stickyHeader,variant:y}),b=VIe(x);let _=null;return u&&(_=u==="asc"?"ascending":"descending"),w.jsx(GIe,j({as:g,ref:n,className:ke(b.root,o),"aria-sort":_,scope:v,ownerState:x},d))});function HIe(t){return We("MuiTableContainer",t)}Ve("MuiTableContainer",["root"]);const qIe=["className","component"],XIe=t=>{const{classes:e}=t;return Ue({root:["root"]},HIe,e)},QIe=we("div",{name:"MuiTableContainer",slot:"Root",overridesResolver:(t,e)=>e.root})({width:"100%",overflowX:"auto"}),lie=M.forwardRef(function(e,n){const r=qe({props:e,name:"MuiTableContainer"}),{className:i,component:o="div"}=r,a=Ae(r,qIe),s=j({},r,{component:o}),l=XIe(s);return w.jsx(QIe,j({ref:n,as:o,className:ke(l.root,i),ownerState:s},a))});function YIe(t){return We("MuiTableHead",t)}Ve("MuiTableHead",["root"]);const KIe=["className","component"],ZIe=t=>{const{classes:e}=t;return Ue({root:["root"]},YIe,e)},JIe=we("thead",{name:"MuiTableHead",slot:"Root",overridesResolver:(t,e)=>e.root})({display:"table-header-group"}),eDe={variant:"head"},Q8="thead",tDe=M.forwardRef(function(e,n){const r=qe({props:e,name:"MuiTableHead"}),{className:i,component:o=Q8}=r,a=Ae(r,KIe),s=j({},r,{component:o}),l=ZIe(s);return w.jsx(t2.Provider,{value:eDe,children:w.jsx(JIe,j({as:o,className:ke(l.root,i),ref:n,role:o===Q8?null:"rowgroup",ownerState:s},a))})});function nDe(t){return We("MuiToolbar",t)}Ve("MuiToolbar",["root","gutters","regular","dense"]);const rDe=["className","component","disableGutters","variant"],iDe=t=>{const{classes:e,disableGutters:n,variant:r}=t;return Ue({root:["root",!n&&"gutters",r]},nDe,e)},oDe=we("div",{name:"MuiToolbar",slot:"Root",overridesResolver:(t,e)=>{const{ownerState:n}=t;return[e.root,!n.disableGutters&&e.gutters,e[n.variant]]}})(({theme:t,ownerState:e})=>j({position:"relative",display:"flex",alignItems:"center"},!e.disableGutters&&{paddingLeft:t.spacing(2),paddingRight:t.spacing(2),[t.breakpoints.up("sm")]:{paddingLeft:t.spacing(3),paddingRight:t.spacing(3)}},e.variant==="dense"&&{minHeight:48}),({theme:t,ownerState:e})=>e.variant==="regular"&&t.mixins.toolbar),n2=M.forwardRef(function(e,n){const r=qe({props:e,name:"MuiToolbar"}),{className:i,component:o="div",disableGutters:a=!1,variant:s="regular"}=r,l=Ae(r,rDe),c=j({},r,{component:o,disableGutters:a,variant:s}),u=iDe(c);return w.jsx(oDe,j({as:o,className:ke(u.root,i),ref:n,ownerState:c},l))}),aDe=ni(w.jsx("path",{d:"M15.41 16.09l-4.58-4.59 4.58-4.59L14 5.5l-6 6 6 6z"}),"KeyboardArrowLeft"),sDe=ni(w.jsx("path",{d:"M8.59 16.34l4.58-4.59-4.58-4.59L10 5.75l6 6-6 6z"}),"KeyboardArrowRight");function lDe(t){return We("MuiTableRow",t)}const Y8=Ve("MuiTableRow",["root","selected","hover","head","footer"]),cDe=["className","component","hover","selected"],uDe=t=>{const{classes:e,selected:n,hover:r,head:i,footer:o}=t;return Ue({root:["root",n&&"selected",r&&"hover",i&&"head",o&&"footer"]},lDe,e)},fDe=we("tr",{name:"MuiTableRow",slot:"Root",overridesResolver:(t,e)=>{const{ownerState:n}=t;return[e.root,n.head&&e.head,n.footer&&e.footer]}})(({theme:t})=>({color:"inherit",display:"table-row",verticalAlign:"middle",outline:0,[`&.${Y8.hover}:hover`]:{backgroundColor:(t.vars||t).palette.action.hover},[`&.${Y8.selected}`]:{backgroundColor:t.vars?`rgba(${t.vars.palette.primary.mainChannel} / ${t.vars.palette.action.selectedOpacity})`:kt(t.palette.primary.main,t.palette.action.selectedOpacity),"&:hover":{backgroundColor:t.vars?`rgba(${t.vars.palette.primary.mainChannel} / calc(${t.vars.palette.action.selectedOpacity} + ${t.vars.palette.action.hoverOpacity}))`:kt(t.palette.primary.main,t.palette.action.selectedOpacity+t.palette.action.hoverOpacity)}}})),K8="tr",vl=M.forwardRef(function(e,n){const r=qe({props:e,name:"MuiTableRow"}),{className:i,component:o=K8,hover:a=!1,selected:s=!1}=r,l=Ae(r,cDe),c=M.useContext(t2),u=j({},r,{component:o,hover:a,selected:s,head:c&&c.variant==="head",footer:c&&c.variant==="footer"}),f=uDe(u);return w.jsx(fDe,j({as:o,ref:n,className:ke(f.root,i),role:o===K8?null:"row",ownerState:u},l))});function dDe(t){return(1+Math.sin(Math.PI*t-Math.PI/2))/2}function hDe(t,e,n,r={},i=()=>{}){const{ease:o=dDe,duration:a=300}=r;let s=null;const l=e[t];let c=!1;const u=()=>{c=!0},f=d=>{if(c){i(new Error("Animation cancelled"));return}s===null&&(s=d);const h=Math.min(1,(d-s)/a);if(e[t]=o(h)*(n-l)+l,h>=1){requestAnimationFrame(()=>{i(null)});return}requestAnimationFrame(f)};return l===n?(i(new Error("Element already at target position")),u):(requestAnimationFrame(f),u)}const pDe=["onChange"],mDe={width:99,height:99,position:"absolute",top:-9999,overflow:"scroll"};function gDe(t){const{onChange:e}=t,n=Ae(t,pDe),r=M.useRef(),i=M.useRef(null),o=()=>{r.current=i.current.offsetHeight-i.current.clientHeight};return Hr(()=>{const a=Kv(()=>{const l=r.current;o(),l!==r.current&&e(r.current)}),s=cs(i.current);return s.addEventListener("resize",a),()=>{a.clear(),s.removeEventListener("resize",a)}},[e]),M.useEffect(()=>{o(),e(r.current)},[e]),w.jsx("div",j({style:mDe,ref:i},n))}function vDe(t){return We("MuiTabScrollButton",t)}const yDe=Ve("MuiTabScrollButton",["root","vertical","horizontal","disabled"]),xDe=["className","slots","slotProps","direction","orientation","disabled"],bDe=t=>{const{classes:e,orientation:n,disabled:r}=t;return Ue({root:["root",n,r&&"disabled"]},vDe,e)},_De=we(fs,{name:"MuiTabScrollButton",slot:"Root",overridesResolver:(t,e)=>{const{ownerState:n}=t;return[e.root,n.orientation&&e[n.orientation]]}})(({ownerState:t})=>j({width:40,flexShrink:0,opacity:.8,[`&.${yDe.disabled}`]:{opacity:0}},t.orientation==="vertical"&&{width:"100%",height:40,"& svg":{transform:`rotate(${t.isRtl?-90:90}deg)`}})),wDe=M.forwardRef(function(e,n){var r,i;const o=qe({props:e,name:"MuiTabScrollButton"}),{className:a,slots:s={},slotProps:l={},direction:c}=o,u=Ae(o,xDe),f=R1(),d=j({isRtl:f},o),h=bDe(d),p=(r=s.StartScrollButtonIcon)!=null?r:aDe,m=(i=s.EndScrollButtonIcon)!=null?i:sDe,g=$r({elementType:p,externalSlotProps:l.startScrollButtonIcon,additionalProps:{fontSize:"small"},ownerState:d}),v=$r({elementType:m,externalSlotProps:l.endScrollButtonIcon,additionalProps:{fontSize:"small"},ownerState:d});return w.jsx(_De,j({component:"div",className:ke(h.root,a),ref:n,role:null,ownerState:d,tabIndex:null},u,{children:c==="left"?w.jsx(p,j({},g)):w.jsx(m,j({},v))}))});function SDe(t){return We("MuiTabs",t)}const kC=Ve("MuiTabs",["root","vertical","flexContainer","flexContainerVertical","centered","scroller","fixed","scrollableX","scrollableY","hideScrollbar","scrollButtons","scrollButtonsHideMobile","indicator"]),ODe=["aria-label","aria-labelledby","action","centered","children","className","component","allowScrollButtonsMobile","indicatorColor","onChange","orientation","ScrollButtonComponent","scrollButtons","selectionFollowsFocus","slots","slotProps","TabIndicatorProps","TabScrollButtonProps","textColor","value","variant","visibleScrollbar"],Z8=(t,e)=>t===e?t.firstChild:e&&e.nextElementSibling?e.nextElementSibling:t.firstChild,J8=(t,e)=>t===e?t.lastChild:e&&e.previousElementSibling?e.previousElementSibling:t.lastChild,pS=(t,e,n)=>{let r=!1,i=n(t,e);for(;i;){if(i===t.firstChild){if(r)return;r=!0}const o=i.disabled||i.getAttribute("aria-disabled")==="true";if(!i.hasAttribute("tabindex")||o)i=n(t,i);else{i.focus();return}}},CDe=t=>{const{vertical:e,fixed:n,hideScrollbar:r,scrollableX:i,scrollableY:o,centered:a,scrollButtonsHideMobile:s,classes:l}=t;return Ue({root:["root",e&&"vertical"],scroller:["scroller",n&&"fixed",r&&"hideScrollbar",i&&"scrollableX",o&&"scrollableY"],flexContainer:["flexContainer",e&&"flexContainerVertical",a&&"centered"],indicator:["indicator"],scrollButtons:["scrollButtons",s&&"scrollButtonsHideMobile"],scrollableX:[i&&"scrollableX"],hideScrollbar:[r&&"hideScrollbar"]},SDe,l)},TDe=we("div",{name:"MuiTabs",slot:"Root",overridesResolver:(t,e)=>{const{ownerState:n}=t;return[{[`& .${kC.scrollButtons}`]:e.scrollButtons},{[`& .${kC.scrollButtons}`]:n.scrollButtonsHideMobile&&e.scrollButtonsHideMobile},e.root,n.vertical&&e.vertical]}})(({ownerState:t,theme:e})=>j({overflow:"hidden",minHeight:48,WebkitOverflowScrolling:"touch",display:"flex"},t.vertical&&{flexDirection:"column"},t.scrollButtonsHideMobile&&{[`& .${kC.scrollButtons}`]:{[e.breakpoints.down("sm")]:{display:"none"}}})),EDe=we("div",{name:"MuiTabs",slot:"Scroller",overridesResolver:(t,e)=>{const{ownerState:n}=t;return[e.scroller,n.fixed&&e.fixed,n.hideScrollbar&&e.hideScrollbar,n.scrollableX&&e.scrollableX,n.scrollableY&&e.scrollableY]}})(({ownerState:t})=>j({position:"relative",display:"inline-block",flex:"1 1 auto",whiteSpace:"nowrap"},t.fixed&&{overflowX:"hidden",width:"100%"},t.hideScrollbar&&{scrollbarWidth:"none","&::-webkit-scrollbar":{display:"none"}},t.scrollableX&&{overflowX:"auto",overflowY:"hidden"},t.scrollableY&&{overflowY:"auto",overflowX:"hidden"})),PDe=we("div",{name:"MuiTabs",slot:"FlexContainer",overridesResolver:(t,e)=>{const{ownerState:n}=t;return[e.flexContainer,n.vertical&&e.flexContainerVertical,n.centered&&e.centered]}})(({ownerState:t})=>j({display:"flex"},t.vertical&&{flexDirection:"column"},t.centered&&{justifyContent:"center"})),MDe=we("span",{name:"MuiTabs",slot:"Indicator",overridesResolver:(t,e)=>e.indicator})(({ownerState:t,theme:e})=>j({position:"absolute",height:2,bottom:0,width:"100%",transition:e.transitions.create()},t.indicatorColor==="primary"&&{backgroundColor:(e.vars||e).palette.primary.main},t.indicatorColor==="secondary"&&{backgroundColor:(e.vars||e).palette.secondary.main},t.vertical&&{height:"100%",width:2,right:0})),kDe=we(gDe)({overflowX:"auto",overflowY:"hidden",scrollbarWidth:"none","&::-webkit-scrollbar":{display:"none"}}),eG={},A5=M.forwardRef(function(e,n){const r=qe({props:e,name:"MuiTabs"}),i=Go(),o=R1(),{"aria-label":a,"aria-labelledby":s,action:l,centered:c=!1,children:u,className:f,component:d="div",allowScrollButtonsMobile:h=!1,indicatorColor:p="primary",onChange:m,orientation:g="horizontal",ScrollButtonComponent:v=wDe,scrollButtons:y="auto",selectionFollowsFocus:x,slots:b={},slotProps:_={},TabIndicatorProps:S={},TabScrollButtonProps:O={},textColor:C="primary",value:E,variant:k="standard",visibleScrollbar:I=!1}=r,P=Ae(r,ODe),R=k==="scrollable",T=g==="vertical",L=T?"scrollTop":"scrollLeft",z=T?"top":"left",B=T?"bottom":"right",U=T?"clientHeight":"clientWidth",W=T?"height":"width",$=j({},r,{component:d,allowScrollButtonsMobile:h,indicatorColor:p,orientation:g,vertical:T,scrollButtons:y,textColor:C,variant:k,visibleScrollbar:I,fixed:!R,hideScrollbar:R&&!I,scrollableX:R&&!T,scrollableY:R&&T,centered:c&&!R,scrollButtonsHideMobile:!h}),N=CDe($),D=$r({elementType:b.StartScrollButtonIcon,externalSlotProps:_.startScrollButtonIcon,ownerState:$}),A=$r({elementType:b.EndScrollButtonIcon,externalSlotProps:_.endScrollButtonIcon,ownerState:$}),[q,Y]=M.useState(!1),[K,se]=M.useState(eG),[te,J]=M.useState(!1),[pe,be]=M.useState(!1),[re,ve]=M.useState(!1),[F,ce]=M.useState({overflow:"hidden",scrollbarWidth:0}),le=new Map,Q=M.useRef(null),X=M.useRef(null),ee=()=>{const Te=Q.current;let Re;if(Te){const Le=Te.getBoundingClientRect();Re={clientWidth:Te.clientWidth,scrollLeft:Te.scrollLeft,scrollTop:Te.scrollTop,scrollLeftNormalized:NSe(Te,o?"rtl":"ltr"),scrollWidth:Te.scrollWidth,top:Le.top,bottom:Le.bottom,left:Le.left,right:Le.right}}let ae;if(Te&&E!==!1){const Le=X.current.children;if(Le.length>0){const Ee=Le[le.get(E)];ae=Ee?Ee.getBoundingClientRect():null}}return{tabsMeta:Re,tabMeta:ae}},ge=_r(()=>{const{tabsMeta:Te,tabMeta:Re}=ee();let ae=0,Le;if(T)Le="top",Re&&Te&&(ae=Re.top-Te.top+Te.scrollTop);else if(Le=o?"right":"left",Re&&Te){const ze=o?Te.scrollLeftNormalized+Te.clientWidth-Te.scrollWidth:Te.scrollLeft;ae=(o?-1:1)*(Re[Le]-Te[Le]+ze)}const Ee={[Le]:ae,[W]:Re?Re[W]:0};if(isNaN(K[Le])||isNaN(K[W]))se(Ee);else{const ze=Math.abs(K[Le]-Ee[Le]),He=Math.abs(K[W]-Ee[W]);(ze>=1||He>=1)&&se(Ee)}}),ye=(Te,{animation:Re=!0}={})=>{Re?hDe(L,Q.current,Te,{duration:i.transitions.duration.standard}):Q.current[L]=Te},H=Te=>{let Re=Q.current[L];T?Re+=Te:(Re+=Te*(o?-1:1),Re*=o&&rre()==="reverse"?-1:1),ye(Re)},G=()=>{const Te=Q.current[U];let Re=0;const ae=Array.from(X.current.children);for(let Le=0;Le<ae.length;Le+=1){const Ee=ae[Le];if(Re+Ee[U]>Te){Le===0&&(Re=Te);break}Re+=Ee[U]}return Re},ie=()=>{H(-1*G())},he=()=>{H(G())},_e=M.useCallback(Te=>{ce({overflow:null,scrollbarWidth:Te})},[]),oe=()=>{const Te={};Te.scrollbarSizeListener=R?w.jsx(kDe,{onChange:_e,className:ke(N.scrollableX,N.hideScrollbar)}):null;const ae=R&&(y==="auto"&&(te||pe)||y===!0);return Te.scrollButtonStart=ae?w.jsx(v,j({slots:{StartScrollButtonIcon:b.StartScrollButtonIcon},slotProps:{startScrollButtonIcon:D},orientation:g,direction:o?"right":"left",onClick:ie,disabled:!te},O,{className:ke(N.scrollButtons,O.className)})):null,Te.scrollButtonEnd=ae?w.jsx(v,j({slots:{EndScrollButtonIcon:b.EndScrollButtonIcon},slotProps:{endScrollButtonIcon:A},orientation:g,direction:o?"left":"right",onClick:he,disabled:!pe},O,{className:ke(N.scrollButtons,O.className)})):null,Te},Z=_r(Te=>{const{tabsMeta:Re,tabMeta:ae}=ee();if(!(!ae||!Re)){if(ae[z]<Re[z]){const Le=Re[L]+(ae[z]-Re[z]);ye(Le,{animation:Te})}else if(ae[B]>Re[B]){const Le=Re[L]+(ae[B]-Re[B]);ye(Le,{animation:Te})}}}),V=_r(()=>{R&&y!==!1&&ve(!re)});M.useEffect(()=>{const Te=Kv(()=>{Q.current&&ge()});let Re;const ae=ze=>{ze.forEach(He=>{He.removedNodes.forEach(xt=>{var Dt;(Dt=Re)==null||Dt.unobserve(xt)}),He.addedNodes.forEach(xt=>{var Dt;(Dt=Re)==null||Dt.observe(xt)})}),Te(),V()},Le=cs(Q.current);Le.addEventListener("resize",Te);let Ee;return typeof ResizeObserver<"u"&&(Re=new ResizeObserver(Te),Array.from(X.current.children).forEach(ze=>{Re.observe(ze)})),typeof MutationObserver<"u"&&(Ee=new MutationObserver(ae),Ee.observe(X.current,{childList:!0})),()=>{var ze,He;Te.clear(),Le.removeEventListener("resize",Te),(ze=Ee)==null||ze.disconnect(),(He=Re)==null||He.disconnect()}},[ge,V]),M.useEffect(()=>{const Te=Array.from(X.current.children),Re=Te.length;if(typeof IntersectionObserver<"u"&&Re>0&&R&&y!==!1){const ae=Te[0],Le=Te[Re-1],Ee={root:Q.current,threshold:.99},ze=nn=>{J(!nn[0].isIntersecting)},He=new IntersectionObserver(ze,Ee);He.observe(ae);const xt=nn=>{be(!nn[0].isIntersecting)},Dt=new IntersectionObserver(xt,Ee);return Dt.observe(Le),()=>{He.disconnect(),Dt.disconnect()}}},[R,y,re,u==null?void 0:u.length]),M.useEffect(()=>{Y(!0)},[]),M.useEffect(()=>{ge()}),M.useEffect(()=>{Z(eG!==K)},[Z,K]),M.useImperativeHandle(l,()=>({updateIndicator:ge,updateScrollButtons:V}),[ge,V]);const de=w.jsx(MDe,j({},S,{className:ke(N.indicator,S.className),ownerState:$,style:j({},K,S.style)}));let xe=0;const Me=M.Children.map(u,Te=>{if(!M.isValidElement(Te))return null;const Re=Te.props.value===void 0?xe:Te.props.value;le.set(Re,xe);const ae=Re===E;return xe+=1,M.cloneElement(Te,j({fullWidth:k==="fullWidth",indicator:ae&&!q&&de,selected:ae,selectionFollowsFocus:x,onChange:m,textColor:C,value:Re},xe===1&&E===!1&&!Te.props.tabIndex?{tabIndex:0}:{}))}),me=Te=>{const Re=X.current,ae=$n(Re).activeElement;if(ae.getAttribute("role")!=="tab")return;let Ee=g==="horizontal"?"ArrowLeft":"ArrowUp",ze=g==="horizontal"?"ArrowRight":"ArrowDown";switch(g==="horizontal"&&o&&(Ee="ArrowRight",ze="ArrowLeft"),Te.key){case Ee:Te.preventDefault(),pS(Re,ae,J8);break;case ze:Te.preventDefault(),pS(Re,ae,Z8);break;case"Home":Te.preventDefault(),pS(Re,null,Z8);break;case"End":Te.preventDefault(),pS(Re,null,J8);break}},$e=oe();return w.jsxs(TDe,j({className:ke(N.root,f),ownerState:$,ref:n,as:d},P,{children:[$e.scrollButtonStart,$e.scrollbarSizeListener,w.jsxs(EDe,{className:N.scroller,ownerState:$,style:{overflow:F.overflow,[T?`margin${o?"Left":"Right"}`:"marginBottom"]:I?void 0:-F.scrollbarWidth},ref:Q,children:[w.jsx(PDe,{"aria-label":a,"aria-labelledby":s,"aria-orientation":g==="vertical"?"vertical":null,className:N.flexContainer,ownerState:$,onKeyDown:me,ref:X,role:"tablist",children:Me}),q&&de]}),$e.scrollButtonEnd]}))});function ADe(t){return We("MuiTextField",t)}Ve("MuiTextField",["root"]);const RDe=["autoComplete","autoFocus","children","className","color","defaultValue","disabled","error","FormHelperTextProps","fullWidth","helperText","id","InputLabelProps","inputProps","InputProps","inputRef","label","maxRows","minRows","multiline","name","onBlur","onChange","onFocus","placeholder","required","rows","select","SelectProps","type","value","variant"],IDe={standard:yd,filled:O5,outlined:T5},DDe=t=>{const{classes:e}=t;return Ue({root:["root"]},ADe,e)},LDe=we(ty,{name:"MuiTextField",slot:"Root",overridesResolver:(t,e)=>e.root})({}),cr=M.forwardRef(function(e,n){const r=qe({props:e,name:"MuiTextField"}),{autoComplete:i,autoFocus:o=!1,children:a,className:s,color:l="primary",defaultValue:c,disabled:u=!1,error:f=!1,FormHelperTextProps:d,fullWidth:h=!1,helperText:p,id:m,InputLabelProps:g,inputProps:v,InputProps:y,inputRef:x,label:b,maxRows:_,minRows:S,multiline:O=!1,name:C,onBlur:E,onChange:k,onFocus:I,placeholder:P,required:R=!1,rows:T,select:L=!1,SelectProps:z,type:B,value:U,variant:W="outlined"}=r,$=Ae(r,RDe),N=j({},r,{autoFocus:o,color:l,disabled:u,error:f,fullWidth:h,multiline:O,required:R,select:L,variant:W}),D=DDe(N),A={};W==="outlined"&&(g&&typeof g.shrink<"u"&&(A.notched=g.shrink),A.label=b),L&&((!z||!z.native)&&(A.id=void 0),A["aria-describedby"]=void 0);const q=pd(m),Y=p&&q?`${q}-helper-text`:void 0,K=b&&q?`${q}-label`:void 0,se=IDe[W],te=w.jsx(se,j({"aria-describedby":Y,autoComplete:i,autoFocus:o,defaultValue:c,fullWidth:h,multiline:O,name:C,rows:T,maxRows:_,minRows:S,type:B,value:U,id:q,inputRef:x,onBlur:E,onChange:k,onFocus:I,placeholder:P,inputProps:v},A,y));return w.jsxs(LDe,j({className:ke(D.root,s),disabled:u,error:f,fullWidth:h,ref:n,required:R,color:l,variant:W,ownerState:N},$,{children:[b!=null&&b!==""&&w.jsx(ny,j({htmlFor:q,id:K},g,{children:b})),L?w.jsx(xd,j({"aria-describedby":Y,id:q,labelId:K,value:U,input:te},z,{children:a})):te,p&&w.jsx(qre,j({id:Y},d,{children:p}))]}))});function NDe(t){return We("MuiToggleButton",t)}const Jm=Ve("MuiToggleButton",["root","disabled","selected","standard","primary","secondary","sizeSmall","sizeMedium","sizeLarge","fullWidth"]),cie=M.createContext({}),uie=M.createContext(void 0);function $De(t,e){return e===void 0||t===void 0?!1:Array.isArray(e)?e.indexOf(t)>=0:t===e}const FDe=["value"],jDe=["children","className","color","disabled","disableFocusRipple","fullWidth","onChange","onClick","selected","size","value"],BDe=t=>{const{classes:e,fullWidth:n,selected:r,disabled:i,size:o,color:a}=t,s={root:["root",r&&"selected",i&&"disabled",n&&"fullWidth",`size${De(o)}`,a]};return Ue(s,NDe,e)},zDe=we(fs,{name:"MuiToggleButton",slot:"Root",overridesResolver:(t,e)=>{const{ownerState:n}=t;return[e.root,e[`size${De(n.size)}`]]}})(({theme:t,ownerState:e})=>{let n=e.color==="standard"?t.palette.text.primary:t.palette[e.color].main,r;return t.vars&&(n=e.color==="standard"?t.vars.palette.text.primary:t.vars.palette[e.color].main,r=e.color==="standard"?t.vars.palette.text.primaryChannel:t.vars.palette[e.color].mainChannel),j({},t.typography.button,{borderRadius:(t.vars||t).shape.borderRadius,padding:11,border:`1px solid ${(t.vars||t).palette.divider}`,color:(t.vars||t).palette.action.active},e.fullWidth&&{width:"100%"},{[`&.${Jm.disabled}`]:{color:(t.vars||t).palette.action.disabled,border:`1px solid ${(t.vars||t).palette.action.disabledBackground}`},"&:hover":{textDecoration:"none",backgroundColor:t.vars?`rgba(${t.vars.palette.text.primaryChannel} / ${t.vars.palette.action.hoverOpacity})`:Hc(t.palette.text.primary,t.palette.action.hoverOpacity),"@media (hover: none)":{backgroundColor:"transparent"}},[`&.${Jm.selected}`]:{color:n,backgroundColor:t.vars?`rgba(${r} / ${t.vars.palette.action.selectedOpacity})`:Hc(n,t.palette.action.selectedOpacity),"&:hover":{backgroundColor:t.vars?`rgba(${r} / calc(${t.vars.palette.action.selectedOpacity} + ${t.vars.palette.action.hoverOpacity}))`:Hc(n,t.palette.action.selectedOpacity+t.palette.action.hoverOpacity),"@media (hover: none)":{backgroundColor:t.vars?`rgba(${r} / ${t.vars.palette.action.selectedOpacity})`:Hc(n,t.palette.action.selectedOpacity)}}}},e.size==="small"&&{padding:7,fontSize:t.typography.pxToRem(13)},e.size==="large"&&{padding:15,fontSize:t.typography.pxToRem(15)})}),Pn=M.forwardRef(function(e,n){const r=M.useContext(cie),{value:i}=r,o=Ae(r,FDe),a=M.useContext(uie),s=kM(j({},o,{selected:$De(e.value,i)}),e),l=qe({props:s,name:"MuiToggleButton"}),{children:c,className:u,color:f="standard",disabled:d=!1,disableFocusRipple:h=!1,fullWidth:p=!1,onChange:m,onClick:g,selected:v,size:y="medium",value:x}=l,b=Ae(l,jDe),_=j({},l,{color:f,disabled:d,disableFocusRipple:h,fullWidth:p,size:y}),S=BDe(_),O=E=>{g&&(g(E,x),E.defaultPrevented)||m&&m(E,x)},C=a||"";return w.jsx(zDe,j({className:ke(o.className,S.root,u,C),disabled:d,focusRipple:!h,ref:n,onClick:O,onChange:m,value:x,ownerState:_,"aria-pressed":v},b,{children:c}))});function UDe(t){return We("MuiToggleButtonGroup",t)}const ar=Ve("MuiToggleButtonGroup",["root","selected","horizontal","vertical","disabled","grouped","groupedHorizontal","groupedVertical","fullWidth","firstButton","lastButton","middleButton"]),WDe=["children","className","color","disabled","exclusive","fullWidth","onChange","orientation","size","value"],VDe=t=>{const{classes:e,orientation:n,fullWidth:r,disabled:i}=t,o={root:["root",n==="vertical"&&"vertical",r&&"fullWidth"],grouped:["grouped",`grouped${De(n)}`,i&&"disabled"],firstButton:["firstButton"],lastButton:["lastButton"],middleButton:["middleButton"]};return Ue(o,UDe,e)},GDe=we("div",{name:"MuiToggleButtonGroup",slot:"Root",overridesResolver:(t,e)=>{const{ownerState:n}=t;return[{[`& .${ar.grouped}`]:e.grouped},{[`& .${ar.grouped}`]:e[`grouped${De(n.orientation)}`]},{[`& .${ar.firstButton}`]:e.firstButton},{[`& .${ar.lastButton}`]:e.lastButton},{[`& .${ar.middleButton}`]:e.middleButton},e.root,n.orientation==="vertical"&&e.vertical,n.fullWidth&&e.fullWidth]}})(({ownerState:t,theme:e})=>j({display:"inline-flex",borderRadius:(e.vars||e).shape.borderRadius},t.orientation==="vertical"&&{flexDirection:"column"},t.fullWidth&&{width:"100%"},{[`& .${ar.grouped}`]:j({},t.orientation==="horizontal"?{[`&.${ar.selected} + .${ar.grouped}.${ar.selected}`]:{borderLeft:0,marginLeft:0}}:{[`&.${ar.selected} + .${ar.grouped}.${ar.selected}`]:{borderTop:0,marginTop:0}})},t.orientation==="horizontal"?{[`& .${ar.firstButton},& .${ar.middleButton}`]:{borderTopRightRadius:0,borderBottomRightRadius:0},[`& .${ar.lastButton},& .${ar.middleButton}`]:{marginLeft:-1,borderLeft:"1px solid transparent",borderTopLeftRadius:0,borderBottomLeftRadius:0}}:{[`& .${ar.firstButton},& .${ar.middleButton}`]:{borderBottomLeftRadius:0,borderBottomRightRadius:0},[`& .${ar.lastButton},& .${ar.middleButton}`]:{marginTop:-1,borderTop:"1px solid transparent",borderTopLeftRadius:0,borderTopRightRadius:0}},t.orientation==="horizontal"?{[`& .${ar.lastButton}.${Jm.disabled},& .${ar.middleButton}.${Jm.disabled}`]:{borderLeft:"1px solid transparent"}}:{[`& .${ar.lastButton}.${Jm.disabled},& .${ar.middleButton}.${Jm.disabled}`]:{borderTop:"1px solid transparent"}})),iy=M.forwardRef(function(e,n){const r=qe({props:e,name:"MuiToggleButtonGroup"}),{children:i,className:o,color:a="standard",disabled:s=!1,exclusive:l=!1,fullWidth:c=!1,onChange:u,orientation:f="horizontal",size:d="medium",value:h}=r,p=Ae(r,WDe),m=j({},r,{disabled:s,fullWidth:c,orientation:f,size:d}),g=VDe(m),v=M.useCallback((O,C)=>{if(!u)return;const E=h&&h.indexOf(C);let k;h&&E>=0?(k=h.slice(),k.splice(E,1)):k=h?h.concat(C):[C],u(O,k)},[u,h]),y=M.useCallback((O,C)=>{u&&u(O,h===C?null:C)},[u,h]),x=M.useMemo(()=>({className:g.grouped,onChange:l?y:v,value:h,size:d,fullWidth:c,color:a,disabled:s}),[g.grouped,l,y,v,h,d,c,a,s]),b=$Se(i),_=b.length,S=O=>{const C=O===0,E=O===_-1;return C&&E?"":C?g.firstButton:E?g.lastButton:g.middleButton};return w.jsx(GDe,j({role:"group",className:ke(g.root,o),ref:n,ownerState:m},p,{children:w.jsx(cie.Provider,{value:x,children:b.map((O,C)=>w.jsx(uie.Provider,{value:S(C),children:O},C))})}))}),HDe="default",qDe={id:"local",name:"Local Server",url:"http://localhost:8080"},XDe={appBarTitle:"xcube Viewer",windowTitle:"xcube Viewer",windowIcon:null,compact:!1,themeName:"light",primaryColor:"blue",secondaryColor:"pink",organisationUrl:"https://xcube.readthedocs.io/",logoImage:"images/logo.png",logoWidth:32,baseMapUrl:"https://services.arcgisonline.com/arcgis/rest/services/World_Imagery/MapServer/tile/{z}/{y}/{x}",defaultAgg:"mean",polygonFillOpacity:.2,mapProjection:"EPSG:3857",allowDownloads:!0,allowRefresh:!0,allowUserVariables:!0,allow3D:!0},mS={name:HDe,server:qDe,branding:XDe};function QDe(){const t=new URL(window.location.href),e=t.pathname.split("/"),n=e.length;return n>0?e[n-1]==="index.html"?new URL(e.slice(0,n-1).join("/"),window.location.origin):new URL(t.pathname,window.location.origin):new URL(window.location.origin)}const r2=QDe();console.log("baseUrl = ",r2.href);function fie(t,...e){let n=t;for(const r of e)r!==""&&(n.endsWith("/")?r.startsWith("/")?n+=r.substring(1):n+=r:r.startsWith("/")?n+=r:n+="/"+r);return n}const YDe={amber:vne,blue:rf,blueGrey:e1e,brown:yne,cyan:hne,deepOrange:Dh,deepPurple:Z_e,green:Lc,grey:xne,indigo:dne,lightBlue:of,lightGreen:J_e,lime:mne,orange:oh,pink:fne,purple:nf,red:tf,teal:pne,yellow:gne};function tG(t,e){const n=t[e];let r=null;if(typeof n=="string"?(r=YDe[n]||null,r===null&&n.startsWith("#")&&(n.length===7||n.length===9)&&(r={main:n})):typeof n=="object"&&n!==null&&"main"in n&&(r=n),r!==null)t[e]=r;else throw new Error(`Value of branding.${e} is invalid: ${n}`)}function KDe(t,e,n){const r=t[e];typeof r=="string"&&(t[e]=fie(r2.href,n,r))}function ZDe(t,e){return t={...t},tG(t,"primaryColor"),tG(t,"secondaryColor"),KDe(t,"logoImage",e),t}function En(t){return typeof t=="number"}function Mp(t){return typeof t=="string"}function JDe(t){return typeof t=="function"}function nG(t){return t!==null&&typeof t=="object"&&t.constructor===Object}const hf=new URLSearchParams(window.location.search),$s=class $s{constructor(e,n,r,i){Yt(this,"name");Yt(this,"server");Yt(this,"branding");Yt(this,"authClient");this.name=e,this.server=n,this.branding=r,this.authClient=i}static async load(){let e=hf.get("configPath")||"config";const n=await this.loadRawConfig(e);n===mS&&(e="");const r=n.name||"default",i=this.getAuthConfig(n),o=this.getServerConfig(n),a=parseInt(hf.get("compact")||"0")!==0;let s=ZDe({...mS.branding,...n.branding,compact:a||n.branding.compact},e);return s=iG(s,"allowUserVariables"),s=iG(s,"allow3D"),$s._instance=new $s(r,o,s,i),s.windowTitle&&this.changeWindowTitle(s.windowTitle),s.windowIcon&&this.changeWindowIcon(s.windowIcon),$s._instance}static getAuthConfig(e){let n=e.authClient&&{...e.authClient};const r=$s.getAuthClientFromEnv();if(!n&&r.authority&&r.clientId&&(n={authority:r.authority,client_id:r.clientId}),n){if(r.authority){const i=r.authority;n={...n,authority:i}}if(r.clientId){const i=r.clientId;n={...n,client_id:i}}if(r.audience){const i=r.audience,o=n.extraQueryParams;n={...n,extraQueryParams:{...o,audience:i}}}}return n}static getServerConfig(e){const n={...mS.server,...e.server},r=$s.getApiServerFromEnv();return n.id=hf.get("serverId")||r.id||n.id,n.name=hf.get("serverName")||r.name||n.name,n.url=hf.get("serverUrl")||r.url||n.url,n}static async loadRawConfig(e){let n=null,r=null;const i=fie(r2.href,e,"config.json");try{const o=await fetch(i);if(o.ok)n=await o.json();else{const{status:a,statusText:s}=o;r=`HTTP status ${a}`,s&&(r+=` (${s})`)}}catch(o){n=null,r=`${o}`}return n===null&&(n=mS),n}static get instance(){return $s.assertConfigLoaded(),$s._instance}static assertConfigLoaded(){if(!$s._instance)throw new Error("internal error: configuration not available yet")}static changeWindowTitle(e){document.title=e}static changeWindowIcon(e){let n=document.querySelector('link[rel="icon"]');n!==null?n.href=e:(n=document.createElement("link"),n.rel="icon",n.href=e,document.head.appendChild(n))}static getAuthClientFromEnv(){return{authority:void 0,clientId:void 0,audience:void 0}}static getApiServerFromEnv(){return{id:void 0,name:void 0,url:void 0}}};Yt($s,"_instance");let Kt=$s;const R5=[["red",tf],["yellow",gne],["blue",rf],["pink",fne],["lightBlue",of],["green",Lc],["orange",oh],["lime",mne],["purple",nf],["indigo",dne],["cyan",hne],["brown",yne],["teal",pne]],eLe=(()=>{const t={};return R5.forEach(([e,n])=>{t[e]=n}),t})(),rG=R5.map(([t,e])=>t);function tLe(t){return t==="light"?800:400}function tp(t){return rG[t%rG.length]}function die(t,e){const n=tLe(e);return eLe[t][n]}function I5(t){return En(t)||(t=Kt.instance.branding.polygonFillOpacity),En(t)?t:.25}const nLe={Mapbox:{param:"access_token",token:"pk.eyJ1IjoiZm9ybWFuIiwiYSI6ImNrM2JranV0bDBtenczb2szZG84djh6bWUifQ.q0UKwf4CWt5fcQwIDwF8Bg"}};function rLe(t){return nLe[t]}function iG(t,e){const n=hf.get(e),r=n?!!parseInt(n):!!t[e];return{...t,[e]:r}}function cx(t){throw new Error('Could not dynamically require "'+t+'". Please configure the dynamicRequireTargets or/and ignoreDynamicRequires option of @rollup/plugin-commonjs appropriately for this require call to work.')}var RA={exports:{}};const iLe={},oLe=Object.freeze(Object.defineProperty({__proto__:null,default:iLe},Symbol.toStringTag,{value:"Module"})),aLe=Ea(oLe);var oG;function i2(){return oG||(oG=1,function(t,e){(function(n,r){t.exports=r()})(Zn,function(){var n=n||function(r,i){var o;if(typeof window<"u"&&window.crypto&&(o=window.crypto),typeof self<"u"&&self.crypto&&(o=self.crypto),typeof globalThis<"u"&&globalThis.crypto&&(o=globalThis.crypto),!o&&typeof window<"u"&&window.msCrypto&&(o=window.msCrypto),!o&&typeof Zn<"u"&&Zn.crypto&&(o=Zn.crypto),!o&&typeof cx=="function")try{o=aLe}catch{}var a=function(){if(o){if(typeof o.getRandomValues=="function")try{return o.getRandomValues(new Uint32Array(1))[0]}catch{}if(typeof o.randomBytes=="function")try{return o.randomBytes(4).readInt32LE()}catch{}}throw new Error("Native crypto module could not be used to get secure random number.")},s=Object.create||function(){function y(){}return function(x){var b;return y.prototype=x,b=new y,y.prototype=null,b}}(),l={},c=l.lib={},u=c.Base=function(){return{extend:function(y){var x=s(this);return y&&x.mixIn(y),(!x.hasOwnProperty("init")||this.init===x.init)&&(x.init=function(){x.$super.init.apply(this,arguments)}),x.init.prototype=x,x.$super=this,x},create:function(){var y=this.extend();return y.init.apply(y,arguments),y},init:function(){},mixIn:function(y){for(var x in y)y.hasOwnProperty(x)&&(this[x]=y[x]);y.hasOwnProperty("toString")&&(this.toString=y.toString)},clone:function(){return this.init.prototype.extend(this)}}}(),f=c.WordArray=u.extend({init:function(y,x){y=this.words=y||[],x!=i?this.sigBytes=x:this.sigBytes=y.length*4},toString:function(y){return(y||h).stringify(this)},concat:function(y){var x=this.words,b=y.words,_=this.sigBytes,S=y.sigBytes;if(this.clamp(),_%4)for(var O=0;O<S;O++){var C=b[O>>>2]>>>24-O%4*8&255;x[_+O>>>2]|=C<<24-(_+O)%4*8}else for(var E=0;E<S;E+=4)x[_+E>>>2]=b[E>>>2];return this.sigBytes+=S,this},clamp:function(){var y=this.words,x=this.sigBytes;y[x>>>2]&=4294967295<<32-x%4*8,y.length=r.ceil(x/4)},clone:function(){var y=u.clone.call(this);return y.words=this.words.slice(0),y},random:function(y){for(var x=[],b=0;b<y;b+=4)x.push(a());return new f.init(x,y)}}),d=l.enc={},h=d.Hex={stringify:function(y){for(var x=y.words,b=y.sigBytes,_=[],S=0;S<b;S++){var O=x[S>>>2]>>>24-S%4*8&255;_.push((O>>>4).toString(16)),_.push((O&15).toString(16))}return _.join("")},parse:function(y){for(var x=y.length,b=[],_=0;_<x;_+=2)b[_>>>3]|=parseInt(y.substr(_,2),16)<<24-_%8*4;return new f.init(b,x/2)}},p=d.Latin1={stringify:function(y){for(var x=y.words,b=y.sigBytes,_=[],S=0;S<b;S++){var O=x[S>>>2]>>>24-S%4*8&255;_.push(String.fromCharCode(O))}return _.join("")},parse:function(y){for(var x=y.length,b=[],_=0;_<x;_++)b[_>>>2]|=(y.charCodeAt(_)&255)<<24-_%4*8;return new f.init(b,x)}},m=d.Utf8={stringify:function(y){try{return decodeURIComponent(escape(p.stringify(y)))}catch{throw new Error("Malformed UTF-8 data")}},parse:function(y){return p.parse(unescape(encodeURIComponent(y)))}},g=c.BufferedBlockAlgorithm=u.extend({reset:function(){this._data=new f.init,this._nDataBytes=0},_append:function(y){typeof y=="string"&&(y=m.parse(y)),this._data.concat(y),this._nDataBytes+=y.sigBytes},_process:function(y){var x,b=this._data,_=b.words,S=b.sigBytes,O=this.blockSize,C=O*4,E=S/C;y?E=r.ceil(E):E=r.max((E|0)-this._minBufferSize,0);var k=E*O,I=r.min(k*4,S);if(k){for(var P=0;P<k;P+=O)this._doProcessBlock(_,P);x=_.splice(0,k),b.sigBytes-=I}return new f.init(x,I)},clone:function(){var y=u.clone.call(this);return y._data=this._data.clone(),y},_minBufferSize:0});c.Hasher=g.extend({cfg:u.extend(),init:function(y){this.cfg=this.cfg.extend(y),this.reset()},reset:function(){g.reset.call(this),this._doReset()},update:function(y){return this._append(y),this._process(),this},finalize:function(y){y&&this._append(y);var x=this._doFinalize();return x},blockSize:16,_createHelper:function(y){return function(x,b){return new y.init(b).finalize(x)}},_createHmacHelper:function(y){return function(x,b){return new v.HMAC.init(y,b).finalize(x)}}});var v=l.algo={};return l}(Math);return n})}(RA)),RA.exports}var sLe=i2();const lLe=$t(sLe);var hie={exports:{}};(function(t,e){(function(n,r){t.exports=r(i2())})(Zn,function(n){return function(r){var i=n,o=i.lib,a=o.WordArray,s=o.Hasher,l=i.algo,c=[],u=[];(function(){function h(v){for(var y=r.sqrt(v),x=2;x<=y;x++)if(!(v%x))return!1;return!0}function p(v){return(v-(v|0))*4294967296|0}for(var m=2,g=0;g<64;)h(m)&&(g<8&&(c[g]=p(r.pow(m,1/2))),u[g]=p(r.pow(m,1/3)),g++),m++})();var f=[],d=l.SHA256=s.extend({_doReset:function(){this._hash=new a.init(c.slice(0))},_doProcessBlock:function(h,p){for(var m=this._hash.words,g=m[0],v=m[1],y=m[2],x=m[3],b=m[4],_=m[5],S=m[6],O=m[7],C=0;C<64;C++){if(C<16)f[C]=h[p+C]|0;else{var E=f[C-15],k=(E<<25|E>>>7)^(E<<14|E>>>18)^E>>>3,I=f[C-2],P=(I<<15|I>>>17)^(I<<13|I>>>19)^I>>>10;f[C]=k+f[C-7]+P+f[C-16]}var R=b&_^~b&S,T=g&v^g&y^v&y,L=(g<<30|g>>>2)^(g<<19|g>>>13)^(g<<10|g>>>22),z=(b<<26|b>>>6)^(b<<21|b>>>11)^(b<<7|b>>>25),B=O+z+R+u[C]+f[C],U=L+T;O=S,S=_,_=b,b=x+B|0,x=y,y=v,v=g,g=B+U|0}m[0]=m[0]+g|0,m[1]=m[1]+v|0,m[2]=m[2]+y|0,m[3]=m[3]+x|0,m[4]=m[4]+b|0,m[5]=m[5]+_|0,m[6]=m[6]+S|0,m[7]=m[7]+O|0},_doFinalize:function(){var h=this._data,p=h.words,m=this._nDataBytes*8,g=h.sigBytes*8;return p[g>>>5]|=128<<24-g%32,p[(g+64>>>9<<4)+14]=r.floor(m/4294967296),p[(g+64>>>9<<4)+15]=m,h.sigBytes=p.length*4,this._process(),this._hash},clone:function(){var h=s.clone.call(this);return h._hash=this._hash.clone(),h}});i.SHA256=s._createHelper(d),i.HmacSHA256=s._createHmacHelper(d)}(Math),n.SHA256})})(hie);var cLe=hie.exports;const uLe=$t(cLe);var pie={exports:{}};(function(t,e){(function(n,r){t.exports=r(i2())})(Zn,function(n){return function(){var r=n,i=r.lib,o=i.WordArray,a=r.enc;a.Base64={stringify:function(l){var c=l.words,u=l.sigBytes,f=this._map;l.clamp();for(var d=[],h=0;h<u;h+=3)for(var p=c[h>>>2]>>>24-h%4*8&255,m=c[h+1>>>2]>>>24-(h+1)%4*8&255,g=c[h+2>>>2]>>>24-(h+2)%4*8&255,v=p<<16|m<<8|g,y=0;y<4&&h+y*.75<u;y++)d.push(f.charAt(v>>>6*(3-y)&63));var x=f.charAt(64);if(x)for(;d.length%4;)d.push(x);return d.join("")},parse:function(l){var c=l.length,u=this._map,f=this._reverseMap;if(!f){f=this._reverseMap=[];for(var d=0;d<u.length;d++)f[u.charCodeAt(d)]=d}var h=u.charAt(64);if(h){var p=l.indexOf(h);p!==-1&&(c=p)}return s(l,c,f)},_map:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/="};function s(l,c,u){for(var f=[],d=0,h=0;h<c;h++)if(h%4){var p=u[l.charCodeAt(h-1)]<<h%4*2,m=u[l.charCodeAt(h)]>>>6-h%4*2,g=p|m;f[d>>>2]|=g<<24-d%4*8,d++}return o.create(f,d)}}(),n.enc.Base64})})(pie);var fLe=pie.exports;const aG=$t(fLe);var mie={exports:{}};(function(t,e){(function(n,r){t.exports=r(i2())})(Zn,function(n){return n.enc.Utf8})})(mie);var dLe=mie.exports;const hLe=$t(dLe);function VL(t){this.message=t}VL.prototype=new Error,VL.prototype.name="InvalidCharacterError";var sG=typeof window<"u"&&window.atob&&window.atob.bind(window)||function(t){var e=String(t).replace(/=+$/,"");if(e.length%4==1)throw new VL("'atob' failed: The string to be decoded is not correctly encoded.");for(var n,r,i=0,o=0,a="";r=e.charAt(o++);~r&&(n=i%4?64*n+r:r,i++%4)?a+=String.fromCharCode(255&n>>(-2*i&6)):0)r="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=".indexOf(r);return a};function pLe(t){var e=t.replace(/-/g,"+").replace(/_/g,"/");switch(e.length%4){case 0:break;case 2:e+="==";break;case 3:e+="=";break;default:throw"Illegal base64url string!"}try{return function(n){return decodeURIComponent(sG(n).replace(/(.)/g,function(r,i){var o=i.charCodeAt(0).toString(16).toUpperCase();return o.length<2&&(o="0"+o),"%"+o}))}(e)}catch{return sG(e)}}function IT(t){this.message=t}function mLe(t,e){if(typeof t!="string")throw new IT("Invalid token specified");var n=(e=e||{}).header===!0?0:1;try{return JSON.parse(pLe(t.split(".")[n]))}catch(r){throw new IT("Invalid token specified: "+r.message)}}IT.prototype=new Error,IT.prototype.name="InvalidTokenError";var gLe={debug:()=>{},info:()=>{},warn:()=>{},error:()=>{}},pl,ml,DT=(t=>(t[t.NONE=0]="NONE",t[t.ERROR=1]="ERROR",t[t.WARN=2]="WARN",t[t.INFO=3]="INFO",t[t.DEBUG=4]="DEBUG",t))(DT||{});(t=>{function e(){pl=3,ml=gLe}t.reset=e;function n(i){if(!(0<=i&&i<=4))throw new Error("Invalid log level");pl=i}t.setLevel=n;function r(i){ml=i}t.setLogger=r})(DT||(DT={}));var It=class{constructor(t){this._name=t}debug(...t){pl>=4&&ml.debug(It._format(this._name,this._method),...t)}info(...t){pl>=3&&ml.info(It._format(this._name,this._method),...t)}warn(...t){pl>=2&&ml.warn(It._format(this._name,this._method),...t)}error(...t){pl>=1&&ml.error(It._format(this._name,this._method),...t)}throw(t){throw this.error(t),t}create(t){const e=Object.create(this);return e._method=t,e.debug("begin"),e}static createStatic(t,e){const n=new It(`${t}.${e}`);return n.debug("begin"),n}static _format(t,e){const n=`[${t}]`;return e?`${n} ${e}:`:n}static debug(t,...e){pl>=4&&ml.debug(It._format(t),...e)}static info(t,...e){pl>=3&&ml.info(It._format(t),...e)}static warn(t,...e){pl>=2&&ml.warn(It._format(t),...e)}static error(t,...e){pl>=1&&ml.error(It._format(t),...e)}};DT.reset();var vLe="10000000-1000-4000-8000-100000000000",Al=class{static _randomWord(){return lLe.lib.WordArray.random(1).words[0]}static generateUUIDv4(){return vLe.replace(/[018]/g,e=>(+e^Al._randomWord()&15>>+e/4).toString(16)).replace(/-/g,"")}static generateCodeVerifier(){return Al.generateUUIDv4()+Al.generateUUIDv4()+Al.generateUUIDv4()}static generateCodeChallenge(t){try{const e=uLe(t);return aG.stringify(e).replace(/\+/g,"-").replace(/\//g,"_").replace(/=+$/,"")}catch(e){throw It.error("CryptoUtils.generateCodeChallenge",e),e}}static generateBasicAuth(t,e){const n=hLe.parse([t,e].join(":"));return aG.stringify(n)}},af=class{constructor(t){this._name=t,this._logger=new It(`Event('${this._name}')`),this._callbacks=[]}addHandler(t){return this._callbacks.push(t),()=>this.removeHandler(t)}removeHandler(t){const e=this._callbacks.lastIndexOf(t);e>=0&&this._callbacks.splice(e,1)}raise(...t){this._logger.debug("raise:",...t);for(const e of this._callbacks)e(...t)}},GL=class{static decode(t){try{return mLe(t)}catch(e){throw It.error("JwtUtils.decode",e),e}}},lG=class{static center({...t}){var e,n,r;return t.width==null&&(t.width=(e=[800,720,600,480].find(i=>i<=window.outerWidth/1.618))!=null?e:360),(n=t.left)!=null||(t.left=Math.max(0,Math.round(window.screenX+(window.outerWidth-t.width)/2))),t.height!=null&&((r=t.top)!=null||(t.top=Math.max(0,Math.round(window.screenY+(window.outerHeight-t.height)/2)))),t}static serialize(t){return Object.entries(t).filter(([,e])=>e!=null).map(([e,n])=>`${e}=${typeof n!="boolean"?n:n?"yes":"no"}`).join(",")}},ns=class extends af{constructor(){super(...arguments),this._logger=new It(`Timer('${this._name}')`),this._timerHandle=null,this._expiration=0,this._callback=()=>{const t=this._expiration-ns.getEpochTime();this._logger.debug("timer completes in",t),this._expiration<=ns.getEpochTime()&&(this.cancel(),super.raise())}}static getEpochTime(){return Math.floor(Date.now()/1e3)}init(t){const e=this._logger.create("init");t=Math.max(Math.floor(t),1);const n=ns.getEpochTime()+t;if(this.expiration===n&&this._timerHandle){e.debug("skipping since already initialized for expiration at",this.expiration);return}this.cancel(),e.debug("using duration",t),this._expiration=n;const r=Math.min(t,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)}},HL=class{static readParams(t,e="query"){if(!t)throw new TypeError("Invalid URL");const r=new URL(t,"http://127.0.0.1")[e==="fragment"?"hash":"search"];return new URLSearchParams(r.slice(1))}},np=class extends Error{constructor(t,e){var n,r,i;if(super(t.error_description||t.error||""),this.form=e,this.name="ErrorResponse",!t.error)throw It.error("ErrorResponse","No error passed"),new Error("No error passed");this.error=t.error,this.error_description=(n=t.error_description)!=null?n:null,this.error_uri=(r=t.error_uri)!=null?r:null,this.state=t.userState,this.session_state=(i=t.session_state)!=null?i:null}},D5=class extends Error{constructor(t){super(t),this.name="ErrorTimeout"}},yLe=class{constructor(t){this._logger=new It("AccessTokenEvents"),this._expiringTimer=new ns("Access token expiring"),this._expiredTimer=new ns("Access token expired"),this._expiringNotificationTimeInSeconds=t.expiringNotificationTimeInSeconds}load(t){const e=this._logger.create("load");if(t.access_token&&t.expires_in!==void 0){const n=t.expires_in;if(e.debug("access token present, remaining duration:",n),n>0){let i=n-this._expiringNotificationTimeInSeconds;i<=0&&(i=1),e.debug("registering expiring timer, raising in",i,"seconds"),this._expiringTimer.init(i)}else e.debug("canceling existing expiring timer because we're past expiration."),this._expiringTimer.cancel();const r=n+1;e.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(t){return this._expiringTimer.addHandler(t)}removeAccessTokenExpiring(t){this._expiringTimer.removeHandler(t)}addAccessTokenExpired(t){return this._expiredTimer.addHandler(t)}removeAccessTokenExpired(t){this._expiredTimer.removeHandler(t)}},xLe=class{constructor(t,e,n,r,i){this._callback=t,this._client_id=e,this._intervalInSeconds=r,this._stopOnError=i,this._logger=new It("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 o=new URL(n);this._frame_origin=o.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=o.href}load(){return new Promise(t=>{this._frame.onload=()=>{t()},window.document.body.appendChild(this._frame),window.addEventListener("message",this._message,!1)})}start(t){if(this._session_state===t)return;this._logger.create("start"),this.stop(),this._session_state=t;const e=()=>{!this._frame.contentWindow||!this._session_state||this._frame.contentWindow.postMessage(this._client_id+" "+this._session_state,this._frame_origin)};e(),this._timer=setInterval(e,this._intervalInSeconds*1e3)}stop(){this._logger.create("stop"),this._session_state=null,this._timer&&(clearInterval(this._timer),this._timer=null)}},gie=class{constructor(){this._logger=new It("InMemoryWebStorage"),this._data={}}clear(){this._logger.create("clear"),this._data={}}getItem(t){return this._logger.create(`getItem('${t}')`),this._data[t]}setItem(t,e){this._logger.create(`setItem('${t}')`),this._data[t]=e}removeItem(t){this._logger.create(`removeItem('${t}')`),delete this._data[t]}get length(){return Object.getOwnPropertyNames(this._data).length}key(t){return Object.getOwnPropertyNames(this._data)[t]}},L5=class{constructor(t=[],e=null,n={}){this._jwtHandler=e,this._extraHeaders=n,this._logger=new It("JsonService"),this._contentTypes=[],this._contentTypes.push(...t,"application/json"),e&&this._contentTypes.push("application/jwt")}async fetchWithTimeout(t,e={}){const{timeoutInSeconds:n,...r}=e;if(!n)return await fetch(t,r);const i=new AbortController,o=setTimeout(()=>i.abort(),n*1e3);try{return await fetch(t,{...e,signal:i.signal})}catch(a){throw a instanceof DOMException&&a.name==="AbortError"?new D5("Network timed out"):a}finally{clearTimeout(o)}}async getJson(t,{token:e,credentials:n}={}){const r=this._logger.create("getJson"),i={Accept:this._contentTypes.join(", ")};e&&(r.debug("token passed, setting Authorization header"),i.Authorization="Bearer "+e),this.appendExtraHeaders(i);let o;try{r.debug("url:",t),o=await this.fetchWithTimeout(t,{method:"GET",headers:i,credentials:n})}catch(l){throw r.error("Network Error"),l}r.debug("HTTP response received, status",o.status);const a=o.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: ${t}`)),o.ok&&this._jwtHandler&&(a!=null&&a.startsWith("application/jwt")))return await this._jwtHandler(await o.text());let s;try{s=await o.json()}catch(l){throw r.error("Error parsing JSON response",l),o.ok?l:new Error(`${o.statusText} (${o.status})`)}if(!o.ok)throw r.error("Error from server:",s),s.error?new np(s):new Error(`${o.statusText} (${o.status}): ${JSON.stringify(s)}`);return s}async postForm(t,{body:e,basicAuth:n,timeoutInSeconds:r,initCredentials:i}){const o=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{o.debug("url:",t),s=await this.fetchWithTimeout(t,{method:"POST",headers:a,body:e,timeoutInSeconds:r,credentials:i})}catch(f){throw o.error("Network error"),f}o.debug("HTTP response received, status",s.status);const l=s.headers.get("Content-Type");if(l&&!this._contentTypes.find(f=>l.startsWith(f)))throw new Error(`Invalid response Content-Type: ${l??"undefined"}, from URL: ${t}`);const c=await s.text();let u={};if(c)try{u=JSON.parse(c)}catch(f){throw o.error("Error parsing JSON response",f),s.ok?f:new Error(`${s.statusText} (${s.status})`)}if(!s.ok)throw o.error("Error from server:",u),u.error?new np(u,e):new Error(`${s.statusText} (${s.status}): ${JSON.stringify(u)}`);return u}appendExtraHeaders(t){const e=this._logger.create("appendExtraHeaders"),n=Object.keys(this._extraHeaders),r=["authorization","accept","content-type"];n.length!==0&&n.forEach(i=>{if(r.includes(i.toLocaleLowerCase())){e.warn("Protected header could not be overridden",i,r);return}const o=typeof this._extraHeaders[i]=="function"?this._extraHeaders[i]():this._extraHeaders[i];o&&o!==""&&(t[i]=o)})}},bLe=class{constructor(t){this._settings=t,this._logger=new It("MetadataService"),this._signingKeys=null,this._metadata=null,this._metadataUrl=this._settings.metadataUrl,this._jsonService=new L5(["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 t=this._logger.create("getMetadata");if(this._metadata)return t.debug("using cached values"),this._metadata;if(!this._metadataUrl)throw t.throw(new Error("No authority or metadataUrl configured on settings")),null;t.debug("getting metadata from",this._metadataUrl);const e=await this._jsonService.getJson(this._metadataUrl,{credentials:this._fetchRequestCredentials});return t.debug("merging remote JSON with seed metadata"),this._metadata=Object.assign({},this._settings.metadataSeed,e),this._metadata}getIssuer(){return this._getMetadataProperty("issuer")}getAuthorizationEndpoint(){return this._getMetadataProperty("authorization_endpoint")}getUserInfoEndpoint(){return this._getMetadataProperty("userinfo_endpoint")}getTokenEndpoint(t=!0){return this._getMetadataProperty("token_endpoint",t)}getCheckSessionIframe(){return this._getMetadataProperty("check_session_iframe",!0)}getEndSessionEndpoint(){return this._getMetadataProperty("end_session_endpoint",!0)}getRevocationEndpoint(t=!0){return this._getMetadataProperty("revocation_endpoint",t)}getKeysEndpoint(t=!0){return this._getMetadataProperty("jwks_uri",t)}async _getMetadataProperty(t,e=!1){const n=this._logger.create(`_getMetadataProperty('${t}')`),r=await this.getMetadata();if(n.debug("resolved"),r[t]===void 0){if(e===!0){n.warn("Metadata does not contain optional property");return}n.throw(new Error("Metadata does not contain property "+t))}return r[t]}async getSigningKeys(){const t=this._logger.create("getSigningKeys");if(this._signingKeys)return t.debug("returning signingKeys from cache"),this._signingKeys;const e=await this.getKeysEndpoint(!1);t.debug("got jwks_uri",e);const n=await this._jsonService.getJson(e);if(t.debug("got key set",n),!Array.isArray(n.keys))throw t.throw(new Error("Missing keys on keyset")),null;return this._signingKeys=n.keys,this._signingKeys}},vie=class{constructor({prefix:t="oidc.",store:e=localStorage}={}){this._logger=new It("WebStorageStateStore"),this._store=e,this._prefix=t}async set(t,e){this._logger.create(`set('${t}')`),t=this._prefix+t,await this._store.setItem(t,e)}async get(t){return this._logger.create(`get('${t}')`),t=this._prefix+t,await this._store.getItem(t)}async remove(t){this._logger.create(`remove('${t}')`),t=this._prefix+t;const e=await this._store.getItem(t);return await this._store.removeItem(t),e}async getAllKeys(){this._logger.create("getAllKeys");const t=await this._store.length,e=[];for(let n=0;n<t;n++){const r=await this._store.key(n);r&&r.indexOf(this._prefix)===0&&e.push(r.substr(this._prefix.length))}return e}},_Le="code",wLe="openid",SLe="client_secret_post",OLe="query",CLe=60*15,TLe=60*5,yie=class{constructor({authority:t,metadataUrl:e,metadata:n,signingKeys:r,metadataSeed:i,client_id:o,client_secret:a,response_type:s=_Le,scope:l=wLe,redirect_uri:c,post_logout_redirect_uri:u,client_authentication:f=SLe,prompt:d,display:h,max_age:p,ui_locales:m,acr_values:g,resource:v,response_mode:y=OLe,filterProtocolClaims:x=!0,loadUserInfo:b=!1,staleStateAgeInSeconds:_=CLe,clockSkewInSeconds:S=TLe,userInfoJwtIssuer:O="OP",mergeClaims:C=!1,disablePKCE:E=!1,stateStore:k,refreshTokenCredentials:I,revokeTokenAdditionalContentTypes:P,fetchRequestCredentials:R,refreshTokenAllowedScope:T,extraQueryParams:L={},extraTokenParams:z={},extraHeaders:B={}}){if(this.authority=t,e?this.metadataUrl=e:(this.metadataUrl=t,t&&(this.metadataUrl.endsWith("/")||(this.metadataUrl+="/"),this.metadataUrl+=".well-known/openid-configuration")),this.metadata=n,this.metadataSeed=i,this.signingKeys=r,this.client_id=o,this.client_secret=a,this.response_type=s,this.scope=l,this.redirect_uri=c,this.post_logout_redirect_uri=u,this.client_authentication=f,this.prompt=d,this.display=h,this.max_age=p,this.ui_locales=m,this.acr_values=g,this.resource=v,this.response_mode=y,this.filterProtocolClaims=x??!0,this.loadUserInfo=!!b,this.staleStateAgeInSeconds=_,this.clockSkewInSeconds=S,this.userInfoJwtIssuer=O,this.mergeClaims=!!C,this.disablePKCE=!!E,this.revokeTokenAdditionalContentTypes=P,R&&I&&console.warn("Both fetchRequestCredentials and refreshTokenCredentials is set. Only fetchRequestCredentials will be used."),this.fetchRequestCredentials=R||I||"same-origin",k)this.stateStore=k;else{const U=typeof window<"u"?window.localStorage:new gie;this.stateStore=new vie({store:U})}this.refreshTokenAllowedScope=T,this.extraQueryParams=L,this.extraTokenParams=z,this.extraHeaders=B}},ELe=class{constructor(t,e){this._settings=t,this._metadataService=e,this._logger=new It("UserInfoService"),this._getClaimsFromJwt=async n=>{const r=this._logger.create("_getClaimsFromJwt");try{const i=GL.decode(n);return r.debug("JWT decoding successful"),i}catch(i){throw r.error("Error parsing JWT response"),i}},this._jsonService=new L5(void 0,this._getClaimsFromJwt,this._settings.extraHeaders)}async getClaims(t){const e=this._logger.create("getClaims");t||this._logger.throw(new Error("No token passed"));const n=await this._metadataService.getUserInfoEndpoint();e.debug("got userinfo url",n);const r=await this._jsonService.getJson(n,{token:t,credentials:this._settings.fetchRequestCredentials});return e.debug("got claims",r),r}},xie=class{constructor(t,e){this._settings=t,this._metadataService=e,this._logger=new It("TokenClient"),this._jsonService=new L5(this._settings.revokeTokenAdditionalContentTypes,null,this._settings.extraHeaders)}async exchangeCode({grant_type:t="authorization_code",redirect_uri:e=this._settings.redirect_uri,client_id:n=this._settings.client_id,client_secret:r=this._settings.client_secret,...i}){const o=this._logger.create("exchangeCode");n||o.throw(new Error("A client_id is required")),e||o.throw(new Error("A redirect_uri is required")),i.code||o.throw(new Error("A code is required"));const a=new URLSearchParams({grant_type:t,redirect_uri:e});for(const[u,f]of Object.entries(i))f!=null&&a.set(u,f);let s;switch(this._settings.client_authentication){case"client_secret_basic":if(!r)throw o.throw(new Error("A client_secret is required")),null;s=Al.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);o.debug("got token endpoint");const c=await this._jsonService.postForm(l,{body:a,basicAuth:s,initCredentials:this._settings.fetchRequestCredentials});return o.debug("got response"),c}async exchangeCredentials({grant_type:t="password",client_id:e=this._settings.client_id,client_secret:n=this._settings.client_secret,scope:r=this._settings.scope,...i}){const o=this._logger.create("exchangeCredentials");e||o.throw(new Error("A client_id is required"));const a=new URLSearchParams({grant_type:t,scope:r});for(const[u,f]of Object.entries(i))f!=null&&a.set(u,f);let s;switch(this._settings.client_authentication){case"client_secret_basic":if(!n)throw o.throw(new Error("A client_secret is required")),null;s=Al.generateBasicAuth(e,n);break;case"client_secret_post":a.append("client_id",e),n&&a.append("client_secret",n);break}const l=await this._metadataService.getTokenEndpoint(!1);o.debug("got token endpoint");const c=await this._jsonService.postForm(l,{body:a,basicAuth:s,initCredentials:this._settings.fetchRequestCredentials});return o.debug("got response"),c}async exchangeRefreshToken({grant_type:t="refresh_token",client_id:e=this._settings.client_id,client_secret:n=this._settings.client_secret,timeoutInSeconds:r,...i}){const o=this._logger.create("exchangeRefreshToken");e||o.throw(new Error("A client_id is required")),i.refresh_token||o.throw(new Error("A refresh_token is required"));const a=new URLSearchParams({grant_type:t});for(const[u,f]of Object.entries(i))f!=null&&a.set(u,f);let s;switch(this._settings.client_authentication){case"client_secret_basic":if(!n)throw o.throw(new Error("A client_secret is required")),null;s=Al.generateBasicAuth(e,n);break;case"client_secret_post":a.append("client_id",e),n&&a.append("client_secret",n);break}const l=await this._metadataService.getTokenEndpoint(!1);o.debug("got token endpoint");const c=await this._jsonService.postForm(l,{body:a,basicAuth:s,timeoutInSeconds:r,initCredentials:this._settings.fetchRequestCredentials});return o.debug("got response"),c}async revoke(t){var e;const n=this._logger.create("revoke");t.token||n.throw(new Error("A token is required"));const r=await this._metadataService.getRevocationEndpoint(!1);n.debug(`got revocation endpoint, revoking ${(e=t.token_type_hint)!=null?e:"default token type"}`);const i=new URLSearchParams;for(const[o,a]of Object.entries(t))a!=null&&i.set(o,a);i.set("client_id",this._settings.client_id),this._settings.client_secret&&i.set("client_secret",this._settings.client_secret),await this._jsonService.postForm(r,{body:i}),n.debug("got response")}},PLe=class{constructor(t,e,n){this._settings=t,this._metadataService=e,this._claimsService=n,this._logger=new It("ResponseValidator"),this._userInfoService=new ELe(this._settings,this._metadataService),this._tokenClient=new xie(this._settings,this._metadataService)}async validateSigninResponse(t,e){const n=this._logger.create("validateSigninResponse");this._processSigninState(t,e),n.debug("state processed"),await this._processCode(t,e),n.debug("code processed"),t.isOpenId&&this._validateIdTokenAttributes(t),n.debug("tokens validated"),await this._processClaims(t,e==null?void 0:e.skipUserInfo,t.isOpenId),n.debug("claims processed")}async validateCredentialsResponse(t,e){const n=this._logger.create("validateCredentialsResponse");t.isOpenId&&this._validateIdTokenAttributes(t),n.debug("tokens validated"),await this._processClaims(t,e,t.isOpenId),n.debug("claims processed")}async validateRefreshResponse(t,e){var n,r;const i=this._logger.create("validateRefreshResponse");t.userState=e.data,(n=t.session_state)!=null||(t.session_state=e.session_state),(r=t.scope)!=null||(t.scope=e.scope),t.isOpenId&&t.id_token&&(this._validateIdTokenAttributes(t,e.id_token),i.debug("ID Token validated")),t.id_token||(t.id_token=e.id_token,t.profile=e.profile);const o=t.isOpenId&&!!t.id_token;await this._processClaims(t,!1,o),i.debug("claims processed")}validateSignoutResponse(t,e){const n=this._logger.create("validateSignoutResponse");if(e.id!==t.state&&n.throw(new Error("State does not match")),n.debug("state validated"),t.userState=e.data,t.error)throw n.warn("Response was error",t.error),new np(t)}_processSigninState(t,e){var n;const r=this._logger.create("_processSigninState");if(e.id!==t.state&&r.throw(new Error("State does not match")),e.client_id||r.throw(new Error("No client_id on state")),e.authority||r.throw(new Error("No authority on state")),this._settings.authority!==e.authority&&r.throw(new Error("authority mismatch on settings vs. signin state")),this._settings.client_id&&this._settings.client_id!==e.client_id&&r.throw(new Error("client_id mismatch on settings vs. signin state")),r.debug("state validated"),t.userState=e.data,(n=t.scope)!=null||(t.scope=e.scope),t.error)throw r.warn("Response was error",t.error),new np(t);e.code_verifier&&!t.code&&r.throw(new Error("Expected code in response"))}async _processClaims(t,e=!1,n=!0){const r=this._logger.create("_processClaims");if(t.profile=this._claimsService.filterProtocolClaims(t.profile),e||!this._settings.loadUserInfo||!t.access_token){r.debug("not loading user info");return}r.debug("loading user info");const i=await this._userInfoService.getClaims(t.access_token);r.debug("user info claims received from user info endpoint"),n&&i.sub!==t.profile.sub&&r.throw(new Error("subject from UserInfo response does not match subject in ID Token")),t.profile=this._claimsService.mergeClaims(t.profile,this._claimsService.filterProtocolClaims(i)),r.debug("user info claims received, updated profile:",t.profile)}async _processCode(t,e){const n=this._logger.create("_processCode");if(t.code){n.debug("Validating code");const r=await this._tokenClient.exchangeCode({client_id:e.client_id,client_secret:e.client_secret,code:t.code,redirect_uri:e.redirect_uri,code_verifier:e.code_verifier,...e.extraTokenParams});Object.assign(t,r)}else n.debug("No code to process")}_validateIdTokenAttributes(t,e){var n;const r=this._logger.create("_validateIdTokenAttributes");r.debug("decoding ID Token JWT");const i=GL.decode((n=t.id_token)!=null?n:"");if(i.sub||r.throw(new Error("ID Token is missing a subject claim")),e){const o=GL.decode(e);i.sub!==o.sub&&r.throw(new Error("sub in id_token does not match current sub")),i.auth_time&&i.auth_time!==o.auth_time&&r.throw(new Error("auth_time in id_token does not match original auth_time")),i.azp&&i.azp!==o.azp&&r.throw(new Error("azp in id_token does not match original azp")),!i.azp&&o.azp&&r.throw(new Error("azp not in id_token, but present in original id_token"))}t.profile=i}},tv=class{constructor(t){this.id=t.id||Al.generateUUIDv4(),this.data=t.data,t.created&&t.created>0?this.created=t.created:this.created=ns.getEpochTime(),this.request_type=t.request_type}toStorageString(){return new It("State").create("toStorageString"),JSON.stringify({id:this.id,data:this.data,created:this.created,request_type:this.request_type})}static fromStorageString(t){return It.createStatic("State","fromStorageString"),new tv(JSON.parse(t))}static async clearStaleState(t,e){const n=It.createStatic("State","clearStaleState"),r=ns.getEpochTime()-e,i=await t.getAllKeys();n.debug("got keys",i);for(let o=0;o<i.length;o++){const a=i[o],s=await t.get(a);let l=!1;if(s)try{const c=tv.fromStorageString(s);n.debug("got item from key:",a,c.created),c.created<=r&&(l=!0)}catch(c){n.error("Error parsing state for key:",a,c),l=!0}else n.debug("no item in storage for key:",a),l=!0;l&&(n.debug("removed item for key:",a),t.remove(a))}}},N5=class extends tv{constructor(t){super(t),t.code_verifier===!0?this.code_verifier=Al.generateCodeVerifier():t.code_verifier&&(this.code_verifier=t.code_verifier),this.code_verifier&&(this.code_challenge=Al.generateCodeChallenge(this.code_verifier)),this.authority=t.authority,this.client_id=t.client_id,this.redirect_uri=t.redirect_uri,this.scope=t.scope,this.client_secret=t.client_secret,this.extraTokenParams=t.extraTokenParams,this.response_mode=t.response_mode,this.skipUserInfo=t.skipUserInfo}toStorageString(){return new It("SigninState").create("toStorageString"),JSON.stringify({id:this.id,data:this.data,created:this.created,request_type:this.request_type,code_verifier:this.code_verifier,authority:this.authority,client_id:this.client_id,redirect_uri:this.redirect_uri,scope:this.scope,client_secret:this.client_secret,extraTokenParams:this.extraTokenParams,response_mode:this.response_mode,skipUserInfo:this.skipUserInfo})}static fromStorageString(t){It.createStatic("SigninState","fromStorageString");const e=JSON.parse(t);return new N5(e)}},MLe=class{constructor({url:t,authority:e,client_id:n,redirect_uri:r,response_type:i,scope:o,state_data:a,response_mode:s,request_type:l,client_secret:c,nonce:u,resource:f,skipUserInfo:d,extraQueryParams:h,extraTokenParams:p,disablePKCE:m,...g}){if(this._logger=new It("SigninRequest"),!t)throw this._logger.error("ctor: No url passed"),new Error("url");if(!n)throw this._logger.error("ctor: No client_id passed"),new Error("client_id");if(!r)throw this._logger.error("ctor: No redirect_uri passed"),new Error("redirect_uri");if(!i)throw this._logger.error("ctor: No response_type passed"),new Error("response_type");if(!o)throw this._logger.error("ctor: No scope passed"),new Error("scope");if(!e)throw this._logger.error("ctor: No authority passed"),new Error("authority");this.state=new N5({data:a,request_type:l,code_verifier:!m,client_id:n,authority:e,redirect_uri:r,response_mode:s,client_secret:c,scope:o,extraTokenParams:p,skipUserInfo:d});const v=new URL(t);v.searchParams.append("client_id",n),v.searchParams.append("redirect_uri",r),v.searchParams.append("response_type",i),v.searchParams.append("scope",o),u&&v.searchParams.append("nonce",u),v.searchParams.append("state",this.state.id),this.state.code_challenge&&(v.searchParams.append("code_challenge",this.state.code_challenge),v.searchParams.append("code_challenge_method","S256")),f&&(Array.isArray(f)?f:[f]).forEach(x=>v.searchParams.append("resource",x));for(const[y,x]of Object.entries({response_mode:s,...g,...h}))x!=null&&v.searchParams.append(y,x.toString());this.url=v.href}},kLe="openid",IA=class{constructor(t){this.access_token="",this.token_type="",this.profile={},this.state=t.get("state"),this.session_state=t.get("session_state"),this.error=t.get("error"),this.error_description=t.get("error_description"),this.error_uri=t.get("error_uri"),this.code=t.get("code")}get expires_in(){if(this.expires_at!==void 0)return this.expires_at-ns.getEpochTime()}set expires_in(t){typeof t=="string"&&(t=Number(t)),t!==void 0&&t>=0&&(this.expires_at=Math.floor(t)+ns.getEpochTime())}get isOpenId(){var t;return((t=this.scope)==null?void 0:t.split(" ").includes(kLe))||!!this.id_token}},ALe=class{constructor({url:t,state_data:e,id_token_hint:n,post_logout_redirect_uri:r,extraQueryParams:i,request_type:o}){if(this._logger=new It("SignoutRequest"),!t)throw this._logger.error("ctor: No url passed"),new Error("url");const a=new URL(t);n&&a.searchParams.append("id_token_hint",n),r&&(a.searchParams.append("post_logout_redirect_uri",r),e&&(this.state=new tv({data:e,request_type:o}),a.searchParams.append("state",this.state.id)));for(const[s,l]of Object.entries({...i}))l!=null&&a.searchParams.append(s,l.toString());this.url=a.href}},RLe=class{constructor(t){this.state=t.get("state"),this.error=t.get("error"),this.error_description=t.get("error_description"),this.error_uri=t.get("error_uri")}},ILe=["nbf","jti","auth_time","nonce","acr","amr","azp","at_hash"],DLe=["sub","iss","aud","exp","iat"],LLe=class{constructor(t){this._settings=t,this._logger=new It("ClaimsService")}filterProtocolClaims(t){const e={...t};if(this._settings.filterProtocolClaims){let n;Array.isArray(this._settings.filterProtocolClaims)?n=this._settings.filterProtocolClaims:n=ILe;for(const r of n)DLe.includes(r)||delete e[r]}return e}mergeClaims(t,e){const n={...t};for(const[r,i]of Object.entries(e))for(const o of Array.isArray(i)?i:[i]){const a=n[r];a?Array.isArray(a)?a.includes(o)||a.push(o):n[r]!==o&&(typeof o=="object"&&this._settings.mergeClaims?n[r]=this.mergeClaims(a,o):n[r]=[a,o]):n[r]=o}return n}},NLe=class{constructor(t){this._logger=new It("OidcClient"),this.settings=new yie(t),this.metadataService=new bLe(this.settings),this._claimsService=new LLe(this.settings),this._validator=new PLe(this.settings,this.metadataService,this._claimsService),this._tokenClient=new xie(this.settings,this.metadataService)}async createSigninRequest({state:t,request:e,request_uri:n,request_type:r,id_token_hint:i,login_hint:o,skipUserInfo:a,nonce:s,response_type:l=this.settings.response_type,scope:c=this.settings.scope,redirect_uri:u=this.settings.redirect_uri,prompt:f=this.settings.prompt,display:d=this.settings.display,max_age:h=this.settings.max_age,ui_locales:p=this.settings.ui_locales,acr_values:m=this.settings.acr_values,resource:g=this.settings.resource,response_mode:v=this.settings.response_mode,extraQueryParams:y=this.settings.extraQueryParams,extraTokenParams:x=this.settings.extraTokenParams}){const b=this._logger.create("createSigninRequest");if(l!=="code")throw new Error("Only the Authorization Code flow (with PKCE) is supported");const _=await this.metadataService.getAuthorizationEndpoint();b.debug("Received authorization endpoint",_);const S=new MLe({url:_,authority:this.settings.authority,client_id:this.settings.client_id,redirect_uri:u,response_type:l,scope:c,state_data:t,prompt:f,display:d,max_age:h,ui_locales:p,id_token_hint:i,login_hint:o,acr_values:m,resource:g,request:e,request_uri:n,extraQueryParams:y,extraTokenParams:x,request_type:r,response_mode:v,client_secret:this.settings.client_secret,skipUserInfo:a,nonce:s,disablePKCE:this.settings.disablePKCE});await this.clearStaleState();const O=S.state;return await this.settings.stateStore.set(O.id,O.toStorageString()),S}async readSigninResponseState(t,e=!1){const n=this._logger.create("readSigninResponseState"),r=new IA(HL.readParams(t,this.settings.response_mode));if(!r.state)throw n.throw(new Error("No state in response")),null;const i=await this.settings.stateStore[e?"remove":"get"](r.state);if(!i)throw n.throw(new Error("No matching state found in storage")),null;return{state:N5.fromStorageString(i),response:r}}async processSigninResponse(t){const e=this._logger.create("processSigninResponse"),{state:n,response:r}=await this.readSigninResponseState(t,!0);return e.debug("received state from storage; validating response"),await this._validator.validateSigninResponse(r,n),r}async processResourceOwnerPasswordCredentials({username:t,password:e,skipUserInfo:n=!1,extraTokenParams:r={}}){const i=await this._tokenClient.exchangeCredentials({username:t,password:e,...r}),o=new IA(new URLSearchParams);return Object.assign(o,i),await this._validator.validateCredentialsResponse(o,n),o}async useRefreshToken({state:t,timeoutInSeconds:e}){var n;const r=this._logger.create("useRefreshToken");let i;if(this.settings.refreshTokenAllowedScope===void 0)i=t.scope;else{const s=this.settings.refreshTokenAllowedScope.split(" ");i=(((n=t.scope)==null?void 0:n.split(" "))||[]).filter(c=>s.includes(c)).join(" ")}const o=await this._tokenClient.exchangeRefreshToken({refresh_token:t.refresh_token,scope:i,timeoutInSeconds:e}),a=new IA(new URLSearchParams);return Object.assign(a,o),r.debug("validating response",a),await this._validator.validateRefreshResponse(a,{...t,scope:i}),a}async createSignoutRequest({state:t,id_token_hint:e,request_type:n,post_logout_redirect_uri:r=this.settings.post_logout_redirect_uri,extraQueryParams:i=this.settings.extraQueryParams}={}){const o=this._logger.create("createSignoutRequest"),a=await this.metadataService.getEndSessionEndpoint();if(!a)throw o.throw(new Error("No end session endpoint")),null;o.debug("Received end session endpoint",a);const s=new ALe({url:a,id_token_hint:e,post_logout_redirect_uri:r,state_data:t,extraQueryParams:i,request_type:n});await this.clearStaleState();const l=s.state;return l&&(o.debug("Signout request has state to persist"),await this.settings.stateStore.set(l.id,l.toStorageString())),s}async readSignoutResponseState(t,e=!1){const n=this._logger.create("readSignoutResponseState"),r=new RLe(HL.readParams(t,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 np(r);return{state:void 0,response:r}}const i=await this.settings.stateStore[e?"remove":"get"](r.state);if(!i)throw n.throw(new Error("No matching state found in storage")),null;return{state:tv.fromStorageString(i),response:r}}async processSignoutResponse(t){const e=this._logger.create("processSignoutResponse"),{state:n,response:r}=await this.readSignoutResponseState(t,!0);return n?(e.debug("Received state from storage; validating response"),this._validator.validateSignoutResponse(r,n)):e.debug("No state from storage; skipping response validation"),r}clearStaleState(){return this._logger.create("clearStaleState"),tv.clearStaleState(this.settings.stateStore,this.settings.staleStateAgeInSeconds)}async revokeToken(t,e){return this._logger.create("revokeToken"),await this._tokenClient.revoke({token:t,token_type_hint:e})}},$Le=class{constructor(t){this._userManager=t,this._logger=new It("SessionMonitor"),this._start=async e=>{const n=e.session_state;if(!n)return;const r=this._logger.create("_start");if(e.profile?(this._sub=e.profile.sub,this._sid=e.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 i=await this._userManager.metadataService.getCheckSessionIframe();if(i){r.debug("initializing check session iframe");const o=this._userManager.settings.client_id,a=this._userManager.settings.checkSessionIntervalInSeconds,s=this._userManager.settings.stopCheckSessionOnError,l=new xLe(this._callback,o,i,a,s);await l.load(),this._checkSessionIFrame=l,l.start(n)}else r.warn("no check session iframe found in the metadata")}catch(i){r.error("Error from getCheckSessionIframe:",i instanceof Error?i.message:i)}},this._stop=()=>{const e=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 i={session_state:r.session_state,profile:r.sub&&r.sid?{sub:r.sub,sid:r.sid}:null};this._start(i)}}catch(r){e.error("error from querySessionStatus",r instanceof Error?r.message:r)}},1e3)}},this._callback=async()=>{const e=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?e.debug("same sub still logged in at OP, restarting check session iframe; session_state",n.session_state):(e.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())):e.debug("different subject signed into OP",n.sub):e.debug("subject no longer signed into OP"),r?this._sub?this._userManager.events._raiseUserSignedOut():this._userManager.events._raiseUserSignedIn():e.debug("no change in session detected, no event to raise")}catch(n){this._sub&&(e.debug("Error calling queryCurrentSigninSession; raising signed out event",n),this._userManager.events._raiseUserSignedOut())}},t||this._logger.throw(new Error("No user manager passed")),this._userManager.events.addUserLoaded(this._start),this._userManager.events.addUserUnloaded(this._stop),this._init().catch(e=>{this._logger.error(e)})}async _init(){this._logger.create("_init");const t=await this._userManager.getUser();if(t)this._start(t);else if(this._userManager.settings.monitorAnonymousSession){const e=await this._userManager.querySessionStatus();if(e){const n={session_state:e.session_state,profile:e.sub&&e.sid?{sub:e.sub,sid:e.sid}:null};this._start(n)}}}},AC=class{constructor(t){var e;this.id_token=t.id_token,this.session_state=(e=t.session_state)!=null?e:null,this.access_token=t.access_token,this.refresh_token=t.refresh_token,this.token_type=t.token_type,this.scope=t.scope,this.profile=t.profile,this.expires_at=t.expires_at,this.state=t.userState}get expires_in(){if(this.expires_at!==void 0)return this.expires_at-ns.getEpochTime()}set expires_in(t){t!==void 0&&(this.expires_at=Math.floor(t)+ns.getEpochTime())}get expired(){const t=this.expires_in;if(t!==void 0)return t<=0}get scopes(){var t,e;return(e=(t=this.scope)==null?void 0:t.split(" "))!=null?e:[]}toStorageString(){return new It("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(t){return It.createStatic("User","fromStorageString"),new AC(JSON.parse(t))}},cG="oidc-client",bie=class{constructor(){this._abort=new af("Window navigation aborted"),this._disposeHandlers=new Set,this._window=null}async navigate(t){const e=this._logger.create("navigate");if(!this._window)throw new Error("Attempted to navigate on a disposed window");e.debug("setting URL in window"),this._window.location.replace(t.url);const{url:n,keepOpen:r}=await new Promise((i,o)=>{const a=s=>{var l;const c=s.data,u=(l=t.scriptOrigin)!=null?l:window.location.origin;if(!(s.origin!==u||(c==null?void 0:c.source)!==cG)){try{const f=HL.readParams(c.url,t.response_mode).get("state");if(f||e.warn("no state found in response url"),s.source!==this._window&&f!==t.state)return}catch{this._dispose(),o(new Error("Invalid response from window"))}i(c)}};window.addEventListener("message",a,!1),this._disposeHandlers.add(()=>window.removeEventListener("message",a,!1)),this._disposeHandlers.add(this._abort.addHandler(s=>{this._dispose(),o(s)}))});return e.debug("got response from window"),this._dispose(),r||this.close(),{url:n}}_dispose(){this._logger.create("_dispose");for(const t of this._disposeHandlers)t();this._disposeHandlers.clear()}static _notifyParent(t,e,n=!1,r=window.location.origin){t.postMessage({source:cG,url:e,keepOpen:n},r)}},_ie={location:!1,toolbar:!1,height:640},wie="_blank",FLe=60,jLe=2,Sie=10,BLe=class extends yie{constructor(t){const{popup_redirect_uri:e=t.redirect_uri,popup_post_logout_redirect_uri:n=t.post_logout_redirect_uri,popupWindowFeatures:r=_ie,popupWindowTarget:i=wie,redirectMethod:o="assign",redirectTarget:a="self",iframeNotifyParentOrigin:s=t.iframeNotifyParentOrigin,iframeScriptOrigin:l=t.iframeScriptOrigin,silent_redirect_uri:c=t.redirect_uri,silentRequestTimeoutInSeconds:u=Sie,automaticSilentRenew:f=!0,validateSubOnSilentRenew:d=!0,includeIdTokenInSilentRenew:h=!1,monitorSession:p=!1,monitorAnonymousSession:m=!1,checkSessionIntervalInSeconds:g=jLe,query_status_response_type:v="code",stopCheckSessionOnError:y=!0,revokeTokenTypes:x=["access_token","refresh_token"],revokeTokensOnSignout:b=!1,includeIdTokenInSilentSignout:_=!1,accessTokenExpiringNotificationTimeInSeconds:S=FLe,userStore:O}=t;if(super(t),this.popup_redirect_uri=e,this.popup_post_logout_redirect_uri=n,this.popupWindowFeatures=r,this.popupWindowTarget=i,this.redirectMethod=o,this.redirectTarget=a,this.iframeNotifyParentOrigin=s,this.iframeScriptOrigin=l,this.silent_redirect_uri=c,this.silentRequestTimeoutInSeconds=u,this.automaticSilentRenew=f,this.validateSubOnSilentRenew=d,this.includeIdTokenInSilentRenew=h,this.monitorSession=p,this.monitorAnonymousSession=m,this.checkSessionIntervalInSeconds=g,this.stopCheckSessionOnError=y,this.query_status_response_type=v,this.revokeTokenTypes=x,this.revokeTokensOnSignout=b,this.includeIdTokenInSilentSignout=_,this.accessTokenExpiringNotificationTimeInSeconds=S,O)this.userStore=O;else{const C=typeof window<"u"?window.sessionStorage:new gie;this.userStore=new vie({store:C})}}},qL=class extends bie{constructor({silentRequestTimeoutInSeconds:t=Sie}){super(),this._logger=new It("IFrameWindow"),this._timeoutInSeconds=t,this._frame=qL.createHiddenIframe(),this._window=this._frame.contentWindow}static createHiddenIframe(){const t=window.document.createElement("iframe");return t.style.visibility="hidden",t.style.position="fixed",t.style.left="-1000px",t.style.top="0",t.width="0",t.height="0",t.setAttribute("sandbox","allow-scripts allow-same-origin allow-forms"),window.document.body.appendChild(t),t}async navigate(t){this._logger.debug("navigate: Using timeout of:",this._timeoutInSeconds);const e=setTimeout(()=>this._abort.raise(new D5("IFrame timed out without a response")),this._timeoutInSeconds*1e3);return this._disposeHandlers.add(()=>clearTimeout(e)),await super.navigate(t)}close(){var t;this._frame&&(this._frame.parentNode&&(this._frame.addEventListener("load",e=>{var n;const r=e.target;(n=r.parentNode)==null||n.removeChild(r),this._abort.raise(new Error("IFrame removed from DOM"))},!0),(t=this._frame.contentWindow)==null||t.location.replace("about:blank")),this._frame=null),this._window=null}static notifyParent(t,e){return super._notifyParent(window.parent,t,!1,e)}},zLe=class{constructor(t){this._settings=t,this._logger=new It("IFrameNavigator")}async prepare({silentRequestTimeoutInSeconds:t=this._settings.silentRequestTimeoutInSeconds}){return new qL({silentRequestTimeoutInSeconds:t})}async callback(t){this._logger.create("callback"),qL.notifyParent(t,this._settings.iframeNotifyParentOrigin)}},ULe=500,uG=class extends bie{constructor({popupWindowTarget:t=wie,popupWindowFeatures:e={}}){super(),this._logger=new It("PopupWindow");const n=lG.center({..._ie,...e});this._window=window.open(void 0,t,lG.serialize(n))}async navigate(t){var e;(e=this._window)==null||e.focus();const n=setInterval(()=>{(!this._window||this._window.closed)&&this._abort.raise(new Error("Popup closed by user"))},ULe);return this._disposeHandlers.add(()=>clearInterval(n)),await super.navigate(t)}close(){this._window&&(this._window.closed||(this._window.close(),this._abort.raise(new Error("Popup closed")))),this._window=null}static notifyOpener(t,e){if(!window.opener)throw new Error("No window.opener. Can't complete notification.");return super._notifyParent(window.opener,t,e)}},WLe=class{constructor(t){this._settings=t,this._logger=new It("PopupNavigator")}async prepare({popupWindowFeatures:t=this._settings.popupWindowFeatures,popupWindowTarget:e=this._settings.popupWindowTarget}){return new uG({popupWindowFeatures:t,popupWindowTarget:e})}async callback(t,e=!1){this._logger.create("callback"),uG.notifyOpener(t,e)}},VLe=class{constructor(t){this._settings=t,this._logger=new It("RedirectNavigator")}async prepare({redirectMethod:t=this._settings.redirectMethod,redirectTarget:e=this._settings.redirectTarget}){var n;this._logger.create("prepare");let r=window.self;e==="top"&&(r=(n=window.top)!=null?n:window.self);const i=r.location[t].bind(r.location);let o;return{navigate:async a=>{this._logger.create("navigate");const s=new Promise((l,c)=>{o=c});return i(a.url),await s},close:()=>{this._logger.create("close"),o==null||o(new Error("Redirect aborted")),r.stop()}}}},GLe=class extends yLe{constructor(t){super({expiringNotificationTimeInSeconds:t.accessTokenExpiringNotificationTimeInSeconds}),this._logger=new It("UserManagerEvents"),this._userLoaded=new af("User loaded"),this._userUnloaded=new af("User unloaded"),this._silentRenewError=new af("Silent renew error"),this._userSignedIn=new af("User signed in"),this._userSignedOut=new af("User signed out"),this._userSessionChanged=new af("User session changed")}load(t,e=!0){super.load(t),e&&this._userLoaded.raise(t)}unload(){super.unload(),this._userUnloaded.raise()}addUserLoaded(t){return this._userLoaded.addHandler(t)}removeUserLoaded(t){return this._userLoaded.removeHandler(t)}addUserUnloaded(t){return this._userUnloaded.addHandler(t)}removeUserUnloaded(t){return this._userUnloaded.removeHandler(t)}addSilentRenewError(t){return this._silentRenewError.addHandler(t)}removeSilentRenewError(t){return this._silentRenewError.removeHandler(t)}_raiseSilentRenewError(t){this._silentRenewError.raise(t)}addUserSignedIn(t){return this._userSignedIn.addHandler(t)}removeUserSignedIn(t){this._userSignedIn.removeHandler(t)}_raiseUserSignedIn(){this._userSignedIn.raise()}addUserSignedOut(t){return this._userSignedOut.addHandler(t)}removeUserSignedOut(t){this._userSignedOut.removeHandler(t)}_raiseUserSignedOut(){this._userSignedOut.raise()}addUserSessionChanged(t){return this._userSessionChanged.addHandler(t)}removeUserSessionChanged(t){this._userSessionChanged.removeHandler(t)}_raiseUserSessionChanged(){this._userSessionChanged.raise()}},HLe=class{constructor(t){this._userManager=t,this._logger=new It("SilentRenewService"),this._isStarted=!1,this._retryTimer=new ns("Retry Silent Renew"),this._tokenExpiring=async()=>{const e=this._logger.create("_tokenExpiring");try{await this._userManager.signinSilent(),e.debug("silent token renewal successful")}catch(n){if(n instanceof D5){e.warn("ErrorTimeout from signinSilent:",n,"retry in 5s"),this._retryTimer.init(5);return}e.error("Error from signinSilent:",n),this._userManager.events._raiseSilentRenewError(n)}}}async start(){const t=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(e){t.error("getUser error",e)}}}stop(){this._isStarted&&(this._retryTimer.cancel(),this._retryTimer.removeHandler(this._tokenExpiring),this._userManager.events.removeAccessTokenExpiring(this._tokenExpiring),this._isStarted=!1)}},qLe=class{constructor(t){this.refresh_token=t.refresh_token,this.id_token=t.id_token,this.session_state=t.session_state,this.scope=t.scope,this.profile=t.profile,this.data=t.state}},XLe=class{constructor(t){this._logger=new It("UserManager"),this.settings=new BLe(t),this._client=new NLe(t),this._redirectNavigator=new VLe(this.settings),this._popupNavigator=new WLe(this.settings),this._iframeNavigator=new zLe(this.settings),this._events=new GLe(this.settings),this._silentRenewService=new HLe(this),this.settings.automaticSilentRenew&&this.startSilentRenew(),this._sessionMonitor=null,this.settings.monitorSession&&(this._sessionMonitor=new $Le(this))}get events(){return this._events}get metadataService(){return this._client.metadataService}async getUser(){const t=this._logger.create("getUser"),e=await this._loadUser();return e?(t.info("user loaded"),this._events.load(e,!1),e):(t.info("user not found in storage"),null)}async removeUser(){const t=this._logger.create("removeUser");await this.storeUser(null),t.info("user removed from storage"),this._events.unload()}async signinRedirect(t={}){this._logger.create("signinRedirect");const{redirectMethod:e,...n}=t,r=await this._redirectNavigator.prepare({redirectMethod:e});await this._signinStart({request_type:"si:r",...n},r)}async signinRedirectCallback(t=window.location.href){const e=this._logger.create("signinRedirectCallback"),n=await this._signinEnd(t);return n.profile&&n.profile.sub?e.info("success, signed in subject",n.profile.sub):e.info("no subject"),n}async signinResourceOwnerCredentials({username:t,password:e,skipUserInfo:n=!1}){const r=this._logger.create("signinResourceOwnerCredential"),i=await this._client.processResourceOwnerPasswordCredentials({username:t,password:e,skipUserInfo:n,extraTokenParams:this.settings.extraTokenParams});r.debug("got signin response");const o=await this._buildUser(i);return o.profile&&o.profile.sub?r.info("success, signed in subject",o.profile.sub):r.info("no subject"),o}async signinPopup(t={}){const e=this._logger.create("signinPopup"),{popupWindowFeatures:n,popupWindowTarget:r,...i}=t,o=this.settings.popup_redirect_uri;o||e.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:o,display:"popup",...i},a);return s&&(s.profile&&s.profile.sub?e.info("success, signed in subject",s.profile.sub):e.info("no subject")),s}async signinPopupCallback(t=window.location.href,e=!1){const n=this._logger.create("signinPopupCallback");await this._popupNavigator.callback(t,e),n.info("success")}async signinSilent(t={}){var e;const n=this._logger.create("signinSilent"),{silentRequestTimeoutInSeconds:r,...i}=t;let o=await this._loadUser();if(o!=null&&o.refresh_token){n.debug("using refresh token");const c=new qLe(o);return await this._useRefreshToken(c)}const a=this.settings.silent_redirect_uri;a||n.throw(new Error("No silent_redirect_uri configured"));let s;o&&this.settings.validateSubOnSilentRenew&&(n.debug("subject prior to silent renew:",o.profile.sub),s=o.profile.sub);const l=await this._iframeNavigator.prepare({silentRequestTimeoutInSeconds:r});return o=await this._signin({request_type:"si:s",redirect_uri:a,prompt:"none",id_token_hint:this.settings.includeIdTokenInSilentRenew?o==null?void 0:o.id_token:void 0,...i},l,s),o&&((e=o.profile)!=null&&e.sub?n.info("success, signed in subject",o.profile.sub):n.info("no subject")),o}async _useRefreshToken(t){const e=await this._client.useRefreshToken({state:t,timeoutInSeconds:this.settings.silentRequestTimeoutInSeconds}),n=new AC({...t,...e});return await this.storeUser(n),this._events.load(n),n}async signinSilentCallback(t=window.location.href){const e=this._logger.create("signinSilentCallback");await this._iframeNavigator.callback(t),e.info("success")}async signinCallback(t=window.location.href){const{state:e}=await this._client.readSigninResponseState(t);switch(e.request_type){case"si:r":return await this.signinRedirectCallback(t);case"si:p":return await this.signinPopupCallback(t);case"si:s":return await this.signinSilentCallback(t);default:throw new Error("invalid response_type in state")}}async signoutCallback(t=window.location.href,e=!1){const{state:n}=await this._client.readSignoutResponseState(t);if(n)switch(n.request_type){case"so:r":await this.signoutRedirectCallback(t);break;case"so:p":await this.signoutPopupCallback(t,e);break;case"so:s":await this.signoutSilentCallback(t);break;default:throw new Error("invalid response_type in state")}}async querySessionStatus(t={}){const e=this._logger.create("querySessionStatus"),{silentRequestTimeoutInSeconds:n,...r}=t,i=this.settings.silent_redirect_uri;i||e.throw(new Error("No silent_redirect_uri configured"));const o=await this._loadUser(),a=await this._iframeNavigator.prepare({silentRequestTimeoutInSeconds:n}),s=await this._signinStart({request_type:"si:s",redirect_uri:i,prompt:"none",id_token_hint:this.settings.includeIdTokenInSilentRenew?o==null?void 0:o.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 e.debug("got signin response"),l.session_state&&l.profile.sub?(e.info("success for subject",l.profile.sub),{session_state:l.session_state,sub:l.profile.sub,sid:l.profile.sid}):(e.info("success, user not authenticated"),null)}catch(l){if(this.settings.monitorAnonymousSession&&l instanceof np)switch(l.error){case"login_required":case"consent_required":case"interaction_required":case"account_selection_required":return e.info("success for anonymous user"),{session_state:l.session_state}}throw l}}async _signin(t,e,n){const r=await this._signinStart(t,e);return await this._signinEnd(r.url,n)}async _signinStart(t,e){const n=this._logger.create("_signinStart");try{const r=await this._client.createSigninRequest(t);return n.debug("got signin request"),await e.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"),e.close(),r}}async _signinEnd(t,e){const n=this._logger.create("_signinEnd"),r=await this._client.processSigninResponse(t);return n.debug("got signin response"),await this._buildUser(r,e)}async _buildUser(t,e){const n=this._logger.create("_buildUser"),r=new AC(t);if(e){if(e!==r.profile.sub)throw n.debug("current user does not match user returned from signin. sub from signin:",r.profile.sub),new np({...t,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(t={}){const e=this._logger.create("signoutRedirect"),{redirectMethod:n,...r}=t,i=await this._redirectNavigator.prepare({redirectMethod:n});await this._signoutStart({request_type:"so:r",post_logout_redirect_uri:this.settings.post_logout_redirect_uri,...r},i),e.info("success")}async signoutRedirectCallback(t=window.location.href){const e=this._logger.create("signoutRedirectCallback"),n=await this._signoutEnd(t);return e.info("success"),n}async signoutPopup(t={}){const e=this._logger.create("signoutPopup"),{popupWindowFeatures:n,popupWindowTarget:r,...i}=t,o=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:o,state:o==null?void 0:{},...i},a),e.info("success")}async signoutPopupCallback(t=window.location.href,e=!1){const n=this._logger.create("signoutPopupCallback");await this._popupNavigator.callback(t,e),n.info("success")}async _signout(t,e){const n=await this._signoutStart(t,e);return await this._signoutEnd(n.url)}async _signoutStart(t={},e){var n;const r=this._logger.create("_signoutStart");try{const i=await this._loadUser();r.debug("loaded current user from storage"),this.settings.revokeTokensOnSignout&&await this._revokeInternal(i);const o=t.id_token_hint||i&&i.id_token;o&&(r.debug("setting id_token_hint in signout request"),t.id_token_hint=o),await this.removeUser(),r.debug("user removed, creating signout request");const a=await this._client.createSignoutRequest(t);return r.debug("got signout request"),await e.navigate({url:a.url,state:(n=a.state)==null?void 0:n.id})}catch(i){throw r.debug("error after preparing navigator, closing navigator window"),e.close(),i}}async _signoutEnd(t){const e=this._logger.create("_signoutEnd"),n=await this._client.processSignoutResponse(t);return e.debug("got signout response"),n}async signoutSilent(t={}){var e;const n=this._logger.create("signoutSilent"),{silentRequestTimeoutInSeconds:r,...i}=t,o=this.settings.includeIdTokenInSilentSignout?(e=await this._loadUser())==null?void 0:e.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:o,...i},s),n.info("success")}async signoutSilentCallback(t=window.location.href){const e=this._logger.create("signoutSilentCallback");await this._iframeNavigator.callback(t),e.info("success")}async revokeTokens(t){const e=await this._loadUser();await this._revokeInternal(e,t)}async _revokeInternal(t,e=this.settings.revokeTokenTypes){const n=this._logger.create("_revokeInternal");if(!t)return;const r=e.filter(i=>typeof t[i]=="string");if(!r.length){n.debug("no need to revoke due to no token(s)");return}for(const i of r)await this._client.revokeToken(t[i],i),n.info(`${i} revoked successfully`),i!=="access_token"&&(t[i]=null);await this.storeUser(t),n.debug("user stored"),this._events.load(t)}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 t=this._logger.create("_loadUser"),e=await this.settings.userStore.get(this._userStoreKey);return e?(t.debug("user storageString loaded"),AC.fromStorageString(e)):(t.debug("no user storageString"),null)}async storeUser(t){const e=this._logger.create("storeUser");if(t){e.debug("storing user");const n=t.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()}},$5=ue.createContext(void 0);$5.displayName="AuthContext";var QLe={isLoading:!0,isAuthenticated:!1},YLe=(t,e)=>{switch(e.type){case"INITIALISED":case"USER_LOADED":return{...t,user:e.user,isLoading:!1,isAuthenticated:e.user?!e.user.expired:!1,error:void 0};case"USER_UNLOADED":return{...t,user:void 0,isAuthenticated:!1};case"NAVIGATOR_INIT":return{...t,isLoading:!0,activeNavigator:e.method};case"NAVIGATOR_CLOSE":return{...t,isLoading:!1,activeNavigator:void 0};case"ERROR":return{...t,isLoading:!1,error:e.error};default:return{...t,isLoading:!1,error:new Error(`unknown type ${e.type}`)}}},KLe=(t=window.location)=>{let e=new URLSearchParams(t.search);return!!((e.get("code")||e.get("error"))&&e.get("state")||(e=new URLSearchParams(t.hash.replace("#","?")),(e.get("code")||e.get("error"))&&e.get("state")))},ZLe=t=>e=>e instanceof Error?e:new Error(t),JLe=ZLe("Login failed"),e3e=["clearStaleState","querySessionStatus","revokeTokens","startSilentRenew","stopSilentRenew"],t3e=["signinPopup","signinSilent","signinRedirect","signoutPopup","signoutRedirect","signoutSilent"],DA=t=>()=>{throw new Error(`UserManager#${t} was called from an unsupported context. If this is a server-rendered page, defer this call with useEffect() or pass a custom UserManager implementation.`)},n3e=typeof window>"u"?null:XLe,r3e=t=>{const{children:e,onSigninCallback:n,skipSigninCallback:r,onRemoveUser:i,onSignoutRedirect:o,onSignoutPopup:a,implementation:s=n3e,userManager:l,...c}=t,[u]=M.useState(()=>l??(s?new s(c):{settings:c})),[f,d]=M.useReducer(YLe,QLe),h=M.useMemo(()=>Object.assign({settings:u.settings,events:u.events},Object.fromEntries(e3e.map(x=>{var b,_;return[x,(_=(b=u[x])==null?void 0:b.bind(u))!=null?_:DA(x)]})),Object.fromEntries(t3e.map(x=>[x,u[x]?async(...b)=>{d({type:"NAVIGATOR_INIT",method:x});try{return await u[x](...b)}finally{d({type:"NAVIGATOR_CLOSE"})}}:DA(x)]))),[u]),p=M.useRef(!1);M.useEffect(()=>{!u||p.current||(p.current=!0,(async()=>{let x=null;try{KLe()&&!r&&(x=await u.signinCallback(),n&&n(x)),x=x||await u.getUser(),d({type:"INITIALISED",user:x})}catch(b){d({type:"ERROR",error:JLe(b)})}})())},[u,r,n]),M.useEffect(()=>{if(!u)return;const x=S=>{d({type:"USER_LOADED",user:S})};u.events.addUserLoaded(x);const b=()=>{d({type:"USER_UNLOADED"})};u.events.addUserUnloaded(b);const _=S=>{d({type:"ERROR",error:S})};return u.events.addSilentRenewError(_),()=>{u.events.removeUserLoaded(x),u.events.removeUserUnloaded(b),u.events.removeSilentRenewError(_)}},[u]);const m=M.useCallback(u?()=>u.removeUser().then(i):DA("removeUser"),[u,i]),g=M.useCallback(x=>h.signoutRedirect(x).then(o),[h.signoutRedirect,o]),v=M.useCallback(x=>h.signoutPopup(x).then(a),[h.signoutPopup,a]),y=M.useCallback(x=>h.signoutSilent(x),[h.signoutSilent]);return ue.createElement($5.Provider,{value:{...f,...h,removeUser:m,signoutRedirect:g,signoutPopup:v,signoutSilent:y}},e)},i3e=()=>{const t=ue.useContext($5);if(!t)throw new Error("AuthProvider context is undefined, please verify you are calling useAuth() as child of a <AuthProvider> component.");return t};const fG="color:green;font-weight:bold;",o3e="color:blue;font-weight:bold;";class a3e{constructor(e){Yt(this,"_languages");Yt(this,"_content");Yt(this,"_locale");const n=Object.getOwnPropertyNames(e.languages);if(n.findIndex(i=>i==="en")<0)throw new Error('Internal error: locale "en" must be included in supported languages');const r={};e.dictionary.forEach((i,o)=>{n.forEach(s=>{if(!i[s])throw new Error(`Internal error: invalid entry at index ${o} in "./resources/lang.json": missing translation for locale: "${s}": ${i}`)});const a=dG(i.en);r[a]&&console.warn(`Translation already defined for "${i.en}".`),r[a]=i}),this._languages=e.languages,this._content=r,this._locale="en"}get languages(){return this._languages}get locale(){return this._locale}set locale(e){const n=Object.getOwnPropertyNames(this._languages);if(n.findIndex(r=>r===e)<0){const r=e.split("-")[0];if(n.findIndex(i=>i===r)<0){console.error(`No translations found for locale "${e}", staying with "${this._locale}".`);return}else console.warn(`No translations found for locale "${e}", falling back to "${r}".`),e=r}this._locale=e}get(e,n){const r=dG(e),i=this._content[r];let o;return i?(o=i[this._locale],o||(console.debug(`missing translation of phrase %c${e}`,fG,` for locale %c${this._locale}`,o3e),o=e)):(console.debug(`missing translation for phrase %c${e}`,fG),o=e),n&&Object.keys(n).forEach(a=>{o=o.replace("${"+a+"}",`${n[a]}`)}),o}}const s3e=()=>{let t;return navigator.languages&&navigator.languages.length>0?t=navigator.languages[0]:t=navigator.language||navigator.userLanguage||navigator.browserLanguage||"en",t.split("-")[0]},dG=t=>t.toLowerCase(),l3e={en:"English",de:"Deutsch",se:"Svenska"},c3e=[{en:"OK",de:"OK",se:"OK"},{en:"Cancel",de:"Abbrechen",se:"Avbryt"},{en:"Save",de:"Speichern",se:"Spara"},{en:"Select",de:"Auswählen",se:"Välj"},{en:"Add",de:"Hinzufügen",se:"Lägg till"},{en:"Edit",de:"Bearbeiten",se:"Redigera"},{en:"Remove",de:"Entfernen",se:"Ta bort"},{en:"Dataset",de:"Datensatz",se:"Dataset"},{en:"Variable",de:"Variable",se:"Variabel"},{en:"My places",de:"Meine Orte",se:"Mina platser"},{en:"Loading places",de:"Lade Orte",se:"Laddar platser"},{en:"Places",de:"Orte",se:"Platser"},{en:"Place",de:"Ort",se:"Plats"},{en:"Time",de:"Zeit",se:"Tid"},{en:"Missing time axis",de:"Fehlende Zeitachse",se:"Saknar tidsaxel"},{en:"Geometry type",de:"Geometry-Typ",se:"Geometri typ"},{en:"Point",de:"Punkt",se:"Punkt"},{en:"Polygon",de:"Polygon",se:"Polygon"},{en:"Circle",de:"Kreis",se:"Cirkel"},{en:"Multi",de:"Multi",se:"Multi"},{en:"Something went wrong.",de:"Irgendetwas lief schief.",se:"Något gick fel."},{en:"Time-Series",de:"Zeitserie",se:"Tidsserier"},{en:"Quantity",de:"Größe",se:"Kvantitet"},{en:"unknown units",de:"unbekannte Einheiten",se:"okända enheter"},{en:"Values",de:"Werte",se:"Värden"},{en:"Start",de:"Start",se:"Start"},{en:"Stop",de:"Stopp",se:"Stopp"},{en:"Please wait...",de:"Bitte warten...",se:"Vänta ..."},{en:"Loading data",de:"Lade Daten",se:"Laddar data"},{en:"Connecting to server",de:"Verbindung zum Server wird hergestellt",se:"Ansluta till servern"},{en:"Cannot reach server",de:"Kann Server nicht erreichen",se:"Kan inte nå servern"},{en:"Language",de:"Sprache",se:"Språk"},{en:"Settings",de:"Einstellungen",se:"Inställningar"},{en:"General",de:"Allgemein",se:"Allmänhet"},{en:"System Information",de:"Systeminformation",se:"Systeminformation"},{en:"version",de:"Version",se:"Version"},{en:"Server",de:"Server",se:"Server"},{en:"Add Server",de:"Server hinzufügen",se:"Lägg till server"},{en:"Edit Server",de:"Server bearbeiten",se:"Redigera server"},{en:"Select Server",de:"Server auswählen",se:"Välj server"},{en:"On",de:"An",se:"På"},{en:"Off",de:"Aus",se:"Av"},{en:"Time interval of the player",de:"Zeitintervall des Abspielers",se:"Spelarens tidsintervall"},{en:"Show chart after adding a place",de:"Diagram anzeigen, nachdem ein Ort hinzugefügt wurde",se:"Visa diagram efter att du har lagt till en plats"},{en:"Calculate standard deviation",de:"Berechne Standardabweichung",se:"Beräkna standardavvikelsen"},{en:"Calculate median instead of mean (disables standard deviation)",de:"Median statt Mittelwert berechnen (deaktiviert Standardabweichung)",se:"Beräkna median istället för medelvärde (inaktiverar standardavvikelse)"},{en:"Minimal number of data points in a time series update",de:"Minimale Anzahl Datenpunkte in einer Zeitreihen-Aktualisierung",se:"Minimalt antal datapunkter i en tidsserieuppdatering"},{en:"Map",de:"Karte",se:"Karta"},{en:"Projection",de:"Projektion",se:"Projektion"},{en:"Geographic",de:"Geografisch",se:"Geografiskt"},{en:"Mercator",de:"Mercator",se:"Mercator"},{en:"Image smoothing",de:"Bildglättung",se:"Bildutjämning"},{en:"Show dataset boundaries",de:"Datensatzgrenzen anzeigen",se:"Visa datauppsättningsgränser"},{en:"Base map",de:"Basiskarte",se:"Grundkarta"},{en:"Hide small values",de:"Kleine Werte ausblenden",se:"Dölja små värden"},{en:"Reverse",de:"Umkehren",se:"Omvänt"},{en:"Color",de:"Farbe",se:"Färg"},{en:"Opacity",de:"Opazität",se:"Opacitet"},{en:"Value Range",de:"Wertebereich",se:"Värdeintervall"},{en:"Assign min/max from color mapping values",de:"Min./Max. aus Farbzuordnungswerten übertragen",se:"Tilldela min/max från färgmappningsvärden"},{en:"Log-scaled",de:"Log-skaliert",se:"Log-skalad"},{en:"Logarithmic scaling",de:"Logarithmische Skalierung",se:"Logaritmisk skalning"},{en:"Others",de:"Andere",se:"Andra"},{en:"Dataset information",de:"Informationen zum Datensatz",se:"Information om dataset"},{en:"Variable information",de:"Informationen zur Variablen",se:"Information om variabeln"},{en:"Place information",de:"Informationen zum Ort",se:"Platsinformation"},{en:"Dimension names",de:"Namen der Dimensionen",se:"Dimensioner namn"},{en:"Dimension data types",de:"Datentypen der Dimensionen",se:"Dimensionsdatatyper"},{en:"Dimension lengths",de:"Länge der Dimensionen",se:"Måttlängder"},{en:"Time chunk size",de:"Zeitblockgröße",se:"Tidsblockstorlek"},{en:"Geographical extent",de:"Geografische Ausdehnung",se:"Geografisk omfattning"},{en:"Spatial reference system",de:"Räumliches Bezugssystem",se:"Rumsligt referenssystem"},{en:"Name",de:"Name",se:"Namn"},{en:"Title",de:"Titel",se:"Titel"},{en:"Units",de:"Einheiten",se:"Enheter"},{en:"Expression",de:"Ausdruck",se:"Uttryck"},{en:"Data type",de:"Datentyp",se:"Datatyp"},{en:"There is no information available for this location.",de:"Zu diesem Ort sind keine keine Informationen vorhanden.",se:"Det finns ingen information tillgänglig för den här platsen."},{en:"Log out",de:"Abmelden",se:"Logga ut"},{en:"Profile",de:"Profil",se:"Profil"},{en:"User Profile",de:"Nutzerprofil",se:"Användarprofil"},{en:"User name",de:"Nutzername",se:"Användarnamn"},{en:"E-mail",de:"E-mail",se:"E-post"},{en:"Nickname",de:"Spitzname",se:"Smeknamn"},{en:"verified",de:"verifiziert",se:"verified"},{en:"not verified",de:"nicht verifiziert",se:"inte verifierad"},{en:"RGB",de:"RGB",se:"RGB"},{en:"Imprint",de:"Impressum",se:"Avtryck"},{en:"User Manual",de:"Benutzerhandbuch",se:"Användarmanual"},{en:"Show time-series diagram",de:"Zeitserien-Diagramm anzeigen",se:"Visa tidsseriediagram"},{en:"Help",de:"Hilfe",se:"Hjälp"},{en:"Copy snapshot of chart to clipboard",de:"Schnappschuss des Diagramms in die Zwischenablage kopieren",se:"Kopiera ögonblicksbild av diagrammet till urklipp"},{en:"Snapshot copied to clipboard",de:"Schnappschuss wurde in die Zwischenablage kopiert",se:"Ögonblicksbild har kopierats till urklipp"},{en:"Error copying snapshot to clipboard",de:"Fehler beim Kopieren des Schnappschusses in die Zwischenablage",se:"Det gick inte att kopiera ögonblicksbilden till urklipp"},{en:"Export data",de:"Daten exportieren",se:"Exportera data"},{en:"Export Settings",de:"Export-Einstellungen",se:"Exportera Inställningar"},{en:"Include time-series data",de:"Zeitseriendaten einschließen",se:"Inkludera tidsseriedata"},{en:"Include places data",de:"Ortsdaten einschließen",se:"Inkludera platsdata"},{en:"File name",de:"Dateiname",se:"Filnamn"},{en:"Separator for time-series data",de:"Trennzeichen für Zeitreihendaten",se:"Separator för tidsseriedata"},{en:"Combine place data in one file",de:"Ortsdaten in einer Datei zusammenfassen",se:"Kombinera platsdata i en fil"},{en:"As ZIP archive",de:"Als ZIP-Archiv",se:"Som ett ZIP-arkiv"},{en:"Download",de:"Herunterladen",se:"Ladda ner"},{en:"Locate place in map",de:"Lokalisiere Ort in Karte",se:"Leta upp plats på kartan"},{en:"Locate dataset in map",de:"Lokalisiere Datensatz in Karte",se:"Leta upp dataset på kartan"},{en:"Open information panel",de:"Informationsfeld öffnen",se:"Öppet informationsfält"},{en:"Select a place in map",de:"Ort in der Karte auswählen",se:"Välj plats på kartan"},{en:"Add a point location in map",de:"Punkt zur Karte hinzufügen",se:"Lägg till punkt på kartan"},{en:"Draw a polygon area in map",de:"Polygonale Fläche in der Karte zeichnen",se:"Rita en polygonal yta på kartan"},{en:"Draw a circular area in map",de:"Kreisförmige Fläche in der Karte zeichnen",se:"Rita ett cirkulärt område på kartan"},{en:"Rename place",de:"Ort umbenennen",se:"Byt namn på plats"},{en:"Remove place",de:"Ort entfernen",se:"Ta bort plats"},{en:"Rename place group",de:"Ortsgruppe umbenennen",se:"Byt namn på platsgrupp"},{en:"Remove places",de:"Orte entfernen",se:"Ta bort platser"},{en:"Show RGB layer instead",de:"Stattdessen RGB-Layer anzeigen",se:"Visa RGB-lager istället"},{en:"Auto-step through times in the dataset",de:"Zeiten im Datensatz automatisch durchlaufen",se:"Kör automatiskt genom tider i dataposten"},{en:"Select time in dataset",de:"Datensatz-Zeit auswählen",se:"Välj tid i dataset"},{en:"Refresh",de:"Aktualisieren",se:"Att uppdatera"},{en:"Accept and continue",de:"Akzeptieren und weiter",se:"Acceptera och fortsätt"},{en:"Leave",de:"Verlassen",se:"Lämna"},{en:"Import places",de:"Orte importieren",se:"Importera platser"},{en:"Text/CSV",de:"Text/CSV",se:"Text/CSV"},{en:"GeoJSON",de:"GeoJSON",se:"GeoJSON"},{en:"WKT",de:"WKT",se:"WKT"},{en:"Enter text or drag & drop a text file.",de:"Text eingeben oder Textdatei per Drag & Drop einfügen.",se:"Skriv in text eller dra och släpp en textfil."},{en:"From File",de:"Aus Datei",se:"Från fil"},{en:"Clear",de:"Löschen",se:"Tömma"},{en:"Options",de:"Optionen",se:"Alternativ"},{en:"Time (UTC, ISO-format)",de:"Zeit (UTC, ISO-Format)",se:"Tid (UTC, ISO-format)"},{en:"Group",de:"Gruppe",se:"Grupp"},{en:"Label",de:"Label",se:"Etikett"},{en:"Time property names",de:"Eigenschaftsnamen für Zeit",se:"Gruppegendomsnamn"},{en:"Group property names",de:"Eigenschaftsnamen für Gruppe",se:"Gruppegendomsnamn"},{en:"Label property names",de:"Eigenschaftsnamen für Label",se:"Etikett egendomsnamn"},{en:"Group prefix (used as fallback)",de:"Gruppen-Präfix (als Fallback verwendet)",se:"Gruppprefix (används som reserv)"},{en:"Label prefix (used as fallback)",de:"Label-Präfix (als Fallback verwendet)",se:"Etikettprefix (används som reserv)"},{en:"X/longitude column names",de:"Spaltennamen für y/Längengrad",se:"X/longitud kolumnnamn"},{en:"Y/latitude column names",de:"Spaltennamen für y/Breitengrad",se:"Y/latitud kolumnnamn"},{en:"Geometry column names",de:"Spaltennamen für Geometrie",se:"Geometrikolumnnamn"},{en:"Time column names",de:"Spaltennamen für Zeit",se:"Tidskolumnnamn"},{en:"Group column names",de:"Spaltennamen für Gruppe",se:"Gruppkolumnnamn"},{en:"Label column names",de:"Spaltennamen für Label",se:"Etikettkolumnnamn"},{en:"Separator character",de:"Trennzeichen",se:"Skiljetecken"},{en:"Comment character",de:"Kommentar-Zeichen",se:"Kommentar karaktär"},{en:"Quote character",de:"Zitierzeichen",se:"Citat karaktär"},{en:"Escape character",de:"Escape character",se:"Escape karaktär"},{en:"Not-a-number token",de:"Token für 'keine Zahl'",se:"Not-a-number token"},{en:"True token",de:"Token für 'wahr'",se:"Sann token"},{en:"False token",de:"Token für 'falsch'",se:"Falsk token"},{en:"Revoke consent",de:"Zustimmung widerrufen",se:"Återkalla samtycke "},{en:"Accepted",de:"Akzeptiert",se:"Accepterad"},{en:"Legal Agreement",de:"Rechtliches Übereinkommen",se:"Laglig Överenskommelse"},{en:"Privacy Notice",de:"Datenschutzhinweis",se:"Sekretessmeddelande"},{en:"WMS URL",de:"WMS URL",se:"WMS URL"},{en:"WMS Layer",de:"WMS Layer",se:"WMS Lager"},{en:"Add layer from a Web Map Service",de:"Layer aus einem Web Map Service hinzufügen",se:"Lägg till lager från en Web Map Service"},{en:"Add layer from a Tiled Web Map",de:"Layer aus einer Tiled Web Map hinzufügen",se:"Lägg till lager från en Tiled Web Map"},{en:"Show or hide layers panel",de:"Layer-Bedienfeld ein- oder ausblenden",se:"Visa eller dölj panelen Lager"},{en:"Turn layer split mode on or off",de:"Layer-Split-Modus ein- oder ausschalten",se:"Aktivera eller inaktivera lagerdelningsläget"},{en:"Turn info box on or off",de:"Infobox ein- oder ausschalten",se:"Slå på eller av informationsrutan"},{en:"Show or hide sidebar",de:"Seitenleiste ein- oder ausblenden",se:"Visa eller dölja sidofält"},{en:"Unknown color bar",de:"Unbekannte Farbskala",se:"Färgskala okänd"},{en:"Points",de:"Punkte",se:"Punkter"},{en:"Lines",de:"Linien",se:"Linjer"},{en:"Bars",de:"Balken",se:"Staplar"},{en:"Default chart type",de:"Diagrammtyp (default)",se:"Diagramtyp (default)"},{en:"User Base Maps",de:"Nutzer Basiskarte",se:"Användare Grundkarta"},{en:"Overlay",de:"Overlay (überlagernder Layer)",se:"Overlay (överliggande lager)"},{en:"User Overlays",de:"Nutzer Overlay",se:"Användare Overlay"},{en:"On dataset selection",de:"Bei Auswahl von Datensatz",se:"Vid val av dataset"},{en:"On place selection",de:"Bei Auswahl von Ort",se:"Vid val av plats"},{en:"Do nothing",de:"Nichts tun",se:"Gör ingenting"},{en:"Pan",de:"Verschieben",se:"Panorera"},{en:"Pan and zoom",de:"Verschieben und zoom",se:"Panorera och zooma"},{en:"User Layers",de:"Nutzer Layer",se:"Användare lager"},{en:"XYZ Layer URL",de:"XYZ-Layer URL",se:"XYZ lager URL"},{en:"Layer Title",de:"Layer Titel",se:"Lagertitel "},{en:"Layer Attribution",de:"Layer Attribution",se:"Lagerattribution"},{en:"Info",de:"Info",se:"Info"},{en:"Charts",de:"Diagramme",se:"Diagrammer"},{en:"Statistics",de:"Statistik",se:"Statistik"},{en:"Volume",de:"Volumen",se:"Volym"},{en:"Toggle zoom mode (or press CTRL key)",de:"Zoom-Modus umschalten (oder drücke CTRL-Taste)",se:"Växla zoomläge (eller tryck på CTRL-tangenten)"},{en:"Enter fixed y-range",de:"Festen y-Bereich angeben",se:"Ange fast y-intervall"},{en:"Toggle showing info popup on hover",de:"Anzeige des Info-Popups bei Hover umschalten",se:"Växla visning av popup-info vid hover"},{en:"Show points",de:"Punkte anzeigen",se:"Visa punkter"},{en:"Show lines",de:"Linien anzeigen",se:"Visa linjer"},{en:"Show bars",de:"Balken anzeigen",se:"Visa staplar"},{en:"Show standard deviation (if any)",de:"Standardabweichung anzeigen",se:"Visa standardavvikelsen"},{en:"Add time-series from places",de:"Zeitserien hinzufügen von Orten",se:"Lägg till tidsserier från platser"},{en:"Zoom to full range",de:"Zoom auf gesamten x-Bereich",se:"Zooma till hela x-intervallet"},{en:"Make it 2nd variable for comparison",de:"Festlegen als 2. Variable für Vergleich",se:"Ställ in som 2:a variabel för jämförelse"},{en:"Load Volume Data",de:"Lade Volumendaten",se:"Ladda volymdata"},{en:"Please note that the 3D volume rendering is still an experimental feature.",de:"Bitte beachte, dass das 3D-Volumen-Rendering noch eine experimentelle Funktion ist.",se:"Observera att 3D-volymrendering fortfarande är en experimentell funktion."},{en:"User-defined color bars.",de:"Benutzerdefinierte Farbskalen.",se:"Användardefinierade färgskalor."},{en:"Contin.",de:"Kontin.",se:"Kontin."},{en:"Stepwise",de:"Schrittw.",se:"Stegvis"},{en:"Categ.",de:"Kateg.",se:"Kateg."},{en:"Continuous color assignment, where each value represents a support point of a color gradient",de:"Kontinuierliche Farbzuordnung, bei der jeder Wert eine Stützstelle eines Farbverlaufs darstellt",se:"Kontinuerlig färgtilldelning där varje värde representerar en punkt i en färggradient"},{en:"Stepwise color mapping where values are bounds of value ranges mapped to the same color",de:"Schrittweise Farbzuordnung, bei der die Werte Bereichsgrenzen darstellen, die einer einzelnen Farbe zugeordnet werden",se:"Gradvis färgmappning, där värdena representerar intervallgränser mappade till en enda färg"},{en:"Values represent unique categories or indexes that are mapped to a color",de:"Werte stellen eindeutige Kategorien oder Indizes dar, die einer Farbe zugeordnet sind",se:"Värden representerar unika kategorier eller index som är mappade till en färg"},{en:"User",de:"Nutzer",se:"Användare"},{en:"Add Time-Series",de:"Zeitserien hinzufügen",se:"Lägg till tidsserier"},{en:"No time-series have been obtained yet. Select a variable and a place first.",de:"Es wurden noch keine Zeitreihen abgerufen. Wähle zuerst eine Variable und einen Ort aus.",se:"Inga tidsserier har hämtats ännu. Välj först en variabel och en plats."},{en:"Count",de:"Anzahl",se:"Antal"},{en:"Minimum",de:"Minimum",se:"Minimum"},{en:"Maximum",de:"Maximum",se:"Maximum"},{en:"Mean",de:"Mittelwert",se:"Medelvärde"},{en:"Deviation",de:"Abweichung",se:"Avvikelse"},{en:"Toggle adjustable x-range",de:"Anpassbaren x-Bereich umschalten",se:"Växla justerbart x-intervall"},{en:"pinned",de:"angepinnt",se:"fäst"},{en:"Compare Mode (Drag)",de:"Vergleichsmodus (Ziehen)",se:"Jämförelseläge (Dra)"},{en:"Point Info Mode (Hover)",de:"Punktinformationsmodus (Bewegen)",se:"Punktinformationsläge (Sväva)"},{en:"Dataset RGB",de:"Datensatz RGB",se:"Dataset RGB"},{en:"Dataset RGB 2",de:"Datensatz RGB 2",se:"Dataset RGB 2"},{en:"Dataset Variable",de:"Datensatz Variable",se:"Dataset Variabel"},{en:"Dataset Variable 2",de:"Datensatz Variable 2",se:"Dataset Variabel 2"},{en:"Dataset Boundary",de:"Datensatz Außengrenze",se:"Dataset Yttre Gräns"},{en:"Dataset Places",de:"Datensatz Orte",se:"Dataset Platser"},{en:"User Places",de:"Nutzer Orte",se:"Användare Platser"},{en:"Layers",de:"Layer",se:"Lager"},{en:"User Variables",de:"Nutzer-Variablen",se:"Användarvariabler"},{en:"Create and manage user variables",de:"Nutzer-Variablen erstellen und verwalten",se:"Skapa och hantera användarvariabler"},{en:"Manage user variables",de:"Nutzer-Variablen verwalten",se:"Hantera användarvariabler"},{en:"Add user variable",de:"Nutzer-Variable hinzufügen",se:"Lägg till användarvariabel"},{en:"Duplicate user variable",de:"Nutzer-Variable duplizieren",se:"Duplicera användarvariabel"},{en:"Edit user variable",de:"Nutzer-Variable bearbeiten",se:"Redigera användarvariabel"},{en:"Remove user variable",de:"Nutzer-Variable löschen",se:"Ta bort användarvariabel"},{en:"Use keys CTRL+SPACE to show autocompletions",de:"Tasten STRG+LEER benutzen, um Autovervollständigungen zu zeigen",se:"Använd tangenterna CTRL+MELLANSLAG för att visa autoslutföranden"},{en:"Display further elements to be used in expressions",de:"Weitere Elemente anzeigen, die in Ausdrücken verwendet werden können",se:"Visa fler element som kan användas i uttryck"},{en:"Variables",de:"Variablen",se:"Variabler"},{en:"Constants",de:"Konstanten",se:"Konstanter"},{en:"Array operators",de:"Array-Operatoren",se:"Arrayoperatorer"},{en:"Other operators",de:"Andere Operatoren",se:"Andra Operatorer"},{en:"Array functions",de:"Array-Funktionen",se:"Arrayfunktioner"},{en:"Other functions",de:"Andere Funktionen",se:"Andra funktioner"},{en:"Not a valid identifier",de:"Kein gültiger Bezeichner",se:"Inte en giltig identifierare"},{en:"Must not be empty",de:"Darf nicht leer sein",se:"Får inte vara tom"},{en:"docs/privacy-note.en.md",de:"docs/privacy-note.de.md",se:"docs/privacy-note.se.md"},{en:"docs/add-layer-wms.en.md",de:"docs/add-layer-wms.de.md",se:"docs/add-layer-wms.se.md"},{en:"docs/add-layer-xyz.en.md",de:"docs/add-layer-xyz.de.md",se:"docs/add-layer-xyz.se.md"},{en:"docs/color-mappings.en.md",de:"docs/color-mappings.de.md",se:"docs/color-mappings.se.md"},{en:"docs/user-variables.en.md",de:"docs/user-variables.de.md",se:"docs/user-variables.se.md"}],u3e={languages:l3e,dictionary:c3e},fe=new a3e(u3e);fe.locale=s3e();class Oie extends M.Component{constructor(e){super(e),this.state={error:null}}static getDerivedStateFromError(e){return{error:e}}componentDidCatch(e,n){console.error(e),n.componentStack&&console.error(n.componentStack)}render(){if(!this.props.children)throw new Error("An ErrorBoundary requires at least one child");return this.state.error?w.jsxs("div",{children:[w.jsx("h2",{className:"errorBoundary-header",children:fe.get("Something went wrong.")}),w.jsxs("details",{className:"errorBoundary-details",style:{whiteSpace:"pre-wrap"},children:[this.state.error.toString(),w.jsx("br",{})]})]}):this.props.children}}const f3e=({children:t})=>{const e=Kt.instance.authClient;if(!e)return w.jsx(w.Fragment,{children:t});const n=o=>{console.info("handleSigninCallback:",o),window.history.replaceState({},document.title,window.location.pathname)},r=()=>{console.info("handleRemoveUser"),window.location.pathname="/"},i=r2.href;return w.jsx(Oie,{children:w.jsx(r3e,{...e,loadUserInfo:!0,scope:"openid email profile",automaticSilentRenew:!0,redirect_uri:i,post_logout_redirect_uri:i,popup_post_logout_redirect_uri:i,onSigninCallback:n,onRemoveUser:r,children:t})})};var F5={},LA={};const d3e=Ea(fCe);var hG;function pt(){return hG||(hG=1,function(t){"use client";Object.defineProperty(t,"__esModule",{value:!0}),Object.defineProperty(t,"default",{enumerable:!0,get:function(){return e.createSvgIcon}});var e=d3e}(LA)),LA}var h3e=ft;Object.defineProperty(F5,"__esModule",{value:!0});var j5=F5.default=void 0,p3e=h3e(pt()),m3e=w;j5=F5.default=(0,p3e.default)((0,m3e.jsx)("path",{d:"M11 18h2v-2h-2zm1-16C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2m0 18c-4.41 0-8-3.59-8-8s3.59-8 8-8 8 3.59 8 8-3.59 8-8 8m0-14c-2.21 0-4 1.79-4 4h2c0-1.1.9-2 2-2s2 .9 2 2c0 2-3 1.75-3 5h2c0-2.25 3-2.5 3-5 0-2.21-1.79-4-4-4"}),"HelpOutline");var B5={},g3e=ft;Object.defineProperty(B5,"__esModule",{value:!0});var z5=B5.default=void 0,v3e=g3e(pt()),y3e=w;z5=B5.default=(0,v3e.default)((0,y3e.jsx)("path",{d:"M19.14 12.94c.04-.3.06-.61.06-.94 0-.32-.02-.64-.07-.94l2.03-1.58c.18-.14.23-.41.12-.61l-1.92-3.32c-.12-.22-.37-.29-.59-.22l-2.39.96c-.5-.38-1.03-.7-1.62-.94l-.36-2.54c-.04-.24-.24-.41-.48-.41h-3.84c-.24 0-.43.17-.47.41l-.36 2.54c-.59.24-1.13.57-1.62.94l-2.39-.96c-.22-.08-.47 0-.59.22L2.74 8.87c-.12.21-.08.47.12.61l2.03 1.58c-.05.3-.09.63-.09.94s.02.64.07.94l-2.03 1.58c-.18.14-.23.41-.12.61l1.92 3.32c.12.22.37.29.59.22l2.39-.96c.5.38 1.03.7 1.62.94l.36 2.54c.05.24.24.41.48.41h3.84c.24 0 .44-.17.47-.41l.36-2.54c.59-.24 1.13-.56 1.62-.94l2.39.96c.22.08.47 0 .59-.22l1.92-3.32c.12-.22.07-.47-.12-.61zM12 15.6c-1.98 0-3.6-1.62-3.6-3.6s1.62-3.6 3.6-3.6 3.6 1.62 3.6 3.6-1.62 3.6-3.6 3.6"}),"Settings");var U5={},x3e=ft;Object.defineProperty(U5,"__esModule",{value:!0});var W5=U5.default=void 0,b3e=x3e(pt()),_3e=w;W5=U5.default=(0,b3e.default)((0,_3e.jsx)("path",{d:"M17.65 6.35C16.2 4.9 14.21 4 12 4c-4.42 0-7.99 3.58-7.99 8s3.57 8 7.99 8c3.73 0 6.84-2.55 7.73-6h-2.08c-.82 2.33-3.04 4-5.65 4-3.31 0-6-2.69-6-6s2.69-6 6-6c1.66 0 3.14.69 4.22 1.78L13 11h7V4z"}),"Refresh");var V5={},w3e=ft;Object.defineProperty(V5,"__esModule",{value:!0});var Cie=V5.default=void 0,S3e=w3e(pt()),pG=w;Cie=V5.default=(0,S3e.default)([(0,pG.jsx)("path",{d:"m21 5-9-4-9 4v6c0 5.55 3.84 10.74 9 12 2.3-.56 4.33-1.9 5.88-3.71l-3.12-3.12c-1.94 1.29-4.58 1.07-6.29-.64-1.95-1.95-1.95-5.12 0-7.07 1.95-1.95 5.12-1.95 7.07 0 1.71 1.71 1.92 4.35.64 6.29l2.9 2.9C20.29 15.69 21 13.38 21 11z"},"0"),(0,pG.jsx)("circle",{cx:"12",cy:"12",r:"3"},"1")],"Policy");var G5={},O3e=ft;Object.defineProperty(G5,"__esModule",{value:!0});var H5=G5.default=void 0,C3e=O3e(pt()),T3e=w;H5=G5.default=(0,C3e.default)((0,T3e.jsx)("path",{d:"M19.35 10.04C18.67 6.59 15.64 4 12 4 9.11 4 6.6 5.64 5.35 8.04 2.34 8.36 0 10.91 0 14c0 3.31 2.69 6 6 6h13c2.76 0 5-2.24 5-5 0-2.64-2.05-4.78-4.65-4.96M17 13l-5 5-5-5h3V9h4v4z"}),"CloudDownload");var ac=function(){function t(e){this.propagationStopped,this.defaultPrevented,this.type=e,this.target=null}return t.prototype.preventDefault=function(){this.defaultPrevented=!0},t.prototype.stopPropagation=function(){this.propagationStopped=!0},t}();const nv={PROPERTYCHANGE:"propertychange"};var q5=function(){function t(){this.disposed=!1}return t.prototype.dispose=function(){this.disposed||(this.disposed=!0,this.disposeInternal())},t.prototype.disposeInternal=function(){},t}();function E3e(t,e,n){for(var r,i,o=rp,a=0,s=t.length,l=!1;a<s;)r=a+(s-a>>1),i=+o(t[r],e),i<0?a=r+1:(s=r,l=!i);return l?a:~a}function rp(t,e){return t>e?1:t<e?-1:0}function X5(t,e,n){var r=t.length;if(t[0]<=e)return 0;if(e<=t[r-1])return r-1;var i=void 0;if(n>0){for(i=1;i<r;++i)if(t[i]<e)return i-1}else if(n<0){for(i=1;i<r;++i)if(t[i]<=e)return i}else for(i=1;i<r;++i){if(t[i]==e)return i;if(t[i]<e)return typeof n=="function"?n(e,t[i-1],t[i])>0?i-1:i:t[i-1]-e<e-t[i]?i-1:i}return r-1}function P3e(t,e,n){for(;e<n;){var r=t[e];t[e]=t[n],t[n]=r,++e,--n}}function Zc(t,e){for(var n=Array.isArray(e)?e:[e],r=n.length,i=0;i<r;i++)t[t.length]=n[i]}function kp(t,e){var n=t.length;if(n!==e.length)return!1;for(var r=0;r<n;r++)if(t[r]!==e[r])return!1;return!0}function M3e(t,e,n){var r=e||rp;return t.every(function(i,o){if(o===0)return!0;var a=r(t[o-1],i);return!(a>0||a===0)})}function Fh(){return!0}function F1(){return!1}function ip(){}function k3e(t){var e=!1,n,r,i;return function(){var o=Array.prototype.slice.call(arguments);return(!e||this!==i||!kp(o,r))&&(e=!0,i=this,r=o,n=t.apply(this,arguments)),n}}var ur=typeof Object.assign=="function"?Object.assign:function(t,e){if(t==null)throw new TypeError("Cannot convert undefined or null to object");for(var n=Object(t),r=1,i=arguments.length;r<i;++r){var o=arguments[r];if(o!=null)for(var a in o)o.hasOwnProperty(a)&&(n[a]=o[a])}return n};function j1(t){for(var e in t)delete t[e]}var Tie=typeof Object.values=="function"?Object.values:function(t){var e=[];for(var n in t)e.push(t[n]);return e};function rv(t){var e;for(e in t)return!1;return!e}var A3e=function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,i){r.__proto__=i}||function(r,i){for(var o in i)Object.prototype.hasOwnProperty.call(i,o)&&(r[o]=i[o])},t(e,n)};return function(e,n){if(typeof n!="function"&&n!==null)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");t(e,n);function r(){this.constructor=e}e.prototype=n===null?Object.create(n):(r.prototype=n.prototype,new r)}}(),oy=function(t){A3e(e,t);function e(n){var r=t.call(this)||this;return r.eventTarget_=n,r.pendingRemovals_=null,r.dispatching_=null,r.listeners_=null,r}return e.prototype.addEventListener=function(n,r){if(!(!n||!r)){var i=this.listeners_||(this.listeners_={}),o=i[n]||(i[n]=[]);o.indexOf(r)===-1&&o.push(r)}},e.prototype.dispatchEvent=function(n){var r=typeof n=="string",i=r?n:n.type,o=this.listeners_&&this.listeners_[i];if(o){var a=r?new ac(n):n;a.target||(a.target=this.eventTarget_||this);var s=this.dispatching_||(this.dispatching_={}),l=this.pendingRemovals_||(this.pendingRemovals_={});i in s||(s[i]=0,l[i]=0),++s[i];for(var c,u=0,f=o.length;u<f;++u)if("handleEvent"in o[u]?c=o[u].handleEvent(a):c=o[u].call(this,a),c===!1||a.propagationStopped){c=!1;break}if(--s[i]===0){var d=l[i];for(delete l[i];d--;)this.removeEventListener(i,ip);delete s[i]}return c}},e.prototype.disposeInternal=function(){this.listeners_&&j1(this.listeners_)},e.prototype.getListeners=function(n){return this.listeners_&&this.listeners_[n]||void 0},e.prototype.hasListener=function(n){return this.listeners_?n?n in this.listeners_:Object.keys(this.listeners_).length>0:!1},e.prototype.removeEventListener=function(n,r){var i=this.listeners_&&this.listeners_[n];if(i){var o=i.indexOf(r);o!==-1&&(this.pendingRemovals_&&n in this.pendingRemovals_?(i[o]=ip,++this.pendingRemovals_[n]):(i.splice(o,1),i.length===0&&delete this.listeners_[n]))}},e}(q5);const Mt={CHANGE:"change",ERROR:"error",BLUR:"blur",CLEAR:"clear",CONTEXTMENU:"contextmenu",CLICK:"click",DBLCLICK:"dblclick",DRAGENTER:"dragenter",DRAGOVER:"dragover",DROP:"drop",FOCUS:"focus",KEYDOWN:"keydown",KEYPRESS:"keypress",LOAD:"load",RESIZE:"resize",TOUCHMOVE:"touchmove",WHEEL:"wheel"};function rn(t,e,n,r,i){if(r&&r!==t&&(n=n.bind(r)),i){var o=n;n=function(){t.removeEventListener(e,n),o.apply(this,arguments)}}var a={target:t,type:e,listener:n};return t.addEventListener(e,n),a}function LT(t,e,n,r){return rn(t,e,n,r,!0)}function nr(t){t&&t.target&&(t.target.removeEventListener(t.type,t.listener),j1(t))}var R3e=function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,i){r.__proto__=i}||function(r,i){for(var o in i)Object.prototype.hasOwnProperty.call(i,o)&&(r[o]=i[o])},t(e,n)};return function(e,n){if(typeof n!="function"&&n!==null)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");t(e,n);function r(){this.constructor=e}e.prototype=n===null?Object.create(n):(r.prototype=n.prototype,new r)}}(),B1=function(t){R3e(e,t);function e(){var n=t.call(this)||this;return n.on=n.onInternal,n.once=n.onceInternal,n.un=n.unInternal,n.revision_=0,n}return e.prototype.changed=function(){++this.revision_,this.dispatchEvent(Mt.CHANGE)},e.prototype.getRevision=function(){return this.revision_},e.prototype.onInternal=function(n,r){if(Array.isArray(n)){for(var i=n.length,o=new Array(i),a=0;a<i;++a)o[a]=rn(this,n[a],r);return o}else return rn(this,n,r)},e.prototype.onceInternal=function(n,r){var i;if(Array.isArray(n)){var o=n.length;i=new Array(o);for(var a=0;a<o;++a)i[a]=LT(this,n[a],r)}else i=LT(this,n,r);return r.ol_key=i,i},e.prototype.unInternal=function(n,r){var i=r.ol_key;if(i)I3e(i);else if(Array.isArray(n))for(var o=0,a=n.length;o<a;++o)this.removeEventListener(n[o],r);else this.removeEventListener(n,r)},e}(oy);B1.prototype.on;B1.prototype.once;B1.prototype.un;function I3e(t){if(Array.isArray(t))for(var e=0,n=t.length;e<n;++e)nr(t[e]);else nr(t)}function yt(){return function(){throw new Error("Unimplemented abstract method.")}()}var D3e=0;function vn(t){return t.ol_uid||(t.ol_uid=String(++D3e))}var L3e="6.15.1",Eie=function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,i){r.__proto__=i}||function(r,i){for(var o in i)Object.prototype.hasOwnProperty.call(i,o)&&(r[o]=i[o])},t(e,n)};return function(e,n){if(typeof n!="function"&&n!==null)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");t(e,n);function r(){this.constructor=e}e.prototype=n===null?Object.create(n):(r.prototype=n.prototype,new r)}}(),mG=function(t){Eie(e,t);function e(n,r,i){var o=t.call(this,n)||this;return o.key=r,o.oldValue=i,o}return e}(ac),sc=function(t){Eie(e,t);function e(n){var r=t.call(this)||this;return r.on,r.once,r.un,vn(r),r.values_=null,n!==void 0&&r.setProperties(n),r}return e.prototype.get=function(n){var r;return this.values_&&this.values_.hasOwnProperty(n)&&(r=this.values_[n]),r},e.prototype.getKeys=function(){return this.values_&&Object.keys(this.values_)||[]},e.prototype.getProperties=function(){return this.values_&&ur({},this.values_)||{}},e.prototype.hasProperties=function(){return!!this.values_},e.prototype.notify=function(n,r){var i;i="change:".concat(n),this.hasListener(i)&&this.dispatchEvent(new mG(i,n,r)),i=nv.PROPERTYCHANGE,this.hasListener(i)&&this.dispatchEvent(new mG(i,n,r))},e.prototype.addChangeListener=function(n,r){this.addEventListener("change:".concat(n),r)},e.prototype.removeChangeListener=function(n,r){this.removeEventListener("change:".concat(n),r)},e.prototype.set=function(n,r,i){var o=this.values_||(this.values_={});if(i)o[n]=r;else{var a=o[n];o[n]=r,a!==r&&this.notify(n,a)}},e.prototype.setProperties=function(n,r){for(var i in n)this.set(i,n[i],r)},e.prototype.applyProperties=function(n){n.values_&&ur(this.values_||(this.values_={}),n.values_)},e.prototype.unset=function(n,r){if(this.values_&&n in this.values_){var i=this.values_[n];delete this.values_[n],rv(this.values_)&&(this.values_=null),r||this.notify(n,i)}},e}(B1),N3e=function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,i){r.__proto__=i}||function(r,i){for(var o in i)Object.prototype.hasOwnProperty.call(i,o)&&(r[o]=i[o])},t(e,n)};return function(e,n){if(typeof n!="function"&&n!==null)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");t(e,n);function r(){this.constructor=e}e.prototype=n===null?Object.create(n):(r.prototype=n.prototype,new r)}}(),Pie=function(t){N3e(e,t);function e(n){var r=this,i="v"+L3e.split("-")[0],o="Assertion failed. See https://openlayers.org/en/"+i+"/doc/errors/#"+n+" for details.";return r=t.call(this,o)||this,r.code=n,r.name="AssertionError",r.message=o,r}return e}(Error);function Ut(t,e){if(!t)throw new Pie(e)}var $3e=function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,i){r.__proto__=i}||function(r,i){for(var o in i)Object.prototype.hasOwnProperty.call(i,o)&&(r[o]=i[o])},t(e,n)};return function(e,n){if(typeof n!="function"&&n!==null)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");t(e,n);function r(){this.constructor=e}e.prototype=n===null?Object.create(n):(r.prototype=n.prototype,new r)}}(),zc=function(t){$3e(e,t);function e(n){var r=t.call(this)||this;if(r.on,r.once,r.un,r.id_=void 0,r.geometryName_="geometry",r.style_=null,r.styleFunction_=void 0,r.geometryChangeKey_=null,r.addChangeListener(r.geometryName_,r.handleGeometryChanged_),n)if(typeof n.getSimplifiedGeometry=="function"){var i=n;r.setGeometry(i)}else{var o=n;r.setProperties(o)}return r}return e.prototype.clone=function(){var n=new e(this.hasProperties()?this.getProperties():null);n.setGeometryName(this.getGeometryName());var r=this.getGeometry();r&&n.setGeometry(r.clone());var i=this.getStyle();return i&&n.setStyle(i),n},e.prototype.getGeometry=function(){return this.get(this.geometryName_)},e.prototype.getId=function(){return this.id_},e.prototype.getGeometryName=function(){return this.geometryName_},e.prototype.getStyle=function(){return this.style_},e.prototype.getStyleFunction=function(){return this.styleFunction_},e.prototype.handleGeometryChange_=function(){this.changed()},e.prototype.handleGeometryChanged_=function(){this.geometryChangeKey_&&(nr(this.geometryChangeKey_),this.geometryChangeKey_=null);var n=this.getGeometry();n&&(this.geometryChangeKey_=rn(n,Mt.CHANGE,this.handleGeometryChange_,this)),this.changed()},e.prototype.setGeometry=function(n){this.set(this.geometryName_,n)},e.prototype.setStyle=function(n){this.style_=n,this.styleFunction_=n?F3e(n):void 0,this.changed()},e.prototype.setId=function(n){this.id_=n,this.changed()},e.prototype.setGeometryName=function(n){this.removeChangeListener(this.geometryName_,this.handleGeometryChanged_),this.geometryName_=n,this.addChangeListener(this.geometryName_,this.handleGeometryChanged_),this.handleGeometryChanged_()},e}(sc);function F3e(t){if(typeof t=="function")return t;var e;if(Array.isArray(t))e=t;else{Ut(typeof t.getZIndex=="function",41);var n=t;e=[n]}return function(){return e}}var ci={RADIANS:"radians",DEGREES:"degrees",FEET:"ft",METERS:"m",PIXELS:"pixels",TILE_PIXELS:"tile-pixels",USFEET:"us-ft"},Ks={};Ks[ci.RADIANS]=6370997/(2*Math.PI);Ks[ci.DEGREES]=2*Math.PI*6370997/360;Ks[ci.FEET]=.3048;Ks[ci.METERS]=1;Ks[ci.USFEET]=1200/3937;var Jf=typeof navigator<"u"&&typeof navigator.userAgent<"u"?navigator.userAgent.toLowerCase():"",j3e=Jf.indexOf("firefox")!==-1,B3e=Jf.indexOf("safari")!==-1&&Jf.indexOf("chrom")==-1;B3e&&(Jf.indexOf("version/15.4")>=0||Jf.match(/cpu (os|iphone os) 15_4 like mac os x/));var z3e=Jf.indexOf("webkit")!==-1&&Jf.indexOf("edge")==-1,U3e=Jf.indexOf("macintosh")!==-1,Mie=typeof devicePixelRatio<"u"?devicePixelRatio:1,o2=typeof WorkerGlobalScope<"u"&&typeof OffscreenCanvas<"u"&&self instanceof WorkerGlobalScope,W3e=typeof Image<"u"&&Image.prototype.decode,kie=function(){var t=!1;try{var e=Object.defineProperty({},"passive",{get:function(){t=!0}});window.addEventListener("_",null,e),window.removeEventListener("_",null,e)}catch{}return t}();new Array(6);function Hl(){return[1,0,0,1,0,0]}function V3e(t,e,n,r,i,o,a){return t[0]=e,t[1]=n,t[2]=r,t[3]=i,t[4]=o,t[5]=a,t}function G3e(t,e){return t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[3],t[4]=e[4],t[5]=e[5],t}function Cr(t,e){var n=e[0],r=e[1];return e[0]=t[0]*n+t[2]*r+t[4],e[1]=t[1]*n+t[3]*r+t[5],e}function H3e(t,e,n){return V3e(t,e,0,0,n,0,0)}function hu(t,e,n,r,i,o,a,s){var l=Math.sin(o),c=Math.cos(o);return t[0]=r*c,t[1]=i*l,t[2]=-r*l,t[3]=i*c,t[4]=a*r*c-s*r*l+e,t[5]=a*i*l+s*i*c+n,t}function Q5(t,e){var n=q3e(e);Ut(n!==0,32);var r=e[0],i=e[1],o=e[2],a=e[3],s=e[4],l=e[5];return t[0]=a/n,t[1]=-i/n,t[2]=-o/n,t[3]=r/n,t[4]=(o*l-a*s)/n,t[5]=-(r*l-i*s)/n,t}function q3e(t){return t[0]*t[3]-t[1]*t[2]}var gG;function Aie(t){var e="matrix("+t.join(", ")+")";if(o2)return e;var n=gG||(gG=document.createElement("div"));return n.style.transform=e,n.style.transform}const si={UNKNOWN:0,INTERSECTING:1,ABOVE:2,RIGHT:4,BELOW:8,LEFT:16};function vG(t){for(var e=Oa(),n=0,r=t.length;n<r;++n)Gx(e,t[n]);return e}function X3e(t,e,n){var r=Math.min.apply(null,t),i=Math.min.apply(null,e),o=Math.max.apply(null,t),a=Math.max.apply(null,e);return Zs(r,i,o,a,n)}function Fb(t,e,n){return n?(n[0]=t[0]-e,n[1]=t[1]-e,n[2]=t[2]+e,n[3]=t[3]+e,n):[t[0]-e,t[1]-e,t[2]+e,t[3]+e]}function Rie(t,e){return e?(e[0]=t[0],e[1]=t[1],e[2]=t[2],e[3]=t[3],e):t.slice()}function Ap(t,e,n){var r,i;return e<t[0]?r=t[0]-e:t[2]<e?r=e-t[2]:r=0,n<t[1]?i=t[1]-n:t[3]<n?i=n-t[3]:i=0,r*r+i*i}function z1(t,e){return Y5(t,e[0],e[1])}function eg(t,e){return t[0]<=e[0]&&e[2]<=t[2]&&t[1]<=e[1]&&e[3]<=t[3]}function Y5(t,e,n){return t[0]<=e&&e<=t[2]&&t[1]<=n&&n<=t[3]}function XL(t,e){var n=t[0],r=t[1],i=t[2],o=t[3],a=e[0],s=e[1],l=si.UNKNOWN;return a<n?l=l|si.LEFT:a>i&&(l=l|si.RIGHT),s<r?l=l|si.BELOW:s>o&&(l=l|si.ABOVE),l===si.UNKNOWN&&(l=si.INTERSECTING),l}function Oa(){return[1/0,1/0,-1/0,-1/0]}function Zs(t,e,n,r,i){return i?(i[0]=t,i[1]=e,i[2]=n,i[3]=r,i):[t,e,n,r]}function U1(t){return Zs(1/0,1/0,-1/0,-1/0,t)}function Q3e(t,e){var n=t[0],r=t[1];return Zs(n,r,n,r,e)}function Iie(t,e,n,r,i){var o=U1(i);return Lie(o,t,e,n,r)}function jb(t,e){return t[0]==e[0]&&t[2]==e[2]&&t[1]==e[1]&&t[3]==e[3]}function Die(t,e){return e[0]<t[0]&&(t[0]=e[0]),e[2]>t[2]&&(t[2]=e[2]),e[1]<t[1]&&(t[1]=e[1]),e[3]>t[3]&&(t[3]=e[3]),t}function Gx(t,e){e[0]<t[0]&&(t[0]=e[0]),e[0]>t[2]&&(t[2]=e[0]),e[1]<t[1]&&(t[1]=e[1]),e[1]>t[3]&&(t[3]=e[1])}function Lie(t,e,n,r,i){for(;n<r;n+=i)Y3e(t,e[n],e[n+1]);return t}function Y3e(t,e,n){t[0]=Math.min(t[0],e),t[1]=Math.min(t[1],n),t[2]=Math.max(t[2],e),t[3]=Math.max(t[3],n)}function K5(t,e){var n;return n=e(Z5(t)),n||(n=e(J5(t)),n)||(n=e(eB(t)),n)||(n=e(Rp(t)),n)?n:!1}function QL(t){var e=0;return tB(t)||(e=Kn(t)*ps(t)),e}function Z5(t){return[t[0],t[1]]}function J5(t){return[t[2],t[1]]}function ed(t){return[(t[0]+t[2])/2,(t[1]+t[3])/2]}function K3e(t,e){var n;return n=Rp(t),n}function YL(t,e,n,r,i){var o=KL(t,e,n,r),a=o[0],s=o[1],l=o[2],c=o[3],u=o[4],f=o[5],d=o[6],h=o[7];return Zs(Math.min(a,l,u,d),Math.min(s,c,f,h),Math.max(a,l,u,d),Math.max(s,c,f,h),i)}function KL(t,e,n,r){var i=e*r[0]/2,o=e*r[1]/2,a=Math.cos(n),s=Math.sin(n),l=i*a,c=i*s,u=o*a,f=o*s,d=t[0],h=t[1];return[d-l+f,h-c-u,d-l-f,h-c+u,d+l-f,h+c+u,d+l+f,h+c-u,d-l+f,h-c-u]}function ps(t){return t[3]-t[1]}function Hx(t,e,n){var r=n||Oa();return so(t,e)?(t[0]>e[0]?r[0]=t[0]:r[0]=e[0],t[1]>e[1]?r[1]=t[1]:r[1]=e[1],t[2]<e[2]?r[2]=t[2]:r[2]=e[2],t[3]<e[3]?r[3]=t[3]:r[3]=e[3]):U1(r),r}function Rp(t){return[t[0],t[3]]}function eB(t){return[t[2],t[3]]}function Kn(t){return t[2]-t[0]}function so(t,e){return t[0]<=e[2]&&t[2]>=e[0]&&t[1]<=e[3]&&t[3]>=e[1]}function tB(t){return t[2]<t[0]||t[3]<t[1]}function Z3e(t,e){return e?(e[0]=t[0],e[1]=t[1],e[2]=t[2],e[3]=t[3],e):t}function J3e(t,e,n){var r=!1,i=XL(t,e),o=XL(t,n);if(i===si.INTERSECTING||o===si.INTERSECTING)r=!0;else{var a=t[0],s=t[1],l=t[2],c=t[3],u=e[0],f=e[1],d=n[0],h=n[1],p=(h-f)/(d-u),m=void 0,g=void 0;o&si.ABOVE&&!(i&si.ABOVE)&&(m=d-(h-c)/p,r=m>=a&&m<=l),!r&&o&si.RIGHT&&!(i&si.RIGHT)&&(g=h-(d-l)*p,r=g>=s&&g<=c),!r&&o&si.BELOW&&!(i&si.BELOW)&&(m=d-(h-s)/p,r=m>=a&&m<=l),!r&&o&si.LEFT&&!(i&si.LEFT)&&(g=h-(d-a)*p,r=g>=s&&g<=c)}return r}function eNe(t,e,n,r){var i=[],o;i=[t[0],t[1],t[2],t[1],t[2],t[3],t[0],t[3]],e(i,i,2);for(var a=[],s=[],o=0,l=i.length;o<l;o+=2)a.push(i[o]),s.push(i[o+1]);return X3e(a,s,n)}function Nie(t,e){var n=e.getExtent(),r=ed(t);if(e.canWrapX()&&(r[0]<n[0]||r[0]>=n[2])){var i=Kn(n),o=Math.floor((r[0]-n[0])/i),a=o*i;t[0]-=a,t[2]-=a}return t}function tNe(t,e){if(e.canWrapX()){var n=e.getExtent();if(!isFinite(t[0])||!isFinite(t[2]))return[[n[0],t[1],n[2],t[3]]];Nie(t,e);var r=Kn(n);if(Kn(t)>r)return[[n[0],t[1],n[2],t[3]]];if(t[0]<n[0])return[[t[0]+r,t[1],n[2],t[3]],[n[0],t[1],t[2],t[3]]];if(t[2]>n[2])return[[t[0],t[1],n[2],t[3]],[n[0],t[1],t[2]-r,t[3]]]}return[t]}var $ie=function(){function t(e){this.code_=e.code,this.units_=e.units,this.extent_=e.extent!==void 0?e.extent:null,this.worldExtent_=e.worldExtent!==void 0?e.worldExtent:null,this.axisOrientation_=e.axisOrientation!==void 0?e.axisOrientation:"enu",this.global_=e.global!==void 0?e.global:!1,this.canWrapX_=!!(this.global_&&this.extent_),this.getPointResolutionFunc_=e.getPointResolution,this.defaultTileGrid_=null,this.metersPerUnit_=e.metersPerUnit}return t.prototype.canWrapX=function(){return this.canWrapX_},t.prototype.getCode=function(){return this.code_},t.prototype.getExtent=function(){return this.extent_},t.prototype.getUnits=function(){return this.units_},t.prototype.getMetersPerUnit=function(){return this.metersPerUnit_||Ks[this.units_]},t.prototype.getWorldExtent=function(){return this.worldExtent_},t.prototype.getAxisOrientation=function(){return this.axisOrientation_},t.prototype.isGlobal=function(){return this.global_},t.prototype.setGlobal=function(e){this.global_=e,this.canWrapX_=!!(e&&this.extent_)},t.prototype.getDefaultTileGrid=function(){return this.defaultTileGrid_},t.prototype.setDefaultTileGrid=function(e){this.defaultTileGrid_=e},t.prototype.setExtent=function(e){this.extent_=e,this.canWrapX_=!!(this.global_&&e)},t.prototype.setWorldExtent=function(e){this.worldExtent_=e},t.prototype.setGetPointResolution=function(e){this.getPointResolutionFunc_=e},t.prototype.getPointResolutionFunc=function(){return this.getPointResolutionFunc_},t}();function Br(t,e,n){return Math.min(Math.max(t,e),n)}var nNe=function(){var t;return"cosh"in Math?t=Math.cosh:t=function(e){var n=Math.exp(e);return(n+1/n)/2},t}(),rNe=function(){var t;return"log2"in Math?t=Math.log2:t=function(e){return Math.log(e)*Math.LOG2E},t}();function iNe(t,e,n,r,i,o){var a=i-n,s=o-r;if(a!==0||s!==0){var l=((t-n)*a+(e-r)*s)/(a*a+s*s);l>1?(n=i,r=o):l>0&&(n+=a*l,r+=s*l)}return jh(t,e,n,r)}function jh(t,e,n,r){var i=n-t,o=r-e;return i*i+o*o}function oNe(t){for(var e=t.length,n=0;n<e;n++){for(var r=n,i=Math.abs(t[n][n]),o=n+1;o<e;o++){var a=Math.abs(t[o][n]);a>i&&(i=a,r=o)}if(i===0)return null;var s=t[r];t[r]=t[n],t[n]=s;for(var l=n+1;l<e;l++)for(var c=-t[l][n]/t[n][n],u=n;u<e+1;u++)n==u?t[l][u]=0:t[l][u]+=c*t[n][u]}for(var f=new Array(e),d=e-1;d>=0;d--){f[d]=t[d][e]/t[d][d];for(var h=d-1;h>=0;h--)t[h][e]-=t[h][d]*f[d]}return f}function RC(t){return t*Math.PI/180}function jf(t,e){var n=t%e;return n*e<0?n+e:n}function Nc(t,e,n){return t+n*(e-t)}function Fie(t,e){var n=Math.pow(10,e);return Math.round(t*n)/n}function gS(t,e){return Math.floor(Fie(t,e))}function vS(t,e){return Math.ceil(Fie(t,e))}var aNe=function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,i){r.__proto__=i}||function(r,i){for(var o in i)Object.prototype.hasOwnProperty.call(i,o)&&(r[o]=i[o])},t(e,n)};return function(e,n){if(typeof n!="function"&&n!==null)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");t(e,n);function r(){this.constructor=e}e.prototype=n===null?Object.create(n):(r.prototype=n.prototype,new r)}}(),W1=6378137,tg=Math.PI*W1,sNe=[-tg,-tg,tg,tg],lNe=[-180,-85,180,85],yS=W1*Math.log(Math.tan(Math.PI/2)),em=function(t){aNe(e,t);function e(n){return t.call(this,{code:n,units:ci.METERS,extent:sNe,global:!0,worldExtent:lNe,getPointResolution:function(r,i){return r/nNe(i[1]/W1)}})||this}return e}($ie),yG=[new em("EPSG:3857"),new em("EPSG:102100"),new em("EPSG:102113"),new em("EPSG:900913"),new em("http://www.opengis.net/def/crs/EPSG/0/3857"),new em("http://www.opengis.net/gml/srs/epsg.xml#3857")];function cNe(t,e,n){var r=t.length,i=n>1?n:2,o=e;o===void 0&&(i>2?o=t.slice():o=new Array(r));for(var a=0;a<r;a+=i){o[a]=tg*t[a]/180;var s=W1*Math.log(Math.tan(Math.PI*(+t[a+1]+90)/360));s>yS?s=yS:s<-yS&&(s=-yS),o[a+1]=s}return o}function uNe(t,e,n){var r=t.length,i=n>1?n:2,o=e;o===void 0&&(i>2?o=t.slice():o=new Array(r));for(var a=0;a<r;a+=i)o[a]=180*t[a]/tg,o[a+1]=360*Math.atan(Math.exp(t[a+1]/W1))/Math.PI-90;return o}var fNe=function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,i){r.__proto__=i}||function(r,i){for(var o in i)Object.prototype.hasOwnProperty.call(i,o)&&(r[o]=i[o])},t(e,n)};return function(e,n){if(typeof n!="function"&&n!==null)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");t(e,n);function r(){this.constructor=e}e.prototype=n===null?Object.create(n):(r.prototype=n.prototype,new r)}}(),dNe=6378137,xG=[-180,-90,180,90],hNe=Math.PI*dNe/180,Fd=function(t){fNe(e,t);function e(n,r){return t.call(this,{code:n,units:ci.DEGREES,extent:xG,axisOrientation:r,global:!0,metersPerUnit:hNe,worldExtent:xG})||this}return e}($ie),bG=[new Fd("CRS:84"),new Fd("EPSG:4326","neu"),new Fd("urn:ogc:def:crs:OGC:1.3:CRS84"),new Fd("urn:ogc:def:crs:OGC:2:84"),new Fd("http://www.opengis.net/def/crs/OGC/1.3/CRS84"),new Fd("http://www.opengis.net/gml/srs/epsg.xml#4326","neu"),new Fd("http://www.opengis.net/def/crs/EPSG/0/4326","neu")],ZL={};function pNe(t){return ZL[t]||ZL[t.replace(/urn:(x-)?ogc:def:crs:EPSG:(.*:)?(\w+)$/,"EPSG:$3")]||null}function mNe(t,e){ZL[t]=e}var Tg={};function NT(t,e,n){var r=t.getCode(),i=e.getCode();r in Tg||(Tg[r]={}),Tg[r][i]=n}function gNe(t,e){var n;return t in Tg&&e in Tg[t]&&(n=Tg[t][e]),n}function vNe(t,e){for(var n=(""+t).split("."),r=(""+e).split("."),i=0;i<Math.max(n.length,r.length);i++){var o=parseInt(n[i]||"0",10),a=parseInt(r[i]||"0",10);if(o>a)return 1;if(a>o)return-1}return 0}function yNe(t,e){return t[0]+=+e[0],t[1]+=+e[1],t}function $T(t,e){for(var n=!0,r=t.length-1;r>=0;--r)if(t[r]!=e[r]){n=!1;break}return n}function nB(t,e){var n=Math.cos(e),r=Math.sin(e),i=t[0]*n-t[1]*r,o=t[1]*n+t[0]*r;return t[0]=i,t[1]=o,t}function xNe(t,e){return t[0]*=e,t[1]*=e,t}function bNe(t,e){var n=t[0]-e[0],r=t[1]-e[1];return n*n+r*r}function jie(t,e){if(e.canWrapX()){var n=Kn(e.getExtent()),r=_Ne(t,e,n);r&&(t[0]-=r*n)}return t}function _Ne(t,e,n){var r=e.getExtent(),i=0;if(e.canWrapX()&&(t[0]<r[0]||t[0]>r[2])){var o=n||Kn(r);i=Math.floor((t[0]-r[0])/o)}return i}var wNe=63710088e-1;function _G(t,e,n){var r=wNe,i=RC(t[1]),o=RC(e[1]),a=(o-i)/2,s=RC(e[0]-t[0])/2,l=Math.sin(a)*Math.sin(a)+Math.sin(s)*Math.sin(s)*Math.cos(i)*Math.cos(o);return 2*r*Math.atan2(Math.sqrt(l),Math.sqrt(1-l))}var JL=!0;function SNe(t){var e=!0;JL=!e}function rB(t,e,n){var r;if(e!==void 0){for(var i=0,o=t.length;i<o;++i)e[i]=t[i];r=e}else r=t.slice();return r}function Bie(t,e,n){if(e!==void 0&&t!==e){for(var r=0,i=t.length;r<i;++r)e[r]=t[r];t=e}return t}function ONe(t){mNe(t.getCode(),t),NT(t,t,rB)}function CNe(t){t.forEach(ONe)}function zr(t){return typeof t=="string"?pNe(t):t||null}function FT(t,e,n,r){t=zr(t);var i,o=t.getPointResolutionFunc();if(o){if(i=o(e,n),r&&r!==t.getUnits()){var a=t.getMetersPerUnit();a&&(i=i*a/Ks[r])}}else{var s=t.getUnits();if(s==ci.DEGREES&&!r||r==ci.DEGREES)i=e;else{var l=oB(t,zr("EPSG:4326"));if(l===Bie&&s!==ci.DEGREES)i=e*t.getMetersPerUnit();else{var c=[n[0]-e/2,n[1],n[0]+e/2,n[1],n[0],n[1]-e/2,n[0],n[1]+e/2];c=l(c,c,2);var u=_G(c.slice(0,2),c.slice(2,4)),f=_G(c.slice(4,6),c.slice(6,8));i=(u+f)/2}var a=r?Ks[r]:t.getMetersPerUnit();a!==void 0&&(i/=a)}}return i}function wG(t){CNe(t),t.forEach(function(e){t.forEach(function(n){e!==n&&NT(e,n,rB)})})}function TNe(t,e,n,r){t.forEach(function(i){e.forEach(function(o){NT(i,o,n),NT(o,i,r)})})}function iB(t,e){return t?typeof t=="string"?zr(t):t:zr(e)}function sh(t,e){if(t===e)return!0;var n=t.getUnits()===e.getUnits();if(t.getCode()===e.getCode())return n;var r=oB(t,e);return r===rB&&n}function oB(t,e){var n=t.getCode(),r=e.getCode(),i=gNe(n,r);return i||(i=Bie),i}function Bb(t,e){var n=zr(t),r=zr(e);return oB(n,r)}function a2(t,e,n){var r=Bb(e,n);return r(t,void 0,t.length)}function zie(t,e,n,r){var i=Bb(e,n);return eNe(t,i,void 0)}var ENe=null;function PNe(){return ENe}function e3(t,e){return t}function js(t,e){return JL&&!$T(t,[0,0])&&t[0]>=-180&&t[0]<=180&&t[1]>=-90&&t[1]<=90&&(JL=!1,console.warn("Call useGeographic() from ol/proj once to work with [longitude, latitude] coordinates.")),t}function Uie(t,e){return t}function xh(t,e){return t}function MNe(){wG(yG),wG(bG),TNe(bG,yG,cNe,uNe)}MNe();function Bh(t,e,n,r,i,o){for(var a=o||[],s=0,l=e;l<n;l+=r){var c=t[l],u=t[l+1];a[s++]=i[0]*c+i[2]*u+i[4],a[s++]=i[1]*c+i[3]*u+i[5]}return o&&a.length!=s&&(a.length=s),a}function aB(t,e,n,r,i,o,a){for(var s=a||[],l=Math.cos(i),c=Math.sin(i),u=o[0],f=o[1],d=0,h=e;h<n;h+=r){var p=t[h]-u,m=t[h+1]-f;s[d++]=u+p*l-m*c,s[d++]=f+p*c+m*l;for(var g=h+2;g<h+r;++g)s[d++]=t[g]}return a&&s.length!=d&&(s.length=d),s}function kNe(t,e,n,r,i,o,a,s){for(var l=s||[],c=a[0],u=a[1],f=0,d=e;d<n;d+=r){var h=t[d]-c,p=t[d+1]-u;l[f++]=c+i*h,l[f++]=u+o*p;for(var m=d+2;m<d+r;++m)l[f++]=t[m]}return s&&l.length!=f&&(l.length=f),l}function Wie(t,e,n,r,i,o,a){for(var s=a||[],l=0,c=e;c<n;c+=r){s[l++]=t[c]+i,s[l++]=t[c+1]+o;for(var u=c+2;u<c+r;++u)s[l++]=t[u]}return a&&s.length!=l&&(s.length=l),s}var ANe=function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,i){r.__proto__=i}||function(r,i){for(var o in i)Object.prototype.hasOwnProperty.call(i,o)&&(r[o]=i[o])},t(e,n)};return function(e,n){if(typeof n!="function"&&n!==null)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");t(e,n);function r(){this.constructor=e}e.prototype=n===null?Object.create(n):(r.prototype=n.prototype,new r)}}(),SG=Hl(),Vie=function(t){ANe(e,t);function e(){var n=t.call(this)||this;return n.extent_=Oa(),n.extentRevision_=-1,n.simplifiedGeometryMaxMinSquaredTolerance=0,n.simplifiedGeometryRevision=0,n.simplifyTransformedInternal=k3e(function(r,i,o){if(!o)return this.getSimplifiedGeometry(i);var a=this.clone();return a.applyTransform(o),a.getSimplifiedGeometry(i)}),n}return e.prototype.simplifyTransformed=function(n,r){return this.simplifyTransformedInternal(this.getRevision(),n,r)},e.prototype.clone=function(){return yt()},e.prototype.closestPointXY=function(n,r,i,o){return yt()},e.prototype.containsXY=function(n,r){var i=this.getClosestPoint([n,r]);return i[0]===n&&i[1]===r},e.prototype.getClosestPoint=function(n,r){var i=r||[NaN,NaN];return this.closestPointXY(n[0],n[1],i,1/0),i},e.prototype.intersectsCoordinate=function(n){return this.containsXY(n[0],n[1])},e.prototype.computeExtent=function(n){return yt()},e.prototype.getExtent=function(n){if(this.extentRevision_!=this.getRevision()){var r=this.computeExtent(this.extent_);(isNaN(r[0])||isNaN(r[1]))&&U1(r),this.extentRevision_=this.getRevision()}return Z3e(this.extent_,n)},e.prototype.rotate=function(n,r){yt()},e.prototype.scale=function(n,r,i){yt()},e.prototype.simplify=function(n){return this.getSimplifiedGeometry(n*n)},e.prototype.getSimplifiedGeometry=function(n){return yt()},e.prototype.getType=function(){return yt()},e.prototype.applyTransform=function(n){yt()},e.prototype.intersectsExtent=function(n){return yt()},e.prototype.translate=function(n,r){yt()},e.prototype.transform=function(n,r){var i=zr(n),o=i.getUnits()==ci.TILE_PIXELS?function(a,s,l){var c=i.getExtent(),u=i.getWorldExtent(),f=ps(u)/ps(c);return hu(SG,u[0],u[3],f,-f,0,0,0),Bh(a,0,a.length,l,SG,s),Bb(i,r)(a,s,l)}:Bb(i,r);return this.applyTransform(o),this},e}(sc),RNe=function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,i){r.__proto__=i}||function(r,i){for(var o in i)Object.prototype.hasOwnProperty.call(i,o)&&(r[o]=i[o])},t(e,n)};return function(e,n){if(typeof n!="function"&&n!==null)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");t(e,n);function r(){this.constructor=e}e.prototype=n===null?Object.create(n):(r.prototype=n.prototype,new r)}}(),jT=function(t){RNe(e,t);function e(n){var r=t.call(this)||this;return r.geometries_=n||null,r.changeEventsKeys_=[],r.listenGeometriesChange_(),r}return e.prototype.unlistenGeometriesChange_=function(){this.changeEventsKeys_.forEach(nr),this.changeEventsKeys_.length=0},e.prototype.listenGeometriesChange_=function(){if(this.geometries_)for(var n=0,r=this.geometries_.length;n<r;++n)this.changeEventsKeys_.push(rn(this.geometries_[n],Mt.CHANGE,this.changed,this))},e.prototype.clone=function(){var n=new e(null);return n.setGeometries(this.geometries_),n.applyProperties(this),n},e.prototype.closestPointXY=function(n,r,i,o){if(o<Ap(this.getExtent(),n,r))return o;for(var a=this.geometries_,s=0,l=a.length;s<l;++s)o=a[s].closestPointXY(n,r,i,o);return o},e.prototype.containsXY=function(n,r){for(var i=this.geometries_,o=0,a=i.length;o<a;++o)if(i[o].containsXY(n,r))return!0;return!1},e.prototype.computeExtent=function(n){U1(n);for(var r=this.geometries_,i=0,o=r.length;i<o;++i)Die(n,r[i].getExtent());return n},e.prototype.getGeometries=function(){return OG(this.geometries_)},e.prototype.getGeometriesArray=function(){return this.geometries_},e.prototype.getGeometriesArrayRecursive=function(){for(var n=[],r=this.geometries_,i=0,o=r.length;i<o;++i)r[i].getType()===this.getType()?n=n.concat(r[i].getGeometriesArrayRecursive()):n.push(r[i]);return n},e.prototype.getSimplifiedGeometry=function(n){if(this.simplifiedGeometryRevision!==this.getRevision()&&(this.simplifiedGeometryMaxMinSquaredTolerance=0,this.simplifiedGeometryRevision=this.getRevision()),n<0||this.simplifiedGeometryMaxMinSquaredTolerance!==0&&n<this.simplifiedGeometryMaxMinSquaredTolerance)return this;for(var r=[],i=this.geometries_,o=!1,a=0,s=i.length;a<s;++a){var l=i[a],c=l.getSimplifiedGeometry(n);r.push(c),c!==l&&(o=!0)}if(o){var u=new e(null);return u.setGeometriesArray(r),u}else return this.simplifiedGeometryMaxMinSquaredTolerance=n,this},e.prototype.getType=function(){return"GeometryCollection"},e.prototype.intersectsExtent=function(n){for(var r=this.geometries_,i=0,o=r.length;i<o;++i)if(r[i].intersectsExtent(n))return!0;return!1},e.prototype.isEmpty=function(){return this.geometries_.length===0},e.prototype.rotate=function(n,r){for(var i=this.geometries_,o=0,a=i.length;o<a;++o)i[o].rotate(n,r);this.changed()},e.prototype.scale=function(n,r,i){var o=i;o||(o=ed(this.getExtent()));for(var a=this.geometries_,s=0,l=a.length;s<l;++s)a[s].scale(n,r,o);this.changed()},e.prototype.setGeometries=function(n){this.setGeometriesArray(OG(n))},e.prototype.setGeometriesArray=function(n){this.unlistenGeometriesChange_(),this.geometries_=n,this.listenGeometriesChange_(),this.changed()},e.prototype.applyTransform=function(n){for(var r=this.geometries_,i=0,o=r.length;i<o;++i)r[i].applyTransform(n);this.changed()},e.prototype.translate=function(n,r){for(var i=this.geometries_,o=0,a=i.length;o<a;++o)i[o].translate(n,r);this.changed()},e.prototype.disposeInternal=function(){this.unlistenGeometriesChange_(),t.prototype.disposeInternal.call(this)},e}(Vie);function OG(t){for(var e=[],n=0,r=t.length;n<r;++n)e.push(t[n].clone());return e}var Gie=function(){function t(){this.dataProjection=void 0,this.defaultFeatureProjection=void 0,this.supportedMediaTypes=null}return t.prototype.getReadOptions=function(e,n){var r;if(n){var i=n.dataProjection?zr(n.dataProjection):this.readProjection(e);n.extent&&i&&i.getUnits()===ci.TILE_PIXELS&&(i=zr(i),i.setWorldExtent(n.extent)),r={dataProjection:i,featureProjection:n.featureProjection}}return this.adaptOptions(r)},t.prototype.adaptOptions=function(e){return ur({dataProjection:this.dataProjection,featureProjection:this.defaultFeatureProjection},e)},t.prototype.getType=function(){return yt()},t.prototype.readFeature=function(e,n){return yt()},t.prototype.readFeatures=function(e,n){return yt()},t.prototype.readGeometry=function(e,n){return yt()},t.prototype.readProjection=function(e){return yt()},t.prototype.writeFeature=function(e,n){return yt()},t.prototype.writeFeatures=function(e,n){return yt()},t.prototype.writeGeometry=function(e,n){return yt()},t}();function BT(t,e,n){var r=n?zr(n.featureProjection):null,i=n?zr(n.dataProjection):null,o;if(r&&i&&!sh(r,i)?o=(e?t.clone():t).transform(e?r:i,e?i:r):o=t,e&&n&&n.decimals!==void 0){var a=Math.pow(10,n.decimals),s=function(l){for(var c=0,u=l.length;c<u;++c)l[c]=Math.round(l[c]*a)/a;return l};o===t&&(o=t.clone()),o.applyTransform(s)}return o}var INe=function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,i){r.__proto__=i}||function(r,i){for(var o in i)Object.prototype.hasOwnProperty.call(i,o)&&(r[o]=i[o])},t(e,n)};return function(e,n){if(typeof n!="function"&&n!==null)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");t(e,n);function r(){this.constructor=e}e.prototype=n===null?Object.create(n):(r.prototype=n.prototype,new r)}}(),DNe=function(t){INe(e,t);function e(){return t.call(this)||this}return e.prototype.getType=function(){return"json"},e.prototype.readFeature=function(n,r){return this.readFeatureFromObject(xS(n),this.getReadOptions(n,r))},e.prototype.readFeatures=function(n,r){return this.readFeaturesFromObject(xS(n),this.getReadOptions(n,r))},e.prototype.readFeatureFromObject=function(n,r){return yt()},e.prototype.readFeaturesFromObject=function(n,r){return yt()},e.prototype.readGeometry=function(n,r){return this.readGeometryFromObject(xS(n),this.getReadOptions(n,r))},e.prototype.readGeometryFromObject=function(n,r){return yt()},e.prototype.readProjection=function(n){return this.readProjectionFromObject(xS(n))},e.prototype.readProjectionFromObject=function(n){return yt()},e.prototype.writeFeature=function(n,r){return JSON.stringify(this.writeFeatureObject(n,r))},e.prototype.writeFeatureObject=function(n,r){return yt()},e.prototype.writeFeatures=function(n,r){return JSON.stringify(this.writeFeaturesObject(n,r))},e.prototype.writeFeaturesObject=function(n,r){return yt()},e.prototype.writeGeometry=function(n,r){return JSON.stringify(this.writeGeometryObject(n,r))},e.prototype.writeGeometryObject=function(n,r){return yt()},e}(Gie);function xS(t){if(typeof t=="string"){var e=JSON.parse(t);return e||null}else return t!==null?t:null}const dn={XY:"XY",XYZ:"XYZ",XYM:"XYM",XYZM:"XYZM"};var LNe=function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,i){r.__proto__=i}||function(r,i){for(var o in i)Object.prototype.hasOwnProperty.call(i,o)&&(r[o]=i[o])},t(e,n)};return function(e,n){if(typeof n!="function"&&n!==null)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");t(e,n);function r(){this.constructor=e}e.prototype=n===null?Object.create(n):(r.prototype=n.prototype,new r)}}(),bd=function(t){LNe(e,t);function e(){var n=t.call(this)||this;return n.layout=dn.XY,n.stride=2,n.flatCoordinates=null,n}return e.prototype.computeExtent=function(n){return Iie(this.flatCoordinates,0,this.flatCoordinates.length,this.stride,n)},e.prototype.getCoordinates=function(){return yt()},e.prototype.getFirstCoordinate=function(){return this.flatCoordinates.slice(0,this.stride)},e.prototype.getFlatCoordinates=function(){return this.flatCoordinates},e.prototype.getLastCoordinate=function(){return this.flatCoordinates.slice(this.flatCoordinates.length-this.stride)},e.prototype.getLayout=function(){return this.layout},e.prototype.getSimplifiedGeometry=function(n){if(this.simplifiedGeometryRevision!==this.getRevision()&&(this.simplifiedGeometryMaxMinSquaredTolerance=0,this.simplifiedGeometryRevision=this.getRevision()),n<0||this.simplifiedGeometryMaxMinSquaredTolerance!==0&&n<=this.simplifiedGeometryMaxMinSquaredTolerance)return this;var r=this.getSimplifiedGeometryInternal(n),i=r.getFlatCoordinates();return i.length<this.flatCoordinates.length?r:(this.simplifiedGeometryMaxMinSquaredTolerance=n,this)},e.prototype.getSimplifiedGeometryInternal=function(n){return this},e.prototype.getStride=function(){return this.stride},e.prototype.setFlatCoordinates=function(n,r){this.stride=zT(n),this.layout=n,this.flatCoordinates=r},e.prototype.setCoordinates=function(n,r){yt()},e.prototype.setLayout=function(n,r,i){var o;if(n)o=zT(n);else{for(var a=0;a<i;++a)if(r.length===0){this.layout=dn.XY,this.stride=2;return}else r=r[0];o=r.length,n=NNe(o)}this.layout=n,this.stride=o},e.prototype.applyTransform=function(n){this.flatCoordinates&&(n(this.flatCoordinates,this.flatCoordinates,this.stride),this.changed())},e.prototype.rotate=function(n,r){var i=this.getFlatCoordinates();if(i){var o=this.getStride();aB(i,0,i.length,o,n,r,i),this.changed()}},e.prototype.scale=function(n,r,i){var o=r;o===void 0&&(o=n);var a=i;a||(a=ed(this.getExtent()));var s=this.getFlatCoordinates();if(s){var l=this.getStride();kNe(s,0,s.length,l,n,o,a,s),this.changed()}},e.prototype.translate=function(n,r){var i=this.getFlatCoordinates();if(i){var o=this.getStride();Wie(i,0,i.length,o,n,r,i),this.changed()}},e}(Vie);function NNe(t){var e;return t==2?e=dn.XY:t==3?e=dn.XYZ:t==4&&(e=dn.XYZM),e}function zT(t){var e;return t==dn.XY?e=2:t==dn.XYZ||t==dn.XYM?e=3:t==dn.XYZM&&(e=4),e}function $Ne(t,e,n){var r=t.getFlatCoordinates();if(r){var i=t.getStride();return Bh(r,0,r.length,i,e,n)}else return null}function CG(t,e,n,r,i,o,a){var s=t[e],l=t[e+1],c=t[n]-s,u=t[n+1]-l,f;if(c===0&&u===0)f=e;else{var d=((i-s)*c+(o-l)*u)/(c*c+u*u);if(d>1)f=n;else if(d>0){for(var h=0;h<r;++h)a[h]=Nc(t[e+h],t[n+h],d);a.length=r;return}else f=e}for(var h=0;h<r;++h)a[h]=t[f+h];a.length=r}function sB(t,e,n,r,i){var o=t[e],a=t[e+1];for(e+=r;e<n;e+=r){var s=t[e],l=t[e+1],c=jh(o,a,s,l);c>i&&(i=c),o=s,a=l}return i}function lB(t,e,n,r,i){for(var o=0,a=n.length;o<a;++o){var s=n[o];i=sB(t,e,s,r,i),e=s}return i}function FNe(t,e,n,r,i){for(var o=0,a=n.length;o<a;++o){var s=n[o];i=lB(t,e,s,r,i),e=s[s.length-1]}return i}function cB(t,e,n,r,i,o,a,s,l,c,u){if(e==n)return c;var f,d;if(i===0)if(d=jh(a,s,t[e],t[e+1]),d<c){for(f=0;f<r;++f)l[f]=t[e+f];return l.length=r,d}else return c;for(var h=u||[NaN,NaN],p=e+r;p<n;)if(CG(t,p-r,p,r,a,s,h),d=jh(a,s,h[0],h[1]),d<c){for(c=d,f=0;f<r;++f)l[f]=h[f];l.length=r,p+=r}else p+=r*Math.max((Math.sqrt(d)-Math.sqrt(c))/i|0,1);if(o&&(CG(t,n-r,e,r,a,s,h),d=jh(a,s,h[0],h[1]),d<c)){for(c=d,f=0;f<r;++f)l[f]=h[f];l.length=r}return c}function uB(t,e,n,r,i,o,a,s,l,c,u){for(var f=u||[NaN,NaN],d=0,h=n.length;d<h;++d){var p=n[d];c=cB(t,e,p,r,i,o,a,s,l,c,f),e=p}return c}function jNe(t,e,n,r,i,o,a,s,l,c,u){for(var f=[NaN,NaN],d=0,h=n.length;d<h;++d){var p=n[d];c=uB(t,e,p,r,i,o,a,s,l,c,f),e=p[p.length-1]}return c}function Hie(t,e,n,r){for(var i=0,o=n.length;i<o;++i)t[e++]=n[i];return e}function s2(t,e,n,r){for(var i=0,o=n.length;i<o;++i)for(var a=n[i],s=0;s<r;++s)t[e++]=a[s];return e}function fB(t,e,n,r,i){for(var o=i||[],a=0,s=0,l=n.length;s<l;++s){var c=s2(t,e,n[s],r);o[a++]=c,e=c}return o.length=a,o}function BNe(t,e,n,r,i){for(var o=i||[],a=0,s=0,l=n.length;s<l;++s){var c=fB(t,e,n[s],r,o[a]);o[a++]=c,e=c[c.length-1]}return o.length=a,o}function dB(t,e,n,r,i,o,a){var s=(n-e)/r;if(s<3){for(;e<n;e+=r)o[a++]=t[e],o[a++]=t[e+1];return a}var l=new Array(s);l[0]=1,l[s-1]=1;for(var c=[e,n-r],u=0;c.length>0;){for(var f=c.pop(),d=c.pop(),h=0,p=t[d],m=t[d+1],g=t[f],v=t[f+1],y=d+r;y<f;y+=r){var x=t[y],b=t[y+1],_=iNe(x,b,p,m,g,v);_>h&&(u=y,h=_)}h>i&&(l[(u-e)/r]=1,d+r<u&&c.push(d,u),u+r<f&&c.push(u,f))}for(var y=0;y<s;++y)l[y]&&(o[a++]=t[e+y*r],o[a++]=t[e+y*r+1]);return a}function zNe(t,e,n,r,i,o,a,s){for(var l=0,c=n.length;l<c;++l){var u=n[l];a=dB(t,e,u,r,i,o,a),s.push(a),e=u}return a}function Zd(t,e){return e*Math.round(t/e)}function UNe(t,e,n,r,i,o,a){if(e==n)return a;var s=Zd(t[e],i),l=Zd(t[e+1],i);e+=r,o[a++]=s,o[a++]=l;var c,u;do if(c=Zd(t[e],i),u=Zd(t[e+1],i),e+=r,e==n)return o[a++]=c,o[a++]=u,a;while(c==s&&u==l);for(;e<n;){var f=Zd(t[e],i),d=Zd(t[e+1],i);if(e+=r,!(f==c&&d==u)){var h=c-s,p=u-l,m=f-s,g=d-l;if(h*g==p*m&&(h<0&&m<h||h==m||h>0&&m>h)&&(p<0&&g<p||p==g||p>0&&g>p)){c=f,u=d;continue}o[a++]=c,o[a++]=u,s=c,l=u,c=f,u=d}}return o[a++]=c,o[a++]=u,a}function qie(t,e,n,r,i,o,a,s){for(var l=0,c=n.length;l<c;++l){var u=n[l];a=UNe(t,e,u,r,i,o,a),s.push(a),e=u}return a}function WNe(t,e,n,r,i,o,a,s){for(var l=0,c=n.length;l<c;++l){var u=n[l],f=[];a=qie(t,e,u,r,i,o,a,f),s.push(f),e=u[u.length-1]}return a}function Xie(t,e,n,r,i){var o;for(e+=r;e<n;e+=r)if(o=i(t.slice(e-r,e),t.slice(e,e+r)),o)return o;return!1}function wf(t,e,n,r,i){for(var o=i!==void 0?i:[],a=0,s=e;s<n;s+=r)o[a++]=t.slice(s,s+r);return o.length=a,o}function zb(t,e,n,r,i){for(var o=i!==void 0?i:[],a=0,s=0,l=n.length;s<l;++s){var c=n[s];o[a++]=wf(t,e,c,r,o[a]),e=c}return o.length=a,o}function t3(t,e,n,r,i){for(var o=i!==void 0?i:[],a=0,s=0,l=n.length;s<l;++s){var c=n[s];o[a++]=zb(t,e,c,r,o[a]),e=c[c.length-1]}return o.length=a,o}function Qie(t,e,n,r,i,o,a){var s,l,c=(n-e)/r;if(c===1)s=e;else if(c===2)s=e,l=i;else if(c!==0){for(var u=t[e],f=t[e+1],d=0,h=[0],p=e+r;p<n;p+=r){var m=t[p],g=t[p+1];d+=Math.sqrt((m-u)*(m-u)+(g-f)*(g-f)),h.push(d),u=m,f=g}var v=i*d,y=E3e(h,v);y<0?(l=(v-h[-y-2])/(h[-y-1]-h[-y-2]),s=e+(-y-2)*r):s=e+y*r}for(var x=a>1?a:2,b=o||new Array(x),p=0;p<x;++p)b[p]=s===void 0?NaN:l===void 0?t[s+p]:Nc(t[s+p],t[s+r+p],l);return b}function n3(t,e,n,r,i,o){if(n==e)return null;var a;if(i<t[e+r-1])return o?(a=t.slice(e,e+r),a[r-1]=i,a):null;if(t[n-1]<i)return o?(a=t.slice(n-r,n),a[r-1]=i,a):null;if(i==t[e+r-1])return t.slice(e,e+r);for(var s=e/r,l=n/r;s<l;){var c=s+l>>1;i<t[(c+1)*r-1]?l=c:s=c+1}var u=t[s*r-1];if(i==u)return t.slice((s-1)*r,(s-1)*r+r);var f=t[(s+1)*r-1],d=(i-u)/(f-u);a=[];for(var h=0;h<r-1;++h)a.push(Nc(t[(s-1)*r+h],t[s*r+h],d));return a.push(i),a}function VNe(t,e,n,r,i,o,a){if(a)return n3(t,e,n[n.length-1],r,i,o);var s;if(i<t[r-1])return o?(s=t.slice(0,r),s[r-1]=i,s):null;if(t[t.length-1]<i)return o?(s=t.slice(t.length-r),s[r-1]=i,s):null;for(var l=0,c=n.length;l<c;++l){var u=n[l];if(e!=u){if(i<t[e+r-1])return null;if(i<=t[u-1])return n3(t,e,u,r,i,!1);e=u}}return null}function GNe(t,e,n,r,i){var o=K5(i,function(a){return!bh(t,e,n,r,a[0],a[1])});return!o}function bh(t,e,n,r,i,o){for(var a=0,s=t[n-r],l=t[n-r+1];e<n;e+=r){var c=t[e],u=t[e+1];l<=o?u>o&&(c-s)*(o-l)-(i-s)*(u-l)>0&&a++:u<=o&&(c-s)*(o-l)-(i-s)*(u-l)<0&&a--,s=c,l=u}return a!==0}function hB(t,e,n,r,i,o){if(n.length===0||!bh(t,e,n[0],r,i,o))return!1;for(var a=1,s=n.length;a<s;++a)if(bh(t,n[a-1],n[a],r,i,o))return!1;return!0}function HNe(t,e,n,r,i,o){if(n.length===0)return!1;for(var a=0,s=n.length;a<s;++a){var l=n[a];if(hB(t,e,l,r,i,o))return!0;e=l[l.length-1]}return!1}function l2(t,e,n,r,i){var o=Lie(Oa(),t,e,n,r);return so(i,o)?eg(i,o)||o[0]>=i[0]&&o[2]<=i[2]||o[1]>=i[1]&&o[3]<=i[3]?!0:Xie(t,e,n,r,function(a,s){return J3e(i,a,s)}):!1}function qNe(t,e,n,r,i){for(var o=0,a=n.length;o<a;++o){if(l2(t,e,n[o],r,i))return!0;e=n[o]}return!1}function Yie(t,e,n,r,i){return!!(l2(t,e,n,r,i)||bh(t,e,n,r,i[0],i[1])||bh(t,e,n,r,i[0],i[3])||bh(t,e,n,r,i[2],i[1])||bh(t,e,n,r,i[2],i[3]))}function Kie(t,e,n,r,i){if(!Yie(t,e,n[0],r,i))return!1;if(n.length===1)return!0;for(var o=1,a=n.length;o<a;++o)if(GNe(t,n[o-1],n[o],r,i)&&!l2(t,n[o-1],n[o],r,i))return!1;return!0}function XNe(t,e,n,r,i){for(var o=0,a=n.length;o<a;++o){var s=n[o];if(Kie(t,e,s,r,i))return!0;e=s[s.length-1]}return!1}function Zie(t,e,n,r){for(var i=t[e],o=t[e+1],a=0,s=e+r;s<n;s+=r){var l=t[s],c=t[s+1];a+=Math.sqrt((l-i)*(l-i)+(c-o)*(c-o)),i=l,o=c}return a}var QNe=function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,i){r.__proto__=i}||function(r,i){for(var o in i)Object.prototype.hasOwnProperty.call(i,o)&&(r[o]=i[o])},t(e,n)};return function(e,n){if(typeof n!="function"&&n!==null)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");t(e,n);function r(){this.constructor=e}e.prototype=n===null?Object.create(n):(r.prototype=n.prototype,new r)}}(),zh=function(t){QNe(e,t);function e(n,r){var i=t.call(this)||this;return i.flatMidpoint_=null,i.flatMidpointRevision_=-1,i.maxDelta_=-1,i.maxDeltaRevision_=-1,r!==void 0&&!Array.isArray(n[0])?i.setFlatCoordinates(r,n):i.setCoordinates(n,r),i}return e.prototype.appendCoordinate=function(n){this.flatCoordinates?Zc(this.flatCoordinates,n):this.flatCoordinates=n.slice(),this.changed()},e.prototype.clone=function(){var n=new e(this.flatCoordinates.slice(),this.layout);return n.applyProperties(this),n},e.prototype.closestPointXY=function(n,r,i,o){return o<Ap(this.getExtent(),n,r)?o:(this.maxDeltaRevision_!=this.getRevision()&&(this.maxDelta_=Math.sqrt(sB(this.flatCoordinates,0,this.flatCoordinates.length,this.stride,0)),this.maxDeltaRevision_=this.getRevision()),cB(this.flatCoordinates,0,this.flatCoordinates.length,this.stride,this.maxDelta_,!1,n,r,i,o))},e.prototype.forEachSegment=function(n){return Xie(this.flatCoordinates,0,this.flatCoordinates.length,this.stride,n)},e.prototype.getCoordinateAtM=function(n,r){if(this.layout!=dn.XYM&&this.layout!=dn.XYZM)return null;var i=r!==void 0?r:!1;return n3(this.flatCoordinates,0,this.flatCoordinates.length,this.stride,n,i)},e.prototype.getCoordinates=function(){return wf(this.flatCoordinates,0,this.flatCoordinates.length,this.stride)},e.prototype.getCoordinateAt=function(n,r){return Qie(this.flatCoordinates,0,this.flatCoordinates.length,this.stride,n,r,this.stride)},e.prototype.getLength=function(){return Zie(this.flatCoordinates,0,this.flatCoordinates.length,this.stride)},e.prototype.getFlatMidpoint=function(){return this.flatMidpointRevision_!=this.getRevision()&&(this.flatMidpoint_=this.getCoordinateAt(.5,this.flatMidpoint_),this.flatMidpointRevision_=this.getRevision()),this.flatMidpoint_},e.prototype.getSimplifiedGeometryInternal=function(n){var r=[];return r.length=dB(this.flatCoordinates,0,this.flatCoordinates.length,this.stride,n,r,0),new e(r,dn.XY)},e.prototype.getType=function(){return"LineString"},e.prototype.intersectsExtent=function(n){return l2(this.flatCoordinates,0,this.flatCoordinates.length,this.stride,n)},e.prototype.setCoordinates=function(n,r){this.setLayout(r,n,1),this.flatCoordinates||(this.flatCoordinates=[]),this.flatCoordinates.length=s2(this.flatCoordinates,0,n,this.stride),this.changed()},e}(bd),YNe=function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,i){r.__proto__=i}||function(r,i){for(var o in i)Object.prototype.hasOwnProperty.call(i,o)&&(r[o]=i[o])},t(e,n)};return function(e,n){if(typeof n!="function"&&n!==null)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");t(e,n);function r(){this.constructor=e}e.prototype=n===null?Object.create(n):(r.prototype=n.prototype,new r)}}(),pB=function(t){YNe(e,t);function e(n,r,i){var o=t.call(this)||this;if(o.ends_=[],o.maxDelta_=-1,o.maxDeltaRevision_=-1,Array.isArray(n[0]))o.setCoordinates(n,r);else if(r!==void 0&&i)o.setFlatCoordinates(r,n),o.ends_=i;else{for(var a=o.getLayout(),s=n,l=[],c=[],u=0,f=s.length;u<f;++u){var d=s[u];u===0&&(a=d.getLayout()),Zc(l,d.getFlatCoordinates()),c.push(l.length)}o.setFlatCoordinates(a,l),o.ends_=c}return o}return e.prototype.appendLineString=function(n){this.flatCoordinates?Zc(this.flatCoordinates,n.getFlatCoordinates().slice()):this.flatCoordinates=n.getFlatCoordinates().slice(),this.ends_.push(this.flatCoordinates.length),this.changed()},e.prototype.clone=function(){var n=new e(this.flatCoordinates.slice(),this.layout,this.ends_.slice());return n.applyProperties(this),n},e.prototype.closestPointXY=function(n,r,i,o){return o<Ap(this.getExtent(),n,r)?o:(this.maxDeltaRevision_!=this.getRevision()&&(this.maxDelta_=Math.sqrt(lB(this.flatCoordinates,0,this.ends_,this.stride,0)),this.maxDeltaRevision_=this.getRevision()),uB(this.flatCoordinates,0,this.ends_,this.stride,this.maxDelta_,!1,n,r,i,o))},e.prototype.getCoordinateAtM=function(n,r,i){if(this.layout!=dn.XYM&&this.layout!=dn.XYZM||this.flatCoordinates.length===0)return null;var o=r!==void 0?r:!1,a=i!==void 0?i:!1;return VNe(this.flatCoordinates,0,this.ends_,this.stride,n,o,a)},e.prototype.getCoordinates=function(){return zb(this.flatCoordinates,0,this.ends_,this.stride)},e.prototype.getEnds=function(){return this.ends_},e.prototype.getLineString=function(n){return n<0||this.ends_.length<=n?null:new zh(this.flatCoordinates.slice(n===0?0:this.ends_[n-1],this.ends_[n]),this.layout)},e.prototype.getLineStrings=function(){for(var n=this.flatCoordinates,r=this.ends_,i=this.layout,o=[],a=0,s=0,l=r.length;s<l;++s){var c=r[s],u=new zh(n.slice(a,c),i);o.push(u),a=c}return o},e.prototype.getFlatMidpoints=function(){for(var n=[],r=this.flatCoordinates,i=0,o=this.ends_,a=this.stride,s=0,l=o.length;s<l;++s){var c=o[s],u=Qie(r,i,c,a,.5);Zc(n,u),i=c}return n},e.prototype.getSimplifiedGeometryInternal=function(n){var r=[],i=[];return r.length=zNe(this.flatCoordinates,0,this.ends_,this.stride,n,r,0,i),new e(r,dn.XY,i)},e.prototype.getType=function(){return"MultiLineString"},e.prototype.intersectsExtent=function(n){return qNe(this.flatCoordinates,0,this.ends_,this.stride,n)},e.prototype.setCoordinates=function(n,r){this.setLayout(r,n,2),this.flatCoordinates||(this.flatCoordinates=[]);var i=fB(this.flatCoordinates,0,n,this.stride,this.ends_);this.flatCoordinates.length=i.length===0?0:i[i.length-1],this.changed()},e}(bd),KNe=function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,i){r.__proto__=i}||function(r,i){for(var o in i)Object.prototype.hasOwnProperty.call(i,o)&&(r[o]=i[o])},t(e,n)};return function(e,n){if(typeof n!="function"&&n!==null)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");t(e,n);function r(){this.constructor=e}e.prototype=n===null?Object.create(n):(r.prototype=n.prototype,new r)}}(),ql=function(t){KNe(e,t);function e(n,r){var i=t.call(this)||this;return i.setCoordinates(n,r),i}return e.prototype.clone=function(){var n=new e(this.flatCoordinates.slice(),this.layout);return n.applyProperties(this),n},e.prototype.closestPointXY=function(n,r,i,o){var a=this.flatCoordinates,s=jh(n,r,a[0],a[1]);if(s<o){for(var l=this.stride,c=0;c<l;++c)i[c]=a[c];return i.length=l,s}else return o},e.prototype.getCoordinates=function(){return this.flatCoordinates?this.flatCoordinates.slice():[]},e.prototype.computeExtent=function(n){return Q3e(this.flatCoordinates,n)},e.prototype.getType=function(){return"Point"},e.prototype.intersectsExtent=function(n){return Y5(n,this.flatCoordinates[0],this.flatCoordinates[1])},e.prototype.setCoordinates=function(n,r){this.setLayout(r,n,0),this.flatCoordinates||(this.flatCoordinates=[]),this.flatCoordinates.length=Hie(this.flatCoordinates,0,n,this.stride),this.changed()},e}(bd),ZNe=function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,i){r.__proto__=i}||function(r,i){for(var o in i)Object.prototype.hasOwnProperty.call(i,o)&&(r[o]=i[o])},t(e,n)};return function(e,n){if(typeof n!="function"&&n!==null)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");t(e,n);function r(){this.constructor=e}e.prototype=n===null?Object.create(n):(r.prototype=n.prototype,new r)}}(),c2=function(t){ZNe(e,t);function e(n,r){var i=t.call(this)||this;return r&&!Array.isArray(n[0])?i.setFlatCoordinates(r,n):i.setCoordinates(n,r),i}return e.prototype.appendPoint=function(n){this.flatCoordinates?Zc(this.flatCoordinates,n.getFlatCoordinates()):this.flatCoordinates=n.getFlatCoordinates().slice(),this.changed()},e.prototype.clone=function(){var n=new e(this.flatCoordinates.slice(),this.layout);return n.applyProperties(this),n},e.prototype.closestPointXY=function(n,r,i,o){if(o<Ap(this.getExtent(),n,r))return o;for(var a=this.flatCoordinates,s=this.stride,l=0,c=a.length;l<c;l+=s){var u=jh(n,r,a[l],a[l+1]);if(u<o){o=u;for(var f=0;f<s;++f)i[f]=a[l+f];i.length=s}}return o},e.prototype.getCoordinates=function(){return wf(this.flatCoordinates,0,this.flatCoordinates.length,this.stride)},e.prototype.getPoint=function(n){var r=this.flatCoordinates?this.flatCoordinates.length/this.stride:0;return n<0||r<=n?null:new ql(this.flatCoordinates.slice(n*this.stride,(n+1)*this.stride),this.layout)},e.prototype.getPoints=function(){for(var n=this.flatCoordinates,r=this.layout,i=this.stride,o=[],a=0,s=n.length;a<s;a+=i){var l=new ql(n.slice(a,a+i),r);o.push(l)}return o},e.prototype.getType=function(){return"MultiPoint"},e.prototype.intersectsExtent=function(n){for(var r=this.flatCoordinates,i=this.stride,o=0,a=r.length;o<a;o+=i){var s=r[o],l=r[o+1];if(Y5(n,s,l))return!0}return!1},e.prototype.setCoordinates=function(n,r){this.setLayout(r,n,1),this.flatCoordinates||(this.flatCoordinates=[]),this.flatCoordinates.length=s2(this.flatCoordinates,0,n,this.stride),this.changed()},e}(bd);function Jie(t,e,n,r){for(var i=0,o=t[n-r],a=t[n-r+1];e<n;e+=r){var s=t[e],l=t[e+1];i+=a*s-o*l,o=s,a=l}return i/2}function eoe(t,e,n,r){for(var i=0,o=0,a=n.length;o<a;++o){var s=n[o];i+=Jie(t,e,s,r),e=s}return i}function JNe(t,e,n,r){for(var i=0,o=0,a=n.length;o<a;++o){var s=n[o];i+=eoe(t,e,s,r),e=s[s.length-1]}return i}var e$e=function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,i){r.__proto__=i}||function(r,i){for(var o in i)Object.prototype.hasOwnProperty.call(i,o)&&(r[o]=i[o])},t(e,n)};return function(e,n){if(typeof n!="function"&&n!==null)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");t(e,n);function r(){this.constructor=e}e.prototype=n===null?Object.create(n):(r.prototype=n.prototype,new r)}}(),TG=function(t){e$e(e,t);function e(n,r){var i=t.call(this)||this;return i.maxDelta_=-1,i.maxDeltaRevision_=-1,r!==void 0&&!Array.isArray(n[0])?i.setFlatCoordinates(r,n):i.setCoordinates(n,r),i}return e.prototype.clone=function(){return new e(this.flatCoordinates.slice(),this.layout)},e.prototype.closestPointXY=function(n,r,i,o){return o<Ap(this.getExtent(),n,r)?o:(this.maxDeltaRevision_!=this.getRevision()&&(this.maxDelta_=Math.sqrt(sB(this.flatCoordinates,0,this.flatCoordinates.length,this.stride,0)),this.maxDeltaRevision_=this.getRevision()),cB(this.flatCoordinates,0,this.flatCoordinates.length,this.stride,this.maxDelta_,!0,n,r,i,o))},e.prototype.getArea=function(){return Jie(this.flatCoordinates,0,this.flatCoordinates.length,this.stride)},e.prototype.getCoordinates=function(){return wf(this.flatCoordinates,0,this.flatCoordinates.length,this.stride)},e.prototype.getSimplifiedGeometryInternal=function(n){var r=[];return r.length=dB(this.flatCoordinates,0,this.flatCoordinates.length,this.stride,n,r,0),new e(r,dn.XY)},e.prototype.getType=function(){return"LinearRing"},e.prototype.intersectsExtent=function(n){return!1},e.prototype.setCoordinates=function(n,r){this.setLayout(r,n,1),this.flatCoordinates||(this.flatCoordinates=[]),this.flatCoordinates.length=s2(this.flatCoordinates,0,n,this.stride),this.changed()},e}(bd);function toe(t,e,n,r,i,o,a){for(var s,l,c,u,f,d,h,p=i[o+1],m=[],g=0,v=n.length;g<v;++g){var y=n[g];for(u=t[y-r],d=t[y-r+1],s=e;s<y;s+=r)f=t[s],h=t[s+1],(p<=d&&h<=p||d<=p&&p<=h)&&(c=(p-d)/(h-d)*(f-u)+u,m.push(c)),u=f,d=h}var x=NaN,b=-1/0;for(m.sort(rp),u=m[0],s=1,l=m.length;s<l;++s){f=m[s];var _=Math.abs(f-u);_>b&&(c=(u+f)/2,hB(t,e,n,r,c,p)&&(x=c,b=_)),u=f}return isNaN(x)&&(x=i[o]),a?(a.push(x,p,b),a):[x,p,b]}function t$e(t,e,n,r,i){for(var o=[],a=0,s=n.length;a<s;++a){var l=n[a];o=toe(t,e,l,r,i,2*a,o),e=l[l.length-1]}return o}function n$e(t,e,n,r){for(;e<n-r;){for(var i=0;i<r;++i){var o=t[e+i];t[e+i]=t[n-r+i],t[n-r+i]=o}e+=r,n-=r}}function noe(t,e,n,r){for(var i=0,o=t[n-r],a=t[n-r+1];e<n;e+=r){var s=t[e],l=t[e+1];i+=(s-o)*(l+a),o=s,a=l}return i===0?void 0:i>0}function roe(t,e,n,r,i){for(var o=0,a=n.length;o<a;++o){var s=n[o],l=noe(t,e,s,r);if(o===0){if(!l)return!1}else if(l)return!1;e=s}return!0}function r$e(t,e,n,r,i){for(var o=0,a=n.length;o<a;++o){var s=n[o];if(!roe(t,e,s,r))return!1;s.length&&(e=s[s.length-1])}return!0}function r3(t,e,n,r,i){for(var o=i!==void 0?i:!1,a=0,s=n.length;a<s;++a){var l=n[a],c=noe(t,e,l,r),u=a===0?o&&c||!o&&!c:o&&!c||!o&&c;u&&n$e(t,e,l,r),e=l}return e}function EG(t,e,n,r,i){for(var o=0,a=n.length;o<a;++o)e=r3(t,e,n[o],r,i);return e}var i$e=function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,i){r.__proto__=i}||function(r,i){for(var o in i)Object.prototype.hasOwnProperty.call(i,o)&&(r[o]=i[o])},t(e,n)};return function(e,n){if(typeof n!="function"&&n!==null)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");t(e,n);function r(){this.constructor=e}e.prototype=n===null?Object.create(n):(r.prototype=n.prototype,new r)}}(),td=function(t){i$e(e,t);function e(n,r,i){var o=t.call(this)||this;return o.ends_=[],o.flatInteriorPointRevision_=-1,o.flatInteriorPoint_=null,o.maxDelta_=-1,o.maxDeltaRevision_=-1,o.orientedRevision_=-1,o.orientedFlatCoordinates_=null,r!==void 0&&i?(o.setFlatCoordinates(r,n),o.ends_=i):o.setCoordinates(n,r),o}return e.prototype.appendLinearRing=function(n){this.flatCoordinates?Zc(this.flatCoordinates,n.getFlatCoordinates()):this.flatCoordinates=n.getFlatCoordinates().slice(),this.ends_.push(this.flatCoordinates.length),this.changed()},e.prototype.clone=function(){var n=new e(this.flatCoordinates.slice(),this.layout,this.ends_.slice());return n.applyProperties(this),n},e.prototype.closestPointXY=function(n,r,i,o){return o<Ap(this.getExtent(),n,r)?o:(this.maxDeltaRevision_!=this.getRevision()&&(this.maxDelta_=Math.sqrt(lB(this.flatCoordinates,0,this.ends_,this.stride,0)),this.maxDeltaRevision_=this.getRevision()),uB(this.flatCoordinates,0,this.ends_,this.stride,this.maxDelta_,!0,n,r,i,o))},e.prototype.containsXY=function(n,r){return hB(this.getOrientedFlatCoordinates(),0,this.ends_,this.stride,n,r)},e.prototype.getArea=function(){return eoe(this.getOrientedFlatCoordinates(),0,this.ends_,this.stride)},e.prototype.getCoordinates=function(n){var r;return n!==void 0?(r=this.getOrientedFlatCoordinates().slice(),r3(r,0,this.ends_,this.stride,n)):r=this.flatCoordinates,zb(r,0,this.ends_,this.stride)},e.prototype.getEnds=function(){return this.ends_},e.prototype.getFlatInteriorPoint=function(){if(this.flatInteriorPointRevision_!=this.getRevision()){var n=ed(this.getExtent());this.flatInteriorPoint_=toe(this.getOrientedFlatCoordinates(),0,this.ends_,this.stride,n,0),this.flatInteriorPointRevision_=this.getRevision()}return this.flatInteriorPoint_},e.prototype.getInteriorPoint=function(){return new ql(this.getFlatInteriorPoint(),dn.XYM)},e.prototype.getLinearRingCount=function(){return this.ends_.length},e.prototype.getLinearRing=function(n){return n<0||this.ends_.length<=n?null:new TG(this.flatCoordinates.slice(n===0?0:this.ends_[n-1],this.ends_[n]),this.layout)},e.prototype.getLinearRings=function(){for(var n=this.layout,r=this.flatCoordinates,i=this.ends_,o=[],a=0,s=0,l=i.length;s<l;++s){var c=i[s],u=new TG(r.slice(a,c),n);o.push(u),a=c}return o},e.prototype.getOrientedFlatCoordinates=function(){if(this.orientedRevision_!=this.getRevision()){var n=this.flatCoordinates;roe(n,0,this.ends_,this.stride)?this.orientedFlatCoordinates_=n:(this.orientedFlatCoordinates_=n.slice(),this.orientedFlatCoordinates_.length=r3(this.orientedFlatCoordinates_,0,this.ends_,this.stride)),this.orientedRevision_=this.getRevision()}return this.orientedFlatCoordinates_},e.prototype.getSimplifiedGeometryInternal=function(n){var r=[],i=[];return r.length=qie(this.flatCoordinates,0,this.ends_,this.stride,Math.sqrt(n),r,0,i),new e(r,dn.XY,i)},e.prototype.getType=function(){return"Polygon"},e.prototype.intersectsExtent=function(n){return Kie(this.getOrientedFlatCoordinates(),0,this.ends_,this.stride,n)},e.prototype.setCoordinates=function(n,r){this.setLayout(r,n,2),this.flatCoordinates||(this.flatCoordinates=[]);var i=fB(this.flatCoordinates,0,n,this.stride,this.ends_);this.flatCoordinates.length=i.length===0?0:i[i.length-1],this.changed()},e}(bd);function i3(t){var e=t[0],n=t[1],r=t[2],i=t[3],o=[e,n,e,i,r,i,r,n,e,n];return new td(o,dn.XY,[o.length])}function o$e(t,e,n){for(var r=32,i=t.getStride(),o=t.getLayout(),a=t.getCenter(),s=i*(r+1),l=new Array(s),c=0;c<s;c+=i){l[c]=0,l[c+1]=0;for(var u=2;u<i;u++)l[c+u]=a[u]}var f=[l.length],d=new td(l,o,f);return a$e(d,a,t.getRadius()),d}function a$e(t,e,n,r){for(var i=t.getFlatCoordinates(),o=t.getStride(),a=i.length/o-1,s=0,l=0;l<=a;++l){var c=l*o,u=s+jf(l,a)*2*Math.PI/a;i[c]=e[0]+n*Math.cos(u),i[c+1]=e[1]+n*Math.sin(u)}t.changed()}function s$e(t,e,n,r){for(var i=[],o=Oa(),a=0,s=n.length;a<s;++a){var l=n[a];o=Iie(t,e,l[0],r),i.push((o[0]+o[2])/2,(o[1]+o[3])/2),e=l[l.length-1]}return i}var l$e=function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,i){r.__proto__=i}||function(r,i){for(var o in i)Object.prototype.hasOwnProperty.call(i,o)&&(r[o]=i[o])},t(e,n)};return function(e,n){if(typeof n!="function"&&n!==null)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");t(e,n);function r(){this.constructor=e}e.prototype=n===null?Object.create(n):(r.prototype=n.prototype,new r)}}(),mB=function(t){l$e(e,t);function e(n,r,i){var o=t.call(this)||this;if(o.endss_=[],o.flatInteriorPointsRevision_=-1,o.flatInteriorPoints_=null,o.maxDelta_=-1,o.maxDeltaRevision_=-1,o.orientedRevision_=-1,o.orientedFlatCoordinates_=null,!i&&!Array.isArray(n[0])){for(var a=o.getLayout(),s=n,l=[],c=[],u=0,f=s.length;u<f;++u){var d=s[u];u===0&&(a=d.getLayout());for(var h=l.length,p=d.getEnds(),m=0,g=p.length;m<g;++m)p[m]+=h;Zc(l,d.getFlatCoordinates()),c.push(p)}r=a,n=l,i=c}return r!==void 0&&i?(o.setFlatCoordinates(r,n),o.endss_=i):o.setCoordinates(n,r),o}return e.prototype.appendPolygon=function(n){var r;if(!this.flatCoordinates)this.flatCoordinates=n.getFlatCoordinates().slice(),r=n.getEnds().slice(),this.endss_.push();else{var i=this.flatCoordinates.length;Zc(this.flatCoordinates,n.getFlatCoordinates()),r=n.getEnds().slice();for(var o=0,a=r.length;o<a;++o)r[o]+=i}this.endss_.push(r),this.changed()},e.prototype.clone=function(){for(var n=this.endss_.length,r=new Array(n),i=0;i<n;++i)r[i]=this.endss_[i].slice();var o=new e(this.flatCoordinates.slice(),this.layout,r);return o.applyProperties(this),o},e.prototype.closestPointXY=function(n,r,i,o){return o<Ap(this.getExtent(),n,r)?o:(this.maxDeltaRevision_!=this.getRevision()&&(this.maxDelta_=Math.sqrt(FNe(this.flatCoordinates,0,this.endss_,this.stride,0)),this.maxDeltaRevision_=this.getRevision()),jNe(this.getOrientedFlatCoordinates(),0,this.endss_,this.stride,this.maxDelta_,!0,n,r,i,o))},e.prototype.containsXY=function(n,r){return HNe(this.getOrientedFlatCoordinates(),0,this.endss_,this.stride,n,r)},e.prototype.getArea=function(){return JNe(this.getOrientedFlatCoordinates(),0,this.endss_,this.stride)},e.prototype.getCoordinates=function(n){var r;return n!==void 0?(r=this.getOrientedFlatCoordinates().slice(),EG(r,0,this.endss_,this.stride,n)):r=this.flatCoordinates,t3(r,0,this.endss_,this.stride)},e.prototype.getEndss=function(){return this.endss_},e.prototype.getFlatInteriorPoints=function(){if(this.flatInteriorPointsRevision_!=this.getRevision()){var n=s$e(this.flatCoordinates,0,this.endss_,this.stride);this.flatInteriorPoints_=t$e(this.getOrientedFlatCoordinates(),0,this.endss_,this.stride,n),this.flatInteriorPointsRevision_=this.getRevision()}return this.flatInteriorPoints_},e.prototype.getInteriorPoints=function(){return new c2(this.getFlatInteriorPoints().slice(),dn.XYM)},e.prototype.getOrientedFlatCoordinates=function(){if(this.orientedRevision_!=this.getRevision()){var n=this.flatCoordinates;r$e(n,0,this.endss_,this.stride)?this.orientedFlatCoordinates_=n:(this.orientedFlatCoordinates_=n.slice(),this.orientedFlatCoordinates_.length=EG(this.orientedFlatCoordinates_,0,this.endss_,this.stride)),this.orientedRevision_=this.getRevision()}return this.orientedFlatCoordinates_},e.prototype.getSimplifiedGeometryInternal=function(n){var r=[],i=[];return r.length=WNe(this.flatCoordinates,0,this.endss_,this.stride,Math.sqrt(n),r,0,i),new e(r,dn.XY,i)},e.prototype.getPolygon=function(n){if(n<0||this.endss_.length<=n)return null;var r;if(n===0)r=0;else{var i=this.endss_[n-1];r=i[i.length-1]}var o=this.endss_[n].slice(),a=o[o.length-1];if(r!==0)for(var s=0,l=o.length;s<l;++s)o[s]-=r;return new td(this.flatCoordinates.slice(r,a),this.layout,o)},e.prototype.getPolygons=function(){for(var n=this.layout,r=this.flatCoordinates,i=this.endss_,o=[],a=0,s=0,l=i.length;s<l;++s){var c=i[s].slice(),u=c[c.length-1];if(a!==0)for(var f=0,d=c.length;f<d;++f)c[f]-=a;var h=new td(r.slice(a,u),n,c);o.push(h),a=u}return o},e.prototype.getType=function(){return"MultiPolygon"},e.prototype.intersectsExtent=function(n){return XNe(this.getOrientedFlatCoordinates(),0,this.endss_,this.stride,n)},e.prototype.setCoordinates=function(n,r){this.setLayout(r,n,3),this.flatCoordinates||(this.flatCoordinates=[]);var i=BNe(this.flatCoordinates,0,n,this.stride,this.endss_);if(i.length===0)this.flatCoordinates.length=0;else{var o=i[i.length-1];this.flatCoordinates.length=o.length===0?0:o[o.length-1]}this.changed()},e}(bd),c$e=function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,i){r.__proto__=i}||function(r,i){for(var o in i)Object.prototype.hasOwnProperty.call(i,o)&&(r[o]=i[o])},t(e,n)};return function(e,n){if(typeof n!="function"&&n!==null)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");t(e,n);function r(){this.constructor=e}e.prototype=n===null?Object.create(n):(r.prototype=n.prototype,new r)}}(),Ip=function(t){c$e(e,t);function e(n){var r=this,i=n||{};return r=t.call(this)||this,r.dataProjection=zr(i.dataProjection?i.dataProjection:"EPSG:4326"),i.featureProjection&&(r.defaultFeatureProjection=zr(i.featureProjection)),r.geometryName_=i.geometryName,r.extractGeometryName_=i.extractGeometryName,r.supportedMediaTypes=["application/geo+json","application/vnd.geo+json"],r}return e.prototype.readFeatureFromObject=function(n,r){var i=null;n.type==="Feature"?i=n:i={type:"Feature",geometry:n,properties:null};var o=o3(i.geometry,r),a=new zc;return this.geometryName_?a.setGeometryName(this.geometryName_):this.extractGeometryName_&&"geometry_name"in i!==void 0&&a.setGeometryName(i.geometry_name),a.setGeometry(o),"id"in i&&a.setId(i.id),i.properties&&a.setProperties(i.properties,!0),a},e.prototype.readFeaturesFromObject=function(n,r){var i=n,o=null;if(i.type==="FeatureCollection"){var a=n;o=[];for(var s=a.features,l=0,c=s.length;l<c;++l)o.push(this.readFeatureFromObject(s[l],r))}else o=[this.readFeatureFromObject(n,r)];return o},e.prototype.readGeometryFromObject=function(n,r){return o3(n,r)},e.prototype.readProjectionFromObject=function(n){var r=n.crs,i;return r?r.type=="name"?i=zr(r.properties.name):r.type==="EPSG"?i=zr("EPSG:"+r.properties.code):Ut(!1,36):i=this.dataProjection,i},e.prototype.writeFeatureObject=function(n,r){r=this.adaptOptions(r);var i={type:"Feature",geometry:null,properties:null},o=n.getId();if(o!==void 0&&(i.id=o),!n.hasProperties())return i;var a=n.getProperties(),s=n.getGeometry();return s&&(i.geometry=a3(s,r),delete a[n.getGeometryName()]),rv(a)||(i.properties=a),i},e.prototype.writeFeaturesObject=function(n,r){r=this.adaptOptions(r);for(var i=[],o=0,a=n.length;o<a;++o)i.push(this.writeFeatureObject(n[o],r));return{type:"FeatureCollection",features:i}},e.prototype.writeGeometryObject=function(n,r){return a3(n,this.adaptOptions(r))},e}(DNe);function o3(t,e){if(!t)return null;var n;switch(t.type){case"Point":{n=f$e(t);break}case"LineString":{n=d$e(t);break}case"Polygon":{n=g$e(t);break}case"MultiPoint":{n=p$e(t);break}case"MultiLineString":{n=h$e(t);break}case"MultiPolygon":{n=m$e(t);break}case"GeometryCollection":{n=u$e(t);break}default:throw new Error("Unsupported GeoJSON type: "+t.type)}return BT(n,!1,e)}function u$e(t,e){var n=t.geometries.map(function(r){return o3(r,e)});return new jT(n)}function f$e(t){return new ql(t.coordinates)}function d$e(t){return new zh(t.coordinates)}function h$e(t){return new pB(t.coordinates)}function p$e(t){return new c2(t.coordinates)}function m$e(t){return new mB(t.coordinates)}function g$e(t){return new td(t.coordinates)}function a3(t,e){t=BT(t,!0,e);var n=t.getType(),r;switch(n){case"Point":{r=w$e(t);break}case"LineString":{r=y$e(t);break}case"Polygon":{r=S$e(t,e);break}case"MultiPoint":{r=b$e(t);break}case"MultiLineString":{r=x$e(t);break}case"MultiPolygon":{r=_$e(t,e);break}case"GeometryCollection":{r=v$e(t,e);break}case"Circle":{r={type:"GeometryCollection",geometries:[]};break}default:throw new Error("Unsupported geometry type: "+n)}return r}function v$e(t,e){var n=t.getGeometriesArray().map(function(r){var i=ur({},e);return delete i.featureProjection,a3(r,i)});return{type:"GeometryCollection",geometries:n}}function y$e(t,e){return{type:"LineString",coordinates:t.getCoordinates()}}function x$e(t,e){return{type:"MultiLineString",coordinates:t.getCoordinates()}}function b$e(t,e){return{type:"MultiPoint",coordinates:t.getCoordinates()}}function _$e(t,e){var n;return e&&(n=e.rightHanded),{type:"MultiPolygon",coordinates:t.getCoordinates(n)}}function w$e(t,e){return{type:"Point",coordinates:t.getCoordinates()}}function S$e(t,e){var n;return e&&(n=e.rightHanded),{type:"Polygon",coordinates:t.getCoordinates(n)}}class ioe extends Error{constructor(n,r){super(r);Yt(this,"statusCode");this.statusCode=n}}function ay(t){return t?{headers:[["Authorization",`Bearer ${t}`]]}:{}}function sy(t,e){if(e.length>0){const n=e.map(r=>r.map(encodeURIComponent).join("=")).join("&");return t.includes("?")?t.endsWith("&")?t+n:t+"&"+n:t+"?"+n}return t}async function ooe(t,e){let n;try{if(n=await fetch(t,e),n.ok)return n}catch(i){throw i instanceof TypeError?(console.error(`Server did not respond for ${t}. May be caused by timeout, refused connection, network error, etc.`,i),new Error(fe.get("Cannot reach server"))):(console.error(i),i)}let r=n.statusText;try{const i=await n.json();if(i&&i.error){const o=i.error;console.error(o),o.message&&(r+=`: ${o.message}`)}}catch{}throw console.error(n),new ioe(n.status,r)}async function wu(t,e,n){let r;JDe(e)?n=e:r=e;const o=await(await ooe(t,r)).json();return n?n(o):o}const O$e=/^#([A-Fa-f0-9]{8}|[A-Fa-f0-9]{6}|[A-Fa-f0-9]{3})$/,C$e=t=>{let e;if(t.includes(",")){const r=t.split(",");if(r.length===3||r.length===4){const i=[0,0,0,255];for(let o=0;o<3;o++){const a=Number.parseInt(r[o]);if(a<0||a>255)return;i[o]=a}if(r.length===4){if(e=PG(r[3]),e===void 0)return;i[3]=e}return i}if(r.length!==2||(t=r[0],e=PG(r[1]),e===void 0))return}const n=(t.startsWith("#")?soe:E$e)(t);if(n){if(n.length===3)return[...n,e===void 0?255:e];if(n.length===4&&e===void 0)return n}};function aoe(t){return"#"+t.map(e=>{const n=e.toString(16);return n.length===1?"0"+n:n}).join("")}function soe(t){if(O$e.test(t)){if(t.length===4)return[parseInt(t[1]+t[1],16),parseInt(t[2]+t[2],16),parseInt(t[3]+t[3],16)];if(t.length===7)return[parseInt(t.substring(1,3),16),parseInt(t.substring(3,5),16),parseInt(t.substring(5,7),16)];if(t.length===9)return[parseInt(t.substring(1,3),16),parseInt(t.substring(3,5),16),parseInt(t.substring(5,7),16),parseInt(t.substring(7,9),16)]}}const PG=t=>{const e=Number.parseFloat(t);if(e===0)return 0;if(e===1)return 255;if(e>0&&e<1)return Math.round(256*e)},T$e=t=>P$e[t.toLowerCase()],E$e=t=>{const e=T$e(t);if(e)return soe(e)},P$e={aliceblue:"#F0F8FF",antiquewhite:"#FAEBD7",aqua:"#00FFFF",aquamarine:"#7FFFD4",azure:"#F0FFFF",beige:"#F5F5DC",bisque:"#FFE4C4",black:"#000000",blanchedalmond:"#FFEBCD",blue:"#0000FF",blueviolet:"#8A2BE2",brown:"#A52A2A",burlywood:"#DEB887",cadetblue:"#5F9EA0",chartreuse:"#7FFF00",chocolate:"#D2691E",coral:"#FF7F50",cornflowerblue:"#6495ED",cornsilk:"#FFF8DC",crimson:"#DC143C",cyan:"#00FFFF",darkblue:"#00008B",darkcyan:"#008B8B",darkgoldenrod:"#B8860B",darkgray:"#A9A9A9",darkgrey:"#A9A9A9",darkgreen:"#006400",darkkhaki:"#BDB76B",darkmagenta:"#8B008B",darkolivegreen:"#556B2F",darkorange:"#FF8C00",darkorchid:"#9932CC",darkred:"#8B0000",darksalmon:"#E9967A",darkseagreen:"#8FBC8F",darkslateblue:"#483D8B",darkslategray:"#2F4F4F",darkslategrey:"#2F4F4F",darkturquoise:"#00CED1",darkviolet:"#9400D3",deeppink:"#FF1493",deepskyblue:"#00BFFF",dimgray:"#696969",dimgrey:"#696969",dodgerblue:"#1E90FF",firebrick:"#B22222",floralwhite:"#FFFAF0",forestgreen:"#228B22",fuchsia:"#FF00FF",gainsboro:"#DCDCDC",ghostwhite:"#F8F8FF",gold:"#FFD700",goldenrod:"#DAA520",gray:"#808080",grey:"#808080",green:"#008000",greenyellow:"#ADFF2F",honeydew:"#F0FFF0",hotpink:"#FF69B4",indianred:"#CD5C5C",indigo:"#4B0082",ivory:"#FFFFF0",khaki:"#F0E68C",lavender:"#E6E6FA",lavenderblush:"#FFF0F5",lawngreen:"#7CFC00",lemonchiffon:"#FFFACD",lightblue:"#ADD8E6",lightcoral:"#F08080",lightcyan:"#E0FFFF",lightgoldenrodyellow:"#FAFAD2",lightgray:"#D3D3D3",lightgrey:"#D3D3D3",lightgreen:"#90EE90",lightpink:"#FFB6C1",lightsalmon:"#FFA07A",lightseagreen:"#20B2AA",lightskyblue:"#87CEFA",lightslategray:"#778899",lightslategrey:"#778899",lightsteelblue:"#B0C4DE",lightyellow:"#FFFFE0",lime:"#00FF00",limegreen:"#32CD32",linen:"#FAF0E6",magenta:"#FF00FF",maroon:"#800000",mediumaquamarine:"#66CDAA",mediumblue:"#0000CD",mediumorchid:"#BA55D3",mediumpurple:"#9370DB",mediumseagreen:"#3CB371",mediumslateblue:"#7B68EE",mediumspringgreen:"#00FA9A",mediumturquoise:"#48D1CC",mediumvioletred:"#C71585",midnightblue:"#191970",mintcream:"#F5FFFA",mistyrose:"#FFE4E1",moccasin:"#FFE4B5",navajowhite:"#FFDEAD",navy:"#000080",oldlace:"#FDF5E6",olive:"#808000",olivedrab:"#6B8E23",orange:"#FFA500",orangered:"#FF4500",orchid:"#DA70D6",palegoldenrod:"#EEE8AA",palegreen:"#98FB98",paleturquoise:"#AFEEEE",palevioletred:"#DB7093",papayawhip:"#FFEFD5",peachpuff:"#FFDAB9",peru:"#CD853F",pink:"#FFC0CB",plum:"#DDA0DD",powderblue:"#B0E0E6",purple:"#800080",rebeccapurple:"#663399",red:"#FF0000",rosybrown:"#BC8F8F",royalblue:"#4169E1",saddlebrown:"#8B4513",salmon:"#FA8072",sandybrown:"#F4A460",seagreen:"#2E8B57",seashell:"#FFF5EE",sienna:"#A0522D",silver:"#C0C0C0",skyblue:"#87CEEB",slateblue:"#6A5ACD",slategray:"#708090",slategrey:"#708090",snow:"#FFFAFA",springgreen:"#00FF7F",steelblue:"#4682B4",tan:"#D2B48C",teal:"#008080",thistle:"#D8BFD8",tomato:"#FF6347",turquoise:"#40E0D0",violet:"#EE82EE",wheat:"#F5DEB3",white:"#FFFFFF",whitesmoke:"#F5F5F5",yellow:"#FFFF00",yellowgreen:"#9ACD32"};function M$e(t){return wu(`${t}/colorbars`,k$e)}function k$e(t){const e=[],n={},r={};return t.forEach(i=>{const[o,a,s]=i,l=[];s.forEach(c=>{if(c.length===3){const[u,f,d]=c;l.push(u),n[u]=f,r[u]={name:d.name,type:d.type,colorRecords:d.colors.map(A$e)}}else if(c.length===2){const[u,f]=c;l.push(u),n[u]=f}}),e.push({title:o,description:a,names:l})}),{groups:e,images:n,customColorMaps:r}}function A$e(t){const e=R$e(t[1]),n=t[0];if(t.length===3){const r=t[2];return{value:n,color:e,label:r}}else return{value:n,color:e}}function R$e(t){return t?Mp(t)?t:aoe(t):"#000000"}function I$e(t,e){const n=sy(`${t}/datasets`,[["details","1"]]),r=ay(e);return wu(n,r,D$e)}function D$e(t){return(t.datasets||[]).map(L$e)}function L$e(t){if(t.dimensions&&t.dimensions.length){let e=t.dimensions;const n=e.findIndex(r=>r.name==="time");if(n>-1){const r=e[n],i=r.coordinates;if(i&&i.length&&typeof i[0]=="string"){const o=i,a=o.map(s=>new Date(s).getTime());return e=[...e],e[n]={...r,coordinates:a,labels:o},{...t,dimensions:e}}}}return t}function N$e(t,e,n,r){const i=ay(r),o=encodeURIComponent(e),a=encodeURIComponent(n);return wu(`${t}/datasets/${o}/places/${a}`,i)}function $$e(t){return wu(`${t}/expressions/capabilities`)}function F$e(t){return wu(`${t}/`)}function V1(t){return Mp(t.expression)}function ly(t){return encodeURIComponent(Mp(t)?t:t.id)}function G1(t){return encodeURIComponent(Mp(t)?t:V1(t)?`${t.name}=${t.expression}`:t.name)}function j$e(t,e,n,r,i,o,a,s,l,c){let u,f=null;const d=[];s?(d.push(["aggMethods","median"]),u="median"):l?(d.push(["aggMethods","mean,std"]),u="mean",f="std"):(d.push(["aggMethods","mean"]),u="mean"),o&&d.push(["startDate",o]),a&&d.push(["endDate",a]);const h=sy(`${t}/timeseries/${ly(e)}/${G1(n)}`,d),p={...ay(c),method:"post",body:JSON.stringify(i)};return wu(h,p,g=>{const v=g.result;if(!v||v.length===0)return null;const y=v.map(b=>({...b,time:new Date(b.time).getTime()}));return{source:{datasetId:e.id,datasetTitle:e.title,variableName:n.name,variableUnits:n.units||void 0,placeId:r,geometry:i,valueDataKey:u,errorDataKey:f},data:y}})}function B$e(t,e,n,r,i,o){const a=[["time",i]],s=sy(`${t}/statistics/${ly(e)}/${G1(n)}`,a),l={...ay(o),method:"post",body:JSON.stringify(r.place.geometry)},c={dataset:e,variable:n,placeInfo:r,time:i};return wu(s,l,u=>({source:c,statistics:u.result}))}function z$e(t,e,n,r,i,o,a){const s=[["lon",r.toString()],["lat",i.toString()]];o&&s.push(["time",o]);const l=sy(`${t}/statistics/${ly(e)}/${G1(n)}`,s);return wu(l,ay(a),c=>c.result?c.result:{})}function U$e(t,e){const n=sy(`${t}/maintenance/update`,[]),r=ay(e);try{return wu(n,r).then(()=>!0).catch(i=>(console.error(i),!1))}catch(i){return console.error(i),Promise.resolve(!1)}}class UT extends Error{}function W$e(t,e){if(t===null)throw new UT(`assertion failed: ${e} must not be null`)}function V$e(t,e){if(typeof t>"u")throw new UT(`assertion failed: ${e} must not be undefined`)}function G$e(t,e){W$e(t,e),V$e(t,e)}function NA(t,e){if(Array.isArray(t)){if(t.length===0)throw new UT(`assertion failed: ${e} must be a non-empty array`)}else throw new UT(`assertion failed: ${e} must be an array`)}function Ub(t,e){return e&&t.find(n=>n.id===e)||null}function s3(t,e){return e&&t.variables.find(n=>n.name===e)||null}function H$e(t){return t.variables.findIndex(e=>Mp(e.expression))}function gB(t){const e=H$e(t);return e>=0?[t.variables.slice(0,e),t.variables.slice(e)]:[t.variables,[]]}function loe(t){G$e(t,"dataset"),NA(t.dimensions,"dataset.dimensions");const e=t.dimensions.find(n=>n.name==="time");return e?(NA(e.coordinates,"timeDimension.coordinates"),NA(e.labels,"timeDimension.labels"),e):null}function coe(t){const e=loe(t);if(!e)return null;const n=e.coordinates;return[n[0],n[n.length-1]]}var WT="NOT_FOUND";function q$e(t){var e;return{get:function(r){return e&&t(e.key,r)?e.value:WT},put:function(r,i){e={key:r,value:i}},getEntries:function(){return e?[e]:[]},clear:function(){e=void 0}}}function X$e(t,e){var n=[];function r(s){var l=n.findIndex(function(u){return e(s,u.key)});if(l>-1){var c=n[l];return l>0&&(n.splice(l,1),n.unshift(c)),c.value}return WT}function i(s,l){r(s)===WT&&(n.unshift({key:s,value:l}),n.length>t&&n.pop())}function o(){return n}function a(){n=[]}return{get:r,put:i,getEntries:o,clear:a}}var Q$e=function(e,n){return e===n};function Y$e(t){return function(n,r){if(n===null||r===null||n.length!==r.length)return!1;for(var i=n.length,o=0;o<i;o++)if(!t(n[o],r[o]))return!1;return!0}}function uoe(t,e){var n=typeof e=="object"?e:{equalityCheck:e},r=n.equalityCheck,i=r===void 0?Q$e:r,o=n.maxSize,a=o===void 0?1:o,s=n.resultEqualityCheck,l=Y$e(i),c=a===1?q$e(l):X$e(a,l);function u(){var f=c.get(arguments);if(f===WT){if(f=t.apply(null,arguments),s){var d=c.getEntries(),h=d.find(function(p){return s(p.value,f)});h&&(f=h.value)}c.put(arguments,f)}return f}return u.clearCache=function(){return c.clear()},u}function K$e(t){var e=Array.isArray(t[0])?t[0]:t;if(!e.every(function(r){return typeof r=="function"})){var n=e.map(function(r){return typeof r=="function"?"function "+(r.name||"unnamed")+"()":typeof r}).join(", ");throw new Error("createSelector expects all input-selectors to be functions, but received the following types: ["+n+"]")}return e}function Z$e(t){for(var e=arguments.length,n=new Array(e>1?e-1:0),r=1;r<e;r++)n[r-1]=arguments[r];var i=function(){for(var a=arguments.length,s=new Array(a),l=0;l<a;l++)s[l]=arguments[l];var c=0,u,f={memoizeOptions:void 0},d=s.pop();if(typeof d=="object"&&(f=d,d=s.pop()),typeof d!="function")throw new Error("createSelector expects an output function after the inputs, but received: ["+typeof d+"]");var h=f,p=h.memoizeOptions,m=p===void 0?n:p,g=Array.isArray(m)?m:[m],v=K$e(s),y=t.apply(void 0,[function(){return c++,d.apply(null,arguments)}].concat(g)),x=t(function(){for(var _=[],S=v.length,O=0;O<S;O++)_.push(v[O].apply(null,arguments));return u=y.apply(null,_),u});return Object.assign(x,{resultFunc:d,memoizedResultFunc:y,dependencies:v,lastResult:function(){return u},recomputations:function(){return c},resetRecomputations:function(){return c=0}}),x};return i}var at=Z$e(uoe);function Js(t){return(t||"")+Math.random().toString(16).substring(2)}const cy="user-",Ws=cy+"drawing";function vB(t,e){return{type:"FeatureCollection",features:e,id:Js(cy),title:t}}function yB(t,e){return{type:"Feature",geometry:new Ip().writeGeometryObject(t),properties:e,id:Js(cy)}}const J$e=H1(["label","title","name","id"]),eFe=H1(["description","desc","abstract","comment"]),tFe=H1(["color"]),nFe=H1(["opacity"]),rFe=H1(["image","img","picture","pic"]);function iFe(t,e){const n={};return x0(n,t,e,"label",e.id+"",J$e),x0(n,t,e,"color",tp(sFe(e)),tFe),x0(n,t,e,"opacity",.2,nFe),x0(n,t,e,"image",null,rFe),x0(n,t,e,"description",null,eFe),{placeGroup:t,place:e,...n}}const u2=uoe(iFe);function x0(t,e,n,r,i,o){let a;const s=e.propertyMapping&&e.propertyMapping[r];if(s){if(s.includes("${")){t[r]=oFe(n,s);return}o.length>0&&o[0]!==s&&(o=[s,...o])}n.properties&&(a=MG(n.properties,o)),a===void 0&&(a=MG(n,o)),t[r]=a||i}function oFe(t,e){let n=e;if(t.properties)for(const r of Object.getOwnPropertyNames(t.properties)){if(!n.includes("${"))break;const i="${"+r+"}";n.includes(i)&&(n=n.replace(i,`${t.properties[r]}`))}return n}function MG(t,e){let n;for(const r of e)if(r in t)return t[r];return n}function H1(t){let e=[];for(const n of t)e=e.concat(n.toLowerCase(),n.toUpperCase(),n[0].toUpperCase()+n.substring(1).toLowerCase());return e}function xB(t,e){t.forEach(n=>{uy(n)&&n.features.forEach(r=>{e(n,r)})})}function aFe(t,e){const n=Mp(e)?(r,i)=>i.id===e:e;for(const r of t)if(uy(r)){const i=r.features.find(o=>n(r,o));if(i)return u2(r,i)}return null}function sFe(t){const e=t.id+"";let n=0,r,i;if(e.length===0)return n;for(r=0;r<e.length;r++)i=e.charCodeAt(r),n=(n<<5)-n+i,n|=0;return n}function uy(t){return!!t.features}function foe(t,e){if(!e||!uy(t))return null;const n=t.features.find(i=>i.id===e);if(n)return n;const r=t.placeGroups;if(r)for(const i in r){const o=foe(r[i],e);if(o)return o}return null}function bB(t,e){if(e)for(const n of t){const r=foe(n,e);if(r!==null)return r}return null}const doe="User",hoe=`0.0: #23FF52
0.5: red
1.0: 120,30,255`;function lFe(t,e,n){const r=new Uint8ClampedArray(4*n),i=t.length;if(e==="categorical"||e==="stepwise"){const o=e==="categorical"?i:i-1;for(let a=0,s=0;a<n;a++,s+=4){const l=Math.floor(o*a/n),[c,u,f,d]=t[l].color;r[s]=c,r[s+1]=u,r[s+2]=f,r[s+3]=d}}else{const o=t[0].value,a=t[i-1].value,s=t.map(f=>(f.value-o)/(a-o));let l=0,c=s[0],u=s[1];for(let f=0,d=0;f<n;f++,d+=4){const h=f/(n-1);h>u&&(l++,c=s[l],u=s[l+1]);const p=(h-c)/(u-c),[m,g,v,y]=t[l].color,[x,b,_,S]=t[l+1].color;r[d]=m+p*(x-m),r[d+1]=g+p*(b-g),r[d+2]=v+p*(_-v),r[d+3]=y+p*(S-y)}}return r}function cFe(t,e,n){const r=lFe(t,e,n.width),i=new ImageData(r,r.length/4,1);return createImageBitmap(i).then(o=>{const a=n.getContext("2d");a&&a.drawImage(o,0,0,n.width,n.height)})}function uFe(t){const{colorRecords:e,errorMessage:n}=moe(t.code);if(!e)return Promise.resolve({errorMessage:n});const r=document.createElement("canvas");return r.width=256,r.height=1,cFe(e,t.type,r).then(()=>({imageData:r.toDataURL("image/png").split(",")[1]}))}function poe(t){const{colorRecords:e}=moe(t);if(e)return e.map(n=>({...n,color:aoe(n.color)}))}function moe(t){try{return{colorRecords:fFe(t)}}catch(e){if(e instanceof SyntaxError)return{errorMessage:`${e.message}`};throw e}}function fFe(t){const e=[];t.split(`
`).map(o=>o.trim().split(":").map(a=>a.trim())).forEach((o,a)=>{if(o.length==2||o.length==3){const[s,l]=o,c=parseFloat(s),u=C$e(l);if(!Number.isFinite(c))throw new SyntaxError(`Line ${a+1}: invalid value: ${s}`);if(!u)throw new SyntaxError(`Line ${a+1}: invalid color: ${l}`);o.length==3?e.push({value:c,color:u,label:o[2]}):e.push({value:c,color:u})}else if(o.length===1&&o[0]!=="")throw new SyntaxError(`Line ${a+1}: invalid color record: ${o[0]}`)});const n=e.length;if(n<2)throw new SyntaxError("At least two color records must be given");e.sort((o,a)=>o.value-a.value);const r=e[0].value,i=e[n-1].value;if(r===i)throw new SyntaxError("Values must form a range");return e}var _B={exports:{}};function dFe(t,e){var n=e&&e.cache?e.cache:yFe,r=e&&e.serializer?e.serializer:vFe,i=e&&e.strategy?e.strategy:pFe;return i(t,{cache:n,serializer:r})}function hFe(t){return t==null||typeof t=="number"||typeof t=="boolean"}function goe(t,e,n,r){var i=hFe(r)?r:n(r),o=e.get(i);return typeof o>"u"&&(o=t.call(this,r),e.set(i,o)),o}function voe(t,e,n){var r=Array.prototype.slice.call(arguments,3),i=n(r),o=e.get(i);return typeof o>"u"&&(o=t.apply(this,r),e.set(i,o)),o}function wB(t,e,n,r,i){return n.bind(e,t,r,i)}function pFe(t,e){var n=t.length===1?goe:voe;return wB(t,this,n,e.cache.create(),e.serializer)}function mFe(t,e){var n=voe;return wB(t,this,n,e.cache.create(),e.serializer)}function gFe(t,e){var n=goe;return wB(t,this,n,e.cache.create(),e.serializer)}function vFe(){return JSON.stringify(arguments)}function f2(){this.cache=Object.create(null)}f2.prototype.has=function(t){return t in this.cache};f2.prototype.get=function(t){return this.cache[t]};f2.prototype.set=function(t,e){this.cache[t]=e};var yFe={create:function(){return new f2}};_B.exports=dFe;_B.exports.strategies={variadic:mFe,monadic:gFe};var xFe=_B.exports;const bFe=$t(xFe),Oo={ADD:"add",REMOVE:"remove"};var yoe=function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,i){r.__proto__=i}||function(r,i){for(var o in i)Object.prototype.hasOwnProperty.call(i,o)&&(r[o]=i[o])},t(e,n)};return function(e,n){if(typeof n!="function"&&n!==null)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");t(e,n);function r(){this.constructor=e}e.prototype=n===null?Object.create(n):(r.prototype=n.prototype,new r)}}(),kG={LENGTH:"length"},bS=function(t){yoe(e,t);function e(n,r,i){var o=t.call(this,n)||this;return o.element=r,o.index=i,o}return e}(ac),Qa=function(t){yoe(e,t);function e(n,r){var i=t.call(this)||this;i.on,i.once,i.un;var o=r||{};if(i.unique_=!!o.unique,i.array_=n||[],i.unique_)for(var a=0,s=i.array_.length;a<s;++a)i.assertUnique_(i.array_[a],a);return i.updateLength_(),i}return e.prototype.clear=function(){for(;this.getLength()>0;)this.pop()},e.prototype.extend=function(n){for(var r=0,i=n.length;r<i;++r)this.push(n[r]);return this},e.prototype.forEach=function(n){for(var r=this.array_,i=0,o=r.length;i<o;++i)n(r[i],i,r)},e.prototype.getArray=function(){return this.array_},e.prototype.item=function(n){return this.array_[n]},e.prototype.getLength=function(){return this.get(kG.LENGTH)},e.prototype.insertAt=function(n,r){this.unique_&&this.assertUnique_(r),this.array_.splice(n,0,r),this.updateLength_(),this.dispatchEvent(new bS(Oo.ADD,r,n))},e.prototype.pop=function(){return this.removeAt(this.getLength()-1)},e.prototype.push=function(n){this.unique_&&this.assertUnique_(n);var r=this.getLength();return this.insertAt(r,n),this.getLength()},e.prototype.remove=function(n){for(var r=this.array_,i=0,o=r.length;i<o;++i)if(r[i]===n)return this.removeAt(i)},e.prototype.removeAt=function(n){var r=this.array_[n];return this.array_.splice(n,1),this.updateLength_(),this.dispatchEvent(new bS(Oo.REMOVE,r,n)),r},e.prototype.setAt=function(n,r){var i=this.getLength();if(n<i){this.unique_&&this.assertUnique_(r,n);var o=this.array_[n];this.array_[n]=r,this.dispatchEvent(new bS(Oo.REMOVE,o,n)),this.dispatchEvent(new bS(Oo.ADD,r,n))}else{for(var a=i;a<n;++a)this.insertAt(a,void 0);this.insertAt(n,r)}},e.prototype.updateLength_=function(){this.set(kG.LENGTH,this.array_.length)},e.prototype.assertUnique_=function(n,r){for(var i=0,o=this.array_.length;i<o;++i)if(this.array_[i]===n&&i!==r)throw new Pie(58)},e}(sc);const Bf={PRERENDER:"prerender",POSTRENDER:"postrender",PRECOMPOSE:"precompose",POSTCOMPOSE:"postcompose",RENDERCOMPLETE:"rendercomplete"};var op=function(){function t(e){var n=e||{};this.color_=n.color!==void 0?n.color:null}return t.prototype.clone=function(){var e=this.getColor();return new t({color:Array.isArray(e)?e.slice():e||void 0})},t.prototype.getColor=function(){return this.color_},t.prototype.setColor=function(e){this.color_=e},t}(),Xl=function(){function t(e){var n=e||{};this.color_=n.color!==void 0?n.color:null,this.lineCap_=n.lineCap,this.lineDash_=n.lineDash!==void 0?n.lineDash:null,this.lineDashOffset_=n.lineDashOffset,this.lineJoin_=n.lineJoin,this.miterLimit_=n.miterLimit,this.width_=n.width}return t.prototype.clone=function(){var e=this.getColor();return new t({color:Array.isArray(e)?e.slice():e||void 0,lineCap:this.getLineCap(),lineDash:this.getLineDash()?this.getLineDash().slice():void 0,lineDashOffset:this.getLineDashOffset(),lineJoin:this.getLineJoin(),miterLimit:this.getMiterLimit(),width:this.getWidth()})},t.prototype.getColor=function(){return this.color_},t.prototype.getLineCap=function(){return this.lineCap_},t.prototype.getLineDash=function(){return this.lineDash_},t.prototype.getLineDashOffset=function(){return this.lineDashOffset_},t.prototype.getLineJoin=function(){return this.lineJoin_},t.prototype.getMiterLimit=function(){return this.miterLimit_},t.prototype.getWidth=function(){return this.width_},t.prototype.setColor=function(e){this.color_=e},t.prototype.setLineCap=function(e){this.lineCap_=e},t.prototype.setLineDash=function(e){this.lineDash_=e},t.prototype.setLineDashOffset=function(e){this.lineDashOffset_=e},t.prototype.setLineJoin=function(e){this.lineJoin_=e},t.prototype.setMiterLimit=function(e){this.miterLimit_=e},t.prototype.setWidth=function(e){this.width_=e},t}();const Wn={IDLE:0,LOADING:1,LOADED:2,ERROR:3,EMPTY:4};function AG(t,e,n){return n===void 0&&(n=[0,0]),n[0]=t[0]+2*e,n[1]=t[1]+2*e,n}function RG(t){return t[0]>0&&t[1]>0}function xoe(t,e,n){return n===void 0&&(n=[0,0]),n[0]=t[0]*e+.5|0,n[1]=t[1]*e+.5|0,n}function fa(t,e){return Array.isArray(t)?t:(e===void 0?e=[t,t]:(e[0]=t,e[1]=t),e)}var boe=function(){function t(e){this.opacity_=e.opacity,this.rotateWithView_=e.rotateWithView,this.rotation_=e.rotation,this.scale_=e.scale,this.scaleArray_=fa(e.scale),this.displacement_=e.displacement,this.declutterMode_=e.declutterMode}return t.prototype.clone=function(){var e=this.getScale();return new t({opacity:this.getOpacity(),scale:Array.isArray(e)?e.slice():e,rotation:this.getRotation(),rotateWithView:this.getRotateWithView(),displacement:this.getDisplacement().slice(),declutterMode:this.getDeclutterMode()})},t.prototype.getOpacity=function(){return this.opacity_},t.prototype.getRotateWithView=function(){return this.rotateWithView_},t.prototype.getRotation=function(){return this.rotation_},t.prototype.getScale=function(){return this.scale_},t.prototype.getScaleArray=function(){return this.scaleArray_},t.prototype.getDisplacement=function(){return this.displacement_},t.prototype.getDeclutterMode=function(){return this.declutterMode_},t.prototype.getAnchor=function(){return yt()},t.prototype.getImage=function(e){return yt()},t.prototype.getHitDetectionImage=function(){return yt()},t.prototype.getPixelRatio=function(e){return 1},t.prototype.getImageState=function(){return yt()},t.prototype.getImageSize=function(){return yt()},t.prototype.getOrigin=function(){return yt()},t.prototype.getSize=function(){return yt()},t.prototype.setDisplacement=function(e){this.displacement_=e},t.prototype.setOpacity=function(e){this.opacity_=e},t.prototype.setRotateWithView=function(e){this.rotateWithView_=e},t.prototype.setRotation=function(e){this.rotation_=e},t.prototype.setScale=function(e){this.scale_=e,this.scaleArray_=fa(e)},t.prototype.listenImageChange=function(e){yt()},t.prototype.load=function(){yt()},t.prototype.unlistenImageChange=function(e){yt()},t}(),_Fe=/^#([a-f0-9]{3}|[a-f0-9]{4}(?:[a-f0-9]{2}){0,2})$/i,wFe=/^([a-z]*)$|^hsla?\(.*\)$/i;function _oe(t){return typeof t=="string"?t:woe(t)}function SFe(t){var e=document.createElement("div");if(e.style.color=t,e.style.color!==""){document.body.appendChild(e);var n=getComputedStyle(e).color;return document.body.removeChild(e),n}else return""}var OFe=function(){var t=1024,e={},n=0;return function(r){var i;if(e.hasOwnProperty(r))i=e[r];else{if(n>=t){var o=0;for(var a in e)o++&3||(delete e[a],--n)}i=CFe(r),e[r]=i,++n}return i}}();function VT(t){return Array.isArray(t)?t:OFe(t)}function CFe(t){var e,n,r,i,o;if(wFe.exec(t)&&(t=SFe(t)),_Fe.exec(t)){var a=t.length-1,s=void 0;a<=4?s=1:s=2;var l=a===4||a===8;e=parseInt(t.substr(1+0*s,s),16),n=parseInt(t.substr(1+1*s,s),16),r=parseInt(t.substr(1+2*s,s),16),l?i=parseInt(t.substr(1+3*s,s),16):i=255,s==1&&(e=(e<<4)+e,n=(n<<4)+n,r=(r<<4)+r,l&&(i=(i<<4)+i)),o=[e,n,r,i/255]}else t.indexOf("rgba(")==0?(o=t.slice(5,-1).split(",").map(Number),IG(o)):t.indexOf("rgb(")==0?(o=t.slice(4,-1).split(",").map(Number),o.push(1),IG(o)):Ut(!1,14);return o}function IG(t){return t[0]=Br(t[0]+.5|0,0,255),t[1]=Br(t[1]+.5|0,0,255),t[2]=Br(t[2]+.5|0,0,255),t[3]=Br(t[3],0,1),t}function woe(t){var e=t[0];e!=(e|0)&&(e=e+.5|0);var n=t[1];n!=(n|0)&&(n=n+.5|0);var r=t[2];r!=(r|0)&&(r=r+.5|0);var i=t[3]===void 0?1:Math.round(t[3]*100)/100;return"rgba("+e+","+n+","+r+","+i+")"}function Rl(t){return Array.isArray(t)?woe(t):t}function Ca(t,e,n,r){var i;return n&&n.length?i=n.shift():o2?i=new OffscreenCanvas(t||300,e||300):i=document.createElement("canvas"),t&&(i.width=t),e&&(i.height=e),i.getContext("2d",r)}function Soe(t){var e=t.canvas;e.width=1,e.height=1,t.clearRect(0,0,1,1)}function DG(t,e){var n=e.parentNode;n&&n.replaceChild(t,e)}function l3(t){return t&&t.parentNode?t.parentNode.removeChild(t):null}function TFe(t){for(;t.lastChild;)t.removeChild(t.lastChild)}function EFe(t,e){for(var n=t.childNodes,r=0;;++r){var i=n[r],o=e[r];if(!i&&!o)break;if(i!==o){if(!i){t.appendChild(o);continue}if(!o){t.removeChild(i),--r;continue}t.insertBefore(o,i)}}}var _S="ol-hidden",q1="ol-unselectable",SB="ol-control",LG="ol-collapsed",PFe=new RegExp(["^\\s*(?=(?:(?:[-a-z]+\\s*){0,2}(italic|oblique))?)","(?=(?:(?:[-a-z]+\\s*){0,2}(small-caps))?)","(?=(?:(?:[-a-z]+\\s*){0,2}(bold(?:er)?|lighter|[1-9]00 ))?)","(?:(?:normal|\\1|\\2|\\3)\\s*){0,3}((?:xx?-)?","(?:small|large)|medium|smaller|larger|[\\.\\d]+(?:\\%|in|[cem]m|ex|p[ctx]))","(?:\\s*\\/\\s*(normal|[\\.\\d]+(?:\\%|in|[cem]m|ex|p[ctx])?))",`?\\s*([-,\\"\\'\\sa-z]+?)\\s*$`].join(""),"i"),NG=["style","variant","weight","size","lineHeight","family"],Ooe=function(t){var e=t.match(PFe);if(!e)return null;for(var n={lineHeight:"normal",size:"1.2em",style:"normal",weight:"normal",variant:"normal"},r=0,i=NG.length;r<i;++r){var o=e[r+1];o!==void 0&&(n[NG[r]]=o)}return n.families=n.family.split(/,\s?/),n},Coe="10px sans-serif",Jc="#000",GT="round",Wb=[],Vb=0,iv="round",Gb=10,Hb="#000",qb="center",HT="middle",_h=[0,0,0,0],Xb=1,Tc=new sc,MFe=new oy;MFe.setSize=function(){console.warn("labelCache is deprecated.")};var Fm=null,c3,u3={},kFe=function(){var t=100,e="32px ",n=["monospace","serif"],r=n.length,i="wmytzilWMYTZIL@#/&?$%10",o,a;function s(c,u,f){for(var d=!0,h=0;h<r;++h){var p=n[h];if(a=qT(c+" "+u+" "+e+p,i),f!=p){var m=qT(c+" "+u+" "+e+f+","+p,i);d=d&&m!=a}}return!!d}function l(){for(var c=!0,u=Tc.getKeys(),f=0,d=u.length;f<d;++f){var h=u[f];Tc.get(h)<t&&(s.apply(this,h.split(`
`))?(j1(u3),Fm=null,c3=void 0,Tc.set(h,t)):(Tc.set(h,Tc.get(h)+1,!0),c=!1))}c&&(clearInterval(o),o=void 0)}return function(c){var u=Ooe(c);if(u)for(var f=u.families,d=0,h=f.length;d<h;++d){var p=f[d],m=u.style+`
`+u.weight+`
`+p;Tc.get(m)===void 0&&(Tc.set(m,t,!0),s(u.style,u.weight,p)||(Tc.set(m,0,!0),o===void 0&&(o=setInterval(l,32))))}}}(),AFe=function(){var t;return function(e){var n=u3[e];if(n==null){if(o2){var r=Ooe(e),i=Toe(e,"Žg"),o=isNaN(Number(r.lineHeight))?1.2:Number(r.lineHeight);n=o*(i.actualBoundingBoxAscent+i.actualBoundingBoxDescent)}else t||(t=document.createElement("div"),t.innerHTML="M",t.style.minHeight="0",t.style.maxHeight="none",t.style.height="auto",t.style.padding="0",t.style.border="none",t.style.position="absolute",t.style.display="block",t.style.left="-99999px"),t.style.font=e,document.body.appendChild(t),n=t.offsetHeight,document.body.removeChild(t);u3[e]=n}return n}}();function Toe(t,e){return Fm||(Fm=Ca(1,1)),t!=c3&&(Fm.font=t,c3=Fm.font),Fm.measureText(e)}function qT(t,e){return Toe(t,e).width}function $G(t,e,n){if(e in n)return n[e];var r=e.split(`
`).reduce(function(i,o){return Math.max(i,qT(t,o))},0);return n[e]=r,r}function RFe(t,e){for(var n=[],r=[],i=[],o=0,a=0,s=0,l=0,c=0,u=e.length;c<=u;c+=2){var f=e[c];if(f===`
`||c===u){o=Math.max(o,a),i.push(a),a=0,s+=l;continue}var d=e[c+1]||t.font,h=qT(d,f);n.push(h),a+=h;var p=AFe(d);r.push(p),l=Math.max(l,p)}return{width:o,height:s,widths:n,heights:r,lineWidths:i}}function IFe(t,e,n,r,i,o,a,s,l,c,u){t.save(),n!==1&&(t.globalAlpha*=n),e&&t.setTransform.apply(t,e),r.contextInstructions?(t.translate(l,c),t.scale(u[0],u[1]),DFe(r,t)):u[0]<0||u[1]<0?(t.translate(l,c),t.scale(u[0],u[1]),t.drawImage(r,i,o,a,s,0,0,a,s)):t.drawImage(r,i,o,a,s,l,c,a*u[0],s*u[1]),t.restore()}function DFe(t,e){for(var n=t.contextInstructions,r=0,i=n.length;r<i;r+=2)Array.isArray(n[r+1])?e[n[r]].apply(e,n[r+1]):e[n[r]]=n[r+1]}var LFe=function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,i){r.__proto__=i}||function(r,i){for(var o in i)Object.prototype.hasOwnProperty.call(i,o)&&(r[o]=i[o])},t(e,n)};return function(e,n){if(typeof n!="function"&&n!==null)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");t(e,n);function r(){this.constructor=e}e.prototype=n===null?Object.create(n):(r.prototype=n.prototype,new r)}}(),f3=function(t){LFe(e,t);function e(n){var r=this,i=n.rotateWithView!==void 0?n.rotateWithView:!1;return r=t.call(this,{opacity:1,rotateWithView:i,rotation:n.rotation!==void 0?n.rotation:0,scale:n.scale!==void 0?n.scale:1,displacement:n.displacement!==void 0?n.displacement:[0,0],declutterMode:n.declutterMode})||this,r.canvas_=void 0,r.hitDetectionCanvas_=null,r.fill_=n.fill!==void 0?n.fill:null,r.origin_=[0,0],r.points_=n.points,r.radius_=n.radius!==void 0?n.radius:n.radius1,r.radius2_=n.radius2,r.angle_=n.angle!==void 0?n.angle:0,r.stroke_=n.stroke!==void 0?n.stroke:null,r.size_=null,r.renderOptions_=null,r.render(),r}return e.prototype.clone=function(){var n=this.getScale(),r=new e({fill:this.getFill()?this.getFill().clone():void 0,points:this.getPoints(),radius:this.getRadius(),radius2:this.getRadius2(),angle:this.getAngle(),stroke:this.getStroke()?this.getStroke().clone():void 0,rotation:this.getRotation(),rotateWithView:this.getRotateWithView(),scale:Array.isArray(n)?n.slice():n,displacement:this.getDisplacement().slice(),declutterMode:this.getDeclutterMode()});return r.setOpacity(this.getOpacity()),r},e.prototype.getAnchor=function(){var n=this.size_;if(!n)return null;var r=this.getDisplacement();return[n[0]/2-r[0],n[1]/2+r[1]]},e.prototype.getAngle=function(){return this.angle_},e.prototype.getFill=function(){return this.fill_},e.prototype.setFill=function(n){this.fill_=n,this.render()},e.prototype.getHitDetectionImage=function(){return this.hitDetectionCanvas_||this.createHitDetectionCanvas_(this.renderOptions_),this.hitDetectionCanvas_},e.prototype.getImage=function(n){var r=this.canvas_[n];if(!r){var i=this.renderOptions_,o=Ca(i.size*n,i.size*n);this.draw_(i,o,n),r=o.canvas,this.canvas_[n]=r}return r},e.prototype.getPixelRatio=function(n){return n},e.prototype.getImageSize=function(){return this.size_},e.prototype.getImageState=function(){return Wn.LOADED},e.prototype.getOrigin=function(){return this.origin_},e.prototype.getPoints=function(){return this.points_},e.prototype.getRadius=function(){return this.radius_},e.prototype.getRadius2=function(){return this.radius2_},e.prototype.getSize=function(){return this.size_},e.prototype.getStroke=function(){return this.stroke_},e.prototype.setStroke=function(n){this.stroke_=n,this.render()},e.prototype.listenImageChange=function(n){},e.prototype.load=function(){},e.prototype.unlistenImageChange=function(n){},e.prototype.calculateLineJoinSize_=function(n,r,i){if(r===0||this.points_===1/0||n!=="bevel"&&n!=="miter")return r;var o=this.radius_,a=this.radius2_===void 0?o:this.radius2_;if(o<a){var s=o;o=a,a=s}var l=this.radius2_===void 0?this.points_:this.points_*2,c=2*Math.PI/l,u=a*Math.sin(c),f=Math.sqrt(a*a-u*u),d=o-f,h=Math.sqrt(u*u+d*d),p=h/u;if(n==="miter"&&p<=i)return p*r;var m=r/2/p,g=r/2*(d/h),v=Math.sqrt((o+m)*(o+m)+g*g),y=v-o;if(this.radius2_===void 0||n==="bevel")return y*2;var x=o*Math.sin(c),b=Math.sqrt(o*o-x*x),_=a-b,S=Math.sqrt(x*x+_*_),O=S/x;if(O<=i){var C=O*r/2-a-o;return 2*Math.max(y,C)}return y*2},e.prototype.createRenderOptions=function(){var n=iv,r=0,i=null,o=0,a,s=0;this.stroke_&&(a=this.stroke_.getColor(),a===null&&(a=Hb),a=Rl(a),s=this.stroke_.getWidth(),s===void 0&&(s=Xb),i=this.stroke_.getLineDash(),o=this.stroke_.getLineDashOffset(),n=this.stroke_.getLineJoin(),n===void 0&&(n=iv),r=this.stroke_.getMiterLimit(),r===void 0&&(r=Gb));var l=this.calculateLineJoinSize_(n,s,r),c=Math.max(this.radius_,this.radius2_||0),u=Math.ceil(2*c+l);return{strokeStyle:a,strokeWidth:s,size:u,lineDash:i,lineDashOffset:o,lineJoin:n,miterLimit:r}},e.prototype.render=function(){this.renderOptions_=this.createRenderOptions();var n=this.renderOptions_.size;this.canvas_={},this.size_=[n,n]},e.prototype.draw_=function(n,r,i){if(r.scale(i,i),r.translate(n.size/2,n.size/2),this.createPath_(r),this.fill_){var o=this.fill_.getColor();o===null&&(o=Jc),r.fillStyle=Rl(o),r.fill()}this.stroke_&&(r.strokeStyle=n.strokeStyle,r.lineWidth=n.strokeWidth,r.setLineDash&&n.lineDash&&(r.setLineDash(n.lineDash),r.lineDashOffset=n.lineDashOffset),r.lineJoin=n.lineJoin,r.miterLimit=n.miterLimit,r.stroke())},e.prototype.createHitDetectionCanvas_=function(n){if(this.fill_){var r=this.fill_.getColor(),i=0;if(typeof r=="string"&&(r=VT(r)),r===null?i=1:Array.isArray(r)&&(i=r.length===4?r[3]:1),i===0){var o=Ca(n.size,n.size);this.hitDetectionCanvas_=o.canvas,this.drawHitDetectionCanvas_(n,o)}}this.hitDetectionCanvas_||(this.hitDetectionCanvas_=this.getImage(1))},e.prototype.createPath_=function(n){var r=this.points_,i=this.radius_;if(r===1/0)n.arc(0,0,i,0,2*Math.PI);else{var o=this.radius2_===void 0?i:this.radius2_;this.radius2_!==void 0&&(r*=2);for(var a=this.angle_-Math.PI/2,s=2*Math.PI/r,l=0;l<r;l++){var c=a+l*s,u=l%2===0?i:o;n.lineTo(u*Math.cos(c),u*Math.sin(c))}n.closePath()}},e.prototype.drawHitDetectionCanvas_=function(n,r){r.translate(n.size/2,n.size/2),this.createPath_(r),r.fillStyle=Jc,r.fill(),this.stroke_&&(r.strokeStyle=n.strokeStyle,r.lineWidth=n.strokeWidth,n.lineDash&&(r.setLineDash(n.lineDash),r.lineDashOffset=n.lineDashOffset),r.lineJoin=n.lineJoin,r.miterLimit=n.miterLimit,r.stroke())},e}(boe),NFe=function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,i){r.__proto__=i}||function(r,i){for(var o in i)Object.prototype.hasOwnProperty.call(i,o)&&(r[o]=i[o])},t(e,n)};return function(e,n){if(typeof n!="function"&&n!==null)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");t(e,n);function r(){this.constructor=e}e.prototype=n===null?Object.create(n):(r.prototype=n.prototype,new r)}}(),X1=function(t){NFe(e,t);function e(n){var r=n||{};return t.call(this,{points:1/0,fill:r.fill,radius:r.radius,stroke:r.stroke,scale:r.scale!==void 0?r.scale:1,rotation:r.rotation!==void 0?r.rotation:0,rotateWithView:r.rotateWithView!==void 0?r.rotateWithView:!1,displacement:r.displacement!==void 0?r.displacement:[0,0],declutterMode:r.declutterMode})||this}return e.prototype.clone=function(){var n=this.getScale(),r=new e({fill:this.getFill()?this.getFill().clone():void 0,stroke:this.getStroke()?this.getStroke().clone():void 0,radius:this.getRadius(),scale:Array.isArray(n)?n.slice():n,rotation:this.getRotation(),rotateWithView:this.getRotateWithView(),displacement:this.getDisplacement().slice(),declutterMode:this.getDeclutterMode()});return r.setOpacity(this.getOpacity()),r},e.prototype.setRadius=function(n){this.radius_=n,this.render()},e}(f3),Il=function(){function t(e){var n=e||{};this.geometry_=null,this.geometryFunction_=FG,n.geometry!==void 0&&this.setGeometry(n.geometry),this.fill_=n.fill!==void 0?n.fill:null,this.image_=n.image!==void 0?n.image:null,this.renderer_=n.renderer!==void 0?n.renderer:null,this.hitDetectionRenderer_=n.hitDetectionRenderer!==void 0?n.hitDetectionRenderer:null,this.stroke_=n.stroke!==void 0?n.stroke:null,this.text_=n.text!==void 0?n.text:null,this.zIndex_=n.zIndex}return t.prototype.clone=function(){var e=this.getGeometry();return e&&typeof e=="object"&&(e=e.clone()),new t({geometry:e,fill:this.getFill()?this.getFill().clone():void 0,image:this.getImage()?this.getImage().clone():void 0,renderer:this.getRenderer(),stroke:this.getStroke()?this.getStroke().clone():void 0,text:this.getText()?this.getText().clone():void 0,zIndex:this.getZIndex()})},t.prototype.getRenderer=function(){return this.renderer_},t.prototype.setRenderer=function(e){this.renderer_=e},t.prototype.setHitDetectionRenderer=function(e){this.hitDetectionRenderer_=e},t.prototype.getHitDetectionRenderer=function(){return this.hitDetectionRenderer_},t.prototype.getGeometry=function(){return this.geometry_},t.prototype.getGeometryFunction=function(){return this.geometryFunction_},t.prototype.getFill=function(){return this.fill_},t.prototype.setFill=function(e){this.fill_=e},t.prototype.getImage=function(){return this.image_},t.prototype.setImage=function(e){this.image_=e},t.prototype.getStroke=function(){return this.stroke_},t.prototype.setStroke=function(e){this.stroke_=e},t.prototype.getText=function(){return this.text_},t.prototype.setText=function(e){this.text_=e},t.prototype.getZIndex=function(){return this.zIndex_},t.prototype.setGeometry=function(e){typeof e=="function"?this.geometryFunction_=e:typeof e=="string"?this.geometryFunction_=function(n){return n.get(e)}:e?e!==void 0&&(this.geometryFunction_=function(){return e}):this.geometryFunction_=FG,this.geometry_=e},t.prototype.setZIndex=function(e){this.zIndex_=e},t}();function $Fe(t){var e;if(typeof t=="function")e=t;else{var n;if(Array.isArray(t))n=t;else{Ut(typeof t.getZIndex=="function",41);var r=t;n=[r]}e=function(){return n}}return e}var $A=null;function FFe(t,e){if(!$A){var n=new op({color:"rgba(255,255,255,0.4)"}),r=new Xl({color:"#3399CC",width:1.25});$A=[new Il({image:new X1({fill:n,stroke:r,radius:5}),fill:n,stroke:r})]}return $A}function jFe(){var t={},e=[255,255,255,1],n=[0,153,255,1],r=3;return t.Polygon=[new Il({fill:new op({color:[255,255,255,.5]})})],t.MultiPolygon=t.Polygon,t.LineString=[new Il({stroke:new Xl({color:e,width:r+2})}),new Il({stroke:new Xl({color:n,width:r})})],t.MultiLineString=t.LineString,t.Circle=t.Polygon.concat(t.LineString),t.Point=[new Il({image:new X1({radius:r*2,fill:new op({color:n}),stroke:new Xl({color:e,width:r/2})}),zIndex:1/0})],t.MultiPoint=t.Point,t.GeometryCollection=t.Polygon.concat(t.LineString,t.Point),t}function FG(t){return t.getGeometry()}const BFe={POINT:"point",LINE:"line"},Tn={OPACITY:"opacity",VISIBLE:"visible",EXTENT:"extent",Z_INDEX:"zIndex",MAX_RESOLUTION:"maxResolution",MIN_RESOLUTION:"minResolution",MAX_ZOOM:"maxZoom",MIN_ZOOM:"minZoom",SOURCE:"source",MAP:"map"};var zFe=function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,i){r.__proto__=i}||function(r,i){for(var o in i)Object.prototype.hasOwnProperty.call(i,o)&&(r[o]=i[o])},t(e,n)};return function(e,n){if(typeof n!="function"&&n!==null)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");t(e,n);function r(){this.constructor=e}e.prototype=n===null?Object.create(n):(r.prototype=n.prototype,new r)}}(),Eoe=function(t){zFe(e,t);function e(n){var r=t.call(this)||this;r.on,r.once,r.un,r.background_=n.background;var i=ur({},n);return typeof n.properties=="object"&&(delete i.properties,ur(i,n.properties)),i[Tn.OPACITY]=n.opacity!==void 0?n.opacity:1,Ut(typeof i[Tn.OPACITY]=="number",64),i[Tn.VISIBLE]=n.visible!==void 0?n.visible:!0,i[Tn.Z_INDEX]=n.zIndex,i[Tn.MAX_RESOLUTION]=n.maxResolution!==void 0?n.maxResolution:1/0,i[Tn.MIN_RESOLUTION]=n.minResolution!==void 0?n.minResolution:0,i[Tn.MIN_ZOOM]=n.minZoom!==void 0?n.minZoom:-1/0,i[Tn.MAX_ZOOM]=n.maxZoom!==void 0?n.maxZoom:1/0,r.className_=i.className!==void 0?i.className:"ol-layer",delete i.className,r.setProperties(i),r.state_=null,r}return e.prototype.getBackground=function(){return this.background_},e.prototype.getClassName=function(){return this.className_},e.prototype.getLayerState=function(n){var r=this.state_||{layer:this,managed:n===void 0?!0:n},i=this.getZIndex();return r.opacity=Br(Math.round(this.getOpacity()*100)/100,0,1),r.visible=this.getVisible(),r.extent=this.getExtent(),r.zIndex=i===void 0&&!r.managed?1/0:i,r.maxResolution=this.getMaxResolution(),r.minResolution=Math.max(this.getMinResolution(),0),r.minZoom=this.getMinZoom(),r.maxZoom=this.getMaxZoom(),this.state_=r,r},e.prototype.getLayersArray=function(n){return yt()},e.prototype.getLayerStatesArray=function(n){return yt()},e.prototype.getExtent=function(){return this.get(Tn.EXTENT)},e.prototype.getMaxResolution=function(){return this.get(Tn.MAX_RESOLUTION)},e.prototype.getMinResolution=function(){return this.get(Tn.MIN_RESOLUTION)},e.prototype.getMinZoom=function(){return this.get(Tn.MIN_ZOOM)},e.prototype.getMaxZoom=function(){return this.get(Tn.MAX_ZOOM)},e.prototype.getOpacity=function(){return this.get(Tn.OPACITY)},e.prototype.getSourceState=function(){return yt()},e.prototype.getVisible=function(){return this.get(Tn.VISIBLE)},e.prototype.getZIndex=function(){return this.get(Tn.Z_INDEX)},e.prototype.setBackground=function(n){this.background_=n,this.changed()},e.prototype.setExtent=function(n){this.set(Tn.EXTENT,n)},e.prototype.setMaxResolution=function(n){this.set(Tn.MAX_RESOLUTION,n)},e.prototype.setMinResolution=function(n){this.set(Tn.MIN_RESOLUTION,n)},e.prototype.setMaxZoom=function(n){this.set(Tn.MAX_ZOOM,n)},e.prototype.setMinZoom=function(n){this.set(Tn.MIN_ZOOM,n)},e.prototype.setOpacity=function(n){Ut(typeof n=="number",64),this.set(Tn.OPACITY,n)},e.prototype.setVisible=function(n){this.set(Tn.VISIBLE,n)},e.prototype.setZIndex=function(n){this.set(Tn.Z_INDEX,n)},e.prototype.disposeInternal=function(){this.state_&&(this.state_.layer=null,this.state_=null),t.prototype.disposeInternal.call(this)},e}(sc),UFe=function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,i){r.__proto__=i}||function(r,i){for(var o in i)Object.prototype.hasOwnProperty.call(i,o)&&(r[o]=i[o])},t(e,n)};return function(e,n){if(typeof n!="function"&&n!==null)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");t(e,n);function r(){this.constructor=e}e.prototype=n===null?Object.create(n):(r.prototype=n.prototype,new r)}}(),d2=function(t){UFe(e,t);function e(n){var r=this,i=ur({},n);delete i.source,r=t.call(this,i)||this,r.on,r.once,r.un,r.mapPrecomposeKey_=null,r.mapRenderKey_=null,r.sourceChangeKey_=null,r.renderer_=null,r.rendered=!1,n.render&&(r.render=n.render),n.map&&r.setMap(n.map),r.addChangeListener(Tn.SOURCE,r.handleSourcePropertyChange_);var o=n.source?n.source:null;return r.setSource(o),r}return e.prototype.getLayersArray=function(n){var r=n||[];return r.push(this),r},e.prototype.getLayerStatesArray=function(n){var r=n||[];return r.push(this.getLayerState()),r},e.prototype.getSource=function(){return this.get(Tn.SOURCE)||null},e.prototype.getRenderSource=function(){return this.getSource()},e.prototype.getSourceState=function(){var n=this.getSource();return n?n.getState():"undefined"},e.prototype.handleSourceChange_=function(){this.changed()},e.prototype.handleSourcePropertyChange_=function(){this.sourceChangeKey_&&(nr(this.sourceChangeKey_),this.sourceChangeKey_=null);var n=this.getSource();n&&(this.sourceChangeKey_=rn(n,Mt.CHANGE,this.handleSourceChange_,this)),this.changed()},e.prototype.getFeatures=function(n){return this.renderer_?this.renderer_.getFeatures(n):new Promise(function(r){return r([])})},e.prototype.getData=function(n){return!this.renderer_||!this.rendered?null:this.renderer_.getData(n)},e.prototype.render=function(n,r){var i=this.getRenderer();if(i.prepareFrame(n))return this.rendered=!0,i.renderFrame(n,r)},e.prototype.unrender=function(){this.rendered=!1},e.prototype.setMapInternal=function(n){n||this.unrender(),this.set(Tn.MAP,n)},e.prototype.getMapInternal=function(){return this.get(Tn.MAP)},e.prototype.setMap=function(n){this.mapPrecomposeKey_&&(nr(this.mapPrecomposeKey_),this.mapPrecomposeKey_=null),n||this.changed(),this.mapRenderKey_&&(nr(this.mapRenderKey_),this.mapRenderKey_=null),n&&(this.mapPrecomposeKey_=rn(n,Bf.PRECOMPOSE,function(r){var i=r,o=i.frameState.layerStatesArray,a=this.getLayerState(!1);Ut(!o.some(function(s){return s.layer===a.layer}),67),o.push(a)},this),this.mapRenderKey_=rn(this,Mt.CHANGE,n.render,n),this.changed())},e.prototype.setSource=function(n){this.set(Tn.SOURCE,n)},e.prototype.getRenderer=function(){return this.renderer_||(this.renderer_=this.createRenderer()),this.renderer_},e.prototype.hasRenderer=function(){return!!this.renderer_},e.prototype.createRenderer=function(){return null},e.prototype.disposeInternal=function(){this.renderer_&&(this.renderer_.dispose(),delete this.renderer_),this.setSource(null),t.prototype.disposeInternal.call(this)},e}(Eoe);function XT(t,e){if(!t.visible)return!1;var n=e.resolution;if(n<t.minResolution||n>=t.maxResolution)return!1;var r=e.zoom;return r>t.minZoom&&r<=t.maxZoom}function WFe(t,e,n,r,i){Poe(t,e,n||0,r||t.length-1,i||VFe)}function Poe(t,e,n,r,i){for(;r>n;){if(r-n>600){var o=r-n+1,a=e-n+1,s=Math.log(o),l=.5*Math.exp(2*s/3),c=.5*Math.sqrt(s*l*(o-l)/o)*(a-o/2<0?-1:1),u=Math.max(n,Math.floor(e-a*l/o+c)),f=Math.min(r,Math.floor(e+(o-a)*l/o+c));Poe(t,e,u,f,i)}var d=t[e],h=n,p=r;for(b0(t,n,e),i(t[r],d)>0&&b0(t,n,r);h<p;){for(b0(t,h,p),h++,p--;i(t[h],d)<0;)h++;for(;i(t[p],d)>0;)p--}i(t[n],d)===0?b0(t,n,p):(p++,b0(t,p,r)),p<=e&&(n=p+1),e<=p&&(r=p-1)}}function b0(t,e,n){var r=t[e];t[e]=t[n],t[n]=r}function VFe(t,e){return t<e?-1:t>e?1:0}let Moe=class{constructor(e=9){this._maxEntries=Math.max(4,e),this._minEntries=Math.max(2,Math.ceil(this._maxEntries*.4)),this.clear()}all(){return this._all(this.data,[])}search(e){let n=this.data;const r=[];if(!SS(e,n))return r;const i=this.toBBox,o=[];for(;n;){for(let a=0;a<n.children.length;a++){const s=n.children[a],l=n.leaf?i(s):s;SS(e,l)&&(n.leaf?r.push(s):jA(e,l)?this._all(s,r):o.push(s))}n=o.pop()}return r}collides(e){let n=this.data;if(!SS(e,n))return!1;const r=[];for(;n;){for(let i=0;i<n.children.length;i++){const o=n.children[i],a=n.leaf?this.toBBox(o):o;if(SS(e,a)){if(n.leaf||jA(e,a))return!0;r.push(o)}}n=r.pop()}return!1}load(e){if(!(e&&e.length))return this;if(e.length<this._minEntries){for(let r=0;r<e.length;r++)this.insert(e[r]);return this}let n=this._build(e.slice(),0,e.length-1,0);if(!this.data.children.length)this.data=n;else if(this.data.height===n.height)this._splitRoot(this.data,n);else{if(this.data.height<n.height){const r=this.data;this.data=n,n=r}this._insert(n,this.data.height-n.height-1,!0)}return this}insert(e){return e&&this._insert(e,this.data.height-1),this}clear(){return this.data=jm([]),this}remove(e,n){if(!e)return this;let r=this.data;const i=this.toBBox(e),o=[],a=[];let s,l,c;for(;r||o.length;){if(r||(r=o.pop(),l=o[o.length-1],s=a.pop(),c=!0),r.leaf){const u=GFe(e,r.children,n);if(u!==-1)return r.children.splice(u,1),o.push(r),this._condense(o),this}!c&&!r.leaf&&jA(r,i)?(o.push(r),a.push(s),s=0,l=r,r=r.children[0]):l?(s++,r=l.children[s],c=!1):r=null}return this}toBBox(e){return e}compareMinX(e,n){return e.minX-n.minX}compareMinY(e,n){return e.minY-n.minY}toJSON(){return this.data}fromJSON(e){return this.data=e,this}_all(e,n){const r=[];for(;e;)e.leaf?n.push(...e.children):r.push(...e.children),e=r.pop();return n}_build(e,n,r,i){const o=r-n+1;let a=this._maxEntries,s;if(o<=a)return s=jm(e.slice(n,r+1)),tm(s,this.toBBox),s;i||(i=Math.ceil(Math.log(o)/Math.log(a)),a=Math.ceil(o/Math.pow(a,i-1))),s=jm([]),s.leaf=!1,s.height=i;const l=Math.ceil(o/a),c=l*Math.ceil(Math.sqrt(a));jG(e,n,r,c,this.compareMinX);for(let u=n;u<=r;u+=c){const f=Math.min(u+c-1,r);jG(e,u,f,l,this.compareMinY);for(let d=u;d<=f;d+=l){const h=Math.min(d+l-1,f);s.children.push(this._build(e,d,h,i-1))}}return tm(s,this.toBBox),s}_chooseSubtree(e,n,r,i){for(;i.push(n),!(n.leaf||i.length-1===r);){let o=1/0,a=1/0,s;for(let l=0;l<n.children.length;l++){const c=n.children[l],u=FA(c),f=XFe(e,c)-u;f<a?(a=f,o=u<o?u:o,s=c):f===a&&u<o&&(o=u,s=c)}n=s||n.children[0]}return n}_insert(e,n,r){const i=r?e:this.toBBox(e),o=[],a=this._chooseSubtree(i,this.data,n,o);for(a.children.push(e),fx(a,i);n>=0&&o[n].children.length>this._maxEntries;)this._split(o,n),n--;this._adjustParentBBoxes(i,o,n)}_split(e,n){const r=e[n],i=r.children.length,o=this._minEntries;this._chooseSplitAxis(r,o,i);const a=this._chooseSplitIndex(r,o,i),s=jm(r.children.splice(a,r.children.length-a));s.height=r.height,s.leaf=r.leaf,tm(r,this.toBBox),tm(s,this.toBBox),n?e[n-1].children.push(s):this._splitRoot(r,s)}_splitRoot(e,n){this.data=jm([e,n]),this.data.height=e.height+1,this.data.leaf=!1,tm(this.data,this.toBBox)}_chooseSplitIndex(e,n,r){let i,o=1/0,a=1/0;for(let s=n;s<=r-n;s++){const l=ux(e,0,s,this.toBBox),c=ux(e,s,r,this.toBBox),u=QFe(l,c),f=FA(l)+FA(c);u<o?(o=u,i=s,a=f<a?f:a):u===o&&f<a&&(a=f,i=s)}return i||r-n}_chooseSplitAxis(e,n,r){const i=e.leaf?this.compareMinX:HFe,o=e.leaf?this.compareMinY:qFe,a=this._allDistMargin(e,n,r,i),s=this._allDistMargin(e,n,r,o);a<s&&e.children.sort(i)}_allDistMargin(e,n,r,i){e.children.sort(i);const o=this.toBBox,a=ux(e,0,n,o),s=ux(e,r-n,r,o);let l=wS(a)+wS(s);for(let c=n;c<r-n;c++){const u=e.children[c];fx(a,e.leaf?o(u):u),l+=wS(a)}for(let c=r-n-1;c>=n;c--){const u=e.children[c];fx(s,e.leaf?o(u):u),l+=wS(s)}return l}_adjustParentBBoxes(e,n,r){for(let i=r;i>=0;i--)fx(n[i],e)}_condense(e){for(let n=e.length-1,r;n>=0;n--)e[n].children.length===0?n>0?(r=e[n-1].children,r.splice(r.indexOf(e[n]),1)):this.clear():tm(e[n],this.toBBox)}};function GFe(t,e,n){if(!n)return e.indexOf(t);for(let r=0;r<e.length;r++)if(n(t,e[r]))return r;return-1}function tm(t,e){ux(t,0,t.children.length,e,t)}function ux(t,e,n,r,i){i||(i=jm(null)),i.minX=1/0,i.minY=1/0,i.maxX=-1/0,i.maxY=-1/0;for(let o=e;o<n;o++){const a=t.children[o];fx(i,t.leaf?r(a):a)}return i}function fx(t,e){return t.minX=Math.min(t.minX,e.minX),t.minY=Math.min(t.minY,e.minY),t.maxX=Math.max(t.maxX,e.maxX),t.maxY=Math.max(t.maxY,e.maxY),t}function HFe(t,e){return t.minX-e.minX}function qFe(t,e){return t.minY-e.minY}function FA(t){return(t.maxX-t.minX)*(t.maxY-t.minY)}function wS(t){return t.maxX-t.minX+(t.maxY-t.minY)}function XFe(t,e){return(Math.max(e.maxX,t.maxX)-Math.min(e.minX,t.minX))*(Math.max(e.maxY,t.maxY)-Math.min(e.minY,t.minY))}function QFe(t,e){const n=Math.max(t.minX,e.minX),r=Math.max(t.minY,e.minY),i=Math.min(t.maxX,e.maxX),o=Math.min(t.maxY,e.maxY);return Math.max(0,i-n)*Math.max(0,o-r)}function jA(t,e){return t.minX<=e.minX&&t.minY<=e.minY&&e.maxX<=t.maxX&&e.maxY<=t.maxY}function SS(t,e){return e.minX<=t.maxX&&e.minY<=t.maxY&&e.maxX>=t.minX&&e.maxY>=t.minY}function jm(t){return{children:t,height:1,leaf:!0,minX:1/0,minY:1/0,maxX:-1/0,maxY:-1/0}}function jG(t,e,n,r,i){const o=[e,n];for(;o.length;){if(n=o.pop(),e=o.pop(),n-e<=r)continue;const a=e+Math.ceil((n-e)/r/2)*r;WFe(t,a,e,n,i),o.push(e,a,a,n)}}var YFe=function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,i){r.__proto__=i}||function(r,i){for(var o in i)Object.prototype.hasOwnProperty.call(i,o)&&(r[o]=i[o])},t(e,n)};return function(e,n){if(typeof n!="function"&&n!==null)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");t(e,n);function r(){this.constructor=e}e.prototype=n===null?Object.create(n):(r.prototype=n.prototype,new r)}}(),BG={RENDER_ORDER:"renderOrder"},KFe=function(t){YFe(e,t);function e(n){var r=this,i=n||{},o=ur({},i);return delete o.style,delete o.renderBuffer,delete o.updateWhileAnimating,delete o.updateWhileInteracting,r=t.call(this,o)||this,r.declutter_=i.declutter!==void 0?i.declutter:!1,r.renderBuffer_=i.renderBuffer!==void 0?i.renderBuffer:100,r.style_=null,r.styleFunction_=void 0,r.setStyle(i.style),r.updateWhileAnimating_=i.updateWhileAnimating!==void 0?i.updateWhileAnimating:!1,r.updateWhileInteracting_=i.updateWhileInteracting!==void 0?i.updateWhileInteracting:!1,r}return e.prototype.getDeclutter=function(){return this.declutter_},e.prototype.getFeatures=function(n){return t.prototype.getFeatures.call(this,n)},e.prototype.getRenderBuffer=function(){return this.renderBuffer_},e.prototype.getRenderOrder=function(){return this.get(BG.RENDER_ORDER)},e.prototype.getStyle=function(){return this.style_},e.prototype.getStyleFunction=function(){return this.styleFunction_},e.prototype.getUpdateWhileAnimating=function(){return this.updateWhileAnimating_},e.prototype.getUpdateWhileInteracting=function(){return this.updateWhileInteracting_},e.prototype.renderDeclutter=function(n){n.declutterTree||(n.declutterTree=new Moe(9)),this.getRenderer().renderDeclutter(n)},e.prototype.setRenderOrder=function(n){this.set(BG.RENDER_ORDER,n)},e.prototype.setStyle=function(n){this.style_=n!==void 0?n:FFe,this.styleFunction_=n===null?void 0:$Fe(this.style_),this.changed()},e}(d2),bt={BEGIN_GEOMETRY:0,BEGIN_PATH:1,CIRCLE:2,CLOSE_PATH:3,CUSTOM:4,DRAW_CHARS:5,DRAW_IMAGE:6,END_GEOMETRY:7,FILL:8,MOVE_TO_LINE_TO:9,SET_FILL_STYLE:10,SET_STROKE_STYLE:11,STROKE:12},OS=[bt.FILL],Sf=[bt.STROKE],wh=[bt.BEGIN_PATH],zG=[bt.CLOSE_PATH],koe=function(){function t(){}return t.prototype.drawCustom=function(e,n,r,i){},t.prototype.drawGeometry=function(e){},t.prototype.setStyle=function(e){},t.prototype.drawCircle=function(e,n){},t.prototype.drawFeature=function(e,n){},t.prototype.drawGeometryCollection=function(e,n){},t.prototype.drawLineString=function(e,n){},t.prototype.drawMultiLineString=function(e,n){},t.prototype.drawMultiPoint=function(e,n){},t.prototype.drawMultiPolygon=function(e,n){},t.prototype.drawPoint=function(e,n){},t.prototype.drawPolygon=function(e,n){},t.prototype.drawText=function(e,n){},t.prototype.setFillStrokeStyle=function(e,n){},t.prototype.setImageStyle=function(e,n){},t.prototype.setTextStyle=function(e,n){},t}(),ZFe=function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,i){r.__proto__=i}||function(r,i){for(var o in i)Object.prototype.hasOwnProperty.call(i,o)&&(r[o]=i[o])},t(e,n)};return function(e,n){if(typeof n!="function"&&n!==null)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");t(e,n);function r(){this.constructor=e}e.prototype=n===null?Object.create(n):(r.prototype=n.prototype,new r)}}(),Q1=function(t){ZFe(e,t);function e(n,r,i,o){var a=t.call(this)||this;return a.tolerance=n,a.maxExtent=r,a.pixelRatio=o,a.maxLineWidth=0,a.resolution=i,a.beginGeometryInstruction1_=null,a.beginGeometryInstruction2_=null,a.bufferedMaxExtent_=null,a.instructions=[],a.coordinates=[],a.tmpCoordinate_=[],a.hitDetectionInstructions=[],a.state={},a}return e.prototype.applyPixelRatio=function(n){var r=this.pixelRatio;return r==1?n:n.map(function(i){return i*r})},e.prototype.appendFlatPointCoordinates=function(n,r){for(var i=this.getBufferedMaxExtent(),o=this.tmpCoordinate_,a=this.coordinates,s=a.length,l=0,c=n.length;l<c;l+=r)o[0]=n[l],o[1]=n[l+1],z1(i,o)&&(a[s++]=o[0],a[s++]=o[1]);return s},e.prototype.appendFlatLineCoordinates=function(n,r,i,o,a,s){var l=this.coordinates,c=l.length,u=this.getBufferedMaxExtent();s&&(r+=o);var f=n[r],d=n[r+1],h=this.tmpCoordinate_,p=!0,m,g,v;for(m=r+o;m<i;m+=o)h[0]=n[m],h[1]=n[m+1],v=XL(u,h),v!==g?(p&&(l[c++]=f,l[c++]=d,p=!1),l[c++]=h[0],l[c++]=h[1]):v===si.INTERSECTING?(l[c++]=h[0],l[c++]=h[1],p=!1):p=!0,f=h[0],d=h[1],g=v;return(a&&p||m===r+o)&&(l[c++]=f,l[c++]=d),c},e.prototype.drawCustomCoordinates_=function(n,r,i,o,a){for(var s=0,l=i.length;s<l;++s){var c=i[s],u=this.appendFlatLineCoordinates(n,r,c,o,!1,!1);a.push(u),r=c}return r},e.prototype.drawCustom=function(n,r,i,o){this.beginGeometry(n,r);var a=n.getType(),s=n.getStride(),l=this.coordinates.length,c,u,f,d,h;switch(a){case"MultiPolygon":c=n.getOrientedFlatCoordinates(),d=[];var p=n.getEndss();h=0;for(var m=0,g=p.length;m<g;++m){var v=[];h=this.drawCustomCoordinates_(c,h,p[m],s,v),d.push(v)}this.instructions.push([bt.CUSTOM,l,d,n,i,t3]),this.hitDetectionInstructions.push([bt.CUSTOM,l,d,n,o||i,t3]);break;case"Polygon":case"MultiLineString":f=[],c=a=="Polygon"?n.getOrientedFlatCoordinates():n.getFlatCoordinates(),h=this.drawCustomCoordinates_(c,0,n.getEnds(),s,f),this.instructions.push([bt.CUSTOM,l,f,n,i,zb]),this.hitDetectionInstructions.push([bt.CUSTOM,l,f,n,o||i,zb]);break;case"LineString":case"Circle":c=n.getFlatCoordinates(),u=this.appendFlatLineCoordinates(c,0,c.length,s,!1,!1),this.instructions.push([bt.CUSTOM,l,u,n,i,wf]),this.hitDetectionInstructions.push([bt.CUSTOM,l,u,n,o||i,wf]);break;case"MultiPoint":c=n.getFlatCoordinates(),u=this.appendFlatPointCoordinates(c,s),u>l&&(this.instructions.push([bt.CUSTOM,l,u,n,i,wf]),this.hitDetectionInstructions.push([bt.CUSTOM,l,u,n,o||i,wf]));break;case"Point":c=n.getFlatCoordinates(),this.coordinates.push(c[0],c[1]),u=this.coordinates.length,this.instructions.push([bt.CUSTOM,l,u,n,i]),this.hitDetectionInstructions.push([bt.CUSTOM,l,u,n,o||i]);break}this.endGeometry(r)},e.prototype.beginGeometry=function(n,r){this.beginGeometryInstruction1_=[bt.BEGIN_GEOMETRY,r,0,n],this.instructions.push(this.beginGeometryInstruction1_),this.beginGeometryInstruction2_=[bt.BEGIN_GEOMETRY,r,0,n],this.hitDetectionInstructions.push(this.beginGeometryInstruction2_)},e.prototype.finish=function(){return{instructions:this.instructions,hitDetectionInstructions:this.hitDetectionInstructions,coordinates:this.coordinates}},e.prototype.reverseHitDetectionInstructions=function(){var n=this.hitDetectionInstructions;n.reverse();var r,i=n.length,o,a,s=-1;for(r=0;r<i;++r)o=n[r],a=o[0],a==bt.END_GEOMETRY?s=r:a==bt.BEGIN_GEOMETRY&&(o[2]=r,P3e(this.hitDetectionInstructions,s,r),s=-1)},e.prototype.setFillStrokeStyle=function(n,r){var i=this.state;if(n){var o=n.getColor();i.fillStyle=Rl(o||Jc)}else i.fillStyle=void 0;if(r){var a=r.getColor();i.strokeStyle=Rl(a||Hb);var s=r.getLineCap();i.lineCap=s!==void 0?s:GT;var l=r.getLineDash();i.lineDash=l?l.slice():Wb;var c=r.getLineDashOffset();i.lineDashOffset=c||Vb;var u=r.getLineJoin();i.lineJoin=u!==void 0?u:iv;var f=r.getWidth();i.lineWidth=f!==void 0?f:Xb;var d=r.getMiterLimit();i.miterLimit=d!==void 0?d:Gb,i.lineWidth>this.maxLineWidth&&(this.maxLineWidth=i.lineWidth,this.bufferedMaxExtent_=null)}else i.strokeStyle=void 0,i.lineCap=void 0,i.lineDash=null,i.lineDashOffset=void 0,i.lineJoin=void 0,i.lineWidth=void 0,i.miterLimit=void 0},e.prototype.createFill=function(n){var r=n.fillStyle,i=[bt.SET_FILL_STYLE,r];return typeof r!="string"&&i.push(!0),i},e.prototype.applyStroke=function(n){this.instructions.push(this.createStroke(n))},e.prototype.createStroke=function(n){return[bt.SET_STROKE_STYLE,n.strokeStyle,n.lineWidth*this.pixelRatio,n.lineCap,n.lineJoin,n.miterLimit,this.applyPixelRatio(n.lineDash),n.lineDashOffset*this.pixelRatio]},e.prototype.updateFillStyle=function(n,r){var i=n.fillStyle;(typeof i!="string"||n.currentFillStyle!=i)&&(i!==void 0&&this.instructions.push(r.call(this,n)),n.currentFillStyle=i)},e.prototype.updateStrokeStyle=function(n,r){var i=n.strokeStyle,o=n.lineCap,a=n.lineDash,s=n.lineDashOffset,l=n.lineJoin,c=n.lineWidth,u=n.miterLimit;(n.currentStrokeStyle!=i||n.currentLineCap!=o||a!=n.currentLineDash&&!kp(n.currentLineDash,a)||n.currentLineDashOffset!=s||n.currentLineJoin!=l||n.currentLineWidth!=c||n.currentMiterLimit!=u)&&(i!==void 0&&r.call(this,n),n.currentStrokeStyle=i,n.currentLineCap=o,n.currentLineDash=a,n.currentLineDashOffset=s,n.currentLineJoin=l,n.currentLineWidth=c,n.currentMiterLimit=u)},e.prototype.endGeometry=function(n){this.beginGeometryInstruction1_[2]=this.instructions.length,this.beginGeometryInstruction1_=null,this.beginGeometryInstruction2_[2]=this.hitDetectionInstructions.length,this.beginGeometryInstruction2_=null;var r=[bt.END_GEOMETRY,n];this.instructions.push(r),this.hitDetectionInstructions.push(r)},e.prototype.getBufferedMaxExtent=function(){if(!this.bufferedMaxExtent_&&(this.bufferedMaxExtent_=Rie(this.maxExtent),this.maxLineWidth>0)){var n=this.resolution*(this.maxLineWidth+1)/2;Fb(this.bufferedMaxExtent_,n,this.bufferedMaxExtent_)}return this.bufferedMaxExtent_},e}(koe),JFe=function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,i){r.__proto__=i}||function(r,i){for(var o in i)Object.prototype.hasOwnProperty.call(i,o)&&(r[o]=i[o])},t(e,n)};return function(e,n){if(typeof n!="function"&&n!==null)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");t(e,n);function r(){this.constructor=e}e.prototype=n===null?Object.create(n):(r.prototype=n.prototype,new r)}}(),eje=function(t){JFe(e,t);function e(n,r,i,o){var a=t.call(this,n,r,i,o)||this;return a.hitDetectionImage_=null,a.image_=null,a.imagePixelRatio_=void 0,a.anchorX_=void 0,a.anchorY_=void 0,a.height_=void 0,a.opacity_=void 0,a.originX_=void 0,a.originY_=void 0,a.rotateWithView_=void 0,a.rotation_=void 0,a.scale_=void 0,a.width_=void 0,a.declutterMode_=void 0,a.declutterImageWithText_=void 0,a}return e.prototype.drawPoint=function(n,r){if(this.image_){this.beginGeometry(n,r);var i=n.getFlatCoordinates(),o=n.getStride(),a=this.coordinates.length,s=this.appendFlatPointCoordinates(i,o);this.instructions.push([bt.DRAW_IMAGE,a,s,this.image_,this.anchorX_*this.imagePixelRatio_,this.anchorY_*this.imagePixelRatio_,Math.ceil(this.height_*this.imagePixelRatio_),this.opacity_,this.originX_*this.imagePixelRatio_,this.originY_*this.imagePixelRatio_,this.rotateWithView_,this.rotation_,[this.scale_[0]*this.pixelRatio/this.imagePixelRatio_,this.scale_[1]*this.pixelRatio/this.imagePixelRatio_],Math.ceil(this.width_*this.imagePixelRatio_),this.declutterMode_,this.declutterImageWithText_]),this.hitDetectionInstructions.push([bt.DRAW_IMAGE,a,s,this.hitDetectionImage_,this.anchorX_,this.anchorY_,this.height_,this.opacity_,this.originX_,this.originY_,this.rotateWithView_,this.rotation_,this.scale_,this.width_,this.declutterMode_,this.declutterImageWithText_]),this.endGeometry(r)}},e.prototype.drawMultiPoint=function(n,r){if(this.image_){this.beginGeometry(n,r);var i=n.getFlatCoordinates(),o=n.getStride(),a=this.coordinates.length,s=this.appendFlatPointCoordinates(i,o);this.instructions.push([bt.DRAW_IMAGE,a,s,this.image_,this.anchorX_*this.imagePixelRatio_,this.anchorY_*this.imagePixelRatio_,Math.ceil(this.height_*this.imagePixelRatio_),this.opacity_,this.originX_*this.imagePixelRatio_,this.originY_*this.imagePixelRatio_,this.rotateWithView_,this.rotation_,[this.scale_[0]*this.pixelRatio/this.imagePixelRatio_,this.scale_[1]*this.pixelRatio/this.imagePixelRatio_],Math.ceil(this.width_*this.imagePixelRatio_),this.declutterMode_,this.declutterImageWithText_]),this.hitDetectionInstructions.push([bt.DRAW_IMAGE,a,s,this.hitDetectionImage_,this.anchorX_,this.anchorY_,this.height_,this.opacity_,this.originX_,this.originY_,this.rotateWithView_,this.rotation_,this.scale_,this.width_,this.declutterMode_,this.declutterImageWithText_]),this.endGeometry(r)}},e.prototype.finish=function(){return this.reverseHitDetectionInstructions(),this.anchorX_=void 0,this.anchorY_=void 0,this.hitDetectionImage_=null,this.image_=null,this.imagePixelRatio_=void 0,this.height_=void 0,this.scale_=void 0,this.opacity_=void 0,this.originX_=void 0,this.originY_=void 0,this.rotateWithView_=void 0,this.rotation_=void 0,this.width_=void 0,t.prototype.finish.call(this)},e.prototype.setImageStyle=function(n,r){var i=n.getAnchor(),o=n.getSize(),a=n.getOrigin();this.imagePixelRatio_=n.getPixelRatio(this.pixelRatio),this.anchorX_=i[0],this.anchorY_=i[1],this.hitDetectionImage_=n.getHitDetectionImage(),this.image_=n.getImage(this.pixelRatio),this.height_=o[1],this.opacity_=n.getOpacity(),this.originX_=a[0],this.originY_=a[1],this.rotateWithView_=n.getRotateWithView(),this.rotation_=n.getRotation(),this.scale_=n.getScaleArray(),this.width_=o[0],this.declutterMode_=n.getDeclutterMode(),this.declutterImageWithText_=r},e}(Q1),tje=function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,i){r.__proto__=i}||function(r,i){for(var o in i)Object.prototype.hasOwnProperty.call(i,o)&&(r[o]=i[o])},t(e,n)};return function(e,n){if(typeof n!="function"&&n!==null)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");t(e,n);function r(){this.constructor=e}e.prototype=n===null?Object.create(n):(r.prototype=n.prototype,new r)}}(),nje=function(t){tje(e,t);function e(n,r,i,o){return t.call(this,n,r,i,o)||this}return e.prototype.drawFlatCoordinates_=function(n,r,i,o){var a=this.coordinates.length,s=this.appendFlatLineCoordinates(n,r,i,o,!1,!1),l=[bt.MOVE_TO_LINE_TO,a,s];return this.instructions.push(l),this.hitDetectionInstructions.push(l),i},e.prototype.drawLineString=function(n,r){var i=this.state,o=i.strokeStyle,a=i.lineWidth;if(!(o===void 0||a===void 0)){this.updateStrokeStyle(i,this.applyStroke),this.beginGeometry(n,r),this.hitDetectionInstructions.push([bt.SET_STROKE_STYLE,i.strokeStyle,i.lineWidth,i.lineCap,i.lineJoin,i.miterLimit,Wb,Vb],wh);var s=n.getFlatCoordinates(),l=n.getStride();this.drawFlatCoordinates_(s,0,s.length,l),this.hitDetectionInstructions.push(Sf),this.endGeometry(r)}},e.prototype.drawMultiLineString=function(n,r){var i=this.state,o=i.strokeStyle,a=i.lineWidth;if(!(o===void 0||a===void 0)){this.updateStrokeStyle(i,this.applyStroke),this.beginGeometry(n,r),this.hitDetectionInstructions.push([bt.SET_STROKE_STYLE,i.strokeStyle,i.lineWidth,i.lineCap,i.lineJoin,i.miterLimit,i.lineDash,i.lineDashOffset],wh);for(var s=n.getEnds(),l=n.getFlatCoordinates(),c=n.getStride(),u=0,f=0,d=s.length;f<d;++f)u=this.drawFlatCoordinates_(l,u,s[f],c);this.hitDetectionInstructions.push(Sf),this.endGeometry(r)}},e.prototype.finish=function(){var n=this.state;return n.lastStroke!=null&&n.lastStroke!=this.coordinates.length&&this.instructions.push(Sf),this.reverseHitDetectionInstructions(),this.state=null,t.prototype.finish.call(this)},e.prototype.applyStroke=function(n){n.lastStroke!=null&&n.lastStroke!=this.coordinates.length&&(this.instructions.push(Sf),n.lastStroke=this.coordinates.length),n.lastStroke=0,t.prototype.applyStroke.call(this,n),this.instructions.push(wh)},e}(Q1),rje=function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,i){r.__proto__=i}||function(r,i){for(var o in i)Object.prototype.hasOwnProperty.call(i,o)&&(r[o]=i[o])},t(e,n)};return function(e,n){if(typeof n!="function"&&n!==null)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");t(e,n);function r(){this.constructor=e}e.prototype=n===null?Object.create(n):(r.prototype=n.prototype,new r)}}(),UG=function(t){rje(e,t);function e(n,r,i,o){return t.call(this,n,r,i,o)||this}return e.prototype.drawFlatCoordinatess_=function(n,r,i,o){var a=this.state,s=a.fillStyle!==void 0,l=a.strokeStyle!==void 0,c=i.length;this.instructions.push(wh),this.hitDetectionInstructions.push(wh);for(var u=0;u<c;++u){var f=i[u],d=this.coordinates.length,h=this.appendFlatLineCoordinates(n,r,f,o,!0,!l),p=[bt.MOVE_TO_LINE_TO,d,h];this.instructions.push(p),this.hitDetectionInstructions.push(p),l&&(this.instructions.push(zG),this.hitDetectionInstructions.push(zG)),r=f}return s&&(this.instructions.push(OS),this.hitDetectionInstructions.push(OS)),l&&(this.instructions.push(Sf),this.hitDetectionInstructions.push(Sf)),r},e.prototype.drawCircle=function(n,r){var i=this.state,o=i.fillStyle,a=i.strokeStyle;if(!(o===void 0&&a===void 0)){this.setFillStrokeStyles_(),this.beginGeometry(n,r),i.fillStyle!==void 0&&this.hitDetectionInstructions.push([bt.SET_FILL_STYLE,Jc]),i.strokeStyle!==void 0&&this.hitDetectionInstructions.push([bt.SET_STROKE_STYLE,i.strokeStyle,i.lineWidth,i.lineCap,i.lineJoin,i.miterLimit,i.lineDash,i.lineDashOffset]);var s=n.getFlatCoordinates(),l=n.getStride(),c=this.coordinates.length;this.appendFlatLineCoordinates(s,0,s.length,l,!1,!1);var u=[bt.CIRCLE,c];this.instructions.push(wh,u),this.hitDetectionInstructions.push(wh,u),i.fillStyle!==void 0&&(this.instructions.push(OS),this.hitDetectionInstructions.push(OS)),i.strokeStyle!==void 0&&(this.instructions.push(Sf),this.hitDetectionInstructions.push(Sf)),this.endGeometry(r)}},e.prototype.drawPolygon=function(n,r){var i=this.state,o=i.fillStyle,a=i.strokeStyle;if(!(o===void 0&&a===void 0)){this.setFillStrokeStyles_(),this.beginGeometry(n,r),i.fillStyle!==void 0&&this.hitDetectionInstructions.push([bt.SET_FILL_STYLE,Jc]),i.strokeStyle!==void 0&&this.hitDetectionInstructions.push([bt.SET_STROKE_STYLE,i.strokeStyle,i.lineWidth,i.lineCap,i.lineJoin,i.miterLimit,i.lineDash,i.lineDashOffset]);var s=n.getEnds(),l=n.getOrientedFlatCoordinates(),c=n.getStride();this.drawFlatCoordinatess_(l,0,s,c),this.endGeometry(r)}},e.prototype.drawMultiPolygon=function(n,r){var i=this.state,o=i.fillStyle,a=i.strokeStyle;if(!(o===void 0&&a===void 0)){this.setFillStrokeStyles_(),this.beginGeometry(n,r),i.fillStyle!==void 0&&this.hitDetectionInstructions.push([bt.SET_FILL_STYLE,Jc]),i.strokeStyle!==void 0&&this.hitDetectionInstructions.push([bt.SET_STROKE_STYLE,i.strokeStyle,i.lineWidth,i.lineCap,i.lineJoin,i.miterLimit,i.lineDash,i.lineDashOffset]);for(var s=n.getEndss(),l=n.getOrientedFlatCoordinates(),c=n.getStride(),u=0,f=0,d=s.length;f<d;++f)u=this.drawFlatCoordinatess_(l,u,s[f],c);this.endGeometry(r)}},e.prototype.finish=function(){this.reverseHitDetectionInstructions(),this.state=null;var n=this.tolerance;if(n!==0)for(var r=this.coordinates,i=0,o=r.length;i<o;++i)r[i]=Zd(r[i],n);return t.prototype.finish.call(this)},e.prototype.setFillStrokeStyles_=function(){var n=this.state,r=n.fillStyle;r!==void 0&&this.updateFillStyle(n,this.createFill),n.strokeStyle!==void 0&&this.updateStrokeStyle(n,this.applyStroke)},e}(Q1);function ije(t,e,n,r,i){var o=n,a=n,s=0,l=0,c=n,u,f,d,h,p,m,g,v,y,x;for(f=n;f<r;f+=i){var b=e[f],_=e[f+1];p!==void 0&&(y=b-p,x=_-m,h=Math.sqrt(y*y+x*x),g!==void 0&&(l+=d,u=Math.acos((g*y+v*x)/(d*h)),u>t&&(l>s&&(s=l,o=c,a=f),l=0,c=f-i)),d=h,g=y,v=x),p=b,m=_}return l+=h,l>s?[c,f]:[o,a]}var oje=function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,i){r.__proto__=i}||function(r,i){for(var o in i)Object.prototype.hasOwnProperty.call(i,o)&&(r[o]=i[o])},t(e,n)};return function(e,n){if(typeof n!="function"&&n!==null)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");t(e,n);function r(){this.constructor=e}e.prototype=n===null?Object.create(n):(r.prototype=n.prototype,new r)}}(),qx={left:0,end:0,center:.5,right:1,start:1,top:0,middle:.5,hanging:.2,alphabetic:.8,ideographic:.8,bottom:1},aje=function(t){oje(e,t);function e(n,r,i,o){var a=t.call(this,n,r,i,o)||this;return a.labels_=null,a.text_="",a.textOffsetX_=0,a.textOffsetY_=0,a.textRotateWithView_=void 0,a.textRotation_=0,a.textFillState_=null,a.fillStates={},a.textStrokeState_=null,a.strokeStates={},a.textState_={},a.textStates={},a.textKey_="",a.fillKey_="",a.strokeKey_="",a.declutterImageWithText_=void 0,a}return e.prototype.finish=function(){var n=t.prototype.finish.call(this);return n.textStates=this.textStates,n.fillStates=this.fillStates,n.strokeStates=this.strokeStates,n},e.prototype.drawText=function(n,r){var i=this.textFillState_,o=this.textStrokeState_,a=this.textState_;if(!(this.text_===""||!a||!i&&!o)){var s=this.coordinates,l=s.length,c=n.getType(),u=null,f=n.getStride();if(a.placement===BFe.LINE&&(c=="LineString"||c=="MultiLineString"||c=="Polygon"||c=="MultiPolygon")){if(!so(this.getBufferedMaxExtent(),n.getExtent()))return;var d=void 0;if(u=n.getFlatCoordinates(),c=="LineString")d=[u.length];else if(c=="MultiLineString")d=n.getEnds();else if(c=="Polygon")d=n.getEnds().slice(0,1);else if(c=="MultiPolygon"){var h=n.getEndss();d=[];for(var p=0,m=h.length;p<m;++p)d.push(h[p][0])}this.beginGeometry(n,r);for(var g=a.textAlign,v=0,y=void 0,x=0,b=d.length;x<b;++x){if(g==null){var _=ije(a.maxAngle,u,v,d[x],f);v=_[0],y=_[1]}else y=d[x];for(var p=v;p<y;p+=f)s.push(u[p],u[p+1]);var S=s.length;v=d[x],this.drawChars_(l,S),l=S}this.endGeometry(r)}else{var O=a.overflow?null:[];switch(c){case"Point":case"MultiPoint":u=n.getFlatCoordinates();break;case"LineString":u=n.getFlatMidpoint();break;case"Circle":u=n.getCenter();break;case"MultiLineString":u=n.getFlatMidpoints(),f=2;break;case"Polygon":u=n.getFlatInteriorPoint(),a.overflow||O.push(u[2]/this.resolution),f=3;break;case"MultiPolygon":var C=n.getFlatInteriorPoints();u=[];for(var p=0,m=C.length;p<m;p+=3)a.overflow||O.push(C[p+2]/this.resolution),u.push(C[p],C[p+1]);if(u.length===0)return;f=2;break}var S=this.appendFlatPointCoordinates(u,f);if(S===l)return;if(O&&(S-l)/2!==u.length/f){var E=l/2;O=O.filter(function(U,W){var $=s[(E+W)*2]===u[W*f]&&s[(E+W)*2+1]===u[W*f+1];return $||--E,$})}this.saveTextStates_(),(a.backgroundFill||a.backgroundStroke)&&(this.setFillStrokeStyle(a.backgroundFill,a.backgroundStroke),a.backgroundFill&&(this.updateFillStyle(this.state,this.createFill),this.hitDetectionInstructions.push(this.createFill(this.state))),a.backgroundStroke&&(this.updateStrokeStyle(this.state,this.applyStroke),this.hitDetectionInstructions.push(this.createStroke(this.state)))),this.beginGeometry(n,r);var k=a.padding;if(k!=_h&&(a.scale[0]<0||a.scale[1]<0)){var I=a.padding[0],P=a.padding[1],R=a.padding[2],T=a.padding[3];a.scale[0]<0&&(P=-P,T=-T),a.scale[1]<0&&(I=-I,R=-R),k=[I,P,R,T]}var L=this.pixelRatio;this.instructions.push([bt.DRAW_IMAGE,l,S,null,NaN,NaN,NaN,1,0,0,this.textRotateWithView_,this.textRotation_,[1,1],NaN,void 0,this.declutterImageWithText_,k==_h?_h:k.map(function(U){return U*L}),!!a.backgroundFill,!!a.backgroundStroke,this.text_,this.textKey_,this.strokeKey_,this.fillKey_,this.textOffsetX_,this.textOffsetY_,O]);var z=1/L;this.hitDetectionInstructions.push([bt.DRAW_IMAGE,l,S,null,NaN,NaN,NaN,1,0,0,this.textRotateWithView_,this.textRotation_,[z,z],NaN,void 0,this.declutterImageWithText_,k,!!a.backgroundFill,!!a.backgroundStroke,this.text_,this.textKey_,this.strokeKey_,this.fillKey_,this.textOffsetX_,this.textOffsetY_,O]),this.endGeometry(r)}}},e.prototype.saveTextStates_=function(){var n=this.textStrokeState_,r=this.textState_,i=this.textFillState_,o=this.strokeKey_;n&&(o in this.strokeStates||(this.strokeStates[o]={strokeStyle:n.strokeStyle,lineCap:n.lineCap,lineDashOffset:n.lineDashOffset,lineWidth:n.lineWidth,lineJoin:n.lineJoin,miterLimit:n.miterLimit,lineDash:n.lineDash}));var a=this.textKey_;a in this.textStates||(this.textStates[a]={font:r.font,textAlign:r.textAlign||qb,justify:r.justify,textBaseline:r.textBaseline||HT,scale:r.scale});var s=this.fillKey_;i&&(s in this.fillStates||(this.fillStates[s]={fillStyle:i.fillStyle}))},e.prototype.drawChars_=function(n,r){var i=this.textStrokeState_,o=this.textState_,a=this.strokeKey_,s=this.textKey_,l=this.fillKey_;this.saveTextStates_();var c=this.pixelRatio,u=qx[o.textBaseline],f=this.textOffsetY_*c,d=this.text_,h=i?i.lineWidth*Math.abs(o.scale[0])/2:0;this.instructions.push([bt.DRAW_CHARS,n,r,u,o.overflow,l,o.maxAngle,c,f,a,h*c,d,s,1]),this.hitDetectionInstructions.push([bt.DRAW_CHARS,n,r,u,o.overflow,l,o.maxAngle,1,f,a,h,d,s,1/c])},e.prototype.setTextStyle=function(n,r){var i,o,a;if(!n)this.text_="";else{var s=n.getFill();s?(o=this.textFillState_,o||(o={},this.textFillState_=o),o.fillStyle=Rl(s.getColor()||Jc)):(o=null,this.textFillState_=o);var l=n.getStroke();if(!l)a=null,this.textStrokeState_=a;else{a=this.textStrokeState_,a||(a={},this.textStrokeState_=a);var c=l.getLineDash(),u=l.getLineDashOffset(),f=l.getWidth(),d=l.getMiterLimit();a.lineCap=l.getLineCap()||GT,a.lineDash=c?c.slice():Wb,a.lineDashOffset=u===void 0?Vb:u,a.lineJoin=l.getLineJoin()||iv,a.lineWidth=f===void 0?Xb:f,a.miterLimit=d===void 0?Gb:d,a.strokeStyle=Rl(l.getColor()||Hb)}i=this.textState_;var h=n.getFont()||Coe;kFe(h);var p=n.getScaleArray();i.overflow=n.getOverflow(),i.font=h,i.maxAngle=n.getMaxAngle(),i.placement=n.getPlacement(),i.textAlign=n.getTextAlign(),i.justify=n.getJustify(),i.textBaseline=n.getTextBaseline()||HT,i.backgroundFill=n.getBackgroundFill(),i.backgroundStroke=n.getBackgroundStroke(),i.padding=n.getPadding()||_h,i.scale=p===void 0?[1,1]:p;var m=n.getOffsetX(),g=n.getOffsetY(),v=n.getRotateWithView(),y=n.getRotation();this.text_=n.getText()||"",this.textOffsetX_=m===void 0?0:m,this.textOffsetY_=g===void 0?0:g,this.textRotateWithView_=v===void 0?!1:v,this.textRotation_=y===void 0?0:y,this.strokeKey_=a?(typeof a.strokeStyle=="string"?a.strokeStyle:vn(a.strokeStyle))+a.lineCap+a.lineDashOffset+"|"+a.lineWidth+a.lineJoin+a.miterLimit+"["+a.lineDash.join()+"]":"",this.textKey_=i.font+i.scale+(i.textAlign||"?")+(i.justify||"?")+(i.textBaseline||"?"),this.fillKey_=o?typeof o.fillStyle=="string"?o.fillStyle:"|"+vn(o.fillStyle):""}this.declutterImageWithText_=r},e}(Q1),sje={Circle:UG,Default:Q1,Image:eje,LineString:nje,Polygon:UG,Text:aje},WG=function(){function t(e,n,r,i){this.tolerance_=e,this.maxExtent_=n,this.pixelRatio_=i,this.resolution_=r,this.buildersByZIndex_={}}return t.prototype.finish=function(){var e={};for(var n in this.buildersByZIndex_){e[n]=e[n]||{};var r=this.buildersByZIndex_[n];for(var i in r){var o=r[i].finish();e[n][i]=o}}return e},t.prototype.getBuilder=function(e,n){var r=e!==void 0?e.toString():"0",i=this.buildersByZIndex_[r];i===void 0&&(i={},this.buildersByZIndex_[r]=i);var o=i[n];if(o===void 0){var a=sje[n];o=new a(this.tolerance_,this.maxExtent_,this.resolution_,this.pixelRatio_),i[n]=o}return o},t}(),lje=function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,i){r.__proto__=i}||function(r,i){for(var o in i)Object.prototype.hasOwnProperty.call(i,o)&&(r[o]=i[o])},t(e,n)};return function(e,n){if(typeof n!="function"&&n!==null)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");t(e,n);function r(){this.constructor=e}e.prototype=n===null?Object.create(n):(r.prototype=n.prototype,new r)}}(),cje=function(t){lje(e,t);function e(n){var r=t.call(this)||this;return r.ready=!0,r.boundHandleImageChange_=r.handleImageChange_.bind(r),r.layer_=n,r.declutterExecutorGroup=null,r}return e.prototype.getFeatures=function(n){return yt()},e.prototype.getData=function(n){return null},e.prototype.prepareFrame=function(n){return yt()},e.prototype.renderFrame=function(n,r){return yt()},e.prototype.loadedTileCallback=function(n,r,i){n[r]||(n[r]={}),n[r][i.tileCoord.toString()]=i},e.prototype.createLoadedTileFinder=function(n,r,i){return(function(o,a){var s=this.loadedTileCallback.bind(this,i,o);return n.forEachLoadedTile(r,o,a,s)}).bind(this)},e.prototype.forEachFeatureAtCoordinate=function(n,r,i,o,a){},e.prototype.getDataAtPixel=function(n,r,i){return null},e.prototype.getLayer=function(){return this.layer_},e.prototype.handleFontsChanged=function(){},e.prototype.handleImageChange_=function(n){var r=n.target;r.getState()===Wn.LOADED&&this.renderIfReadyAndVisible()},e.prototype.loadImage=function(n){var r=n.getState();return r!=Wn.LOADED&&r!=Wn.ERROR&&n.addEventListener(Mt.CHANGE,this.boundHandleImageChange_),r==Wn.IDLE&&(n.load(),r=n.getState()),r==Wn.LOADED},e.prototype.renderIfReadyAndVisible=function(){var n=this.getLayer();n&&n.getVisible()&&n.getSourceState()==="ready"&&n.changed()},e.prototype.disposeInternal=function(){delete this.layer_,t.prototype.disposeInternal.call(this)},e}(B1),uje=function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,i){r.__proto__=i}||function(r,i){for(var o in i)Object.prototype.hasOwnProperty.call(i,o)&&(r[o]=i[o])},t(e,n)};return function(e,n){if(typeof n!="function"&&n!==null)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");t(e,n);function r(){this.constructor=e}e.prototype=n===null?Object.create(n):(r.prototype=n.prototype,new r)}}(),Aoe=function(t){uje(e,t);function e(n,r,i,o){var a=t.call(this,n)||this;return a.inversePixelTransform=r,a.frameState=i,a.context=o,a}return e}(ac),fje=function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,i){r.__proto__=i}||function(r,i){for(var o in i)Object.prototype.hasOwnProperty.call(i,o)&&(r[o]=i[o])},t(e,n)};return function(e,n){if(typeof n!="function"&&n!==null)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");t(e,n);function r(){this.constructor=e}e.prototype=n===null?Object.create(n):(r.prototype=n.prototype,new r)}}(),VG=[],Bm=null;function dje(){var t=document.createElement("canvas");t.width=1,t.height=1,Bm=t.getContext("2d")}var Roe=function(t){fje(e,t);function e(n){var r=t.call(this,n)||this;return r.container=null,r.renderedResolution,r.tempTransform=Hl(),r.pixelTransform=Hl(),r.inversePixelTransform=Hl(),r.context=null,r.containerReused=!1,r.pixelContext_=null,r.frameState=null,r}return e.prototype.getImageData=function(n,r,i){Bm||dje(),Bm.clearRect(0,0,1,1);var o;try{Bm.drawImage(n,r,i,1,1,0,0,1,1),o=Bm.getImageData(0,0,1,1).data}catch{return Bm=null,null}return o},e.prototype.getBackground=function(n){var r=this.getLayer(),i=r.getBackground();return typeof i=="function"&&(i=i(n.viewState.resolution)),i||void 0},e.prototype.useContainer=function(n,r,i){var o=this.getLayer().getClassName(),a,s;if(n&&n.className===o&&(!i||n&&n.style.backgroundColor&&kp(VT(n.style.backgroundColor),VT(i)))){var l=n.firstElementChild;l instanceof HTMLCanvasElement&&(s=l.getContext("2d"))}if(s&&s.canvas.style.transform===r?(this.container=n,this.context=s,this.containerReused=!0):this.containerReused&&(this.container=null,this.context=null,this.containerReused=!1),!this.container){a=document.createElement("div"),a.className=o;var c=a.style;c.position="absolute",c.width="100%",c.height="100%",s=Ca();var l=s.canvas;a.appendChild(l),c=l.style,c.position="absolute",c.left="0",c.transformOrigin="top left",this.container=a,this.context=s}!this.containerReused&&i&&!this.container.style.backgroundColor&&(this.container.style.backgroundColor=i)},e.prototype.clipUnrotated=function(n,r,i){var o=Rp(i),a=eB(i),s=J5(i),l=Z5(i);Cr(r.coordinateToPixelTransform,o),Cr(r.coordinateToPixelTransform,a),Cr(r.coordinateToPixelTransform,s),Cr(r.coordinateToPixelTransform,l);var c=this.inversePixelTransform;Cr(c,o),Cr(c,a),Cr(c,s),Cr(c,l),n.save(),n.beginPath(),n.moveTo(Math.round(o[0]),Math.round(o[1])),n.lineTo(Math.round(a[0]),Math.round(a[1])),n.lineTo(Math.round(s[0]),Math.round(s[1])),n.lineTo(Math.round(l[0]),Math.round(l[1])),n.clip()},e.prototype.dispatchRenderEvent_=function(n,r,i){var o=this.getLayer();if(o.hasListener(n)){var a=new Aoe(n,this.inversePixelTransform,i,r);o.dispatchEvent(a)}},e.prototype.preRender=function(n,r){this.frameState=r,this.dispatchRenderEvent_(Bf.PRERENDER,n,r)},e.prototype.postRender=function(n,r){this.dispatchRenderEvent_(Bf.POSTRENDER,n,r)},e.prototype.getRenderTransform=function(n,r,i,o,a,s,l){var c=a/2,u=s/2,f=o/r,d=-f,h=-n[0]+l,p=-n[1];return hu(this.tempTransform,c,u,f,d,-i,h,p)},e.prototype.getDataAtPixel=function(n,r,i){var o=Cr(this.inversePixelTransform,n.slice()),a=this.context,s=this.getLayer(),l=s.getExtent();if(l){var c=Cr(r.pixelToCoordinateTransform,n.slice());if(!z1(l,c))return null}var u=Math.round(o[0]),f=Math.round(o[1]),d=this.pixelContext_;if(!d){var h=document.createElement("canvas");h.width=1,h.height=1,d=h.getContext("2d"),this.pixelContext_=d}d.clearRect(0,0,1,1);var p;try{d.drawImage(a.canvas,u,f,1,1,0,0,1,1),p=d.getImageData(0,0,1,1).data}catch(m){return m.name==="SecurityError"?(this.pixelContext_=null,new Uint8Array):p}return p[3]===0?null:p},e.prototype.disposeInternal=function(){delete this.frameState,t.prototype.disposeInternal.call(this)},e}(cje);function hje(t,e,n,r,i,o,a,s,l,c,u,f){var d=t[e],h=t[e+1],p=0,m=0,g=0,v=0;function y(){p=d,m=h,e+=r,d=t[e],h=t[e+1],v+=g,g=Math.sqrt((d-p)*(d-p)+(h-m)*(h-m))}do y();while(e<n-r&&v+g<o);for(var x=g===0?0:(o-v)/g,b=Nc(p,d,x),_=Nc(m,h,x),S=e-r,O=v,C=o+s*l(c,i,u);e<n-r&&v+g<C;)y();x=g===0?0:(C-v)/g;var E=Nc(p,d,x),k=Nc(m,h,x),I;if(f){var P=[b,_,E,k];aB(P,0,4,2,f,P,P),I=P[0]>P[2]}else I=b>E;var R=Math.PI,T=[],L=S+r===e;e=S,g=0,v=O,d=t[e],h=t[e+1];var z;if(L){y(),z=Math.atan2(h-m,d-p),I&&(z+=z>0?-R:R);var B=(E+b)/2,U=(k+_)/2;return T[0]=[B,U,(C-o)/2,z,i],T}i=i.replace(/\n/g," ");for(var W=0,$=i.length;W<$;){y();var N=Math.atan2(h-m,d-p);if(I&&(N+=N>0?-R:R),z!==void 0){var D=N-z;if(D+=D>R?-2*R:D<-R?2*R:0,Math.abs(D)>a)return null}z=N;for(var A=W,q=0;W<$;++W){var Y=I?$-W-1:W,K=s*l(c,i[Y],u);if(e+r<n&&v+g<o+q+K/2)break;q+=K}if(W!==A){var se=I?i.substring($-A,$-W):i.substring(A,W);x=g===0?0:(o+q/2-v)/g;var B=Nc(p,d,x),U=Nc(m,h,x);T.push([B,U,q/2,N,se]),o+=q}}return T}var nm=Oa(),Ru=[],mc=[],gc=[],Iu=[];function GG(t){return t[3].declutterBox}var pje=new RegExp("[֑-ࣿיִ-﷿ﹰ-ﻼࠀ-࿿-]");function HG(t,e){return(e==="start"||e==="end")&&!pje.test(t)&&(e=e==="start"?"left":"right"),qx[e]}function mje(t,e,n){return n>0&&t.push(`
`,""),t.push(e,""),t}var gje=function(){function t(e,n,r,i){this.overlaps=r,this.pixelRatio=n,this.resolution=e,this.alignFill_,this.instructions=i.instructions,this.coordinates=i.coordinates,this.coordinateCache_={},this.renderedTransform_=Hl(),this.hitDetectionInstructions=i.hitDetectionInstructions,this.pixelCoordinates_=null,this.viewRotation_=0,this.fillStates=i.fillStates||{},this.strokeStates=i.strokeStates||{},this.textStates=i.textStates||{},this.widths_={},this.labels_={}}return t.prototype.createLabel=function(e,n,r,i){var o=e+n+r+i;if(this.labels_[o])return this.labels_[o];var a=i?this.strokeStates[i]:null,s=r?this.fillStates[r]:null,l=this.textStates[n],c=this.pixelRatio,u=[l.scale[0]*c,l.scale[1]*c],f=Array.isArray(e),d=l.justify?qx[l.justify]:HG(Array.isArray(e)?e[0]:e,l.textAlign||qb),h=i&&a.lineWidth?a.lineWidth:0,p=f?e:e.split(`
`).reduce(mje,[]),m=RFe(l,p),g=m.width,v=m.height,y=m.widths,x=m.heights,b=m.lineWidths,_=g+h,S=[],O=(_+2)*u[0],C=(v+h)*u[1],E={width:O<0?Math.floor(O):Math.ceil(O),height:C<0?Math.floor(C):Math.ceil(C),contextInstructions:S};if((u[0]!=1||u[1]!=1)&&S.push("scale",u),i){S.push("strokeStyle",a.strokeStyle),S.push("lineWidth",h),S.push("lineCap",a.lineCap),S.push("lineJoin",a.lineJoin),S.push("miterLimit",a.miterLimit);var k=o2?OffscreenCanvasRenderingContext2D:CanvasRenderingContext2D;k.prototype.setLineDash&&(S.push("setLineDash",[a.lineDash]),S.push("lineDashOffset",a.lineDashOffset))}r&&S.push("fillStyle",s.fillStyle),S.push("textBaseline","middle"),S.push("textAlign","center");for(var I=.5-d,P=d*_+I*h,R=[],T=[],L=0,z=0,B=0,U=0,W,$=0,N=p.length;$<N;$+=2){var D=p[$];if(D===`
`){z+=L,L=0,P=d*_+I*h,++U;continue}var A=p[$+1]||l.font;A!==W&&(i&&R.push("font",A),r&&T.push("font",A),W=A),L=Math.max(L,x[B]);var q=[D,P+I*y[B]+d*(y[B]-b[U]),.5*(h+L)+z];P+=y[B],i&&R.push("strokeText",q),r&&T.push("fillText",q),++B}return Array.prototype.push.apply(S,R),Array.prototype.push.apply(S,T),this.labels_[o]=E,E},t.prototype.replayTextBackground_=function(e,n,r,i,o,a,s){e.beginPath(),e.moveTo.apply(e,n),e.lineTo.apply(e,r),e.lineTo.apply(e,i),e.lineTo.apply(e,o),e.lineTo.apply(e,n),a&&(this.alignFill_=a[2],this.fill_(e)),s&&(this.setStrokeStyle_(e,s),e.stroke())},t.prototype.calculateImageOrLabelDimensions_=function(e,n,r,i,o,a,s,l,c,u,f,d,h,p,m,g){s*=d[0],l*=d[1];var v=r-s,y=i-l,x=o+c>e?e-c:o,b=a+u>n?n-u:a,_=p[3]+x*d[0]+p[1],S=p[0]+b*d[1]+p[2],O=v-p[3],C=y-p[0];(m||f!==0)&&(Ru[0]=O,Iu[0]=O,Ru[1]=C,mc[1]=C,mc[0]=O+_,gc[0]=mc[0],gc[1]=C+S,Iu[1]=gc[1]);var E;return f!==0?(E=hu(Hl(),r,i,1,1,f,-r,-i),Cr(E,Ru),Cr(E,mc),Cr(E,gc),Cr(E,Iu),Zs(Math.min(Ru[0],mc[0],gc[0],Iu[0]),Math.min(Ru[1],mc[1],gc[1],Iu[1]),Math.max(Ru[0],mc[0],gc[0],Iu[0]),Math.max(Ru[1],mc[1],gc[1],Iu[1]),nm)):Zs(Math.min(O,O+_),Math.min(C,C+S),Math.max(O,O+_),Math.max(C,C+S),nm),h&&(v=Math.round(v),y=Math.round(y)),{drawImageX:v,drawImageY:y,drawImageW:x,drawImageH:b,originX:c,originY:u,declutterBox:{minX:nm[0],minY:nm[1],maxX:nm[2],maxY:nm[3],value:g},canvasTransform:E,scale:d}},t.prototype.replayImageOrLabel_=function(e,n,r,i,o,a,s){var l=!!(a||s),c=i.declutterBox,u=e.canvas,f=s?s[2]*i.scale[0]/2:0,d=c.minX-f<=u.width/n&&c.maxX+f>=0&&c.minY-f<=u.height/n&&c.maxY+f>=0;return d&&(l&&this.replayTextBackground_(e,Ru,mc,gc,Iu,a,s),IFe(e,i.canvasTransform,o,r,i.originX,i.originY,i.drawImageW,i.drawImageH,i.drawImageX,i.drawImageY,i.scale)),!0},t.prototype.fill_=function(e){if(this.alignFill_){var n=Cr(this.renderedTransform_,[0,0]),r=512*this.pixelRatio;e.save(),e.translate(n[0]%r,n[1]%r),e.rotate(this.viewRotation_)}e.fill(),this.alignFill_&&e.restore()},t.prototype.setStrokeStyle_=function(e,n){e.strokeStyle=n[1],e.lineWidth=n[2],e.lineCap=n[3],e.lineJoin=n[4],e.miterLimit=n[5],e.setLineDash&&(e.lineDashOffset=n[7],e.setLineDash(n[6]))},t.prototype.drawLabelWithPointPlacement_=function(e,n,r,i){var o=this.textStates[n],a=this.createLabel(e,n,i,r),s=this.strokeStates[r],l=this.pixelRatio,c=HG(Array.isArray(e)?e[0]:e,o.textAlign||qb),u=qx[o.textBaseline||HT],f=s&&s.lineWidth?s.lineWidth:0,d=a.width/l-2*o.scale[0],h=c*d+2*(.5-c)*f,p=u*a.height/l+2*(.5-u)*f;return{label:a,anchorX:h,anchorY:p}},t.prototype.execute_=function(e,n,r,i,o,a,s,l){var c;this.pixelCoordinates_&&kp(r,this.renderedTransform_)?c=this.pixelCoordinates_:(this.pixelCoordinates_||(this.pixelCoordinates_=[]),c=Bh(this.coordinates,0,this.coordinates.length,2,r,this.pixelCoordinates_),G3e(this.renderedTransform_,r));for(var u=0,f=i.length,d=0,h,p,m,g,v,y,x,b,_,S,O,C,E=0,k=0,I=null,P=null,R=this.coordinateCache_,T=this.viewRotation_,L=Math.round(Math.atan2(-r[1],r[0])*1e12)/1e12,z={context:e,pixelRatio:this.pixelRatio,resolution:this.resolution,rotation:T},B=this.instructions!=i||this.overlaps?0:200,U,W,$,N;u<f;){var D=i[u],A=D[0];switch(A){case bt.BEGIN_GEOMETRY:U=D[1],N=D[3],U.getGeometry()?s!==void 0&&!so(s,N.getExtent())?u=D[2]+1:++u:u=D[2];break;case bt.BEGIN_PATH:E>B&&(this.fill_(e),E=0),k>B&&(e.stroke(),k=0),!E&&!k&&(e.beginPath(),g=NaN,v=NaN),++u;break;case bt.CIRCLE:d=D[1];var q=c[d],Y=c[d+1],K=c[d+2],se=c[d+3],te=K-q,J=se-Y,pe=Math.sqrt(te*te+J*J);e.moveTo(q+pe,Y),e.arc(q,Y,pe,0,2*Math.PI,!0),++u;break;case bt.CLOSE_PATH:e.closePath(),++u;break;case bt.CUSTOM:d=D[1],h=D[2];var be=D[3],re=D[4],ve=D.length==6?D[5]:void 0;z.geometry=be,z.feature=U,u in R||(R[u]=[]);var F=R[u];ve?ve(c,d,h,2,F):(F[0]=c[d],F[1]=c[d+1],F.length=2),re(F,z),++u;break;case bt.DRAW_IMAGE:d=D[1],h=D[2],b=D[3],p=D[4],m=D[5];var ce=D[6],le=D[7],Q=D[8],X=D[9],ee=D[10],ge=D[11],ye=D[12],H=D[13],G=D[14],ie=D[15];if(!b&&D.length>=20){_=D[19],S=D[20],O=D[21],C=D[22];var he=this.drawLabelWithPointPlacement_(_,S,O,C);b=he.label,D[3]=b;var _e=D[23];p=(he.anchorX-_e)*this.pixelRatio,D[4]=p;var oe=D[24];m=(he.anchorY-oe)*this.pixelRatio,D[5]=m,ce=b.height,D[6]=ce,H=b.width,D[13]=H}var Z=void 0;D.length>25&&(Z=D[25]);var V=void 0,de=void 0,xe=void 0;D.length>17?(V=D[16],de=D[17],xe=D[18]):(V=_h,de=!1,xe=!1),ee&&L?ge+=T:!ee&&!L&&(ge-=T);for(var Me=0;d<h;d+=2)if(!(Z&&Z[Me++]<H/this.pixelRatio)){var me=this.calculateImageOrLabelDimensions_(b.width,b.height,c[d],c[d+1],H,ce,p,m,Q,X,ge,ye,o,V,de||xe,U),$e=[e,n,b,me,le,de?I:null,xe?P:null];if(l){if(G==="none")continue;if(G==="obstacle"){l.insert(me.declutterBox);continue}else{var Te=void 0,Re=void 0;if(ie){var ae=h-d;if(!ie[ae]){ie[ae]=$e;continue}if(Te=ie[ae],delete ie[ae],Re=GG(Te),l.collides(Re))continue}if(l.collides(me.declutterBox))continue;Te&&(l.insert(Re),this.replayImageOrLabel_.apply(this,Te)),l.insert(me.declutterBox)}}this.replayImageOrLabel_.apply(this,$e)}++u;break;case bt.DRAW_CHARS:var Le=D[1],Ee=D[2],ze=D[3],He=D[4];C=D[5];var xt=D[6],Dt=D[7],nn=D[8];O=D[9];var Xr=D[10];_=D[11],S=D[12];var Cn=[D[13],D[13]],Qr=this.textStates[S],ir=Qr.font,to=[Qr.scale[0]*Dt,Qr.scale[1]*Dt],yo=void 0;ir in this.widths_?yo=this.widths_[ir]:(yo={},this.widths_[ir]=yo);var Xo=Zie(c,Le,Ee,2),al=Math.abs(to[0])*$G(ir,_,yo);if(He||al<=Xo){var yi=this.textStates[S].textAlign,Ts=(Xo-al)*qx[yi],ne=hje(c,Le,Ee,2,_,Ts,xt,Math.abs(to[0]),$G,ir,yo,L?0:this.viewRotation_);e:if(ne){var Pe=[],Ie=void 0,Oe=void 0,Ne=void 0,ot=void 0,Ze=void 0;if(O)for(Ie=0,Oe=ne.length;Ie<Oe;++Ie){Ze=ne[Ie],Ne=Ze[4],ot=this.createLabel(Ne,S,"",O),p=Ze[2]+(to[0]<0?-Xr:Xr),m=ze*ot.height+(.5-ze)*2*Xr*to[1]/to[0]-nn;var me=this.calculateImageOrLabelDimensions_(ot.width,ot.height,Ze[0],Ze[1],ot.width,ot.height,p,m,0,0,Ze[3],Cn,!1,_h,!1,U);if(l&&l.collides(me.declutterBox))break e;Pe.push([e,n,ot,me,1,null,null])}if(C)for(Ie=0,Oe=ne.length;Ie<Oe;++Ie){Ze=ne[Ie],Ne=Ze[4],ot=this.createLabel(Ne,S,C,""),p=Ze[2],m=ze*ot.height-nn;var me=this.calculateImageOrLabelDimensions_(ot.width,ot.height,Ze[0],Ze[1],ot.width,ot.height,p,m,0,0,Ze[3],Cn,!1,_h,!1,U);if(l&&l.collides(me.declutterBox))break e;Pe.push([e,n,ot,me,1,null,null])}l&&l.load(Pe.map(GG));for(var mt=0,wt=Pe.length;mt<wt;++mt)this.replayImageOrLabel_.apply(this,Pe[mt])}}++u;break;case bt.END_GEOMETRY:if(a!==void 0){U=D[1];var zt=a(U,N);if(zt)return zt}++u;break;case bt.FILL:B?E++:this.fill_(e),++u;break;case bt.MOVE_TO_LINE_TO:for(d=D[1],h=D[2],W=c[d],$=c[d+1],y=W+.5|0,x=$+.5|0,(y!==g||x!==v)&&(e.moveTo(W,$),g=y,v=x),d+=2;d<h;d+=2)W=c[d],$=c[d+1],y=W+.5|0,x=$+.5|0,(d==h-2||y!==g||x!==v)&&(e.lineTo(W,$),g=y,v=x);++u;break;case bt.SET_FILL_STYLE:I=D,this.alignFill_=D[2],E&&(this.fill_(e),E=0,k&&(e.stroke(),k=0)),e.fillStyle=D[1],++u;break;case bt.SET_STROKE_STYLE:P=D,k&&(e.stroke(),k=0),this.setStrokeStyle_(e,D),++u;break;case bt.STROKE:B?k++:e.stroke(),++u;break;default:++u;break}}E&&this.fill_(e),k&&e.stroke()},t.prototype.execute=function(e,n,r,i,o,a){this.viewRotation_=i,this.execute_(e,n,r,this.instructions,o,void 0,void 0,a)},t.prototype.executeHitDetection=function(e,n,r,i,o){return this.viewRotation_=r,this.execute_(e,1,n,this.hitDetectionInstructions,!0,i,o)},t}(),BA=["Polygon","Circle","LineString","Image","Text","Default"],qG=function(){function t(e,n,r,i,o,a){this.maxExtent_=e,this.overlaps_=i,this.pixelRatio_=r,this.resolution_=n,this.renderBuffer_=a,this.executorsByZIndex_={},this.hitDetectionContext_=null,this.hitDetectionTransform_=Hl(),this.createExecutors_(o)}return t.prototype.clip=function(e,n){var r=this.getClipCoords(n);e.beginPath(),e.moveTo(r[0],r[1]),e.lineTo(r[2],r[3]),e.lineTo(r[4],r[5]),e.lineTo(r[6],r[7]),e.clip()},t.prototype.createExecutors_=function(e){for(var n in e){var r=this.executorsByZIndex_[n];r===void 0&&(r={},this.executorsByZIndex_[n]=r);var i=e[n];for(var o in i){var a=i[o];r[o]=new gje(this.resolution_,this.pixelRatio_,this.overlaps_,a)}}},t.prototype.hasExecutors=function(e){for(var n in this.executorsByZIndex_)for(var r=this.executorsByZIndex_[n],i=0,o=e.length;i<o;++i)if(e[i]in r)return!0;return!1},t.prototype.forEachFeatureAtCoordinate=function(e,n,r,i,o,a){i=Math.round(i);var s=i*2+1,l=hu(this.hitDetectionTransform_,i+.5,i+.5,1/n,-1/n,-r,-e[0],-e[1]),c=!this.hitDetectionContext_;c&&(this.hitDetectionContext_=Ca(s,s));var u=this.hitDetectionContext_;u.canvas.width!==s||u.canvas.height!==s?(u.canvas.width=s,u.canvas.height=s):c||u.clearRect(0,0,s,s);var f;this.renderBuffer_!==void 0&&(f=Oa(),Gx(f,e),Fb(f,n*(this.renderBuffer_+i),f));var d=vje(i),h;function p(S,O){for(var C=u.getImageData(0,0,s,s).data,E=0,k=d.length;E<k;E++)if(C[d[E]]>0){if(!a||h!=="Image"&&h!=="Text"||a.indexOf(S)!==-1){var I=(d[E]-3)/4,P=i-I%s,R=i-(I/s|0),T=o(S,O,P*P+R*R);if(T)return T}u.clearRect(0,0,s,s);break}}var m=Object.keys(this.executorsByZIndex_).map(Number);m.sort(rp);var g,v,y,x,b;for(g=m.length-1;g>=0;--g){var _=m[g].toString();for(y=this.executorsByZIndex_[_],v=BA.length-1;v>=0;--v)if(h=BA[v],x=y[h],x!==void 0&&(b=x.executeHitDetection(u,l,r,p,f),b))return b}},t.prototype.getClipCoords=function(e){var n=this.maxExtent_;if(!n)return null;var r=n[0],i=n[1],o=n[2],a=n[3],s=[r,i,r,a,o,a,o,i];return Bh(s,0,8,2,e,s),s},t.prototype.isEmpty=function(){return rv(this.executorsByZIndex_)},t.prototype.execute=function(e,n,r,i,o,a,s){var l=Object.keys(this.executorsByZIndex_).map(Number);l.sort(rp),this.maxExtent_&&(e.save(),this.clip(e,r));var c=a||BA,u,f,d,h,p,m;for(s&&l.reverse(),u=0,f=l.length;u<f;++u){var g=l[u].toString();for(p=this.executorsByZIndex_[g],d=0,h=c.length;d<h;++d){var v=c[d];m=p[v],m!==void 0&&m.execute(e,n,r,i,o,s)}}this.maxExtent_&&e.restore()},t}(),zA={};function vje(t){if(zA[t]!==void 0)return zA[t];for(var e=t*2+1,n=t*t,r=new Array(n+1),i=0;i<=t;++i)for(var o=0;o<=t;++o){var a=i*i+o*o;if(a>n)break;var s=r[a];s||(s=[],r[a]=s),s.push(((t+i)*e+(t+o))*4+3),i>0&&s.push(((t-i)*e+(t+o))*4+3),o>0&&(s.push(((t+i)*e+(t-o))*4+3),i>0&&s.push(((t-i)*e+(t-o))*4+3))}for(var l=[],i=0,c=r.length;i<c;++i)r[i]&&l.push.apply(l,r[i]);return zA[t]=l,l}const Hi={ANIMATING:0,INTERACTING:1};var yje=function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,i){r.__proto__=i}||function(r,i){for(var o in i)Object.prototype.hasOwnProperty.call(i,o)&&(r[o]=i[o])},t(e,n)};return function(e,n){if(typeof n!="function"&&n!==null)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");t(e,n);function r(){this.constructor=e}e.prototype=n===null?Object.create(n):(r.prototype=n.prototype,new r)}}(),xje=function(t){yje(e,t);function e(n,r,i,o,a,s,l){var c=t.call(this)||this;return c.context_=n,c.pixelRatio_=r,c.extent_=i,c.transform_=o,c.viewRotation_=a,c.squaredTolerance_=s,c.userTransform_=l,c.contextFillState_=null,c.contextStrokeState_=null,c.contextTextState_=null,c.fillState_=null,c.strokeState_=null,c.image_=null,c.imageAnchorX_=0,c.imageAnchorY_=0,c.imageHeight_=0,c.imageOpacity_=0,c.imageOriginX_=0,c.imageOriginY_=0,c.imageRotateWithView_=!1,c.imageRotation_=0,c.imageScale_=[0,0],c.imageWidth_=0,c.text_="",c.textOffsetX_=0,c.textOffsetY_=0,c.textRotateWithView_=!1,c.textRotation_=0,c.textScale_=[0,0],c.textFillState_=null,c.textStrokeState_=null,c.textState_=null,c.pixelCoordinates_=[],c.tmpLocalTransform_=Hl(),c}return e.prototype.drawImages_=function(n,r,i,o){if(this.image_){var a=Bh(n,r,i,o,this.transform_,this.pixelCoordinates_),s=this.context_,l=this.tmpLocalTransform_,c=s.globalAlpha;this.imageOpacity_!=1&&(s.globalAlpha=c*this.imageOpacity_);var u=this.imageRotation_;this.imageRotateWithView_&&(u+=this.viewRotation_);for(var f=0,d=a.length;f<d;f+=2){var h=a[f]-this.imageAnchorX_,p=a[f+1]-this.imageAnchorY_;if(u!==0||this.imageScale_[0]!=1||this.imageScale_[1]!=1){var m=h+this.imageAnchorX_,g=p+this.imageAnchorY_;hu(l,m,g,1,1,u,-m,-g),s.setTransform.apply(s,l),s.translate(m,g),s.scale(this.imageScale_[0],this.imageScale_[1]),s.drawImage(this.image_,this.imageOriginX_,this.imageOriginY_,this.imageWidth_,this.imageHeight_,-this.imageAnchorX_,-this.imageAnchorY_,this.imageWidth_,this.imageHeight_),s.setTransform(1,0,0,1,0,0)}else s.drawImage(this.image_,this.imageOriginX_,this.imageOriginY_,this.imageWidth_,this.imageHeight_,h,p,this.imageWidth_,this.imageHeight_)}this.imageOpacity_!=1&&(s.globalAlpha=c)}},e.prototype.drawText_=function(n,r,i,o){if(!(!this.textState_||this.text_==="")){this.textFillState_&&this.setContextFillState_(this.textFillState_),this.textStrokeState_&&this.setContextStrokeState_(this.textStrokeState_),this.setContextTextState_(this.textState_);var a=Bh(n,r,i,o,this.transform_,this.pixelCoordinates_),s=this.context_,l=this.textRotation_;for(this.textRotateWithView_&&(l+=this.viewRotation_);r<i;r+=o){var c=a[r]+this.textOffsetX_,u=a[r+1]+this.textOffsetY_;if(l!==0||this.textScale_[0]!=1||this.textScale_[1]!=1){var f=hu(this.tmpLocalTransform_,c,u,1,1,l,-c,-u);s.setTransform.apply(s,f),s.translate(c,u),s.scale(this.textScale_[0],this.textScale_[1]),this.textStrokeState_&&s.strokeText(this.text_,0,0),this.textFillState_&&s.fillText(this.text_,0,0),s.setTransform(1,0,0,1,0,0)}else this.textStrokeState_&&s.strokeText(this.text_,c,u),this.textFillState_&&s.fillText(this.text_,c,u)}}},e.prototype.moveToLineTo_=function(n,r,i,o,a){var s=this.context_,l=Bh(n,r,i,o,this.transform_,this.pixelCoordinates_);s.moveTo(l[0],l[1]);var c=l.length;a&&(c-=2);for(var u=2;u<c;u+=2)s.lineTo(l[u],l[u+1]);return a&&s.closePath(),i},e.prototype.drawRings_=function(n,r,i,o){for(var a=0,s=i.length;a<s;++a)r=this.moveToLineTo_(n,r,i[a],o,!0);return r},e.prototype.drawCircle=function(n){if(so(this.extent_,n.getExtent())){if(this.fillState_||this.strokeState_){this.fillState_&&this.setContextFillState_(this.fillState_),this.strokeState_&&this.setContextStrokeState_(this.strokeState_);var r=$Ne(n,this.transform_,this.pixelCoordinates_),i=r[2]-r[0],o=r[3]-r[1],a=Math.sqrt(i*i+o*o),s=this.context_;s.beginPath(),s.arc(r[0],r[1],a,0,2*Math.PI),this.fillState_&&s.fill(),this.strokeState_&&s.stroke()}this.text_!==""&&this.drawText_(n.getCenter(),0,2,2)}},e.prototype.setStyle=function(n){this.setFillStrokeStyle(n.getFill(),n.getStroke()),this.setImageStyle(n.getImage()),this.setTextStyle(n.getText())},e.prototype.setTransform=function(n){this.transform_=n},e.prototype.drawGeometry=function(n){var r=n.getType();switch(r){case"Point":this.drawPoint(n);break;case"LineString":this.drawLineString(n);break;case"Polygon":this.drawPolygon(n);break;case"MultiPoint":this.drawMultiPoint(n);break;case"MultiLineString":this.drawMultiLineString(n);break;case"MultiPolygon":this.drawMultiPolygon(n);break;case"GeometryCollection":this.drawGeometryCollection(n);break;case"Circle":this.drawCircle(n);break}},e.prototype.drawFeature=function(n,r){var i=r.getGeometryFunction()(n);!i||!so(this.extent_,i.getExtent())||(this.setStyle(r),this.drawGeometry(i))},e.prototype.drawGeometryCollection=function(n){for(var r=n.getGeometriesArray(),i=0,o=r.length;i<o;++i)this.drawGeometry(r[i])},e.prototype.drawPoint=function(n){this.squaredTolerance_&&(n=n.simplifyTransformed(this.squaredTolerance_,this.userTransform_));var r=n.getFlatCoordinates(),i=n.getStride();this.image_&&this.drawImages_(r,0,r.length,i),this.text_!==""&&this.drawText_(r,0,r.length,i)},e.prototype.drawMultiPoint=function(n){this.squaredTolerance_&&(n=n.simplifyTransformed(this.squaredTolerance_,this.userTransform_));var r=n.getFlatCoordinates(),i=n.getStride();this.image_&&this.drawImages_(r,0,r.length,i),this.text_!==""&&this.drawText_(r,0,r.length,i)},e.prototype.drawLineString=function(n){if(this.squaredTolerance_&&(n=n.simplifyTransformed(this.squaredTolerance_,this.userTransform_)),!!so(this.extent_,n.getExtent())){if(this.strokeState_){this.setContextStrokeState_(this.strokeState_);var r=this.context_,i=n.getFlatCoordinates();r.beginPath(),this.moveToLineTo_(i,0,i.length,n.getStride(),!1),r.stroke()}if(this.text_!==""){var o=n.getFlatMidpoint();this.drawText_(o,0,2,2)}}},e.prototype.drawMultiLineString=function(n){this.squaredTolerance_&&(n=n.simplifyTransformed(this.squaredTolerance_,this.userTransform_));var r=n.getExtent();if(so(this.extent_,r)){if(this.strokeState_){this.setContextStrokeState_(this.strokeState_);var i=this.context_,o=n.getFlatCoordinates(),a=0,s=n.getEnds(),l=n.getStride();i.beginPath();for(var c=0,u=s.length;c<u;++c)a=this.moveToLineTo_(o,a,s[c],l,!1);i.stroke()}if(this.text_!==""){var f=n.getFlatMidpoints();this.drawText_(f,0,f.length,2)}}},e.prototype.drawPolygon=function(n){if(this.squaredTolerance_&&(n=n.simplifyTransformed(this.squaredTolerance_,this.userTransform_)),!!so(this.extent_,n.getExtent())){if(this.strokeState_||this.fillState_){this.fillState_&&this.setContextFillState_(this.fillState_),this.strokeState_&&this.setContextStrokeState_(this.strokeState_);var r=this.context_;r.beginPath(),this.drawRings_(n.getOrientedFlatCoordinates(),0,n.getEnds(),n.getStride()),this.fillState_&&r.fill(),this.strokeState_&&r.stroke()}if(this.text_!==""){var i=n.getFlatInteriorPoint();this.drawText_(i,0,2,2)}}},e.prototype.drawMultiPolygon=function(n){if(this.squaredTolerance_&&(n=n.simplifyTransformed(this.squaredTolerance_,this.userTransform_)),!!so(this.extent_,n.getExtent())){if(this.strokeState_||this.fillState_){this.fillState_&&this.setContextFillState_(this.fillState_),this.strokeState_&&this.setContextStrokeState_(this.strokeState_);var r=this.context_,i=n.getOrientedFlatCoordinates(),o=0,a=n.getEndss(),s=n.getStride();r.beginPath();for(var l=0,c=a.length;l<c;++l){var u=a[l];o=this.drawRings_(i,o,u,s)}this.fillState_&&r.fill(),this.strokeState_&&r.stroke()}if(this.text_!==""){var f=n.getFlatInteriorPoints();this.drawText_(f,0,f.length,2)}}},e.prototype.setContextFillState_=function(n){var r=this.context_,i=this.contextFillState_;i?i.fillStyle!=n.fillStyle&&(i.fillStyle=n.fillStyle,r.fillStyle=n.fillStyle):(r.fillStyle=n.fillStyle,this.contextFillState_={fillStyle:n.fillStyle})},e.prototype.setContextStrokeState_=function(n){var r=this.context_,i=this.contextStrokeState_;i?(i.lineCap!=n.lineCap&&(i.lineCap=n.lineCap,r.lineCap=n.lineCap),r.setLineDash&&(kp(i.lineDash,n.lineDash)||r.setLineDash(i.lineDash=n.lineDash),i.lineDashOffset!=n.lineDashOffset&&(i.lineDashOffset=n.lineDashOffset,r.lineDashOffset=n.lineDashOffset)),i.lineJoin!=n.lineJoin&&(i.lineJoin=n.lineJoin,r.lineJoin=n.lineJoin),i.lineWidth!=n.lineWidth&&(i.lineWidth=n.lineWidth,r.lineWidth=n.lineWidth),i.miterLimit!=n.miterLimit&&(i.miterLimit=n.miterLimit,r.miterLimit=n.miterLimit),i.strokeStyle!=n.strokeStyle&&(i.strokeStyle=n.strokeStyle,r.strokeStyle=n.strokeStyle)):(r.lineCap=n.lineCap,r.setLineDash&&(r.setLineDash(n.lineDash),r.lineDashOffset=n.lineDashOffset),r.lineJoin=n.lineJoin,r.lineWidth=n.lineWidth,r.miterLimit=n.miterLimit,r.strokeStyle=n.strokeStyle,this.contextStrokeState_={lineCap:n.lineCap,lineDash:n.lineDash,lineDashOffset:n.lineDashOffset,lineJoin:n.lineJoin,lineWidth:n.lineWidth,miterLimit:n.miterLimit,strokeStyle:n.strokeStyle})},e.prototype.setContextTextState_=function(n){var r=this.context_,i=this.contextTextState_,o=n.textAlign?n.textAlign:qb;i?(i.font!=n.font&&(i.font=n.font,r.font=n.font),i.textAlign!=o&&(i.textAlign=o,r.textAlign=o),i.textBaseline!=n.textBaseline&&(i.textBaseline=n.textBaseline,r.textBaseline=n.textBaseline)):(r.font=n.font,r.textAlign=o,r.textBaseline=n.textBaseline,this.contextTextState_={font:n.font,textAlign:o,textBaseline:n.textBaseline})},e.prototype.setFillStrokeStyle=function(n,r){var i=this;if(!n)this.fillState_=null;else{var o=n.getColor();this.fillState_={fillStyle:Rl(o||Jc)}}if(!r)this.strokeState_=null;else{var a=r.getColor(),s=r.getLineCap(),l=r.getLineDash(),c=r.getLineDashOffset(),u=r.getLineJoin(),f=r.getWidth(),d=r.getMiterLimit(),h=l||Wb;this.strokeState_={lineCap:s!==void 0?s:GT,lineDash:this.pixelRatio_===1?h:h.map(function(p){return p*i.pixelRatio_}),lineDashOffset:(c||Vb)*this.pixelRatio_,lineJoin:u!==void 0?u:iv,lineWidth:(f!==void 0?f:Xb)*this.pixelRatio_,miterLimit:d!==void 0?d:Gb,strokeStyle:Rl(a||Hb)}}},e.prototype.setImageStyle=function(n){var r;if(!n||!(r=n.getSize())){this.image_=null;return}var i=n.getAnchor(),o=n.getOrigin();this.image_=n.getImage(this.pixelRatio_),this.imageAnchorX_=i[0]*this.pixelRatio_,this.imageAnchorY_=i[1]*this.pixelRatio_,this.imageHeight_=r[1]*this.pixelRatio_,this.imageOpacity_=n.getOpacity(),this.imageOriginX_=o[0],this.imageOriginY_=o[1],this.imageRotateWithView_=n.getRotateWithView(),this.imageRotation_=n.getRotation(),this.imageScale_=n.getScaleArray(),this.imageWidth_=r[0]*this.pixelRatio_},e.prototype.setTextStyle=function(n){if(!n)this.text_="";else{var r=n.getFill();if(!r)this.textFillState_=null;else{var i=r.getColor();this.textFillState_={fillStyle:Rl(i||Jc)}}var o=n.getStroke();if(!o)this.textStrokeState_=null;else{var a=o.getColor(),s=o.getLineCap(),l=o.getLineDash(),c=o.getLineDashOffset(),u=o.getLineJoin(),f=o.getWidth(),d=o.getMiterLimit();this.textStrokeState_={lineCap:s!==void 0?s:GT,lineDash:l||Wb,lineDashOffset:c||Vb,lineJoin:u!==void 0?u:iv,lineWidth:f!==void 0?f:Xb,miterLimit:d!==void 0?d:Gb,strokeStyle:Rl(a||Hb)}}var h=n.getFont(),p=n.getOffsetX(),m=n.getOffsetY(),g=n.getRotateWithView(),v=n.getRotation(),y=n.getScaleArray(),x=n.getText(),b=n.getTextAlign(),_=n.getTextBaseline();this.textState_={font:h!==void 0?h:Coe,textAlign:b!==void 0?b:qb,textBaseline:_!==void 0?_:HT},this.text_=x!==void 0?Array.isArray(x)?x.reduce(function(S,O,C){return S+=C%2?" ":O},""):x:"",this.textOffsetX_=p!==void 0?this.pixelRatio_*p:0,this.textOffsetY_=m!==void 0?this.pixelRatio_*m:0,this.textRotateWithView_=g!==void 0?g:!1,this.textRotation_=v!==void 0?v:0,this.textScale_=[this.pixelRatio_*y[0],this.pixelRatio_*y[1]]}},e}(koe);const sf={FRACTION:"fraction",PIXELS:"pixels"},Ra={BOTTOM_LEFT:"bottom-left",BOTTOM_RIGHT:"bottom-right",TOP_LEFT:"top-left",TOP_RIGHT:"top-right"};var bje=function(){function t(){this.cache_={},this.cacheSize_=0,this.maxCacheSize_=32}return t.prototype.clear=function(){this.cache_={},this.cacheSize_=0},t.prototype.canExpireCache=function(){return this.cacheSize_>this.maxCacheSize_},t.prototype.expire=function(){if(this.canExpireCache()){var e=0;for(var n in this.cache_){var r=this.cache_[n];!(e++&3)&&!r.hasListener()&&(delete this.cache_[n],--this.cacheSize_)}}},t.prototype.get=function(e,n,r){var i=XG(e,n,r);return i in this.cache_?this.cache_[i]:null},t.prototype.set=function(e,n,r,i){var o=XG(e,n,r);this.cache_[o]=i,++this.cacheSize_},t.prototype.setSize=function(e){this.maxCacheSize_=e,this.expire()},t}();function XG(t,e,n){var r=n?_oe(n):"null";return e+":"+t+":"+r}var QT=new bje,_je=function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,i){r.__proto__=i}||function(r,i){for(var o in i)Object.prototype.hasOwnProperty.call(i,o)&&(r[o]=i[o])},t(e,n)};return function(e,n){if(typeof n!="function"&&n!==null)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");t(e,n);function r(){this.constructor=e}e.prototype=n===null?Object.create(n):(r.prototype=n.prototype,new r)}}(),wje=function(t){_je(e,t);function e(n,r,i,o){var a=t.call(this)||this;return a.extent=n,a.pixelRatio_=i,a.resolution=r,a.state=o,a}return e.prototype.changed=function(){this.dispatchEvent(Mt.CHANGE)},e.prototype.getExtent=function(){return this.extent},e.prototype.getImage=function(){return yt()},e.prototype.getPixelRatio=function(){return this.pixelRatio_},e.prototype.getResolution=function(){return this.resolution},e.prototype.getState=function(){return this.state},e.prototype.load=function(){yt()},e}(oy),Sje=function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,i){r.__proto__=i}||function(r,i){for(var o in i)Object.prototype.hasOwnProperty.call(i,o)&&(r[o]=i[o])},t(e,n)};return function(e,n){if(typeof n!="function"&&n!==null)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");t(e,n);function r(){this.constructor=e}e.prototype=n===null?Object.create(n):(r.prototype=n.prototype,new r)}}();(function(t){Sje(e,t);function e(n,r,i,o,a,s){var l=t.call(this,n,r,i,Wn.IDLE)||this;return l.src_=o,l.image_=new Image,a!==null&&(l.image_.crossOrigin=a),l.unlisten_=null,l.state=Wn.IDLE,l.imageLoadFunction_=s,l}return e.prototype.getImage=function(){return this.image_},e.prototype.handleImageError_=function(){this.state=Wn.ERROR,this.unlistenImage_(),this.changed()},e.prototype.handleImageLoad_=function(){this.resolution===void 0&&(this.resolution=ps(this.extent)/this.image_.height),this.state=Wn.LOADED,this.unlistenImage_(),this.changed()},e.prototype.load=function(){(this.state==Wn.IDLE||this.state==Wn.ERROR)&&(this.state=Wn.LOADING,this.changed(),this.imageLoadFunction_(this,this.src_),this.unlisten_=OB(this.image_,this.handleImageLoad_.bind(this),this.handleImageError_.bind(this)))},e.prototype.setImage=function(n){this.image_=n,this.resolution=ps(this.extent)/this.image_.height},e.prototype.unlistenImage_=function(){this.unlisten_&&(this.unlisten_(),this.unlisten_=null)},e})(wje);function OB(t,e,n){var r=t,i=!0,o=!1,a=!1,s=[LT(r,Mt.LOAD,function(){a=!0,o||e()})];return r.src&&W3e?(o=!0,r.decode().then(function(){i&&e()}).catch(function(l){i&&(a?e():n())})):s.push(LT(r,Mt.ERROR,n)),function(){i=!1,s.forEach(nr)}}var Oje=function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,i){r.__proto__=i}||function(r,i){for(var o in i)Object.prototype.hasOwnProperty.call(i,o)&&(r[o]=i[o])},t(e,n)};return function(e,n){if(typeof n!="function"&&n!==null)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");t(e,n);function r(){this.constructor=e}e.prototype=n===null?Object.create(n):(r.prototype=n.prototype,new r)}}(),_0=null,Cje=function(t){Oje(e,t);function e(n,r,i,o,a,s){var l=t.call(this)||this;return l.hitDetectionImage_=null,l.image_=n||new Image,o!==null&&(l.image_.crossOrigin=o),l.canvas_={},l.color_=s,l.unlisten_=null,l.imageState_=a,l.size_=i,l.src_=r,l.tainted_,l}return e.prototype.isTainted_=function(){if(this.tainted_===void 0&&this.imageState_===Wn.LOADED){_0||(_0=Ca(1,1)),_0.drawImage(this.image_,0,0);try{_0.getImageData(0,0,1,1),this.tainted_=!1}catch{_0=null,this.tainted_=!0}}return this.tainted_===!0},e.prototype.dispatchChangeEvent_=function(){this.dispatchEvent(Mt.CHANGE)},e.prototype.handleImageError_=function(){this.imageState_=Wn.ERROR,this.unlistenImage_(),this.dispatchChangeEvent_()},e.prototype.handleImageLoad_=function(){this.imageState_=Wn.LOADED,this.size_?(this.image_.width=this.size_[0],this.image_.height=this.size_[1]):this.size_=[this.image_.width,this.image_.height],this.unlistenImage_(),this.dispatchChangeEvent_()},e.prototype.getImage=function(n){return this.replaceColor_(n),this.canvas_[n]?this.canvas_[n]:this.image_},e.prototype.getPixelRatio=function(n){return this.replaceColor_(n),this.canvas_[n]?n:1},e.prototype.getImageState=function(){return this.imageState_},e.prototype.getHitDetectionImage=function(){if(!this.hitDetectionImage_)if(this.isTainted_()){var n=this.size_[0],r=this.size_[1],i=Ca(n,r);i.fillRect(0,0,n,r),this.hitDetectionImage_=i.canvas}else this.hitDetectionImage_=this.image_;return this.hitDetectionImage_},e.prototype.getSize=function(){return this.size_},e.prototype.getSrc=function(){return this.src_},e.prototype.load=function(){if(this.imageState_==Wn.IDLE){this.imageState_=Wn.LOADING;try{this.image_.src=this.src_}catch{this.handleImageError_()}this.unlisten_=OB(this.image_,this.handleImageLoad_.bind(this),this.handleImageError_.bind(this))}},e.prototype.replaceColor_=function(n){if(!(!this.color_||this.canvas_[n]||this.imageState_!==Wn.LOADED)){var r=document.createElement("canvas");this.canvas_[n]=r,r.width=Math.ceil(this.image_.width*n),r.height=Math.ceil(this.image_.height*n);var i=r.getContext("2d");if(i.scale(n,n),i.drawImage(this.image_,0,0),i.globalCompositeOperation="multiply",i.globalCompositeOperation==="multiply"||this.isTainted_())i.fillStyle=_oe(this.color_),i.fillRect(0,0,r.width/n,r.height/n),i.globalCompositeOperation="destination-in",i.drawImage(this.image_,0,0);else{for(var o=i.getImageData(0,0,r.width,r.height),a=o.data,s=this.color_[0]/255,l=this.color_[1]/255,c=this.color_[2]/255,u=this.color_[3],f=0,d=a.length;f<d;f+=4)a[f]*=s,a[f+1]*=l,a[f+2]*=c,a[f+3]*=u;i.putImageData(o,0,0)}}},e.prototype.unlistenImage_=function(){this.unlisten_&&(this.unlisten_(),this.unlisten_=null)},e}(oy);function Tje(t,e,n,r,i,o){var a=QT.get(e,r,o);return a||(a=new Cje(t,e,n,r,i,o),QT.set(e,r,o,a)),a}var Eje=function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,i){r.__proto__=i}||function(r,i){for(var o in i)Object.prototype.hasOwnProperty.call(i,o)&&(r[o]=i[o])},t(e,n)};return function(e,n){if(typeof n!="function"&&n!==null)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");t(e,n);function r(){this.constructor=e}e.prototype=n===null?Object.create(n):(r.prototype=n.prototype,new r)}}(),Pje=function(t){Eje(e,t);function e(n){var r=this,i=n||{},o=i.opacity!==void 0?i.opacity:1,a=i.rotation!==void 0?i.rotation:0,s=i.scale!==void 0?i.scale:1,l=i.rotateWithView!==void 0?i.rotateWithView:!1;r=t.call(this,{opacity:o,rotation:a,scale:s,displacement:i.displacement!==void 0?i.displacement:[0,0],rotateWithView:l,declutterMode:i.declutterMode})||this,r.anchor_=i.anchor!==void 0?i.anchor:[.5,.5],r.normalizedAnchor_=null,r.anchorOrigin_=i.anchorOrigin!==void 0?i.anchorOrigin:Ra.TOP_LEFT,r.anchorXUnits_=i.anchorXUnits!==void 0?i.anchorXUnits:sf.FRACTION,r.anchorYUnits_=i.anchorYUnits!==void 0?i.anchorYUnits:sf.FRACTION,r.crossOrigin_=i.crossOrigin!==void 0?i.crossOrigin:null;var c=i.img!==void 0?i.img:null;r.imgSize_=i.imgSize;var u=i.src;Ut(!(u!==void 0&&c),4),Ut(!c||c&&r.imgSize_,5),(u===void 0||u.length===0)&&c&&(u=c.src||vn(c)),Ut(u!==void 0&&u.length>0,6);var f=i.src!==void 0?Wn.IDLE:Wn.LOADED;return r.color_=i.color!==void 0?VT(i.color):null,r.iconImage_=Tje(c,u,r.imgSize_!==void 0?r.imgSize_:null,r.crossOrigin_,f,r.color_),r.offset_=i.offset!==void 0?i.offset:[0,0],r.offsetOrigin_=i.offsetOrigin!==void 0?i.offsetOrigin:Ra.TOP_LEFT,r.origin_=null,r.size_=i.size!==void 0?i.size:null,r}return e.prototype.clone=function(){var n=this.getScale();return new e({anchor:this.anchor_.slice(),anchorOrigin:this.anchorOrigin_,anchorXUnits:this.anchorXUnits_,anchorYUnits:this.anchorYUnits_,color:this.color_&&this.color_.slice?this.color_.slice():this.color_||void 0,crossOrigin:this.crossOrigin_,imgSize:this.imgSize_,offset:this.offset_.slice(),offsetOrigin:this.offsetOrigin_,opacity:this.getOpacity(),rotateWithView:this.getRotateWithView(),rotation:this.getRotation(),scale:Array.isArray(n)?n.slice():n,size:this.size_!==null?this.size_.slice():void 0,src:this.getSrc(),displacement:this.getDisplacement().slice(),declutterMode:this.getDeclutterMode()})},e.prototype.getAnchor=function(){var n=this.normalizedAnchor_;if(!n){n=this.anchor_;var r=this.getSize();if(this.anchorXUnits_==sf.FRACTION||this.anchorYUnits_==sf.FRACTION){if(!r)return null;n=this.anchor_.slice(),this.anchorXUnits_==sf.FRACTION&&(n[0]*=r[0]),this.anchorYUnits_==sf.FRACTION&&(n[1]*=r[1])}if(this.anchorOrigin_!=Ra.TOP_LEFT){if(!r)return null;n===this.anchor_&&(n=this.anchor_.slice()),(this.anchorOrigin_==Ra.TOP_RIGHT||this.anchorOrigin_==Ra.BOTTOM_RIGHT)&&(n[0]=-n[0]+r[0]),(this.anchorOrigin_==Ra.BOTTOM_LEFT||this.anchorOrigin_==Ra.BOTTOM_RIGHT)&&(n[1]=-n[1]+r[1])}this.normalizedAnchor_=n}var i=this.getDisplacement();return[n[0]-i[0],n[1]+i[1]]},e.prototype.setAnchor=function(n){this.anchor_=n,this.normalizedAnchor_=null},e.prototype.getColor=function(){return this.color_},e.prototype.getImage=function(n){return this.iconImage_.getImage(n)},e.prototype.getPixelRatio=function(n){return this.iconImage_.getPixelRatio(n)},e.prototype.getImageSize=function(){return this.iconImage_.getSize()},e.prototype.getImageState=function(){return this.iconImage_.getImageState()},e.prototype.getHitDetectionImage=function(){return this.iconImage_.getHitDetectionImage()},e.prototype.getOrigin=function(){if(this.origin_)return this.origin_;var n=this.offset_;if(this.offsetOrigin_!=Ra.TOP_LEFT){var r=this.getSize(),i=this.iconImage_.getSize();if(!r||!i)return null;n=n.slice(),(this.offsetOrigin_==Ra.TOP_RIGHT||this.offsetOrigin_==Ra.BOTTOM_RIGHT)&&(n[0]=i[0]-r[0]-n[0]),(this.offsetOrigin_==Ra.BOTTOM_LEFT||this.offsetOrigin_==Ra.BOTTOM_RIGHT)&&(n[1]=i[1]-r[1]-n[1])}return this.origin_=n,this.origin_},e.prototype.getSrc=function(){return this.iconImage_.getSrc()},e.prototype.getSize=function(){return this.size_?this.size_:this.iconImage_.getSize()},e.prototype.listenImageChange=function(n){this.iconImage_.addEventListener(Mt.CHANGE,n)},e.prototype.load=function(){this.iconImage_.load()},e.prototype.unlistenImageChange=function(n){this.iconImage_.removeEventListener(Mt.CHANGE,n)},e}(boe),wl=.5;function Mje(t,e,n,r,i,o,a){var s=t[0]*wl,l=t[1]*wl,c=Ca(s,l);c.imageSmoothingEnabled=!1;for(var u=c.canvas,f=new xje(c,wl,i,null,a),d=n.length,h=Math.floor((256*256*256-1)/d),p={},m=1;m<=d;++m){var g=n[m-1],v=g.getStyleFunction()||r;if(r){var y=v(g,o);if(y){Array.isArray(y)||(y=[y]);for(var x=m*h,b="#"+("000000"+x.toString(16)).slice(-6),_=0,S=y.length;_<S;++_){var O=y[_],C=O.getGeometryFunction()(g);if(!(!C||!so(i,C.getExtent()))){var E=O.clone(),k=E.getFill();k&&k.setColor(b);var I=E.getStroke();I&&(I.setColor(b),I.setLineDash(null)),E.setText(void 0);var P=O.getImage();if(P&&P.getOpacity()!==0){var R=P.getImageSize();if(!R)continue;var T=Ca(R[0],R[1],void 0,{alpha:!1}),L=T.canvas;T.fillStyle=b,T.fillRect(0,0,L.width,L.height),E.setImage(new Pje({img:L,imgSize:R,anchor:P.getAnchor(),anchorXUnits:sf.PIXELS,anchorYUnits:sf.PIXELS,offset:P.getOrigin(),opacity:1,size:P.getSize(),scale:P.getScale(),rotation:P.getRotation(),rotateWithView:P.getRotateWithView()}))}var z=E.getZIndex()||0,B=p[z];B||(B={},p[z]=B,B.Polygon=[],B.Circle=[],B.LineString=[],B.Point=[]),B[C.getType().replace("Multi","")].push(C,E)}}}}}for(var U=Object.keys(p).map(Number).sort(rp),m=0,W=U.length;m<W;++m){var B=p[U[m]];for(var $ in B)for(var N=B[$],_=0,S=N.length;_<S;_+=2){f.setStyle(N[_+1]);for(var D=0,A=e.length;D<A;++D)f.setTransform(e[D]),f.drawGeometry(N[_])}}return c.getImageData(0,0,u.width,u.height)}function kje(t,e,n){var r=[];if(n){var i=Math.floor(Math.round(t[0])*wl),o=Math.floor(Math.round(t[1])*wl),a=(Br(i,0,n.width-1)+Br(o,0,n.height-1)*n.width)*4,s=n.data[a],l=n.data[a+1],c=n.data[a+2],u=c+256*(l+256*s),f=Math.floor((256*256*256-1)/e.length);u&&u%f===0&&r.push(e[u/f-1])}return r}var Aje=.5,Ioe={Point:Bje,LineString:$je,Polygon:Uje,MultiPoint:zje,MultiLineString:Fje,MultiPolygon:jje,GeometryCollection:Nje,Circle:Dje};function Rje(t,e){return parseInt(vn(t),10)-parseInt(vn(e),10)}function Ije(t,e){var n=d3(t,e);return n*n}function d3(t,e){return Aje*t/e}function Dje(t,e,n,r,i){var o=n.getFill(),a=n.getStroke();if(o||a){var s=t.getBuilder(n.getZIndex(),"Circle");s.setFillStrokeStyle(o,a),s.drawCircle(e,r)}var l=n.getText();if(l&&l.getText()){var c=(i||t).getBuilder(n.getZIndex(),"Text");c.setTextStyle(l),c.drawText(e,r)}}function QG(t,e,n,r,i,o,a){var s=!1,l=n.getImage();if(l){var c=l.getImageState();c==Wn.LOADED||c==Wn.ERROR?l.unlistenImageChange(i):(c==Wn.IDLE&&l.load(),l.listenImageChange(i),s=!0)}return Lje(t,e,n,r,o,a),s}function Lje(t,e,n,r,i,o){var a=n.getGeometryFunction()(e);if(a){var s=a.simplifyTransformed(r,i),l=n.getRenderer();if(l)Doe(t,s,n,e);else{var c=Ioe[s.getType()];c(t,s,n,e,o)}}}function Doe(t,e,n,r){if(e.getType()=="GeometryCollection"){for(var i=e.getGeometries(),o=0,a=i.length;o<a;++o)Doe(t,i[o],n,r);return}var s=t.getBuilder(n.getZIndex(),"Default");s.drawCustom(e,r,n.getRenderer(),n.getHitDetectionRenderer())}function Nje(t,e,n,r,i){var o=e.getGeometriesArray(),a,s;for(a=0,s=o.length;a<s;++a){var l=Ioe[o[a].getType()];l(t,o[a],n,r,i)}}function $je(t,e,n,r,i){var o=n.getStroke();if(o){var a=t.getBuilder(n.getZIndex(),"LineString");a.setFillStrokeStyle(null,o),a.drawLineString(e,r)}var s=n.getText();if(s&&s.getText()){var l=(i||t).getBuilder(n.getZIndex(),"Text");l.setTextStyle(s),l.drawText(e,r)}}function Fje(t,e,n,r,i){var o=n.getStroke();if(o){var a=t.getBuilder(n.getZIndex(),"LineString");a.setFillStrokeStyle(null,o),a.drawMultiLineString(e,r)}var s=n.getText();if(s&&s.getText()){var l=(i||t).getBuilder(n.getZIndex(),"Text");l.setTextStyle(s),l.drawText(e,r)}}function jje(t,e,n,r,i){var o=n.getFill(),a=n.getStroke();if(a||o){var s=t.getBuilder(n.getZIndex(),"Polygon");s.setFillStrokeStyle(o,a),s.drawMultiPolygon(e,r)}var l=n.getText();if(l&&l.getText()){var c=(i||t).getBuilder(n.getZIndex(),"Text");c.setTextStyle(l),c.drawText(e,r)}}function Bje(t,e,n,r,i){var o=n.getImage(),a=n.getText(),s;if(o){if(o.getImageState()!=Wn.LOADED)return;var l=t;if(i){var c=o.getDeclutterMode();if(c!=="none")if(l=i,c==="obstacle"){var u=t.getBuilder(n.getZIndex(),"Image");u.setImageStyle(o,s),u.drawPoint(e,r)}else a&&a.getText()&&(s={})}var f=l.getBuilder(n.getZIndex(),"Image");f.setImageStyle(o,s),f.drawPoint(e,r)}if(a&&a.getText()){var d=t;i&&(d=i);var h=d.getBuilder(n.getZIndex(),"Text");h.setTextStyle(a,s),h.drawText(e,r)}}function zje(t,e,n,r,i){var o=n.getImage(),a=n.getText(),s;if(o){if(o.getImageState()!=Wn.LOADED)return;var l=t;if(i){var c=o.getDeclutterMode();if(c!=="none")if(l=i,c==="obstacle"){var u=t.getBuilder(n.getZIndex(),"Image");u.setImageStyle(o,s),u.drawMultiPoint(e,r)}else a&&a.getText()&&(s={})}var f=l.getBuilder(n.getZIndex(),"Image");f.setImageStyle(o,s),f.drawMultiPoint(e,r)}if(a&&a.getText()){var d=t;i&&(d=i);var h=d.getBuilder(n.getZIndex(),"Text");h.setTextStyle(a,s),h.drawText(e,r)}}function Uje(t,e,n,r,i){var o=n.getFill(),a=n.getStroke();if(o||a){var s=t.getBuilder(n.getZIndex(),"Polygon");s.setFillStrokeStyle(o,a),s.drawPolygon(e,r)}var l=n.getText();if(l&&l.getText()){var c=(i||t).getBuilder(n.getZIndex(),"Text");c.setTextStyle(l),c.drawText(e,r)}}var Wje=function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,i){r.__proto__=i}||function(r,i){for(var o in i)Object.prototype.hasOwnProperty.call(i,o)&&(r[o]=i[o])},t(e,n)};return function(e,n){if(typeof n!="function"&&n!==null)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");t(e,n);function r(){this.constructor=e}e.prototype=n===null?Object.create(n):(r.prototype=n.prototype,new r)}}(),Vje=function(t){Wje(e,t);function e(n){var r=t.call(this,n)||this;return r.boundHandleStyleImageChange_=r.handleStyleImageChange_.bind(r),r.animatingOrInteracting_,r.hitDetectionImageData_=null,r.renderedFeatures_=null,r.renderedRevision_=-1,r.renderedResolution_=NaN,r.renderedExtent_=Oa(),r.wrappedRenderedExtent_=Oa(),r.renderedRotation_,r.renderedCenter_=null,r.renderedProjection_=null,r.renderedRenderOrder_=null,r.replayGroup_=null,r.replayGroupChanged=!0,r.declutterExecutorGroup=null,r.clipping=!0,r.compositionContext_=null,r.opacity_=1,r}return e.prototype.renderWorlds=function(n,r,i){var o=r.extent,a=r.viewState,s=a.center,l=a.resolution,c=a.projection,u=a.rotation,f=c.getExtent(),d=this.getLayer().getSource(),h=r.pixelRatio,p=r.viewHints,m=!(p[Hi.ANIMATING]||p[Hi.INTERACTING]),g=this.compositionContext_,v=Math.round(r.size[0]*h),y=Math.round(r.size[1]*h),x=d.getWrapX()&&c.canWrapX(),b=x?Kn(f):null,_=x?Math.ceil((o[2]-f[2])/b)+1:1,S=x?Math.floor((o[0]-f[0])/b):0;do{var O=this.getRenderTransform(s,l,u,h,v,y,S*b);n.execute(g,1,O,u,m,void 0,i)}while(++S<_)},e.prototype.setupCompositionContext_=function(){if(this.opacity_!==1){var n=Ca(this.context.canvas.width,this.context.canvas.height,VG);this.compositionContext_=n}else this.compositionContext_=this.context},e.prototype.releaseCompositionContext_=function(){if(this.opacity_!==1){var n=this.context.globalAlpha;this.context.globalAlpha=this.opacity_,this.context.drawImage(this.compositionContext_.canvas,0,0),this.context.globalAlpha=n,Soe(this.compositionContext_),VG.push(this.compositionContext_.canvas),this.compositionContext_=null}},e.prototype.renderDeclutter=function(n){this.declutterExecutorGroup&&(this.setupCompositionContext_(),this.renderWorlds(this.declutterExecutorGroup,n,n.declutterTree),this.releaseCompositionContext_())},e.prototype.renderFrame=function(n,r){var i=n.pixelRatio,o=n.layerStatesArray[n.layerIndex];H3e(this.pixelTransform,1/i,1/i),Q5(this.inversePixelTransform,this.pixelTransform);var a=Aie(this.pixelTransform);this.useContainer(r,a,this.getBackground(n));var s=this.context,l=s.canvas,c=this.replayGroup_,u=this.declutterExecutorGroup;if((!c||c.isEmpty())&&(!u||u.isEmpty()))return null;var f=Math.round(n.size[0]*i),d=Math.round(n.size[1]*i);l.width!=f||l.height!=d?(l.width=f,l.height=d,l.style.transform!==a&&(l.style.transform=a)):this.containerReused||s.clearRect(0,0,f,d),this.preRender(s,n);var h=n.viewState;h.projection,this.opacity_=o.opacity,this.setupCompositionContext_();var p=!1,m=!0;if(o.extent&&this.clipping){var g=xh(o.extent);m=so(g,n.extent),p=m&&!eg(g,n.extent),p&&this.clipUnrotated(this.compositionContext_,n,g)}return m&&this.renderWorlds(c,n),p&&this.compositionContext_.restore(),this.releaseCompositionContext_(),this.postRender(s,n),this.renderedRotation_!==h.rotation&&(this.renderedRotation_=h.rotation,this.hitDetectionImageData_=null),this.container},e.prototype.getFeatures=function(n){return new Promise((function(r){if(!this.hitDetectionImageData_&&!this.animatingOrInteracting_){var i=[this.context.canvas.width,this.context.canvas.height];Cr(this.pixelTransform,i);var o=this.renderedCenter_,a=this.renderedResolution_,s=this.renderedRotation_,l=this.renderedProjection_,c=this.wrappedRenderedExtent_,u=this.getLayer(),f=[],d=i[0]*wl,h=i[1]*wl;f.push(this.getRenderTransform(o,a,s,wl,d,h,0).slice());var p=u.getSource(),m=l.getExtent();if(p.getWrapX()&&l.canWrapX()&&!eg(m,c)){for(var g=c[0],v=Kn(m),y=0,x=void 0;g<m[0];)--y,x=v*y,f.push(this.getRenderTransform(o,a,s,wl,d,h,x).slice()),g+=v;for(y=0,g=c[2];g>m[2];)++y,x=v*y,f.push(this.getRenderTransform(o,a,s,wl,d,h,x).slice()),g-=v}this.hitDetectionImageData_=Mje(i,f,this.renderedFeatures_,u.getStyleFunction(),c,a,s)}r(kje(n,this.renderedFeatures_,this.hitDetectionImageData_))}).bind(this))},e.prototype.forEachFeatureAtCoordinate=function(n,r,i,o,a){var s=this;if(this.replayGroup_){var l=r.viewState.resolution,c=r.viewState.rotation,u=this.getLayer(),f={},d=function(m,g,v){var y=vn(m),x=f[y];if(x){if(x!==!0&&v<x.distanceSq){if(v===0)return f[y]=!0,a.splice(a.lastIndexOf(x),1),o(m,u,g);x.geometry=g,x.distanceSq=v}}else{if(v===0)return f[y]=!0,o(m,u,g);a.push(f[y]={feature:m,layer:u,geometry:g,distanceSq:v,callback:o})}},h,p=[this.replayGroup_];return this.declutterExecutorGroup&&p.push(this.declutterExecutorGroup),p.some(function(m){return h=m.forEachFeatureAtCoordinate(n,l,c,i,d,m===s.declutterExecutorGroup&&r.declutterTree?r.declutterTree.all().map(function(g){return g.value}):null)}),h}},e.prototype.handleFontsChanged=function(){var n=this.getLayer();n.getVisible()&&this.replayGroup_&&n.changed()},e.prototype.handleStyleImageChange_=function(n){this.renderIfReadyAndVisible()},e.prototype.prepareFrame=function(n){var r=this.getLayer(),i=r.getSource();if(!i)return!1;var o=n.viewHints[Hi.ANIMATING],a=n.viewHints[Hi.INTERACTING],s=r.getUpdateWhileAnimating(),l=r.getUpdateWhileInteracting();if(this.ready&&!s&&o||!l&&a)return this.animatingOrInteracting_=!0,!0;this.animatingOrInteracting_=!1;var c=n.extent,u=n.viewState,f=u.projection,d=u.resolution,h=n.pixelRatio,p=r.getRevision(),m=r.getRenderBuffer(),g=r.getRenderOrder();g===void 0&&(g=Rje);var v=u.center.slice(),y=Fb(c,m*d),x=y.slice(),b=[y.slice()],_=f.getExtent();if(i.getWrapX()&&f.canWrapX()&&!eg(_,n.extent)){var S=Kn(_),O=Math.max(Kn(y)/2,S);y[0]=_[0]-O,y[2]=_[2]+O,jie(v,f);var C=Nie(b[0],f);C[0]<_[0]&&C[2]<_[2]?b.push([C[0]+S,C[1],C[2]+S,C[3]]):C[0]>_[0]&&C[2]>_[2]&&b.push([C[0]-S,C[1],C[2]-S,C[3]])}if(this.ready&&this.renderedResolution_==d&&this.renderedRevision_==p&&this.renderedRenderOrder_==g&&eg(this.wrappedRenderedExtent_,y))return kp(this.renderedExtent_,x)||(this.hitDetectionImageData_=null,this.renderedExtent_=x),this.renderedCenter_=v,this.replayGroupChanged=!1,!0;this.replayGroup_=null;var E=new WG(d3(d,h),y,d,h),k;this.getLayer().getDeclutter()&&(k=new WG(d3(d,h),y,d,h));for(var I,P,R,P=0,R=b.length;P<R;++P)i.loadFeatures(b[P],d,f);var T=Ije(d,h),L=!0,z=(function(N){var D,A=N.getStyleFunction()||r.getStyleFunction();if(A&&(D=A(N,d)),D){var q=this.renderFeature(N,T,D,E,I,k);L=L&&!q}}).bind(this),B=Uie(y),U=i.getFeaturesInExtent(B);g&&U.sort(g);for(var P=0,R=U.length;P<R;++P)z(U[P]);this.renderedFeatures_=U,this.ready=L;var W=E.finish(),$=new qG(y,d,h,i.getOverlaps(),W,r.getRenderBuffer());return k&&(this.declutterExecutorGroup=new qG(y,d,h,i.getOverlaps(),k.finish(),r.getRenderBuffer())),this.renderedResolution_=d,this.renderedRevision_=p,this.renderedRenderOrder_=g,this.renderedExtent_=x,this.wrappedRenderedExtent_=y,this.renderedCenter_=v,this.renderedProjection_=f,this.replayGroup_=$,this.hitDetectionImageData_=null,this.replayGroupChanged=!0,!0},e.prototype.renderFeature=function(n,r,i,o,a,s){if(!i)return!1;var l=!1;if(Array.isArray(i))for(var c=0,u=i.length;c<u;++c)l=QG(o,n,i[c],r,this.boundHandleStyleImageChange_,a,s)||l;else l=QG(o,n,i,r,this.boundHandleStyleImageChange_,a,s);return l},e}(Roe),Gje=function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,i){r.__proto__=i}||function(r,i){for(var o in i)Object.prototype.hasOwnProperty.call(i,o)&&(r[o]=i[o])},t(e,n)};return function(e,n){if(typeof n!="function"&&n!==null)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");t(e,n);function r(){this.constructor=e}e.prototype=n===null?Object.create(n):(r.prototype=n.prototype,new r)}}(),h2=function(t){Gje(e,t);function e(n){return t.call(this,n)||this}return e.prototype.createRenderer=function(){return new Vje(this)},e}(KFe),YG=function(){function t(e){this.rbush_=new Moe(e),this.items_={}}return t.prototype.insert=function(e,n){var r={minX:e[0],minY:e[1],maxX:e[2],maxY:e[3],value:n};this.rbush_.insert(r),this.items_[vn(n)]=r},t.prototype.load=function(e,n){for(var r=new Array(n.length),i=0,o=n.length;i<o;i++){var a=e[i],s=n[i],l={minX:a[0],minY:a[1],maxX:a[2],maxY:a[3],value:s};r[i]=l,this.items_[vn(s)]=l}this.rbush_.load(r)},t.prototype.remove=function(e){var n=vn(e),r=this.items_[n];return delete this.items_[n],this.rbush_.remove(r)!==null},t.prototype.update=function(e,n){var r=this.items_[vn(n)],i=[r.minX,r.minY,r.maxX,r.maxY];jb(i,e)||(this.remove(n),this.insert(e,n))},t.prototype.getAll=function(){var e=this.rbush_.all();return e.map(function(n){return n.value})},t.prototype.getInExtent=function(e){var n={minX:e[0],minY:e[1],maxX:e[2],maxY:e[3]},r=this.rbush_.search(n);return r.map(function(i){return i.value})},t.prototype.forEach=function(e){return this.forEach_(this.getAll(),e)},t.prototype.forEachInExtent=function(e,n){return this.forEach_(this.getInExtent(e),n)},t.prototype.forEach_=function(e,n){for(var r,i=0,o=e.length;i<o;i++)if(r=n(e[i]),r)return r;return r},t.prototype.isEmpty=function(){return rv(this.items_)},t.prototype.clear=function(){this.rbush_.clear(),this.items_={}},t.prototype.getExtent=function(e){var n=this.rbush_.toJSON();return Zs(n.minX,n.minY,n.maxX,n.maxY,e)},t.prototype.concat=function(e){this.rbush_.load(e.rbush_.all());for(var n in e.items_)this.items_[n]=e.items_[n]},t}(),Hje=function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,i){r.__proto__=i}||function(r,i){for(var o in i)Object.prototype.hasOwnProperty.call(i,o)&&(r[o]=i[o])},t(e,n)};return function(e,n){if(typeof n!="function"&&n!==null)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");t(e,n);function r(){this.constructor=e}e.prototype=n===null?Object.create(n):(r.prototype=n.prototype,new r)}}(),Loe=function(t){Hje(e,t);function e(n){var r=t.call(this)||this;r.projection=zr(n.projection),r.attributions_=KG(n.attributions),r.attributionsCollapsible_=n.attributionsCollapsible!==void 0?n.attributionsCollapsible:!0,r.loading=!1,r.state_=n.state!==void 0?n.state:"ready",r.wrapX_=n.wrapX!==void 0?n.wrapX:!1,r.interpolate_=!!n.interpolate,r.viewResolver=null,r.viewRejector=null;var i=r;return r.viewPromise_=new Promise(function(o,a){i.viewResolver=o,i.viewRejector=a}),r}return e.prototype.getAttributions=function(){return this.attributions_},e.prototype.getAttributionsCollapsible=function(){return this.attributionsCollapsible_},e.prototype.getProjection=function(){return this.projection},e.prototype.getResolutions=function(){return yt()},e.prototype.getView=function(){return this.viewPromise_},e.prototype.getState=function(){return this.state_},e.prototype.getWrapX=function(){return this.wrapX_},e.prototype.getInterpolate=function(){return this.interpolate_},e.prototype.refresh=function(){this.changed()},e.prototype.setAttributions=function(n){this.attributions_=KG(n),this.changed()},e.prototype.setState=function(n){this.state_=n,this.changed()},e}(sc);function KG(t){return t?Array.isArray(t)?function(e){return t}:typeof t=="function"?t:function(e){return[t]}:null}const Ps={ADDFEATURE:"addfeature",CHANGEFEATURE:"changefeature",CLEAR:"clear",REMOVEFEATURE:"removefeature",FEATURESLOADSTART:"featuresloadstart",FEATURESLOADEND:"featuresloadend",FEATURESLOADERROR:"featuresloaderror"};function qje(t,e){return[[-1/0,-1/0,1/0,1/0]]}var Xje=!1;function Qje(t,e,n,r,i,o,a){var s=new XMLHttpRequest;s.open("GET",typeof t=="function"?t(n,r,i):t,!0),e.getType()=="arraybuffer"&&(s.responseType="arraybuffer"),s.withCredentials=Xje,s.onload=function(l){if(!s.status||s.status>=200&&s.status<300){var c=e.getType(),u=void 0;c=="json"||c=="text"?u=s.responseText:c=="xml"?(u=s.responseXML,u||(u=new DOMParser().parseFromString(s.responseText,"application/xml"))):c=="arraybuffer"&&(u=s.response),u?o(e.readFeatures(u,{extent:n,featureProjection:i}),e.readProjection(u)):a()}else a()},s.onerror=a,s.send()}function ZG(t,e){return function(n,r,i,o,a){var s=this;Qje(t,e,n,r,i,function(l,c){s.addFeatures(l),o!==void 0&&o(l)},a||ip)}}var Noe=function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,i){r.__proto__=i}||function(r,i){for(var o in i)Object.prototype.hasOwnProperty.call(i,o)&&(r[o]=i[o])},t(e,n)};return function(e,n){if(typeof n!="function"&&n!==null)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");t(e,n);function r(){this.constructor=e}e.prototype=n===null?Object.create(n):(r.prototype=n.prototype,new r)}}(),Du=function(t){Noe(e,t);function e(n,r,i){var o=t.call(this,n)||this;return o.feature=r,o.features=i,o}return e}(ac),Y1=function(t){Noe(e,t);function e(n){var r=this,i=n||{};r=t.call(this,{attributions:i.attributions,interpolate:!0,projection:void 0,state:"ready",wrapX:i.wrapX!==void 0?i.wrapX:!0})||this,r.on,r.once,r.un,r.loader_=ip,r.format_=i.format,r.overlaps_=i.overlaps===void 0?!0:i.overlaps,r.url_=i.url,i.loader!==void 0?r.loader_=i.loader:r.url_!==void 0&&(Ut(r.format_,7),r.loader_=ZG(r.url_,r.format_)),r.strategy_=i.strategy!==void 0?i.strategy:qje;var o=i.useSpatialIndex!==void 0?i.useSpatialIndex:!0;r.featuresRtree_=o?new YG:null,r.loadedExtentsRtree_=new YG,r.loadingExtentsCount_=0,r.nullGeometryFeatures_={},r.idIndex_={},r.uidIndex_={},r.featureChangeKeys_={},r.featuresCollection_=null;var a,s;return Array.isArray(i.features)?s=i.features:i.features&&(a=i.features,s=a.getArray()),!o&&a===void 0&&(a=new Qa(s)),s!==void 0&&r.addFeaturesInternal(s),a!==void 0&&r.bindFeaturesCollection_(a),r}return e.prototype.addFeature=function(n){this.addFeatureInternal(n),this.changed()},e.prototype.addFeatureInternal=function(n){var r=vn(n);if(!this.addToIndex_(r,n)){this.featuresCollection_&&this.featuresCollection_.remove(n);return}this.setupChangeEvents_(r,n);var i=n.getGeometry();if(i){var o=i.getExtent();this.featuresRtree_&&this.featuresRtree_.insert(o,n)}else this.nullGeometryFeatures_[r]=n;this.dispatchEvent(new Du(Ps.ADDFEATURE,n))},e.prototype.setupChangeEvents_=function(n,r){this.featureChangeKeys_[n]=[rn(r,Mt.CHANGE,this.handleFeatureChange_,this),rn(r,nv.PROPERTYCHANGE,this.handleFeatureChange_,this)]},e.prototype.addToIndex_=function(n,r){var i=!0,o=r.getId();return o!==void 0&&(o.toString()in this.idIndex_?i=!1:this.idIndex_[o.toString()]=r),i&&(Ut(!(n in this.uidIndex_),30),this.uidIndex_[n]=r),i},e.prototype.addFeatures=function(n){this.addFeaturesInternal(n),this.changed()},e.prototype.addFeaturesInternal=function(n){for(var r=[],i=[],o=[],a=0,s=n.length;a<s;a++){var l=n[a],c=vn(l);this.addToIndex_(c,l)&&i.push(l)}for(var a=0,u=i.length;a<u;a++){var l=i[a],c=vn(l);this.setupChangeEvents_(c,l);var f=l.getGeometry();if(f){var d=f.getExtent();r.push(d),o.push(l)}else this.nullGeometryFeatures_[c]=l}if(this.featuresRtree_&&this.featuresRtree_.load(r,o),this.hasListener(Ps.ADDFEATURE))for(var a=0,h=i.length;a<h;a++)this.dispatchEvent(new Du(Ps.ADDFEATURE,i[a]))},e.prototype.bindFeaturesCollection_=function(n){var r=!1;this.addEventListener(Ps.ADDFEATURE,function(i){r||(r=!0,n.push(i.feature),r=!1)}),this.addEventListener(Ps.REMOVEFEATURE,function(i){r||(r=!0,n.remove(i.feature),r=!1)}),n.addEventListener(Oo.ADD,(function(i){r||(r=!0,this.addFeature(i.element),r=!1)}).bind(this)),n.addEventListener(Oo.REMOVE,(function(i){r||(r=!0,this.removeFeature(i.element),r=!1)}).bind(this)),this.featuresCollection_=n},e.prototype.clear=function(n){if(n){for(var r in this.featureChangeKeys_){var i=this.featureChangeKeys_[r];i.forEach(nr)}this.featuresCollection_||(this.featureChangeKeys_={},this.idIndex_={},this.uidIndex_={})}else if(this.featuresRtree_){var o=(function(l){this.removeFeatureInternal(l)}).bind(this);this.featuresRtree_.forEach(o);for(var a in this.nullGeometryFeatures_)this.removeFeatureInternal(this.nullGeometryFeatures_[a])}this.featuresCollection_&&this.featuresCollection_.clear(),this.featuresRtree_&&this.featuresRtree_.clear(),this.nullGeometryFeatures_={};var s=new Du(Ps.CLEAR);this.dispatchEvent(s),this.changed()},e.prototype.forEachFeature=function(n){if(this.featuresRtree_)return this.featuresRtree_.forEach(n);this.featuresCollection_&&this.featuresCollection_.forEach(n)},e.prototype.forEachFeatureAtCoordinateDirect=function(n,r){var i=[n[0],n[1],n[0],n[1]];return this.forEachFeatureInExtent(i,function(o){var a=o.getGeometry();if(a.intersectsCoordinate(n))return r(o)})},e.prototype.forEachFeatureInExtent=function(n,r){if(this.featuresRtree_)return this.featuresRtree_.forEachInExtent(n,r);this.featuresCollection_&&this.featuresCollection_.forEach(r)},e.prototype.forEachFeatureIntersectingExtent=function(n,r){return this.forEachFeatureInExtent(n,function(i){var o=i.getGeometry();if(o.intersectsExtent(n)){var a=r(i);if(a)return a}})},e.prototype.getFeaturesCollection=function(){return this.featuresCollection_},e.prototype.getFeatures=function(){var n;return this.featuresCollection_?n=this.featuresCollection_.getArray().slice(0):this.featuresRtree_&&(n=this.featuresRtree_.getAll(),rv(this.nullGeometryFeatures_)||Zc(n,Tie(this.nullGeometryFeatures_))),n},e.prototype.getFeaturesAtCoordinate=function(n){var r=[];return this.forEachFeatureAtCoordinateDirect(n,function(i){r.push(i)}),r},e.prototype.getFeaturesInExtent=function(n,r){var i=this;if(this.featuresRtree_){var o=r&&r.canWrapX()&&this.getWrapX();if(!o)return this.featuresRtree_.getInExtent(n);var a=tNe(n,r);return[].concat.apply([],a.map(function(s){return i.featuresRtree_.getInExtent(s)}))}else return this.featuresCollection_?this.featuresCollection_.getArray().slice(0):[]},e.prototype.getClosestFeatureToCoordinate=function(n,r){var i=n[0],o=n[1],a=null,s=[NaN,NaN],l=1/0,c=[-1/0,-1/0,1/0,1/0],u=r||Fh;return this.featuresRtree_.forEachInExtent(c,function(f){if(u(f)){var d=f.getGeometry(),h=l;if(l=d.closestPointXY(i,o,s,l),l<h){a=f;var p=Math.sqrt(l);c[0]=i-p,c[1]=o-p,c[2]=i+p,c[3]=o+p}}}),a},e.prototype.getExtent=function(n){return this.featuresRtree_.getExtent(n)},e.prototype.getFeatureById=function(n){var r=this.idIndex_[n.toString()];return r!==void 0?r:null},e.prototype.getFeatureByUid=function(n){var r=this.uidIndex_[n];return r!==void 0?r:null},e.prototype.getFormat=function(){return this.format_},e.prototype.getOverlaps=function(){return this.overlaps_},e.prototype.getUrl=function(){return this.url_},e.prototype.handleFeatureChange_=function(n){var r=n.target,i=vn(r),o=r.getGeometry();if(!o)i in this.nullGeometryFeatures_||(this.featuresRtree_&&this.featuresRtree_.remove(r),this.nullGeometryFeatures_[i]=r);else{var a=o.getExtent();i in this.nullGeometryFeatures_?(delete this.nullGeometryFeatures_[i],this.featuresRtree_&&this.featuresRtree_.insert(a,r)):this.featuresRtree_&&this.featuresRtree_.update(a,r)}var s=r.getId();if(s!==void 0){var l=s.toString();this.idIndex_[l]!==r&&(this.removeFromIdIndex_(r),this.idIndex_[l]=r)}else this.removeFromIdIndex_(r),this.uidIndex_[i]=r;this.changed(),this.dispatchEvent(new Du(Ps.CHANGEFEATURE,r))},e.prototype.hasFeature=function(n){var r=n.getId();return r!==void 0?r in this.idIndex_:vn(n)in this.uidIndex_},e.prototype.isEmpty=function(){return this.featuresRtree_?this.featuresRtree_.isEmpty()&&rv(this.nullGeometryFeatures_):this.featuresCollection_?this.featuresCollection_.getLength()===0:!0},e.prototype.loadFeatures=function(n,r,i){for(var o=this.loadedExtentsRtree_,a=this.strategy_(n,r,i),s=function(f,d){var h=a[f],p=o.forEachInExtent(h,function(m){return eg(m.extent,h)});p||(++l.loadingExtentsCount_,l.dispatchEvent(new Du(Ps.FEATURESLOADSTART)),l.loader_.call(l,h,r,i,(function(m){--this.loadingExtentsCount_,this.dispatchEvent(new Du(Ps.FEATURESLOADEND,void 0,m))}).bind(l),(function(){--this.loadingExtentsCount_,this.dispatchEvent(new Du(Ps.FEATURESLOADERROR))}).bind(l)),o.insert(h,{extent:h.slice()}))},l=this,c=0,u=a.length;c<u;++c)s(c);this.loading=this.loader_.length<4?!1:this.loadingExtentsCount_>0},e.prototype.refresh=function(){this.clear(!0),this.loadedExtentsRtree_.clear(),t.prototype.refresh.call(this)},e.prototype.removeLoadedExtent=function(n){var r=this.loadedExtentsRtree_,i;r.forEachInExtent(n,function(o){if(jb(o.extent,n))return i=o,!0}),i&&r.remove(i)},e.prototype.removeFeature=function(n){if(n){var r=vn(n);r in this.nullGeometryFeatures_?delete this.nullGeometryFeatures_[r]:this.featuresRtree_&&this.featuresRtree_.remove(n);var i=this.removeFeatureInternal(n);i&&this.changed()}},e.prototype.removeFeatureInternal=function(n){var r=vn(n),i=this.featureChangeKeys_[r];if(i){i.forEach(nr),delete this.featureChangeKeys_[r];var o=n.getId();return o!==void 0&&delete this.idIndex_[o.toString()],delete this.uidIndex_[r],this.dispatchEvent(new Du(Ps.REMOVEFEATURE,n)),n}},e.prototype.removeFromIdIndex_=function(n){var r=!1;for(var i in this.idIndex_)if(this.idIndex_[i]===n){delete this.idIndex_[i],r=!0;break}return r},e.prototype.setLoader=function(n){this.loader_=n},e.prototype.setUrl=function(n){Ut(this.format_,7),this.url_=n,this.setLoader(ZG(n,this.format_))},e}(Loe);function Lu(t,e){return Cr(t.inversePixelTransform,e.slice(0))}const St={IDLE:0,LOADING:1,LOADED:2,ERROR:3,EMPTY:4};function $oe(t){return Math.pow(t,3)}function fy(t){return 1-$oe(1-t)}function Yje(t){return 3*t*t-2*t*t*t}function Kje(t){return t}var Zje=function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,i){r.__proto__=i}||function(r,i){for(var o in i)Object.prototype.hasOwnProperty.call(i,o)&&(r[o]=i[o])},t(e,n)};return function(e,n){if(typeof n!="function"&&n!==null)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");t(e,n);function r(){this.constructor=e}e.prototype=n===null?Object.create(n):(r.prototype=n.prototype,new r)}}(),Foe=function(t){Zje(e,t);function e(n,r,i){var o=t.call(this)||this,a=i||{};return o.tileCoord=n,o.state=r,o.interimTile=null,o.key="",o.transition_=a.transition===void 0?250:a.transition,o.transitionStarts_={},o.interpolate=!!a.interpolate,o}return e.prototype.changed=function(){this.dispatchEvent(Mt.CHANGE)},e.prototype.release=function(){},e.prototype.getKey=function(){return this.key+"/"+this.tileCoord},e.prototype.getInterimTile=function(){if(!this.interimTile)return this;var n=this.interimTile;do{if(n.getState()==St.LOADED)return this.transition_=0,n;n=n.interimTile}while(n);return this},e.prototype.refreshInterimChain=function(){if(this.interimTile){var n=this.interimTile,r=this;do{if(n.getState()==St.LOADED){n.interimTile=null;break}else n.getState()==St.LOADING?r=n:n.getState()==St.IDLE?r.interimTile=n.interimTile:r=n;n=r.interimTile}while(n)}},e.prototype.getTileCoord=function(){return this.tileCoord},e.prototype.getState=function(){return this.state},e.prototype.setState=function(n){if(this.state!==St.ERROR&&this.state>n)throw new Error("Tile load sequence violation");this.state=n,this.changed()},e.prototype.load=function(){yt()},e.prototype.getAlpha=function(n,r){if(!this.transition_)return 1;var i=this.transitionStarts_[n];if(!i)i=r,this.transitionStarts_[n]=i;else if(i===-1)return 1;var o=r-i+1e3/60;return o>=this.transition_?1:$oe(o/this.transition_)},e.prototype.inTransition=function(n){return this.transition_?this.transitionStarts_[n]!==-1:!1},e.prototype.endTransition=function(n){this.transition_&&(this.transitionStarts_[n]=-1)},e}(oy),Jje=function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,i){r.__proto__=i}||function(r,i){for(var o in i)Object.prototype.hasOwnProperty.call(i,o)&&(r[o]=i[o])},t(e,n)};return function(e,n){if(typeof n!="function"&&n!==null)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");t(e,n);function r(){this.constructor=e}e.prototype=n===null?Object.create(n):(r.prototype=n.prototype,new r)}}(),CB=function(t){Jje(e,t);function e(n,r,i,o,a,s){var l=t.call(this,n,r,s)||this;return l.crossOrigin_=o,l.src_=i,l.key=i,l.image_=new Image,o!==null&&(l.image_.crossOrigin=o),l.unlisten_=null,l.tileLoadFunction_=a,l}return e.prototype.getImage=function(){return this.image_},e.prototype.setImage=function(n){this.image_=n,this.state=St.LOADED,this.unlistenImage_(),this.changed()},e.prototype.handleImageError_=function(){this.state=St.ERROR,this.unlistenImage_(),this.image_=e5e(),this.changed()},e.prototype.handleImageLoad_=function(){var n=this.image_;n.naturalWidth&&n.naturalHeight?this.state=St.LOADED:this.state=St.EMPTY,this.unlistenImage_(),this.changed()},e.prototype.load=function(){this.state==St.ERROR&&(this.state=St.IDLE,this.image_=new Image,this.crossOrigin_!==null&&(this.image_.crossOrigin=this.crossOrigin_)),this.state==St.IDLE&&(this.state=St.LOADING,this.changed(),this.tileLoadFunction_(this,this.src_),this.unlisten_=OB(this.image_,this.handleImageLoad_.bind(this),this.handleImageError_.bind(this)))},e.prototype.unlistenImage_=function(){this.unlisten_&&(this.unlisten_(),this.unlisten_=null)},e}(Foe);function e5e(){var t=Ca(1,1);return t.fillStyle="rgba(0,0,0,0)",t.fillRect(0,0,1,1),t.canvas}var t5e=function(){function t(e,n,r){this.decay_=e,this.minVelocity_=n,this.delay_=r,this.points_=[],this.angle_=0,this.initialVelocity_=0}return t.prototype.begin=function(){this.points_.length=0,this.angle_=0,this.initialVelocity_=0},t.prototype.update=function(e,n){this.points_.push(e,n,Date.now())},t.prototype.end=function(){if(this.points_.length<6)return!1;var e=Date.now()-this.delay_,n=this.points_.length-3;if(this.points_[n+2]<e)return!1;for(var r=n-3;r>0&&this.points_[r+2]>e;)r-=3;var i=this.points_[n+2]-this.points_[r+2];if(i<1e3/60)return!1;var o=this.points_[n]-this.points_[r],a=this.points_[n+1]-this.points_[r+1];return this.angle_=Math.atan2(a,o),this.initialVelocity_=Math.sqrt(o*o+a*a)/i,this.initialVelocity_>this.minVelocity_},t.prototype.getDistance=function(){return(this.minVelocity_-this.initialVelocity_)/this.decay_},t.prototype.getAngle=function(){return this.angle_},t}(),n5e=function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,i){r.__proto__=i}||function(r,i){for(var o in i)Object.prototype.hasOwnProperty.call(i,o)&&(r[o]=i[o])},t(e,n)};return function(e,n){if(typeof n!="function"&&n!==null)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");t(e,n);function r(){this.constructor=e}e.prototype=n===null?Object.create(n):(r.prototype=n.prototype,new r)}}(),r5e=function(t){n5e(e,t);function e(n){var r=t.call(this)||this;return r.map_=n,r}return e.prototype.dispatchRenderEvent=function(n,r){yt()},e.prototype.calculateMatrices2D=function(n){var r=n.viewState,i=n.coordinateToPixelTransform,o=n.pixelToCoordinateTransform;hu(i,n.size[0]/2,n.size[1]/2,1/r.resolution,-1/r.resolution,-r.rotation,-r.center[0],-r.center[1]),Q5(o,i)},e.prototype.forEachFeatureAtCoordinate=function(n,r,i,o,a,s,l,c){var u,f=r.viewState;function d(L,z,B,U){return a.call(s,z,L?B:null,U)}var h=f.projection,p=jie(n.slice(),h),m=[[0,0]];if(h.canWrapX()&&o){var g=h.getExtent(),v=Kn(g);m.push([-v,0],[v,0])}for(var y=r.layerStatesArray,x=y.length,b=[],_=[],S=0;S<m.length;S++)for(var O=x-1;O>=0;--O){var C=y[O],E=C.layer;if(E.hasRenderer()&&XT(C,f)&&l.call(c,E)){var k=E.getRenderer(),I=E.getSource();if(k&&I){var P=I.getWrapX()?p:n,R=d.bind(null,C.managed);_[0]=P[0]+m[S][0],_[1]=P[1]+m[S][1],u=k.forEachFeatureAtCoordinate(_,r,i,R,b)}if(u)return u}}if(b.length!==0){var T=1/b.length;return b.forEach(function(L,z){return L.distanceSq+=z*T}),b.sort(function(L,z){return L.distanceSq-z.distanceSq}),b.some(function(L){return u=L.callback(L.feature,L.layer,L.geometry)}),u}},e.prototype.forEachLayerAtPixel=function(n,r,i,o,a){return yt()},e.prototype.hasFeatureAtCoordinate=function(n,r,i,o,a,s){var l=this.forEachFeatureAtCoordinate(n,r,i,o,Fh,this,a,s);return l!==void 0},e.prototype.getMap=function(){return this.map_},e.prototype.renderFrame=function(n){yt()},e.prototype.scheduleExpireIconCache=function(n){QT.canExpireCache()&&n.postRenderFunctions.push(i5e)},e}(q5);function i5e(t,e){QT.expire()}var o5e=function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,i){r.__proto__=i}||function(r,i){for(var o in i)Object.prototype.hasOwnProperty.call(i,o)&&(r[o]=i[o])},t(e,n)};return function(e,n){if(typeof n!="function"&&n!==null)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");t(e,n);function r(){this.constructor=e}e.prototype=n===null?Object.create(n):(r.prototype=n.prototype,new r)}}(),a5e=function(t){o5e(e,t);function e(n){var r=t.call(this,n)||this;r.fontChangeListenerKey_=rn(Tc,nv.PROPERTYCHANGE,n.redrawText.bind(n)),r.element_=document.createElement("div");var i=r.element_.style;i.position="absolute",i.width="100%",i.height="100%",i.zIndex="0",r.element_.className=q1+" ol-layers";var o=n.getViewport();return o.insertBefore(r.element_,o.firstChild||null),r.children_=[],r.renderedVisible_=!0,r}return e.prototype.dispatchRenderEvent=function(n,r){var i=this.getMap();if(i.hasListener(n)){var o=new Aoe(n,void 0,r);i.dispatchEvent(o)}},e.prototype.disposeInternal=function(){nr(this.fontChangeListenerKey_),this.element_.parentNode.removeChild(this.element_),t.prototype.disposeInternal.call(this)},e.prototype.renderFrame=function(n){if(!n){this.renderedVisible_&&(this.element_.style.display="none",this.renderedVisible_=!1);return}this.calculateMatrices2D(n),this.dispatchRenderEvent(Bf.PRECOMPOSE,n);var r=n.layerStatesArray.sort(function(h,p){return h.zIndex-p.zIndex}),i=n.viewState;this.children_.length=0;for(var o=[],a=null,s=0,l=r.length;s<l;++s){var c=r[s];n.layerIndex=s;var u=c.layer,f=u.getSourceState();if(!XT(c,i)||f!="ready"&&f!="undefined"){u.unrender();continue}var d=u.render(n,a);d&&(d!==a&&(this.children_.push(d),a=d),"getDeclutter"in u&&o.push(u))}for(var s=o.length-1;s>=0;--s)o[s].renderDeclutter(n);EFe(this.element_,this.children_),this.dispatchRenderEvent(Bf.POSTCOMPOSE,n),this.renderedVisible_||(this.element_.style.display="",this.renderedVisible_=!0),this.scheduleExpireIconCache(n)},e.prototype.forEachLayerAtPixel=function(n,r,i,o,a){for(var s=r.viewState,l=r.layerStatesArray,c=l.length,u=c-1;u>=0;--u){var f=l[u],d=f.layer;if(d.hasRenderer()&&XT(f,s)&&a(d)){var h=d.getRenderer(),p=h.getDataAtPixel(n,r,i);if(p){var m=o(d,p);if(m)return m}}}},e}(r5e),joe=function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,i){r.__proto__=i}||function(r,i){for(var o in i)Object.prototype.hasOwnProperty.call(i,o)&&(r[o]=i[o])},t(e,n)};return function(e,n){if(typeof n!="function"&&n!==null)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");t(e,n);function r(){this.constructor=e}e.prototype=n===null?Object.create(n):(r.prototype=n.prototype,new r)}}(),lf=function(t){joe(e,t);function e(n,r){var i=t.call(this,n)||this;return i.layer=r,i}return e}(ac),UA={LAYERS:"layers"},s5e=function(t){joe(e,t);function e(n){var r=this,i=n||{},o=ur({},i);delete o.layers;var a=i.layers;return r=t.call(this,o)||this,r.on,r.once,r.un,r.layersListenerKeys_=[],r.listenerKeys_={},r.addChangeListener(UA.LAYERS,r.handleLayersChanged_),a?Array.isArray(a)?a=new Qa(a.slice(),{unique:!0}):Ut(typeof a.getArray=="function",43):a=new Qa(void 0,{unique:!0}),r.setLayers(a),r}return e.prototype.handleLayerChange_=function(){this.changed()},e.prototype.handleLayersChanged_=function(){this.layersListenerKeys_.forEach(nr),this.layersListenerKeys_.length=0;var n=this.getLayers();this.layersListenerKeys_.push(rn(n,Oo.ADD,this.handleLayersAdd_,this),rn(n,Oo.REMOVE,this.handleLayersRemove_,this));for(var r in this.listenerKeys_)this.listenerKeys_[r].forEach(nr);j1(this.listenerKeys_);for(var i=n.getArray(),o=0,a=i.length;o<a;o++){var s=i[o];this.registerLayerListeners_(s),this.dispatchEvent(new lf("addlayer",s))}this.changed()},e.prototype.registerLayerListeners_=function(n){var r=[rn(n,nv.PROPERTYCHANGE,this.handleLayerChange_,this),rn(n,Mt.CHANGE,this.handleLayerChange_,this)];n instanceof e&&r.push(rn(n,"addlayer",this.handleLayerGroupAdd_,this),rn(n,"removelayer",this.handleLayerGroupRemove_,this)),this.listenerKeys_[vn(n)]=r},e.prototype.handleLayerGroupAdd_=function(n){this.dispatchEvent(new lf("addlayer",n.layer))},e.prototype.handleLayerGroupRemove_=function(n){this.dispatchEvent(new lf("removelayer",n.layer))},e.prototype.handleLayersAdd_=function(n){var r=n.element;this.registerLayerListeners_(r),this.dispatchEvent(new lf("addlayer",r)),this.changed()},e.prototype.handleLayersRemove_=function(n){var r=n.element,i=vn(r);this.listenerKeys_[i].forEach(nr),delete this.listenerKeys_[i],this.dispatchEvent(new lf("removelayer",r)),this.changed()},e.prototype.getLayers=function(){return this.get(UA.LAYERS)},e.prototype.setLayers=function(n){var r=this.getLayers();if(r)for(var i=r.getArray(),o=0,a=i.length;o<a;++o)this.dispatchEvent(new lf("removelayer",i[o]));this.set(UA.LAYERS,n)},e.prototype.getLayersArray=function(n){var r=n!==void 0?n:[];return this.getLayers().forEach(function(i){i.getLayersArray(r)}),r},e.prototype.getLayerStatesArray=function(n){var r=n!==void 0?n:[],i=r.length;this.getLayers().forEach(function(u){u.getLayerStatesArray(r)});var o=this.getLayerState(),a=o.zIndex;!n&&o.zIndex===void 0&&(a=0);for(var s=i,l=r.length;s<l;s++){var c=r[s];c.opacity*=o.opacity,c.visible=c.visible&&o.visible,c.maxResolution=Math.min(c.maxResolution,o.maxResolution),c.minResolution=Math.max(c.minResolution,o.minResolution),c.minZoom=Math.max(c.minZoom,o.minZoom),c.maxZoom=Math.min(c.maxZoom,o.maxZoom),o.extent!==void 0&&(c.extent!==void 0?c.extent=Hx(c.extent,o.extent):c.extent=o.extent),c.zIndex===void 0&&(c.zIndex=a)}return r},e.prototype.getSourceState=function(){return"ready"},e}(Eoe);const p2=s5e;var l5e=function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,i){r.__proto__=i}||function(r,i){for(var o in i)Object.prototype.hasOwnProperty.call(i,o)&&(r[o]=i[o])},t(e,n)};return function(e,n){if(typeof n!="function"&&n!==null)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");t(e,n);function r(){this.constructor=e}e.prototype=n===null?Object.create(n):(r.prototype=n.prototype,new r)}}(),zm=function(t){l5e(e,t);function e(n,r,i){var o=t.call(this,n)||this;return o.map=r,o.frameState=i!==void 0?i:null,o}return e}(ac),c5e=function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,i){r.__proto__=i}||function(r,i){for(var o in i)Object.prototype.hasOwnProperty.call(i,o)&&(r[o]=i[o])},t(e,n)};return function(e,n){if(typeof n!="function"&&n!==null)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");t(e,n);function r(){this.constructor=e}e.prototype=n===null?Object.create(n):(r.prototype=n.prototype,new r)}}(),Ac=function(t){c5e(e,t);function e(n,r,i,o,a,s){var l=t.call(this,n,r,a)||this;return l.originalEvent=i,l.pixel_=null,l.coordinate_=null,l.dragging=o!==void 0?o:!1,l.activePointers=s,l}return Object.defineProperty(e.prototype,"pixel",{get:function(){return this.pixel_||(this.pixel_=this.map.getEventPixel(this.originalEvent)),this.pixel_},set:function(n){this.pixel_=n},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"coordinate",{get:function(){return this.coordinate_||(this.coordinate_=this.map.getCoordinateFromPixel(this.pixel)),this.coordinate_},set:function(n){this.coordinate_=n},enumerable:!1,configurable:!0}),e.prototype.preventDefault=function(){t.prototype.preventDefault.call(this),"preventDefault"in this.originalEvent&&this.originalEvent.preventDefault()},e.prototype.stopPropagation=function(){t.prototype.stopPropagation.call(this),"stopPropagation"in this.originalEvent&&this.originalEvent.stopPropagation()},e}(zm);const Sn={SINGLECLICK:"singleclick",CLICK:Mt.CLICK,DBLCLICK:Mt.DBLCLICK,POINTERDRAG:"pointerdrag",POINTERMOVE:"pointermove",POINTERDOWN:"pointerdown",POINTERUP:"pointerup",POINTEROVER:"pointerover",POINTEROUT:"pointerout",POINTERENTER:"pointerenter",POINTERLEAVE:"pointerleave",POINTERCANCEL:"pointercancel"},h3={POINTERMOVE:"pointermove",POINTERDOWN:"pointerdown",POINTERUP:"pointerup",POINTEROVER:"pointerover",POINTEROUT:"pointerout",POINTERENTER:"pointerenter",POINTERLEAVE:"pointerleave",POINTERCANCEL:"pointercancel"};var u5e=function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,i){r.__proto__=i}||function(r,i){for(var o in i)Object.prototype.hasOwnProperty.call(i,o)&&(r[o]=i[o])},t(e,n)};return function(e,n){if(typeof n!="function"&&n!==null)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");t(e,n);function r(){this.constructor=e}e.prototype=n===null?Object.create(n):(r.prototype=n.prototype,new r)}}(),f5e=function(t){u5e(e,t);function e(n,r){var i=t.call(this,n)||this;i.map_=n,i.clickTimeoutId_,i.emulateClicks_=!1,i.dragging_=!1,i.dragListenerKeys_=[],i.moveTolerance_=r===void 0?1:r,i.down_=null;var o=i.map_.getViewport();return i.activePointers_=[],i.trackedTouches_={},i.element_=o,i.pointerdownListenerKey_=rn(o,h3.POINTERDOWN,i.handlePointerDown_,i),i.originalPointerMoveEvent_,i.relayedListenerKey_=rn(o,h3.POINTERMOVE,i.relayMoveEvent_,i),i.boundHandleTouchMove_=i.handleTouchMove_.bind(i),i.element_.addEventListener(Mt.TOUCHMOVE,i.boundHandleTouchMove_,kie?{passive:!1}:!1),i}return e.prototype.emulateClick_=function(n){var r=new Ac(Sn.CLICK,this.map_,n);this.dispatchEvent(r),this.clickTimeoutId_!==void 0?(clearTimeout(this.clickTimeoutId_),this.clickTimeoutId_=void 0,r=new Ac(Sn.DBLCLICK,this.map_,n),this.dispatchEvent(r)):this.clickTimeoutId_=setTimeout((function(){this.clickTimeoutId_=void 0;var i=new Ac(Sn.SINGLECLICK,this.map_,n);this.dispatchEvent(i)}).bind(this),250)},e.prototype.updateActivePointers_=function(n){var r=n,i=r.pointerId;if(r.type==Sn.POINTERUP||r.type==Sn.POINTERCANCEL){delete this.trackedTouches_[i];for(var o in this.trackedTouches_)if(this.trackedTouches_[o].target!==r.target){delete this.trackedTouches_[o];break}}else(r.type==Sn.POINTERDOWN||r.type==Sn.POINTERMOVE)&&(this.trackedTouches_[i]=r);this.activePointers_=Tie(this.trackedTouches_)},e.prototype.handlePointerUp_=function(n){this.updateActivePointers_(n);var r=new Ac(Sn.POINTERUP,this.map_,n,void 0,void 0,this.activePointers_);this.dispatchEvent(r),this.emulateClicks_&&!r.defaultPrevented&&!this.dragging_&&this.isMouseActionButton_(n)&&this.emulateClick_(this.down_),this.activePointers_.length===0&&(this.dragListenerKeys_.forEach(nr),this.dragListenerKeys_.length=0,this.dragging_=!1,this.down_=null)},e.prototype.isMouseActionButton_=function(n){return n.button===0},e.prototype.handlePointerDown_=function(n){this.emulateClicks_=this.activePointers_.length===0,this.updateActivePointers_(n);var r=new Ac(Sn.POINTERDOWN,this.map_,n,void 0,void 0,this.activePointers_);this.dispatchEvent(r),this.down_={};for(var i in n){var o=n[i];this.down_[i]=typeof o=="function"?ip:o}if(this.dragListenerKeys_.length===0){var a=this.map_.getOwnerDocument();this.dragListenerKeys_.push(rn(a,Sn.POINTERMOVE,this.handlePointerMove_,this),rn(a,Sn.POINTERUP,this.handlePointerUp_,this),rn(this.element_,Sn.POINTERCANCEL,this.handlePointerUp_,this)),this.element_.getRootNode&&this.element_.getRootNode()!==a&&this.dragListenerKeys_.push(rn(this.element_.getRootNode(),Sn.POINTERUP,this.handlePointerUp_,this))}},e.prototype.handlePointerMove_=function(n){if(this.isMoving_(n)){this.updateActivePointers_(n),this.dragging_=!0;var r=new Ac(Sn.POINTERDRAG,this.map_,n,this.dragging_,void 0,this.activePointers_);this.dispatchEvent(r)}},e.prototype.relayMoveEvent_=function(n){this.originalPointerMoveEvent_=n;var r=!!(this.down_&&this.isMoving_(n));this.dispatchEvent(new Ac(Sn.POINTERMOVE,this.map_,n,r))},e.prototype.handleTouchMove_=function(n){var r=this.originalPointerMoveEvent_;(!r||r.defaultPrevented)&&(typeof n.cancelable!="boolean"||n.cancelable===!0)&&n.preventDefault()},e.prototype.isMoving_=function(n){return this.dragging_||Math.abs(n.clientX-this.down_.clientX)>this.moveTolerance_||Math.abs(n.clientY-this.down_.clientY)>this.moveTolerance_},e.prototype.disposeInternal=function(){this.relayedListenerKey_&&(nr(this.relayedListenerKey_),this.relayedListenerKey_=null),this.element_.removeEventListener(Mt.TOUCHMOVE,this.boundHandleTouchMove_),this.pointerdownListenerKey_&&(nr(this.pointerdownListenerKey_),this.pointerdownListenerKey_=null),this.dragListenerKeys_.forEach(nr),this.dragListenerKeys_.length=0,this.element_=null,t.prototype.disposeInternal.call(this)},e}(oy);const Yu={POSTRENDER:"postrender",MOVESTART:"movestart",MOVEEND:"moveend",LOADSTART:"loadstart",LOADEND:"loadend"},Ui={LAYERGROUP:"layergroup",SIZE:"size",TARGET:"target",VIEW:"view"};var YT=1/0,d5e=function(){function t(e,n){this.priorityFunction_=e,this.keyFunction_=n,this.elements_=[],this.priorities_=[],this.queuedElements_={}}return t.prototype.clear=function(){this.elements_.length=0,this.priorities_.length=0,j1(this.queuedElements_)},t.prototype.dequeue=function(){var e=this.elements_,n=this.priorities_,r=e[0];e.length==1?(e.length=0,n.length=0):(e[0]=e.pop(),n[0]=n.pop(),this.siftUp_(0));var i=this.keyFunction_(r);return delete this.queuedElements_[i],r},t.prototype.enqueue=function(e){Ut(!(this.keyFunction_(e)in this.queuedElements_),31);var n=this.priorityFunction_(e);return n!=YT?(this.elements_.push(e),this.priorities_.push(n),this.queuedElements_[this.keyFunction_(e)]=!0,this.siftDown_(0,this.elements_.length-1),!0):!1},t.prototype.getCount=function(){return this.elements_.length},t.prototype.getLeftChildIndex_=function(e){return e*2+1},t.prototype.getRightChildIndex_=function(e){return e*2+2},t.prototype.getParentIndex_=function(e){return e-1>>1},t.prototype.heapify_=function(){var e;for(e=(this.elements_.length>>1)-1;e>=0;e--)this.siftUp_(e)},t.prototype.isEmpty=function(){return this.elements_.length===0},t.prototype.isKeyQueued=function(e){return e in this.queuedElements_},t.prototype.isQueued=function(e){return this.isKeyQueued(this.keyFunction_(e))},t.prototype.siftUp_=function(e){for(var n=this.elements_,r=this.priorities_,i=n.length,o=n[e],a=r[e],s=e;e<i>>1;){var l=this.getLeftChildIndex_(e),c=this.getRightChildIndex_(e),u=c<i&&r[c]<r[l]?c:l;n[e]=n[u],r[e]=r[u],e=u}n[e]=o,r[e]=a,this.siftDown_(s,e)},t.prototype.siftDown_=function(e,n){for(var r=this.elements_,i=this.priorities_,o=r[n],a=i[n];n>e;){var s=this.getParentIndex_(n);if(i[s]>a)r[n]=r[s],i[n]=i[s],n=s;else break}r[n]=o,i[n]=a},t.prototype.reprioritize=function(){var e=this.priorityFunction_,n=this.elements_,r=this.priorities_,i=0,o=n.length,a,s,l;for(s=0;s<o;++s)a=n[s],l=e(a),l==YT?delete this.queuedElements_[this.keyFunction_(a)]:(r[i]=l,n[i++]=a);n.length=i,r.length=i,this.heapify_()},t}(),h5e=function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,i){r.__proto__=i}||function(r,i){for(var o in i)Object.prototype.hasOwnProperty.call(i,o)&&(r[o]=i[o])},t(e,n)};return function(e,n){if(typeof n!="function"&&n!==null)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");t(e,n);function r(){this.constructor=e}e.prototype=n===null?Object.create(n):(r.prototype=n.prototype,new r)}}(),p5e=function(t){h5e(e,t);function e(n,r){var i=t.call(this,function(o){return n.apply(null,o)},function(o){return o[0].getKey()})||this;return i.boundHandleTileChange_=i.handleTileChange.bind(i),i.tileChangeCallback_=r,i.tilesLoading_=0,i.tilesLoadingKeys_={},i}return e.prototype.enqueue=function(n){var r=t.prototype.enqueue.call(this,n);if(r){var i=n[0];i.addEventListener(Mt.CHANGE,this.boundHandleTileChange_)}return r},e.prototype.getTilesLoading=function(){return this.tilesLoading_},e.prototype.handleTileChange=function(n){var r=n.target,i=r.getState();if(i===St.LOADED||i===St.ERROR||i===St.EMPTY){r.removeEventListener(Mt.CHANGE,this.boundHandleTileChange_);var o=r.getKey();o in this.tilesLoadingKeys_&&(delete this.tilesLoadingKeys_[o],--this.tilesLoading_),this.tileChangeCallback_()}},e.prototype.loadMoreTiles=function(n,r){for(var i=0,o,a,s;this.tilesLoading_<n&&i<r&&this.getCount()>0;)a=this.dequeue()[0],s=a.getKey(),o=a.getState(),o===St.IDLE&&!(s in this.tilesLoadingKeys_)&&(this.tilesLoadingKeys_[s]=!0,++this.tilesLoading_,++i,a.load())},e}(d5e);function m5e(t,e,n,r,i){if(!t||!(n in t.wantedTiles)||!t.wantedTiles[n][e.getKey()])return YT;var o=t.viewState.center,a=r[0]-o[0],s=r[1]-o[1];return 65536*Math.log(i)+Math.sqrt(a*a+s*s)/i}const Ms={CENTER:"center",RESOLUTION:"resolution",ROTATION:"rotation"};var g5e=42,TB=256;function JG(t,e,n){return function(r,i,o,a,s){if(r){if(!i&&!e)return r;var l=e?0:o[0]*i,c=e?0:o[1]*i,u=s?s[0]:0,f=s?s[1]:0,d=t[0]+l/2+u,h=t[2]-l/2+u,p=t[1]+c/2+f,m=t[3]-c/2+f;d>h&&(d=(h+d)/2,h=d),p>m&&(p=(m+p)/2,m=p);var g=Br(r[0],d,h),v=Br(r[1],p,m);if(a&&n&&i){var y=30*i;g+=-y*Math.log(1+Math.max(0,d-r[0])/y)+y*Math.log(1+Math.max(0,r[0]-h)/y),v+=-y*Math.log(1+Math.max(0,p-r[1])/y)+y*Math.log(1+Math.max(0,r[1]-m)/y)}return[g,v]}}}function v5e(t){return t}function EB(t,e,n,r){var i=Kn(e)/n[0],o=ps(e)/n[1];return r?Math.min(t,Math.max(i,o)):Math.min(t,Math.min(i,o))}function PB(t,e,n){var r=Math.min(t,e),i=50;return r*=Math.log(1+i*Math.max(0,t/e-1))/i+1,n&&(r=Math.max(r,n),r/=Math.log(1+i*Math.max(0,n/t-1))/i+1),Br(r,n/2,e*2)}function y5e(t,e,n,r){return function(i,o,a,s){if(i!==void 0){var l=t[0],c=t[t.length-1],u=n?EB(l,n,a,r):l;if(s){var f=e!==void 0?e:!0;return f?PB(i,u,c):Br(i,c,u)}var d=Math.min(u,i),h=Math.floor(X5(t,d,o));return t[h]>u&&h<t.length-1?t[h+1]:t[h]}else return}}function x5e(t,e,n,r,i,o){return function(a,s,l,c){if(a!==void 0){var u=i?EB(e,i,l,o):e,f=n!==void 0?n:0;if(c){var d=r!==void 0?r:!0;return d?PB(a,u,f):Br(a,f,u)}var h=1e-9,p=Math.ceil(Math.log(e/u)/Math.log(t)-h),m=-s*(.5-h)+.5,g=Math.min(u,a),v=Math.floor(Math.log(e/g)/Math.log(t)+m),y=Math.max(p,v),x=e/Math.pow(t,y);return Br(x,f,u)}else return}}function eH(t,e,n,r,i){return function(o,a,s,l){if(o!==void 0){var c=r?EB(t,r,s,i):t,u=n!==void 0?n:!0;return!u||!l?Br(o,e,c):PB(o,c,e)}else return}}function MB(t){if(t!==void 0)return 0}function tH(t){if(t!==void 0)return t}function b5e(t){var e=2*Math.PI/t;return function(n,r){if(r)return n;if(n!==void 0)return n=Math.floor(n/e+.5)*e,n}}function _5e(t){var e=RC(5);return function(n,r){if(r)return n;if(n!==void 0)return Math.abs(n)<=e?0:n}}var w5e=function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,i){r.__proto__=i}||function(r,i){for(var o in i)Object.prototype.hasOwnProperty.call(i,o)&&(r[o]=i[o])},t(e,n)};return function(e,n){if(typeof n!="function"&&n!==null)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");t(e,n);function r(){this.constructor=e}e.prototype=n===null?Object.create(n):(r.prototype=n.prototype,new r)}}(),WA=0,Uc=function(t){w5e(e,t);function e(n){var r=t.call(this)||this;r.on,r.once,r.un;var i=ur({},n);return r.hints_=[0,0],r.animations_=[],r.updateAnimationKey_,r.projection_=iB(i.projection,"EPSG:3857"),r.viewportSize_=[100,100],r.targetCenter_=null,r.targetResolution_,r.targetRotation_,r.nextCenter_=null,r.nextResolution_,r.nextRotation_,r.cancelAnchor_=void 0,i.projection&&SNe(),i.center&&(i.center=js(i.center,r.projection_)),i.extent&&(i.extent=xh(i.extent,r.projection_)),r.applyOptions_(i),r}return e.prototype.applyOptions_=function(n){var r=ur({},n);for(var i in Ms)delete r[i];this.setProperties(r,!0);var o=O5e(n);this.maxResolution_=o.maxResolution,this.minResolution_=o.minResolution,this.zoomFactor_=o.zoomFactor,this.resolutions_=n.resolutions,this.padding_=n.padding,this.minZoom_=o.minZoom;var a=S5e(n),s=o.constraint,l=C5e(n);this.constraints_={center:a,resolution:s,rotation:l},this.setRotation(n.rotation!==void 0?n.rotation:0),this.setCenterInternal(n.center!==void 0?n.center:null),n.resolution!==void 0?this.setResolution(n.resolution):n.zoom!==void 0&&this.setZoom(n.zoom)},Object.defineProperty(e.prototype,"padding",{get:function(){return this.padding_},set:function(n){var r=this.padding_;this.padding_=n;var i=this.getCenter();if(i){var o=n||[0,0,0,0];r=r||[0,0,0,0];var a=this.getResolution(),s=a/2*(o[3]-r[3]+r[1]-o[1]),l=a/2*(o[0]-r[0]+r[2]-o[2]);this.setCenterInternal([i[0]+s,i[1]-l])}},enumerable:!1,configurable:!0}),e.prototype.getUpdatedOptions_=function(n){var r=this.getProperties();return r.resolution!==void 0?r.resolution=this.getResolution():r.zoom=this.getZoom(),r.center=this.getCenterInternal(),r.rotation=this.getRotation(),ur({},r,n)},e.prototype.animate=function(n){this.isDef()&&!this.getAnimating()&&this.resolveConstraints(0);for(var r=new Array(arguments.length),i=0;i<r.length;++i){var o=arguments[i];o.center&&(o=ur({},o),o.center=js(o.center,this.getProjection())),o.anchor&&(o=ur({},o),o.anchor=js(o.anchor,this.getProjection())),r[i]=o}this.animateInternal.apply(this,r)},e.prototype.animateInternal=function(n){var r=arguments.length,i;r>1&&typeof arguments[r-1]=="function"&&(i=arguments[r-1],--r);for(var o=0;o<r&&!this.isDef();++o){var a=arguments[o];a.center&&this.setCenterInternal(a.center),a.zoom!==void 0?this.setZoom(a.zoom):a.resolution&&this.setResolution(a.resolution),a.rotation!==void 0&&this.setRotation(a.rotation)}if(o===r){i&&CS(i,!0);return}for(var s=Date.now(),l=this.targetCenter_.slice(),c=this.targetResolution_,u=this.targetRotation_,f=[];o<r;++o){var d=arguments[o],h={start:s,complete:!1,anchor:d.anchor,duration:d.duration!==void 0?d.duration:1e3,easing:d.easing||Yje,callback:i};if(d.center&&(h.sourceCenter=l,h.targetCenter=d.center.slice(),l=h.targetCenter),d.zoom!==void 0?(h.sourceResolution=c,h.targetResolution=this.getResolutionForZoom(d.zoom),c=h.targetResolution):d.resolution&&(h.sourceResolution=c,h.targetResolution=d.resolution,c=h.targetResolution),d.rotation!==void 0){h.sourceRotation=u;var p=jf(d.rotation-u+Math.PI,2*Math.PI)-Math.PI;h.targetRotation=u+p,u=h.targetRotation}T5e(h)?h.complete=!0:s+=h.duration,f.push(h)}this.animations_.push(f),this.setHint(Hi.ANIMATING,1),this.updateAnimations_()},e.prototype.getAnimating=function(){return this.hints_[Hi.ANIMATING]>0},e.prototype.getInteracting=function(){return this.hints_[Hi.INTERACTING]>0},e.prototype.cancelAnimations=function(){this.setHint(Hi.ANIMATING,-this.hints_[Hi.ANIMATING]);for(var n,r=0,i=this.animations_.length;r<i;++r){var o=this.animations_[r];if(o[0].callback&&CS(o[0].callback,!1),!n)for(var a=0,s=o.length;a<s;++a){var l=o[a];if(!l.complete){n=l.anchor;break}}}this.animations_.length=0,this.cancelAnchor_=n,this.nextCenter_=null,this.nextResolution_=NaN,this.nextRotation_=NaN},e.prototype.updateAnimations_=function(){if(this.updateAnimationKey_!==void 0&&(cancelAnimationFrame(this.updateAnimationKey_),this.updateAnimationKey_=void 0),!!this.getAnimating()){for(var n=Date.now(),r=!1,i=this.animations_.length-1;i>=0;--i){for(var o=this.animations_[i],a=!0,s=0,l=o.length;s<l;++s){var c=o[s];if(!c.complete){var u=n-c.start,f=c.duration>0?u/c.duration:1;f>=1?(c.complete=!0,f=1):a=!1;var d=c.easing(f);if(c.sourceCenter){var h=c.sourceCenter[0],p=c.sourceCenter[1],m=c.targetCenter[0],g=c.targetCenter[1];this.nextCenter_=c.targetCenter;var v=h+d*(m-h),y=p+d*(g-p);this.targetCenter_=[v,y]}if(c.sourceResolution&&c.targetResolution){var x=d===1?c.targetResolution:c.sourceResolution+d*(c.targetResolution-c.sourceResolution);if(c.anchor){var b=this.getViewportSize_(this.getRotation()),_=this.constraints_.resolution(x,0,b,!0);this.targetCenter_=this.calculateCenterZoom(_,c.anchor)}this.nextResolution_=c.targetResolution,this.targetResolution_=x,this.applyTargetState_(!0)}if(c.sourceRotation!==void 0&&c.targetRotation!==void 0){var S=d===1?jf(c.targetRotation+Math.PI,2*Math.PI)-Math.PI:c.sourceRotation+d*(c.targetRotation-c.sourceRotation);if(c.anchor){var O=this.constraints_.rotation(S,!0);this.targetCenter_=this.calculateCenterRotate(O,c.anchor)}this.nextRotation_=c.targetRotation,this.targetRotation_=S}if(this.applyTargetState_(!0),r=!0,!c.complete)break}}if(a){this.animations_[i]=null,this.setHint(Hi.ANIMATING,-1),this.nextCenter_=null,this.nextResolution_=NaN,this.nextRotation_=NaN;var C=o[0].callback;C&&CS(C,!0)}}this.animations_=this.animations_.filter(Boolean),r&&this.updateAnimationKey_===void 0&&(this.updateAnimationKey_=requestAnimationFrame(this.updateAnimations_.bind(this)))}},e.prototype.calculateCenterRotate=function(n,r){var i,o=this.getCenterInternal();return o!==void 0&&(i=[o[0]-r[0],o[1]-r[1]],nB(i,n-this.getRotation()),yNe(i,r)),i},e.prototype.calculateCenterZoom=function(n,r){var i,o=this.getCenterInternal(),a=this.getResolution();if(o!==void 0&&a!==void 0){var s=r[0]-n*(r[0]-o[0])/a,l=r[1]-n*(r[1]-o[1])/a;i=[s,l]}return i},e.prototype.getViewportSize_=function(n){var r=this.viewportSize_;if(n){var i=r[0],o=r[1];return[Math.abs(i*Math.cos(n))+Math.abs(o*Math.sin(n)),Math.abs(i*Math.sin(n))+Math.abs(o*Math.cos(n))]}else return r},e.prototype.setViewportSize=function(n){this.viewportSize_=Array.isArray(n)?n.slice():[100,100],this.getAnimating()||this.resolveConstraints(0)},e.prototype.getCenter=function(){var n=this.getCenterInternal();return n&&e3(n,this.getProjection())},e.prototype.getCenterInternal=function(){return this.get(Ms.CENTER)},e.prototype.getConstraints=function(){return this.constraints_},e.prototype.getConstrainResolution=function(){return this.get("constrainResolution")},e.prototype.getHints=function(n){return n!==void 0?(n[0]=this.hints_[0],n[1]=this.hints_[1],n):this.hints_.slice()},e.prototype.calculateExtent=function(n){var r=this.calculateExtentInternal(n);return Uie(r,this.getProjection())},e.prototype.calculateExtentInternal=function(n){var r=n||this.getViewportSizeMinusPadding_(),i=this.getCenterInternal();Ut(i,1);var o=this.getResolution();Ut(o!==void 0,2);var a=this.getRotation();return Ut(a!==void 0,3),YL(i,o,a,r)},e.prototype.getMaxResolution=function(){return this.maxResolution_},e.prototype.getMinResolution=function(){return this.minResolution_},e.prototype.getMaxZoom=function(){return this.getZoomForResolution(this.minResolution_)},e.prototype.setMaxZoom=function(n){this.applyOptions_(this.getUpdatedOptions_({maxZoom:n}))},e.prototype.getMinZoom=function(){return this.getZoomForResolution(this.maxResolution_)},e.prototype.setMinZoom=function(n){this.applyOptions_(this.getUpdatedOptions_({minZoom:n}))},e.prototype.setConstrainResolution=function(n){this.applyOptions_(this.getUpdatedOptions_({constrainResolution:n}))},e.prototype.getProjection=function(){return this.projection_},e.prototype.getResolution=function(){return this.get(Ms.RESOLUTION)},e.prototype.getResolutions=function(){return this.resolutions_},e.prototype.getResolutionForExtent=function(n,r){return this.getResolutionForExtentInternal(xh(n,this.getProjection()),r)},e.prototype.getResolutionForExtentInternal=function(n,r){var i=r||this.getViewportSizeMinusPadding_(),o=Kn(n)/i[0],a=ps(n)/i[1];return Math.max(o,a)},e.prototype.getResolutionForValueFunction=function(n){var r=n||2,i=this.getConstrainedResolution(this.maxResolution_),o=this.minResolution_,a=Math.log(i/o)/Math.log(r);return function(s){var l=i/Math.pow(r,s*a);return l}},e.prototype.getRotation=function(){return this.get(Ms.ROTATION)},e.prototype.getValueForResolutionFunction=function(n){var r=Math.log(n||2),i=this.getConstrainedResolution(this.maxResolution_),o=this.minResolution_,a=Math.log(i/o)/r;return function(s){var l=Math.log(i/s)/r/a;return l}},e.prototype.getViewportSizeMinusPadding_=function(n){var r=this.getViewportSize_(n),i=this.padding_;return i&&(r=[r[0]-i[1]-i[3],r[1]-i[0]-i[2]]),r},e.prototype.getState=function(){var n=this.getProjection(),r=this.getResolution(),i=this.getRotation(),o=this.getCenterInternal(),a=this.padding_;if(a){var s=this.getViewportSizeMinusPadding_();o=VA(o,this.getViewportSize_(),[s[0]/2+a[3],s[1]/2+a[0]],r,i)}return{center:o.slice(0),projection:n!==void 0?n:null,resolution:r,nextCenter:this.nextCenter_,nextResolution:this.nextResolution_,nextRotation:this.nextRotation_,rotation:i,zoom:this.getZoom()}},e.prototype.getZoom=function(){var n,r=this.getResolution();return r!==void 0&&(n=this.getZoomForResolution(r)),n},e.prototype.getZoomForResolution=function(n){var r=this.minZoom_||0,i,o;if(this.resolutions_){var a=X5(this.resolutions_,n,1);r=a,i=this.resolutions_[a],a==this.resolutions_.length-1?o=2:o=i/this.resolutions_[a+1]}else i=this.maxResolution_,o=this.zoomFactor_;return r+Math.log(i/n)/Math.log(o)},e.prototype.getResolutionForZoom=function(n){if(this.resolutions_){if(this.resolutions_.length<=1)return 0;var r=Br(Math.floor(n),0,this.resolutions_.length-2),i=this.resolutions_[r]/this.resolutions_[r+1];return this.resolutions_[r]/Math.pow(i,Br(n-r,0,1))}else return this.maxResolution_/Math.pow(this.zoomFactor_,n-this.minZoom_)},e.prototype.fit=function(n,r){var i;if(Ut(Array.isArray(n)||typeof n.getSimplifiedGeometry=="function",24),Array.isArray(n)){Ut(!tB(n),25);var o=xh(n,this.getProjection());i=i3(o)}else if(n.getType()==="Circle"){var o=xh(n.getExtent(),this.getProjection());i=i3(o),i.rotate(this.getRotation(),ed(o))}else{var a=PNe();a?i=n.clone().transform(a,this.getProjection()):i=n}this.fitInternal(i,r)},e.prototype.rotatedExtentForGeometry=function(n){for(var r=this.getRotation(),i=Math.cos(r),o=Math.sin(-r),a=n.getFlatCoordinates(),s=n.getStride(),l=1/0,c=1/0,u=-1/0,f=-1/0,d=0,h=a.length;d<h;d+=s){var p=a[d]*i-a[d+1]*o,m=a[d]*o+a[d+1]*i;l=Math.min(l,p),c=Math.min(c,m),u=Math.max(u,p),f=Math.max(f,m)}return[l,c,u,f]},e.prototype.fitInternal=function(n,r){var i=r||{},o=i.size;o||(o=this.getViewportSizeMinusPadding_());var a=i.padding!==void 0?i.padding:[0,0,0,0],s=i.nearest!==void 0?i.nearest:!1,l;i.minResolution!==void 0?l=i.minResolution:i.maxZoom!==void 0?l=this.getResolutionForZoom(i.maxZoom):l=0;var c=this.rotatedExtentForGeometry(n),u=this.getResolutionForExtentInternal(c,[o[0]-a[1]-a[3],o[1]-a[0]-a[2]]);u=isNaN(u)?l:Math.max(u,l),u=this.getConstrainedResolution(u,s?0:1);var f=this.getRotation(),d=Math.sin(f),h=Math.cos(f),p=ed(c);p[0]+=(a[1]-a[3])/2*u,p[1]+=(a[0]-a[2])/2*u;var m=p[0]*h-p[1]*d,g=p[1]*h+p[0]*d,v=this.getConstrainedCenter([m,g],u),y=i.callback?i.callback:ip;i.duration!==void 0?this.animateInternal({resolution:u,center:v,duration:i.duration,easing:i.easing},y):(this.targetResolution_=u,this.targetCenter_=v,this.applyTargetState_(!1,!0),CS(y,!0))},e.prototype.centerOn=function(n,r,i){this.centerOnInternal(js(n,this.getProjection()),r,i)},e.prototype.centerOnInternal=function(n,r,i){this.setCenterInternal(VA(n,r,i,this.getResolution(),this.getRotation()))},e.prototype.calculateCenterShift=function(n,r,i,o){var a,s=this.padding_;if(s&&n){var l=this.getViewportSizeMinusPadding_(-i),c=VA(n,o,[l[0]/2+s[3],l[1]/2+s[0]],r,i);a=[n[0]-c[0],n[1]-c[1]]}return a},e.prototype.isDef=function(){return!!this.getCenterInternal()&&this.getResolution()!==void 0},e.prototype.adjustCenter=function(n){var r=e3(this.targetCenter_,this.getProjection());this.setCenter([r[0]+n[0],r[1]+n[1]])},e.prototype.adjustCenterInternal=function(n){var r=this.targetCenter_;this.setCenterInternal([r[0]+n[0],r[1]+n[1]])},e.prototype.adjustResolution=function(n,r){var i=r&&js(r,this.getProjection());this.adjustResolutionInternal(n,i)},e.prototype.adjustResolutionInternal=function(n,r){var i=this.getAnimating()||this.getInteracting(),o=this.getViewportSize_(this.getRotation()),a=this.constraints_.resolution(this.targetResolution_*n,0,o,i);r&&(this.targetCenter_=this.calculateCenterZoom(a,r)),this.targetResolution_*=n,this.applyTargetState_()},e.prototype.adjustZoom=function(n,r){this.adjustResolution(Math.pow(this.zoomFactor_,-n),r)},e.prototype.adjustRotation=function(n,r){r&&(r=js(r,this.getProjection())),this.adjustRotationInternal(n,r)},e.prototype.adjustRotationInternal=function(n,r){var i=this.getAnimating()||this.getInteracting(),o=this.constraints_.rotation(this.targetRotation_+n,i);r&&(this.targetCenter_=this.calculateCenterRotate(o,r)),this.targetRotation_+=n,this.applyTargetState_()},e.prototype.setCenter=function(n){this.setCenterInternal(n&&js(n,this.getProjection()))},e.prototype.setCenterInternal=function(n){this.targetCenter_=n,this.applyTargetState_()},e.prototype.setHint=function(n,r){return this.hints_[n]+=r,this.changed(),this.hints_[n]},e.prototype.setResolution=function(n){this.targetResolution_=n,this.applyTargetState_()},e.prototype.setRotation=function(n){this.targetRotation_=n,this.applyTargetState_()},e.prototype.setZoom=function(n){this.setResolution(this.getResolutionForZoom(n))},e.prototype.applyTargetState_=function(n,r){var i=this.getAnimating()||this.getInteracting()||r,o=this.constraints_.rotation(this.targetRotation_,i),a=this.getViewportSize_(o),s=this.constraints_.resolution(this.targetResolution_,0,a,i),l=this.constraints_.center(this.targetCenter_,s,a,i,this.calculateCenterShift(this.targetCenter_,s,o,a));this.get(Ms.ROTATION)!==o&&this.set(Ms.ROTATION,o),this.get(Ms.RESOLUTION)!==s&&(this.set(Ms.RESOLUTION,s),this.set("zoom",this.getZoom(),!0)),(!l||!this.get(Ms.CENTER)||!$T(this.get(Ms.CENTER),l))&&this.set(Ms.CENTER,l),this.getAnimating()&&!n&&this.cancelAnimations(),this.cancelAnchor_=void 0},e.prototype.resolveConstraints=function(n,r,i){var o=n!==void 0?n:200,a=r||0,s=this.constraints_.rotation(this.targetRotation_),l=this.getViewportSize_(s),c=this.constraints_.resolution(this.targetResolution_,a,l),u=this.constraints_.center(this.targetCenter_,c,l,!1,this.calculateCenterShift(this.targetCenter_,c,s,l));if(o===0&&!this.cancelAnchor_){this.targetResolution_=c,this.targetRotation_=s,this.targetCenter_=u,this.applyTargetState_();return}var f=i||(o===0?this.cancelAnchor_:void 0);this.cancelAnchor_=void 0,(this.getResolution()!==c||this.getRotation()!==s||!this.getCenterInternal()||!$T(this.getCenterInternal(),u))&&(this.getAnimating()&&this.cancelAnimations(),this.animateInternal({rotation:s,center:u,resolution:c,duration:o,easing:fy,anchor:f}))},e.prototype.beginInteraction=function(){this.resolveConstraints(0),this.setHint(Hi.INTERACTING,1)},e.prototype.endInteraction=function(n,r,i){var o=i&&js(i,this.getProjection());this.endInteractionInternal(n,r,o)},e.prototype.endInteractionInternal=function(n,r,i){this.setHint(Hi.INTERACTING,-1),this.resolveConstraints(n,r,i)},e.prototype.getConstrainedCenter=function(n,r){var i=this.getViewportSize_(this.getRotation());return this.constraints_.center(n,r||this.getResolution(),i)},e.prototype.getConstrainedZoom=function(n,r){var i=this.getResolutionForZoom(n);return this.getZoomForResolution(this.getConstrainedResolution(i,r))},e.prototype.getConstrainedResolution=function(n,r){var i=r||0,o=this.getViewportSize_(this.getRotation());return this.constraints_.resolution(n,i,o)},e}(sc);function CS(t,e){setTimeout(function(){t(e)},0)}function S5e(t){if(t.extent!==void 0){var e=t.smoothExtentConstraint!==void 0?t.smoothExtentConstraint:!0;return JG(t.extent,t.constrainOnlyCenter,e)}var n=iB(t.projection,"EPSG:3857");if(t.multiWorld!==!0&&n.isGlobal()){var r=n.getExtent().slice();return r[0]=-1/0,r[2]=1/0,JG(r,!1,!1)}return v5e}function O5e(t){var e,n,r,i=28,o=2,a=t.minZoom!==void 0?t.minZoom:WA,s=t.maxZoom!==void 0?t.maxZoom:i,l=t.zoomFactor!==void 0?t.zoomFactor:o,c=t.multiWorld!==void 0?t.multiWorld:!1,u=t.smoothResolutionConstraint!==void 0?t.smoothResolutionConstraint:!0,f=t.showFullExtent!==void 0?t.showFullExtent:!1,d=iB(t.projection,"EPSG:3857"),h=d.getExtent(),p=t.constrainOnlyCenter,m=t.extent;if(!c&&!m&&d.isGlobal()&&(p=!1,m=h),t.resolutions!==void 0){var g=t.resolutions;n=g[a],r=g[s]!==void 0?g[s]:g[g.length-1],t.constrainResolution?e=y5e(g,u,!p&&m,f):e=eH(n,r,u,!p&&m,f)}else{var v=h?Math.max(Kn(h),ps(h)):360*Ks[ci.DEGREES]/d.getMetersPerUnit(),y=v/TB/Math.pow(o,WA),x=y/Math.pow(o,i-WA);n=t.maxResolution,n!==void 0?a=0:n=y/Math.pow(l,a),r=t.minResolution,r===void 0&&(t.maxZoom!==void 0?t.maxResolution!==void 0?r=n/Math.pow(l,s):r=y/Math.pow(l,s):r=x),s=a+Math.floor(Math.log(n/r)/Math.log(l)),r=n/Math.pow(l,s-a),t.constrainResolution?e=x5e(l,n,r,u,!p&&m,f):e=eH(n,r,u,!p&&m,f)}return{constraint:e,maxResolution:n,minResolution:r,minZoom:a,zoomFactor:l}}function C5e(t){var e=t.enableRotation!==void 0?t.enableRotation:!0;if(e){var n=t.constrainRotation;return n===void 0||n===!0?_5e():n===!1?tH:typeof n=="number"?b5e(n):tH}else return MB}function T5e(t){return!(t.sourceCenter&&t.targetCenter&&!$T(t.sourceCenter,t.targetCenter)||t.sourceResolution!==t.targetResolution||t.sourceRotation!==t.targetRotation)}function VA(t,e,n,r,i){var o=Math.cos(-i),a=Math.sin(-i),s=t[0]*o-t[1]*a,l=t[1]*o+t[0]*a;s+=(e[0]/2-n[0])*r,l+=(n[1]-e[1]/2)*r,a=-a;var c=s*o-l*a,u=l*o+s*a;return[c,u]}var E5e=function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,i){r.__proto__=i}||function(r,i){for(var o in i)Object.prototype.hasOwnProperty.call(i,o)&&(r[o]=i[o])},t(e,n)};return function(e,n){if(typeof n!="function"&&n!==null)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");t(e,n);function r(){this.constructor=e}e.prototype=n===null?Object.create(n):(r.prototype=n.prototype,new r)}}();function Boe(t){if(t instanceof d2){t.setMapInternal(null);return}t instanceof p2&&t.getLayers().forEach(Boe)}function zoe(t,e){if(t instanceof d2){t.setMapInternal(e);return}if(t instanceof p2)for(var n=t.getLayers().getArray(),r=0,i=n.length;r<i;++r)zoe(n[r],e)}var P5e=function(t){E5e(e,t);function e(n){var r=t.call(this)||this;r.on,r.once,r.un;var i=M5e(n);r.renderComplete_,r.loaded_=!0,r.boundHandleBrowserEvent_=r.handleBrowserEvent.bind(r),r.maxTilesLoading_=n.maxTilesLoading!==void 0?n.maxTilesLoading:16,r.pixelRatio_=n.pixelRatio!==void 0?n.pixelRatio:Mie,r.postRenderTimeoutHandle_,r.animationDelayKey_,r.animationDelay_=(function(){this.animationDelayKey_=void 0,this.renderFrame_(Date.now())}).bind(r),r.coordinateToPixelTransform_=Hl(),r.pixelToCoordinateTransform_=Hl(),r.frameIndex_=0,r.frameState_=null,r.previousExtent_=null,r.viewPropertyListenerKey_=null,r.viewChangeListenerKey_=null,r.layerGroupPropertyListenerKeys_=null,r.viewport_=document.createElement("div"),r.viewport_.className="ol-viewport"+("ontouchstart"in window?" ol-touch":""),r.viewport_.style.position="relative",r.viewport_.style.overflow="hidden",r.viewport_.style.width="100%",r.viewport_.style.height="100%",r.overlayContainer_=document.createElement("div"),r.overlayContainer_.style.position="absolute",r.overlayContainer_.style.zIndex="0",r.overlayContainer_.style.width="100%",r.overlayContainer_.style.height="100%",r.overlayContainer_.style.pointerEvents="none",r.overlayContainer_.className="ol-overlaycontainer",r.viewport_.appendChild(r.overlayContainer_),r.overlayContainerStopEvent_=document.createElement("div"),r.overlayContainerStopEvent_.style.position="absolute",r.overlayContainerStopEvent_.style.zIndex="0",r.overlayContainerStopEvent_.style.width="100%",r.overlayContainerStopEvent_.style.height="100%",r.overlayContainerStopEvent_.style.pointerEvents="none",r.overlayContainerStopEvent_.className="ol-overlaycontainer-stopevent",r.viewport_.appendChild(r.overlayContainerStopEvent_),r.mapBrowserEventHandler_=null,r.moveTolerance_=n.moveTolerance,r.keyboardEventTarget_=i.keyboardEventTarget,r.targetChangeHandlerKeys_=null,r.controls=i.controls||new Qa,r.interactions=i.interactions||new Qa,r.overlays_=i.overlays,r.overlayIdIndex_={},r.renderer_=null,r.postRenderFunctions_=[],r.tileQueue_=new p5e(r.getTilePriority.bind(r),r.handleTileChange_.bind(r)),r.addChangeListener(Ui.LAYERGROUP,r.handleLayerGroupChanged_),r.addChangeListener(Ui.VIEW,r.handleViewChanged_),r.addChangeListener(Ui.SIZE,r.handleSizeChanged_),r.addChangeListener(Ui.TARGET,r.handleTargetChanged_),r.setProperties(i.values);var o=r;return n.view&&!(n.view instanceof Uc)&&n.view.then(function(a){o.setView(new Uc(a))}),r.controls.addEventListener(Oo.ADD,(function(a){a.element.setMap(this)}).bind(r)),r.controls.addEventListener(Oo.REMOVE,(function(a){a.element.setMap(null)}).bind(r)),r.interactions.addEventListener(Oo.ADD,(function(a){a.element.setMap(this)}).bind(r)),r.interactions.addEventListener(Oo.REMOVE,(function(a){a.element.setMap(null)}).bind(r)),r.overlays_.addEventListener(Oo.ADD,(function(a){this.addOverlayInternal_(a.element)}).bind(r)),r.overlays_.addEventListener(Oo.REMOVE,(function(a){var s=a.element,l=s.getId();l!==void 0&&delete this.overlayIdIndex_[l.toString()],a.element.setMap(null)}).bind(r)),r.controls.forEach((function(a){a.setMap(this)}).bind(r)),r.interactions.forEach((function(a){a.setMap(this)}).bind(r)),r.overlays_.forEach(r.addOverlayInternal_.bind(r)),r}return e.prototype.createRenderer=function(){throw new Error("Use a map type that has a createRenderer method")},e.prototype.addControl=function(n){this.getControls().push(n)},e.prototype.addInteraction=function(n){this.getInteractions().push(n)},e.prototype.addLayer=function(n){var r=this.getLayerGroup().getLayers();r.push(n)},e.prototype.handleLayerAdd_=function(n){zoe(n.layer,this)},e.prototype.addOverlay=function(n){this.getOverlays().push(n)},e.prototype.addOverlayInternal_=function(n){var r=n.getId();r!==void 0&&(this.overlayIdIndex_[r.toString()]=n),n.setMap(this)},e.prototype.disposeInternal=function(){this.controls.clear(),this.interactions.clear(),this.overlays_.clear(),this.setTarget(null),t.prototype.disposeInternal.call(this)},e.prototype.forEachFeatureAtPixel=function(n,r,i){if(!(!this.frameState_||!this.renderer_)){var o=this.getCoordinateFromPixelInternal(n);i=i!==void 0?i:{};var a=i.hitTolerance!==void 0?i.hitTolerance:0,s=i.layerFilter!==void 0?i.layerFilter:Fh,l=i.checkWrapped!==!1;return this.renderer_.forEachFeatureAtCoordinate(o,this.frameState_,a,l,r,null,s,null)}},e.prototype.getFeaturesAtPixel=function(n,r){var i=[];return this.forEachFeatureAtPixel(n,function(o){i.push(o)},r),i},e.prototype.getAllLayers=function(){var n=[];function r(i){i.forEach(function(o){o instanceof p2?r(o.getLayers()):n.push(o)})}return r(this.getLayers()),n},e.prototype.forEachLayerAtPixel=function(n,r,i){if(!(!this.frameState_||!this.renderer_)){var o=i||{},a=o.hitTolerance!==void 0?o.hitTolerance:0,s=o.layerFilter||Fh;return this.renderer_.forEachLayerAtPixel(n,this.frameState_,a,r,s)}},e.prototype.hasFeatureAtPixel=function(n,r){if(!this.frameState_||!this.renderer_)return!1;var i=this.getCoordinateFromPixelInternal(n);r=r!==void 0?r:{};var o=r.layerFilter!==void 0?r.layerFilter:Fh,a=r.hitTolerance!==void 0?r.hitTolerance:0,s=r.checkWrapped!==!1;return this.renderer_.hasFeatureAtCoordinate(i,this.frameState_,a,s,o,null)},e.prototype.getEventCoordinate=function(n){return this.getCoordinateFromPixel(this.getEventPixel(n))},e.prototype.getEventCoordinateInternal=function(n){return this.getCoordinateFromPixelInternal(this.getEventPixel(n))},e.prototype.getEventPixel=function(n){var r=this.viewport_.getBoundingClientRect(),i="changedTouches"in n?n.changedTouches[0]:n;return[i.clientX-r.left,i.clientY-r.top]},e.prototype.getTarget=function(){return this.get(Ui.TARGET)},e.prototype.getTargetElement=function(){var n=this.getTarget();return n!==void 0?typeof n=="string"?document.getElementById(n):n:null},e.prototype.getCoordinateFromPixel=function(n){return e3(this.getCoordinateFromPixelInternal(n),this.getView().getProjection())},e.prototype.getCoordinateFromPixelInternal=function(n){var r=this.frameState_;return r?Cr(r.pixelToCoordinateTransform,n.slice()):null},e.prototype.getControls=function(){return this.controls},e.prototype.getOverlays=function(){return this.overlays_},e.prototype.getOverlayById=function(n){var r=this.overlayIdIndex_[n.toString()];return r!==void 0?r:null},e.prototype.getInteractions=function(){return this.interactions},e.prototype.getLayerGroup=function(){return this.get(Ui.LAYERGROUP)},e.prototype.setLayers=function(n){var r=this.getLayerGroup();if(n instanceof Qa){r.setLayers(n);return}var i=r.getLayers();i.clear(),i.extend(n)},e.prototype.getLayers=function(){var n=this.getLayerGroup().getLayers();return n},e.prototype.getLoadingOrNotReady=function(){for(var n=this.getLayerGroup().getLayerStatesArray(),r=0,i=n.length;r<i;++r){var o=n[r];if(o.visible){var a=o.layer.getRenderer();if(a&&!a.ready)return!0;var s=o.layer.getSource();if(s&&s.loading)return!0}}return!1},e.prototype.getPixelFromCoordinate=function(n){var r=js(n,this.getView().getProjection());return this.getPixelFromCoordinateInternal(r)},e.prototype.getPixelFromCoordinateInternal=function(n){var r=this.frameState_;return r?Cr(r.coordinateToPixelTransform,n.slice(0,2)):null},e.prototype.getRenderer=function(){return this.renderer_},e.prototype.getSize=function(){return this.get(Ui.SIZE)},e.prototype.getView=function(){return this.get(Ui.VIEW)},e.prototype.getViewport=function(){return this.viewport_},e.prototype.getOverlayContainer=function(){return this.overlayContainer_},e.prototype.getOverlayContainerStopEvent=function(){return this.overlayContainerStopEvent_},e.prototype.getOwnerDocument=function(){var n=this.getTargetElement();return n?n.ownerDocument:document},e.prototype.getTilePriority=function(n,r,i,o){return m5e(this.frameState_,n,r,i,o)},e.prototype.handleBrowserEvent=function(n,r){var i=r||n.type,o=new Ac(i,this,n);this.handleMapBrowserEvent(o)},e.prototype.handleMapBrowserEvent=function(n){if(this.frameState_){var r=n.originalEvent,i=r.type;if(i===h3.POINTERDOWN||i===Mt.WHEEL||i===Mt.KEYDOWN){var o=this.getOwnerDocument(),a=this.viewport_.getRootNode?this.viewport_.getRootNode():o,s=r.target;if(this.overlayContainerStopEvent_.contains(s)||!(a===o?o.documentElement:a).contains(s))return}if(n.frameState=this.frameState_,this.dispatchEvent(n)!==!1)for(var l=this.getInteractions().getArray().slice(),c=l.length-1;c>=0;c--){var u=l[c];if(!(u.getMap()!==this||!u.getActive()||!this.getTargetElement())){var f=u.handleEvent(n);if(!f||n.propagationStopped)break}}}},e.prototype.handlePostRender=function(){var n=this.frameState_,r=this.tileQueue_;if(!r.isEmpty()){var i=this.maxTilesLoading_,o=i;if(n){var a=n.viewHints;if(a[Hi.ANIMATING]||a[Hi.INTERACTING]){var s=Date.now()-n.time>8;i=s?0:8,o=s?0:2}}r.getTilesLoading()<i&&(r.reprioritize(),r.loadMoreTiles(i,o))}n&&this.renderer_&&!n.animate&&(this.renderComplete_===!0?(this.hasListener(Bf.RENDERCOMPLETE)&&this.renderer_.dispatchRenderEvent(Bf.RENDERCOMPLETE,n),this.loaded_===!1&&(this.loaded_=!0,this.dispatchEvent(new zm(Yu.LOADEND,this,n)))):this.loaded_===!0&&(this.loaded_=!1,this.dispatchEvent(new zm(Yu.LOADSTART,this,n))));for(var l=this.postRenderFunctions_,c=0,u=l.length;c<u;++c)l[c](this,n);l.length=0},e.prototype.handleSizeChanged_=function(){this.getView()&&!this.getView().getAnimating()&&this.getView().resolveConstraints(0),this.render()},e.prototype.handleTargetChanged_=function(){if(this.mapBrowserEventHandler_){for(var n=0,r=this.targetChangeHandlerKeys_.length;n<r;++n)nr(this.targetChangeHandlerKeys_[n]);this.targetChangeHandlerKeys_=null,this.viewport_.removeEventListener(Mt.CONTEXTMENU,this.boundHandleBrowserEvent_),this.viewport_.removeEventListener(Mt.WHEEL,this.boundHandleBrowserEvent_),this.mapBrowserEventHandler_.dispose(),this.mapBrowserEventHandler_=null,l3(this.viewport_)}var i=this.getTargetElement();if(!i)this.renderer_&&(clearTimeout(this.postRenderTimeoutHandle_),this.postRenderTimeoutHandle_=void 0,this.postRenderFunctions_.length=0,this.renderer_.dispose(),this.renderer_=null),this.animationDelayKey_&&(cancelAnimationFrame(this.animationDelayKey_),this.animationDelayKey_=void 0);else{i.appendChild(this.viewport_),this.renderer_||(this.renderer_=this.createRenderer()),this.mapBrowserEventHandler_=new f5e(this,this.moveTolerance_);for(var o in Sn)this.mapBrowserEventHandler_.addEventListener(Sn[o],this.handleMapBrowserEvent.bind(this));this.viewport_.addEventListener(Mt.CONTEXTMENU,this.boundHandleBrowserEvent_,!1),this.viewport_.addEventListener(Mt.WHEEL,this.boundHandleBrowserEvent_,kie?{passive:!1}:!1);var a=this.getOwnerDocument().defaultView,s=this.keyboardEventTarget_?this.keyboardEventTarget_:i;this.targetChangeHandlerKeys_=[rn(s,Mt.KEYDOWN,this.handleBrowserEvent,this),rn(s,Mt.KEYPRESS,this.handleBrowserEvent,this),rn(a,Mt.RESIZE,this.updateSize,this)]}this.updateSize()},e.prototype.handleTileChange_=function(){this.render()},e.prototype.handleViewPropertyChanged_=function(){this.render()},e.prototype.handleViewChanged_=function(){this.viewPropertyListenerKey_&&(nr(this.viewPropertyListenerKey_),this.viewPropertyListenerKey_=null),this.viewChangeListenerKey_&&(nr(this.viewChangeListenerKey_),this.viewChangeListenerKey_=null);var n=this.getView();n&&(this.updateViewportSize_(),this.viewPropertyListenerKey_=rn(n,nv.PROPERTYCHANGE,this.handleViewPropertyChanged_,this),this.viewChangeListenerKey_=rn(n,Mt.CHANGE,this.handleViewPropertyChanged_,this),n.resolveConstraints(0)),this.render()},e.prototype.handleLayerGroupChanged_=function(){this.layerGroupPropertyListenerKeys_&&(this.layerGroupPropertyListenerKeys_.forEach(nr),this.layerGroupPropertyListenerKeys_=null);var n=this.getLayerGroup();n&&(this.handleLayerAdd_(new lf("addlayer",n)),this.layerGroupPropertyListenerKeys_=[rn(n,nv.PROPERTYCHANGE,this.render,this),rn(n,Mt.CHANGE,this.render,this),rn(n,"addlayer",this.handleLayerAdd_,this),rn(n,"removelayer",this.handleLayerRemove_,this)]),this.render()},e.prototype.isRendered=function(){return!!this.frameState_},e.prototype.renderSync=function(){this.animationDelayKey_&&cancelAnimationFrame(this.animationDelayKey_),this.animationDelay_()},e.prototype.redrawText=function(){for(var n=this.getLayerGroup().getLayerStatesArray(),r=0,i=n.length;r<i;++r){var o=n[r].layer;o.hasRenderer()&&o.getRenderer().handleFontsChanged()}},e.prototype.render=function(){this.renderer_&&this.animationDelayKey_===void 0&&(this.animationDelayKey_=requestAnimationFrame(this.animationDelay_))},e.prototype.removeControl=function(n){return this.getControls().remove(n)},e.prototype.removeInteraction=function(n){return this.getInteractions().remove(n)},e.prototype.removeLayer=function(n){var r=this.getLayerGroup().getLayers();return r.remove(n)},e.prototype.handleLayerRemove_=function(n){Boe(n.layer)},e.prototype.removeOverlay=function(n){return this.getOverlays().remove(n)},e.prototype.renderFrame_=function(n){var r=this,i=this.getSize(),o=this.getView(),a=this.frameState_,s=null;if(i!==void 0&&RG(i)&&o&&o.isDef()){var l=o.getHints(this.frameState_?this.frameState_.viewHints:void 0),c=o.getState();if(s={animate:!1,coordinateToPixelTransform:this.coordinateToPixelTransform_,declutterTree:null,extent:YL(c.center,c.resolution,c.rotation,i),index:this.frameIndex_++,layerIndex:0,layerStatesArray:this.getLayerGroup().getLayerStatesArray(),pixelRatio:this.pixelRatio_,pixelToCoordinateTransform:this.pixelToCoordinateTransform_,postRenderFunctions:[],size:i,tileQueue:this.tileQueue_,time:n,usedTiles:{},viewState:c,viewHints:l,wantedTiles:{},mapId:vn(this),renderTargets:{}},c.nextCenter&&c.nextResolution){var u=isNaN(c.nextRotation)?c.rotation:c.nextRotation;s.nextExtent=YL(c.nextCenter,c.nextResolution,u,i)}}if(this.frameState_=s,this.renderer_.renderFrame(s),s){if(s.animate&&this.render(),Array.prototype.push.apply(this.postRenderFunctions_,s.postRenderFunctions),a){var f=!this.previousExtent_||!tB(this.previousExtent_)&&!jb(s.extent,this.previousExtent_);f&&(this.dispatchEvent(new zm(Yu.MOVESTART,this,a)),this.previousExtent_=U1(this.previousExtent_))}var d=this.previousExtent_&&!s.viewHints[Hi.ANIMATING]&&!s.viewHints[Hi.INTERACTING]&&!jb(s.extent,this.previousExtent_);d&&(this.dispatchEvent(new zm(Yu.MOVEEND,this,s)),Rie(s.extent,this.previousExtent_))}this.dispatchEvent(new zm(Yu.POSTRENDER,this,s)),this.renderComplete_=this.hasListener(Yu.LOADSTART)||this.hasListener(Yu.LOADEND)||this.hasListener(Bf.RENDERCOMPLETE)?!this.tileQueue_.getTilesLoading()&&!this.tileQueue_.getCount()&&!this.getLoadingOrNotReady():void 0,this.postRenderTimeoutHandle_||(this.postRenderTimeoutHandle_=setTimeout(function(){r.postRenderTimeoutHandle_=void 0,r.handlePostRender()},0))},e.prototype.setLayerGroup=function(n){var r=this.getLayerGroup();r&&this.handleLayerRemove_(new lf("removelayer",r)),this.set(Ui.LAYERGROUP,n)},e.prototype.setSize=function(n){this.set(Ui.SIZE,n)},e.prototype.setTarget=function(n){this.set(Ui.TARGET,n)},e.prototype.setView=function(n){if(!n||n instanceof Uc){this.set(Ui.VIEW,n);return}this.set(Ui.VIEW,new Uc);var r=this;n.then(function(i){r.setView(new Uc(i))})},e.prototype.updateSize=function(){var n=this.getTargetElement(),r=void 0;if(n){var i=getComputedStyle(n),o=n.offsetWidth-parseFloat(i.borderLeftWidth)-parseFloat(i.paddingLeft)-parseFloat(i.paddingRight)-parseFloat(i.borderRightWidth),a=n.offsetHeight-parseFloat(i.borderTopWidth)-parseFloat(i.paddingTop)-parseFloat(i.paddingBottom)-parseFloat(i.borderBottomWidth);!isNaN(o)&&!isNaN(a)&&(r=[o,a],!RG(r)&&(n.offsetWidth||n.offsetHeight||n.getClientRects().length)&&console.warn("No map visible because the map container's width or height are 0."))}this.setSize(r),this.updateViewportSize_()},e.prototype.updateViewportSize_=function(){var n=this.getView();if(n){var r=void 0,i=getComputedStyle(this.viewport_);i.width&&i.height&&(r=[parseInt(i.width,10),parseInt(i.height,10)]),n.setViewportSize(r)}},e}(sc);function M5e(t){var e=null;t.keyboardEventTarget!==void 0&&(e=typeof t.keyboardEventTarget=="string"?document.getElementById(t.keyboardEventTarget):t.keyboardEventTarget);var n={},r=t.layers&&typeof t.layers.getLayers=="function"?t.layers:new p2({layers:t.layers});n[Ui.LAYERGROUP]=r,n[Ui.TARGET]=t.target,n[Ui.VIEW]=t.view instanceof Uc?t.view:new Uc;var i;t.controls!==void 0&&(Array.isArray(t.controls)?i=new Qa(t.controls.slice()):(Ut(typeof t.controls.getArray=="function",47),i=t.controls));var o;t.interactions!==void 0&&(Array.isArray(t.interactions)?o=new Qa(t.interactions.slice()):(Ut(typeof t.interactions.getArray=="function",48),o=t.interactions));var a;return t.overlays!==void 0?Array.isArray(t.overlays)?a=new Qa(t.overlays.slice()):(Ut(typeof t.overlays.getArray=="function",49),a=t.overlays):a=new Qa,{controls:i,interactions:o,keyboardEventTarget:e,overlays:a,values:n}}var k5e=function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,i){r.__proto__=i}||function(r,i){for(var o in i)Object.prototype.hasOwnProperty.call(i,o)&&(r[o]=i[o])},t(e,n)};return function(e,n){if(typeof n!="function"&&n!==null)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");t(e,n);function r(){this.constructor=e}e.prototype=n===null?Object.create(n):(r.prototype=n.prototype,new r)}}(),m2=function(t){k5e(e,t);function e(n){var r=t.call(this)||this,i=n.element;return i&&!n.target&&!i.style.pointerEvents&&(i.style.pointerEvents="auto"),r.element=i||null,r.target_=null,r.map_=null,r.listenerKeys=[],n.render&&(r.render=n.render),n.target&&r.setTarget(n.target),r}return e.prototype.disposeInternal=function(){l3(this.element),t.prototype.disposeInternal.call(this)},e.prototype.getMap=function(){return this.map_},e.prototype.setMap=function(n){this.map_&&l3(this.element);for(var r=0,i=this.listenerKeys.length;r<i;++r)nr(this.listenerKeys[r]);if(this.listenerKeys.length=0,this.map_=n,n){var o=this.target_?this.target_:n.getOverlayContainerStopEvent();o.appendChild(this.element),this.render!==ip&&this.listenerKeys.push(rn(n,Yu.POSTRENDER,this.render,this)),n.render()}},e.prototype.render=function(n){},e.prototype.setTarget=function(n){this.target_=typeof n=="string"?document.getElementById(n):n},e}(sc),A5e=function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,i){r.__proto__=i}||function(r,i){for(var o in i)Object.prototype.hasOwnProperty.call(i,o)&&(r[o]=i[o])},t(e,n)};return function(e,n){if(typeof n!="function"&&n!==null)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");t(e,n);function r(){this.constructor=e}e.prototype=n===null?Object.create(n):(r.prototype=n.prototype,new r)}}(),R5e=function(t){A5e(e,t);function e(n){var r=this,i=n||{};r=t.call(this,{element:document.createElement("div"),render:i.render,target:i.target})||this,r.ulElement_=document.createElement("ul"),r.collapsed_=i.collapsed!==void 0?i.collapsed:!0,r.userCollapsed_=r.collapsed_,r.overrideCollapsible_=i.collapsible!==void 0,r.collapsible_=i.collapsible!==void 0?i.collapsible:!0,r.collapsible_||(r.collapsed_=!1);var o=i.className!==void 0?i.className:"ol-attribution",a=i.tipLabel!==void 0?i.tipLabel:"Attributions",s=i.expandClassName!==void 0?i.expandClassName:o+"-expand",l=i.collapseLabel!==void 0?i.collapseLabel:"›",c=i.collapseClassName!==void 0?i.collapseClassName:o+"-collapse";typeof l=="string"?(r.collapseLabel_=document.createElement("span"),r.collapseLabel_.textContent=l,r.collapseLabel_.className=c):r.collapseLabel_=l;var u=i.label!==void 0?i.label:"i";typeof u=="string"?(r.label_=document.createElement("span"),r.label_.textContent=u,r.label_.className=s):r.label_=u;var f=r.collapsible_&&!r.collapsed_?r.collapseLabel_:r.label_;r.toggleButton_=document.createElement("button"),r.toggleButton_.setAttribute("type","button"),r.toggleButton_.setAttribute("aria-expanded",String(!r.collapsed_)),r.toggleButton_.title=a,r.toggleButton_.appendChild(f),r.toggleButton_.addEventListener(Mt.CLICK,r.handleClick_.bind(r),!1);var d=o+" "+q1+" "+SB+(r.collapsed_&&r.collapsible_?" "+LG:"")+(r.collapsible_?"":" ol-uncollapsible"),h=r.element;return h.className=d,h.appendChild(r.toggleButton_),h.appendChild(r.ulElement_),r.renderedAttributions_=[],r.renderedVisible_=!0,r}return e.prototype.collectSourceAttributions_=function(n){for(var r={},i=[],o=!0,a=n.layerStatesArray,s=0,l=a.length;s<l;++s){var c=a[s];if(XT(c,n.viewState)){var u=c.layer.getSource();if(u){var f=u.getAttributions();if(f){var d=f(n);if(d)if(o=o&&u.getAttributionsCollapsible()!==!1,Array.isArray(d))for(var h=0,p=d.length;h<p;++h)d[h]in r||(i.push(d[h]),r[d[h]]=!0);else d in r||(i.push(d),r[d]=!0)}}}}return this.overrideCollapsible_||this.setCollapsible(o),i},e.prototype.updateElement_=function(n){if(!n){this.renderedVisible_&&(this.element.style.display="none",this.renderedVisible_=!1);return}var r=this.collectSourceAttributions_(n),i=r.length>0;if(this.renderedVisible_!=i&&(this.element.style.display=i?"":"none",this.renderedVisible_=i),!kp(r,this.renderedAttributions_)){TFe(this.ulElement_);for(var o=0,a=r.length;o<a;++o){var s=document.createElement("li");s.innerHTML=r[o],this.ulElement_.appendChild(s)}this.renderedAttributions_=r}},e.prototype.handleClick_=function(n){n.preventDefault(),this.handleToggle_(),this.userCollapsed_=this.collapsed_},e.prototype.handleToggle_=function(){this.element.classList.toggle(LG),this.collapsed_?DG(this.collapseLabel_,this.label_):DG(this.label_,this.collapseLabel_),this.collapsed_=!this.collapsed_,this.toggleButton_.setAttribute("aria-expanded",String(!this.collapsed_))},e.prototype.getCollapsible=function(){return this.collapsible_},e.prototype.setCollapsible=function(n){this.collapsible_!==n&&(this.collapsible_=n,this.element.classList.toggle("ol-uncollapsible"),this.userCollapsed_&&this.handleToggle_())},e.prototype.setCollapsed=function(n){this.userCollapsed_=n,!(!this.collapsible_||this.collapsed_===n)&&this.handleToggle_()},e.prototype.getCollapsed=function(){return this.collapsed_},e.prototype.render=function(n){this.updateElement_(n.frameState)},e}(m2),I5e=function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,i){r.__proto__=i}||function(r,i){for(var o in i)Object.prototype.hasOwnProperty.call(i,o)&&(r[o]=i[o])},t(e,n)};return function(e,n){if(typeof n!="function"&&n!==null)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");t(e,n);function r(){this.constructor=e}e.prototype=n===null?Object.create(n):(r.prototype=n.prototype,new r)}}(),D5e=function(t){I5e(e,t);function e(n){var r=this,i=n||{};r=t.call(this,{element:document.createElement("div"),render:i.render,target:i.target})||this;var o=i.className!==void 0?i.className:"ol-rotate",a=i.label!==void 0?i.label:"⇧",s=i.compassClassName!==void 0?i.compassClassName:"ol-compass";r.label_=null,typeof a=="string"?(r.label_=document.createElement("span"),r.label_.className=s,r.label_.textContent=a):(r.label_=a,r.label_.classList.add(s));var l=i.tipLabel?i.tipLabel:"Reset rotation",c=document.createElement("button");c.className=o+"-reset",c.setAttribute("type","button"),c.title=l,c.appendChild(r.label_),c.addEventListener(Mt.CLICK,r.handleClick_.bind(r),!1);var u=o+" "+q1+" "+SB,f=r.element;return f.className=u,f.appendChild(c),r.callResetNorth_=i.resetNorth?i.resetNorth:void 0,r.duration_=i.duration!==void 0?i.duration:250,r.autoHide_=i.autoHide!==void 0?i.autoHide:!0,r.rotation_=void 0,r.autoHide_&&r.element.classList.add(_S),r}return e.prototype.handleClick_=function(n){n.preventDefault(),this.callResetNorth_!==void 0?this.callResetNorth_():this.resetNorth_()},e.prototype.resetNorth_=function(){var n=this.getMap(),r=n.getView();if(r){var i=r.getRotation();i!==void 0&&(this.duration_>0&&i%(2*Math.PI)!==0?r.animate({rotation:0,duration:this.duration_,easing:fy}):r.setRotation(0))}},e.prototype.render=function(n){var r=n.frameState;if(r){var i=r.viewState.rotation;if(i!=this.rotation_){var o="rotate("+i+"rad)";if(this.autoHide_){var a=this.element.classList.contains(_S);!a&&i===0?this.element.classList.add(_S):a&&i!==0&&this.element.classList.remove(_S)}this.label_.style.transform=o}this.rotation_=i}},e}(m2),L5e=function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,i){r.__proto__=i}||function(r,i){for(var o in i)Object.prototype.hasOwnProperty.call(i,o)&&(r[o]=i[o])},t(e,n)};return function(e,n){if(typeof n!="function"&&n!==null)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");t(e,n);function r(){this.constructor=e}e.prototype=n===null?Object.create(n):(r.prototype=n.prototype,new r)}}(),N5e=function(t){L5e(e,t);function e(n){var r=this,i=n||{};r=t.call(this,{element:document.createElement("div"),target:i.target})||this;var o=i.className!==void 0?i.className:"ol-zoom",a=i.delta!==void 0?i.delta:1,s=i.zoomInClassName!==void 0?i.zoomInClassName:o+"-in",l=i.zoomOutClassName!==void 0?i.zoomOutClassName:o+"-out",c=i.zoomInLabel!==void 0?i.zoomInLabel:"+",u=i.zoomOutLabel!==void 0?i.zoomOutLabel:"–",f=i.zoomInTipLabel!==void 0?i.zoomInTipLabel:"Zoom in",d=i.zoomOutTipLabel!==void 0?i.zoomOutTipLabel:"Zoom out",h=document.createElement("button");h.className=s,h.setAttribute("type","button"),h.title=f,h.appendChild(typeof c=="string"?document.createTextNode(c):c),h.addEventListener(Mt.CLICK,r.handleClick_.bind(r,a),!1);var p=document.createElement("button");p.className=l,p.setAttribute("type","button"),p.title=d,p.appendChild(typeof u=="string"?document.createTextNode(u):u),p.addEventListener(Mt.CLICK,r.handleClick_.bind(r,-a),!1);var m=o+" "+q1+" "+SB,g=r.element;return g.className=m,g.appendChild(h),g.appendChild(p),r.duration_=i.duration!==void 0?i.duration:250,r}return e.prototype.handleClick_=function(n,r){r.preventDefault(),this.zoomByDelta_(n)},e.prototype.zoomByDelta_=function(n){var r=this.getMap(),i=r.getView();if(i){var o=i.getZoom();if(o!==void 0){var a=i.getConstrainedZoom(o+n);this.duration_>0?(i.getAnimating()&&i.cancelAnimations(),i.animate({zoom:a,duration:this.duration_,easing:fy})):i.setZoom(a)}}},e}(m2),$5e=function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,i){r.__proto__=i}||function(r,i){for(var o in i)Object.prototype.hasOwnProperty.call(i,o)&&(r[o]=i[o])},t(e,n)};return function(e,n){if(typeof n!="function"&&n!==null)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");t(e,n);function r(){this.constructor=e}e.prototype=n===null?Object.create(n):(r.prototype=n.prototype,new r)}}(),GA="units",jd={DEGREES:"degrees",IMPERIAL:"imperial",NAUTICAL:"nautical",METRIC:"metric",US:"us"},F5e=[1,2,5],w0=25.4/.28,j5e=function(t){$5e(e,t);function e(n){var r=this,i=n||{},o=i.className!==void 0?i.className:i.bar?"ol-scale-bar":"ol-scale-line";return r=t.call(this,{element:document.createElement("div"),render:i.render,target:i.target})||this,r.on,r.once,r.un,r.innerElement_=document.createElement("div"),r.innerElement_.className=o+"-inner",r.element.className=o+" "+q1,r.element.appendChild(r.innerElement_),r.viewState_=null,r.minWidth_=i.minWidth!==void 0?i.minWidth:64,r.maxWidth_=i.maxWidth,r.renderedVisible_=!1,r.renderedWidth_=void 0,r.renderedHTML_="",r.addChangeListener(GA,r.handleUnitsChanged_),r.setUnits(i.units||jd.METRIC),r.scaleBar_=i.bar||!1,r.scaleBarSteps_=i.steps||4,r.scaleBarText_=i.text||!1,r.dpi_=i.dpi||void 0,r}return e.prototype.getUnits=function(){return this.get(GA)},e.prototype.handleUnitsChanged_=function(){this.updateElement_()},e.prototype.setUnits=function(n){this.set(GA,n)},e.prototype.setDpi=function(n){this.dpi_=n},e.prototype.updateElement_=function(){var n=this.viewState_;if(!n){this.renderedVisible_&&(this.element.style.display="none",this.renderedVisible_=!1);return}var r=n.center,i=n.projection,o=this.getUnits(),a=o==jd.DEGREES?ci.DEGREES:ci.METERS,s=FT(i,n.resolution,r,a),l=this.minWidth_*(this.dpi_||w0)/w0,c=this.maxWidth_!==void 0?this.maxWidth_*(this.dpi_||w0)/w0:void 0,u=l*s,f="";if(o==jd.DEGREES){var d=Ks[ci.DEGREES];u*=d,u<d/60?(f="″",s*=3600):u<d?(f="′",s*=60):f="°"}else o==jd.IMPERIAL?u<.9144?(f="in",s/=.0254):u<1609.344?(f="ft",s/=.3048):(f="mi",s/=1609.344):o==jd.NAUTICAL?(s/=1852,f="NM"):o==jd.METRIC?u<.001?(f="μm",s*=1e6):u<1?(f="mm",s*=1e3):u<1e3?f="m":(f="km",s/=1e3):o==jd.US?u<.9144?(f="in",s*=39.37):u<1609.344?(f="ft",s/=.30480061):(f="mi",s/=1609.3472):Ut(!1,33);for(var h=3*Math.floor(Math.log(l*s)/Math.log(10)),p,m,g,v,y,x;;){g=Math.floor(h/3);var b=Math.pow(10,g);if(p=F5e[(h%3+3)%3]*b,m=Math.round(p/s),isNaN(m)){this.element.style.display="none",this.renderedVisible_=!1;return}if(c!==void 0&&m>=c){p=v,m=y,g=x;break}else if(m>=l)break;v=p,y=m,x=g,++h}var _;this.scaleBar_?_=this.createScaleBar(m,p,f):_=p.toFixed(g<0?-g:0)+" "+f,this.renderedHTML_!=_&&(this.innerElement_.innerHTML=_,this.renderedHTML_=_),this.renderedWidth_!=m&&(this.innerElement_.style.width=m+"px",this.renderedWidth_=m),this.renderedVisible_||(this.element.style.display="",this.renderedVisible_=!0)},e.prototype.createScaleBar=function(n,r,i){for(var o="1 : "+Math.round(this.getScaleForResolution()).toLocaleString(),a=[],s=n/this.scaleBarSteps_,l="ol-scale-singlebar-odd",c=0;c<this.scaleBarSteps_;c++)c===0&&a.push(this.createMarker("absolute",c)),a.push('<div><div class="ol-scale-singlebar '+l+'" style="width: '+s+'px;"></div>'+this.createMarker("relative",c)+(c%2===0||this.scaleBarSteps_===2?this.createStepText(c,n,!1,r,i):"")+"</div>"),c===this.scaleBarSteps_-1&&a.push(this.createStepText(c+1,n,!0,r,i)),l=l==="ol-scale-singlebar-odd"?"ol-scale-singlebar-even":"ol-scale-singlebar-odd";var u;this.scaleBarText_?u='<div class="ol-scale-text" style="width: '+n+'px;">'+o+"</div>":u="";var f='<div style="display: flex;">'+u+a.join("")+"</div>";return f},e.prototype.createMarker=function(n,r){var i=n==="absolute"?3:-10;return'<div class="ol-scale-step-marker" style="position: '+n+";top: "+i+'px;"></div>'},e.prototype.createStepText=function(n,r,i,o,a){var s=n===0?0:Math.round(o/this.scaleBarSteps_*n*100)/100,l=s+(n===0?"":" "+a),c=n===0?-3:r/this.scaleBarSteps_*-1,u=n===0?0:r/this.scaleBarSteps_*2;return'<div class="ol-scale-step-text" style="margin-left: '+c+"px;text-align: "+(n===0?"left":"center")+"; min-width: "+u+"px;left: "+(i?r+"px":"unset")+';">'+l+"</div>"},e.prototype.getScaleForResolution=function(){var n=FT(this.viewState_.projection,this.viewState_.resolution,this.viewState_.center,ci.METERS),r=this.dpi_||w0,i=1e3/25.4;return parseFloat(n.toString())*i*r},e.prototype.render=function(n){var r=n.frameState;r?this.viewState_=r.viewState:this.viewState_=null,this.updateElement_()},e}(m2);function B5e(t){var e={},n=new Qa,r=e.zoom!==void 0?e.zoom:!0;r&&n.push(new N5e(e.zoomOptions));var i=e.rotate!==void 0?e.rotate:!0;i&&n.push(new D5e(e.rotateOptions));var o=e.attribution!==void 0?e.attribution:!0;return o&&n.push(new R5e(e.attributionOptions)),n}const p3={ACTIVE:"active"};var z5e=function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,i){r.__proto__=i}||function(r,i){for(var o in i)Object.prototype.hasOwnProperty.call(i,o)&&(r[o]=i[o])},t(e,n)};return function(e,n){if(typeof n!="function"&&n!==null)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");t(e,n);function r(){this.constructor=e}e.prototype=n===null?Object.create(n):(r.prototype=n.prototype,new r)}}(),K1=function(t){z5e(e,t);function e(n){var r=t.call(this)||this;return r.on,r.once,r.un,n&&n.handleEvent&&(r.handleEvent=n.handleEvent),r.map_=null,r.setActive(!0),r}return e.prototype.getActive=function(){return this.get(p3.ACTIVE)},e.prototype.getMap=function(){return this.map_},e.prototype.handleEvent=function(n){return!0},e.prototype.setActive=function(n){this.set(p3.ACTIVE,n)},e.prototype.setMap=function(n){this.map_=n},e}(sc);function U5e(t,e,n){var r=t.getCenterInternal();if(r){var i=[r[0]+e[0],r[1]+e[1]];t.animateInternal({duration:n!==void 0?n:250,easing:Kje,center:t.getConstrainedCenter(i)})}}function kB(t,e,n,r){var i=t.getZoom();if(i!==void 0){var o=t.getConstrainedZoom(i+e),a=t.getResolutionForZoom(o);t.getAnimating()&&t.cancelAnimations(),t.animate({resolution:a,anchor:n,duration:r!==void 0?r:250,easing:fy})}}var W5e=function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,i){r.__proto__=i}||function(r,i){for(var o in i)Object.prototype.hasOwnProperty.call(i,o)&&(r[o]=i[o])},t(e,n)};return function(e,n){if(typeof n!="function"&&n!==null)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");t(e,n);function r(){this.constructor=e}e.prototype=n===null?Object.create(n):(r.prototype=n.prototype,new r)}}(),V5e=function(t){W5e(e,t);function e(n){var r=t.call(this)||this,i=n||{};return r.delta_=i.delta?i.delta:1,r.duration_=i.duration!==void 0?i.duration:250,r}return e.prototype.handleEvent=function(n){var r=!1;if(n.type==Sn.DBLCLICK){var i=n.originalEvent,o=n.map,a=n.coordinate,s=i.shiftKey?-this.delta_:this.delta_,l=o.getView();kB(l,s,a,this.duration_),i.preventDefault(),r=!0}return!r},e}(K1),G5e=function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,i){r.__proto__=i}||function(r,i){for(var o in i)Object.prototype.hasOwnProperty.call(i,o)&&(r[o]=i[o])},t(e,n)};return function(e,n){if(typeof n!="function"&&n!==null)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");t(e,n);function r(){this.constructor=e}e.prototype=n===null?Object.create(n):(r.prototype=n.prototype,new r)}}(),dy=function(t){G5e(e,t);function e(n){var r=this,i=n||{};return r=t.call(this,i)||this,i.handleDownEvent&&(r.handleDownEvent=i.handleDownEvent),i.handleDragEvent&&(r.handleDragEvent=i.handleDragEvent),i.handleMoveEvent&&(r.handleMoveEvent=i.handleMoveEvent),i.handleUpEvent&&(r.handleUpEvent=i.handleUpEvent),i.stopDown&&(r.stopDown=i.stopDown),r.handlingDownUpSequence=!1,r.targetPointers=[],r}return e.prototype.getPointerCount=function(){return this.targetPointers.length},e.prototype.handleDownEvent=function(n){return!1},e.prototype.handleDragEvent=function(n){},e.prototype.handleEvent=function(n){if(!n.originalEvent)return!0;var r=!1;if(this.updateTrackedPointers_(n),this.handlingDownUpSequence){if(n.type==Sn.POINTERDRAG)this.handleDragEvent(n),n.originalEvent.preventDefault();else if(n.type==Sn.POINTERUP){var i=this.handleUpEvent(n);this.handlingDownUpSequence=i&&this.targetPointers.length>0}}else if(n.type==Sn.POINTERDOWN){var o=this.handleDownEvent(n);this.handlingDownUpSequence=o,r=this.stopDown(o)}else n.type==Sn.POINTERMOVE&&this.handleMoveEvent(n);return!r},e.prototype.handleMoveEvent=function(n){},e.prototype.handleUpEvent=function(n){return!1},e.prototype.stopDown=function(n){return n},e.prototype.updateTrackedPointers_=function(n){n.activePointers&&(this.targetPointers=n.activePointers)},e}(K1);function AB(t){for(var e=t.length,n=0,r=0,i=0;i<e;i++)n+=t[i].clientX,r+=t[i].clientY;return[n/e,r/e]}function m3(t){var e=arguments;return function(n){for(var r=!0,i=0,o=e.length;i<o&&(r=r&&e[i](n),!!r);++i);return r}}var H5e=function(t){var e=t.originalEvent;return e.altKey&&!(e.metaKey||e.ctrlKey)&&e.shiftKey},q5e=function(t){var e=t.map.getTargetElement(),n=t.map.getOwnerDocument().activeElement;return e.contains(n)},Uoe=function(t){return t.map.getTargetElement().hasAttribute("tabindex")?q5e(t):!0},Woe=Fh,Voe=function(t){var e=t.originalEvent;return e.button==0&&!(z3e&&U3e&&e.ctrlKey)},RB=function(t){var e=t.originalEvent;return!e.altKey&&!(e.metaKey||e.ctrlKey)&&!e.shiftKey},Goe=function(t){var e=t.originalEvent;return!e.altKey&&!(e.metaKey||e.ctrlKey)&&e.shiftKey},Hoe=function(t){var e=t.originalEvent,n=e.target.tagName;return n!=="INPUT"&&n!=="SELECT"&&n!=="TEXTAREA"&&!e.target.isContentEditable},HA=function(t){var e=t.originalEvent;return Ut(e!==void 0,56),e.pointerType=="mouse"},X5e=function(t){var e=t.originalEvent;return Ut(e!==void 0,56),e.isPrimary&&e.button===0},Q5e=function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,i){r.__proto__=i}||function(r,i){for(var o in i)Object.prototype.hasOwnProperty.call(i,o)&&(r[o]=i[o])},t(e,n)};return function(e,n){if(typeof n!="function"&&n!==null)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");t(e,n);function r(){this.constructor=e}e.prototype=n===null?Object.create(n):(r.prototype=n.prototype,new r)}}(),Y5e=function(t){Q5e(e,t);function e(n){var r=t.call(this,{stopDown:F1})||this,i=n||{};r.kinetic_=i.kinetic,r.lastCentroid=null,r.lastPointersCount_,r.panning_=!1;var o=i.condition?i.condition:m3(RB,X5e);return r.condition_=i.onFocusOnly?m3(Uoe,o):o,r.noKinetic_=!1,r}return e.prototype.handleDragEvent=function(n){this.panning_||(this.panning_=!0,this.getMap().getView().beginInteraction());var r=this.targetPointers,i=AB(r);if(r.length==this.lastPointersCount_){if(this.kinetic_&&this.kinetic_.update(i[0],i[1]),this.lastCentroid){var o=[this.lastCentroid[0]-i[0],i[1]-this.lastCentroid[1]],a=n.map,s=a.getView();xNe(o,s.getResolution()),nB(o,s.getRotation()),s.adjustCenterInternal(o)}}else this.kinetic_&&this.kinetic_.begin();this.lastCentroid=i,this.lastPointersCount_=r.length,n.originalEvent.preventDefault()},e.prototype.handleUpEvent=function(n){var r=n.map,i=r.getView();if(this.targetPointers.length===0){if(!this.noKinetic_&&this.kinetic_&&this.kinetic_.end()){var o=this.kinetic_.getDistance(),a=this.kinetic_.getAngle(),s=i.getCenterInternal(),l=r.getPixelFromCoordinateInternal(s),c=r.getCoordinateFromPixelInternal([l[0]-o*Math.cos(a),l[1]-o*Math.sin(a)]);i.animateInternal({center:i.getConstrainedCenter(c),duration:500,easing:fy})}return this.panning_&&(this.panning_=!1,i.endInteraction()),!1}else return this.kinetic_&&this.kinetic_.begin(),this.lastCentroid=null,!0},e.prototype.handleDownEvent=function(n){if(this.targetPointers.length>0&&this.condition_(n)){var r=n.map,i=r.getView();return this.lastCentroid=null,i.getAnimating()&&i.cancelAnimations(),this.kinetic_&&this.kinetic_.begin(),this.noKinetic_=this.targetPointers.length>1,!0}else return!1},e}(dy),K5e=function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,i){r.__proto__=i}||function(r,i){for(var o in i)Object.prototype.hasOwnProperty.call(i,o)&&(r[o]=i[o])},t(e,n)};return function(e,n){if(typeof n!="function"&&n!==null)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");t(e,n);function r(){this.constructor=e}e.prototype=n===null?Object.create(n):(r.prototype=n.prototype,new r)}}(),Z5e=function(t){K5e(e,t);function e(n){var r=this,i=n||{};return r=t.call(this,{stopDown:F1})||this,r.condition_=i.condition?i.condition:H5e,r.lastAngle_=void 0,r.duration_=i.duration!==void 0?i.duration:250,r}return e.prototype.handleDragEvent=function(n){if(HA(n)){var r=n.map,i=r.getView();if(i.getConstraints().rotation!==MB){var o=r.getSize(),a=n.pixel,s=Math.atan2(o[1]/2-a[1],a[0]-o[0]/2);if(this.lastAngle_!==void 0){var l=s-this.lastAngle_;i.adjustRotationInternal(-l)}this.lastAngle_=s}}},e.prototype.handleUpEvent=function(n){if(!HA(n))return!0;var r=n.map,i=r.getView();return i.endInteraction(this.duration_),!1},e.prototype.handleDownEvent=function(n){if(!HA(n))return!1;if(Voe(n)&&this.condition_(n)){var r=n.map;return r.getView().beginInteraction(),this.lastAngle_=void 0,!0}else return!1},e}(dy),J5e=function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,i){r.__proto__=i}||function(r,i){for(var o in i)Object.prototype.hasOwnProperty.call(i,o)&&(r[o]=i[o])},t(e,n)};return function(e,n){if(typeof n!="function"&&n!==null)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");t(e,n);function r(){this.constructor=e}e.prototype=n===null?Object.create(n):(r.prototype=n.prototype,new r)}}(),eBe=function(t){J5e(e,t);function e(n){var r=t.call(this)||this;return r.geometry_=null,r.element_=document.createElement("div"),r.element_.style.position="absolute",r.element_.style.pointerEvents="auto",r.element_.className="ol-box "+n,r.map_=null,r.startPixel_=null,r.endPixel_=null,r}return e.prototype.disposeInternal=function(){this.setMap(null)},e.prototype.render_=function(){var n=this.startPixel_,r=this.endPixel_,i="px",o=this.element_.style;o.left=Math.min(n[0],r[0])+i,o.top=Math.min(n[1],r[1])+i,o.width=Math.abs(r[0]-n[0])+i,o.height=Math.abs(r[1]-n[1])+i},e.prototype.setMap=function(n){if(this.map_){this.map_.getOverlayContainer().removeChild(this.element_);var r=this.element_.style;r.left="inherit",r.top="inherit",r.width="inherit",r.height="inherit"}this.map_=n,this.map_&&this.map_.getOverlayContainer().appendChild(this.element_)},e.prototype.setPixels=function(n,r){this.startPixel_=n,this.endPixel_=r,this.createOrUpdateGeometry(),this.render_()},e.prototype.createOrUpdateGeometry=function(){var n=this.startPixel_,r=this.endPixel_,i=[n,[n[0],r[1]],r,[r[0],n[1]]],o=i.map(this.map_.getCoordinateFromPixelInternal,this.map_);o[4]=o[0].slice(),this.geometry_?this.geometry_.setCoordinates([o]):this.geometry_=new td([o])},e.prototype.getGeometry=function(){return this.geometry_},e}(q5),qoe=function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,i){r.__proto__=i}||function(r,i){for(var o in i)Object.prototype.hasOwnProperty.call(i,o)&&(r[o]=i[o])},t(e,n)};return function(e,n){if(typeof n!="function"&&n!==null)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");t(e,n);function r(){this.constructor=e}e.prototype=n===null?Object.create(n):(r.prototype=n.prototype,new r)}}(),TS={BOXSTART:"boxstart",BOXDRAG:"boxdrag",BOXEND:"boxend",BOXCANCEL:"boxcancel"},qA=function(t){qoe(e,t);function e(n,r,i){var o=t.call(this,n)||this;return o.coordinate=r,o.mapBrowserEvent=i,o}return e}(ac),tBe=function(t){qoe(e,t);function e(n){var r=t.call(this)||this;r.on,r.once,r.un;var i=n||{};return r.box_=new eBe(i.className||"ol-dragbox"),r.minArea_=i.minArea!==void 0?i.minArea:64,i.onBoxEnd&&(r.onBoxEnd=i.onBoxEnd),r.startPixel_=null,r.condition_=i.condition?i.condition:Voe,r.boxEndCondition_=i.boxEndCondition?i.boxEndCondition:r.defaultBoxEndCondition,r}return e.prototype.defaultBoxEndCondition=function(n,r,i){var o=i[0]-r[0],a=i[1]-r[1];return o*o+a*a>=this.minArea_},e.prototype.getGeometry=function(){return this.box_.getGeometry()},e.prototype.handleDragEvent=function(n){this.box_.setPixels(this.startPixel_,n.pixel),this.dispatchEvent(new qA(TS.BOXDRAG,n.coordinate,n))},e.prototype.handleUpEvent=function(n){this.box_.setMap(null);var r=this.boxEndCondition_(n,this.startPixel_,n.pixel);return r&&this.onBoxEnd(n),this.dispatchEvent(new qA(r?TS.BOXEND:TS.BOXCANCEL,n.coordinate,n)),!1},e.prototype.handleDownEvent=function(n){return this.condition_(n)?(this.startPixel_=n.pixel,this.box_.setMap(n.map),this.box_.setPixels(this.startPixel_,this.startPixel_),this.dispatchEvent(new qA(TS.BOXSTART,n.coordinate,n)),!0):!1},e.prototype.onBoxEnd=function(n){},e}(dy),nBe=function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,i){r.__proto__=i}||function(r,i){for(var o in i)Object.prototype.hasOwnProperty.call(i,o)&&(r[o]=i[o])},t(e,n)};return function(e,n){if(typeof n!="function"&&n!==null)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");t(e,n);function r(){this.constructor=e}e.prototype=n===null?Object.create(n):(r.prototype=n.prototype,new r)}}(),rBe=function(t){nBe(e,t);function e(n){var r=this,i=n||{},o=i.condition?i.condition:Goe;return r=t.call(this,{condition:o,className:i.className||"ol-dragzoom",minArea:i.minArea})||this,r.duration_=i.duration!==void 0?i.duration:200,r.out_=i.out!==void 0?i.out:!1,r}return e.prototype.onBoxEnd=function(n){var r=this.getMap(),i=r.getView(),o=this.getGeometry();if(this.out_){var a=i.rotatedExtentForGeometry(o),s=i.getResolutionForExtentInternal(a),l=i.getResolution()/s;o=o.clone(),o.scale(l*l)}i.fitInternal(o,{duration:this.duration_,easing:fy})},e}(tBe);const Bd={LEFT:37,UP:38,RIGHT:39,DOWN:40};var iBe=function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,i){r.__proto__=i}||function(r,i){for(var o in i)Object.prototype.hasOwnProperty.call(i,o)&&(r[o]=i[o])},t(e,n)};return function(e,n){if(typeof n!="function"&&n!==null)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");t(e,n);function r(){this.constructor=e}e.prototype=n===null?Object.create(n):(r.prototype=n.prototype,new r)}}(),oBe=function(t){iBe(e,t);function e(n){var r=t.call(this)||this,i=n||{};return r.defaultCondition_=function(o){return RB(o)&&Hoe(o)},r.condition_=i.condition!==void 0?i.condition:r.defaultCondition_,r.duration_=i.duration!==void 0?i.duration:100,r.pixelDelta_=i.pixelDelta!==void 0?i.pixelDelta:128,r}return e.prototype.handleEvent=function(n){var r=!1;if(n.type==Mt.KEYDOWN){var i=n.originalEvent,o=i.keyCode;if(this.condition_(n)&&(o==Bd.DOWN||o==Bd.LEFT||o==Bd.RIGHT||o==Bd.UP)){var a=n.map,s=a.getView(),l=s.getResolution()*this.pixelDelta_,c=0,u=0;o==Bd.DOWN?u=-l:o==Bd.LEFT?c=-l:o==Bd.RIGHT?c=l:u=l;var f=[c,u];nB(f,s.getRotation()),U5e(s,f,this.duration_),i.preventDefault(),r=!0}}return!r},e}(K1),aBe=function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,i){r.__proto__=i}||function(r,i){for(var o in i)Object.prototype.hasOwnProperty.call(i,o)&&(r[o]=i[o])},t(e,n)};return function(e,n){if(typeof n!="function"&&n!==null)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");t(e,n);function r(){this.constructor=e}e.prototype=n===null?Object.create(n):(r.prototype=n.prototype,new r)}}(),sBe=function(t){aBe(e,t);function e(n){var r=t.call(this)||this,i=n||{};return r.condition_=i.condition?i.condition:Hoe,r.delta_=i.delta?i.delta:1,r.duration_=i.duration!==void 0?i.duration:100,r}return e.prototype.handleEvent=function(n){var r=!1;if(n.type==Mt.KEYDOWN||n.type==Mt.KEYPRESS){var i=n.originalEvent,o=i.charCode;if(this.condition_(n)&&(o==43||o==45)){var a=n.map,s=o==43?this.delta_:-this.delta_,l=a.getView();kB(l,s,void 0,this.duration_),i.preventDefault(),r=!0}}return!r},e}(K1),lBe=function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,i){r.__proto__=i}||function(r,i){for(var o in i)Object.prototype.hasOwnProperty.call(i,o)&&(r[o]=i[o])},t(e,n)};return function(e,n){if(typeof n!="function"&&n!==null)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");t(e,n);function r(){this.constructor=e}e.prototype=n===null?Object.create(n):(r.prototype=n.prototype,new r)}}(),XA={TRACKPAD:"trackpad",WHEEL:"wheel"},cBe=function(t){lBe(e,t);function e(n){var r=this,i=n||{};r=t.call(this,i)||this,r.totalDelta_=0,r.lastDelta_=0,r.maxDelta_=i.maxDelta!==void 0?i.maxDelta:1,r.duration_=i.duration!==void 0?i.duration:250,r.timeout_=i.timeout!==void 0?i.timeout:80,r.useAnchor_=i.useAnchor!==void 0?i.useAnchor:!0,r.constrainResolution_=i.constrainResolution!==void 0?i.constrainResolution:!1;var o=i.condition?i.condition:Woe;return r.condition_=i.onFocusOnly?m3(Uoe,o):o,r.lastAnchor_=null,r.startTime_=void 0,r.timeoutId_,r.mode_=void 0,r.trackpadEventGap_=400,r.trackpadTimeoutId_,r.deltaPerZoom_=300,r}return e.prototype.endInteraction_=function(){this.trackpadTimeoutId_=void 0;var n=this.getMap();if(n){var r=n.getView();r.endInteraction(void 0,this.lastDelta_?this.lastDelta_>0?1:-1:0,this.lastAnchor_)}},e.prototype.handleEvent=function(n){if(!this.condition_(n))return!0;var r=n.type;if(r!==Mt.WHEEL)return!0;var i=n.map,o=n.originalEvent;o.preventDefault(),this.useAnchor_&&(this.lastAnchor_=n.coordinate);var a;if(n.type==Mt.WHEEL&&(a=o.deltaY,j3e&&o.deltaMode===WheelEvent.DOM_DELTA_PIXEL&&(a/=Mie),o.deltaMode===WheelEvent.DOM_DELTA_LINE&&(a*=40)),a===0)return!1;this.lastDelta_=a;var s=Date.now();this.startTime_===void 0&&(this.startTime_=s),(!this.mode_||s-this.startTime_>this.trackpadEventGap_)&&(this.mode_=Math.abs(a)<4?XA.TRACKPAD:XA.WHEEL);var l=i.getView();if(this.mode_===XA.TRACKPAD&&!(l.getConstrainResolution()||this.constrainResolution_))return this.trackpadTimeoutId_?clearTimeout(this.trackpadTimeoutId_):(l.getAnimating()&&l.cancelAnimations(),l.beginInteraction()),this.trackpadTimeoutId_=setTimeout(this.endInteraction_.bind(this),this.timeout_),l.adjustZoom(-a/this.deltaPerZoom_,this.lastAnchor_),this.startTime_=s,!1;this.totalDelta_+=a;var c=Math.max(this.timeout_-(s-this.startTime_),0);return clearTimeout(this.timeoutId_),this.timeoutId_=setTimeout(this.handleWheelZoom_.bind(this,i),c),!1},e.prototype.handleWheelZoom_=function(n){var r=n.getView();r.getAnimating()&&r.cancelAnimations();var i=-Br(this.totalDelta_,-this.maxDelta_*this.deltaPerZoom_,this.maxDelta_*this.deltaPerZoom_)/this.deltaPerZoom_;(r.getConstrainResolution()||this.constrainResolution_)&&(i=i?i>0?1:-1:0),kB(r,i,this.lastAnchor_,this.duration_),this.mode_=void 0,this.totalDelta_=0,this.lastAnchor_=null,this.startTime_=void 0,this.timeoutId_=void 0},e.prototype.setMouseAnchor=function(n){this.useAnchor_=n,n||(this.lastAnchor_=null)},e}(K1),uBe=function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,i){r.__proto__=i}||function(r,i){for(var o in i)Object.prototype.hasOwnProperty.call(i,o)&&(r[o]=i[o])},t(e,n)};return function(e,n){if(typeof n!="function"&&n!==null)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");t(e,n);function r(){this.constructor=e}e.prototype=n===null?Object.create(n):(r.prototype=n.prototype,new r)}}(),fBe=function(t){uBe(e,t);function e(n){var r=this,i=n||{},o=i;return o.stopDown||(o.stopDown=F1),r=t.call(this,o)||this,r.anchor_=null,r.lastAngle_=void 0,r.rotating_=!1,r.rotationDelta_=0,r.threshold_=i.threshold!==void 0?i.threshold:.3,r.duration_=i.duration!==void 0?i.duration:250,r}return e.prototype.handleDragEvent=function(n){var r=0,i=this.targetPointers[0],o=this.targetPointers[1],a=Math.atan2(o.clientY-i.clientY,o.clientX-i.clientX);if(this.lastAngle_!==void 0){var s=a-this.lastAngle_;this.rotationDelta_+=s,!this.rotating_&&Math.abs(this.rotationDelta_)>this.threshold_&&(this.rotating_=!0),r=s}this.lastAngle_=a;var l=n.map,c=l.getView();if(c.getConstraints().rotation!==MB){var u=l.getViewport().getBoundingClientRect(),f=AB(this.targetPointers);f[0]-=u.left,f[1]-=u.top,this.anchor_=l.getCoordinateFromPixelInternal(f),this.rotating_&&(l.render(),c.adjustRotationInternal(r,this.anchor_))}},e.prototype.handleUpEvent=function(n){if(this.targetPointers.length<2){var r=n.map,i=r.getView();return i.endInteraction(this.duration_),!1}else return!0},e.prototype.handleDownEvent=function(n){if(this.targetPointers.length>=2){var r=n.map;return this.anchor_=null,this.lastAngle_=void 0,this.rotating_=!1,this.rotationDelta_=0,this.handlingDownUpSequence||r.getView().beginInteraction(),!0}else return!1},e}(dy),dBe=function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,i){r.__proto__=i}||function(r,i){for(var o in i)Object.prototype.hasOwnProperty.call(i,o)&&(r[o]=i[o])},t(e,n)};return function(e,n){if(typeof n!="function"&&n!==null)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");t(e,n);function r(){this.constructor=e}e.prototype=n===null?Object.create(n):(r.prototype=n.prototype,new r)}}(),hBe=function(t){dBe(e,t);function e(n){var r=this,i=n||{},o=i;return o.stopDown||(o.stopDown=F1),r=t.call(this,o)||this,r.anchor_=null,r.duration_=i.duration!==void 0?i.duration:400,r.lastDistance_=void 0,r.lastScaleDelta_=1,r}return e.prototype.handleDragEvent=function(n){var r=1,i=this.targetPointers[0],o=this.targetPointers[1],a=i.clientX-o.clientX,s=i.clientY-o.clientY,l=Math.sqrt(a*a+s*s);this.lastDistance_!==void 0&&(r=this.lastDistance_/l),this.lastDistance_=l;var c=n.map,u=c.getView();r!=1&&(this.lastScaleDelta_=r);var f=c.getViewport().getBoundingClientRect(),d=AB(this.targetPointers);d[0]-=f.left,d[1]-=f.top,this.anchor_=c.getCoordinateFromPixelInternal(d),c.render(),u.adjustResolutionInternal(r,this.anchor_)},e.prototype.handleUpEvent=function(n){if(this.targetPointers.length<2){var r=n.map,i=r.getView(),o=this.lastScaleDelta_>1?1:-1;return i.endInteraction(this.duration_,o),!1}else return!0},e.prototype.handleDownEvent=function(n){if(this.targetPointers.length>=2){var r=n.map;return this.anchor_=null,this.lastDistance_=void 0,this.lastScaleDelta_=1,this.handlingDownUpSequence||r.getView().beginInteraction(),!0}else return!1},e}(dy),pBe=function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,i){r.__proto__=i}||function(r,i){for(var o in i)Object.prototype.hasOwnProperty.call(i,o)&&(r[o]=i[o])},t(e,n)};return function(e,n){if(typeof n!="function"&&n!==null)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");t(e,n);function r(){this.constructor=e}e.prototype=n===null?Object.create(n):(r.prototype=n.prototype,new r)}}(),IB=function(t){pBe(e,t);function e(n,r,i){var o=t.call(this)||this;if(i!==void 0&&r===void 0)o.setFlatCoordinates(i,n);else{var a=r||0;o.setCenterAndRadius(n,a,i)}return o}return e.prototype.clone=function(){var n=new e(this.flatCoordinates.slice(),void 0,this.layout);return n.applyProperties(this),n},e.prototype.closestPointXY=function(n,r,i,o){var a=this.flatCoordinates,s=n-a[0],l=r-a[1],c=s*s+l*l;if(c<o){if(c===0)for(var u=0;u<this.stride;++u)i[u]=a[u];else{var f=this.getRadius()/Math.sqrt(c);i[0]=a[0]+f*s,i[1]=a[1]+f*l;for(var u=2;u<this.stride;++u)i[u]=a[u]}return i.length=this.stride,c}else return o},e.prototype.containsXY=function(n,r){var i=this.flatCoordinates,o=n-i[0],a=r-i[1];return o*o+a*a<=this.getRadiusSquared_()},e.prototype.getCenter=function(){return this.flatCoordinates.slice(0,this.stride)},e.prototype.computeExtent=function(n){var r=this.flatCoordinates,i=r[this.stride]-r[0];return Zs(r[0]-i,r[1]-i,r[0]+i,r[1]+i,n)},e.prototype.getRadius=function(){return Math.sqrt(this.getRadiusSquared_())},e.prototype.getRadiusSquared_=function(){var n=this.flatCoordinates[this.stride]-this.flatCoordinates[0],r=this.flatCoordinates[this.stride+1]-this.flatCoordinates[1];return n*n+r*r},e.prototype.getType=function(){return"Circle"},e.prototype.intersectsExtent=function(n){var r=this.getExtent();if(so(n,r)){var i=this.getCenter();return n[0]<=i[0]&&n[2]>=i[0]||n[1]<=i[1]&&n[3]>=i[1]?!0:K5(n,this.intersectsCoordinate.bind(this))}return!1},e.prototype.setCenter=function(n){var r=this.stride,i=this.flatCoordinates[r]-this.flatCoordinates[0],o=n.slice();o[r]=o[0]+i;for(var a=1;a<r;++a)o[r+a]=n[a];this.setFlatCoordinates(this.layout,o),this.changed()},e.prototype.setCenterAndRadius=function(n,r,i){this.setLayout(i,n,0),this.flatCoordinates||(this.flatCoordinates=[]);var o=this.flatCoordinates,a=Hie(o,0,n,this.stride);o[a++]=o[0]+r;for(var s=1,l=this.stride;s<l;++s)o[a++]=o[s];o.length=a,this.changed()},e.prototype.getCoordinates=function(){return null},e.prototype.setCoordinates=function(n,r){},e.prototype.setRadius=function(n){this.flatCoordinates[this.stride]=this.flatCoordinates[0]+n,this.changed()},e.prototype.rotate=function(n,r){var i=this.getCenter(),o=this.getStride();this.setCenter(aB(i,0,i.length,o,n,r,i)),this.changed()},e.prototype.translate=function(n,r){var i=this.getCenter(),o=this.getStride();this.setCenter(Wie(i,0,i.length,o,n,r,i)),this.changed()},e}(bd);IB.prototype.transform;var Xoe=function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,i){r.__proto__=i}||function(r,i){for(var o in i)Object.prototype.hasOwnProperty.call(i,o)&&(r[o]=i[o])},t(e,n)};return function(e,n){if(typeof n!="function"&&n!==null)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");t(e,n);function r(){this.constructor=e}e.prototype=n===null?Object.create(n):(r.prototype=n.prototype,new r)}}(),an={POINT:"Point",LINE_STRING:"LineString",POLYGON:"Polygon",CIRCLE:"Circle"},ES={DRAWSTART:"drawstart",DRAWEND:"drawend",DRAWABORT:"drawabort"},PS=function(t){Xoe(e,t);function e(n,r){var i=t.call(this,n)||this;return i.feature=r,i}return e}(ac),mBe=function(t){Xoe(e,t);function e(n){var r=this,i=n;i.stopDown||(i.stopDown=F1),r=t.call(this,i)||this,r.on,r.once,r.un,r.shouldHandle_=!1,r.downPx_=null,r.downTimeout_,r.lastDragTime_,r.pointerType_,r.freehand_=!1,r.source_=n.source?n.source:null,r.features_=n.features?n.features:null,r.snapTolerance_=n.snapTolerance?n.snapTolerance:12,r.type_=n.type,r.mode_=vBe(r.type_),r.stopClick_=!!n.stopClick,r.minPoints_=n.minPoints?n.minPoints:r.mode_===an.POLYGON?3:2,r.maxPoints_=r.mode_===an.CIRCLE?2:n.maxPoints?n.maxPoints:1/0,r.finishCondition_=n.finishCondition?n.finishCondition:Fh,r.geometryLayout_=n.geometryLayout?n.geometryLayout:dn.XY;var o=n.geometryFunction;if(!o){var a=r.mode_;if(a===an.CIRCLE)o=function(l,c,u){var f=c||new IB([NaN,NaN]),d=js(l[0]),h=bNe(d,js(l[l.length-1]));return f.setCenterAndRadius(d,Math.sqrt(h),this.geometryLayout_),f};else{var s;a===an.POINT?s=ql:a===an.LINE_STRING?s=zh:a===an.POLYGON&&(s=td),o=function(l,c,u){return c?a===an.POLYGON?l[0].length?c.setCoordinates([l[0].concat([l[0][0]])],this.geometryLayout_):c.setCoordinates([],this.geometryLayout_):c.setCoordinates(l,this.geometryLayout_):c=new s(l,this.geometryLayout_),c}}}return r.geometryFunction_=o,r.dragVertexDelay_=n.dragVertexDelay!==void 0?n.dragVertexDelay:500,r.finishCoordinate_=null,r.sketchFeature_=null,r.sketchPoint_=null,r.sketchCoords_=null,r.sketchLine_=null,r.sketchLineCoords_=null,r.squaredClickTolerance_=n.clickTolerance?n.clickTolerance*n.clickTolerance:36,r.overlay_=new h2({source:new Y1({useSpatialIndex:!1,wrapX:n.wrapX?n.wrapX:!1}),style:n.style?n.style:gBe(),updateWhileInteracting:!0}),r.geometryName_=n.geometryName,r.condition_=n.condition?n.condition:RB,r.freehandCondition_,n.freehand?r.freehandCondition_=Woe:r.freehandCondition_=n.freehandCondition?n.freehandCondition:Goe,r.addChangeListener(p3.ACTIVE,r.updateState_),r}return e.prototype.setMap=function(n){t.prototype.setMap.call(this,n),this.updateState_()},e.prototype.getOverlay=function(){return this.overlay_},e.prototype.handleEvent=function(n){n.originalEvent.type===Mt.CONTEXTMENU&&n.originalEvent.preventDefault(),this.freehand_=this.mode_!==an.POINT&&this.freehandCondition_(n);var r=n.type===Sn.POINTERMOVE,i=!0;if(!this.freehand_&&this.lastDragTime_&&n.type===Sn.POINTERDRAG){var o=Date.now();o-this.lastDragTime_>=this.dragVertexDelay_?(this.downPx_=n.pixel,this.shouldHandle_=!this.freehand_,r=!0):this.lastDragTime_=void 0,this.shouldHandle_&&this.downTimeout_!==void 0&&(clearTimeout(this.downTimeout_),this.downTimeout_=void 0)}return this.freehand_&&n.type===Sn.POINTERDRAG&&this.sketchFeature_!==null?(this.addToDrawing_(n.coordinate),i=!1):this.freehand_&&n.type===Sn.POINTERDOWN?i=!1:r&&this.getPointerCount()<2?(i=n.type===Sn.POINTERMOVE,i&&this.freehand_?(this.handlePointerMove_(n),this.shouldHandle_&&n.originalEvent.preventDefault()):(n.originalEvent.pointerType==="mouse"||n.type===Sn.POINTERDRAG&&this.downTimeout_===void 0)&&this.handlePointerMove_(n)):n.type===Sn.DBLCLICK&&(i=!1),t.prototype.handleEvent.call(this,n)&&i},e.prototype.handleDownEvent=function(n){return this.shouldHandle_=!this.freehand_,this.freehand_?(this.downPx_=n.pixel,this.finishCoordinate_||this.startDrawing_(n.coordinate),!0):this.condition_(n)?(this.lastDragTime_=Date.now(),this.downTimeout_=setTimeout((function(){this.handlePointerMove_(new Ac(Sn.POINTERMOVE,n.map,n.originalEvent,!1,n.frameState))}).bind(this),this.dragVertexDelay_),this.downPx_=n.pixel,!0):(this.lastDragTime_=void 0,!1)},e.prototype.handleUpEvent=function(n){var r=!0;if(this.getPointerCount()===0)if(this.downTimeout_&&(clearTimeout(this.downTimeout_),this.downTimeout_=void 0),this.handlePointerMove_(n),this.shouldHandle_){var i=!this.finishCoordinate_;i&&this.startDrawing_(n.coordinate),!i&&this.freehand_?this.finishDrawing():!this.freehand_&&(!i||this.mode_===an.POINT)&&(this.atFinish_(n.pixel)?this.finishCondition_(n)&&this.finishDrawing():this.addToDrawing_(n.coordinate)),r=!1}else this.freehand_&&this.abortDrawing();return!r&&this.stopClick_&&n.preventDefault(),r},e.prototype.handlePointerMove_=function(n){if(this.pointerType_=n.originalEvent.pointerType,this.downPx_&&(!this.freehand_&&this.shouldHandle_||this.freehand_&&!this.shouldHandle_)){var r=this.downPx_,i=n.pixel,o=r[0]-i[0],a=r[1]-i[1],s=o*o+a*a;if(this.shouldHandle_=this.freehand_?s>this.squaredClickTolerance_:s<=this.squaredClickTolerance_,!this.shouldHandle_)return}this.finishCoordinate_?this.modifyDrawing_(n.coordinate):this.createOrUpdateSketchPoint_(n.coordinate.slice())},e.prototype.atFinish_=function(n){var r=!1;if(this.sketchFeature_){var i=!1,o=[this.finishCoordinate_],a=this.mode_;if(a===an.POINT)r=!0;else if(a===an.CIRCLE)r=this.sketchCoords_.length===2;else if(a===an.LINE_STRING)i=this.sketchCoords_.length>this.minPoints_;else if(a===an.POLYGON){var s=this.sketchCoords_;i=s[0].length>this.minPoints_,o=[s[0][0],s[0][s[0].length-2]]}if(i)for(var l=this.getMap(),c=0,u=o.length;c<u;c++){var f=o[c],d=l.getPixelFromCoordinate(f),h=n[0]-d[0],p=n[1]-d[1],m=this.freehand_?1:this.snapTolerance_;if(r=Math.sqrt(h*h+p*p)<=m,r){this.finishCoordinate_=f;break}}}return r},e.prototype.createOrUpdateSketchPoint_=function(n){if(!this.sketchPoint_)this.sketchPoint_=new zc(new ql(n)),this.updateSketchFeatures_();else{var r=this.sketchPoint_.getGeometry();r.setCoordinates(n)}},e.prototype.createOrUpdateCustomSketchLine_=function(n){this.sketchLine_||(this.sketchLine_=new zc);var r=n.getLinearRing(0),i=this.sketchLine_.getGeometry();i?(i.setFlatCoordinates(r.getLayout(),r.getFlatCoordinates()),i.changed()):(i=new zh(r.getFlatCoordinates(),r.getLayout()),this.sketchLine_.setGeometry(i))},e.prototype.startDrawing_=function(n){for(var r=this.getMap().getView().getProjection(),i=zT(this.geometryLayout_);n.length<i;)n.push(0);this.finishCoordinate_=n,this.mode_===an.POINT?this.sketchCoords_=n.slice():this.mode_===an.POLYGON?(this.sketchCoords_=[[n.slice(),n.slice()]],this.sketchLineCoords_=this.sketchCoords_[0]):this.sketchCoords_=[n.slice(),n.slice()],this.sketchLineCoords_&&(this.sketchLine_=new zc(new zh(this.sketchLineCoords_)));var o=this.geometryFunction_(this.sketchCoords_,void 0,r);this.sketchFeature_=new zc,this.geometryName_&&this.sketchFeature_.setGeometryName(this.geometryName_),this.sketchFeature_.setGeometry(o),this.updateSketchFeatures_(),this.dispatchEvent(new PS(ES.DRAWSTART,this.sketchFeature_))},e.prototype.modifyDrawing_=function(n){for(var r=this.getMap(),i=this.sketchFeature_.getGeometry(),o=r.getView().getProjection(),a=zT(this.geometryLayout_),s,l;n.length<a;)n.push(0);if(this.mode_===an.POINT?l=this.sketchCoords_:this.mode_===an.POLYGON?(s=this.sketchCoords_[0],l=s[s.length-1],this.atFinish_(r.getPixelFromCoordinate(n))&&(n=this.finishCoordinate_.slice())):(s=this.sketchCoords_,l=s[s.length-1]),l[0]=n[0],l[1]=n[1],this.geometryFunction_(this.sketchCoords_,i,o),this.sketchPoint_){var c=this.sketchPoint_.getGeometry();c.setCoordinates(n)}if(i.getType()==="Polygon"&&this.mode_!==an.POLYGON)this.createOrUpdateCustomSketchLine_(i);else if(this.sketchLineCoords_){var u=this.sketchLine_.getGeometry();u.setCoordinates(this.sketchLineCoords_)}this.updateSketchFeatures_()},e.prototype.addToDrawing_=function(n){var r=this.sketchFeature_.getGeometry(),i=this.getMap().getView().getProjection(),o,a,s=this.mode_;s===an.LINE_STRING||s===an.CIRCLE?(this.finishCoordinate_=n.slice(),a=this.sketchCoords_,a.length>=this.maxPoints_&&(this.freehand_?a.pop():o=!0),a.push(n.slice()),this.geometryFunction_(a,r,i)):s===an.POLYGON&&(a=this.sketchCoords_[0],a.length>=this.maxPoints_&&(this.freehand_?a.pop():o=!0),a.push(n.slice()),o&&(this.finishCoordinate_=a[0]),this.geometryFunction_(this.sketchCoords_,r,i)),this.createOrUpdateSketchPoint_(n.slice()),this.updateSketchFeatures_(),o&&this.finishDrawing()},e.prototype.removeLastPoint=function(){if(this.sketchFeature_){var n=this.sketchFeature_.getGeometry(),r=this.getMap().getView().getProjection(),i,o=this.mode_;if(o===an.LINE_STRING||o===an.CIRCLE){if(i=this.sketchCoords_,i.splice(-2,1),i.length>=2){this.finishCoordinate_=i[i.length-2].slice();var a=this.finishCoordinate_.slice();i[i.length-1]=a,this.createOrUpdateSketchPoint_(a)}this.geometryFunction_(i,n,r),n.getType()==="Polygon"&&this.sketchLine_&&this.createOrUpdateCustomSketchLine_(n)}else if(o===an.POLYGON){i=this.sketchCoords_[0],i.splice(-2,1);var s=this.sketchLine_.getGeometry();if(i.length>=2){var a=i[i.length-2].slice();i[i.length-1]=a,this.createOrUpdateSketchPoint_(a)}s.setCoordinates(i),this.geometryFunction_(this.sketchCoords_,n,r)}i.length===1&&this.abortDrawing(),this.updateSketchFeatures_()}},e.prototype.finishDrawing=function(){var n=this.abortDrawing_();if(n){var r=this.sketchCoords_,i=n.getGeometry(),o=this.getMap().getView().getProjection();this.mode_===an.LINE_STRING?(r.pop(),this.geometryFunction_(r,i,o)):this.mode_===an.POLYGON&&(r[0].pop(),this.geometryFunction_(r,i,o),r=i.getCoordinates()),this.type_==="MultiPoint"?n.setGeometry(new c2([r])):this.type_==="MultiLineString"?n.setGeometry(new pB([r])):this.type_==="MultiPolygon"&&n.setGeometry(new mB([r])),this.dispatchEvent(new PS(ES.DRAWEND,n)),this.features_&&this.features_.push(n),this.source_&&this.source_.addFeature(n)}},e.prototype.abortDrawing_=function(){this.finishCoordinate_=null;var n=this.sketchFeature_;return this.sketchFeature_=null,this.sketchPoint_=null,this.sketchLine_=null,this.overlay_.getSource().clear(!0),n},e.prototype.abortDrawing=function(){var n=this.abortDrawing_();n&&this.dispatchEvent(new PS(ES.DRAWABORT,n))},e.prototype.appendCoordinates=function(n){var r=this.mode_,i=!this.sketchFeature_;i&&this.startDrawing_(n[0]);var o;if(r===an.LINE_STRING||r===an.CIRCLE)o=this.sketchCoords_;else if(r===an.POLYGON)o=this.sketchCoords_&&this.sketchCoords_.length?this.sketchCoords_[0]:[];else return;i&&o.shift(),o.pop();for(var a=0;a<n.length;a++)this.addToDrawing_(n[a]);var s=n[n.length-1];this.addToDrawing_(s),this.modifyDrawing_(s)},e.prototype.extend=function(n){var r=n.getGeometry(),i=r;this.sketchFeature_=n,this.sketchCoords_=i.getCoordinates();var o=this.sketchCoords_[this.sketchCoords_.length-1];this.finishCoordinate_=o.slice(),this.sketchCoords_.push(o.slice()),this.sketchPoint_=new zc(new ql(o)),this.updateSketchFeatures_(),this.dispatchEvent(new PS(ES.DRAWSTART,this.sketchFeature_))},e.prototype.updateSketchFeatures_=function(){var n=[];this.sketchFeature_&&n.push(this.sketchFeature_),this.sketchLine_&&n.push(this.sketchLine_),this.sketchPoint_&&n.push(this.sketchPoint_);var r=this.overlay_.getSource();r.clear(!0),r.addFeatures(n)},e.prototype.updateState_=function(){var n=this.getMap(),r=this.getActive();(!n||!r)&&this.abortDrawing(),this.overlay_.setMap(r?n:null)},e}(dy);function gBe(){var t=jFe();return function(e,n){return t[e.getGeometry().getType()]}}function vBe(t){switch(t){case"Point":case"MultiPoint":return an.POINT;case"LineString":case"MultiLineString":return an.LINE_STRING;case"Polygon":case"MultiPolygon":return an.POLYGON;case"Circle":return an.CIRCLE;default:throw new Error("Invalid type: "+t)}}function yBe(t){var e=t||{},n=new Qa,r=new t5e(-.005,.05,100),i=e.altShiftDragRotate!==void 0?e.altShiftDragRotate:!0;i&&n.push(new Z5e);var o=e.doubleClickZoom!==void 0?e.doubleClickZoom:!0;o&&n.push(new V5e({delta:e.zoomDelta,duration:e.zoomDuration}));var a=e.dragPan!==void 0?e.dragPan:!0;a&&n.push(new Y5e({onFocusOnly:e.onFocusOnly,kinetic:r}));var s=e.pinchRotate!==void 0?e.pinchRotate:!0;s&&n.push(new fBe);var l=e.pinchZoom!==void 0?e.pinchZoom:!0;l&&n.push(new hBe({duration:e.zoomDuration}));var c=e.keyboard!==void 0?e.keyboard:!0;c&&(n.push(new oBe),n.push(new sBe({delta:e.zoomDelta,duration:e.zoomDuration})));var u=e.mouseWheelZoom!==void 0?e.mouseWheelZoom:!0;u&&n.push(new cBe({onFocusOnly:e.onFocusOnly,duration:e.zoomDuration}));var f=e.shiftDragZoom!==void 0?e.shiftDragZoom:!0;return f&&n.push(new rBe({duration:e.zoomDuration})),n}var xBe=function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,i){r.__proto__=i}||function(r,i){for(var o in i)Object.prototype.hasOwnProperty.call(i,o)&&(r[o]=i[o])},t(e,n)};return function(e,n){if(typeof n!="function"&&n!==null)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");t(e,n);function r(){this.constructor=e}e.prototype=n===null?Object.create(n):(r.prototype=n.prototype,new r)}}(),nH=function(t){xBe(e,t);function e(n){return n=ur({},n),n.controls||(n.controls=B5e()),n.interactions||(n.interactions=yBe({onFocusOnly:!0})),t.call(this,n)||this}return e.prototype.createRenderer=function(){return new a5e(this)},e}(P5e),bBe=function(){function t(e){this.highWaterMark=e!==void 0?e:2048,this.count_=0,this.entries_={},this.oldest_=null,this.newest_=null}return t.prototype.canExpireCache=function(){return this.highWaterMark>0&&this.getCount()>this.highWaterMark},t.prototype.expireCache=function(e){for(;this.canExpireCache();)this.pop()},t.prototype.clear=function(){this.count_=0,this.entries_={},this.oldest_=null,this.newest_=null},t.prototype.containsKey=function(e){return this.entries_.hasOwnProperty(e)},t.prototype.forEach=function(e){for(var n=this.oldest_;n;)e(n.value_,n.key_,this),n=n.newer},t.prototype.get=function(e,n){var r=this.entries_[e];return Ut(r!==void 0,15),r===this.newest_||(r===this.oldest_?(this.oldest_=this.oldest_.newer,this.oldest_.older=null):(r.newer.older=r.older,r.older.newer=r.newer),r.newer=null,r.older=this.newest_,this.newest_.newer=r,this.newest_=r),r.value_},t.prototype.remove=function(e){var n=this.entries_[e];return Ut(n!==void 0,15),n===this.newest_?(this.newest_=n.older,this.newest_&&(this.newest_.newer=null)):n===this.oldest_?(this.oldest_=n.newer,this.oldest_&&(this.oldest_.older=null)):(n.newer.older=n.older,n.older.newer=n.newer),delete this.entries_[e],--this.count_,n.value_},t.prototype.getCount=function(){return this.count_},t.prototype.getKeys=function(){var e=new Array(this.count_),n=0,r;for(r=this.newest_;r;r=r.older)e[n++]=r.key_;return e},t.prototype.getValues=function(){var e=new Array(this.count_),n=0,r;for(r=this.newest_;r;r=r.older)e[n++]=r.value_;return e},t.prototype.peekLast=function(){return this.oldest_.value_},t.prototype.peekLastKey=function(){return this.oldest_.key_},t.prototype.peekFirstKey=function(){return this.newest_.key_},t.prototype.peek=function(e){if(this.containsKey(e))return this.entries_[e].value_},t.prototype.pop=function(){var e=this.oldest_;return delete this.entries_[e.key_],e.newer&&(e.newer.older=null),this.oldest_=e.newer,this.oldest_||(this.newest_=null),--this.count_,e.value_},t.prototype.replace=function(e,n){this.get(e),this.entries_[e].value_=n},t.prototype.set=function(e,n){Ut(!(e in this.entries_),16);var r={key_:e,newer:null,older:this.newest_,value_:n};this.newest_?this.newest_.newer=r:this.oldest_=r,this.newest_=r,this.entries_[e]=r,++this.count_},t.prototype.setSize=function(e){this.highWaterMark=e},t}();function rH(t,e,n,r){return r!==void 0?(r[0]=t,r[1]=e,r[2]=n,r):[t,e,n]}function g2(t,e,n){return t+"/"+e+"/"+n}function Qoe(t){return g2(t[0],t[1],t[2])}function _Be(t){return t.split("/").map(Number)}function Yoe(t){return(t[1]<<t[0])+t[2]}function wBe(t,e){var n=t[0],r=t[1],i=t[2];if(e.getMinZoom()>n||n>e.getMaxZoom())return!1;var o=e.getFullTileRange(n);return o?o.containsXY(r,i):!0}var SBe=function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,i){r.__proto__=i}||function(r,i){for(var o in i)Object.prototype.hasOwnProperty.call(i,o)&&(r[o]=i[o])},t(e,n)};return function(e,n){if(typeof n!="function"&&n!==null)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");t(e,n);function r(){this.constructor=e}e.prototype=n===null?Object.create(n):(r.prototype=n.prototype,new r)}}(),Koe=function(t){SBe(e,t);function e(){return t!==null&&t.apply(this,arguments)||this}return e.prototype.expireCache=function(n){for(;this.canExpireCache();){var r=this.peekLast();if(r.getKey()in n)break;this.pop().release()}},e.prototype.pruneExceptNewestZ=function(){if(this.getCount()!==0){var n=this.peekFirstKey(),r=_Be(n),i=r[0];this.forEach((function(o){o.tileCoord[0]!==i&&(this.remove(Qoe(o.tileCoord)),o.release())}).bind(this))}},e}(bBe),DB=function(){function t(e,n,r,i){this.minX=e,this.maxX=n,this.minY=r,this.maxY=i}return t.prototype.contains=function(e){return this.containsXY(e[1],e[2])},t.prototype.containsTileRange=function(e){return this.minX<=e.minX&&e.maxX<=this.maxX&&this.minY<=e.minY&&e.maxY<=this.maxY},t.prototype.containsXY=function(e,n){return this.minX<=e&&e<=this.maxX&&this.minY<=n&&n<=this.maxY},t.prototype.equals=function(e){return this.minX==e.minX&&this.minY==e.minY&&this.maxX==e.maxX&&this.maxY==e.maxY},t.prototype.extend=function(e){e.minX<this.minX&&(this.minX=e.minX),e.maxX>this.maxX&&(this.maxX=e.maxX),e.minY<this.minY&&(this.minY=e.minY),e.maxY>this.maxY&&(this.maxY=e.maxY)},t.prototype.getHeight=function(){return this.maxY-this.minY+1},t.prototype.getSize=function(){return[this.getWidth(),this.getHeight()]},t.prototype.getWidth=function(){return this.maxX-this.minX+1},t.prototype.intersects=function(e){return this.minX<=e.maxX&&this.maxX>=e.minX&&this.minY<=e.maxY&&this.maxY>=e.minY},t}();function rm(t,e,n,r,i){return i!==void 0?(i.minX=t,i.maxX=e,i.minY=n,i.maxY=r,i):new DB(t,e,n,r)}var OBe=.5,CBe=10,iH=.25,TBe=function(){function t(e,n,r,i,o,a){this.sourceProj_=e,this.targetProj_=n;var s={},l=Bb(this.targetProj_,this.sourceProj_);this.transformInv_=function(x){var b=x[0]+"/"+x[1];return s[b]||(s[b]=l(x)),s[b]},this.maxSourceExtent_=i,this.errorThresholdSquared_=o*o,this.triangles_=[],this.wrapsXInSource_=!1,this.canWrapXInSource_=this.sourceProj_.canWrapX()&&!!i&&!!this.sourceProj_.getExtent()&&Kn(i)==Kn(this.sourceProj_.getExtent()),this.sourceWorldWidth_=this.sourceProj_.getExtent()?Kn(this.sourceProj_.getExtent()):null,this.targetWorldWidth_=this.targetProj_.getExtent()?Kn(this.targetProj_.getExtent()):null;var c=Rp(r),u=eB(r),f=J5(r),d=Z5(r),h=this.transformInv_(c),p=this.transformInv_(u),m=this.transformInv_(f),g=this.transformInv_(d),v=CBe+(a?Math.max(0,Math.ceil(rNe(QL(r)/(a*a*256*256)))):0);if(this.addQuad_(c,u,f,d,h,p,m,g,v),this.wrapsXInSource_){var y=1/0;this.triangles_.forEach(function(x,b,_){y=Math.min(y,x.source[0][0],x.source[1][0],x.source[2][0])}),this.triangles_.forEach((function(x){if(Math.max(x.source[0][0],x.source[1][0],x.source[2][0])-y>this.sourceWorldWidth_/2){var b=[[x.source[0][0],x.source[0][1]],[x.source[1][0],x.source[1][1]],[x.source[2][0],x.source[2][1]]];b[0][0]-y>this.sourceWorldWidth_/2&&(b[0][0]-=this.sourceWorldWidth_),b[1][0]-y>this.sourceWorldWidth_/2&&(b[1][0]-=this.sourceWorldWidth_),b[2][0]-y>this.sourceWorldWidth_/2&&(b[2][0]-=this.sourceWorldWidth_);var _=Math.min(b[0][0],b[1][0],b[2][0]),S=Math.max(b[0][0],b[1][0],b[2][0]);S-_<this.sourceWorldWidth_/2&&(x.source=b)}}).bind(this))}s={}}return t.prototype.addTriangle_=function(e,n,r,i,o,a){this.triangles_.push({source:[i,o,a],target:[e,n,r]})},t.prototype.addQuad_=function(e,n,r,i,o,a,s,l,c){var u=vG([o,a,s,l]),f=this.sourceWorldWidth_?Kn(u)/this.sourceWorldWidth_:null,d=this.sourceWorldWidth_,h=this.sourceProj_.canWrapX()&&f>.5&&f<1,p=!1;if(c>0){if(this.targetProj_.isGlobal()&&this.targetWorldWidth_){var m=vG([e,n,r,i]),g=Kn(m)/this.targetWorldWidth_;p=g>iH||p}!h&&this.sourceProj_.isGlobal()&&f&&(p=f>iH||p)}if(!(!p&&this.maxSourceExtent_&&isFinite(u[0])&&isFinite(u[1])&&isFinite(u[2])&&isFinite(u[3])&&!so(u,this.maxSourceExtent_))){var v=0;if(!p&&(!isFinite(o[0])||!isFinite(o[1])||!isFinite(a[0])||!isFinite(a[1])||!isFinite(s[0])||!isFinite(s[1])||!isFinite(l[0])||!isFinite(l[1]))){if(c>0)p=!0;else if(v=(!isFinite(o[0])||!isFinite(o[1])?8:0)+(!isFinite(a[0])||!isFinite(a[1])?4:0)+(!isFinite(s[0])||!isFinite(s[1])?2:0)+(!isFinite(l[0])||!isFinite(l[1])?1:0),v!=1&&v!=2&&v!=4&&v!=8)return}if(c>0){if(!p){var y=[(e[0]+r[0])/2,(e[1]+r[1])/2],x=this.transformInv_(y),b=void 0;if(h){var _=(jf(o[0],d)+jf(s[0],d))/2;b=_-jf(x[0],d)}else b=(o[0]+s[0])/2-x[0];var S=(o[1]+s[1])/2-x[1],O=b*b+S*S;p=O>this.errorThresholdSquared_}if(p){if(Math.abs(e[0]-r[0])<=Math.abs(e[1]-r[1])){var C=[(n[0]+r[0])/2,(n[1]+r[1])/2],E=this.transformInv_(C),k=[(i[0]+e[0])/2,(i[1]+e[1])/2],I=this.transformInv_(k);this.addQuad_(e,n,C,k,o,a,E,I,c-1),this.addQuad_(k,C,r,i,I,E,s,l,c-1)}else{var P=[(e[0]+n[0])/2,(e[1]+n[1])/2],R=this.transformInv_(P),T=[(r[0]+i[0])/2,(r[1]+i[1])/2],L=this.transformInv_(T);this.addQuad_(e,P,T,i,o,R,L,l,c-1),this.addQuad_(P,n,r,T,R,a,s,L,c-1)}return}}if(h){if(!this.canWrapXInSource_)return;this.wrapsXInSource_=!0}v&11||this.addTriangle_(e,r,i,o,s,l),v&14||this.addTriangle_(e,r,n,o,s,a),v&&(v&13||this.addTriangle_(n,i,e,a,l,o),v&7||this.addTriangle_(n,i,r,a,l,s))}},t.prototype.calculateSourceExtent=function(){var e=Oa();return this.triangles_.forEach(function(n,r,i){var o=n.source;Gx(e,o[0]),Gx(e,o[1]),Gx(e,o[2])}),e},t.prototype.getTriangles=function(){return this.triangles_},t}(),g3={imageSmoothingEnabled:!1,msImageSmoothingEnabled:!1},EBe={imageSmoothingEnabled:!0,msImageSmoothingEnabled:!0},QA,Zoe=[];function oH(t,e,n,r,i){t.beginPath(),t.moveTo(0,0),t.lineTo(e,n),t.lineTo(r,i),t.closePath(),t.save(),t.clip(),t.fillRect(0,0,Math.max(e,r)+1,Math.max(n,i)),t.restore()}function YA(t,e){return Math.abs(t[e*4]-210)>2||Math.abs(t[e*4+3]-.75*255)>2}function PBe(){if(QA===void 0){var t=document.createElement("canvas").getContext("2d");t.globalCompositeOperation="lighter",t.fillStyle="rgba(210, 0, 0, 0.75)",oH(t,4,5,4,0),oH(t,4,5,0,5);var e=t.getImageData(0,0,3,3).data;QA=YA(e,0)||YA(e,4)||YA(e,8)}return QA}function v3(t,e,n,r){var i=a2(n,e,t),o=FT(e,r,n),a=e.getMetersPerUnit();a!==void 0&&(o*=a);var s=t.getMetersPerUnit();s!==void 0&&(o/=s);var l=t.getExtent();if(!l||z1(l,i)){var c=FT(t,o,i)/o;isFinite(c)&&c>0&&(o/=c)}return o}function MBe(t,e,n,r){var i=ed(n),o=v3(t,e,i,r);return(!isFinite(o)||o<=0)&&K5(n,function(a){return o=v3(t,e,a,r),isFinite(o)&&o>0}),o}function kBe(t,e,n,r,i,o,a,s,l,c,u,f){var d=Ca(Math.round(n*t),Math.round(n*e),Zoe);if(f||ur(d,g3),l.length===0)return d.canvas;d.scale(n,n);function h(b){return Math.round(b*n)/n}d.globalCompositeOperation="lighter";var p=Oa();l.forEach(function(b,_,S){Die(p,b.extent)});var m=Kn(p),g=ps(p),v=Ca(Math.round(n*m/r),Math.round(n*g/r));f||ur(v,g3);var y=n/r;l.forEach(function(b,_,S){var O=b.extent[0]-p[0],C=-(b.extent[3]-p[3]),E=Kn(b.extent),k=ps(b.extent);b.image.width>0&&b.image.height>0&&v.drawImage(b.image,c,c,b.image.width-2*c,b.image.height-2*c,O*y,C*y,E*y,k*y)});var x=Rp(a);return s.getTriangles().forEach(function(b,_,S){var O=b.source,C=b.target,E=O[0][0],k=O[0][1],I=O[1][0],P=O[1][1],R=O[2][0],T=O[2][1],L=h((C[0][0]-x[0])/o),z=h(-(C[0][1]-x[1])/o),B=h((C[1][0]-x[0])/o),U=h(-(C[1][1]-x[1])/o),W=h((C[2][0]-x[0])/o),$=h(-(C[2][1]-x[1])/o),N=E,D=k;E=0,k=0,I-=N,P-=D,R-=N,T-=D;var A=[[I,P,0,0,B-L],[R,T,0,0,W-L],[0,0,I,P,U-z],[0,0,R,T,$-z]],q=oNe(A);if(q){if(d.save(),d.beginPath(),PBe()||!f){d.moveTo(B,U);for(var Y=4,K=L-B,se=z-U,te=0;te<Y;te++)d.lineTo(B+h((te+1)*K/Y),U+h(te*se/(Y-1))),te!=Y-1&&d.lineTo(B+h((te+1)*K/Y),U+h((te+1)*se/(Y-1)));d.lineTo(W,$)}else d.moveTo(B,U),d.lineTo(L,z),d.lineTo(W,$);d.clip(),d.transform(q[0],q[2],q[1],q[3],L,z),d.translate(p[0]-N,p[3]-D),d.scale(r/n,-r/n),d.drawImage(v.canvas,0,0),d.restore()}}),u&&(d.save(),d.globalCompositeOperation="source-over",d.strokeStyle="black",d.lineWidth=1,s.getTriangles().forEach(function(b,_,S){var O=b.target,C=(O[0][0]-x[0])/o,E=-(O[0][1]-x[1])/o,k=(O[1][0]-x[0])/o,I=-(O[1][1]-x[1])/o,P=(O[2][0]-x[0])/o,R=-(O[2][1]-x[1])/o;d.beginPath(),d.moveTo(k,I),d.lineTo(C,E),d.lineTo(P,R),d.closePath(),d.stroke()}),d.restore()),d.canvas}var ABe=function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,i){r.__proto__=i}||function(r,i){for(var o in i)Object.prototype.hasOwnProperty.call(i,o)&&(r[o]=i[o])},t(e,n)};return function(e,n){if(typeof n!="function"&&n!==null)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");t(e,n);function r(){this.constructor=e}e.prototype=n===null?Object.create(n):(r.prototype=n.prototype,new r)}}(),Joe=function(t){ABe(e,t);function e(n,r,i,o,a,s,l,c,u,f,d,h){var p=t.call(this,a,St.IDLE,{interpolate:!!h})||this;p.renderEdges_=d!==void 0?d:!1,p.pixelRatio_=l,p.gutter_=c,p.canvas_=null,p.sourceTileGrid_=r,p.targetTileGrid_=o,p.wrappedTileCoord_=s||a,p.sourceTiles_=[],p.sourcesListenerKeys_=null,p.sourceZ_=0;var m=o.getTileCoordExtent(p.wrappedTileCoord_),g=p.targetTileGrid_.getExtent(),v=p.sourceTileGrid_.getExtent(),y=g?Hx(m,g):m;if(QL(y)===0)return p.state=St.EMPTY,p;var x=n.getExtent();x&&(v?v=Hx(v,x):v=x);var b=o.getResolution(p.wrappedTileCoord_[0]),_=MBe(n,i,y,b);if(!isFinite(_)||_<=0)return p.state=St.EMPTY,p;var S=f!==void 0?f:OBe;if(p.triangulation_=new TBe(n,i,y,v,_*S,b),p.triangulation_.getTriangles().length===0)return p.state=St.EMPTY,p;p.sourceZ_=r.getZForResolution(_);var O=p.triangulation_.calculateSourceExtent();if(v&&(n.canWrapX()?(O[1]=Br(O[1],v[1],v[3]),O[3]=Br(O[3],v[1],v[3])):O=Hx(O,v)),!QL(O))p.state=St.EMPTY;else{for(var C=r.getTileRangeForExtentAndZ(O,p.sourceZ_),E=C.minX;E<=C.maxX;E++)for(var k=C.minY;k<=C.maxY;k++){var I=u(p.sourceZ_,E,k,l);I&&p.sourceTiles_.push(I)}p.sourceTiles_.length===0&&(p.state=St.EMPTY)}return p}return e.prototype.getImage=function(){return this.canvas_},e.prototype.reproject_=function(){var n=[];if(this.sourceTiles_.forEach((function(u,f,d){u&&u.getState()==St.LOADED&&n.push({extent:this.sourceTileGrid_.getTileCoordExtent(u.tileCoord),image:u.getImage()})}).bind(this)),this.sourceTiles_.length=0,n.length===0)this.state=St.ERROR;else{var r=this.wrappedTileCoord_[0],i=this.targetTileGrid_.getTileSize(r),o=typeof i=="number"?i:i[0],a=typeof i=="number"?i:i[1],s=this.targetTileGrid_.getResolution(r),l=this.sourceTileGrid_.getResolution(this.sourceZ_),c=this.targetTileGrid_.getTileCoordExtent(this.wrappedTileCoord_);this.canvas_=kBe(o,a,this.pixelRatio_,l,this.sourceTileGrid_.getExtent(),s,c,this.triangulation_,n,this.gutter_,this.renderEdges_,this.interpolate),this.state=St.LOADED}this.changed()},e.prototype.load=function(){if(this.state==St.IDLE){this.state=St.LOADING,this.changed();var n=0;this.sourcesListenerKeys_=[],this.sourceTiles_.forEach((function(r,i,o){var a=r.getState();if(a==St.IDLE||a==St.LOADING){n++;var s=rn(r,Mt.CHANGE,function(l){var c=r.getState();(c==St.LOADED||c==St.ERROR||c==St.EMPTY)&&(nr(s),n--,n===0&&(this.unlistenSources_(),this.reproject_()))},this);this.sourcesListenerKeys_.push(s)}}).bind(this)),n===0?setTimeout(this.reproject_.bind(this),0):this.sourceTiles_.forEach(function(r,i,o){var a=r.getState();a==St.IDLE&&r.load()})}},e.prototype.unlistenSources_=function(){this.sourcesListenerKeys_.forEach(nr),this.sourcesListenerKeys_=null},e.prototype.release=function(){this.canvas_&&(Soe(this.canvas_.getContext("2d")),Zoe.push(this.canvas_),this.canvas_=null),t.prototype.release.call(this)},e}(Foe);const KA={TILELOADSTART:"tileloadstart",TILELOADEND:"tileloadend",TILELOADERROR:"tileloaderror"};var RBe=[0,0,0],Nu=5,LB=function(){function t(e){this.minZoom=e.minZoom!==void 0?e.minZoom:0,this.resolutions_=e.resolutions,Ut(M3e(this.resolutions_,function(a,s){return s-a}),17);var n;if(!e.origins){for(var r=0,i=this.resolutions_.length-1;r<i;++r)if(!n)n=this.resolutions_[r]/this.resolutions_[r+1];else if(this.resolutions_[r]/this.resolutions_[r+1]!==n){n=void 0;break}}this.zoomFactor_=n,this.maxZoom=this.resolutions_.length-1,this.origin_=e.origin!==void 0?e.origin:null,this.origins_=null,e.origins!==void 0&&(this.origins_=e.origins,Ut(this.origins_.length==this.resolutions_.length,20));var o=e.extent;o!==void 0&&!this.origin_&&!this.origins_&&(this.origin_=Rp(o)),Ut(!this.origin_&&this.origins_||this.origin_&&!this.origins_,18),this.tileSizes_=null,e.tileSizes!==void 0&&(this.tileSizes_=e.tileSizes,Ut(this.tileSizes_.length==this.resolutions_.length,19)),this.tileSize_=e.tileSize!==void 0?e.tileSize:this.tileSizes_?null:TB,Ut(!this.tileSize_&&this.tileSizes_||this.tileSize_&&!this.tileSizes_,22),this.extent_=o!==void 0?o:null,this.fullTileRanges_=null,this.tmpSize_=[0,0],this.tmpExtent_=[0,0,0,0],e.sizes!==void 0?this.fullTileRanges_=e.sizes.map(function(a,s){var l=new DB(Math.min(0,a[0]),Math.max(a[0]-1,-1),Math.min(0,a[1]),Math.max(a[1]-1,-1));if(o){var c=this.getTileRangeForExtentAndZ(o,s);l.minX=Math.max(c.minX,l.minX),l.maxX=Math.min(c.maxX,l.maxX),l.minY=Math.max(c.minY,l.minY),l.maxY=Math.min(c.maxY,l.maxY)}return l},this):o&&this.calculateTileRanges_(o)}return t.prototype.forEachTileCoord=function(e,n,r){for(var i=this.getTileRangeForExtentAndZ(e,n),o=i.minX,a=i.maxX;o<=a;++o)for(var s=i.minY,l=i.maxY;s<=l;++s)r([n,o,s])},t.prototype.forEachTileCoordParentTileRange=function(e,n,r,i){var o,a,s,l=null,c=e[0]-1;for(this.zoomFactor_===2?(a=e[1],s=e[2]):l=this.getTileCoordExtent(e,i);c>=this.minZoom;){if(this.zoomFactor_===2?(a=Math.floor(a/2),s=Math.floor(s/2),o=rm(a,a,s,s,r)):o=this.getTileRangeForExtentAndZ(l,c,r),n(c,o))return!0;--c}return!1},t.prototype.getExtent=function(){return this.extent_},t.prototype.getMaxZoom=function(){return this.maxZoom},t.prototype.getMinZoom=function(){return this.minZoom},t.prototype.getOrigin=function(e){return this.origin_?this.origin_:this.origins_[e]},t.prototype.getResolution=function(e){return this.resolutions_[e]},t.prototype.getResolutions=function(){return this.resolutions_},t.prototype.getTileCoordChildTileRange=function(e,n,r){if(e[0]<this.maxZoom){if(this.zoomFactor_===2){var i=e[1]*2,o=e[2]*2;return rm(i,i+1,o,o+1,n)}var a=this.getTileCoordExtent(e,r||this.tmpExtent_);return this.getTileRangeForExtentAndZ(a,e[0]+1,n)}return null},t.prototype.getTileRangeForTileCoordAndZ=function(e,n,r){if(n>this.maxZoom||n<this.minZoom)return null;var i=e[0],o=e[1],a=e[2];if(n===i)return rm(o,a,o,a,r);if(this.zoomFactor_){var s=Math.pow(this.zoomFactor_,n-i),l=Math.floor(o*s),c=Math.floor(a*s);if(n<i)return rm(l,l,c,c,r);var u=Math.floor(s*(o+1))-1,f=Math.floor(s*(a+1))-1;return rm(l,u,c,f,r)}var d=this.getTileCoordExtent(e,this.tmpExtent_);return this.getTileRangeForExtentAndZ(d,n,r)},t.prototype.getTileRangeExtent=function(e,n,r){var i=this.getOrigin(e),o=this.getResolution(e),a=fa(this.getTileSize(e),this.tmpSize_),s=i[0]+n.minX*a[0]*o,l=i[0]+(n.maxX+1)*a[0]*o,c=i[1]+n.minY*a[1]*o,u=i[1]+(n.maxY+1)*a[1]*o;return Zs(s,c,l,u,r)},t.prototype.getTileRangeForExtentAndZ=function(e,n,r){var i=RBe;this.getTileCoordForXYAndZ_(e[0],e[3],n,!1,i);var o=i[1],a=i[2];return this.getTileCoordForXYAndZ_(e[2],e[1],n,!0,i),rm(o,i[1],a,i[2],r)},t.prototype.getTileCoordCenter=function(e){var n=this.getOrigin(e[0]),r=this.getResolution(e[0]),i=fa(this.getTileSize(e[0]),this.tmpSize_);return[n[0]+(e[1]+.5)*i[0]*r,n[1]-(e[2]+.5)*i[1]*r]},t.prototype.getTileCoordExtent=function(e,n){var r=this.getOrigin(e[0]),i=this.getResolution(e[0]),o=fa(this.getTileSize(e[0]),this.tmpSize_),a=r[0]+e[1]*o[0]*i,s=r[1]-(e[2]+1)*o[1]*i,l=a+o[0]*i,c=s+o[1]*i;return Zs(a,s,l,c,n)},t.prototype.getTileCoordForCoordAndResolution=function(e,n,r){return this.getTileCoordForXYAndResolution_(e[0],e[1],n,!1,r)},t.prototype.getTileCoordForXYAndResolution_=function(e,n,r,i,o){var a=this.getZForResolution(r),s=r/this.getResolution(a),l=this.getOrigin(a),c=fa(this.getTileSize(a),this.tmpSize_),u=s*(e-l[0])/r/c[0],f=s*(l[1]-n)/r/c[1];return i?(u=vS(u,Nu)-1,f=vS(f,Nu)-1):(u=gS(u,Nu),f=gS(f,Nu)),rH(a,u,f,o)},t.prototype.getTileCoordForXYAndZ_=function(e,n,r,i,o){var a=this.getOrigin(r),s=this.getResolution(r),l=fa(this.getTileSize(r),this.tmpSize_),c=(e-a[0])/s/l[0],u=(a[1]-n)/s/l[1];return i?(c=vS(c,Nu)-1,u=vS(u,Nu)-1):(c=gS(c,Nu),u=gS(u,Nu)),rH(r,c,u,o)},t.prototype.getTileCoordForCoordAndZ=function(e,n,r){return this.getTileCoordForXYAndZ_(e[0],e[1],n,!1,r)},t.prototype.getTileCoordResolution=function(e){return this.resolutions_[e[0]]},t.prototype.getTileSize=function(e){return this.tileSize_?this.tileSize_:this.tileSizes_[e]},t.prototype.getFullTileRange=function(e){return this.fullTileRanges_?this.fullTileRanges_[e]:this.extent_?this.getTileRangeForExtentAndZ(this.extent_,e):null},t.prototype.getZForResolution=function(e,n){var r=X5(this.resolutions_,e,n||0);return Br(r,this.minZoom,this.maxZoom)},t.prototype.tileCoordIntersectsViewport=function(e,n){return Yie(n,0,n.length,2,this.getTileCoordExtent(e))},t.prototype.calculateTileRanges_=function(e){for(var n=this.resolutions_.length,r=new Array(n),i=this.minZoom;i<n;++i)r[i]=this.getTileRangeForExtentAndZ(e,i);this.fullTileRanges_=r},t}();function eae(t){var e=t.getDefaultTileGrid();return e||(e=NBe(t),t.setDefaultTileGrid(e)),e}function IBe(t,e,n){var r=e[0],i=t.getTileCoordCenter(e),o=NB(n);if(z1(o,i))return e;var a=Kn(o),s=Math.ceil((o[0]-i[0])/a);return i[0]+=a*s,t.getTileCoordForCoordAndZ(i,r)}function DBe(t,e,n,r){var i=tae(t,e,n);return new LB({extent:t,origin:K3e(t),resolutions:i,tileSize:n})}function LBe(t){var e=t||{},n=e.extent||zr("EPSG:3857").getExtent(),r={extent:n,minZoom:e.minZoom,tileSize:e.tileSize,resolutions:tae(n,e.maxZoom,e.tileSize,e.maxResolution)};return new LB(r)}function tae(t,e,n,r){for(var i=e!==void 0?e:g5e,o=ps(t),a=Kn(t),s=fa(n!==void 0?n:TB),l=r>0?r:Math.max(a/s[0],o/s[1]),c=i+1,u=new Array(c),f=0;f<c;++f)u[f]=l/Math.pow(2,f);return u}function NBe(t,e,n,r){var i=NB(t);return DBe(i,e,n)}function NB(t){t=zr(t);var e=t.getExtent();if(!e){var n=180*Ks[ci.DEGREES]/t.getMetersPerUnit();e=Zs(-n,-n,n,n)}return e}var nae=function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,i){r.__proto__=i}||function(r,i){for(var o in i)Object.prototype.hasOwnProperty.call(i,o)&&(r[o]=i[o])},t(e,n)};return function(e,n){if(typeof n!="function"&&n!==null)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");t(e,n);function r(){this.constructor=e}e.prototype=n===null?Object.create(n):(r.prototype=n.prototype,new r)}}(),$Be=function(t){nae(e,t);function e(n){var r=t.call(this,{attributions:n.attributions,attributionsCollapsible:n.attributionsCollapsible,projection:n.projection,state:n.state,wrapX:n.wrapX,interpolate:n.interpolate})||this;r.on,r.once,r.un,r.opaque_=n.opaque!==void 0?n.opaque:!1,r.tilePixelRatio_=n.tilePixelRatio!==void 0?n.tilePixelRatio:1,r.tileGrid=n.tileGrid!==void 0?n.tileGrid:null;var i=[256,256];return r.tileGrid&&fa(r.tileGrid.getTileSize(r.tileGrid.getMinZoom()),i),r.tileCache=new Koe(n.cacheSize||0),r.tmpSize=[0,0],r.key_=n.key||"",r.tileOptions={transition:n.transition,interpolate:n.interpolate},r.zDirection=n.zDirection?n.zDirection:0,r}return e.prototype.canExpireCache=function(){return this.tileCache.canExpireCache()},e.prototype.expireCache=function(n,r){var i=this.getTileCacheForProjection(n);i&&i.expireCache(r)},e.prototype.forEachLoadedTile=function(n,r,i,o){var a=this.getTileCacheForProjection(n);if(!a)return!1;for(var s=!0,l,c,u,f=i.minX;f<=i.maxX;++f)for(var d=i.minY;d<=i.maxY;++d)c=g2(r,f,d),u=!1,a.containsKey(c)&&(l=a.get(c),u=l.getState()===St.LOADED,u&&(u=o(l)!==!1)),u||(s=!1);return s},e.prototype.getGutterForProjection=function(n){return 0},e.prototype.getKey=function(){return this.key_},e.prototype.setKey=function(n){this.key_!==n&&(this.key_=n,this.changed())},e.prototype.getOpaque=function(n){return this.opaque_},e.prototype.getResolutions=function(){return this.tileGrid?this.tileGrid.getResolutions():null},e.prototype.getTile=function(n,r,i,o,a){return yt()},e.prototype.getTileGrid=function(){return this.tileGrid},e.prototype.getTileGridForProjection=function(n){return this.tileGrid?this.tileGrid:eae(n)},e.prototype.getTileCacheForProjection=function(n){var r=this.getProjection();return Ut(r===null||sh(r,n),68),this.tileCache},e.prototype.getTilePixelRatio=function(n){return this.tilePixelRatio_},e.prototype.getTilePixelSize=function(n,r,i){var o=this.getTileGridForProjection(i),a=this.getTilePixelRatio(r),s=fa(o.getTileSize(n),this.tmpSize);return a==1?s:xoe(s,a,this.tmpSize)},e.prototype.getTileCoordForTileUrlFunction=function(n,r){var i=r!==void 0?r:this.getProjection(),o=this.getTileGridForProjection(i);return this.getWrapX()&&i.isGlobal()&&(n=IBe(o,n,i)),wBe(n,o)?n:null},e.prototype.clear=function(){this.tileCache.clear()},e.prototype.refresh=function(){this.clear(),t.prototype.refresh.call(this)},e.prototype.updateCacheSize=function(n,r){var i=this.getTileCacheForProjection(r);n>i.highWaterMark&&(i.highWaterMark=n)},e.prototype.useTile=function(n,r,i,o){},e}(Loe),FBe=function(t){nae(e,t);function e(n,r){var i=t.call(this,n)||this;return i.tile=r,i}return e}(ac);function jBe(t,e){var n=/\{z\}/g,r=/\{x\}/g,i=/\{y\}/g,o=/\{-y\}/g;return function(a,s,l){if(a)return t.replace(n,a[0].toString()).replace(r,a[1].toString()).replace(i,a[2].toString()).replace(o,function(){var c=a[0],u=e.getFullTileRange(c);Ut(u,55);var f=u.getHeight()-a[2]-1;return f.toString()})}}function BBe(t,e){for(var n=t.length,r=new Array(n),i=0;i<n;++i)r[i]=jBe(t[i],e);return zBe(r)}function zBe(t){return t.length===1?t[0]:function(e,n,r){if(e){var i=Yoe(e),o=jf(i,t.length);return t[o](e,n,r)}else return}}function UBe(t){var e=[],n=/\{([a-z])-([a-z])\}/.exec(t);if(n){var r=n[1].charCodeAt(0),i=n[2].charCodeAt(0),o=void 0;for(o=r;o<=i;++o)e.push(t.replace(n[0],String.fromCharCode(o)));return e}if(n=/\{(\d+)-(\d+)\}/.exec(t),n){for(var a=parseInt(n[2],10),s=parseInt(n[1],10);s<=a;s++)e.push(t.replace(n[0],s.toString()));return e}return e.push(t),e}var WBe=function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,i){r.__proto__=i}||function(r,i){for(var o in i)Object.prototype.hasOwnProperty.call(i,o)&&(r[o]=i[o])},t(e,n)};return function(e,n){if(typeof n!="function"&&n!==null)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");t(e,n);function r(){this.constructor=e}e.prototype=n===null?Object.create(n):(r.prototype=n.prototype,new r)}}(),y3=function(t){WBe(e,t);function e(n){var r=t.call(this,{attributions:n.attributions,cacheSize:n.cacheSize,opaque:n.opaque,projection:n.projection,state:n.state,tileGrid:n.tileGrid,tilePixelRatio:n.tilePixelRatio,wrapX:n.wrapX,transition:n.transition,interpolate:n.interpolate,key:n.key,attributionsCollapsible:n.attributionsCollapsible,zDirection:n.zDirection})||this;return r.generateTileUrlFunction_=r.tileUrlFunction===e.prototype.tileUrlFunction,r.tileLoadFunction=n.tileLoadFunction,n.tileUrlFunction&&(r.tileUrlFunction=n.tileUrlFunction),r.urls=null,n.urls?r.setUrls(n.urls):n.url&&r.setUrl(n.url),r.tileLoadingKeys_={},r}return e.prototype.getTileLoadFunction=function(){return this.tileLoadFunction},e.prototype.getTileUrlFunction=function(){return Object.getPrototypeOf(this).tileUrlFunction===this.tileUrlFunction?this.tileUrlFunction.bind(this):this.tileUrlFunction},e.prototype.getUrls=function(){return this.urls},e.prototype.handleTileChange=function(n){var r=n.target,i=vn(r),o=r.getState(),a;o==St.LOADING?(this.tileLoadingKeys_[i]=!0,a=KA.TILELOADSTART):i in this.tileLoadingKeys_&&(delete this.tileLoadingKeys_[i],a=o==St.ERROR?KA.TILELOADERROR:o==St.LOADED?KA.TILELOADEND:void 0),a!=null&&this.dispatchEvent(new FBe(a,r))},e.prototype.setTileLoadFunction=function(n){this.tileCache.clear(),this.tileLoadFunction=n,this.changed()},e.prototype.setTileUrlFunction=function(n,r){this.tileUrlFunction=n,this.tileCache.pruneExceptNewestZ(),typeof r<"u"?this.setKey(r):this.changed()},e.prototype.setUrl=function(n){var r=UBe(n);this.urls=r,this.setUrls(r)},e.prototype.setUrls=function(n){this.urls=n;var r=n.join(`
`);this.generateTileUrlFunction_?this.setTileUrlFunction(BBe(n,this.tileGrid),r):this.setKey(r)},e.prototype.tileUrlFunction=function(n,r,i){},e.prototype.useTile=function(n,r,i){var o=g2(n,r,i);this.tileCache.containsKey(o)&&this.tileCache.get(o)},e}($Be),VBe=function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,i){r.__proto__=i}||function(r,i){for(var o in i)Object.prototype.hasOwnProperty.call(i,o)&&(r[o]=i[o])},t(e,n)};return function(e,n){if(typeof n!="function"&&n!==null)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");t(e,n);function r(){this.constructor=e}e.prototype=n===null?Object.create(n):(r.prototype=n.prototype,new r)}}(),rae=function(t){VBe(e,t);function e(n){var r=this,i=n.imageSmoothing!==void 0?n.imageSmoothing:!0;return n.interpolate!==void 0&&(i=n.interpolate),r=t.call(this,{attributions:n.attributions,cacheSize:n.cacheSize,opaque:n.opaque,projection:n.projection,state:n.state,tileGrid:n.tileGrid,tileLoadFunction:n.tileLoadFunction?n.tileLoadFunction:GBe,tilePixelRatio:n.tilePixelRatio,tileUrlFunction:n.tileUrlFunction,url:n.url,urls:n.urls,wrapX:n.wrapX,transition:n.transition,interpolate:i,key:n.key,attributionsCollapsible:n.attributionsCollapsible,zDirection:n.zDirection})||this,r.crossOrigin=n.crossOrigin!==void 0?n.crossOrigin:null,r.tileClass=n.tileClass!==void 0?n.tileClass:CB,r.tileCacheForProjection={},r.tileGridForProjection={},r.reprojectionErrorThreshold_=n.reprojectionErrorThreshold,r.renderReprojectionEdges_=!1,r}return e.prototype.canExpireCache=function(){if(this.tileCache.canExpireCache())return!0;for(var n in this.tileCacheForProjection)if(this.tileCacheForProjection[n].canExpireCache())return!0;return!1},e.prototype.expireCache=function(n,r){var i=this.getTileCacheForProjection(n);this.tileCache.expireCache(this.tileCache==i?r:{});for(var o in this.tileCacheForProjection){var a=this.tileCacheForProjection[o];a.expireCache(a==i?r:{})}},e.prototype.getGutterForProjection=function(n){return this.getProjection()&&n&&!sh(this.getProjection(),n)?0:this.getGutter()},e.prototype.getGutter=function(){return 0},e.prototype.getKey=function(){var n=t.prototype.getKey.call(this);return this.getInterpolate()||(n+=":disable-interpolation"),n},e.prototype.getOpaque=function(n){return this.getProjection()&&n&&!sh(this.getProjection(),n)?!1:t.prototype.getOpaque.call(this,n)},e.prototype.getTileGridForProjection=function(n){var r=this.getProjection();if(this.tileGrid&&(!r||sh(r,n)))return this.tileGrid;var i=vn(n);return i in this.tileGridForProjection||(this.tileGridForProjection[i]=eae(n)),this.tileGridForProjection[i]},e.prototype.getTileCacheForProjection=function(n){var r=this.getProjection();if(!r||sh(r,n))return this.tileCache;var i=vn(n);return i in this.tileCacheForProjection||(this.tileCacheForProjection[i]=new Koe(this.tileCache.highWaterMark)),this.tileCacheForProjection[i]},e.prototype.createTile_=function(n,r,i,o,a,s){var l=[n,r,i],c=this.getTileCoordForTileUrlFunction(l,a),u=c?this.tileUrlFunction(c,o,a):void 0,f=new this.tileClass(l,u!==void 0?St.IDLE:St.EMPTY,u!==void 0?u:"",this.crossOrigin,this.tileLoadFunction,this.tileOptions);return f.key=s,f.addEventListener(Mt.CHANGE,this.handleTileChange.bind(this)),f},e.prototype.getTile=function(n,r,i,o,a){var s=this.getProjection();if(!s||!a||sh(s,a))return this.getTileInternal(n,r,i,o,s||a);var l=this.getTileCacheForProjection(a),c=[n,r,i],u=void 0,f=Qoe(c);l.containsKey(f)&&(u=l.get(f));var d=this.getKey();if(u&&u.key==d)return u;var h=this.getTileGridForProjection(s),p=this.getTileGridForProjection(a),m=this.getTileCoordForTileUrlFunction(c,a),g=new Joe(s,h,a,p,c,m,this.getTilePixelRatio(o),this.getGutter(),(function(v,y,x,b){return this.getTileInternal(v,y,x,b,s)}).bind(this),this.reprojectionErrorThreshold_,this.renderReprojectionEdges_,this.getInterpolate());return g.key=d,u?(g.interimTile=u,g.refreshInterimChain(),l.replace(f,g)):l.set(f,g),g},e.prototype.getTileInternal=function(n,r,i,o,a){var s=null,l=g2(n,r,i),c=this.getKey();if(!this.tileCache.containsKey(l))s=this.createTile_(n,r,i,o,a,c),this.tileCache.set(l,s);else if(s=this.tileCache.get(l),s.key!=c){var u=s;s=this.createTile_(n,r,i,o,a,c),u.getState()==St.IDLE?s.interimTile=u.interimTile:s.interimTile=u,s.refreshInterimChain(),this.tileCache.replace(l,s)}return s},e.prototype.setRenderReprojectionEdges=function(n){if(this.renderReprojectionEdges_!=n){this.renderReprojectionEdges_=n;for(var r in this.tileCacheForProjection)this.tileCacheForProjection[r].clear();this.changed()}},e.prototype.setTileGridForProjection=function(n,r){{var i=zr(n);if(i){var o=vn(i);o in this.tileGridForProjection||(this.tileGridForProjection[o]=r)}}},e}(y3);function GBe(t,e){t.getImage().src=e}var HBe=function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,i){r.__proto__=i}||function(r,i){for(var o in i)Object.prototype.hasOwnProperty.call(i,o)&&(r[o]=i[o])},t(e,n)};return function(e,n){if(typeof n!="function"&&n!==null)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");t(e,n);function r(){this.constructor=e}e.prototype=n===null?Object.create(n):(r.prototype=n.prototype,new r)}}(),hy=function(t){HBe(e,t);function e(n){var r=this,i=n||{},o=i.imageSmoothing!==void 0?i.imageSmoothing:!0;i.interpolate!==void 0&&(o=i.interpolate);var a=i.projection!==void 0?i.projection:"EPSG:3857",s=i.tileGrid!==void 0?i.tileGrid:LBe({extent:NB(a),maxResolution:i.maxResolution,maxZoom:i.maxZoom,minZoom:i.minZoom,tileSize:i.tileSize});return r=t.call(this,{attributions:i.attributions,cacheSize:i.cacheSize,crossOrigin:i.crossOrigin,interpolate:o,opaque:i.opaque,projection:a,reprojectionErrorThreshold:i.reprojectionErrorThreshold,tileGrid:s,tileLoadFunction:i.tileLoadFunction,tilePixelRatio:i.tilePixelRatio,tileUrlFunction:i.tileUrlFunction,url:i.url,urls:i.urls,wrapX:i.wrapX!==void 0?i.wrapX:!0,transition:i.transition,attributionsCollapsible:i.attributionsCollapsible,zDirection:i.zDirection})||this,r.gutter_=i.gutter!==void 0?i.gutter:0,r}return e.prototype.getGutter=function(){return this.gutter_},e}(rae),MS="1.3.0";function aH(t,e){var n=[];Object.keys(e).forEach(function(i){e[i]!==null&&e[i]!==void 0&&n.push(i+"="+encodeURIComponent(e[i]))});var r=n.join("&");return t=t.replace(/[?&]$/,""),t=t.indexOf("?")===-1?t+"?":t+"&",t+r}var qBe=function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,i){r.__proto__=i}||function(r,i){for(var o in i)Object.prototype.hasOwnProperty.call(i,o)&&(r[o]=i[o])},t(e,n)};return function(e,n){if(typeof n!="function"&&n!==null)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");t(e,n);function r(){this.constructor=e}e.prototype=n===null?Object.create(n):(r.prototype=n.prototype,new r)}}(),XBe=function(t){qBe(e,t);function e(n){var r=this,i=n||{},o=i.imageSmoothing!==void 0?i.imageSmoothing:!0;i.interpolate!==void 0&&(o=i.interpolate);var a=i.params||{},s="TRANSPARENT"in a?a.TRANSPARENT:!0;return r=t.call(this,{attributions:i.attributions,attributionsCollapsible:i.attributionsCollapsible,cacheSize:i.cacheSize,crossOrigin:i.crossOrigin,interpolate:o,opaque:!s,projection:i.projection,reprojectionErrorThreshold:i.reprojectionErrorThreshold,tileClass:i.tileClass,tileGrid:i.tileGrid,tileLoadFunction:i.tileLoadFunction,url:i.url,urls:i.urls,wrapX:i.wrapX!==void 0?i.wrapX:!0,transition:i.transition,zDirection:i.zDirection})||this,r.gutter_=i.gutter!==void 0?i.gutter:0,r.params_=a,r.v13_=!0,r.serverType_=i.serverType,r.hidpi_=i.hidpi!==void 0?i.hidpi:!0,r.tmpExtent_=Oa(),r.updateV13_(),r.setKey(r.getKeyForParams_()),r}return e.prototype.getFeatureInfoUrl=function(n,r,i,o){var a=zr(i),s=this.getProjection(),l=this.getTileGrid();l||(l=this.getTileGridForProjection(a));var c=l.getZForResolution(r,this.zDirection),u=l.getTileCoordForCoordAndZ(n,c);if(!(l.getResolutions().length<=u[0])){var f=l.getResolution(u[0]),d=l.getTileCoordExtent(u,this.tmpExtent_),h=fa(l.getTileSize(u[0]),this.tmpSize),p=this.gutter_;p!==0&&(h=AG(h,p,this.tmpSize),d=Fb(d,f*p,d)),s&&s!==a&&(f=v3(s,a,n,f),d=zie(d,a,s),n=a2(n,a,s));var m={SERVICE:"WMS",VERSION:MS,REQUEST:"GetFeatureInfo",FORMAT:"image/png",TRANSPARENT:!0,QUERY_LAYERS:this.params_.LAYERS};ur(m,this.params_,o);var g=Math.floor((n[0]-d[0])/f),v=Math.floor((d[3]-n[1])/f);return m[this.v13_?"I":"X"]=g,m[this.v13_?"J":"Y"]=v,this.getRequestUrl_(u,h,d,1,s||a,m)}},e.prototype.getLegendUrl=function(n,r){if(this.urls[0]!==void 0){var i={SERVICE:"WMS",VERSION:MS,REQUEST:"GetLegendGraphic",FORMAT:"image/png"};if(r===void 0||r.LAYER===void 0){var o=this.params_.LAYERS,a=!Array.isArray(o)||o.length===1;if(!a)return;i.LAYER=o}if(n!==void 0){var s=this.getProjection()?this.getProjection().getMetersPerUnit():1,l=28e-5;i.SCALE=n*s/l}return ur(i,r),aH(this.urls[0],i)}},e.prototype.getGutter=function(){return this.gutter_},e.prototype.getParams=function(){return this.params_},e.prototype.getRequestUrl_=function(n,r,i,o,a,s){var l=this.urls;if(l){if(s.WIDTH=r[0],s.HEIGHT=r[1],s[this.v13_?"CRS":"SRS"]=a.getCode(),"STYLES"in this.params_||(s.STYLES=""),o!=1)switch(this.serverType_){case"geoserver":var c=90*o+.5|0;"FORMAT_OPTIONS"in s?s.FORMAT_OPTIONS+=";dpi:"+c:s.FORMAT_OPTIONS="dpi:"+c;break;case"mapserver":s.MAP_RESOLUTION=90*o;break;case"carmentaserver":case"qgis":s.DPI=90*o;break;default:Ut(!1,52);break}var u=a.getAxisOrientation(),f=i;if(this.v13_&&u.substr(0,2)=="ne"){var d=void 0;d=i[0],f[0]=i[1],f[1]=d,d=i[2],f[2]=i[3],f[3]=d}s.BBOX=f.join(",");var h;if(l.length==1)h=l[0];else{var p=jf(Yoe(n),l.length);h=l[p]}return aH(h,s)}},e.prototype.getTilePixelRatio=function(n){return!this.hidpi_||this.serverType_===void 0?1:n},e.prototype.getKeyForParams_=function(){var n=0,r=[];for(var i in this.params_)r[n++]=i+"-"+this.params_[i];return r.join("/")},e.prototype.updateParams=function(n){ur(this.params_,n),this.updateV13_(),this.setKey(this.getKeyForParams_())},e.prototype.updateV13_=function(){var n=this.params_.VERSION||MS;this.v13_=vNe(n,"1.3")>=0},e.prototype.tileUrlFunction=function(n,r,i){var o=this.getTileGrid();if(o||(o=this.getTileGridForProjection(i)),!(o.getResolutions().length<=n[0])){r!=1&&(!this.hidpi_||this.serverType_===void 0)&&(r=1);var a=o.getResolution(n[0]),s=o.getTileCoordExtent(n,this.tmpExtent_),l=fa(o.getTileSize(n[0]),this.tmpSize),c=this.gutter_;c!==0&&(l=AG(l,c,this.tmpSize),s=Fb(s,a*c,s)),r!=1&&(l=xoe(l,r,this.tmpSize));var u={SERVICE:"WMS",VERSION:MS,REQUEST:"GetMap",FORMAT:"image/png",TRANSPARENT:!0};return ur(u,this.params_),this.getRequestUrl_(n,l,s,r,i,u)}},e}(rae);function iae(t){return w.jsx(M.Fragment,{children:t.children})}const kS={PRELOAD:"preload",USE_INTERIM_TILES_ON_ERROR:"useInterimTilesOnError"};var QBe=function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,i){r.__proto__=i}||function(r,i){for(var o in i)Object.prototype.hasOwnProperty.call(i,o)&&(r[o]=i[o])},t(e,n)};return function(e,n){if(typeof n!="function"&&n!==null)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");t(e,n);function r(){this.constructor=e}e.prototype=n===null?Object.create(n):(r.prototype=n.prototype,new r)}}(),YBe=function(t){QBe(e,t);function e(n){var r=this,i=n||{},o=ur({},i);return delete o.preload,delete o.useInterimTilesOnError,r=t.call(this,o)||this,r.on,r.once,r.un,r.setPreload(i.preload!==void 0?i.preload:0),r.setUseInterimTilesOnError(i.useInterimTilesOnError!==void 0?i.useInterimTilesOnError:!0),r}return e.prototype.getPreload=function(){return this.get(kS.PRELOAD)},e.prototype.setPreload=function(n){this.set(kS.PRELOAD,n)},e.prototype.getUseInterimTilesOnError=function(){return this.get(kS.USE_INTERIM_TILES_ON_ERROR)},e.prototype.setUseInterimTilesOnError=function(n){this.set(kS.USE_INTERIM_TILES_ON_ERROR,n)},e.prototype.getData=function(n){return t.prototype.getData.call(this,n)},e}(d2),KBe=function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,i){r.__proto__=i}||function(r,i){for(var o in i)Object.prototype.hasOwnProperty.call(i,o)&&(r[o]=i[o])},t(e,n)};return function(e,n){if(typeof n!="function"&&n!==null)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");t(e,n);function r(){this.constructor=e}e.prototype=n===null?Object.create(n):(r.prototype=n.prototype,new r)}}(),ZBe=function(t){KBe(e,t);function e(n){var r=t.call(this,n)||this;return r.extentChanged=!0,r.renderedExtent_=null,r.renderedPixelRatio,r.renderedProjection=null,r.renderedRevision,r.renderedTiles=[],r.newTiles_=!1,r.tmpExtent=Oa(),r.tmpTileRange_=new DB(0,0,0,0),r}return e.prototype.isDrawableTile=function(n){var r=this.getLayer(),i=n.getState(),o=r.getUseInterimTilesOnError();return i==St.LOADED||i==St.EMPTY||i==St.ERROR&&!o},e.prototype.getTile=function(n,r,i,o){var a=o.pixelRatio,s=o.viewState.projection,l=this.getLayer(),c=l.getSource(),u=c.getTile(n,r,i,a,s);return u.getState()==St.ERROR&&(l.getUseInterimTilesOnError()?l.getPreload()>0&&(this.newTiles_=!0):u.setState(St.LOADED)),this.isDrawableTile(u)||(u=u.getInterimTile()),u},e.prototype.getData=function(n){var r=this.frameState;if(!r)return null;var i=this.getLayer(),o=Cr(r.pixelToCoordinateTransform,n.slice()),a=i.getExtent();if(a&&!z1(a,o))return null;for(var s=r.pixelRatio,l=r.viewState.projection,c=r.viewState,u=i.getRenderSource(),f=u.getTileGridForProjection(c.projection),d=u.getTilePixelRatio(r.pixelRatio),h=f.getZForResolution(c.resolution);h>=f.getMinZoom();--h){var p=f.getTileCoordForCoordAndZ(o,h),m=u.getTile(h,p[1],p[2],s,l);if(!(m instanceof CB||m instanceof Joe))return null;if(m.getState()===St.LOADED){var g=f.getOrigin(h),v=fa(f.getTileSize(h)),y=f.getResolution(h),x=Math.floor(d*((o[0]-g[0])/y-p[1]*v[0])),b=Math.floor(d*((g[1]-o[1])/y-p[2]*v[1])),_=Math.round(d*u.getGutterForProjection(c.projection));return this.getImageData(m.getImage(),x+_,b+_)}}return null},e.prototype.loadedTileCallback=function(n,r,i){return this.isDrawableTile(i)?t.prototype.loadedTileCallback.call(this,n,r,i):!1},e.prototype.prepareFrame=function(n){return!!this.getLayer().getSource()},e.prototype.renderFrame=function(n,r){var i=n.layerStatesArray[n.layerIndex],o=n.viewState,a=o.projection,s=o.resolution,l=o.center,c=o.rotation,u=n.pixelRatio,f=this.getLayer(),d=f.getSource(),h=d.getRevision(),p=d.getTileGridForProjection(a),m=p.getZForResolution(s,d.zDirection),g=p.getResolution(m),v=n.extent,y=n.viewState.resolution,x=d.getTilePixelRatio(u),b=Math.round(Kn(v)/y*u),_=Math.round(ps(v)/y*u),S=i.extent&&xh(i.extent);S&&(v=Hx(v,xh(i.extent)));var O=g*b/2/x,C=g*_/2/x,E=[l[0]-O,l[1]-C,l[0]+O,l[1]+C],k=p.getTileRangeForExtentAndZ(v,m),I={};I[m]={};var P=this.createLoadedTileFinder(d,a,I),R=this.tmpExtent,T=this.tmpTileRange_;this.newTiles_=!1;for(var L=c?KL(o.center,y,c,n.size):void 0,z=k.minX;z<=k.maxX;++z)for(var B=k.minY;B<=k.maxY;++B)if(!(c&&!p.tileCoordIntersectsViewport([m,z,B],L))){var U=this.getTile(m,z,B,n);if(this.isDrawableTile(U)){var W=vn(this);if(U.getState()==St.LOADED){I[m][U.tileCoord.toString()]=U;var $=U.inTransition(W);$&&i.opacity!==1&&(U.endTransition(W),$=!1),!this.newTiles_&&($||this.renderedTiles.indexOf(U)===-1)&&(this.newTiles_=!0)}if(U.getAlpha(W,n.time)===1)continue}var N=p.getTileCoordChildTileRange(U.tileCoord,T,R),D=!1;N&&(D=P(m+1,N)),D||p.forEachTileCoordParentTileRange(U.tileCoord,P,T,R)}var A=g/s*u/x;hu(this.pixelTransform,n.size[0]/2,n.size[1]/2,1/u,1/u,c,-b/2,-_/2);var q=Aie(this.pixelTransform);this.useContainer(r,q,this.getBackground(n));var Y=this.context,K=Y.canvas;Q5(this.inversePixelTransform,this.pixelTransform),hu(this.tempTransform,b/2,_/2,A,A,0,-b/2,-_/2),K.width!=b||K.height!=_?(K.width=b,K.height=_):this.containerReused||Y.clearRect(0,0,b,_),S&&this.clipUnrotated(Y,n,S),d.getInterpolate()||ur(Y,g3),this.preRender(Y,n),this.renderedTiles.length=0;var se=Object.keys(I).map(Number);se.sort(rp);var te,J,pe;i.opacity===1&&(!this.containerReused||d.getOpaque(n.viewState.projection))?se=se.reverse():(te=[],J=[]);for(var be=se.length-1;be>=0;--be){var re=se[be],ve=d.getTilePixelSize(re,u,a),F=p.getResolution(re),ce=F/g,le=ve[0]*ce*A,Q=ve[1]*ce*A,X=p.getTileCoordForCoordAndZ(Rp(E),re),ee=p.getTileCoordExtent(X),ge=Cr(this.tempTransform,[x*(ee[0]-E[0])/g,x*(E[3]-ee[3])/g]),ye=x*d.getGutterForProjection(a),H=I[re];for(var G in H){var U=H[G],ie=U.tileCoord,he=X[1]-ie[1],_e=Math.round(ge[0]-(he-1)*le),oe=X[2]-ie[2],Z=Math.round(ge[1]-(oe-1)*Q),z=Math.round(ge[0]-he*le),B=Math.round(ge[1]-oe*Q),V=_e-z,de=Z-B,xe=m===re,$=xe&&U.getAlpha(vn(this),n.time)!==1,Me=!1;if(!$)if(te){pe=[z,B,z+V,B,z+V,B+de,z,B+de];for(var me=0,$e=te.length;me<$e;++me)if(m!==re&&re<J[me]){var Te=te[me];so([z,B,z+V,B+de],[Te[0],Te[3],Te[4],Te[7]])&&(Me||(Y.save(),Me=!0),Y.beginPath(),Y.moveTo(pe[0],pe[1]),Y.lineTo(pe[2],pe[3]),Y.lineTo(pe[4],pe[5]),Y.lineTo(pe[6],pe[7]),Y.moveTo(Te[6],Te[7]),Y.lineTo(Te[4],Te[5]),Y.lineTo(Te[2],Te[3]),Y.lineTo(Te[0],Te[1]),Y.clip())}te.push(pe),J.push(re)}else Y.clearRect(z,B,V,de);this.drawTileImage(U,n,z,B,V,de,ye,xe),te&&!$?(Me&&Y.restore(),this.renderedTiles.unshift(U)):this.renderedTiles.push(U),this.updateUsedTiles(n.usedTiles,d,U)}}return this.renderedRevision=h,this.renderedResolution=g,this.extentChanged=!this.renderedExtent_||!jb(this.renderedExtent_,E),this.renderedExtent_=E,this.renderedPixelRatio=u,this.renderedProjection=a,this.manageTilePyramid(n,d,p,u,a,v,m,f.getPreload()),this.scheduleExpireCache(n,d),this.postRender(Y,n),i.extent&&Y.restore(),ur(Y,EBe),q!==K.style.transform&&(K.style.transform=q),this.container},e.prototype.drawTileImage=function(n,r,i,o,a,s,l,c){var u=this.getTileImage(n);if(u){var f=vn(this),d=r.layerStatesArray[r.layerIndex],h=d.opacity*(c?n.getAlpha(f,r.time):1),p=h!==this.context.globalAlpha;p&&(this.context.save(),this.context.globalAlpha=h),this.context.drawImage(u,l,l,u.width-2*l,u.height-2*l,i,o,a,s),p&&this.context.restore(),h!==d.opacity?r.animate=!0:c&&n.endTransition(f)}},e.prototype.getImage=function(){var n=this.context;return n?n.canvas:null},e.prototype.getTileImage=function(n){return n.getImage()},e.prototype.scheduleExpireCache=function(n,r){if(r.canExpireCache()){var i=(function(o,a,s){var l=vn(o);l in s.usedTiles&&o.expireCache(s.viewState.projection,s.usedTiles[l])}).bind(null,r);n.postRenderFunctions.push(i)}},e.prototype.updateUsedTiles=function(n,r,i){var o=vn(r);o in n||(n[o]={}),n[o][i.getKey()]=!0},e.prototype.manageTilePyramid=function(n,r,i,o,a,s,l,c,u){var f=vn(r);f in n.wantedTiles||(n.wantedTiles[f]={});var d=n.wantedTiles[f],h=n.tileQueue,p=i.getMinZoom(),m=n.viewState.rotation,g=m?KL(n.viewState.center,n.viewState.resolution,m,n.size):void 0,v=0,y,x,b,_,S,O;for(O=p;O<=l;++O)for(x=i.getTileRangeForExtentAndZ(s,O,x),b=i.getResolution(O),_=x.minX;_<=x.maxX;++_)for(S=x.minY;S<=x.maxY;++S)m&&!i.tileCoordIntersectsViewport([O,_,S],g)||(l-O<=c?(++v,y=r.getTile(O,_,S,o,a),y.getState()==St.IDLE&&(d[y.getKey()]=!0,h.isKeyQueued(y.getKey())||h.enqueue([y,f,i.getTileCoordCenter(y.tileCoord),b])),u!==void 0&&u(y)):r.useTile(O,_,S,a));r.updateCacheSize(v,a)},e}(Roe),JBe=function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,i){r.__proto__=i}||function(r,i){for(var o in i)Object.prototype.hasOwnProperty.call(i,o)&&(r[o]=i[o])},t(e,n)};return function(e,n){if(typeof n!="function"&&n!==null)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");t(e,n);function r(){this.constructor=e}e.prototype=n===null?Object.create(n):(r.prototype=n.prototype,new r)}}(),oae=function(t){JBe(e,t);function e(n){return t.call(this,n)||this}return e.prototype.createRenderer=function(){return new ZBe(this)},e}(YBe),eze=function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,i){r.__proto__=i}||function(r,i){for(var o in i)Object.prototype.hasOwnProperty.call(i,o)&&(r[o]=i[o])},t(e,n)};return function(e,n){if(typeof n!="function"&&n!==null)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");t(e,n);function r(){this.constructor=e}e.prototype=n===null?Object.create(n):(r.prototype=n.prototype,new r)}}(),tze='&#169; <a href="https://www.openstreetmap.org/copyright" target="_blank">OpenStreetMap</a> contributors.',nze=function(t){eze(e,t);function e(n){var r=n||{},i=r.imageSmoothing!==void 0?r.imageSmoothing:!0;r.interpolate!==void 0&&(i=r.interpolate);var o;r.attributions!==void 0?o=r.attributions:o=[tze];var a=r.crossOrigin!==void 0?r.crossOrigin:"anonymous",s=r.url!==void 0?r.url:"https://{a-c}.tile.openstreetmap.org/{z}/{x}/{y}.png";return t.call(this,{attributions:o,attributionsCollapsible:!1,cacheSize:r.cacheSize,crossOrigin:a,interpolate:i,maxZoom:r.maxZoom!==void 0?r.maxZoom:19,opaque:r.opaque!==void 0?r.opaque:!0,reprojectionErrorThreshold:r.reprojectionErrorThreshold,tileLoadFunction:r.tileLoadFunction,transition:r.transition,url:s,wrapX:r.wrapX,zDirection:r.zDirection})||this}return e}(hy);const py="EPSG:4326",$B="EPSG:3857",aae=$B,sae=M.createContext({mapObjects:{}}),rze={position:"relative",top:0,left:0,width:"100%",height:"100%"};let ize=class extends M.Component{constructor(n){super(n);Yt(this,"contextValue");Yt(this,"clickEventsKey",null);Yt(this,"handleClick",n=>{const r=this.props.onClick;r&&r(n)});Yt(this,"handleDrop",n=>{if(this.props.onDropFiles){n.preventDefault();const r=[];if(n.dataTransfer.items)for(let i=0;i<n.dataTransfer.items.length;i++){const o=n.dataTransfer.items[i];if(o.kind==="file"){const a=o.getAsFile();a!==null&&r.push(a)}}else if(n.dataTransfer.files)for(let i=0;i<n.dataTransfer.files.length;i++){const o=n.dataTransfer.files[i];o!==null&&r.push(o)}r.length&&this.props.onDropFiles(r)}});Yt(this,"handleDragOver",n=>{this.props.onDropFiles&&n.preventDefault()});Yt(this,"handleRef",n=>{this.contextValue.mapDiv=n});Yt(this,"handleResize",()=>{const n=this.contextValue.mapDiv,r=this.contextValue.map;if(n&&r){r.updateSize();const i=r.getView(),o=this.getMinZoom(n);o!==i.getMinZoom()&&i.setMinZoom(o)}});Yt(this,"getMinZoom",n=>{const r=n.clientWidth,i=Math.LOG2E*Math.log(r/256);return i>=0?i:0});const{id:r,mapObjects:i}=n;i?this.contextValue={map:i[r]||void 0,mapObjects:i}:this.contextValue={mapObjects:{}}}componentDidMount(){const{id:n}=this.props,r=this.contextValue.mapDiv;let i=null;if(this.props.isStale){const a=this.contextValue.mapObjects[n];a instanceof nH&&(i=a,i.setTarget(r),this.clickEventsKey&&i.un("click",this.clickEventsKey.listener))}if(!i){const a=this.getMinZoom(r),s=new Uc({projection:aae,center:[0,0],minZoom:a,zoom:a});i=new nH({view:s,...this.getMapOptions(),target:r})}this.contextValue.map=i,this.contextValue.mapObjects[n]=i,this.clickEventsKey=i.on("click",this.handleClick),i.updateSize(),this.forceUpdate(),window.addEventListener("resize",this.handleResize);const o=this.props.onMapRef;o&&o(i)}componentDidUpdate(n){const r=this.contextValue.map,i=this.contextValue.mapDiv,o=this.getMapOptions();r.setProperties({...o}),r.setTarget(i),r.updateSize()}componentWillUnmount(){window.removeEventListener("resize",this.handleResize);const n=this.props.onMapRef;n&&n(null)}render(){let n;return this.contextValue.map&&(n=w.jsx(sae.Provider,{value:this.contextValue,children:this.props.children})),w.jsx("div",{ref:this.handleRef,style:rze,onDragOver:this.handleDragOver,onDrop:this.handleDrop,children:n})}getMapOptions(){const n={...this.props};return delete n.children,delete n.onClick,delete n.onDropFiles,n}};class my extends M.PureComponent{constructor(){super(...arguments);Yt(this,"context",{});Yt(this,"object",null)}getMapObject(n){return this.context.mapObjects&&this.context.mapObjects[n]||null}getOptions(){const n={...this.props};return delete n.id,n}componentDidMount(){this._updateMapObject(this.addMapObject(this.context.map))}componentDidUpdate(n){this._updateMapObject(this.updateMapObject(this.context.map,this.object,n))}componentWillUnmount(){const n=this.context.map;this.removeMapObject(n,this.object),this.props.id&&delete this.context.mapObjects[this.props.id],this.object=null}_updateMapObject(n){n!=null&&this.props.id&&(n.set("objectId",this.props.id),this.context.mapObjects[this.props.id]=n),this.object=n}render(){return null}}Yt(my,"contextType",sae);function lae(t,e,n){im(t,e,n,"visible",!0),im(t,e,n,"opacity",1),im(t,e,n,"zIndex",void 0),im(t,e,n,"extent",void 0),im(t,e,n,"minResolution",void 0),im(t,e,n,"maxResolution",void 0)}function im(t,e,n,r,i){const o=sH(e[r],i),a=sH(n[r],i);o!==a&&t.set(r,a)}function sH(t,e){return t===void 0?e:t}let So;So=()=>{};class cae extends my{addMapObject(e){const n=new oae(this.props);return n.set("id",this.props.id),e.getLayers().push(n),n}updateMapObject(e,n,r){const i=n.getSource(),o=this.props.source||null;if(i===o)return n;if(o!==null&&i!==o){let a=!0;if(i instanceof y3&&o instanceof y3){const c=i,u=o,f=c.getTileGrid(),d=u.getTileGrid();if(oze(f,d)){So("--> Equal tile grids!");const h=c.getUrls(),p=u.getUrls();h!==p&&p&&(h===null||h[0]!==p[0])&&(c.setUrls(p),a=!1);const m=c.getTileLoadFunction(),g=u.getTileLoadFunction();m!==g&&(c.setTileLoadFunction(g),a=!1);const v=c.getTileUrlFunction(),y=u.getTileUrlFunction();v!==y&&(c.setTileUrlFunction(y),a=!1)}else So("--> Tile grids are not equal!")}const s=i==null?void 0:i.getInterpolate(),l=o==null?void 0:o.getInterpolate();s!==l&&(a=!0),a?(n.setSource(o),So("--> Replaced source (expect flickering!)")):So("--> Updated source (check, is it still flickering?)")}return lae(n,r,this.props),n}removeMapObject(e,n){e.getLayers().remove(n)}}new hy({url:"https://a.tiles.mapbox.com/v3/mapbox.natural-earth-2/{z}/{x}/{y}.png",attributions:["&copy; <a href=&quot;https://www.naturalearthdata.com/&quot;>MapBox</a>","&copy; <a href=&quot;https://www.mapbox.com/&quot;>MapBox</a> and contributors"]});new hy({url:"https://gis.ngdc.noaa.gov/arcgis/rest/services/web_mercator/gebco_2014_contours/MapServer/tile/{z}/{y}/{x}",attributions:["&copy; <a href=&quot;https://www.gebco.net/data_and_products/gridded_bathymetry_data/&quot;>GEBCO</a>","&copy; <a href=&quot;https://maps.ngdc.noaa.gov/&quot;>NOAHH</a> and contributors"]});new nze;new hy({url:"https://tiles.wmflabs.org/bw-mapnik/{z}/{x}/{y}.png",attributions:["&copy; <a href=&quot;https://www.openstreetmap.org/copyright&quot;>OpenStreetMap</a> contributors"]});function oze(t,e){if(t===e)return!0;if(t===null||e===null||(So("tile grid:",t,e),So("min zoom:",t.getMinZoom(),e.getMinZoom()),So("max zoom:",t.getMaxZoom(),e.getMaxZoom()),t.getMinZoom()!==e.getMinZoom()||t.getMaxZoom()!==e.getMaxZoom()))return!1;const n=t.getExtent(),r=e.getExtent();So("extent:",n,r);for(let s=0;s<n.length;s++)if(n[s]!==r[s])return!1;const i=t.getResolutions(),o=e.getResolutions();So("resolutions:",i,o);const a=i.length;if(a!==o.length)return!1;for(let s=0;s<a;s++){const l=t.getResolution(s),c=e.getResolution(s);if(So(`resolution ${s}:`,l,c),l!==c)return!1;const u=t.getOrigin(s),f=e.getOrigin(s);So(`origin ${s}:`,u,f);for(let g=0;g<u.length;g++)if(u[g]!==f[g])return!1;let d=t.getTileSize(s),h=e.getTileSize(s);So(`tile size ${s}:`,d,h);for(let g=0;g<u.length;g++)if(typeof d=="number"&&(d=[d,d]),typeof h=="number"&&(h=[h,h]),d[0]!==h[0]||d[1]!==h[1])return!1;const p=t.getFullTileRange(s),m=e.getFullTileRange(s);if(So(`tile range ${s}:`,p,m),p&&m){if(p.getWidth()!==m.getWidth()||p.getHeight()!==m.getHeight())return!1}else if(p||m)return!1}return!0}class v2 extends my{addMapObject(e){const n=new h2(this.props);return n.set("id",this.props.id),e.getLayers().push(n),n}updateMapObject(e,n,r){return this.props.source!==r.source&&this.props.source&&n.setSource(this.props.source),lae(n,r,this.props),n}removeMapObject(e,n){e.getLayers().remove(n)}}function uae(t,e){const n=t.length;if(n===0)return-1;if(n===1)return 0;let r=0,i=n-1;if(e<=t[r])return r;if(e>=t[i])return i;let o=Math.floor(n/2),a;for(let s=0;s<n;s++){if(a=t[o],e<a)[o,i]=[Math.floor((r+o)/2),o];else if(e>a)[r,o]=[o,Math.floor((o+i)/2)];else return o;if(r===o||o===i)return Math.abs(t[r]-e)<=Math.abs(t[i]-e)?r:i}return-1}function On(t){if(t===null||t===!0||t===!1)return NaN;var e=Number(t);return isNaN(e)?e:e<0?Math.ceil(e):Math.floor(e)}function tt(t,e){if(e.length<t)throw new TypeError(t+" argument"+(t>1?"s":"")+" required, but only "+e.length+" present")}function nt(t){tt(1,arguments);var e=Object.prototype.toString.call(t);return t instanceof Date||uu(t)==="object"&&e==="[object Date]"?new Date(t.getTime()):typeof t=="number"||e==="[object Number]"?new Date(t):((typeof t=="string"||e==="[object String]")&&typeof console<"u"&&(console.warn("Starting with v2.0.0-beta.1 date-fns doesn't accept strings as date arguments. Please use `parseISO` to parse strings. See: https://github.com/date-fns/date-fns/blob/master/docs/upgradeGuide.md#string-arguments"),console.warn(new Error().stack)),new Date(NaN))}function x3(t,e){tt(2,arguments);var n=nt(t),r=On(e);return isNaN(r)?new Date(NaN):(r&&n.setDate(n.getDate()+r),n)}function IC(t,e){tt(2,arguments);var n=nt(t),r=On(e);if(isNaN(r))return new Date(NaN);if(!r)return n;var i=n.getDate(),o=new Date(n.getTime());o.setMonth(n.getMonth()+r+1,0);var a=o.getDate();return i>=a?o:(n.setFullYear(o.getFullYear(),o.getMonth(),i),n)}function y2(t,e){tt(2,arguments);var n=nt(t).getTime(),r=On(e);return new Date(n+r)}var aze=36e5;function sze(t,e){tt(2,arguments);var n=On(e);return y2(t,n*aze)}var lze={};function _d(){return lze}function ZA(t,e){var n,r,i,o,a,s,l,c;tt(1,arguments);var u=_d(),f=On((n=(r=(i=(o=e==null?void 0:e.weekStartsOn)!==null&&o!==void 0?o:e==null||(a=e.locale)===null||a===void 0||(s=a.options)===null||s===void 0?void 0:s.weekStartsOn)!==null&&i!==void 0?i:u.weekStartsOn)!==null&&r!==void 0?r:(l=u.locale)===null||l===void 0||(c=l.options)===null||c===void 0?void 0:c.weekStartsOn)!==null&&n!==void 0?n:0);if(!(f>=0&&f<=6))throw new RangeError("weekStartsOn must be between 0 and 6 inclusively");var d=nt(t),h=d.getDay(),p=(h<f?7:0)+h-f;return d.setDate(d.getDate()-p),d.setHours(0,0,0,0),d}function KT(t){var e=new Date(Date.UTC(t.getFullYear(),t.getMonth(),t.getDate(),t.getHours(),t.getMinutes(),t.getSeconds(),t.getMilliseconds()));return e.setUTCFullYear(t.getFullYear()),t.getTime()-e.getTime()}function ov(t){tt(1,arguments);var e=nt(t);return e.setHours(0,0,0,0),e}var cze=864e5;function uze(t,e){tt(2,arguments);var n=ov(t),r=ov(e),i=n.getTime()-KT(n),o=r.getTime()-KT(r);return Math.round((i-o)/cze)}var fze=6e4;function dze(t,e){tt(2,arguments);var n=On(e);return y2(t,n*fze)}function hze(t,e){tt(2,arguments);var n=On(e);return y2(t,n*1e3)}function pze(t,e){tt(2,arguments);var n=On(e),r=n*7;return x3(t,r)}function lH(t,e){tt(2,arguments);var n=On(e);return IC(t,n*12)}function Xx(t,e){tt(2,arguments);var n=nt(t),r=nt(e),i=n.getTime()-r.getTime();return i<0?-1:i>0?1:i}var x2=6e4,b2=36e5,mze=1e3;function gze(t,e){tt(2,arguments);var n=ov(t),r=ov(e);return n.getTime()===r.getTime()}function vze(t){return tt(1,arguments),t instanceof Date||uu(t)==="object"&&Object.prototype.toString.call(t)==="[object Date]"}function fae(t){if(tt(1,arguments),!vze(t)&&typeof t!="number")return!1;var e=nt(t);return!isNaN(Number(e))}function yze(t,e){tt(2,arguments);var n=nt(t),r=nt(e),i=n.getFullYear()-r.getFullYear(),o=n.getMonth()-r.getMonth();return i*12+o}function xze(t,e){tt(2,arguments);var n=nt(t),r=nt(e);return n.getFullYear()-r.getFullYear()}function cH(t,e){var n=t.getFullYear()-e.getFullYear()||t.getMonth()-e.getMonth()||t.getDate()-e.getDate()||t.getHours()-e.getHours()||t.getMinutes()-e.getMinutes()||t.getSeconds()-e.getSeconds()||t.getMilliseconds()-e.getMilliseconds();return n<0?-1:n>0?1:n}function dae(t,e){tt(2,arguments);var n=nt(t),r=nt(e),i=cH(n,r),o=Math.abs(uze(n,r));n.setDate(n.getDate()-i*o);var a=+(cH(n,r)===-i),s=i*(o-a);return s===0?0:s}function _2(t,e){return tt(2,arguments),nt(t).getTime()-nt(e).getTime()}var uH={ceil:Math.ceil,round:Math.round,floor:Math.floor,trunc:function(e){return e<0?Math.ceil(e):Math.floor(e)}},bze="trunc";function Z1(t){return t?uH[t]:uH[bze]}function _ze(t,e,n){tt(2,arguments);var r=_2(t,e)/b2;return Z1(void 0)(r)}function wze(t,e,n){tt(2,arguments);var r=_2(t,e)/x2;return Z1(void 0)(r)}function b3(t){tt(1,arguments);var e=nt(t);return e.setHours(23,59,59,999),e}function _3(t){tt(1,arguments);var e=nt(t),n=e.getMonth();return e.setFullYear(e.getFullYear(),n+1,0),e.setHours(23,59,59,999),e}function Sze(t){tt(1,arguments);var e=nt(t);return b3(e).getTime()===_3(e).getTime()}function hae(t,e){tt(2,arguments);var n=nt(t),r=nt(e),i=Xx(n,r),o=Math.abs(yze(n,r)),a;if(o<1)a=0;else{n.getMonth()===1&&n.getDate()>27&&n.setDate(30),n.setMonth(n.getMonth()-i*o);var s=Xx(n,r)===-i;Sze(nt(t))&&o===1&&Xx(t,r)===1&&(s=!1),a=i*(o-Number(s))}return a===0?0:a}function Oze(t,e,n){tt(2,arguments);var r=hae(t,e)/3;return Z1(void 0)(r)}function Cze(t,e,n){tt(2,arguments);var r=_2(t,e)/1e3;return Z1(void 0)(r)}function Tze(t,e,n){tt(2,arguments);var r=dae(t,e)/7;return Z1(void 0)(r)}function Eze(t,e){tt(2,arguments);var n=nt(t),r=nt(e),i=Xx(n,r),o=Math.abs(xze(n,r));n.setFullYear(1584),r.setFullYear(1584);var a=Xx(n,r)===-i,s=i*(o-Number(a));return s===0?0:s}function Pze(t,e){var n;tt(1,arguments);var r=t||{},i=nt(r.start),o=nt(r.end),a=o.getTime();if(!(i.getTime()<=a))throw new RangeError("Invalid interval");var s=[],l=i;l.setHours(0,0,0,0);var c=Number((n=void 0)!==null&&n!==void 0?n:1);if(c<1||isNaN(c))throw new RangeError("`options.step` must be a number greater than 1");for(;l.getTime()<=a;)s.push(nt(l)),l.setDate(l.getDate()+c),l.setHours(0,0,0,0);return s}function AS(t){tt(1,arguments);var e=nt(t);return e.setDate(1),e.setHours(0,0,0,0),e}function JA(t){tt(1,arguments);var e=nt(t),n=e.getFullYear();return e.setFullYear(n+1,0,0),e.setHours(23,59,59,999),e}function RS(t){tt(1,arguments);var e=nt(t),n=new Date(0);return n.setFullYear(e.getFullYear(),0,1),n.setHours(0,0,0,0),n}function eR(t,e){var n,r,i,o,a,s,l,c;tt(1,arguments);var u=_d(),f=On((n=(r=(i=(o=e==null?void 0:e.weekStartsOn)!==null&&o!==void 0?o:e==null||(a=e.locale)===null||a===void 0||(s=a.options)===null||s===void 0?void 0:s.weekStartsOn)!==null&&i!==void 0?i:u.weekStartsOn)!==null&&r!==void 0?r:(l=u.locale)===null||l===void 0||(c=l.options)===null||c===void 0?void 0:c.weekStartsOn)!==null&&n!==void 0?n:0);if(!(f>=0&&f<=6))throw new RangeError("weekStartsOn must be between 0 and 6 inclusively");var d=nt(t),h=d.getDay(),p=(h<f?-7:0)+6-(h-f);return d.setDate(d.getDate()+p),d.setHours(23,59,59,999),d}function pae(t,e){tt(2,arguments);var n=On(e);return y2(t,-n)}var Mze=864e5;function kze(t){tt(1,arguments);var e=nt(t),n=e.getTime();e.setUTCMonth(0,1),e.setUTCHours(0,0,0,0);var r=e.getTime(),i=n-r;return Math.floor(i/Mze)+1}function av(t){tt(1,arguments);var e=1,n=nt(t),r=n.getUTCDay(),i=(r<e?7:0)+r-e;return n.setUTCDate(n.getUTCDate()-i),n.setUTCHours(0,0,0,0),n}function mae(t){tt(1,arguments);var e=nt(t),n=e.getUTCFullYear(),r=new Date(0);r.setUTCFullYear(n+1,0,4),r.setUTCHours(0,0,0,0);var i=av(r),o=new Date(0);o.setUTCFullYear(n,0,4),o.setUTCHours(0,0,0,0);var a=av(o);return e.getTime()>=i.getTime()?n+1:e.getTime()>=a.getTime()?n:n-1}function Aze(t){tt(1,arguments);var e=mae(t),n=new Date(0);n.setUTCFullYear(e,0,4),n.setUTCHours(0,0,0,0);var r=av(n);return r}var Rze=6048e5;function gae(t){tt(1,arguments);var e=nt(t),n=av(e).getTime()-Aze(e).getTime();return Math.round(n/Rze)+1}function ap(t,e){var n,r,i,o,a,s,l,c;tt(1,arguments);var u=_d(),f=On((n=(r=(i=(o=e==null?void 0:e.weekStartsOn)!==null&&o!==void 0?o:e==null||(a=e.locale)===null||a===void 0||(s=a.options)===null||s===void 0?void 0:s.weekStartsOn)!==null&&i!==void 0?i:u.weekStartsOn)!==null&&r!==void 0?r:(l=u.locale)===null||l===void 0||(c=l.options)===null||c===void 0?void 0:c.weekStartsOn)!==null&&n!==void 0?n:0);if(!(f>=0&&f<=6))throw new RangeError("weekStartsOn must be between 0 and 6 inclusively");var d=nt(t),h=d.getUTCDay(),p=(h<f?7:0)+h-f;return d.setUTCDate(d.getUTCDate()-p),d.setUTCHours(0,0,0,0),d}function FB(t,e){var n,r,i,o,a,s,l,c;tt(1,arguments);var u=nt(t),f=u.getUTCFullYear(),d=_d(),h=On((n=(r=(i=(o=e==null?void 0:e.firstWeekContainsDate)!==null&&o!==void 0?o:e==null||(a=e.locale)===null||a===void 0||(s=a.options)===null||s===void 0?void 0:s.firstWeekContainsDate)!==null&&i!==void 0?i:d.firstWeekContainsDate)!==null&&r!==void 0?r:(l=d.locale)===null||l===void 0||(c=l.options)===null||c===void 0?void 0:c.firstWeekContainsDate)!==null&&n!==void 0?n:1);if(!(h>=1&&h<=7))throw new RangeError("firstWeekContainsDate must be between 1 and 7 inclusively");var p=new Date(0);p.setUTCFullYear(f+1,0,h),p.setUTCHours(0,0,0,0);var m=ap(p,e),g=new Date(0);g.setUTCFullYear(f,0,h),g.setUTCHours(0,0,0,0);var v=ap(g,e);return u.getTime()>=m.getTime()?f+1:u.getTime()>=v.getTime()?f:f-1}function Ize(t,e){var n,r,i,o,a,s,l,c;tt(1,arguments);var u=_d(),f=On((n=(r=(i=(o=e==null?void 0:e.firstWeekContainsDate)!==null&&o!==void 0?o:e==null||(a=e.locale)===null||a===void 0||(s=a.options)===null||s===void 0?void 0:s.firstWeekContainsDate)!==null&&i!==void 0?i:u.firstWeekContainsDate)!==null&&r!==void 0?r:(l=u.locale)===null||l===void 0||(c=l.options)===null||c===void 0?void 0:c.firstWeekContainsDate)!==null&&n!==void 0?n:1),d=FB(t,e),h=new Date(0);h.setUTCFullYear(d,0,f),h.setUTCHours(0,0,0,0);var p=ap(h,e);return p}var Dze=6048e5;function vae(t,e){tt(1,arguments);var n=nt(t),r=ap(n,e).getTime()-Ize(n,e).getTime();return Math.round(r/Dze)+1}function Ht(t,e){for(var n=t<0?"-":"",r=Math.abs(t).toString();r.length<e;)r="0"+r;return n+r}var $u={y:function(e,n){var r=e.getUTCFullYear(),i=r>0?r:1-r;return Ht(n==="yy"?i%100:i,n.length)},M:function(e,n){var r=e.getUTCMonth();return n==="M"?String(r+1):Ht(r+1,2)},d:function(e,n){return Ht(e.getUTCDate(),n.length)},a:function(e,n){var r=e.getUTCHours()/12>=1?"pm":"am";switch(n){case"a":case"aa":return r.toUpperCase();case"aaa":return r;case"aaaaa":return r[0];case"aaaa":default:return r==="am"?"a.m.":"p.m."}},h:function(e,n){return Ht(e.getUTCHours()%12||12,n.length)},H:function(e,n){return Ht(e.getUTCHours(),n.length)},m:function(e,n){return Ht(e.getUTCMinutes(),n.length)},s:function(e,n){return Ht(e.getUTCSeconds(),n.length)},S:function(e,n){var r=n.length,i=e.getUTCMilliseconds(),o=Math.floor(i*Math.pow(10,r-3));return Ht(o,n.length)}},om={am:"am",pm:"pm",midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},Lze={G:function(e,n,r){var i=e.getUTCFullYear()>0?1:0;switch(n){case"G":case"GG":case"GGG":return r.era(i,{width:"abbreviated"});case"GGGGG":return r.era(i,{width:"narrow"});case"GGGG":default:return r.era(i,{width:"wide"})}},y:function(e,n,r){if(n==="yo"){var i=e.getUTCFullYear(),o=i>0?i:1-i;return r.ordinalNumber(o,{unit:"year"})}return $u.y(e,n)},Y:function(e,n,r,i){var o=FB(e,i),a=o>0?o:1-o;if(n==="YY"){var s=a%100;return Ht(s,2)}return n==="Yo"?r.ordinalNumber(a,{unit:"year"}):Ht(a,n.length)},R:function(e,n){var r=mae(e);return Ht(r,n.length)},u:function(e,n){var r=e.getUTCFullYear();return Ht(r,n.length)},Q:function(e,n,r){var i=Math.ceil((e.getUTCMonth()+1)/3);switch(n){case"Q":return String(i);case"QQ":return Ht(i,2);case"Qo":return r.ordinalNumber(i,{unit:"quarter"});case"QQQ":return r.quarter(i,{width:"abbreviated",context:"formatting"});case"QQQQQ":return r.quarter(i,{width:"narrow",context:"formatting"});case"QQQQ":default:return r.quarter(i,{width:"wide",context:"formatting"})}},q:function(e,n,r){var i=Math.ceil((e.getUTCMonth()+1)/3);switch(n){case"q":return String(i);case"qq":return Ht(i,2);case"qo":return r.ordinalNumber(i,{unit:"quarter"});case"qqq":return r.quarter(i,{width:"abbreviated",context:"standalone"});case"qqqqq":return r.quarter(i,{width:"narrow",context:"standalone"});case"qqqq":default:return r.quarter(i,{width:"wide",context:"standalone"})}},M:function(e,n,r){var i=e.getUTCMonth();switch(n){case"M":case"MM":return $u.M(e,n);case"Mo":return r.ordinalNumber(i+1,{unit:"month"});case"MMM":return r.month(i,{width:"abbreviated",context:"formatting"});case"MMMMM":return r.month(i,{width:"narrow",context:"formatting"});case"MMMM":default:return r.month(i,{width:"wide",context:"formatting"})}},L:function(e,n,r){var i=e.getUTCMonth();switch(n){case"L":return String(i+1);case"LL":return Ht(i+1,2);case"Lo":return r.ordinalNumber(i+1,{unit:"month"});case"LLL":return r.month(i,{width:"abbreviated",context:"standalone"});case"LLLLL":return r.month(i,{width:"narrow",context:"standalone"});case"LLLL":default:return r.month(i,{width:"wide",context:"standalone"})}},w:function(e,n,r,i){var o=vae(e,i);return n==="wo"?r.ordinalNumber(o,{unit:"week"}):Ht(o,n.length)},I:function(e,n,r){var i=gae(e);return n==="Io"?r.ordinalNumber(i,{unit:"week"}):Ht(i,n.length)},d:function(e,n,r){return n==="do"?r.ordinalNumber(e.getUTCDate(),{unit:"date"}):$u.d(e,n)},D:function(e,n,r){var i=kze(e);return n==="Do"?r.ordinalNumber(i,{unit:"dayOfYear"}):Ht(i,n.length)},E:function(e,n,r){var i=e.getUTCDay();switch(n){case"E":case"EE":case"EEE":return r.day(i,{width:"abbreviated",context:"formatting"});case"EEEEE":return r.day(i,{width:"narrow",context:"formatting"});case"EEEEEE":return r.day(i,{width:"short",context:"formatting"});case"EEEE":default:return r.day(i,{width:"wide",context:"formatting"})}},e:function(e,n,r,i){var o=e.getUTCDay(),a=(o-i.weekStartsOn+8)%7||7;switch(n){case"e":return String(a);case"ee":return Ht(a,2);case"eo":return r.ordinalNumber(a,{unit:"day"});case"eee":return r.day(o,{width:"abbreviated",context:"formatting"});case"eeeee":return r.day(o,{width:"narrow",context:"formatting"});case"eeeeee":return r.day(o,{width:"short",context:"formatting"});case"eeee":default:return r.day(o,{width:"wide",context:"formatting"})}},c:function(e,n,r,i){var o=e.getUTCDay(),a=(o-i.weekStartsOn+8)%7||7;switch(n){case"c":return String(a);case"cc":return Ht(a,n.length);case"co":return r.ordinalNumber(a,{unit:"day"});case"ccc":return r.day(o,{width:"abbreviated",context:"standalone"});case"ccccc":return r.day(o,{width:"narrow",context:"standalone"});case"cccccc":return r.day(o,{width:"short",context:"standalone"});case"cccc":default:return r.day(o,{width:"wide",context:"standalone"})}},i:function(e,n,r){var i=e.getUTCDay(),o=i===0?7:i;switch(n){case"i":return String(o);case"ii":return Ht(o,n.length);case"io":return r.ordinalNumber(o,{unit:"day"});case"iii":return r.day(i,{width:"abbreviated",context:"formatting"});case"iiiii":return r.day(i,{width:"narrow",context:"formatting"});case"iiiiii":return r.day(i,{width:"short",context:"formatting"});case"iiii":default:return r.day(i,{width:"wide",context:"formatting"})}},a:function(e,n,r){var i=e.getUTCHours(),o=i/12>=1?"pm":"am";switch(n){case"a":case"aa":return r.dayPeriod(o,{width:"abbreviated",context:"formatting"});case"aaa":return r.dayPeriod(o,{width:"abbreviated",context:"formatting"}).toLowerCase();case"aaaaa":return r.dayPeriod(o,{width:"narrow",context:"formatting"});case"aaaa":default:return r.dayPeriod(o,{width:"wide",context:"formatting"})}},b:function(e,n,r){var i=e.getUTCHours(),o;switch(i===12?o=om.noon:i===0?o=om.midnight:o=i/12>=1?"pm":"am",n){case"b":case"bb":return r.dayPeriod(o,{width:"abbreviated",context:"formatting"});case"bbb":return r.dayPeriod(o,{width:"abbreviated",context:"formatting"}).toLowerCase();case"bbbbb":return r.dayPeriod(o,{width:"narrow",context:"formatting"});case"bbbb":default:return r.dayPeriod(o,{width:"wide",context:"formatting"})}},B:function(e,n,r){var i=e.getUTCHours(),o;switch(i>=17?o=om.evening:i>=12?o=om.afternoon:i>=4?o=om.morning:o=om.night,n){case"B":case"BB":case"BBB":return r.dayPeriod(o,{width:"abbreviated",context:"formatting"});case"BBBBB":return r.dayPeriod(o,{width:"narrow",context:"formatting"});case"BBBB":default:return r.dayPeriod(o,{width:"wide",context:"formatting"})}},h:function(e,n,r){if(n==="ho"){var i=e.getUTCHours()%12;return i===0&&(i=12),r.ordinalNumber(i,{unit:"hour"})}return $u.h(e,n)},H:function(e,n,r){return n==="Ho"?r.ordinalNumber(e.getUTCHours(),{unit:"hour"}):$u.H(e,n)},K:function(e,n,r){var i=e.getUTCHours()%12;return n==="Ko"?r.ordinalNumber(i,{unit:"hour"}):Ht(i,n.length)},k:function(e,n,r){var i=e.getUTCHours();return i===0&&(i=24),n==="ko"?r.ordinalNumber(i,{unit:"hour"}):Ht(i,n.length)},m:function(e,n,r){return n==="mo"?r.ordinalNumber(e.getUTCMinutes(),{unit:"minute"}):$u.m(e,n)},s:function(e,n,r){return n==="so"?r.ordinalNumber(e.getUTCSeconds(),{unit:"second"}):$u.s(e,n)},S:function(e,n){return $u.S(e,n)},X:function(e,n,r,i){var o=i._originalDate||e,a=o.getTimezoneOffset();if(a===0)return"Z";switch(n){case"X":return dH(a);case"XXXX":case"XX":return Jd(a);case"XXXXX":case"XXX":default:return Jd(a,":")}},x:function(e,n,r,i){var o=i._originalDate||e,a=o.getTimezoneOffset();switch(n){case"x":return dH(a);case"xxxx":case"xx":return Jd(a);case"xxxxx":case"xxx":default:return Jd(a,":")}},O:function(e,n,r,i){var o=i._originalDate||e,a=o.getTimezoneOffset();switch(n){case"O":case"OO":case"OOO":return"GMT"+fH(a,":");case"OOOO":default:return"GMT"+Jd(a,":")}},z:function(e,n,r,i){var o=i._originalDate||e,a=o.getTimezoneOffset();switch(n){case"z":case"zz":case"zzz":return"GMT"+fH(a,":");case"zzzz":default:return"GMT"+Jd(a,":")}},t:function(e,n,r,i){var o=i._originalDate||e,a=Math.floor(o.getTime()/1e3);return Ht(a,n.length)},T:function(e,n,r,i){var o=i._originalDate||e,a=o.getTime();return Ht(a,n.length)}};function fH(t,e){var n=t>0?"-":"+",r=Math.abs(t),i=Math.floor(r/60),o=r%60;if(o===0)return n+String(i);var a=e;return n+String(i)+a+Ht(o,2)}function dH(t,e){if(t%60===0){var n=t>0?"-":"+";return n+Ht(Math.abs(t)/60,2)}return Jd(t,e)}function Jd(t,e){var n=e||"",r=t>0?"-":"+",i=Math.abs(t),o=Ht(Math.floor(i/60),2),a=Ht(i%60,2);return r+o+n+a}var hH=function(e,n){switch(e){case"P":return n.date({width:"short"});case"PP":return n.date({width:"medium"});case"PPP":return n.date({width:"long"});case"PPPP":default:return n.date({width:"full"})}},yae=function(e,n){switch(e){case"p":return n.time({width:"short"});case"pp":return n.time({width:"medium"});case"ppp":return n.time({width:"long"});case"pppp":default:return n.time({width:"full"})}},Nze=function(e,n){var r=e.match(/(P+)(p+)?/)||[],i=r[1],o=r[2];if(!o)return hH(e,n);var a;switch(i){case"P":a=n.dateTime({width:"short"});break;case"PP":a=n.dateTime({width:"medium"});break;case"PPP":a=n.dateTime({width:"long"});break;case"PPPP":default:a=n.dateTime({width:"full"});break}return a.replace("{{date}}",hH(i,n)).replace("{{time}}",yae(o,n))},w3={p:yae,P:Nze},$ze=["D","DD"],Fze=["YY","YYYY"];function xae(t){return $ze.indexOf(t)!==-1}function bae(t){return Fze.indexOf(t)!==-1}function ZT(t,e,n){if(t==="YYYY")throw new RangeError("Use `yyyy` instead of `YYYY` (in `".concat(e,"`) for formatting years to the input `").concat(n,"`; see: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md"));if(t==="YY")throw new RangeError("Use `yy` instead of `YY` (in `".concat(e,"`) for formatting years to the input `").concat(n,"`; see: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md"));if(t==="D")throw new RangeError("Use `d` instead of `D` (in `".concat(e,"`) for formatting days of the month to the input `").concat(n,"`; see: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md"));if(t==="DD")throw new RangeError("Use `dd` instead of `DD` (in `".concat(e,"`) for formatting days of the month to the input `").concat(n,"`; see: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md"))}var jze={lessThanXSeconds:{one:"less than a second",other:"less than {{count}} seconds"},xSeconds:{one:"1 second",other:"{{count}} seconds"},halfAMinute:"half a minute",lessThanXMinutes:{one:"less than a minute",other:"less than {{count}} minutes"},xMinutes:{one:"1 minute",other:"{{count}} minutes"},aboutXHours:{one:"about 1 hour",other:"about {{count}} hours"},xHours:{one:"1 hour",other:"{{count}} hours"},xDays:{one:"1 day",other:"{{count}} days"},aboutXWeeks:{one:"about 1 week",other:"about {{count}} weeks"},xWeeks:{one:"1 week",other:"{{count}} weeks"},aboutXMonths:{one:"about 1 month",other:"about {{count}} months"},xMonths:{one:"1 month",other:"{{count}} months"},aboutXYears:{one:"about 1 year",other:"about {{count}} years"},xYears:{one:"1 year",other:"{{count}} years"},overXYears:{one:"over 1 year",other:"over {{count}} years"},almostXYears:{one:"almost 1 year",other:"almost {{count}} years"}},Bze=function(e,n,r){var i,o=jze[e];return typeof o=="string"?i=o:n===1?i=o.one:i=o.other.replace("{{count}}",n.toString()),r!=null&&r.addSuffix?r.comparison&&r.comparison>0?"in "+i:i+" ago":i};function tR(t){return function(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},n=e.width?String(e.width):t.defaultWidth,r=t.formats[n]||t.formats[t.defaultWidth];return r}}var zze={full:"EEEE, MMMM do, y",long:"MMMM do, y",medium:"MMM d, y",short:"MM/dd/yyyy"},Uze={full:"h:mm:ss a zzzz",long:"h:mm:ss a z",medium:"h:mm:ss a",short:"h:mm a"},Wze={full:"{{date}} 'at' {{time}}",long:"{{date}} 'at' {{time}}",medium:"{{date}}, {{time}}",short:"{{date}}, {{time}}"},Vze={date:tR({formats:zze,defaultWidth:"full"}),time:tR({formats:Uze,defaultWidth:"full"}),dateTime:tR({formats:Wze,defaultWidth:"full"})},Gze={lastWeek:"'last' eeee 'at' p",yesterday:"'yesterday at' p",today:"'today at' p",tomorrow:"'tomorrow at' p",nextWeek:"eeee 'at' p",other:"P"},Hze=function(e,n,r,i){return Gze[e]};function S0(t){return function(e,n){var r=n!=null&&n.context?String(n.context):"standalone",i;if(r==="formatting"&&t.formattingValues){var o=t.defaultFormattingWidth||t.defaultWidth,a=n!=null&&n.width?String(n.width):o;i=t.formattingValues[a]||t.formattingValues[o]}else{var s=t.defaultWidth,l=n!=null&&n.width?String(n.width):t.defaultWidth;i=t.values[l]||t.values[s]}var c=t.argumentCallback?t.argumentCallback(e):e;return i[c]}}var qze={narrow:["B","A"],abbreviated:["BC","AD"],wide:["Before Christ","Anno Domini"]},Xze={narrow:["1","2","3","4"],abbreviated:["Q1","Q2","Q3","Q4"],wide:["1st quarter","2nd quarter","3rd quarter","4th quarter"]},Qze={narrow:["J","F","M","A","M","J","J","A","S","O","N","D"],abbreviated:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],wide:["January","February","March","April","May","June","July","August","September","October","November","December"]},Yze={narrow:["S","M","T","W","T","F","S"],short:["Su","Mo","Tu","We","Th","Fr","Sa"],abbreviated:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],wide:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"]},Kze={narrow:{am:"a",pm:"p",midnight:"mi",noon:"n",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},abbreviated:{am:"AM",pm:"PM",midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},wide:{am:"a.m.",pm:"p.m.",midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"}},Zze={narrow:{am:"a",pm:"p",midnight:"mi",noon:"n",morning:"in the morning",afternoon:"in the afternoon",evening:"in the evening",night:"at night"},abbreviated:{am:"AM",pm:"PM",midnight:"midnight",noon:"noon",morning:"in the morning",afternoon:"in the afternoon",evening:"in the evening",night:"at night"},wide:{am:"a.m.",pm:"p.m.",midnight:"midnight",noon:"noon",morning:"in the morning",afternoon:"in the afternoon",evening:"in the evening",night:"at night"}},Jze=function(e,n){var r=Number(e),i=r%100;if(i>20||i<10)switch(i%10){case 1:return r+"st";case 2:return r+"nd";case 3:return r+"rd"}return r+"th"},e4e={ordinalNumber:Jze,era:S0({values:qze,defaultWidth:"wide"}),quarter:S0({values:Xze,defaultWidth:"wide",argumentCallback:function(e){return e-1}}),month:S0({values:Qze,defaultWidth:"wide"}),day:S0({values:Yze,defaultWidth:"wide"}),dayPeriod:S0({values:Kze,defaultWidth:"wide",formattingValues:Zze,defaultFormattingWidth:"wide"})};function O0(t){return function(e){var n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},r=n.width,i=r&&t.matchPatterns[r]||t.matchPatterns[t.defaultMatchWidth],o=e.match(i);if(!o)return null;var a=o[0],s=r&&t.parsePatterns[r]||t.parsePatterns[t.defaultParseWidth],l=Array.isArray(s)?n4e(s,function(f){return f.test(a)}):t4e(s,function(f){return f.test(a)}),c;c=t.valueCallback?t.valueCallback(l):l,c=n.valueCallback?n.valueCallback(c):c;var u=e.slice(a.length);return{value:c,rest:u}}}function t4e(t,e){for(var n in t)if(t.hasOwnProperty(n)&&e(t[n]))return n}function n4e(t,e){for(var n=0;n<t.length;n++)if(e(t[n]))return n}function r4e(t){return function(e){var n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},r=e.match(t.matchPattern);if(!r)return null;var i=r[0],o=e.match(t.parsePattern);if(!o)return null;var a=t.valueCallback?t.valueCallback(o[0]):o[0];a=n.valueCallback?n.valueCallback(a):a;var s=e.slice(i.length);return{value:a,rest:s}}}var i4e=/^(\d+)(th|st|nd|rd)?/i,o4e=/\d+/i,a4e={narrow:/^(b|a)/i,abbreviated:/^(b\.?\s?c\.?|b\.?\s?c\.?\s?e\.?|a\.?\s?d\.?|c\.?\s?e\.?)/i,wide:/^(before christ|before common era|anno domini|common era)/i},s4e={any:[/^b/i,/^(a|c)/i]},l4e={narrow:/^[1234]/i,abbreviated:/^q[1234]/i,wide:/^[1234](th|st|nd|rd)? quarter/i},c4e={any:[/1/i,/2/i,/3/i,/4/i]},u4e={narrow:/^[jfmasond]/i,abbreviated:/^(jan|feb|mar|apr|may|jun|jul|aug|sep|oct|nov|dec)/i,wide:/^(january|february|march|april|may|june|july|august|september|october|november|december)/i},f4e={narrow:[/^j/i,/^f/i,/^m/i,/^a/i,/^m/i,/^j/i,/^j/i,/^a/i,/^s/i,/^o/i,/^n/i,/^d/i],any:[/^ja/i,/^f/i,/^mar/i,/^ap/i,/^may/i,/^jun/i,/^jul/i,/^au/i,/^s/i,/^o/i,/^n/i,/^d/i]},d4e={narrow:/^[smtwf]/i,short:/^(su|mo|tu|we|th|fr|sa)/i,abbreviated:/^(sun|mon|tue|wed|thu|fri|sat)/i,wide:/^(sunday|monday|tuesday|wednesday|thursday|friday|saturday)/i},h4e={narrow:[/^s/i,/^m/i,/^t/i,/^w/i,/^t/i,/^f/i,/^s/i],any:[/^su/i,/^m/i,/^tu/i,/^w/i,/^th/i,/^f/i,/^sa/i]},p4e={narrow:/^(a|p|mi|n|(in the|at) (morning|afternoon|evening|night))/i,any:/^([ap]\.?\s?m\.?|midnight|noon|(in the|at) (morning|afternoon|evening|night))/i},m4e={any:{am:/^a/i,pm:/^p/i,midnight:/^mi/i,noon:/^no/i,morning:/morning/i,afternoon:/afternoon/i,evening:/evening/i,night:/night/i}},g4e={ordinalNumber:r4e({matchPattern:i4e,parsePattern:o4e,valueCallback:function(e){return parseInt(e,10)}}),era:O0({matchPatterns:a4e,defaultMatchWidth:"wide",parsePatterns:s4e,defaultParseWidth:"any"}),quarter:O0({matchPatterns:l4e,defaultMatchWidth:"wide",parsePatterns:c4e,defaultParseWidth:"any",valueCallback:function(e){return e+1}}),month:O0({matchPatterns:u4e,defaultMatchWidth:"wide",parsePatterns:f4e,defaultParseWidth:"any"}),day:O0({matchPatterns:d4e,defaultMatchWidth:"wide",parsePatterns:h4e,defaultParseWidth:"any"}),dayPeriod:O0({matchPatterns:p4e,defaultMatchWidth:"any",parsePatterns:m4e,defaultParseWidth:"any"})},w2={code:"en-US",formatDistance:Bze,formatLong:Vze,formatRelative:Hze,localize:e4e,match:g4e,options:{weekStartsOn:0,firstWeekContainsDate:1}},v4e=/[yYQqMLwIdDecihHKkms]o|(\w)\1*|''|'(''|[^'])+('|$)|./g,y4e=/P+p+|P+|p+|''|'(''|[^'])+('|$)|./g,x4e=/^'([^]*?)'?$/,b4e=/''/g,_4e=/[a-zA-Z]/;function w4e(t,e,n){var r,i,o,a,s,l,c,u,f,d,h,p,m,g,v,y,x,b;tt(2,arguments);var _=String(e),S=_d(),O=(r=(i=n==null?void 0:n.locale)!==null&&i!==void 0?i:S.locale)!==null&&r!==void 0?r:w2,C=On((o=(a=(s=(l=n==null?void 0:n.firstWeekContainsDate)!==null&&l!==void 0?l:n==null||(c=n.locale)===null||c===void 0||(u=c.options)===null||u===void 0?void 0:u.firstWeekContainsDate)!==null&&s!==void 0?s:S.firstWeekContainsDate)!==null&&a!==void 0?a:(f=S.locale)===null||f===void 0||(d=f.options)===null||d===void 0?void 0:d.firstWeekContainsDate)!==null&&o!==void 0?o:1);if(!(C>=1&&C<=7))throw new RangeError("firstWeekContainsDate must be between 1 and 7 inclusively");var E=On((h=(p=(m=(g=n==null?void 0:n.weekStartsOn)!==null&&g!==void 0?g:n==null||(v=n.locale)===null||v===void 0||(y=v.options)===null||y===void 0?void 0:y.weekStartsOn)!==null&&m!==void 0?m:S.weekStartsOn)!==null&&p!==void 0?p:(x=S.locale)===null||x===void 0||(b=x.options)===null||b===void 0?void 0:b.weekStartsOn)!==null&&h!==void 0?h:0);if(!(E>=0&&E<=6))throw new RangeError("weekStartsOn must be between 0 and 6 inclusively");if(!O.localize)throw new RangeError("locale must contain localize property");if(!O.formatLong)throw new RangeError("locale must contain formatLong property");var k=nt(t);if(!fae(k))throw new RangeError("Invalid time value");var I=KT(k),P=pae(k,I),R={firstWeekContainsDate:C,weekStartsOn:E,locale:O,_originalDate:k},T=_.match(y4e).map(function(L){var z=L[0];if(z==="p"||z==="P"){var B=w3[z];return B(L,O.formatLong)}return L}).join("").match(v4e).map(function(L){if(L==="''")return"'";var z=L[0];if(z==="'")return S4e(L);var B=Lze[z];if(B)return!(n!=null&&n.useAdditionalWeekYearTokens)&&bae(L)&&ZT(L,e,String(t)),!(n!=null&&n.useAdditionalDayOfYearTokens)&&xae(L)&&ZT(L,e,String(t)),B(P,L,O.localize,R);if(z.match(_4e))throw new RangeError("Format string contains an unescaped latin alphabet character `"+z+"`");return L}).join("");return T}function S4e(t){var e=t.match(x4e);return e?e[1].replace(b4e,"'"):t}function O4e(t,e){if(t==null)throw new TypeError("assign requires that input parameter not be null or undefined");for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n]);return t}function C4e(t,e){var n,r;tt(1,arguments);var i=nt(t);if(isNaN(i.getTime()))throw new RangeError("Invalid time value");var o=String((n=e==null?void 0:e.format)!==null&&n!==void 0?n:"extended"),a=String((r=e==null?void 0:e.representation)!==null&&r!==void 0?r:"complete");if(o!=="extended"&&o!=="basic")throw new RangeError("format must be 'extended' or 'basic'");if(a!=="date"&&a!=="time"&&a!=="complete")throw new RangeError("representation must be 'date', 'time', or 'complete'");var s="",l="",c=o==="extended"?"-":"",u=o==="extended"?":":"";if(a!=="time"){var f=Ht(i.getDate(),2),d=Ht(i.getMonth()+1,2),h=Ht(i.getFullYear(),4);s="".concat(h).concat(c).concat(d).concat(c).concat(f)}if(a!=="date"){var p=i.getTimezoneOffset();if(p!==0){var m=Math.abs(p),g=Ht(Math.floor(m/60),2),v=Ht(m%60,2),y=p<0?"+":"-";l="".concat(y).concat(g,":").concat(v)}else l="Z";var x=Ht(i.getHours(),2),b=Ht(i.getMinutes(),2),_=Ht(i.getSeconds(),2),S=s===""?"":"T",O=[x,b,_].join(u);s="".concat(s).concat(S).concat(O).concat(l)}return s}function T4e(t){tt(1,arguments);var e=nt(t),n=e.getDate();return n}function E4e(t){tt(1,arguments);var e=nt(t),n=e.getDay();return n}function _ae(t){tt(1,arguments);var e=nt(t),n=e.getFullYear(),r=e.getMonth(),i=new Date(0);return i.setFullYear(n,r+1,0),i.setHours(0,0,0,0),i.getDate()}function P4e(t){tt(1,arguments);var e=nt(t),n=e.getHours();return n}function M4e(t){tt(1,arguments);var e=nt(t),n=e.getMinutes();return n}function k4e(t){tt(1,arguments);var e=nt(t),n=e.getMonth();return n}function A4e(t){tt(1,arguments);var e=nt(t),n=e.getSeconds();return n}function R4e(t){return tt(1,arguments),nt(t).getFullYear()}function IS(t,e){tt(2,arguments);var n=nt(t),r=nt(e);return n.getTime()>r.getTime()}function am(t,e){tt(2,arguments);var n=nt(t),r=nt(e);return n.getTime()<r.getTime()}function I4e(t,e){tt(2,arguments);var n=nt(t),r=nt(e);return n.getTime()===r.getTime()}function S3(t,e){(e==null||e>t.length)&&(e=t.length);for(var n=0,r=Array(e);n<e;n++)r[n]=t[n];return r}function wae(t,e){if(t){if(typeof t=="string")return S3(t,e);var n={}.toString.call(t).slice(8,-1);return n==="Object"&&t.constructor&&(n=t.constructor.name),n==="Map"||n==="Set"?Array.from(t):n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?S3(t,e):void 0}}function pH(t,e){var n=typeof Symbol<"u"&&t[Symbol.iterator]||t["@@iterator"];if(!n){if(Array.isArray(t)||(n=wae(t))||e){n&&(t=n);var r=0,i=function(){};return{s:i,n:function(){return r>=t.length?{done:!0}:{done:!1,value:t[r++]}},e:function(c){throw c},f:i}}throw new TypeError(`Invalid attempt to iterate non-iterable instance.
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}var o,a=!0,s=!1;return{s:function(){n=n.call(t)},n:function(){var c=n.next();return a=c.done,c},e:function(c){s=!0,o=c},f:function(){try{a||n.return==null||n.return()}finally{if(s)throw o}}}}function cn(t,e){if(typeof e!="function"&&e!==null)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&ET(t,e)}function JT(t){return JT=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},JT(t)}function Sae(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch{}return(Sae=function(){return!!t})()}function D4e(t,e){if(e&&(uu(e)=="object"||typeof e=="function"))return e;if(e!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return lt(t)}function un(t){var e=Sae();return function(){var n,r=JT(t);if(e){var i=JT(this).constructor;n=Reflect.construct(r,arguments,i)}else n=r.apply(this,arguments);return D4e(this,n)}}function tn(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function L4e(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,sne(r.key),r)}}function Xt(t,e,n){return e&&L4e(t.prototype,e),Object.defineProperty(t,"prototype",{writable:!1}),t}var N4e=10,Oae=function(){function t(){tn(this,t),it(this,"priority",void 0),it(this,"subPriority",0)}return Xt(t,[{key:"validate",value:function(n,r){return!0}}]),t}(),$4e=function(t){cn(n,t);var e=un(n);function n(r,i,o,a,s){var l;return tn(this,n),l=e.call(this),l.value=r,l.validateValue=i,l.setValue=o,l.priority=a,s&&(l.subPriority=s),l}return Xt(n,[{key:"validate",value:function(i,o){return this.validateValue(i,this.value,o)}},{key:"set",value:function(i,o,a){return this.setValue(i,o,this.value,a)}}]),n}(Oae),F4e=function(t){cn(n,t);var e=un(n);function n(){var r;tn(this,n);for(var i=arguments.length,o=new Array(i),a=0;a<i;a++)o[a]=arguments[a];return r=e.call.apply(e,[this].concat(o)),it(lt(r),"priority",N4e),it(lt(r),"subPriority",-1),r}return Xt(n,[{key:"set",value:function(i,o){if(o.timestampIsSet)return i;var a=new Date(0);return a.setFullYear(i.getUTCFullYear(),i.getUTCMonth(),i.getUTCDate()),a.setHours(i.getUTCHours(),i.getUTCMinutes(),i.getUTCSeconds(),i.getUTCMilliseconds()),a}}]),n}(Oae),_n=function(){function t(){tn(this,t),it(this,"incompatibleTokens",void 0),it(this,"priority",void 0),it(this,"subPriority",void 0)}return Xt(t,[{key:"run",value:function(n,r,i,o){var a=this.parse(n,r,i,o);return a?{setter:new $4e(a.value,this.validate,this.set,this.priority,this.subPriority),rest:a.rest}:null}},{key:"validate",value:function(n,r,i){return!0}}]),t}(),j4e=function(t){cn(n,t);var e=un(n);function n(){var r;tn(this,n);for(var i=arguments.length,o=new Array(i),a=0;a<i;a++)o[a]=arguments[a];return r=e.call.apply(e,[this].concat(o)),it(lt(r),"priority",140),it(lt(r),"incompatibleTokens",["R","u","t","T"]),r}return Xt(n,[{key:"parse",value:function(i,o,a){switch(o){case"G":case"GG":case"GGG":return a.era(i,{width:"abbreviated"})||a.era(i,{width:"narrow"});case"GGGGG":return a.era(i,{width:"narrow"});case"GGGG":default:return a.era(i,{width:"wide"})||a.era(i,{width:"abbreviated"})||a.era(i,{width:"narrow"})}}},{key:"set",value:function(i,o,a){return o.era=a,i.setUTCFullYear(a,0,1),i.setUTCHours(0,0,0,0),i}}]),n}(_n),Er={month:/^(1[0-2]|0?\d)/,date:/^(3[0-1]|[0-2]?\d)/,dayOfYear:/^(36[0-6]|3[0-5]\d|[0-2]?\d?\d)/,week:/^(5[0-3]|[0-4]?\d)/,hour23h:/^(2[0-3]|[0-1]?\d)/,hour24h:/^(2[0-4]|[0-1]?\d)/,hour11h:/^(1[0-1]|0?\d)/,hour12h:/^(1[0-2]|0?\d)/,minute:/^[0-5]?\d/,second:/^[0-5]?\d/,singleDigit:/^\d/,twoDigits:/^\d{1,2}/,threeDigits:/^\d{1,3}/,fourDigits:/^\d{1,4}/,anyDigitsSigned:/^-?\d+/,singleDigitSigned:/^-?\d/,twoDigitsSigned:/^-?\d{1,2}/,threeDigitsSigned:/^-?\d{1,3}/,fourDigitsSigned:/^-?\d{1,4}/},Sl={basicOptionalMinutes:/^([+-])(\d{2})(\d{2})?|Z/,basic:/^([+-])(\d{2})(\d{2})|Z/,basicOptionalSeconds:/^([+-])(\d{2})(\d{2})((\d{2}))?|Z/,extended:/^([+-])(\d{2}):(\d{2})|Z/,extendedOptionalSeconds:/^([+-])(\d{2}):(\d{2})(:(\d{2}))?|Z/};function Pr(t,e){return t&&{value:e(t.value),rest:t.rest}}function mr(t,e){var n=e.match(t);return n?{value:parseInt(n[0],10),rest:e.slice(n[0].length)}:null}function Ol(t,e){var n=e.match(t);if(!n)return null;if(n[0]==="Z")return{value:0,rest:e.slice(1)};var r=n[1]==="+"?1:-1,i=n[2]?parseInt(n[2],10):0,o=n[3]?parseInt(n[3],10):0,a=n[5]?parseInt(n[5],10):0;return{value:r*(i*b2+o*x2+a*mze),rest:e.slice(n[0].length)}}function Cae(t){return mr(Er.anyDigitsSigned,t)}function wr(t,e){switch(t){case 1:return mr(Er.singleDigit,e);case 2:return mr(Er.twoDigits,e);case 3:return mr(Er.threeDigits,e);case 4:return mr(Er.fourDigits,e);default:return mr(new RegExp("^\\d{1,"+t+"}"),e)}}function eE(t,e){switch(t){case 1:return mr(Er.singleDigitSigned,e);case 2:return mr(Er.twoDigitsSigned,e);case 3:return mr(Er.threeDigitsSigned,e);case 4:return mr(Er.fourDigitsSigned,e);default:return mr(new RegExp("^-?\\d{1,"+t+"}"),e)}}function jB(t){switch(t){case"morning":return 4;case"evening":return 17;case"pm":case"noon":case"afternoon":return 12;case"am":case"midnight":case"night":default:return 0}}function Tae(t,e){var n=e>0,r=n?e:1-e,i;if(r<=50)i=t||100;else{var o=r+50,a=Math.floor(o/100)*100,s=t>=o%100;i=t+a-(s?100:0)}return n?i:1-i}function Eae(t){return t%400===0||t%4===0&&t%100!==0}var B4e=function(t){cn(n,t);var e=un(n);function n(){var r;tn(this,n);for(var i=arguments.length,o=new Array(i),a=0;a<i;a++)o[a]=arguments[a];return r=e.call.apply(e,[this].concat(o)),it(lt(r),"priority",130),it(lt(r),"incompatibleTokens",["Y","R","u","w","I","i","e","c","t","T"]),r}return Xt(n,[{key:"parse",value:function(i,o,a){var s=function(c){return{year:c,isTwoDigitYear:o==="yy"}};switch(o){case"y":return Pr(wr(4,i),s);case"yo":return Pr(a.ordinalNumber(i,{unit:"year"}),s);default:return Pr(wr(o.length,i),s)}}},{key:"validate",value:function(i,o){return o.isTwoDigitYear||o.year>0}},{key:"set",value:function(i,o,a){var s=i.getUTCFullYear();if(a.isTwoDigitYear){var l=Tae(a.year,s);return i.setUTCFullYear(l,0,1),i.setUTCHours(0,0,0,0),i}var c=!("era"in o)||o.era===1?a.year:1-a.year;return i.setUTCFullYear(c,0,1),i.setUTCHours(0,0,0,0),i}}]),n}(_n),z4e=function(t){cn(n,t);var e=un(n);function n(){var r;tn(this,n);for(var i=arguments.length,o=new Array(i),a=0;a<i;a++)o[a]=arguments[a];return r=e.call.apply(e,[this].concat(o)),it(lt(r),"priority",130),it(lt(r),"incompatibleTokens",["y","R","u","Q","q","M","L","I","d","D","i","t","T"]),r}return Xt(n,[{key:"parse",value:function(i,o,a){var s=function(c){return{year:c,isTwoDigitYear:o==="YY"}};switch(o){case"Y":return Pr(wr(4,i),s);case"Yo":return Pr(a.ordinalNumber(i,{unit:"year"}),s);default:return Pr(wr(o.length,i),s)}}},{key:"validate",value:function(i,o){return o.isTwoDigitYear||o.year>0}},{key:"set",value:function(i,o,a,s){var l=FB(i,s);if(a.isTwoDigitYear){var c=Tae(a.year,l);return i.setUTCFullYear(c,0,s.firstWeekContainsDate),i.setUTCHours(0,0,0,0),ap(i,s)}var u=!("era"in o)||o.era===1?a.year:1-a.year;return i.setUTCFullYear(u,0,s.firstWeekContainsDate),i.setUTCHours(0,0,0,0),ap(i,s)}}]),n}(_n),U4e=function(t){cn(n,t);var e=un(n);function n(){var r;tn(this,n);for(var i=arguments.length,o=new Array(i),a=0;a<i;a++)o[a]=arguments[a];return r=e.call.apply(e,[this].concat(o)),it(lt(r),"priority",130),it(lt(r),"incompatibleTokens",["G","y","Y","u","Q","q","M","L","w","d","D","e","c","t","T"]),r}return Xt(n,[{key:"parse",value:function(i,o){return eE(o==="R"?4:o.length,i)}},{key:"set",value:function(i,o,a){var s=new Date(0);return s.setUTCFullYear(a,0,4),s.setUTCHours(0,0,0,0),av(s)}}]),n}(_n),W4e=function(t){cn(n,t);var e=un(n);function n(){var r;tn(this,n);for(var i=arguments.length,o=new Array(i),a=0;a<i;a++)o[a]=arguments[a];return r=e.call.apply(e,[this].concat(o)),it(lt(r),"priority",130),it(lt(r),"incompatibleTokens",["G","y","Y","R","w","I","i","e","c","t","T"]),r}return Xt(n,[{key:"parse",value:function(i,o){return eE(o==="u"?4:o.length,i)}},{key:"set",value:function(i,o,a){return i.setUTCFullYear(a,0,1),i.setUTCHours(0,0,0,0),i}}]),n}(_n),V4e=function(t){cn(n,t);var e=un(n);function n(){var r;tn(this,n);for(var i=arguments.length,o=new Array(i),a=0;a<i;a++)o[a]=arguments[a];return r=e.call.apply(e,[this].concat(o)),it(lt(r),"priority",120),it(lt(r),"incompatibleTokens",["Y","R","q","M","L","w","I","d","D","i","e","c","t","T"]),r}return Xt(n,[{key:"parse",value:function(i,o,a){switch(o){case"Q":case"QQ":return wr(o.length,i);case"Qo":return a.ordinalNumber(i,{unit:"quarter"});case"QQQ":return a.quarter(i,{width:"abbreviated",context:"formatting"})||a.quarter(i,{width:"narrow",context:"formatting"});case"QQQQQ":return a.quarter(i,{width:"narrow",context:"formatting"});case"QQQQ":default:return a.quarter(i,{width:"wide",context:"formatting"})||a.quarter(i,{width:"abbreviated",context:"formatting"})||a.quarter(i,{width:"narrow",context:"formatting"})}}},{key:"validate",value:function(i,o){return o>=1&&o<=4}},{key:"set",value:function(i,o,a){return i.setUTCMonth((a-1)*3,1),i.setUTCHours(0,0,0,0),i}}]),n}(_n),G4e=function(t){cn(n,t);var e=un(n);function n(){var r;tn(this,n);for(var i=arguments.length,o=new Array(i),a=0;a<i;a++)o[a]=arguments[a];return r=e.call.apply(e,[this].concat(o)),it(lt(r),"priority",120),it(lt(r),"incompatibleTokens",["Y","R","Q","M","L","w","I","d","D","i","e","c","t","T"]),r}return Xt(n,[{key:"parse",value:function(i,o,a){switch(o){case"q":case"qq":return wr(o.length,i);case"qo":return a.ordinalNumber(i,{unit:"quarter"});case"qqq":return a.quarter(i,{width:"abbreviated",context:"standalone"})||a.quarter(i,{width:"narrow",context:"standalone"});case"qqqqq":return a.quarter(i,{width:"narrow",context:"standalone"});case"qqqq":default:return a.quarter(i,{width:"wide",context:"standalone"})||a.quarter(i,{width:"abbreviated",context:"standalone"})||a.quarter(i,{width:"narrow",context:"standalone"})}}},{key:"validate",value:function(i,o){return o>=1&&o<=4}},{key:"set",value:function(i,o,a){return i.setUTCMonth((a-1)*3,1),i.setUTCHours(0,0,0,0),i}}]),n}(_n),H4e=function(t){cn(n,t);var e=un(n);function n(){var r;tn(this,n);for(var i=arguments.length,o=new Array(i),a=0;a<i;a++)o[a]=arguments[a];return r=e.call.apply(e,[this].concat(o)),it(lt(r),"incompatibleTokens",["Y","R","q","Q","L","w","I","D","i","e","c","t","T"]),it(lt(r),"priority",110),r}return Xt(n,[{key:"parse",value:function(i,o,a){var s=function(c){return c-1};switch(o){case"M":return Pr(mr(Er.month,i),s);case"MM":return Pr(wr(2,i),s);case"Mo":return Pr(a.ordinalNumber(i,{unit:"month"}),s);case"MMM":return a.month(i,{width:"abbreviated",context:"formatting"})||a.month(i,{width:"narrow",context:"formatting"});case"MMMMM":return a.month(i,{width:"narrow",context:"formatting"});case"MMMM":default:return a.month(i,{width:"wide",context:"formatting"})||a.month(i,{width:"abbreviated",context:"formatting"})||a.month(i,{width:"narrow",context:"formatting"})}}},{key:"validate",value:function(i,o){return o>=0&&o<=11}},{key:"set",value:function(i,o,a){return i.setUTCMonth(a,1),i.setUTCHours(0,0,0,0),i}}]),n}(_n),q4e=function(t){cn(n,t);var e=un(n);function n(){var r;tn(this,n);for(var i=arguments.length,o=new Array(i),a=0;a<i;a++)o[a]=arguments[a];return r=e.call.apply(e,[this].concat(o)),it(lt(r),"priority",110),it(lt(r),"incompatibleTokens",["Y","R","q","Q","M","w","I","D","i","e","c","t","T"]),r}return Xt(n,[{key:"parse",value:function(i,o,a){var s=function(c){return c-1};switch(o){case"L":return Pr(mr(Er.month,i),s);case"LL":return Pr(wr(2,i),s);case"Lo":return Pr(a.ordinalNumber(i,{unit:"month"}),s);case"LLL":return a.month(i,{width:"abbreviated",context:"standalone"})||a.month(i,{width:"narrow",context:"standalone"});case"LLLLL":return a.month(i,{width:"narrow",context:"standalone"});case"LLLL":default:return a.month(i,{width:"wide",context:"standalone"})||a.month(i,{width:"abbreviated",context:"standalone"})||a.month(i,{width:"narrow",context:"standalone"})}}},{key:"validate",value:function(i,o){return o>=0&&o<=11}},{key:"set",value:function(i,o,a){return i.setUTCMonth(a,1),i.setUTCHours(0,0,0,0),i}}]),n}(_n);function X4e(t,e,n){tt(2,arguments);var r=nt(t),i=On(e),o=vae(r,n)-i;return r.setUTCDate(r.getUTCDate()-o*7),r}var Q4e=function(t){cn(n,t);var e=un(n);function n(){var r;tn(this,n);for(var i=arguments.length,o=new Array(i),a=0;a<i;a++)o[a]=arguments[a];return r=e.call.apply(e,[this].concat(o)),it(lt(r),"priority",100),it(lt(r),"incompatibleTokens",["y","R","u","q","Q","M","L","I","d","D","i","t","T"]),r}return Xt(n,[{key:"parse",value:function(i,o,a){switch(o){case"w":return mr(Er.week,i);case"wo":return a.ordinalNumber(i,{unit:"week"});default:return wr(o.length,i)}}},{key:"validate",value:function(i,o){return o>=1&&o<=53}},{key:"set",value:function(i,o,a,s){return ap(X4e(i,a,s),s)}}]),n}(_n);function Y4e(t,e){tt(2,arguments);var n=nt(t),r=On(e),i=gae(n)-r;return n.setUTCDate(n.getUTCDate()-i*7),n}var K4e=function(t){cn(n,t);var e=un(n);function n(){var r;tn(this,n);for(var i=arguments.length,o=new Array(i),a=0;a<i;a++)o[a]=arguments[a];return r=e.call.apply(e,[this].concat(o)),it(lt(r),"priority",100),it(lt(r),"incompatibleTokens",["y","Y","u","q","Q","M","L","w","d","D","e","c","t","T"]),r}return Xt(n,[{key:"parse",value:function(i,o,a){switch(o){case"I":return mr(Er.week,i);case"Io":return a.ordinalNumber(i,{unit:"week"});default:return wr(o.length,i)}}},{key:"validate",value:function(i,o){return o>=1&&o<=53}},{key:"set",value:function(i,o,a){return av(Y4e(i,a))}}]),n}(_n),Z4e=[31,28,31,30,31,30,31,31,30,31,30,31],J4e=[31,29,31,30,31,30,31,31,30,31,30,31],eUe=function(t){cn(n,t);var e=un(n);function n(){var r;tn(this,n);for(var i=arguments.length,o=new Array(i),a=0;a<i;a++)o[a]=arguments[a];return r=e.call.apply(e,[this].concat(o)),it(lt(r),"priority",90),it(lt(r),"subPriority",1),it(lt(r),"incompatibleTokens",["Y","R","q","Q","w","I","D","i","e","c","t","T"]),r}return Xt(n,[{key:"parse",value:function(i,o,a){switch(o){case"d":return mr(Er.date,i);case"do":return a.ordinalNumber(i,{unit:"date"});default:return wr(o.length,i)}}},{key:"validate",value:function(i,o){var a=i.getUTCFullYear(),s=Eae(a),l=i.getUTCMonth();return s?o>=1&&o<=J4e[l]:o>=1&&o<=Z4e[l]}},{key:"set",value:function(i,o,a){return i.setUTCDate(a),i.setUTCHours(0,0,0,0),i}}]),n}(_n),tUe=function(t){cn(n,t);var e=un(n);function n(){var r;tn(this,n);for(var i=arguments.length,o=new Array(i),a=0;a<i;a++)o[a]=arguments[a];return r=e.call.apply(e,[this].concat(o)),it(lt(r),"priority",90),it(lt(r),"subpriority",1),it(lt(r),"incompatibleTokens",["Y","R","q","Q","M","L","w","I","d","E","i","e","c","t","T"]),r}return Xt(n,[{key:"parse",value:function(i,o,a){switch(o){case"D":case"DD":return mr(Er.dayOfYear,i);case"Do":return a.ordinalNumber(i,{unit:"date"});default:return wr(o.length,i)}}},{key:"validate",value:function(i,o){var a=i.getUTCFullYear(),s=Eae(a);return s?o>=1&&o<=366:o>=1&&o<=365}},{key:"set",value:function(i,o,a){return i.setUTCMonth(0,a),i.setUTCHours(0,0,0,0),i}}]),n}(_n);function BB(t,e,n){var r,i,o,a,s,l,c,u;tt(2,arguments);var f=_d(),d=On((r=(i=(o=(a=n==null?void 0:n.weekStartsOn)!==null&&a!==void 0?a:n==null||(s=n.locale)===null||s===void 0||(l=s.options)===null||l===void 0?void 0:l.weekStartsOn)!==null&&o!==void 0?o:f.weekStartsOn)!==null&&i!==void 0?i:(c=f.locale)===null||c===void 0||(u=c.options)===null||u===void 0?void 0:u.weekStartsOn)!==null&&r!==void 0?r:0);if(!(d>=0&&d<=6))throw new RangeError("weekStartsOn must be between 0 and 6 inclusively");var h=nt(t),p=On(e),m=h.getUTCDay(),g=p%7,v=(g+7)%7,y=(v<d?7:0)+p-m;return h.setUTCDate(h.getUTCDate()+y),h}var nUe=function(t){cn(n,t);var e=un(n);function n(){var r;tn(this,n);for(var i=arguments.length,o=new Array(i),a=0;a<i;a++)o[a]=arguments[a];return r=e.call.apply(e,[this].concat(o)),it(lt(r),"priority",90),it(lt(r),"incompatibleTokens",["D","i","e","c","t","T"]),r}return Xt(n,[{key:"parse",value:function(i,o,a){switch(o){case"E":case"EE":case"EEE":return a.day(i,{width:"abbreviated",context:"formatting"})||a.day(i,{width:"short",context:"formatting"})||a.day(i,{width:"narrow",context:"formatting"});case"EEEEE":return a.day(i,{width:"narrow",context:"formatting"});case"EEEEEE":return a.day(i,{width:"short",context:"formatting"})||a.day(i,{width:"narrow",context:"formatting"});case"EEEE":default:return a.day(i,{width:"wide",context:"formatting"})||a.day(i,{width:"abbreviated",context:"formatting"})||a.day(i,{width:"short",context:"formatting"})||a.day(i,{width:"narrow",context:"formatting"})}}},{key:"validate",value:function(i,o){return o>=0&&o<=6}},{key:"set",value:function(i,o,a,s){return i=BB(i,a,s),i.setUTCHours(0,0,0,0),i}}]),n}(_n),rUe=function(t){cn(n,t);var e=un(n);function n(){var r;tn(this,n);for(var i=arguments.length,o=new Array(i),a=0;a<i;a++)o[a]=arguments[a];return r=e.call.apply(e,[this].concat(o)),it(lt(r),"priority",90),it(lt(r),"incompatibleTokens",["y","R","u","q","Q","M","L","I","d","D","E","i","c","t","T"]),r}return Xt(n,[{key:"parse",value:function(i,o,a,s){var l=function(u){var f=Math.floor((u-1)/7)*7;return(u+s.weekStartsOn+6)%7+f};switch(o){case"e":case"ee":return Pr(wr(o.length,i),l);case"eo":return Pr(a.ordinalNumber(i,{unit:"day"}),l);case"eee":return a.day(i,{width:"abbreviated",context:"formatting"})||a.day(i,{width:"short",context:"formatting"})||a.day(i,{width:"narrow",context:"formatting"});case"eeeee":return a.day(i,{width:"narrow",context:"formatting"});case"eeeeee":return a.day(i,{width:"short",context:"formatting"})||a.day(i,{width:"narrow",context:"formatting"});case"eeee":default:return a.day(i,{width:"wide",context:"formatting"})||a.day(i,{width:"abbreviated",context:"formatting"})||a.day(i,{width:"short",context:"formatting"})||a.day(i,{width:"narrow",context:"formatting"})}}},{key:"validate",value:function(i,o){return o>=0&&o<=6}},{key:"set",value:function(i,o,a,s){return i=BB(i,a,s),i.setUTCHours(0,0,0,0),i}}]),n}(_n),iUe=function(t){cn(n,t);var e=un(n);function n(){var r;tn(this,n);for(var i=arguments.length,o=new Array(i),a=0;a<i;a++)o[a]=arguments[a];return r=e.call.apply(e,[this].concat(o)),it(lt(r),"priority",90),it(lt(r),"incompatibleTokens",["y","R","u","q","Q","M","L","I","d","D","E","i","e","t","T"]),r}return Xt(n,[{key:"parse",value:function(i,o,a,s){var l=function(u){var f=Math.floor((u-1)/7)*7;return(u+s.weekStartsOn+6)%7+f};switch(o){case"c":case"cc":return Pr(wr(o.length,i),l);case"co":return Pr(a.ordinalNumber(i,{unit:"day"}),l);case"ccc":return a.day(i,{width:"abbreviated",context:"standalone"})||a.day(i,{width:"short",context:"standalone"})||a.day(i,{width:"narrow",context:"standalone"});case"ccccc":return a.day(i,{width:"narrow",context:"standalone"});case"cccccc":return a.day(i,{width:"short",context:"standalone"})||a.day(i,{width:"narrow",context:"standalone"});case"cccc":default:return a.day(i,{width:"wide",context:"standalone"})||a.day(i,{width:"abbreviated",context:"standalone"})||a.day(i,{width:"short",context:"standalone"})||a.day(i,{width:"narrow",context:"standalone"})}}},{key:"validate",value:function(i,o){return o>=0&&o<=6}},{key:"set",value:function(i,o,a,s){return i=BB(i,a,s),i.setUTCHours(0,0,0,0),i}}]),n}(_n);function oUe(t,e){tt(2,arguments);var n=On(e);n%7===0&&(n=n-7);var r=1,i=nt(t),o=i.getUTCDay(),a=n%7,s=(a+7)%7,l=(s<r?7:0)+n-o;return i.setUTCDate(i.getUTCDate()+l),i}var aUe=function(t){cn(n,t);var e=un(n);function n(){var r;tn(this,n);for(var i=arguments.length,o=new Array(i),a=0;a<i;a++)o[a]=arguments[a];return r=e.call.apply(e,[this].concat(o)),it(lt(r),"priority",90),it(lt(r),"incompatibleTokens",["y","Y","u","q","Q","M","L","w","d","D","E","e","c","t","T"]),r}return Xt(n,[{key:"parse",value:function(i,o,a){var s=function(c){return c===0?7:c};switch(o){case"i":case"ii":return wr(o.length,i);case"io":return a.ordinalNumber(i,{unit:"day"});case"iii":return Pr(a.day(i,{width:"abbreviated",context:"formatting"})||a.day(i,{width:"short",context:"formatting"})||a.day(i,{width:"narrow",context:"formatting"}),s);case"iiiii":return Pr(a.day(i,{width:"narrow",context:"formatting"}),s);case"iiiiii":return Pr(a.day(i,{width:"short",context:"formatting"})||a.day(i,{width:"narrow",context:"formatting"}),s);case"iiii":default:return Pr(a.day(i,{width:"wide",context:"formatting"})||a.day(i,{width:"abbreviated",context:"formatting"})||a.day(i,{width:"short",context:"formatting"})||a.day(i,{width:"narrow",context:"formatting"}),s)}}},{key:"validate",value:function(i,o){return o>=1&&o<=7}},{key:"set",value:function(i,o,a){return i=oUe(i,a),i.setUTCHours(0,0,0,0),i}}]),n}(_n),sUe=function(t){cn(n,t);var e=un(n);function n(){var r;tn(this,n);for(var i=arguments.length,o=new Array(i),a=0;a<i;a++)o[a]=arguments[a];return r=e.call.apply(e,[this].concat(o)),it(lt(r),"priority",80),it(lt(r),"incompatibleTokens",["b","B","H","k","t","T"]),r}return Xt(n,[{key:"parse",value:function(i,o,a){switch(o){case"a":case"aa":case"aaa":return a.dayPeriod(i,{width:"abbreviated",context:"formatting"})||a.dayPeriod(i,{width:"narrow",context:"formatting"});case"aaaaa":return a.dayPeriod(i,{width:"narrow",context:"formatting"});case"aaaa":default:return a.dayPeriod(i,{width:"wide",context:"formatting"})||a.dayPeriod(i,{width:"abbreviated",context:"formatting"})||a.dayPeriod(i,{width:"narrow",context:"formatting"})}}},{key:"set",value:function(i,o,a){return i.setUTCHours(jB(a),0,0,0),i}}]),n}(_n),lUe=function(t){cn(n,t);var e=un(n);function n(){var r;tn(this,n);for(var i=arguments.length,o=new Array(i),a=0;a<i;a++)o[a]=arguments[a];return r=e.call.apply(e,[this].concat(o)),it(lt(r),"priority",80),it(lt(r),"incompatibleTokens",["a","B","H","k","t","T"]),r}return Xt(n,[{key:"parse",value:function(i,o,a){switch(o){case"b":case"bb":case"bbb":return a.dayPeriod(i,{width:"abbreviated",context:"formatting"})||a.dayPeriod(i,{width:"narrow",context:"formatting"});case"bbbbb":return a.dayPeriod(i,{width:"narrow",context:"formatting"});case"bbbb":default:return a.dayPeriod(i,{width:"wide",context:"formatting"})||a.dayPeriod(i,{width:"abbreviated",context:"formatting"})||a.dayPeriod(i,{width:"narrow",context:"formatting"})}}},{key:"set",value:function(i,o,a){return i.setUTCHours(jB(a),0,0,0),i}}]),n}(_n),cUe=function(t){cn(n,t);var e=un(n);function n(){var r;tn(this,n);for(var i=arguments.length,o=new Array(i),a=0;a<i;a++)o[a]=arguments[a];return r=e.call.apply(e,[this].concat(o)),it(lt(r),"priority",80),it(lt(r),"incompatibleTokens",["a","b","t","T"]),r}return Xt(n,[{key:"parse",value:function(i,o,a){switch(o){case"B":case"BB":case"BBB":return a.dayPeriod(i,{width:"abbreviated",context:"formatting"})||a.dayPeriod(i,{width:"narrow",context:"formatting"});case"BBBBB":return a.dayPeriod(i,{width:"narrow",context:"formatting"});case"BBBB":default:return a.dayPeriod(i,{width:"wide",context:"formatting"})||a.dayPeriod(i,{width:"abbreviated",context:"formatting"})||a.dayPeriod(i,{width:"narrow",context:"formatting"})}}},{key:"set",value:function(i,o,a){return i.setUTCHours(jB(a),0,0,0),i}}]),n}(_n),uUe=function(t){cn(n,t);var e=un(n);function n(){var r;tn(this,n);for(var i=arguments.length,o=new Array(i),a=0;a<i;a++)o[a]=arguments[a];return r=e.call.apply(e,[this].concat(o)),it(lt(r),"priority",70),it(lt(r),"incompatibleTokens",["H","K","k","t","T"]),r}return Xt(n,[{key:"parse",value:function(i,o,a){switch(o){case"h":return mr(Er.hour12h,i);case"ho":return a.ordinalNumber(i,{unit:"hour"});default:return wr(o.length,i)}}},{key:"validate",value:function(i,o){return o>=1&&o<=12}},{key:"set",value:function(i,o,a){var s=i.getUTCHours()>=12;return s&&a<12?i.setUTCHours(a+12,0,0,0):!s&&a===12?i.setUTCHours(0,0,0,0):i.setUTCHours(a,0,0,0),i}}]),n}(_n),fUe=function(t){cn(n,t);var e=un(n);function n(){var r;tn(this,n);for(var i=arguments.length,o=new Array(i),a=0;a<i;a++)o[a]=arguments[a];return r=e.call.apply(e,[this].concat(o)),it(lt(r),"priority",70),it(lt(r),"incompatibleTokens",["a","b","h","K","k","t","T"]),r}return Xt(n,[{key:"parse",value:function(i,o,a){switch(o){case"H":return mr(Er.hour23h,i);case"Ho":return a.ordinalNumber(i,{unit:"hour"});default:return wr(o.length,i)}}},{key:"validate",value:function(i,o){return o>=0&&o<=23}},{key:"set",value:function(i,o,a){return i.setUTCHours(a,0,0,0),i}}]),n}(_n),dUe=function(t){cn(n,t);var e=un(n);function n(){var r;tn(this,n);for(var i=arguments.length,o=new Array(i),a=0;a<i;a++)o[a]=arguments[a];return r=e.call.apply(e,[this].concat(o)),it(lt(r),"priority",70),it(lt(r),"incompatibleTokens",["h","H","k","t","T"]),r}return Xt(n,[{key:"parse",value:function(i,o,a){switch(o){case"K":return mr(Er.hour11h,i);case"Ko":return a.ordinalNumber(i,{unit:"hour"});default:return wr(o.length,i)}}},{key:"validate",value:function(i,o){return o>=0&&o<=11}},{key:"set",value:function(i,o,a){var s=i.getUTCHours()>=12;return s&&a<12?i.setUTCHours(a+12,0,0,0):i.setUTCHours(a,0,0,0),i}}]),n}(_n),hUe=function(t){cn(n,t);var e=un(n);function n(){var r;tn(this,n);for(var i=arguments.length,o=new Array(i),a=0;a<i;a++)o[a]=arguments[a];return r=e.call.apply(e,[this].concat(o)),it(lt(r),"priority",70),it(lt(r),"incompatibleTokens",["a","b","h","H","K","t","T"]),r}return Xt(n,[{key:"parse",value:function(i,o,a){switch(o){case"k":return mr(Er.hour24h,i);case"ko":return a.ordinalNumber(i,{unit:"hour"});default:return wr(o.length,i)}}},{key:"validate",value:function(i,o){return o>=1&&o<=24}},{key:"set",value:function(i,o,a){var s=a<=24?a%24:a;return i.setUTCHours(s,0,0,0),i}}]),n}(_n),pUe=function(t){cn(n,t);var e=un(n);function n(){var r;tn(this,n);for(var i=arguments.length,o=new Array(i),a=0;a<i;a++)o[a]=arguments[a];return r=e.call.apply(e,[this].concat(o)),it(lt(r),"priority",60),it(lt(r),"incompatibleTokens",["t","T"]),r}return Xt(n,[{key:"parse",value:function(i,o,a){switch(o){case"m":return mr(Er.minute,i);case"mo":return a.ordinalNumber(i,{unit:"minute"});default:return wr(o.length,i)}}},{key:"validate",value:function(i,o){return o>=0&&o<=59}},{key:"set",value:function(i,o,a){return i.setUTCMinutes(a,0,0),i}}]),n}(_n),mUe=function(t){cn(n,t);var e=un(n);function n(){var r;tn(this,n);for(var i=arguments.length,o=new Array(i),a=0;a<i;a++)o[a]=arguments[a];return r=e.call.apply(e,[this].concat(o)),it(lt(r),"priority",50),it(lt(r),"incompatibleTokens",["t","T"]),r}return Xt(n,[{key:"parse",value:function(i,o,a){switch(o){case"s":return mr(Er.second,i);case"so":return a.ordinalNumber(i,{unit:"second"});default:return wr(o.length,i)}}},{key:"validate",value:function(i,o){return o>=0&&o<=59}},{key:"set",value:function(i,o,a){return i.setUTCSeconds(a,0),i}}]),n}(_n),gUe=function(t){cn(n,t);var e=un(n);function n(){var r;tn(this,n);for(var i=arguments.length,o=new Array(i),a=0;a<i;a++)o[a]=arguments[a];return r=e.call.apply(e,[this].concat(o)),it(lt(r),"priority",30),it(lt(r),"incompatibleTokens",["t","T"]),r}return Xt(n,[{key:"parse",value:function(i,o){var a=function(l){return Math.floor(l*Math.pow(10,-o.length+3))};return Pr(wr(o.length,i),a)}},{key:"set",value:function(i,o,a){return i.setUTCMilliseconds(a),i}}]),n}(_n),vUe=function(t){cn(n,t);var e=un(n);function n(){var r;tn(this,n);for(var i=arguments.length,o=new Array(i),a=0;a<i;a++)o[a]=arguments[a];return r=e.call.apply(e,[this].concat(o)),it(lt(r),"priority",10),it(lt(r),"incompatibleTokens",["t","T","x"]),r}return Xt(n,[{key:"parse",value:function(i,o){switch(o){case"X":return Ol(Sl.basicOptionalMinutes,i);case"XX":return Ol(Sl.basic,i);case"XXXX":return Ol(Sl.basicOptionalSeconds,i);case"XXXXX":return Ol(Sl.extendedOptionalSeconds,i);case"XXX":default:return Ol(Sl.extended,i)}}},{key:"set",value:function(i,o,a){return o.timestampIsSet?i:new Date(i.getTime()-a)}}]),n}(_n),yUe=function(t){cn(n,t);var e=un(n);function n(){var r;tn(this,n);for(var i=arguments.length,o=new Array(i),a=0;a<i;a++)o[a]=arguments[a];return r=e.call.apply(e,[this].concat(o)),it(lt(r),"priority",10),it(lt(r),"incompatibleTokens",["t","T","X"]),r}return Xt(n,[{key:"parse",value:function(i,o){switch(o){case"x":return Ol(Sl.basicOptionalMinutes,i);case"xx":return Ol(Sl.basic,i);case"xxxx":return Ol(Sl.basicOptionalSeconds,i);case"xxxxx":return Ol(Sl.extendedOptionalSeconds,i);case"xxx":default:return Ol(Sl.extended,i)}}},{key:"set",value:function(i,o,a){return o.timestampIsSet?i:new Date(i.getTime()-a)}}]),n}(_n),xUe=function(t){cn(n,t);var e=un(n);function n(){var r;tn(this,n);for(var i=arguments.length,o=new Array(i),a=0;a<i;a++)o[a]=arguments[a];return r=e.call.apply(e,[this].concat(o)),it(lt(r),"priority",40),it(lt(r),"incompatibleTokens","*"),r}return Xt(n,[{key:"parse",value:function(i){return Cae(i)}},{key:"set",value:function(i,o,a){return[new Date(a*1e3),{timestampIsSet:!0}]}}]),n}(_n),bUe=function(t){cn(n,t);var e=un(n);function n(){var r;tn(this,n);for(var i=arguments.length,o=new Array(i),a=0;a<i;a++)o[a]=arguments[a];return r=e.call.apply(e,[this].concat(o)),it(lt(r),"priority",20),it(lt(r),"incompatibleTokens","*"),r}return Xt(n,[{key:"parse",value:function(i){return Cae(i)}},{key:"set",value:function(i,o,a){return[new Date(a),{timestampIsSet:!0}]}}]),n}(_n),_Ue={G:new j4e,y:new B4e,Y:new z4e,R:new U4e,u:new W4e,Q:new V4e,q:new G4e,M:new H4e,L:new q4e,w:new Q4e,I:new K4e,d:new eUe,D:new tUe,E:new nUe,e:new rUe,c:new iUe,i:new aUe,a:new sUe,b:new lUe,B:new cUe,h:new uUe,H:new fUe,K:new dUe,k:new hUe,m:new pUe,s:new mUe,S:new gUe,X:new vUe,x:new yUe,t:new xUe,T:new bUe},wUe=/[yYQqMLwIdDecihHKkms]o|(\w)\1*|''|'(''|[^'])+('|$)|./g,SUe=/P+p+|P+|p+|''|'(''|[^'])+('|$)|./g,OUe=/^'([^]*?)'?$/,CUe=/''/g,TUe=/\S/,EUe=/[a-zA-Z]/;function PUe(t,e,n,r){var i,o,a,s,l,c,u,f,d,h,p,m,g,v,y,x,b,_;tt(3,arguments);var S=String(t),O=String(e),C=_d(),E=(i=(o=r==null?void 0:r.locale)!==null&&o!==void 0?o:C.locale)!==null&&i!==void 0?i:w2;if(!E.match)throw new RangeError("locale must contain match property");var k=On((a=(s=(l=(c=r==null?void 0:r.firstWeekContainsDate)!==null&&c!==void 0?c:r==null||(u=r.locale)===null||u===void 0||(f=u.options)===null||f===void 0?void 0:f.firstWeekContainsDate)!==null&&l!==void 0?l:C.firstWeekContainsDate)!==null&&s!==void 0?s:(d=C.locale)===null||d===void 0||(h=d.options)===null||h===void 0?void 0:h.firstWeekContainsDate)!==null&&a!==void 0?a:1);if(!(k>=1&&k<=7))throw new RangeError("firstWeekContainsDate must be between 1 and 7 inclusively");var I=On((p=(m=(g=(v=r==null?void 0:r.weekStartsOn)!==null&&v!==void 0?v:r==null||(y=r.locale)===null||y===void 0||(x=y.options)===null||x===void 0?void 0:x.weekStartsOn)!==null&&g!==void 0?g:C.weekStartsOn)!==null&&m!==void 0?m:(b=C.locale)===null||b===void 0||(_=b.options)===null||_===void 0?void 0:_.weekStartsOn)!==null&&p!==void 0?p:0);if(!(I>=0&&I<=6))throw new RangeError("weekStartsOn must be between 0 and 6 inclusively");if(O==="")return S===""?nt(n):new Date(NaN);var P={firstWeekContainsDate:k,weekStartsOn:I,locale:E},R=[new F4e],T=O.match(SUe).map(function(te){var J=te[0];if(J in w3){var pe=w3[J];return pe(te,E.formatLong)}return te}).join("").match(wUe),L=[],z=pH(T),B;try{var U=function(){var J=B.value;!(r!=null&&r.useAdditionalWeekYearTokens)&&bae(J)&&ZT(J,O,t),!(r!=null&&r.useAdditionalDayOfYearTokens)&&xae(J)&&ZT(J,O,t);var pe=J[0],be=_Ue[pe];if(be){var re=be.incompatibleTokens;if(Array.isArray(re)){var ve=L.find(function(ce){return re.includes(ce.token)||ce.token===pe});if(ve)throw new RangeError("The format string mustn't contain `".concat(ve.fullToken,"` and `").concat(J,"` at the same time"))}else if(be.incompatibleTokens==="*"&&L.length>0)throw new RangeError("The format string mustn't contain `".concat(J,"` and any other token at the same time"));L.push({token:pe,fullToken:J});var F=be.run(S,J,E.match,P);if(!F)return{v:new Date(NaN)};R.push(F.setter),S=F.rest}else{if(pe.match(EUe))throw new RangeError("Format string contains an unescaped latin alphabet character `"+pe+"`");if(J==="''"?J="'":pe==="'"&&(J=MUe(J)),S.indexOf(J)===0)S=S.slice(J.length);else return{v:new Date(NaN)}}};for(z.s();!(B=z.n()).done;){var W=U();if(uu(W)==="object")return W.v}}catch(te){z.e(te)}finally{z.f()}if(S.length>0&&TUe.test(S))return new Date(NaN);var $=R.map(function(te){return te.priority}).sort(function(te,J){return J-te}).filter(function(te,J,pe){return pe.indexOf(te)===J}).map(function(te){return R.filter(function(J){return J.priority===te}).sort(function(J,pe){return pe.subPriority-J.subPriority})}).map(function(te){return te[0]}),N=nt(n);if(isNaN(N.getTime()))return new Date(NaN);var D=pae(N,KT(N)),A={},q=pH($),Y;try{for(q.s();!(Y=q.n()).done;){var K=Y.value;if(!K.validate(D,P))return new Date(NaN);var se=K.set(D,A,P);Array.isArray(se)?(D=se[0],O4e(A,se[1])):D=se}}catch(te){q.e(te)}finally{q.f()}return D}function MUe(t){return t.match(OUe)[1].replace(CUe,"'")}function mH(t){tt(1,arguments);var e=nt(t);return e.setMinutes(0,0,0),e}function kUe(t,e){tt(2,arguments);var n=mH(t),r=mH(e);return n.getTime()===r.getTime()}function AUe(t,e){tt(2,arguments);var n=nt(t),r=nt(e);return n.getFullYear()===r.getFullYear()&&n.getMonth()===r.getMonth()}function RUe(t,e){tt(2,arguments);var n=nt(t),r=nt(e);return n.getFullYear()===r.getFullYear()}function IUe(t,e){tt(2,arguments);var n=nt(t).getTime(),r=nt(e.start).getTime(),i=nt(e.end).getTime();if(!(r<=i))throw new RangeError("Invalid interval");return n>=r&&n<=i}function Pae(t,e){var n;tt(1,arguments);var r=On((n=void 0)!==null&&n!==void 0?n:2);if(r!==2&&r!==1&&r!==0)throw new RangeError("additionalDigits must be 0, 1 or 2");if(!(typeof t=="string"||Object.prototype.toString.call(t)==="[object String]"))return new Date(NaN);var i=$Ue(t),o;if(i.date){var a=FUe(i.date,r);o=jUe(a.restDateString,a.year)}if(!o||isNaN(o.getTime()))return new Date(NaN);var s=o.getTime(),l=0,c;if(i.time&&(l=BUe(i.time),isNaN(l)))return new Date(NaN);if(i.timezone){if(c=zUe(i.timezone),isNaN(c))return new Date(NaN)}else{var u=new Date(s+l),f=new Date(0);return f.setFullYear(u.getUTCFullYear(),u.getUTCMonth(),u.getUTCDate()),f.setHours(u.getUTCHours(),u.getUTCMinutes(),u.getUTCSeconds(),u.getUTCMilliseconds()),f}return new Date(s+l+c)}var DS={dateTimeDelimiter:/[T ]/,timeZoneDelimiter:/[Z ]/i,timezone:/([Z+-].*)$/},DUe=/^-?(?:(\d{3})|(\d{2})(?:-?(\d{2}))?|W(\d{2})(?:-?(\d{1}))?|)$/,LUe=/^(\d{2}(?:[.,]\d*)?)(?::?(\d{2}(?:[.,]\d*)?))?(?::?(\d{2}(?:[.,]\d*)?))?$/,NUe=/^([+-])(\d{2})(?::?(\d{2}))?$/;function $Ue(t){var e={},n=t.split(DS.dateTimeDelimiter),r;if(n.length>2)return e;if(/:/.test(n[0])?r=n[0]:(e.date=n[0],r=n[1],DS.timeZoneDelimiter.test(e.date)&&(e.date=t.split(DS.timeZoneDelimiter)[0],r=t.substr(e.date.length,t.length))),r){var i=DS.timezone.exec(r);i?(e.time=r.replace(i[1],""),e.timezone=i[1]):e.time=r}return e}function FUe(t,e){var n=new RegExp("^(?:(\\d{4}|[+-]\\d{"+(4+e)+"})|(\\d{2}|[+-]\\d{"+(2+e)+"})$)"),r=t.match(n);if(!r)return{year:NaN,restDateString:""};var i=r[1]?parseInt(r[1]):null,o=r[2]?parseInt(r[2]):null;return{year:o===null?i:o*100,restDateString:t.slice((r[1]||r[2]).length)}}function jUe(t,e){if(e===null)return new Date(NaN);var n=t.match(DUe);if(!n)return new Date(NaN);var r=!!n[4],i=C0(n[1]),o=C0(n[2])-1,a=C0(n[3]),s=C0(n[4]),l=C0(n[5])-1;if(r)return HUe(e,s,l)?UUe(e,s,l):new Date(NaN);var c=new Date(0);return!VUe(e,o,a)||!GUe(e,i)?new Date(NaN):(c.setUTCFullYear(e,o,Math.max(i,a)),c)}function C0(t){return t?parseInt(t):1}function BUe(t){var e=t.match(LUe);if(!e)return NaN;var n=nR(e[1]),r=nR(e[2]),i=nR(e[3]);return qUe(n,r,i)?n*b2+r*x2+i*1e3:NaN}function nR(t){return t&&parseFloat(t.replace(",","."))||0}function zUe(t){if(t==="Z")return 0;var e=t.match(NUe);if(!e)return 0;var n=e[1]==="+"?-1:1,r=parseInt(e[2]),i=e[3]&&parseInt(e[3])||0;return XUe(r,i)?n*(r*b2+i*x2):NaN}function UUe(t,e,n){var r=new Date(0);r.setUTCFullYear(t,0,4);var i=r.getUTCDay()||7,o=(e-1)*7+n+1-i;return r.setUTCDate(r.getUTCDate()+o),r}var WUe=[31,null,31,30,31,30,31,31,30,31,30,31];function Mae(t){return t%400===0||t%4===0&&t%100!==0}function VUe(t,e,n){return e>=0&&e<=11&&n>=1&&n<=(WUe[e]||(Mae(t)?29:28))}function GUe(t,e){return e>=1&&e<=(Mae(t)?366:365)}function HUe(t,e,n){return e>=1&&e<=53&&n>=0&&n<=6}function qUe(t,e,n){return t===24?e===0&&n===0:n>=0&&n<60&&e>=0&&e<60&&t>=0&&t<25}function XUe(t,e){return e>=0&&e<=59}function QUe(t,e){tt(2,arguments);var n=nt(t),r=On(e),i=n.getFullYear(),o=n.getDate(),a=new Date(0);a.setFullYear(i,r,15),a.setHours(0,0,0,0);var s=_ae(a);return n.setMonth(r,Math.min(o,s)),n}function YUe(t,e){tt(2,arguments);var n=nt(t),r=On(e);return n.setDate(r),n}function KUe(t,e){tt(2,arguments);var n=nt(t),r=On(e);return n.setHours(r),n}function ZUe(t,e){tt(2,arguments);var n=nt(t),r=On(e);return n.setMinutes(r),n}function JUe(t,e){tt(2,arguments);var n=nt(t),r=On(e);return n.setSeconds(r),n}function e6e(t,e){tt(2,arguments);var n=nt(t),r=On(e);return isNaN(n.getTime())?new Date(NaN):(n.setFullYear(r),n)}function kae(t){return t.getTimezoneOffset()*6e4}function t6e(t){return t.getTime()-kae(t)}function rR(t){const e=new Date(t);return new Date(e.getTime()+kae(e))}function Qb(t){return new Date(t).toISOString().substring(0,10)}function gy(t){return Aae(new Date(t).toISOString())}function Aae(t){return t.substring(0,19).replace("T"," ")}const Rae={seconds:1e3,minutes:1e3*60,hours:1e3*60*60,days:1e3*60*60*24,weeks:1e3*60*60*24*7,years:1e3*60*60*24*365};function n6e(t,e){return t===e?!0:t!==null&&e!=null?t[0]===e[0]&&t[1]===e[1]:!1}function r6e(t,e){const n=new Set,r=new Set,i={};for(const l of t)for(const c of l.timeSeriesArray){const{placeId:u,datasetId:f,variableName:d,valueDataKey:h,errorDataKey:p}=c.source;u!==null&&r.add(u);const m=`${f}.${d}.${h}`;n.add(m);let g=null;p&&(g=`${f}.${d}.${p}`,n.add(g)),c.data.forEach(v=>{const y=gy(v.time),x=`${u!==null?u:f}-${y}`,b=i[x];b?i[x]={...b,[m]:v[h]}:i[x]={placeId:u,time:y,[m]:v[h]},g!==null&&(i[x][g]=v[p])})}const o=["placeId","time"].concat(Array.from(n).sort()),a=[];Object.keys(i).forEach(l=>{const c=i[l],u=new Array(o.length);o.forEach((f,d)=>{u[d]=c[f]}),a.push(u)}),a.sort((l,c)=>{const u=l[1],f=c[1],d=u.localeCompare(f);if(d!==0)return d;const h=l[0],p=c[0];return h.localeCompare(p)});const s={};return r.forEach(l=>{s[l]=bB(e,l)}),{colNames:o,dataRows:a,referencedPlaces:s}}function i6e(t){let e=null;const n=t.features||[];for(const r of n){if(!r.properties)continue;const i=r.properties.time;if(typeof i!="string")continue;const a=Pae(i).getTime();if(!Number.isNaN(a))for(const s of Object.getOwnPropertyNames(r.properties)){let l=r.properties[s];const c=typeof l;if(c==="boolean"?l=l?1:0:c!=="number"&&(l=Number.NaN),Number.isNaN(l))continue;const u={time:a,countTot:1,mean:l};e===null&&(e={});const f=e[s];f?f.data.push(u):e[s]={source:{datasetId:t.id,datasetTitle:t.title,variableName:s,placeId:null,geometry:null,valueDataKey:"mean",errorDataKey:null},data:[u],dataProgress:1}}}return e===null?null:{placeGroup:t,timeSeries:e}}const J1=t=>t.dataState.datasets||[],o6e=t=>t.dataState.colorBars,Iae=t=>t.dataState.timeSeriesGroups,ew=t=>t.dataState.userPlaceGroups,Dae=t=>t.dataState.userServers||[],a6e=t=>t.dataState.expressionCapabilities,s6e=t=>t.dataState.statistics.loading,l6e=t=>t.dataState.statistics.records,Lae=at(J1,ew,(t,e)=>{const n={},r=[];return t.forEach(i=>{i.placeGroups&&i.placeGroups.forEach(o=>{n[o.id]||(n[o.id]=o,r.push(o))})}),[...r,...e]}),c6e=at(Lae,t=>{const e=[];return t.forEach(n=>{const r=i6e(n);r!==null&&e.push(r)}),e}),u6e=[{name:"OpenStreetMap",link:"https://openstreetmap.org",datasets:[{name:"OSM Mapnik",endpoint:"https://a.tile.osm.org/{z}/{x}/{y}.png"},{name:"OSM Humanitarian",endpoint:"https://a.tile.openstreetmap.fr/hot/{z}/{x}/{y}.png"},{name:"OSM Landscape",endpoint:"https://a.tile3.opencyclemap.org/landscape/{z}/{x}/{y}.png"}],overlays:[]},{name:"ESRI",link:"https://services.arcgisonline.com/arcgis/rest/services",datasets:[{name:"Dark Gray Base",endpoint:"https://services.arcgisonline.com/arcgis/rest/services/Canvas/World_Dark_Gray_Base/MapServer/tile/{z}/{y}/{x}"},{name:"Light Gray Base",endpoint:"https://services.arcgisonline.com/arcgis/rest/services/Canvas/World_Light_Gray_Base/MapServer/tile/{z}/{y}/{x}"},{name:"World Hillshade",endpoint:"https://services.arcgisonline.com/arcgis/rest/services/Elevation/World_Hillshade/MapServer/tile/{z}/{y}/{x}"},{name:"World Ocean Base",endpoint:"https://services.arcgisonline.com/arcgis/rest/services/Ocean/World_Ocean_Base/MapServer/tile/{z}/{y}/{x}"},{name:"DeLorme World Base Map",endpoint:"https://services.arcgisonline.com/arcgis/rest/services/Specialty/DeLorme_World_Base_Map/MapServer/tile/{z}/{y}/{x}"},{name:"World Street Map",endpoint:"https://services.arcgisonline.com/arcgis/rest/services/World_Street_Map/MapServer/tile/{z}/{y}/{x}"},{name:"World Navigation Charts",endpoint:"https://services.arcgisonline.com/arcgis/rest/services/Specialty/World_Navigation_Charts/MapServer/tile/{z}/{y}/{x}"},{name:"National Geographic",endpoint:"https://services.arcgisonline.com/arcgis/rest/services/NatGeo_World_Map/MapServer/tile/{z}/{y}/{x}"},{name:"World Imagery",endpoint:"https://services.arcgisonline.com/arcgis/rest/services/World_Imagery/MapServer/tile/{z}/{y}/{x}"},{name:"World Physical Map",endpoint:"https://services.arcgisonline.com/arcgis/rest/services/World_Physical_Map/MapServer/tile/{z}/{y}/{x}"},{name:"World Shaded Relief",endpoint:"https://services.arcgisonline.com/arcgis/rest/services/World_Shaded_Relief/MapServer/tile/{z}/{y}/{x}"},{name:"World Terrain",endpoint:"https://services.arcgisonline.com/arcgis/rest/services/World_Terrain_Base/MapServer/tile/{z}/{y}/{x}"},{name:"World Topo Map",endpoint:"https://services.arcgisonline.com/arcgis/rest/services/World_Topo_Map/MapServer/tile/{z}/{y}/{x}"}],overlays:[{name:"Dark Gray Reference",endpoint:"https://services.arcgisonline.com/arcgis/rest/services/Canvas/World_Dark_Gray_Reference/MapServer/tile/{z}/{y}/{x}"},{name:"Light Gray Reference",endpoint:"https://services.arcgisonline.com/arcgis/rest/services/Canvas/World_Light_Gray_Reference/MapServer/tile/{z}/{y}/{x}"},{name:"World Ocean Reference",endpoint:"https://services.arcgisonline.com/arcgis/rest/services/Ocean/World_Ocean_Reference/MapServer/tile/{z}/{y}/{x}"},{name:"World Boundaries & Places",endpoint:"https://services.arcgisonline.com/arcgis/rest/services/Reference/World_Boundaries_and_Places/MapServer/tile/{z}/{y}/{x}"},{name:"World Reference Overlay",endpoint:"https://services.arcgisonline.com/arcgis/rest/services/Reference/World_Reference_Overlay/MapServer/tile/{z}/{y}/{x}"},{name:"World Transportation",endpoint:"https://services.arcgisonline.com/arcgis/rest/services/Reference/World_Transportation/MapServer/tile/{z}/{y}/{x}"}]},{name:"CartoDB",link:"https://cartodb.com/basemaps/",datasets:[{name:"Positron",endpoint:"https://a.basemaps.cartocdn.com/light_all/{z}/{x}/{y}.png"},{name:"Dark Matter",endpoint:"https://a.basemaps.cartocdn.com/dark_all/{z}/{x}/{y}.png"},{name:"Positron (No Labels)",endpoint:"https://a.basemaps.cartocdn.com/light_nolabels/{z}/{x}/{y}.png"},{name:"Dark Matter (No Labels)",endpoint:"https://a.basemaps.cartocdn.com/dark_nolabels/{z}/{x}/{y}.png"}],overlays:[{name:"Positron Labels",endpoint:"https://a.basemaps.cartocdn.com/light_only_labels/{z}/{x}/{y}.png"},{name:"Dark Matter Labels",endpoint:"https://a.basemaps.cartocdn.com/dark_only_labels/{z}/{x}/{y}.png"}]},{name:"Stamen",link:"https://maps.stamen.com",datasets:[{name:"Toner",endpoint:"https://tile.stamen.com/toner/{z}/{x}/{y}.png",attribution:'Map tiles by <a href="https://stamen.com">Stamen Design</a>, under <a href="https://creativecommons.org/licenses/by/3.0">CC BY 3.0</a>. Data by <a href="https://openstreetmap.org">OpenStreetMap</a>, under <a href="https://www.openstreetmap.org/copyright">ODbL</a>.'},{name:"Terrain",endpoint:"https://tile.stamen.com/terrain/{z}/{x}/{y}.png"},{name:"Watercolor",endpoint:"https://tile.stamen.com/watercolor/{z}/{x}/{y}.png"}],overlays:[]},{name:"Mapbox",link:"https://a.tiles.mapbox.com/v3/mapbox/maps.html",datasets:[{name:"Blue Marble (January)",endpoint:"https://a.tiles.mapbox.com/v3/mapbox.blue-marble-topo-bathy-jan/{z}/{x}/{y}.png"},{name:"Blue Marble (July)",endpoint:"https://a.tiles.mapbox.com/v3/mapbox.blue-marble-topo-bathy-jul/{z}/{x}/{y}.png"},{name:"Blue Marble Topo & Bathy B/W (July)",endpoint:"https://a.tiles.mapbox.com/v3/mapbox.blue-marble-topo-bathy-jul-bw/{z}/{x}/{y}.png"},{name:"Control Room",endpoint:"https://a.tiles.mapbox.com/v3/mapbox.control-room/{z}/{x}/{y}.png"},{name:"Geography Class",endpoint:"https://a.tiles.mapbox.com/v3/mapbox.geography-class/{z}/{x}/{y}.png"},{name:"World Dark",endpoint:"https://a.tiles.mapbox.com/v3/mapbox.world-dark/{z}/{x}/{y}.png"},{name:"World Light",endpoint:"https:a.tiles.mapbox.com/v3/mapbox.world-light/{z}/{x}/{y}.png"},{name:"World Glass",endpoint:"https:a.tiles.mapbox.com/v3/mapbox.world-glass/{z}/{x}/{y}.png"},{name:"World Print",endpoint:"https:a.tiles.mapbox.com/v3/mapbox.world-print/{z}/{x}/{y}.png"},{name:"World Blue",endpoint:"https:a.tiles.mapbox.com/v3/mapbox.world-blue/{z}/{x}/{y}.png"}],overlays:[]}],f6e=u6e,zB="User";function tE(t){return t?`${t.group}: ${t.title}`:"-"}function nE(t,e){return t.find(n=>n.id===e)||null}function Nae(t="datasets"){const e=[];return f6e.forEach(n=>{n[t].forEach(r=>{e.push({id:`${n.name}-${r.name}`,group:n.name,attribution:n.link,title:r.name,url:r.endpoint})})}),e}const $ae=Nae("datasets"),d6e=Nae("overlays"),h6e=$ae[0].id;var p6e=function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,i){r.__proto__=i}||function(r,i){for(var o in i)Object.prototype.hasOwnProperty.call(i,o)&&(r[o]=i[o])},t(e,n)};return function(e,n){if(typeof n!="function"&&n!==null)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");t(e,n);function r(){this.constructor=e}e.prototype=n===null?Object.create(n):(r.prototype=n.prototype,new r)}}(),m6e=function(t){p6e(e,t);function e(){return t.call(this)||this}return e.prototype.getType=function(){return"text"},e.prototype.readFeature=function(n,r){return this.readFeatureFromText(LS(n),this.adaptOptions(r))},e.prototype.readFeatureFromText=function(n,r){return yt()},e.prototype.readFeatures=function(n,r){return this.readFeaturesFromText(LS(n),this.adaptOptions(r))},e.prototype.readFeaturesFromText=function(n,r){return yt()},e.prototype.readGeometry=function(n,r){return this.readGeometryFromText(LS(n),this.adaptOptions(r))},e.prototype.readGeometryFromText=function(n,r){return yt()},e.prototype.readProjection=function(n){return this.readProjectionFromText(LS(n))},e.prototype.readProjectionFromText=function(n){return this.dataProjection},e.prototype.writeFeature=function(n,r){return this.writeFeatureText(n,this.adaptOptions(r))},e.prototype.writeFeatureText=function(n,r){return yt()},e.prototype.writeFeatures=function(n,r){return this.writeFeaturesText(n,this.adaptOptions(r))},e.prototype.writeFeaturesText=function(n,r){return yt()},e.prototype.writeGeometry=function(n,r){return this.writeGeometryText(n,this.adaptOptions(r))},e.prototype.writeGeometryText=function(n,r){return yt()},e}(Gie);function LS(t){return typeof t=="string"?t:""}var g6e=function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,i){r.__proto__=i}||function(r,i){for(var o in i)Object.prototype.hasOwnProperty.call(i,o)&&(r[o]=i[o])},t(e,n)};return function(e,n){if(typeof n!="function"&&n!==null)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");t(e,n);function r(){this.constructor=e}e.prototype=n===null?Object.create(n):(r.prototype=n.prototype,new r)}}(),v6e={POINT:ql,LINESTRING:zh,POLYGON:td,MULTIPOINT:c2,MULTILINESTRING:pB,MULTIPOLYGON:mB},Fae="EMPTY",jae="Z",Bae="M",y6e="ZM",mn={START:0,TEXT:1,LEFT_PAREN:2,RIGHT_PAREN:3,NUMBER:4,COMMA:5,EOF:6},x6e={Point:"POINT",LineString:"LINESTRING",Polygon:"POLYGON",MultiPoint:"MULTIPOINT",MultiLineString:"MULTILINESTRING",MultiPolygon:"MULTIPOLYGON",GeometryCollection:"GEOMETRYCOLLECTION",Circle:"CIRCLE"},b6e=function(){function t(e){this.wkt=e,this.index_=-1}return t.prototype.isAlpha_=function(e){return e>="a"&&e<="z"||e>="A"&&e<="Z"},t.prototype.isNumeric_=function(e,n){var r=n!==void 0?n:!1;return e>="0"&&e<="9"||e=="."&&!r},t.prototype.isWhiteSpace_=function(e){return e==" "||e=="	"||e=="\r"||e==`
`},t.prototype.nextChar_=function(){return this.wkt.charAt(++this.index_)},t.prototype.nextToken=function(){var e=this.nextChar_(),n=this.index_,r=e,i;if(e=="(")i=mn.LEFT_PAREN;else if(e==",")i=mn.COMMA;else if(e==")")i=mn.RIGHT_PAREN;else if(this.isNumeric_(e)||e=="-")i=mn.NUMBER,r=this.readNumber_();else if(this.isAlpha_(e))i=mn.TEXT,r=this.readText_();else{if(this.isWhiteSpace_(e))return this.nextToken();if(e==="")i=mn.EOF;else throw new Error("Unexpected character: "+e)}return{position:n,value:r,type:i}},t.prototype.readNumber_=function(){var e,n=this.index_,r=!1,i=!1;do e=="."?r=!0:(e=="e"||e=="E")&&(i=!0),e=this.nextChar_();while(this.isNumeric_(e,r)||!i&&(e=="e"||e=="E")||i&&(e=="-"||e=="+"));return parseFloat(this.wkt.substring(n,this.index_--))},t.prototype.readText_=function(){var e,n=this.index_;do e=this.nextChar_();while(this.isAlpha_(e));return this.wkt.substring(n,this.index_--).toUpperCase()},t}(),_6e=function(){function t(e){this.lexer_=e,this.token_={position:0,type:mn.START},this.layout_=dn.XY}return t.prototype.consume_=function(){this.token_=this.lexer_.nextToken()},t.prototype.isTokenType=function(e){return this.token_.type==e},t.prototype.match=function(e){var n=this.isTokenType(e);return n&&this.consume_(),n},t.prototype.parse=function(){return this.consume_(),this.parseGeometry_()},t.prototype.parseGeometryLayout_=function(){var e=dn.XY,n=this.token_;if(this.isTokenType(mn.TEXT)){var r=n.value;r===jae?e=dn.XYZ:r===Bae?e=dn.XYM:r===y6e&&(e=dn.XYZM),e!==dn.XY&&this.consume_()}return e},t.prototype.parseGeometryCollectionText_=function(){if(this.match(mn.LEFT_PAREN)){var e=[];do e.push(this.parseGeometry_());while(this.match(mn.COMMA));if(this.match(mn.RIGHT_PAREN))return e}throw new Error(this.formatErrorMessage_())},t.prototype.parsePointText_=function(){if(this.match(mn.LEFT_PAREN)){var e=this.parsePoint_();if(this.match(mn.RIGHT_PAREN))return e}throw new Error(this.formatErrorMessage_())},t.prototype.parseLineStringText_=function(){if(this.match(mn.LEFT_PAREN)){var e=this.parsePointList_();if(this.match(mn.RIGHT_PAREN))return e}throw new Error(this.formatErrorMessage_())},t.prototype.parsePolygonText_=function(){if(this.match(mn.LEFT_PAREN)){var e=this.parseLineStringTextList_();if(this.match(mn.RIGHT_PAREN))return e}throw new Error(this.formatErrorMessage_())},t.prototype.parseMultiPointText_=function(){if(this.match(mn.LEFT_PAREN)){var e=void 0;if(this.token_.type==mn.LEFT_PAREN?e=this.parsePointTextList_():e=this.parsePointList_(),this.match(mn.RIGHT_PAREN))return e}throw new Error(this.formatErrorMessage_())},t.prototype.parseMultiLineStringText_=function(){if(this.match(mn.LEFT_PAREN)){var e=this.parseLineStringTextList_();if(this.match(mn.RIGHT_PAREN))return e}throw new Error(this.formatErrorMessage_())},t.prototype.parseMultiPolygonText_=function(){if(this.match(mn.LEFT_PAREN)){var e=this.parsePolygonTextList_();if(this.match(mn.RIGHT_PAREN))return e}throw new Error(this.formatErrorMessage_())},t.prototype.parsePoint_=function(){for(var e=[],n=this.layout_.length,r=0;r<n;++r){var i=this.token_;if(this.match(mn.NUMBER))e.push(i.value);else break}if(e.length==n)return e;throw new Error(this.formatErrorMessage_())},t.prototype.parsePointList_=function(){for(var e=[this.parsePoint_()];this.match(mn.COMMA);)e.push(this.parsePoint_());return e},t.prototype.parsePointTextList_=function(){for(var e=[this.parsePointText_()];this.match(mn.COMMA);)e.push(this.parsePointText_());return e},t.prototype.parseLineStringTextList_=function(){for(var e=[this.parseLineStringText_()];this.match(mn.COMMA);)e.push(this.parseLineStringText_());return e},t.prototype.parsePolygonTextList_=function(){for(var e=[this.parsePolygonText_()];this.match(mn.COMMA);)e.push(this.parsePolygonText_());return e},t.prototype.isEmptyGeometry_=function(){var e=this.isTokenType(mn.TEXT)&&this.token_.value==Fae;return e&&this.consume_(),e},t.prototype.formatErrorMessage_=function(){return"Unexpected `"+this.token_.value+"` at position "+this.token_.position+" in `"+this.lexer_.wkt+"`"},t.prototype.parseGeometry_=function(){var e=this.token_;if(this.match(mn.TEXT)){var n=e.value;this.layout_=this.parseGeometryLayout_();var r=this.isEmptyGeometry_();if(n=="GEOMETRYCOLLECTION"){if(r)return new jT([]);var i=this.parseGeometryCollectionText_();return new jT(i)}else{var o=v6e[n];if(!o)throw new Error("Invalid geometry type: "+n);var a=void 0;if(r)n=="POINT"?a=[NaN,NaN]:a=[];else switch(n){case"POINT":{a=this.parsePointText_();break}case"LINESTRING":{a=this.parseLineStringText_();break}case"POLYGON":{a=this.parsePolygonText_();break}case"MULTIPOINT":{a=this.parseMultiPointText_();break}case"MULTILINESTRING":{a=this.parseMultiLineStringText_();break}case"MULTIPOLYGON":{a=this.parseMultiPolygonText_();break}}return new o(a,this.layout_)}}throw new Error(this.formatErrorMessage_())},t}(),zae=function(t){g6e(e,t);function e(n){var r=t.call(this)||this,i=n||{};return r.splitCollection_=i.splitCollection!==void 0?i.splitCollection:!1,r}return e.prototype.parse_=function(n){var r=new b6e(n),i=new _6e(r);return i.parse()},e.prototype.readFeatureFromText=function(n,r){var i=this.readGeometryFromText(n,r),o=new zc;return o.setGeometry(i),o},e.prototype.readFeaturesFromText=function(n,r){var i=[],o=this.readGeometryFromText(n,r);this.splitCollection_&&o.getType()=="GeometryCollection"?i=o.getGeometriesArray():i=[o];for(var a=[],s=0,l=i.length;s<l;++s){var c=new zc;c.setGeometry(i[s]),a.push(c)}return a},e.prototype.readGeometryFromText=function(n,r){var i=this.parse_(n);return BT(i,!1,r)},e.prototype.writeFeatureText=function(n,r){var i=n.getGeometry();return i?this.writeGeometryText(i,r):""},e.prototype.writeFeaturesText=function(n,r){if(n.length==1)return this.writeFeatureText(n[0],r);for(var i=[],o=0,a=n.length;o<a;++o)i.push(n[o].getGeometry());var s=new jT(i);return this.writeGeometryText(s,r)},e.prototype.writeGeometryText=function(n,r){return Vae(BT(n,!0,r))},e}(m6e);function Uae(t){var e=t.getCoordinates();return e.length===0?"":e.join(" ")}function w6e(t){for(var e=[],n=t.getPoints(),r=0,i=n.length;r<i;++r)e.push("("+Uae(n[r])+")");return e.join(",")}function S6e(t){for(var e=[],n=t.getGeometries(),r=0,i=n.length;r<i;++r)e.push(Vae(n[r]));return e.join(",")}function UB(t){for(var e=t.getCoordinates(),n=[],r=0,i=e.length;r<i;++r)n.push(e[r].join(" "));return n.join(",")}function O6e(t){for(var e=[],n=t.getLineStrings(),r=0,i=n.length;r<i;++r)e.push("("+UB(n[r])+")");return e.join(",")}function Wae(t){for(var e=[],n=t.getLinearRings(),r=0,i=n.length;r<i;++r)e.push("("+UB(n[r])+")");return e.join(",")}function C6e(t){for(var e=[],n=t.getPolygons(),r=0,i=n.length;r<i;++r)e.push("("+Wae(n[r])+")");return e.join(",")}function T6e(t){var e=t.getLayout(),n="";return(e===dn.XYZ||e===dn.XYZM)&&(n+=jae),(e===dn.XYM||e===dn.XYZM)&&(n+=Bae),n}var E6e={Point:Uae,LineString:UB,Polygon:Wae,MultiPoint:w6e,MultiLineString:O6e,MultiPolygon:C6e,GeometryCollection:S6e};function Vae(t){var e=t.getType(),n=E6e[e],r=n(t),i=x6e[e];if(typeof t.getFlatCoordinates=="function"){var o=T6e(t);o.length>0&&(i+=" "+o)}return r.length===0?i+" "+Fae:i+"("+r+")"}class P6e extends Error{}const Gae={separator:",",comment:"#",quote:'"',escape:"\\",trim:!0,nanToken:"NaN",trueToken:"true",falseToken:"false"};function Hae(t,e){return new M6e(e).parse(t)}let M6e=class{constructor(e){Yt(this,"options");this.options={...Gae,...e},this.parseLine=this.parseLine.bind(this)}parse(e){return this.parseText(e).map(this.parseLine)}parseText(e){const{comment:n,trim:r}=this.options;return e.split(`
`).map((i,o)=>(r&&(i=i.trim()),[i,o])).filter(([i,o])=>i.trim()!==""&&!i.startsWith(n))}parseLine([e,n]){const{separator:r,quote:i,escape:o}=this.options;let a=!1;const s=[];let l=0,c=0;for(;c<e.length;c++){const u=e[c];u===o?c++:a?u===i&&(a=!1):u===i?a=!0:u===r&&(this.collectValue(e,l,c,s),l=c+1)}if(a)throw k6e(`missing quote character [${this.options.quote}]`,n,l);return this.collectValue(e,l,c,s),s}collectValue(e,n,r,i){const o=e.slice(n,r);i.push(this.parseToken(o))}parseToken(e){const n=this.options;if(n.trim&&(e=e.trim()),e==="")return null;if(e.startsWith(n.quote))e=e.substring(1,e.length-1);else{if(e===n.trueToken)return!0;if(e===n.falseToken)return!1;if(e===n.nanToken)return Number.NaN;const r=Number(e);if(!Number.isNaN(r))return r}return A6e(e,n.escape)}};function k6e(t,e,n){return new P6e(`line ${e+1}, column ${n+1}: ${t}`)}function A6e(t,e){let n=t.indexOf(e);if(n<0)return t;let r=0,i="";for(;n<t.length;n++)t[n]===e&&(i+=t.substring(r,n)+t.substring(n+1,n+2),n+=2,r=n);return i+=t.substring(r,t.length),i}const R6e=["Point","LineString","Polygon","MultiPoint","MultiLineString","MultiPolygon","GeometryCollection"].map(t=>t.toLowerCase());function gH(t){if(t=t.trim(),t==="")return"csv";if(t[0]==="{")return"geojson";const e=t.substring(0,20).toLowerCase();return R6e.find(r=>e.startsWith(r)&&(e.length===r.length||`
	 (`.indexOf(e[r.length])>=0))?"wkt":"csv"}function DC(t){return t.split(",").map(e=>e.trim().toLowerCase()).filter(e=>e!=="")}const I6e=t=>{if(t.trim()!=="")try{Hae(t)}catch(e){return console.error(e),`${e}`}return null},qae={name:"Text/CSV",fileExt:".txt,.csv",checkError:I6e},O3={...Gae,xNames:"longitude, lon, x",yNames:"latitude, lat, y",forceGeometry:!1,geometryNames:"geometry, geom",timeNames:"time, date, datetime, date-time",groupNames:"group, cruise, station, type",groupPrefix:"Group-",labelNames:"label, name, title, id",labelPrefix:"Place-"};let D6e=0,L6e=0;function N6e(t,e){const n=Hae(t,e);if(n.length<2)throw new Error(fe.get("Missing header line in CSV"));for(const S of n[0])if(typeof S!="string"||S==="")throw new Error(fe.get("Invalid header line in CSV"));const r=n[0].map(S=>S),i=r.map(S=>S.toLowerCase()),o=r.length;for(const S of n)if(S.length!==o)throw new Error(fe.get("All rows must have same length"));const a=$6e(i),s=sm(a,e.groupNames),l=sm(a,e.labelNames),c=sm(a,e.timeNames),u=sm(a,e.xNames),f=sm(a,e.yNames);let d=sm(a,e.geometryNames);if(e.forceGeometry||u<0||f<0||u===f){if(d<0)throw new Error(fe.get("No geometry column(s) found"))}else d=-1;let p=e.groupPrefix.trim();p===""&&(p=O3.groupPrefix);let m=e.labelPrefix.trim();m===""&&(m=O3.labelPrefix);let g="";if(s===-1){const S=++D6e;g=`${p}${S}`}const v=new zae,y={};let x=1,b=0,_=tp(0);for(;x<n.length;x++){const S=n[x];let O="";c>=0&&(O=`${S[c]}`),s>=0&&(g=`${S[s]}`);let C=y[g];C||(C=vB(g,[]),y[g]=C,_=tp(b),b++);let E=null;if(d>=0){if(typeof S[d]=="string")try{E=v.readGeometry(t)}catch{}}else{const P=S[u],R=S[f];typeof P=="number"&&Number.isFinite(P)&&typeof R=="number"&&Number.isFinite(R)&&(E=new ql([P,R]))}if(E===null)throw new Error(fe.get(`Invalid geometry in data row ${x}`));const k={};S.forEach((P,R)=>{if(R!==u&&R!==f&&R!==d){const T=r[R];k[T]=P}});let I;if(l>=0)I=`${S[l]}`;else{const P=++L6e;I=`${m}${P}`}O!==""&&(k.time=O),k.color||(k.color=_),k.label||(k.label=I),k.source||(k.source="CSV"),C.features.push(yB(E,k))}return Object.getOwnPropertyNames(y).map(S=>y[S])}function $6e(t){const e={};for(let n=0;n<t.length;n++)e[t[n].toLowerCase()]=n;return e}function sm(t,e){const n=DC(e);for(const r of n){const i=t[r];if(typeof i=="number")return i}return-1}const F6e=t=>{if(t.trim()!=="")try{JSON.parse(t)}catch(e){return console.error(e),`${e}`}return null},Xae={name:"GeoJSON",fileExt:".json,.geojson",checkError:F6e},C3={groupNames:"group, cruise, station, type",groupPrefix:"Group-",labelNames:"label, name, title, id",labelPrefix:"Place-",timeNames:"time, date, datetime, date-time"};let j6e=0,B6e=0;function z6e(t,e){const n=DC(e.groupNames||"");let r=e.groupPrefix.trim();r===""&&(r=C3.groupPrefix);const i=DC(e.labelNames||"");let o=e.labelPrefix.trim();o===""&&(o=C3.labelPrefix);const a=DC(e.timeNames||""),s=new Ip;let l;try{l=s.readFeatures(t)}catch{try{const d=s.readGeometry(t);l=[new zc(d)]}catch{throw new Error(fe.get("Invalid GeoJSON"))}}const c={};let u=0;return l.forEach(f=>{const d=f.getProperties(),h=f.getGeometry();if(h){let p="",m="",g="",v=tp(0);if(d){const b={};Object.getOwnPropertyNames(d).forEach(_=>{b[_.toLowerCase()]=d[_]}),p=iR(b,a,p),g=iR(b,i,g),m=iR(b,n,m)}if(m===""){const b=++j6e;m=`${r}-${b}`}if(g===""){const b=++B6e;g=`${o}-${b}`}let y=c[m];y||(y=vB(m,[]),c[m]=y,v=tp(u),u++);const x={...d};p!==""&&(x.time=p),x.color||(x.color=v),x.label||(x.label=g),x.source||(x.source="GeoJSON"),y.features.push(yB(h,x))}}),Object.getOwnPropertyNames(c).map(f=>c[f])}function iR(t,e,n){if(n===""){for(const r of e)if(t[r]==="string")return t[r]}return n}const U6e=t=>null,Qae={name:"WKT",fileExt:".txt,.wkt",checkError:U6e},T3={group:"",groupPrefix:"Group-",label:"",labelPrefix:"Place-",time:gy(new Date().getTime())};let W6e=0,V6e=0;function G6e(t,e){let n=e.groupPrefix.trim();n===""&&(n=T3.groupPrefix);let r=e.group.trim();if(r===""){const s=++W6e;r=`${n}${s}`}let i=e.labelPrefix.trim();i===""&&(i=T3.labelPrefix);let o=e.label.trim();if(o===""){const s=++V6e;o=`${i}${s}`}const a=e.time.trim();try{const s=new zae().readGeometry(t);let l={color:tp(Math.floor(1e3*Math.random())),label:o,source:"WKT"};a!==""&&(l={time:a,...l});const c=[yB(s,l)];return[vB(r,c)]}catch{throw new Error(fe.get("Invalid Geometry WKT"))}}function vy(t){return H6e("localStorage",t)}function H6e(t,e){try{const n=window[t],r="__storage_test__";return n.setItem(r,r),n.removeItem(r),new q6e(n,e)}catch{return null}}class q6e{constructor(e,n){Yt(this,"nativeStorage");Yt(this,"brandingName");this.nativeStorage=e,this.brandingName=n}getItem(e,n,r,i){const o=this.nativeStorage.getItem(this.makeKey(e));if(o!==null)try{const a=r?r(o):o;return i?i(a):a}catch(a){console.error(`Failed parsing user setting "${e}": ${a}`)}return typeof n>"u"?null:n}getObjectItem(e,n){return this.getItem(e,n,r=>JSON.parse(r))}getBooleanProperty(e,n,r){this.getProperty(e,n,r,i=>i==="true")}getIntProperty(e,n,r){this.getProperty(e,n,r,parseInt)}getStringProperty(e,n,r){this.getProperty(e,n,r,i=>i)}getArrayProperty(e,n,r,i){this.getProperty(e,n,r,o=>{const a=JSON.parse(o);if(Array.isArray(a))return a;const s=r[e];return Array.isArray(s)?s:[]},i)}getObjectProperty(e,n,r){this.getProperty(e,n,r,i=>{const o=JSON.parse(i),a=r[e],s={...a,...o};return Object.getOwnPropertyNames(o).forEach(l=>{const c=a[l],u=o[l];nG(c)&&nG(u)&&(s[l]={...c,...u})}),s})}getProperty(e,n,r,i,o){n[e]=this.getItem(e,r[e],i,o)}setItem(e,n,r){if(typeof n>"u"||n===null)this.nativeStorage.removeItem(this.makeKey(e));else{const i=r?r(n):n+"";this.nativeStorage.setItem(this.makeKey(e),i)}}setObjectItem(e,n){this.setItem(e,n,r=>JSON.stringify(r))}setPrimitiveProperty(e,n){this.setItem(e,n[e])}setArrayProperty(e,n){this.setObjectItem(e,n[e])}setObjectProperty(e,n){this.setObjectItem(e,n[e])}makeKey(e){return`xcube.${this.brandingName}.${e}`}}function X6e(t){const e=vy(Kt.instance.name);if(e)try{e.setObjectItem("userServers",t)}catch(n){console.warn(`failed to store user servers: ${n}`)}}function Q6e(){const t=vy(Kt.instance.name);if(t)try{return t.getObjectItem("userServers",[])}catch(e){console.warn(`failed to load user servers: ${e}`)}return[]}function Y6e(t){const e=vy(Kt.instance.name);if(e)try{e.setObjectItem("userVariables",t)}catch(n){console.warn(`failed to store user variables: ${n}`)}}function K6e(){const t=vy(Kt.instance.name);if(t)try{return t.getObjectItem("userVariables",{})}catch(e){console.warn(`failed to load user variables: ${e}`)}return{}}function ll(t){const e=vy(Kt.instance.name);if(e)try{e.setPrimitiveProperty("locale",t),e.setPrimitiveProperty("privacyNoticeAccepted",t),e.setPrimitiveProperty("autoShowTimeSeries",t),e.setPrimitiveProperty("timeSeriesIncludeStdev",t),e.setPrimitiveProperty("timeSeriesChartTypeDefault",t),e.setPrimitiveProperty("timeSeriesUseMedian",t),e.setPrimitiveProperty("timeAnimationInterval",t),e.setPrimitiveProperty("timeChunkSize",t),e.setPrimitiveProperty("sidebarOpen",t),e.setPrimitiveProperty("sidebarPanelId",t),e.setPrimitiveProperty("volumeRenderMode",t),e.setObjectProperty("infoCardElementStates",t),e.setPrimitiveProperty("imageSmoothingEnabled",t),e.setPrimitiveProperty("mapProjection",t),e.setPrimitiveProperty("selectedBaseMapId",t),e.setPrimitiveProperty("selectedOverlayId",t),e.setArrayProperty("userBaseMaps",t),e.setArrayProperty("userOverlays",t),e.setArrayProperty("userColorBars",t),e.setPrimitiveProperty("userDrawnPlaceGroupName",t),e.setPrimitiveProperty("datasetLocateMode",t),e.setPrimitiveProperty("placeLocateMode",t),e.setPrimitiveProperty("exportTimeSeries",t),e.setPrimitiveProperty("exportTimeSeriesSeparator",t),e.setPrimitiveProperty("exportPlaces",t),e.setPrimitiveProperty("exportPlacesAsCollection",t),e.setPrimitiveProperty("exportZipArchive",t),e.setPrimitiveProperty("exportFileName",t),e.setPrimitiveProperty("userPlacesFormatName",t),e.setObjectProperty("userPlacesFormatOptions",t)}catch(n){console.warn(`failed to store user settings: ${n}`)}}function Z6e(t){const e=vy(Kt.instance.name);if(e){const n={...t};try{e.getStringProperty("locale",n,t),e.getBooleanProperty("privacyNoticeAccepted",n,t),e.getBooleanProperty("autoShowTimeSeries",n,t),e.getBooleanProperty("timeSeriesIncludeStdev",n,t),e.getStringProperty("timeSeriesChartTypeDefault",n,t),e.getBooleanProperty("timeSeriesUseMedian",n,t),e.getIntProperty("timeAnimationInterval",n,t),e.getIntProperty("timeChunkSize",n,t),e.getBooleanProperty("sidebarOpen",n,t),e.getStringProperty("sidebarPanelId",n,t),e.getStringProperty("volumeRenderMode",n,t),e.getObjectProperty("infoCardElementStates",n,t),e.getBooleanProperty("imageSmoothingEnabled",n,t),e.getStringProperty("mapProjection",n,t),e.getStringProperty("selectedBaseMapId",n,t),e.getStringProperty("selectedOverlayId",n,t),e.getArrayProperty("userBaseMaps",n,t),e.getArrayProperty("userOverlays",n,t),e.getArrayProperty("userColorBars",n,t,J6e),e.getStringProperty("userDrawnPlaceGroupName",n,t),e.getStringProperty("datasetLocateMode",n,t),e.getStringProperty("placeLocateMode",n,t),e.getBooleanProperty("exportTimeSeries",n,t),e.getStringProperty("exportTimeSeriesSeparator",n,t),e.getBooleanProperty("exportPlaces",n,t),e.getBooleanProperty("exportPlacesAsCollection",n,t),e.getBooleanProperty("exportZipArchive",n,t),e.getStringProperty("exportFileName",n,t),e.getStringProperty("userPlacesFormatName",n,t),e.getObjectProperty("userPlacesFormatOptions",n,t)}catch(r){console.warn(`Failed to load user settings: ${r}`)}return n}else console.warn("User settings not found or access denied");return t}const vH={node:"continuous",continuous:"continuous",bound:"stepwise",stepwise:"stepwise",key:"categorical",categorical:"categorical"};function J6e(t){if(Array.isArray(t))return t.map(e=>({...e,type:eWe(e.type)}))}function eWe(t){return Mp(t)&&t in vH?vH[t]:"continuous"}const tWe=[250,500,1e3,2500],nWe=["info","timeSeries","stats","volume"];function rWe(){const t=Kt.instance.branding,e={selectedDatasetId:null,selectedVariableName:null,selectedDataset2Id:null,selectedVariable2Name:null,selectedPlaceGroupIds:[],selectedPlaceId:null,selectedUserPlaceId:null,selectedServerId:Kt.instance.server.id,selectedTime:null,selectedTimeRange:null,timeSeriesUpdateMode:"add",timeAnimationActive:!1,timeAnimationInterval:1e3,timeChunkSize:20,autoShowTimeSeries:!0,timeSeriesChartTypeDefault:"line",timeSeriesIncludeStdev:!0,timeSeriesUseMedian:t.defaultAgg==="median",userDrawnPlaceGroupName:"",userPlacesFormatName:"csv",userPlacesFormatOptions:{csv:{...O3},geojson:{...C3},wkt:{...T3}},flyTo:null,activities:{},locale:"en",dialogOpen:{},privacyNoticeAccepted:!1,mapInteraction:"Select",lastMapInteraction:"Select",layerVisibilities:{baseMap:!0,datasetRgb:!1,datasetVariable:!0,datasetVariable2:!0,datasetBoundary:!1,datasetPlaces:!0,userPlaces:!0,overlay:!0},variableCompareMode:!1,mapPointInfoBoxEnabled:!1,datasetLocateMode:"panAndZoom",placeLocateMode:"panAndZoom",layerMenuOpen:!1,sidebarPosition:2*Math.max(window.innerWidth,window.innerHeight)/3,sidebarOpen:!1,sidebarPanelId:"info",volumeRenderMode:"mip",volumeStates:{},infoCardElementStates:{dataset:{visible:!0,viewMode:"text"},variable:{visible:!0,viewMode:"text"},place:{visible:!0,viewMode:"text"}},mapProjection:t.mapProjection||aae,imageSmoothingEnabled:!1,selectedBaseMapId:h6e,selectedOverlayId:null,userBaseMaps:[],userOverlays:[],userColorBars:[],exportTimeSeries:!0,exportTimeSeriesSeparator:"TAB",exportPlaces:!0,exportPlacesAsCollection:!0,exportZipArchive:!0,exportFileName:"export"};return Z6e(e)}const Ga={},iWe="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQBAMAAADt3eJSAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAAAGUExURcDAwP///ytph7QAAAAJcEhZcwAADsMAAA7DAcdvqGQAAAAUSURBVBjTYwABQSCglEENMxgYGAAynwRB8BEAgQAAAABJRU5ErkJggg==",Yae=new Image;Yae.src=iWe;const E3="_alpha",P3="_r";function oWe(t){let e=t;const n=e.endsWith(E3);n&&(e=e.slice(0,e.length-E3.length));const r=e.endsWith(P3);return r&&(e=e.slice(0,e.length-P3.length)),{baseName:e,isAlpha:n,isReversed:r}}function rE(t){let e=t.baseName;return t.isReversed&&(e+=P3),t.isAlpha&&(e+=E3),e}function aWe(t,e,n){lWe(t,e).then(r=>{Promise.resolve(createImageBitmap(r)).then(i=>{const o=n.getContext("2d");if(o!==null){const a=o.createPattern(Yae,"repeat");a!==null?o.fillStyle=a:o.fillStyle="#ffffff",o.fillRect(0,0,n.width,n.height),o.drawImage(i,0,0,n.width,n.height)}})})}function sWe(t,e){return new Promise((n,r)=>{const i=new Image,o=t.imageData;if(!o){n(i);return}i.onload=()=>{n(i)},i.onerror=(a,s,l,c,u)=>{r(u)},i.src=`data:image/png;base64,${o}`})}function lWe(t,e){return sWe(t).then(n=>{const r=cWe(t,e,n);if(r!==null)return r;throw new Error("failed to retrieve 2d context")})}function cWe(t,e,n){const r=document.createElement("canvas");r.width=n.width||1,r.height=n.height||1;const i=r.getContext("2d");if(i===null)return null;i.drawImage(n,0,0);let a=i.getImageData(0,0,r.width,r.height).data;if(t.isReversed){const s=new Uint8ClampedArray(a.length);for(let l=0;l<a.length;l+=4){const c=a.length-l-4;s[c]=a[l],s[c+1]=a[l+1],s[c+2]=a[l+2],s[c+3]=a[l+3]}a=s}if(t.isAlpha){const s=512/a.length;for(let l=0;l<a.length/2;l+=4)a[l+3]=s*l}if(e<1)for(let s=0;s<a.length;s+=4)a[s+3]*=e;return new ImageData(a,a.length/4,1)}const tw=t=>t.controlState.selectedDatasetId,yy=t=>t.controlState.selectedVariableName,uWe=t=>t.controlState.selectedDataset2Id,Kae=t=>t.controlState.selectedVariable2Name,WB=t=>t.controlState.selectedPlaceGroupIds,xy=t=>t.controlState.selectedPlaceId,by=t=>t.controlState.selectedTime,fWe=t=>t.controlState.selectedServerId,dWe=t=>t.controlState.activities,S2=t=>t.controlState.timeAnimationActive,nw=t=>t.controlState.imageSmoothingEnabled,hWe=t=>t.controlState.userBaseMaps,pWe=t=>t.controlState.userOverlays,VB=t=>t.controlState.selectedBaseMapId,GB=t=>t.controlState.selectedOverlayId,mWe=t=>!!t.controlState.layerVisibilities.baseMap,gWe=t=>!!t.controlState.layerVisibilities.datasetBoundary,vWe=t=>!!t.controlState.layerVisibilities.datasetVariable,yWe=t=>!!t.controlState.layerVisibilities.datasetVariable2,xWe=t=>!!t.controlState.layerVisibilities.datasetRgb,bWe=t=>!!t.controlState.layerVisibilities.datasetRgb2,_We=t=>!!t.controlState.layerVisibilities.datasetPlaces,Zae=t=>!!t.controlState.layerVisibilities.userPlaces,wWe=t=>!!t.controlState.layerVisibilities.overlay,SWe=t=>t.controlState.layerVisibilities,Jae=t=>t.controlState.infoCardElementStates,wd=t=>t.controlState.mapProjection,OWe=t=>t.controlState.timeChunkSize,CWe=t=>t.controlState.userPlacesFormatName,TWe=t=>t.controlState.userPlacesFormatOptions.csv,EWe=t=>t.controlState.userPlacesFormatOptions.geojson,PWe=t=>t.controlState.userPlacesFormatOptions.wkt,Dp=t=>t.controlState.userColorBars,MWe=t=>Kt.instance.branding.allowUserVariables,kWe=()=>"variable",AWe=()=>"variable2",RWe=()=>"rgb",IWe=()=>"rgb2",DWe=()=>13,LWe=()=>12,NWe=()=>11,$We=()=>10,qr=at(J1,tw,Ub),Sd=at(J1,uWe,Ub),FWe=at(qr,t=>t&&t.variables||[]),jWe=at(qr,t=>t?gB(t)[1]:[]),ese=(t,e)=>!t||!e?null:s3(t,e),vo=at(qr,yy,ese),Su=at(Sd,Kae,ese),tse=t=>t&&(t.title||t.name),BWe=at(vo,tse),zWe=at(Su,tse),nse=t=>t&&t.units||"-",UWe=at(vo,nse),WWe=at(Su,nse),rse=t=>t&&t.colorBarName||"viridis",O2=at(vo,rse),C2=at(Su,rse),ise=t=>t?[t.colorBarMin,t.colorBarMax]:[0,1],ose=at(vo,ise),ase=at(Su,ise),sse=t=>(t&&t.colorBarNorm)==="log"?"log":"lin",lse=at(vo,sse),cse=at(Su,sse),T2=at(Dp,o6e,(t,e)=>{const n={title:doe,description:"User-defined color bars.",names:t.map(i=>i.id)},r={};return t.forEach(({id:i,imageData:o})=>{o&&(r[i]=o)}),e?{...e,groups:[n,...e.groups],images:{...e.images,...r}}:{groups:[n],images:r,customColorMaps:{}}}),use=(t,e,n)=>{const r=oWe(t),{baseName:i}=r,o=e.images[i],a=n.find(s=>s.id===i);if(a){const s=a.type,l=poe(a.code);return{...r,imageData:o,type:s,colorRecords:l}}else{const s=e.customColorMaps[i];if(s){const l=s.type,c=s.colorRecords;return{...r,imageData:o,type:l,colorRecords:c}}}return{...r,imageData:o}},HB=at(O2,T2,Dp,use),fse=at(C2,T2,Dp,use),dse=(t,e,n)=>{const{baseName:r}=t,i=n.find(o=>o.id===r);if(i){const o=poe(i.code);if(o)return JSON.stringify({name:e,type:i.type,colors:o.map(a=>[a.value,a.color])})}return null},VWe=at(HB,O2,Dp,dse),GWe=at(fse,C2,Dp,dse),hse=t=>!t||typeof t.opacity!="number"?1:t.opacity,pse=at(vo,hse),mse=at(Su,hse),HWe=at(qr,t=>t!==null?coe(t):null),qWe=at(qr,t=>t!==null&&t.rgbSchema||null),XWe=at(Sd,t=>t!==null&&t.rgbSchema||null),gse=at(qr,t=>t&&t.placeGroups||[]),E2=at(gse,ew,(t,e)=>t.concat(e));function vse(t,e){const n=[];return e!==null&&e.length>0&&t.forEach(r=>{e.indexOf(r.id)>-1&&n.push(r)}),n}const QWe=at(ew,WB,Zae,(t,e)=>{const n={},r=new Set(e||[]);return t.forEach(i=>{n[i.id]=r.has(i.id)}),n}),yse=at(gse,WB,vse),_y=at(E2,WB,vse),YWe=at(_y,t=>t.map(e=>e.title||e.id).join(", ")),rw=at(_y,t=>{const e=t.map(n=>uy(n)?n.features:[]);return[].concat(...e)}),xse=at(rw,xy,(t,e)=>t.find(n=>n.id===e)||null),iw=at(_y,xy,(t,e)=>t.length===0||e===null?null:aFe(t,e)),KWe=at(tw,yy,xse,(t,e,n)=>{if(t&&e){if(!n)return`${t}-${e}-all`;if(n.geometry.type==="Polygon"||n.geometry.type==="MultiPolygon")return`${t}-${e}-${n.id}`}return null}),bse=at(Iae,tw,yy,xy,(t,e,n,r)=>{if(!e||!n||!r)return!1;for(const i of t)for(const o of i.timeSeriesArray){const a=o.source;if(a.datasetId===e&&a.variableName===n&&a.placeId===r)return!1}return!0}),ZWe=at(Iae,E2,(t,e)=>{const n={};return xB(e,(r,i)=>{for(const o of t)if(o.timeSeriesArray.find(a=>a.source.placeId===i.id)){n[i.id]=u2(r,i);break}}),n}),_se=at(tw,yy,by,xy,(t,e,n,r)=>!!(t&&e&&n&&r)),JWe=at(l6e,E2,(t,e)=>{const n=[];return t.forEach(r=>{const i=r.source.placeInfo.place.id;xB(e,(o,a)=>{if(a.id===i){const s=u2(o,a);n.push({...r,source:{...r.source,placeInfo:s}})}})}),n}),eVe=at(_y,t=>{const e=[];return xB(t,(n,r)=>{e.push(u2(n,r).label)}),e}),tVe=at(vo,OWe,(t,e)=>{if(t&&t.timeChunkSize){const n=t.timeChunkSize;return n*Math.ceil(e/n)}return e}),wse=t=>t&&loe(t)||null,wy=at(qr,wse),nVe=at(Sd,wse),Sse=t=>t&&t.attributions||null,qB=at(qr,Sse),rVe=at(Sd,Sse),Ose=t=>t===null||t.coordinates.length===0?null:t.coordinates,M3=at(wy,Ose),iVe=at(wy,Ose),Cse=(t,e)=>t===null||e===null?-1:uae(e,t),Tse=at(by,M3,Cse),oVe=at(by,iVe,Cse),Ese=(t,e,n)=>t===null?null:n&&e>-1?n.labels[e]:new Date(t).toISOString(),Sy=at(by,Tse,wy,Ese),aVe=at(by,oVe,nVe,Ese);function sVe(t,e){if(t!==$B){const n=typeof e=="number"?e+1:20;return new LB({tileSize:[256,256],origin:[-180,90],extent:[-180,-90,180,90],resolutions:Array.from({length:n},(r,i)=>180/256/Math.pow(2,i))})}}function lVe(t,e,n,r,i,o,a,s,l){return new hy({url:t,projection:e,tileGrid:n,attributions:r||void 0,transition:i?0:250,imageSmoothing:o,tileLoadFunction:a,maxZoom:l})}function cVe(t){if(t)return(e,n)=>{e instanceof CB&&(t.getView().getInteracting()?t.once("moveend",function(){e.getImage().src=n}):e.getImage().src=n)}}const uVe=bFe(cVe,{serializer:t=>{const e=t[0];if(e){const n=e.getTarget();return typeof n=="string"?n:n&&n.id||"map"}return""}});function fVe(){const t=Ga.map;return uVe(t)}function Pse(t,e,n,r,i,o,a,s,l,c,u,f,d=10){s!==null&&(o=[...o,["time",s]]);const h=sy(e,o);typeof i=="number"&&(i+=3);const p=sVe(c,i),m=lVe(h,c,p,u,l,f,fVe(),r,i),g=c===py?n:zie(n,"EPSG:4326",c);return console.log("extent:",n,g),w.jsx(cae,{id:t,source:m,extent:g,zIndex:d,opacity:a})}const dVe=at(qr,wd,gWe,(t,e,n)=>{if(!t||!n)return null;let r=t.geometry;if(!r)if(t.bbox){const[a,s,l,c]=t.bbox;r={type:"Polygon",coordinates:[[[a,s],[l,s],[l,c],[a,c],[a,s]]]}}else return console.warn(`Dataset ${t.id} has no bbox!`),null;const i=new Y1({features:new Ip({dataProjection:py,featureProjection:e}).readFeatures({type:"Feature",geometry:r})}),o=new Il({stroke:new Xl({color:"orange",width:3,lineDash:[2,4]})});return w.jsx(v2,{id:`${t.id}.bbox`,source:i,style:o,zIndex:16,opacity:.5})}),pi=at(Dae,fWe,(t,e)=>{if(t.length===0)throw new Error("internal error: no servers configured");const n=t.find(r=>r.id===e);if(!n)throw new Error(`internal error: server with ID "${e}" not found`);return n}),Mse=(t,e,n,r,i,o,a,s,l,c,u,f,d,h,p,m)=>{if(!e||!i||!u)return null;const g=[["crs",p],["vmin",`${a[0]}`],["vmax",`${a[1]}`],["cmap",l||o]];return s==="log"&&g.push(["norm",s]),Pse(f,Ase(t.url,e,i),e.bbox,i.tileLevelMin,i.tileLevelMax,g,c,n,h,p,r,m,d)},hVe=at(pi,qr,Sy,qB,vo,O2,ose,lse,VWe,pse,vWe,kWe,DWe,S2,wd,nw,Mse),pVe=at(pi,Sd,aVe,rVe,Su,C2,ase,cse,GWe,mse,yWe,AWe,LWe,S2,wd,nw,Mse),kse=(t,e,n,r,i,o,a,s,l,c,u)=>{if(!e||!n||!r)return null;const f=[["crs",l]];return Pse(i,Ase(t.url,e,"rgb"),e.bbox,n.tileLevelMin,n.tileLevelMax,f,1,a,s,l,c,u,o)},mVe=at(pi,qr,qWe,xWe,RWe,NWe,Sy,S2,wd,qB,nw,kse),gVe=at(pi,Sd,XWe,bWe,IWe,$We,Sy,S2,wd,qB,nw,kse);function Ase(t,e,n){return`${t}/tiles/${ly(e)}/${G1(n)}/{z}/{y}/{x}`}function vVe(){return I5()}function yVe(){return new X1({fill:Ise(),stroke:Rse(),radius:6})}function Rse(){return new Xl({color:[200,0,0,.75],width:1.25})}function Ise(){return new op({color:[255,0,0,vVe()]})}function xVe(){return new Il({image:yVe(),stroke:Rse(),fill:Ise()})}const bVe=at(yse,wd,_We,(t,e,n)=>{if(!n||t.length===0)return null;const r=[];return t.forEach((i,o)=>{uy(i)&&r.push(w.jsx(v2,{id:`placeGroup.${i.id}`,style:xVe(),zIndex:100,source:new Y1({features:new Ip({dataProjection:py,featureProjection:e}).readFeatures(i)})},o))}),w.jsx(iae,{children:r})}),_Ve=at(Jae,t=>{const e=[];return Object.getOwnPropertyNames(t).forEach(n=>{t[n].visible&&e.push(n)}),e}),wVe=at(Jae,t=>{const e={};return Object.getOwnPropertyNames(t).forEach(n=>{e[n]=t[n].viewMode||"text"}),e}),SVe=at(dWe,t=>Object.keys(t).map(e=>t[e])),XB=at(hWe,t=>[...t,...$ae]),QB=at(pWe,t=>[...t,...d6e]),Dse=(t,e,n,r)=>{if(!n||!e)return null;const i=nE(t,e);if(!i)return null;let o=i.attribution;o&&(o.startsWith("http://")||o.startsWith("https://"))&&(o=`&copy; <a href=&quot;${i.attribution}&quot;>${i.group}</a>`);let a;if(i.wms){const{layerName:s,styleName:l}=i.wms;a=new XBe({url:i.url,params:{...l?{STYLES:l}:{},LAYERS:s},attributions:o,attributionsCollapsible:!0})}else{const s=rLe(i.group);a=new hy({url:i.url+(s?`?${s.param}=${s.token}`:""),attributions:o,attributionsCollapsible:!0})}return w.jsx(cae,{id:i.id,source:a,zIndex:r})},OVe=at(XB,VB,mWe,()=>0,Dse),CVe=at(QB,GB,wWe,()=>20,Dse),Lse=(t,e)=>{const n=nE(t,e);return n?tE(n):null},TVe=at(XB,VB,Lse),EVe=at(QB,GB,Lse),PVe=at(TVe,EVe,VB,GB,qr,Sd,vo,Su,SWe,(t,e,n,r,i,o,a,s,l)=>({baseMap:{title:"Base Map",subTitle:t||void 0,visible:l.baseMap,disabled:!n},overlay:{title:"Overlay",subTitle:e||void 0,visible:l.overlay,disabled:!r},datasetRgb:{title:"Dataset RGB",subTitle:i?i.title:void 0,visible:l.datasetRgb,disabled:!i},datasetRgb2:{title:"Dataset RGB",subTitle:o?o.title:void 0,visible:l.datasetRgb2,disabled:!o,pinned:!0},datasetVariable:{title:"Dataset Variable",subTitle:i&&a?`${i.title} / ${a.title||a.name}`:void 0,visible:l.datasetVariable,disabled:!(i&&a)},datasetVariable2:{title:"Dataset Variable",subTitle:o&&s?`${o.title} / ${s.title||s.name}`:void 0,visible:l.datasetVariable2,disabled:!(o&&s),pinned:!0},datasetBoundary:{title:"Dataset Boundary",subTitle:i?i.title:void 0,visible:l.datasetBoundary,disabled:!i},datasetPlaces:{title:"Dataset Places",visible:l.datasetPlaces},userPlaces:{title:"User Places",visible:l.userPlaces}}));var Nse={exports:{}};/*!

JSZip v3.10.1 - A JavaScript class for generating and reading zip files
<http://stuartk.com/jszip>

(c) 2009-2016 Stuart Knightley <stuart [at] stuartk.com>
Dual licenced under the MIT license or GPLv3. See https://raw.github.com/Stuk/jszip/main/LICENSE.markdown.

JSZip uses the library pako released under the MIT license :
https://github.com/nodeca/pako/blob/main/LICENSE
*/(function(t,e){(function(n){t.exports=n()})(function(){return function n(r,i,o){function a(c,u){if(!i[c]){if(!r[c]){var f=typeof cx=="function"&&cx;if(!u&&f)return f(c,!0);if(s)return s(c,!0);var d=new Error("Cannot find module '"+c+"'");throw d.code="MODULE_NOT_FOUND",d}var h=i[c]={exports:{}};r[c][0].call(h.exports,function(p){var m=r[c][1][p];return a(m||p)},h,h.exports,n,r,i,o)}return i[c].exports}for(var s=typeof cx=="function"&&cx,l=0;l<o.length;l++)a(o[l]);return a}({1:[function(n,r,i){var o=n("./utils"),a=n("./support"),s="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=";i.encode=function(l){for(var c,u,f,d,h,p,m,g=[],v=0,y=l.length,x=y,b=o.getTypeOf(l)!=="string";v<l.length;)x=y-v,f=b?(c=l[v++],u=v<y?l[v++]:0,v<y?l[v++]:0):(c=l.charCodeAt(v++),u=v<y?l.charCodeAt(v++):0,v<y?l.charCodeAt(v++):0),d=c>>2,h=(3&c)<<4|u>>4,p=1<x?(15&u)<<2|f>>6:64,m=2<x?63&f:64,g.push(s.charAt(d)+s.charAt(h)+s.charAt(p)+s.charAt(m));return g.join("")},i.decode=function(l){var c,u,f,d,h,p,m=0,g=0,v="data:";if(l.substr(0,v.length)===v)throw new Error("Invalid base64 input, it looks like a data url.");var y,x=3*(l=l.replace(/[^A-Za-z0-9+/=]/g,"")).length/4;if(l.charAt(l.length-1)===s.charAt(64)&&x--,l.charAt(l.length-2)===s.charAt(64)&&x--,x%1!=0)throw new Error("Invalid base64 input, bad content length.");for(y=a.uint8array?new Uint8Array(0|x):new Array(0|x);m<l.length;)c=s.indexOf(l.charAt(m++))<<2|(d=s.indexOf(l.charAt(m++)))>>4,u=(15&d)<<4|(h=s.indexOf(l.charAt(m++)))>>2,f=(3&h)<<6|(p=s.indexOf(l.charAt(m++))),y[g++]=c,h!==64&&(y[g++]=u),p!==64&&(y[g++]=f);return y}},{"./support":30,"./utils":32}],2:[function(n,r,i){var o=n("./external"),a=n("./stream/DataWorker"),s=n("./stream/Crc32Probe"),l=n("./stream/DataLengthProbe");function c(u,f,d,h,p){this.compressedSize=u,this.uncompressedSize=f,this.crc32=d,this.compression=h,this.compressedContent=p}c.prototype={getContentWorker:function(){var u=new a(o.Promise.resolve(this.compressedContent)).pipe(this.compression.uncompressWorker()).pipe(new l("data_length")),f=this;return u.on("end",function(){if(this.streamInfo.data_length!==f.uncompressedSize)throw new Error("Bug : uncompressed data size mismatch")}),u},getCompressedWorker:function(){return new a(o.Promise.resolve(this.compressedContent)).withStreamInfo("compressedSize",this.compressedSize).withStreamInfo("uncompressedSize",this.uncompressedSize).withStreamInfo("crc32",this.crc32).withStreamInfo("compression",this.compression)}},c.createWorkerFrom=function(u,f,d){return u.pipe(new s).pipe(new l("uncompressedSize")).pipe(f.compressWorker(d)).pipe(new l("compressedSize")).withStreamInfo("compression",f)},r.exports=c},{"./external":6,"./stream/Crc32Probe":25,"./stream/DataLengthProbe":26,"./stream/DataWorker":27}],3:[function(n,r,i){var o=n("./stream/GenericWorker");i.STORE={magic:"\0\0",compressWorker:function(){return new o("STORE compression")},uncompressWorker:function(){return new o("STORE decompression")}},i.DEFLATE=n("./flate")},{"./flate":7,"./stream/GenericWorker":28}],4:[function(n,r,i){var o=n("./utils"),a=function(){for(var s,l=[],c=0;c<256;c++){s=c;for(var u=0;u<8;u++)s=1&s?3988292384^s>>>1:s>>>1;l[c]=s}return l}();r.exports=function(s,l){return s!==void 0&&s.length?o.getTypeOf(s)!=="string"?function(c,u,f,d){var h=a,p=d+f;c^=-1;for(var m=d;m<p;m++)c=c>>>8^h[255&(c^u[m])];return-1^c}(0|l,s,s.length,0):function(c,u,f,d){var h=a,p=d+f;c^=-1;for(var m=d;m<p;m++)c=c>>>8^h[255&(c^u.charCodeAt(m))];return-1^c}(0|l,s,s.length,0):0}},{"./utils":32}],5:[function(n,r,i){i.base64=!1,i.binary=!1,i.dir=!1,i.createFolders=!0,i.date=null,i.compression=null,i.compressionOptions=null,i.comment=null,i.unixPermissions=null,i.dosPermissions=null},{}],6:[function(n,r,i){var o=null;o=typeof Promise<"u"?Promise:n("lie"),r.exports={Promise:o}},{lie:37}],7:[function(n,r,i){var o=typeof Uint8Array<"u"&&typeof Uint16Array<"u"&&typeof Uint32Array<"u",a=n("pako"),s=n("./utils"),l=n("./stream/GenericWorker"),c=o?"uint8array":"array";function u(f,d){l.call(this,"FlateWorker/"+f),this._pako=null,this._pakoAction=f,this._pakoOptions=d,this.meta={}}i.magic="\b\0",s.inherits(u,l),u.prototype.processChunk=function(f){this.meta=f.meta,this._pako===null&&this._createPako(),this._pako.push(s.transformTo(c,f.data),!1)},u.prototype.flush=function(){l.prototype.flush.call(this),this._pako===null&&this._createPako(),this._pako.push([],!0)},u.prototype.cleanUp=function(){l.prototype.cleanUp.call(this),this._pako=null},u.prototype._createPako=function(){this._pako=new a[this._pakoAction]({raw:!0,level:this._pakoOptions.level||-1});var f=this;this._pako.onData=function(d){f.push({data:d,meta:f.meta})}},i.compressWorker=function(f){return new u("Deflate",f)},i.uncompressWorker=function(){return new u("Inflate",{})}},{"./stream/GenericWorker":28,"./utils":32,pako:38}],8:[function(n,r,i){function o(h,p){var m,g="";for(m=0;m<p;m++)g+=String.fromCharCode(255&h),h>>>=8;return g}function a(h,p,m,g,v,y){var x,b,_=h.file,S=h.compression,O=y!==c.utf8encode,C=s.transformTo("string",y(_.name)),E=s.transformTo("string",c.utf8encode(_.name)),k=_.comment,I=s.transformTo("string",y(k)),P=s.transformTo("string",c.utf8encode(k)),R=E.length!==_.name.length,T=P.length!==k.length,L="",z="",B="",U=_.dir,W=_.date,$={crc32:0,compressedSize:0,uncompressedSize:0};p&&!m||($.crc32=h.crc32,$.compressedSize=h.compressedSize,$.uncompressedSize=h.uncompressedSize);var N=0;p&&(N|=8),O||!R&&!T||(N|=2048);var D=0,A=0;U&&(D|=16),v==="UNIX"?(A=798,D|=function(Y,K){var se=Y;return Y||(se=K?16893:33204),(65535&se)<<16}(_.unixPermissions,U)):(A=20,D|=function(Y){return 63&(Y||0)}(_.dosPermissions)),x=W.getUTCHours(),x<<=6,x|=W.getUTCMinutes(),x<<=5,x|=W.getUTCSeconds()/2,b=W.getUTCFullYear()-1980,b<<=4,b|=W.getUTCMonth()+1,b<<=5,b|=W.getUTCDate(),R&&(z=o(1,1)+o(u(C),4)+E,L+="up"+o(z.length,2)+z),T&&(B=o(1,1)+o(u(I),4)+P,L+="uc"+o(B.length,2)+B);var q="";return q+=`
\0`,q+=o(N,2),q+=S.magic,q+=o(x,2),q+=o(b,2),q+=o($.crc32,4),q+=o($.compressedSize,4),q+=o($.uncompressedSize,4),q+=o(C.length,2),q+=o(L.length,2),{fileRecord:f.LOCAL_FILE_HEADER+q+C+L,dirRecord:f.CENTRAL_FILE_HEADER+o(A,2)+q+o(I.length,2)+"\0\0\0\0"+o(D,4)+o(g,4)+C+L+I}}var s=n("../utils"),l=n("../stream/GenericWorker"),c=n("../utf8"),u=n("../crc32"),f=n("../signature");function d(h,p,m,g){l.call(this,"ZipFileWorker"),this.bytesWritten=0,this.zipComment=p,this.zipPlatform=m,this.encodeFileName=g,this.streamFiles=h,this.accumulate=!1,this.contentBuffer=[],this.dirRecords=[],this.currentSourceOffset=0,this.entriesCount=0,this.currentFile=null,this._sources=[]}s.inherits(d,l),d.prototype.push=function(h){var p=h.meta.percent||0,m=this.entriesCount,g=this._sources.length;this.accumulate?this.contentBuffer.push(h):(this.bytesWritten+=h.data.length,l.prototype.push.call(this,{data:h.data,meta:{currentFile:this.currentFile,percent:m?(p+100*(m-g-1))/m:100}}))},d.prototype.openedSource=function(h){this.currentSourceOffset=this.bytesWritten,this.currentFile=h.file.name;var p=this.streamFiles&&!h.file.dir;if(p){var m=a(h,p,!1,this.currentSourceOffset,this.zipPlatform,this.encodeFileName);this.push({data:m.fileRecord,meta:{percent:0}})}else this.accumulate=!0},d.prototype.closedSource=function(h){this.accumulate=!1;var p=this.streamFiles&&!h.file.dir,m=a(h,p,!0,this.currentSourceOffset,this.zipPlatform,this.encodeFileName);if(this.dirRecords.push(m.dirRecord),p)this.push({data:function(g){return f.DATA_DESCRIPTOR+o(g.crc32,4)+o(g.compressedSize,4)+o(g.uncompressedSize,4)}(h),meta:{percent:100}});else for(this.push({data:m.fileRecord,meta:{percent:0}});this.contentBuffer.length;)this.push(this.contentBuffer.shift());this.currentFile=null},d.prototype.flush=function(){for(var h=this.bytesWritten,p=0;p<this.dirRecords.length;p++)this.push({data:this.dirRecords[p],meta:{percent:100}});var m=this.bytesWritten-h,g=function(v,y,x,b,_){var S=s.transformTo("string",_(b));return f.CENTRAL_DIRECTORY_END+"\0\0\0\0"+o(v,2)+o(v,2)+o(y,4)+o(x,4)+o(S.length,2)+S}(this.dirRecords.length,m,h,this.zipComment,this.encodeFileName);this.push({data:g,meta:{percent:100}})},d.prototype.prepareNextSource=function(){this.previous=this._sources.shift(),this.openedSource(this.previous.streamInfo),this.isPaused?this.previous.pause():this.previous.resume()},d.prototype.registerPrevious=function(h){this._sources.push(h);var p=this;return h.on("data",function(m){p.processChunk(m)}),h.on("end",function(){p.closedSource(p.previous.streamInfo),p._sources.length?p.prepareNextSource():p.end()}),h.on("error",function(m){p.error(m)}),this},d.prototype.resume=function(){return!!l.prototype.resume.call(this)&&(!this.previous&&this._sources.length?(this.prepareNextSource(),!0):this.previous||this._sources.length||this.generatedError?void 0:(this.end(),!0))},d.prototype.error=function(h){var p=this._sources;if(!l.prototype.error.call(this,h))return!1;for(var m=0;m<p.length;m++)try{p[m].error(h)}catch{}return!0},d.prototype.lock=function(){l.prototype.lock.call(this);for(var h=this._sources,p=0;p<h.length;p++)h[p].lock()},r.exports=d},{"../crc32":4,"../signature":23,"../stream/GenericWorker":28,"../utf8":31,"../utils":32}],9:[function(n,r,i){var o=n("../compressions"),a=n("./ZipFileWorker");i.generateWorker=function(s,l,c){var u=new a(l.streamFiles,c,l.platform,l.encodeFileName),f=0;try{s.forEach(function(d,h){f++;var p=function(y,x){var b=y||x,_=o[b];if(!_)throw new Error(b+" is not a valid compression method !");return _}(h.options.compression,l.compression),m=h.options.compressionOptions||l.compressionOptions||{},g=h.dir,v=h.date;h._compressWorker(p,m).withStreamInfo("file",{name:d,dir:g,date:v,comment:h.comment||"",unixPermissions:h.unixPermissions,dosPermissions:h.dosPermissions}).pipe(u)}),u.entriesCount=f}catch(d){u.error(d)}return u}},{"../compressions":3,"./ZipFileWorker":8}],10:[function(n,r,i){function o(){if(!(this instanceof o))return new o;if(arguments.length)throw new Error("The constructor with parameters has been removed in JSZip 3.0, please check the upgrade guide.");this.files=Object.create(null),this.comment=null,this.root="",this.clone=function(){var a=new o;for(var s in this)typeof this[s]!="function"&&(a[s]=this[s]);return a}}(o.prototype=n("./object")).loadAsync=n("./load"),o.support=n("./support"),o.defaults=n("./defaults"),o.version="3.10.1",o.loadAsync=function(a,s){return new o().loadAsync(a,s)},o.external=n("./external"),r.exports=o},{"./defaults":5,"./external":6,"./load":11,"./object":15,"./support":30}],11:[function(n,r,i){var o=n("./utils"),a=n("./external"),s=n("./utf8"),l=n("./zipEntries"),c=n("./stream/Crc32Probe"),u=n("./nodejsUtils");function f(d){return new a.Promise(function(h,p){var m=d.decompressed.getContentWorker().pipe(new c);m.on("error",function(g){p(g)}).on("end",function(){m.streamInfo.crc32!==d.decompressed.crc32?p(new Error("Corrupted zip : CRC32 mismatch")):h()}).resume()})}r.exports=function(d,h){var p=this;return h=o.extend(h||{},{base64:!1,checkCRC32:!1,optimizedBinaryString:!1,createFolders:!1,decodeFileName:s.utf8decode}),u.isNode&&u.isStream(d)?a.Promise.reject(new Error("JSZip can't accept a stream when loading a zip file.")):o.prepareContent("the loaded zip file",d,!0,h.optimizedBinaryString,h.base64).then(function(m){var g=new l(h);return g.load(m),g}).then(function(m){var g=[a.Promise.resolve(m)],v=m.files;if(h.checkCRC32)for(var y=0;y<v.length;y++)g.push(f(v[y]));return a.Promise.all(g)}).then(function(m){for(var g=m.shift(),v=g.files,y=0;y<v.length;y++){var x=v[y],b=x.fileNameStr,_=o.resolve(x.fileNameStr);p.file(_,x.decompressed,{binary:!0,optimizedBinaryString:!0,date:x.date,dir:x.dir,comment:x.fileCommentStr.length?x.fileCommentStr:null,unixPermissions:x.unixPermissions,dosPermissions:x.dosPermissions,createFolders:h.createFolders}),x.dir||(p.file(_).unsafeOriginalName=b)}return g.zipComment.length&&(p.comment=g.zipComment),p})}},{"./external":6,"./nodejsUtils":14,"./stream/Crc32Probe":25,"./utf8":31,"./utils":32,"./zipEntries":33}],12:[function(n,r,i){var o=n("../utils"),a=n("../stream/GenericWorker");function s(l,c){a.call(this,"Nodejs stream input adapter for "+l),this._upstreamEnded=!1,this._bindStream(c)}o.inherits(s,a),s.prototype._bindStream=function(l){var c=this;(this._stream=l).pause(),l.on("data",function(u){c.push({data:u,meta:{percent:0}})}).on("error",function(u){c.isPaused?this.generatedError=u:c.error(u)}).on("end",function(){c.isPaused?c._upstreamEnded=!0:c.end()})},s.prototype.pause=function(){return!!a.prototype.pause.call(this)&&(this._stream.pause(),!0)},s.prototype.resume=function(){return!!a.prototype.resume.call(this)&&(this._upstreamEnded?this.end():this._stream.resume(),!0)},r.exports=s},{"../stream/GenericWorker":28,"../utils":32}],13:[function(n,r,i){var o=n("readable-stream").Readable;function a(s,l,c){o.call(this,l),this._helper=s;var u=this;s.on("data",function(f,d){u.push(f)||u._helper.pause(),c&&c(d)}).on("error",function(f){u.emit("error",f)}).on("end",function(){u.push(null)})}n("../utils").inherits(a,o),a.prototype._read=function(){this._helper.resume()},r.exports=a},{"../utils":32,"readable-stream":16}],14:[function(n,r,i){r.exports={isNode:typeof Buffer<"u",newBufferFrom:function(o,a){if(Buffer.from&&Buffer.from!==Uint8Array.from)return Buffer.from(o,a);if(typeof o=="number")throw new Error('The "data" argument must not be a number');return new Buffer(o,a)},allocBuffer:function(o){if(Buffer.alloc)return Buffer.alloc(o);var a=new Buffer(o);return a.fill(0),a},isBuffer:function(o){return Buffer.isBuffer(o)},isStream:function(o){return o&&typeof o.on=="function"&&typeof o.pause=="function"&&typeof o.resume=="function"}}},{}],15:[function(n,r,i){function o(_,S,O){var C,E=s.getTypeOf(S),k=s.extend(O||{},u);k.date=k.date||new Date,k.compression!==null&&(k.compression=k.compression.toUpperCase()),typeof k.unixPermissions=="string"&&(k.unixPermissions=parseInt(k.unixPermissions,8)),k.unixPermissions&&16384&k.unixPermissions&&(k.dir=!0),k.dosPermissions&&16&k.dosPermissions&&(k.dir=!0),k.dir&&(_=v(_)),k.createFolders&&(C=g(_))&&y.call(this,C,!0);var I=E==="string"&&k.binary===!1&&k.base64===!1;O&&O.binary!==void 0||(k.binary=!I),(S instanceof f&&S.uncompressedSize===0||k.dir||!S||S.length===0)&&(k.base64=!1,k.binary=!0,S="",k.compression="STORE",E="string");var P=null;P=S instanceof f||S instanceof l?S:p.isNode&&p.isStream(S)?new m(_,S):s.prepareContent(_,S,k.binary,k.optimizedBinaryString,k.base64);var R=new d(_,P,k);this.files[_]=R}var a=n("./utf8"),s=n("./utils"),l=n("./stream/GenericWorker"),c=n("./stream/StreamHelper"),u=n("./defaults"),f=n("./compressedObject"),d=n("./zipObject"),h=n("./generate"),p=n("./nodejsUtils"),m=n("./nodejs/NodejsStreamInputAdapter"),g=function(_){_.slice(-1)==="/"&&(_=_.substring(0,_.length-1));var S=_.lastIndexOf("/");return 0<S?_.substring(0,S):""},v=function(_){return _.slice(-1)!=="/"&&(_+="/"),_},y=function(_,S){return S=S!==void 0?S:u.createFolders,_=v(_),this.files[_]||o.call(this,_,null,{dir:!0,createFolders:S}),this.files[_]};function x(_){return Object.prototype.toString.call(_)==="[object RegExp]"}var b={load:function(){throw new Error("This method has been removed in JSZip 3.0, please check the upgrade guide.")},forEach:function(_){var S,O,C;for(S in this.files)C=this.files[S],(O=S.slice(this.root.length,S.length))&&S.slice(0,this.root.length)===this.root&&_(O,C)},filter:function(_){var S=[];return this.forEach(function(O,C){_(O,C)&&S.push(C)}),S},file:function(_,S,O){if(arguments.length!==1)return _=this.root+_,o.call(this,_,S,O),this;if(x(_)){var C=_;return this.filter(function(k,I){return!I.dir&&C.test(k)})}var E=this.files[this.root+_];return E&&!E.dir?E:null},folder:function(_){if(!_)return this;if(x(_))return this.filter(function(E,k){return k.dir&&_.test(E)});var S=this.root+_,O=y.call(this,S),C=this.clone();return C.root=O.name,C},remove:function(_){_=this.root+_;var S=this.files[_];if(S||(_.slice(-1)!=="/"&&(_+="/"),S=this.files[_]),S&&!S.dir)delete this.files[_];else for(var O=this.filter(function(E,k){return k.name.slice(0,_.length)===_}),C=0;C<O.length;C++)delete this.files[O[C].name];return this},generate:function(){throw new Error("This method has been removed in JSZip 3.0, please check the upgrade guide.")},generateInternalStream:function(_){var S,O={};try{if((O=s.extend(_||{},{streamFiles:!1,compression:"STORE",compressionOptions:null,type:"",platform:"DOS",comment:null,mimeType:"application/zip",encodeFileName:a.utf8encode})).type=O.type.toLowerCase(),O.compression=O.compression.toUpperCase(),O.type==="binarystring"&&(O.type="string"),!O.type)throw new Error("No output type specified.");s.checkSupport(O.type),O.platform!=="darwin"&&O.platform!=="freebsd"&&O.platform!=="linux"&&O.platform!=="sunos"||(O.platform="UNIX"),O.platform==="win32"&&(O.platform="DOS");var C=O.comment||this.comment||"";S=h.generateWorker(this,O,C)}catch(E){(S=new l("error")).error(E)}return new c(S,O.type||"string",O.mimeType)},generateAsync:function(_,S){return this.generateInternalStream(_).accumulate(S)},generateNodeStream:function(_,S){return(_=_||{}).type||(_.type="nodebuffer"),this.generateInternalStream(_).toNodejsStream(S)}};r.exports=b},{"./compressedObject":2,"./defaults":5,"./generate":9,"./nodejs/NodejsStreamInputAdapter":12,"./nodejsUtils":14,"./stream/GenericWorker":28,"./stream/StreamHelper":29,"./utf8":31,"./utils":32,"./zipObject":35}],16:[function(n,r,i){r.exports=n("stream")},{stream:void 0}],17:[function(n,r,i){var o=n("./DataReader");function a(s){o.call(this,s);for(var l=0;l<this.data.length;l++)s[l]=255&s[l]}n("../utils").inherits(a,o),a.prototype.byteAt=function(s){return this.data[this.zero+s]},a.prototype.lastIndexOfSignature=function(s){for(var l=s.charCodeAt(0),c=s.charCodeAt(1),u=s.charCodeAt(2),f=s.charCodeAt(3),d=this.length-4;0<=d;--d)if(this.data[d]===l&&this.data[d+1]===c&&this.data[d+2]===u&&this.data[d+3]===f)return d-this.zero;return-1},a.prototype.readAndCheckSignature=function(s){var l=s.charCodeAt(0),c=s.charCodeAt(1),u=s.charCodeAt(2),f=s.charCodeAt(3),d=this.readData(4);return l===d[0]&&c===d[1]&&u===d[2]&&f===d[3]},a.prototype.readData=function(s){if(this.checkOffset(s),s===0)return[];var l=this.data.slice(this.zero+this.index,this.zero+this.index+s);return this.index+=s,l},r.exports=a},{"../utils":32,"./DataReader":18}],18:[function(n,r,i){var o=n("../utils");function a(s){this.data=s,this.length=s.length,this.index=0,this.zero=0}a.prototype={checkOffset:function(s){this.checkIndex(this.index+s)},checkIndex:function(s){if(this.length<this.zero+s||s<0)throw new Error("End of data reached (data length = "+this.length+", asked index = "+s+"). Corrupted zip ?")},setIndex:function(s){this.checkIndex(s),this.index=s},skip:function(s){this.setIndex(this.index+s)},byteAt:function(){},readInt:function(s){var l,c=0;for(this.checkOffset(s),l=this.index+s-1;l>=this.index;l--)c=(c<<8)+this.byteAt(l);return this.index+=s,c},readString:function(s){return o.transformTo("string",this.readData(s))},readData:function(){},lastIndexOfSignature:function(){},readAndCheckSignature:function(){},readDate:function(){var s=this.readInt(4);return new Date(Date.UTC(1980+(s>>25&127),(s>>21&15)-1,s>>16&31,s>>11&31,s>>5&63,(31&s)<<1))}},r.exports=a},{"../utils":32}],19:[function(n,r,i){var o=n("./Uint8ArrayReader");function a(s){o.call(this,s)}n("../utils").inherits(a,o),a.prototype.readData=function(s){this.checkOffset(s);var l=this.data.slice(this.zero+this.index,this.zero+this.index+s);return this.index+=s,l},r.exports=a},{"../utils":32,"./Uint8ArrayReader":21}],20:[function(n,r,i){var o=n("./DataReader");function a(s){o.call(this,s)}n("../utils").inherits(a,o),a.prototype.byteAt=function(s){return this.data.charCodeAt(this.zero+s)},a.prototype.lastIndexOfSignature=function(s){return this.data.lastIndexOf(s)-this.zero},a.prototype.readAndCheckSignature=function(s){return s===this.readData(4)},a.prototype.readData=function(s){this.checkOffset(s);var l=this.data.slice(this.zero+this.index,this.zero+this.index+s);return this.index+=s,l},r.exports=a},{"../utils":32,"./DataReader":18}],21:[function(n,r,i){var o=n("./ArrayReader");function a(s){o.call(this,s)}n("../utils").inherits(a,o),a.prototype.readData=function(s){if(this.checkOffset(s),s===0)return new Uint8Array(0);var l=this.data.subarray(this.zero+this.index,this.zero+this.index+s);return this.index+=s,l},r.exports=a},{"../utils":32,"./ArrayReader":17}],22:[function(n,r,i){var o=n("../utils"),a=n("../support"),s=n("./ArrayReader"),l=n("./StringReader"),c=n("./NodeBufferReader"),u=n("./Uint8ArrayReader");r.exports=function(f){var d=o.getTypeOf(f);return o.checkSupport(d),d!=="string"||a.uint8array?d==="nodebuffer"?new c(f):a.uint8array?new u(o.transformTo("uint8array",f)):new s(o.transformTo("array",f)):new l(f)}},{"../support":30,"../utils":32,"./ArrayReader":17,"./NodeBufferReader":19,"./StringReader":20,"./Uint8ArrayReader":21}],23:[function(n,r,i){i.LOCAL_FILE_HEADER="PK",i.CENTRAL_FILE_HEADER="PK",i.CENTRAL_DIRECTORY_END="PK",i.ZIP64_CENTRAL_DIRECTORY_LOCATOR="PK\x07",i.ZIP64_CENTRAL_DIRECTORY_END="PK",i.DATA_DESCRIPTOR="PK\x07\b"},{}],24:[function(n,r,i){var o=n("./GenericWorker"),a=n("../utils");function s(l){o.call(this,"ConvertWorker to "+l),this.destType=l}a.inherits(s,o),s.prototype.processChunk=function(l){this.push({data:a.transformTo(this.destType,l.data),meta:l.meta})},r.exports=s},{"../utils":32,"./GenericWorker":28}],25:[function(n,r,i){var o=n("./GenericWorker"),a=n("../crc32");function s(){o.call(this,"Crc32Probe"),this.withStreamInfo("crc32",0)}n("../utils").inherits(s,o),s.prototype.processChunk=function(l){this.streamInfo.crc32=a(l.data,this.streamInfo.crc32||0),this.push(l)},r.exports=s},{"../crc32":4,"../utils":32,"./GenericWorker":28}],26:[function(n,r,i){var o=n("../utils"),a=n("./GenericWorker");function s(l){a.call(this,"DataLengthProbe for "+l),this.propName=l,this.withStreamInfo(l,0)}o.inherits(s,a),s.prototype.processChunk=function(l){if(l){var c=this.streamInfo[this.propName]||0;this.streamInfo[this.propName]=c+l.data.length}a.prototype.processChunk.call(this,l)},r.exports=s},{"../utils":32,"./GenericWorker":28}],27:[function(n,r,i){var o=n("../utils"),a=n("./GenericWorker");function s(l){a.call(this,"DataWorker");var c=this;this.dataIsReady=!1,this.index=0,this.max=0,this.data=null,this.type="",this._tickScheduled=!1,l.then(function(u){c.dataIsReady=!0,c.data=u,c.max=u&&u.length||0,c.type=o.getTypeOf(u),c.isPaused||c._tickAndRepeat()},function(u){c.error(u)})}o.inherits(s,a),s.prototype.cleanUp=function(){a.prototype.cleanUp.call(this),this.data=null},s.prototype.resume=function(){return!!a.prototype.resume.call(this)&&(!this._tickScheduled&&this.dataIsReady&&(this._tickScheduled=!0,o.delay(this._tickAndRepeat,[],this)),!0)},s.prototype._tickAndRepeat=function(){this._tickScheduled=!1,this.isPaused||this.isFinished||(this._tick(),this.isFinished||(o.delay(this._tickAndRepeat,[],this),this._tickScheduled=!0))},s.prototype._tick=function(){if(this.isPaused||this.isFinished)return!1;var l=null,c=Math.min(this.max,this.index+16384);if(this.index>=this.max)return this.end();switch(this.type){case"string":l=this.data.substring(this.index,c);break;case"uint8array":l=this.data.subarray(this.index,c);break;case"array":case"nodebuffer":l=this.data.slice(this.index,c)}return this.index=c,this.push({data:l,meta:{percent:this.max?this.index/this.max*100:0}})},r.exports=s},{"../utils":32,"./GenericWorker":28}],28:[function(n,r,i){function o(a){this.name=a||"default",this.streamInfo={},this.generatedError=null,this.extraStreamInfo={},this.isPaused=!0,this.isFinished=!1,this.isLocked=!1,this._listeners={data:[],end:[],error:[]},this.previous=null}o.prototype={push:function(a){this.emit("data",a)},end:function(){if(this.isFinished)return!1;this.flush();try{this.emit("end"),this.cleanUp(),this.isFinished=!0}catch(a){this.emit("error",a)}return!0},error:function(a){return!this.isFinished&&(this.isPaused?this.generatedError=a:(this.isFinished=!0,this.emit("error",a),this.previous&&this.previous.error(a),this.cleanUp()),!0)},on:function(a,s){return this._listeners[a].push(s),this},cleanUp:function(){this.streamInfo=this.generatedError=this.extraStreamInfo=null,this._listeners=[]},emit:function(a,s){if(this._listeners[a])for(var l=0;l<this._listeners[a].length;l++)this._listeners[a][l].call(this,s)},pipe:function(a){return a.registerPrevious(this)},registerPrevious:function(a){if(this.isLocked)throw new Error("The stream '"+this+"' has already been used.");this.streamInfo=a.streamInfo,this.mergeStreamInfo(),this.previous=a;var s=this;return a.on("data",function(l){s.processChunk(l)}),a.on("end",function(){s.end()}),a.on("error",function(l){s.error(l)}),this},pause:function(){return!this.isPaused&&!this.isFinished&&(this.isPaused=!0,this.previous&&this.previous.pause(),!0)},resume:function(){if(!this.isPaused||this.isFinished)return!1;var a=this.isPaused=!1;return this.generatedError&&(this.error(this.generatedError),a=!0),this.previous&&this.previous.resume(),!a},flush:function(){},processChunk:function(a){this.push(a)},withStreamInfo:function(a,s){return this.extraStreamInfo[a]=s,this.mergeStreamInfo(),this},mergeStreamInfo:function(){for(var a in this.extraStreamInfo)Object.prototype.hasOwnProperty.call(this.extraStreamInfo,a)&&(this.streamInfo[a]=this.extraStreamInfo[a])},lock:function(){if(this.isLocked)throw new Error("The stream '"+this+"' has already been used.");this.isLocked=!0,this.previous&&this.previous.lock()},toString:function(){var a="Worker "+this.name;return this.previous?this.previous+" -> "+a:a}},r.exports=o},{}],29:[function(n,r,i){var o=n("../utils"),a=n("./ConvertWorker"),s=n("./GenericWorker"),l=n("../base64"),c=n("../support"),u=n("../external"),f=null;if(c.nodestream)try{f=n("../nodejs/NodejsStreamOutputAdapter")}catch{}function d(p,m){return new u.Promise(function(g,v){var y=[],x=p._internalType,b=p._outputType,_=p._mimeType;p.on("data",function(S,O){y.push(S),m&&m(O)}).on("error",function(S){y=[],v(S)}).on("end",function(){try{var S=function(O,C,E){switch(O){case"blob":return o.newBlob(o.transformTo("arraybuffer",C),E);case"base64":return l.encode(C);default:return o.transformTo(O,C)}}(b,function(O,C){var E,k=0,I=null,P=0;for(E=0;E<C.length;E++)P+=C[E].length;switch(O){case"string":return C.join("");case"array":return Array.prototype.concat.apply([],C);case"uint8array":for(I=new Uint8Array(P),E=0;E<C.length;E++)I.set(C[E],k),k+=C[E].length;return I;case"nodebuffer":return Buffer.concat(C);default:throw new Error("concat : unsupported type '"+O+"'")}}(x,y),_);g(S)}catch(O){v(O)}y=[]}).resume()})}function h(p,m,g){var v=m;switch(m){case"blob":case"arraybuffer":v="uint8array";break;case"base64":v="string"}try{this._internalType=v,this._outputType=m,this._mimeType=g,o.checkSupport(v),this._worker=p.pipe(new a(v)),p.lock()}catch(y){this._worker=new s("error"),this._worker.error(y)}}h.prototype={accumulate:function(p){return d(this,p)},on:function(p,m){var g=this;return p==="data"?this._worker.on(p,function(v){m.call(g,v.data,v.meta)}):this._worker.on(p,function(){o.delay(m,arguments,g)}),this},resume:function(){return o.delay(this._worker.resume,[],this._worker),this},pause:function(){return this._worker.pause(),this},toNodejsStream:function(p){if(o.checkSupport("nodestream"),this._outputType!=="nodebuffer")throw new Error(this._outputType+" is not supported by this method");return new f(this,{objectMode:this._outputType!=="nodebuffer"},p)}},r.exports=h},{"../base64":1,"../external":6,"../nodejs/NodejsStreamOutputAdapter":13,"../support":30,"../utils":32,"./ConvertWorker":24,"./GenericWorker":28}],30:[function(n,r,i){if(i.base64=!0,i.array=!0,i.string=!0,i.arraybuffer=typeof ArrayBuffer<"u"&&typeof Uint8Array<"u",i.nodebuffer=typeof Buffer<"u",i.uint8array=typeof Uint8Array<"u",typeof ArrayBuffer>"u")i.blob=!1;else{var o=new ArrayBuffer(0);try{i.blob=new Blob([o],{type:"application/zip"}).size===0}catch{try{var a=new(self.BlobBuilder||self.WebKitBlobBuilder||self.MozBlobBuilder||self.MSBlobBuilder);a.append(o),i.blob=a.getBlob("application/zip").size===0}catch{i.blob=!1}}}try{i.nodestream=!!n("readable-stream").Readable}catch{i.nodestream=!1}},{"readable-stream":16}],31:[function(n,r,i){for(var o=n("./utils"),a=n("./support"),s=n("./nodejsUtils"),l=n("./stream/GenericWorker"),c=new Array(256),u=0;u<256;u++)c[u]=252<=u?6:248<=u?5:240<=u?4:224<=u?3:192<=u?2:1;c[254]=c[254]=1;function f(){l.call(this,"utf-8 decode"),this.leftOver=null}function d(){l.call(this,"utf-8 encode")}i.utf8encode=function(h){return a.nodebuffer?s.newBufferFrom(h,"utf-8"):function(p){var m,g,v,y,x,b=p.length,_=0;for(y=0;y<b;y++)(64512&(g=p.charCodeAt(y)))==55296&&y+1<b&&(64512&(v=p.charCodeAt(y+1)))==56320&&(g=65536+(g-55296<<10)+(v-56320),y++),_+=g<128?1:g<2048?2:g<65536?3:4;for(m=a.uint8array?new Uint8Array(_):new Array(_),y=x=0;x<_;y++)(64512&(g=p.charCodeAt(y)))==55296&&y+1<b&&(64512&(v=p.charCodeAt(y+1)))==56320&&(g=65536+(g-55296<<10)+(v-56320),y++),g<128?m[x++]=g:(g<2048?m[x++]=192|g>>>6:(g<65536?m[x++]=224|g>>>12:(m[x++]=240|g>>>18,m[x++]=128|g>>>12&63),m[x++]=128|g>>>6&63),m[x++]=128|63&g);return m}(h)},i.utf8decode=function(h){return a.nodebuffer?o.transformTo("nodebuffer",h).toString("utf-8"):function(p){var m,g,v,y,x=p.length,b=new Array(2*x);for(m=g=0;m<x;)if((v=p[m++])<128)b[g++]=v;else if(4<(y=c[v]))b[g++]=65533,m+=y-1;else{for(v&=y===2?31:y===3?15:7;1<y&&m<x;)v=v<<6|63&p[m++],y--;1<y?b[g++]=65533:v<65536?b[g++]=v:(v-=65536,b[g++]=55296|v>>10&1023,b[g++]=56320|1023&v)}return b.length!==g&&(b.subarray?b=b.subarray(0,g):b.length=g),o.applyFromCharCode(b)}(h=o.transformTo(a.uint8array?"uint8array":"array",h))},o.inherits(f,l),f.prototype.processChunk=function(h){var p=o.transformTo(a.uint8array?"uint8array":"array",h.data);if(this.leftOver&&this.leftOver.length){if(a.uint8array){var m=p;(p=new Uint8Array(m.length+this.leftOver.length)).set(this.leftOver,0),p.set(m,this.leftOver.length)}else p=this.leftOver.concat(p);this.leftOver=null}var g=function(y,x){var b;for((x=x||y.length)>y.length&&(x=y.length),b=x-1;0<=b&&(192&y[b])==128;)b--;return b<0||b===0?x:b+c[y[b]]>x?b:x}(p),v=p;g!==p.length&&(a.uint8array?(v=p.subarray(0,g),this.leftOver=p.subarray(g,p.length)):(v=p.slice(0,g),this.leftOver=p.slice(g,p.length))),this.push({data:i.utf8decode(v),meta:h.meta})},f.prototype.flush=function(){this.leftOver&&this.leftOver.length&&(this.push({data:i.utf8decode(this.leftOver),meta:{}}),this.leftOver=null)},i.Utf8DecodeWorker=f,o.inherits(d,l),d.prototype.processChunk=function(h){this.push({data:i.utf8encode(h.data),meta:h.meta})},i.Utf8EncodeWorker=d},{"./nodejsUtils":14,"./stream/GenericWorker":28,"./support":30,"./utils":32}],32:[function(n,r,i){var o=n("./support"),a=n("./base64"),s=n("./nodejsUtils"),l=n("./external");function c(m){return m}function u(m,g){for(var v=0;v<m.length;++v)g[v]=255&m.charCodeAt(v);return g}n("setimmediate"),i.newBlob=function(m,g){i.checkSupport("blob");try{return new Blob([m],{type:g})}catch{try{var v=new(self.BlobBuilder||self.WebKitBlobBuilder||self.MozBlobBuilder||self.MSBlobBuilder);return v.append(m),v.getBlob(g)}catch{throw new Error("Bug : can't construct the Blob.")}}};var f={stringifyByChunk:function(m,g,v){var y=[],x=0,b=m.length;if(b<=v)return String.fromCharCode.apply(null,m);for(;x<b;)g==="array"||g==="nodebuffer"?y.push(String.fromCharCode.apply(null,m.slice(x,Math.min(x+v,b)))):y.push(String.fromCharCode.apply(null,m.subarray(x,Math.min(x+v,b)))),x+=v;return y.join("")},stringifyByChar:function(m){for(var g="",v=0;v<m.length;v++)g+=String.fromCharCode(m[v]);return g},applyCanBeUsed:{uint8array:function(){try{return o.uint8array&&String.fromCharCode.apply(null,new Uint8Array(1)).length===1}catch{return!1}}(),nodebuffer:function(){try{return o.nodebuffer&&String.fromCharCode.apply(null,s.allocBuffer(1)).length===1}catch{return!1}}()}};function d(m){var g=65536,v=i.getTypeOf(m),y=!0;if(v==="uint8array"?y=f.applyCanBeUsed.uint8array:v==="nodebuffer"&&(y=f.applyCanBeUsed.nodebuffer),y)for(;1<g;)try{return f.stringifyByChunk(m,v,g)}catch{g=Math.floor(g/2)}return f.stringifyByChar(m)}function h(m,g){for(var v=0;v<m.length;v++)g[v]=m[v];return g}i.applyFromCharCode=d;var p={};p.string={string:c,array:function(m){return u(m,new Array(m.length))},arraybuffer:function(m){return p.string.uint8array(m).buffer},uint8array:function(m){return u(m,new Uint8Array(m.length))},nodebuffer:function(m){return u(m,s.allocBuffer(m.length))}},p.array={string:d,array:c,arraybuffer:function(m){return new Uint8Array(m).buffer},uint8array:function(m){return new Uint8Array(m)},nodebuffer:function(m){return s.newBufferFrom(m)}},p.arraybuffer={string:function(m){return d(new Uint8Array(m))},array:function(m){return h(new Uint8Array(m),new Array(m.byteLength))},arraybuffer:c,uint8array:function(m){return new Uint8Array(m)},nodebuffer:function(m){return s.newBufferFrom(new Uint8Array(m))}},p.uint8array={string:d,array:function(m){return h(m,new Array(m.length))},arraybuffer:function(m){return m.buffer},uint8array:c,nodebuffer:function(m){return s.newBufferFrom(m)}},p.nodebuffer={string:d,array:function(m){return h(m,new Array(m.length))},arraybuffer:function(m){return p.nodebuffer.uint8array(m).buffer},uint8array:function(m){return h(m,new Uint8Array(m.length))},nodebuffer:c},i.transformTo=function(m,g){if(g=g||"",!m)return g;i.checkSupport(m);var v=i.getTypeOf(g);return p[v][m](g)},i.resolve=function(m){for(var g=m.split("/"),v=[],y=0;y<g.length;y++){var x=g[y];x==="."||x===""&&y!==0&&y!==g.length-1||(x===".."?v.pop():v.push(x))}return v.join("/")},i.getTypeOf=function(m){return typeof m=="string"?"string":Object.prototype.toString.call(m)==="[object Array]"?"array":o.nodebuffer&&s.isBuffer(m)?"nodebuffer":o.uint8array&&m instanceof Uint8Array?"uint8array":o.arraybuffer&&m instanceof ArrayBuffer?"arraybuffer":void 0},i.checkSupport=function(m){if(!o[m.toLowerCase()])throw new Error(m+" is not supported by this platform")},i.MAX_VALUE_16BITS=65535,i.MAX_VALUE_32BITS=-1,i.pretty=function(m){var g,v,y="";for(v=0;v<(m||"").length;v++)y+="\\x"+((g=m.charCodeAt(v))<16?"0":"")+g.toString(16).toUpperCase();return y},i.delay=function(m,g,v){setImmediate(function(){m.apply(v||null,g||[])})},i.inherits=function(m,g){function v(){}v.prototype=g.prototype,m.prototype=new v},i.extend=function(){var m,g,v={};for(m=0;m<arguments.length;m++)for(g in arguments[m])Object.prototype.hasOwnProperty.call(arguments[m],g)&&v[g]===void 0&&(v[g]=arguments[m][g]);return v},i.prepareContent=function(m,g,v,y,x){return l.Promise.resolve(g).then(function(b){return o.blob&&(b instanceof Blob||["[object File]","[object Blob]"].indexOf(Object.prototype.toString.call(b))!==-1)&&typeof FileReader<"u"?new l.Promise(function(_,S){var O=new FileReader;O.onload=function(C){_(C.target.result)},O.onerror=function(C){S(C.target.error)},O.readAsArrayBuffer(b)}):b}).then(function(b){var _=i.getTypeOf(b);return _?(_==="arraybuffer"?b=i.transformTo("uint8array",b):_==="string"&&(x?b=a.decode(b):v&&y!==!0&&(b=function(S){return u(S,o.uint8array?new Uint8Array(S.length):new Array(S.length))}(b))),b):l.Promise.reject(new Error("Can't read the data of '"+m+"'. Is it in a supported JavaScript type (String, Blob, ArrayBuffer, etc) ?"))})}},{"./base64":1,"./external":6,"./nodejsUtils":14,"./support":30,setimmediate:54}],33:[function(n,r,i){var o=n("./reader/readerFor"),a=n("./utils"),s=n("./signature"),l=n("./zipEntry"),c=n("./support");function u(f){this.files=[],this.loadOptions=f}u.prototype={checkSignature:function(f){if(!this.reader.readAndCheckSignature(f)){this.reader.index-=4;var d=this.reader.readString(4);throw new Error("Corrupted zip or bug: unexpected signature ("+a.pretty(d)+", expected "+a.pretty(f)+")")}},isSignature:function(f,d){var h=this.reader.index;this.reader.setIndex(f);var p=this.reader.readString(4)===d;return this.reader.setIndex(h),p},readBlockEndOfCentral:function(){this.diskNumber=this.reader.readInt(2),this.diskWithCentralDirStart=this.reader.readInt(2),this.centralDirRecordsOnThisDisk=this.reader.readInt(2),this.centralDirRecords=this.reader.readInt(2),this.centralDirSize=this.reader.readInt(4),this.centralDirOffset=this.reader.readInt(4),this.zipCommentLength=this.reader.readInt(2);var f=this.reader.readData(this.zipCommentLength),d=c.uint8array?"uint8array":"array",h=a.transformTo(d,f);this.zipComment=this.loadOptions.decodeFileName(h)},readBlockZip64EndOfCentral:function(){this.zip64EndOfCentralSize=this.reader.readInt(8),this.reader.skip(4),this.diskNumber=this.reader.readInt(4),this.diskWithCentralDirStart=this.reader.readInt(4),this.centralDirRecordsOnThisDisk=this.reader.readInt(8),this.centralDirRecords=this.reader.readInt(8),this.centralDirSize=this.reader.readInt(8),this.centralDirOffset=this.reader.readInt(8),this.zip64ExtensibleData={};for(var f,d,h,p=this.zip64EndOfCentralSize-44;0<p;)f=this.reader.readInt(2),d=this.reader.readInt(4),h=this.reader.readData(d),this.zip64ExtensibleData[f]={id:f,length:d,value:h}},readBlockZip64EndOfCentralLocator:function(){if(this.diskWithZip64CentralDirStart=this.reader.readInt(4),this.relativeOffsetEndOfZip64CentralDir=this.reader.readInt(8),this.disksCount=this.reader.readInt(4),1<this.disksCount)throw new Error("Multi-volumes zip are not supported")},readLocalFiles:function(){var f,d;for(f=0;f<this.files.length;f++)d=this.files[f],this.reader.setIndex(d.localHeaderOffset),this.checkSignature(s.LOCAL_FILE_HEADER),d.readLocalPart(this.reader),d.handleUTF8(),d.processAttributes()},readCentralDir:function(){var f;for(this.reader.setIndex(this.centralDirOffset);this.reader.readAndCheckSignature(s.CENTRAL_FILE_HEADER);)(f=new l({zip64:this.zip64},this.loadOptions)).readCentralPart(this.reader),this.files.push(f);if(this.centralDirRecords!==this.files.length&&this.centralDirRecords!==0&&this.files.length===0)throw new Error("Corrupted zip or bug: expected "+this.centralDirRecords+" records in central dir, got "+this.files.length)},readEndOfCentral:function(){var f=this.reader.lastIndexOfSignature(s.CENTRAL_DIRECTORY_END);if(f<0)throw this.isSignature(0,s.LOCAL_FILE_HEADER)?new Error("Corrupted zip: can't find end of central directory"):new Error("Can't find end of central directory : is this a zip file ? If it is, see https://stuk.github.io/jszip/documentation/howto/read_zip.html");this.reader.setIndex(f);var d=f;if(this.checkSignature(s.CENTRAL_DIRECTORY_END),this.readBlockEndOfCentral(),this.diskNumber===a.MAX_VALUE_16BITS||this.diskWithCentralDirStart===a.MAX_VALUE_16BITS||this.centralDirRecordsOnThisDisk===a.MAX_VALUE_16BITS||this.centralDirRecords===a.MAX_VALUE_16BITS||this.centralDirSize===a.MAX_VALUE_32BITS||this.centralDirOffset===a.MAX_VALUE_32BITS){if(this.zip64=!0,(f=this.reader.lastIndexOfSignature(s.ZIP64_CENTRAL_DIRECTORY_LOCATOR))<0)throw new Error("Corrupted zip: can't find the ZIP64 end of central directory locator");if(this.reader.setIndex(f),this.checkSignature(s.ZIP64_CENTRAL_DIRECTORY_LOCATOR),this.readBlockZip64EndOfCentralLocator(),!this.isSignature(this.relativeOffsetEndOfZip64CentralDir,s.ZIP64_CENTRAL_DIRECTORY_END)&&(this.relativeOffsetEndOfZip64CentralDir=this.reader.lastIndexOfSignature(s.ZIP64_CENTRAL_DIRECTORY_END),this.relativeOffsetEndOfZip64CentralDir<0))throw new Error("Corrupted zip: can't find the ZIP64 end of central directory");this.reader.setIndex(this.relativeOffsetEndOfZip64CentralDir),this.checkSignature(s.ZIP64_CENTRAL_DIRECTORY_END),this.readBlockZip64EndOfCentral()}var h=this.centralDirOffset+this.centralDirSize;this.zip64&&(h+=20,h+=12+this.zip64EndOfCentralSize);var p=d-h;if(0<p)this.isSignature(d,s.CENTRAL_FILE_HEADER)||(this.reader.zero=p);else if(p<0)throw new Error("Corrupted zip: missing "+Math.abs(p)+" bytes.")},prepareReader:function(f){this.reader=o(f)},load:function(f){this.prepareReader(f),this.readEndOfCentral(),this.readCentralDir(),this.readLocalFiles()}},r.exports=u},{"./reader/readerFor":22,"./signature":23,"./support":30,"./utils":32,"./zipEntry":34}],34:[function(n,r,i){var o=n("./reader/readerFor"),a=n("./utils"),s=n("./compressedObject"),l=n("./crc32"),c=n("./utf8"),u=n("./compressions"),f=n("./support");function d(h,p){this.options=h,this.loadOptions=p}d.prototype={isEncrypted:function(){return(1&this.bitFlag)==1},useUTF8:function(){return(2048&this.bitFlag)==2048},readLocalPart:function(h){var p,m;if(h.skip(22),this.fileNameLength=h.readInt(2),m=h.readInt(2),this.fileName=h.readData(this.fileNameLength),h.skip(m),this.compressedSize===-1||this.uncompressedSize===-1)throw new Error("Bug or corrupted zip : didn't get enough information from the central directory (compressedSize === -1 || uncompressedSize === -1)");if((p=function(g){for(var v in u)if(Object.prototype.hasOwnProperty.call(u,v)&&u[v].magic===g)return u[v];return null}(this.compressionMethod))===null)throw new Error("Corrupted zip : compression "+a.pretty(this.compressionMethod)+" unknown (inner file : "+a.transformTo("string",this.fileName)+")");this.decompressed=new s(this.compressedSize,this.uncompressedSize,this.crc32,p,h.readData(this.compressedSize))},readCentralPart:function(h){this.versionMadeBy=h.readInt(2),h.skip(2),this.bitFlag=h.readInt(2),this.compressionMethod=h.readString(2),this.date=h.readDate(),this.crc32=h.readInt(4),this.compressedSize=h.readInt(4),this.uncompressedSize=h.readInt(4);var p=h.readInt(2);if(this.extraFieldsLength=h.readInt(2),this.fileCommentLength=h.readInt(2),this.diskNumberStart=h.readInt(2),this.internalFileAttributes=h.readInt(2),this.externalFileAttributes=h.readInt(4),this.localHeaderOffset=h.readInt(4),this.isEncrypted())throw new Error("Encrypted zip are not supported");h.skip(p),this.readExtraFields(h),this.parseZIP64ExtraField(h),this.fileComment=h.readData(this.fileCommentLength)},processAttributes:function(){this.unixPermissions=null,this.dosPermissions=null;var h=this.versionMadeBy>>8;this.dir=!!(16&this.externalFileAttributes),h==0&&(this.dosPermissions=63&this.externalFileAttributes),h==3&&(this.unixPermissions=this.externalFileAttributes>>16&65535),this.dir||this.fileNameStr.slice(-1)!=="/"||(this.dir=!0)},parseZIP64ExtraField:function(){if(this.extraFields[1]){var h=o(this.extraFields[1].value);this.uncompressedSize===a.MAX_VALUE_32BITS&&(this.uncompressedSize=h.readInt(8)),this.compressedSize===a.MAX_VALUE_32BITS&&(this.compressedSize=h.readInt(8)),this.localHeaderOffset===a.MAX_VALUE_32BITS&&(this.localHeaderOffset=h.readInt(8)),this.diskNumberStart===a.MAX_VALUE_32BITS&&(this.diskNumberStart=h.readInt(4))}},readExtraFields:function(h){var p,m,g,v=h.index+this.extraFieldsLength;for(this.extraFields||(this.extraFields={});h.index+4<v;)p=h.readInt(2),m=h.readInt(2),g=h.readData(m),this.extraFields[p]={id:p,length:m,value:g};h.setIndex(v)},handleUTF8:function(){var h=f.uint8array?"uint8array":"array";if(this.useUTF8())this.fileNameStr=c.utf8decode(this.fileName),this.fileCommentStr=c.utf8decode(this.fileComment);else{var p=this.findExtraFieldUnicodePath();if(p!==null)this.fileNameStr=p;else{var m=a.transformTo(h,this.fileName);this.fileNameStr=this.loadOptions.decodeFileName(m)}var g=this.findExtraFieldUnicodeComment();if(g!==null)this.fileCommentStr=g;else{var v=a.transformTo(h,this.fileComment);this.fileCommentStr=this.loadOptions.decodeFileName(v)}}},findExtraFieldUnicodePath:function(){var h=this.extraFields[28789];if(h){var p=o(h.value);return p.readInt(1)!==1||l(this.fileName)!==p.readInt(4)?null:c.utf8decode(p.readData(h.length-5))}return null},findExtraFieldUnicodeComment:function(){var h=this.extraFields[25461];if(h){var p=o(h.value);return p.readInt(1)!==1||l(this.fileComment)!==p.readInt(4)?null:c.utf8decode(p.readData(h.length-5))}return null}},r.exports=d},{"./compressedObject":2,"./compressions":3,"./crc32":4,"./reader/readerFor":22,"./support":30,"./utf8":31,"./utils":32}],35:[function(n,r,i){function o(p,m,g){this.name=p,this.dir=g.dir,this.date=g.date,this.comment=g.comment,this.unixPermissions=g.unixPermissions,this.dosPermissions=g.dosPermissions,this._data=m,this._dataBinary=g.binary,this.options={compression:g.compression,compressionOptions:g.compressionOptions}}var a=n("./stream/StreamHelper"),s=n("./stream/DataWorker"),l=n("./utf8"),c=n("./compressedObject"),u=n("./stream/GenericWorker");o.prototype={internalStream:function(p){var m=null,g="string";try{if(!p)throw new Error("No output type specified.");var v=(g=p.toLowerCase())==="string"||g==="text";g!=="binarystring"&&g!=="text"||(g="string"),m=this._decompressWorker();var y=!this._dataBinary;y&&!v&&(m=m.pipe(new l.Utf8EncodeWorker)),!y&&v&&(m=m.pipe(new l.Utf8DecodeWorker))}catch(x){(m=new u("error")).error(x)}return new a(m,g,"")},async:function(p,m){return this.internalStream(p).accumulate(m)},nodeStream:function(p,m){return this.internalStream(p||"nodebuffer").toNodejsStream(m)},_compressWorker:function(p,m){if(this._data instanceof c&&this._data.compression.magic===p.magic)return this._data.getCompressedWorker();var g=this._decompressWorker();return this._dataBinary||(g=g.pipe(new l.Utf8EncodeWorker)),c.createWorkerFrom(g,p,m)},_decompressWorker:function(){return this._data instanceof c?this._data.getContentWorker():this._data instanceof u?this._data:new s(this._data)}};for(var f=["asText","asBinary","asNodeBuffer","asUint8Array","asArrayBuffer"],d=function(){throw new Error("This method has been removed in JSZip 3.0, please check the upgrade guide.")},h=0;h<f.length;h++)o.prototype[f[h]]=d;r.exports=o},{"./compressedObject":2,"./stream/DataWorker":27,"./stream/GenericWorker":28,"./stream/StreamHelper":29,"./utf8":31}],36:[function(n,r,i){(function(o){var a,s,l=o.MutationObserver||o.WebKitMutationObserver;if(l){var c=0,u=new l(p),f=o.document.createTextNode("");u.observe(f,{characterData:!0}),a=function(){f.data=c=++c%2}}else if(o.setImmediate||o.MessageChannel===void 0)a="document"in o&&"onreadystatechange"in o.document.createElement("script")?function(){var m=o.document.createElement("script");m.onreadystatechange=function(){p(),m.onreadystatechange=null,m.parentNode.removeChild(m),m=null},o.document.documentElement.appendChild(m)}:function(){setTimeout(p,0)};else{var d=new o.MessageChannel;d.port1.onmessage=p,a=function(){d.port2.postMessage(0)}}var h=[];function p(){var m,g;s=!0;for(var v=h.length;v;){for(g=h,h=[],m=-1;++m<v;)g[m]();v=h.length}s=!1}r.exports=function(m){h.push(m)!==1||s||a()}}).call(this,typeof Zn<"u"?Zn:typeof self<"u"?self:typeof window<"u"?window:{})},{}],37:[function(n,r,i){var o=n("immediate");function a(){}var s={},l=["REJECTED"],c=["FULFILLED"],u=["PENDING"];function f(v){if(typeof v!="function")throw new TypeError("resolver must be a function");this.state=u,this.queue=[],this.outcome=void 0,v!==a&&m(this,v)}function d(v,y,x){this.promise=v,typeof y=="function"&&(this.onFulfilled=y,this.callFulfilled=this.otherCallFulfilled),typeof x=="function"&&(this.onRejected=x,this.callRejected=this.otherCallRejected)}function h(v,y,x){o(function(){var b;try{b=y(x)}catch(_){return s.reject(v,_)}b===v?s.reject(v,new TypeError("Cannot resolve promise with itself")):s.resolve(v,b)})}function p(v){var y=v&&v.then;if(v&&(typeof v=="object"||typeof v=="function")&&typeof y=="function")return function(){y.apply(v,arguments)}}function m(v,y){var x=!1;function b(O){x||(x=!0,s.reject(v,O))}function _(O){x||(x=!0,s.resolve(v,O))}var S=g(function(){y(_,b)});S.status==="error"&&b(S.value)}function g(v,y){var x={};try{x.value=v(y),x.status="success"}catch(b){x.status="error",x.value=b}return x}(r.exports=f).prototype.finally=function(v){if(typeof v!="function")return this;var y=this.constructor;return this.then(function(x){return y.resolve(v()).then(function(){return x})},function(x){return y.resolve(v()).then(function(){throw x})})},f.prototype.catch=function(v){return this.then(null,v)},f.prototype.then=function(v,y){if(typeof v!="function"&&this.state===c||typeof y!="function"&&this.state===l)return this;var x=new this.constructor(a);return this.state!==u?h(x,this.state===c?v:y,this.outcome):this.queue.push(new d(x,v,y)),x},d.prototype.callFulfilled=function(v){s.resolve(this.promise,v)},d.prototype.otherCallFulfilled=function(v){h(this.promise,this.onFulfilled,v)},d.prototype.callRejected=function(v){s.reject(this.promise,v)},d.prototype.otherCallRejected=function(v){h(this.promise,this.onRejected,v)},s.resolve=function(v,y){var x=g(p,y);if(x.status==="error")return s.reject(v,x.value);var b=x.value;if(b)m(v,b);else{v.state=c,v.outcome=y;for(var _=-1,S=v.queue.length;++_<S;)v.queue[_].callFulfilled(y)}return v},s.reject=function(v,y){v.state=l,v.outcome=y;for(var x=-1,b=v.queue.length;++x<b;)v.queue[x].callRejected(y);return v},f.resolve=function(v){return v instanceof this?v:s.resolve(new this(a),v)},f.reject=function(v){var y=new this(a);return s.reject(y,v)},f.all=function(v){var y=this;if(Object.prototype.toString.call(v)!=="[object Array]")return this.reject(new TypeError("must be an array"));var x=v.length,b=!1;if(!x)return this.resolve([]);for(var _=new Array(x),S=0,O=-1,C=new this(a);++O<x;)E(v[O],O);return C;function E(k,I){y.resolve(k).then(function(P){_[I]=P,++S!==x||b||(b=!0,s.resolve(C,_))},function(P){b||(b=!0,s.reject(C,P))})}},f.race=function(v){var y=this;if(Object.prototype.toString.call(v)!=="[object Array]")return this.reject(new TypeError("must be an array"));var x=v.length,b=!1;if(!x)return this.resolve([]);for(var _=-1,S=new this(a);++_<x;)O=v[_],y.resolve(O).then(function(C){b||(b=!0,s.resolve(S,C))},function(C){b||(b=!0,s.reject(S,C))});var O;return S}},{immediate:36}],38:[function(n,r,i){var o={};(0,n("./lib/utils/common").assign)(o,n("./lib/deflate"),n("./lib/inflate"),n("./lib/zlib/constants")),r.exports=o},{"./lib/deflate":39,"./lib/inflate":40,"./lib/utils/common":41,"./lib/zlib/constants":44}],39:[function(n,r,i){var o=n("./zlib/deflate"),a=n("./utils/common"),s=n("./utils/strings"),l=n("./zlib/messages"),c=n("./zlib/zstream"),u=Object.prototype.toString,f=0,d=-1,h=0,p=8;function m(v){if(!(this instanceof m))return new m(v);this.options=a.assign({level:d,method:p,chunkSize:16384,windowBits:15,memLevel:8,strategy:h,to:""},v||{});var y=this.options;y.raw&&0<y.windowBits?y.windowBits=-y.windowBits:y.gzip&&0<y.windowBits&&y.windowBits<16&&(y.windowBits+=16),this.err=0,this.msg="",this.ended=!1,this.chunks=[],this.strm=new c,this.strm.avail_out=0;var x=o.deflateInit2(this.strm,y.level,y.method,y.windowBits,y.memLevel,y.strategy);if(x!==f)throw new Error(l[x]);if(y.header&&o.deflateSetHeader(this.strm,y.header),y.dictionary){var b;if(b=typeof y.dictionary=="string"?s.string2buf(y.dictionary):u.call(y.dictionary)==="[object ArrayBuffer]"?new Uint8Array(y.dictionary):y.dictionary,(x=o.deflateSetDictionary(this.strm,b))!==f)throw new Error(l[x]);this._dict_set=!0}}function g(v,y){var x=new m(y);if(x.push(v,!0),x.err)throw x.msg||l[x.err];return x.result}m.prototype.push=function(v,y){var x,b,_=this.strm,S=this.options.chunkSize;if(this.ended)return!1;b=y===~~y?y:y===!0?4:0,typeof v=="string"?_.input=s.string2buf(v):u.call(v)==="[object ArrayBuffer]"?_.input=new Uint8Array(v):_.input=v,_.next_in=0,_.avail_in=_.input.length;do{if(_.avail_out===0&&(_.output=new a.Buf8(S),_.next_out=0,_.avail_out=S),(x=o.deflate(_,b))!==1&&x!==f)return this.onEnd(x),!(this.ended=!0);_.avail_out!==0&&(_.avail_in!==0||b!==4&&b!==2)||(this.options.to==="string"?this.onData(s.buf2binstring(a.shrinkBuf(_.output,_.next_out))):this.onData(a.shrinkBuf(_.output,_.next_out)))}while((0<_.avail_in||_.avail_out===0)&&x!==1);return b===4?(x=o.deflateEnd(this.strm),this.onEnd(x),this.ended=!0,x===f):b!==2||(this.onEnd(f),!(_.avail_out=0))},m.prototype.onData=function(v){this.chunks.push(v)},m.prototype.onEnd=function(v){v===f&&(this.options.to==="string"?this.result=this.chunks.join(""):this.result=a.flattenChunks(this.chunks)),this.chunks=[],this.err=v,this.msg=this.strm.msg},i.Deflate=m,i.deflate=g,i.deflateRaw=function(v,y){return(y=y||{}).raw=!0,g(v,y)},i.gzip=function(v,y){return(y=y||{}).gzip=!0,g(v,y)}},{"./utils/common":41,"./utils/strings":42,"./zlib/deflate":46,"./zlib/messages":51,"./zlib/zstream":53}],40:[function(n,r,i){var o=n("./zlib/inflate"),a=n("./utils/common"),s=n("./utils/strings"),l=n("./zlib/constants"),c=n("./zlib/messages"),u=n("./zlib/zstream"),f=n("./zlib/gzheader"),d=Object.prototype.toString;function h(m){if(!(this instanceof h))return new h(m);this.options=a.assign({chunkSize:16384,windowBits:0,to:""},m||{});var g=this.options;g.raw&&0<=g.windowBits&&g.windowBits<16&&(g.windowBits=-g.windowBits,g.windowBits===0&&(g.windowBits=-15)),!(0<=g.windowBits&&g.windowBits<16)||m&&m.windowBits||(g.windowBits+=32),15<g.windowBits&&g.windowBits<48&&!(15&g.windowBits)&&(g.windowBits|=15),this.err=0,this.msg="",this.ended=!1,this.chunks=[],this.strm=new u,this.strm.avail_out=0;var v=o.inflateInit2(this.strm,g.windowBits);if(v!==l.Z_OK)throw new Error(c[v]);this.header=new f,o.inflateGetHeader(this.strm,this.header)}function p(m,g){var v=new h(g);if(v.push(m,!0),v.err)throw v.msg||c[v.err];return v.result}h.prototype.push=function(m,g){var v,y,x,b,_,S,O=this.strm,C=this.options.chunkSize,E=this.options.dictionary,k=!1;if(this.ended)return!1;y=g===~~g?g:g===!0?l.Z_FINISH:l.Z_NO_FLUSH,typeof m=="string"?O.input=s.binstring2buf(m):d.call(m)==="[object ArrayBuffer]"?O.input=new Uint8Array(m):O.input=m,O.next_in=0,O.avail_in=O.input.length;do{if(O.avail_out===0&&(O.output=new a.Buf8(C),O.next_out=0,O.avail_out=C),(v=o.inflate(O,l.Z_NO_FLUSH))===l.Z_NEED_DICT&&E&&(S=typeof E=="string"?s.string2buf(E):d.call(E)==="[object ArrayBuffer]"?new Uint8Array(E):E,v=o.inflateSetDictionary(this.strm,S)),v===l.Z_BUF_ERROR&&k===!0&&(v=l.Z_OK,k=!1),v!==l.Z_STREAM_END&&v!==l.Z_OK)return this.onEnd(v),!(this.ended=!0);O.next_out&&(O.avail_out!==0&&v!==l.Z_STREAM_END&&(O.avail_in!==0||y!==l.Z_FINISH&&y!==l.Z_SYNC_FLUSH)||(this.options.to==="string"?(x=s.utf8border(O.output,O.next_out),b=O.next_out-x,_=s.buf2string(O.output,x),O.next_out=b,O.avail_out=C-b,b&&a.arraySet(O.output,O.output,x,b,0),this.onData(_)):this.onData(a.shrinkBuf(O.output,O.next_out)))),O.avail_in===0&&O.avail_out===0&&(k=!0)}while((0<O.avail_in||O.avail_out===0)&&v!==l.Z_STREAM_END);return v===l.Z_STREAM_END&&(y=l.Z_FINISH),y===l.Z_FINISH?(v=o.inflateEnd(this.strm),this.onEnd(v),this.ended=!0,v===l.Z_OK):y!==l.Z_SYNC_FLUSH||(this.onEnd(l.Z_OK),!(O.avail_out=0))},h.prototype.onData=function(m){this.chunks.push(m)},h.prototype.onEnd=function(m){m===l.Z_OK&&(this.options.to==="string"?this.result=this.chunks.join(""):this.result=a.flattenChunks(this.chunks)),this.chunks=[],this.err=m,this.msg=this.strm.msg},i.Inflate=h,i.inflate=p,i.inflateRaw=function(m,g){return(g=g||{}).raw=!0,p(m,g)},i.ungzip=p},{"./utils/common":41,"./utils/strings":42,"./zlib/constants":44,"./zlib/gzheader":47,"./zlib/inflate":49,"./zlib/messages":51,"./zlib/zstream":53}],41:[function(n,r,i){var o=typeof Uint8Array<"u"&&typeof Uint16Array<"u"&&typeof Int32Array<"u";i.assign=function(l){for(var c=Array.prototype.slice.call(arguments,1);c.length;){var u=c.shift();if(u){if(typeof u!="object")throw new TypeError(u+"must be non-object");for(var f in u)u.hasOwnProperty(f)&&(l[f]=u[f])}}return l},i.shrinkBuf=function(l,c){return l.length===c?l:l.subarray?l.subarray(0,c):(l.length=c,l)};var a={arraySet:function(l,c,u,f,d){if(c.subarray&&l.subarray)l.set(c.subarray(u,u+f),d);else for(var h=0;h<f;h++)l[d+h]=c[u+h]},flattenChunks:function(l){var c,u,f,d,h,p;for(c=f=0,u=l.length;c<u;c++)f+=l[c].length;for(p=new Uint8Array(f),c=d=0,u=l.length;c<u;c++)h=l[c],p.set(h,d),d+=h.length;return p}},s={arraySet:function(l,c,u,f,d){for(var h=0;h<f;h++)l[d+h]=c[u+h]},flattenChunks:function(l){return[].concat.apply([],l)}};i.setTyped=function(l){l?(i.Buf8=Uint8Array,i.Buf16=Uint16Array,i.Buf32=Int32Array,i.assign(i,a)):(i.Buf8=Array,i.Buf16=Array,i.Buf32=Array,i.assign(i,s))},i.setTyped(o)},{}],42:[function(n,r,i){var o=n("./common"),a=!0,s=!0;try{String.fromCharCode.apply(null,[0])}catch{a=!1}try{String.fromCharCode.apply(null,new Uint8Array(1))}catch{s=!1}for(var l=new o.Buf8(256),c=0;c<256;c++)l[c]=252<=c?6:248<=c?5:240<=c?4:224<=c?3:192<=c?2:1;function u(f,d){if(d<65537&&(f.subarray&&s||!f.subarray&&a))return String.fromCharCode.apply(null,o.shrinkBuf(f,d));for(var h="",p=0;p<d;p++)h+=String.fromCharCode(f[p]);return h}l[254]=l[254]=1,i.string2buf=function(f){var d,h,p,m,g,v=f.length,y=0;for(m=0;m<v;m++)(64512&(h=f.charCodeAt(m)))==55296&&m+1<v&&(64512&(p=f.charCodeAt(m+1)))==56320&&(h=65536+(h-55296<<10)+(p-56320),m++),y+=h<128?1:h<2048?2:h<65536?3:4;for(d=new o.Buf8(y),m=g=0;g<y;m++)(64512&(h=f.charCodeAt(m)))==55296&&m+1<v&&(64512&(p=f.charCodeAt(m+1)))==56320&&(h=65536+(h-55296<<10)+(p-56320),m++),h<128?d[g++]=h:(h<2048?d[g++]=192|h>>>6:(h<65536?d[g++]=224|h>>>12:(d[g++]=240|h>>>18,d[g++]=128|h>>>12&63),d[g++]=128|h>>>6&63),d[g++]=128|63&h);return d},i.buf2binstring=function(f){return u(f,f.length)},i.binstring2buf=function(f){for(var d=new o.Buf8(f.length),h=0,p=d.length;h<p;h++)d[h]=f.charCodeAt(h);return d},i.buf2string=function(f,d){var h,p,m,g,v=d||f.length,y=new Array(2*v);for(h=p=0;h<v;)if((m=f[h++])<128)y[p++]=m;else if(4<(g=l[m]))y[p++]=65533,h+=g-1;else{for(m&=g===2?31:g===3?15:7;1<g&&h<v;)m=m<<6|63&f[h++],g--;1<g?y[p++]=65533:m<65536?y[p++]=m:(m-=65536,y[p++]=55296|m>>10&1023,y[p++]=56320|1023&m)}return u(y,p)},i.utf8border=function(f,d){var h;for((d=d||f.length)>f.length&&(d=f.length),h=d-1;0<=h&&(192&f[h])==128;)h--;return h<0||h===0?d:h+l[f[h]]>d?h:d}},{"./common":41}],43:[function(n,r,i){r.exports=function(o,a,s,l){for(var c=65535&o|0,u=o>>>16&65535|0,f=0;s!==0;){for(s-=f=2e3<s?2e3:s;u=u+(c=c+a[l++]|0)|0,--f;);c%=65521,u%=65521}return c|u<<16|0}},{}],44:[function(n,r,i){r.exports={Z_NO_FLUSH:0,Z_PARTIAL_FLUSH:1,Z_SYNC_FLUSH:2,Z_FULL_FLUSH:3,Z_FINISH:4,Z_BLOCK:5,Z_TREES:6,Z_OK:0,Z_STREAM_END:1,Z_NEED_DICT:2,Z_ERRNO:-1,Z_STREAM_ERROR:-2,Z_DATA_ERROR:-3,Z_BUF_ERROR:-5,Z_NO_COMPRESSION:0,Z_BEST_SPEED:1,Z_BEST_COMPRESSION:9,Z_DEFAULT_COMPRESSION:-1,Z_FILTERED:1,Z_HUFFMAN_ONLY:2,Z_RLE:3,Z_FIXED:4,Z_DEFAULT_STRATEGY:0,Z_BINARY:0,Z_TEXT:1,Z_UNKNOWN:2,Z_DEFLATED:8}},{}],45:[function(n,r,i){var o=function(){for(var a,s=[],l=0;l<256;l++){a=l;for(var c=0;c<8;c++)a=1&a?3988292384^a>>>1:a>>>1;s[l]=a}return s}();r.exports=function(a,s,l,c){var u=o,f=c+l;a^=-1;for(var d=c;d<f;d++)a=a>>>8^u[255&(a^s[d])];return-1^a}},{}],46:[function(n,r,i){var o,a=n("../utils/common"),s=n("./trees"),l=n("./adler32"),c=n("./crc32"),u=n("./messages"),f=0,d=4,h=0,p=-2,m=-1,g=4,v=2,y=8,x=9,b=286,_=30,S=19,O=2*b+1,C=15,E=3,k=258,I=k+E+1,P=42,R=113,T=1,L=2,z=3,B=4;function U(F,ce){return F.msg=u[ce],ce}function W(F){return(F<<1)-(4<F?9:0)}function $(F){for(var ce=F.length;0<=--ce;)F[ce]=0}function N(F){var ce=F.state,le=ce.pending;le>F.avail_out&&(le=F.avail_out),le!==0&&(a.arraySet(F.output,ce.pending_buf,ce.pending_out,le,F.next_out),F.next_out+=le,ce.pending_out+=le,F.total_out+=le,F.avail_out-=le,ce.pending-=le,ce.pending===0&&(ce.pending_out=0))}function D(F,ce){s._tr_flush_block(F,0<=F.block_start?F.block_start:-1,F.strstart-F.block_start,ce),F.block_start=F.strstart,N(F.strm)}function A(F,ce){F.pending_buf[F.pending++]=ce}function q(F,ce){F.pending_buf[F.pending++]=ce>>>8&255,F.pending_buf[F.pending++]=255&ce}function Y(F,ce){var le,Q,X=F.max_chain_length,ee=F.strstart,ge=F.prev_length,ye=F.nice_match,H=F.strstart>F.w_size-I?F.strstart-(F.w_size-I):0,G=F.window,ie=F.w_mask,he=F.prev,_e=F.strstart+k,oe=G[ee+ge-1],Z=G[ee+ge];F.prev_length>=F.good_match&&(X>>=2),ye>F.lookahead&&(ye=F.lookahead);do if(G[(le=ce)+ge]===Z&&G[le+ge-1]===oe&&G[le]===G[ee]&&G[++le]===G[ee+1]){ee+=2,le++;do;while(G[++ee]===G[++le]&&G[++ee]===G[++le]&&G[++ee]===G[++le]&&G[++ee]===G[++le]&&G[++ee]===G[++le]&&G[++ee]===G[++le]&&G[++ee]===G[++le]&&G[++ee]===G[++le]&&ee<_e);if(Q=k-(_e-ee),ee=_e-k,ge<Q){if(F.match_start=ce,ye<=(ge=Q))break;oe=G[ee+ge-1],Z=G[ee+ge]}}while((ce=he[ce&ie])>H&&--X!=0);return ge<=F.lookahead?ge:F.lookahead}function K(F){var ce,le,Q,X,ee,ge,ye,H,G,ie,he=F.w_size;do{if(X=F.window_size-F.lookahead-F.strstart,F.strstart>=he+(he-I)){for(a.arraySet(F.window,F.window,he,he,0),F.match_start-=he,F.strstart-=he,F.block_start-=he,ce=le=F.hash_size;Q=F.head[--ce],F.head[ce]=he<=Q?Q-he:0,--le;);for(ce=le=he;Q=F.prev[--ce],F.prev[ce]=he<=Q?Q-he:0,--le;);X+=he}if(F.strm.avail_in===0)break;if(ge=F.strm,ye=F.window,H=F.strstart+F.lookahead,G=X,ie=void 0,ie=ge.avail_in,G<ie&&(ie=G),le=ie===0?0:(ge.avail_in-=ie,a.arraySet(ye,ge.input,ge.next_in,ie,H),ge.state.wrap===1?ge.adler=l(ge.adler,ye,ie,H):ge.state.wrap===2&&(ge.adler=c(ge.adler,ye,ie,H)),ge.next_in+=ie,ge.total_in+=ie,ie),F.lookahead+=le,F.lookahead+F.insert>=E)for(ee=F.strstart-F.insert,F.ins_h=F.window[ee],F.ins_h=(F.ins_h<<F.hash_shift^F.window[ee+1])&F.hash_mask;F.insert&&(F.ins_h=(F.ins_h<<F.hash_shift^F.window[ee+E-1])&F.hash_mask,F.prev[ee&F.w_mask]=F.head[F.ins_h],F.head[F.ins_h]=ee,ee++,F.insert--,!(F.lookahead+F.insert<E)););}while(F.lookahead<I&&F.strm.avail_in!==0)}function se(F,ce){for(var le,Q;;){if(F.lookahead<I){if(K(F),F.lookahead<I&&ce===f)return T;if(F.lookahead===0)break}if(le=0,F.lookahead>=E&&(F.ins_h=(F.ins_h<<F.hash_shift^F.window[F.strstart+E-1])&F.hash_mask,le=F.prev[F.strstart&F.w_mask]=F.head[F.ins_h],F.head[F.ins_h]=F.strstart),le!==0&&F.strstart-le<=F.w_size-I&&(F.match_length=Y(F,le)),F.match_length>=E)if(Q=s._tr_tally(F,F.strstart-F.match_start,F.match_length-E),F.lookahead-=F.match_length,F.match_length<=F.max_lazy_match&&F.lookahead>=E){for(F.match_length--;F.strstart++,F.ins_h=(F.ins_h<<F.hash_shift^F.window[F.strstart+E-1])&F.hash_mask,le=F.prev[F.strstart&F.w_mask]=F.head[F.ins_h],F.head[F.ins_h]=F.strstart,--F.match_length!=0;);F.strstart++}else F.strstart+=F.match_length,F.match_length=0,F.ins_h=F.window[F.strstart],F.ins_h=(F.ins_h<<F.hash_shift^F.window[F.strstart+1])&F.hash_mask;else Q=s._tr_tally(F,0,F.window[F.strstart]),F.lookahead--,F.strstart++;if(Q&&(D(F,!1),F.strm.avail_out===0))return T}return F.insert=F.strstart<E-1?F.strstart:E-1,ce===d?(D(F,!0),F.strm.avail_out===0?z:B):F.last_lit&&(D(F,!1),F.strm.avail_out===0)?T:L}function te(F,ce){for(var le,Q,X;;){if(F.lookahead<I){if(K(F),F.lookahead<I&&ce===f)return T;if(F.lookahead===0)break}if(le=0,F.lookahead>=E&&(F.ins_h=(F.ins_h<<F.hash_shift^F.window[F.strstart+E-1])&F.hash_mask,le=F.prev[F.strstart&F.w_mask]=F.head[F.ins_h],F.head[F.ins_h]=F.strstart),F.prev_length=F.match_length,F.prev_match=F.match_start,F.match_length=E-1,le!==0&&F.prev_length<F.max_lazy_match&&F.strstart-le<=F.w_size-I&&(F.match_length=Y(F,le),F.match_length<=5&&(F.strategy===1||F.match_length===E&&4096<F.strstart-F.match_start)&&(F.match_length=E-1)),F.prev_length>=E&&F.match_length<=F.prev_length){for(X=F.strstart+F.lookahead-E,Q=s._tr_tally(F,F.strstart-1-F.prev_match,F.prev_length-E),F.lookahead-=F.prev_length-1,F.prev_length-=2;++F.strstart<=X&&(F.ins_h=(F.ins_h<<F.hash_shift^F.window[F.strstart+E-1])&F.hash_mask,le=F.prev[F.strstart&F.w_mask]=F.head[F.ins_h],F.head[F.ins_h]=F.strstart),--F.prev_length!=0;);if(F.match_available=0,F.match_length=E-1,F.strstart++,Q&&(D(F,!1),F.strm.avail_out===0))return T}else if(F.match_available){if((Q=s._tr_tally(F,0,F.window[F.strstart-1]))&&D(F,!1),F.strstart++,F.lookahead--,F.strm.avail_out===0)return T}else F.match_available=1,F.strstart++,F.lookahead--}return F.match_available&&(Q=s._tr_tally(F,0,F.window[F.strstart-1]),F.match_available=0),F.insert=F.strstart<E-1?F.strstart:E-1,ce===d?(D(F,!0),F.strm.avail_out===0?z:B):F.last_lit&&(D(F,!1),F.strm.avail_out===0)?T:L}function J(F,ce,le,Q,X){this.good_length=F,this.max_lazy=ce,this.nice_length=le,this.max_chain=Q,this.func=X}function pe(){this.strm=null,this.status=0,this.pending_buf=null,this.pending_buf_size=0,this.pending_out=0,this.pending=0,this.wrap=0,this.gzhead=null,this.gzindex=0,this.method=y,this.last_flush=-1,this.w_size=0,this.w_bits=0,this.w_mask=0,this.window=null,this.window_size=0,this.prev=null,this.head=null,this.ins_h=0,this.hash_size=0,this.hash_bits=0,this.hash_mask=0,this.hash_shift=0,this.block_start=0,this.match_length=0,this.prev_match=0,this.match_available=0,this.strstart=0,this.match_start=0,this.lookahead=0,this.prev_length=0,this.max_chain_length=0,this.max_lazy_match=0,this.level=0,this.strategy=0,this.good_match=0,this.nice_match=0,this.dyn_ltree=new a.Buf16(2*O),this.dyn_dtree=new a.Buf16(2*(2*_+1)),this.bl_tree=new a.Buf16(2*(2*S+1)),$(this.dyn_ltree),$(this.dyn_dtree),$(this.bl_tree),this.l_desc=null,this.d_desc=null,this.bl_desc=null,this.bl_count=new a.Buf16(C+1),this.heap=new a.Buf16(2*b+1),$(this.heap),this.heap_len=0,this.heap_max=0,this.depth=new a.Buf16(2*b+1),$(this.depth),this.l_buf=0,this.lit_bufsize=0,this.last_lit=0,this.d_buf=0,this.opt_len=0,this.static_len=0,this.matches=0,this.insert=0,this.bi_buf=0,this.bi_valid=0}function be(F){var ce;return F&&F.state?(F.total_in=F.total_out=0,F.data_type=v,(ce=F.state).pending=0,ce.pending_out=0,ce.wrap<0&&(ce.wrap=-ce.wrap),ce.status=ce.wrap?P:R,F.adler=ce.wrap===2?0:1,ce.last_flush=f,s._tr_init(ce),h):U(F,p)}function re(F){var ce=be(F);return ce===h&&function(le){le.window_size=2*le.w_size,$(le.head),le.max_lazy_match=o[le.level].max_lazy,le.good_match=o[le.level].good_length,le.nice_match=o[le.level].nice_length,le.max_chain_length=o[le.level].max_chain,le.strstart=0,le.block_start=0,le.lookahead=0,le.insert=0,le.match_length=le.prev_length=E-1,le.match_available=0,le.ins_h=0}(F.state),ce}function ve(F,ce,le,Q,X,ee){if(!F)return p;var ge=1;if(ce===m&&(ce=6),Q<0?(ge=0,Q=-Q):15<Q&&(ge=2,Q-=16),X<1||x<X||le!==y||Q<8||15<Q||ce<0||9<ce||ee<0||g<ee)return U(F,p);Q===8&&(Q=9);var ye=new pe;return(F.state=ye).strm=F,ye.wrap=ge,ye.gzhead=null,ye.w_bits=Q,ye.w_size=1<<ye.w_bits,ye.w_mask=ye.w_size-1,ye.hash_bits=X+7,ye.hash_size=1<<ye.hash_bits,ye.hash_mask=ye.hash_size-1,ye.hash_shift=~~((ye.hash_bits+E-1)/E),ye.window=new a.Buf8(2*ye.w_size),ye.head=new a.Buf16(ye.hash_size),ye.prev=new a.Buf16(ye.w_size),ye.lit_bufsize=1<<X+6,ye.pending_buf_size=4*ye.lit_bufsize,ye.pending_buf=new a.Buf8(ye.pending_buf_size),ye.d_buf=1*ye.lit_bufsize,ye.l_buf=3*ye.lit_bufsize,ye.level=ce,ye.strategy=ee,ye.method=le,re(F)}o=[new J(0,0,0,0,function(F,ce){var le=65535;for(le>F.pending_buf_size-5&&(le=F.pending_buf_size-5);;){if(F.lookahead<=1){if(K(F),F.lookahead===0&&ce===f)return T;if(F.lookahead===0)break}F.strstart+=F.lookahead,F.lookahead=0;var Q=F.block_start+le;if((F.strstart===0||F.strstart>=Q)&&(F.lookahead=F.strstart-Q,F.strstart=Q,D(F,!1),F.strm.avail_out===0)||F.strstart-F.block_start>=F.w_size-I&&(D(F,!1),F.strm.avail_out===0))return T}return F.insert=0,ce===d?(D(F,!0),F.strm.avail_out===0?z:B):(F.strstart>F.block_start&&(D(F,!1),F.strm.avail_out),T)}),new J(4,4,8,4,se),new J(4,5,16,8,se),new J(4,6,32,32,se),new J(4,4,16,16,te),new J(8,16,32,32,te),new J(8,16,128,128,te),new J(8,32,128,256,te),new J(32,128,258,1024,te),new J(32,258,258,4096,te)],i.deflateInit=function(F,ce){return ve(F,ce,y,15,8,0)},i.deflateInit2=ve,i.deflateReset=re,i.deflateResetKeep=be,i.deflateSetHeader=function(F,ce){return F&&F.state?F.state.wrap!==2?p:(F.state.gzhead=ce,h):p},i.deflate=function(F,ce){var le,Q,X,ee;if(!F||!F.state||5<ce||ce<0)return F?U(F,p):p;if(Q=F.state,!F.output||!F.input&&F.avail_in!==0||Q.status===666&&ce!==d)return U(F,F.avail_out===0?-5:p);if(Q.strm=F,le=Q.last_flush,Q.last_flush=ce,Q.status===P)if(Q.wrap===2)F.adler=0,A(Q,31),A(Q,139),A(Q,8),Q.gzhead?(A(Q,(Q.gzhead.text?1:0)+(Q.gzhead.hcrc?2:0)+(Q.gzhead.extra?4:0)+(Q.gzhead.name?8:0)+(Q.gzhead.comment?16:0)),A(Q,255&Q.gzhead.time),A(Q,Q.gzhead.time>>8&255),A(Q,Q.gzhead.time>>16&255),A(Q,Q.gzhead.time>>24&255),A(Q,Q.level===9?2:2<=Q.strategy||Q.level<2?4:0),A(Q,255&Q.gzhead.os),Q.gzhead.extra&&Q.gzhead.extra.length&&(A(Q,255&Q.gzhead.extra.length),A(Q,Q.gzhead.extra.length>>8&255)),Q.gzhead.hcrc&&(F.adler=c(F.adler,Q.pending_buf,Q.pending,0)),Q.gzindex=0,Q.status=69):(A(Q,0),A(Q,0),A(Q,0),A(Q,0),A(Q,0),A(Q,Q.level===9?2:2<=Q.strategy||Q.level<2?4:0),A(Q,3),Q.status=R);else{var ge=y+(Q.w_bits-8<<4)<<8;ge|=(2<=Q.strategy||Q.level<2?0:Q.level<6?1:Q.level===6?2:3)<<6,Q.strstart!==0&&(ge|=32),ge+=31-ge%31,Q.status=R,q(Q,ge),Q.strstart!==0&&(q(Q,F.adler>>>16),q(Q,65535&F.adler)),F.adler=1}if(Q.status===69)if(Q.gzhead.extra){for(X=Q.pending;Q.gzindex<(65535&Q.gzhead.extra.length)&&(Q.pending!==Q.pending_buf_size||(Q.gzhead.hcrc&&Q.pending>X&&(F.adler=c(F.adler,Q.pending_buf,Q.pending-X,X)),N(F),X=Q.pending,Q.pending!==Q.pending_buf_size));)A(Q,255&Q.gzhead.extra[Q.gzindex]),Q.gzindex++;Q.gzhead.hcrc&&Q.pending>X&&(F.adler=c(F.adler,Q.pending_buf,Q.pending-X,X)),Q.gzindex===Q.gzhead.extra.length&&(Q.gzindex=0,Q.status=73)}else Q.status=73;if(Q.status===73)if(Q.gzhead.name){X=Q.pending;do{if(Q.pending===Q.pending_buf_size&&(Q.gzhead.hcrc&&Q.pending>X&&(F.adler=c(F.adler,Q.pending_buf,Q.pending-X,X)),N(F),X=Q.pending,Q.pending===Q.pending_buf_size)){ee=1;break}ee=Q.gzindex<Q.gzhead.name.length?255&Q.gzhead.name.charCodeAt(Q.gzindex++):0,A(Q,ee)}while(ee!==0);Q.gzhead.hcrc&&Q.pending>X&&(F.adler=c(F.adler,Q.pending_buf,Q.pending-X,X)),ee===0&&(Q.gzindex=0,Q.status=91)}else Q.status=91;if(Q.status===91)if(Q.gzhead.comment){X=Q.pending;do{if(Q.pending===Q.pending_buf_size&&(Q.gzhead.hcrc&&Q.pending>X&&(F.adler=c(F.adler,Q.pending_buf,Q.pending-X,X)),N(F),X=Q.pending,Q.pending===Q.pending_buf_size)){ee=1;break}ee=Q.gzindex<Q.gzhead.comment.length?255&Q.gzhead.comment.charCodeAt(Q.gzindex++):0,A(Q,ee)}while(ee!==0);Q.gzhead.hcrc&&Q.pending>X&&(F.adler=c(F.adler,Q.pending_buf,Q.pending-X,X)),ee===0&&(Q.status=103)}else Q.status=103;if(Q.status===103&&(Q.gzhead.hcrc?(Q.pending+2>Q.pending_buf_size&&N(F),Q.pending+2<=Q.pending_buf_size&&(A(Q,255&F.adler),A(Q,F.adler>>8&255),F.adler=0,Q.status=R)):Q.status=R),Q.pending!==0){if(N(F),F.avail_out===0)return Q.last_flush=-1,h}else if(F.avail_in===0&&W(ce)<=W(le)&&ce!==d)return U(F,-5);if(Q.status===666&&F.avail_in!==0)return U(F,-5);if(F.avail_in!==0||Q.lookahead!==0||ce!==f&&Q.status!==666){var ye=Q.strategy===2?function(H,G){for(var ie;;){if(H.lookahead===0&&(K(H),H.lookahead===0)){if(G===f)return T;break}if(H.match_length=0,ie=s._tr_tally(H,0,H.window[H.strstart]),H.lookahead--,H.strstart++,ie&&(D(H,!1),H.strm.avail_out===0))return T}return H.insert=0,G===d?(D(H,!0),H.strm.avail_out===0?z:B):H.last_lit&&(D(H,!1),H.strm.avail_out===0)?T:L}(Q,ce):Q.strategy===3?function(H,G){for(var ie,he,_e,oe,Z=H.window;;){if(H.lookahead<=k){if(K(H),H.lookahead<=k&&G===f)return T;if(H.lookahead===0)break}if(H.match_length=0,H.lookahead>=E&&0<H.strstart&&(he=Z[_e=H.strstart-1])===Z[++_e]&&he===Z[++_e]&&he===Z[++_e]){oe=H.strstart+k;do;while(he===Z[++_e]&&he===Z[++_e]&&he===Z[++_e]&&he===Z[++_e]&&he===Z[++_e]&&he===Z[++_e]&&he===Z[++_e]&&he===Z[++_e]&&_e<oe);H.match_length=k-(oe-_e),H.match_length>H.lookahead&&(H.match_length=H.lookahead)}if(H.match_length>=E?(ie=s._tr_tally(H,1,H.match_length-E),H.lookahead-=H.match_length,H.strstart+=H.match_length,H.match_length=0):(ie=s._tr_tally(H,0,H.window[H.strstart]),H.lookahead--,H.strstart++),ie&&(D(H,!1),H.strm.avail_out===0))return T}return H.insert=0,G===d?(D(H,!0),H.strm.avail_out===0?z:B):H.last_lit&&(D(H,!1),H.strm.avail_out===0)?T:L}(Q,ce):o[Q.level].func(Q,ce);if(ye!==z&&ye!==B||(Q.status=666),ye===T||ye===z)return F.avail_out===0&&(Q.last_flush=-1),h;if(ye===L&&(ce===1?s._tr_align(Q):ce!==5&&(s._tr_stored_block(Q,0,0,!1),ce===3&&($(Q.head),Q.lookahead===0&&(Q.strstart=0,Q.block_start=0,Q.insert=0))),N(F),F.avail_out===0))return Q.last_flush=-1,h}return ce!==d?h:Q.wrap<=0?1:(Q.wrap===2?(A(Q,255&F.adler),A(Q,F.adler>>8&255),A(Q,F.adler>>16&255),A(Q,F.adler>>24&255),A(Q,255&F.total_in),A(Q,F.total_in>>8&255),A(Q,F.total_in>>16&255),A(Q,F.total_in>>24&255)):(q(Q,F.adler>>>16),q(Q,65535&F.adler)),N(F),0<Q.wrap&&(Q.wrap=-Q.wrap),Q.pending!==0?h:1)},i.deflateEnd=function(F){var ce;return F&&F.state?(ce=F.state.status)!==P&&ce!==69&&ce!==73&&ce!==91&&ce!==103&&ce!==R&&ce!==666?U(F,p):(F.state=null,ce===R?U(F,-3):h):p},i.deflateSetDictionary=function(F,ce){var le,Q,X,ee,ge,ye,H,G,ie=ce.length;if(!F||!F.state||(ee=(le=F.state).wrap)===2||ee===1&&le.status!==P||le.lookahead)return p;for(ee===1&&(F.adler=l(F.adler,ce,ie,0)),le.wrap=0,ie>=le.w_size&&(ee===0&&($(le.head),le.strstart=0,le.block_start=0,le.insert=0),G=new a.Buf8(le.w_size),a.arraySet(G,ce,ie-le.w_size,le.w_size,0),ce=G,ie=le.w_size),ge=F.avail_in,ye=F.next_in,H=F.input,F.avail_in=ie,F.next_in=0,F.input=ce,K(le);le.lookahead>=E;){for(Q=le.strstart,X=le.lookahead-(E-1);le.ins_h=(le.ins_h<<le.hash_shift^le.window[Q+E-1])&le.hash_mask,le.prev[Q&le.w_mask]=le.head[le.ins_h],le.head[le.ins_h]=Q,Q++,--X;);le.strstart=Q,le.lookahead=E-1,K(le)}return le.strstart+=le.lookahead,le.block_start=le.strstart,le.insert=le.lookahead,le.lookahead=0,le.match_length=le.prev_length=E-1,le.match_available=0,F.next_in=ye,F.input=H,F.avail_in=ge,le.wrap=ee,h},i.deflateInfo="pako deflate (from Nodeca project)"},{"../utils/common":41,"./adler32":43,"./crc32":45,"./messages":51,"./trees":52}],47:[function(n,r,i){r.exports=function(){this.text=0,this.time=0,this.xflags=0,this.os=0,this.extra=null,this.extra_len=0,this.name="",this.comment="",this.hcrc=0,this.done=!1}},{}],48:[function(n,r,i){r.exports=function(o,a){var s,l,c,u,f,d,h,p,m,g,v,y,x,b,_,S,O,C,E,k,I,P,R,T,L;s=o.state,l=o.next_in,T=o.input,c=l+(o.avail_in-5),u=o.next_out,L=o.output,f=u-(a-o.avail_out),d=u+(o.avail_out-257),h=s.dmax,p=s.wsize,m=s.whave,g=s.wnext,v=s.window,y=s.hold,x=s.bits,b=s.lencode,_=s.distcode,S=(1<<s.lenbits)-1,O=(1<<s.distbits)-1;e:do{x<15&&(y+=T[l++]<<x,x+=8,y+=T[l++]<<x,x+=8),C=b[y&S];t:for(;;){if(y>>>=E=C>>>24,x-=E,(E=C>>>16&255)===0)L[u++]=65535&C;else{if(!(16&E)){if(!(64&E)){C=b[(65535&C)+(y&(1<<E)-1)];continue t}if(32&E){s.mode=12;break e}o.msg="invalid literal/length code",s.mode=30;break e}k=65535&C,(E&=15)&&(x<E&&(y+=T[l++]<<x,x+=8),k+=y&(1<<E)-1,y>>>=E,x-=E),x<15&&(y+=T[l++]<<x,x+=8,y+=T[l++]<<x,x+=8),C=_[y&O];n:for(;;){if(y>>>=E=C>>>24,x-=E,!(16&(E=C>>>16&255))){if(!(64&E)){C=_[(65535&C)+(y&(1<<E)-1)];continue n}o.msg="invalid distance code",s.mode=30;break e}if(I=65535&C,x<(E&=15)&&(y+=T[l++]<<x,(x+=8)<E&&(y+=T[l++]<<x,x+=8)),h<(I+=y&(1<<E)-1)){o.msg="invalid distance too far back",s.mode=30;break e}if(y>>>=E,x-=E,(E=u-f)<I){if(m<(E=I-E)&&s.sane){o.msg="invalid distance too far back",s.mode=30;break e}if(R=v,(P=0)===g){if(P+=p-E,E<k){for(k-=E;L[u++]=v[P++],--E;);P=u-I,R=L}}else if(g<E){if(P+=p+g-E,(E-=g)<k){for(k-=E;L[u++]=v[P++],--E;);if(P=0,g<k){for(k-=E=g;L[u++]=v[P++],--E;);P=u-I,R=L}}}else if(P+=g-E,E<k){for(k-=E;L[u++]=v[P++],--E;);P=u-I,R=L}for(;2<k;)L[u++]=R[P++],L[u++]=R[P++],L[u++]=R[P++],k-=3;k&&(L[u++]=R[P++],1<k&&(L[u++]=R[P++]))}else{for(P=u-I;L[u++]=L[P++],L[u++]=L[P++],L[u++]=L[P++],2<(k-=3););k&&(L[u++]=L[P++],1<k&&(L[u++]=L[P++]))}break}}break}}while(l<c&&u<d);l-=k=x>>3,y&=(1<<(x-=k<<3))-1,o.next_in=l,o.next_out=u,o.avail_in=l<c?c-l+5:5-(l-c),o.avail_out=u<d?d-u+257:257-(u-d),s.hold=y,s.bits=x}},{}],49:[function(n,r,i){var o=n("../utils/common"),a=n("./adler32"),s=n("./crc32"),l=n("./inffast"),c=n("./inftrees"),u=1,f=2,d=0,h=-2,p=1,m=852,g=592;function v(P){return(P>>>24&255)+(P>>>8&65280)+((65280&P)<<8)+((255&P)<<24)}function y(){this.mode=0,this.last=!1,this.wrap=0,this.havedict=!1,this.flags=0,this.dmax=0,this.check=0,this.total=0,this.head=null,this.wbits=0,this.wsize=0,this.whave=0,this.wnext=0,this.window=null,this.hold=0,this.bits=0,this.length=0,this.offset=0,this.extra=0,this.lencode=null,this.distcode=null,this.lenbits=0,this.distbits=0,this.ncode=0,this.nlen=0,this.ndist=0,this.have=0,this.next=null,this.lens=new o.Buf16(320),this.work=new o.Buf16(288),this.lendyn=null,this.distdyn=null,this.sane=0,this.back=0,this.was=0}function x(P){var R;return P&&P.state?(R=P.state,P.total_in=P.total_out=R.total=0,P.msg="",R.wrap&&(P.adler=1&R.wrap),R.mode=p,R.last=0,R.havedict=0,R.dmax=32768,R.head=null,R.hold=0,R.bits=0,R.lencode=R.lendyn=new o.Buf32(m),R.distcode=R.distdyn=new o.Buf32(g),R.sane=1,R.back=-1,d):h}function b(P){var R;return P&&P.state?((R=P.state).wsize=0,R.whave=0,R.wnext=0,x(P)):h}function _(P,R){var T,L;return P&&P.state?(L=P.state,R<0?(T=0,R=-R):(T=1+(R>>4),R<48&&(R&=15)),R&&(R<8||15<R)?h:(L.window!==null&&L.wbits!==R&&(L.window=null),L.wrap=T,L.wbits=R,b(P))):h}function S(P,R){var T,L;return P?(L=new y,(P.state=L).window=null,(T=_(P,R))!==d&&(P.state=null),T):h}var O,C,E=!0;function k(P){if(E){var R;for(O=new o.Buf32(512),C=new o.Buf32(32),R=0;R<144;)P.lens[R++]=8;for(;R<256;)P.lens[R++]=9;for(;R<280;)P.lens[R++]=7;for(;R<288;)P.lens[R++]=8;for(c(u,P.lens,0,288,O,0,P.work,{bits:9}),R=0;R<32;)P.lens[R++]=5;c(f,P.lens,0,32,C,0,P.work,{bits:5}),E=!1}P.lencode=O,P.lenbits=9,P.distcode=C,P.distbits=5}function I(P,R,T,L){var z,B=P.state;return B.window===null&&(B.wsize=1<<B.wbits,B.wnext=0,B.whave=0,B.window=new o.Buf8(B.wsize)),L>=B.wsize?(o.arraySet(B.window,R,T-B.wsize,B.wsize,0),B.wnext=0,B.whave=B.wsize):(L<(z=B.wsize-B.wnext)&&(z=L),o.arraySet(B.window,R,T-L,z,B.wnext),(L-=z)?(o.arraySet(B.window,R,T-L,L,0),B.wnext=L,B.whave=B.wsize):(B.wnext+=z,B.wnext===B.wsize&&(B.wnext=0),B.whave<B.wsize&&(B.whave+=z))),0}i.inflateReset=b,i.inflateReset2=_,i.inflateResetKeep=x,i.inflateInit=function(P){return S(P,15)},i.inflateInit2=S,i.inflate=function(P,R){var T,L,z,B,U,W,$,N,D,A,q,Y,K,se,te,J,pe,be,re,ve,F,ce,le,Q,X=0,ee=new o.Buf8(4),ge=[16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15];if(!P||!P.state||!P.output||!P.input&&P.avail_in!==0)return h;(T=P.state).mode===12&&(T.mode=13),U=P.next_out,z=P.output,$=P.avail_out,B=P.next_in,L=P.input,W=P.avail_in,N=T.hold,D=T.bits,A=W,q=$,ce=d;e:for(;;)switch(T.mode){case p:if(T.wrap===0){T.mode=13;break}for(;D<16;){if(W===0)break e;W--,N+=L[B++]<<D,D+=8}if(2&T.wrap&&N===35615){ee[T.check=0]=255&N,ee[1]=N>>>8&255,T.check=s(T.check,ee,2,0),D=N=0,T.mode=2;break}if(T.flags=0,T.head&&(T.head.done=!1),!(1&T.wrap)||(((255&N)<<8)+(N>>8))%31){P.msg="incorrect header check",T.mode=30;break}if((15&N)!=8){P.msg="unknown compression method",T.mode=30;break}if(D-=4,F=8+(15&(N>>>=4)),T.wbits===0)T.wbits=F;else if(F>T.wbits){P.msg="invalid window size",T.mode=30;break}T.dmax=1<<F,P.adler=T.check=1,T.mode=512&N?10:12,D=N=0;break;case 2:for(;D<16;){if(W===0)break e;W--,N+=L[B++]<<D,D+=8}if(T.flags=N,(255&T.flags)!=8){P.msg="unknown compression method",T.mode=30;break}if(57344&T.flags){P.msg="unknown header flags set",T.mode=30;break}T.head&&(T.head.text=N>>8&1),512&T.flags&&(ee[0]=255&N,ee[1]=N>>>8&255,T.check=s(T.check,ee,2,0)),D=N=0,T.mode=3;case 3:for(;D<32;){if(W===0)break e;W--,N+=L[B++]<<D,D+=8}T.head&&(T.head.time=N),512&T.flags&&(ee[0]=255&N,ee[1]=N>>>8&255,ee[2]=N>>>16&255,ee[3]=N>>>24&255,T.check=s(T.check,ee,4,0)),D=N=0,T.mode=4;case 4:for(;D<16;){if(W===0)break e;W--,N+=L[B++]<<D,D+=8}T.head&&(T.head.xflags=255&N,T.head.os=N>>8),512&T.flags&&(ee[0]=255&N,ee[1]=N>>>8&255,T.check=s(T.check,ee,2,0)),D=N=0,T.mode=5;case 5:if(1024&T.flags){for(;D<16;){if(W===0)break e;W--,N+=L[B++]<<D,D+=8}T.length=N,T.head&&(T.head.extra_len=N),512&T.flags&&(ee[0]=255&N,ee[1]=N>>>8&255,T.check=s(T.check,ee,2,0)),D=N=0}else T.head&&(T.head.extra=null);T.mode=6;case 6:if(1024&T.flags&&(W<(Y=T.length)&&(Y=W),Y&&(T.head&&(F=T.head.extra_len-T.length,T.head.extra||(T.head.extra=new Array(T.head.extra_len)),o.arraySet(T.head.extra,L,B,Y,F)),512&T.flags&&(T.check=s(T.check,L,Y,B)),W-=Y,B+=Y,T.length-=Y),T.length))break e;T.length=0,T.mode=7;case 7:if(2048&T.flags){if(W===0)break e;for(Y=0;F=L[B+Y++],T.head&&F&&T.length<65536&&(T.head.name+=String.fromCharCode(F)),F&&Y<W;);if(512&T.flags&&(T.check=s(T.check,L,Y,B)),W-=Y,B+=Y,F)break e}else T.head&&(T.head.name=null);T.length=0,T.mode=8;case 8:if(4096&T.flags){if(W===0)break e;for(Y=0;F=L[B+Y++],T.head&&F&&T.length<65536&&(T.head.comment+=String.fromCharCode(F)),F&&Y<W;);if(512&T.flags&&(T.check=s(T.check,L,Y,B)),W-=Y,B+=Y,F)break e}else T.head&&(T.head.comment=null);T.mode=9;case 9:if(512&T.flags){for(;D<16;){if(W===0)break e;W--,N+=L[B++]<<D,D+=8}if(N!==(65535&T.check)){P.msg="header crc mismatch",T.mode=30;break}D=N=0}T.head&&(T.head.hcrc=T.flags>>9&1,T.head.done=!0),P.adler=T.check=0,T.mode=12;break;case 10:for(;D<32;){if(W===0)break e;W--,N+=L[B++]<<D,D+=8}P.adler=T.check=v(N),D=N=0,T.mode=11;case 11:if(T.havedict===0)return P.next_out=U,P.avail_out=$,P.next_in=B,P.avail_in=W,T.hold=N,T.bits=D,2;P.adler=T.check=1,T.mode=12;case 12:if(R===5||R===6)break e;case 13:if(T.last){N>>>=7&D,D-=7&D,T.mode=27;break}for(;D<3;){if(W===0)break e;W--,N+=L[B++]<<D,D+=8}switch(T.last=1&N,D-=1,3&(N>>>=1)){case 0:T.mode=14;break;case 1:if(k(T),T.mode=20,R!==6)break;N>>>=2,D-=2;break e;case 2:T.mode=17;break;case 3:P.msg="invalid block type",T.mode=30}N>>>=2,D-=2;break;case 14:for(N>>>=7&D,D-=7&D;D<32;){if(W===0)break e;W--,N+=L[B++]<<D,D+=8}if((65535&N)!=(N>>>16^65535)){P.msg="invalid stored block lengths",T.mode=30;break}if(T.length=65535&N,D=N=0,T.mode=15,R===6)break e;case 15:T.mode=16;case 16:if(Y=T.length){if(W<Y&&(Y=W),$<Y&&(Y=$),Y===0)break e;o.arraySet(z,L,B,Y,U),W-=Y,B+=Y,$-=Y,U+=Y,T.length-=Y;break}T.mode=12;break;case 17:for(;D<14;){if(W===0)break e;W--,N+=L[B++]<<D,D+=8}if(T.nlen=257+(31&N),N>>>=5,D-=5,T.ndist=1+(31&N),N>>>=5,D-=5,T.ncode=4+(15&N),N>>>=4,D-=4,286<T.nlen||30<T.ndist){P.msg="too many length or distance symbols",T.mode=30;break}T.have=0,T.mode=18;case 18:for(;T.have<T.ncode;){for(;D<3;){if(W===0)break e;W--,N+=L[B++]<<D,D+=8}T.lens[ge[T.have++]]=7&N,N>>>=3,D-=3}for(;T.have<19;)T.lens[ge[T.have++]]=0;if(T.lencode=T.lendyn,T.lenbits=7,le={bits:T.lenbits},ce=c(0,T.lens,0,19,T.lencode,0,T.work,le),T.lenbits=le.bits,ce){P.msg="invalid code lengths set",T.mode=30;break}T.have=0,T.mode=19;case 19:for(;T.have<T.nlen+T.ndist;){for(;J=(X=T.lencode[N&(1<<T.lenbits)-1])>>>16&255,pe=65535&X,!((te=X>>>24)<=D);){if(W===0)break e;W--,N+=L[B++]<<D,D+=8}if(pe<16)N>>>=te,D-=te,T.lens[T.have++]=pe;else{if(pe===16){for(Q=te+2;D<Q;){if(W===0)break e;W--,N+=L[B++]<<D,D+=8}if(N>>>=te,D-=te,T.have===0){P.msg="invalid bit length repeat",T.mode=30;break}F=T.lens[T.have-1],Y=3+(3&N),N>>>=2,D-=2}else if(pe===17){for(Q=te+3;D<Q;){if(W===0)break e;W--,N+=L[B++]<<D,D+=8}D-=te,F=0,Y=3+(7&(N>>>=te)),N>>>=3,D-=3}else{for(Q=te+7;D<Q;){if(W===0)break e;W--,N+=L[B++]<<D,D+=8}D-=te,F=0,Y=11+(127&(N>>>=te)),N>>>=7,D-=7}if(T.have+Y>T.nlen+T.ndist){P.msg="invalid bit length repeat",T.mode=30;break}for(;Y--;)T.lens[T.have++]=F}}if(T.mode===30)break;if(T.lens[256]===0){P.msg="invalid code -- missing end-of-block",T.mode=30;break}if(T.lenbits=9,le={bits:T.lenbits},ce=c(u,T.lens,0,T.nlen,T.lencode,0,T.work,le),T.lenbits=le.bits,ce){P.msg="invalid literal/lengths set",T.mode=30;break}if(T.distbits=6,T.distcode=T.distdyn,le={bits:T.distbits},ce=c(f,T.lens,T.nlen,T.ndist,T.distcode,0,T.work,le),T.distbits=le.bits,ce){P.msg="invalid distances set",T.mode=30;break}if(T.mode=20,R===6)break e;case 20:T.mode=21;case 21:if(6<=W&&258<=$){P.next_out=U,P.avail_out=$,P.next_in=B,P.avail_in=W,T.hold=N,T.bits=D,l(P,q),U=P.next_out,z=P.output,$=P.avail_out,B=P.next_in,L=P.input,W=P.avail_in,N=T.hold,D=T.bits,T.mode===12&&(T.back=-1);break}for(T.back=0;J=(X=T.lencode[N&(1<<T.lenbits)-1])>>>16&255,pe=65535&X,!((te=X>>>24)<=D);){if(W===0)break e;W--,N+=L[B++]<<D,D+=8}if(J&&!(240&J)){for(be=te,re=J,ve=pe;J=(X=T.lencode[ve+((N&(1<<be+re)-1)>>be)])>>>16&255,pe=65535&X,!(be+(te=X>>>24)<=D);){if(W===0)break e;W--,N+=L[B++]<<D,D+=8}N>>>=be,D-=be,T.back+=be}if(N>>>=te,D-=te,T.back+=te,T.length=pe,J===0){T.mode=26;break}if(32&J){T.back=-1,T.mode=12;break}if(64&J){P.msg="invalid literal/length code",T.mode=30;break}T.extra=15&J,T.mode=22;case 22:if(T.extra){for(Q=T.extra;D<Q;){if(W===0)break e;W--,N+=L[B++]<<D,D+=8}T.length+=N&(1<<T.extra)-1,N>>>=T.extra,D-=T.extra,T.back+=T.extra}T.was=T.length,T.mode=23;case 23:for(;J=(X=T.distcode[N&(1<<T.distbits)-1])>>>16&255,pe=65535&X,!((te=X>>>24)<=D);){if(W===0)break e;W--,N+=L[B++]<<D,D+=8}if(!(240&J)){for(be=te,re=J,ve=pe;J=(X=T.distcode[ve+((N&(1<<be+re)-1)>>be)])>>>16&255,pe=65535&X,!(be+(te=X>>>24)<=D);){if(W===0)break e;W--,N+=L[B++]<<D,D+=8}N>>>=be,D-=be,T.back+=be}if(N>>>=te,D-=te,T.back+=te,64&J){P.msg="invalid distance code",T.mode=30;break}T.offset=pe,T.extra=15&J,T.mode=24;case 24:if(T.extra){for(Q=T.extra;D<Q;){if(W===0)break e;W--,N+=L[B++]<<D,D+=8}T.offset+=N&(1<<T.extra)-1,N>>>=T.extra,D-=T.extra,T.back+=T.extra}if(T.offset>T.dmax){P.msg="invalid distance too far back",T.mode=30;break}T.mode=25;case 25:if($===0)break e;if(Y=q-$,T.offset>Y){if((Y=T.offset-Y)>T.whave&&T.sane){P.msg="invalid distance too far back",T.mode=30;break}K=Y>T.wnext?(Y-=T.wnext,T.wsize-Y):T.wnext-Y,Y>T.length&&(Y=T.length),se=T.window}else se=z,K=U-T.offset,Y=T.length;for($<Y&&(Y=$),$-=Y,T.length-=Y;z[U++]=se[K++],--Y;);T.length===0&&(T.mode=21);break;case 26:if($===0)break e;z[U++]=T.length,$--,T.mode=21;break;case 27:if(T.wrap){for(;D<32;){if(W===0)break e;W--,N|=L[B++]<<D,D+=8}if(q-=$,P.total_out+=q,T.total+=q,q&&(P.adler=T.check=T.flags?s(T.check,z,q,U-q):a(T.check,z,q,U-q)),q=$,(T.flags?N:v(N))!==T.check){P.msg="incorrect data check",T.mode=30;break}D=N=0}T.mode=28;case 28:if(T.wrap&&T.flags){for(;D<32;){if(W===0)break e;W--,N+=L[B++]<<D,D+=8}if(N!==(4294967295&T.total)){P.msg="incorrect length check",T.mode=30;break}D=N=0}T.mode=29;case 29:ce=1;break e;case 30:ce=-3;break e;case 31:return-4;case 32:default:return h}return P.next_out=U,P.avail_out=$,P.next_in=B,P.avail_in=W,T.hold=N,T.bits=D,(T.wsize||q!==P.avail_out&&T.mode<30&&(T.mode<27||R!==4))&&I(P,P.output,P.next_out,q-P.avail_out)?(T.mode=31,-4):(A-=P.avail_in,q-=P.avail_out,P.total_in+=A,P.total_out+=q,T.total+=q,T.wrap&&q&&(P.adler=T.check=T.flags?s(T.check,z,q,P.next_out-q):a(T.check,z,q,P.next_out-q)),P.data_type=T.bits+(T.last?64:0)+(T.mode===12?128:0)+(T.mode===20||T.mode===15?256:0),(A==0&&q===0||R===4)&&ce===d&&(ce=-5),ce)},i.inflateEnd=function(P){if(!P||!P.state)return h;var R=P.state;return R.window&&(R.window=null),P.state=null,d},i.inflateGetHeader=function(P,R){var T;return P&&P.state&&2&(T=P.state).wrap?((T.head=R).done=!1,d):h},i.inflateSetDictionary=function(P,R){var T,L=R.length;return P&&P.state?(T=P.state).wrap!==0&&T.mode!==11?h:T.mode===11&&a(1,R,L,0)!==T.check?-3:I(P,R,L,L)?(T.mode=31,-4):(T.havedict=1,d):h},i.inflateInfo="pako inflate (from Nodeca project)"},{"../utils/common":41,"./adler32":43,"./crc32":45,"./inffast":48,"./inftrees":50}],50:[function(n,r,i){var o=n("../utils/common"),a=[3,4,5,6,7,8,9,10,11,13,15,17,19,23,27,31,35,43,51,59,67,83,99,115,131,163,195,227,258,0,0],s=[16,16,16,16,16,16,16,16,17,17,17,17,18,18,18,18,19,19,19,19,20,20,20,20,21,21,21,21,16,72,78],l=[1,2,3,4,5,7,9,13,17,25,33,49,65,97,129,193,257,385,513,769,1025,1537,2049,3073,4097,6145,8193,12289,16385,24577,0,0],c=[16,16,16,16,17,17,18,18,19,19,20,20,21,21,22,22,23,23,24,24,25,25,26,26,27,27,28,28,29,29,64,64];r.exports=function(u,f,d,h,p,m,g,v){var y,x,b,_,S,O,C,E,k,I=v.bits,P=0,R=0,T=0,L=0,z=0,B=0,U=0,W=0,$=0,N=0,D=null,A=0,q=new o.Buf16(16),Y=new o.Buf16(16),K=null,se=0;for(P=0;P<=15;P++)q[P]=0;for(R=0;R<h;R++)q[f[d+R]]++;for(z=I,L=15;1<=L&&q[L]===0;L--);if(L<z&&(z=L),L===0)return p[m++]=20971520,p[m++]=20971520,v.bits=1,0;for(T=1;T<L&&q[T]===0;T++);for(z<T&&(z=T),P=W=1;P<=15;P++)if(W<<=1,(W-=q[P])<0)return-1;if(0<W&&(u===0||L!==1))return-1;for(Y[1]=0,P=1;P<15;P++)Y[P+1]=Y[P]+q[P];for(R=0;R<h;R++)f[d+R]!==0&&(g[Y[f[d+R]]++]=R);if(O=u===0?(D=K=g,19):u===1?(D=a,A-=257,K=s,se-=257,256):(D=l,K=c,-1),P=T,S=m,U=R=N=0,b=-1,_=($=1<<(B=z))-1,u===1&&852<$||u===2&&592<$)return 1;for(;;){for(C=P-U,k=g[R]<O?(E=0,g[R]):g[R]>O?(E=K[se+g[R]],D[A+g[R]]):(E=96,0),y=1<<P-U,T=x=1<<B;p[S+(N>>U)+(x-=y)]=C<<24|E<<16|k|0,x!==0;);for(y=1<<P-1;N&y;)y>>=1;if(y!==0?(N&=y-1,N+=y):N=0,R++,--q[P]==0){if(P===L)break;P=f[d+g[R]]}if(z<P&&(N&_)!==b){for(U===0&&(U=z),S+=T,W=1<<(B=P-U);B+U<L&&!((W-=q[B+U])<=0);)B++,W<<=1;if($+=1<<B,u===1&&852<$||u===2&&592<$)return 1;p[b=N&_]=z<<24|B<<16|S-m|0}}return N!==0&&(p[S+N]=P-U<<24|64<<16|0),v.bits=z,0}},{"../utils/common":41}],51:[function(n,r,i){r.exports={2:"need dictionary",1:"stream end",0:"","-1":"file error","-2":"stream error","-3":"data error","-4":"insufficient memory","-5":"buffer error","-6":"incompatible version"}},{}],52:[function(n,r,i){var o=n("../utils/common"),a=0,s=1;function l(X){for(var ee=X.length;0<=--ee;)X[ee]=0}var c=0,u=29,f=256,d=f+1+u,h=30,p=19,m=2*d+1,g=15,v=16,y=7,x=256,b=16,_=17,S=18,O=[0,0,0,0,0,0,0,0,1,1,1,1,2,2,2,2,3,3,3,3,4,4,4,4,5,5,5,5,0],C=[0,0,0,0,1,1,2,2,3,3,4,4,5,5,6,6,7,7,8,8,9,9,10,10,11,11,12,12,13,13],E=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2,3,7],k=[16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15],I=new Array(2*(d+2));l(I);var P=new Array(2*h);l(P);var R=new Array(512);l(R);var T=new Array(256);l(T);var L=new Array(u);l(L);var z,B,U,W=new Array(h);function $(X,ee,ge,ye,H){this.static_tree=X,this.extra_bits=ee,this.extra_base=ge,this.elems=ye,this.max_length=H,this.has_stree=X&&X.length}function N(X,ee){this.dyn_tree=X,this.max_code=0,this.stat_desc=ee}function D(X){return X<256?R[X]:R[256+(X>>>7)]}function A(X,ee){X.pending_buf[X.pending++]=255&ee,X.pending_buf[X.pending++]=ee>>>8&255}function q(X,ee,ge){X.bi_valid>v-ge?(X.bi_buf|=ee<<X.bi_valid&65535,A(X,X.bi_buf),X.bi_buf=ee>>v-X.bi_valid,X.bi_valid+=ge-v):(X.bi_buf|=ee<<X.bi_valid&65535,X.bi_valid+=ge)}function Y(X,ee,ge){q(X,ge[2*ee],ge[2*ee+1])}function K(X,ee){for(var ge=0;ge|=1&X,X>>>=1,ge<<=1,0<--ee;);return ge>>>1}function se(X,ee,ge){var ye,H,G=new Array(g+1),ie=0;for(ye=1;ye<=g;ye++)G[ye]=ie=ie+ge[ye-1]<<1;for(H=0;H<=ee;H++){var he=X[2*H+1];he!==0&&(X[2*H]=K(G[he]++,he))}}function te(X){var ee;for(ee=0;ee<d;ee++)X.dyn_ltree[2*ee]=0;for(ee=0;ee<h;ee++)X.dyn_dtree[2*ee]=0;for(ee=0;ee<p;ee++)X.bl_tree[2*ee]=0;X.dyn_ltree[2*x]=1,X.opt_len=X.static_len=0,X.last_lit=X.matches=0}function J(X){8<X.bi_valid?A(X,X.bi_buf):0<X.bi_valid&&(X.pending_buf[X.pending++]=X.bi_buf),X.bi_buf=0,X.bi_valid=0}function pe(X,ee,ge,ye){var H=2*ee,G=2*ge;return X[H]<X[G]||X[H]===X[G]&&ye[ee]<=ye[ge]}function be(X,ee,ge){for(var ye=X.heap[ge],H=ge<<1;H<=X.heap_len&&(H<X.heap_len&&pe(ee,X.heap[H+1],X.heap[H],X.depth)&&H++,!pe(ee,ye,X.heap[H],X.depth));)X.heap[ge]=X.heap[H],ge=H,H<<=1;X.heap[ge]=ye}function re(X,ee,ge){var ye,H,G,ie,he=0;if(X.last_lit!==0)for(;ye=X.pending_buf[X.d_buf+2*he]<<8|X.pending_buf[X.d_buf+2*he+1],H=X.pending_buf[X.l_buf+he],he++,ye===0?Y(X,H,ee):(Y(X,(G=T[H])+f+1,ee),(ie=O[G])!==0&&q(X,H-=L[G],ie),Y(X,G=D(--ye),ge),(ie=C[G])!==0&&q(X,ye-=W[G],ie)),he<X.last_lit;);Y(X,x,ee)}function ve(X,ee){var ge,ye,H,G=ee.dyn_tree,ie=ee.stat_desc.static_tree,he=ee.stat_desc.has_stree,_e=ee.stat_desc.elems,oe=-1;for(X.heap_len=0,X.heap_max=m,ge=0;ge<_e;ge++)G[2*ge]!==0?(X.heap[++X.heap_len]=oe=ge,X.depth[ge]=0):G[2*ge+1]=0;for(;X.heap_len<2;)G[2*(H=X.heap[++X.heap_len]=oe<2?++oe:0)]=1,X.depth[H]=0,X.opt_len--,he&&(X.static_len-=ie[2*H+1]);for(ee.max_code=oe,ge=X.heap_len>>1;1<=ge;ge--)be(X,G,ge);for(H=_e;ge=X.heap[1],X.heap[1]=X.heap[X.heap_len--],be(X,G,1),ye=X.heap[1],X.heap[--X.heap_max]=ge,X.heap[--X.heap_max]=ye,G[2*H]=G[2*ge]+G[2*ye],X.depth[H]=(X.depth[ge]>=X.depth[ye]?X.depth[ge]:X.depth[ye])+1,G[2*ge+1]=G[2*ye+1]=H,X.heap[1]=H++,be(X,G,1),2<=X.heap_len;);X.heap[--X.heap_max]=X.heap[1],function(Z,V){var de,xe,Me,me,$e,Te,Re=V.dyn_tree,ae=V.max_code,Le=V.stat_desc.static_tree,Ee=V.stat_desc.has_stree,ze=V.stat_desc.extra_bits,He=V.stat_desc.extra_base,xt=V.stat_desc.max_length,Dt=0;for(me=0;me<=g;me++)Z.bl_count[me]=0;for(Re[2*Z.heap[Z.heap_max]+1]=0,de=Z.heap_max+1;de<m;de++)xt<(me=Re[2*Re[2*(xe=Z.heap[de])+1]+1]+1)&&(me=xt,Dt++),Re[2*xe+1]=me,ae<xe||(Z.bl_count[me]++,$e=0,He<=xe&&($e=ze[xe-He]),Te=Re[2*xe],Z.opt_len+=Te*(me+$e),Ee&&(Z.static_len+=Te*(Le[2*xe+1]+$e)));if(Dt!==0){do{for(me=xt-1;Z.bl_count[me]===0;)me--;Z.bl_count[me]--,Z.bl_count[me+1]+=2,Z.bl_count[xt]--,Dt-=2}while(0<Dt);for(me=xt;me!==0;me--)for(xe=Z.bl_count[me];xe!==0;)ae<(Me=Z.heap[--de])||(Re[2*Me+1]!==me&&(Z.opt_len+=(me-Re[2*Me+1])*Re[2*Me],Re[2*Me+1]=me),xe--)}}(X,ee),se(G,oe,X.bl_count)}function F(X,ee,ge){var ye,H,G=-1,ie=ee[1],he=0,_e=7,oe=4;for(ie===0&&(_e=138,oe=3),ee[2*(ge+1)+1]=65535,ye=0;ye<=ge;ye++)H=ie,ie=ee[2*(ye+1)+1],++he<_e&&H===ie||(he<oe?X.bl_tree[2*H]+=he:H!==0?(H!==G&&X.bl_tree[2*H]++,X.bl_tree[2*b]++):he<=10?X.bl_tree[2*_]++:X.bl_tree[2*S]++,G=H,oe=(he=0)===ie?(_e=138,3):H===ie?(_e=6,3):(_e=7,4))}function ce(X,ee,ge){var ye,H,G=-1,ie=ee[1],he=0,_e=7,oe=4;for(ie===0&&(_e=138,oe=3),ye=0;ye<=ge;ye++)if(H=ie,ie=ee[2*(ye+1)+1],!(++he<_e&&H===ie)){if(he<oe)for(;Y(X,H,X.bl_tree),--he!=0;);else H!==0?(H!==G&&(Y(X,H,X.bl_tree),he--),Y(X,b,X.bl_tree),q(X,he-3,2)):he<=10?(Y(X,_,X.bl_tree),q(X,he-3,3)):(Y(X,S,X.bl_tree),q(X,he-11,7));G=H,oe=(he=0)===ie?(_e=138,3):H===ie?(_e=6,3):(_e=7,4)}}l(W);var le=!1;function Q(X,ee,ge,ye){q(X,(c<<1)+(ye?1:0),3),function(H,G,ie,he){J(H),A(H,ie),A(H,~ie),o.arraySet(H.pending_buf,H.window,G,ie,H.pending),H.pending+=ie}(X,ee,ge)}i._tr_init=function(X){le||(function(){var ee,ge,ye,H,G,ie=new Array(g+1);for(H=ye=0;H<u-1;H++)for(L[H]=ye,ee=0;ee<1<<O[H];ee++)T[ye++]=H;for(T[ye-1]=H,H=G=0;H<16;H++)for(W[H]=G,ee=0;ee<1<<C[H];ee++)R[G++]=H;for(G>>=7;H<h;H++)for(W[H]=G<<7,ee=0;ee<1<<C[H]-7;ee++)R[256+G++]=H;for(ge=0;ge<=g;ge++)ie[ge]=0;for(ee=0;ee<=143;)I[2*ee+1]=8,ee++,ie[8]++;for(;ee<=255;)I[2*ee+1]=9,ee++,ie[9]++;for(;ee<=279;)I[2*ee+1]=7,ee++,ie[7]++;for(;ee<=287;)I[2*ee+1]=8,ee++,ie[8]++;for(se(I,d+1,ie),ee=0;ee<h;ee++)P[2*ee+1]=5,P[2*ee]=K(ee,5);z=new $(I,O,f+1,d,g),B=new $(P,C,0,h,g),U=new $(new Array(0),E,0,p,y)}(),le=!0),X.l_desc=new N(X.dyn_ltree,z),X.d_desc=new N(X.dyn_dtree,B),X.bl_desc=new N(X.bl_tree,U),X.bi_buf=0,X.bi_valid=0,te(X)},i._tr_stored_block=Q,i._tr_flush_block=function(X,ee,ge,ye){var H,G,ie=0;0<X.level?(X.strm.data_type===2&&(X.strm.data_type=function(he){var _e,oe=4093624447;for(_e=0;_e<=31;_e++,oe>>>=1)if(1&oe&&he.dyn_ltree[2*_e]!==0)return a;if(he.dyn_ltree[18]!==0||he.dyn_ltree[20]!==0||he.dyn_ltree[26]!==0)return s;for(_e=32;_e<f;_e++)if(he.dyn_ltree[2*_e]!==0)return s;return a}(X)),ve(X,X.l_desc),ve(X,X.d_desc),ie=function(he){var _e;for(F(he,he.dyn_ltree,he.l_desc.max_code),F(he,he.dyn_dtree,he.d_desc.max_code),ve(he,he.bl_desc),_e=p-1;3<=_e&&he.bl_tree[2*k[_e]+1]===0;_e--);return he.opt_len+=3*(_e+1)+5+5+4,_e}(X),H=X.opt_len+3+7>>>3,(G=X.static_len+3+7>>>3)<=H&&(H=G)):H=G=ge+5,ge+4<=H&&ee!==-1?Q(X,ee,ge,ye):X.strategy===4||G===H?(q(X,2+(ye?1:0),3),re(X,I,P)):(q(X,4+(ye?1:0),3),function(he,_e,oe,Z){var V;for(q(he,_e-257,5),q(he,oe-1,5),q(he,Z-4,4),V=0;V<Z;V++)q(he,he.bl_tree[2*k[V]+1],3);ce(he,he.dyn_ltree,_e-1),ce(he,he.dyn_dtree,oe-1)}(X,X.l_desc.max_code+1,X.d_desc.max_code+1,ie+1),re(X,X.dyn_ltree,X.dyn_dtree)),te(X),ye&&J(X)},i._tr_tally=function(X,ee,ge){return X.pending_buf[X.d_buf+2*X.last_lit]=ee>>>8&255,X.pending_buf[X.d_buf+2*X.last_lit+1]=255&ee,X.pending_buf[X.l_buf+X.last_lit]=255&ge,X.last_lit++,ee===0?X.dyn_ltree[2*ge]++:(X.matches++,ee--,X.dyn_ltree[2*(T[ge]+f+1)]++,X.dyn_dtree[2*D(ee)]++),X.last_lit===X.lit_bufsize-1},i._tr_align=function(X){q(X,2,3),Y(X,x,I),function(ee){ee.bi_valid===16?(A(ee,ee.bi_buf),ee.bi_buf=0,ee.bi_valid=0):8<=ee.bi_valid&&(ee.pending_buf[ee.pending++]=255&ee.bi_buf,ee.bi_buf>>=8,ee.bi_valid-=8)}(X)}},{"../utils/common":41}],53:[function(n,r,i){r.exports=function(){this.input=null,this.next_in=0,this.avail_in=0,this.total_in=0,this.output=null,this.next_out=0,this.avail_out=0,this.total_out=0,this.msg="",this.state=null,this.data_type=2,this.adler=0}},{}],54:[function(n,r,i){(function(o){(function(a,s){if(!a.setImmediate){var l,c,u,f,d=1,h={},p=!1,m=a.document,g=Object.getPrototypeOf&&Object.getPrototypeOf(a);g=g&&g.setTimeout?g:a,l={}.toString.call(a.process)==="[object process]"?function(b){process.nextTick(function(){y(b)})}:function(){if(a.postMessage&&!a.importScripts){var b=!0,_=a.onmessage;return a.onmessage=function(){b=!1},a.postMessage("","*"),a.onmessage=_,b}}()?(f="setImmediate$"+Math.random()+"$",a.addEventListener?a.addEventListener("message",x,!1):a.attachEvent("onmessage",x),function(b){a.postMessage(f+b,"*")}):a.MessageChannel?((u=new MessageChannel).port1.onmessage=function(b){y(b.data)},function(b){u.port2.postMessage(b)}):m&&"onreadystatechange"in m.createElement("script")?(c=m.documentElement,function(b){var _=m.createElement("script");_.onreadystatechange=function(){y(b),_.onreadystatechange=null,c.removeChild(_),_=null},c.appendChild(_)}):function(b){setTimeout(y,0,b)},g.setImmediate=function(b){typeof b!="function"&&(b=new Function(""+b));for(var _=new Array(arguments.length-1),S=0;S<_.length;S++)_[S]=arguments[S+1];var O={callback:b,args:_};return h[d]=O,l(d),d++},g.clearImmediate=v}function v(b){delete h[b]}function y(b){if(p)setTimeout(y,0,b);else{var _=h[b];if(_){p=!0;try{(function(S){var O=S.callback,C=S.args;switch(C.length){case 0:O();break;case 1:O(C[0]);break;case 2:O(C[0],C[1]);break;case 3:O(C[0],C[1],C[2]);break;default:O.apply(s,C)}})(_)}finally{v(b),p=!1}}}}function x(b){b.source===a&&typeof b.data=="string"&&b.data.indexOf(f)===0&&y(+b.data.slice(f.length))}})(typeof self>"u"?o===void 0?this:o:self)}).call(this,typeof Zn<"u"?Zn:typeof self<"u"?self:typeof window<"u"?window:{})},{}]},{},[10])(10)})})(Nse);var MVe=Nse.exports;const kVe=$t(MVe);var $se={exports:{}};(function(t,e){(function(n,r){r()})(Zn,function(){function n(c,u){return typeof u>"u"?u={autoBom:!1}:typeof u!="object"&&(console.warn("Deprecated: Expected third argument to be a object"),u={autoBom:!u}),u.autoBom&&/^\s*(?:text\/\S*|application\/xml|\S*\/\S*\+xml)\s*;.*charset\s*=\s*utf-8/i.test(c.type)?new Blob(["\uFEFF",c],{type:c.type}):c}function r(c,u,f){var d=new XMLHttpRequest;d.open("GET",c),d.responseType="blob",d.onload=function(){l(d.response,u,f)},d.onerror=function(){console.error("could not download file")},d.send()}function i(c){var u=new XMLHttpRequest;u.open("HEAD",c,!1);try{u.send()}catch{}return 200<=u.status&&299>=u.status}function o(c){try{c.dispatchEvent(new MouseEvent("click"))}catch{var u=document.createEvent("MouseEvents");u.initMouseEvent("click",!0,!0,window,0,0,0,80,20,!1,!1,!1,!1,0,null),c.dispatchEvent(u)}}var a=typeof window=="object"&&window.window===window?window:typeof self=="object"&&self.self===self?self:typeof Zn=="object"&&Zn.global===Zn?Zn:void 0,s=a.navigator&&/Macintosh/.test(navigator.userAgent)&&/AppleWebKit/.test(navigator.userAgent)&&!/Safari/.test(navigator.userAgent),l=a.saveAs||(typeof window!="object"||window!==a?function(){}:"download"in HTMLAnchorElement.prototype&&!s?function(c,u,f){var d=a.URL||a.webkitURL,h=document.createElement("a");u=u||c.name||"download",h.download=u,h.rel="noopener",typeof c=="string"?(h.href=c,h.origin===location.origin?o(h):i(h.href)?r(c,u,f):o(h,h.target="_blank")):(h.href=d.createObjectURL(c),setTimeout(function(){d.revokeObjectURL(h.href)},4e4),setTimeout(function(){o(h)},0))}:"msSaveOrOpenBlob"in navigator?function(c,u,f){if(u=u||c.name||"download",typeof c!="string")navigator.msSaveOrOpenBlob(n(c,f),u);else if(i(c))r(c,u,f);else{var d=document.createElement("a");d.href=c,d.target="_blank",setTimeout(function(){o(d)})}}:function(c,u,f,d){if(d=d||open("","_blank"),d&&(d.document.title=d.document.body.innerText="downloading..."),typeof c=="string")return r(c,u,f);var h=c.type==="application/octet-stream",p=/constructor/i.test(a.HTMLElement)||a.safari,m=/CriOS\/[\d]+/.test(navigator.userAgent);if((m||h&&p||s)&&typeof FileReader<"u"){var g=new FileReader;g.onloadend=function(){var x=g.result;x=m?x:x.replace(/^data:[^;]*;/,"data:attachment/file;"),d?d.location.href=x:location=x,d=null},g.readAsDataURL(c)}else{var v=a.URL||a.webkitURL,y=v.createObjectURL(c);d?d.location=y:location.href=y,d=null,setTimeout(function(){v.revokeObjectURL(y)},4e4)}});a.saveAs=l.saveAs=l,t.exports=l})})($se);var Fse=$se.exports;const jse="POST_MESSAGE";function ba(t,e){return{type:jse,messageType:t,messageText:typeof e=="string"?e:e.message}}const Bse="HIDE_MESSAGE";function AVe(t){return{type:Bse,messageId:t}}var RVe={aliceblue:[240,248,255],antiquewhite:[250,235,215],aqua:[0,255,255],aquamarine:[127,255,212],azure:[240,255,255],beige:[245,245,220],bisque:[255,228,196],black:[0,0,0],blanchedalmond:[255,235,205],blue:[0,0,255],blueviolet:[138,43,226],brown:[165,42,42],burlywood:[222,184,135],cadetblue:[95,158,160],chartreuse:[127,255,0],chocolate:[210,105,30],coral:[255,127,80],cornflowerblue:[100,149,237],cornsilk:[255,248,220],crimson:[220,20,60],cyan:[0,255,255],darkblue:[0,0,139],darkcyan:[0,139,139],darkgoldenrod:[184,134,11],darkgray:[169,169,169],darkgreen:[0,100,0],darkgrey:[169,169,169],darkkhaki:[189,183,107],darkmagenta:[139,0,139],darkolivegreen:[85,107,47],darkorange:[255,140,0],darkorchid:[153,50,204],darkred:[139,0,0],darksalmon:[233,150,122],darkseagreen:[143,188,143],darkslateblue:[72,61,139],darkslategray:[47,79,79],darkslategrey:[47,79,79],darkturquoise:[0,206,209],darkviolet:[148,0,211],deeppink:[255,20,147],deepskyblue:[0,191,255],dimgray:[105,105,105],dimgrey:[105,105,105],dodgerblue:[30,144,255],firebrick:[178,34,34],floralwhite:[255,250,240],forestgreen:[34,139,34],fuchsia:[255,0,255],gainsboro:[220,220,220],ghostwhite:[248,248,255],gold:[255,215,0],goldenrod:[218,165,32],gray:[128,128,128],green:[0,128,0],greenyellow:[173,255,47],grey:[128,128,128],honeydew:[240,255,240],hotpink:[255,105,180],indianred:[205,92,92],indigo:[75,0,130],ivory:[255,255,240],khaki:[240,230,140],lavender:[230,230,250],lavenderblush:[255,240,245],lawngreen:[124,252,0],lemonchiffon:[255,250,205],lightblue:[173,216,230],lightcoral:[240,128,128],lightcyan:[224,255,255],lightgoldenrodyellow:[250,250,210],lightgray:[211,211,211],lightgreen:[144,238,144],lightgrey:[211,211,211],lightpink:[255,182,193],lightsalmon:[255,160,122],lightseagreen:[32,178,170],lightskyblue:[135,206,250],lightslategray:[119,136,153],lightslategrey:[119,136,153],lightsteelblue:[176,196,222],lightyellow:[255,255,224],lime:[0,255,0],limegreen:[50,205,50],linen:[250,240,230],magenta:[255,0,255],maroon:[128,0,0],mediumaquamarine:[102,205,170],mediumblue:[0,0,205],mediumorchid:[186,85,211],mediumpurple:[147,112,219],mediumseagreen:[60,179,113],mediumslateblue:[123,104,238],mediumspringgreen:[0,250,154],mediumturquoise:[72,209,204],mediumvioletred:[199,21,133],midnightblue:[25,25,112],mintcream:[245,255,250],mistyrose:[255,228,225],moccasin:[255,228,181],navajowhite:[255,222,173],navy:[0,0,128],oldlace:[253,245,230],olive:[128,128,0],olivedrab:[107,142,35],orange:[255,165,0],orangered:[255,69,0],orchid:[218,112,214],palegoldenrod:[238,232,170],palegreen:[152,251,152],paleturquoise:[175,238,238],palevioletred:[219,112,147],papayawhip:[255,239,213],peachpuff:[255,218,185],peru:[205,133,63],pink:[255,192,203],plum:[221,160,221],powderblue:[176,224,230],purple:[128,0,128],rebeccapurple:[102,51,153],red:[255,0,0],rosybrown:[188,143,143],royalblue:[65,105,225],saddlebrown:[139,69,19],salmon:[250,128,114],sandybrown:[244,164,96],seagreen:[46,139,87],seashell:[255,245,238],sienna:[160,82,45],silver:[192,192,192],skyblue:[135,206,235],slateblue:[106,90,205],slategray:[112,128,144],slategrey:[112,128,144],snow:[255,250,250],springgreen:[0,255,127],steelblue:[70,130,180],tan:[210,180,140],teal:[0,128,128],thistle:[216,191,216],tomato:[255,99,71],turquoise:[64,224,208],violet:[238,130,238],wheat:[245,222,179],white:[255,255,255],whitesmoke:[245,245,245],yellow:[255,255,0],yellowgreen:[154,205,50]};const yH=$t(RVe);var xH={red:0,orange:60,yellow:120,green:180,blue:240,purple:300};function IVe(t){var e,n=[],r=1,i;if(typeof t=="string")if(t=t.toLowerCase(),yH[t])n=yH[t].slice(),i="rgb";else if(t==="transparent")r=0,i="rgb",n=[0,0,0];else if(/^#[A-Fa-f0-9]+$/.test(t)){var o=t.slice(1),a=o.length,s=a<=4;r=1,s?(n=[parseInt(o[0]+o[0],16),parseInt(o[1]+o[1],16),parseInt(o[2]+o[2],16)],a===4&&(r=parseInt(o[3]+o[3],16)/255)):(n=[parseInt(o[0]+o[1],16),parseInt(o[2]+o[3],16),parseInt(o[4]+o[5],16)],a===8&&(r=parseInt(o[6]+o[7],16)/255)),n[0]||(n[0]=0),n[1]||(n[1]=0),n[2]||(n[2]=0),i="rgb"}else if(e=/^((?:rgb|hs[lvb]|hwb|cmyk?|xy[zy]|gray|lab|lchu?v?|[ly]uv|lms)a?)\s*\(([^\)]*)\)/.exec(t)){var l=e[1],c=l==="rgb",o=l.replace(/a$/,"");i=o;var a=o==="cmyk"?4:o==="gray"?1:3;n=e[2].trim().split(/\s*[,\/]\s*|\s+/).map(function(d,h){if(/%$/.test(d))return h===a?parseFloat(d)/100:o==="rgb"?parseFloat(d)*255/100:parseFloat(d);if(o[h]==="h"){if(/deg$/.test(d))return parseFloat(d);if(xH[d]!==void 0)return xH[d]}return parseFloat(d)}),l===o&&n.push(1),r=c||n[a]===void 0?1:n[a],n=n.slice(0,a)}else t.length>10&&/[0-9](?:\s|\/)/.test(t)&&(n=t.match(/([0-9]+)/g).map(function(u){return parseFloat(u)}),i=t.match(/([a-z])/ig).join("").toLowerCase());else isNaN(t)?Array.isArray(t)||t.length?(n=[t[0],t[1],t[2]],i="rgb",r=t.length===4?t[3]:1):t instanceof Object&&(t.r!=null||t.red!=null||t.R!=null?(i="rgb",n=[t.r||t.red||t.R||0,t.g||t.green||t.G||0,t.b||t.blue||t.B||0]):(i="hsl",n=[t.h||t.hue||t.H||0,t.s||t.saturation||t.S||0,t.l||t.lightness||t.L||t.b||t.brightness]),r=t.a||t.alpha||t.opacity||1,t.opacity!=null&&(r/=100)):(i="rgb",n=[t>>>16,(t&65280)>>>8,t&255]);return{space:i,values:n,alpha:r}}const k3={name:"rgb",min:[0,0,0],max:[255,255,255],channel:["red","green","blue"],alias:["RGB"]},oR={name:"hsl",min:[0,0,0],max:[360,100,100],channel:["hue","saturation","lightness"],alias:["HSL"],rgb:function(t){var e=t[0]/360,n=t[1]/100,r=t[2]/100,i,o,a,s,l,c=0;if(n===0)return l=r*255,[l,l,l];for(o=r<.5?r*(1+n):r+n-r*n,i=2*r-o,s=[0,0,0];c<3;)a=e+1/3*-(c-1),a<0?a++:a>1&&a--,l=6*a<1?i+(o-i)*6*a:2*a<1?o:3*a<2?i+(o-i)*(2/3-a)*6:i,s[c++]=l*255;return s}};k3.hsl=function(t){var e=t[0]/255,n=t[1]/255,r=t[2]/255,i=Math.min(e,n,r),o=Math.max(e,n,r),a=o-i,s,l,c;return o===i?s=0:e===o?s=(n-r)/a:n===o?s=2+(r-e)/a:r===o&&(s=4+(e-n)/a),s=Math.min(s*60,360),s<0&&(s+=360),c=(i+o)/2,o===i?l=0:c<=.5?l=a/(o+i):l=a/(2-o-i),[s,l*100,c*100]};function DVe(t){Array.isArray(t)&&t.raw&&(t=String.raw(...arguments));var e,n=IVe(t);if(!n.space)return[];const r=n.space[0]==="h"?oR.min:k3.min,i=n.space[0]==="h"?oR.max:k3.max;return e=Array(3),e[0]=Math.min(Math.max(n.values[0],r[0]),i[0]),e[1]=Math.min(Math.max(n.values[1],r[1]),i[1]),e[2]=Math.min(Math.max(n.values[2],r[2]),i[2]),n.space[0]==="h"&&(e=oR.rgb(e)),e.push(Math.min(Math.max(n.alpha,0),1)),e}function YB(t,e,n,r="circle"){if(t.getGeometry()instanceof ql)t.setStyle(LVe(7,e,"white",2,r));else{n=typeof n=="number"?n:.25;let i=DVe(e);Array.isArray(i)?i=[i[0],i[1],i[2],n]:i=[255,255,255,n],t.setStyle($Ve(i,e,2))}}function LVe(t,e,n,r,i="circle"){return new Il({image:NVe(t,e,n,r,i)})}function NVe(t,e,n,r,i){const o=new op({color:e}),a=new Xl({color:n,width:r});switch(i){case"square":return new f3({fill:o,stroke:a,radius:t,points:4,angle:Math.PI/4,rotation:0});case"diamond":return new f3({fill:o,stroke:a,radius:t,points:4,angle:Math.PI/4,rotation:Math.PI/4});default:return new X1({fill:o,stroke:a,radius:t})}}function $Ve(t,e,n){const r=new op({color:t}),i=new Xl({color:e,width:n});return new Il({fill:r,stroke:i})}function FVe(t,e,n){Ga[t]}function jVe(t,e,n){if(Ga[t]){const i=Ga[t].getSource(),o=i==null?void 0:i.getFeatureById(e);o&&YB(o,n.color,n.opacity)}}function BVe(t,e,n){if(Ga[t]){const r=Ga[t],i=r.getView().getProjection(),a=(Array.isArray(e)?i3(e):e).transform(py,i);a.getType()==="Point"?r.getView().setCenter(a.getFirstCoordinate()):n?r.getView().fit(a,{size:r.getSize()}):r.getView().setCenter(ed(a.getExtent()))}}const iE="UPDATE_SERVER_INFO";function zVe(){return(t,e)=>{const n=pi(e());t(A2(iE,fe.get("Connecting to server"))),F$e(n.url).then(r=>{t(UVe(r))}).catch(r=>{t(ba("error",r))}).then(()=>{t(R2(iE))})}}function UVe(t){return{type:iE,serverInfo:t}}const bH="UPDATE_RESOURCES";function zse(){return(t,e)=>{const n=pi(e());t(A2(bH,fe.get("Updating resources"))),U$e(n.url,e().userAuthState.accessToken).then(r=>{r&&window.location.reload()}).finally(()=>t(R2(bH)))}}const Yb="UPDATE_DATASETS";function Use(){return(t,e)=>{const n=pi(e());t(A2(Yb,fe.get("Loading data"))),I$e(n.url,e().userAuthState.accessToken).then(r=>{const i=K6e();if(r=r.map(o=>({...o,variables:[...o.variables,...i[o.id]||[]]})),t(_H(r)),r.length>0){const o=e().controlState.selectedDatasetId||r[0].id;t(cle(o,r,!0))}}).catch(r=>{t(ba("error",r)),t(_H([]))}).then(()=>{t(R2(Yb))})}}function _H(t){return{type:Yb,datasets:t}}function WVe(t,e){return(n,r)=>{n(VVe(t,e));const i={};r().dataState.datasets.forEach(o=>{const[a,s]=gB(o);s.length>=0&&(i[o.id]=s)}),Y6e(i)}}const Wse="UPDATE_DATASET_USER_VARIABLES";function VVe(t,e){return{type:Wse,datasetId:t,userVariables:e}}const KB="UPDATE_DATASET_PLACE_GROUP";function GVe(t,e){return{type:KB,datasetId:t,placeGroup:e}}const ZB="ADD_DRAWN_USER_PLACE";function HVe(t,e,n,r,i){return(o,a)=>{o(qVe(t,e,n,r,i)),a().controlState.autoShowTimeSeries&&a().controlState.selectedPlaceId===e&&o(P2())}}function qVe(t,e,n,r,i){return{type:ZB,placeGroupTitle:t,id:e,properties:n,geometry:r,selected:i}}const JB="ADD_IMPORTED_USER_PLACES";function XVe(t,e,n){return{type:JB,placeGroups:t,mapProjection:e,selected:n}}function Vse(t){return(e,n)=>{const r=CWe(n());let i;try{if(r==="csv"){const o=TWe(n());i=N6e(t,o)}else if(r==="geojson"){const o=EWe(n());i=z6e(t,o)}else if(r==="wkt"){const o=PWe(n());i=G6e(t,o)}else i=[]}catch(o){e(ba("error",o)),e(Lp("addUserPlacesFromText")),i=[]}if(i.length>0){if(e(XVe(i,wd(n()),!0)),i.length===1&&i[0].features.length===1){const a=i[0].features[0];e(M2(a.id,rw(n()),!0)),n().controlState.autoShowTimeSeries&&e(P2())}let o=0;i.forEach(a=>{o+=a.features?a.features.length:0}),e(ba("info",fe.get(`Imported ${o} place(s) in ${i.length} groups(s), 1 selected`)))}else e(ba("warning",fe.get("No places imported")))}}const ez="RENAME_USER_PLACE_GROUP";function QVe(t,e){return{type:ez,placeGroupId:t,newName:e}}const Gse="RENAME_USER_PLACE";function YVe(t,e,n){return r=>{r(KVe(t,e,n)),FVe(t)}}function KVe(t,e,n){return{type:Gse,placeGroupId:t,placeId:e,newName:n}}const Hse="RESTYLE_USER_PLACE";function ZVe(t,e,n){return r=>{r(JVe(t,e,n)),jVe(t,e,n)}}function JVe(t,e,n){return{type:Hse,placeGroupId:t,placeId:e,placeStyle:n}}const tz="REMOVE_USER_PLACE";function e8e(t,e,n){return{type:tz,placeGroupId:t,placeId:e,places:n}}const qse="REMOVE_USER_PLACE_GROUP";function t8e(t){return{type:qse,placeGroupId:t}}function Xse(){return(t,e)=>{const n=pi(e()),r=qr(e()),i=vo(e()),o=iw(e()),a=Sy(e()),s=e().controlState.sidebarOpen,l=e().controlState.sidebarPanelId;r&&i&&o&&a&&(l!=="stats"&&t(sz("stats")),s||t(az(!0)),t(wH(null)),B$e(n.url,r,i,o,a,e().userAuthState.accessToken).then(c=>t(wH(c))).catch(c=>{t(ba("error",c))}))}}const Qse="ADD_STATISTICS";function wH(t){return{type:Qse,statistics:t}}const Yse="REMOVE_STATISTICS";function n8e(t){return{type:Yse,index:t}}function P2(){return(t,e)=>{const n=pi(e()),r=qr(e()),i=wy(e()),o=vo(e()),a=xy(e()),s=xse(e()),l=e().controlState.timeSeriesUpdateMode,c=e().controlState.timeSeriesUseMedian,u=e().controlState.timeSeriesIncludeStdev;let f=tVe(e());const d=e().controlState.sidebarOpen,h=e().controlState.sidebarPanelId,p=Lae(e());if(r&&o&&a&&i){h!=="timeSeries"&&t(sz("timeSeries")),d||t(az(!0));const m=i.labels,g=m.length;f=f>0?f:g;let v=g-1,y=v-f+1;const x=()=>{const _=y>=0?m[y]:null,S=m[v];return j$e(n.url,r,o,s.id,s.geometry,_,S,c,u,e().userAuthState.accessToken)},b=_=>{if(_!==null&&SH(p,s.id)){const S=y>0,O=S?(g-y)/g:1;t(r8e({..._,dataProgress:O},l,v===g-1?"new":"append")),S&&SH(p,s.id)&&(y-=f,v-=f,x().then(b))}else t(ba("info","No data found here"))};x().then(b).catch(_=>{t(ba("error",_))})}}}function SH(t,e){return bB(t,e)!==null}const Kse="UPDATE_TIME_SERIES";function r8e(t,e,n){return{type:Kse,timeSeries:t,updateMode:e,dataMode:n}}const Zse="ADD_PLACE_GROUP_TIME_SERIES";function i8e(t,e){return{type:Zse,timeSeriesGroupId:t,timeSeries:e}}const Jse="REMOVE_TIME_SERIES";function o8e(t,e){return{type:Jse,groupId:t,index:e}}const ele="REMOVE_TIME_SERIES_GROUP";function a8e(t){return{type:ele,id:t}}const tle="REMOVE_ALL_TIME_SERIES";function s8e(){return{type:tle}}const nz="CONFIGURE_SERVERS";function l8e(t,e){return(n,r)=>{r().controlState.selectedServerId!==e?(n(s8e()),n(OH(t,e)),n(rz())):r().dataState.userServers!==t&&n(OH(t,e))}}function OH(t,e){return{type:nz,servers:t,selectedServerId:e}}function rz(){return t=>{t(zVe()),t(Use()),t(c8e()),t(f8e())}}const nle="UPDATE_EXPRESSION_CAPABILITIES";function c8e(){return(t,e)=>{const n=pi(e());$$e(n.url).then(r=>{t(u8e(r))}).catch(r=>{t(ba("error",r))})}}function u8e(t){return{type:nle,expressionCapabilities:t}}const rle="UPDATE_COLOR_BARS";function f8e(){return(t,e)=>{const n=pi(e());M$e(n.url).then(r=>{t(d8e(r))}).catch(r=>{t(ba("error",r))})}}function d8e(t){return{type:rle,colorBars:t}}const ile="UPDATE_VARIABLE_COLOR_BAR";function h8e(t,e,n,r){return(i,o)=>{const a=o().controlState.selectedDatasetId,s=o().controlState.selectedVariableName;a&&s&&i(ole(a,s,t,e,n,r))}}function p8e(t,e,n,r){return(i,o)=>{const a=o().controlState.selectedDatasetId,s=o().controlState.selectedVariable2Name;a&&s&&i(ole(a,s,t,e,n,r))}}function ole(t,e,n,r,i,o){if(i==="log"){let[a,s]=r;a<=0&&(a=.001),s<=a&&(s=1),r=[a,s]}return{type:ile,datasetId:t,variableName:e,colorBarName:n,colorBarMinMax:r,colorBarNorm:i,opacity:o}}const ale="UPDATE_VARIABLE_VOLUME";function m8e(t,e,n,r,i){return{type:ale,datasetId:t,variableName:e,variableColorBar:n,volumeRenderMode:r,volumeIsoThreshold:i}}function g8e(){return(t,e)=>{const{exportTimeSeries:n,exportTimeSeriesSeparator:r,exportPlaces:i,exportPlacesAsCollection:o,exportZipArchive:a,exportFileName:s}=e().controlState;let l=[];n?(l=[],J1(e()).forEach(u=>{u.placeGroups&&(l=l.concat(u.placeGroups))}),l=[...l,...ew(e())]):i&&(l=_y(e())),x8e(e().dataState.timeSeriesGroups,l,{includeTimeSeries:n,includePlaces:i,separator:r,placesAsCollection:o,zip:a,fileName:s})}}class sle{}class v8e extends sle{constructor(n){super();Yt(this,"fileName");Yt(this,"zipArchive");this.fileName=n,this.zipArchive=new kVe}write(n,r){this.zipArchive.file(n,r)}close(){this.zipArchive.generateAsync({type:"blob"}).then(n=>Fse.saveAs(n,this.fileName))}}class y8e extends sle{write(e,n){const r=new Blob([n],{type:"text/plain;charset=utf-8"});Fse.saveAs(r,e)}close(){}}function x8e(t,e,n){const{includeTimeSeries:r,includePlaces:i,placesAsCollection:o,zip:a}=n;let{separator:s,fileName:l}=n;if(s=s||"TAB",s.toUpperCase()==="TAB"&&(s="	"),l=l||"export",!r&&!i)return;let c;a?c=new v8e(`${l}.zip`):c=new y8e;let u;if(r){const{colNames:f,dataRows:d,referencedPlaces:h}=r6e(t,e),p={number:!0,string:!0},m=f.join(s),g=d.map(y=>y.map(x=>p[typeof x]?x+"":"").join(s)),v=[m].concat(g).join(`
`);c.write(`${l}.txt`,v),u=h}else u={},e.forEach(f=>{f.features&&f.features.forEach(d=>{u[d.id]=d})});if(i)if(o){const f={type:"FeatureCollection",features:Object.keys(u).map(d=>u[d])};c.write(`${l}.geojson`,JSON.stringify(f,null,2))}else Object.keys(u).forEach(f=>{c.write(`${f}.geojson`,JSON.stringify(u[f],null,2))});c.close()}const lle="SELECT_DATASET";function cle(t,e,n){return(r,i)=>{r(b8e(t,e));const o=i().controlState.datasetLocateMode;t&&n&&o!=="doNothing"&&r(ule(t,i().controlState.datasetLocateMode==="panAndZoom"))}}function b8e(t,e){return{type:lle,selectedDatasetId:t,datasets:e}}function _8e(){return(t,e)=>{const n=tw(e());n&&t(ule(n,!0))}}function w8e(){return(t,e)=>{const n=xy(e());n&&t(fle(n,!0))}}function ule(t,e){return(n,r)=>{const i=J1(r()),o=Ub(i,t);o&&o.bbox&&n(A3(o.bbox,e))}}const S8e=["Point","LineString","LinearRing","Polygon","MultiPoint","MultiLineString","MultiPolygon","Circle"];function fle(t,e){return(n,r)=>{const i=_y(r()),o=bB(i,t);o&&(o.bbox&&o.bbox.length===4?n(A3(o.bbox,e)):o.geometry&&S8e.includes(o.geometry.type)&&n(A3(new Ip().readGeometry(o.geometry),e)))}}function A3(t,e){return n=>{if(t!==null){const r="map";n(O8e(r,t)),BVe(r,t,e)}}}const dle="FLY_TO";function O8e(t,e){return{type:dle,mapId:t,location:e}}const hle="SELECT_PLACE_GROUPS";function C8e(t){return(e,n)=>{const r=pi(n());e(T8e(t));const i=qr(n()),o=yse(n());if(i!==null&&o.length>0){for(const a of o)if(!uy(a)){const s=i.id,l=a.id,c=`${KB}-${s}-${l}`;e(A2(c,fe.get("Loading places"))),N$e(r.url,s,l,n().userAuthState.accessToken).then(u=>{e(GVe(i.id,u))}).catch(u=>{e(ba("error",u))}).finally(()=>{e(R2(c))})}}}}function T8e(t){return{type:hle,selectedPlaceGroupIds:t}}const ple="SELECT_PLACE";function M2(t,e,n){return(r,i)=>{r(E8e(t,e));const o=i().controlState.placeLocateMode;n&&t&&o!=="doNothing"&&r(fle(t,i().controlState.placeLocateMode==="panAndZoom"))}}function E8e(t,e){return{type:ple,placeId:t,places:e}}const mle="SET_LAYER_VISIBILITY";function P8e(t,e){return{type:mle,layerId:t,visible:e}}const gle="SET_MAP_POINT_INFO_BOX_ENABLED";function M8e(t){return{type:gle,mapPointInfoBoxEnabled:t}}const vle="SET_VARIABLE_COMPARE_MODE";function k8e(t){return{type:vle,variableCompareMode:t}}const iz="SET_VARIABLE_SPLIT_POS";function A8e(t){return{type:iz,variableSplitPos:t}}const yle="SELECT_VARIABLE";function xle(t){return{type:yle,selectedVariableName:t}}const ble="SELECT_VARIABLE_2";function R8e(t,e){return{type:ble,selectedDataset2Id:t,selectedVariable2Name:e}}const _le="SELECT_TIME";function k2(t){return{type:_le,selectedTime:t}}const wle="INC_SELECTED_TIME";function I8e(t){return{type:wle,increment:t}}const oz="SELECT_TIME_RANGE";function Sle(t,e,n){return{type:oz,selectedTimeRange:t,selectedGroupId:e,selectedValueRange:n}}const D8e="SELECT_TIME_SERIES_UPDATE_MODE",Ole="UPDATE_TIME_ANIMATION";function L8e(t,e){return{type:Ole,timeAnimationActive:t,timeAnimationInterval:e}}const Cle="SET_MAP_INTERACTION";function Tle(t){return{type:Cle,mapInteraction:t}}const Ele="SET_LAYER_MENU_OPEN";function Ple(t){return{type:Ele,layerMenuOpen:t}}const Mle="SET_SIDEBAR_POSITION";function N8e(t){return{type:Mle,sidebarPosition:t}}const kle="SET_SIDEBAR_OPEN";function az(t){return{type:kle,sidebarOpen:t}}const Ale="SET_SIDEBAR_PANEL_ID";function sz(t){return{type:Ale,sidebarPanelId:t}}const Rle="SET_VOLUME_RENDER_MODE";function $8e(t){return{type:Rle,volumeRenderMode:t}}const Ile="UPDATE_VOLUME_STATE";function F8e(t,e){return{type:Ile,volumeId:t,volumeState:e}}const Dle="SET_VISIBLE_INFO_CARD_ELEMENTS";function j8e(t){return{type:Dle,visibleElements:t}}const Lle="UPDATE_INFO_CARD_ELEMENT_VIEW_MODE";function B8e(t,e){return{type:Lle,elementType:t,viewMode:e}}const Nle="ADD_ACTIVITY";function A2(t,e){return{type:Nle,id:t,message:e}}const $le="REMOVE_ACTIVITY";function R2(t){return{type:$le,id:t}}const Fle="CHANGE_LOCALE";function jle(t){return{type:Fle,locale:t}}const Ble="OPEN_DIALOG";function Lp(t){return{type:Ble,dialogId:t}}const zle="CLOSE_DIALOG";function Oy(t){return{type:zle,dialogId:t}}const lz="UPDATE_SETTINGS";function ow(t){return{type:lz,settings:t}}const Ule="STORE_SETTINGS";function Wle(){return{type:Ule}}function Vle(t){return e=>{e(z8e(t)),e(U8e(t))}}const Gle="ADD_USER_COLOR_BAR";function z8e(t){return{type:Gle,colorBarId:t}}const Hle="REMOVE_USER_COLOR_BAR";function qle(t){return{type:Hle,colorBarId:t}}function Xle(t){return e=>{e(Yle(t)),e(cz(t))}}const Qle="UPDATE_USER_COLOR_BAR";function Yle(t){return{type:Qle,userColorBar:t}}function U8e(t){return(e,n)=>{const r=n().controlState.userColorBars.find(i=>i.id===t);r&&e(cz(r))}}function cz(t){return e=>{uFe(t).then(({imageData:n,errorMessage:r})=>{e(Yle({...t,imageData:n,errorMessage:r}))})}}function W8e(){return(t,e)=>{e().controlState.userColorBars.forEach(n=>{n.imageData||t(cz(n))})}}function Kle(t){return{type:lz,settings:{userColorBars:t}}}const CH=["http","https","mailto","tel"];function V8e(t){const e=(t||"").trim(),n=e.charAt(0);if(n==="#"||n==="/")return e;const r=e.indexOf(":");if(r===-1)return e;let i=-1;for(;++i<CH.length;){const o=CH[i];if(r===o.length&&e.slice(0,o.length).toLowerCase()===o)return e}return i=e.indexOf("?"),i!==-1&&r>i||(i=e.indexOf("#"),i!==-1&&r>i)?e:"javascript:void(0)"}/*!
 * Determine if an object is a Buffer
 *
 * @author   Feross Aboukhadijeh <https://feross.org>
 * @license  MIT
 */var G8e=function(e){return e!=null&&e.constructor!=null&&typeof e.constructor.isBuffer=="function"&&e.constructor.isBuffer(e)};const Zle=$t(G8e);function Qx(t){return!t||typeof t!="object"?"":"position"in t||"type"in t?TH(t.position):"start"in t||"end"in t?TH(t):"line"in t||"column"in t?R3(t):""}function R3(t){return EH(t&&t.line)+":"+EH(t&&t.column)}function TH(t){return R3(t&&t.start)+"-"+R3(t&&t.end)}function EH(t){return t&&typeof t=="number"?t:1}class _s extends Error{constructor(e,n,r){const i=[null,null];let o={start:{line:null,column:null},end:{line:null,column:null}};if(super(),typeof n=="string"&&(r=n,n=void 0),typeof r=="string"){const a=r.indexOf(":");a===-1?i[1]=r:(i[0]=r.slice(0,a),i[1]=r.slice(a+1))}n&&("type"in n||"position"in n?n.position&&(o=n.position):"start"in n||"end"in n?o=n:("line"in n||"column"in n)&&(o.start=n)),this.name=Qx(n)||"1:1",this.message=typeof e=="object"?e.message:e,this.stack="",typeof e=="object"&&e.stack&&(this.stack=e.stack),this.reason=this.message,this.fatal,this.line=o.start.line,this.column=o.start.column,this.position=o,this.source=i[0],this.ruleId=i[1],this.file,this.actual,this.expected,this.url,this.note}}_s.prototype.file="";_s.prototype.name="";_s.prototype.reason="";_s.prototype.message="";_s.prototype.stack="";_s.prototype.fatal=null;_s.prototype.column=null;_s.prototype.line=null;_s.prototype.source=null;_s.prototype.ruleId=null;_s.prototype.position=null;const gl={basename:H8e,dirname:q8e,extname:X8e,join:Q8e,sep:"/"};function H8e(t,e){if(e!==void 0&&typeof e!="string")throw new TypeError('"ext" argument must be a string');aw(t);let n=0,r=-1,i=t.length,o;if(e===void 0||e.length===0||e.length>t.length){for(;i--;)if(t.charCodeAt(i)===47){if(o){n=i+1;break}}else r<0&&(o=!0,r=i+1);return r<0?"":t.slice(n,r)}if(e===t)return"";let a=-1,s=e.length-1;for(;i--;)if(t.charCodeAt(i)===47){if(o){n=i+1;break}}else a<0&&(o=!0,a=i+1),s>-1&&(t.charCodeAt(i)===e.charCodeAt(s--)?s<0&&(r=i):(s=-1,r=a));return n===r?r=a:r<0&&(r=t.length),t.slice(n,r)}function q8e(t){if(aw(t),t.length===0)return".";let e=-1,n=t.length,r;for(;--n;)if(t.charCodeAt(n)===47){if(r){e=n;break}}else r||(r=!0);return e<0?t.charCodeAt(0)===47?"/":".":e===1&&t.charCodeAt(0)===47?"//":t.slice(0,e)}function X8e(t){aw(t);let e=t.length,n=-1,r=0,i=-1,o=0,a;for(;e--;){const s=t.charCodeAt(e);if(s===47){if(a){r=e+1;break}continue}n<0&&(a=!0,n=e+1),s===46?i<0?i=e:o!==1&&(o=1):i>-1&&(o=-1)}return i<0||n<0||o===0||o===1&&i===n-1&&i===r+1?"":t.slice(i,n)}function Q8e(...t){let e=-1,n;for(;++e<t.length;)aw(t[e]),t[e]&&(n=n===void 0?t[e]:n+"/"+t[e]);return n===void 0?".":Y8e(n)}function Y8e(t){aw(t);const e=t.charCodeAt(0)===47;let n=K8e(t,!e);return n.length===0&&!e&&(n="."),n.length>0&&t.charCodeAt(t.length-1)===47&&(n+="/"),e?"/"+n:n}function K8e(t,e){let n="",r=0,i=-1,o=0,a=-1,s,l;for(;++a<=t.length;){if(a<t.length)s=t.charCodeAt(a);else{if(s===47)break;s=47}if(s===47){if(!(i===a-1||o===1))if(i!==a-1&&o===2){if(n.length<2||r!==2||n.charCodeAt(n.length-1)!==46||n.charCodeAt(n.length-2)!==46){if(n.length>2){if(l=n.lastIndexOf("/"),l!==n.length-1){l<0?(n="",r=0):(n=n.slice(0,l),r=n.length-1-n.lastIndexOf("/")),i=a,o=0;continue}}else if(n.length>0){n="",r=0,i=a,o=0;continue}}e&&(n=n.length>0?n+"/..":"..",r=2)}else n.length>0?n+="/"+t.slice(i+1,a):n=t.slice(i+1,a),r=a-i-1;i=a,o=0}else s===46&&o>-1?o++:o=-1}return n}function aw(t){if(typeof t!="string")throw new TypeError("Path must be a string. Received "+JSON.stringify(t))}const Z8e={cwd:J8e};function J8e(){return"/"}function I3(t){return t!==null&&typeof t=="object"&&t.href&&t.origin}function eGe(t){if(typeof t=="string")t=new URL(t);else if(!I3(t)){const e=new TypeError('The "path" argument must be of type string or an instance of URL. Received `'+t+"`");throw e.code="ERR_INVALID_ARG_TYPE",e}if(t.protocol!=="file:"){const e=new TypeError("The URL must be of scheme file");throw e.code="ERR_INVALID_URL_SCHEME",e}return tGe(t)}function tGe(t){if(t.hostname!==""){const r=new TypeError('File URL host must be "localhost" or empty on darwin');throw r.code="ERR_INVALID_FILE_URL_HOST",r}const e=t.pathname;let n=-1;for(;++n<e.length;)if(e.charCodeAt(n)===37&&e.charCodeAt(n+1)===50){const r=e.charCodeAt(n+2);if(r===70||r===102){const i=new TypeError("File URL path must not include encoded / characters");throw i.code="ERR_INVALID_FILE_URL_PATH",i}}return decodeURIComponent(e)}const aR=["history","path","basename","stem","extname","dirname"];class Jle{constructor(e){let n;e?typeof e=="string"||nGe(e)?n={value:e}:I3(e)?n={path:e}:n=e:n={},this.data={},this.messages=[],this.history=[],this.cwd=Z8e.cwd(),this.value,this.stored,this.result,this.map;let r=-1;for(;++r<aR.length;){const o=aR[r];o in n&&n[o]!==void 0&&n[o]!==null&&(this[o]=o==="history"?[...n[o]]:n[o])}let i;for(i in n)aR.includes(i)||(this[i]=n[i])}get path(){return this.history[this.history.length-1]}set path(e){I3(e)&&(e=eGe(e)),lR(e,"path"),this.path!==e&&this.history.push(e)}get dirname(){return typeof this.path=="string"?gl.dirname(this.path):void 0}set dirname(e){PH(this.basename,"dirname"),this.path=gl.join(e||"",this.basename)}get basename(){return typeof this.path=="string"?gl.basename(this.path):void 0}set basename(e){lR(e,"basename"),sR(e,"basename"),this.path=gl.join(this.dirname||"",e)}get extname(){return typeof this.path=="string"?gl.extname(this.path):void 0}set extname(e){if(sR(e,"extname"),PH(this.dirname,"extname"),e){if(e.charCodeAt(0)!==46)throw new Error("`extname` must start with `.`");if(e.includes(".",1))throw new Error("`extname` cannot contain multiple dots")}this.path=gl.join(this.dirname,this.stem+(e||""))}get stem(){return typeof this.path=="string"?gl.basename(this.path,this.extname):void 0}set stem(e){lR(e,"stem"),sR(e,"stem"),this.path=gl.join(this.dirname||"",e+(this.extname||""))}toString(e){return(this.value||"").toString(e||void 0)}message(e,n,r){const i=new _s(e,n,r);return this.path&&(i.name=this.path+":"+i.name,i.file=this.path),i.fatal=!1,this.messages.push(i),i}info(e,n,r){const i=this.message(e,n,r);return i.fatal=null,i}fail(e,n,r){const i=this.message(e,n,r);throw i.fatal=!0,i}}function sR(t,e){if(t&&t.includes(gl.sep))throw new Error("`"+e+"` cannot be a path: did not expect `"+gl.sep+"`")}function lR(t,e){if(!t)throw new Error("`"+e+"` cannot be empty")}function PH(t,e){if(!t)throw new Error("Setting `"+e+"` requires `path` to be set too")}function nGe(t){return Zle(t)}function MH(t){if(t)throw t}var LC=Object.prototype.hasOwnProperty,ece=Object.prototype.toString,kH=Object.defineProperty,AH=Object.getOwnPropertyDescriptor,RH=function(e){return typeof Array.isArray=="function"?Array.isArray(e):ece.call(e)==="[object Array]"},IH=function(e){if(!e||ece.call(e)!=="[object Object]")return!1;var n=LC.call(e,"constructor"),r=e.constructor&&e.constructor.prototype&&LC.call(e.constructor.prototype,"isPrototypeOf");if(e.constructor&&!n&&!r)return!1;var i;for(i in e);return typeof i>"u"||LC.call(e,i)},DH=function(e,n){kH&&n.name==="__proto__"?kH(e,n.name,{enumerable:!0,configurable:!0,value:n.newValue,writable:!0}):e[n.name]=n.newValue},LH=function(e,n){if(n==="__proto__")if(LC.call(e,n)){if(AH)return AH(e,n).value}else return;return e[n]},rGe=function t(){var e,n,r,i,o,a,s=arguments[0],l=1,c=arguments.length,u=!1;for(typeof s=="boolean"&&(u=s,s=arguments[1]||{},l=2),(s==null||typeof s!="object"&&typeof s!="function")&&(s={});l<c;++l)if(e=arguments[l],e!=null)for(n in e)r=LH(s,n),i=LH(e,n),s!==i&&(u&&i&&(IH(i)||(o=RH(i)))?(o?(o=!1,a=r&&RH(r)?r:[]):a=r&&IH(r)?r:{},DH(s,{name:n,newValue:t(u,a,i)})):typeof i<"u"&&DH(s,{name:n,newValue:i}));return s};const NH=$t(rGe);function D3(t){if(typeof t!="object"||t===null)return!1;const e=Object.getPrototypeOf(t);return(e===null||e===Object.prototype||Object.getPrototypeOf(e)===null)&&!(Symbol.toStringTag in t)&&!(Symbol.iterator in t)}function iGe(){const t=[],e={run:n,use:r};return e;function n(...i){let o=-1;const a=i.pop();if(typeof a!="function")throw new TypeError("Expected function as last argument, not "+a);s(null,...i);function s(l,...c){const u=t[++o];let f=-1;if(l){a(l);return}for(;++f<i.length;)(c[f]===null||c[f]===void 0)&&(c[f]=i[f]);i=c,u?oGe(u,s)(...c):a(null,...c)}}function r(i){if(typeof i!="function")throw new TypeError("Expected `middelware` to be a function, not "+i);return t.push(i),e}}function oGe(t,e){let n;return r;function r(...a){const s=t.length>a.length;let l;s&&a.push(i);try{l=t.apply(this,a)}catch(c){const u=c;if(s&&n)throw u;return i(u)}s||(l&&l.then&&typeof l.then=="function"?l.then(o,i):l instanceof Error?i(l):o(l))}function i(a,...s){n||(n=!0,e(a,...s))}function o(a){i(null,a)}}const aGe=nce().freeze(),tce={}.hasOwnProperty;function nce(){const t=iGe(),e=[];let n={},r,i=-1;return o.data=a,o.Parser=void 0,o.Compiler=void 0,o.freeze=s,o.attachers=e,o.use=l,o.parse=c,o.stringify=u,o.run=f,o.runSync=d,o.process=h,o.processSync=p,o;function o(){const m=nce();let g=-1;for(;++g<e.length;)m.use(...e[g]);return m.data(NH(!0,{},n)),m}function a(m,g){return typeof m=="string"?arguments.length===2?(fR("data",r),n[m]=g,o):tce.call(n,m)&&n[m]||null:m?(fR("data",r),n=m,o):n}function s(){if(r)return o;for(;++i<e.length;){const[m,...g]=e[i];if(g[0]===!1)continue;g[0]===!0&&(g[0]=void 0);const v=m.call(o,...g);typeof v=="function"&&t.use(v)}return r=!0,i=Number.POSITIVE_INFINITY,o}function l(m,...g){let v;if(fR("use",r),m!=null)if(typeof m=="function")_(m,...g);else if(typeof m=="object")Array.isArray(m)?b(m):x(m);else throw new TypeError("Expected usable value, not `"+m+"`");return v&&(n.settings=Object.assign(n.settings||{},v)),o;function y(S){if(typeof S=="function")_(S);else if(typeof S=="object")if(Array.isArray(S)){const[O,...C]=S;_(O,...C)}else x(S);else throw new TypeError("Expected usable value, not `"+S+"`")}function x(S){b(S.plugins),S.settings&&(v=Object.assign(v||{},S.settings))}function b(S){let O=-1;if(S!=null)if(Array.isArray(S))for(;++O<S.length;){const C=S[O];y(C)}else throw new TypeError("Expected a list of plugins, not `"+S+"`")}function _(S,O){let C=-1,E;for(;++C<e.length;)if(e[C][0]===S){E=e[C];break}E?(D3(E[1])&&D3(O)&&(O=NH(!0,E[1],O)),E[1]=O):e.push([...arguments])}}function c(m){o.freeze();const g=T0(m),v=o.Parser;return cR("parse",v),$H(v,"parse")?new v(String(g),g).parse():v(String(g),g)}function u(m,g){o.freeze();const v=T0(g),y=o.Compiler;return uR("stringify",y),FH(m),$H(y,"compile")?new y(m,v).compile():y(m,v)}function f(m,g,v){if(FH(m),o.freeze(),!v&&typeof g=="function"&&(v=g,g=void 0),!v)return new Promise(y);y(null,v);function y(x,b){t.run(m,T0(g),_);function _(S,O,C){O=O||m,S?b(S):x?x(O):v(null,O,C)}}}function d(m,g){let v,y;return o.run(m,g,x),jH("runSync","run",y),v;function x(b,_){MH(b),v=_,y=!0}}function h(m,g){if(o.freeze(),cR("process",o.Parser),uR("process",o.Compiler),!g)return new Promise(v);v(null,g);function v(y,x){const b=T0(m);o.run(o.parse(b),b,(S,O,C)=>{if(S||!O||!C)_(S);else{const E=o.stringify(O,C);E==null||(cGe(E)?C.value=E:C.result=E),_(S,C)}});function _(S,O){S||!O?x(S):y?y(O):g(null,O)}}}function p(m){let g;o.freeze(),cR("processSync",o.Parser),uR("processSync",o.Compiler);const v=T0(m);return o.process(v,y),jH("processSync","process",g),v;function y(x){g=!0,MH(x)}}}function $H(t,e){return typeof t=="function"&&t.prototype&&(sGe(t.prototype)||e in t.prototype)}function sGe(t){let e;for(e in t)if(tce.call(t,e))return!0;return!1}function cR(t,e){if(typeof e!="function")throw new TypeError("Cannot `"+t+"` without `Parser`")}function uR(t,e){if(typeof e!="function")throw new TypeError("Cannot `"+t+"` without `Compiler`")}function fR(t,e){if(e)throw new Error("Cannot call `"+t+"` on a frozen processor.\nCreate a new processor first, by calling it: use `processor()` instead of `processor`.")}function FH(t){if(!D3(t)||typeof t.type!="string")throw new TypeError("Expected node, got `"+t+"`")}function jH(t,e,n){if(!n)throw new Error("`"+t+"` finished async. Use `"+e+"` instead")}function T0(t){return lGe(t)?t:new Jle(t)}function lGe(t){return!!(t&&typeof t=="object"&&"message"in t&&"messages"in t)}function cGe(t){return typeof t=="string"||Zle(t)}const uGe={};function fGe(t,e){const n=uGe,r=typeof n.includeImageAlt=="boolean"?n.includeImageAlt:!0,i=typeof n.includeHtml=="boolean"?n.includeHtml:!0;return rce(t,r,i)}function rce(t,e,n){if(dGe(t)){if("value"in t)return t.type==="html"&&!n?"":t.value;if(e&&"alt"in t&&t.alt)return t.alt;if("children"in t)return BH(t.children,e,n)}return Array.isArray(t)?BH(t,e,n):""}function BH(t,e,n){const r=[];let i=-1;for(;++i<t.length;)r[i]=rce(t[i],e,n);return r.join("")}function dGe(t){return!!(t&&typeof t=="object")}function ec(t,e,n,r){const i=t.length;let o=0,a;if(e<0?e=-e>i?0:i+e:e=e>i?i:e,n=n>0?n:0,r.length<1e4)a=Array.from(r),a.unshift(e,n),t.splice(...a);else for(n&&t.splice(e,n);o<r.length;)a=r.slice(o,o+1e4),a.unshift(e,0),t.splice(...a),o+=1e4,e+=1e4}function Ba(t,e){return t.length>0?(ec(t,t.length,0,e),t):e}const zH={}.hasOwnProperty;function hGe(t){const e={};let n=-1;for(;++n<t.length;)pGe(e,t[n]);return e}function pGe(t,e){let n;for(n in e){const i=(zH.call(t,n)?t[n]:void 0)||(t[n]={}),o=e[n];let a;if(o)for(a in o){zH.call(i,a)||(i[a]=[]);const s=o[a];mGe(i[a],Array.isArray(s)?s:s?[s]:[])}}}function mGe(t,e){let n=-1;const r=[];for(;++n<e.length;)(e[n].add==="after"?t:r).push(e[n]);ec(t,0,0,r)}const gGe=/[!-\/:-@\[-`\{-~\xA1\xA7\xAB\xB6\xB7\xBB\xBF\u037E\u0387\u055A-\u055F\u0589\u058A\u05BE\u05C0\u05C3\u05C6\u05F3\u05F4\u0609\u060A\u060C\u060D\u061B\u061D-\u061F\u066A-\u066D\u06D4\u0700-\u070D\u07F7-\u07F9\u0830-\u083E\u085E\u0964\u0965\u0970\u09FD\u0A76\u0AF0\u0C77\u0C84\u0DF4\u0E4F\u0E5A\u0E5B\u0F04-\u0F12\u0F14\u0F3A-\u0F3D\u0F85\u0FD0-\u0FD4\u0FD9\u0FDA\u104A-\u104F\u10FB\u1360-\u1368\u1400\u166E\u169B\u169C\u16EB-\u16ED\u1735\u1736\u17D4-\u17D6\u17D8-\u17DA\u1800-\u180A\u1944\u1945\u1A1E\u1A1F\u1AA0-\u1AA6\u1AA8-\u1AAD\u1B5A-\u1B60\u1B7D\u1B7E\u1BFC-\u1BFF\u1C3B-\u1C3F\u1C7E\u1C7F\u1CC0-\u1CC7\u1CD3\u2010-\u2027\u2030-\u2043\u2045-\u2051\u2053-\u205E\u207D\u207E\u208D\u208E\u2308-\u230B\u2329\u232A\u2768-\u2775\u27C5\u27C6\u27E6-\u27EF\u2983-\u2998\u29D8-\u29DB\u29FC\u29FD\u2CF9-\u2CFC\u2CFE\u2CFF\u2D70\u2E00-\u2E2E\u2E30-\u2E4F\u2E52-\u2E5D\u3001-\u3003\u3008-\u3011\u3014-\u301F\u3030\u303D\u30A0\u30FB\uA4FE\uA4FF\uA60D-\uA60F\uA673\uA67E\uA6F2-\uA6F7\uA874-\uA877\uA8CE\uA8CF\uA8F8-\uA8FA\uA8FC\uA92E\uA92F\uA95F\uA9C1-\uA9CD\uA9DE\uA9DF\uAA5C-\uAA5F\uAADE\uAADF\uAAF0\uAAF1\uABEB\uFD3E\uFD3F\uFE10-\uFE19\uFE30-\uFE52\uFE54-\uFE61\uFE63\uFE68\uFE6A\uFE6B\uFF01-\uFF03\uFF05-\uFF0A\uFF0C-\uFF0F\uFF1A\uFF1B\uFF1F\uFF20\uFF3B-\uFF3D\uFF3F\uFF5B\uFF5D\uFF5F-\uFF65]/,Cl=Od(/[A-Za-z]/),ma=Od(/[\dA-Za-z]/),vGe=Od(/[#-'*+\--9=?A-Z^-~]/);function L3(t){return t!==null&&(t<32||t===127)}const N3=Od(/\d/),yGe=Od(/[\dA-Fa-f]/),xGe=Od(/[!-/:-@[-`{-~]/);function Tt(t){return t!==null&&t<-2}function Fo(t){return t!==null&&(t<0||t===32)}function yn(t){return t===-2||t===-1||t===32}const bGe=Od(gGe),_Ge=Od(/\s/);function Od(t){return e;function e(n){return n!==null&&t.test(String.fromCharCode(n))}}function Vn(t,e,n,r){const i=r?r-1:Number.POSITIVE_INFINITY;let o=0;return a;function a(l){return yn(l)?(t.enter(n),s(l)):e(l)}function s(l){return yn(l)&&o++<i?(t.consume(l),s):(t.exit(n),e(l))}}const wGe={tokenize:SGe};function SGe(t){const e=t.attempt(this.parser.constructs.contentInitial,r,i);let n;return e;function r(s){if(s===null){t.consume(s);return}return t.enter("lineEnding"),t.consume(s),t.exit("lineEnding"),Vn(t,e,"linePrefix")}function i(s){return t.enter("paragraph"),o(s)}function o(s){const l=t.enter("chunkText",{contentType:"text",previous:n});return n&&(n.next=l),n=l,a(s)}function a(s){if(s===null){t.exit("chunkText"),t.exit("paragraph"),t.consume(s);return}return Tt(s)?(t.consume(s),t.exit("chunkText"),o):(t.consume(s),a)}}const OGe={tokenize:CGe},UH={tokenize:TGe};function CGe(t){const e=this,n=[];let r=0,i,o,a;return s;function s(x){if(r<n.length){const b=n[r];return e.containerState=b[1],t.attempt(b[0].continuation,l,c)(x)}return c(x)}function l(x){if(r++,e.containerState._closeFlow){e.containerState._closeFlow=void 0,i&&y();const b=e.events.length;let _=b,S;for(;_--;)if(e.events[_][0]==="exit"&&e.events[_][1].type==="chunkFlow"){S=e.events[_][1].end;break}v(r);let O=b;for(;O<e.events.length;)e.events[O][1].end=Object.assign({},S),O++;return ec(e.events,_+1,0,e.events.slice(b)),e.events.length=O,c(x)}return s(x)}function c(x){if(r===n.length){if(!i)return d(x);if(i.currentConstruct&&i.currentConstruct.concrete)return p(x);e.interrupt=!!(i.currentConstruct&&!i._gfmTableDynamicInterruptHack)}return e.containerState={},t.check(UH,u,f)(x)}function u(x){return i&&y(),v(r),d(x)}function f(x){return e.parser.lazy[e.now().line]=r!==n.length,a=e.now().offset,p(x)}function d(x){return e.containerState={},t.attempt(UH,h,p)(x)}function h(x){return r++,n.push([e.currentConstruct,e.containerState]),d(x)}function p(x){if(x===null){i&&y(),v(0),t.consume(x);return}return i=i||e.parser.flow(e.now()),t.enter("chunkFlow",{contentType:"flow",previous:o,_tokenizer:i}),m(x)}function m(x){if(x===null){g(t.exit("chunkFlow"),!0),v(0),t.consume(x);return}return Tt(x)?(t.consume(x),g(t.exit("chunkFlow")),r=0,e.interrupt=void 0,s):(t.consume(x),m)}function g(x,b){const _=e.sliceStream(x);if(b&&_.push(null),x.previous=o,o&&(o.next=x),o=x,i.defineSkip(x.start),i.write(_),e.parser.lazy[x.start.line]){let S=i.events.length;for(;S--;)if(i.events[S][1].start.offset<a&&(!i.events[S][1].end||i.events[S][1].end.offset>a))return;const O=e.events.length;let C=O,E,k;for(;C--;)if(e.events[C][0]==="exit"&&e.events[C][1].type==="chunkFlow"){if(E){k=e.events[C][1].end;break}E=!0}for(v(r),S=O;S<e.events.length;)e.events[S][1].end=Object.assign({},k),S++;ec(e.events,C+1,0,e.events.slice(O)),e.events.length=S}}function v(x){let b=n.length;for(;b-- >x;){const _=n[b];e.containerState=_[1],_[0].exit.call(e,t)}n.length=x}function y(){i.write([null]),o=void 0,i=void 0,e.containerState._closeFlow=void 0}}function TGe(t,e,n){return Vn(t,t.attempt(this.parser.constructs.document,e,n),"linePrefix",this.parser.constructs.disable.null.includes("codeIndented")?void 0:4)}function WH(t){if(t===null||Fo(t)||_Ge(t))return 1;if(bGe(t))return 2}function uz(t,e,n){const r=[];let i=-1;for(;++i<t.length;){const o=t[i].resolveAll;o&&!r.includes(o)&&(e=o(e,n),r.push(o))}return e}const $3={name:"attention",tokenize:PGe,resolveAll:EGe};function EGe(t,e){let n=-1,r,i,o,a,s,l,c,u;for(;++n<t.length;)if(t[n][0]==="enter"&&t[n][1].type==="attentionSequence"&&t[n][1]._close){for(r=n;r--;)if(t[r][0]==="exit"&&t[r][1].type==="attentionSequence"&&t[r][1]._open&&e.sliceSerialize(t[r][1]).charCodeAt(0)===e.sliceSerialize(t[n][1]).charCodeAt(0)){if((t[r][1]._close||t[n][1]._open)&&(t[n][1].end.offset-t[n][1].start.offset)%3&&!((t[r][1].end.offset-t[r][1].start.offset+t[n][1].end.offset-t[n][1].start.offset)%3))continue;l=t[r][1].end.offset-t[r][1].start.offset>1&&t[n][1].end.offset-t[n][1].start.offset>1?2:1;const f=Object.assign({},t[r][1].end),d=Object.assign({},t[n][1].start);VH(f,-l),VH(d,l),a={type:l>1?"strongSequence":"emphasisSequence",start:f,end:Object.assign({},t[r][1].end)},s={type:l>1?"strongSequence":"emphasisSequence",start:Object.assign({},t[n][1].start),end:d},o={type:l>1?"strongText":"emphasisText",start:Object.assign({},t[r][1].end),end:Object.assign({},t[n][1].start)},i={type:l>1?"strong":"emphasis",start:Object.assign({},a.start),end:Object.assign({},s.end)},t[r][1].end=Object.assign({},a.start),t[n][1].start=Object.assign({},s.end),c=[],t[r][1].end.offset-t[r][1].start.offset&&(c=Ba(c,[["enter",t[r][1],e],["exit",t[r][1],e]])),c=Ba(c,[["enter",i,e],["enter",a,e],["exit",a,e],["enter",o,e]]),c=Ba(c,uz(e.parser.constructs.insideSpan.null,t.slice(r+1,n),e)),c=Ba(c,[["exit",o,e],["enter",s,e],["exit",s,e],["exit",i,e]]),t[n][1].end.offset-t[n][1].start.offset?(u=2,c=Ba(c,[["enter",t[n][1],e],["exit",t[n][1],e]])):u=0,ec(t,r-1,n-r+3,c),n=r+c.length-u-2;break}}for(n=-1;++n<t.length;)t[n][1].type==="attentionSequence"&&(t[n][1].type="data");return t}function PGe(t,e){const n=this.parser.constructs.attentionMarkers.null,r=this.previous,i=WH(r);let o;return a;function a(l){return o=l,t.enter("attentionSequence"),s(l)}function s(l){if(l===o)return t.consume(l),s;const c=t.exit("attentionSequence"),u=WH(l),f=!u||u===2&&i||n.includes(l),d=!i||i===2&&u||n.includes(r);return c._open=!!(o===42?f:f&&(i||!d)),c._close=!!(o===42?d:d&&(u||!f)),e(l)}}function VH(t,e){t.column+=e,t.offset+=e,t._bufferIndex+=e}const MGe={name:"autolink",tokenize:kGe};function kGe(t,e,n){let r=0;return i;function i(h){return t.enter("autolink"),t.enter("autolinkMarker"),t.consume(h),t.exit("autolinkMarker"),t.enter("autolinkProtocol"),o}function o(h){return Cl(h)?(t.consume(h),a):c(h)}function a(h){return h===43||h===45||h===46||ma(h)?(r=1,s(h)):c(h)}function s(h){return h===58?(t.consume(h),r=0,l):(h===43||h===45||h===46||ma(h))&&r++<32?(t.consume(h),s):(r=0,c(h))}function l(h){return h===62?(t.exit("autolinkProtocol"),t.enter("autolinkMarker"),t.consume(h),t.exit("autolinkMarker"),t.exit("autolink"),e):h===null||h===32||h===60||L3(h)?n(h):(t.consume(h),l)}function c(h){return h===64?(t.consume(h),u):vGe(h)?(t.consume(h),c):n(h)}function u(h){return ma(h)?f(h):n(h)}function f(h){return h===46?(t.consume(h),r=0,u):h===62?(t.exit("autolinkProtocol").type="autolinkEmail",t.enter("autolinkMarker"),t.consume(h),t.exit("autolinkMarker"),t.exit("autolink"),e):d(h)}function d(h){if((h===45||ma(h))&&r++<63){const p=h===45?d:f;return t.consume(h),p}return n(h)}}const I2={tokenize:AGe,partial:!0};function AGe(t,e,n){return r;function r(o){return yn(o)?Vn(t,i,"linePrefix")(o):i(o)}function i(o){return o===null||Tt(o)?e(o):n(o)}}const ice={name:"blockQuote",tokenize:RGe,continuation:{tokenize:IGe},exit:DGe};function RGe(t,e,n){const r=this;return i;function i(a){if(a===62){const s=r.containerState;return s.open||(t.enter("blockQuote",{_container:!0}),s.open=!0),t.enter("blockQuotePrefix"),t.enter("blockQuoteMarker"),t.consume(a),t.exit("blockQuoteMarker"),o}return n(a)}function o(a){return yn(a)?(t.enter("blockQuotePrefixWhitespace"),t.consume(a),t.exit("blockQuotePrefixWhitespace"),t.exit("blockQuotePrefix"),e):(t.exit("blockQuotePrefix"),e(a))}}function IGe(t,e,n){const r=this;return i;function i(a){return yn(a)?Vn(t,o,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(a):o(a)}function o(a){return t.attempt(ice,e,n)(a)}}function DGe(t){t.exit("blockQuote")}const oce={name:"characterEscape",tokenize:LGe};function LGe(t,e,n){return r;function r(o){return t.enter("characterEscape"),t.enter("escapeMarker"),t.consume(o),t.exit("escapeMarker"),i}function i(o){return xGe(o)?(t.enter("characterEscapeValue"),t.consume(o),t.exit("characterEscapeValue"),t.exit("characterEscape"),e):n(o)}}const GH=document.createElement("i");function fz(t){const e="&"+t+";";GH.innerHTML=e;const n=GH.textContent;return n.charCodeAt(n.length-1)===59&&t!=="semi"||n===e?!1:n}const ace={name:"characterReference",tokenize:NGe};function NGe(t,e,n){const r=this;let i=0,o,a;return s;function s(f){return t.enter("characterReference"),t.enter("characterReferenceMarker"),t.consume(f),t.exit("characterReferenceMarker"),l}function l(f){return f===35?(t.enter("characterReferenceMarkerNumeric"),t.consume(f),t.exit("characterReferenceMarkerNumeric"),c):(t.enter("characterReferenceValue"),o=31,a=ma,u(f))}function c(f){return f===88||f===120?(t.enter("characterReferenceMarkerHexadecimal"),t.consume(f),t.exit("characterReferenceMarkerHexadecimal"),t.enter("characterReferenceValue"),o=6,a=yGe,u):(t.enter("characterReferenceValue"),o=7,a=N3,u(f))}function u(f){if(f===59&&i){const d=t.exit("characterReferenceValue");return a===ma&&!fz(r.sliceSerialize(d))?n(f):(t.enter("characterReferenceMarker"),t.consume(f),t.exit("characterReferenceMarker"),t.exit("characterReference"),e)}return a(f)&&i++<o?(t.consume(f),u):n(f)}}const HH={tokenize:FGe,partial:!0},qH={name:"codeFenced",tokenize:$Ge,concrete:!0};function $Ge(t,e,n){const r=this,i={tokenize:_,partial:!0};let o=0,a=0,s;return l;function l(S){return c(S)}function c(S){const O=r.events[r.events.length-1];return o=O&&O[1].type==="linePrefix"?O[2].sliceSerialize(O[1],!0).length:0,s=S,t.enter("codeFenced"),t.enter("codeFencedFence"),t.enter("codeFencedFenceSequence"),u(S)}function u(S){return S===s?(a++,t.consume(S),u):a<3?n(S):(t.exit("codeFencedFenceSequence"),yn(S)?Vn(t,f,"whitespace")(S):f(S))}function f(S){return S===null||Tt(S)?(t.exit("codeFencedFence"),r.interrupt?e(S):t.check(HH,m,b)(S)):(t.enter("codeFencedFenceInfo"),t.enter("chunkString",{contentType:"string"}),d(S))}function d(S){return S===null||Tt(S)?(t.exit("chunkString"),t.exit("codeFencedFenceInfo"),f(S)):yn(S)?(t.exit("chunkString"),t.exit("codeFencedFenceInfo"),Vn(t,h,"whitespace")(S)):S===96&&S===s?n(S):(t.consume(S),d)}function h(S){return S===null||Tt(S)?f(S):(t.enter("codeFencedFenceMeta"),t.enter("chunkString",{contentType:"string"}),p(S))}function p(S){return S===null||Tt(S)?(t.exit("chunkString"),t.exit("codeFencedFenceMeta"),f(S)):S===96&&S===s?n(S):(t.consume(S),p)}function m(S){return t.attempt(i,b,g)(S)}function g(S){return t.enter("lineEnding"),t.consume(S),t.exit("lineEnding"),v}function v(S){return o>0&&yn(S)?Vn(t,y,"linePrefix",o+1)(S):y(S)}function y(S){return S===null||Tt(S)?t.check(HH,m,b)(S):(t.enter("codeFlowValue"),x(S))}function x(S){return S===null||Tt(S)?(t.exit("codeFlowValue"),y(S)):(t.consume(S),x)}function b(S){return t.exit("codeFenced"),e(S)}function _(S,O,C){let E=0;return k;function k(L){return S.enter("lineEnding"),S.consume(L),S.exit("lineEnding"),I}function I(L){return S.enter("codeFencedFence"),yn(L)?Vn(S,P,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(L):P(L)}function P(L){return L===s?(S.enter("codeFencedFenceSequence"),R(L)):C(L)}function R(L){return L===s?(E++,S.consume(L),R):E>=a?(S.exit("codeFencedFenceSequence"),yn(L)?Vn(S,T,"whitespace")(L):T(L)):C(L)}function T(L){return L===null||Tt(L)?(S.exit("codeFencedFence"),O(L)):C(L)}}}function FGe(t,e,n){const r=this;return i;function i(a){return a===null?n(a):(t.enter("lineEnding"),t.consume(a),t.exit("lineEnding"),o)}function o(a){return r.parser.lazy[r.now().line]?n(a):e(a)}}const dR={name:"codeIndented",tokenize:BGe},jGe={tokenize:zGe,partial:!0};function BGe(t,e,n){const r=this;return i;function i(c){return t.enter("codeIndented"),Vn(t,o,"linePrefix",5)(c)}function o(c){const u=r.events[r.events.length-1];return u&&u[1].type==="linePrefix"&&u[2].sliceSerialize(u[1],!0).length>=4?a(c):n(c)}function a(c){return c===null?l(c):Tt(c)?t.attempt(jGe,a,l)(c):(t.enter("codeFlowValue"),s(c))}function s(c){return c===null||Tt(c)?(t.exit("codeFlowValue"),a(c)):(t.consume(c),s)}function l(c){return t.exit("codeIndented"),e(c)}}function zGe(t,e,n){const r=this;return i;function i(a){return r.parser.lazy[r.now().line]?n(a):Tt(a)?(t.enter("lineEnding"),t.consume(a),t.exit("lineEnding"),i):Vn(t,o,"linePrefix",5)(a)}function o(a){const s=r.events[r.events.length-1];return s&&s[1].type==="linePrefix"&&s[2].sliceSerialize(s[1],!0).length>=4?e(a):Tt(a)?i(a):n(a)}}const UGe={name:"codeText",tokenize:GGe,resolve:WGe,previous:VGe};function WGe(t){let e=t.length-4,n=3,r,i;if((t[n][1].type==="lineEnding"||t[n][1].type==="space")&&(t[e][1].type==="lineEnding"||t[e][1].type==="space")){for(r=n;++r<e;)if(t[r][1].type==="codeTextData"){t[n][1].type="codeTextPadding",t[e][1].type="codeTextPadding",n+=2,e-=2;break}}for(r=n-1,e++;++r<=e;)i===void 0?r!==e&&t[r][1].type!=="lineEnding"&&(i=r):(r===e||t[r][1].type==="lineEnding")&&(t[i][1].type="codeTextData",r!==i+2&&(t[i][1].end=t[r-1][1].end,t.splice(i+2,r-i-2),e-=r-i-2,r=i+2),i=void 0);return t}function VGe(t){return t!==96||this.events[this.events.length-1][1].type==="characterEscape"}function GGe(t,e,n){let r=0,i,o;return a;function a(f){return t.enter("codeText"),t.enter("codeTextSequence"),s(f)}function s(f){return f===96?(t.consume(f),r++,s):(t.exit("codeTextSequence"),l(f))}function l(f){return f===null?n(f):f===32?(t.enter("space"),t.consume(f),t.exit("space"),l):f===96?(o=t.enter("codeTextSequence"),i=0,u(f)):Tt(f)?(t.enter("lineEnding"),t.consume(f),t.exit("lineEnding"),l):(t.enter("codeTextData"),c(f))}function c(f){return f===null||f===32||f===96||Tt(f)?(t.exit("codeTextData"),l(f)):(t.consume(f),c)}function u(f){return f===96?(t.consume(f),i++,u):i===r?(t.exit("codeTextSequence"),t.exit("codeText"),e(f)):(o.type="codeTextData",c(f))}}function sce(t){const e={};let n=-1,r,i,o,a,s,l,c;for(;++n<t.length;){for(;n in e;)n=e[n];if(r=t[n],n&&r[1].type==="chunkFlow"&&t[n-1][1].type==="listItemPrefix"&&(l=r[1]._tokenizer.events,o=0,o<l.length&&l[o][1].type==="lineEndingBlank"&&(o+=2),o<l.length&&l[o][1].type==="content"))for(;++o<l.length&&l[o][1].type!=="content";)l[o][1].type==="chunkText"&&(l[o][1]._isInFirstContentOfListItem=!0,o++);if(r[0]==="enter")r[1].contentType&&(Object.assign(e,HGe(t,n)),n=e[n],c=!0);else if(r[1]._container){for(o=n,i=void 0;o--&&(a=t[o],a[1].type==="lineEnding"||a[1].type==="lineEndingBlank");)a[0]==="enter"&&(i&&(t[i][1].type="lineEndingBlank"),a[1].type="lineEnding",i=o);i&&(r[1].end=Object.assign({},t[i][1].start),s=t.slice(i,n),s.unshift(r),ec(t,i,n-i+1,s))}}return!c}function HGe(t,e){const n=t[e][1],r=t[e][2];let i=e-1;const o=[],a=n._tokenizer||r.parser[n.contentType](n.start),s=a.events,l=[],c={};let u,f,d=-1,h=n,p=0,m=0;const g=[m];for(;h;){for(;t[++i][1]!==h;);o.push(i),h._tokenizer||(u=r.sliceStream(h),h.next||u.push(null),f&&a.defineSkip(h.start),h._isInFirstContentOfListItem&&(a._gfmTasklistFirstContentOfListItem=!0),a.write(u),h._isInFirstContentOfListItem&&(a._gfmTasklistFirstContentOfListItem=void 0)),f=h,h=h.next}for(h=n;++d<s.length;)s[d][0]==="exit"&&s[d-1][0]==="enter"&&s[d][1].type===s[d-1][1].type&&s[d][1].start.line!==s[d][1].end.line&&(m=d+1,g.push(m),h._tokenizer=void 0,h.previous=void 0,h=h.next);for(a.events=[],h?(h._tokenizer=void 0,h.previous=void 0):g.pop(),d=g.length;d--;){const v=s.slice(g[d],g[d+1]),y=o.pop();l.unshift([y,y+v.length-1]),ec(t,y,2,v)}for(d=-1;++d<l.length;)c[p+l[d][0]]=p+l[d][1],p+=l[d][1]-l[d][0]-1;return c}const qGe={tokenize:YGe,resolve:QGe},XGe={tokenize:KGe,partial:!0};function QGe(t){return sce(t),t}function YGe(t,e){let n;return r;function r(s){return t.enter("content"),n=t.enter("chunkContent",{contentType:"content"}),i(s)}function i(s){return s===null?o(s):Tt(s)?t.check(XGe,a,o)(s):(t.consume(s),i)}function o(s){return t.exit("chunkContent"),t.exit("content"),e(s)}function a(s){return t.consume(s),t.exit("chunkContent"),n.next=t.enter("chunkContent",{contentType:"content",previous:n}),n=n.next,i}}function KGe(t,e,n){const r=this;return i;function i(a){return t.exit("chunkContent"),t.enter("lineEnding"),t.consume(a),t.exit("lineEnding"),Vn(t,o,"linePrefix")}function o(a){if(a===null||Tt(a))return n(a);const s=r.events[r.events.length-1];return!r.parser.constructs.disable.null.includes("codeIndented")&&s&&s[1].type==="linePrefix"&&s[2].sliceSerialize(s[1],!0).length>=4?e(a):t.interrupt(r.parser.constructs.flow,n,e)(a)}}function lce(t,e,n,r,i,o,a,s,l){const c=l||Number.POSITIVE_INFINITY;let u=0;return f;function f(v){return v===60?(t.enter(r),t.enter(i),t.enter(o),t.consume(v),t.exit(o),d):v===null||v===32||v===41||L3(v)?n(v):(t.enter(r),t.enter(a),t.enter(s),t.enter("chunkString",{contentType:"string"}),m(v))}function d(v){return v===62?(t.enter(o),t.consume(v),t.exit(o),t.exit(i),t.exit(r),e):(t.enter(s),t.enter("chunkString",{contentType:"string"}),h(v))}function h(v){return v===62?(t.exit("chunkString"),t.exit(s),d(v)):v===null||v===60||Tt(v)?n(v):(t.consume(v),v===92?p:h)}function p(v){return v===60||v===62||v===92?(t.consume(v),h):h(v)}function m(v){return!u&&(v===null||v===41||Fo(v))?(t.exit("chunkString"),t.exit(s),t.exit(a),t.exit(r),e(v)):u<c&&v===40?(t.consume(v),u++,m):v===41?(t.consume(v),u--,m):v===null||v===32||v===40||L3(v)?n(v):(t.consume(v),v===92?g:m)}function g(v){return v===40||v===41||v===92?(t.consume(v),m):m(v)}}function cce(t,e,n,r,i,o){const a=this;let s=0,l;return c;function c(h){return t.enter(r),t.enter(i),t.consume(h),t.exit(i),t.enter(o),u}function u(h){return s>999||h===null||h===91||h===93&&!l||h===94&&!s&&"_hiddenFootnoteSupport"in a.parser.constructs?n(h):h===93?(t.exit(o),t.enter(i),t.consume(h),t.exit(i),t.exit(r),e):Tt(h)?(t.enter("lineEnding"),t.consume(h),t.exit("lineEnding"),u):(t.enter("chunkString",{contentType:"string"}),f(h))}function f(h){return h===null||h===91||h===93||Tt(h)||s++>999?(t.exit("chunkString"),u(h)):(t.consume(h),l||(l=!yn(h)),h===92?d:f)}function d(h){return h===91||h===92||h===93?(t.consume(h),s++,f):f(h)}}function uce(t,e,n,r,i,o){let a;return s;function s(d){return d===34||d===39||d===40?(t.enter(r),t.enter(i),t.consume(d),t.exit(i),a=d===40?41:d,l):n(d)}function l(d){return d===a?(t.enter(i),t.consume(d),t.exit(i),t.exit(r),e):(t.enter(o),c(d))}function c(d){return d===a?(t.exit(o),l(a)):d===null?n(d):Tt(d)?(t.enter("lineEnding"),t.consume(d),t.exit("lineEnding"),Vn(t,c,"linePrefix")):(t.enter("chunkString",{contentType:"string"}),u(d))}function u(d){return d===a||d===null||Tt(d)?(t.exit("chunkString"),c(d)):(t.consume(d),d===92?f:u)}function f(d){return d===a||d===92?(t.consume(d),u):u(d)}}function Yx(t,e){let n;return r;function r(i){return Tt(i)?(t.enter("lineEnding"),t.consume(i),t.exit("lineEnding"),n=!0,r):yn(i)?Vn(t,r,n?"linePrefix":"lineSuffix")(i):e(i)}}function Eg(t){return t.replace(/[\t\n\r ]+/g," ").replace(/^ | $/g,"").toLowerCase().toUpperCase()}const ZGe={name:"definition",tokenize:eHe},JGe={tokenize:tHe,partial:!0};function eHe(t,e,n){const r=this;let i;return o;function o(h){return t.enter("definition"),a(h)}function a(h){return cce.call(r,t,s,n,"definitionLabel","definitionLabelMarker","definitionLabelString")(h)}function s(h){return i=Eg(r.sliceSerialize(r.events[r.events.length-1][1]).slice(1,-1)),h===58?(t.enter("definitionMarker"),t.consume(h),t.exit("definitionMarker"),l):n(h)}function l(h){return Fo(h)?Yx(t,c)(h):c(h)}function c(h){return lce(t,u,n,"definitionDestination","definitionDestinationLiteral","definitionDestinationLiteralMarker","definitionDestinationRaw","definitionDestinationString")(h)}function u(h){return t.attempt(JGe,f,f)(h)}function f(h){return yn(h)?Vn(t,d,"whitespace")(h):d(h)}function d(h){return h===null||Tt(h)?(t.exit("definition"),r.parser.defined.push(i),e(h)):n(h)}}function tHe(t,e,n){return r;function r(s){return Fo(s)?Yx(t,i)(s):n(s)}function i(s){return uce(t,o,n,"definitionTitle","definitionTitleMarker","definitionTitleString")(s)}function o(s){return yn(s)?Vn(t,a,"whitespace")(s):a(s)}function a(s){return s===null||Tt(s)?e(s):n(s)}}const nHe={name:"hardBreakEscape",tokenize:rHe};function rHe(t,e,n){return r;function r(o){return t.enter("hardBreakEscape"),t.consume(o),i}function i(o){return Tt(o)?(t.exit("hardBreakEscape"),e(o)):n(o)}}const iHe={name:"headingAtx",tokenize:aHe,resolve:oHe};function oHe(t,e){let n=t.length-2,r=3,i,o;return t[r][1].type==="whitespace"&&(r+=2),n-2>r&&t[n][1].type==="whitespace"&&(n-=2),t[n][1].type==="atxHeadingSequence"&&(r===n-1||n-4>r&&t[n-2][1].type==="whitespace")&&(n-=r+1===n?2:4),n>r&&(i={type:"atxHeadingText",start:t[r][1].start,end:t[n][1].end},o={type:"chunkText",start:t[r][1].start,end:t[n][1].end,contentType:"text"},ec(t,r,n-r+1,[["enter",i,e],["enter",o,e],["exit",o,e],["exit",i,e]])),t}function aHe(t,e,n){let r=0;return i;function i(u){return t.enter("atxHeading"),o(u)}function o(u){return t.enter("atxHeadingSequence"),a(u)}function a(u){return u===35&&r++<6?(t.consume(u),a):u===null||Fo(u)?(t.exit("atxHeadingSequence"),s(u)):n(u)}function s(u){return u===35?(t.enter("atxHeadingSequence"),l(u)):u===null||Tt(u)?(t.exit("atxHeading"),e(u)):yn(u)?Vn(t,s,"whitespace")(u):(t.enter("atxHeadingText"),c(u))}function l(u){return u===35?(t.consume(u),l):(t.exit("atxHeadingSequence"),s(u))}function c(u){return u===null||u===35||Fo(u)?(t.exit("atxHeadingText"),s(u)):(t.consume(u),c)}}const sHe=["address","article","aside","base","basefont","blockquote","body","caption","center","col","colgroup","dd","details","dialog","dir","div","dl","dt","fieldset","figcaption","figure","footer","form","frame","frameset","h1","h2","h3","h4","h5","h6","head","header","hr","html","iframe","legend","li","link","main","menu","menuitem","nav","noframes","ol","optgroup","option","p","param","search","section","summary","table","tbody","td","tfoot","th","thead","title","tr","track","ul"],XH=["pre","script","style","textarea"],lHe={name:"htmlFlow",tokenize:dHe,resolveTo:fHe,concrete:!0},cHe={tokenize:pHe,partial:!0},uHe={tokenize:hHe,partial:!0};function fHe(t){let e=t.length;for(;e--&&!(t[e][0]==="enter"&&t[e][1].type==="htmlFlow"););return e>1&&t[e-2][1].type==="linePrefix"&&(t[e][1].start=t[e-2][1].start,t[e+1][1].start=t[e-2][1].start,t.splice(e-2,2)),t}function dHe(t,e,n){const r=this;let i,o,a,s,l;return c;function c(A){return u(A)}function u(A){return t.enter("htmlFlow"),t.enter("htmlFlowData"),t.consume(A),f}function f(A){return A===33?(t.consume(A),d):A===47?(t.consume(A),o=!0,m):A===63?(t.consume(A),i=3,r.interrupt?e:$):Cl(A)?(t.consume(A),a=String.fromCharCode(A),g):n(A)}function d(A){return A===45?(t.consume(A),i=2,h):A===91?(t.consume(A),i=5,s=0,p):Cl(A)?(t.consume(A),i=4,r.interrupt?e:$):n(A)}function h(A){return A===45?(t.consume(A),r.interrupt?e:$):n(A)}function p(A){const q="CDATA[";return A===q.charCodeAt(s++)?(t.consume(A),s===q.length?r.interrupt?e:P:p):n(A)}function m(A){return Cl(A)?(t.consume(A),a=String.fromCharCode(A),g):n(A)}function g(A){if(A===null||A===47||A===62||Fo(A)){const q=A===47,Y=a.toLowerCase();return!q&&!o&&XH.includes(Y)?(i=1,r.interrupt?e(A):P(A)):sHe.includes(a.toLowerCase())?(i=6,q?(t.consume(A),v):r.interrupt?e(A):P(A)):(i=7,r.interrupt&&!r.parser.lazy[r.now().line]?n(A):o?y(A):x(A))}return A===45||ma(A)?(t.consume(A),a+=String.fromCharCode(A),g):n(A)}function v(A){return A===62?(t.consume(A),r.interrupt?e:P):n(A)}function y(A){return yn(A)?(t.consume(A),y):k(A)}function x(A){return A===47?(t.consume(A),k):A===58||A===95||Cl(A)?(t.consume(A),b):yn(A)?(t.consume(A),x):k(A)}function b(A){return A===45||A===46||A===58||A===95||ma(A)?(t.consume(A),b):_(A)}function _(A){return A===61?(t.consume(A),S):yn(A)?(t.consume(A),_):x(A)}function S(A){return A===null||A===60||A===61||A===62||A===96?n(A):A===34||A===39?(t.consume(A),l=A,O):yn(A)?(t.consume(A),S):C(A)}function O(A){return A===l?(t.consume(A),l=null,E):A===null||Tt(A)?n(A):(t.consume(A),O)}function C(A){return A===null||A===34||A===39||A===47||A===60||A===61||A===62||A===96||Fo(A)?_(A):(t.consume(A),C)}function E(A){return A===47||A===62||yn(A)?x(A):n(A)}function k(A){return A===62?(t.consume(A),I):n(A)}function I(A){return A===null||Tt(A)?P(A):yn(A)?(t.consume(A),I):n(A)}function P(A){return A===45&&i===2?(t.consume(A),z):A===60&&i===1?(t.consume(A),B):A===62&&i===4?(t.consume(A),N):A===63&&i===3?(t.consume(A),$):A===93&&i===5?(t.consume(A),W):Tt(A)&&(i===6||i===7)?(t.exit("htmlFlowData"),t.check(cHe,D,R)(A)):A===null||Tt(A)?(t.exit("htmlFlowData"),R(A)):(t.consume(A),P)}function R(A){return t.check(uHe,T,D)(A)}function T(A){return t.enter("lineEnding"),t.consume(A),t.exit("lineEnding"),L}function L(A){return A===null||Tt(A)?R(A):(t.enter("htmlFlowData"),P(A))}function z(A){return A===45?(t.consume(A),$):P(A)}function B(A){return A===47?(t.consume(A),a="",U):P(A)}function U(A){if(A===62){const q=a.toLowerCase();return XH.includes(q)?(t.consume(A),N):P(A)}return Cl(A)&&a.length<8?(t.consume(A),a+=String.fromCharCode(A),U):P(A)}function W(A){return A===93?(t.consume(A),$):P(A)}function $(A){return A===62?(t.consume(A),N):A===45&&i===2?(t.consume(A),$):P(A)}function N(A){return A===null||Tt(A)?(t.exit("htmlFlowData"),D(A)):(t.consume(A),N)}function D(A){return t.exit("htmlFlow"),e(A)}}function hHe(t,e,n){const r=this;return i;function i(a){return Tt(a)?(t.enter("lineEnding"),t.consume(a),t.exit("lineEnding"),o):n(a)}function o(a){return r.parser.lazy[r.now().line]?n(a):e(a)}}function pHe(t,e,n){return r;function r(i){return t.enter("lineEnding"),t.consume(i),t.exit("lineEnding"),t.attempt(I2,e,n)}}const mHe={name:"htmlText",tokenize:gHe};function gHe(t,e,n){const r=this;let i,o,a;return s;function s($){return t.enter("htmlText"),t.enter("htmlTextData"),t.consume($),l}function l($){return $===33?(t.consume($),c):$===47?(t.consume($),_):$===63?(t.consume($),x):Cl($)?(t.consume($),C):n($)}function c($){return $===45?(t.consume($),u):$===91?(t.consume($),o=0,p):Cl($)?(t.consume($),y):n($)}function u($){return $===45?(t.consume($),h):n($)}function f($){return $===null?n($):$===45?(t.consume($),d):Tt($)?(a=f,B($)):(t.consume($),f)}function d($){return $===45?(t.consume($),h):f($)}function h($){return $===62?z($):$===45?d($):f($)}function p($){const N="CDATA[";return $===N.charCodeAt(o++)?(t.consume($),o===N.length?m:p):n($)}function m($){return $===null?n($):$===93?(t.consume($),g):Tt($)?(a=m,B($)):(t.consume($),m)}function g($){return $===93?(t.consume($),v):m($)}function v($){return $===62?z($):$===93?(t.consume($),v):m($)}function y($){return $===null||$===62?z($):Tt($)?(a=y,B($)):(t.consume($),y)}function x($){return $===null?n($):$===63?(t.consume($),b):Tt($)?(a=x,B($)):(t.consume($),x)}function b($){return $===62?z($):x($)}function _($){return Cl($)?(t.consume($),S):n($)}function S($){return $===45||ma($)?(t.consume($),S):O($)}function O($){return Tt($)?(a=O,B($)):yn($)?(t.consume($),O):z($)}function C($){return $===45||ma($)?(t.consume($),C):$===47||$===62||Fo($)?E($):n($)}function E($){return $===47?(t.consume($),z):$===58||$===95||Cl($)?(t.consume($),k):Tt($)?(a=E,B($)):yn($)?(t.consume($),E):z($)}function k($){return $===45||$===46||$===58||$===95||ma($)?(t.consume($),k):I($)}function I($){return $===61?(t.consume($),P):Tt($)?(a=I,B($)):yn($)?(t.consume($),I):E($)}function P($){return $===null||$===60||$===61||$===62||$===96?n($):$===34||$===39?(t.consume($),i=$,R):Tt($)?(a=P,B($)):yn($)?(t.consume($),P):(t.consume($),T)}function R($){return $===i?(t.consume($),i=void 0,L):$===null?n($):Tt($)?(a=R,B($)):(t.consume($),R)}function T($){return $===null||$===34||$===39||$===60||$===61||$===96?n($):$===47||$===62||Fo($)?E($):(t.consume($),T)}function L($){return $===47||$===62||Fo($)?E($):n($)}function z($){return $===62?(t.consume($),t.exit("htmlTextData"),t.exit("htmlText"),e):n($)}function B($){return t.exit("htmlTextData"),t.enter("lineEnding"),t.consume($),t.exit("lineEnding"),U}function U($){return yn($)?Vn(t,W,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)($):W($)}function W($){return t.enter("htmlTextData"),a($)}}const dz={name:"labelEnd",tokenize:wHe,resolveTo:_He,resolveAll:bHe},vHe={tokenize:SHe},yHe={tokenize:OHe},xHe={tokenize:CHe};function bHe(t){let e=-1;for(;++e<t.length;){const n=t[e][1];(n.type==="labelImage"||n.type==="labelLink"||n.type==="labelEnd")&&(t.splice(e+1,n.type==="labelImage"?4:2),n.type="data",e++)}return t}function _He(t,e){let n=t.length,r=0,i,o,a,s;for(;n--;)if(i=t[n][1],o){if(i.type==="link"||i.type==="labelLink"&&i._inactive)break;t[n][0]==="enter"&&i.type==="labelLink"&&(i._inactive=!0)}else if(a){if(t[n][0]==="enter"&&(i.type==="labelImage"||i.type==="labelLink")&&!i._balanced&&(o=n,i.type!=="labelLink")){r=2;break}}else i.type==="labelEnd"&&(a=n);const l={type:t[o][1].type==="labelLink"?"link":"image",start:Object.assign({},t[o][1].start),end:Object.assign({},t[t.length-1][1].end)},c={type:"label",start:Object.assign({},t[o][1].start),end:Object.assign({},t[a][1].end)},u={type:"labelText",start:Object.assign({},t[o+r+2][1].end),end:Object.assign({},t[a-2][1].start)};return s=[["enter",l,e],["enter",c,e]],s=Ba(s,t.slice(o+1,o+r+3)),s=Ba(s,[["enter",u,e]]),s=Ba(s,uz(e.parser.constructs.insideSpan.null,t.slice(o+r+4,a-3),e)),s=Ba(s,[["exit",u,e],t[a-2],t[a-1],["exit",c,e]]),s=Ba(s,t.slice(a+1)),s=Ba(s,[["exit",l,e]]),ec(t,o,t.length,s),t}function wHe(t,e,n){const r=this;let i=r.events.length,o,a;for(;i--;)if((r.events[i][1].type==="labelImage"||r.events[i][1].type==="labelLink")&&!r.events[i][1]._balanced){o=r.events[i][1];break}return s;function s(d){return o?o._inactive?f(d):(a=r.parser.defined.includes(Eg(r.sliceSerialize({start:o.end,end:r.now()}))),t.enter("labelEnd"),t.enter("labelMarker"),t.consume(d),t.exit("labelMarker"),t.exit("labelEnd"),l):n(d)}function l(d){return d===40?t.attempt(vHe,u,a?u:f)(d):d===91?t.attempt(yHe,u,a?c:f)(d):a?u(d):f(d)}function c(d){return t.attempt(xHe,u,f)(d)}function u(d){return e(d)}function f(d){return o._balanced=!0,n(d)}}function SHe(t,e,n){return r;function r(f){return t.enter("resource"),t.enter("resourceMarker"),t.consume(f),t.exit("resourceMarker"),i}function i(f){return Fo(f)?Yx(t,o)(f):o(f)}function o(f){return f===41?u(f):lce(t,a,s,"resourceDestination","resourceDestinationLiteral","resourceDestinationLiteralMarker","resourceDestinationRaw","resourceDestinationString",32)(f)}function a(f){return Fo(f)?Yx(t,l)(f):u(f)}function s(f){return n(f)}function l(f){return f===34||f===39||f===40?uce(t,c,n,"resourceTitle","resourceTitleMarker","resourceTitleString")(f):u(f)}function c(f){return Fo(f)?Yx(t,u)(f):u(f)}function u(f){return f===41?(t.enter("resourceMarker"),t.consume(f),t.exit("resourceMarker"),t.exit("resource"),e):n(f)}}function OHe(t,e,n){const r=this;return i;function i(s){return cce.call(r,t,o,a,"reference","referenceMarker","referenceString")(s)}function o(s){return r.parser.defined.includes(Eg(r.sliceSerialize(r.events[r.events.length-1][1]).slice(1,-1)))?e(s):n(s)}function a(s){return n(s)}}function CHe(t,e,n){return r;function r(o){return t.enter("reference"),t.enter("referenceMarker"),t.consume(o),t.exit("referenceMarker"),i}function i(o){return o===93?(t.enter("referenceMarker"),t.consume(o),t.exit("referenceMarker"),t.exit("reference"),e):n(o)}}const THe={name:"labelStartImage",tokenize:EHe,resolveAll:dz.resolveAll};function EHe(t,e,n){const r=this;return i;function i(s){return t.enter("labelImage"),t.enter("labelImageMarker"),t.consume(s),t.exit("labelImageMarker"),o}function o(s){return s===91?(t.enter("labelMarker"),t.consume(s),t.exit("labelMarker"),t.exit("labelImage"),a):n(s)}function a(s){return s===94&&"_hiddenFootnoteSupport"in r.parser.constructs?n(s):e(s)}}const PHe={name:"labelStartLink",tokenize:MHe,resolveAll:dz.resolveAll};function MHe(t,e,n){const r=this;return i;function i(a){return t.enter("labelLink"),t.enter("labelMarker"),t.consume(a),t.exit("labelMarker"),t.exit("labelLink"),o}function o(a){return a===94&&"_hiddenFootnoteSupport"in r.parser.constructs?n(a):e(a)}}const hR={name:"lineEnding",tokenize:kHe};function kHe(t,e){return n;function n(r){return t.enter("lineEnding"),t.consume(r),t.exit("lineEnding"),Vn(t,e,"linePrefix")}}const NC={name:"thematicBreak",tokenize:AHe};function AHe(t,e,n){let r=0,i;return o;function o(c){return t.enter("thematicBreak"),a(c)}function a(c){return i=c,s(c)}function s(c){return c===i?(t.enter("thematicBreakSequence"),l(c)):r>=3&&(c===null||Tt(c))?(t.exit("thematicBreak"),e(c)):n(c)}function l(c){return c===i?(t.consume(c),r++,l):(t.exit("thematicBreakSequence"),yn(c)?Vn(t,s,"whitespace")(c):s(c))}}const _o={name:"list",tokenize:DHe,continuation:{tokenize:LHe},exit:$He},RHe={tokenize:FHe,partial:!0},IHe={tokenize:NHe,partial:!0};function DHe(t,e,n){const r=this,i=r.events[r.events.length-1];let o=i&&i[1].type==="linePrefix"?i[2].sliceSerialize(i[1],!0).length:0,a=0;return s;function s(h){const p=r.containerState.type||(h===42||h===43||h===45?"listUnordered":"listOrdered");if(p==="listUnordered"?!r.containerState.marker||h===r.containerState.marker:N3(h)){if(r.containerState.type||(r.containerState.type=p,t.enter(p,{_container:!0})),p==="listUnordered")return t.enter("listItemPrefix"),h===42||h===45?t.check(NC,n,c)(h):c(h);if(!r.interrupt||h===49)return t.enter("listItemPrefix"),t.enter("listItemValue"),l(h)}return n(h)}function l(h){return N3(h)&&++a<10?(t.consume(h),l):(!r.interrupt||a<2)&&(r.containerState.marker?h===r.containerState.marker:h===41||h===46)?(t.exit("listItemValue"),c(h)):n(h)}function c(h){return t.enter("listItemMarker"),t.consume(h),t.exit("listItemMarker"),r.containerState.marker=r.containerState.marker||h,t.check(I2,r.interrupt?n:u,t.attempt(RHe,d,f))}function u(h){return r.containerState.initialBlankLine=!0,o++,d(h)}function f(h){return yn(h)?(t.enter("listItemPrefixWhitespace"),t.consume(h),t.exit("listItemPrefixWhitespace"),d):n(h)}function d(h){return r.containerState.size=o+r.sliceSerialize(t.exit("listItemPrefix"),!0).length,e(h)}}function LHe(t,e,n){const r=this;return r.containerState._closeFlow=void 0,t.check(I2,i,o);function i(s){return r.containerState.furtherBlankLines=r.containerState.furtherBlankLines||r.containerState.initialBlankLine,Vn(t,e,"listItemIndent",r.containerState.size+1)(s)}function o(s){return r.containerState.furtherBlankLines||!yn(s)?(r.containerState.furtherBlankLines=void 0,r.containerState.initialBlankLine=void 0,a(s)):(r.containerState.furtherBlankLines=void 0,r.containerState.initialBlankLine=void 0,t.attempt(IHe,e,a)(s))}function a(s){return r.containerState._closeFlow=!0,r.interrupt=void 0,Vn(t,t.attempt(_o,e,n),"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(s)}}function NHe(t,e,n){const r=this;return Vn(t,i,"listItemIndent",r.containerState.size+1);function i(o){const a=r.events[r.events.length-1];return a&&a[1].type==="listItemIndent"&&a[2].sliceSerialize(a[1],!0).length===r.containerState.size?e(o):n(o)}}function $He(t){t.exit(this.containerState.type)}function FHe(t,e,n){const r=this;return Vn(t,i,"listItemPrefixWhitespace",r.parser.constructs.disable.null.includes("codeIndented")?void 0:5);function i(o){const a=r.events[r.events.length-1];return!yn(o)&&a&&a[1].type==="listItemPrefixWhitespace"?e(o):n(o)}}const QH={name:"setextUnderline",tokenize:BHe,resolveTo:jHe};function jHe(t,e){let n=t.length,r,i,o;for(;n--;)if(t[n][0]==="enter"){if(t[n][1].type==="content"){r=n;break}t[n][1].type==="paragraph"&&(i=n)}else t[n][1].type==="content"&&t.splice(n,1),!o&&t[n][1].type==="definition"&&(o=n);const a={type:"setextHeading",start:Object.assign({},t[i][1].start),end:Object.assign({},t[t.length-1][1].end)};return t[i][1].type="setextHeadingText",o?(t.splice(i,0,["enter",a,e]),t.splice(o+1,0,["exit",t[r][1],e]),t[r][1].end=Object.assign({},t[o][1].end)):t[r][1]=a,t.push(["exit",a,e]),t}function BHe(t,e,n){const r=this;let i;return o;function o(c){let u=r.events.length,f;for(;u--;)if(r.events[u][1].type!=="lineEnding"&&r.events[u][1].type!=="linePrefix"&&r.events[u][1].type!=="content"){f=r.events[u][1].type==="paragraph";break}return!r.parser.lazy[r.now().line]&&(r.interrupt||f)?(t.enter("setextHeadingLine"),i=c,a(c)):n(c)}function a(c){return t.enter("setextHeadingLineSequence"),s(c)}function s(c){return c===i?(t.consume(c),s):(t.exit("setextHeadingLineSequence"),yn(c)?Vn(t,l,"lineSuffix")(c):l(c))}function l(c){return c===null||Tt(c)?(t.exit("setextHeadingLine"),e(c)):n(c)}}const zHe={tokenize:UHe};function UHe(t){const e=this,n=t.attempt(I2,r,t.attempt(this.parser.constructs.flowInitial,i,Vn(t,t.attempt(this.parser.constructs.flow,i,t.attempt(qGe,i)),"linePrefix")));return n;function r(o){if(o===null){t.consume(o);return}return t.enter("lineEndingBlank"),t.consume(o),t.exit("lineEndingBlank"),e.currentConstruct=void 0,n}function i(o){if(o===null){t.consume(o);return}return t.enter("lineEnding"),t.consume(o),t.exit("lineEnding"),e.currentConstruct=void 0,n}}const WHe={resolveAll:dce()},VHe=fce("string"),GHe=fce("text");function fce(t){return{tokenize:e,resolveAll:dce(t==="text"?HHe:void 0)};function e(n){const r=this,i=this.parser.constructs[t],o=n.attempt(i,a,s);return a;function a(u){return c(u)?o(u):s(u)}function s(u){if(u===null){n.consume(u);return}return n.enter("data"),n.consume(u),l}function l(u){return c(u)?(n.exit("data"),o(u)):(n.consume(u),l)}function c(u){if(u===null)return!0;const f=i[u];let d=-1;if(f)for(;++d<f.length;){const h=f[d];if(!h.previous||h.previous.call(r,r.previous))return!0}return!1}}}function dce(t){return e;function e(n,r){let i=-1,o;for(;++i<=n.length;)o===void 0?n[i]&&n[i][1].type==="data"&&(o=i,i++):(!n[i]||n[i][1].type!=="data")&&(i!==o+2&&(n[o][1].end=n[i-1][1].end,n.splice(o+2,i-o-2),i=o+2),o=void 0);return t?t(n,r):n}}function HHe(t,e){let n=0;for(;++n<=t.length;)if((n===t.length||t[n][1].type==="lineEnding")&&t[n-1][1].type==="data"){const r=t[n-1][1],i=e.sliceStream(r);let o=i.length,a=-1,s=0,l;for(;o--;){const c=i[o];if(typeof c=="string"){for(a=c.length;c.charCodeAt(a-1)===32;)s++,a--;if(a)break;a=-1}else if(c===-2)l=!0,s++;else if(c!==-1){o++;break}}if(s){const c={type:n===t.length||l||s<2?"lineSuffix":"hardBreakTrailing",start:{line:r.end.line,column:r.end.column-s,offset:r.end.offset-s,_index:r.start._index+o,_bufferIndex:o?a:r.start._bufferIndex+a},end:Object.assign({},r.end)};r.end=Object.assign({},c.start),r.start.offset===r.end.offset?Object.assign(r,c):(t.splice(n,0,["enter",c,e],["exit",c,e]),n+=2)}n++}return t}function qHe(t,e,n){let r=Object.assign(n?Object.assign({},n):{line:1,column:1,offset:0},{_index:0,_bufferIndex:-1});const i={},o=[];let a=[],s=[];const l={consume:y,enter:x,exit:b,attempt:O(_),check:O(S),interrupt:O(S,{interrupt:!0})},c={previous:null,code:null,containerState:{},events:[],parser:t,sliceStream:h,sliceSerialize:d,now:p,defineSkip:m,write:f};let u=e.tokenize.call(c,l);return e.resolveAll&&o.push(e),c;function f(I){return a=Ba(a,I),g(),a[a.length-1]!==null?[]:(C(e,0),c.events=uz(o,c.events,c),c.events)}function d(I,P){return QHe(h(I),P)}function h(I){return XHe(a,I)}function p(){const{line:I,column:P,offset:R,_index:T,_bufferIndex:L}=r;return{line:I,column:P,offset:R,_index:T,_bufferIndex:L}}function m(I){i[I.line]=I.column,k()}function g(){let I;for(;r._index<a.length;){const P=a[r._index];if(typeof P=="string")for(I=r._index,r._bufferIndex<0&&(r._bufferIndex=0);r._index===I&&r._bufferIndex<P.length;)v(P.charCodeAt(r._bufferIndex));else v(P)}}function v(I){u=u(I)}function y(I){Tt(I)?(r.line++,r.column=1,r.offset+=I===-3?2:1,k()):I!==-1&&(r.column++,r.offset++),r._bufferIndex<0?r._index++:(r._bufferIndex++,r._bufferIndex===a[r._index].length&&(r._bufferIndex=-1,r._index++)),c.previous=I}function x(I,P){const R=P||{};return R.type=I,R.start=p(),c.events.push(["enter",R,c]),s.push(R),R}function b(I){const P=s.pop();return P.end=p(),c.events.push(["exit",P,c]),P}function _(I,P){C(I,P.from)}function S(I,P){P.restore()}function O(I,P){return R;function R(T,L,z){let B,U,W,$;return Array.isArray(T)?D(T):"tokenize"in T?D([T]):N(T);function N(K){return se;function se(te){const J=te!==null&&K[te],pe=te!==null&&K.null,be=[...Array.isArray(J)?J:J?[J]:[],...Array.isArray(pe)?pe:pe?[pe]:[]];return D(be)(te)}}function D(K){return B=K,U=0,K.length===0?z:A(K[U])}function A(K){return se;function se(te){return $=E(),W=K,K.partial||(c.currentConstruct=K),K.name&&c.parser.constructs.disable.null.includes(K.name)?Y():K.tokenize.call(P?Object.assign(Object.create(c),P):c,l,q,Y)(te)}}function q(K){return I(W,$),L}function Y(K){return $.restore(),++U<B.length?A(B[U]):z}}}function C(I,P){I.resolveAll&&!o.includes(I)&&o.push(I),I.resolve&&ec(c.events,P,c.events.length-P,I.resolve(c.events.slice(P),c)),I.resolveTo&&(c.events=I.resolveTo(c.events,c))}function E(){const I=p(),P=c.previous,R=c.currentConstruct,T=c.events.length,L=Array.from(s);return{restore:z,from:T};function z(){r=I,c.previous=P,c.currentConstruct=R,c.events.length=T,s=L,k()}}function k(){r.line in i&&r.column<2&&(r.column=i[r.line],r.offset+=i[r.line]-1)}}function XHe(t,e){const n=e.start._index,r=e.start._bufferIndex,i=e.end._index,o=e.end._bufferIndex;let a;if(n===i)a=[t[n].slice(r,o)];else{if(a=t.slice(n,i),r>-1){const s=a[0];typeof s=="string"?a[0]=s.slice(r):a.shift()}o>0&&a.push(t[i].slice(0,o))}return a}function QHe(t,e){let n=-1;const r=[];let i;for(;++n<t.length;){const o=t[n];let a;if(typeof o=="string")a=o;else switch(o){case-5:{a="\r";break}case-4:{a=`
`;break}case-3:{a=`\r
`;break}case-2:{a=e?" ":"	";break}case-1:{if(!e&&i)continue;a=" ";break}default:a=String.fromCharCode(o)}i=o===-2,r.push(a)}return r.join("")}const YHe={42:_o,43:_o,45:_o,48:_o,49:_o,50:_o,51:_o,52:_o,53:_o,54:_o,55:_o,56:_o,57:_o,62:ice},KHe={91:ZGe},ZHe={[-2]:dR,[-1]:dR,32:dR},JHe={35:iHe,42:NC,45:[QH,NC],60:lHe,61:QH,95:NC,96:qH,126:qH},e9e={38:ace,92:oce},t9e={[-5]:hR,[-4]:hR,[-3]:hR,33:THe,38:ace,42:$3,60:[MGe,mHe],91:PHe,92:[nHe,oce],93:dz,95:$3,96:UGe},n9e={null:[$3,WHe]},r9e={null:[42,95]},i9e={null:[]},o9e=Object.freeze(Object.defineProperty({__proto__:null,attentionMarkers:r9e,contentInitial:KHe,disable:i9e,document:YHe,flow:JHe,flowInitial:ZHe,insideSpan:n9e,string:e9e,text:t9e},Symbol.toStringTag,{value:"Module"}));function a9e(t){const n=hGe([o9e,...(t||{}).extensions||[]]),r={defined:[],lazy:{},constructs:n,content:i(wGe),document:i(OGe),flow:i(zHe),string:i(VHe),text:i(GHe)};return r;function i(o){return a;function a(s){return qHe(r,o,s)}}}const YH=/[\0\t\n\r]/g;function s9e(){let t=1,e="",n=!0,r;return i;function i(o,a,s){const l=[];let c,u,f,d,h;for(o=e+o.toString(a),f=0,e="",n&&(o.charCodeAt(0)===65279&&f++,n=void 0);f<o.length;){if(YH.lastIndex=f,c=YH.exec(o),d=c&&c.index!==void 0?c.index:o.length,h=o.charCodeAt(d),!c){e=o.slice(f);break}if(h===10&&f===d&&r)l.push(-3),r=void 0;else switch(r&&(l.push(-5),r=void 0),f<d&&(l.push(o.slice(f,d)),t+=d-f),h){case 0:{l.push(65533),t++;break}case 9:{for(u=Math.ceil(t/4)*4,l.push(-2);t++<u;)l.push(-1);break}case 10:{l.push(-4),t=1;break}default:r=!0,t=1}f=d+1}return s&&(r&&l.push(-5),e&&l.push(e),l.push(null)),l}}function l9e(t){for(;!sce(t););return t}function hce(t,e){const n=Number.parseInt(t,e);return n<9||n===11||n>13&&n<32||n>126&&n<160||n>55295&&n<57344||n>64975&&n<65008||(n&65535)===65535||(n&65535)===65534||n>1114111?"�":String.fromCharCode(n)}const c9e=/\\([!-/:-@[-`{-~])|&(#(?:\d{1,7}|x[\da-f]{1,6})|[\da-z]{1,31});/gi;function u9e(t){return t.replace(c9e,f9e)}function f9e(t,e,n){if(e)return e;if(n.charCodeAt(0)===35){const i=n.charCodeAt(1),o=i===120||i===88;return hce(n.slice(o?2:1),o?16:10)}return fz(n)||t}const pce={}.hasOwnProperty,d9e=function(t,e,n){return typeof e!="string"&&(n=e,e=void 0),h9e(n)(l9e(a9e(n).document().write(s9e()(t,e,!0))))};function h9e(t){const e={transforms:[],canContainEols:["emphasis","fragment","heading","paragraph","strong"],enter:{autolink:s(ge),autolinkProtocol:I,autolinkEmail:I,atxHeading:s(le),blockQuote:s(be),characterEscape:I,characterReference:I,codeFenced:s(re),codeFencedFenceInfo:l,codeFencedFenceMeta:l,codeIndented:s(re,l),codeText:s(ve,l),codeTextData:I,data:I,codeFlowValue:I,definition:s(F),definitionDestinationString:l,definitionLabelString:l,definitionTitleString:l,emphasis:s(ce),hardBreakEscape:s(Q),hardBreakTrailing:s(Q),htmlFlow:s(X,l),htmlFlowData:I,htmlText:s(X,l),htmlTextData:I,image:s(ee),label:l,link:s(ge),listItem:s(H),listItemValue:p,listOrdered:s(ye,h),listUnordered:s(ye),paragraph:s(G),reference:Y,referenceString:l,resourceDestinationString:l,resourceTitleString:l,setextHeading:s(le),strong:s(ie),thematicBreak:s(_e)},exit:{atxHeading:u(),atxHeadingSequence:O,autolink:u(),autolinkEmail:pe,autolinkProtocol:J,blockQuote:u(),characterEscapeValue:P,characterReferenceMarkerHexadecimal:se,characterReferenceMarkerNumeric:se,characterReferenceValue:te,codeFenced:u(y),codeFencedFence:v,codeFencedFenceInfo:m,codeFencedFenceMeta:g,codeFlowValue:P,codeIndented:u(x),codeText:u(B),codeTextData:P,data:P,definition:u(),definitionDestinationString:S,definitionLabelString:b,definitionTitleString:_,emphasis:u(),hardBreakEscape:u(T),hardBreakTrailing:u(T),htmlFlow:u(L),htmlFlowData:P,htmlText:u(z),htmlTextData:P,image:u(W),label:N,labelText:$,lineEnding:R,link:u(U),listItem:u(),listOrdered:u(),listUnordered:u(),paragraph:u(),referenceString:K,resourceDestinationString:D,resourceTitleString:A,resource:q,setextHeading:u(k),setextHeadingLineSequence:E,setextHeadingText:C,strong:u(),thematicBreak:u()}};mce(e,(t||{}).mdastExtensions||[]);const n={};return r;function r(oe){let Z={type:"root",children:[]};const V={stack:[Z],tokenStack:[],config:e,enter:c,exit:f,buffer:l,resume:d,setData:o,getData:a},de=[];let xe=-1;for(;++xe<oe.length;)if(oe[xe][1].type==="listOrdered"||oe[xe][1].type==="listUnordered")if(oe[xe][0]==="enter")de.push(xe);else{const Me=de.pop();xe=i(oe,Me,xe)}for(xe=-1;++xe<oe.length;){const Me=e[oe[xe][0]];pce.call(Me,oe[xe][1].type)&&Me[oe[xe][1].type].call(Object.assign({sliceSerialize:oe[xe][2].sliceSerialize},V),oe[xe][1])}if(V.tokenStack.length>0){const Me=V.tokenStack[V.tokenStack.length-1];(Me[1]||KH).call(V,void 0,Me[0])}for(Z.position={start:Fu(oe.length>0?oe[0][1].start:{line:1,column:1,offset:0}),end:Fu(oe.length>0?oe[oe.length-2][1].end:{line:1,column:1,offset:0})},xe=-1;++xe<e.transforms.length;)Z=e.transforms[xe](Z)||Z;return Z}function i(oe,Z,V){let de=Z-1,xe=-1,Me=!1,me,$e,Te,Re;for(;++de<=V;){const ae=oe[de];if(ae[1].type==="listUnordered"||ae[1].type==="listOrdered"||ae[1].type==="blockQuote"?(ae[0]==="enter"?xe++:xe--,Re=void 0):ae[1].type==="lineEndingBlank"?ae[0]==="enter"&&(me&&!Re&&!xe&&!Te&&(Te=de),Re=void 0):ae[1].type==="linePrefix"||ae[1].type==="listItemValue"||ae[1].type==="listItemMarker"||ae[1].type==="listItemPrefix"||ae[1].type==="listItemPrefixWhitespace"||(Re=void 0),!xe&&ae[0]==="enter"&&ae[1].type==="listItemPrefix"||xe===-1&&ae[0]==="exit"&&(ae[1].type==="listUnordered"||ae[1].type==="listOrdered")){if(me){let Le=de;for($e=void 0;Le--;){const Ee=oe[Le];if(Ee[1].type==="lineEnding"||Ee[1].type==="lineEndingBlank"){if(Ee[0]==="exit")continue;$e&&(oe[$e][1].type="lineEndingBlank",Me=!0),Ee[1].type="lineEnding",$e=Le}else if(!(Ee[1].type==="linePrefix"||Ee[1].type==="blockQuotePrefix"||Ee[1].type==="blockQuotePrefixWhitespace"||Ee[1].type==="blockQuoteMarker"||Ee[1].type==="listItemIndent"))break}Te&&(!$e||Te<$e)&&(me._spread=!0),me.end=Object.assign({},$e?oe[$e][1].start:ae[1].end),oe.splice($e||de,0,["exit",me,ae[2]]),de++,V++}ae[1].type==="listItemPrefix"&&(me={type:"listItem",_spread:!1,start:Object.assign({},ae[1].start),end:void 0},oe.splice(de,0,["enter",me,ae[2]]),de++,V++,Te=void 0,Re=!0)}}return oe[Z][1]._spread=Me,V}function o(oe,Z){n[oe]=Z}function a(oe){return n[oe]}function s(oe,Z){return V;function V(de){c.call(this,oe(de),de),Z&&Z.call(this,de)}}function l(){this.stack.push({type:"fragment",children:[]})}function c(oe,Z,V){return this.stack[this.stack.length-1].children.push(oe),this.stack.push(oe),this.tokenStack.push([Z,V]),oe.position={start:Fu(Z.start)},oe}function u(oe){return Z;function Z(V){oe&&oe.call(this,V),f.call(this,V)}}function f(oe,Z){const V=this.stack.pop(),de=this.tokenStack.pop();if(de)de[0].type!==oe.type&&(Z?Z.call(this,oe,de[0]):(de[1]||KH).call(this,oe,de[0]));else throw new Error("Cannot close `"+oe.type+"` ("+Qx({start:oe.start,end:oe.end})+"): it’s not open");return V.position.end=Fu(oe.end),V}function d(){return fGe(this.stack.pop())}function h(){o("expectingFirstListItemValue",!0)}function p(oe){if(a("expectingFirstListItemValue")){const Z=this.stack[this.stack.length-2];Z.start=Number.parseInt(this.sliceSerialize(oe),10),o("expectingFirstListItemValue")}}function m(){const oe=this.resume(),Z=this.stack[this.stack.length-1];Z.lang=oe}function g(){const oe=this.resume(),Z=this.stack[this.stack.length-1];Z.meta=oe}function v(){a("flowCodeInside")||(this.buffer(),o("flowCodeInside",!0))}function y(){const oe=this.resume(),Z=this.stack[this.stack.length-1];Z.value=oe.replace(/^(\r?\n|\r)|(\r?\n|\r)$/g,""),o("flowCodeInside")}function x(){const oe=this.resume(),Z=this.stack[this.stack.length-1];Z.value=oe.replace(/(\r?\n|\r)$/g,"")}function b(oe){const Z=this.resume(),V=this.stack[this.stack.length-1];V.label=Z,V.identifier=Eg(this.sliceSerialize(oe)).toLowerCase()}function _(){const oe=this.resume(),Z=this.stack[this.stack.length-1];Z.title=oe}function S(){const oe=this.resume(),Z=this.stack[this.stack.length-1];Z.url=oe}function O(oe){const Z=this.stack[this.stack.length-1];if(!Z.depth){const V=this.sliceSerialize(oe).length;Z.depth=V}}function C(){o("setextHeadingSlurpLineEnding",!0)}function E(oe){const Z=this.stack[this.stack.length-1];Z.depth=this.sliceSerialize(oe).charCodeAt(0)===61?1:2}function k(){o("setextHeadingSlurpLineEnding")}function I(oe){const Z=this.stack[this.stack.length-1];let V=Z.children[Z.children.length-1];(!V||V.type!=="text")&&(V=he(),V.position={start:Fu(oe.start)},Z.children.push(V)),this.stack.push(V)}function P(oe){const Z=this.stack.pop();Z.value+=this.sliceSerialize(oe),Z.position.end=Fu(oe.end)}function R(oe){const Z=this.stack[this.stack.length-1];if(a("atHardBreak")){const V=Z.children[Z.children.length-1];V.position.end=Fu(oe.end),o("atHardBreak");return}!a("setextHeadingSlurpLineEnding")&&e.canContainEols.includes(Z.type)&&(I.call(this,oe),P.call(this,oe))}function T(){o("atHardBreak",!0)}function L(){const oe=this.resume(),Z=this.stack[this.stack.length-1];Z.value=oe}function z(){const oe=this.resume(),Z=this.stack[this.stack.length-1];Z.value=oe}function B(){const oe=this.resume(),Z=this.stack[this.stack.length-1];Z.value=oe}function U(){const oe=this.stack[this.stack.length-1];if(a("inReference")){const Z=a("referenceType")||"shortcut";oe.type+="Reference",oe.referenceType=Z,delete oe.url,delete oe.title}else delete oe.identifier,delete oe.label;o("referenceType")}function W(){const oe=this.stack[this.stack.length-1];if(a("inReference")){const Z=a("referenceType")||"shortcut";oe.type+="Reference",oe.referenceType=Z,delete oe.url,delete oe.title}else delete oe.identifier,delete oe.label;o("referenceType")}function $(oe){const Z=this.sliceSerialize(oe),V=this.stack[this.stack.length-2];V.label=u9e(Z),V.identifier=Eg(Z).toLowerCase()}function N(){const oe=this.stack[this.stack.length-1],Z=this.resume(),V=this.stack[this.stack.length-1];if(o("inReference",!0),V.type==="link"){const de=oe.children;V.children=de}else V.alt=Z}function D(){const oe=this.resume(),Z=this.stack[this.stack.length-1];Z.url=oe}function A(){const oe=this.resume(),Z=this.stack[this.stack.length-1];Z.title=oe}function q(){o("inReference")}function Y(){o("referenceType","collapsed")}function K(oe){const Z=this.resume(),V=this.stack[this.stack.length-1];V.label=Z,V.identifier=Eg(this.sliceSerialize(oe)).toLowerCase(),o("referenceType","full")}function se(oe){o("characterReferenceType",oe.type)}function te(oe){const Z=this.sliceSerialize(oe),V=a("characterReferenceType");let de;V?(de=hce(Z,V==="characterReferenceMarkerNumeric"?10:16),o("characterReferenceType")):de=fz(Z);const xe=this.stack.pop();xe.value+=de,xe.position.end=Fu(oe.end)}function J(oe){P.call(this,oe);const Z=this.stack[this.stack.length-1];Z.url=this.sliceSerialize(oe)}function pe(oe){P.call(this,oe);const Z=this.stack[this.stack.length-1];Z.url="mailto:"+this.sliceSerialize(oe)}function be(){return{type:"blockquote",children:[]}}function re(){return{type:"code",lang:null,meta:null,value:""}}function ve(){return{type:"inlineCode",value:""}}function F(){return{type:"definition",identifier:"",label:null,title:null,url:""}}function ce(){return{type:"emphasis",children:[]}}function le(){return{type:"heading",depth:void 0,children:[]}}function Q(){return{type:"break"}}function X(){return{type:"html",value:""}}function ee(){return{type:"image",title:null,url:"",alt:null}}function ge(){return{type:"link",title:null,url:"",children:[]}}function ye(oe){return{type:"list",ordered:oe.type==="listOrdered",start:null,spread:oe._spread,children:[]}}function H(oe){return{type:"listItem",spread:oe._spread,checked:null,children:[]}}function G(){return{type:"paragraph",children:[]}}function ie(){return{type:"strong",children:[]}}function he(){return{type:"text",value:""}}function _e(){return{type:"thematicBreak"}}}function Fu(t){return{line:t.line,column:t.column,offset:t.offset}}function mce(t,e){let n=-1;for(;++n<e.length;){const r=e[n];Array.isArray(r)?mce(t,r):p9e(t,r)}}function p9e(t,e){let n;for(n in e)if(pce.call(e,n)){if(n==="canContainEols"){const r=e[n];r&&t[n].push(...r)}else if(n==="transforms"){const r=e[n];r&&t[n].push(...r)}else if(n==="enter"||n==="exit"){const r=e[n];r&&Object.assign(t[n],r)}}}function KH(t,e){throw t?new Error("Cannot close `"+t.type+"` ("+Qx({start:t.start,end:t.end})+"): a different token (`"+e.type+"`, "+Qx({start:e.start,end:e.end})+") is open"):new Error("Cannot close document, a token (`"+e.type+"`, "+Qx({start:e.start,end:e.end})+") is still open")}function m9e(t){Object.assign(this,{Parser:n=>{const r=this.data("settings");return d9e(n,Object.assign({},r,t,{extensions:this.data("micromarkExtensions")||[],mdastExtensions:this.data("fromMarkdownExtensions")||[]}))}})}function g9e(t,e){const n={type:"element",tagName:"blockquote",properties:{},children:t.wrap(t.all(e),!0)};return t.patch(e,n),t.applyData(e,n)}function v9e(t,e){const n={type:"element",tagName:"br",properties:{},children:[]};return t.patch(e,n),[t.applyData(e,n),{type:"text",value:`
`}]}function y9e(t,e){const n=e.value?e.value+`
`:"",r=e.lang?e.lang.match(/^[^ \t]+(?=[ \t]|$)/):null,i={};r&&(i.className=["language-"+r]);let o={type:"element",tagName:"code",properties:i,children:[{type:"text",value:n}]};return e.meta&&(o.data={meta:e.meta}),t.patch(e,o),o=t.applyData(e,o),o={type:"element",tagName:"pre",properties:{},children:[o]},t.patch(e,o),o}function x9e(t,e){const n={type:"element",tagName:"del",properties:{},children:t.all(e)};return t.patch(e,n),t.applyData(e,n)}function b9e(t,e){const n={type:"element",tagName:"em",properties:{},children:t.all(e)};return t.patch(e,n),t.applyData(e,n)}function Cy(t){const e=[];let n=-1,r=0,i=0;for(;++n<t.length;){const o=t.charCodeAt(n);let a="";if(o===37&&ma(t.charCodeAt(n+1))&&ma(t.charCodeAt(n+2)))i=2;else if(o<128)/[!#$&-;=?-Z_a-z~]/.test(String.fromCharCode(o))||(a=String.fromCharCode(o));else if(o>55295&&o<57344){const s=t.charCodeAt(n+1);o<56320&&s>56319&&s<57344?(a=String.fromCharCode(o,s),i=1):a="�"}else a=String.fromCharCode(o);a&&(e.push(t.slice(r,n),encodeURIComponent(a)),r=n+i+1,a=""),i&&(n+=i,i=0)}return e.join("")+t.slice(r)}function gce(t,e){const n=String(e.identifier).toUpperCase(),r=Cy(n.toLowerCase()),i=t.footnoteOrder.indexOf(n);let o;i===-1?(t.footnoteOrder.push(n),t.footnoteCounts[n]=1,o=t.footnoteOrder.length):(t.footnoteCounts[n]++,o=i+1);const a=t.footnoteCounts[n],s={type:"element",tagName:"a",properties:{href:"#"+t.clobberPrefix+"fn-"+r,id:t.clobberPrefix+"fnref-"+r+(a>1?"-"+a:""),dataFootnoteRef:!0,ariaDescribedBy:["footnote-label"]},children:[{type:"text",value:String(o)}]};t.patch(e,s);const l={type:"element",tagName:"sup",properties:{},children:[s]};return t.patch(e,l),t.applyData(e,l)}function _9e(t,e){const n=t.footnoteById;let r=1;for(;r in n;)r++;const i=String(r);return n[i]={type:"footnoteDefinition",identifier:i,children:[{type:"paragraph",children:e.children}],position:e.position},gce(t,{type:"footnoteReference",identifier:i,position:e.position})}function w9e(t,e){const n={type:"element",tagName:"h"+e.depth,properties:{},children:t.all(e)};return t.patch(e,n),t.applyData(e,n)}function S9e(t,e){if(t.dangerous){const n={type:"raw",value:e.value};return t.patch(e,n),t.applyData(e,n)}return null}function vce(t,e){const n=e.referenceType;let r="]";if(n==="collapsed"?r+="[]":n==="full"&&(r+="["+(e.label||e.identifier)+"]"),e.type==="imageReference")return{type:"text",value:"!["+e.alt+r};const i=t.all(e),o=i[0];o&&o.type==="text"?o.value="["+o.value:i.unshift({type:"text",value:"["});const a=i[i.length-1];return a&&a.type==="text"?a.value+=r:i.push({type:"text",value:r}),i}function O9e(t,e){const n=t.definition(e.identifier);if(!n)return vce(t,e);const r={src:Cy(n.url||""),alt:e.alt};n.title!==null&&n.title!==void 0&&(r.title=n.title);const i={type:"element",tagName:"img",properties:r,children:[]};return t.patch(e,i),t.applyData(e,i)}function C9e(t,e){const n={src:Cy(e.url)};e.alt!==null&&e.alt!==void 0&&(n.alt=e.alt),e.title!==null&&e.title!==void 0&&(n.title=e.title);const r={type:"element",tagName:"img",properties:n,children:[]};return t.patch(e,r),t.applyData(e,r)}function T9e(t,e){const n={type:"text",value:e.value.replace(/\r?\n|\r/g," ")};t.patch(e,n);const r={type:"element",tagName:"code",properties:{},children:[n]};return t.patch(e,r),t.applyData(e,r)}function E9e(t,e){const n=t.definition(e.identifier);if(!n)return vce(t,e);const r={href:Cy(n.url||"")};n.title!==null&&n.title!==void 0&&(r.title=n.title);const i={type:"element",tagName:"a",properties:r,children:t.all(e)};return t.patch(e,i),t.applyData(e,i)}function P9e(t,e){const n={href:Cy(e.url)};e.title!==null&&e.title!==void 0&&(n.title=e.title);const r={type:"element",tagName:"a",properties:n,children:t.all(e)};return t.patch(e,r),t.applyData(e,r)}function M9e(t,e,n){const r=t.all(e),i=n?k9e(n):yce(e),o={},a=[];if(typeof e.checked=="boolean"){const u=r[0];let f;u&&u.type==="element"&&u.tagName==="p"?f=u:(f={type:"element",tagName:"p",properties:{},children:[]},r.unshift(f)),f.children.length>0&&f.children.unshift({type:"text",value:" "}),f.children.unshift({type:"element",tagName:"input",properties:{type:"checkbox",checked:e.checked,disabled:!0},children:[]}),o.className=["task-list-item"]}let s=-1;for(;++s<r.length;){const u=r[s];(i||s!==0||u.type!=="element"||u.tagName!=="p")&&a.push({type:"text",value:`
`}),u.type==="element"&&u.tagName==="p"&&!i?a.push(...u.children):a.push(u)}const l=r[r.length-1];l&&(i||l.type!=="element"||l.tagName!=="p")&&a.push({type:"text",value:`
`});const c={type:"element",tagName:"li",properties:o,children:a};return t.patch(e,c),t.applyData(e,c)}function k9e(t){let e=!1;if(t.type==="list"){e=t.spread||!1;const n=t.children;let r=-1;for(;!e&&++r<n.length;)e=yce(n[r])}return e}function yce(t){const e=t.spread;return e??t.children.length>1}function A9e(t,e){const n={},r=t.all(e);let i=-1;for(typeof e.start=="number"&&e.start!==1&&(n.start=e.start);++i<r.length;){const a=r[i];if(a.type==="element"&&a.tagName==="li"&&a.properties&&Array.isArray(a.properties.className)&&a.properties.className.includes("task-list-item")){n.className=["contains-task-list"];break}}const o={type:"element",tagName:e.ordered?"ol":"ul",properties:n,children:t.wrap(r,!0)};return t.patch(e,o),t.applyData(e,o)}function R9e(t,e){const n={type:"element",tagName:"p",properties:{},children:t.all(e)};return t.patch(e,n),t.applyData(e,n)}function I9e(t,e){const n={type:"root",children:t.wrap(t.all(e))};return t.patch(e,n),t.applyData(e,n)}function D9e(t,e){const n={type:"element",tagName:"strong",properties:{},children:t.all(e)};return t.patch(e,n),t.applyData(e,n)}const hz=xce("start"),pz=xce("end");function L9e(t){return{start:hz(t),end:pz(t)}}function xce(t){return e;function e(n){const r=n&&n.position&&n.position[t]||{};return{line:r.line||null,column:r.column||null,offset:r.offset>-1?r.offset:null}}}function N9e(t,e){const n=t.all(e),r=n.shift(),i=[];if(r){const a={type:"element",tagName:"thead",properties:{},children:t.wrap([r],!0)};t.patch(e.children[0],a),i.push(a)}if(n.length>0){const a={type:"element",tagName:"tbody",properties:{},children:t.wrap(n,!0)},s=hz(e.children[1]),l=pz(e.children[e.children.length-1]);s.line&&l.line&&(a.position={start:s,end:l}),i.push(a)}const o={type:"element",tagName:"table",properties:{},children:t.wrap(i,!0)};return t.patch(e,o),t.applyData(e,o)}function $9e(t,e,n){const r=n?n.children:void 0,o=(r?r.indexOf(e):1)===0?"th":"td",a=n&&n.type==="table"?n.align:void 0,s=a?a.length:e.children.length;let l=-1;const c=[];for(;++l<s;){const f=e.children[l],d={},h=a?a[l]:void 0;h&&(d.align=h);let p={type:"element",tagName:o,properties:d,children:[]};f&&(p.children=t.all(f),t.patch(f,p),p=t.applyData(e,p)),c.push(p)}const u={type:"element",tagName:"tr",properties:{},children:t.wrap(c,!0)};return t.patch(e,u),t.applyData(e,u)}function F9e(t,e){const n={type:"element",tagName:"td",properties:{},children:t.all(e)};return t.patch(e,n),t.applyData(e,n)}const ZH=9,JH=32;function j9e(t){const e=String(t),n=/\r?\n|\r/g;let r=n.exec(e),i=0;const o=[];for(;r;)o.push(e9(e.slice(i,r.index),i>0,!0),r[0]),i=r.index+r[0].length,r=n.exec(e);return o.push(e9(e.slice(i),i>0,!1)),o.join("")}function e9(t,e,n){let r=0,i=t.length;if(e){let o=t.codePointAt(r);for(;o===ZH||o===JH;)r++,o=t.codePointAt(r)}if(n){let o=t.codePointAt(i-1);for(;o===ZH||o===JH;)i--,o=t.codePointAt(i-1)}return i>r?t.slice(r,i):""}function B9e(t,e){const n={type:"text",value:j9e(String(e.value))};return t.patch(e,n),t.applyData(e,n)}function z9e(t,e){const n={type:"element",tagName:"hr",properties:{},children:[]};return t.patch(e,n),t.applyData(e,n)}const U9e={blockquote:g9e,break:v9e,code:y9e,delete:x9e,emphasis:b9e,footnoteReference:gce,footnote:_9e,heading:w9e,html:S9e,imageReference:O9e,image:C9e,inlineCode:T9e,linkReference:E9e,link:P9e,listItem:M9e,list:A9e,paragraph:R9e,root:I9e,strong:D9e,table:N9e,tableCell:F9e,tableRow:$9e,text:B9e,thematicBreak:z9e,toml:NS,yaml:NS,definition:NS,footnoteDefinition:NS};function NS(){return null}const bce=function(t){if(t==null)return H9e;if(typeof t=="string")return G9e(t);if(typeof t=="object")return Array.isArray(t)?W9e(t):V9e(t);if(typeof t=="function")return D2(t);throw new Error("Expected function, string, or object as test")};function W9e(t){const e=[];let n=-1;for(;++n<t.length;)e[n]=bce(t[n]);return D2(r);function r(...i){let o=-1;for(;++o<e.length;)if(e[o].call(this,...i))return!0;return!1}}function V9e(t){return D2(e);function e(n){let r;for(r in t)if(n[r]!==t[r])return!1;return!0}}function G9e(t){return D2(e);function e(n){return n&&n.type===t}}function D2(t){return e;function e(n,...r){return!!(n&&typeof n=="object"&&"type"in n&&t.call(this,n,...r))}}function H9e(){return!0}const q9e=!0,t9=!1,X9e="skip",Q9e=function(t,e,n,r){typeof e=="function"&&typeof n!="function"&&(r=n,n=e,e=null);const i=bce(e),o=r?-1:1;a(t,void 0,[])();function a(s,l,c){const u=s&&typeof s=="object"?s:{};if(typeof u.type=="string"){const d=typeof u.tagName=="string"?u.tagName:typeof u.name=="string"?u.name:void 0;Object.defineProperty(f,"name",{value:"node ("+(s.type+(d?"<"+d+">":""))+")"})}return f;function f(){let d=[],h,p,m;if((!e||i(s,l,c[c.length-1]||null))&&(d=Y9e(n(s,c)),d[0]===t9))return d;if(s.children&&d[0]!==X9e)for(p=(r?s.children.length:-1)+o,m=c.concat(s);p>-1&&p<s.children.length;){if(h=a(s.children[p],p,m)(),h[0]===t9)return h;p=typeof h[1]=="number"?h[1]:p+o}return d}}};function Y9e(t){return Array.isArray(t)?t:typeof t=="number"?[q9e,t]:[t]}const mz=function(t,e,n,r){typeof e=="function"&&typeof n!="function"&&(r=n,n=e,e=null),Q9e(t,e,i,r);function i(o,a){const s=a[a.length-1];return n(o,s?s.children.indexOf(o):null,s)}};function K9e(t){return!t||!t.position||!t.position.start||!t.position.start.line||!t.position.start.column||!t.position.end||!t.position.end.line||!t.position.end.column}const n9={}.hasOwnProperty;function Z9e(t){const e=Object.create(null);if(!t||!t.type)throw new Error("mdast-util-definitions expected node");return mz(t,"definition",r=>{const i=r9(r.identifier);i&&!n9.call(e,i)&&(e[i]=r)}),n;function n(r){const i=r9(r);return i&&n9.call(e,i)?e[i]:null}}function r9(t){return String(t||"").toUpperCase()}const oE={}.hasOwnProperty;function J9e(t,e){const n=e||{},r=n.allowDangerousHtml||!1,i={};return a.dangerous=r,a.clobberPrefix=n.clobberPrefix===void 0||n.clobberPrefix===null?"user-content-":n.clobberPrefix,a.footnoteLabel=n.footnoteLabel||"Footnotes",a.footnoteLabelTagName=n.footnoteLabelTagName||"h2",a.footnoteLabelProperties=n.footnoteLabelProperties||{className:["sr-only"]},a.footnoteBackLabel=n.footnoteBackLabel||"Back to content",a.unknownHandler=n.unknownHandler,a.passThrough=n.passThrough,a.handlers={...U9e,...n.handlers},a.definition=Z9e(t),a.footnoteById=i,a.footnoteOrder=[],a.footnoteCounts={},a.patch=e7e,a.applyData=t7e,a.one=s,a.all=l,a.wrap=r7e,a.augment=o,mz(t,"footnoteDefinition",c=>{const u=String(c.identifier).toUpperCase();oE.call(i,u)||(i[u]=c)}),a;function o(c,u){if(c&&"data"in c&&c.data){const f=c.data;f.hName&&(u.type!=="element"&&(u={type:"element",tagName:"",properties:{},children:[]}),u.tagName=f.hName),u.type==="element"&&f.hProperties&&(u.properties={...u.properties,...f.hProperties}),"children"in u&&u.children&&f.hChildren&&(u.children=f.hChildren)}if(c){const f="type"in c?c:{position:c};K9e(f)||(u.position={start:hz(f),end:pz(f)})}return u}function a(c,u,f,d){return Array.isArray(f)&&(d=f,f={}),o(c,{type:"element",tagName:u,properties:f||{},children:d||[]})}function s(c,u){return _ce(a,c,u)}function l(c){return gz(a,c)}}function e7e(t,e){t.position&&(e.position=L9e(t))}function t7e(t,e){let n=e;if(t&&t.data){const r=t.data.hName,i=t.data.hChildren,o=t.data.hProperties;typeof r=="string"&&(n.type==="element"?n.tagName=r:n={type:"element",tagName:r,properties:{},children:[]}),n.type==="element"&&o&&(n.properties={...n.properties,...o}),"children"in n&&n.children&&i!==null&&i!==void 0&&(n.children=i)}return n}function _ce(t,e,n){const r=e&&e.type;if(!r)throw new Error("Expected node, got `"+e+"`");return oE.call(t.handlers,r)?t.handlers[r](t,e,n):t.passThrough&&t.passThrough.includes(r)?"children"in e?{...e,children:gz(t,e)}:e:t.unknownHandler?t.unknownHandler(t,e,n):n7e(t,e)}function gz(t,e){const n=[];if("children"in e){const r=e.children;let i=-1;for(;++i<r.length;){const o=_ce(t,r[i],e);if(o){if(i&&r[i-1].type==="break"&&(!Array.isArray(o)&&o.type==="text"&&(o.value=o.value.replace(/^\s+/,"")),!Array.isArray(o)&&o.type==="element")){const a=o.children[0];a&&a.type==="text"&&(a.value=a.value.replace(/^\s+/,""))}Array.isArray(o)?n.push(...o):n.push(o)}}}return n}function n7e(t,e){const n=e.data||{},r="value"in e&&!(oE.call(n,"hProperties")||oE.call(n,"hChildren"))?{type:"text",value:e.value}:{type:"element",tagName:"div",properties:{},children:gz(t,e)};return t.patch(e,r),t.applyData(e,r)}function r7e(t,e){const n=[];let r=-1;for(e&&n.push({type:"text",value:`
`});++r<t.length;)r&&n.push({type:"text",value:`
`}),n.push(t[r]);return e&&t.length>0&&n.push({type:"text",value:`
`}),n}function i7e(t){const e=[];let n=-1;for(;++n<t.footnoteOrder.length;){const r=t.footnoteById[t.footnoteOrder[n]];if(!r)continue;const i=t.all(r),o=String(r.identifier).toUpperCase(),a=Cy(o.toLowerCase());let s=0;const l=[];for(;++s<=t.footnoteCounts[o];){const f={type:"element",tagName:"a",properties:{href:"#"+t.clobberPrefix+"fnref-"+a+(s>1?"-"+s:""),dataFootnoteBackref:!0,className:["data-footnote-backref"],ariaLabel:t.footnoteBackLabel},children:[{type:"text",value:"↩"}]};s>1&&f.children.push({type:"element",tagName:"sup",children:[{type:"text",value:String(s)}]}),l.length>0&&l.push({type:"text",value:" "}),l.push(f)}const c=i[i.length-1];if(c&&c.type==="element"&&c.tagName==="p"){const f=c.children[c.children.length-1];f&&f.type==="text"?f.value+=" ":c.children.push({type:"text",value:" "}),c.children.push(...l)}else i.push(...l);const u={type:"element",tagName:"li",properties:{id:t.clobberPrefix+"fn-"+a},children:t.wrap(i,!0)};t.patch(r,u),e.push(u)}if(e.length!==0)return{type:"element",tagName:"section",properties:{dataFootnotes:!0,className:["footnotes"]},children:[{type:"element",tagName:t.footnoteLabelTagName,properties:{...JSON.parse(JSON.stringify(t.footnoteLabelProperties)),id:"footnote-label"},children:[{type:"text",value:t.footnoteLabel}]},{type:"text",value:`
`},{type:"element",tagName:"ol",properties:{},children:t.wrap(e,!0)},{type:"text",value:`
`}]}}function wce(t,e){const n=J9e(t,e),r=n.one(t,null),i=i7e(n);return i&&r.children.push({type:"text",value:`
`},i),Array.isArray(r)?{type:"root",children:r}:r}const o7e=function(t,e){return t&&"run"in t?a7e(t,e):s7e(t||e)};function a7e(t,e){return(n,r,i)=>{t.run(wce(n,e),r,o=>{i(o)})}}function s7e(t){return e=>wce(e,t)}class sw{constructor(e,n,r){this.property=e,this.normal=n,r&&(this.space=r)}}sw.prototype.property={};sw.prototype.normal={};sw.prototype.space=null;function Sce(t,e){const n={},r={};let i=-1;for(;++i<t.length;)Object.assign(n,t[i].property),Object.assign(r,t[i].normal);return new sw(n,r,e)}function F3(t){return t.toLowerCase()}let ws=class{constructor(e,n){this.property=e,this.attribute=n}};ws.prototype.space=null;ws.prototype.boolean=!1;ws.prototype.booleanish=!1;ws.prototype.overloadedBoolean=!1;ws.prototype.number=!1;ws.prototype.commaSeparated=!1;ws.prototype.spaceSeparated=!1;ws.prototype.commaOrSpaceSeparated=!1;ws.prototype.mustUseProperty=!1;ws.prototype.defined=!1;let l7e=0;const Lt=Np(),Lr=Np(),Oce=Np(),Ge=Np(),Bn=Np(),Pg=Np(),ra=Np();function Np(){return 2**++l7e}const j3=Object.freeze(Object.defineProperty({__proto__:null,boolean:Lt,booleanish:Lr,commaOrSpaceSeparated:ra,commaSeparated:Pg,number:Ge,overloadedBoolean:Oce,spaceSeparated:Bn},Symbol.toStringTag,{value:"Module"})),pR=Object.keys(j3);class vz extends ws{constructor(e,n,r,i){let o=-1;if(super(e,n),i9(this,"space",i),typeof r=="number")for(;++o<pR.length;){const a=pR[o];i9(this,pR[o],(r&j3[a])===j3[a])}}}vz.prototype.defined=!0;function i9(t,e,n){n&&(t[e]=n)}const c7e={}.hasOwnProperty;function Ty(t){const e={},n={};let r;for(r in t.properties)if(c7e.call(t.properties,r)){const i=t.properties[r],o=new vz(r,t.transform(t.attributes||{},r),i,t.space);t.mustUseProperty&&t.mustUseProperty.includes(r)&&(o.mustUseProperty=!0),e[r]=o,n[F3(r)]=r,n[F3(o.attribute)]=r}return new sw(e,n,t.space)}const Cce=Ty({space:"xlink",transform(t,e){return"xlink:"+e.slice(5).toLowerCase()},properties:{xLinkActuate:null,xLinkArcRole:null,xLinkHref:null,xLinkRole:null,xLinkShow:null,xLinkTitle:null,xLinkType:null}}),Tce=Ty({space:"xml",transform(t,e){return"xml:"+e.slice(3).toLowerCase()},properties:{xmlLang:null,xmlBase:null,xmlSpace:null}});function Ece(t,e){return e in t?t[e]:e}function Pce(t,e){return Ece(t,e.toLowerCase())}const Mce=Ty({space:"xmlns",attributes:{xmlnsxlink:"xmlns:xlink"},transform:Pce,properties:{xmlns:null,xmlnsXLink:null}}),kce=Ty({transform(t,e){return e==="role"?e:"aria-"+e.slice(4).toLowerCase()},properties:{ariaActiveDescendant:null,ariaAtomic:Lr,ariaAutoComplete:null,ariaBusy:Lr,ariaChecked:Lr,ariaColCount:Ge,ariaColIndex:Ge,ariaColSpan:Ge,ariaControls:Bn,ariaCurrent:null,ariaDescribedBy:Bn,ariaDetails:null,ariaDisabled:Lr,ariaDropEffect:Bn,ariaErrorMessage:null,ariaExpanded:Lr,ariaFlowTo:Bn,ariaGrabbed:Lr,ariaHasPopup:null,ariaHidden:Lr,ariaInvalid:null,ariaKeyShortcuts:null,ariaLabel:null,ariaLabelledBy:Bn,ariaLevel:Ge,ariaLive:null,ariaModal:Lr,ariaMultiLine:Lr,ariaMultiSelectable:Lr,ariaOrientation:null,ariaOwns:Bn,ariaPlaceholder:null,ariaPosInSet:Ge,ariaPressed:Lr,ariaReadOnly:Lr,ariaRelevant:null,ariaRequired:Lr,ariaRoleDescription:Bn,ariaRowCount:Ge,ariaRowIndex:Ge,ariaRowSpan:Ge,ariaSelected:Lr,ariaSetSize:Ge,ariaSort:null,ariaValueMax:Ge,ariaValueMin:Ge,ariaValueNow:Ge,ariaValueText:null,role:null}}),u7e=Ty({space:"html",attributes:{acceptcharset:"accept-charset",classname:"class",htmlfor:"for",httpequiv:"http-equiv"},transform:Pce,mustUseProperty:["checked","multiple","muted","selected"],properties:{abbr:null,accept:Pg,acceptCharset:Bn,accessKey:Bn,action:null,allow:null,allowFullScreen:Lt,allowPaymentRequest:Lt,allowUserMedia:Lt,alt:null,as:null,async:Lt,autoCapitalize:null,autoComplete:Bn,autoFocus:Lt,autoPlay:Lt,blocking:Bn,capture:null,charSet:null,checked:Lt,cite:null,className:Bn,cols:Ge,colSpan:null,content:null,contentEditable:Lr,controls:Lt,controlsList:Bn,coords:Ge|Pg,crossOrigin:null,data:null,dateTime:null,decoding:null,default:Lt,defer:Lt,dir:null,dirName:null,disabled:Lt,download:Oce,draggable:Lr,encType:null,enterKeyHint:null,fetchPriority:null,form:null,formAction:null,formEncType:null,formMethod:null,formNoValidate:Lt,formTarget:null,headers:Bn,height:Ge,hidden:Lt,high:Ge,href:null,hrefLang:null,htmlFor:Bn,httpEquiv:Bn,id:null,imageSizes:null,imageSrcSet:null,inert:Lt,inputMode:null,integrity:null,is:null,isMap:Lt,itemId:null,itemProp:Bn,itemRef:Bn,itemScope:Lt,itemType:Bn,kind:null,label:null,lang:null,language:null,list:null,loading:null,loop:Lt,low:Ge,manifest:null,max:null,maxLength:Ge,media:null,method:null,min:null,minLength:Ge,multiple:Lt,muted:Lt,name:null,nonce:null,noModule:Lt,noValidate:Lt,onAbort:null,onAfterPrint:null,onAuxClick:null,onBeforeMatch:null,onBeforePrint:null,onBeforeToggle:null,onBeforeUnload:null,onBlur:null,onCancel:null,onCanPlay:null,onCanPlayThrough:null,onChange:null,onClick:null,onClose:null,onContextLost:null,onContextMenu:null,onContextRestored:null,onCopy:null,onCueChange:null,onCut:null,onDblClick:null,onDrag:null,onDragEnd:null,onDragEnter:null,onDragExit:null,onDragLeave:null,onDragOver:null,onDragStart:null,onDrop:null,onDurationChange:null,onEmptied:null,onEnded:null,onError:null,onFocus:null,onFormData:null,onHashChange:null,onInput:null,onInvalid:null,onKeyDown:null,onKeyPress:null,onKeyUp:null,onLanguageChange:null,onLoad:null,onLoadedData:null,onLoadedMetadata:null,onLoadEnd:null,onLoadStart:null,onMessage:null,onMessageError:null,onMouseDown:null,onMouseEnter:null,onMouseLeave:null,onMouseMove:null,onMouseOut:null,onMouseOver:null,onMouseUp:null,onOffline:null,onOnline:null,onPageHide:null,onPageShow:null,onPaste:null,onPause:null,onPlay:null,onPlaying:null,onPopState:null,onProgress:null,onRateChange:null,onRejectionHandled:null,onReset:null,onResize:null,onScroll:null,onScrollEnd:null,onSecurityPolicyViolation:null,onSeeked:null,onSeeking:null,onSelect:null,onSlotChange:null,onStalled:null,onStorage:null,onSubmit:null,onSuspend:null,onTimeUpdate:null,onToggle:null,onUnhandledRejection:null,onUnload:null,onVolumeChange:null,onWaiting:null,onWheel:null,open:Lt,optimum:Ge,pattern:null,ping:Bn,placeholder:null,playsInline:Lt,popover:null,popoverTarget:null,popoverTargetAction:null,poster:null,preload:null,readOnly:Lt,referrerPolicy:null,rel:Bn,required:Lt,reversed:Lt,rows:Ge,rowSpan:Ge,sandbox:Bn,scope:null,scoped:Lt,seamless:Lt,selected:Lt,shadowRootClonable:Lt,shadowRootDelegatesFocus:Lt,shadowRootMode:null,shape:null,size:Ge,sizes:null,slot:null,span:Ge,spellCheck:Lr,src:null,srcDoc:null,srcLang:null,srcSet:null,start:Ge,step:null,style:null,tabIndex:Ge,target:null,title:null,translate:null,type:null,typeMustMatch:Lt,useMap:null,value:Lr,width:Ge,wrap:null,writingSuggestions:null,align:null,aLink:null,archive:Bn,axis:null,background:null,bgColor:null,border:Ge,borderColor:null,bottomMargin:Ge,cellPadding:null,cellSpacing:null,char:null,charOff:null,classId:null,clear:null,code:null,codeBase:null,codeType:null,color:null,compact:Lt,declare:Lt,event:null,face:null,frame:null,frameBorder:null,hSpace:Ge,leftMargin:Ge,link:null,longDesc:null,lowSrc:null,marginHeight:Ge,marginWidth:Ge,noResize:Lt,noHref:Lt,noShade:Lt,noWrap:Lt,object:null,profile:null,prompt:null,rev:null,rightMargin:Ge,rules:null,scheme:null,scrolling:Lr,standby:null,summary:null,text:null,topMargin:Ge,valueType:null,version:null,vAlign:null,vLink:null,vSpace:Ge,allowTransparency:null,autoCorrect:null,autoSave:null,disablePictureInPicture:Lt,disableRemotePlayback:Lt,prefix:null,property:null,results:Ge,security:null,unselectable:null}}),f7e=Ty({space:"svg",attributes:{accentHeight:"accent-height",alignmentBaseline:"alignment-baseline",arabicForm:"arabic-form",baselineShift:"baseline-shift",capHeight:"cap-height",className:"class",clipPath:"clip-path",clipRule:"clip-rule",colorInterpolation:"color-interpolation",colorInterpolationFilters:"color-interpolation-filters",colorProfile:"color-profile",colorRendering:"color-rendering",crossOrigin:"crossorigin",dataType:"datatype",dominantBaseline:"dominant-baseline",enableBackground:"enable-background",fillOpacity:"fill-opacity",fillRule:"fill-rule",floodColor:"flood-color",floodOpacity:"flood-opacity",fontFamily:"font-family",fontSize:"font-size",fontSizeAdjust:"font-size-adjust",fontStretch:"font-stretch",fontStyle:"font-style",fontVariant:"font-variant",fontWeight:"font-weight",glyphName:"glyph-name",glyphOrientationHorizontal:"glyph-orientation-horizontal",glyphOrientationVertical:"glyph-orientation-vertical",hrefLang:"hreflang",horizAdvX:"horiz-adv-x",horizOriginX:"horiz-origin-x",horizOriginY:"horiz-origin-y",imageRendering:"image-rendering",letterSpacing:"letter-spacing",lightingColor:"lighting-color",markerEnd:"marker-end",markerMid:"marker-mid",markerStart:"marker-start",navDown:"nav-down",navDownLeft:"nav-down-left",navDownRight:"nav-down-right",navLeft:"nav-left",navNext:"nav-next",navPrev:"nav-prev",navRight:"nav-right",navUp:"nav-up",navUpLeft:"nav-up-left",navUpRight:"nav-up-right",onAbort:"onabort",onActivate:"onactivate",onAfterPrint:"onafterprint",onBeforePrint:"onbeforeprint",onBegin:"onbegin",onCancel:"oncancel",onCanPlay:"oncanplay",onCanPlayThrough:"oncanplaythrough",onChange:"onchange",onClick:"onclick",onClose:"onclose",onCopy:"oncopy",onCueChange:"oncuechange",onCut:"oncut",onDblClick:"ondblclick",onDrag:"ondrag",onDragEnd:"ondragend",onDragEnter:"ondragenter",onDragExit:"ondragexit",onDragLeave:"ondragleave",onDragOver:"ondragover",onDragStart:"ondragstart",onDrop:"ondrop",onDurationChange:"ondurationchange",onEmptied:"onemptied",onEnd:"onend",onEnded:"onended",onError:"onerror",onFocus:"onfocus",onFocusIn:"onfocusin",onFocusOut:"onfocusout",onHashChange:"onhashchange",onInput:"oninput",onInvalid:"oninvalid",onKeyDown:"onkeydown",onKeyPress:"onkeypress",onKeyUp:"onkeyup",onLoad:"onload",onLoadedData:"onloadeddata",onLoadedMetadata:"onloadedmetadata",onLoadStart:"onloadstart",onMessage:"onmessage",onMouseDown:"onmousedown",onMouseEnter:"onmouseenter",onMouseLeave:"onmouseleave",onMouseMove:"onmousemove",onMouseOut:"onmouseout",onMouseOver:"onmouseover",onMouseUp:"onmouseup",onMouseWheel:"onmousewheel",onOffline:"onoffline",onOnline:"ononline",onPageHide:"onpagehide",onPageShow:"onpageshow",onPaste:"onpaste",onPause:"onpause",onPlay:"onplay",onPlaying:"onplaying",onPopState:"onpopstate",onProgress:"onprogress",onRateChange:"onratechange",onRepeat:"onrepeat",onReset:"onreset",onResize:"onresize",onScroll:"onscroll",onSeeked:"onseeked",onSeeking:"onseeking",onSelect:"onselect",onShow:"onshow",onStalled:"onstalled",onStorage:"onstorage",onSubmit:"onsubmit",onSuspend:"onsuspend",onTimeUpdate:"ontimeupdate",onToggle:"ontoggle",onUnload:"onunload",onVolumeChange:"onvolumechange",onWaiting:"onwaiting",onZoom:"onzoom",overlinePosition:"overline-position",overlineThickness:"overline-thickness",paintOrder:"paint-order",panose1:"panose-1",pointerEvents:"pointer-events",referrerPolicy:"referrerpolicy",renderingIntent:"rendering-intent",shapeRendering:"shape-rendering",stopColor:"stop-color",stopOpacity:"stop-opacity",strikethroughPosition:"strikethrough-position",strikethroughThickness:"strikethrough-thickness",strokeDashArray:"stroke-dasharray",strokeDashOffset:"stroke-dashoffset",strokeLineCap:"stroke-linecap",strokeLineJoin:"stroke-linejoin",strokeMiterLimit:"stroke-miterlimit",strokeOpacity:"stroke-opacity",strokeWidth:"stroke-width",tabIndex:"tabindex",textAnchor:"text-anchor",textDecoration:"text-decoration",textRendering:"text-rendering",transformOrigin:"transform-origin",typeOf:"typeof",underlinePosition:"underline-position",underlineThickness:"underline-thickness",unicodeBidi:"unicode-bidi",unicodeRange:"unicode-range",unitsPerEm:"units-per-em",vAlphabetic:"v-alphabetic",vHanging:"v-hanging",vIdeographic:"v-ideographic",vMathematical:"v-mathematical",vectorEffect:"vector-effect",vertAdvY:"vert-adv-y",vertOriginX:"vert-origin-x",vertOriginY:"vert-origin-y",wordSpacing:"word-spacing",writingMode:"writing-mode",xHeight:"x-height",playbackOrder:"playbackorder",timelineBegin:"timelinebegin"},transform:Ece,properties:{about:ra,accentHeight:Ge,accumulate:null,additive:null,alignmentBaseline:null,alphabetic:Ge,amplitude:Ge,arabicForm:null,ascent:Ge,attributeName:null,attributeType:null,azimuth:Ge,bandwidth:null,baselineShift:null,baseFrequency:null,baseProfile:null,bbox:null,begin:null,bias:Ge,by:null,calcMode:null,capHeight:Ge,className:Bn,clip:null,clipPath:null,clipPathUnits:null,clipRule:null,color:null,colorInterpolation:null,colorInterpolationFilters:null,colorProfile:null,colorRendering:null,content:null,contentScriptType:null,contentStyleType:null,crossOrigin:null,cursor:null,cx:null,cy:null,d:null,dataType:null,defaultAction:null,descent:Ge,diffuseConstant:Ge,direction:null,display:null,dur:null,divisor:Ge,dominantBaseline:null,download:Lt,dx:null,dy:null,edgeMode:null,editable:null,elevation:Ge,enableBackground:null,end:null,event:null,exponent:Ge,externalResourcesRequired:null,fill:null,fillOpacity:Ge,fillRule:null,filter:null,filterRes:null,filterUnits:null,floodColor:null,floodOpacity:null,focusable:null,focusHighlight:null,fontFamily:null,fontSize:null,fontSizeAdjust:null,fontStretch:null,fontStyle:null,fontVariant:null,fontWeight:null,format:null,fr:null,from:null,fx:null,fy:null,g1:Pg,g2:Pg,glyphName:Pg,glyphOrientationHorizontal:null,glyphOrientationVertical:null,glyphRef:null,gradientTransform:null,gradientUnits:null,handler:null,hanging:Ge,hatchContentUnits:null,hatchUnits:null,height:null,href:null,hrefLang:null,horizAdvX:Ge,horizOriginX:Ge,horizOriginY:Ge,id:null,ideographic:Ge,imageRendering:null,initialVisibility:null,in:null,in2:null,intercept:Ge,k:Ge,k1:Ge,k2:Ge,k3:Ge,k4:Ge,kernelMatrix:ra,kernelUnitLength:null,keyPoints:null,keySplines:null,keyTimes:null,kerning:null,lang:null,lengthAdjust:null,letterSpacing:null,lightingColor:null,limitingConeAngle:Ge,local:null,markerEnd:null,markerMid:null,markerStart:null,markerHeight:null,markerUnits:null,markerWidth:null,mask:null,maskContentUnits:null,maskUnits:null,mathematical:null,max:null,media:null,mediaCharacterEncoding:null,mediaContentEncodings:null,mediaSize:Ge,mediaTime:null,method:null,min:null,mode:null,name:null,navDown:null,navDownLeft:null,navDownRight:null,navLeft:null,navNext:null,navPrev:null,navRight:null,navUp:null,navUpLeft:null,navUpRight:null,numOctaves:null,observer:null,offset:null,onAbort:null,onActivate:null,onAfterPrint:null,onBeforePrint:null,onBegin:null,onCancel:null,onCanPlay:null,onCanPlayThrough:null,onChange:null,onClick:null,onClose:null,onCopy:null,onCueChange:null,onCut:null,onDblClick:null,onDrag:null,onDragEnd:null,onDragEnter:null,onDragExit:null,onDragLeave:null,onDragOver:null,onDragStart:null,onDrop:null,onDurationChange:null,onEmptied:null,onEnd:null,onEnded:null,onError:null,onFocus:null,onFocusIn:null,onFocusOut:null,onHashChange:null,onInput:null,onInvalid:null,onKeyDown:null,onKeyPress:null,onKeyUp:null,onLoad:null,onLoadedData:null,onLoadedMetadata:null,onLoadStart:null,onMessage:null,onMouseDown:null,onMouseEnter:null,onMouseLeave:null,onMouseMove:null,onMouseOut:null,onMouseOver:null,onMouseUp:null,onMouseWheel:null,onOffline:null,onOnline:null,onPageHide:null,onPageShow:null,onPaste:null,onPause:null,onPlay:null,onPlaying:null,onPopState:null,onProgress:null,onRateChange:null,onRepeat:null,onReset:null,onResize:null,onScroll:null,onSeeked:null,onSeeking:null,onSelect:null,onShow:null,onStalled:null,onStorage:null,onSubmit:null,onSuspend:null,onTimeUpdate:null,onToggle:null,onUnload:null,onVolumeChange:null,onWaiting:null,onZoom:null,opacity:null,operator:null,order:null,orient:null,orientation:null,origin:null,overflow:null,overlay:null,overlinePosition:Ge,overlineThickness:Ge,paintOrder:null,panose1:null,path:null,pathLength:Ge,patternContentUnits:null,patternTransform:null,patternUnits:null,phase:null,ping:Bn,pitch:null,playbackOrder:null,pointerEvents:null,points:null,pointsAtX:Ge,pointsAtY:Ge,pointsAtZ:Ge,preserveAlpha:null,preserveAspectRatio:null,primitiveUnits:null,propagate:null,property:ra,r:null,radius:null,referrerPolicy:null,refX:null,refY:null,rel:ra,rev:ra,renderingIntent:null,repeatCount:null,repeatDur:null,requiredExtensions:ra,requiredFeatures:ra,requiredFonts:ra,requiredFormats:ra,resource:null,restart:null,result:null,rotate:null,rx:null,ry:null,scale:null,seed:null,shapeRendering:null,side:null,slope:null,snapshotTime:null,specularConstant:Ge,specularExponent:Ge,spreadMethod:null,spacing:null,startOffset:null,stdDeviation:null,stemh:null,stemv:null,stitchTiles:null,stopColor:null,stopOpacity:null,strikethroughPosition:Ge,strikethroughThickness:Ge,string:null,stroke:null,strokeDashArray:ra,strokeDashOffset:null,strokeLineCap:null,strokeLineJoin:null,strokeMiterLimit:Ge,strokeOpacity:Ge,strokeWidth:null,style:null,surfaceScale:Ge,syncBehavior:null,syncBehaviorDefault:null,syncMaster:null,syncTolerance:null,syncToleranceDefault:null,systemLanguage:ra,tabIndex:Ge,tableValues:null,target:null,targetX:Ge,targetY:Ge,textAnchor:null,textDecoration:null,textRendering:null,textLength:null,timelineBegin:null,title:null,transformBehavior:null,type:null,typeOf:ra,to:null,transform:null,transformOrigin:null,u1:null,u2:null,underlinePosition:Ge,underlineThickness:Ge,unicode:null,unicodeBidi:null,unicodeRange:null,unitsPerEm:Ge,values:null,vAlphabetic:Ge,vMathematical:Ge,vectorEffect:null,vHanging:Ge,vIdeographic:Ge,version:null,vertAdvY:Ge,vertOriginX:Ge,vertOriginY:Ge,viewBox:null,viewTarget:null,visibility:null,width:null,widths:null,wordSpacing:null,writingMode:null,x:null,x1:null,x2:null,xChannelSelector:null,xHeight:Ge,y:null,y1:null,y2:null,yChannelSelector:null,z:null,zoomAndPan:null}}),d7e=/^data[-\w.:]+$/i,o9=/-[a-z]/g,h7e=/[A-Z]/g;function p7e(t,e){const n=F3(e);let r=e,i=ws;if(n in t.normal)return t.property[t.normal[n]];if(n.length>4&&n.slice(0,4)==="data"&&d7e.test(e)){if(e.charAt(4)==="-"){const o=e.slice(5).replace(o9,g7e);r="data"+o.charAt(0).toUpperCase()+o.slice(1)}else{const o=e.slice(4);if(!o9.test(o)){let a=o.replace(h7e,m7e);a.charAt(0)!=="-"&&(a="-"+a),e="data"+a}}i=vz}return new i(r,e)}function m7e(t){return"-"+t.toLowerCase()}function g7e(t){return t.charAt(1).toUpperCase()}const a9={classId:"classID",dataType:"datatype",itemId:"itemID",strokeDashArray:"strokeDasharray",strokeDashOffset:"strokeDashoffset",strokeLineCap:"strokeLinecap",strokeLineJoin:"strokeLinejoin",strokeMiterLimit:"strokeMiterlimit",typeOf:"typeof",xLinkActuate:"xlinkActuate",xLinkArcRole:"xlinkArcrole",xLinkHref:"xlinkHref",xLinkRole:"xlinkRole",xLinkShow:"xlinkShow",xLinkTitle:"xlinkTitle",xLinkType:"xlinkType",xmlnsXLink:"xmlnsXlink"},v7e=Sce([Tce,Cce,Mce,kce,u7e],"html"),y7e=Sce([Tce,Cce,Mce,kce,f7e],"svg");function x7e(t){if(t.allowedElements&&t.disallowedElements)throw new TypeError("Only one of `allowedElements` and `disallowedElements` should be defined");if(t.allowedElements||t.disallowedElements||t.allowElement)return e=>{mz(e,"element",(n,r,i)=>{const o=i;let a;if(t.allowedElements?a=!t.allowedElements.includes(n.tagName):t.disallowedElements&&(a=t.disallowedElements.includes(n.tagName)),!a&&t.allowElement&&typeof r=="number"&&(a=!t.allowElement(n,r,o)),a&&typeof r=="number")return t.unwrapDisallowed&&n.children?o.children.splice(r,1,...n.children):o.children.splice(r,1),r})}}var Ace={exports:{}},An={};/**
 * @license React
 * react-is.production.min.js
 *
 * Copyright (c) Facebook, Inc. and its affiliates.
 *
 * This source code is licensed under the MIT license found in the
 * LICENSE file in the root directory of this source tree.
 */var yz=Symbol.for("react.element"),xz=Symbol.for("react.portal"),L2=Symbol.for("react.fragment"),N2=Symbol.for("react.strict_mode"),$2=Symbol.for("react.profiler"),F2=Symbol.for("react.provider"),j2=Symbol.for("react.context"),b7e=Symbol.for("react.server_context"),B2=Symbol.for("react.forward_ref"),z2=Symbol.for("react.suspense"),U2=Symbol.for("react.suspense_list"),W2=Symbol.for("react.memo"),V2=Symbol.for("react.lazy"),_7e=Symbol.for("react.offscreen"),Rce;Rce=Symbol.for("react.module.reference");function Ss(t){if(typeof t=="object"&&t!==null){var e=t.$$typeof;switch(e){case yz:switch(t=t.type,t){case L2:case $2:case N2:case z2:case U2:return t;default:switch(t=t&&t.$$typeof,t){case b7e:case j2:case B2:case V2:case W2:case F2:return t;default:return e}}case xz:return e}}}An.ContextConsumer=j2;An.ContextProvider=F2;An.Element=yz;An.ForwardRef=B2;An.Fragment=L2;An.Lazy=V2;An.Memo=W2;An.Portal=xz;An.Profiler=$2;An.StrictMode=N2;An.Suspense=z2;An.SuspenseList=U2;An.isAsyncMode=function(){return!1};An.isConcurrentMode=function(){return!1};An.isContextConsumer=function(t){return Ss(t)===j2};An.isContextProvider=function(t){return Ss(t)===F2};An.isElement=function(t){return typeof t=="object"&&t!==null&&t.$$typeof===yz};An.isForwardRef=function(t){return Ss(t)===B2};An.isFragment=function(t){return Ss(t)===L2};An.isLazy=function(t){return Ss(t)===V2};An.isMemo=function(t){return Ss(t)===W2};An.isPortal=function(t){return Ss(t)===xz};An.isProfiler=function(t){return Ss(t)===$2};An.isStrictMode=function(t){return Ss(t)===N2};An.isSuspense=function(t){return Ss(t)===z2};An.isSuspenseList=function(t){return Ss(t)===U2};An.isValidElementType=function(t){return typeof t=="string"||typeof t=="function"||t===L2||t===$2||t===N2||t===z2||t===U2||t===_7e||typeof t=="object"&&t!==null&&(t.$$typeof===V2||t.$$typeof===W2||t.$$typeof===F2||t.$$typeof===j2||t.$$typeof===B2||t.$$typeof===Rce||t.getModuleId!==void 0)};An.typeOf=Ss;Ace.exports=An;var w7e=Ace.exports;const S7e=$t(w7e);function O7e(t){const e=t&&typeof t=="object"&&t.type==="text"?t.value||"":t;return typeof e=="string"&&e.replace(/[ \t\n\f\r]/g,"")===""}function C7e(t){return t.join(" ").trim()}function T7e(t,e){const n={};return(t[t.length-1]===""?[...t,""]:t).join((n.padRight?" ":"")+","+(n.padLeft===!1?"":" ")).trim()}var bz={exports:{}},s9=/\/\*[^*]*\*+([^/*][^*]*\*+)*\//g,E7e=/\n/g,P7e=/^\s*/,M7e=/^(\*?[-#/*\\\w]+(\[[0-9a-z_-]+\])?)\s*/,k7e=/^:\s*/,A7e=/^((?:'(?:\\'|.)*?'|"(?:\\"|.)*?"|\([^)]*?\)|[^};])+)/,R7e=/^[;\s]*/,I7e=/^\s+|\s+$/g,D7e=`
`,l9="/",c9="*",lh="",L7e="comment",N7e="declaration",$7e=function(t,e){if(typeof t!="string")throw new TypeError("First argument must be a string");if(!t)return[];e=e||{};var n=1,r=1;function i(p){var m=p.match(E7e);m&&(n+=m.length);var g=p.lastIndexOf(D7e);r=~g?p.length-g:r+p.length}function o(){var p={line:n,column:r};return function(m){return m.position=new a(p),c(),m}}function a(p){this.start=p,this.end={line:n,column:r},this.source=e.source}a.prototype.content=t;function s(p){var m=new Error(e.source+":"+n+":"+r+": "+p);if(m.reason=p,m.filename=e.source,m.line=n,m.column=r,m.source=t,!e.silent)throw m}function l(p){var m=p.exec(t);if(m){var g=m[0];return i(g),t=t.slice(g.length),m}}function c(){l(P7e)}function u(p){var m;for(p=p||[];m=f();)m!==!1&&p.push(m);return p}function f(){var p=o();if(!(l9!=t.charAt(0)||c9!=t.charAt(1))){for(var m=2;lh!=t.charAt(m)&&(c9!=t.charAt(m)||l9!=t.charAt(m+1));)++m;if(m+=2,lh===t.charAt(m-1))return s("End of comment missing");var g=t.slice(2,m-2);return r+=2,i(g),t=t.slice(m),r+=2,p({type:L7e,comment:g})}}function d(){var p=o(),m=l(M7e);if(m){if(f(),!l(k7e))return s("property missing ':'");var g=l(A7e),v=p({type:N7e,property:u9(m[0].replace(s9,lh)),value:g?u9(g[0].replace(s9,lh)):lh});return l(R7e),v}}function h(){var p=[];u(p);for(var m;m=d();)m!==!1&&(p.push(m),u(p));return p}return c(),h()};function u9(t){return t?t.replace(I7e,lh):lh}var F7e=$7e;function Ice(t,e){var n=null;if(!t||typeof t!="string")return n;for(var r,i=F7e(t),o=typeof e=="function",a,s,l=0,c=i.length;l<c;l++)r=i[l],a=r.property,s=r.value,o?e(a,s,r):s&&(n||(n={}),n[a]=s);return n}bz.exports=Ice;bz.exports.default=Ice;var j7e=bz.exports;const B7e=$t(j7e),B3={}.hasOwnProperty,z7e=new Set(["table","thead","tbody","tfoot","tr"]);function Dce(t,e){const n=[];let r=-1,i;for(;++r<e.children.length;)i=e.children[r],i.type==="element"?n.push(U7e(t,i,r,e)):i.type==="text"?(e.type!=="element"||!z7e.has(e.tagName)||!O7e(i))&&n.push(i.value):i.type==="raw"&&!t.options.skipHtml&&n.push(i.value);return n}function U7e(t,e,n,r){const i=t.options,o=i.transformLinkUri===void 0?V8e:i.transformLinkUri,a=t.schema,s=e.tagName,l={};let c=a,u;if(a.space==="html"&&s==="svg"&&(c=y7e,t.schema=c),e.properties)for(u in e.properties)B3.call(e.properties,u)&&V7e(l,u,e.properties[u],t);(s==="ol"||s==="ul")&&t.listDepth++;const f=Dce(t,e);(s==="ol"||s==="ul")&&t.listDepth--,t.schema=a;const d=e.position||{start:{line:null,column:null,offset:null},end:{line:null,column:null,offset:null}},h=i.components&&B3.call(i.components,s)?i.components[s]:s,p=typeof h=="string"||h===ue.Fragment;if(!S7e.isValidElementType(h))throw new TypeError(`Component for name \`${s}\` not defined or is not renderable`);if(l.key=n,s==="a"&&i.linkTarget&&(l.target=typeof i.linkTarget=="function"?i.linkTarget(String(l.href||""),e.children,typeof l.title=="string"?l.title:null):i.linkTarget),s==="a"&&o&&(l.href=o(String(l.href||""),e.children,typeof l.title=="string"?l.title:null)),!p&&s==="code"&&r.type==="element"&&r.tagName!=="pre"&&(l.inline=!0),!p&&(s==="h1"||s==="h2"||s==="h3"||s==="h4"||s==="h5"||s==="h6")&&(l.level=Number.parseInt(s.charAt(1),10)),s==="img"&&i.transformImageUri&&(l.src=i.transformImageUri(String(l.src||""),String(l.alt||""),typeof l.title=="string"?l.title:null)),!p&&s==="li"&&r.type==="element"){const m=W7e(e);l.checked=m&&m.properties?!!m.properties.checked:null,l.index=mR(r,e),l.ordered=r.tagName==="ol"}return!p&&(s==="ol"||s==="ul")&&(l.ordered=s==="ol",l.depth=t.listDepth),(s==="td"||s==="th")&&(l.align&&(l.style||(l.style={}),l.style.textAlign=l.align,delete l.align),p||(l.isHeader=s==="th")),!p&&s==="tr"&&r.type==="element"&&(l.isHeader=r.tagName==="thead"),i.sourcePos&&(l["data-sourcepos"]=q7e(d)),!p&&i.rawSourcePos&&(l.sourcePosition=e.position),!p&&i.includeElementIndex&&(l.index=mR(r,e),l.siblingCount=mR(r)),p||(l.node=e),f.length>0?ue.createElement(h,l,f):ue.createElement(h,l)}function W7e(t){let e=-1;for(;++e<t.children.length;){const n=t.children[e];if(n.type==="element"&&n.tagName==="input")return n}return null}function mR(t,e){let n=-1,r=0;for(;++n<t.children.length&&t.children[n]!==e;)t.children[n].type==="element"&&r++;return r}function V7e(t,e,n,r){const i=p7e(r.schema,e);let o=n;o==null||o!==o||(Array.isArray(o)&&(o=i.commaSeparated?T7e(o):C7e(o)),i.property==="style"&&typeof o=="string"&&(o=G7e(o)),i.space&&i.property?t[B3.call(a9,i.property)?a9[i.property]:i.property]=o:i.attribute&&(t[i.attribute]=o))}function G7e(t){const e={};try{B7e(t,n)}catch{}return e;function n(r,i){const o=r.slice(0,4)==="-ms-"?`ms-${r.slice(4)}`:r;e[o.replace(/-([a-z])/g,H7e)]=i}}function H7e(t,e){return e.toUpperCase()}function q7e(t){return[t.start.line,":",t.start.column,"-",t.end.line,":",t.end.column].map(String).join("")}const f9={}.hasOwnProperty,X7e="https://github.com/remarkjs/react-markdown/blob/main/changelog.md",$S={plugins:{to:"remarkPlugins",id:"change-plugins-to-remarkplugins"},renderers:{to:"components",id:"change-renderers-to-components"},astPlugins:{id:"remove-buggy-html-in-markdown-parser"},allowDangerousHtml:{id:"remove-buggy-html-in-markdown-parser"},escapeHtml:{id:"remove-buggy-html-in-markdown-parser"},source:{to:"children",id:"change-source-to-children"},allowNode:{to:"allowElement",id:"replace-allownode-allowedtypes-and-disallowedtypes"},allowedTypes:{to:"allowedElements",id:"replace-allownode-allowedtypes-and-disallowedtypes"},disallowedTypes:{to:"disallowedElements",id:"replace-allownode-allowedtypes-and-disallowedtypes"},includeNodeIndex:{to:"includeElementIndex",id:"change-includenodeindex-to-includeelementindex"}};function G2(t){for(const o in $S)if(f9.call($S,o)&&f9.call(t,o)){const a=$S[o];console.warn(`[react-markdown] Warning: please ${a.to?`use \`${a.to}\` instead of`:"remove"} \`${o}\` (see <${X7e}#${a.id}> for more info)`),delete $S[o]}const e=aGe().use(m9e).use(t.remarkPlugins||[]).use(o7e,{...t.remarkRehypeOptions,allowDangerousHtml:!0}).use(t.rehypePlugins||[]).use(x7e,t),n=new Jle;typeof t.children=="string"?n.value=t.children:t.children!==void 0&&t.children!==null&&console.warn(`[react-markdown] Warning: please pass a string as \`children\` (not: \`${t.children}\`)`);const r=e.runSync(e.parse(n),n);if(r.type!=="root")throw new TypeError("Expected a `root` node");let i=ue.createElement(ue.Fragment,{},Dce({options:t,schema:v7e,listDepth:0},r));return t.className&&(i=ue.createElement("div",{className:t.className},i)),i}G2.propTypes={children:Qe.string,className:Qe.string,allowElement:Qe.func,allowedElements:Qe.arrayOf(Qe.string),disallowedElements:Qe.arrayOf(Qe.string),unwrapDisallowed:Qe.bool,remarkPlugins:Qe.arrayOf(Qe.oneOfType([Qe.object,Qe.func,Qe.arrayOf(Qe.oneOfType([Qe.bool,Qe.string,Qe.object,Qe.func,Qe.arrayOf(Qe.any)]))])),rehypePlugins:Qe.arrayOf(Qe.oneOfType([Qe.object,Qe.func,Qe.arrayOf(Qe.oneOfType([Qe.bool,Qe.string,Qe.object,Qe.func,Qe.arrayOf(Qe.any)]))])),sourcePos:Qe.bool,rawSourcePos:Qe.bool,skipHtml:Qe.bool,includeElementIndex:Qe.bool,transformLinkUri:Qe.oneOfType([Qe.func,Qe.bool]),linkTarget:Qe.oneOfType([Qe.func,Qe.string]),transformImageUri:Qe.func,components:Qe.object};var _z={},Q7e=ft;Object.defineProperty(_z,"__esModule",{value:!0});var $p=_z.default=void 0,Y7e=Q7e(pt()),K7e=w;$p=_z.default=(0,Y7e.default)((0,K7e.jsx)("path",{d:"M19 6.41 17.59 5 12 10.59 6.41 5 5 6.41 10.59 12 5 17.59 6.41 19 12 13.41 17.59 19 19 17.59 13.41 12z"}),"Close");function Lce(t){const[e,n]=M.useState();return M.useEffect(()=>{t?fetch(t).then(r=>r.text()).then(r=>n(r)).catch(r=>{console.error(r)}):n(void 0)},[t]),e}const gR={dialog:t=>({backgroundColor:t.palette.grey[200]}),appBar:{position:"relative"},title:t=>({marginLeft:t.spacing(2),flex:1})},Z7e=Li("div")(({theme:t})=>({marginTop:t.spacing(4),marginLeft:t.spacing(40),marginRight:t.spacing(40)})),J7e=ue.forwardRef(function(e,n){return w.jsx(V2e,{direction:"up",ref:n,...e})}),eqe=({title:t,href:e,open:n,onClose:r})=>{const i=Lce(e);return w.jsxs(rl,{fullScreen:!0,open:n,onClose:r,TransitionComponent:J7e,PaperProps:{tabIndex:-1},children:[w.jsx(_re,{sx:gR.appBar,children:w.jsxs(n2,{children:[w.jsx(Ot,{edge:"start",color:"inherit",onClick:r,"aria-label":"close",size:"large",children:w.jsx($p,{})}),w.jsx(At,{variant:"h6",sx:gR.title,children:t})]})}),w.jsx(Ys,{sx:gR.dialog,children:w.jsx(Z7e,{children:w.jsx(G2,{children:i||"",linkTarget:"_blank"})})})]})};var wz={},tqe=ft;Object.defineProperty(wz,"__esModule",{value:!0});var z3=wz.default=void 0,nqe=tqe(pt()),rqe=w;z3=wz.default=(0,nqe.default)((0,rqe.jsx)("path",{d:"M12 12c2.21 0 4-1.79 4-4s-1.79-4-4-4-4 1.79-4 4 1.79 4 4 4m0 2c-2.67 0-8 1.34-8 4v2h16v-2c0-2.66-5.33-4-8-4"}),"Person");const iqe=({userInfo:t})=>w.jsxs(MC,{container:!0,justifyContent:"center",spacing:1,children:[w.jsx(MC,{item:!0,children:w.jsx("img",{src:t.picture,width:84,alt:fe.get("User Profile")})}),w.jsx(MC,{item:!0,children:w.jsx(Ho,{elevation:3,children:w.jsxs(e2,{children:[w.jsx(Wx,{children:w.jsx(ts,{primary:t.name,secondary:fe.get("User name")})}),w.jsx(ep,{light:!0}),w.jsx(Wx,{children:w.jsx(ts,{primary:`${t.email} (${t.email_verified?fe.get("verified"):fe.get("not verified")})`,secondary:fe.get("E-mail")})}),w.jsx(ep,{light:!0}),w.jsx(Wx,{children:w.jsx(ts,{primary:t.nickname,secondary:fe.get("Nickname")})})]})})})]}),E0={imageAvatar:{width:32,height:32,color:"#fff",backgroundColor:Dh[300]},letterAvatar:{width:32,height:32,color:"#fff",backgroundColor:Dh[300]},signInProgress:{color:Dh[300],position:"absolute",top:"50%",left:"50%",zIndex:1,marginTop:-12,marginLeft:-12},iconButton:{padding:0}},oqe=Li("div")(({theme:t})=>({margin:t.spacing(1),position:"relative"})),aqe=({updateAccessToken:t})=>{const e=i3e(),[n,r]=M.useState(null),[i,o]=M.useState(!1);M.useEffect(()=>{e.user&&e.user.access_token?t(e.user.access_token):t(null)},[e.user,t]);const a=()=>{c(),o(!0)},s=()=>{o(!1)},l=d=>{r(d.currentTarget)},c=()=>{r(null)},u=()=>{e.signinRedirect().then(()=>{}).catch(d=>{console.error(d)})},f=()=>{c(),e.signoutRedirect().then(()=>{}).catch(d=>{console.error(d)})};if(e.user){const d=e.user.profile;let h,p=w.jsx(z3,{});if(!d)h=w.jsx(EA,{sx:E0.letterAvatar,children:"?"});else if(d.picture)h=w.jsx(EA,{sx:E0.imageAvatar,src:d.picture,alt:d.name});else{const m=d.given_name||d.name||d.nickname,g=d.family_name;let v=null;m&&g?v=m[0]+g[0]:m?v=m[0]:g&&(v=g[0]),v!==null&&(p=v.toUpperCase()),h=w.jsx(EA,{sx:E0.letterAvatar,children:p})}return w.jsxs(M.Fragment,{children:[w.jsx(Ot,{onClick:l,"aria-controls":"user-menu","aria-haspopup":"true",size:"small",sx:E0.iconButton,children:h}),w.jsxs(Pp,{id:"user-menu",anchorEl:n,keepMounted:!0,open:!!n,onClose:c,children:[w.jsx(jr,{onClick:a,children:fe.get("Profile")}),w.jsx(jr,{onClick:f,children:fe.get("Log out")})]}),w.jsxs(rl,{open:i,keepMounted:!0,onClose:s,"aria-labelledby":"alert-dialog-slide-title","aria-describedby":"alert-dialog-slide-description",children:[w.jsx(vd,{id:"alert-dialog-slide-title",children:fe.get("User Profile")}),w.jsx(Ys,{children:w.jsx(iqe,{userInfo:e.user.profile})}),w.jsx(Tp,{children:w.jsx(tr,{onClick:s,children:"OK"})})]})]})}else{let d=w.jsx(Ot,{onClick:e.isLoading?void 0:u,size:"small",children:w.jsx(z3,{})});return e.isLoading&&(d=w.jsxs(oqe,{children:[d,w.jsx(ey,{size:24,sx:E0.signInProgress})]})),d}},sqe=t=>Kt.instance.authClient?w.jsx(aqe,{...t}):null,lqe=sqe,Nce="UPDATE_ACCESS_TOKEN";function cqe(t){return(e,n)=>{const r=n().userAuthState.accessToken;r!==t&&(e(uqe(t)),(t===null||r===null)&&e(Use()))}}function uqe(t){return{type:Nce,accessToken:t}}const fqe=t=>({}),dqe={updateAccessToken:cqe},hqe=Jt(fqe,dqe)(lqe),pqe=t=>({locale:t.controlState.locale,appName:Kt.instance.branding.appBarTitle,allowRefresh:Kt.instance.branding.allowRefresh}),mqe={openDialog:Lp,updateResources:zse},gqe={appBar:t=>({zIndex:t.zIndex.drawer+1,transition:t.transitions.create(["width","margin"],{easing:t.transitions.easing.sharp,duration:t.transitions.duration.leavingScreen})})},vqe=we("a")(()=>({display:"flex",alignItems:"center"})),yqe=we("img")(({theme:t})=>({marginLeft:t.spacing(1)})),zd={toolbar:t=>({backgroundColor:Kt.instance.branding.headerBackgroundColor,paddingRight:t.spacing(1)}),logo:t=>({marginLeft:t.spacing(1)}),title:t=>({flexGrow:1,marginLeft:t.spacing(1),...Kt.instance.branding.headerTitleStyle}),imageAvatar:{width:24,height:24,color:"#fff",backgroundColor:Dh[300]},letterAvatar:{width:24,height:24,color:"#fff",backgroundColor:Dh[300]},signInWrapper:t=>({margin:t.spacing(1),position:"relative"}),signInProgress:{color:Dh[300],position:"absolute",top:"50%",left:"50%",zIndex:1,marginTop:"-12px",marginLeft:"-12px"},iconButton:t=>({marginLeft:t.spacing(2),...Kt.instance.branding.headerIconStyle})},xqe=({appName:t,openDialog:e,allowRefresh:n,updateResources:r})=>{const[i,o]=M.useState(!1),a=()=>{e("settings")},s=()=>{window.open("https://xcube.readthedocs.io/en/latest/viewer.html","Manual")},l=()=>{o(!0)},c=()=>{o(!1)};return w.jsxs(_re,{position:"absolute",sx:gqe.appBar,elevation:0,children:[w.jsxs(n2,{disableGutters:!0,sx:zd.toolbar,variant:"dense",children:[w.jsx(vqe,{href:Kt.instance.branding.organisationUrl||"",target:"_blank",rel:"noreferrer",children:w.jsx(yqe,{src:Kt.instance.branding.logoImage,width:Kt.instance.branding.logoWidth,alt:"xcube logo"})}),w.jsx(At,{component:"h1",variant:"h6",color:"inherit",noWrap:!0,sx:zd.title,children:t}),w.jsx(hqe,{}),n&&w.jsx(_t,{arrow:!0,title:fe.get("Refresh"),children:w.jsx(Ot,{onClick:r,size:"small",sx:zd.iconButton,children:w.jsx(W5,{})})}),Kt.instance.branding.allowDownloads&&w.jsx(_t,{arrow:!0,title:fe.get("Export data"),children:w.jsx(Ot,{onClick:()=>e("export"),size:"small",sx:zd.iconButton,children:w.jsx(H5,{})})}),w.jsx(_t,{arrow:!0,title:fe.get("Help"),children:w.jsx(Ot,{onClick:s,size:"small",sx:zd.iconButton,children:w.jsx(j5,{})})}),w.jsx(_t,{arrow:!0,title:fe.get("Imprint"),children:w.jsx(Ot,{onClick:l,size:"small",sx:zd.iconButton,children:w.jsx(Cie,{})})}),w.jsx(_t,{arrow:!0,title:fe.get("Settings"),children:w.jsx(Ot,{onClick:a,size:"small",sx:zd.iconButton,children:w.jsx(z5,{})})})]}),w.jsx(eqe,{title:fe.get("Imprint"),href:"docs/imprint.md",open:i,onClose:c})]})},bqe=Jt(pqe,mqe)(xqe),_qe=Li("form")(({theme:t})=>({display:"flex",flexWrap:"wrap",paddingTop:t.spacing(1),paddingLeft:t.spacing(1),paddingRight:t.spacing(1),flexGrow:0}));function wqe({children:t}){return w.jsx(_qe,{autoComplete:"off",children:t})}var Sz={},Sqe=ft;Object.defineProperty(Sz,"__esModule",{value:!0});var Oz=Sz.default=void 0,Oqe=Sqe(pt()),Cqe=w;Oz=Sz.default=(0,Oqe.default)((0,Cqe.jsx)("path",{d:"M19.3 16.9c.4-.7.7-1.5.7-2.4 0-2.5-2-4.5-4.5-4.5S11 12 11 14.5s2 4.5 4.5 4.5c.9 0 1.7-.3 2.4-.7l3.2 3.2 1.4-1.4zm-3.8.1c-1.4 0-2.5-1.1-2.5-2.5s1.1-2.5 2.5-2.5 2.5 1.1 2.5 2.5-1.1 2.5-2.5 2.5M12 20v2C6.48 22 2 17.52 2 12S6.48 2 12 2c4.84 0 8.87 3.44 9.8 8h-2.07c-.64-2.46-2.4-4.47-4.73-5.41V5c0 1.1-.9 2-2 2h-2v2c0 .55-.45 1-1 1H8v2h2v3H9l-4.79-4.79C4.08 10.79 4 11.38 4 12c0 4.41 3.59 8 8 8"}),"TravelExplore");const Ya=({sx:t,className:e,disabled:n,onClick:r,icon:i,tooltipText:o,toggle:a,value:s,selected:l})=>{const c=f=>{a?r(f,s):r(f)},u=o?w.jsx(_t,{arrow:!0,title:o,children:i}):i;return a?w.jsx(Pn,{sx:{padding:.3,...t},className:e,disabled:n,size:"small",onClick:c,value:s||"",selected:l,children:u}):w.jsx(Ot,{sx:t,className:e,disabled:n,size:"small",onClick:c,children:u})},Tqe=Li(ty)(({theme:t})=>({marginRight:t.spacing(1)}));function Kb({label:t,control:e,actions:n}){return w.jsx(Tqe,{variant:"standard",children:w.jsxs(Ke,{children:[t,e,n]})})}function Eqe({selectedDatasetId:t,datasets:e,selectDataset:n,locateSelectedDataset:r}){const i=M.useMemo(()=>e.sort((d,h)=>{const p=d.groupTitle||"zzz",m=h.groupTitle||"zzz",g=p.localeCompare(m);return g!==0?g:d.title.localeCompare(h.title)}),[e]),o=i.length>0&&!!i[0].groupTitle,a=d=>{const h=d.target.value||null;n(h,e,!0)};t=t||"",e=e||[];const s=w.jsx(ny,{shrink:!0,htmlFor:"dataset-select",children:fe.get("Dataset")}),l=[];let c;i.forEach(d=>{if(o){const h=d.groupTitle||fe.get("Others");h!==c&&l.push(w.jsx(ep,{children:w.jsx(At,{fontSize:"small",color:"text.secondary",children:h})},h)),c=h}l.push(w.jsx(jr,{value:d.id,selected:d.id===t,children:d.title},d.id))});const u=w.jsx(xd,{variant:"standard",value:t,onChange:a,input:w.jsx(yd,{name:"dataset",id:"dataset-select"}),displayEmpty:!0,name:"dataset",children:l}),f=w.jsx(Ya,{onClick:r,tooltipText:fe.get("Locate dataset in map"),icon:w.jsx(Oz,{})});return w.jsx(Kb,{label:s,control:u,actions:f})}const Pqe=t=>({locale:t.controlState.locale,selectedDatasetId:t.controlState.selectedDatasetId,datasets:t.dataState.datasets}),Mqe={selectDataset:cle,locateSelectedDataset:_8e},kqe=Jt(Pqe,Mqe)(Eqe);var Cz={},Aqe=ft;Object.defineProperty(Cz,"__esModule",{value:!0});var aE=Cz.default=void 0,Rqe=Aqe(pt()),Iqe=w;aE=Cz.default=(0,Rqe.default)((0,Iqe.jsx)("path",{d:"M19 3H5c-1.1 0-2 .9-2 2v14c0 1.1.9 2 2 2h14c1.1 0 2-.9 2-2V5c0-1.1-.9-2-2-2m-5.97 4.06L14.09 6l1.41 1.41L16.91 6l1.06 1.06-1.41 1.41 1.41 1.41-1.06 1.06-1.41-1.4-1.41 1.41-1.06-1.06 1.41-1.41zm-6.78.66h5v1.5h-5zM11.5 16h-2v2H8v-2H6v-1.5h2v-2h1.5v2h2zm6.5 1.25h-5v-1.5h5zm0-2.5h-5v-1.5h5z"}),"Calculate");var Tz={},Dqe=ft;Object.defineProperty(Tz,"__esModule",{value:!0});var Ez=Tz.default=void 0,Lqe=Dqe(pt()),Nqe=w;Ez=Tz.default=(0,Lqe.default)((0,Nqe.jsx)("path",{d:"M18 4H6v2l6.5 6L6 18v2h12v-3h-7l5-5-5-5h7z"}),"Functions");var Pz={},$qe=ft;Object.defineProperty(Pz,"__esModule",{value:!0});var sE=Pz.default=void 0,Fqe=$qe(pt()),jqe=w;sE=Pz.default=(0,Fqe.default)((0,jqe.jsx)("path",{fillRule:"evenodd",d:"M16 9V4h1c.55 0 1-.45 1-1s-.45-1-1-1H7c-.55 0-1 .45-1 1s.45 1 1 1h1v5c0 1.66-1.34 3-3 3v2h5.97v7l1 1 1-1v-7H19v-2c-1.66 0-3-1.34-3-3"}),"PushPin");var Mz={},Bqe=ft;Object.defineProperty(Mz,"__esModule",{value:!0});var $ce=Mz.default=void 0,zqe=Bqe(pt()),Uqe=w;$ce=Mz.default=(0,zqe.default)((0,Uqe.jsx)("path",{d:"M23 8c0 1.1-.9 2-2 2-.18 0-.35-.02-.51-.07l-3.56 3.55c.05.16.07.34.07.52 0 1.1-.9 2-2 2s-2-.9-2-2c0-.18.02-.36.07-.52l-2.55-2.55c-.16.05-.34.07-.52.07s-.36-.02-.52-.07l-4.55 4.56c.05.16.07.33.07.51 0 1.1-.9 2-2 2s-2-.9-2-2 .9-2 2-2c.18 0 .35.02.51.07l4.56-4.55C8.02 9.36 8 9.18 8 9c0-1.1.9-2 2-2s2 .9 2 2c0 .18-.02.36-.07.52l2.55 2.55c.16-.05.34-.07.52-.07s.36.02.52.07l3.55-3.56C19.02 8.35 19 8.18 19 8c0-1.1.9-2 2-2s2 .9 2 2"}),"Timeline");const ko={toggleButton:{padding:.3}},lE="userVariablesDialog";function Wqe(){return{id:Js("user"),name:"",title:"",units:"",expression:"",colorBarName:"bone",colorBarMin:0,colorBarMax:1,shape:[],dims:[],dtype:"float64",timeChunkSize:null,attrs:{}}}function Vqe(t){return{...t,id:Js("user"),name:`${t.name}_copy`,title:t.title?`${t.title} Copy`:""}}const Gqe={variables:!0,constants:!1,arrayOperators:!1,otherOperators:!1,arrayFunctions:!1,otherFunctions:!1},Fce=["variables","constants","arrayOperators","otherOperators","arrayFunctions","otherFunctions"],Hqe={variables:"Variables",constants:"Constants",arrayOperators:"Array operators",otherOperators:"Other operators",arrayFunctions:"Array functions",otherFunctions:"Other functions"};function qqe({selectedDatasetId:t,selectedVariableName:e,selectedDataset2Id:n,selectedVariable2Name:r,variables:i,userVariablesAllowed:o,canAddTimeSeries:a,addTimeSeries:s,canAddStatistics:l,addStatistics:c,selectVariable:u,selectVariable2:f,openDialog:d}){const h=C=>{u(C.target.value||null)},p=()=>{d(lE)},m=()=>{s()},g=()=>{c()},v=t===n&&e===r,y=w.jsx(ny,{shrink:!0,htmlFor:"variable-select",children:fe.get("Variable")}),x=w.jsx(xd,{variant:"standard",value:e||"",onChange:h,input:w.jsx(yd,{name:"variable",id:"variable-select"}),displayEmpty:!0,name:"variable",renderValue:()=>d9(i.find(C=>C.name===e)),children:(i||[]).map(C=>w.jsxs(jr,{value:C.name,selected:C.name===e,children:[V1(C)&&w.jsx(Kre,{children:w.jsx(aE,{fontSize:"small"})}),w.jsx(ts,{children:d9(C)}),t===n&&C.name===r&&w.jsx(sE,{fontSize:"small",color:"secondary"})]},C.name))}),b=o&&w.jsx(Ya,{onClick:p,tooltipText:fe.get("Create and manage user variables"),icon:w.jsx(aE,{})},"userVariables"),_=w.jsx(Ya,{disabled:!a,onClick:m,tooltipText:fe.get("Show time-series diagram"),icon:w.jsx($ce,{})},"timeSeries"),S=w.jsx(Ya,{disabled:!l,onClick:g,tooltipText:fe.get("Add statistics"),icon:w.jsx(Ez,{})},"statistics"),O=w.jsx(Pn,{selected:v,value:"comparison",size:"small",sx:{...ko.toggleButton,marginLeft:.4},onClick:()=>f(t,e),children:w.jsx(_t,{arrow:!0,title:fe.get("Make it 2nd variable for comparison"),children:w.jsx(sE,{fontSize:"small"})})},"variable2");return w.jsx(Kb,{label:y,control:x,actions:[O,b,_,S]})}function d9(t){return t?t.title||t.name:"?"}const Xqe=t=>({locale:t.controlState.locale,selectedDatasetId:t.controlState.selectedDatasetId,selectedVariableName:t.controlState.selectedVariableName,selectedDataset2Id:t.controlState.selectedDataset2Id,selectedVariable2Name:t.controlState.selectedVariable2Name,userVariablesAllowed:MWe(),canAddTimeSeries:bse(t),canAddStatistics:_se(t),variables:FWe(t)}),Qqe={openDialog:Lp,selectVariable:xle,selectVariable2:R8e,addTimeSeries:P2,addStatistics:Xse},Yqe=Jt(Xqe,Qqe)(qqe);var kz={},Kqe=ft;Object.defineProperty(kz,"__esModule",{value:!0});var Fp=kz.default=void 0,Zqe=Kqe(pt()),Jqe=w;Fp=kz.default=(0,Zqe.default)((0,Jqe.jsx)("path",{d:"M3 17.25V21h3.75L17.81 9.94l-3.75-3.75zM20.71 7.04c.39-.39.39-1.02 0-1.41l-2.34-2.34a.9959.9959 0 0 0-1.41 0l-1.83 1.83 3.75 3.75z"}),"Edit");var Az={},eXe=ft;Object.defineProperty(Az,"__esModule",{value:!0});var lw=Az.default=void 0,tXe=eXe(pt()),nXe=w;lw=Az.default=(0,tXe.default)((0,nXe.jsx)("path",{d:"M7 11v2h10v-2zm5-9C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2m0 18c-4.41 0-8-3.59-8-8s3.59-8 8-8 8 3.59 8 8-3.59 8-8 8"}),"RemoveCircleOutline");const jce=({itemValue:t,setItemValue:e,validateItemValue:n,editMode:r,setEditMode:i,labelText:o,select:a,actions:s})=>{const l=M.useRef(null),[c,u]=M.useState("");M.useEffect(()=>{r&&u(t)},[r,t,u]),M.useEffect(()=>{if(r){const p=l.current;p!==null&&(p.focus(),p.select())}},[r]);const f=w.jsx(ny,{shrink:!0,htmlFor:"place-select",children:o});if(!r)return w.jsx(Kb,{label:f,control:a,actions:s});const d=n?n(c):!0,h=w.jsx(yd,{value:c,error:!d,inputRef:l,onBlur:()=>i(!1),onKeyUp:p=>{p.code==="Escape"?i(!1):p.code==="Enter"&&d&&(i(!1),e(c))},onChange:p=>{u(p.currentTarget.value)}});return w.jsx(Kb,{label:f,control:h})},rXe={select:{minWidth:"5em"}};function iXe({placeGroups:t,selectPlaceGroups:e,renameUserPlaceGroup:n,removeUserPlaceGroup:r,selectedPlaceGroupIds:i,selectedPlaceGroupsTitle:o}){const[a,s]=M.useState(!1);if(t=t||[],i=i||[],t.length===0)return null;const l=i.length===1?i[0]:null,c=m=>{n(l,m)},u=m=>{e(m.target.value||null)},f=()=>o,d=w.jsx(xd,{variant:"standard",multiple:!0,displayEmpty:!0,onChange:u,input:w.jsx(yd,{name:"place-groups",id:"place-groups-select"}),value:i,renderValue:f,name:"place-groups",sx:rXe.select,children:t.map(m=>w.jsxs(jr,{value:m.id,children:[w.jsx(UL,{checked:i.indexOf(m.id)>-1}),w.jsx(ts,{primary:m.title})]},m.id))});let h=!1;l!==null&&l.startsWith(cy)&&(h=!!t.find(m=>m.id===l&&m.features&&m.features.length>=0));let p;if(h){const m=()=>{s(!0)},g=()=>{r(l)};p=[w.jsx(Ya,{onClick:m,tooltipText:fe.get("Rename place group"),icon:w.jsx(Fp,{})},"editPlaceGroup"),w.jsx(Ya,{onClick:g,tooltipText:fe.get("Remove places"),icon:w.jsx(lw,{})},"removePlaceGroup")]}return w.jsx(jce,{itemValue:o,setItemValue:c,validateItemValue:m=>m.trim().length>0,editMode:a,setEditMode:s,labelText:fe.get("Places"),select:d,actions:p})}const oXe=t=>({locale:t.controlState.locale,selectedPlaceGroupIds:t.controlState.selectedPlaceGroupIds,placeGroups:E2(t),selectedPlaceGroupsTitle:YWe(t)}),aXe={selectPlaceGroups:C8e,renameUserPlaceGroup:QVe,removeUserPlaceGroup:t8e},sXe=Jt(oXe,aXe)(iXe);var Rz={},lXe=ft;Object.defineProperty(Rz,"__esModule",{value:!0});var Bce=Rz.default=void 0,cXe=lXe(pt()),uXe=w;Bce=Rz.default=(0,cXe.default)((0,uXe.jsx)("path",{d:"M16.56 8.94 7.62 0 6.21 1.41l2.38 2.38-5.15 5.15c-.59.59-.59 1.54 0 2.12l5.5 5.5c.29.29.68.44 1.06.44s.77-.15 1.06-.44l5.5-5.5c.59-.58.59-1.53 0-2.12M5.21 10 10 5.21 14.79 10zM19 11.5s-2 2.17-2 3.5c0 1.1.9 2 2 2s2-.9 2-2c0-1.33-2-3.5-2-3.5M2 20h20v4H2z"}),"FormatColorFill");const Ud={container:{display:"grid",gridTemplateColumns:"auto 120px",gridTemplateRows:"auto",gridTemplateAreas:"'colorLabel colorValue' 'opacityLabel opacityValue'",rowGap:1,columnGap:2.5,padding:1},colorLabel:{gridArea:"colorLabel",alignSelf:"center"},colorValue:{gridArea:"colorValue",alignSelf:"center",width:"100%",height:"22px",borderWidth:1,borderStyle:"solid",borderColor:"black"},opacityLabel:{gridArea:"opacityLabel",alignSelf:"center"},opacityValue:{gridArea:"opacityValue",alignSelf:"center",width:"100%"},colorMenuItem:{padding:"4px 8px 4px 8px"},colorMenuItemBox:{width:"104px",height:"18px"}},fXe=({anchorEl:t,setAnchorEl:e,isPoint:n,placeStyle:r,updatePlaceStyle:i})=>{const[o,a]=M.useState(null);function s(l){a(l.currentTarget)}return w.jsxs(w.Fragment,{children:[w.jsx(Ep,{open:t!==null,anchorEl:t,onClose:()=>e(null),anchorOrigin:{vertical:"bottom",horizontal:"left"},transformOrigin:{vertical:"top",horizontal:"left"},children:w.jsxs(Ke,{sx:Ud.container,children:[w.jsx(At,{sx:Ud.colorLabel,children:fe.get("Color")}),w.jsx(At,{sx:Ud.opacityLabel,color:n?"text.secondary":"text.primary",children:fe.get("Opacity")}),w.jsx(Ke,{sx:Ud.colorValue,style:{backgroundColor:r.color},onClick:s}),w.jsx(ry,{sx:Ud.opacityValue,disabled:n,size:"small",min:0,max:1,step:.05,value:r.opacity,onChange:(l,c)=>i({...r,opacity:c})})]})}),w.jsx(Pp,{open:!!o,anchorEl:o,onClose:()=>a(null),children:R5.map(([l,c])=>w.jsx(jr,{selected:r.color===l,sx:Ud.colorMenuItem,onClick:()=>i({...r,color:l}),children:w.jsx(_t,{title:l,children:w.jsx(Ke,{sx:{...Ud.colorMenuItemBox,backgroundColor:l}})})},l))})]})},dXe={select:{minWidth:"5em"}};function hXe({selectPlace:t,placeLabels:e,selectedPlaceId:n,selectedPlaceGroupIds:r,selectedPlaceInfo:i,renameUserPlace:o,restyleUserPlace:a,removeUserPlace:s,places:l,locateSelectedPlace:c}){const[u,f]=M.useState(!1),[d,h]=M.useState(null);l=l||[],e=e||[],n=n||"",r=r||[];const p=r.length===1?r[0]:null,m=l.findIndex(O=>O.id===n),g=m>=0?e[m]:"",v=O=>{o(p,n,O)},y=O=>{a(p,n,O)},x=O=>{t(O.target.value||null,l,!0)},b=w.jsx(xd,{variant:"standard",value:n,onChange:x,input:w.jsx(yd,{name:"place",id:"place-select"}),displayEmpty:!0,name:"place",sx:dXe.select,disabled:l.length===0,children:l.map((O,C)=>w.jsx(jr,{value:O.id,selected:O.id===n,children:e[C]},O.id))}),_=p!==null&&p.startsWith(cy)&&n!=="";let S=[w.jsx(Ya,{onClick:c,tooltipText:fe.get("Locate place in map"),icon:w.jsx(Oz,{})},"locatePlace")];if(!u&&_){const O=()=>{f(!0)},C=k=>{h(k.currentTarget)},E=()=>{s(p,n,l)};S=[w.jsx(Ya,{onClick:O,tooltipText:fe.get("Rename place"),icon:w.jsx(Fp,{})},"editButton"),w.jsx(Ya,{onClick:C,tooltipText:fe.get("Style place"),icon:w.jsx(Bce,{})},"styleButton"),w.jsx(Ya,{onClick:E,tooltipText:fe.get("Remove place"),icon:w.jsx(lw,{})},"removeButton")].concat(S)}return w.jsxs(w.Fragment,{children:[w.jsx(jce,{itemValue:g,setItemValue:v,validateItemValue:O=>O.trim().length>0,editMode:u,setEditMode:f,labelText:fe.get("Place"),select:b,actions:S}),i&&w.jsx(fXe,{anchorEl:d,setAnchorEl:h,isPoint:i.place.geometry.type==="Point",placeStyle:i,updatePlaceStyle:y})]})}const pXe=t=>({locale:t.controlState.locale,datasets:t.dataState.datasets,selectedPlaceGroupIds:t.controlState.selectedPlaceGroupIds,selectedPlaceId:t.controlState.selectedPlaceId,selectedPlaceInfo:iw(t),places:rw(t),placeLabels:eVe(t)}),mXe={selectPlace:M2,renameUserPlace:YVe,restyleUserPlace:ZVe,removeUserPlace:e8e,locateSelectedPlace:w8e,openDialog:Lp},gXe=Jt(pXe,mXe)(hXe);var Iz={},vXe=ft;Object.defineProperty(Iz,"__esModule",{value:!0});var zce=Iz.default=void 0,yXe=vXe(pt()),xXe=w;zce=Iz.default=(0,yXe.default)((0,xXe.jsx)("path",{d:"M12 2C8.14 2 5 5.14 5 9c0 5.25 7 13 7 13s7-7.75 7-13c0-3.86-3.14-7-7-7m4 8h-3v3h-2v-3H8V8h3V5h2v3h3z"}),"AddLocation");var Dz={},bXe=ft;Object.defineProperty(Dz,"__esModule",{value:!0});var Uce=Dz.default=void 0,_Xe=bXe(pt()),wXe=w;Uce=Dz.default=(0,_Xe.default)((0,wXe.jsx)("path",{d:"M11.71 17.99C8.53 17.84 6 15.22 6 12c0-3.31 2.69-6 6-6 3.22 0 5.84 2.53 5.99 5.71l-2.1-.63C15.48 9.31 13.89 8 12 8c-2.21 0-4 1.79-4 4 0 1.89 1.31 3.48 3.08 3.89zM22 12c0 .3-.01.6-.04.9l-1.97-.59c.01-.1.01-.21.01-.31 0-4.42-3.58-8-8-8s-8 3.58-8 8 3.58 8 8 8c.1 0 .21 0 .31-.01l.59 1.97c-.3.03-.6.04-.9.04-5.52 0-10-4.48-10-10S6.48 2 12 2s10 4.48 10 10m-3.77 4.26L22 15l-10-3 3 10 1.26-3.77 4.27 4.27 1.98-1.98z"}),"AdsClick");var Lz={},SXe=ft;Object.defineProperty(Lz,"__esModule",{value:!0});var Wce=Lz.default=void 0,OXe=SXe(pt()),vR=w;Wce=Lz.default=(0,OXe.default)([(0,vR.jsx)("path",{d:"m12 2-5.5 9h11z"},"0"),(0,vR.jsx)("circle",{cx:"17.5",cy:"17.5",r:"4.5"},"1"),(0,vR.jsx)("path",{d:"M3 13.5h8v8H3z"},"2")],"Category");var Nz={},CXe=ft;Object.defineProperty(Nz,"__esModule",{value:!0});var Vce=Nz.default=void 0,TXe=CXe(pt()),EXe=w;Vce=Nz.default=(0,TXe.default)((0,EXe.jsx)("circle",{cx:"12",cy:"12",r:"8"}),"FiberManualRecord");var $z={},PXe=ft;Object.defineProperty($z,"__esModule",{value:!0});var Gce=$z.default=void 0,MXe=PXe(pt()),kXe=w;Gce=$z.default=(0,MXe.default)((0,kXe.jsx)("path",{d:"M19.35 10.04C18.67 6.59 15.64 4 12 4 9.11 4 6.6 5.64 5.35 8.04 2.34 8.36 0 10.91 0 14c0 3.31 2.69 6 6 6h13c2.76 0 5-2.24 5-5 0-2.64-2.05-4.78-4.65-4.96M14 13v4h-4v-4H7l5-5 5 5z"}),"CloudUpload");const AXe=Li(ty)(({theme:t})=>({marginTop:t.spacing(2),marginLeft:t.spacing(1),marginRight:t.spacing(2)}));function RXe({mapInteraction:t,setMapInteraction:e}){function n(r,i){e(i!==null?i:"Select")}return w.jsx(AXe,{variant:"standard",children:w.jsxs(iy,{size:"small",value:t,exclusive:!0,onChange:n,children:[w.jsx(Pn,{value:"Select",size:"small",sx:ko.toggleButton,children:w.jsx(_t,{arrow:!0,title:fe.get("Select a place in map"),children:w.jsx(Uce,{})})},0),w.jsx(Pn,{value:"Point",size:"small",sx:ko.toggleButton,children:w.jsx(_t,{arrow:!0,title:fe.get("Add a point location in map"),children:w.jsx(zce,{})})},1),w.jsx(Pn,{value:"Polygon",size:"small",sx:ko.toggleButton,children:w.jsx(_t,{arrow:!0,title:fe.get("Draw a polygon area in map"),children:w.jsx(Wce,{})})},2),w.jsx(Pn,{value:"Circle",size:"small",sx:ko.toggleButton,children:w.jsx(_t,{arrow:!0,title:fe.get("Draw a circular area in map"),children:w.jsx(Vce,{})})},3),w.jsx(Pn,{value:"Geometry",size:"small",sx:ko.toggleButton,children:w.jsx(_t,{arrow:!0,title:fe.get("Import places"),children:w.jsx(Gce,{})})},4)]})})}const IXe=t=>({mapInteraction:t.controlState.mapInteraction}),DXe={setMapInteraction:Tle},LXe=Jt(IXe,DXe)(RXe);var h9=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},cw=(typeof window>"u"?"undefined":h9(window))==="object"&&(typeof document>"u"?"undefined":h9(document))==="object"&&document.nodeType===9,NXe={}.constructor;function U3(t){if(t==null||typeof t!="object")return t;if(Array.isArray(t))return t.map(U3);if(t.constructor!==NXe)return t;var e={};for(var n in t)e[n]=U3(t[n]);return e}function Fz(t,e,n){t===void 0&&(t="unnamed");var r=n.jss,i=U3(e),o=r.plugins.onCreateRule(t,i,n);return o||(t[0],null)}var p9=function(e,n){for(var r="",i=0;i<e.length&&e[i]!=="!important";i++)r&&(r+=n),r+=e[i];return r},Uh=function(e){if(!Array.isArray(e))return e;var n="";if(Array.isArray(e[0]))for(var r=0;r<e.length&&e[r]!=="!important";r++)n&&(n+=", "),n+=p9(e[r]," ");else n=p9(e,", ");return e[e.length-1]==="!important"&&(n+=" !important"),n};function Ey(t){return t&&t.format===!1?{linebreak:"",space:""}:{linebreak:`
`,space:" "}}function P0(t,e){for(var n="",r=0;r<e;r++)n+="  ";return n+t}function Zb(t,e,n){n===void 0&&(n={});var r="";if(!e)return r;var i=n,o=i.indent,a=o===void 0?0:o,s=e.fallbacks;n.format===!1&&(a=-1/0);var l=Ey(n),c=l.linebreak,u=l.space;if(t&&a++,s)if(Array.isArray(s))for(var f=0;f<s.length;f++){var d=s[f];for(var h in d){var p=d[h];p!=null&&(r&&(r+=c),r+=P0(h+":"+u+Uh(p)+";",a))}}else for(var m in s){var g=s[m];g!=null&&(r&&(r+=c),r+=P0(m+":"+u+Uh(g)+";",a))}for(var v in e){var y=e[v];y!=null&&v!=="fallbacks"&&(r&&(r+=c),r+=P0(v+":"+u+Uh(y)+";",a))}return!r&&!n.allowEmpty||!t?r:(a--,r&&(r=""+c+r+c),P0(""+t+u+"{"+r,a)+P0("}",a))}var $Xe=/([[\].#*$><+~=|^:(),"'`\s])/g,m9=typeof CSS<"u"&&CSS.escape,jz=function(t){return m9?m9(t):t.replace($Xe,"\\$1")},Hce=function(){function t(n,r,i){this.type="style",this.isProcessed=!1;var o=i.sheet,a=i.Renderer;this.key=n,this.options=i,this.style=r,o?this.renderer=o.renderer:a&&(this.renderer=new a)}var e=t.prototype;return e.prop=function(r,i,o){if(i===void 0)return this.style[r];var a=o?o.force:!1;if(!a&&this.style[r]===i)return this;var s=i;(!o||o.process!==!1)&&(s=this.options.jss.plugins.onChangeValue(i,r,this));var l=s==null||s===!1,c=r in this.style;if(l&&!c&&!a)return this;var u=l&&c;if(u?delete this.style[r]:this.style[r]=s,this.renderable&&this.renderer)return u?this.renderer.removeProperty(this.renderable,r):this.renderer.setProperty(this.renderable,r,s),this;var f=this.options.sheet;return f&&f.attached,this},t}(),W3=function(t){D1(e,t);function e(r,i,o){var a;a=t.call(this,r,i,o)||this;var s=o.selector,l=o.scoped,c=o.sheet,u=o.generateId;return s?a.selectorText=s:l!==!1&&(a.id=u(lt(lt(a)),c),a.selectorText="."+jz(a.id)),a}var n=e.prototype;return n.applyTo=function(i){var o=this.renderer;if(o){var a=this.toJSON();for(var s in a)o.setProperty(i,s,a[s])}return this},n.toJSON=function(){var i={};for(var o in this.style){var a=this.style[o];typeof a!="object"?i[o]=a:Array.isArray(a)&&(i[o]=Uh(a))}return i},n.toString=function(i){var o=this.options.sheet,a=o?o.options.link:!1,s=a?j({},i,{allowEmpty:!0}):i;return Zb(this.selectorText,this.style,s)},Xt(e,[{key:"selector",set:function(i){if(i!==this.selectorText){this.selectorText=i;var o=this.renderer,a=this.renderable;if(!(!a||!o)){var s=o.setSelector(a,i);s||o.replaceRule(a,this)}}},get:function(){return this.selectorText}}]),e}(Hce),FXe={onCreateRule:function(e,n,r){return e[0]==="@"||r.parent&&r.parent.type==="keyframes"?null:new W3(e,n,r)}},yR={indent:1,children:!0},jXe=/@([\w-]+)/,BXe=function(){function t(n,r,i){this.type="conditional",this.isProcessed=!1,this.key=n;var o=n.match(jXe);this.at=o?o[1]:"unknown",this.query=i.name||"@"+this.at,this.options=i,this.rules=new H2(j({},i,{parent:this}));for(var a in r)this.rules.add(a,r[a]);this.rules.process()}var e=t.prototype;return e.getRule=function(r){return this.rules.get(r)},e.indexOf=function(r){return this.rules.indexOf(r)},e.addRule=function(r,i,o){var a=this.rules.add(r,i,o);return a?(this.options.jss.plugins.onProcessRule(a),a):null},e.replaceRule=function(r,i,o){var a=this.rules.replace(r,i,o);return a&&this.options.jss.plugins.onProcessRule(a),a},e.toString=function(r){r===void 0&&(r=yR);var i=Ey(r),o=i.linebreak;if(r.indent==null&&(r.indent=yR.indent),r.children==null&&(r.children=yR.children),r.children===!1)return this.query+" {}";var a=this.rules.toString(r);return a?this.query+" {"+o+a+o+"}":""},t}(),zXe=/@container|@media|@supports\s+/,UXe={onCreateRule:function(e,n,r){return zXe.test(e)?new BXe(e,n,r):null}},xR={indent:1,children:!0},WXe=/@keyframes\s+([\w-]+)/,V3=function(){function t(n,r,i){this.type="keyframes",this.at="@keyframes",this.isProcessed=!1;var o=n.match(WXe);o&&o[1]?this.name=o[1]:this.name="noname",this.key=this.type+"-"+this.name,this.options=i;var a=i.scoped,s=i.sheet,l=i.generateId;this.id=a===!1?this.name:jz(l(this,s)),this.rules=new H2(j({},i,{parent:this}));for(var c in r)this.rules.add(c,r[c],j({},i,{parent:this}));this.rules.process()}var e=t.prototype;return e.toString=function(r){r===void 0&&(r=xR);var i=Ey(r),o=i.linebreak;if(r.indent==null&&(r.indent=xR.indent),r.children==null&&(r.children=xR.children),r.children===!1)return this.at+" "+this.id+" {}";var a=this.rules.toString(r);return a&&(a=""+o+a+o),this.at+" "+this.id+" {"+a+"}"},t}(),VXe=/@keyframes\s+/,GXe=/\$([\w-]+)/g,G3=function(e,n){return typeof e=="string"?e.replace(GXe,function(r,i){return i in n?n[i]:r}):e},g9=function(e,n,r){var i=e[n],o=G3(i,r);o!==i&&(e[n]=o)},HXe={onCreateRule:function(e,n,r){return typeof e=="string"&&VXe.test(e)?new V3(e,n,r):null},onProcessStyle:function(e,n,r){return n.type!=="style"||!r||("animation-name"in e&&g9(e,"animation-name",r.keyframes),"animation"in e&&g9(e,"animation",r.keyframes)),e},onChangeValue:function(e,n,r){var i=r.options.sheet;if(!i)return e;switch(n){case"animation":return G3(e,i.keyframes);case"animation-name":return G3(e,i.keyframes);default:return e}}},qXe=function(t){D1(e,t);function e(){return t.apply(this,arguments)||this}var n=e.prototype;return n.toString=function(i){var o=this.options.sheet,a=o?o.options.link:!1,s=a?j({},i,{allowEmpty:!0}):i;return Zb(this.key,this.style,s)},e}(Hce),XXe={onCreateRule:function(e,n,r){return r.parent&&r.parent.type==="keyframes"?new qXe(e,n,r):null}},QXe=function(){function t(n,r,i){this.type="font-face",this.at="@font-face",this.isProcessed=!1,this.key=n,this.style=r,this.options=i}var e=t.prototype;return e.toString=function(r){var i=Ey(r),o=i.linebreak;if(Array.isArray(this.style)){for(var a="",s=0;s<this.style.length;s++)a+=Zb(this.at,this.style[s]),this.style[s+1]&&(a+=o);return a}return Zb(this.at,this.style,r)},t}(),YXe=/@font-face/,KXe={onCreateRule:function(e,n,r){return YXe.test(e)?new QXe(e,n,r):null}},ZXe=function(){function t(n,r,i){this.type="viewport",this.at="@viewport",this.isProcessed=!1,this.key=n,this.style=r,this.options=i}var e=t.prototype;return e.toString=function(r){return Zb(this.key,this.style,r)},t}(),JXe={onCreateRule:function(e,n,r){return e==="@viewport"||e==="@-ms-viewport"?new ZXe(e,n,r):null}},eQe=function(){function t(n,r,i){this.type="simple",this.isProcessed=!1,this.key=n,this.value=r,this.options=i}var e=t.prototype;return e.toString=function(r){if(Array.isArray(this.value)){for(var i="",o=0;o<this.value.length;o++)i+=this.key+" "+this.value[o]+";",this.value[o+1]&&(i+=`
`);return i}return this.key+" "+this.value+";"},t}(),tQe={"@charset":!0,"@import":!0,"@namespace":!0},nQe={onCreateRule:function(e,n,r){return e in tQe?new eQe(e,n,r):null}},v9=[FXe,UXe,HXe,XXe,KXe,JXe,nQe],rQe={process:!0},y9={force:!0,process:!0},H2=function(){function t(n){this.map={},this.raw={},this.index=[],this.counter=0,this.options=n,this.classes=n.classes,this.keyframes=n.keyframes}var e=t.prototype;return e.add=function(r,i,o){var a=this.options,s=a.parent,l=a.sheet,c=a.jss,u=a.Renderer,f=a.generateId,d=a.scoped,h=j({classes:this.classes,parent:s,sheet:l,jss:c,Renderer:u,generateId:f,scoped:d,name:r,keyframes:this.keyframes,selector:void 0},o),p=r;r in this.raw&&(p=r+"-d"+this.counter++),this.raw[p]=i,p in this.classes&&(h.selector="."+jz(this.classes[p]));var m=Fz(p,i,h);if(!m)return null;this.register(m);var g=h.index===void 0?this.index.length:h.index;return this.index.splice(g,0,m),m},e.replace=function(r,i,o){var a=this.get(r),s=this.index.indexOf(a);a&&this.remove(a);var l=o;return s!==-1&&(l=j({},o,{index:s})),this.add(r,i,l)},e.get=function(r){return this.map[r]},e.remove=function(r){this.unregister(r),delete this.raw[r.key],this.index.splice(this.index.indexOf(r),1)},e.indexOf=function(r){return this.index.indexOf(r)},e.process=function(){var r=this.options.jss.plugins;this.index.slice(0).forEach(r.onProcessRule,r)},e.register=function(r){this.map[r.key]=r,r instanceof W3?(this.map[r.selector]=r,r.id&&(this.classes[r.key]=r.id)):r instanceof V3&&this.keyframes&&(this.keyframes[r.name]=r.id)},e.unregister=function(r){delete this.map[r.key],r instanceof W3?(delete this.map[r.selector],delete this.classes[r.key]):r instanceof V3&&delete this.keyframes[r.name]},e.update=function(){var r,i,o;if(typeof(arguments.length<=0?void 0:arguments[0])=="string"?(r=arguments.length<=0?void 0:arguments[0],i=arguments.length<=1?void 0:arguments[1],o=arguments.length<=2?void 0:arguments[2]):(i=arguments.length<=0?void 0:arguments[0],o=arguments.length<=1?void 0:arguments[1],r=null),r)this.updateOne(this.get(r),i,o);else for(var a=0;a<this.index.length;a++)this.updateOne(this.index[a],i,o)},e.updateOne=function(r,i,o){o===void 0&&(o=rQe);var a=this.options,s=a.jss.plugins,l=a.sheet;if(r.rules instanceof t){r.rules.update(i,o);return}var c=r.style;if(s.onUpdate(i,r,l,o),o.process&&c&&c!==r.style){s.onProcessStyle(r.style,r,l);for(var u in r.style){var f=r.style[u],d=c[u];f!==d&&r.prop(u,f,y9)}for(var h in c){var p=r.style[h],m=c[h];p==null&&p!==m&&r.prop(h,null,y9)}}},e.toString=function(r){for(var i="",o=this.options.sheet,a=o?o.options.link:!1,s=Ey(r),l=s.linebreak,c=0;c<this.index.length;c++){var u=this.index[c],f=u.toString(r);!f&&!a||(i&&(i+=l),i+=f)}return i},t}(),qce=function(){function t(n,r){this.attached=!1,this.deployed=!1,this.classes={},this.keyframes={},this.options=j({},r,{sheet:this,parent:this,classes:this.classes,keyframes:this.keyframes}),r.Renderer&&(this.renderer=new r.Renderer(this)),this.rules=new H2(this.options);for(var i in n)this.rules.add(i,n[i]);this.rules.process()}var e=t.prototype;return e.attach=function(){return this.attached?this:(this.renderer&&this.renderer.attach(),this.attached=!0,this.deployed||this.deploy(),this)},e.detach=function(){return this.attached?(this.renderer&&this.renderer.detach(),this.attached=!1,this):this},e.addRule=function(r,i,o){var a=this.queue;this.attached&&!a&&(this.queue=[]);var s=this.rules.add(r,i,o);return s?(this.options.jss.plugins.onProcessRule(s),this.attached?(this.deployed&&(a?a.push(s):(this.insertRule(s),this.queue&&(this.queue.forEach(this.insertRule,this),this.queue=void 0))),s):(this.deployed=!1,s)):null},e.replaceRule=function(r,i,o){var a=this.rules.get(r);if(!a)return this.addRule(r,i,o);var s=this.rules.replace(r,i,o);return s&&this.options.jss.plugins.onProcessRule(s),this.attached?(this.deployed&&this.renderer&&(s?a.renderable&&this.renderer.replaceRule(a.renderable,s):this.renderer.deleteRule(a)),s):(this.deployed=!1,s)},e.insertRule=function(r){this.renderer&&this.renderer.insertRule(r)},e.addRules=function(r,i){var o=[];for(var a in r){var s=this.addRule(a,r[a],i);s&&o.push(s)}return o},e.getRule=function(r){return this.rules.get(r)},e.deleteRule=function(r){var i=typeof r=="object"?r:this.rules.get(r);return!i||this.attached&&!i.renderable?!1:(this.rules.remove(i),this.attached&&i.renderable&&this.renderer?this.renderer.deleteRule(i.renderable):!0)},e.indexOf=function(r){return this.rules.indexOf(r)},e.deploy=function(){return this.renderer&&this.renderer.deploy(),this.deployed=!0,this},e.update=function(){var r;return(r=this.rules).update.apply(r,arguments),this},e.updateOne=function(r,i,o){return this.rules.updateOne(r,i,o),this},e.toString=function(r){return this.rules.toString(r)},t}(),iQe=function(){function t(){this.plugins={internal:[],external:[]},this.registry={}}var e=t.prototype;return e.onCreateRule=function(r,i,o){for(var a=0;a<this.registry.onCreateRule.length;a++){var s=this.registry.onCreateRule[a](r,i,o);if(s)return s}return null},e.onProcessRule=function(r){if(!r.isProcessed){for(var i=r.options.sheet,o=0;o<this.registry.onProcessRule.length;o++)this.registry.onProcessRule[o](r,i);r.style&&this.onProcessStyle(r.style,r,i),r.isProcessed=!0}},e.onProcessStyle=function(r,i,o){for(var a=0;a<this.registry.onProcessStyle.length;a++)i.style=this.registry.onProcessStyle[a](i.style,i,o)},e.onProcessSheet=function(r){for(var i=0;i<this.registry.onProcessSheet.length;i++)this.registry.onProcessSheet[i](r)},e.onUpdate=function(r,i,o,a){for(var s=0;s<this.registry.onUpdate.length;s++)this.registry.onUpdate[s](r,i,o,a)},e.onChangeValue=function(r,i,o){for(var a=r,s=0;s<this.registry.onChangeValue.length;s++)a=this.registry.onChangeValue[s](a,i,o);return a},e.use=function(r,i){i===void 0&&(i={queue:"external"});var o=this.plugins[i.queue];o.indexOf(r)===-1&&(o.push(r),this.registry=[].concat(this.plugins.external,this.plugins.internal).reduce(function(a,s){for(var l in s)l in a&&a[l].push(s[l]);return a},{onCreateRule:[],onProcessRule:[],onProcessStyle:[],onProcessSheet:[],onChangeValue:[],onUpdate:[]}))},t}(),oQe=function(){function t(){this.registry=[]}var e=t.prototype;return e.add=function(r){var i=this.registry,o=r.options.index;if(i.indexOf(r)===-1){if(i.length===0||o>=this.index){i.push(r);return}for(var a=0;a<i.length;a++)if(i[a].options.index>o){i.splice(a,0,r);return}}},e.reset=function(){this.registry=[]},e.remove=function(r){var i=this.registry.indexOf(r);this.registry.splice(i,1)},e.toString=function(r){for(var i=r===void 0?{}:r,o=i.attached,a=Ae(i,["attached"]),s=Ey(a),l=s.linebreak,c="",u=0;u<this.registry.length;u++){var f=this.registry[u];o!=null&&f.attached!==o||(c&&(c+=l),c+=f.toString(a))}return c},Xt(t,[{key:"index",get:function(){return this.registry.length===0?0:this.registry[this.registry.length-1].options.index}}]),t}(),Kx=new oQe,H3=typeof globalThis<"u"?globalThis:typeof window<"u"&&window.Math===Math?window:typeof self<"u"&&self.Math===Math?self:Function("return this")(),q3="2f1acc6c3a606b082e5eef5e54414ffb";H3[q3]==null&&(H3[q3]=0);var x9=H3[q3]++,b9=function(e){e===void 0&&(e={});var n=0,r=function(o,a){n+=1;var s="",l="";return a&&(a.options.classNamePrefix&&(l=a.options.classNamePrefix),a.options.jss.id!=null&&(s=String(a.options.jss.id))),e.minify?""+(l||"c")+x9+s+n:l+o.key+"-"+x9+(s?"-"+s:"")+"-"+n};return r},Xce=function(e){var n;return function(){return n||(n=e()),n}},aQe=function(e,n){try{return e.attributeStyleMap?e.attributeStyleMap.get(n):e.style.getPropertyValue(n)}catch{return""}},sQe=function(e,n,r){try{var i=r;if(Array.isArray(r)&&(i=Uh(r)),e.attributeStyleMap)e.attributeStyleMap.set(n,i);else{var o=i?i.indexOf("!important"):-1,a=o>-1?i.substr(0,o-1):i;e.style.setProperty(n,a,o>-1?"important":"")}}catch{return!1}return!0},lQe=function(e,n){try{e.attributeStyleMap?e.attributeStyleMap.delete(n):e.style.removeProperty(n)}catch{}},cQe=function(e,n){return e.selectorText=n,e.selectorText===n},Qce=Xce(function(){return document.querySelector("head")});function uQe(t,e){for(var n=0;n<t.length;n++){var r=t[n];if(r.attached&&r.options.index>e.index&&r.options.insertionPoint===e.insertionPoint)return r}return null}function fQe(t,e){for(var n=t.length-1;n>=0;n--){var r=t[n];if(r.attached&&r.options.insertionPoint===e.insertionPoint)return r}return null}function dQe(t){for(var e=Qce(),n=0;n<e.childNodes.length;n++){var r=e.childNodes[n];if(r.nodeType===8&&r.nodeValue.trim()===t)return r}return null}function hQe(t){var e=Kx.registry;if(e.length>0){var n=uQe(e,t);if(n&&n.renderer)return{parent:n.renderer.element.parentNode,node:n.renderer.element};if(n=fQe(e,t),n&&n.renderer)return{parent:n.renderer.element.parentNode,node:n.renderer.element.nextSibling}}var r=t.insertionPoint;if(r&&typeof r=="string"){var i=dQe(r);if(i)return{parent:i.parentNode,node:i.nextSibling}}return!1}function pQe(t,e){var n=e.insertionPoint,r=hQe(e);if(r!==!1&&r.parent){r.parent.insertBefore(t,r.node);return}if(n&&typeof n.nodeType=="number"){var i=n,o=i.parentNode;o&&o.insertBefore(t,i.nextSibling);return}Qce().appendChild(t)}var mQe=Xce(function(){var t=document.querySelector('meta[property="csp-nonce"]');return t?t.getAttribute("content"):null}),_9=function(e,n,r){try{"insertRule"in e?e.insertRule(n,r):"appendRule"in e&&e.appendRule(n)}catch{return!1}return e.cssRules[r]},w9=function(e,n){var r=e.cssRules.length;return n===void 0||n>r?r:n},gQe=function(){var e=document.createElement("style");return e.textContent=`
`,e},vQe=function(){function t(n){this.getPropertyValue=aQe,this.setProperty=sQe,this.removeProperty=lQe,this.setSelector=cQe,this.hasInsertedRules=!1,this.cssRules=[],n&&Kx.add(n),this.sheet=n;var r=this.sheet?this.sheet.options:{},i=r.media,o=r.meta,a=r.element;this.element=a||gQe(),this.element.setAttribute("data-jss",""),i&&this.element.setAttribute("media",i),o&&this.element.setAttribute("data-meta",o);var s=mQe();s&&this.element.setAttribute("nonce",s)}var e=t.prototype;return e.attach=function(){if(!(this.element.parentNode||!this.sheet)){pQe(this.element,this.sheet.options);var r=!!(this.sheet&&this.sheet.deployed);this.hasInsertedRules&&r&&(this.hasInsertedRules=!1,this.deploy())}},e.detach=function(){if(this.sheet){var r=this.element.parentNode;r&&r.removeChild(this.element),this.sheet.options.link&&(this.cssRules=[],this.element.textContent=`
`)}},e.deploy=function(){var r=this.sheet;if(r){if(r.options.link){this.insertRules(r.rules);return}this.element.textContent=`
`+r.toString()+`
`}},e.insertRules=function(r,i){for(var o=0;o<r.index.length;o++)this.insertRule(r.index[o],o,i)},e.insertRule=function(r,i,o){if(o===void 0&&(o=this.element.sheet),r.rules){var a=r,s=o;if(r.type==="conditional"||r.type==="keyframes"){var l=w9(o,i);if(s=_9(o,a.toString({children:!1}),l),s===!1)return!1;this.refCssRule(r,l,s)}return this.insertRules(a.rules,s),s}var c=r.toString();if(!c)return!1;var u=w9(o,i),f=_9(o,c,u);return f===!1?!1:(this.hasInsertedRules=!0,this.refCssRule(r,u,f),f)},e.refCssRule=function(r,i,o){r.renderable=o,r.options.parent instanceof qce&&this.cssRules.splice(i,0,o)},e.deleteRule=function(r){var i=this.element.sheet,o=this.indexOf(r);return o===-1?!1:(i.deleteRule(o),this.cssRules.splice(o,1),!0)},e.indexOf=function(r){return this.cssRules.indexOf(r)},e.replaceRule=function(r,i){var o=this.indexOf(r);return o===-1?!1:(this.element.sheet.deleteRule(o),this.cssRules.splice(o,1),this.insertRule(i,o))},e.getRules=function(){return this.element.sheet.cssRules},t}(),yQe=0,xQe=function(){function t(n){this.id=yQe++,this.version="10.10.0",this.plugins=new iQe,this.options={id:{minify:!1},createGenerateId:b9,Renderer:cw?vQe:null,plugins:[]},this.generateId=b9({minify:!1});for(var r=0;r<v9.length;r++)this.plugins.use(v9[r],{queue:"internal"});this.setup(n)}var e=t.prototype;return e.setup=function(r){return r===void 0&&(r={}),r.createGenerateId&&(this.options.createGenerateId=r.createGenerateId),r.id&&(this.options.id=j({},this.options.id,r.id)),(r.createGenerateId||r.id)&&(this.generateId=this.options.createGenerateId(this.options.id)),r.insertionPoint!=null&&(this.options.insertionPoint=r.insertionPoint),"Renderer"in r&&(this.options.Renderer=r.Renderer),r.plugins&&this.use.apply(this,r.plugins),this},e.createStyleSheet=function(r,i){i===void 0&&(i={});var o=i,a=o.index;typeof a!="number"&&(a=Kx.index===0?0:Kx.index+1);var s=new qce(r,j({},i,{jss:this,generateId:i.generateId||this.generateId,insertionPoint:this.options.insertionPoint,Renderer:this.options.Renderer,index:a}));return this.plugins.onProcessSheet(s),s},e.removeStyleSheet=function(r){return r.detach(),Kx.remove(r),this},e.createRule=function(r,i,o){if(i===void 0&&(i={}),o===void 0&&(o={}),typeof r=="object")return this.createRule(void 0,r,i);var a=j({},o,{name:r,jss:this,Renderer:this.options.Renderer});a.generateId||(a.generateId=this.generateId),a.classes||(a.classes={}),a.keyframes||(a.keyframes={});var s=Fz(r,i,a);return s&&this.plugins.onProcessRule(s),s},e.use=function(){for(var r=this,i=arguments.length,o=new Array(i),a=0;a<i;a++)o[a]=arguments[a];return o.forEach(function(s){r.plugins.use(s)}),this},t}(),Yce=function(e){return new xQe(e)},Bz=typeof CSS=="object"&&CSS!=null&&"number"in CSS;function Kce(t){var e=null;for(var n in t){var r=t[n],i=typeof r;if(i==="function")e||(e={}),e[n]=r;else if(i==="object"&&r!==null&&!Array.isArray(r)){var o=Kce(r);o&&(e||(e={}),e[n]=o)}}return e}/**
 * A better abstraction over CSS.
 *
 * @copyright Oleg Isonen (Slobodskoi) / Isonen 2014-present
 * @website https://github.com/cssinjs/jss
 * @license MIT
 */Yce();function Zce(t={}){const{baseClasses:e,newClasses:n,Component:r}=t;if(!n)return e;const i=j({},e);return Object.keys(n).forEach(o=>{n[o]&&(i[o]=`${e[o]} ${n[o]}`)}),i}const ng={set:(t,e,n,r)=>{let i=t.get(e);i||(i=new Map,t.set(e,i)),i.set(n,r)},get:(t,e,n)=>{const r=t.get(e);return r?r.get(n):void 0},delete:(t,e,n)=>{t.get(e).delete(n)}};function Jce(){var t;const e=t5();return(t=e==null?void 0:e.$$material)!=null?t:e}const bQe=["checked","disabled","error","focused","focusVisible","required","expanded","selected"];function _Qe(t={}){const{disableGlobal:e=!1,productionPrefix:n="jss",seed:r=""}=t,i=r===""?"":`${r}-`;let o=0;const a=()=>(o+=1,o);return(s,l)=>{const c=l.options.name;if(c&&c.indexOf("Mui")===0&&!l.options.link&&!e){if(bQe.indexOf(s.key)!==-1)return`Mui-${s.key}`;const u=`${i}${c}-${s.key}`;return!l.options.theme[ore]||r!==""?u:`${u}-${a()}`}return`${i}${n}${a()}`}}var eue=Date.now(),bR="fnValues"+eue,_R="fnStyle"+ ++eue,wQe=function(){return{onCreateRule:function(n,r,i){if(typeof r!="function")return null;var o=Fz(n,{},i);return o[_R]=r,o},onProcessStyle:function(n,r){if(bR in r||_R in r)return n;var i={};for(var o in n){var a=n[o];typeof a=="function"&&(delete n[o],i[o]=a)}return r[bR]=i,n},onUpdate:function(n,r,i,o){var a=r,s=a[_R];s&&(a.style=s(n)||{});var l=a[bR];if(l)for(var c in l)a.prop(c,l[c](n),o)}}},zf="@global",X3="@global ",SQe=function(){function t(n,r,i){this.type="global",this.at=zf,this.isProcessed=!1,this.key=n,this.options=i,this.rules=new H2(j({},i,{parent:this}));for(var o in r)this.rules.add(o,r[o]);this.rules.process()}var e=t.prototype;return e.getRule=function(r){return this.rules.get(r)},e.addRule=function(r,i,o){var a=this.rules.add(r,i,o);return a&&this.options.jss.plugins.onProcessRule(a),a},e.replaceRule=function(r,i,o){var a=this.rules.replace(r,i,o);return a&&this.options.jss.plugins.onProcessRule(a),a},e.indexOf=function(r){return this.rules.indexOf(r)},e.toString=function(r){return this.rules.toString(r)},t}(),OQe=function(){function t(n,r,i){this.type="global",this.at=zf,this.isProcessed=!1,this.key=n,this.options=i;var o=n.substr(X3.length);this.rule=i.jss.createRule(o,r,j({},i,{parent:this}))}var e=t.prototype;return e.toString=function(r){return this.rule?this.rule.toString(r):""},t}(),CQe=/\s*,\s*/g;function tue(t,e){for(var n=t.split(CQe),r="",i=0;i<n.length;i++)r+=e+" "+n[i].trim(),n[i+1]&&(r+=", ");return r}function TQe(t,e){var n=t.options,r=t.style,i=r?r[zf]:null;if(i){for(var o in i)e.addRule(o,i[o],j({},n,{selector:tue(o,t.selector)}));delete r[zf]}}function EQe(t,e){var n=t.options,r=t.style;for(var i in r)if(!(i[0]!=="@"||i.substr(0,zf.length)!==zf)){var o=tue(i.substr(zf.length),t.selector);e.addRule(o,r[i],j({},n,{selector:o})),delete r[i]}}function PQe(){function t(n,r,i){if(!n)return null;if(n===zf)return new SQe(n,r,i);if(n[0]==="@"&&n.substr(0,X3.length)===X3)return new OQe(n,r,i);var o=i.parent;return o&&(o.type==="global"||o.options.parent&&o.options.parent.type==="global")&&(i.scoped=!1),!i.selector&&i.scoped===!1&&(i.selector=n),null}function e(n,r){n.type!=="style"||!r||(TQe(n,r),EQe(n,r))}return{onCreateRule:t,onProcessRule:e}}var S9=/\s*,\s*/g,MQe=/&/g,kQe=/\$([\w-]+)/g;function AQe(){function t(i,o){return function(a,s){var l=i.getRule(s)||o&&o.getRule(s);return l?l.selector:s}}function e(i,o){for(var a=o.split(S9),s=i.split(S9),l="",c=0;c<a.length;c++)for(var u=a[c],f=0;f<s.length;f++){var d=s[f];l&&(l+=", "),l+=d.indexOf("&")!==-1?d.replace(MQe,u):u+" "+d}return l}function n(i,o,a){if(a)return j({},a,{index:a.index+1});var s=i.options.nestingLevel;s=s===void 0?1:s+1;var l=j({},i.options,{nestingLevel:s,index:o.indexOf(i)+1});return delete l.name,l}function r(i,o,a){if(o.type!=="style")return i;var s=o,l=s.options.parent,c,u;for(var f in i){var d=f.indexOf("&")!==-1,h=f[0]==="@";if(!(!d&&!h)){if(c=n(s,l,c),d){var p=e(f,s.selector);u||(u=t(l,a)),p=p.replace(kQe,u);var m=s.key+"-"+f;"replaceRule"in l?l.replaceRule(m,i[f],j({},c,{selector:p})):l.addRule(m,i[f],j({},c,{selector:p}))}else h&&l.addRule(f,{},c).addRule(s.key,i[f],{selector:s.selector});delete i[f]}}return i}return{onProcessStyle:r}}var RQe=/[A-Z]/g,IQe=/^ms-/,wR={};function DQe(t){return"-"+t.toLowerCase()}function nue(t){if(wR.hasOwnProperty(t))return wR[t];var e=t.replace(RQe,DQe);return wR[t]=IQe.test(e)?"-"+e:e}function cE(t){var e={};for(var n in t){var r=n.indexOf("--")===0?n:nue(n);e[r]=t[n]}return t.fallbacks&&(Array.isArray(t.fallbacks)?e.fallbacks=t.fallbacks.map(cE):e.fallbacks=cE(t.fallbacks)),e}function LQe(){function t(n){if(Array.isArray(n)){for(var r=0;r<n.length;r++)n[r]=cE(n[r]);return n}return cE(n)}function e(n,r,i){if(r.indexOf("--")===0)return n;var o=nue(r);return r===o?n:(i.prop(o,n),null)}return{onProcessStyle:t,onChangeValue:e}}var Fe=Bz&&CSS?CSS.px:"px",FS=Bz&&CSS?CSS.ms:"ms",lm=Bz&&CSS?CSS.percent:"%",NQe={"animation-delay":FS,"animation-duration":FS,"background-position":Fe,"background-position-x":Fe,"background-position-y":Fe,"background-size":Fe,border:Fe,"border-bottom":Fe,"border-bottom-left-radius":Fe,"border-bottom-right-radius":Fe,"border-bottom-width":Fe,"border-left":Fe,"border-left-width":Fe,"border-radius":Fe,"border-right":Fe,"border-right-width":Fe,"border-top":Fe,"border-top-left-radius":Fe,"border-top-right-radius":Fe,"border-top-width":Fe,"border-width":Fe,"border-block":Fe,"border-block-end":Fe,"border-block-end-width":Fe,"border-block-start":Fe,"border-block-start-width":Fe,"border-block-width":Fe,"border-inline":Fe,"border-inline-end":Fe,"border-inline-end-width":Fe,"border-inline-start":Fe,"border-inline-start-width":Fe,"border-inline-width":Fe,"border-start-start-radius":Fe,"border-start-end-radius":Fe,"border-end-start-radius":Fe,"border-end-end-radius":Fe,margin:Fe,"margin-bottom":Fe,"margin-left":Fe,"margin-right":Fe,"margin-top":Fe,"margin-block":Fe,"margin-block-end":Fe,"margin-block-start":Fe,"margin-inline":Fe,"margin-inline-end":Fe,"margin-inline-start":Fe,padding:Fe,"padding-bottom":Fe,"padding-left":Fe,"padding-right":Fe,"padding-top":Fe,"padding-block":Fe,"padding-block-end":Fe,"padding-block-start":Fe,"padding-inline":Fe,"padding-inline-end":Fe,"padding-inline-start":Fe,"mask-position-x":Fe,"mask-position-y":Fe,"mask-size":Fe,height:Fe,width:Fe,"min-height":Fe,"max-height":Fe,"min-width":Fe,"max-width":Fe,bottom:Fe,left:Fe,top:Fe,right:Fe,inset:Fe,"inset-block":Fe,"inset-block-end":Fe,"inset-block-start":Fe,"inset-inline":Fe,"inset-inline-end":Fe,"inset-inline-start":Fe,"box-shadow":Fe,"text-shadow":Fe,"column-gap":Fe,"column-rule":Fe,"column-rule-width":Fe,"column-width":Fe,"font-size":Fe,"font-size-delta":Fe,"letter-spacing":Fe,"text-decoration-thickness":Fe,"text-indent":Fe,"text-stroke":Fe,"text-stroke-width":Fe,"word-spacing":Fe,motion:Fe,"motion-offset":Fe,outline:Fe,"outline-offset":Fe,"outline-width":Fe,perspective:Fe,"perspective-origin-x":lm,"perspective-origin-y":lm,"transform-origin":lm,"transform-origin-x":lm,"transform-origin-y":lm,"transform-origin-z":lm,"transition-delay":FS,"transition-duration":FS,"vertical-align":Fe,"flex-basis":Fe,"shape-margin":Fe,size:Fe,gap:Fe,grid:Fe,"grid-gap":Fe,"row-gap":Fe,"grid-row-gap":Fe,"grid-column-gap":Fe,"grid-template-rows":Fe,"grid-template-columns":Fe,"grid-auto-rows":Fe,"grid-auto-columns":Fe,"box-shadow-x":Fe,"box-shadow-y":Fe,"box-shadow-blur":Fe,"box-shadow-spread":Fe,"font-line-height":Fe,"text-shadow-x":Fe,"text-shadow-y":Fe,"text-shadow-blur":Fe};function rue(t){var e=/(-[a-z])/g,n=function(a){return a[1].toUpperCase()},r={};for(var i in t)r[i]=t[i],r[i.replace(e,n)]=t[i];return r}var $Qe=rue(NQe);function Zx(t,e,n){if(e==null)return e;if(Array.isArray(e))for(var r=0;r<e.length;r++)e[r]=Zx(t,e[r],n);else if(typeof e=="object")if(t==="fallbacks")for(var i in e)e[i]=Zx(i,e[i],n);else for(var o in e)e[o]=Zx(t+"-"+o,e[o],n);else if(typeof e=="number"&&isNaN(e)===!1){var a=n[t]||$Qe[t];return a&&!(e===0&&a===Fe)?typeof a=="function"?a(e).toString():""+e+a:e.toString()}return e}function FQe(t){t===void 0&&(t={});var e=rue(t);function n(i,o){if(o.type!=="style")return i;for(var a in i)i[a]=Zx(a,i[a],e);return i}function r(i,o){return Zx(o,i,e)}return{onProcessStyle:n,onChangeValue:r}}function jQe(t){if(Array.isArray(t))return S3(t)}function BQe(t){if(typeof Symbol<"u"&&t[Symbol.iterator]!=null||t["@@iterator"]!=null)return Array.from(t)}function zQe(){throw new TypeError(`Invalid attempt to spread non-iterable instance.
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function UQe(t){return jQe(t)||BQe(t)||wae(t)||zQe()}var dx="",Q3="",iue="",oue="",WQe=cw&&"ontouchstart"in document.documentElement;if(cw){var SR={Moz:"-moz-",ms:"-ms-",O:"-o-",Webkit:"-webkit-"},VQe=document.createElement("p"),OR=VQe.style,GQe="Transform";for(var CR in SR)if(CR+GQe in OR){dx=CR,Q3=SR[CR];break}dx==="Webkit"&&"msHyphens"in OR&&(dx="ms",Q3=SR.ms,oue="edge"),dx==="Webkit"&&"-apple-trailing-word"in OR&&(iue="apple")}var Nt={js:dx,css:Q3,vendor:iue,browser:oue,isTouch:WQe};function HQe(t){return t[1]==="-"||Nt.js==="ms"?t:"@"+Nt.css+"keyframes"+t.substr(10)}var qQe={noPrefill:["appearance"],supportedProperty:function(e){return e!=="appearance"?!1:Nt.js==="ms"?"-webkit-"+e:Nt.css+e}},XQe={noPrefill:["color-adjust"],supportedProperty:function(e){return e!=="color-adjust"?!1:Nt.js==="Webkit"?Nt.css+"print-"+e:e}},QQe=/[-\s]+(.)?/g;function YQe(t,e){return e?e.toUpperCase():""}function zz(t){return t.replace(QQe,YQe)}function nd(t){return zz("-"+t)}var KQe={noPrefill:["mask"],supportedProperty:function(e,n){if(!/^mask/.test(e))return!1;if(Nt.js==="Webkit"){var r="mask-image";if(zz(r)in n)return e;if(Nt.js+nd(r)in n)return Nt.css+e}return e}},ZQe={noPrefill:["text-orientation"],supportedProperty:function(e){return e!=="text-orientation"?!1:Nt.vendor==="apple"&&!Nt.isTouch?Nt.css+e:e}},JQe={noPrefill:["transform"],supportedProperty:function(e,n,r){return e!=="transform"?!1:r.transform?e:Nt.css+e}},eYe={noPrefill:["transition"],supportedProperty:function(e,n,r){return e!=="transition"?!1:r.transition?e:Nt.css+e}},tYe={noPrefill:["writing-mode"],supportedProperty:function(e){return e!=="writing-mode"?!1:Nt.js==="Webkit"||Nt.js==="ms"&&Nt.browser!=="edge"?Nt.css+e:e}},nYe={noPrefill:["user-select"],supportedProperty:function(e){return e!=="user-select"?!1:Nt.js==="Moz"||Nt.js==="ms"||Nt.vendor==="apple"?Nt.css+e:e}},rYe={supportedProperty:function(e,n){if(!/^break-/.test(e))return!1;if(Nt.js==="Webkit"){var r="WebkitColumn"+nd(e);return r in n?Nt.css+"column-"+e:!1}if(Nt.js==="Moz"){var i="page"+nd(e);return i in n?"page-"+e:!1}return!1}},iYe={supportedProperty:function(e,n){if(!/^(border|margin|padding)-inline/.test(e))return!1;if(Nt.js==="Moz")return e;var r=e.replace("-inline","");return Nt.js+nd(r)in n?Nt.css+r:!1}},oYe={supportedProperty:function(e,n){return zz(e)in n?e:!1}},aYe={supportedProperty:function(e,n){var r=nd(e);return e[0]==="-"||e[0]==="-"&&e[1]==="-"?e:Nt.js+r in n?Nt.css+e:Nt.js!=="Webkit"&&"Webkit"+r in n?"-webkit-"+e:!1}},sYe={supportedProperty:function(e){return e.substring(0,11)!=="scroll-snap"?!1:Nt.js==="ms"?""+Nt.css+e:e}},lYe={supportedProperty:function(e){return e!=="overscroll-behavior"?!1:Nt.js==="ms"?Nt.css+"scroll-chaining":e}},cYe={"flex-grow":"flex-positive","flex-shrink":"flex-negative","flex-basis":"flex-preferred-size","justify-content":"flex-pack",order:"flex-order","align-items":"flex-align","align-content":"flex-line-pack"},uYe={supportedProperty:function(e,n){var r=cYe[e];return r&&Nt.js+nd(r)in n?Nt.css+r:!1}},aue={flex:"box-flex","flex-grow":"box-flex","flex-direction":["box-orient","box-direction"],order:"box-ordinal-group","align-items":"box-align","flex-flow":["box-orient","box-direction"],"justify-content":"box-pack"},fYe=Object.keys(aue),dYe=function(e){return Nt.css+e},hYe={supportedProperty:function(e,n,r){var i=r.multiple;if(fYe.indexOf(e)>-1){var o=aue[e];if(!Array.isArray(o))return Nt.js+nd(o)in n?Nt.css+o:!1;if(!i)return!1;for(var a=0;a<o.length;a++)if(!(Nt.js+nd(o[0])in n))return!1;return o.map(dYe)}return!1}},sue=[qQe,XQe,KQe,ZQe,JQe,eYe,tYe,nYe,rYe,iYe,oYe,aYe,sYe,lYe,uYe,hYe],O9=sue.filter(function(t){return t.supportedProperty}).map(function(t){return t.supportedProperty}),pYe=sue.filter(function(t){return t.noPrefill}).reduce(function(t,e){return t.push.apply(t,UQe(e.noPrefill)),t},[]),hx,ch={};if(cw){hx=document.createElement("p");var TR=window.getComputedStyle(document.documentElement,"");for(var ER in TR)isNaN(ER)||(ch[TR[ER]]=TR[ER]);pYe.forEach(function(t){return delete ch[t]})}function Y3(t,e){if(e===void 0&&(e={}),!hx)return t;if(ch[t]!=null)return ch[t];(t==="transition"||t==="transform")&&(e[t]=t in hx.style);for(var n=0;n<O9.length&&(ch[t]=O9[n](t,hx.style,e),!ch[t]);n++);try{hx.style[t]=""}catch{return!1}return ch[t]}var cm={},mYe={transition:1,"transition-property":1,"-webkit-transition":1,"-webkit-transition-property":1},gYe=/(^\s*[\w-]+)|, (\s*[\w-]+)(?![^()]*\))/g,Ku;function vYe(t,e,n){if(e==="var")return"var";if(e==="all")return"all";if(n==="all")return", all";var r=e?Y3(e):", "+Y3(n);return r||e||n}cw&&(Ku=document.createElement("p"));function C9(t,e){var n=e;if(!Ku||t==="content")return e;if(typeof n!="string"||!isNaN(parseInt(n,10)))return n;var r=t+n;if(cm[r]!=null)return cm[r];try{Ku.style[t]=n}catch{return cm[r]=!1,!1}if(mYe[t])n=n.replace(gYe,vYe);else if(Ku.style[t]===""&&(n=Nt.css+n,n==="-ms-flex"&&(Ku.style[t]="-ms-flexbox"),Ku.style[t]=n,Ku.style[t]===""))return cm[r]=!1,!1;return Ku.style[t]="",cm[r]=n,cm[r]}function yYe(){function t(i){if(i.type==="keyframes"){var o=i;o.at=HQe(o.at)}}function e(i){for(var o in i){var a=i[o];if(o==="fallbacks"&&Array.isArray(a)){i[o]=a.map(e);continue}var s=!1,l=Y3(o);l&&l!==o&&(s=!0);var c=!1,u=C9(l,Uh(a));u&&u!==a&&(c=!0),(s||c)&&(s&&delete i[o],i[l||o]=u||a)}return i}function n(i,o){return o.type!=="style"?i:e(i)}function r(i,o){return C9(o,Uh(i))||i}return{onProcessRule:t,onProcessStyle:n,onChangeValue:r}}function xYe(){var t=function(n,r){return n.length===r.length?n>r?1:-1:n.length-r.length};return{onProcessStyle:function(n,r){if(r.type!=="style")return n;for(var i={},o=Object.keys(n).sort(t),a=0;a<o.length;a++)i[o[a]]=n[o[a]];return i}}}function bYe(){return{plugins:[wQe(),PQe(),AQe(),LQe(),FQe(),typeof window>"u"?null:yYe(),xYe()]}}const _Ye=Yce(bYe()),wYe=_Qe(),SYe=new Map,OYe={disableGeneration:!1,generateClassName:wYe,jss:_Ye,sheetsCache:null,sheetsManager:SYe,sheetsRegistry:null},CYe=M.createContext(OYe);let T9=-1e9;function TYe(){return T9+=1,T9}const EYe=["variant"];function E9(t){return t.length===0}function PYe(t){const{variant:e}=t,n=Ae(t,EYe);let r=e||"";return Object.keys(n).sort().forEach(i=>{i==="color"?r+=E9(r)?t[i]:De(t[i]):r+=`${E9(r)?i:De(i)}${De(t[i].toString())}`}),r}const MYe={};function kYe(t){const e=typeof t=="function";return{create:(n,r)=>{let i;try{i=e?t(n):t}catch(l){throw l}if(!r||!n.components||!n.components[r]||!n.components[r].styleOverrides&&!n.components[r].variants)return i;const o=n.components[r].styleOverrides||{},a=n.components[r].variants||[],s=j({},i);return Object.keys(o).forEach(l=>{s[l]=Ii(s[l]||{},o[l])}),a.forEach(l=>{const c=PYe(l.props);s[c]=Ii(s[c]||{},l.style)}),s},options:{}}}const AYe=["name","classNamePrefix","Component","defaultTheme"];function RYe({state:t,stylesOptions:e},n,r){if(e.disableGeneration)return n||{};t.cacheClasses||(t.cacheClasses={value:null,lastProp:null,lastJSS:{}});let i=!1;return t.classes!==t.cacheClasses.lastJSS&&(t.cacheClasses.lastJSS=t.classes,i=!0),n!==t.cacheClasses.lastProp&&(t.cacheClasses.lastProp=n,i=!0),i&&(t.cacheClasses.value=Zce({baseClasses:t.cacheClasses.lastJSS,newClasses:n,Component:r})),t.cacheClasses.value}function IYe({state:t,theme:e,stylesOptions:n,stylesCreator:r,name:i},o){if(n.disableGeneration)return;let a=ng.get(n.sheetsManager,r,e);a||(a={refs:0,staticSheet:null,dynamicStyles:null},ng.set(n.sheetsManager,r,e,a));const s=j({},r.options,n,{theme:e,flip:typeof n.flip=="boolean"?n.flip:e.direction==="rtl"});s.generateId=s.serverGenerateClassName||s.generateClassName;const l=n.sheetsRegistry;if(a.refs===0){let c;n.sheetsCache&&(c=ng.get(n.sheetsCache,r,e));const u=r.create(e,i);c||(c=n.jss.createStyleSheet(u,j({link:!1},s)),c.attach(),n.sheetsCache&&ng.set(n.sheetsCache,r,e,c)),l&&l.add(c),a.staticSheet=c,a.dynamicStyles=Kce(u)}if(a.dynamicStyles){const c=n.jss.createStyleSheet(a.dynamicStyles,j({link:!0},s));c.update(o),c.attach(),t.dynamicSheet=c,t.classes=Zce({baseClasses:a.staticSheet.classes,newClasses:c.classes}),l&&l.add(c)}else t.classes=a.staticSheet.classes;a.refs+=1}function DYe({state:t},e){t.dynamicSheet&&t.dynamicSheet.update(e)}function LYe({state:t,theme:e,stylesOptions:n,stylesCreator:r}){if(n.disableGeneration)return;const i=ng.get(n.sheetsManager,r,e);i.refs-=1;const o=n.sheetsRegistry;i.refs===0&&(ng.delete(n.sheetsManager,r,e),n.jss.removeStyleSheet(i.staticSheet),o&&o.remove(i.staticSheet)),t.dynamicSheet&&(n.jss.removeStyleSheet(t.dynamicSheet),o&&o.remove(t.dynamicSheet))}function NYe(t,e){const n=M.useRef([]);let r;const i=M.useMemo(()=>({}),e);n.current!==i&&(n.current=i,r=t()),M.useEffect(()=>()=>{r&&r()},[i])}function $Ye(t,e={}){const{name:n,classNamePrefix:r,Component:i,defaultTheme:o=MYe}=e,a=Ae(e,AYe),s=kYe(t),l=n||r||"makeStyles";return s.options={index:TYe(),name:n,meta:l,classNamePrefix:l},(u={})=>{const f=Jce()||o,d=j({},M.useContext(CYe),a),h=M.useRef(),p=M.useRef();return NYe(()=>{const g={name:n,state:{},stylesCreator:s,stylesOptions:d,theme:f};return IYe(g,u),p.current=!1,h.current=g,()=>{LYe(g)}},[f,s]),M.useEffect(()=>{p.current&&DYe(h.current,u),p.current=!0}),RYe(h.current,u.classes,i)}}function FYe(t){const{theme:e,name:n,props:r}=t;if(!e||!e.components||!e.components[n]||!e.components[n].defaultProps)return r;const i=j({},r),o=e.components[n].defaultProps;let a;for(a in o)i[a]===void 0&&(i[a]=o[a]);return i}const jYe=["defaultTheme","withTheme","name"],BYe=["classes"],zYe=(t,e={})=>n=>{const{defaultTheme:r,withTheme:i=!1,name:o}=e,a=Ae(e,jYe);let s=o;const l=$Ye(t,j({defaultTheme:r,Component:n,name:o||n.displayName,classNamePrefix:s},a)),c=M.forwardRef(function(f,d){const h=Ae(f,BYe),p=l(j({},n.defaultProps,f));let m,g=h;return(typeof o=="string"||i)&&(m=Jce()||r,o&&(g=FYe({theme:m,name:o,props:h})),i&&!g.theme&&(g.theme=m)),w.jsx(n,j({ref:d,classes:p},g))});return PL(c,n),c},UYe=t=>({components:{MuiLocalizationProvider:{defaultProps:{localeText:j({},t)}}}}),lue={previousMonth:"Previous month",nextMonth:"Next month",openPreviousView:"open previous view",openNextView:"open next view",calendarViewSwitchingButtonAriaLabel:t=>t==="year"?"year view is open, switch to calendar view":"calendar view is open, switch to year view",inputModeToggleButtonAriaLabel:(t,e)=>t?`text input view is open, go to ${e} view`:`${e} view is open, go to text input view`,start:"Start",end:"End",cancelButtonLabel:"Cancel",clearButtonLabel:"Clear",okButtonLabel:"OK",todayButtonLabel:"Today",datePickerDefaultToolbarTitle:"Select date",dateTimePickerDefaultToolbarTitle:"Select date & time",timePickerDefaultToolbarTitle:"Select time",dateRangePickerDefaultToolbarTitle:"Select date range",clockLabelText:(t,e,n)=>`Select ${t}. ${e===null?"No time selected":`Selected time is ${n.format(e,"fullTime")}`}`,hoursClockNumberText:t=>`${t} hours`,minutesClockNumberText:t=>`${t} minutes`,secondsClockNumberText:t=>`${t} seconds`,openDatePickerDialogue:(t,e)=>t&&e.isValid(e.date(t))?`Choose date, selected date is ${e.format(e.date(t),"fullDate")}`:"Choose date",openTimePickerDialogue:(t,e)=>t&&e.isValid(e.date(t))?`Choose time, selected time is ${e.format(e.date(t),"fullTime")}`:"Choose time",timeTableLabel:"pick time",dateTableLabel:"pick date"},WYe=lue;UYe(lue);const cue=M.createContext(null);function VYe(t){const e=qe({props:t,name:"MuiLocalizationProvider"}),{children:n,dateAdapter:r,dateFormats:i,dateLibInstance:o,locale:a,adapterLocale:s,localeText:l}=e,c=M.useMemo(()=>new r({locale:s??a,formats:i,instance:o}),[r,a,s,i,o]),u=M.useMemo(()=>({minDate:c.date("1900-01-01T00:00:00.000"),maxDate:c.date("2099-12-31T00:00:00.000")}),[c]),f=M.useMemo(()=>({utils:c,defaultDates:u,localeText:j({},WYe,l??{})}),[u,c,l]);return w.jsx(cue.Provider,{value:f,children:n})}var K3={exports:{}};(function(t,e){Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0;var n=function(l,c){switch(l){case"P":return c.date({width:"short"});case"PP":return c.date({width:"medium"});case"PPP":return c.date({width:"long"});case"PPPP":default:return c.date({width:"full"})}},r=function(l,c){switch(l){case"p":return c.time({width:"short"});case"pp":return c.time({width:"medium"});case"ppp":return c.time({width:"long"});case"pppp":default:return c.time({width:"full"})}},i=function(l,c){var u=l.match(/(P+)(p+)?/)||[],f=u[1],d=u[2];if(!d)return n(l,c);var h;switch(f){case"P":h=c.dateTime({width:"short"});break;case"PP":h=c.dateTime({width:"medium"});break;case"PPP":h=c.dateTime({width:"long"});break;case"PPPP":default:h=c.dateTime({width:"full"});break}return h.replace("{{date}}",n(f,c)).replace("{{time}}",r(d,c))},o={p:r,P:i},a=o;e.default=a,t.exports=e.default})(K3,K3.exports);var GYe=K3.exports;const uue=$t(GYe),HYe={dayOfMonth:"d",fullDate:"PP",fullDateWithWeekday:"PPPP",fullDateTime:"PP p",fullDateTime12h:"PP hh:mm aaa",fullDateTime24h:"PP HH:mm",fullTime:"p",fullTime12h:"hh:mm aaa",fullTime24h:"HH:mm",hours12h:"hh",hours24h:"HH",keyboardDate:"P",keyboardDateTime:"P p",keyboardDateTime12h:"P hh:mm aaa",keyboardDateTime24h:"P HH:mm",minutes:"mm",month:"LLLL",monthAndDate:"MMMM d",monthAndYear:"LLLL yyyy",monthShort:"MMM",weekday:"EEEE",weekdayShort:"EEE",normalDate:"d MMMM",normalDateWithWeekday:"EEE, MMM d",seconds:"ss",shortDate:"MMM d",year:"yyyy"};class qYe{constructor({locale:e,formats:n}={}){this.lib="date-fns",this.is12HourCycleInCurrentLocale=()=>{var r;return this.locale?/a/.test((r=this.locale.formatLong)===null||r===void 0?void 0:r.time()):!0},this.getFormatHelperText=r=>{var i,o;const a=/P+p+|P+|p+|''|'(''|[^'])+('|$)|./g,s=this.locale||w2;return(o=(i=r.match(a))===null||i===void 0?void 0:i.map(l=>{const c=l[0];if(c==="p"||c==="P"){const u=uue[c];return u(l,s.formatLong,{})}return l}).join("").replace(/(aaa|aa|a)/g,"(a|p)m").toLocaleLowerCase())!==null&&o!==void 0?o:r},this.parseISO=r=>Pae(r),this.toISO=r=>C4e(r,{format:"extended"}),this.getCurrentLocaleCode=()=>{var r;return((r=this.locale)===null||r===void 0?void 0:r.code)||"en-US"},this.addSeconds=(r,i)=>hze(r,i),this.addMinutes=(r,i)=>dze(r,i),this.addHours=(r,i)=>sze(r,i),this.addDays=(r,i)=>x3(r,i),this.addWeeks=(r,i)=>pze(r,i),this.addMonths=(r,i)=>IC(r,i),this.addYears=(r,i)=>lH(r,i),this.isValid=r=>fae(this.date(r)),this.getDiff=(r,i,o)=>{var a;const s=(a=this.date(i))!==null&&a!==void 0?a:r;if(!this.isValid(s))return 0;switch(o){case"years":return Eze(r,s);case"quarters":return Oze(r,s);case"months":return hae(r,s);case"weeks":return Tze(r,s);case"days":return dae(r,s);case"hours":return _ze(r,s);case"minutes":return wze(r,s);case"seconds":return Cze(r,s);default:return _2(r,s)}},this.isAfter=(r,i)=>IS(r,i),this.isBefore=(r,i)=>am(r,i),this.startOfDay=r=>ov(r),this.endOfDay=r=>b3(r),this.getHours=r=>P4e(r),this.setHours=(r,i)=>KUe(r,i),this.setMinutes=(r,i)=>ZUe(r,i),this.getSeconds=r=>A4e(r),this.setSeconds=(r,i)=>JUe(r,i),this.isSameDay=(r,i)=>gze(r,i),this.isSameMonth=(r,i)=>AUe(r,i),this.isSameYear=(r,i)=>RUe(r,i),this.isSameHour=(r,i)=>kUe(r,i),this.startOfYear=r=>RS(r),this.endOfYear=r=>JA(r),this.startOfMonth=r=>AS(r),this.endOfMonth=r=>_3(r),this.startOfWeek=r=>ZA(r,{locale:this.locale}),this.endOfWeek=r=>eR(r,{locale:this.locale}),this.getYear=r=>R4e(r),this.setYear=(r,i)=>e6e(r,i),this.date=r=>typeof r>"u"?new Date:r===null?null:new Date(r),this.toJsDate=r=>r,this.parse=(r,i)=>r===""?null:PUe(r,i,new Date,{locale:this.locale}),this.format=(r,i)=>this.formatByString(r,this.formats[i]),this.formatByString=(r,i)=>w4e(r,i,{locale:this.locale}),this.isEqual=(r,i)=>r===null&&i===null?!0:I4e(r,i),this.isNull=r=>r===null,this.isAfterDay=(r,i)=>IS(r,b3(i)),this.isBeforeDay=(r,i)=>am(r,ov(i)),this.isBeforeYear=(r,i)=>am(r,RS(i)),this.isAfterYear=(r,i)=>IS(r,JA(i)),this.isWithinRange=(r,[i,o])=>IUe(r,{start:i,end:o}),this.formatNumber=r=>r,this.getMinutes=r=>M4e(r),this.getDate=r=>T4e(r),this.setDate=(r,i)=>YUe(r,i),this.getMonth=r=>k4e(r),this.getDaysInMonth=r=>_ae(r),this.setMonth=(r,i)=>QUe(r,i),this.getMeridiemText=r=>r==="am"?"AM":"PM",this.getNextMonth=r=>IC(r,1),this.getPreviousMonth=r=>IC(r,-1),this.getMonthArray=r=>{const o=[RS(r)];for(;o.length<12;){const a=o[o.length-1];o.push(this.getNextMonth(a))}return o},this.mergeDateAndTime=(r,i)=>this.setSeconds(this.setMinutes(this.setHours(r,this.getHours(i)),this.getMinutes(i)),this.getSeconds(i)),this.getWeekdays=()=>{const r=new Date;return Pze({start:ZA(r,{locale:this.locale}),end:eR(r,{locale:this.locale})}).map(i=>this.formatByString(i,"EEEEEE"))},this.getWeekArray=r=>{const i=ZA(AS(r),{locale:this.locale}),o=eR(_3(r),{locale:this.locale});let a=0,s=i;const l=[];let c=null;for(;am(s,o);){const u=Math.floor(a/7);l[u]=l[u]||[];const f=E4e(s);c!==f&&(c=f,l[u].push(s),a+=1),s=x3(s,1)}return l},this.getYearRange=(r,i)=>{const o=RS(r),a=JA(i),s=[];let l=o;for(;am(l,a);)s.push(l),l=lH(l,1);return s},this.locale=e,this.formats=Object.assign({},HYe,n)}isBeforeMonth(e,n){return am(e,AS(n))}isAfterMonth(e,n){return IS(e,AS(n))}}const XYe={y:"year",yy:"year",yyy:"year",yyyy:"year",MMMM:"month",MM:"month",DD:"day",d:"day",dd:"day",H:"hour",HH:"hour",h:"hour",hh:"hour",mm:"minute",ss:"second",a:"am-pm",aa:"am-pm",aaa:"am-pm"};class QYe extends qYe{constructor(...e){super(...e),this.formatTokenMap=XYe,this.expandFormat=n=>{const r=/P+p+|P+|p+|''|'(''|[^'])+('|$)|./g;return n.match(r).map(i=>{const o=i[0];if(o==="p"||o==="P"){const a=uue[o],s=this.locale||w2;return a(i,s.formatLong,{})}return i}).join("")},this.getFormatHelperText=n=>this.expandFormat(n).replace(/(aaa|aa|a)/g,"(a|p)m").toLocaleLowerCase()}}const uw=()=>{const t=M.useContext(cue);if(t===null)throw new Error("MUI: Can not find utils in context. It looks like you forgot to wrap your component in LocalizationProvider, or pass dateAdapter prop directly.");return t},Sr=()=>uw().utils,q2=()=>uw().defaultDates,Cd=()=>uw().localeText,fw=()=>{const t=Sr();return M.useRef(t.date()).current},Jx=({date:t,disableFuture:e,disablePast:n,maxDate:r,minDate:i,isDateDisabled:o,utils:a})=>{const s=a.startOfDay(a.date());n&&a.isBefore(i,s)&&(i=s),e&&a.isAfter(r,s)&&(r=s);let l=t,c=t;for(a.isBefore(t,i)&&(l=a.date(i),c=null),a.isAfter(t,r)&&(c&&(c=a.date(r)),l=null);l||c;){if(l&&a.isAfter(l,r)&&(l=null),c&&a.isBefore(c,i)&&(c=null),l){if(!o(l))return l;l=a.addDays(l,1)}if(c){if(!o(c))return c;c=a.addDays(c,-1)}}return null},YYe=(t,e)=>{const n=t.date(e);return t.isValid(n)?n:null},tc=(t,e,n)=>{if(e==null)return n;const r=t.date(e);return t.isValid(r)?r:n};function fue(t,e){var n,r,i,o,a;const s=qe({props:t,name:e}),l=Sr(),c=q2(),u=(n=s.ampm)!=null?n:l.is12HourCycleInCurrentLocale();if(s.orientation!=null&&s.orientation!=="portrait")throw new Error("We are not supporting custom orientation for DateTimePicker yet :(");return j({ampm:u,orientation:"portrait",openTo:"day",views:["year","day","hours","minutes"],ampmInClock:!0,acceptRegex:u?/[\dap]/gi:/\d/gi,disableMaskedInput:!1,inputFormat:u?l.formats.keyboardDateTime12h:l.formats.keyboardDateTime24h,disableIgnoringDatePartForTimeValidation:!!(s.minDateTime||s.maxDateTime),disablePast:!1,disableFuture:!1},s,{minDate:tc(l,(r=s.minDateTime)!=null?r:s.minDate,c.minDate),maxDate:tc(l,(i=s.maxDateTime)!=null?i:s.maxDate,c.maxDate),minTime:(o=s.minDateTime)!=null?o:s.minTime,maxTime:(a=s.maxDateTime)!=null?a:s.maxTime})}const due={emptyValue:null,getTodayValue:t=>t.date(),parseInput:YYe,areValuesEqual:(t,e,n)=>t.isEqual(e,n)},KYe=t=>{switch(t){case"year":case"month":case"day":return"calendar";default:return"clock"}};function hue(t){var e,n,r="";if(typeof t=="string"||typeof t=="number")r+=t;else if(typeof t=="object")if(Array.isArray(t))for(e=0;e<t.length;e++)t[e]&&(n=hue(t[e]))&&(r&&(r+=" "),r+=n);else for(e in t)t[e]&&(r&&(r+=" "),r+=e);return r}function Vr(){for(var t,e,n=0,r="";n<arguments.length;)(t=arguments[n++])&&(e=hue(t))&&(r&&(r+=" "),r+=e);return r}function ZYe(t){return We("PrivatePickersToolbarText",t)}const P9=Ve("PrivatePickersToolbarText",["root","selected"]),JYe=["className","selected","value"],eKe=t=>{const{classes:e,selected:n}=t;return Ue({root:["root",n&&"selected"]},ZYe,e)},tKe=we(At,{name:"PrivatePickersToolbarText",slot:"Root",overridesResolver:(t,e)=>[e.root,{[`&.${P9.selected}`]:e.selected}]})(({theme:t})=>({transition:t.transitions.create("color"),color:t.palette.text.secondary,[`&.${P9.selected}`]:{color:t.palette.text.primary}})),pue=M.forwardRef(function(e,n){const{className:r,value:i}=e,o=Ae(e,JYe),a=eKe(e);return w.jsx(tKe,j({ref:n,className:Vr(r,a.root),component:"span"},o,{children:i}))}),nKe=ni(w.jsx("path",{d:"M7 10l5 5 5-5z"}),"ArrowDropDown"),rKe=ni(w.jsx("path",{d:"M15.41 16.59L10.83 12l4.58-4.59L14 6l-6 6 6 6 1.41-1.41z"}),"ArrowLeft"),iKe=ni(w.jsx("path",{d:"M8.59 16.59L13.17 12 8.59 7.41 10 6l6 6-6 6-1.41-1.41z"}),"ArrowRight"),mue=ni(w.jsx("path",{d:"M17 12h-5v5h5v-5zM16 1v2H8V1H6v2H5c-1.11 0-1.99.9-1.99 2L3 19c0 1.1.89 2 2 2h14c1.1 0 2-.9 2-2V5c0-1.1-.9-2-2-2h-1V1h-2zm3 18H5V8h14v11z"}),"Calendar"),oKe=ni(w.jsxs(M.Fragment,{children:[w.jsx("path",{d:"M11.99 2C6.47 2 2 6.48 2 12s4.47 10 9.99 10C17.52 22 22 17.52 22 12S17.52 2 11.99 2zM12 20c-4.42 0-8-3.58-8-8s3.58-8 8-8 8 3.58 8 8-3.58 8-8 8z"}),w.jsx("path",{d:"M12.5 7H11v6l5.25 3.15.75-1.23-4.5-2.67z"})]}),"Clock"),aKe=ni(w.jsx("path",{d:"M9 11H7v2h2v-2zm4 0h-2v2h2v-2zm4 0h-2v2h2v-2zm2-7h-1V2h-2v2H8V2H6v2H5c-1.11 0-1.99.9-1.99 2L3 20c0 1.1.89 2 2 2h14c1.1 0 2-.9 2-2V6c0-1.1-.9-2-2-2zm0 16H5V9h14v11z"}),"DateRange"),sKe=ni(w.jsx("path",{d:"M3 17.25V21h3.75L17.81 9.94l-3.75-3.75L3 17.25zM20.71 7.04c.39-.39.39-1.02 0-1.41l-2.34-2.34a.9959.9959 0 00-1.41 0l-1.83 1.83 3.75 3.75 1.83-1.83z"}),"Pen"),lKe=ni(w.jsxs(M.Fragment,{children:[w.jsx("path",{d:"M11.99 2C6.47 2 2 6.48 2 12s4.47 10 9.99 10C17.52 22 22 17.52 22 12S17.52 2 11.99 2zM12 20c-4.42 0-8-3.58-8-8s3.58-8 8-8 8 3.58 8 8-3.58 8-8 8z"}),w.jsx("path",{d:"M12.5 7H11v6l5.25 3.15.75-1.23-4.5-2.67z"})]}),"Time");function gue(t){return We("MuiPickersToolbar",t)}const vue=Ve("MuiPickersToolbar",["root","content","penIconButton","penIconButtonLandscape"]),cKe=t=>{const{classes:e,isLandscape:n}=t;return Ue({root:["root"],content:["content"],penIconButton:["penIconButton",n&&"penIconButtonLandscape"]},gue,e)},uKe=we("div",{name:"MuiPickersToolbar",slot:"Root",overridesResolver:(t,e)=>e.root})(({theme:t,ownerState:e})=>j({display:"flex",flexDirection:"column",alignItems:"flex-start",justifyContent:"space-between",padding:t.spacing(2,3)},e.isLandscape&&{height:"auto",maxWidth:160,padding:16,justifyContent:"flex-start",flexWrap:"wrap"})),fKe=we(MC,{name:"MuiPickersToolbar",slot:"Content",overridesResolver:(t,e)=>e.content})(({ownerState:t})=>j({flex:1},!t.isLandscape&&{alignItems:"center"})),dKe=we(Ot,{name:"MuiPickersToolbar",slot:"PenIconButton",overridesResolver:(t,e)=>[{[`&.${vue.penIconButtonLandscape}`]:e.penIconButtonLandscape},e.penIconButton]})({}),hKe=t=>t==="clock"?w.jsx(oKe,{color:"inherit"}):w.jsx(mue,{color:"inherit"}),pKe=M.forwardRef(function(e,n){const r=qe({props:e,name:"MuiPickersToolbar"}),{children:i,className:o,getMobileKeyboardInputViewButtonText:a,isLandscape:s,isMobileKeyboardViewOpen:l,landscapeDirection:c="column",toggleMobileKeyboardView:u,toolbarTitle:f,viewType:d="calendar"}=r,h=r,p=Cd(),m=cKe(h);return w.jsxs(uKe,{ref:n,className:Vr(m.root,o),ownerState:h,children:[w.jsx(At,{color:"text.secondary",variant:"overline",children:f}),w.jsxs(fKe,{container:!0,justifyContent:"space-between",className:m.content,ownerState:h,direction:s?c:"row",alignItems:s?"flex-start":"flex-end",children:[i,w.jsx(dKe,{onClick:u,className:m.penIconButton,ownerState:h,color:"inherit","aria-label":a?a(l,d):p.inputModeToggleButtonAriaLabel(l,d),children:l?hKe(d):w.jsx(sKe,{color:"inherit"})})]})]})}),mKe=["align","className","selected","typographyClassName","value","variant"],gKe=t=>{const{classes:e}=t;return Ue({root:["root"]},gue,e)},vKe=we(tr,{name:"MuiPickersToolbarButton",slot:"Root",overridesResolver:(t,e)=>e.root})({padding:0,minWidth:16,textTransform:"none"}),M0=M.forwardRef(function(e,n){const r=qe({props:e,name:"MuiPickersToolbarButton"}),{align:i,className:o,selected:a,typographyClassName:s,value:l,variant:c}=r,u=Ae(r,mKe),f=gKe(r);return w.jsx(vKe,j({variant:"text",ref:n,className:Vr(o,f.root)},u,{children:w.jsx(pue,{align:i,className:s,variant:c,value:l,selected:a})}))});function yKe(t){return We("MuiDateTimePickerToolbar",t)}Ve("MuiDateTimePickerToolbar",["root","dateContainer","timeContainer","separator"]);const xKe=["ampm","parsedValue","isMobileKeyboardViewOpen","onChange","openView","setOpenView","toggleMobileKeyboardView","toolbarFormat","toolbarPlaceholder","toolbarTitle","views"],bKe=t=>{const{classes:e}=t;return Ue({root:["root"],dateContainer:["dateContainer"],timeContainer:["timeContainer"],separator:["separator"]},yKe,e)},_Ke=we(pKe,{name:"MuiDateTimePickerToolbar",slot:"Root",overridesResolver:(t,e)=>e.root})(({theme:t})=>({paddingLeft:16,paddingRight:16,justifyContent:"space-around",position:"relative",[`& .${vue.penIconButton}`]:j({position:"absolute",top:8},t.direction==="rtl"?{left:8}:{right:8})})),wKe=we("div",{name:"MuiDateTimePickerToolbar",slot:"DateContainer",overridesResolver:(t,e)=>e.dateContainer})({display:"flex",flexDirection:"column",alignItems:"flex-start"}),SKe=we("div",{name:"MuiDateTimePickerToolbar",slot:"TimeContainer",overridesResolver:(t,e)=>e.timeContainer})({display:"flex"}),M9=we(pue,{name:"MuiDateTimePickerToolbar",slot:"Separator",overridesResolver:(t,e)=>e.separator})({margin:"0 4px 0 2px",cursor:"default"});function yue(t){const e=qe({props:t,name:"MuiDateTimePickerToolbar"}),{ampm:n,parsedValue:r,isMobileKeyboardViewOpen:i,openView:o,setOpenView:a,toggleMobileKeyboardView:s,toolbarFormat:l,toolbarPlaceholder:c="––",toolbarTitle:u,views:f}=e,d=Ae(e,xKe),h=e,p=Sr(),m=Cd(),g=bKe(h),v=u??m.dateTimePickerDefaultToolbarTitle,y=b=>n?p.format(b,"hours12h"):p.format(b,"hours24h"),x=M.useMemo(()=>r?l?p.formatByString(r,l):p.format(r,"shortDate"):c,[r,l,c,p]);return w.jsxs(_Ke,j({toolbarTitle:v,isMobileKeyboardViewOpen:i,toggleMobileKeyboardView:s,className:g.root,viewType:KYe(o)},d,{isLandscape:!1,ownerState:h,children:[w.jsxs(wKe,{className:g.dateContainer,ownerState:h,children:[f.includes("year")&&w.jsx(M0,{tabIndex:-1,variant:"subtitle1",onClick:()=>a("year"),selected:o==="year",value:r?p.format(r,"year"):"–"}),f.includes("day")&&w.jsx(M0,{tabIndex:-1,variant:"h4",onClick:()=>a("day"),selected:o==="day",value:x})]}),w.jsxs(SKe,{className:g.timeContainer,ownerState:h,children:[f.includes("hours")&&w.jsx(M0,{variant:"h3",onClick:()=>a("hours"),selected:o==="hours",value:r?y(r):"--"}),f.includes("minutes")&&w.jsxs(M.Fragment,{children:[w.jsx(M9,{variant:"h3",value:":",className:g.separator,ownerState:h}),w.jsx(M0,{variant:"h3",onClick:()=>a("minutes"),selected:o==="minutes",value:r?p.format(r,"minutes"):"--"})]}),f.includes("seconds")&&w.jsxs(M.Fragment,{children:[w.jsx(M9,{variant:"h3",value:":",className:g.separator,ownerState:h}),w.jsx(M0,{variant:"h3",onClick:()=>a("seconds"),selected:o==="seconds",value:r?p.format(r,"seconds"):"--"})]})]})]}))}const Td=M.createContext(null),OKe=["onAccept","onClear","onCancel","onSetToday","actions"],xue=t=>{const{onAccept:e,onClear:n,onCancel:r,onSetToday:i,actions:o}=t,a=Ae(t,OKe),s=M.useContext(Td),l=Cd(),c=typeof o=="function"?o(s):o;if(c==null||c.length===0)return null;const u=c==null?void 0:c.map(f=>{switch(f){case"clear":return w.jsx(tr,{onClick:n,children:l.clearButtonLabel},f);case"cancel":return w.jsx(tr,{onClick:r,children:l.cancelButtonLabel},f);case"accept":return w.jsx(tr,{onClick:e,children:l.okButtonLabel},f);case"today":return w.jsx(tr,{onClick:i,children:l.todayButtonLabel},f);default:return null}});return w.jsx(Tp,j({},a,{children:u}))};function CKe(t){return We("MuiPickersPopper",t)}Ve("MuiPickersPopper",["root","paper"]);function bue(t,e){return Array.isArray(e)?e.every(n=>t.indexOf(n)!==-1):t.indexOf(e)!==-1}const _ue=(t,e)=>n=>{(n.key==="Enter"||n.key===" ")&&(t(n),n.preventDefault(),n.stopPropagation())},wue=(t=document)=>{const e=t.activeElement;return e?e.shadowRoot?wue(e.shadowRoot):e:null},TKe=["onClick","onTouchStart"],EKe=t=>{const{classes:e}=t;return Ue({root:["root"],paper:["paper"]},CKe,e)},PKe=we(_5,{name:"MuiPickersPopper",slot:"Root",overridesResolver:(t,e)=>e.root})(({theme:t})=>({zIndex:t.zIndex.modal})),MKe=we(Ho,{name:"MuiPickersPopper",slot:"Paper",overridesResolver:(t,e)=>e.paper})(({ownerState:t})=>j({transformOrigin:"top center",outline:0},t.placement==="top"&&{transformOrigin:"bottom center"}));function kKe(t,e){return e.documentElement.clientWidth<t.clientX||e.documentElement.clientHeight<t.clientY}function AKe(t,e){const n=M.useRef(!1),r=M.useRef(!1),i=M.useRef(null),o=M.useRef(!1);M.useEffect(()=>{if(!t)return;function l(){o.current=!0}return document.addEventListener("mousedown",l,!0),document.addEventListener("touchstart",l,!0),()=>{document.removeEventListener("mousedown",l,!0),document.removeEventListener("touchstart",l,!0),o.current=!1}},[t]);const a=_r(l=>{if(!o.current)return;const c=r.current;r.current=!1;const u=$n(i.current);if(!i.current||"clientX"in l&&kKe(l,u))return;if(n.current){n.current=!1;return}let f;l.composedPath?f=l.composedPath().indexOf(i.current)>-1:f=!u.documentElement.contains(l.target)||i.current.contains(l.target),!f&&!c&&e(l)}),s=()=>{r.current=!0};return M.useEffect(()=>{if(t){const l=$n(i.current),c=()=>{n.current=!0};return l.addEventListener("touchstart",a),l.addEventListener("touchmove",c),()=>{l.removeEventListener("touchstart",a),l.removeEventListener("touchmove",c)}}},[t,a]),M.useEffect(()=>{if(t){const l=$n(i.current);return l.addEventListener("click",a),()=>{l.removeEventListener("click",a),r.current=!1}}},[t,a]),[i,s,s]}function RKe(t){var e;const n=qe({props:t,name:"MuiPickersPopper"}),{anchorEl:r,children:i,containerRef:o=null,onBlur:a,onClose:s,onClear:l,onAccept:c,onCancel:u,onSetToday:f,open:d,PopperProps:h,role:p,TransitionComponent:m=ev,TrapFocusProps:g,PaperProps:v={},components:y,componentsProps:x}=n;M.useEffect(()=>{function W($){d&&($.key==="Escape"||$.key==="Esc")&&s()}return document.addEventListener("keydown",W),()=>{document.removeEventListener("keydown",W)}},[s,d]);const b=M.useRef(null);M.useEffect(()=>{p!=="tooltip"&&(d?b.current=wue(document):b.current&&b.current instanceof HTMLElement&&setTimeout(()=>{b.current instanceof HTMLElement&&b.current.focus()}))},[d,p]);const[_,S,O]=AKe(d,a??s),C=M.useRef(null),E=Zt(C,o),k=Zt(E,_),I=n,P=EKe(I),{onClick:R,onTouchStart:T}=v,L=Ae(v,TKe),z=W=>{W.key==="Escape"&&(W.stopPropagation(),s())},B=(e=y==null?void 0:y.ActionBar)!=null?e:xue,U=(y==null?void 0:y.PaperContent)||M.Fragment;return w.jsx(PKe,j({transition:!0,role:p,open:d,anchorEl:r,onKeyDown:z,className:P.root},h,{children:({TransitionProps:W,placement:$})=>w.jsx(Ore,j({open:d,disableAutoFocus:!0,disableRestoreFocus:!0,disableEnforceFocus:p==="tooltip",isEnabled:()=>!0},g,{children:w.jsx(m,j({},W,{children:w.jsx(MKe,j({tabIndex:-1,elevation:8,ref:k,onClick:N=>{S(N),R&&R(N)},onTouchStart:N=>{O(N),T&&T(N)},ownerState:j({},I,{placement:$}),className:P.paper},L,{children:w.jsxs(U,j({},x==null?void 0:x.paperContent,{children:[i,w.jsx(B,j({onAccept:c,onClear:l,onCancel:u,onSetToday:f,actions:[]},x==null?void 0:x.actionBar))]}))}))}))}))}))}function IKe(t){const{children:e,DateInputProps:n,KeyboardDateInputComponent:r,onClear:i,onDismiss:o,onCancel:a,onAccept:s,onSetToday:l,open:c,PopperProps:u,PaperProps:f,TransitionComponent:d,components:h,componentsProps:p}=t,m=M.useRef(null),g=Zt(n.inputRef,m);return w.jsxs(Td.Provider,{value:"desktop",children:[w.jsx(r,j({},n,{inputRef:g})),w.jsx(RKe,{role:"dialog",open:c,anchorEl:m.current,TransitionComponent:d,PopperProps:u,PaperProps:f,onClose:o,onCancel:a,onClear:i,onAccept:s,onSetToday:l,components:h,componentsProps:p,children:e})]})}function Uz({onChange:t,onViewChange:e,openTo:n,view:r,views:i}){var o,a;const[s,l]=Qs({name:"Picker",state:"view",controlled:r,default:n&&bue(i,n)?n:i[0]}),c=(o=i[i.indexOf(s)-1])!=null?o:null,u=(a=i[i.indexOf(s)+1])!=null?a:null,f=M.useCallback(p=>{l(p),e&&e(p)},[l,e]),d=M.useCallback(()=>{u&&f(u)},[u,f]);return{handleChangeAndOpenNext:M.useCallback((p,m)=>{const g=m==="finish";t(p,g&&u?"partial":m),g&&d()},[u,t,d]),nextView:u,previousView:c,openNext:d,openView:s,setOpenView:f}}const sv=220,Uf=36,Jb={x:sv/2,y:sv/2},Sue={x:Jb.x,y:0},DKe=Sue.x-Jb.x,LKe=Sue.y-Jb.y,NKe=t=>t*(180/Math.PI),Oue=(t,e,n)=>{const r=e-Jb.x,i=n-Jb.y,o=Math.atan2(DKe,LKe)-Math.atan2(r,i);let a=NKe(o);a=Math.round(a/t)*t,a%=360;const s=Math.floor(a/t)||0,l=r**2+i**2,c=Math.sqrt(l);return{value:s,distance:c}},$Ke=(t,e,n=1)=>{const r=n*6;let{value:i}=Oue(r,t,e);return i=i*n%60,i},FKe=(t,e,n)=>{const{value:r,distance:i}=Oue(30,t,e);let o=r||12;return n?o%=12:i<sv/2-Uf&&(o+=12,o%=24),o};function jKe(t){return We("MuiClockPointer",t)}Ve("MuiClockPointer",["root","thumb"]);const BKe=["className","hasSelected","isInner","type","value"],zKe=t=>{const{classes:e}=t;return Ue({root:["root"],thumb:["thumb"]},jKe,e)},UKe=we("div",{name:"MuiClockPointer",slot:"Root",overridesResolver:(t,e)=>e.root})(({theme:t,ownerState:e})=>j({width:2,backgroundColor:t.palette.primary.main,position:"absolute",left:"calc(50% - 1px)",bottom:"50%",transformOrigin:"center bottom 0px"},e.shouldAnimate&&{transition:t.transitions.create(["transform","height"])})),WKe=we("div",{name:"MuiClockPointer",slot:"Thumb",overridesResolver:(t,e)=>e.thumb})(({theme:t,ownerState:e})=>j({width:4,height:4,backgroundColor:t.palette.primary.contrastText,borderRadius:"50%",position:"absolute",top:-21,left:`calc(50% - ${Uf/2}px)`,border:`${(Uf-4)/2}px solid ${t.palette.primary.main}`,boxSizing:"content-box"},e.hasSelected&&{backgroundColor:t.palette.primary.main}));function VKe(t){const e=qe({props:t,name:"MuiClockPointer"}),{className:n,isInner:r,type:i,value:o}=e,a=Ae(e,BKe),s=M.useRef(i);M.useEffect(()=>{s.current=i},[i]);const l=j({},e,{shouldAnimate:s.current!==i}),c=zKe(l),u=()=>{let d=360/(i==="hours"?12:60)*o;return i==="hours"&&o>12&&(d-=360),{height:Math.round((r?.26:.4)*sv),transform:`rotateZ(${d}deg)`}};return w.jsx(UKe,j({style:u(),className:Vr(n,c.root),ownerState:l},a,{children:w.jsx(WKe,{ownerState:l,className:c.thumb})}))}function GKe(t){return We("MuiClock",t)}Ve("MuiClock",["root","clock","wrapper","squareMask","pin","amButton","pmButton"]);const HKe=t=>{const{classes:e}=t;return Ue({root:["root"],clock:["clock"],wrapper:["wrapper"],squareMask:["squareMask"],pin:["pin"],amButton:["amButton"],pmButton:["pmButton"]},GKe,e)},qKe=we("div",{name:"MuiClock",slot:"Root",overridesResolver:(t,e)=>e.root})(({theme:t})=>({display:"flex",justifyContent:"center",alignItems:"center",margin:t.spacing(2)})),XKe=we("div",{name:"MuiClock",slot:"Clock",overridesResolver:(t,e)=>e.clock})({backgroundColor:"rgba(0,0,0,.07)",borderRadius:"50%",height:220,width:220,flexShrink:0,position:"relative",pointerEvents:"none"}),QKe=we("div",{name:"MuiClock",slot:"Wrapper",overridesResolver:(t,e)=>e.wrapper})({"&:focus":{outline:"none"}}),YKe=we("div",{name:"MuiClock",slot:"SquareMask",overridesResolver:(t,e)=>e.squareMask})(({ownerState:t})=>j({width:"100%",height:"100%",position:"absolute",pointerEvents:"auto",outline:0,touchAction:"none",userSelect:"none"},t.disabled?{}:{"@media (pointer: fine)":{cursor:"pointer",borderRadius:"50%"},"&:active":{cursor:"move"}})),KKe=we("div",{name:"MuiClock",slot:"Pin",overridesResolver:(t,e)=>e.pin})(({theme:t})=>({width:6,height:6,borderRadius:"50%",backgroundColor:t.palette.primary.main,position:"absolute",top:"50%",left:"50%",transform:"translate(-50%, -50%)"})),ZKe=we(Ot,{name:"MuiClock",slot:"AmButton",overridesResolver:(t,e)=>e.amButton})(({theme:t,ownerState:e})=>j({zIndex:1,position:"absolute",bottom:e.ampmInClock?64:8,left:8},e.meridiemMode==="am"&&{backgroundColor:t.palette.primary.main,color:t.palette.primary.contrastText,"&:hover":{backgroundColor:t.palette.primary.light}})),JKe=we(Ot,{name:"MuiClock",slot:"PmButton",overridesResolver:(t,e)=>e.pmButton})(({theme:t,ownerState:e})=>j({zIndex:1,position:"absolute",bottom:e.ampmInClock?64:8,right:8},e.meridiemMode==="pm"&&{backgroundColor:t.palette.primary.main,color:t.palette.primary.contrastText,"&:hover":{backgroundColor:t.palette.primary.light}}));function eZe(t){const e=qe({props:t,name:"MuiClock"}),{ampm:n,ampmInClock:r,autoFocus:i,children:o,date:a,getClockLabelText:s,handleMeridiemChange:l,isTimeDisabled:c,meridiemMode:u,minutesStep:f=1,onChange:d,selectedId:h,type:p,value:m,disabled:g,readOnly:v,className:y}=e,x=e,b=Sr(),_=M.useContext(Td),S=M.useRef(!1),O=HKe(x),C=c(m,p),E=!n&&p==="hours"&&(m<1||m>12),k=($,N)=>{g||v||c($,p)||d($,N)},I=($,N)=>{let{offsetX:D,offsetY:A}=$;if(D===void 0){const Y=$.target.getBoundingClientRect();D=$.changedTouches[0].clientX-Y.left,A=$.changedTouches[0].clientY-Y.top}const q=p==="seconds"||p==="minutes"?$Ke(D,A,f):FKe(D,A,!!n);k(q,N)},P=$=>{S.current=!0,I($,"shallow")},R=$=>{S.current&&(I($,"finish"),S.current=!1)},T=$=>{$.buttons>0&&I($.nativeEvent,"shallow")},L=$=>{S.current&&(S.current=!1),I($.nativeEvent,"finish")},z=M.useMemo(()=>p==="hours"?!0:m%5===0,[p,m]),B=p==="minutes"?f:1,U=M.useRef(null);Hr(()=>{i&&U.current.focus()},[i]);const W=$=>{if(!S.current)switch($.key){case"Home":k(0,"partial"),$.preventDefault();break;case"End":k(p==="minutes"?59:23,"partial"),$.preventDefault();break;case"ArrowUp":k(m+B,"partial"),$.preventDefault();break;case"ArrowDown":k(m-B,"partial"),$.preventDefault();break}};return w.jsxs(qKe,{className:Vr(y,O.root),children:[w.jsxs(XKe,{className:O.clock,children:[w.jsx(YKe,{onTouchMove:P,onTouchEnd:R,onMouseUp:L,onMouseMove:T,ownerState:{disabled:g},className:O.squareMask}),!C&&w.jsxs(M.Fragment,{children:[w.jsx(KKe,{className:O.pin}),a&&w.jsx(VKe,{type:p,value:m,isInner:E,hasSelected:z})]}),w.jsx(QKe,{"aria-activedescendant":h,"aria-label":s(p,a,b),ref:U,role:"listbox",onKeyDown:W,tabIndex:0,className:O.wrapper,children:o})]}),n&&(_==="desktop"||r)&&w.jsxs(M.Fragment,{children:[w.jsx(ZKe,{onClick:v?void 0:()=>l("am"),disabled:g||u===null,ownerState:x,className:O.amButton,children:w.jsx(At,{variant:"caption",children:"AM"})}),w.jsx(JKe,{disabled:g||u===null,onClick:v?void 0:()=>l("pm"),ownerState:x,className:O.pmButton,children:w.jsx(At,{variant:"caption",children:"PM"})})]})]})}const Cue=t=>()=>{};function tZe(t){return We("MuiClockNumber",t)}const jS=Ve("MuiClockNumber",["root","selected","disabled"]),nZe=["className","disabled","index","inner","label","selected"],rZe=t=>{const{classes:e,selected:n,disabled:r}=t;return Ue({root:["root",n&&"selected",r&&"disabled"]},tZe,e)},iZe=we("span",{name:"MuiClockNumber",slot:"Root",overridesResolver:(t,e)=>[e.root,{[`&.${jS.disabled}`]:e.disabled},{[`&.${jS.selected}`]:e.selected}]})(({theme:t,ownerState:e})=>j({height:Uf,width:Uf,position:"absolute",left:`calc((100% - ${Uf}px) / 2)`,display:"inline-flex",justifyContent:"center",alignItems:"center",borderRadius:"50%",color:t.palette.text.primary,fontFamily:t.typography.fontFamily,"&:focused":{backgroundColor:t.palette.background.paper},[`&.${jS.selected}`]:{color:t.palette.primary.contrastText},[`&.${jS.disabled}`]:{pointerEvents:"none",color:t.palette.text.disabled}},e.inner&&j({},t.typography.body2,{color:t.palette.text.secondary})));function Tue(t){const e=qe({props:t,name:"MuiClockNumber"}),{className:n,disabled:r,index:i,inner:o,label:a,selected:s}=e,l=Ae(e,nZe),c=e,u=rZe(c),f=i%12/12*Math.PI*2-Math.PI/2,d=(sv-Uf-2)/2*(o?.65:1),h=Math.round(Math.cos(f)*d),p=Math.round(Math.sin(f)*d);return w.jsx(iZe,j({className:Vr(n,u.root),"aria-disabled":r?!0:void 0,"aria-selected":s?!0:void 0,role:"option",style:{transform:`translate(${h}px, ${p+(sv-Uf)/2}px`},ownerState:c},l,{children:a}))}const oZe=({ampm:t,date:e,getClockNumberText:n,isDisabled:r,selectedId:i,utils:o})=>{const a=e?o.getHours(e):null,s=[],l=t?1:0,c=t?12:23,u=f=>a===null?!1:t?f===12?a===12||a===0:a===f||a-12===f:a===f;for(let f=l;f<=c;f+=1){let d=f.toString();f===0&&(d="00");const h=!t&&(f===0||f>12);d=o.formatNumber(d);const p=u(f);s.push(w.jsx(Tue,{id:p?i:void 0,index:f,inner:h,selected:p,disabled:r(f),label:d,"aria-label":n(d)},f))}return s},k9=({utils:t,value:e,isDisabled:n,getClockNumberText:r,selectedId:i})=>{const o=t.formatNumber;return[[5,o("05")],[10,o("10")],[15,o("15")],[20,o("20")],[25,o("25")],[30,o("30")],[35,o("35")],[40,o("40")],[45,o("45")],[50,o("50")],[55,o("55")],[0,o("00")]].map(([a,s],l)=>{const c=a===e;return w.jsx(Tue,{label:s,id:c?i:void 0,index:l+1,inner:!1,disabled:n(a),selected:c,"aria-label":r(s)},a)})};function aZe(t){return We("MuiPickersArrowSwitcher",t)}Ve("MuiPickersArrowSwitcher",["root","spacer","button"]);const sZe=["children","className","components","componentsProps","isLeftDisabled","isLeftHidden","isRightDisabled","isRightHidden","leftArrowButtonText","onLeftClick","onRightClick","rightArrowButtonText"],lZe=t=>{const{classes:e}=t;return Ue({root:["root"],spacer:["spacer"],button:["button"]},aZe,e)},cZe=we("div",{name:"MuiPickersArrowSwitcher",slot:"Root",overridesResolver:(t,e)=>e.root})({display:"flex"}),uZe=we("div",{name:"MuiPickersArrowSwitcher",slot:"Spacer",overridesResolver:(t,e)=>e.spacer})(({theme:t})=>({width:t.spacing(3)})),A9=we(Ot,{name:"MuiPickersArrowSwitcher",slot:"Button",overridesResolver:(t,e)=>e.button})(({ownerState:t})=>j({},t.hidden&&{visibility:"hidden"})),Eue=M.forwardRef(function(e,n){const r=qe({props:e,name:"MuiPickersArrowSwitcher"}),{children:i,className:o,components:a,componentsProps:s,isLeftDisabled:l,isLeftHidden:c,isRightDisabled:u,isRightHidden:f,leftArrowButtonText:d,onLeftClick:h,onRightClick:p,rightArrowButtonText:m}=r,g=Ae(r,sZe),y=Go().direction==="rtl",x=(s==null?void 0:s.leftArrowButton)||{},b=(a==null?void 0:a.LeftArrowIcon)||rKe,_=(s==null?void 0:s.rightArrowButton)||{},S=(a==null?void 0:a.RightArrowIcon)||iKe,O=r,C=lZe(O);return w.jsxs(cZe,j({ref:n,className:Vr(C.root,o),ownerState:O},g,{children:[w.jsx(A9,j({as:a==null?void 0:a.LeftArrowButton,size:"small","aria-label":d,title:d,disabled:l,edge:"end",onClick:h},x,{className:Vr(C.button,x.className),ownerState:j({},O,x,{hidden:c}),children:y?w.jsx(S,{}):w.jsx(b,{})})),i?w.jsx(At,{variant:"subtitle1",component:"span",children:i}):w.jsx(uZe,{className:C.spacer,ownerState:O}),w.jsx(A9,j({as:a==null?void 0:a.RightArrowButton,size:"small","aria-label":m,title:m,edge:"start",disabled:u,onClick:p},_,{className:Vr(C.button,_.className),ownerState:j({},O,_,{hidden:f}),children:y?w.jsx(b,{}):w.jsx(S,{})}))]}))}),fZe=(t,e)=>t?e.getHours(t)>=12?"pm":"am":null,Z3=(t,e,n)=>n&&(t>=12?"pm":"am")!==e?e==="am"?t-12:t+12:t,dZe=(t,e,n,r)=>{const i=Z3(r.getHours(t),e,n);return r.setHours(t,i)},R9=(t,e)=>e.getHours(t)*3600+e.getMinutes(t)*60+e.getSeconds(t),Pue=(t=!1,e)=>(n,r)=>t?e.isAfter(n,r):R9(n,e)>R9(r,e);function hZe(t,{disableFuture:e,maxDate:n}){const r=Sr();return M.useMemo(()=>{const i=r.date(),o=r.startOfMonth(e&&r.isBefore(i,n)?i:n);return!r.isAfter(o,t)},[e,n,t,r])}function pZe(t,{disablePast:e,minDate:n}){const r=Sr();return M.useMemo(()=>{const i=r.date(),o=r.startOfMonth(e&&r.isAfter(i,n)?i:n);return!r.isBefore(o,t)},[e,n,t,r])}function mZe(t,e,n){const r=Sr(),i=fZe(t,r),o=M.useCallback(a=>{const s=t==null?null:dZe(t,a,!!e,r);n(s,"partial")},[e,t,n,r]);return{meridiemMode:i,handleMeridiemChange:o}}function gZe(t){return We("MuiClockPicker",t)}Ve("MuiClockPicker",["root","arrowSwitcher"]);const J3=36,Wz=2,Mue=320,vZe=358,Vz=we("div")({overflowX:"hidden",width:Mue,maxHeight:vZe,display:"flex",flexDirection:"column",margin:"0 auto"}),yZe=t=>{const{classes:e}=t;return Ue({root:["root"],arrowSwitcher:["arrowSwitcher"]},gZe,e)},xZe=we(Vz,{name:"MuiClockPicker",slot:"Root",overridesResolver:(t,e)=>e.root})({display:"flex",flexDirection:"column"}),bZe=we(Eue,{name:"MuiClockPicker",slot:"ArrowSwitcher",overridesResolver:(t,e)=>e.arrowSwitcher})({position:"absolute",right:12,top:15}),_Ze=Cue(),wZe=M.forwardRef(function(e,n){const r=qe({props:e,name:"MuiClockPicker"}),{ampm:i=!1,ampmInClock:o=!1,autoFocus:a,components:s,componentsProps:l,date:c,disableIgnoringDatePartForTimeValidation:u,getClockLabelText:f,getHoursClockNumberText:d,getMinutesClockNumberText:h,getSecondsClockNumberText:p,leftArrowButtonText:m,maxTime:g,minTime:v,minutesStep:y=1,rightArrowButtonText:x,shouldDisableTime:b,showViewSwitcher:_,onChange:S,view:O,views:C=["hours","minutes"],openTo:E,onViewChange:k,className:I,disabled:P,readOnly:R}=r;_Ze({leftArrowButtonText:m,rightArrowButtonText:x,getClockLabelText:f,getHoursClockNumberText:d,getMinutesClockNumberText:h,getSecondsClockNumberText:p});const T=Cd(),L=m??T.openPreviousView,z=x??T.openNextView,B=f??T.clockLabelText,U=d??T.hoursClockNumberText,W=h??T.minutesClockNumberText,$=p??T.secondsClockNumberText,{openView:N,setOpenView:D,nextView:A,previousView:q,handleChangeAndOpenNext:Y}=Uz({view:O,views:C,openTo:E,onViewChange:k,onChange:S}),K=fw(),se=Sr(),te=M.useMemo(()=>c||se.setSeconds(se.setMinutes(se.setHours(K,0),0),0),[c,K,se]),{meridiemMode:J,handleMeridiemChange:pe}=mZe(te,i,Y),be=M.useCallback((le,Q)=>{const X=Pue(u,se),ee=({start:ye,end:H})=>!(v&&X(v,H)||g&&X(ye,g)),ge=(ye,H=1)=>ye%H!==0?!1:b?!b(ye,Q):!0;switch(Q){case"hours":{const ye=Z3(le,J,i),H=se.setHours(te,ye),G=se.setSeconds(se.setMinutes(H,0),0),ie=se.setSeconds(se.setMinutes(H,59),59);return!ee({start:G,end:ie})||!ge(ye)}case"minutes":{const ye=se.setMinutes(te,le),H=se.setSeconds(ye,0),G=se.setSeconds(ye,59);return!ee({start:H,end:G})||!ge(le,y)}case"seconds":{const ye=se.setSeconds(te,le);return!ee({start:ye,end:ye})||!ge(le)}default:throw new Error("not supported")}},[i,te,u,g,J,v,y,b,se]),re=pd(),ve=M.useMemo(()=>{switch(N){case"hours":{const le=(Q,X)=>{const ee=Z3(Q,J,i);Y(se.setHours(te,ee),X)};return{onChange:le,value:se.getHours(te),children:oZe({date:c,utils:se,ampm:i,onChange:le,getClockNumberText:U,isDisabled:Q=>P||be(Q,"hours"),selectedId:re})}}case"minutes":{const le=se.getMinutes(te),Q=(X,ee)=>{Y(se.setMinutes(te,X),ee)};return{value:le,onChange:Q,children:k9({utils:se,value:le,onChange:Q,getClockNumberText:W,isDisabled:X=>P||be(X,"minutes"),selectedId:re})}}case"seconds":{const le=se.getSeconds(te),Q=(X,ee)=>{Y(se.setSeconds(te,X),ee)};return{value:le,onChange:Q,children:k9({utils:se,value:le,onChange:Q,getClockNumberText:$,isDisabled:X=>P||be(X,"seconds"),selectedId:re})}}default:throw new Error("You must provide the type for ClockView")}},[N,se,c,i,U,W,$,J,Y,te,be,re,P]),F=r,ce=yZe(F);return w.jsxs(xZe,{ref:n,className:Vr(ce.root,I),ownerState:F,children:[_&&w.jsx(bZe,{className:ce.arrowSwitcher,leftArrowButtonText:L,rightArrowButtonText:z,components:s,componentsProps:l,onLeftClick:()=>D(q),onRightClick:()=>D(A),isLeftDisabled:!q,isRightDisabled:!A,ownerState:F}),w.jsx(eZe,j({autoFocus:a,date:c,ampmInClock:o,type:N,ampm:i,getClockLabelText:B,minutesStep:y,isTimeDisabled:be,meridiemMode:J,handleMeridiemChange:pe,selectedId:re,disabled:P,readOnly:R},ve))]})});function SZe(t){return We("PrivatePickersMonth",t)}const I9=Ve("PrivatePickersMonth",["root","selected"]),OZe=["disabled","onSelect","selected","value","tabIndex","hasFocus","onFocus","onBlur"],CZe=t=>{const{classes:e,selected:n}=t;return Ue({root:["root",n&&"selected"]},SZe,e)},TZe=we(At,{name:"PrivatePickersMonth",slot:"Root",overridesResolver:(t,e)=>[e.root,{[`&.${I9.selected}`]:e.selected}]})(({theme:t})=>j({flex:"1 0 33.33%",display:"flex",alignItems:"center",justifyContent:"center",color:"unset",backgroundColor:"transparent",border:0,outline:0},t.typography.subtitle1,{margin:"8px 0",height:36,borderRadius:18,cursor:"pointer","&:focus, &:hover":{backgroundColor:Hc(t.palette.action.active,t.palette.action.hoverOpacity)},"&:disabled":{pointerEvents:"none",color:t.palette.text.secondary},[`&.${I9.selected}`]:{color:t.palette.primary.contrastText,backgroundColor:t.palette.primary.main,"&:focus, &:hover":{backgroundColor:t.palette.primary.dark}}})),D9=()=>{},EZe=t=>{const{disabled:e,onSelect:n,selected:r,value:i,tabIndex:o,hasFocus:a,onFocus:s=D9,onBlur:l=D9}=t,c=Ae(t,OZe),u=CZe(t),f=()=>{n(i)},d=M.useRef(null);return Hr(()=>{if(a){var h;(h=d.current)==null||h.focus()}},[a]),w.jsx(TZe,j({ref:d,component:"button",type:"button",className:u.root,tabIndex:o,onClick:f,onKeyDown:_ue(f),color:r?"primary":void 0,variant:r?"h5":"subtitle1",disabled:e,onFocus:h=>s(h,i),onBlur:h=>l(h,i)},c))};function PZe(t){return We("MuiMonthPicker",t)}Ve("MuiMonthPicker",["root"]);const MZe=["className","date","disabled","disableFuture","disablePast","maxDate","minDate","onChange","shouldDisableMonth","readOnly","disableHighlightToday","autoFocus","onMonthFocus","hasFocus","onFocusedViewChange"],kZe=t=>{const{classes:e}=t;return Ue({root:["root"]},PZe,e)};function AZe(t,e){const n=Sr(),r=q2(),i=qe({props:t,name:e});return j({disableFuture:!1,disablePast:!1},i,{minDate:tc(n,i.minDate,r.minDate),maxDate:tc(n,i.maxDate,r.maxDate)})}const RZe=we("div",{name:"MuiMonthPicker",slot:"Root",overridesResolver:(t,e)=>e.root})({width:310,display:"flex",flexWrap:"wrap",alignContent:"stretch",margin:"0 4px"}),IZe=M.forwardRef(function(e,n){const r=Sr(),i=fw(),o=AZe(e,"MuiMonthPicker"),{className:a,date:s,disabled:l,disableFuture:c,disablePast:u,maxDate:f,minDate:d,onChange:h,shouldDisableMonth:p,readOnly:m,disableHighlightToday:g,autoFocus:v=!1,onMonthFocus:y,hasFocus:x,onFocusedViewChange:b}=o,_=Ae(o,MZe),S=o,O=kZe(S),C=hd(),E=M.useMemo(()=>s??r.startOfMonth(i),[i,r,s]),k=M.useMemo(()=>s!=null?r.getMonth(s):g?null:r.getMonth(i),[i,s,r,g]),[I,P]=M.useState(()=>k||r.getMonth(i)),R=M.useCallback(A=>{const q=r.startOfMonth(u&&r.isAfter(i,d)?i:d),Y=r.startOfMonth(c&&r.isBefore(i,f)?i:f);return r.isBefore(A,q)||r.isAfter(A,Y)?!0:p?p(A):!1},[c,u,f,d,i,p,r]),T=A=>{if(m)return;const q=r.setMonth(E,A);h(q,"finish")},[L,z]=Qs({name:"MonthPicker",state:"hasFocus",controlled:x,default:v}),B=M.useCallback(A=>{z(A),b&&b(A)},[z,b]),U=M.useCallback(A=>{R(r.setMonth(E,A))||(P(A),B(!0),y&&y(A))},[R,r,E,B,y]);M.useEffect(()=>{P(A=>k!==null&&A!==k?k:A)},[k]);const W=_r(A=>{switch(A.key){case"ArrowUp":U((12+I-3)%12),A.preventDefault();break;case"ArrowDown":U((12+I+3)%12),A.preventDefault();break;case"ArrowLeft":U((12+I+(C.direction==="ltr"?-1:1))%12),A.preventDefault();break;case"ArrowRight":U((12+I+(C.direction==="ltr"?1:-1))%12),A.preventDefault();break}}),$=M.useCallback((A,q)=>{U(q)},[U]),N=M.useCallback(()=>{B(!1)},[B]),D=r.getMonth(i);return w.jsx(RZe,j({ref:n,className:Vr(O.root,a),ownerState:S,onKeyDown:W},_,{children:r.getMonthArray(E).map(A=>{const q=r.getMonth(A),Y=r.format(A,"monthShort"),K=l||R(A);return w.jsx(EZe,{value:q,selected:q===k,tabIndex:q===I&&!K?0:-1,hasFocus:L&&q===I,onSelect:T,onFocus:$,onBlur:N,disabled:K,"aria-current":D===q?"date":void 0,children:Y},Y)})}))});function DZe(t,e,n){const{value:r,onError:i}=t,o=uw(),a=M.useRef(null),s=e({adapter:o,value:r,props:t});return M.useEffect(()=>{i&&!n(s,a.current)&&i(s,r),a.current=s},[n,i,a,s,r]),s}const kue=({props:t,value:e,adapter:n})=>{const r=n.utils.date(),i=n.utils.date(e),o=tc(n.utils,t.minDate,n.defaultDates.minDate),a=tc(n.utils,t.maxDate,n.defaultDates.maxDate);if(i===null)return null;switch(!0){case!n.utils.isValid(e):return"invalidDate";case!!(t.shouldDisableDate&&t.shouldDisableDate(i)):return"shouldDisableDate";case!!(t.disableFuture&&n.utils.isAfterDay(i,r)):return"disableFuture";case!!(t.disablePast&&n.utils.isBeforeDay(i,r)):return"disablePast";case!!(o&&n.utils.isBeforeDay(i,o)):return"minDate";case!!(a&&n.utils.isAfterDay(i,a)):return"maxDate";default:return null}},Aue=({shouldDisableDate:t,minDate:e,maxDate:n,disableFuture:r,disablePast:i})=>{const o=uw();return M.useCallback(a=>kue({adapter:o,value:a,props:{shouldDisableDate:t,minDate:e,maxDate:n,disableFuture:r,disablePast:i}})!==null,[o,t,e,n,r,i])},LZe=(t,e,n)=>(r,i)=>{switch(i.type){case"changeMonth":return j({},r,{slideDirection:i.direction,currentMonth:i.newMonth,isMonthSwitchingAnimating:!t});case"finishMonthSwitchingAnimation":return j({},r,{isMonthSwitchingAnimating:!1});case"changeFocusedDay":{if(r.focusedDay!=null&&i.focusedDay!=null&&n.isSameDay(i.focusedDay,r.focusedDay))return r;const o=i.focusedDay!=null&&!e&&!n.isSameMonth(r.currentMonth,i.focusedDay);return j({},r,{focusedDay:i.focusedDay,isMonthSwitchingAnimating:o&&!t&&!i.withoutMonthSwitchingAnimation,currentMonth:o?n.startOfMonth(i.focusedDay):r.currentMonth,slideDirection:i.focusedDay!=null&&n.isAfterDay(i.focusedDay,r.currentMonth)?"left":"right"})}default:throw new Error("missing support")}},NZe=({date:t,defaultCalendarMonth:e,disableFuture:n,disablePast:r,disableSwitchToMonthOnDayFocus:i=!1,maxDate:o,minDate:a,onMonthChange:s,reduceAnimations:l,shouldDisableDate:c})=>{var u;const f=fw(),d=Sr(),h=M.useRef(LZe(!!l,i,d)).current,[p,m]=M.useReducer(h,{isMonthSwitchingAnimating:!1,focusedDay:t||f,currentMonth:d.startOfMonth((u=t??e)!=null?u:f),slideDirection:"left"}),g=M.useCallback(_=>{m(j({type:"changeMonth"},_)),s&&s(_.newMonth)},[s]),v=M.useCallback(_=>{const S=_??f;d.isSameMonth(S,p.currentMonth)||g({newMonth:d.startOfMonth(S),direction:d.isAfterDay(S,p.currentMonth)?"left":"right"})},[p.currentMonth,g,f,d]),y=Aue({shouldDisableDate:c,minDate:a,maxDate:o,disableFuture:n,disablePast:r}),x=M.useCallback(()=>{m({type:"finishMonthSwitchingAnimation"})},[]),b=M.useCallback((_,S)=>{y(_)||m({type:"changeFocusedDay",focusedDay:_,withoutMonthSwitchingAnimation:S})},[y]);return{calendarState:p,changeMonth:v,changeFocusedDay:b,isDateDisabled:y,onMonthSwitchingAnimationEnd:x,handleChangeMonth:g}},$Ze=t=>We("MuiPickersFadeTransitionGroup",t);Ve("MuiPickersFadeTransitionGroup",["root"]);const FZe=t=>{const{classes:e}=t;return Ue({root:["root"]},$Ze,e)},L9=500,jZe=we(L1,{name:"MuiPickersFadeTransitionGroup",slot:"Root",overridesResolver:(t,e)=>e.root})({display:"block",position:"relative"});function Rue(t){const e=qe({props:t,name:"MuiPickersFadeTransitionGroup"}),{children:n,className:r,reduceAnimations:i,transKey:o}=e,a=FZe(e);return i?n:w.jsx(jZe,{className:Vr(a.root,r),children:w.jsx(ZM,{appear:!1,mountOnEnter:!0,unmountOnExit:!0,timeout:{appear:L9,enter:L9/2,exit:0},children:n},o)})}function BZe(t){return We("MuiPickersDay",t)}const BS=Ve("MuiPickersDay",["root","dayWithMargin","dayOutsideMonth","hiddenDaySpacingFiller","today","selected","disabled"]),zZe=["autoFocus","className","day","disabled","disableHighlightToday","disableMargin","hidden","isAnimating","onClick","onDaySelect","onFocus","onBlur","onKeyDown","onMouseDown","outsideCurrentMonth","selected","showDaysOutsideCurrentMonth","children","today"],UZe=t=>{const{selected:e,disableMargin:n,disableHighlightToday:r,today:i,disabled:o,outsideCurrentMonth:a,showDaysOutsideCurrentMonth:s,classes:l}=t;return Ue({root:["root",e&&"selected",o&&"disabled",!n&&"dayWithMargin",!r&&i&&"today",a&&s&&"dayOutsideMonth",a&&!s&&"hiddenDaySpacingFiller"],hiddenDaySpacingFiller:["hiddenDaySpacingFiller"]},BZe,l)},Iue=({theme:t,ownerState:e})=>j({},t.typography.caption,{width:J3,height:J3,borderRadius:"50%",padding:0,backgroundColor:t.palette.background.paper,color:t.palette.text.primary,"&:hover":{backgroundColor:Hc(t.palette.action.active,t.palette.action.hoverOpacity)},"&:focus":{backgroundColor:Hc(t.palette.action.active,t.palette.action.hoverOpacity),[`&.${BS.selected}`]:{willChange:"background-color",backgroundColor:t.palette.primary.dark}},[`&.${BS.selected}`]:{color:t.palette.primary.contrastText,backgroundColor:t.palette.primary.main,fontWeight:t.typography.fontWeightMedium,transition:t.transitions.create("background-color",{duration:t.transitions.duration.short}),"&:hover":{willChange:"background-color",backgroundColor:t.palette.primary.dark}},[`&.${BS.disabled}`]:{color:t.palette.text.disabled}},!e.disableMargin&&{margin:`0 ${Wz}px`},e.outsideCurrentMonth&&e.showDaysOutsideCurrentMonth&&{color:t.palette.text.secondary},!e.disableHighlightToday&&e.today&&{[`&:not(.${BS.selected})`]:{border:`1px solid ${t.palette.text.secondary}`}}),Due=(t,e)=>{const{ownerState:n}=t;return[e.root,!n.disableMargin&&e.dayWithMargin,!n.disableHighlightToday&&n.today&&e.today,!n.outsideCurrentMonth&&n.showDaysOutsideCurrentMonth&&e.dayOutsideMonth,n.outsideCurrentMonth&&!n.showDaysOutsideCurrentMonth&&e.hiddenDaySpacingFiller]},WZe=we(fs,{name:"MuiPickersDay",slot:"Root",overridesResolver:Due})(Iue),VZe=we("div",{name:"MuiPickersDay",slot:"Root",overridesResolver:Due})(({theme:t,ownerState:e})=>j({},Iue({theme:t,ownerState:e}),{opacity:0,pointerEvents:"none"})),PR=()=>{},GZe=M.forwardRef(function(e,n){const r=qe({props:e,name:"MuiPickersDay"}),{autoFocus:i=!1,className:o,day:a,disabled:s=!1,disableHighlightToday:l=!1,disableMargin:c=!1,isAnimating:u,onClick:f,onDaySelect:d,onFocus:h=PR,onBlur:p=PR,onKeyDown:m=PR,onMouseDown:g,outsideCurrentMonth:v,selected:y=!1,showDaysOutsideCurrentMonth:x=!1,children:b,today:_=!1}=r,S=Ae(r,zZe),O=j({},r,{autoFocus:i,disabled:s,disableHighlightToday:l,disableMargin:c,selected:y,showDaysOutsideCurrentMonth:x,today:_}),C=UZe(O),E=Sr(),k=M.useRef(null),I=Zt(k,n);Hr(()=>{i&&!s&&!u&&!v&&k.current.focus()},[i,s,u,v]);const P=T=>{g&&g(T),v&&T.preventDefault()},R=T=>{s||d(a,"finish"),v&&T.currentTarget.focus(),f&&f(T)};return v&&!x?w.jsx(VZe,{className:Vr(C.root,C.hiddenDaySpacingFiller,o),ownerState:O,role:S.role}):w.jsx(WZe,j({className:Vr(C.root,o),ownerState:O,ref:I,centerRipple:!0,disabled:s,tabIndex:y?0:-1,onKeyDown:T=>m(T,a),onFocus:T=>h(T,a),onBlur:T=>p(T,a),onClick:R,onMouseDown:P},S,{children:b||E.format(a,"dayOfMonth")}))}),HZe=(t,e)=>t.autoFocus===e.autoFocus&&t.isAnimating===e.isAnimating&&t.today===e.today&&t.disabled===e.disabled&&t.selected===e.selected&&t.disableMargin===e.disableMargin&&t.showDaysOutsideCurrentMonth===e.showDaysOutsideCurrentMonth&&t.disableHighlightToday===e.disableHighlightToday&&t.className===e.className&&t.sx===e.sx&&t.outsideCurrentMonth===e.outsideCurrentMonth&&t.onFocus===e.onFocus&&t.onBlur===e.onBlur&&t.onDaySelect===e.onDaySelect,qZe=M.memo(GZe,HZe),XZe=t=>We("PrivatePickersSlideTransition",t),Wi=Ve("PrivatePickersSlideTransition",["root","slideEnter-left","slideEnter-right","slideEnterActive","slideExit","slideExitActiveLeft-left","slideExitActiveLeft-right"]),QZe=["children","className","reduceAnimations","slideDirection","transKey"],YZe=t=>{const{classes:e}=t;return Ue({root:["root"]},XZe,e)},Lue=350,KZe=we(L1,{name:"PrivatePickersSlideTransition",slot:"Root",overridesResolver:(t,e)=>[e.root,{[`.${Wi["slideEnter-left"]}`]:e["slideEnter-left"]},{[`.${Wi["slideEnter-right"]}`]:e["slideEnter-right"]},{[`.${Wi.slideEnterActive}`]:e.slideEnterActive},{[`.${Wi.slideExit}`]:e.slideExit},{[`.${Wi["slideExitActiveLeft-left"]}`]:e["slideExitActiveLeft-left"]},{[`.${Wi["slideExitActiveLeft-right"]}`]:e["slideExitActiveLeft-right"]}]})(({theme:t})=>{const e=t.transitions.create("transform",{duration:Lue,easing:"cubic-bezier(0.35, 0.8, 0.4, 1)"});return{display:"block",position:"relative",overflowX:"hidden","& > *":{position:"absolute",top:0,right:0,left:0},[`& .${Wi["slideEnter-left"]}`]:{willChange:"transform",transform:"translate(100%)",zIndex:1},[`& .${Wi["slideEnter-right"]}`]:{willChange:"transform",transform:"translate(-100%)",zIndex:1},[`& .${Wi.slideEnterActive}`]:{transform:"translate(0%)",transition:e},[`& .${Wi.slideExit}`]:{transform:"translate(0%)"},[`& .${Wi["slideExitActiveLeft-left"]}`]:{willChange:"transform",transform:"translate(-100%)",transition:e,zIndex:0},[`& .${Wi["slideExitActiveLeft-right"]}`]:{willChange:"transform",transform:"translate(100%)",transition:e,zIndex:0}}}),ZZe=t=>{const{children:e,className:n,reduceAnimations:r,slideDirection:i,transKey:o}=t,a=Ae(t,QZe),s=YZe(t);if(r)return w.jsx("div",{className:Vr(s.root,n),children:e});const l={exit:Wi.slideExit,enterActive:Wi.slideEnterActive,enter:Wi[`slideEnter-${i}`],exitActive:Wi[`slideExitActiveLeft-${i}`]};return w.jsx(KZe,{className:Vr(s.root,n),childFactory:c=>M.cloneElement(c,{classNames:l}),role:"presentation",children:w.jsx(c5,j({mountOnEnter:!0,unmountOnExit:!0,timeout:Lue,classNames:l},a,{children:e}),o)})},JZe=t=>We("MuiDayPicker",t);Ve("MuiDayPicker",["header","weekDayLabel","loadingContainer","slideTransition","monthContainer","weekContainer"]);const eJe=t=>{const{classes:e}=t;return Ue({header:["header"],weekDayLabel:["weekDayLabel"],loadingContainer:["loadingContainer"],slideTransition:["slideTransition"],monthContainer:["monthContainer"],weekContainer:["weekContainer"]},JZe,e)},tJe=t=>t.charAt(0).toUpperCase(),Nue=(J3+Wz*2)*6,nJe=we("div",{name:"MuiDayPicker",slot:"Header",overridesResolver:(t,e)=>e.header})({display:"flex",justifyContent:"center",alignItems:"center"}),rJe=we(At,{name:"MuiDayPicker",slot:"WeekDayLabel",overridesResolver:(t,e)=>e.weekDayLabel})(({theme:t})=>({width:36,height:40,margin:"0 2px",textAlign:"center",display:"flex",justifyContent:"center",alignItems:"center",color:t.palette.text.secondary})),iJe=we("div",{name:"MuiDayPicker",slot:"LoadingContainer",overridesResolver:(t,e)=>e.loadingContainer})({display:"flex",justifyContent:"center",alignItems:"center",minHeight:Nue}),oJe=we(ZZe,{name:"MuiDayPicker",slot:"SlideTransition",overridesResolver:(t,e)=>e.slideTransition})({minHeight:Nue}),aJe=we("div",{name:"MuiDayPicker",slot:"MonthContainer",overridesResolver:(t,e)=>e.monthContainer})({overflow:"hidden"}),sJe=we("div",{name:"MuiDayPicker",slot:"WeekContainer",overridesResolver:(t,e)=>e.weekContainer})({margin:`${Wz}px 0`,display:"flex",justifyContent:"center"});function lJe(t){const e=fw(),n=Sr(),r=qe({props:t,name:"MuiDayPicker"}),i=eJe(r),{onFocusedDayChange:o,className:a,currentMonth:s,selectedDays:l,disabled:c,disableHighlightToday:u,focusedDay:f,isMonthSwitchingAnimating:d,loading:h,onSelectedDaysChange:p,onMonthSwitchingAnimationEnd:m,readOnly:g,reduceAnimations:v,renderDay:y,renderLoading:x=()=>w.jsx("span",{children:"..."}),showDaysOutsideCurrentMonth:b,slideDirection:_,TransitionProps:S,disablePast:O,disableFuture:C,minDate:E,maxDate:k,shouldDisableDate:I,dayOfWeekFormatter:P=tJe,hasFocus:R,onFocusedViewChange:T,gridLabelId:L}=r,z=Aue({shouldDisableDate:I,minDate:E,maxDate:k,disablePast:O,disableFuture:C}),[B,U]=M.useState(()=>f||e),W=M.useCallback(re=>{T&&T(re)},[T]),$=M.useCallback((re,ve="finish")=>{g||p(re,ve)},[p,g]),N=M.useCallback(re=>{z(re)||(o(re),U(re),W(!0))},[z,o,W]),D=Go();function A(re,ve){switch(re.key){case"ArrowUp":N(n.addDays(ve,-7)),re.preventDefault();break;case"ArrowDown":N(n.addDays(ve,7)),re.preventDefault();break;case"ArrowLeft":{const F=n.addDays(ve,D.direction==="ltr"?-1:1),ce=D.direction==="ltr"?n.getPreviousMonth(ve):n.getNextMonth(ve),le=Jx({utils:n,date:F,minDate:D.direction==="ltr"?n.startOfMonth(ce):F,maxDate:D.direction==="ltr"?F:n.endOfMonth(ce),isDateDisabled:z});N(le||F),re.preventDefault();break}case"ArrowRight":{const F=n.addDays(ve,D.direction==="ltr"?1:-1),ce=D.direction==="ltr"?n.getNextMonth(ve):n.getPreviousMonth(ve),le=Jx({utils:n,date:F,minDate:D.direction==="ltr"?F:n.startOfMonth(ce),maxDate:D.direction==="ltr"?n.endOfMonth(ce):F,isDateDisabled:z});N(le||F),re.preventDefault();break}case"Home":N(n.startOfWeek(ve)),re.preventDefault();break;case"End":N(n.endOfWeek(ve)),re.preventDefault();break;case"PageUp":N(n.getNextMonth(ve)),re.preventDefault();break;case"PageDown":N(n.getPreviousMonth(ve)),re.preventDefault();break}}function q(re,ve){N(ve)}function Y(re,ve){R&&n.isSameDay(B,ve)&&W(!1)}const K=n.getMonth(s),se=l.filter(re=>!!re).map(re=>n.startOfDay(re)),te=K,J=M.useMemo(()=>M.createRef(),[te]),pe=n.startOfWeek(e),be=M.useMemo(()=>{const re=n.startOfMonth(s),ve=n.endOfMonth(s);return z(B)||n.isAfterDay(B,ve)||n.isBeforeDay(B,re)?Jx({utils:n,date:B,minDate:re,maxDate:ve,disablePast:O,disableFuture:C,isDateDisabled:z}):B},[s,C,O,B,z,n]);return w.jsxs("div",{role:"grid","aria-labelledby":L,children:[w.jsx(nJe,{role:"row",className:i.header,children:n.getWeekdays().map((re,ve)=>{var F;return w.jsx(rJe,{variant:"caption",role:"columnheader","aria-label":n.format(n.addDays(pe,ve),"weekday"),className:i.weekDayLabel,children:(F=P==null?void 0:P(re))!=null?F:re},re+ve.toString())})}),h?w.jsx(iJe,{className:i.loadingContainer,children:x()}):w.jsx(oJe,j({transKey:te,onExited:m,reduceAnimations:v,slideDirection:_,className:Vr(a,i.slideTransition)},S,{nodeRef:J,children:w.jsx(aJe,{ref:J,role:"rowgroup",className:i.monthContainer,children:n.getWeekArray(s).map(re=>w.jsx(sJe,{role:"row",className:i.weekContainer,children:re.map(ve=>{const F=be!==null&&n.isSameDay(ve,be),ce=se.some(X=>n.isSameDay(X,ve)),le=n.isSameDay(ve,e),Q={key:ve==null?void 0:ve.toString(),day:ve,isAnimating:d,disabled:c||z(ve),autoFocus:R&&F,today:le,outsideCurrentMonth:n.getMonth(ve)!==K,selected:ce,disableHighlightToday:u,showDaysOutsideCurrentMonth:b,onKeyDown:A,onFocus:q,onBlur:Y,onDaySelect:$,tabIndex:F?0:-1,role:"gridcell","aria-selected":ce};return le&&(Q["aria-current"]="date"),y?y(ve,se,Q):M.createElement(qZe,j({},Q,{key:Q.key}))})},`week-${re[0]}`))})}))]})}const cJe=t=>We("MuiPickersCalendarHeader",t);Ve("MuiPickersCalendarHeader",["root","labelContainer","label","switchViewButton","switchViewIcon"]);const uJe=t=>{const{classes:e}=t;return Ue({root:["root"],labelContainer:["labelContainer"],label:["label"],switchViewButton:["switchViewButton"],switchViewIcon:["switchViewIcon"]},cJe,e)},fJe=we("div",{name:"MuiPickersCalendarHeader",slot:"Root",overridesResolver:(t,e)=>e.root})({display:"flex",alignItems:"center",marginTop:16,marginBottom:8,paddingLeft:24,paddingRight:12,maxHeight:30,minHeight:30}),dJe=we("div",{name:"MuiPickersCalendarHeader",slot:"LabelContainer",overridesResolver:(t,e)=>e.labelContainer})(({theme:t})=>j({display:"flex",maxHeight:30,overflow:"hidden",alignItems:"center",cursor:"pointer",marginRight:"auto"},t.typography.body1,{fontWeight:t.typography.fontWeightMedium})),hJe=we("div",{name:"MuiPickersCalendarHeader",slot:"Label",overridesResolver:(t,e)=>e.label})({marginRight:6}),pJe=we(Ot,{name:"MuiPickersCalendarHeader",slot:"SwitchViewButton",overridesResolver:(t,e)=>e.switchViewButton})({marginRight:"auto"}),mJe=we(nKe,{name:"MuiPickersCalendarHeader",slot:"SwitchViewIcon",overridesResolver:(t,e)=>e.switchViewIcon})(({theme:t,ownerState:e})=>j({willChange:"transform",transition:t.transitions.create("transform"),transform:"rotate(0deg)"},e.openView==="year"&&{transform:"rotate(180deg)"})),gJe=Cue();function vJe(t){const e=qe({props:t,name:"MuiPickersCalendarHeader"}),{components:n={},componentsProps:r={},currentMonth:i,disabled:o,disableFuture:a,disablePast:s,getViewSwitchingButtonText:l,leftArrowButtonText:c,maxDate:u,minDate:f,onMonthChange:d,onViewChange:h,openView:p,reduceAnimations:m,rightArrowButtonText:g,views:v,labelId:y}=e;gJe({leftArrowButtonText:c,rightArrowButtonText:g,getViewSwitchingButtonText:l});const x=Cd(),b=c??x.previousMonth,_=g??x.nextMonth,S=l??x.calendarViewSwitchingButtonAriaLabel,O=Sr(),C=uJe(e),E=r.switchViewButton||{},k=()=>d(O.getNextMonth(i),"left"),I=()=>d(O.getPreviousMonth(i),"right"),P=hZe(i,{disableFuture:a,maxDate:u}),R=pZe(i,{disablePast:s,minDate:f}),T=()=>{if(!(v.length===1||!h||o))if(v.length===2)h(v.find(z=>z!==p)||v[0]);else{const z=v.indexOf(p)!==0?0:1;h(v[z])}};if(v.length===1&&v[0]==="year")return null;const L=e;return w.jsxs(fJe,{ownerState:L,className:C.root,children:[w.jsxs(dJe,{role:"presentation",onClick:T,ownerState:L,"aria-live":"polite",className:C.labelContainer,children:[w.jsx(Rue,{reduceAnimations:m,transKey:O.format(i,"monthAndYear"),children:w.jsx(hJe,{id:y,ownerState:L,className:C.label,children:O.format(i,"monthAndYear")})}),v.length>1&&!o&&w.jsx(pJe,j({size:"small",as:n.SwitchViewButton,"aria-label":S(p),className:C.switchViewButton},E,{children:w.jsx(mJe,{as:n.SwitchViewIcon,ownerState:L,className:C.switchViewIcon})}))]}),w.jsx(ZM,{in:p==="day",children:w.jsx(Eue,{leftArrowButtonText:b,rightArrowButtonText:_,components:n,componentsProps:r,onLeftClick:I,onRightClick:k,isLeftDisabled:R,isRightDisabled:P})})]})}function yJe(t){return We("PrivatePickersYear",t)}const rg=Ve("PrivatePickersYear",["root","modeDesktop","modeMobile","yearButton","selected","disabled"]),xJe=["autoFocus","className","children","disabled","onClick","onKeyDown","value","tabIndex","onFocus","onBlur"],bJe=t=>{const{wrapperVariant:e,disabled:n,selected:r,classes:i}=t,o={root:["root",e&&`mode${De(e)}`],yearButton:["yearButton",n&&"disabled",r&&"selected"]};return Ue(o,yJe,i)},_Je=we("div",{name:"PrivatePickersYear",slot:"Root",overridesResolver:(t,e)=>[e.root,{[`&.${rg.modeDesktop}`]:e.modeDesktop},{[`&.${rg.modeMobile}`]:e.modeMobile}]})(({ownerState:t})=>j({flexBasis:"33.3%",display:"flex",alignItems:"center",justifyContent:"center"},(t==null?void 0:t.wrapperVariant)==="desktop"&&{flexBasis:"25%"})),wJe=we("button",{name:"PrivatePickersYear",slot:"Button",overridesResolver:(t,e)=>[e.button,{[`&.${rg.disabled}`]:e.disabled},{[`&.${rg.selected}`]:e.selected}]})(({theme:t})=>j({color:"unset",backgroundColor:"transparent",border:0,outline:0},t.typography.subtitle1,{margin:"8px 0",height:36,width:72,borderRadius:18,cursor:"pointer","&:focus, &:hover":{backgroundColor:Hc(t.palette.action.active,t.palette.action.hoverOpacity)},[`&.${rg.disabled}`]:{color:t.palette.text.secondary},[`&.${rg.selected}`]:{color:t.palette.primary.contrastText,backgroundColor:t.palette.primary.main,"&:focus, &:hover":{backgroundColor:t.palette.primary.dark}}})),N9=()=>{},SJe=M.forwardRef(function(e,n){const{autoFocus:r,className:i,children:o,disabled:a,onClick:s,onKeyDown:l,value:c,tabIndex:u,onFocus:f=N9,onBlur:d=N9}=e,h=Ae(e,xJe),p=M.useRef(null),m=Zt(p,n),g=M.useContext(Td),v=j({},e,{wrapperVariant:g}),y=bJe(v);return M.useEffect(()=>{r&&p.current.focus()},[r]),w.jsx(_Je,{className:Vr(y.root,i),ownerState:v,children:w.jsx(wJe,j({ref:m,disabled:a,type:"button",tabIndex:a?-1:u,onClick:x=>s(x,c),onKeyDown:x=>l(x,c),onFocus:x=>f(x,c),onBlur:x=>d(x,c),className:y.yearButton,ownerState:v},h,{children:o}))})});function OJe(t){return We("MuiYearPicker",t)}Ve("MuiYearPicker",["root"]);const CJe=t=>{const{classes:e}=t;return Ue({root:["root"]},OJe,e)};function TJe(t,e){const n=Sr(),r=q2(),i=qe({props:t,name:e});return j({disablePast:!1,disableFuture:!1},i,{minDate:tc(n,i.minDate,r.minDate),maxDate:tc(n,i.maxDate,r.maxDate)})}const EJe=we("div",{name:"MuiYearPicker",slot:"Root",overridesResolver:(t,e)=>e.root})({display:"flex",flexDirection:"row",flexWrap:"wrap",overflowY:"auto",height:"100%",padding:"0 4px",maxHeight:"304px"}),PJe=M.forwardRef(function(e,n){const r=fw(),i=Go(),o=Sr(),a=TJe(e,"MuiYearPicker"),{autoFocus:s,className:l,date:c,disabled:u,disableFuture:f,disablePast:d,maxDate:h,minDate:p,onChange:m,readOnly:g,shouldDisableYear:v,disableHighlightToday:y,onYearFocus:x,hasFocus:b,onFocusedViewChange:_}=a,S=a,O=CJe(S),C=M.useMemo(()=>c??o.startOfYear(r),[r,o,c]),E=M.useMemo(()=>c!=null?o.getYear(c):y?null:o.getYear(r),[r,c,o,y]),k=M.useContext(Td),I=M.useRef(null),[P,R]=M.useState(()=>E||o.getYear(r)),[T,L]=Qs({name:"YearPicker",state:"hasFocus",controlled:b,default:s}),z=M.useCallback(se=>{L(se),_&&_(se)},[L,_]),B=M.useCallback(se=>!!(d&&o.isBeforeYear(se,r)||f&&o.isAfterYear(se,r)||p&&o.isBeforeYear(se,p)||h&&o.isAfterYear(se,h)||v&&v(se)),[f,d,h,p,r,v,o]),U=(se,te,J="finish")=>{if(g)return;const pe=o.setYear(C,te);m(pe,J)},W=M.useCallback(se=>{B(o.setYear(C,se))||(R(se),z(!0),x==null||x(se))},[B,o,C,z,x]);M.useEffect(()=>{R(se=>E!==null&&se!==E?E:se)},[E]);const $=k==="desktop"?4:3,N=M.useCallback((se,te)=>{switch(se.key){case"ArrowUp":W(te-$),se.preventDefault();break;case"ArrowDown":W(te+$),se.preventDefault();break;case"ArrowLeft":W(te+(i.direction==="ltr"?-1:1)),se.preventDefault();break;case"ArrowRight":W(te+(i.direction==="ltr"?1:-1)),se.preventDefault();break}},[W,i.direction,$]),D=M.useCallback((se,te)=>{W(te)},[W]),A=M.useCallback((se,te)=>{P===te&&z(!1)},[P,z]),q=o.getYear(r),Y=M.useRef(null),K=Zt(n,Y);return M.useEffect(()=>{if(s||Y.current===null)return;const se=Y.current.querySelector('[tabindex="0"]');if(!se)return;const te=se.offsetHeight,J=se.offsetTop,pe=Y.current.clientHeight,be=Y.current.scrollTop,re=J+te;te>pe||J<be||(Y.current.scrollTop=re-pe/2-te/2)},[s]),w.jsx(EJe,{ref:K,className:Vr(O.root,l),ownerState:S,children:o.getYearRange(p,h).map(se=>{const te=o.getYear(se),J=te===E;return w.jsx(SJe,{selected:J,value:te,onClick:U,onKeyDown:N,autoFocus:T&&te===P,ref:J?I:void 0,disabled:u||B(se),tabIndex:te===P?0:-1,onFocus:D,onBlur:A,"aria-current":q===te?"date":void 0,children:o.format(se,"year")},o.format(se,"year"))})})}),MJe=typeof navigator<"u"&&/(android)/i.test(navigator.userAgent),kJe=t=>We("MuiCalendarPicker",t);Ve("MuiCalendarPicker",["root","viewTransitionContainer"]);const AJe=["autoFocus","onViewChange","date","disableFuture","disablePast","defaultCalendarMonth","onChange","onYearChange","onMonthChange","reduceAnimations","shouldDisableDate","shouldDisableMonth","shouldDisableYear","view","views","openTo","className","disabled","readOnly","minDate","maxDate","disableHighlightToday","focusedView","onFocusedViewChange","classes"],RJe=t=>{const{classes:e}=t;return Ue({root:["root"],viewTransitionContainer:["viewTransitionContainer"]},kJe,e)};function IJe(t,e){const n=Sr(),r=q2(),i=qe({props:t,name:e});return j({loading:!1,disablePast:!1,disableFuture:!1,openTo:"day",views:["year","day"],reduceAnimations:MJe,renderLoading:()=>w.jsx("span",{children:"..."})},i,{minDate:tc(n,i.minDate,r.minDate),maxDate:tc(n,i.maxDate,r.maxDate)})}const DJe=we(Vz,{name:"MuiCalendarPicker",slot:"Root",overridesResolver:(t,e)=>e.root})({display:"flex",flexDirection:"column"}),LJe=we(Rue,{name:"MuiCalendarPicker",slot:"ViewTransitionContainer",overridesResolver:(t,e)=>e.viewTransitionContainer})({}),NJe=M.forwardRef(function(e,n){const r=Sr(),i=pd(),o=IJe(e,"MuiCalendarPicker"),{autoFocus:a,onViewChange:s,date:l,disableFuture:c,disablePast:u,defaultCalendarMonth:f,onChange:d,onYearChange:h,onMonthChange:p,reduceAnimations:m,shouldDisableDate:g,shouldDisableMonth:v,shouldDisableYear:y,view:x,views:b,openTo:_,className:S,disabled:O,readOnly:C,minDate:E,maxDate:k,disableHighlightToday:I,focusedView:P,onFocusedViewChange:R}=o,T=Ae(o,AJe),{openView:L,setOpenView:z,openNext:B}=Uz({view:x,views:b,openTo:_,onChange:d,onViewChange:s}),{calendarState:U,changeFocusedDay:W,changeMonth:$,handleChangeMonth:N,isDateDisabled:D,onMonthSwitchingAnimationEnd:A}=NZe({date:l,defaultCalendarMonth:f,reduceAnimations:m,onMonthChange:p,minDate:E,maxDate:k,shouldDisableDate:g,disablePast:u,disableFuture:c}),q=M.useCallback((ee,ge)=>{const ye=r.startOfMonth(ee),H=r.endOfMonth(ee),G=D(ee)?Jx({utils:r,date:ee,minDate:r.isBefore(E,ye)?ye:E,maxDate:r.isAfter(k,H)?H:k,disablePast:u,disableFuture:c,isDateDisabled:D}):ee;G?(d(G,ge),p==null||p(ye)):(B(),$(ye)),W(G,!0)},[W,c,u,D,k,E,d,p,$,B,r]),Y=M.useCallback((ee,ge)=>{const ye=r.startOfYear(ee),H=r.endOfYear(ee),G=D(ee)?Jx({utils:r,date:ee,minDate:r.isBefore(E,ye)?ye:E,maxDate:r.isAfter(k,H)?H:k,disablePast:u,disableFuture:c,isDateDisabled:D}):ee;G?(d(G,ge),h==null||h(G)):(B(),$(ye)),W(G,!0)},[W,c,u,D,k,E,d,h,B,r,$]),K=M.useCallback((ee,ge)=>d(l&&ee?r.mergeDateAndTime(ee,l):ee,ge),[r,l,d]);M.useEffect(()=>{l&&$(l)},[l]);const se=o,te=RJe(se),J={disablePast:u,disableFuture:c,maxDate:k,minDate:E},pe=O&&l||E,be=O&&l||k,re={disableHighlightToday:I,readOnly:C,disabled:O},ve=`${i}-grid-label`,[F,ce]=Qs({name:"DayPicker",state:"focusedView",controlled:P,default:a?L:null}),le=F!==null,Q=_r(ee=>ge=>{if(R){R(ee)(ge);return}ce(ge?ee:ye=>ye===ee?null:ye)}),X=M.useRef(L);return M.useEffect(()=>{X.current!==L&&(X.current=L,Q(L)(!0))},[L,Q]),w.jsxs(DJe,{ref:n,className:Vr(te.root,S),ownerState:se,children:[w.jsx(vJe,j({},T,{views:b,openView:L,currentMonth:U.currentMonth,onViewChange:z,onMonthChange:(ee,ge)=>N({newMonth:ee,direction:ge}),minDate:pe,maxDate:be,disabled:O,disablePast:u,disableFuture:c,reduceAnimations:m,labelId:ve})),w.jsx(LJe,{reduceAnimations:m,className:te.viewTransitionContainer,transKey:L,ownerState:se,children:w.jsxs("div",{children:[L==="year"&&w.jsx(PJe,j({},T,J,re,{autoFocus:a,date:l,onChange:Y,shouldDisableYear:y,hasFocus:le,onFocusedViewChange:Q("year")})),L==="month"&&w.jsx(IZe,j({},J,re,{autoFocus:a,hasFocus:le,className:S,date:l,onChange:q,shouldDisableMonth:v,onFocusedViewChange:Q("month")})),L==="day"&&w.jsx(lJe,j({},T,U,J,re,{autoFocus:a,onMonthSwitchingAnimationEnd:A,onFocusedDayChange:W,reduceAnimations:m,selectedDays:[l],onSelectedDaysChange:K,shouldDisableDate:g,hasFocus:le,onFocusedViewChange:Q("day"),gridLabelId:ve}))]})})]})}),$Je=t=>{const[,e]=M.useReducer(l=>l+1,0),n=M.useRef(null),{replace:r,append:i}=t,o=r?r(t.format(t.value)):t.format(t.value),a=M.useRef(!1),s=l=>{const c=l.target.value;n.current=[c,l.target,c.length>o.length,a.current,o===t.format(c)],e()};return M.useLayoutEffect(()=>{if(n.current==null)return;let[l,c,u,f,d]=n.current;n.current=null;const h=f&&d,m=l.slice(c.selectionStart).search(t.accept||/\d/g),g=m!==-1?m:0,v=S=>(S.match(t.accept||/\d/g)||[]).join(""),y=v(l.substr(0,c.selectionStart)),x=S=>{let O=0,C=0;for(let E=0;E!==y.length;++E){let k=S.indexOf(y[E],O)+1,I=v(S).indexOf(y[E],C)+1;I-C>1&&(k=O,I=C),C=Math.max(I,C),O=Math.max(O,k)}return O};if(t.mask===!0&&u&&!d){let S=x(l);const O=v(l.substr(S))[0];S=l.indexOf(O,S),l=`${l.substr(0,S)}${l.substr(S+1)}`}let b=t.format(l);i!=null&&c.selectionStart===l.length&&!d&&(u?b=i(b):v(b.slice(-1))===""&&(b=b.slice(0,-1)));const _=r?r(b):b;return o===_?e():t.onChange(_),()=>{let S=x(b);if(t.mask!=null&&(u||f&&!h))for(;b[S]&&v(b[S])==="";)S+=1;c.selectionStart=c.selectionEnd=S+(h?1+g:0)}}),M.useEffect(()=>{const l=u=>{u.code==="Delete"&&(a.current=!0)},c=u=>{u.code==="Delete"&&(a.current=!1)};return document.addEventListener("keydown",l),document.addEventListener("keyup",c),()=>{document.removeEventListener("keydown",l),document.removeEventListener("keyup",c)}},[]),{value:n.current!=null?n.current[0]:o,onChange:s}},eN=(t,e,n)=>{const r=t.date(e);return e===null?"":t.isValid(r)?t.formatByString(r,n):""},uE="_",$ue="2019-11-21T22:30:00.000",Fue="2019-01-01T09:00:00.000";function FJe(t,e,n,r){if(t)return t;const o=r.formatByString(r.date(Fue),e).replace(n,uE),a=r.formatByString(r.date($ue),e).replace(n,"_");return o===a?o:""}function jJe(t,e,n,r){if(!t)return!1;const o=r.formatByString(r.date(Fue),e).replace(n,uE),a=r.formatByString(r.date($ue),e).replace(n,"_"),s=a===o&&t===a;return!s&&r.lib,s}const BJe=(t,e)=>n=>{let r=0;return n.split("").map((i,o)=>{if(e.lastIndex=0,r>t.length-1)return"";const a=t[r],s=t[r+1],l=e.test(i)?i:"",c=a===uE?l:a+l;return r+=c.length,o===n.length-1&&s&&s!==uE?c?c+s:"":c}).join("")},zJe=({acceptRegex:t=/[\d]/gi,disabled:e,disableMaskedInput:n,ignoreInvalidInputs:r,inputFormat:i,inputProps:o,label:a,mask:s,onChange:l,rawValue:c,readOnly:u,rifmFormatter:f,TextFieldProps:d,validationError:h})=>{const p=Sr(),m=p.getFormatHelperText(i),{shouldUseMaskedInput:g,maskToUse:v}=M.useMemo(()=>{if(n)return{shouldUseMaskedInput:!1,maskToUse:""};const T=FJe(s,i,t,p);return{shouldUseMaskedInput:jJe(T,i,t,p),maskToUse:T}},[t,n,i,s,p]),y=M.useMemo(()=>g&&v?BJe(v,t):T=>T,[t,v,g]),x=c===null?null:p.date(c),[b,_]=M.useState(x),[S,O]=M.useState(eN(p,c,i)),C=M.useRef(),E=M.useRef(p.locale),k=M.useRef(i);M.useEffect(()=>{const T=c!==C.current,L=p.locale!==E.current,z=i!==k.current;if(C.current=c,E.current=p.locale,k.current=i,!T&&!L&&!z)return;const B=c===null?null:p.date(c),U=c===null||p.isValid(B);let W=b===null&&B===null;if(b!==null&&B!==null){const N=p.isEqual(b,B);if(N)W=!0;else{const D=Math.abs(p.getDiff(b,B));W=D===0?N:D<1e3}}if(!L&&!z&&(!U||W))return;const $=eN(p,c,i);_(B),O($)},[p,c,i,b]);const I=T=>{const L=T===""||T===s?"":T;O(L);const z=L===null?null:p.parse(L,i);r&&!p.isValid(z)||(_(z),l(z,L||void 0))},P=$Je({value:S,onChange:I,format:f||y});return j({label:a,disabled:e,error:h,inputProps:j({},g?P:{value:S,onChange:T=>{I(T.currentTarget.value)}},{disabled:e,placeholder:m,readOnly:u,type:g?"tel":"text"},o)},d)},UJe=["className","components","disableOpenPicker","getOpenDialogAriaText","InputAdornmentProps","InputProps","inputRef","openPicker","OpenPickerButtonProps","renderInput"],jue=M.forwardRef(function(e,n){const{className:r,components:i={},disableOpenPicker:o,getOpenDialogAriaText:a,InputAdornmentProps:s,InputProps:l,inputRef:c,openPicker:u,OpenPickerButtonProps:f,renderInput:d}=e,h=Ae(e,UJe),p=Cd(),m=a??p.openDatePickerDialogue,g=Sr(),v=zJe(h),y=(s==null?void 0:s.position)||"end",x=i.OpenPickerIcon||mue;return d(j({ref:n,inputRef:c,className:r},v,{InputProps:j({},l,{[`${y}Adornment`]:o?void 0:w.jsx(Vke,j({position:y},s,{children:w.jsx(Ot,j({edge:y,disabled:h.disabled||h.readOnly,"aria-label":m(h.rawValue,g)},f,{onClick:u,children:w.jsx(x,{})}))}))})}))});function $9(){return typeof window>"u"?"portrait":window.screen&&window.screen.orientation&&window.screen.orientation.angle?Math.abs(window.screen.orientation.angle)===90?"landscape":"portrait":window.orientation&&Math.abs(Number(window.orientation))===90?"landscape":"portrait"}const WJe=(t,e)=>{const[n,r]=M.useState($9);return Hr(()=>{const o=()=>{r($9())};return window.addEventListener("orientationchange",o),()=>{window.removeEventListener("orientationchange",o)}},[]),bue(t,["hours","minutes","seconds"])?!1:(e||n)==="landscape"},VJe=({autoFocus:t,openView:e})=>{const[n,r]=M.useState(t?e:null),i=M.useCallback(o=>a=>{r(a?o:s=>o===s?null:s)},[]);return{focusedView:n,setFocusedView:i}};function GJe(t){return We("MuiCalendarOrClockPicker",t)}Ve("MuiCalendarOrClockPicker",["root","mobileKeyboardInputView"]);const HJe=["autoFocus","className","parsedValue","DateInputProps","isMobileKeyboardViewOpen","onDateChange","onViewChange","openTo","orientation","showToolbar","toggleMobileKeyboardView","ToolbarComponent","toolbarFormat","toolbarPlaceholder","toolbarTitle","views","dateRangeIcon","timeIcon","hideTabs","classes"],qJe=t=>{const{classes:e}=t;return Ue({root:["root"],mobileKeyboardInputView:["mobileKeyboardInputView"]},GJe,e)},XJe=we("div",{name:"MuiCalendarOrClockPicker",slot:"MobileKeyboardInputView",overridesResolver:(t,e)=>e.mobileKeyboardInputView})({padding:"16px 24px"}),QJe=we("div",{name:"MuiCalendarOrClockPicker",slot:"Root",overridesResolver:(t,e)=>e.root})(({ownerState:t})=>j({display:"flex",flexDirection:"column"},t.isLandscape&&{flexDirection:"row"})),YJe={fullWidth:!0},F9=t=>t==="year"||t==="month"||t==="day",j9=t=>t==="hours"||t==="minutes"||t==="seconds";function Bue(t){var e,n;const r=qe({props:t,name:"MuiCalendarOrClockPicker"}),{autoFocus:i,parsedValue:o,DateInputProps:a,isMobileKeyboardViewOpen:s,onDateChange:l,onViewChange:c,openTo:u,orientation:f,showToolbar:d,toggleMobileKeyboardView:h,ToolbarComponent:p=()=>null,toolbarFormat:m,toolbarPlaceholder:g,toolbarTitle:v,views:y,dateRangeIcon:x,timeIcon:b,hideTabs:_}=r,S=Ae(r,HJe),O=(e=S.components)==null?void 0:e.Tabs,C=WJe(y,f),E=M.useContext(Td),k=qJe(r),I=d??E!=="desktop",P=!_&&typeof window<"u"&&window.innerHeight>667,R=M.useCallback(($,N)=>{l($,E,N)},[l,E]),T=M.useCallback($=>{s&&h(),c&&c($)},[s,c,h]),{openView:L,setOpenView:z,handleChangeAndOpenNext:B}=Uz({view:void 0,views:y,openTo:u,onChange:R,onViewChange:T}),{focusedView:U,setFocusedView:W}=VJe({autoFocus:i,openView:L});return w.jsxs(QJe,{ownerState:{isLandscape:C},className:k.root,children:[I&&w.jsx(p,j({},S,{views:y,isLandscape:C,parsedValue:o,onChange:R,setOpenView:z,openView:L,toolbarTitle:v,toolbarFormat:m,toolbarPlaceholder:g,isMobileKeyboardViewOpen:s,toggleMobileKeyboardView:h})),P&&!!O&&w.jsx(O,j({dateRangeIcon:x,timeIcon:b,view:L,onChange:z},(n=S.componentsProps)==null?void 0:n.tabs)),w.jsx(Vz,{children:s?w.jsx(XJe,{className:k.mobileKeyboardInputView,children:w.jsx(jue,j({},a,{ignoreInvalidInputs:!0,disableOpenPicker:!0,TextFieldProps:YJe}))}):w.jsxs(M.Fragment,{children:[F9(L)&&w.jsx(NJe,j({autoFocus:i,date:o,onViewChange:z,onChange:B,view:L,views:y.filter(F9),focusedView:U,onFocusedViewChange:W},S)),j9(L)&&w.jsx(wZe,j({},S,{autoFocus:i,date:o,view:L,views:y.filter(j9),onChange:B,onViewChange:z,showViewSwitcher:E==="desktop"}))]})})]})}const KJe=({adapter:t,value:e,props:n})=>{const{minTime:r,maxTime:i,minutesStep:o,shouldDisableTime:a,disableIgnoringDatePartForTimeValidation:s}=n,l=t.utils.date(e),c=Pue(s,t.utils);if(e===null)return null;switch(!0){case!t.utils.isValid(e):return"invalidDate";case!!(r&&c(r,l)):return"minTime";case!!(i&&c(l,i)):return"maxTime";case!!(a&&a(t.utils.getHours(l),"hours")):return"shouldDisableTime-hours";case!!(a&&a(t.utils.getMinutes(l),"minutes")):return"shouldDisableTime-minutes";case!!(a&&a(t.utils.getSeconds(l),"seconds")):return"shouldDisableTime-seconds";case!!(o&&t.utils.getMinutes(l)%o!==0):return"minutesStep";default:return null}},ZJe=["minDate","maxDate","disableFuture","shouldDisableDate","disablePast"],JJe=({props:t,value:e,adapter:n})=>{const{minDate:r,maxDate:i,disableFuture:o,shouldDisableDate:a,disablePast:s}=t,l=Ae(t,ZJe),c=kue({adapter:n,value:e,props:{minDate:r,maxDate:i,disableFuture:o,shouldDisableDate:a,disablePast:s}});return c!==null?c:KJe({adapter:n,value:e,props:l})},eet=(t,e)=>t===e;function zue(t){return DZe(t,JJe,eet)}const tet=({open:t,onOpen:e,onClose:n})=>{const r=M.useRef(typeof t=="boolean").current,[i,o]=M.useState(!1);M.useEffect(()=>{if(r){if(typeof t!="boolean")throw new Error("You must not mix controlling and uncontrolled mode for `open` prop");o(t)}},[r,t]);const a=M.useCallback(s=>{r||o(s),s&&e&&e(),!s&&n&&n()},[r,e,n]);return{isOpen:i,setIsOpen:a}},Uue=(t,e)=>{const{onAccept:n,onChange:r,value:i,closeOnSelect:o}=t,a=Sr(),{isOpen:s,setIsOpen:l}=tet(t),c=M.useMemo(()=>e.parseInput(a,i),[e,a,i]),[u,f]=M.useState(c),[d,h]=M.useState(()=>({committed:c,draft:c,resetFallback:c})),p=M.useCallback(S=>{h(O=>{switch(S.action){case"setAll":case"acceptAndClose":return{draft:S.value,committed:S.value,resetFallback:S.value};case"setCommitted":return j({},O,{draft:S.value,committed:S.value});case"setDraft":return j({},O,{draft:S.value});default:return O}}),(S.forceOnChangeCall||!S.skipOnChangeCall&&!e.areValuesEqual(a,d.committed,S.value))&&r(S.value),S.action==="acceptAndClose"&&(l(!1),n&&!e.areValuesEqual(a,d.resetFallback,S.value)&&n(S.value))},[n,r,l,d,a,e]);M.useEffect(()=>{a.isValid(c)&&f(c)},[a,c]),M.useEffect(()=>{s&&p({action:"setAll",value:c,skipOnChangeCall:!0})},[s]),e.areValuesEqual(a,d.committed,c)||p({action:"setCommitted",value:c,skipOnChangeCall:!0});const m=M.useMemo(()=>({open:s,onClear:()=>{p({value:e.emptyValue,action:"acceptAndClose",forceOnChangeCall:!e.areValuesEqual(a,i,e.emptyValue)})},onAccept:()=>{p({value:d.draft,action:"acceptAndClose",forceOnChangeCall:!e.areValuesEqual(a,i,c)})},onDismiss:()=>{p({value:d.committed,action:"acceptAndClose"})},onCancel:()=>{p({value:d.resetFallback,action:"acceptAndClose"})},onSetToday:()=>{p({value:e.getTodayValue(a),action:"acceptAndClose"})}}),[p,s,a,d,e,i,c]),[g,v]=M.useState(!1),y=M.useMemo(()=>({parsedValue:d.draft,isMobileKeyboardViewOpen:g,toggleMobileKeyboardView:()=>v(!g),onDateChange:(S,O,C="partial")=>{switch(C){case"shallow":return p({action:"setDraft",value:S,skipOnChangeCall:!0});case"partial":return p({action:"setDraft",value:S});case"finish":return p(o??O==="desktop"?{value:S,action:"acceptAndClose"}:{value:S,action:"setCommitted"});default:throw new Error("MUI: Invalid selectionState passed to `onDateChange`")}}}),[p,g,d.draft,o]),x=M.useCallback((S,O)=>{const C=e.valueReducer?e.valueReducer(a,u,S):S;r(C,O)},[r,e,u,a]),b=M.useMemo(()=>({onChange:x,open:s,rawValue:i,openPicker:()=>l(!0)}),[x,s,i,l]),_={pickerProps:y,inputProps:b,wrapperProps:m};return M.useDebugValue(_,()=>({MuiPickerState:{dateState:d,other:_}})),_};function net(t){return We("MuiDateTimePickerTabs",t)}Ve("MuiDateTimePickerTabs",["root"]);const ret=t=>["day","month","year"].includes(t)?"date":"time",iet=t=>t==="date"?"day":"hours",oet=t=>{const{classes:e}=t;return Ue({root:["root"]},net,e)},aet=we(A5,{name:"MuiDateTimePickerTabs",slot:"Root",overridesResolver:(t,e)=>e.root})(({ownerState:t,theme:e})=>j({boxShadow:`0 -1px 0 0 inset ${e.palette.divider}`},t.wrapperVariant==="desktop"&&{order:1,boxShadow:`0 1px 0 0 inset ${e.palette.divider}`,[`& .${kC.indicator}`]:{bottom:"auto",top:0}})),Wue=function(e){const n=qe({props:e,name:"MuiDateTimePickerTabs"}),{dateRangeIcon:r=w.jsx(aKe,{}),onChange:i,timeIcon:o=w.jsx(lKe,{}),view:a}=n,s=Cd(),l=M.useContext(Td),c=j({},n,{wrapperVariant:l}),u=oet(c),f=(d,h)=>{i(iet(h))};return w.jsxs(aet,{ownerState:c,variant:"fullWidth",value:ret(a),onChange:f,className:u.root,children:[w.jsx($b,{value:"date","aria-label":s.dateTableLabel,icon:w.jsx(M.Fragment,{children:r})}),w.jsx($b,{value:"time","aria-label":s.timeTableLabel,icon:w.jsx(M.Fragment,{children:o})})]})},set=["onChange","PaperProps","PopperProps","ToolbarComponent","TransitionComponent","value","components","componentsProps","hideTabs"],cet=M.forwardRef(function(e,n){const r=fue(e,"MuiDesktopDateTimePicker"),i=zue(r)!==null,{pickerProps:o,inputProps:a,wrapperProps:s}=Uue(r,due),{PaperProps:l,PopperProps:c,ToolbarComponent:u=yue,TransitionComponent:f,components:d,componentsProps:h,hideTabs:p=!0}=r,m=Ae(r,set),g=M.useMemo(()=>j({Tabs:Wue},d),[d]),v=j({},a,m,{components:g,componentsProps:h,ref:n,validationError:i});return w.jsx(IKe,j({},s,{DateInputProps:v,KeyboardDateInputComponent:jue,PopperProps:c,PaperProps:l,TransitionComponent:f,components:g,componentsProps:h,children:w.jsx(Bue,j({},o,{autoFocus:!0,toolbarTitle:r.label||r.toolbarTitle,ToolbarComponent:u,DateInputProps:v,components:g,componentsProps:h,hideTabs:p},m))}))}),uet=we(rl)({[`& .${zx.container}`]:{outline:0},[`& .${zx.paper}`]:{outline:0,minWidth:Mue}}),fet=we(Ys)({"&:first-of-type":{padding:0}}),det=t=>{var e;const{children:n,DialogProps:r={},onAccept:i,onClear:o,onDismiss:a,onCancel:s,onSetToday:l,open:c,components:u,componentsProps:f}=t,d=(e=u==null?void 0:u.ActionBar)!=null?e:xue;return w.jsxs(uet,j({open:c,onClose:a},r,{children:[w.jsx(fet,{children:n}),w.jsx(d,j({onAccept:i,onClear:o,onCancel:s,onSetToday:l,actions:["cancel","accept"]},f==null?void 0:f.actionBar))]}))},het=["children","DateInputProps","DialogProps","onAccept","onClear","onDismiss","onCancel","onSetToday","open","PureDateInputComponent","components","componentsProps"];function pet(t){const{children:e,DateInputProps:n,DialogProps:r,onAccept:i,onClear:o,onDismiss:a,onCancel:s,onSetToday:l,open:c,PureDateInputComponent:u,components:f,componentsProps:d}=t,h=Ae(t,het);return w.jsxs(Td.Provider,{value:"mobile",children:[w.jsx(u,j({components:f},h,n)),w.jsx(det,{DialogProps:r,onAccept:i,onClear:o,onDismiss:a,onCancel:s,onSetToday:l,open:c,components:f,componentsProps:d,children:e})]})}const met=M.forwardRef(function(e,n){const{disabled:r,getOpenDialogAriaText:i,inputFormat:o,InputProps:a,inputRef:s,label:l,openPicker:c,rawValue:u,renderInput:f,TextFieldProps:d={},validationError:h,className:p}=e,m=Cd(),g=i??m.openDatePickerDialogue,v=Sr(),y=M.useMemo(()=>j({},a,{readOnly:!0}),[a]),x=eN(v,u,o),b=_r(_=>{_.stopPropagation(),c()});return f(j({label:l,disabled:r,ref:n,inputRef:s,error:h,InputProps:y,className:p},!e.readOnly&&!e.disabled&&{onClick:b},{inputProps:j({disabled:r,readOnly:!0,"aria-readonly":!0,"aria-label":g(u,v),value:x},!e.readOnly&&{onClick:b},{onKeyDown:_ue(c)})},d))}),get=["ToolbarComponent","value","onChange","components","componentsProps","hideTabs"],vet=M.forwardRef(function(e,n){const r=fue(e,"MuiMobileDateTimePicker"),i=zue(r)!==null,{pickerProps:o,inputProps:a,wrapperProps:s}=Uue(r,due),{ToolbarComponent:l=yue,components:c,componentsProps:u,hideTabs:f=!1}=r,d=Ae(r,get),h=M.useMemo(()=>j({Tabs:Wue},c),[c]),p=j({},a,d,{components:h,componentsProps:u,ref:n,validationError:i});return w.jsx(pet,j({},d,s,{DateInputProps:p,PureDateInputComponent:met,components:h,componentsProps:u,children:w.jsx(Bue,j({},o,{autoFocus:!0,toolbarTitle:r.label||r.toolbarTitle,ToolbarComponent:l,DateInputProps:p,components:h,componentsProps:u,hideTabs:f},d))}))}),yet=["desktopModeMediaQuery","DialogProps","PopperProps","TransitionComponent"],xet=M.forwardRef(function(e,n){const r=qe({props:e,name:"MuiDateTimePicker"}),{desktopModeMediaQuery:i="@media (pointer: fine)",DialogProps:o,PopperProps:a,TransitionComponent:s}=r,l=Ae(r,yet);return xSe(i,{defaultMatches:!0})?w.jsx(cet,j({ref:n,PopperProps:a,TransitionComponent:s},l)):w.jsx(vet,j({ref:n,DialogProps:o},l))}),bet=t=>({dateTimePicker:{marginTop:t.spacing(2.5)}}),_et=({classes:t,hasTimeDimension:e,selectedTime:n,selectedTimeRange:r,selectTime:i})=>{const o=d=>{i(d!==null?t6e(d):null)},a=w.jsx(ny,{shrink:!0,htmlFor:"time-select",children:`${fe.get("Time")} (UTC)`}),l=typeof n=="number"?rR(n):null;let c,u;Array.isArray(r)&&(c=rR(r[0]),u=rR(r[1]));const f=w.jsx(VYe,{dateAdapter:QYe,children:w.jsx(xet,{disabled:!e,className:t.dateTimePicker,inputFormat:"yyyy-MM-dd hh:mm:ss",value:l,minDateTime:c,maxDateTime:u,onChange:o,ampm:!1,renderInput:d=>w.jsx(cr,{...d,variant:"standard",size:"small"})})});return w.jsx(Kb,{label:a,control:f})},wet=zYe(bet)(_et),Oet=t=>({locale:t.controlState.locale,hasTimeDimension:!!wy(t),selectedTime:t.controlState.selectedTime,selectedTimeRange:t.controlState.selectedTimeRange}),Cet={selectTime:k2},Tet=Jt(Oet,Cet)(wet),B9=5,Eet={box:t=>({marginTop:t.spacing(1),marginLeft:t.spacing(B9),marginRight:t.spacing(B9),minWidth:200}),label:{color:"grey",fontSize:"1em"}};function Pet({hasTimeDimension:t,selectedTime:e,selectTime:n,selectedTimeRange:r}){const[i,o]=M.useState(e);if(M.useEffect(()=>{o(e||(r?r[0]:0))},[e,r]),!t)return null;const a=(f,d)=>{typeof d=="number"&&o(d)},s=(f,d)=>{n&&typeof d=="number"&&n(d)},l=Array.isArray(r);l||(r=[Date.now()-2*Rae.years,Date.now()]);const c=[{value:r[0],label:Qb(r[0])},{value:r[1],label:Qb(r[1])}];function u(f){return gy(f)}return w.jsx(Ke,{sx:Eet.box,children:w.jsx(_t,{arrow:!0,title:fe.get("Select time in dataset"),children:w.jsx(ry,{disabled:!l,min:r[0],max:r[1],value:i||0,valueLabelDisplay:"off",valueLabelFormat:u,marks:c,onChange:a,onChangeCommitted:s,size:"small"})})})}const Met=t=>({locale:t.controlState.locale,hasTimeDimension:!!wy(t),selectedTime:t.controlState.selectedTime,selectedTimeRange:t.controlState.selectedTimeRange}),ket={selectTime:k2,selectTimeRange:Sle},Aet=Jt(Met,ket)(Pet);var Gz={},Ret=ft;Object.defineProperty(Gz,"__esModule",{value:!0});var Vue=Gz.default=void 0,Iet=Ret(pt()),Det=w;Vue=Gz.default=(0,Iet.default)((0,Det.jsx)("path",{d:"M15.41 7.41 14 6l-6 6 6 6 1.41-1.41L10.83 12z"}),"ChevronLeft");var Hz={},Let=ft;Object.defineProperty(Hz,"__esModule",{value:!0});var Gue=Hz.default=void 0,Net=Let(pt()),$et=w;Gue=Hz.default=(0,Net.default)((0,$et.jsx)("path",{d:"M10 6 8.59 7.41 13.17 12l-4.58 4.59L10 18l6-6z"}),"ChevronRight");var qz={},Fet=ft;Object.defineProperty(qz,"__esModule",{value:!0});var Hue=qz.default=void 0,jet=Fet(pt()),Bet=w;Hue=qz.default=(0,jet.default)((0,Bet.jsx)("path",{d:"M18.41 16.59 13.82 12l4.59-4.59L17 6l-6 6 6 6zM6 6h2v12H6z"}),"FirstPage");var Xz={},zet=ft;Object.defineProperty(Xz,"__esModule",{value:!0});var que=Xz.default=void 0,Uet=zet(pt()),Wet=w;que=Xz.default=(0,Uet.default)((0,Wet.jsx)("path",{d:"M5.59 7.41 10.18 12l-4.59 4.59L7 18l6-6-6-6zM16 6h2v12h-2z"}),"LastPage");var Qz={},Vet=ft;Object.defineProperty(Qz,"__esModule",{value:!0});var Xue=Qz.default=void 0,Get=Vet(pt()),Het=w;Xue=Qz.default=(0,Get.default)((0,Het.jsx)("path",{d:"M9 16h2V8H9zm3-14C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2m0 18c-4.41 0-8-3.59-8-8s3.59-8 8-8 8 3.59 8 8-3.59 8-8 8m1-4h2V8h-2z"}),"PauseCircleOutline");var Yz={},qet=ft;Object.defineProperty(Yz,"__esModule",{value:!0});var Que=Yz.default=void 0,Xet=qet(pt()),Qet=w;Que=Yz.default=(0,Xet.default)((0,Qet.jsx)("path",{d:"m10 16.5 6-4.5-6-4.5zM12 2C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2m0 18c-4.41 0-8-3.59-8-8s3.59-8 8-8 8 3.59 8 8-3.59 8-8 8"}),"PlayCircleOutline");const um={formControl:t=>({marginTop:t.spacing(2.5),marginLeft:t.spacing(1),marginRight:t.spacing(1)}),iconButton:{padding:"2px"}};function Yet({timeAnimationActive:t,timeAnimationInterval:e,updateTimeAnimation:n,selectedTime:r,selectedTimeRange:i,selectTime:o,incSelectedTime:a}){const s=M.useRef(null);M.useEffect(()=>(p(),g));const l=()=>{a(1)},c=()=>{n(!t,e)},u=()=>{a(1)},f=()=>{a(-1)},d=()=>{o(i?i[0]:null)},h=()=>{o(i?i[1]:null)},p=()=>{t?m():g()},m=()=>{g(),s.current=window.setInterval(l,e)},g=()=>{s.current!==null&&(window.clearInterval(s.current),s.current=null)},v=typeof r=="number",y=t?w.jsx(Xue,{}):w.jsx(Que,{}),x=w.jsx(Ot,{disabled:!v,onClick:c,size:"small",sx:um.iconButton,children:w.jsx(_t,{arrow:!0,title:fe.get("Auto-step through times in the dataset"),children:y})}),b=w.jsx(Ot,{disabled:!v||t,onClick:d,size:"small",sx:um.iconButton,children:w.jsx(Hue,{})}),_=w.jsx(Ot,{disabled:!v||t,onClick:f,size:"small",sx:um.iconButton,children:w.jsx(Vue,{})}),S=w.jsx(Ot,{disabled:!v||t,onClick:u,size:"small",sx:um.iconButton,children:w.jsx(Gue,{})}),O=w.jsx(Ot,{disabled:!v||t,onClick:h,size:"small",sx:um.iconButton,children:w.jsx(que,{})});return w.jsx(ty,{sx:um.formControl,variant:"standard",children:w.jsxs(Ke,{children:[b,_,x,S,O]})})}const Ket=t=>({locale:t.controlState.locale,selectedTime:t.controlState.selectedTime,selectedTimeRange:t.controlState.selectedTimeRange,timeAnimationActive:t.controlState.timeAnimationActive,timeAnimationInterval:t.controlState.timeAnimationInterval}),Zet={selectTime:k2,incSelectedTime:I8e,updateTimeAnimation:L8e},Jet=Jt(Ket,Zet)(Yet);var Kz={},ett=ft;Object.defineProperty(Kz,"__esModule",{value:!0});var Yue=Kz.default=void 0,ttt=ett(pt()),ntt=w;Yue=Kz.default=(0,ttt.default)((0,ntt.jsx)("path",{d:"M16 20H2V4h14zm2-12h4V4h-4zm0 12h4v-4h-4zm0-6h4v-4h-4z"}),"ViewSidebar");const rtt=Li(ty)(({theme:t})=>({marginTop:t.spacing(2),marginRight:t.spacing(.5),marginLeft:"auto"}));function itt({visible:t,sidebarOpen:e,setSidebarOpen:n,openDialog:r,allowRefresh:i,updateResources:o,compact:a}){if(!t)return null;const s=w.jsx(Pn,{value:"sidebar",selected:e,onClick:()=>n(!e),size:"small",sx:ko.toggleButton,children:w.jsx(_t,{arrow:!0,title:fe.get("Show or hide sidebar"),children:w.jsx(Yue,{})})});let l,c,u;return a&&(l=i&&w.jsx(Ot,{onClick:o,size:"small",children:w.jsx(_t,{arrow:!0,title:fe.get("Refresh"),children:w.jsx(W5,{})})}),c=Kt.instance.branding.allowDownloads&&w.jsx(Ot,{onClick:()=>r("export"),size:"small",children:w.jsx(_t,{arrow:!0,title:fe.get("Export data"),children:w.jsx(H5,{})})}),u=w.jsx(Ot,{onClick:()=>r("settings"),size:"small",children:w.jsx(_t,{arrow:!0,title:fe.get("Settings"),children:w.jsx(z5,{})})})),w.jsx(rtt,{variant:"standard",children:w.jsxs(Ke,{children:[l,c,u,s]})})}const ott=t=>({locale:t.controlState.locale,visible:!!(t.controlState.selectedDatasetId||t.controlState.selectedPlaceId),sidebarOpen:t.controlState.sidebarOpen,compact:Kt.instance.branding.compact,allowRefresh:Kt.instance.branding.allowRefresh}),att={setSidebarOpen:az,openDialog:Lp,updateResources:zse},stt=Jt(ott,att)(itt),ltt=t=>({locale:t.controlState.locale,show:t.dataState.datasets.length>0}),ctt={},utt=({show:t})=>t?w.jsxs(wqe,{children:[w.jsx(kqe,{}),w.jsx(Yqe,{}),w.jsx(sXe,{}),w.jsx(gXe,{}),w.jsx(LXe,{}),w.jsx(Tet,{}),w.jsx(Jet,{}),w.jsx(Aet,{}),w.jsx(stt,{})]}):null,ftt=Jt(ltt,ctt)(utt);function Kue(t){const e=M.useRef(null),n=M.useRef(o=>{if(o.buttons===1&&e.current!==null){o.preventDefault();const{screenX:a,screenY:s}=o,[l,c]=e.current,u=[a-l,s-c];e.current=[a,s],t(u)}}),r=M.useRef(o=>{o.buttons===1&&(o.preventDefault(),document.body.addEventListener("mousemove",n.current),document.body.addEventListener("mouseup",i.current),document.body.addEventListener("onmouseleave",i.current),e.current=[o.screenX,o.screenY])}),i=M.useRef(o=>{e.current!==null&&(o.preventDefault(),e.current=null,document.body.removeEventListener("mousemove",n.current),document.body.removeEventListener("mouseup",i.current),document.body.removeEventListener("onmouseleave",i.current))});return r.current}const z9={hor:t=>({flex:"none",border:"none",outline:"none",width:"8px",minHeight:"100%",maxHeight:"100%",cursor:"col-resize",backgroundColor:t.palette.mode==="dark"?"white":"black",opacity:0}),ver:t=>({flex:"none",border:"none",outline:"none",height:"8px",minWidth:"100%",maxWidth:"100%",cursor:"row-resize",backgroundColor:t.palette.mode==="dark"?"white":"black",opacity:0})};function dtt({dir:t,onChange:e}){const r=Kue(([i,o])=>{e(i)});return w.jsx(Ke,{sx:t==="hor"?z9.hor:z9.ver,onMouseDown:r})}const zS={hor:{display:"flex",flexFlow:"row nowrap",flex:"auto"},ver:{height:"100%",display:"flex",flexFlow:"column nowrap",flex:"auto"},childHor:{flex:"none"},childVer:{flex:"none"}};function htt({dir:t,splitPosition:e,setSplitPosition:n,children:r,style:i,child1Style:o,child2Style:a}){const s=M.useRef(null);if(!r||!Array.isArray(r)||r.length!==2)return null;const l=t==="hor"?zS.childHor:zS.childVer,c=t==="hor"?{width:e}:{height:e},u=f=>{s.current&&En(s.current.clientWidth)&&n(s.current.clientWidth+f)};return w.jsxs("div",{id:"SplitPane",style:{...i,...t==="hor"?zS.hor:zS.ver},children:[w.jsx("div",{ref:s,id:"SplitPane-Child-1",style:{...l,...o,...c},children:r[0]}),w.jsx(dtt,{dir:t,onChange:u}),w.jsx("div",{id:"SplitPane-Child-2",style:{...l,...a},children:r[1]})]})}const ptt=({placeGroup:t,mapProjection:e,visible:n})=>{const r=M.useRef(new Y1);return M.useEffect(()=>{const i=r.current,o=t.features;if(o.length===0)i.clear();else{const a=i.getFeatures(),s=new Set(a.map(f=>f.getId())),l=new Set(o.map(f=>f.id)),c=o.filter(f=>!s.has(f.id));a.filter(f=>!l.has(f.getId()+"")).forEach(f=>i.removeFeature(f)),c.forEach(f=>{const d=new Ip().readFeature(f,{dataProjection:"EPSG:4326",featureProjection:e});d.getId()!==f.id&&d.setId(f.id);const h=(f.properties||{}).color||"red",p=(f.properties||{}).opacity,m=(f.properties||{}).source?"diamond":"circle";YB(d,h,I5(p),m),i.addFeature(d)})}},[t,e]),w.jsx(v2,{id:t.id,opacity:t.id===Ws?1:.8,visible:n,zIndex:501,source:r.current})};class mtt extends my{addMapObject(e){const n=new j5e(this.getOptions());return e.addControl(n),n}updateMapObject(e,n,r){return n.setProperties(this.getOptions()),n}removeMapObject(e,n){e.removeControl(n)}}class MR extends my{addMapObject(e){const n=new mBe(this.getOptions()),r=!!this.props.active;return n.setActive(r),e.addInteraction(n),r&&this.listen(n,this.props),n}updateMapObject(e,n,r){n.setProperties(this.getOptions());const i=!!this.props.active;return n.setActive(i),this.unlisten(n,r),i&&this.listen(n,this.props),n}removeMapObject(e,n){this.unlisten(n,this.props),e.removeInteraction(n)}getOptions(){const e=super.getOptions();delete e.layerId,delete e.active,delete e.onDrawStart,delete e.onDrawEnd;const n=this.props.layerId;if(n&&!e.source){const r=this.getMapObject(n);r&&(e.source=r.getSource())}return e}listen(e,n){const{onDrawStart:r,onDrawEnd:i}=n;r&&e.on("drawstart",r),i&&e.on("drawend",i)}unlisten(e,n){const{onDrawStart:r,onDrawEnd:i}=n;r&&e.un("drawstart",r),i&&e.un("drawend",i)}}class gtt extends my{addMapObject(e){return this.updateView(e)}removeMapObject(e,n){}updateMapObject(e,n){return this.updateView(e)}updateView(e){const n=this.props.projection;let r=e.getView().getProjection();if(typeof n=="string"&&r&&(r=r.getCode()),n&&n!==r){const i=e.getView(),o=new Uc({...this.props,center:a2(i.getCenter()||[0,0],r,n),minZoom:i.getMinZoom(),zoom:i.getZoom()});e.getLayers().forEach(a=>{a instanceof h2&&a.getSource().forEachFeature(s=>{var l;(l=s.getGeometry())==null||l.transform(r,n)})}),e.setView(o)}else e.getView().setProperties(this.props);return e.getView()}}function US(t,e){const n=t.getLayers();for(let r=0;r<n.getLength();r++){const i=n.item(r);if(i.get("id")===e)return i}return null}const kR="selection",vtt=new Y1,Zue=[255,220,0,.8],ytt=new Xl({color:Zue,width:10,lineCap:"square",lineDash:[10,15]}),U9=new op({color:[0,0,0,0]}),xtt=new Il({stroke:ytt,fill:U9,image:new X1({radius:15,stroke:new Xl({color:Zue,width:6,lineCap:"square",lineDash:[6,6]}),fill:U9})});function btt({theme:t,mapId:e,mapInteraction:n,mapProjection:r,baseMapLayer:i,rgb2Layer:o,rgbLayer:a,variable2Layer:s,variableLayer:l,datasetBoundaryLayer:c,placeGroupLayers:u,overlayLayer:f,colorBarLegend:d,colorBarLegend2:h,mapSplitter:p,mapPointInfoBox:m,mapControlActions:g,userDrawnPlaceGroupName:v,addDrawnUserPlace:y,importUserPlacesFromText:x,userPlaceGroups:b,userPlaceGroupsVisibility:_,showUserPlaces:S,selectPlace:O,selectedPlaceId:C,places:E,imageSmoothing:k,variableSplitPos:I,onMapRef:P}){t=hd();const[R,T]=M.useState(null),[L,z]=M.useState(C||null);M.useEffect(()=>{if(R){const N=C||null;if(N!==L&&Ga[kR]){const A=Ga[kR].getSource();if(A.clear(),N){const q=_tt(R,N);if(q){const Y=q.clone();Y.setId("select-"+q.getId()),Y.setStyle(void 0),A.addFeature(Y)}}z(N)}}},[R,C,L]),M.useEffect(()=>{R&&R.getLayers().forEach(N=>{N instanceof oae?N.getSource().changed():N.changed()})},[R,k]),M.useEffect(()=>{if(R===null||!En(I))return;const N=J=>{W9(R,J,I,0)},D=J=>{W9(R,J,I,1)},A=J=>{J.context.restore()},q=US(R,"rgb2"),Y=US(R,"variable2"),K=US(R,"rgb"),se=US(R,"variable"),te=[[q,N],[Y,N],[K,D],[se,D]];for(const[J,pe]of te)J&&(J.on("prerender",pe),J.on("postrender",A));return()=>{for(const[J,pe]of te)J&&(J.un("prerender",pe),J.un("postrender",A))}});const B=N=>{if(n==="Select"){const D=N.map;let A=null;const q=D.getFeaturesAtPixel(N.pixel);if(q){for(const Y of q)if(typeof Y.getId=="function"){A=Y.getId()+"";break}}O&&O(A,E,!1)}},U=N=>{var D;if(R!==null&&y&&n!=="Select"){const A=N.feature;let q=A.getGeometry();if(!q)return;const Y=Js(cy+n.toLowerCase()+"-"),K=R.getView().getProjection();if(q instanceof IB){const re=o$e(q);A.setGeometry(re)}q=A.clone().getGeometry().transform(K,py);const se=new Ip().writeGeometryObject(q);A.setId(Y);let te=0;if(Ga[Ws]){const re=Ga[Ws],ve=(D=re==null?void 0:re.getSource())==null?void 0:D.getFeatures();ve&&(te=ve.length)}const J=wtt(b,n),pe=tp(te),be=die(pe,t.palette.mode);YB(A,be,I5()),y(v,Y,{label:J,color:pe},se,!0)}return!0};function W(N){P&&P(N),T(N)}const $=N=>{x&&N.forEach(D=>{const A=new FileReader;A.onloadend=()=>{typeof A.result=="string"&&x(A.result)},A.readAsText(D,"UTF-8")})};return w.jsx(Oie,{children:w.jsxs(ize,{id:e,onClick:N=>B(N),onMapRef:W,mapObjects:Ga,isStale:!0,onDropFiles:$,children:[w.jsx(gtt,{id:"view",projection:r}),w.jsxs(iae,{children:[i,o,a,s,l,f,c,w.jsx(v2,{id:kR,opacity:.7,zIndex:500,style:xtt,source:vtt}),w.jsx(w.Fragment,{children:b.map(N=>w.jsx(ptt,{placeGroup:N,mapProjection:r,visible:S&&_[N.id]},N.id))})]}),u,w.jsx(MR,{id:"drawPoint",layerId:Ws,active:n==="Point",type:"Point",wrapX:!0,stopClick:!0,onDrawEnd:U}),w.jsx(MR,{id:"drawPolygon",layerId:Ws,active:n==="Polygon",type:"Polygon",wrapX:!0,stopClick:!0,onDrawEnd:U}),w.jsx(MR,{id:"drawCircle",layerId:Ws,active:n==="Circle",type:"Circle",wrapX:!0,stopClick:!0,onDrawEnd:U}),d,h,m,g,p,w.jsx(mtt,{bar:!1})]})})}function _tt(t,e){var n;for(const r of t.getLayers().getArray())if(r instanceof h2){const o=(n=r.getSource())==null?void 0:n.getFeatureById(e);if(o)return o}return null}function wtt(t,e){const n=fe.get(e),r=t.find(i=>i.id===Ws);if(r)for(let i=1;;i++){const o=`${n} ${i}`;if(!!!r.features.find(s=>s.properties?s.properties.label===o:!1))return o}return`${n} 1`}function W9(t,e,n,r){const i=t.getSize();if(!i)return;const o=i[0],a=i[1];let s,l,c,u;r===0?(s=Lu(e,[0,0]),l=Lu(e,[n,0]),c=Lu(e,[0,a]),u=Lu(e,[n,a])):(s=Lu(e,[n,0]),l=Lu(e,[o,0]),c=Lu(e,[n,a]),u=Lu(e,[o,a]));const f=e.context;f.save(),f.beginPath(),f.moveTo(s[0],s[1]),f.lineTo(c[0],c[1]),f.lineTo(u[0],u[1]),f.lineTo(l[0],l[1]),f.closePath(),f.clip()}const WS=1,e_=.2,Py=240,Jue=20,VS={container:{width:Py},itemContainer:{display:"flex",alignItems:"center",justifyContent:"flex-start"},itemLabelBox:{paddingLeft:1,fontSize:"small"},itemColorBox:t=>({width:"48px",height:"16px",borderStyle:"solid",borderColor:t.palette.mode==="dark"?"lightgray":"darkgray",borderWidth:1})};function Stt({categories:t,onOpenColorBarEditor:e}){return!t||t.length===0?null:w.jsx(Ke,{sx:VS.container,children:t.map((n,r)=>w.jsxs(Ke,{onClick:e,sx:VS.itemContainer,children:[w.jsx(Ke,{sx:VS.itemColorBox,style:{backgroundColor:n.color}}),w.jsx(Ke,{component:"span",sx:VS.itemLabelBox,children:`${n.label||`Category ${r+1}`} (${n.value})`})]},r))})}const V9={nominal:{cursor:"pointer"},error:{cursor:"pointer",border:"0.5px solid red"}};function Ott({colorBar:t,opacity:e,width:n,height:r,onClick:i}){const o=M.useRef(null);M.useEffect(()=>{const c=o.current;c!==null&&aWe(t,e,c)},[t,e]);const{baseName:a,imageData:s}=t,l=s?a:fe.get("Unknown color bar")+`: ${a}`;return w.jsx(_t,{title:l,children:w.jsx("canvas",{ref:o,width:n||Py,height:r||Jue+4,onClick:i,style:s?V9.nominal:V9.error})})}function Ctt(t,e,n=5,r=!1,i=!1){return tN(Ett(t,e,n,r),i)}function tN(t,e=!1){return t.map(n=>rd(n,void 0,e))}function rd(t,e,n){if(e===void 0&&(e=n?2:Ttt(t)),n)return t.toExponential(e);const r=Math.round(t);if(r===t||Math.abs(r-t)<1e-8)return r+"";{let i=t.toFixed(e);if(i.includes("."))for(;i.endsWith("0")&&!i.endsWith(".0");)i=i.substring(0,i.length-1);return i}}function Ttt(t){if(t===0||t===Math.floor(t))return 0;const e=Math.floor(Math.log10(Math.abs(t)));return Math.min(16,Math.max(2,e<0?1-e:0))}function Ett(t,e,n,r){const i=new Array(n);if(r){const o=Math.log10(t),s=(Math.log10(e)-o)/(n-1);for(let l=1;l<n-1;l++)i[l]=Math.pow(10,o+l*s)}else{const o=(e-t)/(n-1);for(let a=1;a<n-1;a++)i[a]=t+a*o}return i[0]=t,i[n-1]=e,i}const Ptt={container:{fontSize:"x-small",fontWeight:"bold",width:"100%",display:"flex",flexWrap:"nowrap",justifyContent:"space-between",cursor:"pointer"}};function Mtt({minValue:t,maxValue:e,numTicks:n,logScaled:r,onClick:i}){const o=M.useMemo(()=>Ctt(t,e,n,r),[t,e,n,r]);return w.jsx(Ke,{sx:Ptt.container,onClick:i,children:o.map((a,s)=>w.jsx("span",{children:a},s))})}var Zz={},ktt=ft;Object.defineProperty(Zz,"__esModule",{value:!0});var efe=Zz.default=void 0,Att=ktt(pt()),Rtt=w;efe=Zz.default=(0,Att.default)((0,Rtt.jsx)("path",{d:"M8 19h3v3h2v-3h3l-4-4zm8-15h-3V1h-2v3H8l4 4zM4 9v2h16V9zm0 3h16v2H4z"}),"Compress");const G9=t=>t,Itt=t=>Math.pow(10,t),Dtt=Math.log10,H9=(t,e)=>typeof t=="number"?e(t):t.map(e);class Ltt{constructor(e){Yt(this,"_fn");Yt(this,"_invFn");e?(this._fn=Dtt,this._invFn=Itt):(this._fn=G9,this._invFn=G9)}scale(e){return H9(e,this._fn)}scaleInv(e){return H9(e,this._invFn)}}function Ntt({variableColorBarName:t,variableColorBarMinMax:e,variableColorBarNorm:n,variableOpacity:r,updateVariableColorBar:i,originalColorBarMinMax:o}){const a=M.useMemo(()=>new Ltt(n==="log"),[n]),[s,l]=M.useState(()=>a.scale(e));M.useEffect(()=>{l(a.scale(e))},[a,e]);const c=(E,k)=>{Array.isArray(k)&&l(k)},u=(E,k)=>{if(Array.isArray(k)){const P=tN(a.scaleInv(k)).map(R=>Number.parseFloat(R));i(t,P,n,r)}},[f,d]=a.scale(o),h=f<d?d-f:1,p=Math.floor(Math.log10(h)),m=h*Math.pow(10,-p);let g=null;for(const E of[.25,.2,.15,.125,.1]){const k=m/E,I=Math.floor(k);if(Math.abs(I-k)<1e-10){g=I;break}}let v;g!==null&&g>=2?v=Math.max(2,Math.round(g/2)):(v=4,g=8);const y=f<d?h/g:.5,x=g+2*v,b=f-v*y,_=d+v*y,S=(_-b)/x,O=[b,f,d,_],C=tN(a.scaleInv(O)).map((E,k)=>({value:O[k],label:E}));return w.jsx(ry,{min:b,max:_,value:s,marks:C,step:S,valueLabelFormat:E=>rd(a.scaleInv(E)),onChange:c,onChangeCommitted:u,valueLabelDisplay:"auto",size:"small"})}const AR=5,ju={container:t=>({marginTop:t.spacing(2),marginBottom:t.spacing(2),display:"flex",flexDirection:"column",gap:1}),header:{display:"flex",alignItems:"center",justifyContent:"space-between"},title:{paddingLeft:2,fontWeight:"bold"},sliderBox:t=>({marginTop:t.spacing(1),marginLeft:t.spacing(AR),marginRight:t.spacing(AR),minWidth:320,width:`calc(100% - ${t.spacing(2*(AR+1))}px)`}),logLabel:{margin:0,paddingRight:2,fontWeight:"bold"},minMaxBox:{display:"flex",justifyContent:"center"},minTextField:{maxWidth:"8em",marginRight:2},maxTextField:{maxWidth:"8em",marginLeft:2}};function $tt({variableColorBar:t,variableColorBarName:e,variableColorBarMinMax:n,variableColorBarNorm:r,variableOpacity:i,updateVariableColorBar:o}){const[a,s]=M.useState(n),[l,c]=M.useState(n),[u,f]=M.useState(q9(n)),[d,h]=M.useState([!1,!1]);M.useEffect(()=>{f(q9(n))},[n]);const p=y=>{const x=y.target.value;f([x,u[1]]);const b=Number.parseFloat(x);let _=!1;if(!Number.isNaN(b)&&b<a[1]){if(b!==a[0]){const S=[b,a[1]];s(S),c(S),o(e,S,r,i)}}else _=!0;h([_,d[1]])},m=y=>{const x=y.target.value;f([u[0],x]);const b=Number.parseFloat(x);let _=!1;if(!Number.isNaN(b)&&b>a[0]){if(b!==a[1]){const S=[a[0],b];s(S),c(S),o(e,S,r,i)}}else _=!0;h([d[0],_])},g=()=>{const y=t.colorRecords,x=y[0].value,b=y[y.length-1].value,_=[x,b];s(_),c(_),o(e,_,r,i),h([!1,!1])},v=(y,x)=>{o(e,n,x?"log":"lin",i)};return w.jsxs(Ke,{sx:ju.container,children:[w.jsxs(Ke,{sx:ju.header,children:[w.jsx(At,{sx:ju.title,children:fe.get("Value Range")}),w.jsx("span",{style:{flexGrow:1}}),t.colorRecords&&w.jsx(Ya,{sx:{marginRight:1},icon:w.jsx(efe,{}),onClick:g,tooltipText:fe.get("Set min/max from color mapping values")}),w.jsx(Og,{sx:ju.logLabel,control:w.jsx(_t,{title:fe.get("Logarithmic scaling"),children:w.jsx(aie,{checked:r==="log",onChange:v,size:"small"})}),label:w.jsx(At,{variant:"body2",children:fe.get("Log-scaled")}),labelPlacement:"start"})]}),w.jsx(Ke,{sx:ju.sliderBox,children:w.jsx(Ntt,{variableColorBarName:e,variableColorBarMinMax:n,variableColorBarNorm:r,updateVariableColorBar:o,originalColorBarMinMax:l,variableOpacity:i})}),w.jsxs(Ke,{component:"form",sx:ju.minMaxBox,children:[w.jsx(cr,{sx:ju.minTextField,label:"Minimum",variant:"filled",size:"small",value:u[0],error:d[0],onChange:y=>p(y)}),w.jsx(cr,{sx:ju.maxTextField,label:"Maximum",variant:"filled",size:"small",value:u[1],error:d[1],onChange:y=>m(y)})]})]})}function q9(t){return[t[0]+"",t[1]+""]}function Ftt({variableColorBar:t,variableColorBarName:e,variableColorBarMinMax:n,variableColorBarNorm:r,variableOpacity:i,updateVariableColorBar:o,onOpenColorBarEditor:a}){const[s,l]=M.useState(null),c=f=>{l(f.currentTarget)},u=()=>{l(null)};return w.jsxs(w.Fragment,{children:[w.jsx(Ott,{colorBar:t,opacity:i,onClick:a}),w.jsx(Mtt,{minValue:n[0],maxValue:n[1],numTicks:5,logScaled:r==="log",onClick:c}),w.jsx(Ep,{anchorEl:s,open:!!s,onClose:u,anchorOrigin:{vertical:"bottom",horizontal:"left"},transformOrigin:{vertical:"top",horizontal:"center"},children:w.jsx($tt,{variableColorBar:t,variableColorBarName:e,variableColorBarMinMax:n,variableColorBarNorm:r,variableOpacity:i,updateVariableColorBar:o})})]})}var Jz={},jtt=ft;Object.defineProperty(Jz,"__esModule",{value:!0});var tfe=Jz.default=void 0,Btt=jtt(pt()),ztt=w;tfe=Jz.default=(0,Btt.default)((0,ztt.jsx)("path",{d:"M12 4.81V19c-3.31 0-6-2.63-6-5.87 0-1.56.62-3.03 1.75-4.14zM6.35 7.56C4.9 8.99 4 10.96 4 13.13 4 17.48 7.58 21 12 21s8-3.52 8-7.87c0-2.17-.9-4.14-2.35-5.57L12 2z"}),"InvertColors");var e4={},Utt=ft;Object.defineProperty(e4,"__esModule",{value:!0});var nfe=e4.default=void 0,Wtt=Utt(pt()),Vtt=w;nfe=e4.default=(0,Wtt.default)((0,Vtt.jsx)("path",{d:"M17.66 8 12 2.35 6.34 8C4.78 9.56 4 11.64 4 13.64s.78 4.11 2.34 5.67 3.61 2.35 5.66 2.35 4.1-.79 5.66-2.35S20 15.64 20 13.64 19.22 9.56 17.66 8M6 14c.01-2 .62-3.27 1.76-4.4L12 5.27l4.24 4.38C17.38 10.77 17.99 12 18 14z"}),"Opacity");const k0={container:{display:"flex",alignItems:"center",justifyContent:"space-between"},settingsBar:{display:"flex",gap:"1px"},toggleButton:{paddingTop:"2px",paddingBottom:"2px"},opacityContainer:{display:"flex",alignItems:"center"},opacityLabel:t=>({color:t.palette.text.secondary}),opacitySlider:{flexGrow:"1px",marginLeft:"10px",marginRight:"10px"}};function Gtt({variableColorBarName:t,variableColorBarMinMax:e,variableColorBarNorm:n,variableColorBar:r,variableOpacity:i,updateVariableColorBar:o}){const a=()=>{const c=!r.isAlpha;t=rE({...r,isAlpha:c}),o(t,e,n,i)},s=()=>{const c=!r.isReversed;t=rE({...r,isReversed:c}),o(t,e,n,i)},l=(c,u)=>{o(t,e,n,u)};return w.jsxs(w.Fragment,{children:[w.jsx(Ke,{sx:k0.container,children:w.jsxs(Ke,{sx:k0.settingsBar,children:[w.jsx(_t,{arrow:!0,title:fe.get("Hide small values"),children:w.jsx(Pn,{value:"alpha",selected:r.isAlpha,onChange:a,size:"small",children:w.jsx(nfe,{fontSize:"inherit"})})}),w.jsx(_t,{arrow:!0,title:fe.get("Reverse"),children:w.jsx(Pn,{value:"reverse",selected:r.isReversed,onChange:s,size:"small",children:w.jsx(tfe,{fontSize:"inherit"})})})]})}),w.jsxs(Ke,{component:"div",sx:k0.opacityContainer,children:[w.jsx(Ke,{component:"span",fontSize:"small",sx:k0.opacityLabel,children:fe.get("Opacity")}),w.jsx(ry,{min:0,max:1,value:i,step:.01,sx:k0.opacitySlider,onChange:l,size:"small"})]})]})}const Htt={colorBarGroupTitle:t=>({marginTop:t.spacing(2*e_),fontSize:"small",color:t.palette.text.secondary})};function rfe({title:t,description:e}){return w.jsx(_t,{arrow:!0,title:e,placement:"left",children:w.jsx(Ke,{sx:Htt.colorBarGroupTitle,children:t})})}const X9=t=>({marginTop:t.spacing(e_),height:20,borderWidth:1,borderStyle:"solid",cursor:"pointer"}),Q9={colorBarItem:t=>({...X9(t),borderColor:t.palette.mode==="dark"?"lightgray":"darkgray"}),colorBarItemSelected:t=>({...X9(t),borderColor:"blue"})};function t4({imageData:t,selected:e,onSelect:n,width:r,title:i}){let o=w.jsx("img",{src:t?`data:image/png;base64,${t}`:void 0,alt:t?"color bar":"error",width:"100%",height:"100%",onClick:n});return i&&(o=w.jsx(_t,{arrow:!0,title:i,placement:"left",children:o})),w.jsx(Ke,{width:r||Py,sx:e?Q9.colorBarItemSelected:Q9.colorBarItem,children:o})}function qtt({colorBarGroup:t,selectedColorBarName:e,onSelectColorBar:n,images:r}){return w.jsxs(w.Fragment,{children:[w.jsx(rfe,{title:t.title,description:t.description}),t.names.map(i=>w.jsx(t4,{title:i,imageData:r[i],selected:i===e,onSelect:()=>n(i)},i))]})}var n4={},Xtt=ft;Object.defineProperty(n4,"__esModule",{value:!0});var dw=n4.default=void 0,Qtt=Xtt(pt()),Ytt=w;dw=n4.default=(0,Qtt.default)((0,Ytt.jsx)("path",{d:"M13 7h-2v4H7v2h4v4h2v-4h4v-2h-4zm-1-5C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2m0 18c-4.41 0-8-3.59-8-8s3.59-8 8-8 8 3.59 8 8-3.59 8-8 8"}),"AddCircleOutline");function ife(){const t=M.useRef(),e=M.useRef(()=>{t.current&&(t.current(),t.current=void 0)}),n=M.useRef(r=>{t.current=r});return M.useEffect(()=>e.current,[]),[e.current,n.current]}var r4={},Ktt=ft;Object.defineProperty(r4,"__esModule",{value:!0});var ofe=r4.default=void 0,Ztt=Ktt(pt()),Jtt=w;ofe=r4.default=(0,Ztt.default)((0,Jtt.jsx)("path",{d:"M12 2C6.47 2 2 6.47 2 12s4.47 10 10 10 10-4.47 10-10S17.53 2 12 2m5 13.59L15.59 17 12 13.41 8.41 17 7 15.59 10.59 12 7 8.41 8.41 7 12 10.59 15.59 7 17 8.41 13.41 12z"}),"Cancel");var i4={},ent=ft;Object.defineProperty(i4,"__esModule",{value:!0});var afe=i4.default=void 0,tnt=ent(pt()),nnt=w;afe=i4.default=(0,tnt.default)((0,nnt.jsx)("path",{d:"M9 16.2 4.8 12l-1.4 1.4L9 19 21 7l-1.4-1.4z"}),"Done");function rnt({anchorEl:t,markdownText:e,open:n,onClose:r}){if(!e)return null;const i={code:o=>{const{node:a,...s}=o;return w.jsx("code",{...s,style:{color:"green"}})}};return w.jsx(Ep,{anchorEl:t,open:n,onClose:r,children:w.jsx(Ho,{sx:{width:"32em",overflowY:"auto",fontSize:"smaller",paddingLeft:2,paddingRight:2},children:w.jsx(G2,{children:e,components:i,linkTarget:"_blank"})})})}function sfe({size:t,helpUrl:e}){const[n,r]=M.useState(null),i=M.useRef(null),o=Lce(e),a=()=>{r(i.current)},s=()=>{r(null)};return w.jsxs(w.Fragment,{children:[w.jsx(Ot,{onClick:a,size:t,ref:i,children:w.jsx(j5,{fontSize:"inherit"})}),w.jsx(rnt,{anchorEl:n,open:!!n,onClose:s,markdownText:o})]})}const Y9={container:{display:"flex",justifyContent:"space-between",gap:.2},doneCancel:{display:"flex",gap:.2}};function hw({onDone:t,onCancel:e,doneDisabled:n,cancelDisabled:r,size:i,helpUrl:o}){return w.jsxs(Ke,{sx:Y9.container,children:[w.jsx(Ke,{children:o&&w.jsx(sfe,{size:i,helpUrl:o})}),w.jsxs(Ke,{sx:Y9.doneCancel,children:[w.jsx(Ot,{onClick:t,color:"primary",disabled:n,size:i,children:w.jsx(afe,{fontSize:"inherit"})}),w.jsx(Ot,{onClick:e,color:"primary",disabled:r,size:i,children:w.jsx(ofe,{fontSize:"inherit"})})]})]})}const RR={radioGroup:{marginLeft:1},radio:{padding:"4px"},label:{fontSize:"small"}},int=[["continuous","Contin.","Continuous color assignment, where each value represents a support point of a color gradient"],["stepwise","Stepwise","Stepwise color mapping where values are bounds of value ranges mapped to the same single color"],["categorical","Categ.","Values represent unique categories or indexes that are mapped to a color"]];function ont({colorMapType:t,setColorMapType:e}){return w.jsx(E5,{row:!0,value:t,onChange:(n,r)=>{e(r)},sx:RR.radioGroup,children:int.map(([n,r,i])=>w.jsx(_t,{arrow:!0,title:fe.get(i),children:w.jsx(Og,{value:n,control:w.jsx(Vx,{size:"small",sx:RR.radio}),label:w.jsx(Ke,{component:"span",sx:RR.label,children:fe.get(r)})})},n))})}function ant({userColorBar:t,updateUserColorBar:e,selected:n,onSelect:r,onDone:i,onCancel:o}){const a=l=>{e({...t,code:l.currentTarget.value})},s=l=>{e({...t,type:l})};return w.jsxs(Ke,{children:[w.jsx(t4,{imageData:t.imageData,title:t.errorMessage,selected:n,onSelect:r}),w.jsx(ont,{colorMapType:t.type,setColorMapType:s}),w.jsx(cr,{label:"Color mapping",placeholder:hoe,multiline:!0,fullWidth:!0,size:"small",minRows:3,sx:{marginTop:1,fontFamily:"monospace"},value:t.code,onChange:a,color:t.errorMessage?"error":"primary",inputProps:{style:{fontFamily:"monospace",fontSize:12}}}),w.jsx(hw,{onDone:i,onCancel:o,doneDisabled:!!t.errorMessage,size:"small",helpUrl:fe.get("docs/color-mappings.en.md")})]})}var o4={},snt=ft;Object.defineProperty(o4,"__esModule",{value:!0});var lfe=o4.default=void 0,lnt=snt(pt()),cnt=w;lfe=o4.default=(0,lnt.default)((0,cnt.jsx)("path",{d:"M6 10c-1.1 0-2 .9-2 2s.9 2 2 2 2-.9 2-2-.9-2-2-2m12 0c-1.1 0-2 .9-2 2s.9 2 2 2 2-.9 2-2-.9-2-2-2m-6 0c-1.1 0-2 .9-2 2s.9 2 2 2 2-.9 2-2-.9-2-2-2"}),"MoreHoriz");const unt={container:{display:"flex",alignItems:"center",width:Py,height:Jue,gap:e_,marginTop:e_}};function fnt({imageData:t,title:e,selected:n,onEdit:r,onRemove:i,onSelect:o,disabled:a}){const[s,l]=M.useState(null),c=p=>{l(p.currentTarget)},u=()=>{l(null)},f=()=>{l(null),r()},d=()=>{l(null),i()},h=!!s;return w.jsxs(w.Fragment,{children:[w.jsxs(Ke,{sx:unt.container,children:[w.jsx(t4,{imageData:t,selected:n,onSelect:o,width:Py-20,title:e}),w.jsx(Ot,{size:"small",onClick:c,children:w.jsx(lfe,{fontSize:"inherit"})})]}),w.jsx(Ep,{anchorOrigin:{vertical:"center",horizontal:"center"},transformOrigin:{vertical:"center",horizontal:"center"},open:h,anchorEl:s,onClose:u,children:w.jsxs(Ke,{children:[w.jsx(Ot,{onClick:f,size:"small",disabled:a,children:w.jsx(Fp,{fontSize:"inherit"})}),w.jsx(Ot,{onClick:d,size:"small",disabled:a,children:w.jsx(lw,{fontSize:"inherit"})})]})})]})}const dnt={container:{display:"flex",justifyContent:"space-between",alignItems:"center",gap:1}};function hnt({colorBarGroup:t,selectedColorBarName:e,onSelectColorBar:n,userColorBars:r,addUserColorBar:i,removeUserColorBar:o,updateUserColorBar:a,updateUserColorBars:s,storeSettings:l}){const[c,u]=M.useState({}),[f,d]=ife(),h=M.useMemo(()=>r.findIndex(x=>x.id===c.colorBarId),[r,c.colorBarId]),p=()=>{d(()=>s(r));const x=Js("ucb");i(x),u({action:"add",colorBarId:x})},m=x=>{d(()=>s(r)),u({action:"edit",colorBarId:x})},g=x=>{d(void 0),o(x)},v=()=>{d(void 0),u({}),l()},y=()=>{f(),u({})};return w.jsxs(w.Fragment,{children:[w.jsxs(Ke,{sx:dnt.container,children:[w.jsx(rfe,{title:fe.get(t.title),description:fe.get(t.description)}),w.jsx(Ot,{onClick:p,size:"small",color:"primary",disabled:!!c.action,children:w.jsx(dw,{fontSize:"inherit"})})]}),r.map(x=>x.id===c.colorBarId&&h>=0?w.jsx(ant,{userColorBar:x,updateUserColorBar:a,selected:x.id===e,onSelect:()=>n(x.id),onDone:v,onCancel:y},x.id):w.jsx(fnt,{imageData:x.imageData,title:x.errorMessage,disabled:!!c.action,selected:x.id===e,onSelect:()=>n(x.id),onEdit:()=>m(x.id),onRemove:()=>g(x.id)},x.id))]})}function pnt({variableColorBarName:t,variableColorBarMinMax:e,variableColorBarNorm:n,variableColorBar:r,variableOpacity:i,updateVariableColorBar:o,colorBars:a,userColorBars:s,addUserColorBar:l,removeUserColorBar:c,updateUserColorBar:u,updateUserColorBars:f,storeSettings:d}){const h=p=>{t=rE({...r,baseName:p}),o(t,e,n,i)};return w.jsx(w.Fragment,{children:a.groups.map(p=>p.title===doe?w.jsx(hnt,{colorBarGroup:p,selectedColorBarName:r.baseName,onSelectColorBar:h,userColorBars:s,addUserColorBar:l,removeUserColorBar:c,updateUserColorBar:u,updateUserColorBars:f,storeSettings:d},p.title):w.jsx(qtt,{colorBarGroup:p,selectedColorBarName:r.baseName,onSelectColorBar:h,images:a.images},p.title))})}const mnt={colorBarBox:t=>({marginTop:t.spacing(WS-2*e_),marginLeft:t.spacing(WS),marginRight:t.spacing(WS),marginBottom:t.spacing(WS)})};function gnt(t){const{colorBars:e,userColorBars:n,addUserColorBar:r,removeUserColorBar:i,updateUserColorBar:o,updateUserColorBars:a,...s}=t;return w.jsxs(Ke,{sx:mnt.colorBarBox,children:[w.jsx(Gtt,{...s}),w.jsx(pnt,{...s,colorBars:e,userColorBars:n,addUserColorBar:r,removeUserColorBar:i,updateUserColorBar:o,updateUserColorBars:a})]})}const K9={container:t=>({position:"absolute",zIndex:1e3,top:10,borderRadius:"5px",borderWidth:"1px",borderStyle:"solid",borderColor:"#00000020",backgroundColor:"#FFFFFFAA",color:"black",maxWidth:`${Py+20}px`,paddingLeft:t.spacing(1.5),paddingRight:t.spacing(1.5),paddingBottom:t.spacing(.5),paddingTop:t.spacing(.5)}),title:t=>({fontSize:"small",fontWeight:"bold",width:"100%",display:"flex",wordBreak:"break-word",wordWrap:"break-word",justifyContent:"center",paddingBottom:t.spacing(.5)})};function cfe(t){const{variableName:e,variableTitle:n,variableUnits:r,variableColorBar:i,style:o}=t,a=M.useRef(null),[s,l]=M.useState(null),c=()=>{l(a.current)},u=()=>{l(null)};if(!e)return null;const f=i.type==="categorical"?n||e:`${n||e} (${r||"-"})`;return w.jsxs(Ke,{sx:K9.container,style:o,ref:a,children:[w.jsx(At,{sx:K9.title,children:f}),i.type==="categorical"?w.jsx(Stt,{categories:i.colorRecords,onOpenColorBarEditor:c,...t}):w.jsx(Ftt,{onOpenColorBarEditor:c,...t}),w.jsx(Ep,{anchorEl:s,open:!!s,onClose:u,anchorOrigin:{vertical:"bottom",horizontal:"left"},transformOrigin:{vertical:"top",horizontal:"left"},children:w.jsx(gnt,{...t})})]})}const vnt=t=>({variableName:yy(t),variableTitle:BWe(t),variableUnits:UWe(t),variableColorBarName:O2(t),variableColorBarMinMax:ose(t),variableColorBarNorm:lse(t),variableColorBar:HB(t),variableOpacity:pse(t),userColorBars:Dp(t),colorBars:T2(t),style:{right:10}}),ynt={updateVariableColorBar:h8e,addUserColorBar:Vle,removeUserColorBar:qle,updateUserColorBar:Xle,updateUserColorBars:Kle,storeSettings:Wle},xnt=Jt(vnt,ynt)(cfe),bnt=t=>{const e=t.controlState.variableSplitPos;return{variableName:e?Kae(t):null,variableTitle:zWe(t),variableUnits:WWe(t),variableColorBarName:C2(t),variableColorBarMinMax:ase(t),variableColorBarNorm:cse(t),variableColorBar:fse(t),variableOpacity:mse(t),userColorBars:Dp(t),colorBars:T2(t),style:{left:e?e-280:0}}},_nt={updateVariableColorBar:p8e,addUserColorBar:Vle,removeUserColorBar:qle,updateUserColorBar:Xle,updateUserColorBars:Kle,storeSettings:Wle},wnt=Jt(bnt,_nt)(cfe),Snt={splitter:{position:"absolute",top:0,left:"50%",width:"6px",height:"100%",backgroundColor:"#ffffff60",zIndex:999,borderLeft:"0.5px solid #ffffffd0",borderRight:"0.5px solid #ffffffd0",cursor:"col-resize",boxShadow:"0px 0px 1px 0px black"}};function Ont({hidden:t,position:e,onPositionChange:n}){const r=M.useRef(null),i=M.useRef(([a,s])=>{r.current!==null&&n(r.current.offsetLeft+a)}),o=Kue(i.current);return M.useEffect(()=>{!t&&!En(e)&&r.current!==null&&r.current.parentElement!==null&&n(Math.round(r.current.parentElement.clientWidth/2))},[t,e,n]),t?null:w.jsx(Ke,{id:"MapSplitter",ref:r,sx:Snt.splitter,style:{left:En(e)?e:"50%"},onMouseDown:o})}const Cnt=t=>({hidden:!t.controlState.variableCompareMode,position:t.controlState.variableSplitPos}),Tnt={onPositionChange:A8e},Ent=Jt(Cnt,Tnt)(Ont);function Pnt(t,e,n,r,i,o,a){const s=M.useRef(0),[l,c]=M.useState(),[u,f]=M.useState(),[d,h]=M.useState(),p=M.useCallback(async(v,y,x,b,_)=>{_({dataset:v,variable:y,result:{fetching:!0}});try{const S=await z$e(e,v,y,x,b,a,null);console.info(y.name,"=",S),_({dataset:v,variable:y,result:{value:S.value}})}catch(S){_({dataset:v,variable:y,result:{error:S}})}},[e,a]),m=M.useCallback(v=>{const y=v.map;if(!t||!n||!r||!y){f(void 0),h(void 0);return}const x=v.pixel[0],b=v.pixel[1],_=a2(v.coordinate,y.getView().getProjection().getCode(),"EPSG:4326"),S=_[0],O=_[1];c({pixelX:x,pixelY:b,lon:S,lat:O});const C=new Date().getTime();C-s.current>=500&&(s.current=C,p(n,r,S,O,f).finally(()=>{i&&o&&p(i,o,S,O,h)}))},[p,t,n,r,i,o]),g=Ga.map;return M.useEffect(()=>{if(t&&g){const v=y=>{y.dragging?c(void 0):m(y)};return g.on("pointermove",v),()=>{g.un("pointermove",v)}}else c(void 0)},[t,g,m]),M.useMemo(()=>l&&u?{location:l,payload:u,payload2:d}:null,[l,u,d])}const vc={container:{display:"grid",gridTemplateColumns:"auto minmax(60px, auto)",gap:0,padding:1,fontSize:"small"},labelItem:{paddingRight:1},valueItem:{textAlign:"right",fontFamily:"monospace"}};function Mnt({location:t,payload:e,payload2:n}){return w.jsxs(Ke,{sx:vc.container,children:[w.jsx(Ke,{sx:vc.labelItem,children:"Longitude"}),w.jsx(Ke,{sx:vc.valueItem,children:rd(t.lon,4)}),w.jsx(Ke,{sx:vc.labelItem,children:"Latitude"}),w.jsx(Ke,{sx:vc.valueItem,children:rd(t.lat,4)}),w.jsx(Ke,{sx:vc.labelItem,children:Z9(e)}),w.jsx(Ke,{sx:vc.valueItem,children:J9(e)}),n&&w.jsx(Ke,{sx:vc.labelItem,children:Z9(n)}),n&&w.jsx(Ke,{sx:vc.valueItem,children:J9(n)})]})}function Z9(t){const e=t.variable;return e.title||e.name}function J9(t){const e=t.result;return e.error?`${e.error}`:e.fetching?"...":En(e.value)?rd(e.value,4):"---"}const knt={container:{position:"absolute",zIndex:1e3,backgroundColor:"#000000A0",color:"#fff",border:"1px solid #FFFFFF50",borderRadius:"4px",transform:"translateX(3%)",pointerEvents:"none"}};function Ant({enabled:t,serverUrl:e,dataset1:n,variable1:r,dataset2:i,variable2:o,time:a}){const s=Pnt(t,e,n,r,i,o,a);if(!s)return null;const{pixelX:l,pixelY:c}=s.location;return w.jsx(Ke,{sx:{...knt.container,left:l,top:c},children:w.jsx(Mnt,{...s})})}const Rnt=t=>({enabled:t.controlState.mapPointInfoBoxEnabled,serverUrl:pi(t).url,dataset1:qr(t),variable1:vo(t),dataset2:Sd(t),variable2:Su(t),time:Sy(t)}),Int={},Dnt=Jt(Rnt,Int)(Ant);var a4={},Lnt=ft;Object.defineProperty(a4,"__esModule",{value:!0});var ufe=a4.default=void 0,Nnt=Lnt(pt()),$nt=w;ufe=a4.default=(0,Nnt.default)((0,$nt.jsx)("path",{d:"M10 3H5c-1.1 0-2 .9-2 2v14c0 1.1.9 2 2 2h5v2h2V1h-2zm0 15H5l5-6zm9-15h-5v2h5v13l-5-6v9h5c1.1 0 2-.9 2-2V5c0-1.1-.9-2-2-2"}),"Compare");var s4={},Fnt=ft;Object.defineProperty(s4,"__esModule",{value:!0});var l4=s4.default=void 0,jnt=Fnt(pt()),Bnt=w;l4=s4.default=(0,jnt.default)((0,Bnt.jsx)("path",{d:"m11.99 18.54-7.37-5.73L3 14.07l9 7 9-7-1.63-1.27zM12 16l7.36-5.73L21 9l-9-7-9 7 1.63 1.27z"}),"Layers");var c4={},znt=ft;Object.defineProperty(c4,"__esModule",{value:!0});var ffe=c4.default=void 0,Unt=znt(pt()),Wnt=w;ffe=c4.default=(0,Unt.default)((0,Wnt.jsx)("path",{d:"M20 2H4c-1.1 0-1.99.9-1.99 2L2 22l4-4h14c1.1 0 2-.9 2-2V4c0-1.1-.9-2-2-2m-2 12H6v-2h12zm0-3H6V9h12zm0-3H6V6h12z"}),"Message");const e7={position:"absolute",display:"flex",flexDirection:"column",zIndex:1e3};function Vnt({style:t,sx:e,children:n}){return w.jsx(Ke,{className:"ol-unselectable ol-control",sx:e,style:t?{...e7,...t}:e7,children:n})}const dfe={width:"1.375em",height:"1.375em"},Gnt={...dfe,backgroundColor:"rgba(0,80,180,0.9)"},Hnt={tooltip:{sx:{backgroundColor:"#4A4A4A",border:"1px solid white",borderRadius:0}}};function IR({icon:t,tooltipTitle:e,onClick:n,selected:r,onSelect:i}){const o=a=>{i&&i(a,!r),n&&n(a)};return e&&(t=w.jsx(_t,{title:e,componentsProps:Hnt,children:t})),w.jsx(Ot,{onClick:o,style:r?Gnt:dfe,children:t})}const qnt={left:"0.5em",top:65};function Xnt({layerMenuOpen:t,setLayerMenuOpen:e,variableCompareMode:n,setVariableCompareMode:r,mapPointInfoBoxEnabled:i,setMapPointInfoBoxEnabled:o}){return w.jsxs(Vnt,{style:qnt,children:[w.jsx(IR,{icon:w.jsx(l4,{fontSize:"small"}),tooltipTitle:fe.get("Show or hide layers panel"),selected:t,onSelect:(a,s)=>void e(s)}),w.jsx(IR,{icon:w.jsx(ufe,{fontSize:"small"}),tooltipTitle:fe.get("Turn layer split mode on or off"),selected:n,onSelect:(a,s)=>void r(s)}),w.jsx(IR,{icon:w.jsx(ffe,{fontSize:"small"}),tooltipTitle:fe.get("Turn info box on or off"),selected:i,onSelect:(a,s)=>void o(s)})]})}const Qnt=t=>({layerMenuOpen:t.controlState.layerMenuOpen,variableCompareMode:t.controlState.variableCompareMode,mapPointInfoBoxEnabled:t.controlState.mapPointInfoBoxEnabled}),Ynt={setLayerMenuOpen:Ple,setVariableCompareMode:k8e,setMapPointInfoBoxEnabled:M8e},Knt=Jt(Qnt,Ynt)(Xnt),Znt=(t,e)=>({mapId:"map",locale:t.controlState.locale,variableLayer:hVe(t),variable2Layer:pVe(t),rgbLayer:mVe(t),rgb2Layer:gVe(t),datasetBoundaryLayer:dVe(t),placeGroupLayers:bVe(t),colorBarLegend:w.jsx(xnt,{}),colorBarLegend2:w.jsx(wnt,{}),mapSplitter:w.jsx(Ent,{}),mapPointInfoBox:w.jsx(Dnt,{}),mapControlActions:w.jsx(Knt,{}),userDrawnPlaceGroupName:t.controlState.userDrawnPlaceGroupName,userPlaceGroups:ew(t),userPlaceGroupsVisibility:QWe(t),showUserPlaces:Zae(t),mapInteraction:t.controlState.mapInteraction,mapProjection:wd(t),selectedPlaceId:t.controlState.selectedPlaceId,places:rw(t),baseMapLayer:OVe(t),overlayLayer:CVe(t),imageSmoothing:nw(t),variableSplitPos:t.controlState.variableSplitPos,onMapRef:e.onMapRef}),Jnt={addDrawnUserPlace:HVe,importUserPlacesFromText:Vse,selectPlace:M2},t7=Jt(Znt,Jnt)(btt);var u4={},ert=ft;Object.defineProperty(u4,"__esModule",{value:!0});var f4=u4.default=void 0,trt=ert(pt()),nrt=w;f4=u4.default=(0,trt.default)((0,nrt.jsx)("path",{d:"M12 2C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2m1 15h-2v-6h2zm0-8h-2V7h2z"}),"Info");var d4={},rrt=ft;Object.defineProperty(d4,"__esModule",{value:!0});var hfe=d4.default=void 0,irt=rrt(pt()),ort=w;hfe=d4.default=(0,irt.default)((0,ort.jsx)("path",{d:"m2 19.99 7.5-7.51 4 4 7.09-7.97L22 9.92l-8.5 9.56-4-4-6 6.01zm1.5-4.5 6-6.01 4 4L22 3.92l-1.41-1.41-7.09 7.97-4-4L2 13.99z"}),"StackedLineChart");var h4={},art=ft;Object.defineProperty(h4,"__esModule",{value:!0});var pfe=h4.default=void 0,srt=art(pt()),lrt=w;pfe=h4.default=(0,srt.default)((0,lrt.jsx)("path",{d:"M7.52 21.48C4.25 19.94 1.91 16.76 1.55 13H.05C.56 19.16 5.71 24 12 24l.66-.03-3.81-3.81zm.89-6.52c-.19 0-.37-.03-.52-.08-.16-.06-.29-.13-.4-.24-.11-.1-.2-.22-.26-.37-.06-.14-.09-.3-.09-.47h-1.3c0 .36.07.68.21.95.14.27.33.5.56.69.24.18.51.32.82.41.3.1.62.15.96.15.37 0 .72-.05 1.03-.15.32-.1.6-.25.83-.44s.42-.43.55-.72c.13-.29.2-.61.2-.97 0-.19-.02-.38-.07-.56-.05-.18-.12-.35-.23-.51-.1-.16-.24-.3-.4-.43-.17-.13-.37-.23-.61-.31.2-.09.37-.2.52-.33.15-.13.27-.27.37-.42.1-.15.17-.3.22-.46.05-.16.07-.32.07-.48 0-.36-.06-.68-.18-.96-.12-.28-.29-.51-.51-.69-.2-.19-.47-.33-.77-.43C9.1 8.05 8.76 8 8.39 8c-.36 0-.69.05-1 .16-.3.11-.57.26-.79.45-.21.19-.38.41-.51.67-.12.26-.18.54-.18.85h1.3c0-.17.03-.32.09-.45s.14-.25.25-.34c.11-.09.23-.17.38-.22.15-.05.3-.08.48-.08.4 0 .7.1.89.31.19.2.29.49.29.86 0 .18-.03.34-.08.49-.05.15-.14.27-.25.37-.11.1-.25.18-.41.24-.16.06-.36.09-.58.09H7.5v1.03h.77c.22 0 .42.02.6.07s.33.13.45.23c.12.11.22.24.29.4.07.16.1.35.1.57 0 .41-.12.72-.35.93-.23.23-.55.33-.95.33m8.55-5.92c-.32-.33-.7-.59-1.14-.77-.43-.18-.92-.27-1.46-.27H12v8h2.3c.55 0 1.06-.09 1.51-.27.45-.18.84-.43 1.16-.76.32-.33.57-.73.74-1.19.17-.47.26-.99.26-1.57v-.4c0-.58-.09-1.1-.26-1.57-.18-.47-.43-.87-.75-1.2m-.39 3.16c0 .42-.05.79-.14 1.13-.1.33-.24.62-.43.85-.19.23-.43.41-.71.53-.29.12-.62.18-.99.18h-.91V9.12h.97c.72 0 1.27.23 1.64.69.38.46.57 1.12.57 1.99zM12 0l-.66.03 3.81 3.81 1.33-1.33c3.27 1.55 5.61 4.72 5.96 8.48h1.5C23.44 4.84 18.29 0 12 0"}),"ThreeDRotation");var p4={},crt=ft;Object.defineProperty(p4,"__esModule",{value:!0});var mfe=p4.default=void 0,urt=crt(pt()),frt=w;mfe=p4.default=(0,urt.default)((0,frt.jsx)("path",{d:"M4 7v2c0 .55-.45 1-1 1H2v4h1c.55 0 1 .45 1 1v2c0 1.65 1.35 3 3 3h3v-2H7c-.55 0-1-.45-1-1v-2c0-1.3-.84-2.42-2-2.83v-.34C5.16 11.42 6 10.3 6 9V7c0-.55.45-1 1-1h3V4H7C5.35 4 4 5.35 4 7m17 3c-.55 0-1-.45-1-1V7c0-1.65-1.35-3-3-3h-3v2h3c.55 0 1 .45 1 1v2c0 1.3.84 2.42 2 2.83v.34c-1.16.41-2 1.52-2 2.83v2c0 .55-.45 1-1 1h-3v2h3c1.65 0 3-1.35 3-3v-2c0-.55.45-1 1-1h1v-4z"}),"DataObject");var m4={},drt=ft;Object.defineProperty(m4,"__esModule",{value:!0});var gfe=m4.default=void 0,hrt=drt(pt()),prt=w;gfe=m4.default=(0,hrt.default)((0,prt.jsx)("path",{d:"M19 5v14H5V5zm1.1-2H3.9c-.5 0-.9.4-.9.9v16.2c0 .4.4.9.9.9h16.2c.4 0 .9-.5.9-.9V3.9c0-.5-.5-.9-.9-.9M11 7h6v2h-6zm0 4h6v2h-6zm0 4h6v2h-6zM7 7h2v2H7zm0 4h2v2H7zm0 4h2v2H7z"}),"ListAlt");var g4={},mrt=ft;Object.defineProperty(g4,"__esModule",{value:!0});var vfe=g4.default=void 0,grt=mrt(pt()),vrt=w;vfe=g4.default=(0,grt.default)((0,vrt.jsx)("path",{d:"M12 2C8.13 2 5 5.13 5 9c0 5.25 7 13 7 13s7-7.75 7-13c0-3.87-3.13-7-7-7m0 9.5c-1.38 0-2.5-1.12-2.5-2.5s1.12-2.5 2.5-2.5 2.5 1.12 2.5 2.5-1.12 2.5-2.5 2.5"}),"Place");var v4={},yrt=ft;Object.defineProperty(v4,"__esModule",{value:!0});var yfe=v4.default=void 0,xrt=yrt(pt()),brt=w;yfe=v4.default=(0,xrt.default)((0,brt.jsx)("path",{d:"M2.5 4v3h5v12h3V7h5V4zm19 5h-9v3h3v7h3v-7h3z"}),"TextFields");var y4={},_rt=ft;Object.defineProperty(y4,"__esModule",{value:!0});var xfe=y4.default=void 0,wrt=_rt(pt()),Srt=w;xfe=y4.default=(0,wrt.default)((0,Srt.jsx)("path",{d:"M13 13v8h8v-8zM3 21h8v-8H3zM3 3v8h8V3zm13.66-1.31L11 7.34 16.66 13l5.66-5.66z"}),"Widgets");let xn=class bfe{lineAt(e){if(e<0||e>this.length)throw new RangeError(`Invalid position ${e} in document of length ${this.length}`);return this.lineInner(e,!1,1,0)}line(e){if(e<1||e>this.lines)throw new RangeError(`Invalid line number ${e} in ${this.lines}-line document`);return this.lineInner(e,!0,1,0)}replace(e,n,r){[e,n]=lv(this,e,n);let i=[];return this.decompose(0,e,i,2),r.length&&r.decompose(0,r.length,i,3),this.decompose(n,this.length,i,1),Tl.from(i,this.length-(n-e)+r.length)}append(e){return this.replace(this.length,this.length,e)}slice(e,n=this.length){[e,n]=lv(this,e,n);let r=[];return this.decompose(e,n,r,0),Tl.from(r,n-e)}eq(e){if(e==this)return!0;if(e.length!=this.length||e.lines!=this.lines)return!1;let n=this.scanIdentical(e,1),r=this.length-this.scanIdentical(e,-1),i=new eb(this),o=new eb(e);for(let a=n,s=n;;){if(i.next(a),o.next(a),a=0,i.lineBreak!=o.lineBreak||i.done!=o.done||i.value!=o.value)return!1;if(s+=i.value.length,i.done||s>=r)return!0}}iter(e=1){return new eb(this,e)}iterRange(e,n=this.length){return new _fe(this,e,n)}iterLines(e,n){let r;if(e==null)r=this.iter();else{n==null&&(n=this.lines+1);let i=this.line(e).from;r=this.iterRange(i,Math.max(i,n==this.lines+1?this.length:n<=1?0:this.line(n-1).to))}return new wfe(r)}toString(){return this.sliceString(0)}toJSON(){let e=[];return this.flatten(e),e}constructor(){}static of(e){if(e.length==0)throw new RangeError("A document must have at least one line");return e.length==1&&!e[0]?bfe.empty:e.length<=32?new Tr(e):Tl.from(Tr.split(e,[]))}};class Tr extends xn{constructor(e,n=Ort(e)){super(),this.text=e,this.length=n}get lines(){return this.text.length}get children(){return null}lineInner(e,n,r,i){for(let o=0;;o++){let a=this.text[o],s=i+a.length;if((n?r:s)>=e)return new Crt(i,s,r,a);i=s+1,r++}}decompose(e,n,r,i){let o=e<=0&&n>=this.length?this:new Tr(n7(this.text,e,n),Math.min(n,this.length)-Math.max(0,e));if(i&1){let a=r.pop(),s=$C(o.text,a.text.slice(),0,o.length);if(s.length<=32)r.push(new Tr(s,a.length+o.length));else{let l=s.length>>1;r.push(new Tr(s.slice(0,l)),new Tr(s.slice(l)))}}else r.push(o)}replace(e,n,r){if(!(r instanceof Tr))return super.replace(e,n,r);[e,n]=lv(this,e,n);let i=$C(this.text,$C(r.text,n7(this.text,0,e)),n),o=this.length+r.length-(n-e);return i.length<=32?new Tr(i,o):Tl.from(Tr.split(i,[]),o)}sliceString(e,n=this.length,r=`
`){[e,n]=lv(this,e,n);let i="";for(let o=0,a=0;o<=n&&a<this.text.length;a++){let s=this.text[a],l=o+s.length;o>e&&a&&(i+=r),e<l&&n>o&&(i+=s.slice(Math.max(0,e-o),n-o)),o=l+1}return i}flatten(e){for(let n of this.text)e.push(n)}scanIdentical(){return 0}static split(e,n){let r=[],i=-1;for(let o of e)r.push(o),i+=o.length+1,r.length==32&&(n.push(new Tr(r,i)),r=[],i=-1);return i>-1&&n.push(new Tr(r,i)),n}}class Tl extends xn{constructor(e,n){super(),this.children=e,this.length=n,this.lines=0;for(let r of e)this.lines+=r.lines}lineInner(e,n,r,i){for(let o=0;;o++){let a=this.children[o],s=i+a.length,l=r+a.lines-1;if((n?l:s)>=e)return a.lineInner(e,n,r,i);i=s+1,r=l+1}}decompose(e,n,r,i){for(let o=0,a=0;a<=n&&o<this.children.length;o++){let s=this.children[o],l=a+s.length;if(e<=l&&n>=a){let c=i&((a<=e?1:0)|(l>=n?2:0));a>=e&&l<=n&&!c?r.push(s):s.decompose(e-a,n-a,r,c)}a=l+1}}replace(e,n,r){if([e,n]=lv(this,e,n),r.lines<this.lines)for(let i=0,o=0;i<this.children.length;i++){let a=this.children[i],s=o+a.length;if(e>=o&&n<=s){let l=a.replace(e-o,n-o,r),c=this.lines-a.lines+l.lines;if(l.lines<c>>4&&l.lines>c>>6){let u=this.children.slice();return u[i]=l,new Tl(u,this.length-(n-e)+r.length)}return super.replace(o,s,l)}o=s+1}return super.replace(e,n,r)}sliceString(e,n=this.length,r=`
`){[e,n]=lv(this,e,n);let i="";for(let o=0,a=0;o<this.children.length&&a<=n;o++){let s=this.children[o],l=a+s.length;a>e&&o&&(i+=r),e<l&&n>a&&(i+=s.sliceString(e-a,n-a,r)),a=l+1}return i}flatten(e){for(let n of this.children)n.flatten(e)}scanIdentical(e,n){if(!(e instanceof Tl))return 0;let r=0,[i,o,a,s]=n>0?[0,0,this.children.length,e.children.length]:[this.children.length-1,e.children.length-1,-1,-1];for(;;i+=n,o+=n){if(i==a||o==s)return r;let l=this.children[i],c=e.children[o];if(l!=c)return r+l.scanIdentical(c,n);r+=l.length+1}}static from(e,n=e.reduce((r,i)=>r+i.length+1,-1)){let r=0;for(let h of e)r+=h.lines;if(r<32){let h=[];for(let p of e)p.flatten(h);return new Tr(h,n)}let i=Math.max(32,r>>5),o=i<<1,a=i>>1,s=[],l=0,c=-1,u=[];function f(h){let p;if(h.lines>o&&h instanceof Tl)for(let m of h.children)f(m);else h.lines>a&&(l>a||!l)?(d(),s.push(h)):h instanceof Tr&&l&&(p=u[u.length-1])instanceof Tr&&h.lines+p.lines<=32?(l+=h.lines,c+=h.length+1,u[u.length-1]=new Tr(p.text.concat(h.text),p.length+1+h.length)):(l+h.lines>i&&d(),l+=h.lines,c+=h.length+1,u.push(h))}function d(){l!=0&&(s.push(u.length==1?u[0]:Tl.from(u,c)),c=-1,l=u.length=0)}for(let h of e)f(h);return d(),s.length==1?s[0]:new Tl(s,n)}}xn.empty=new Tr([""],0);function Ort(t){let e=-1;for(let n of t)e+=n.length+1;return e}function $C(t,e,n=0,r=1e9){for(let i=0,o=0,a=!0;o<t.length&&i<=r;o++){let s=t[o],l=i+s.length;l>=n&&(l>r&&(s=s.slice(0,r-i)),i<n&&(s=s.slice(n-i)),a?(e[e.length-1]+=s,a=!1):e.push(s)),i=l+1}return e}function n7(t,e,n){return $C(t,[""],e,n)}class eb{constructor(e,n=1){this.dir=n,this.done=!1,this.lineBreak=!1,this.value="",this.nodes=[e],this.offsets=[n>0?1:(e instanceof Tr?e.text.length:e.children.length)<<1]}nextInner(e,n){for(this.done=this.lineBreak=!1;;){let r=this.nodes.length-1,i=this.nodes[r],o=this.offsets[r],a=o>>1,s=i instanceof Tr?i.text.length:i.children.length;if(a==(n>0?s:0)){if(r==0)return this.done=!0,this.value="",this;n>0&&this.offsets[r-1]++,this.nodes.pop(),this.offsets.pop()}else if((o&1)==(n>0?0:1)){if(this.offsets[r]+=n,e==0)return this.lineBreak=!0,this.value=`
`,this;e--}else if(i instanceof Tr){let l=i.text[a+(n<0?-1:0)];if(this.offsets[r]+=n,l.length>Math.max(0,e))return this.value=e==0?l:n>0?l.slice(e):l.slice(0,l.length-e),this;e-=l.length}else{let l=i.children[a+(n<0?-1:0)];e>l.length?(e-=l.length,this.offsets[r]+=n):(n<0&&this.offsets[r]--,this.nodes.push(l),this.offsets.push(n>0?1:(l instanceof Tr?l.text.length:l.children.length)<<1))}}}next(e=0){return e<0&&(this.nextInner(-e,-this.dir),e=this.value.length),this.nextInner(e,this.dir)}}class _fe{constructor(e,n,r){this.value="",this.done=!1,this.cursor=new eb(e,n>r?-1:1),this.pos=n>r?e.length:0,this.from=Math.min(n,r),this.to=Math.max(n,r)}nextInner(e,n){if(n<0?this.pos<=this.from:this.pos>=this.to)return this.value="",this.done=!0,this;e+=Math.max(0,n<0?this.pos-this.to:this.from-this.pos);let r=n<0?this.pos-this.from:this.to-this.pos;e>r&&(e=r),r-=e;let{value:i}=this.cursor.next(e);return this.pos+=(i.length+e)*n,this.value=i.length<=r?i:n<0?i.slice(i.length-r):i.slice(0,r),this.done=!this.value,this}next(e=0){return e<0?e=Math.max(e,this.from-this.pos):e>0&&(e=Math.min(e,this.to-this.pos)),this.nextInner(e,this.cursor.dir)}get lineBreak(){return this.cursor.lineBreak&&this.value!=""}}class wfe{constructor(e){this.inner=e,this.afterBreak=!0,this.value="",this.done=!1}next(e=0){let{done:n,lineBreak:r,value:i}=this.inner.next(e);return n&&this.afterBreak?(this.value="",this.afterBreak=!1):n?(this.done=!0,this.value=""):r?this.afterBreak?this.value="":(this.afterBreak=!0,this.next()):(this.value=i,this.afterBreak=!1),this}get lineBreak(){return!1}}typeof Symbol<"u"&&(xn.prototype[Symbol.iterator]=function(){return this.iter()},eb.prototype[Symbol.iterator]=_fe.prototype[Symbol.iterator]=wfe.prototype[Symbol.iterator]=function(){return this});let Crt=class{constructor(e,n,r,i){this.from=e,this.to=n,this.number=r,this.text=i}get length(){return this.to-this.from}};function lv(t,e,n){return e=Math.max(0,Math.min(t.length,e)),[e,Math.max(e,Math.min(t.length,n))]}let Mg="lc,34,7n,7,7b,19,,,,2,,2,,,20,b,1c,l,g,,2t,7,2,6,2,2,,4,z,,u,r,2j,b,1m,9,9,,o,4,,9,,3,,5,17,3,3b,f,,w,1j,,,,4,8,4,,3,7,a,2,t,,1m,,,,2,4,8,,9,,a,2,q,,2,2,1l,,4,2,4,2,2,3,3,,u,2,3,,b,2,1l,,4,5,,2,4,,k,2,m,6,,,1m,,,2,,4,8,,7,3,a,2,u,,1n,,,,c,,9,,14,,3,,1l,3,5,3,,4,7,2,b,2,t,,1m,,2,,2,,3,,5,2,7,2,b,2,s,2,1l,2,,,2,4,8,,9,,a,2,t,,20,,4,,2,3,,,8,,29,,2,7,c,8,2q,,2,9,b,6,22,2,r,,,,,,1j,e,,5,,2,5,b,,10,9,,2u,4,,6,,2,2,2,p,2,4,3,g,4,d,,2,2,6,,f,,jj,3,qa,3,t,3,t,2,u,2,1s,2,,7,8,,2,b,9,,19,3,3b,2,y,,3a,3,4,2,9,,6,3,63,2,2,,1m,,,7,,,,,2,8,6,a,2,,1c,h,1r,4,1c,7,,,5,,14,9,c,2,w,4,2,2,,3,1k,,,2,3,,,3,1m,8,2,2,48,3,,d,,7,4,,6,,3,2,5i,1m,,5,ek,,5f,x,2da,3,3x,,2o,w,fe,6,2x,2,n9w,4,,a,w,2,28,2,7k,,3,,4,,p,2,5,,47,2,q,i,d,,12,8,p,b,1a,3,1c,,2,4,2,2,13,,1v,6,2,2,2,2,c,,8,,1b,,1f,,,3,2,2,5,2,,,16,2,8,,6m,,2,,4,,fn4,,kh,g,g,g,a6,2,gt,,6a,,45,5,1ae,3,,2,5,4,14,3,4,,4l,2,fx,4,ar,2,49,b,4w,,1i,f,1k,3,1d,4,2,2,1x,3,10,5,,8,1q,,c,2,1g,9,a,4,2,,2n,3,2,,,2,6,,4g,,3,8,l,2,1l,2,,,,,m,,e,7,3,5,5f,8,2,3,,,n,,29,,2,6,,,2,,,2,,2,6j,,2,4,6,2,,2,r,2,2d,8,2,,,2,2y,,,,2,6,,,2t,3,2,4,,5,77,9,,2,6t,,a,2,,,4,,40,4,2,2,4,,w,a,14,6,2,4,8,,9,6,2,3,1a,d,,2,ba,7,,6,,,2a,m,2,7,,2,,2,3e,6,3,,,2,,7,,,20,2,3,,,,9n,2,f0b,5,1n,7,t4,,1r,4,29,,f5k,2,43q,,,3,4,5,8,8,2,7,u,4,44,3,1iz,1j,4,1e,8,,e,,m,5,,f,11s,7,,h,2,7,,2,,5,79,7,c5,4,15s,7,31,7,240,5,gx7k,2o,3k,6o".split(",").map(t=>t?parseInt(t,36):1);for(let t=1;t<Mg.length;t++)Mg[t]+=Mg[t-1];function Trt(t){for(let e=1;e<Mg.length;e+=2)if(Mg[e]>t)return Mg[e-1]<=t;return!1}function r7(t){return t>=127462&&t<=127487}const i7=8205;function ki(t,e,n=!0,r=!0){return(n?Sfe:Ert)(t,e,r)}function Sfe(t,e,n){if(e==t.length)return e;e&&Ofe(t.charCodeAt(e))&&Cfe(t.charCodeAt(e-1))&&e--;let r=Ci(t,e);for(e+=Ha(r);e<t.length;){let i=Ci(t,e);if(r==i7||i==i7||n&&Trt(i))e+=Ha(i),r=i;else if(r7(i)){let o=0,a=e-2;for(;a>=0&&r7(Ci(t,a));)o++,a-=2;if(o%2==0)break;e+=2}else break}return e}function Ert(t,e,n){for(;e>0;){let r=Sfe(t,e-2,n);if(r<e)return r;e--}return 0}function Ofe(t){return t>=56320&&t<57344}function Cfe(t){return t>=55296&&t<56320}function Ci(t,e){let n=t.charCodeAt(e);if(!Cfe(n)||e+1==t.length)return n;let r=t.charCodeAt(e+1);return Ofe(r)?(n-55296<<10)+(r-56320)+65536:n}function x4(t){return t<=65535?String.fromCharCode(t):(t-=65536,String.fromCharCode((t>>10)+55296,(t&1023)+56320))}function Ha(t){return t<65536?1:2}const nN=/\r\n?|\n/;var Pi=function(t){return t[t.Simple=0]="Simple",t[t.TrackDel=1]="TrackDel",t[t.TrackBefore=2]="TrackBefore",t[t.TrackAfter=3]="TrackAfter",t}(Pi||(Pi={}));class Ql{constructor(e){this.sections=e}get length(){let e=0;for(let n=0;n<this.sections.length;n+=2)e+=this.sections[n];return e}get newLength(){let e=0;for(let n=0;n<this.sections.length;n+=2){let r=this.sections[n+1];e+=r<0?this.sections[n]:r}return e}get empty(){return this.sections.length==0||this.sections.length==2&&this.sections[1]<0}iterGaps(e){for(let n=0,r=0,i=0;n<this.sections.length;){let o=this.sections[n++],a=this.sections[n++];a<0?(e(r,i,o),i+=o):i+=a,r+=o}}iterChangedRanges(e,n=!1){rN(this,e,n)}get invertedDesc(){let e=[];for(let n=0;n<this.sections.length;){let r=this.sections[n++],i=this.sections[n++];i<0?e.push(r,i):e.push(i,r)}return new Ql(e)}composeDesc(e){return this.empty?e:e.empty?this:Tfe(this,e)}mapDesc(e,n=!1){return e.empty?this:iN(this,e,n)}mapPos(e,n=-1,r=Pi.Simple){let i=0,o=0;for(let a=0;a<this.sections.length;){let s=this.sections[a++],l=this.sections[a++],c=i+s;if(l<0){if(c>e)return o+(e-i);o+=s}else{if(r!=Pi.Simple&&c>=e&&(r==Pi.TrackDel&&i<e&&c>e||r==Pi.TrackBefore&&i<e||r==Pi.TrackAfter&&c>e))return null;if(c>e||c==e&&n<0&&!s)return e==i||n<0?o:o+l;o+=l}i=c}if(e>i)throw new RangeError(`Position ${e} is out of range for changeset of length ${i}`);return o}touchesRange(e,n=e){for(let r=0,i=0;r<this.sections.length&&i<=n;){let o=this.sections[r++],a=this.sections[r++],s=i+o;if(a>=0&&i<=n&&s>=e)return i<e&&s>n?"cover":!0;i=s}return!1}toString(){let e="";for(let n=0;n<this.sections.length;){let r=this.sections[n++],i=this.sections[n++];e+=(e?" ":"")+r+(i>=0?":"+i:"")}return e}toJSON(){return this.sections}static fromJSON(e){if(!Array.isArray(e)||e.length%2||e.some(n=>typeof n!="number"))throw new RangeError("Invalid JSON representation of ChangeDesc");return new Ql(e)}static create(e){return new Ql(e)}}class Zr extends Ql{constructor(e,n){super(e),this.inserted=n}apply(e){if(this.length!=e.length)throw new RangeError("Applying change set to a document with the wrong length");return rN(this,(n,r,i,o,a)=>e=e.replace(i,i+(r-n),a),!1),e}mapDesc(e,n=!1){return iN(this,e,n,!0)}invert(e){let n=this.sections.slice(),r=[];for(let i=0,o=0;i<n.length;i+=2){let a=n[i],s=n[i+1];if(s>=0){n[i]=s,n[i+1]=a;let l=i>>1;for(;r.length<l;)r.push(xn.empty);r.push(a?e.slice(o,o+a):xn.empty)}o+=a}return new Zr(n,r)}compose(e){return this.empty?e:e.empty?this:Tfe(this,e,!0)}map(e,n=!1){return e.empty?this:iN(this,e,n,!0)}iterChanges(e,n=!1){rN(this,e,n)}get desc(){return Ql.create(this.sections)}filter(e){let n=[],r=[],i=[],o=new t_(this);e:for(let a=0,s=0;;){let l=a==e.length?1e9:e[a++];for(;s<l||s==l&&o.len==0;){if(o.done)break e;let u=Math.min(o.len,l-s);qi(i,u,-1);let f=o.ins==-1?-1:o.off==0?o.ins:0;qi(n,u,f),f>0&&Of(r,n,o.text),o.forward(u),s+=u}let c=e[a++];for(;s<c;){if(o.done)break e;let u=Math.min(o.len,c-s);qi(n,u,-1),qi(i,u,o.ins==-1?-1:o.off==0?o.ins:0),o.forward(u),s+=u}}return{changes:new Zr(n,r),filtered:Ql.create(i)}}toJSON(){let e=[];for(let n=0;n<this.sections.length;n+=2){let r=this.sections[n],i=this.sections[n+1];i<0?e.push(r):i==0?e.push([r]):e.push([r].concat(this.inserted[n>>1].toJSON()))}return e}static of(e,n,r){let i=[],o=[],a=0,s=null;function l(u=!1){if(!u&&!i.length)return;a<n&&qi(i,n-a,-1);let f=new Zr(i,o);s=s?s.compose(f.map(s)):f,i=[],o=[],a=0}function c(u){if(Array.isArray(u))for(let f of u)c(f);else if(u instanceof Zr){if(u.length!=n)throw new RangeError(`Mismatched change set length (got ${u.length}, expected ${n})`);l(),s=s?s.compose(u.map(s)):u}else{let{from:f,to:d=f,insert:h}=u;if(f>d||f<0||d>n)throw new RangeError(`Invalid change range ${f} to ${d} (in doc of length ${n})`);let p=h?typeof h=="string"?xn.of(h.split(r||nN)):h:xn.empty,m=p.length;if(f==d&&m==0)return;f<a&&l(),f>a&&qi(i,f-a,-1),qi(i,d-f,m),Of(o,i,p),a=d}}return c(e),l(!s),s}static empty(e){return new Zr(e?[e,-1]:[],[])}static fromJSON(e){if(!Array.isArray(e))throw new RangeError("Invalid JSON representation of ChangeSet");let n=[],r=[];for(let i=0;i<e.length;i++){let o=e[i];if(typeof o=="number")n.push(o,-1);else{if(!Array.isArray(o)||typeof o[0]!="number"||o.some((a,s)=>s&&typeof a!="string"))throw new RangeError("Invalid JSON representation of ChangeSet");if(o.length==1)n.push(o[0],0);else{for(;r.length<i;)r.push(xn.empty);r[i]=xn.of(o.slice(1)),n.push(o[0],r[i].length)}}}return new Zr(n,r)}static createSet(e,n){return new Zr(e,n)}}function qi(t,e,n,r=!1){if(e==0&&n<=0)return;let i=t.length-2;i>=0&&n<=0&&n==t[i+1]?t[i]+=e:e==0&&t[i]==0?t[i+1]+=n:r?(t[i]+=e,t[i+1]+=n):t.push(e,n)}function Of(t,e,n){if(n.length==0)return;let r=e.length-2>>1;if(r<t.length)t[t.length-1]=t[t.length-1].append(n);else{for(;t.length<r;)t.push(xn.empty);t.push(n)}}function rN(t,e,n){let r=t.inserted;for(let i=0,o=0,a=0;a<t.sections.length;){let s=t.sections[a++],l=t.sections[a++];if(l<0)i+=s,o+=s;else{let c=i,u=o,f=xn.empty;for(;c+=s,u+=l,l&&r&&(f=f.append(r[a-2>>1])),!(n||a==t.sections.length||t.sections[a+1]<0);)s=t.sections[a++],l=t.sections[a++];e(i,c,o,u,f),i=c,o=u}}}function iN(t,e,n,r=!1){let i=[],o=r?[]:null,a=new t_(t),s=new t_(e);for(let l=-1;;)if(a.ins==-1&&s.ins==-1){let c=Math.min(a.len,s.len);qi(i,c,-1),a.forward(c),s.forward(c)}else if(s.ins>=0&&(a.ins<0||l==a.i||a.off==0&&(s.len<a.len||s.len==a.len&&!n))){let c=s.len;for(qi(i,s.ins,-1);c;){let u=Math.min(a.len,c);a.ins>=0&&l<a.i&&a.len<=u&&(qi(i,0,a.ins),o&&Of(o,i,a.text),l=a.i),a.forward(u),c-=u}s.next()}else if(a.ins>=0){let c=0,u=a.len;for(;u;)if(s.ins==-1){let f=Math.min(u,s.len);c+=f,u-=f,s.forward(f)}else if(s.ins==0&&s.len<u)u-=s.len,s.next();else break;qi(i,c,l<a.i?a.ins:0),o&&l<a.i&&Of(o,i,a.text),l=a.i,a.forward(a.len-u)}else{if(a.done&&s.done)return o?Zr.createSet(i,o):Ql.create(i);throw new Error("Mismatched change set lengths")}}function Tfe(t,e,n=!1){let r=[],i=n?[]:null,o=new t_(t),a=new t_(e);for(let s=!1;;){if(o.done&&a.done)return i?Zr.createSet(r,i):Ql.create(r);if(o.ins==0)qi(r,o.len,0,s),o.next();else if(a.len==0&&!a.done)qi(r,0,a.ins,s),i&&Of(i,r,a.text),a.next();else{if(o.done||a.done)throw new Error("Mismatched change set lengths");{let l=Math.min(o.len2,a.len),c=r.length;if(o.ins==-1){let u=a.ins==-1?-1:a.off?0:a.ins;qi(r,l,u,s),i&&u&&Of(i,r,a.text)}else a.ins==-1?(qi(r,o.off?0:o.len,l,s),i&&Of(i,r,o.textBit(l))):(qi(r,o.off?0:o.len,a.off?0:a.ins,s),i&&!a.off&&Of(i,r,a.text));s=(o.ins>l||a.ins>=0&&a.len>l)&&(s||r.length>c),o.forward2(l),a.forward(l)}}}}class t_{constructor(e){this.set=e,this.i=0,this.next()}next(){let{sections:e}=this.set;this.i<e.length?(this.len=e[this.i++],this.ins=e[this.i++]):(this.len=0,this.ins=-2),this.off=0}get done(){return this.ins==-2}get len2(){return this.ins<0?this.len:this.ins}get text(){let{inserted:e}=this.set,n=this.i-2>>1;return n>=e.length?xn.empty:e[n]}textBit(e){let{inserted:n}=this.set,r=this.i-2>>1;return r>=n.length&&!e?xn.empty:n[r].slice(this.off,e==null?void 0:this.off+e)}forward(e){e==this.len?this.next():(this.len-=e,this.off+=e)}forward2(e){this.ins==-1?this.forward(e):e==this.ins?this.next():(this.ins-=e,this.off+=e)}}class Sh{constructor(e,n,r){this.from=e,this.to=n,this.flags=r}get anchor(){return this.flags&32?this.to:this.from}get head(){return this.flags&32?this.from:this.to}get empty(){return this.from==this.to}get assoc(){return this.flags&8?-1:this.flags&16?1:0}get bidiLevel(){let e=this.flags&7;return e==7?null:e}get goalColumn(){let e=this.flags>>6;return e==16777215?void 0:e}map(e,n=-1){let r,i;return this.empty?r=i=e.mapPos(this.from,n):(r=e.mapPos(this.from,1),i=e.mapPos(this.to,-1)),r==this.from&&i==this.to?this:new Sh(r,i,this.flags)}extend(e,n=e){if(e<=this.anchor&&n>=this.anchor)return je.range(e,n);let r=Math.abs(e-this.anchor)>Math.abs(n-this.anchor)?e:n;return je.range(this.anchor,r)}eq(e,n=!1){return this.anchor==e.anchor&&this.head==e.head&&(!n||!this.empty||this.assoc==e.assoc)}toJSON(){return{anchor:this.anchor,head:this.head}}static fromJSON(e){if(!e||typeof e.anchor!="number"||typeof e.head!="number")throw new RangeError("Invalid JSON representation for SelectionRange");return je.range(e.anchor,e.head)}static create(e,n,r){return new Sh(e,n,r)}}class je{constructor(e,n){this.ranges=e,this.mainIndex=n}map(e,n=-1){return e.empty?this:je.create(this.ranges.map(r=>r.map(e,n)),this.mainIndex)}eq(e,n=!1){if(this.ranges.length!=e.ranges.length||this.mainIndex!=e.mainIndex)return!1;for(let r=0;r<this.ranges.length;r++)if(!this.ranges[r].eq(e.ranges[r],n))return!1;return!0}get main(){return this.ranges[this.mainIndex]}asSingle(){return this.ranges.length==1?this:new je([this.main],0)}addRange(e,n=!0){return je.create([e].concat(this.ranges),n?0:this.mainIndex+1)}replaceRange(e,n=this.mainIndex){let r=this.ranges.slice();return r[n]=e,je.create(r,this.mainIndex)}toJSON(){return{ranges:this.ranges.map(e=>e.toJSON()),main:this.mainIndex}}static fromJSON(e){if(!e||!Array.isArray(e.ranges)||typeof e.main!="number"||e.main>=e.ranges.length)throw new RangeError("Invalid JSON representation for EditorSelection");return new je(e.ranges.map(n=>Sh.fromJSON(n)),e.main)}static single(e,n=e){return new je([je.range(e,n)],0)}static create(e,n=0){if(e.length==0)throw new RangeError("A selection needs at least one range");for(let r=0,i=0;i<e.length;i++){let o=e[i];if(o.empty?o.from<=r:o.from<r)return je.normalized(e.slice(),n);r=o.to}return new je(e,n)}static cursor(e,n=0,r,i){return Sh.create(e,e,(n==0?0:n<0?8:16)|(r==null?7:Math.min(6,r))|(i??16777215)<<6)}static range(e,n,r,i){let o=(r??16777215)<<6|(i==null?7:Math.min(6,i));return n<e?Sh.create(n,e,48|o):Sh.create(e,n,(n>e?8:0)|o)}static normalized(e,n=0){let r=e[n];e.sort((i,o)=>i.from-o.from),n=e.indexOf(r);for(let i=1;i<e.length;i++){let o=e[i],a=e[i-1];if(o.empty?o.from<=a.to:o.from<a.to){let s=a.from,l=Math.max(o.to,a.to);i<=n&&n--,e.splice(--i,2,o.anchor>o.head?je.range(l,s):je.range(s,l))}}return new je(e,n)}}function Efe(t,e){for(let n of t.ranges)if(n.to>e)throw new RangeError("Selection points outside of document")}let b4=0;class ct{constructor(e,n,r,i,o){this.combine=e,this.compareInput=n,this.compare=r,this.isStatic=i,this.id=b4++,this.default=e([]),this.extensions=typeof o=="function"?o(this):o}get reader(){return this}static define(e={}){return new ct(e.combine||(n=>n),e.compareInput||((n,r)=>n===r),e.compare||(e.combine?(n,r)=>n===r:_4),!!e.static,e.enables)}of(e){return new FC([],this,0,e)}compute(e,n){if(this.isStatic)throw new Error("Can't compute a static facet");return new FC(e,this,1,n)}computeN(e,n){if(this.isStatic)throw new Error("Can't compute a static facet");return new FC(e,this,2,n)}from(e,n){return n||(n=r=>r),this.compute([e],r=>n(r.field(e)))}}function _4(t,e){return t==e||t.length==e.length&&t.every((n,r)=>n===e[r])}class FC{constructor(e,n,r,i){this.dependencies=e,this.facet=n,this.type=r,this.value=i,this.id=b4++}dynamicSlot(e){var n;let r=this.value,i=this.facet.compareInput,o=this.id,a=e[o]>>1,s=this.type==2,l=!1,c=!1,u=[];for(let f of this.dependencies)f=="doc"?l=!0:f=="selection"?c=!0:((n=e[f.id])!==null&&n!==void 0?n:1)&1||u.push(e[f.id]);return{create(f){return f.values[a]=r(f),1},update(f,d){if(l&&d.docChanged||c&&(d.docChanged||d.selection)||oN(f,u)){let h=r(f);if(s?!o7(h,f.values[a],i):!i(h,f.values[a]))return f.values[a]=h,1}return 0},reconfigure:(f,d)=>{let h,p=d.config.address[o];if(p!=null){let m=dE(d,p);if(this.dependencies.every(g=>g instanceof ct?d.facet(g)===f.facet(g):g instanceof mi?d.field(g,!1)==f.field(g,!1):!0)||(s?o7(h=r(f),m,i):i(h=r(f),m)))return f.values[a]=m,0}else h=r(f);return f.values[a]=h,1}}}}function o7(t,e,n){if(t.length!=e.length)return!1;for(let r=0;r<t.length;r++)if(!n(t[r],e[r]))return!1;return!0}function oN(t,e){let n=!1;for(let r of e)tb(t,r)&1&&(n=!0);return n}function Prt(t,e,n){let r=n.map(l=>t[l.id]),i=n.map(l=>l.type),o=r.filter(l=>!(l&1)),a=t[e.id]>>1;function s(l){let c=[];for(let u=0;u<r.length;u++){let f=dE(l,r[u]);if(i[u]==2)for(let d of f)c.push(d);else c.push(f)}return e.combine(c)}return{create(l){for(let c of r)tb(l,c);return l.values[a]=s(l),1},update(l,c){if(!oN(l,o))return 0;let u=s(l);return e.compare(u,l.values[a])?0:(l.values[a]=u,1)},reconfigure(l,c){let u=oN(l,r),f=c.config.facets[e.id],d=c.facet(e);if(f&&!u&&_4(n,f))return l.values[a]=d,0;let h=s(l);return e.compare(h,d)?(l.values[a]=d,0):(l.values[a]=h,1)}}}const a7=ct.define({static:!0});class mi{constructor(e,n,r,i,o){this.id=e,this.createF=n,this.updateF=r,this.compareF=i,this.spec=o,this.provides=void 0}static define(e){let n=new mi(b4++,e.create,e.update,e.compare||((r,i)=>r===i),e);return e.provide&&(n.provides=e.provide(n)),n}create(e){let n=e.facet(a7).find(r=>r.field==this);return((n==null?void 0:n.create)||this.createF)(e)}slot(e){let n=e[this.id]>>1;return{create:r=>(r.values[n]=this.create(r),1),update:(r,i)=>{let o=r.values[n],a=this.updateF(o,i);return this.compareF(o,a)?0:(r.values[n]=a,1)},reconfigure:(r,i)=>i.config.address[this.id]!=null?(r.values[n]=i.field(this),0):(r.values[n]=this.create(r),1)}}init(e){return[this,a7.of({field:this,create:e})]}get extension(){return this}}const uh={lowest:4,low:3,default:2,high:1,highest:0};function A0(t){return e=>new Pfe(e,t)}const Ed={highest:A0(uh.highest),high:A0(uh.high),default:A0(uh.default),low:A0(uh.low),lowest:A0(uh.lowest)};class Pfe{constructor(e,n){this.inner=e,this.prec=n}}class X2{of(e){return new aN(this,e)}reconfigure(e){return X2.reconfigure.of({compartment:this,extension:e})}get(e){return e.config.compartments.get(this)}}class aN{constructor(e,n){this.compartment=e,this.inner=n}}class fE{constructor(e,n,r,i,o,a){for(this.base=e,this.compartments=n,this.dynamicSlots=r,this.address=i,this.staticValues=o,this.facets=a,this.statusTemplate=[];this.statusTemplate.length<r.length;)this.statusTemplate.push(0)}staticFacet(e){let n=this.address[e.id];return n==null?e.default:this.staticValues[n>>1]}static resolve(e,n,r){let i=[],o=Object.create(null),a=new Map;for(let d of Mrt(e,n,a))d instanceof mi?i.push(d):(o[d.facet.id]||(o[d.facet.id]=[])).push(d);let s=Object.create(null),l=[],c=[];for(let d of i)s[d.id]=c.length<<1,c.push(h=>d.slot(h));let u=r==null?void 0:r.config.facets;for(let d in o){let h=o[d],p=h[0].facet,m=u&&u[d]||[];if(h.every(g=>g.type==0))if(s[p.id]=l.length<<1|1,_4(m,h))l.push(r.facet(p));else{let g=p.combine(h.map(v=>v.value));l.push(r&&p.compare(g,r.facet(p))?r.facet(p):g)}else{for(let g of h)g.type==0?(s[g.id]=l.length<<1|1,l.push(g.value)):(s[g.id]=c.length<<1,c.push(v=>g.dynamicSlot(v)));s[p.id]=c.length<<1,c.push(g=>Prt(g,p,h))}}let f=c.map(d=>d(s));return new fE(e,a,f,s,l,o)}}function Mrt(t,e,n){let r=[[],[],[],[],[]],i=new Map;function o(a,s){let l=i.get(a);if(l!=null){if(l<=s)return;let c=r[l].indexOf(a);c>-1&&r[l].splice(c,1),a instanceof aN&&n.delete(a.compartment)}if(i.set(a,s),Array.isArray(a))for(let c of a)o(c,s);else if(a instanceof aN){if(n.has(a.compartment))throw new RangeError("Duplicate use of compartment in extensions");let c=e.get(a.compartment)||a.inner;n.set(a.compartment,c),o(c,s)}else if(a instanceof Pfe)o(a.inner,a.prec);else if(a instanceof mi)r[s].push(a),a.provides&&o(a.provides,s);else if(a instanceof FC)r[s].push(a),a.facet.extensions&&o(a.facet.extensions,uh.default);else{let c=a.extension;if(!c)throw new Error(`Unrecognized extension value in extension set (${a}). This sometimes happens because multiple instances of @codemirror/state are loaded, breaking instanceof checks.`);o(c,s)}}return o(t,uh.default),r.reduce((a,s)=>a.concat(s))}function tb(t,e){if(e&1)return 2;let n=e>>1,r=t.status[n];if(r==4)throw new Error("Cyclic dependency between fields and/or facets");if(r&2)return r;t.status[n]=4;let i=t.computeSlot(t,t.config.dynamicSlots[n]);return t.status[n]=2|i}function dE(t,e){return e&1?t.config.staticValues[e>>1]:t.values[e>>1]}const Mfe=ct.define(),sN=ct.define({combine:t=>t.some(e=>e),static:!0}),kfe=ct.define({combine:t=>t.length?t[0]:void 0,static:!0}),Afe=ct.define(),Rfe=ct.define(),Ife=ct.define(),Dfe=ct.define({combine:t=>t.length?t[0]:!1});class lc{constructor(e,n){this.type=e,this.value=n}static define(){return new krt}}class krt{of(e){return new lc(this,e)}}class Art{constructor(e){this.map=e}of(e){return new Rt(this,e)}}class Rt{constructor(e,n){this.type=e,this.value=n}map(e){let n=this.type.map(this.value,e);return n===void 0?void 0:n==this.value?this:new Rt(this.type,n)}is(e){return this.type==e}static define(e={}){return new Art(e.map||(n=>n))}static mapEffects(e,n){if(!e.length)return e;let r=[];for(let i of e){let o=i.map(n);o&&r.push(o)}return r}}Rt.reconfigure=Rt.define();Rt.appendConfig=Rt.define();class Ur{constructor(e,n,r,i,o,a){this.startState=e,this.changes=n,this.selection=r,this.effects=i,this.annotations=o,this.scrollIntoView=a,this._doc=null,this._state=null,r&&Efe(r,n.newLength),o.some(s=>s.type==Ur.time)||(this.annotations=o.concat(Ur.time.of(Date.now())))}static create(e,n,r,i,o,a){return new Ur(e,n,r,i,o,a)}get newDoc(){return this._doc||(this._doc=this.changes.apply(this.startState.doc))}get newSelection(){return this.selection||this.startState.selection.map(this.changes)}get state(){return this._state||this.startState.applyTransaction(this),this._state}annotation(e){for(let n of this.annotations)if(n.type==e)return n.value}get docChanged(){return!this.changes.empty}get reconfigured(){return this.startState.config!=this.state.config}isUserEvent(e){let n=this.annotation(Ur.userEvent);return!!(n&&(n==e||n.length>e.length&&n.slice(0,e.length)==e&&n[e.length]=="."))}}Ur.time=lc.define();Ur.userEvent=lc.define();Ur.addToHistory=lc.define();Ur.remote=lc.define();function Rrt(t,e){let n=[];for(let r=0,i=0;;){let o,a;if(r<t.length&&(i==e.length||e[i]>=t[r]))o=t[r++],a=t[r++];else if(i<e.length)o=e[i++],a=e[i++];else return n;!n.length||n[n.length-1]<o?n.push(o,a):n[n.length-1]<a&&(n[n.length-1]=a)}}function Lfe(t,e,n){var r;let i,o,a;return n?(i=e.changes,o=Zr.empty(e.changes.length),a=t.changes.compose(e.changes)):(i=e.changes.map(t.changes),o=t.changes.mapDesc(e.changes,!0),a=t.changes.compose(i)),{changes:a,selection:e.selection?e.selection.map(o):(r=t.selection)===null||r===void 0?void 0:r.map(i),effects:Rt.mapEffects(t.effects,i).concat(Rt.mapEffects(e.effects,o)),annotations:t.annotations.length?t.annotations.concat(e.annotations):e.annotations,scrollIntoView:t.scrollIntoView||e.scrollIntoView}}function lN(t,e,n){let r=e.selection,i=kg(e.annotations);return e.userEvent&&(i=i.concat(Ur.userEvent.of(e.userEvent))),{changes:e.changes instanceof Zr?e.changes:Zr.of(e.changes||[],n,t.facet(kfe)),selection:r&&(r instanceof je?r:je.single(r.anchor,r.head)),effects:kg(e.effects),annotations:i,scrollIntoView:!!e.scrollIntoView}}function Nfe(t,e,n){let r=lN(t,e.length?e[0]:{},t.doc.length);e.length&&e[0].filter===!1&&(n=!1);for(let o=1;o<e.length;o++){e[o].filter===!1&&(n=!1);let a=!!e[o].sequential;r=Lfe(r,lN(t,e[o],a?r.changes.newLength:t.doc.length),a)}let i=Ur.create(t,r.changes,r.selection,r.effects,r.annotations,r.scrollIntoView);return Drt(n?Irt(i):i)}function Irt(t){let e=t.startState,n=!0;for(let i of e.facet(Afe)){let o=i(t);if(o===!1){n=!1;break}Array.isArray(o)&&(n=n===!0?o:Rrt(n,o))}if(n!==!0){let i,o;if(n===!1)o=t.changes.invertedDesc,i=Zr.empty(e.doc.length);else{let a=t.changes.filter(n);i=a.changes,o=a.filtered.mapDesc(a.changes).invertedDesc}t=Ur.create(e,i,t.selection&&t.selection.map(o),Rt.mapEffects(t.effects,o),t.annotations,t.scrollIntoView)}let r=e.facet(Rfe);for(let i=r.length-1;i>=0;i--){let o=r[i](t);o instanceof Ur?t=o:Array.isArray(o)&&o.length==1&&o[0]instanceof Ur?t=o[0]:t=Nfe(e,kg(o),!1)}return t}function Drt(t){let e=t.startState,n=e.facet(Ife),r=t;for(let i=n.length-1;i>=0;i--){let o=n[i](t);o&&Object.keys(o).length&&(r=Lfe(r,lN(e,o,t.changes.newLength),!0))}return r==t?t:Ur.create(e,t.changes,t.selection,r.effects,r.annotations,r.scrollIntoView)}const Lrt=[];function kg(t){return t==null?Lrt:Array.isArray(t)?t:[t]}var fr=function(t){return t[t.Word=0]="Word",t[t.Space=1]="Space",t[t.Other=2]="Other",t}(fr||(fr={}));const Nrt=/[\u00df\u0587\u0590-\u05f4\u0600-\u06ff\u3040-\u309f\u30a0-\u30ff\u3400-\u4db5\u4e00-\u9fcc\uac00-\ud7af]/;let cN;try{cN=new RegExp("[\\p{Alphabetic}\\p{Number}_]","u")}catch{}function $rt(t){if(cN)return cN.test(t);for(let e=0;e<t.length;e++){let n=t[e];if(/\w/.test(n)||n>""&&(n.toUpperCase()!=n.toLowerCase()||Nrt.test(n)))return!0}return!1}function Frt(t){return e=>{if(!/\S/.test(e))return fr.Space;if($rt(e))return fr.Word;for(let n=0;n<t.length;n++)if(e.indexOf(t[n])>-1)return fr.Word;return fr.Other}}class en{constructor(e,n,r,i,o,a){this.config=e,this.doc=n,this.selection=r,this.values=i,this.status=e.statusTemplate.slice(),this.computeSlot=o,a&&(a._state=this);for(let s=0;s<this.config.dynamicSlots.length;s++)tb(this,s<<1);this.computeSlot=null}field(e,n=!0){let r=this.config.address[e.id];if(r==null){if(n)throw new RangeError("Field is not present in this state");return}return tb(this,r),dE(this,r)}update(...e){return Nfe(this,e,!0)}applyTransaction(e){let n=this.config,{base:r,compartments:i}=n;for(let s of e.effects)s.is(X2.reconfigure)?(n&&(i=new Map,n.compartments.forEach((l,c)=>i.set(c,l)),n=null),i.set(s.value.compartment,s.value.extension)):s.is(Rt.reconfigure)?(n=null,r=s.value):s.is(Rt.appendConfig)&&(n=null,r=kg(r).concat(s.value));let o;n?o=e.startState.values.slice():(n=fE.resolve(r,i,this),o=new en(n,this.doc,this.selection,n.dynamicSlots.map(()=>null),(l,c)=>c.reconfigure(l,this),null).values);let a=e.startState.facet(sN)?e.newSelection:e.newSelection.asSingle();new en(n,e.newDoc,a,o,(s,l)=>l.update(s,e),e)}replaceSelection(e){return typeof e=="string"&&(e=this.toText(e)),this.changeByRange(n=>({changes:{from:n.from,to:n.to,insert:e},range:je.cursor(n.from+e.length)}))}changeByRange(e){let n=this.selection,r=e(n.ranges[0]),i=this.changes(r.changes),o=[r.range],a=kg(r.effects);for(let s=1;s<n.ranges.length;s++){let l=e(n.ranges[s]),c=this.changes(l.changes),u=c.map(i);for(let d=0;d<s;d++)o[d]=o[d].map(u);let f=i.mapDesc(c,!0);o.push(l.range.map(f)),i=i.compose(u),a=Rt.mapEffects(a,u).concat(Rt.mapEffects(kg(l.effects),f))}return{changes:i,selection:je.create(o,n.mainIndex),effects:a}}changes(e=[]){return e instanceof Zr?e:Zr.of(e,this.doc.length,this.facet(en.lineSeparator))}toText(e){return xn.of(e.split(this.facet(en.lineSeparator)||nN))}sliceDoc(e=0,n=this.doc.length){return this.doc.sliceString(e,n,this.lineBreak)}facet(e){let n=this.config.address[e.id];return n==null?e.default:(tb(this,n),dE(this,n))}toJSON(e){let n={doc:this.sliceDoc(),selection:this.selection.toJSON()};if(e)for(let r in e){let i=e[r];i instanceof mi&&this.config.address[i.id]!=null&&(n[r]=i.spec.toJSON(this.field(e[r]),this))}return n}static fromJSON(e,n={},r){if(!e||typeof e.doc!="string")throw new RangeError("Invalid JSON representation for EditorState");let i=[];if(r){for(let o in r)if(Object.prototype.hasOwnProperty.call(e,o)){let a=r[o],s=e[o];i.push(a.init(l=>a.spec.fromJSON(s,l)))}}return en.create({doc:e.doc,selection:je.fromJSON(e.selection),extensions:n.extensions?i.concat([n.extensions]):i})}static create(e={}){let n=fE.resolve(e.extensions||[],new Map),r=e.doc instanceof xn?e.doc:xn.of((e.doc||"").split(n.staticFacet(en.lineSeparator)||nN)),i=e.selection?e.selection instanceof je?e.selection:je.single(e.selection.anchor,e.selection.head):je.single(0);return Efe(i,r.length),n.staticFacet(sN)||(i=i.asSingle()),new en(n,r,i,n.dynamicSlots.map(()=>null),(o,a)=>a.create(o),null)}get tabSize(){return this.facet(en.tabSize)}get lineBreak(){return this.facet(en.lineSeparator)||`
`}get readOnly(){return this.facet(Dfe)}phrase(e,...n){for(let r of this.facet(en.phrases))if(Object.prototype.hasOwnProperty.call(r,e)){e=r[e];break}return n.length&&(e=e.replace(/\$(\$|\d*)/g,(r,i)=>{if(i=="$")return"$";let o=+(i||1);return!o||o>n.length?r:n[o-1]})),e}languageDataAt(e,n,r=-1){let i=[];for(let o of this.facet(Mfe))for(let a of o(this,n,r))Object.prototype.hasOwnProperty.call(a,e)&&i.push(a[e]);return i}charCategorizer(e){return Frt(this.languageDataAt("wordChars",e).join(""))}wordAt(e){let{text:n,from:r,length:i}=this.doc.lineAt(e),o=this.charCategorizer(e),a=e-r,s=e-r;for(;a>0;){let l=ki(n,a,!1);if(o(n.slice(l,a))!=fr.Word)break;a=l}for(;s<i;){let l=ki(n,s);if(o(n.slice(s,l))!=fr.Word)break;s=l}return a==s?null:je.range(a+r,s+r)}}en.allowMultipleSelections=sN;en.tabSize=ct.define({combine:t=>t.length?t[0]:4});en.lineSeparator=kfe;en.readOnly=Dfe;en.phrases=ct.define({compare(t,e){let n=Object.keys(t),r=Object.keys(e);return n.length==r.length&&n.every(i=>t[i]==e[i])}});en.languageData=Mfe;en.changeFilter=Afe;en.transactionFilter=Rfe;en.transactionExtender=Ife;X2.reconfigure=Rt.define();function cc(t,e,n={}){let r={};for(let i of t)for(let o of Object.keys(i)){let a=i[o],s=r[o];if(s===void 0)r[o]=a;else if(!(s===a||a===void 0))if(Object.hasOwnProperty.call(n,o))r[o]=n[o](s,a);else throw new Error("Config merge conflict for field "+o)}for(let i in e)r[i]===void 0&&(r[i]=e[i]);return r}class sp{eq(e){return this==e}range(e,n=e){return uN.create(e,n,this)}}sp.prototype.startSide=sp.prototype.endSide=0;sp.prototype.point=!1;sp.prototype.mapMode=Pi.TrackDel;let uN=class $fe{constructor(e,n,r){this.from=e,this.to=n,this.value=r}static create(e,n,r){return new $fe(e,n,r)}};function fN(t,e){return t.from-e.from||t.value.startSide-e.value.startSide}class w4{constructor(e,n,r,i){this.from=e,this.to=n,this.value=r,this.maxPoint=i}get length(){return this.to[this.to.length-1]}findIndex(e,n,r,i=0){let o=r?this.to:this.from;for(let a=i,s=o.length;;){if(a==s)return a;let l=a+s>>1,c=o[l]-e||(r?this.value[l].endSide:this.value[l].startSide)-n;if(l==a)return c>=0?a:s;c>=0?s=l:a=l+1}}between(e,n,r,i){for(let o=this.findIndex(n,-1e9,!0),a=this.findIndex(r,1e9,!1,o);o<a;o++)if(i(this.from[o]+e,this.to[o]+e,this.value[o])===!1)return!1}map(e,n){let r=[],i=[],o=[],a=-1,s=-1;for(let l=0;l<this.value.length;l++){let c=this.value[l],u=this.from[l]+e,f=this.to[l]+e,d,h;if(u==f){let p=n.mapPos(u,c.startSide,c.mapMode);if(p==null||(d=h=p,c.startSide!=c.endSide&&(h=n.mapPos(u,c.endSide),h<d)))continue}else if(d=n.mapPos(u,c.startSide),h=n.mapPos(f,c.endSide),d>h||d==h&&c.startSide>0&&c.endSide<=0)continue;(h-d||c.endSide-c.startSide)<0||(a<0&&(a=d),c.point&&(s=Math.max(s,h-d)),r.push(c),i.push(d-a),o.push(h-a))}return{mapped:r.length?new w4(i,o,r,s):null,pos:a}}}class sn{constructor(e,n,r,i){this.chunkPos=e,this.chunk=n,this.nextLayer=r,this.maxPoint=i}static create(e,n,r,i){return new sn(e,n,r,i)}get length(){let e=this.chunk.length-1;return e<0?0:Math.max(this.chunkEnd(e),this.nextLayer.length)}get size(){if(this.isEmpty)return 0;let e=this.nextLayer.size;for(let n of this.chunk)e+=n.value.length;return e}chunkEnd(e){return this.chunkPos[e]+this.chunk[e].length}update(e){let{add:n=[],sort:r=!1,filterFrom:i=0,filterTo:o=this.length}=e,a=e.filter;if(n.length==0&&!a)return this;if(r&&(n=n.slice().sort(fN)),this.isEmpty)return n.length?sn.of(n):this;let s=new Ffe(this,null,-1).goto(0),l=0,c=[],u=new id;for(;s.value||l<n.length;)if(l<n.length&&(s.from-n[l].from||s.startSide-n[l].value.startSide)>=0){let f=n[l++];u.addInner(f.from,f.to,f.value)||c.push(f)}else s.rangeIndex==1&&s.chunkIndex<this.chunk.length&&(l==n.length||this.chunkEnd(s.chunkIndex)<n[l].from)&&(!a||i>this.chunkEnd(s.chunkIndex)||o<this.chunkPos[s.chunkIndex])&&u.addChunk(this.chunkPos[s.chunkIndex],this.chunk[s.chunkIndex])?s.nextChunk():((!a||i>s.to||o<s.from||a(s.from,s.to,s.value))&&(u.addInner(s.from,s.to,s.value)||c.push(uN.create(s.from,s.to,s.value))),s.next());return u.finishInner(this.nextLayer.isEmpty&&!c.length?sn.empty:this.nextLayer.update({add:c,filter:a,filterFrom:i,filterTo:o}))}map(e){if(e.empty||this.isEmpty)return this;let n=[],r=[],i=-1;for(let a=0;a<this.chunk.length;a++){let s=this.chunkPos[a],l=this.chunk[a],c=e.touchesRange(s,s+l.length);if(c===!1)i=Math.max(i,l.maxPoint),n.push(l),r.push(e.mapPos(s));else if(c===!0){let{mapped:u,pos:f}=l.map(s,e);u&&(i=Math.max(i,u.maxPoint),n.push(u),r.push(f))}}let o=this.nextLayer.map(e);return n.length==0?o:new sn(r,n,o||sn.empty,i)}between(e,n,r){if(!this.isEmpty){for(let i=0;i<this.chunk.length;i++){let o=this.chunkPos[i],a=this.chunk[i];if(n>=o&&e<=o+a.length&&a.between(o,e-o,n-o,r)===!1)return}this.nextLayer.between(e,n,r)}}iter(e=0){return n_.from([this]).goto(e)}get isEmpty(){return this.nextLayer==this}static iter(e,n=0){return n_.from(e).goto(n)}static compare(e,n,r,i,o=-1){let a=e.filter(f=>f.maxPoint>0||!f.isEmpty&&f.maxPoint>=o),s=n.filter(f=>f.maxPoint>0||!f.isEmpty&&f.maxPoint>=o),l=s7(a,s,r),c=new R0(a,l,o),u=new R0(s,l,o);r.iterGaps((f,d,h)=>l7(c,f,u,d,h,i)),r.empty&&r.length==0&&l7(c,0,u,0,0,i)}static eq(e,n,r=0,i){i==null&&(i=999999999);let o=e.filter(u=>!u.isEmpty&&n.indexOf(u)<0),a=n.filter(u=>!u.isEmpty&&e.indexOf(u)<0);if(o.length!=a.length)return!1;if(!o.length)return!0;let s=s7(o,a),l=new R0(o,s,0).goto(r),c=new R0(a,s,0).goto(r);for(;;){if(l.to!=c.to||!dN(l.active,c.active)||l.point&&(!c.point||!l.point.eq(c.point)))return!1;if(l.to>i)return!0;l.next(),c.next()}}static spans(e,n,r,i,o=-1){let a=new R0(e,null,o).goto(n),s=n,l=a.openStart;for(;;){let c=Math.min(a.to,r);if(a.point){let u=a.activeForPoint(a.to),f=a.pointFrom<n?u.length+1:a.point.startSide<0?u.length:Math.min(u.length,l);i.point(s,c,a.point,u,f,a.pointRank),l=Math.min(a.openEnd(c),u.length)}else c>s&&(i.span(s,c,a.active,l),l=a.openEnd(c));if(a.to>r)return l+(a.point&&a.to>r?1:0);s=a.to,a.next()}}static of(e,n=!1){let r=new id;for(let i of e instanceof uN?[e]:n?jrt(e):e)r.add(i.from,i.to,i.value);return r.finish()}static join(e){if(!e.length)return sn.empty;let n=e[e.length-1];for(let r=e.length-2;r>=0;r--)for(let i=e[r];i!=sn.empty;i=i.nextLayer)n=new sn(i.chunkPos,i.chunk,n,Math.max(i.maxPoint,n.maxPoint));return n}}sn.empty=new sn([],[],null,-1);function jrt(t){if(t.length>1)for(let e=t[0],n=1;n<t.length;n++){let r=t[n];if(fN(e,r)>0)return t.slice().sort(fN);e=r}return t}sn.empty.nextLayer=sn.empty;class id{finishChunk(e){this.chunks.push(new w4(this.from,this.to,this.value,this.maxPoint)),this.chunkPos.push(this.chunkStart),this.chunkStart=-1,this.setMaxPoint=Math.max(this.setMaxPoint,this.maxPoint),this.maxPoint=-1,e&&(this.from=[],this.to=[],this.value=[])}constructor(){this.chunks=[],this.chunkPos=[],this.chunkStart=-1,this.last=null,this.lastFrom=-1e9,this.lastTo=-1e9,this.from=[],this.to=[],this.value=[],this.maxPoint=-1,this.setMaxPoint=-1,this.nextLayer=null}add(e,n,r){this.addInner(e,n,r)||(this.nextLayer||(this.nextLayer=new id)).add(e,n,r)}addInner(e,n,r){let i=e-this.lastTo||r.startSide-this.last.endSide;if(i<=0&&(e-this.lastFrom||r.startSide-this.last.startSide)<0)throw new Error("Ranges must be added sorted by `from` position and `startSide`");return i<0?!1:(this.from.length==250&&this.finishChunk(!0),this.chunkStart<0&&(this.chunkStart=e),this.from.push(e-this.chunkStart),this.to.push(n-this.chunkStart),this.last=r,this.lastFrom=e,this.lastTo=n,this.value.push(r),r.point&&(this.maxPoint=Math.max(this.maxPoint,n-e)),!0)}addChunk(e,n){if((e-this.lastTo||n.value[0].startSide-this.last.endSide)<0)return!1;this.from.length&&this.finishChunk(!0),this.setMaxPoint=Math.max(this.setMaxPoint,n.maxPoint),this.chunks.push(n),this.chunkPos.push(e);let r=n.value.length-1;return this.last=n.value[r],this.lastFrom=n.from[r]+e,this.lastTo=n.to[r]+e,!0}finish(){return this.finishInner(sn.empty)}finishInner(e){if(this.from.length&&this.finishChunk(!1),this.chunks.length==0)return e;let n=sn.create(this.chunkPos,this.chunks,this.nextLayer?this.nextLayer.finishInner(e):e,this.setMaxPoint);return this.from=null,n}}function s7(t,e,n){let r=new Map;for(let o of t)for(let a=0;a<o.chunk.length;a++)o.chunk[a].maxPoint<=0&&r.set(o.chunk[a],o.chunkPos[a]);let i=new Set;for(let o of e)for(let a=0;a<o.chunk.length;a++){let s=r.get(o.chunk[a]);s!=null&&(n?n.mapPos(s):s)==o.chunkPos[a]&&!(n!=null&&n.touchesRange(s,s+o.chunk[a].length))&&i.add(o.chunk[a])}return i}class Ffe{constructor(e,n,r,i=0){this.layer=e,this.skip=n,this.minPoint=r,this.rank=i}get startSide(){return this.value?this.value.startSide:0}get endSide(){return this.value?this.value.endSide:0}goto(e,n=-1e9){return this.chunkIndex=this.rangeIndex=0,this.gotoInner(e,n,!1),this}gotoInner(e,n,r){for(;this.chunkIndex<this.layer.chunk.length;){let i=this.layer.chunk[this.chunkIndex];if(!(this.skip&&this.skip.has(i)||this.layer.chunkEnd(this.chunkIndex)<e||i.maxPoint<this.minPoint))break;this.chunkIndex++,r=!1}if(this.chunkIndex<this.layer.chunk.length){let i=this.layer.chunk[this.chunkIndex].findIndex(e-this.layer.chunkPos[this.chunkIndex],n,!0);(!r||this.rangeIndex<i)&&this.setRangeIndex(i)}this.next()}forward(e,n){(this.to-e||this.endSide-n)<0&&this.gotoInner(e,n,!0)}next(){for(;;)if(this.chunkIndex==this.layer.chunk.length){this.from=this.to=1e9,this.value=null;break}else{let e=this.layer.chunkPos[this.chunkIndex],n=this.layer.chunk[this.chunkIndex],r=e+n.from[this.rangeIndex];if(this.from=r,this.to=e+n.to[this.rangeIndex],this.value=n.value[this.rangeIndex],this.setRangeIndex(this.rangeIndex+1),this.minPoint<0||this.value.point&&this.to-this.from>=this.minPoint)break}}setRangeIndex(e){if(e==this.layer.chunk[this.chunkIndex].value.length){if(this.chunkIndex++,this.skip)for(;this.chunkIndex<this.layer.chunk.length&&this.skip.has(this.layer.chunk[this.chunkIndex]);)this.chunkIndex++;this.rangeIndex=0}else this.rangeIndex=e}nextChunk(){this.chunkIndex++,this.rangeIndex=0,this.next()}compare(e){return this.from-e.from||this.startSide-e.startSide||this.rank-e.rank||this.to-e.to||this.endSide-e.endSide}}class n_{constructor(e){this.heap=e}static from(e,n=null,r=-1){let i=[];for(let o=0;o<e.length;o++)for(let a=e[o];!a.isEmpty;a=a.nextLayer)a.maxPoint>=r&&i.push(new Ffe(a,n,r,o));return i.length==1?i[0]:new n_(i)}get startSide(){return this.value?this.value.startSide:0}goto(e,n=-1e9){for(let r of this.heap)r.goto(e,n);for(let r=this.heap.length>>1;r>=0;r--)DR(this.heap,r);return this.next(),this}forward(e,n){for(let r of this.heap)r.forward(e,n);for(let r=this.heap.length>>1;r>=0;r--)DR(this.heap,r);(this.to-e||this.value.endSide-n)<0&&this.next()}next(){if(this.heap.length==0)this.from=this.to=1e9,this.value=null,this.rank=-1;else{let e=this.heap[0];this.from=e.from,this.to=e.to,this.value=e.value,this.rank=e.rank,e.value&&e.next(),DR(this.heap,0)}}}function DR(t,e){for(let n=t[e];;){let r=(e<<1)+1;if(r>=t.length)break;let i=t[r];if(r+1<t.length&&i.compare(t[r+1])>=0&&(i=t[r+1],r++),n.compare(i)<0)break;t[r]=n,t[e]=i,e=r}}class R0{constructor(e,n,r){this.minPoint=r,this.active=[],this.activeTo=[],this.activeRank=[],this.minActive=-1,this.point=null,this.pointFrom=0,this.pointRank=0,this.to=-1e9,this.endSide=0,this.openStart=-1,this.cursor=n_.from(e,n,r)}goto(e,n=-1e9){return this.cursor.goto(e,n),this.active.length=this.activeTo.length=this.activeRank.length=0,this.minActive=-1,this.to=e,this.endSide=n,this.openStart=-1,this.next(),this}forward(e,n){for(;this.minActive>-1&&(this.activeTo[this.minActive]-e||this.active[this.minActive].endSide-n)<0;)this.removeActive(this.minActive);this.cursor.forward(e,n)}removeActive(e){GS(this.active,e),GS(this.activeTo,e),GS(this.activeRank,e),this.minActive=c7(this.active,this.activeTo)}addActive(e){let n=0,{value:r,to:i,rank:o}=this.cursor;for(;n<this.activeRank.length&&(o-this.activeRank[n]||i-this.activeTo[n])>0;)n++;HS(this.active,n,r),HS(this.activeTo,n,i),HS(this.activeRank,n,o),e&&HS(e,n,this.cursor.from),this.minActive=c7(this.active,this.activeTo)}next(){let e=this.to,n=this.point;this.point=null;let r=this.openStart<0?[]:null;for(;;){let i=this.minActive;if(i>-1&&(this.activeTo[i]-this.cursor.from||this.active[i].endSide-this.cursor.startSide)<0){if(this.activeTo[i]>e){this.to=this.activeTo[i],this.endSide=this.active[i].endSide;break}this.removeActive(i),r&&GS(r,i)}else if(this.cursor.value)if(this.cursor.from>e){this.to=this.cursor.from,this.endSide=this.cursor.startSide;break}else{let o=this.cursor.value;if(!o.point)this.addActive(r),this.cursor.next();else if(n&&this.cursor.to==this.to&&this.cursor.from<this.cursor.to)this.cursor.next();else{this.point=o,this.pointFrom=this.cursor.from,this.pointRank=this.cursor.rank,this.to=this.cursor.to,this.endSide=o.endSide,this.cursor.next(),this.forward(this.to,this.endSide);break}}else{this.to=this.endSide=1e9;break}}if(r){this.openStart=0;for(let i=r.length-1;i>=0&&r[i]<e;i--)this.openStart++}}activeForPoint(e){if(!this.active.length)return this.active;let n=[];for(let r=this.active.length-1;r>=0&&!(this.activeRank[r]<this.pointRank);r--)(this.activeTo[r]>e||this.activeTo[r]==e&&this.active[r].endSide>=this.point.endSide)&&n.push(this.active[r]);return n.reverse()}openEnd(e){let n=0;for(let r=this.activeTo.length-1;r>=0&&this.activeTo[r]>e;r--)n++;return n}}function l7(t,e,n,r,i,o){t.goto(e),n.goto(r);let a=r+i,s=r,l=r-e;for(;;){let c=t.to+l-n.to||t.endSide-n.endSide,u=c<0?t.to+l:n.to,f=Math.min(u,a);if(t.point||n.point?t.point&&n.point&&(t.point==n.point||t.point.eq(n.point))&&dN(t.activeForPoint(t.to),n.activeForPoint(n.to))||o.comparePoint(s,f,t.point,n.point):f>s&&!dN(t.active,n.active)&&o.compareRange(s,f,t.active,n.active),u>a)break;s=u,c<=0&&t.next(),c>=0&&n.next()}}function dN(t,e){if(t.length!=e.length)return!1;for(let n=0;n<t.length;n++)if(t[n]!=e[n]&&!t[n].eq(e[n]))return!1;return!0}function GS(t,e){for(let n=e,r=t.length-1;n<r;n++)t[n]=t[n+1];t.pop()}function HS(t,e,n){for(let r=t.length-1;r>=e;r--)t[r+1]=t[r];t[e]=n}function c7(t,e){let n=-1,r=1e9;for(let i=0;i<e.length;i++)(e[i]-r||t[i].endSide-t[n].endSide)<0&&(n=i,r=e[i]);return n}function My(t,e,n=t.length){let r=0;for(let i=0;i<n;)t.charCodeAt(i)==9?(r+=e-r%e,i++):(r++,i=ki(t,i));return r}function hN(t,e,n,r){for(let i=0,o=0;;){if(o>=e)return i;if(i==t.length)break;o+=t.charCodeAt(i)==9?n-o%n:1,i=ki(t,i)}return r===!0?-1:t.length}const pN="ͼ",u7=typeof Symbol>"u"?"__"+pN:Symbol.for(pN),mN=typeof Symbol>"u"?"__styleSet"+Math.floor(Math.random()*1e8):Symbol("styleSet"),f7=typeof globalThis<"u"?globalThis:typeof window<"u"?window:{};class od{constructor(e,n){this.rules=[];let{finish:r}=n||{};function i(a){return/^@/.test(a)?[a]:a.split(/,\s*/)}function o(a,s,l,c){let u=[],f=/^@(\w+)\b/.exec(a[0]),d=f&&f[1]=="keyframes";if(f&&s==null)return l.push(a[0]+";");for(let h in s){let p=s[h];if(/&/.test(h))o(h.split(/,\s*/).map(m=>a.map(g=>m.replace(/&/,g))).reduce((m,g)=>m.concat(g)),p,l);else if(p&&typeof p=="object"){if(!f)throw new RangeError("The value of a property ("+h+") should be a primitive value.");o(i(h),p,u,d)}else p!=null&&u.push(h.replace(/_.*/,"").replace(/[A-Z]/g,m=>"-"+m.toLowerCase())+": "+p+";")}(u.length||d)&&l.push((r&&!f&&!c?a.map(r):a).join(", ")+" {"+u.join(" ")+"}")}for(let a in e)o(i(a),e[a],this.rules)}getRules(){return this.rules.join(`
`)}static newName(){let e=f7[u7]||1;return f7[u7]=e+1,pN+e.toString(36)}static mount(e,n,r){let i=e[mN],o=r&&r.nonce;i?o&&i.setNonce(o):i=new Brt(e,o),i.mount(Array.isArray(n)?n:[n],e)}}let d7=new Map;class Brt{constructor(e,n){let r=e.ownerDocument||e,i=r.defaultView;if(!e.head&&e.adoptedStyleSheets&&i.CSSStyleSheet){let o=d7.get(r);if(o)return e[mN]=o;this.sheet=new i.CSSStyleSheet,d7.set(r,this)}else this.styleTag=r.createElement("style"),n&&this.styleTag.setAttribute("nonce",n);this.modules=[],e[mN]=this}mount(e,n){let r=this.sheet,i=0,o=0;for(let a=0;a<e.length;a++){let s=e[a],l=this.modules.indexOf(s);if(l<o&&l>-1&&(this.modules.splice(l,1),o--,l=-1),l==-1){if(this.modules.splice(o++,0,s),r)for(let c=0;c<s.rules.length;c++)r.insertRule(s.rules[c],i++)}else{for(;o<l;)i+=this.modules[o++].rules.length;i+=s.rules.length,o++}}if(r)n.adoptedStyleSheets.indexOf(this.sheet)<0&&(n.adoptedStyleSheets=[this.sheet,...n.adoptedStyleSheets]);else{let a="";for(let l=0;l<this.modules.length;l++)a+=this.modules[l].getRules()+`
`;this.styleTag.textContent=a;let s=n.head||n;this.styleTag.parentNode!=s&&s.insertBefore(this.styleTag,s.firstChild)}}setNonce(e){this.styleTag&&this.styleTag.getAttribute("nonce")!=e&&this.styleTag.setAttribute("nonce",e)}}var ad={8:"Backspace",9:"Tab",10:"Enter",12:"NumLock",13:"Enter",16:"Shift",17:"Control",18:"Alt",20:"CapsLock",27:"Escape",32:" ",33:"PageUp",34:"PageDown",35:"End",36:"Home",37:"ArrowLeft",38:"ArrowUp",39:"ArrowRight",40:"ArrowDown",44:"PrintScreen",45:"Insert",46:"Delete",59:";",61:"=",91:"Meta",92:"Meta",106:"*",107:"+",108:",",109:"-",110:".",111:"/",144:"NumLock",145:"ScrollLock",160:"Shift",161:"Shift",162:"Control",163:"Control",164:"Alt",165:"Alt",173:"-",186:";",187:"=",188:",",189:"-",190:".",191:"/",192:"`",219:"[",220:"\\",221:"]",222:"'"},r_={48:")",49:"!",50:"@",51:"#",52:"$",53:"%",54:"^",55:"&",56:"*",57:"(",59:":",61:"+",173:"_",186:":",187:"+",188:"<",189:"_",190:">",191:"?",192:"~",219:"{",220:"|",221:"}",222:'"'},zrt=typeof navigator<"u"&&/Mac/.test(navigator.platform),Urt=typeof navigator<"u"&&/MSIE \d|Trident\/(?:[7-9]|\d{2,})\..*rv:(\d+)/.exec(navigator.userAgent);for(var Ti=0;Ti<10;Ti++)ad[48+Ti]=ad[96+Ti]=String(Ti);for(var Ti=1;Ti<=24;Ti++)ad[Ti+111]="F"+Ti;for(var Ti=65;Ti<=90;Ti++)ad[Ti]=String.fromCharCode(Ti+32),r_[Ti]=String.fromCharCode(Ti);for(var LR in ad)r_.hasOwnProperty(LR)||(r_[LR]=ad[LR]);function Wrt(t){var e=zrt&&t.metaKey&&t.shiftKey&&!t.ctrlKey&&!t.altKey||Urt&&t.shiftKey&&t.key&&t.key.length==1||t.key=="Unidentified",n=!e&&t.key||(t.shiftKey?r_:ad)[t.keyCode]||t.key||"Unidentified";return n=="Esc"&&(n="Escape"),n=="Del"&&(n="Delete"),n=="Left"&&(n="ArrowLeft"),n=="Up"&&(n="ArrowUp"),n=="Right"&&(n="ArrowRight"),n=="Down"&&(n="ArrowDown"),n}function i_(t){let e;return t.nodeType==11?e=t.getSelection?t:t.ownerDocument:e=t,e.getSelection()}function gN(t,e){return e?t==e||t.contains(e.nodeType!=1?e.parentNode:e):!1}function Vrt(t){let e=t.activeElement;for(;e&&e.shadowRoot;)e=e.shadowRoot.activeElement;return e}function jC(t,e){if(!e.anchorNode)return!1;try{return gN(t,e.anchorNode)}catch{return!1}}function cv(t){return t.nodeType==3?cp(t,0,t.nodeValue.length).getClientRects():t.nodeType==1?t.getClientRects():[]}function nb(t,e,n,r){return n?h7(t,e,n,r,-1)||h7(t,e,n,r,1):!1}function lp(t){for(var e=0;;e++)if(t=t.previousSibling,!t)return e}function hE(t){return t.nodeType==1&&/^(DIV|P|LI|UL|OL|BLOCKQUOTE|DD|DT|H\d|SECTION|PRE)$/.test(t.nodeName)}function h7(t,e,n,r,i){for(;;){if(t==n&&e==r)return!0;if(e==(i<0?0:pu(t))){if(t.nodeName=="DIV")return!1;let o=t.parentNode;if(!o||o.nodeType!=1)return!1;e=lp(t)+(i<0?0:1),t=o}else if(t.nodeType==1){if(t=t.childNodes[e+(i<0?-1:0)],t.nodeType==1&&t.contentEditable=="false")return!1;e=i<0?pu(t):0}else return!1}}function pu(t){return t.nodeType==3?t.nodeValue.length:t.childNodes.length}function pw(t,e){let n=e?t.left:t.right;return{left:n,right:n,top:t.top,bottom:t.bottom}}function Grt(t){let e=t.visualViewport;return e?{left:0,right:e.width,top:0,bottom:e.height}:{left:0,right:t.innerWidth,top:0,bottom:t.innerHeight}}function jfe(t,e){let n=e.width/t.offsetWidth,r=e.height/t.offsetHeight;return(n>.995&&n<1.005||!isFinite(n)||Math.abs(e.width-t.offsetWidth)<1)&&(n=1),(r>.995&&r<1.005||!isFinite(r)||Math.abs(e.height-t.offsetHeight)<1)&&(r=1),{scaleX:n,scaleY:r}}function Hrt(t,e,n,r,i,o,a,s){let l=t.ownerDocument,c=l.defaultView||window;for(let u=t,f=!1;u&&!f;)if(u.nodeType==1){let d,h=u==l.body,p=1,m=1;if(h)d=Grt(c);else{if(/^(fixed|sticky)$/.test(getComputedStyle(u).position)&&(f=!0),u.scrollHeight<=u.clientHeight&&u.scrollWidth<=u.clientWidth){u=u.assignedSlot||u.parentNode;continue}let y=u.getBoundingClientRect();({scaleX:p,scaleY:m}=jfe(u,y)),d={left:y.left,right:y.left+u.clientWidth*p,top:y.top,bottom:y.top+u.clientHeight*m}}let g=0,v=0;if(i=="nearest")e.top<d.top?(v=-(d.top-e.top+a),n>0&&e.bottom>d.bottom+v&&(v=e.bottom-d.bottom+v+a)):e.bottom>d.bottom&&(v=e.bottom-d.bottom+a,n<0&&e.top-v<d.top&&(v=-(d.top+v-e.top+a)));else{let y=e.bottom-e.top,x=d.bottom-d.top;v=(i=="center"&&y<=x?e.top+y/2-x/2:i=="start"||i=="center"&&n<0?e.top-a:e.bottom-x+a)-d.top}if(r=="nearest"?e.left<d.left?(g=-(d.left-e.left+o),n>0&&e.right>d.right+g&&(g=e.right-d.right+g+o)):e.right>d.right&&(g=e.right-d.right+o,n<0&&e.left<d.left+g&&(g=-(d.left+g-e.left+o))):g=(r=="center"?e.left+(e.right-e.left)/2-(d.right-d.left)/2:r=="start"==s?e.left-o:e.right-(d.right-d.left)+o)-d.left,g||v)if(h)c.scrollBy(g,v);else{let y=0,x=0;if(v){let b=u.scrollTop;u.scrollTop+=v/m,x=(u.scrollTop-b)*m}if(g){let b=u.scrollLeft;u.scrollLeft+=g/p,y=(u.scrollLeft-b)*p}e={left:e.left-y,top:e.top-x,right:e.right-y,bottom:e.bottom-x},y&&Math.abs(y-g)<1&&(r="nearest"),x&&Math.abs(x-v)<1&&(i="nearest")}if(h)break;u=u.assignedSlot||u.parentNode}else if(u.nodeType==11)u=u.host;else break}function qrt(t){let e=t.ownerDocument,n,r;for(let i=t.parentNode;i&&!(i==e.body||n&&r);)if(i.nodeType==1)!r&&i.scrollHeight>i.clientHeight&&(r=i),!n&&i.scrollWidth>i.clientWidth&&(n=i),i=i.assignedSlot||i.parentNode;else if(i.nodeType==11)i=i.host;else break;return{x:n,y:r}}class Xrt{constructor(){this.anchorNode=null,this.anchorOffset=0,this.focusNode=null,this.focusOffset=0}eq(e){return this.anchorNode==e.anchorNode&&this.anchorOffset==e.anchorOffset&&this.focusNode==e.focusNode&&this.focusOffset==e.focusOffset}setRange(e){let{anchorNode:n,focusNode:r}=e;this.set(n,Math.min(e.anchorOffset,n?pu(n):0),r,Math.min(e.focusOffset,r?pu(r):0))}set(e,n,r,i){this.anchorNode=e,this.anchorOffset=n,this.focusNode=r,this.focusOffset=i}}let fm=null;function Bfe(t){if(t.setActive)return t.setActive();if(fm)return t.focus(fm);let e=[];for(let n=t;n&&(e.push(n,n.scrollTop,n.scrollLeft),n!=n.ownerDocument);n=n.parentNode);if(t.focus(fm==null?{get preventScroll(){return fm={preventScroll:!0},!0}}:void 0),!fm){fm=!1;for(let n=0;n<e.length;){let r=e[n++],i=e[n++],o=e[n++];r.scrollTop!=i&&(r.scrollTop=i),r.scrollLeft!=o&&(r.scrollLeft=o)}}}let p7;function cp(t,e,n=e){let r=p7||(p7=document.createRange());return r.setEnd(t,n),r.setStart(t,e),r}function Ag(t,e,n,r){let i={key:e,code:e,keyCode:n,which:n,cancelable:!0};r&&({altKey:i.altKey,ctrlKey:i.ctrlKey,shiftKey:i.shiftKey,metaKey:i.metaKey}=r);let o=new KeyboardEvent("keydown",i);o.synthetic=!0,t.dispatchEvent(o);let a=new KeyboardEvent("keyup",i);return a.synthetic=!0,t.dispatchEvent(a),o.defaultPrevented||a.defaultPrevented}function Qrt(t){for(;t;){if(t&&(t.nodeType==9||t.nodeType==11&&t.host))return t;t=t.assignedSlot||t.parentNode}return null}function zfe(t){for(;t.attributes.length;)t.removeAttributeNode(t.attributes[0])}function Yrt(t,e){let n=e.focusNode,r=e.focusOffset;if(!n||e.anchorNode!=n||e.anchorOffset!=r)return!1;for(r=Math.min(r,pu(n));;)if(r){if(n.nodeType!=1)return!1;let i=n.childNodes[r-1];i.contentEditable=="false"?r--:(n=i,r=pu(n))}else{if(n==t)return!0;r=lp(n),n=n.parentNode}}function Ufe(t){return t.scrollTop>Math.max(1,t.scrollHeight-t.clientHeight-4)}function Wfe(t,e){for(let n=t,r=e;;){if(n.nodeType==3&&r>0)return{node:n,offset:r};if(n.nodeType==1&&r>0){if(n.contentEditable=="false")return null;n=n.childNodes[r-1],r=pu(n)}else if(n.parentNode&&!hE(n))r=lp(n),n=n.parentNode;else return null}}function Vfe(t,e){for(let n=t,r=e;;){if(n.nodeType==3&&r<n.nodeValue.length)return{node:n,offset:r};if(n.nodeType==1&&r<n.childNodes.length){if(n.contentEditable=="false")return null;n=n.childNodes[r],r=0}else if(n.parentNode&&!hE(n))r=lp(n)+1,n=n.parentNode;else return null}}class Yi{constructor(e,n,r=!0){this.node=e,this.offset=n,this.precise=r}static before(e,n){return new Yi(e.parentNode,lp(e),n)}static after(e,n){return new Yi(e.parentNode,lp(e)+1,n)}}const S4=[];class Ln{constructor(){this.parent=null,this.dom=null,this.flags=2}get overrideDOMText(){return null}get posAtStart(){return this.parent?this.parent.posBefore(this):0}get posAtEnd(){return this.posAtStart+this.length}posBefore(e){let n=this.posAtStart;for(let r of this.children){if(r==e)return n;n+=r.length+r.breakAfter}throw new RangeError("Invalid child in posBefore")}posAfter(e){return this.posBefore(e)+e.length}sync(e,n){if(this.flags&2){let r=this.dom,i=null,o;for(let a of this.children){if(a.flags&7){if(!a.dom&&(o=i?i.nextSibling:r.firstChild)){let s=Ln.get(o);(!s||!s.parent&&s.canReuseDOM(a))&&a.reuseDOM(o)}a.sync(e,n),a.flags&=-8}if(o=i?i.nextSibling:r.firstChild,n&&!n.written&&n.node==r&&o!=a.dom&&(n.written=!0),a.dom.parentNode==r)for(;o&&o!=a.dom;)o=m7(o);else r.insertBefore(a.dom,o);i=a.dom}for(o=i?i.nextSibling:r.firstChild,o&&n&&n.node==r&&(n.written=!0);o;)o=m7(o)}else if(this.flags&1)for(let r of this.children)r.flags&7&&(r.sync(e,n),r.flags&=-8)}reuseDOM(e){}localPosFromDOM(e,n){let r;if(e==this.dom)r=this.dom.childNodes[n];else{let i=pu(e)==0?0:n==0?-1:1;for(;;){let o=e.parentNode;if(o==this.dom)break;i==0&&o.firstChild!=o.lastChild&&(e==o.firstChild?i=-1:i=1),e=o}i<0?r=e:r=e.nextSibling}if(r==this.dom.firstChild)return 0;for(;r&&!Ln.get(r);)r=r.nextSibling;if(!r)return this.length;for(let i=0,o=0;;i++){let a=this.children[i];if(a.dom==r)return o;o+=a.length+a.breakAfter}}domBoundsAround(e,n,r=0){let i=-1,o=-1,a=-1,s=-1;for(let l=0,c=r,u=r;l<this.children.length;l++){let f=this.children[l],d=c+f.length;if(c<e&&d>n)return f.domBoundsAround(e,n,c);if(d>=e&&i==-1&&(i=l,o=c),c>n&&f.dom.parentNode==this.dom){a=l,s=u;break}u=d,c=d+f.breakAfter}return{from:o,to:s<0?r+this.length:s,startDOM:(i?this.children[i-1].dom.nextSibling:null)||this.dom.firstChild,endDOM:a<this.children.length&&a>=0?this.children[a].dom:null}}markDirty(e=!1){this.flags|=2,this.markParentsDirty(e)}markParentsDirty(e){for(let n=this.parent;n;n=n.parent){if(e&&(n.flags|=2),n.flags&1)return;n.flags|=1,e=!1}}setParent(e){this.parent!=e&&(this.parent=e,this.flags&7&&this.markParentsDirty(!0))}setDOM(e){this.dom!=e&&(this.dom&&(this.dom.cmView=null),this.dom=e,e.cmView=this)}get rootView(){for(let e=this;;){let n=e.parent;if(!n)return e;e=n}}replaceChildren(e,n,r=S4){this.markDirty();for(let i=e;i<n;i++){let o=this.children[i];o.parent==this&&r.indexOf(o)<0&&o.destroy()}this.children.splice(e,n-e,...r);for(let i=0;i<r.length;i++)r[i].setParent(this)}ignoreMutation(e){return!1}ignoreEvent(e){return!1}childCursor(e=this.length){return new Gfe(this.children,e,this.children.length)}childPos(e,n=1){return this.childCursor().findPos(e,n)}toString(){let e=this.constructor.name.replace("View","");return e+(this.children.length?"("+this.children.join()+")":this.length?"["+(e=="Text"?this.text:this.length)+"]":"")+(this.breakAfter?"#":"")}static get(e){return e.cmView}get isEditable(){return!0}get isWidget(){return!1}get isHidden(){return!1}merge(e,n,r,i,o,a){return!1}become(e){return!1}canReuseDOM(e){return e.constructor==this.constructor&&!((this.flags|e.flags)&8)}getSide(){return 0}destroy(){for(let e of this.children)e.parent==this&&e.destroy();this.parent=null}}Ln.prototype.breakAfter=0;function m7(t){let e=t.nextSibling;return t.parentNode.removeChild(t),e}class Gfe{constructor(e,n,r){this.children=e,this.pos=n,this.i=r,this.off=0}findPos(e,n=1){for(;;){if(e>this.pos||e==this.pos&&(n>0||this.i==0||this.children[this.i-1].breakAfter))return this.off=e-this.pos,this;let r=this.children[--this.i];this.pos-=r.length+r.breakAfter}}}function Hfe(t,e,n,r,i,o,a,s,l){let{children:c}=t,u=c.length?c[e]:null,f=o.length?o[o.length-1]:null,d=f?f.breakAfter:a;if(!(e==r&&u&&!a&&!d&&o.length<2&&u.merge(n,i,o.length?f:null,n==0,s,l))){if(r<c.length){let h=c[r];h&&(i<h.length||h.breakAfter&&(f!=null&&f.breakAfter))?(e==r&&(h=h.split(i),i=0),!d&&f&&h.merge(0,i,f,!0,0,l)?o[o.length-1]=h:((i||h.children.length&&!h.children[0].length)&&h.merge(0,i,null,!1,0,l),o.push(h))):h!=null&&h.breakAfter&&(f?f.breakAfter=1:a=1),r++}for(u&&(u.breakAfter=a,n>0&&(!a&&o.length&&u.merge(n,u.length,o[0],!1,s,0)?u.breakAfter=o.shift().breakAfter:(n<u.length||u.children.length&&u.children[u.children.length-1].length==0)&&u.merge(n,u.length,null,!1,s,0),e++));e<r&&o.length;)if(c[r-1].become(o[o.length-1]))r--,o.pop(),l=o.length?0:s;else if(c[e].become(o[0]))e++,o.shift(),s=o.length?0:l;else break;!o.length&&e&&r<c.length&&!c[e-1].breakAfter&&c[r].merge(0,0,c[e-1],!1,s,l)&&e--,(e<r||o.length)&&t.replaceChildren(e,r,o)}}function qfe(t,e,n,r,i,o){let a=t.childCursor(),{i:s,off:l}=a.findPos(n,1),{i:c,off:u}=a.findPos(e,-1),f=e-n;for(let d of r)f+=d.length;t.length+=f,Hfe(t,c,u,s,l,r,0,i,o)}let Co=typeof navigator<"u"?navigator:{userAgent:"",vendor:"",platform:""},vN=typeof document<"u"?document:{documentElement:{style:{}}};const yN=/Edge\/(\d+)/.exec(Co.userAgent),Xfe=/MSIE \d/.test(Co.userAgent),xN=/Trident\/(?:[7-9]|\d{2,})\..*rv:(\d+)/.exec(Co.userAgent),Q2=!!(Xfe||xN||yN),g7=!Q2&&/gecko\/(\d+)/i.test(Co.userAgent),NR=!Q2&&/Chrome\/(\d+)/.exec(Co.userAgent),v7="webkitFontSmoothing"in vN.documentElement.style,Qfe=!Q2&&/Apple Computer/.test(Co.vendor),y7=Qfe&&(/Mobile\/\w+/.test(Co.userAgent)||Co.maxTouchPoints>2);var ut={mac:y7||/Mac/.test(Co.platform),windows:/Win/.test(Co.platform),linux:/Linux|X11/.test(Co.platform),ie:Q2,ie_version:Xfe?vN.documentMode||6:xN?+xN[1]:yN?+yN[1]:0,gecko:g7,gecko_version:g7?+(/Firefox\/(\d+)/.exec(Co.userAgent)||[0,0])[1]:0,chrome:!!NR,chrome_version:NR?+NR[1]:0,ios:y7,android:/Android\b/.test(Co.userAgent),webkit:v7,safari:Qfe,webkit_version:v7?+(/\bAppleWebKit\/(\d+)/.exec(Co.userAgent)||[0,0])[1]:0,tabSize:vN.documentElement.style.tabSize!=null?"tab-size":"-moz-tab-size"};const Krt=256;class el extends Ln{constructor(e){super(),this.text=e}get length(){return this.text.length}createDOM(e){this.setDOM(e||document.createTextNode(this.text))}sync(e,n){this.dom||this.createDOM(),this.dom.nodeValue!=this.text&&(n&&n.node==this.dom&&(n.written=!0),this.dom.nodeValue=this.text)}reuseDOM(e){e.nodeType==3&&this.createDOM(e)}merge(e,n,r){return this.flags&8||r&&(!(r instanceof el)||this.length-(n-e)+r.length>Krt||r.flags&8)?!1:(this.text=this.text.slice(0,e)+(r?r.text:"")+this.text.slice(n),this.markDirty(),!0)}split(e){let n=new el(this.text.slice(e));return this.text=this.text.slice(0,e),this.markDirty(),n.flags|=this.flags&8,n}localPosFromDOM(e,n){return e==this.dom?n:n?this.text.length:0}domAtPos(e){return new Yi(this.dom,e)}domBoundsAround(e,n,r){return{from:r,to:r+this.length,startDOM:this.dom,endDOM:this.dom.nextSibling}}coordsAt(e,n){return Zrt(this.dom,e,n)}}class mu extends Ln{constructor(e,n=[],r=0){super(),this.mark=e,this.children=n,this.length=r;for(let i of n)i.setParent(this)}setAttrs(e){if(zfe(e),this.mark.class&&(e.className=this.mark.class),this.mark.attrs)for(let n in this.mark.attrs)e.setAttribute(n,this.mark.attrs[n]);return e}canReuseDOM(e){return super.canReuseDOM(e)&&!((this.flags|e.flags)&8)}reuseDOM(e){e.nodeName==this.mark.tagName.toUpperCase()&&(this.setDOM(e),this.flags|=6)}sync(e,n){this.dom?this.flags&4&&this.setAttrs(this.dom):this.setDOM(this.setAttrs(document.createElement(this.mark.tagName))),super.sync(e,n)}merge(e,n,r,i,o,a){return r&&(!(r instanceof mu&&r.mark.eq(this.mark))||e&&o<=0||n<this.length&&a<=0)?!1:(qfe(this,e,n,r?r.children.slice():[],o-1,a-1),this.markDirty(),!0)}split(e){let n=[],r=0,i=-1,o=0;for(let s of this.children){let l=r+s.length;l>e&&n.push(r<e?s.split(e-r):s),i<0&&r>=e&&(i=o),r=l,o++}let a=this.length-e;return this.length=e,i>-1&&(this.children.length=i,this.markDirty()),new mu(this.mark,n,a)}domAtPos(e){return Yfe(this,e)}coordsAt(e,n){return Zfe(this,e,n)}}function Zrt(t,e,n){let r=t.nodeValue.length;e>r&&(e=r);let i=e,o=e,a=0;e==0&&n<0||e==r&&n>=0?ut.chrome||ut.gecko||(e?(i--,a=1):o<r&&(o++,a=-1)):n<0?i--:o<r&&o++;let s=cp(t,i,o).getClientRects();if(!s.length)return null;let l=s[(a?a<0:n>=0)?0:s.length-1];return ut.safari&&!a&&l.width==0&&(l=Array.prototype.find.call(s,c=>c.width)||l),a?pw(l,a<0):l||null}class Cf extends Ln{static create(e,n,r){return new Cf(e,n,r)}constructor(e,n,r){super(),this.widget=e,this.length=n,this.side=r,this.prevWidget=null}split(e){let n=Cf.create(this.widget,this.length-e,this.side);return this.length-=e,n}sync(e){(!this.dom||!this.widget.updateDOM(this.dom,e))&&(this.dom&&this.prevWidget&&this.prevWidget.destroy(this.dom),this.prevWidget=null,this.setDOM(this.widget.toDOM(e)),this.widget.editable||(this.dom.contentEditable="false"))}getSide(){return this.side}merge(e,n,r,i,o,a){return r&&(!(r instanceof Cf)||!this.widget.compare(r.widget)||e>0&&o<=0||n<this.length&&a<=0)?!1:(this.length=e+(r?r.length:0)+(this.length-n),!0)}become(e){return e instanceof Cf&&e.side==this.side&&this.widget.constructor==e.widget.constructor?(this.widget.compare(e.widget)||this.markDirty(!0),this.dom&&!this.prevWidget&&(this.prevWidget=this.widget),this.widget=e.widget,this.length=e.length,!0):!1}ignoreMutation(){return!0}ignoreEvent(e){return this.widget.ignoreEvent(e)}get overrideDOMText(){if(this.length==0)return xn.empty;let e=this;for(;e.parent;)e=e.parent;let{view:n}=e,r=n&&n.state.doc,i=this.posAtStart;return r?r.slice(i,i+this.length):xn.empty}domAtPos(e){return(this.length?e==0:this.side>0)?Yi.before(this.dom):Yi.after(this.dom,e==this.length)}domBoundsAround(){return null}coordsAt(e,n){let r=this.widget.coordsAt(this.dom,e,n);if(r)return r;let i=this.dom.getClientRects(),o=null;if(!i.length)return null;let a=this.side?this.side<0:e>0;for(let s=a?i.length-1:0;o=i[s],!(e>0?s==0:s==i.length-1||o.top<o.bottom);s+=a?-1:1);return pw(o,!a)}get isEditable(){return!1}get isWidget(){return!0}get isHidden(){return this.widget.isHidden}destroy(){super.destroy(),this.dom&&this.widget.destroy(this.dom)}}class uv extends Ln{constructor(e){super(),this.side=e}get length(){return 0}merge(){return!1}become(e){return e instanceof uv&&e.side==this.side}split(){return new uv(this.side)}sync(){if(!this.dom){let e=document.createElement("img");e.className="cm-widgetBuffer",e.setAttribute("aria-hidden","true"),this.setDOM(e)}}getSide(){return this.side}domAtPos(e){return this.side>0?Yi.before(this.dom):Yi.after(this.dom)}localPosFromDOM(){return 0}domBoundsAround(){return null}coordsAt(e){return this.dom.getBoundingClientRect()}get overrideDOMText(){return xn.empty}get isHidden(){return!0}}el.prototype.children=Cf.prototype.children=uv.prototype.children=S4;function Yfe(t,e){let n=t.dom,{children:r}=t,i=0;for(let o=0;i<r.length;i++){let a=r[i],s=o+a.length;if(!(s==o&&a.getSide()<=0)){if(e>o&&e<s&&a.dom.parentNode==n)return a.domAtPos(e-o);if(e<=o)break;o=s}}for(let o=i;o>0;o--){let a=r[o-1];if(a.dom.parentNode==n)return a.domAtPos(a.length)}for(let o=i;o<r.length;o++){let a=r[o];if(a.dom.parentNode==n)return a.domAtPos(0)}return new Yi(n,0)}function Kfe(t,e,n){let r,{children:i}=t;n>0&&e instanceof mu&&i.length&&(r=i[i.length-1])instanceof mu&&r.mark.eq(e.mark)?Kfe(r,e.children[0],n-1):(i.push(e),e.setParent(t)),t.length+=e.length}function Zfe(t,e,n){let r=null,i=-1,o=null,a=-1;function s(c,u){for(let f=0,d=0;f<c.children.length&&d<=u;f++){let h=c.children[f],p=d+h.length;p>=u&&(h.children.length?s(h,u-d):(!o||o.isHidden&&n>0)&&(p>u||d==p&&h.getSide()>0)?(o=h,a=u-d):(d<u||d==p&&h.getSide()<0&&!h.isHidden)&&(r=h,i=u-d)),d=p}}s(t,e);let l=(n<0?r:o)||r||o;return l?l.coordsAt(Math.max(0,l==r?i:a),n):Jrt(t)}function Jrt(t){let e=t.dom.lastChild;if(!e)return t.dom.getBoundingClientRect();let n=cv(e);return n[n.length-1]||null}function bN(t,e){for(let n in t)n=="class"&&e.class?e.class+=" "+t.class:n=="style"&&e.style?e.style+=";"+t.style:e[n]=t[n];return e}const x7=Object.create(null);function pE(t,e,n){if(t==e)return!0;t||(t=x7),e||(e=x7);let r=Object.keys(t),i=Object.keys(e);if(r.length-(n&&r.indexOf(n)>-1?1:0)!=i.length-(n&&i.indexOf(n)>-1?1:0))return!1;for(let o of r)if(o!=n&&(i.indexOf(o)==-1||t[o]!==e[o]))return!1;return!0}function _N(t,e,n){let r=!1;if(e)for(let i in e)n&&i in n||(r=!0,i=="style"?t.style.cssText="":t.removeAttribute(i));if(n)for(let i in n)e&&e[i]==n[i]||(r=!0,i=="style"?t.style.cssText=n[i]:t.setAttribute(i,n[i]));return r}function eit(t){let e=Object.create(null);for(let n=0;n<t.attributes.length;n++){let r=t.attributes[n];e[r.name]=r.value}return e}class uc{eq(e){return!1}updateDOM(e,n){return!1}compare(e){return this==e||this.constructor==e.constructor&&this.eq(e)}get estimatedHeight(){return-1}get lineBreaks(){return 0}ignoreEvent(e){return!0}coordsAt(e,n,r){return null}get isHidden(){return!1}get editable(){return!1}destroy(e){}}var uo=function(t){return t[t.Text=0]="Text",t[t.WidgetBefore=1]="WidgetBefore",t[t.WidgetAfter=2]="WidgetAfter",t[t.WidgetRange=3]="WidgetRange",t}(uo||(uo={}));class gt extends sp{constructor(e,n,r,i){super(),this.startSide=e,this.endSide=n,this.widget=r,this.spec=i}get heightRelevant(){return!1}static mark(e){return new mw(e)}static widget(e){let n=Math.max(-1e4,Math.min(1e4,e.side||0)),r=!!e.block;return n+=r&&!e.inlineOrder?n>0?3e8:-4e8:n>0?1e8:-1e8,new sd(e,n,n,r,e.widget||null,!1)}static replace(e){let n=!!e.block,r,i;if(e.isBlockGap)r=-5e8,i=4e8;else{let{start:o,end:a}=Jfe(e,n);r=(o?n?-3e8:-1:5e8)-1,i=(a?n?2e8:1:-6e8)+1}return new sd(e,r,i,n,e.widget||null,!0)}static line(e){return new gw(e)}static set(e,n=!1){return sn.of(e,n)}hasHeight(){return this.widget?this.widget.estimatedHeight>-1:!1}}gt.none=sn.empty;class mw extends gt{constructor(e){let{start:n,end:r}=Jfe(e);super(n?-1:5e8,r?1:-6e8,null,e),this.tagName=e.tagName||"span",this.class=e.class||"",this.attrs=e.attributes||null}eq(e){var n,r;return this==e||e instanceof mw&&this.tagName==e.tagName&&(this.class||((n=this.attrs)===null||n===void 0?void 0:n.class))==(e.class||((r=e.attrs)===null||r===void 0?void 0:r.class))&&pE(this.attrs,e.attrs,"class")}range(e,n=e){if(e>=n)throw new RangeError("Mark decorations may not be empty");return super.range(e,n)}}mw.prototype.point=!1;class gw extends gt{constructor(e){super(-2e8,-2e8,null,e)}eq(e){return e instanceof gw&&this.spec.class==e.spec.class&&pE(this.spec.attributes,e.spec.attributes)}range(e,n=e){if(n!=e)throw new RangeError("Line decoration ranges must be zero-length");return super.range(e,n)}}gw.prototype.mapMode=Pi.TrackBefore;gw.prototype.point=!0;class sd extends gt{constructor(e,n,r,i,o,a){super(n,r,o,e),this.block=i,this.isReplace=a,this.mapMode=i?n<=0?Pi.TrackBefore:Pi.TrackAfter:Pi.TrackDel}get type(){return this.startSide!=this.endSide?uo.WidgetRange:this.startSide<=0?uo.WidgetBefore:uo.WidgetAfter}get heightRelevant(){return this.block||!!this.widget&&(this.widget.estimatedHeight>=5||this.widget.lineBreaks>0)}eq(e){return e instanceof sd&&tit(this.widget,e.widget)&&this.block==e.block&&this.startSide==e.startSide&&this.endSide==e.endSide}range(e,n=e){if(this.isReplace&&(e>n||e==n&&this.startSide>0&&this.endSide<=0))throw new RangeError("Invalid range for replacement decoration");if(!this.isReplace&&n!=e)throw new RangeError("Widget decorations can only have zero-length ranges");return super.range(e,n)}}sd.prototype.point=!0;function Jfe(t,e=!1){let{inclusiveStart:n,inclusiveEnd:r}=t;return n==null&&(n=t.inclusive),r==null&&(r=t.inclusive),{start:n??e,end:r??e}}function tit(t,e){return t==e||!!(t&&e&&t.compare(e))}function wN(t,e,n,r=0){let i=n.length-1;i>=0&&n[i]+r>=t?n[i]=Math.max(n[i],e):n.push(t,e)}class Nr extends Ln{constructor(){super(...arguments),this.children=[],this.length=0,this.prevAttrs=void 0,this.attrs=null,this.breakAfter=0}merge(e,n,r,i,o,a){if(r){if(!(r instanceof Nr))return!1;this.dom||r.transferDOM(this)}return i&&this.setDeco(r?r.attrs:null),qfe(this,e,n,r?r.children.slice():[],o,a),!0}split(e){let n=new Nr;if(n.breakAfter=this.breakAfter,this.length==0)return n;let{i:r,off:i}=this.childPos(e);i&&(n.append(this.children[r].split(i),0),this.children[r].merge(i,this.children[r].length,null,!1,0,0),r++);for(let o=r;o<this.children.length;o++)n.append(this.children[o],0);for(;r>0&&this.children[r-1].length==0;)this.children[--r].destroy();return this.children.length=r,this.markDirty(),this.length=e,n}transferDOM(e){this.dom&&(this.markDirty(),e.setDOM(this.dom),e.prevAttrs=this.prevAttrs===void 0?this.attrs:this.prevAttrs,this.prevAttrs=void 0,this.dom=null)}setDeco(e){pE(this.attrs,e)||(this.dom&&(this.prevAttrs=this.attrs,this.markDirty()),this.attrs=e)}append(e,n){Kfe(this,e,n)}addLineDeco(e){let n=e.spec.attributes,r=e.spec.class;n&&(this.attrs=bN(n,this.attrs||{})),r&&(this.attrs=bN({class:r},this.attrs||{}))}domAtPos(e){return Yfe(this,e)}reuseDOM(e){e.nodeName=="DIV"&&(this.setDOM(e),this.flags|=6)}sync(e,n){var r;this.dom?this.flags&4&&(zfe(this.dom),this.dom.className="cm-line",this.prevAttrs=this.attrs?null:void 0):(this.setDOM(document.createElement("div")),this.dom.className="cm-line",this.prevAttrs=this.attrs?null:void 0),this.prevAttrs!==void 0&&(_N(this.dom,this.prevAttrs,this.attrs),this.dom.classList.add("cm-line"),this.prevAttrs=void 0),super.sync(e,n);let i=this.dom.lastChild;for(;i&&Ln.get(i)instanceof mu;)i=i.lastChild;if(!i||!this.length||i.nodeName!="BR"&&((r=Ln.get(i))===null||r===void 0?void 0:r.isEditable)==!1&&(!ut.ios||!this.children.some(o=>o instanceof el))){let o=document.createElement("BR");o.cmIgnore=!0,this.dom.appendChild(o)}}measureTextSize(){if(this.children.length==0||this.length>20)return null;let e=0,n;for(let r of this.children){if(!(r instanceof el)||/[^ -~]/.test(r.text))return null;let i=cv(r.dom);if(i.length!=1)return null;e+=i[0].width,n=i[0].height}return e?{lineHeight:this.dom.getBoundingClientRect().height,charWidth:e/this.length,textHeight:n}:null}coordsAt(e,n){let r=Zfe(this,e,n);if(!this.children.length&&r&&this.parent){let{heightOracle:i}=this.parent.view.viewState,o=r.bottom-r.top;if(Math.abs(o-i.lineHeight)<2&&i.textHeight<o){let a=(o-i.textHeight)/2;return{top:r.top+a,bottom:r.bottom-a,left:r.left,right:r.left}}}return r}become(e){return e instanceof Nr&&this.children.length==0&&e.children.length==0&&pE(this.attrs,e.attrs)&&this.breakAfter==e.breakAfter}covers(){return!0}static find(e,n){for(let r=0,i=0;r<e.children.length;r++){let o=e.children[r],a=i+o.length;if(a>=n){if(o instanceof Nr)return o;if(a>n)break}i=a+o.breakAfter}return null}}class eu extends Ln{constructor(e,n,r){super(),this.widget=e,this.length=n,this.deco=r,this.breakAfter=0,this.prevWidget=null}merge(e,n,r,i,o,a){return r&&(!(r instanceof eu)||!this.widget.compare(r.widget)||e>0&&o<=0||n<this.length&&a<=0)?!1:(this.length=e+(r?r.length:0)+(this.length-n),!0)}domAtPos(e){return e==0?Yi.before(this.dom):Yi.after(this.dom,e==this.length)}split(e){let n=this.length-e;this.length=e;let r=new eu(this.widget,n,this.deco);return r.breakAfter=this.breakAfter,r}get children(){return S4}sync(e){(!this.dom||!this.widget.updateDOM(this.dom,e))&&(this.dom&&this.prevWidget&&this.prevWidget.destroy(this.dom),this.prevWidget=null,this.setDOM(this.widget.toDOM(e)),this.widget.editable||(this.dom.contentEditable="false"))}get overrideDOMText(){return this.parent?this.parent.view.state.doc.slice(this.posAtStart,this.posAtEnd):xn.empty}domBoundsAround(){return null}become(e){return e instanceof eu&&e.widget.constructor==this.widget.constructor?(e.widget.compare(this.widget)||this.markDirty(!0),this.dom&&!this.prevWidget&&(this.prevWidget=this.widget),this.widget=e.widget,this.length=e.length,this.deco=e.deco,this.breakAfter=e.breakAfter,!0):!1}ignoreMutation(){return!0}ignoreEvent(e){return this.widget.ignoreEvent(e)}get isEditable(){return!1}get isWidget(){return!0}coordsAt(e,n){let r=this.widget.coordsAt(this.dom,e,n);return r||(this.widget instanceof SN?null:pw(this.dom.getBoundingClientRect(),this.length?e==0:n<=0))}destroy(){super.destroy(),this.dom&&this.widget.destroy(this.dom)}covers(e){let{startSide:n,endSide:r}=this.deco;return n==r?!1:e<0?n<0:r>0}}class SN extends uc{constructor(e){super(),this.height=e}toDOM(){let e=document.createElement("div");return e.className="cm-gap",this.updateDOM(e),e}eq(e){return e.height==this.height}updateDOM(e){return e.style.height=this.height+"px",!0}get editable(){return!0}get estimatedHeight(){return this.height}ignoreEvent(){return!1}}class rb{constructor(e,n,r,i){this.doc=e,this.pos=n,this.end=r,this.disallowBlockEffectsFor=i,this.content=[],this.curLine=null,this.breakAtStart=0,this.pendingBuffer=0,this.bufferMarks=[],this.atCursorPos=!0,this.openStart=-1,this.openEnd=-1,this.text="",this.textOff=0,this.cursor=e.iter(),this.skip=n}posCovered(){if(this.content.length==0)return!this.breakAtStart&&this.doc.lineAt(this.pos).from!=this.pos;let e=this.content[this.content.length-1];return!(e.breakAfter||e instanceof eu&&e.deco.endSide<0)}getLine(){return this.curLine||(this.content.push(this.curLine=new Nr),this.atCursorPos=!0),this.curLine}flushBuffer(e=this.bufferMarks){this.pendingBuffer&&(this.curLine.append(qS(new uv(-1),e),e.length),this.pendingBuffer=0)}addBlockWidget(e){this.flushBuffer(),this.curLine=null,this.content.push(e)}finish(e){this.pendingBuffer&&e<=this.bufferMarks.length?this.flushBuffer():this.pendingBuffer=0,!this.posCovered()&&!(e&&this.content.length&&this.content[this.content.length-1]instanceof eu)&&this.getLine()}buildText(e,n,r){for(;e>0;){if(this.textOff==this.text.length){let{value:o,lineBreak:a,done:s}=this.cursor.next(this.skip);if(this.skip=0,s)throw new Error("Ran out of text content when drawing inline views");if(a){this.posCovered()||this.getLine(),this.content.length?this.content[this.content.length-1].breakAfter=1:this.breakAtStart=1,this.flushBuffer(),this.curLine=null,this.atCursorPos=!0,e--;continue}else this.text=o,this.textOff=0}let i=Math.min(this.text.length-this.textOff,e,512);this.flushBuffer(n.slice(n.length-r)),this.getLine().append(qS(new el(this.text.slice(this.textOff,this.textOff+i)),n),r),this.atCursorPos=!0,this.textOff+=i,e-=i,r=0}}span(e,n,r,i){this.buildText(n-e,r,i),this.pos=n,this.openStart<0&&(this.openStart=i)}point(e,n,r,i,o,a){if(this.disallowBlockEffectsFor[a]&&r instanceof sd){if(r.block)throw new RangeError("Block decorations may not be specified via plugins");if(n>this.doc.lineAt(this.pos).to)throw new RangeError("Decorations that replace line breaks may not be specified via plugins")}let s=n-e;if(r instanceof sd)if(r.block)r.startSide>0&&!this.posCovered()&&this.getLine(),this.addBlockWidget(new eu(r.widget||fv.block,s,r));else{let l=Cf.create(r.widget||fv.inline,s,s?0:r.startSide),c=this.atCursorPos&&!l.isEditable&&o<=i.length&&(e<n||r.startSide>0),u=!l.isEditable&&(e<n||o>i.length||r.startSide<=0),f=this.getLine();this.pendingBuffer==2&&!c&&!l.isEditable&&(this.pendingBuffer=0),this.flushBuffer(i),c&&(f.append(qS(new uv(1),i),o),o=i.length+Math.max(0,o-i.length)),f.append(qS(l,i),o),this.atCursorPos=u,this.pendingBuffer=u?e<n||o>i.length?1:2:0,this.pendingBuffer&&(this.bufferMarks=i.slice())}else this.doc.lineAt(this.pos).from==this.pos&&this.getLine().addLineDeco(r);s&&(this.textOff+s<=this.text.length?this.textOff+=s:(this.skip+=s-(this.text.length-this.textOff),this.text="",this.textOff=0),this.pos=n),this.openStart<0&&(this.openStart=o)}static build(e,n,r,i,o){let a=new rb(e,n,r,o);return a.openEnd=sn.spans(i,n,r,a),a.openStart<0&&(a.openStart=a.openEnd),a.finish(a.openEnd),a}}function qS(t,e){for(let n of e)t=new mu(n,[t],t.length);return t}class fv extends uc{constructor(e){super(),this.tag=e}eq(e){return e.tag==this.tag}toDOM(){return document.createElement(this.tag)}updateDOM(e){return e.nodeName.toLowerCase()==this.tag}get isHidden(){return!0}}fv.inline=new fv("span");fv.block=new fv("div");var rr=function(t){return t[t.LTR=0]="LTR",t[t.RTL=1]="RTL",t}(rr||(rr={}));const up=rr.LTR,O4=rr.RTL;function ede(t){let e=[];for(let n=0;n<t.length;n++)e.push(1<<+t[n]);return e}const nit=ede("88888888888888888888888888888888888666888888787833333333337888888000000000000000000000000008888880000000000000000000000000088888888888888888888888888888888888887866668888088888663380888308888800000000000000000000000800000000000000000000000000000008"),rit=ede("4444448826627288999999999992222222222222222222222222222222222222222222222229999999999999999999994444444444644222822222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222999999949999999229989999223333333333"),ON=Object.create(null),cl=[];for(let t of["()","[]","{}"]){let e=t.charCodeAt(0),n=t.charCodeAt(1);ON[e]=n,ON[n]=-e}function tde(t){return t<=247?nit[t]:1424<=t&&t<=1524?2:1536<=t&&t<=1785?rit[t-1536]:1774<=t&&t<=2220?4:8192<=t&&t<=8204?256:64336<=t&&t<=65023?4:1}const iit=/[\u0590-\u05f4\u0600-\u06ff\u0700-\u08ac\ufb50-\ufdff]/;class Tf{get dir(){return this.level%2?O4:up}constructor(e,n,r){this.from=e,this.to=n,this.level=r}side(e,n){return this.dir==n==e?this.to:this.from}forward(e,n){return e==(this.dir==n)}static find(e,n,r,i){let o=-1;for(let a=0;a<e.length;a++){let s=e[a];if(s.from<=n&&s.to>=n){if(s.level==r)return a;(o<0||(i!=0?i<0?s.from<n:s.to>n:e[o].level>s.level))&&(o=a)}}if(o<0)throw new RangeError("Index out of range");return o}}function nde(t,e){if(t.length!=e.length)return!1;for(let n=0;n<t.length;n++){let r=t[n],i=e[n];if(r.from!=i.from||r.to!=i.to||r.direction!=i.direction||!nde(r.inner,i.inner))return!1}return!0}const Dn=[];function oit(t,e,n,r,i){for(let o=0;o<=r.length;o++){let a=o?r[o-1].to:e,s=o<r.length?r[o].from:n,l=o?256:i;for(let c=a,u=l,f=l;c<s;c++){let d=tde(t.charCodeAt(c));d==512?d=u:d==8&&f==4&&(d=16),Dn[c]=d==4?2:d,d&7&&(f=d),u=d}for(let c=a,u=l,f=l;c<s;c++){let d=Dn[c];if(d==128)c<s-1&&u==Dn[c+1]&&u&24?d=Dn[c]=u:Dn[c]=256;else if(d==64){let h=c+1;for(;h<s&&Dn[h]==64;)h++;let p=c&&u==8||h<n&&Dn[h]==8?f==1?1:8:256;for(let m=c;m<h;m++)Dn[m]=p;c=h-1}else d==8&&f==1&&(Dn[c]=1);u=d,d&7&&(f=d)}}}function ait(t,e,n,r,i){let o=i==1?2:1;for(let a=0,s=0,l=0;a<=r.length;a++){let c=a?r[a-1].to:e,u=a<r.length?r[a].from:n;for(let f=c,d,h,p;f<u;f++)if(h=ON[d=t.charCodeAt(f)])if(h<0){for(let m=s-3;m>=0;m-=3)if(cl[m+1]==-h){let g=cl[m+2],v=g&2?i:g&4?g&1?o:i:0;v&&(Dn[f]=Dn[cl[m]]=v),s=m;break}}else{if(cl.length==189)break;cl[s++]=f,cl[s++]=d,cl[s++]=l}else if((p=Dn[f])==2||p==1){let m=p==i;l=m?0:1;for(let g=s-3;g>=0;g-=3){let v=cl[g+2];if(v&2)break;if(m)cl[g+2]|=2;else{if(v&4)break;cl[g+2]|=4}}}}}function sit(t,e,n,r){for(let i=0,o=r;i<=n.length;i++){let a=i?n[i-1].to:t,s=i<n.length?n[i].from:e;for(let l=a;l<s;){let c=Dn[l];if(c==256){let u=l+1;for(;;)if(u==s){if(i==n.length)break;u=n[i++].to,s=i<n.length?n[i].from:e}else if(Dn[u]==256)u++;else break;let f=o==1,d=(u<e?Dn[u]:r)==1,h=f==d?f?1:2:r;for(let p=u,m=i,g=m?n[m-1].to:t;p>l;)p==g&&(p=n[--m].from,g=m?n[m-1].to:t),Dn[--p]=h;l=u}else o=c,l++}}}function CN(t,e,n,r,i,o,a){let s=r%2?2:1;if(r%2==i%2)for(let l=e,c=0;l<n;){let u=!0,f=!1;if(c==o.length||l<o[c].from){let m=Dn[l];m!=s&&(u=!1,f=m==16)}let d=!u&&s==1?[]:null,h=u?r:r+1,p=l;e:for(;;)if(c<o.length&&p==o[c].from){if(f)break e;let m=o[c];if(!u)for(let g=m.to,v=c+1;;){if(g==n)break e;if(v<o.length&&o[v].from==g)g=o[v++].to;else{if(Dn[g]==s)break e;break}}if(c++,d)d.push(m);else{m.from>l&&a.push(new Tf(l,m.from,h));let g=m.direction==up!=!(h%2);TN(t,g?r+1:r,i,m.inner,m.from,m.to,a),l=m.to}p=m.to}else{if(p==n||(u?Dn[p]!=s:Dn[p]==s))break;p++}d?CN(t,l,p,r+1,i,d,a):l<p&&a.push(new Tf(l,p,h)),l=p}else for(let l=n,c=o.length;l>e;){let u=!0,f=!1;if(!c||l>o[c-1].to){let m=Dn[l-1];m!=s&&(u=!1,f=m==16)}let d=!u&&s==1?[]:null,h=u?r:r+1,p=l;e:for(;;)if(c&&p==o[c-1].to){if(f)break e;let m=o[--c];if(!u)for(let g=m.from,v=c;;){if(g==e)break e;if(v&&o[v-1].to==g)g=o[--v].from;else{if(Dn[g-1]==s)break e;break}}if(d)d.push(m);else{m.to<l&&a.push(new Tf(m.to,l,h));let g=m.direction==up!=!(h%2);TN(t,g?r+1:r,i,m.inner,m.from,m.to,a),l=m.from}p=m.from}else{if(p==e||(u?Dn[p-1]!=s:Dn[p-1]==s))break;p--}d?CN(t,p,l,r+1,i,d,a):p<l&&a.push(new Tf(p,l,h)),l=p}}function TN(t,e,n,r,i,o,a){let s=e%2?2:1;oit(t,i,o,r,s),ait(t,i,o,r,s),sit(i,o,r,s),CN(t,i,o,e,n,r,a)}function lit(t,e,n){if(!t)return[new Tf(0,0,e==O4?1:0)];if(e==up&&!n.length&&!iit.test(t))return rde(t.length);if(n.length)for(;t.length>Dn.length;)Dn[Dn.length]=256;let r=[],i=e==up?0:1;return TN(t,i,i,n,0,t.length,r),r}function rde(t){return[new Tf(0,t,0)]}let ide="";function cit(t,e,n,r,i){var o;let a=r.head-t.from,s=Tf.find(e,a,(o=r.bidiLevel)!==null&&o!==void 0?o:-1,r.assoc),l=e[s],c=l.side(i,n);if(a==c){let d=s+=i?1:-1;if(d<0||d>=e.length)return null;l=e[s=d],a=l.side(!i,n),c=l.side(i,n)}let u=ki(t.text,a,l.forward(i,n));(u<l.from||u>l.to)&&(u=c),ide=t.text.slice(Math.min(a,u),Math.max(a,u));let f=s==(i?e.length-1:0)?null:e[s+(i?1:-1)];return f&&u==c&&f.level+(i?0:1)<l.level?je.cursor(f.side(!i,n)+t.from,f.forward(i,n)?1:-1,f.level):je.cursor(u+t.from,l.forward(i,n)?-1:1,l.level)}function uit(t,e,n){for(let r=e;r<n;r++){let i=tde(t.charCodeAt(r));if(i==1)return up;if(i==2||i==4)return O4}return up}const ode=ct.define(),ade=ct.define(),sde=ct.define(),lde=ct.define(),EN=ct.define(),cde=ct.define(),ude=ct.define(),fde=ct.define({combine:t=>t.some(e=>e)}),dde=ct.define({combine:t=>t.some(e=>e)}),hde=ct.define();class Rg{constructor(e,n="nearest",r="nearest",i=5,o=5,a=!1){this.range=e,this.y=n,this.x=r,this.yMargin=i,this.xMargin=o,this.isSnapshot=a}map(e){return e.empty?this:new Rg(this.range.map(e),this.y,this.x,this.yMargin,this.xMargin,this.isSnapshot)}clip(e){return this.range.to<=e.doc.length?this:new Rg(je.cursor(e.doc.length),this.y,this.x,this.yMargin,this.xMargin,this.isSnapshot)}}const XS=Rt.define({map:(t,e)=>t.map(e)}),pde=Rt.define();function Ao(t,e,n){let r=t.facet(lde);r.length?r[0](e):window.onerror?window.onerror(String(e),n,void 0,void 0,e):n?console.error(n+":",e):console.error(e)}const pf=ct.define({combine:t=>t.length?t[0]:!0});let fit=0;const px=ct.define();class kr{constructor(e,n,r,i,o){this.id=e,this.create=n,this.domEventHandlers=r,this.domEventObservers=i,this.extension=o(this)}static define(e,n){const{eventHandlers:r,eventObservers:i,provide:o,decorations:a}=n||{};return new kr(fit++,e,r,i,s=>{let l=[px.of(s)];return a&&l.push(o_.of(c=>{let u=c.plugin(s);return u?a(u):gt.none})),o&&l.push(o(s)),l})}static fromClass(e,n){return kr.define(r=>new e(r),n)}}class $R{constructor(e){this.spec=e,this.mustUpdate=null,this.value=null}update(e){if(this.value){if(this.mustUpdate){let n=this.mustUpdate;if(this.mustUpdate=null,this.value.update)try{this.value.update(n)}catch(r){if(Ao(n.state,r,"CodeMirror plugin crashed"),this.value.destroy)try{this.value.destroy()}catch{}this.deactivate()}}}else if(this.spec)try{this.value=this.spec.create(e)}catch(n){Ao(e.state,n,"CodeMirror plugin crashed"),this.deactivate()}return this}destroy(e){var n;if(!((n=this.value)===null||n===void 0)&&n.destroy)try{this.value.destroy()}catch(r){Ao(e.state,r,"CodeMirror plugin crashed")}}deactivate(){this.spec=this.value=null}}const mde=ct.define(),C4=ct.define(),o_=ct.define(),gde=ct.define(),T4=ct.define(),vde=ct.define();function b7(t,e){let n=t.state.facet(vde);if(!n.length)return n;let r=n.map(o=>o instanceof Function?o(t):o),i=[];return sn.spans(r,e.from,e.to,{point(){},span(o,a,s,l){let c=o-e.from,u=a-e.from,f=i;for(let d=s.length-1;d>=0;d--,l--){let h=s[d].spec.bidiIsolate,p;if(h==null&&(h=uit(e.text,c,u)),l>0&&f.length&&(p=f[f.length-1]).to==c&&p.direction==h)p.to=u,f=p.inner;else{let m={from:c,to:u,direction:h,inner:[]};f.push(m),f=m.inner}}}}),i}const yde=ct.define();function xde(t){let e=0,n=0,r=0,i=0;for(let o of t.state.facet(yde)){let a=o(t);a&&(a.left!=null&&(e=Math.max(e,a.left)),a.right!=null&&(n=Math.max(n,a.right)),a.top!=null&&(r=Math.max(r,a.top)),a.bottom!=null&&(i=Math.max(i,a.bottom)))}return{left:e,right:n,top:r,bottom:i}}const mx=ct.define();class rs{constructor(e,n,r,i){this.fromA=e,this.toA=n,this.fromB=r,this.toB=i}join(e){return new rs(Math.min(this.fromA,e.fromA),Math.max(this.toA,e.toA),Math.min(this.fromB,e.fromB),Math.max(this.toB,e.toB))}addToSet(e){let n=e.length,r=this;for(;n>0;n--){let i=e[n-1];if(!(i.fromA>r.toA)){if(i.toA<r.fromA)break;r=r.join(i),e.splice(n-1,1)}}return e.splice(n,0,r),e}static extendWithRanges(e,n){if(n.length==0)return e;let r=[];for(let i=0,o=0,a=0,s=0;;i++){let l=i==e.length?null:e[i],c=a-s,u=l?l.fromB:1e9;for(;o<n.length&&n[o]<u;){let f=n[o],d=n[o+1],h=Math.max(s,f),p=Math.min(u,d);if(h<=p&&new rs(h+c,p+c,h,p).addToSet(r),d>u)break;o+=2}if(!l)return r;new rs(l.fromA,l.toA,l.fromB,l.toB).addToSet(r),a=l.toA,s=l.toB}}}class mE{constructor(e,n,r){this.view=e,this.state=n,this.transactions=r,this.flags=0,this.startState=e.state,this.changes=Zr.empty(this.startState.doc.length);for(let o of r)this.changes=this.changes.compose(o.changes);let i=[];this.changes.iterChangedRanges((o,a,s,l)=>i.push(new rs(o,a,s,l))),this.changedRanges=i}static create(e,n,r){return new mE(e,n,r)}get viewportChanged(){return(this.flags&4)>0}get heightChanged(){return(this.flags&2)>0}get geometryChanged(){return this.docChanged||(this.flags&10)>0}get focusChanged(){return(this.flags&1)>0}get docChanged(){return!this.changes.empty}get selectionSet(){return this.transactions.some(e=>e.selection)}get empty(){return this.flags==0&&this.transactions.length==0}}class _7 extends Ln{get length(){return this.view.state.doc.length}constructor(e){super(),this.view=e,this.decorations=[],this.dynamicDecorationMap=[!1],this.domChanged=null,this.hasComposition=null,this.markedForComposition=new Set,this.editContextFormatting=gt.none,this.lastCompositionAfterCursor=!1,this.minWidth=0,this.minWidthFrom=0,this.minWidthTo=0,this.impreciseAnchor=null,this.impreciseHead=null,this.forceSelection=!1,this.lastUpdate=Date.now(),this.setDOM(e.contentDOM),this.children=[new Nr],this.children[0].setParent(this),this.updateDeco(),this.updateInner([new rs(0,0,0,e.state.doc.length)],0,null)}update(e){var n;let r=e.changedRanges;this.minWidth>0&&r.length&&(r.every(({fromA:c,toA:u})=>u<this.minWidthFrom||c>this.minWidthTo)?(this.minWidthFrom=e.changes.mapPos(this.minWidthFrom,1),this.minWidthTo=e.changes.mapPos(this.minWidthTo,1)):this.minWidth=this.minWidthFrom=this.minWidthTo=0),this.updateEditContextFormatting(e);let i=-1;this.view.inputState.composing>=0&&!this.view.observer.editContext&&(!((n=this.domChanged)===null||n===void 0)&&n.newSel?i=this.domChanged.newSel.head:!yit(e.changes,this.hasComposition)&&!e.selectionSet&&(i=e.state.selection.main.head));let o=i>-1?hit(this.view,e.changes,i):null;if(this.domChanged=null,this.hasComposition){this.markedForComposition.clear();let{from:c,to:u}=this.hasComposition;r=new rs(c,u,e.changes.mapPos(c,-1),e.changes.mapPos(u,1)).addToSet(r.slice())}this.hasComposition=o?{from:o.range.fromB,to:o.range.toB}:null,(ut.ie||ut.chrome)&&!o&&e&&e.state.doc.lines!=e.startState.doc.lines&&(this.forceSelection=!0);let a=this.decorations,s=this.updateDeco(),l=git(a,s,e.changes);return r=rs.extendWithRanges(r,l),!(this.flags&7)&&r.length==0?!1:(this.updateInner(r,e.startState.doc.length,o),e.transactions.length&&(this.lastUpdate=Date.now()),!0)}updateInner(e,n,r){this.view.viewState.mustMeasureContent=!0,this.updateChildren(e,n,r);let{observer:i}=this.view;i.ignore(()=>{this.dom.style.height=this.view.viewState.contentHeight/this.view.scaleY+"px",this.dom.style.flexBasis=this.minWidth?this.minWidth+"px":"";let a=ut.chrome||ut.ios?{node:i.selectionRange.focusNode,written:!1}:void 0;this.sync(this.view,a),this.flags&=-8,a&&(a.written||i.selectionRange.focusNode!=a.node)&&(this.forceSelection=!0),this.dom.style.height=""}),this.markedForComposition.forEach(a=>a.flags&=-9);let o=[];if(this.view.viewport.from||this.view.viewport.to<this.view.state.doc.length)for(let a of this.children)a instanceof eu&&a.widget instanceof SN&&o.push(a.dom);i.updateGaps(o)}updateChildren(e,n,r){let i=r?r.range.addToSet(e.slice()):e,o=this.childCursor(n);for(let a=i.length-1;;a--){let s=a>=0?i[a]:null;if(!s)break;let{fromA:l,toA:c,fromB:u,toB:f}=s,d,h,p,m;if(r&&r.range.fromB<f&&r.range.toB>u){let b=rb.build(this.view.state.doc,u,r.range.fromB,this.decorations,this.dynamicDecorationMap),_=rb.build(this.view.state.doc,r.range.toB,f,this.decorations,this.dynamicDecorationMap);h=b.breakAtStart,p=b.openStart,m=_.openEnd;let S=this.compositionView(r);_.breakAtStart?S.breakAfter=1:_.content.length&&S.merge(S.length,S.length,_.content[0],!1,_.openStart,0)&&(S.breakAfter=_.content[0].breakAfter,_.content.shift()),b.content.length&&S.merge(0,0,b.content[b.content.length-1],!0,0,b.openEnd)&&b.content.pop(),d=b.content.concat(S).concat(_.content)}else({content:d,breakAtStart:h,openStart:p,openEnd:m}=rb.build(this.view.state.doc,u,f,this.decorations,this.dynamicDecorationMap));let{i:g,off:v}=o.findPos(c,1),{i:y,off:x}=o.findPos(l,-1);Hfe(this,y,x,g,v,d,h,p,m)}r&&this.fixCompositionDOM(r)}updateEditContextFormatting(e){this.editContextFormatting=this.editContextFormatting.map(e.changes);for(let n of e.transactions)for(let r of n.effects)r.is(pde)&&(this.editContextFormatting=r.value)}compositionView(e){let n=new el(e.text.nodeValue);n.flags|=8;for(let{deco:i}of e.marks)n=new mu(i,[n],n.length);let r=new Nr;return r.append(n,0),r}fixCompositionDOM(e){let n=(o,a)=>{a.flags|=8|(a.children.some(l=>l.flags&7)?1:0),this.markedForComposition.add(a);let s=Ln.get(o);s&&s!=a&&(s.dom=null),a.setDOM(o)},r=this.childPos(e.range.fromB,1),i=this.children[r.i];n(e.line,i);for(let o=e.marks.length-1;o>=-1;o--)r=i.childPos(r.off,1),i=i.children[r.i],n(o>=0?e.marks[o].node:e.text,i)}updateSelection(e=!1,n=!1){(e||!this.view.observer.selectionRange.focusNode)&&this.view.observer.readSelectionRange();let r=this.view.root.activeElement,i=r==this.dom,o=!i&&jC(this.dom,this.view.observer.selectionRange)&&!(r&&this.dom.contains(r));if(!(i||n||o))return;let a=this.forceSelection;this.forceSelection=!1;let s=this.view.state.selection.main,l=this.moveToLine(this.domAtPos(s.anchor)),c=s.empty?l:this.moveToLine(this.domAtPos(s.head));if(ut.gecko&&s.empty&&!this.hasComposition&&dit(l)){let f=document.createTextNode("");this.view.observer.ignore(()=>l.node.insertBefore(f,l.node.childNodes[l.offset]||null)),l=c=new Yi(f,0),a=!0}let u=this.view.observer.selectionRange;(a||!u.focusNode||(!nb(l.node,l.offset,u.anchorNode,u.anchorOffset)||!nb(c.node,c.offset,u.focusNode,u.focusOffset))&&!this.suppressWidgetCursorChange(u,s))&&(this.view.observer.ignore(()=>{ut.android&&ut.chrome&&this.dom.contains(u.focusNode)&&vit(u.focusNode,this.dom)&&(this.dom.blur(),this.dom.focus({preventScroll:!0}));let f=i_(this.view.root);if(f)if(s.empty){if(ut.gecko){let d=pit(l.node,l.offset);if(d&&d!=3){let h=(d==1?Wfe:Vfe)(l.node,l.offset);h&&(l=new Yi(h.node,h.offset))}}f.collapse(l.node,l.offset),s.bidiLevel!=null&&f.caretBidiLevel!==void 0&&(f.caretBidiLevel=s.bidiLevel)}else if(f.extend){f.collapse(l.node,l.offset);try{f.extend(c.node,c.offset)}catch{}}else{let d=document.createRange();s.anchor>s.head&&([l,c]=[c,l]),d.setEnd(c.node,c.offset),d.setStart(l.node,l.offset),f.removeAllRanges(),f.addRange(d)}o&&this.view.root.activeElement==this.dom&&(this.dom.blur(),r&&r.focus())}),this.view.observer.setSelectionRange(l,c)),this.impreciseAnchor=l.precise?null:new Yi(u.anchorNode,u.anchorOffset),this.impreciseHead=c.precise?null:new Yi(u.focusNode,u.focusOffset)}suppressWidgetCursorChange(e,n){return this.hasComposition&&n.empty&&nb(e.focusNode,e.focusOffset,e.anchorNode,e.anchorOffset)&&this.posFromDOM(e.focusNode,e.focusOffset)==n.head}enforceCursorAssoc(){if(this.hasComposition)return;let{view:e}=this,n=e.state.selection.main,r=i_(e.root),{anchorNode:i,anchorOffset:o}=e.observer.selectionRange;if(!r||!n.empty||!n.assoc||!r.modify)return;let a=Nr.find(this,n.head);if(!a)return;let s=a.posAtStart;if(n.head==s||n.head==s+a.length)return;let l=this.coordsAt(n.head,-1),c=this.coordsAt(n.head,1);if(!l||!c||l.bottom>c.top)return;let u=this.domAtPos(n.head+n.assoc);r.collapse(u.node,u.offset),r.modify("move",n.assoc<0?"forward":"backward","lineboundary"),e.observer.readSelectionRange();let f=e.observer.selectionRange;e.docView.posFromDOM(f.anchorNode,f.anchorOffset)!=n.from&&r.collapse(i,o)}moveToLine(e){let n=this.dom,r;if(e.node!=n)return e;for(let i=e.offset;!r&&i<n.childNodes.length;i++){let o=Ln.get(n.childNodes[i]);o instanceof Nr&&(r=o.domAtPos(0))}for(let i=e.offset-1;!r&&i>=0;i--){let o=Ln.get(n.childNodes[i]);o instanceof Nr&&(r=o.domAtPos(o.length))}return r?new Yi(r.node,r.offset,!0):e}nearest(e){for(let n=e;n;){let r=Ln.get(n);if(r&&r.rootView==this)return r;n=n.parentNode}return null}posFromDOM(e,n){let r=this.nearest(e);if(!r)throw new RangeError("Trying to find position for a DOM position outside of the document");return r.localPosFromDOM(e,n)+r.posAtStart}domAtPos(e){let{i:n,off:r}=this.childCursor().findPos(e,-1);for(;n<this.children.length-1;){let i=this.children[n];if(r<i.length||i instanceof Nr)break;n++,r=0}return this.children[n].domAtPos(r)}coordsAt(e,n){let r=null,i=0;for(let o=this.length,a=this.children.length-1;a>=0;a--){let s=this.children[a],l=o-s.breakAfter,c=l-s.length;if(l<e)break;if(c<=e&&(c<e||s.covers(-1))&&(l>e||s.covers(1))&&(!r||s instanceof Nr&&!(r instanceof Nr&&n>=0)))r=s,i=c;else if(r&&c==e&&l==e&&s instanceof eu&&Math.abs(n)<2){if(s.deco.startSide<0)break;a&&(r=null)}o=c}return r?r.coordsAt(e-i,n):null}coordsForChar(e){let{i:n,off:r}=this.childPos(e,1),i=this.children[n];if(!(i instanceof Nr))return null;for(;i.children.length;){let{i:s,off:l}=i.childPos(r,1);for(;;s++){if(s==i.children.length)return null;if((i=i.children[s]).length)break}r=l}if(!(i instanceof el))return null;let o=ki(i.text,r);if(o==r)return null;let a=cp(i.dom,r,o).getClientRects();for(let s=0;s<a.length;s++){let l=a[s];if(s==a.length-1||l.top<l.bottom&&l.left<l.right)return l}return null}measureVisibleLineHeights(e){let n=[],{from:r,to:i}=e,o=this.view.contentDOM.clientWidth,a=o>Math.max(this.view.scrollDOM.clientWidth,this.minWidth)+1,s=-1,l=this.view.textDirection==rr.LTR;for(let c=0,u=0;u<this.children.length;u++){let f=this.children[u],d=c+f.length;if(d>i)break;if(c>=r){let h=f.dom.getBoundingClientRect();if(n.push(h.height),a){let p=f.dom.lastChild,m=p?cv(p):[];if(m.length){let g=m[m.length-1],v=l?g.right-h.left:h.right-g.left;v>s&&(s=v,this.minWidth=o,this.minWidthFrom=c,this.minWidthTo=d)}}}c=d+f.breakAfter}return n}textDirectionAt(e){let{i:n}=this.childPos(e,1);return getComputedStyle(this.children[n].dom).direction=="rtl"?rr.RTL:rr.LTR}measureTextSize(){for(let o of this.children)if(o instanceof Nr){let a=o.measureTextSize();if(a)return a}let e=document.createElement("div"),n,r,i;return e.className="cm-line",e.style.width="99999px",e.style.position="absolute",e.textContent="abc def ghi jkl mno pqr stu",this.view.observer.ignore(()=>{this.dom.appendChild(e);let o=cv(e.firstChild)[0];n=e.getBoundingClientRect().height,r=o?o.width/27:7,i=o?o.height:n,e.remove()}),{lineHeight:n,charWidth:r,textHeight:i}}childCursor(e=this.length){let n=this.children.length;return n&&(e-=this.children[--n].length),new Gfe(this.children,e,n)}computeBlockGapDeco(){let e=[],n=this.view.viewState;for(let r=0,i=0;;i++){let o=i==n.viewports.length?null:n.viewports[i],a=o?o.from-1:this.length;if(a>r){let s=(n.lineBlockAt(a).bottom-n.lineBlockAt(r).top)/this.view.scaleY;e.push(gt.replace({widget:new SN(s),block:!0,inclusive:!0,isBlockGap:!0}).range(r,a))}if(!o)break;r=o.to+1}return gt.set(e)}updateDeco(){let e=1,n=this.view.state.facet(o_).map(o=>(this.dynamicDecorationMap[e++]=typeof o=="function")?o(this.view):o),r=!1,i=this.view.state.facet(gde).map((o,a)=>{let s=typeof o=="function";return s&&(r=!0),s?o(this.view):o});for(i.length&&(this.dynamicDecorationMap[e++]=r,n.push(sn.join(i))),this.decorations=[this.editContextFormatting,...n,this.computeBlockGapDeco(),this.view.viewState.lineGapDeco];e<this.decorations.length;)this.dynamicDecorationMap[e++]=!1;return this.decorations}scrollIntoView(e){if(e.isSnapshot){let c=this.view.viewState.lineBlockAt(e.range.head);this.view.scrollDOM.scrollTop=c.top-e.yMargin,this.view.scrollDOM.scrollLeft=e.xMargin;return}for(let c of this.view.state.facet(hde))try{if(c(this.view,e.range,e))return!0}catch(u){Ao(this.view.state,u,"scroll handler")}let{range:n}=e,r=this.coordsAt(n.head,n.empty?n.assoc:n.head>n.anchor?-1:1),i;if(!r)return;!n.empty&&(i=this.coordsAt(n.anchor,n.anchor>n.head?-1:1))&&(r={left:Math.min(r.left,i.left),top:Math.min(r.top,i.top),right:Math.max(r.right,i.right),bottom:Math.max(r.bottom,i.bottom)});let o=xde(this.view),a={left:r.left-o.left,top:r.top-o.top,right:r.right+o.right,bottom:r.bottom+o.bottom},{offsetWidth:s,offsetHeight:l}=this.view.scrollDOM;Hrt(this.view.scrollDOM,a,n.head<n.anchor?-1:1,e.x,e.y,Math.max(Math.min(e.xMargin,s),-s),Math.max(Math.min(e.yMargin,l),-l),this.view.textDirection==rr.LTR)}}function dit(t){return t.node.nodeType==1&&t.node.firstChild&&(t.offset==0||t.node.childNodes[t.offset-1].contentEditable=="false")&&(t.offset==t.node.childNodes.length||t.node.childNodes[t.offset].contentEditable=="false")}function bde(t,e){let n=t.observer.selectionRange;if(!n.focusNode)return null;let r=Wfe(n.focusNode,n.focusOffset),i=Vfe(n.focusNode,n.focusOffset),o=r||i;if(i&&r&&i.node!=r.node){let s=Ln.get(i.node);if(!s||s instanceof el&&s.text!=i.node.nodeValue)o=i;else if(t.docView.lastCompositionAfterCursor){let l=Ln.get(r.node);!l||l instanceof el&&l.text!=r.node.nodeValue||(o=i)}}if(t.docView.lastCompositionAfterCursor=o!=r,!o)return null;let a=e-o.offset;return{from:a,to:a+o.node.nodeValue.length,node:o.node}}function hit(t,e,n){let r=bde(t,n);if(!r)return null;let{node:i,from:o,to:a}=r,s=i.nodeValue;if(/[\n\r]/.test(s)||t.state.doc.sliceString(r.from,r.to)!=s)return null;let l=e.invertedDesc,c=new rs(l.mapPos(o),l.mapPos(a),o,a),u=[];for(let f=i.parentNode;;f=f.parentNode){let d=Ln.get(f);if(d instanceof mu)u.push({node:f,deco:d.mark});else{if(d instanceof Nr||f.nodeName=="DIV"&&f.parentNode==t.contentDOM)return{range:c,text:i,marks:u,line:f};if(f!=t.contentDOM)u.push({node:f,deco:new mw({inclusive:!0,attributes:eit(f),tagName:f.tagName.toLowerCase()})});else return null}}}function pit(t,e){return t.nodeType!=1?0:(e&&t.childNodes[e-1].contentEditable=="false"?1:0)|(e<t.childNodes.length&&t.childNodes[e].contentEditable=="false"?2:0)}let mit=class{constructor(){this.changes=[]}compareRange(e,n){wN(e,n,this.changes)}comparePoint(e,n){wN(e,n,this.changes)}};function git(t,e,n){let r=new mit;return sn.compare(t,e,n,r),r.changes}function vit(t,e){for(let n=t;n&&n!=e;n=n.assignedSlot||n.parentNode)if(n.nodeType==1&&n.contentEditable=="false")return!0;return!1}function yit(t,e){let n=!1;return e&&t.iterChangedRanges((r,i)=>{r<e.to&&i>e.from&&(n=!0)}),n}function xit(t,e,n=1){let r=t.charCategorizer(e),i=t.doc.lineAt(e),o=e-i.from;if(i.length==0)return je.cursor(e);o==0?n=1:o==i.length&&(n=-1);let a=o,s=o;n<0?a=ki(i.text,o,!1):s=ki(i.text,o);let l=r(i.text.slice(a,s));for(;a>0;){let c=ki(i.text,a,!1);if(r(i.text.slice(c,a))!=l)break;a=c}for(;s<i.length;){let c=ki(i.text,s);if(r(i.text.slice(s,c))!=l)break;s=c}return je.range(a+i.from,s+i.from)}function bit(t,e){return e.left>t?e.left-t:Math.max(0,t-e.right)}function _it(t,e){return e.top>t?e.top-t:Math.max(0,t-e.bottom)}function FR(t,e){return t.top<e.bottom-1&&t.bottom>e.top+1}function w7(t,e){return e<t.top?{top:e,left:t.left,right:t.right,bottom:t.bottom}:t}function S7(t,e){return e>t.bottom?{top:t.top,left:t.left,right:t.right,bottom:e}:t}function PN(t,e,n){let r,i,o,a,s=!1,l,c,u,f;for(let p=t.firstChild;p;p=p.nextSibling){let m=cv(p);for(let g=0;g<m.length;g++){let v=m[g];i&&FR(i,v)&&(v=w7(S7(v,i.bottom),i.top));let y=bit(e,v),x=_it(n,v);if(y==0&&x==0)return p.nodeType==3?O7(p,e,n):PN(p,e,n);if(!r||a>x||a==x&&o>y){r=p,i=v,o=y,a=x;let b=x?n<v.top?-1:1:y?e<v.left?-1:1:0;s=!b||(b>0?g<m.length-1:g>0)}y==0?n>v.bottom&&(!u||u.bottom<v.bottom)?(l=p,u=v):n<v.top&&(!f||f.top>v.top)&&(c=p,f=v):u&&FR(u,v)?u=S7(u,v.bottom):f&&FR(f,v)&&(f=w7(f,v.top))}}if(u&&u.bottom>=n?(r=l,i=u):f&&f.top<=n&&(r=c,i=f),!r)return{node:t,offset:0};let d=Math.max(i.left,Math.min(i.right,e));if(r.nodeType==3)return O7(r,d,n);if(s&&r.contentEditable!="false")return PN(r,d,n);let h=Array.prototype.indexOf.call(t.childNodes,r)+(e>=(i.left+i.right)/2?1:0);return{node:t,offset:h}}function O7(t,e,n){let r=t.nodeValue.length,i=-1,o=1e9,a=0;for(let s=0;s<r;s++){let l=cp(t,s,s+1).getClientRects();for(let c=0;c<l.length;c++){let u=l[c];if(u.top==u.bottom)continue;a||(a=e-u.left);let f=(u.top>n?u.top-n:n-u.bottom)-1;if(u.left-1<=e&&u.right+1>=e&&f<o){let d=e>=(u.left+u.right)/2,h=d;if((ut.chrome||ut.gecko)&&cp(t,s).getBoundingClientRect().left==u.right&&(h=!d),f<=0)return{node:t,offset:s+(h?1:0)};i=s+(h?1:0),o=f}}}return{node:t,offset:i>-1?i:a>0?t.nodeValue.length:0}}function _de(t,e,n,r=-1){var i,o;let a=t.contentDOM.getBoundingClientRect(),s=a.top+t.viewState.paddingTop,l,{docHeight:c}=t.viewState,{x:u,y:f}=e,d=f-s;if(d<0)return 0;if(d>c)return t.state.doc.length;for(let b=t.viewState.heightOracle.textHeight/2,_=!1;l=t.elementAtHeight(d),l.type!=uo.Text;)for(;d=r>0?l.bottom+b:l.top-b,!(d>=0&&d<=c);){if(_)return n?null:0;_=!0,r=-r}f=s+d;let h=l.from;if(h<t.viewport.from)return t.viewport.from==0?0:n?null:C7(t,a,l,u,f);if(h>t.viewport.to)return t.viewport.to==t.state.doc.length?t.state.doc.length:n?null:C7(t,a,l,u,f);let p=t.dom.ownerDocument,m=t.root.elementFromPoint?t.root:p,g=m.elementFromPoint(u,f);g&&!t.contentDOM.contains(g)&&(g=null),g||(u=Math.max(a.left+1,Math.min(a.right-1,u)),g=m.elementFromPoint(u,f),g&&!t.contentDOM.contains(g)&&(g=null));let v,y=-1;if(g&&((i=t.docView.nearest(g))===null||i===void 0?void 0:i.isEditable)!=!1){if(p.caretPositionFromPoint){let b=p.caretPositionFromPoint(u,f);b&&({offsetNode:v,offset:y}=b)}else if(p.caretRangeFromPoint){let b=p.caretRangeFromPoint(u,f);b&&({startContainer:v,startOffset:y}=b,(!t.contentDOM.contains(v)||ut.safari&&wit(v,y,u)||ut.chrome&&Sit(v,y,u))&&(v=void 0))}}if(!v||!t.docView.dom.contains(v)){let b=Nr.find(t.docView,h);if(!b)return d>l.top+l.height/2?l.to:l.from;({node:v,offset:y}=PN(b.dom,u,f))}let x=t.docView.nearest(v);if(!x)return null;if(x.isWidget&&((o=x.dom)===null||o===void 0?void 0:o.nodeType)==1){let b=x.dom.getBoundingClientRect();return e.y<b.top||e.y<=b.bottom&&e.x<=(b.left+b.right)/2?x.posAtStart:x.posAtEnd}else return x.localPosFromDOM(v,y)+x.posAtStart}function C7(t,e,n,r,i){let o=Math.round((r-e.left)*t.defaultCharacterWidth);if(t.lineWrapping&&n.height>t.defaultLineHeight*1.5){let s=t.viewState.heightOracle.textHeight,l=Math.floor((i-n.top-(t.defaultLineHeight-s)*.5)/s);o+=l*t.viewState.heightOracle.lineLength}let a=t.state.sliceDoc(n.from,n.to);return n.from+hN(a,o,t.state.tabSize)}function wit(t,e,n){let r;if(t.nodeType!=3||e!=(r=t.nodeValue.length))return!1;for(let i=t.nextSibling;i;i=i.nextSibling)if(i.nodeType!=1||i.nodeName!="BR")return!1;return cp(t,r-1,r).getBoundingClientRect().left>n}function Sit(t,e,n){if(e!=0)return!1;for(let i=t;;){let o=i.parentNode;if(!o||o.nodeType!=1||o.firstChild!=i)return!1;if(o.classList.contains("cm-line"))break;i=o}let r=t.nodeType==1?t.getBoundingClientRect():cp(t,0,Math.max(t.nodeValue.length,1)).getBoundingClientRect();return n-r.left>5}function MN(t,e){let n=t.lineBlockAt(e);if(Array.isArray(n.type)){for(let r of n.type)if(r.to>e||r.to==e&&(r.to==n.to||r.type==uo.Text))return r}return n}function Oit(t,e,n,r){let i=MN(t,e.head),o=!r||i.type!=uo.Text||!(t.lineWrapping||i.widgetLineBreaks)?null:t.coordsAtPos(e.assoc<0&&e.head>i.from?e.head-1:e.head);if(o){let a=t.dom.getBoundingClientRect(),s=t.textDirectionAt(i.from),l=t.posAtCoords({x:n==(s==rr.LTR)?a.right-1:a.left+1,y:(o.top+o.bottom)/2});if(l!=null)return je.cursor(l,n?-1:1)}return je.cursor(n?i.to:i.from,n?-1:1)}function T7(t,e,n,r){let i=t.state.doc.lineAt(e.head),o=t.bidiSpans(i),a=t.textDirectionAt(i.from);for(let s=e,l=null;;){let c=cit(i,o,a,s,n),u=ide;if(!c){if(i.number==(n?t.state.doc.lines:1))return s;u=`
`,i=t.state.doc.line(i.number+(n?1:-1)),o=t.bidiSpans(i),c=t.visualLineSide(i,!n)}if(l){if(!l(u))return s}else{if(!r)return c;l=r(u)}s=c}}function Cit(t,e,n){let r=t.state.charCategorizer(e),i=r(n);return o=>{let a=r(o);return i==fr.Space&&(i=a),i==a}}function Tit(t,e,n,r){let i=e.head,o=n?1:-1;if(i==(n?t.state.doc.length:0))return je.cursor(i,e.assoc);let a=e.goalColumn,s,l=t.contentDOM.getBoundingClientRect(),c=t.coordsAtPos(i,e.assoc||-1),u=t.documentTop;if(c)a==null&&(a=c.left-l.left),s=o<0?c.top:c.bottom;else{let h=t.viewState.lineBlockAt(i);a==null&&(a=Math.min(l.right-l.left,t.defaultCharacterWidth*(i-h.from))),s=(o<0?h.top:h.bottom)+u}let f=l.left+a,d=r??t.viewState.heightOracle.textHeight>>1;for(let h=0;;h+=10){let p=s+(d+h)*o,m=_de(t,{x:f,y:p},!1,o);if(p<l.top||p>l.bottom||(o<0?m<i:m>i)){let g=t.docView.coordsForChar(m),v=!g||p<g.top?-1:1;return je.cursor(m,v,void 0,a)}}}function BC(t,e,n){for(;;){let r=0;for(let i of t)i.between(e-1,e+1,(o,a,s)=>{if(e>o&&e<a){let l=r||n||(e-o<a-e?-1:1);e=l<0?o:a,r=l}});if(!r)return e}}function jR(t,e,n){let r=BC(t.state.facet(T4).map(i=>i(t)),n.from,e.head>n.from?-1:1);return r==n.from?n:je.cursor(r,r<n.from?1:-1)}const gx="";class Eit{constructor(e,n){this.points=e,this.text="",this.lineSeparator=n.facet(en.lineSeparator)}append(e){this.text+=e}lineBreak(){this.text+=gx}readRange(e,n){if(!e)return this;let r=e.parentNode;for(let i=e;;){this.findPointBefore(r,i);let o=this.text.length;this.readNode(i);let a=i.nextSibling;if(a==n)break;let s=Ln.get(i),l=Ln.get(a);(s&&l?s.breakAfter:(s?s.breakAfter:hE(i))||hE(a)&&(i.nodeName!="BR"||i.cmIgnore)&&this.text.length>o)&&this.lineBreak(),i=a}return this.findPointBefore(r,n),this}readTextNode(e){let n=e.nodeValue;for(let r of this.points)r.node==e&&(r.pos=this.text.length+Math.min(r.offset,n.length));for(let r=0,i=this.lineSeparator?null:/\r\n?|\n/g;;){let o=-1,a=1,s;if(this.lineSeparator?(o=n.indexOf(this.lineSeparator,r),a=this.lineSeparator.length):(s=i.exec(n))&&(o=s.index,a=s[0].length),this.append(n.slice(r,o<0?n.length:o)),o<0)break;if(this.lineBreak(),a>1)for(let l of this.points)l.node==e&&l.pos>this.text.length&&(l.pos-=a-1);r=o+a}}readNode(e){if(e.cmIgnore)return;let n=Ln.get(e),r=n&&n.overrideDOMText;if(r!=null){this.findPointInside(e,r.length);for(let i=r.iter();!i.next().done;)i.lineBreak?this.lineBreak():this.append(i.value)}else e.nodeType==3?this.readTextNode(e):e.nodeName=="BR"?e.nextSibling&&this.lineBreak():e.nodeType==1&&this.readRange(e.firstChild,null)}findPointBefore(e,n){for(let r of this.points)r.node==e&&e.childNodes[r.offset]==n&&(r.pos=this.text.length)}findPointInside(e,n){for(let r of this.points)(e.nodeType==3?r.node==e:e.contains(r.node))&&(r.pos=this.text.length+(Pit(e,r.node,r.offset)?n:0))}}function Pit(t,e,n){for(;;){if(!e||n<pu(e))return!1;if(e==t)return!0;n=lp(e)+1,e=e.parentNode}}class E7{constructor(e,n){this.node=e,this.offset=n,this.pos=-1}}class Mit{constructor(e,n,r,i){this.typeOver=i,this.bounds=null,this.text="",this.domChanged=n>-1;let{impreciseHead:o,impreciseAnchor:a}=e.docView;if(e.state.readOnly&&n>-1)this.newSel=null;else if(n>-1&&(this.bounds=e.docView.domBoundsAround(n,r,0))){let s=o||a?[]:Rit(e),l=new Eit(s,e.state);l.readRange(this.bounds.startDOM,this.bounds.endDOM),this.text=l.text,this.newSel=Iit(s,this.bounds.from)}else{let s=e.observer.selectionRange,l=o&&o.node==s.focusNode&&o.offset==s.focusOffset||!gN(e.contentDOM,s.focusNode)?e.state.selection.main.head:e.docView.posFromDOM(s.focusNode,s.focusOffset),c=a&&a.node==s.anchorNode&&a.offset==s.anchorOffset||!gN(e.contentDOM,s.anchorNode)?e.state.selection.main.anchor:e.docView.posFromDOM(s.anchorNode,s.anchorOffset),u=e.viewport;if((ut.ios||ut.chrome)&&e.state.selection.main.empty&&l!=c&&(u.from>0||u.to<e.state.doc.length)){let f=Math.min(l,c),d=Math.max(l,c),h=u.from-f,p=u.to-d;(h==0||h==1||f==0)&&(p==0||p==-1||d==e.state.doc.length)&&(l=0,c=e.state.doc.length)}this.newSel=je.single(c,l)}}}function wde(t,e){let n,{newSel:r}=e,i=t.state.selection.main,o=t.inputState.lastKeyTime>Date.now()-100?t.inputState.lastKeyCode:-1;if(e.bounds){let{from:a,to:s}=e.bounds,l=i.from,c=null;(o===8||ut.android&&e.text.length<s-a)&&(l=i.to,c="end");let u=Ait(t.state.doc.sliceString(a,s,gx),e.text,l-a,c);u&&(ut.chrome&&o==13&&u.toB==u.from+2&&e.text.slice(u.from,u.toB)==gx+gx&&u.toB--,n={from:a+u.from,to:a+u.toA,insert:xn.of(e.text.slice(u.from,u.toB).split(gx))})}else r&&(!t.hasFocus&&t.state.facet(pf)||r.main.eq(i))&&(r=null);if(!n&&!r)return!1;if(!n&&e.typeOver&&!i.empty&&r&&r.main.empty?n={from:i.from,to:i.to,insert:t.state.doc.slice(i.from,i.to)}:n&&n.from>=i.from&&n.to<=i.to&&(n.from!=i.from||n.to!=i.to)&&i.to-i.from-(n.to-n.from)<=4?n={from:i.from,to:i.to,insert:t.state.doc.slice(i.from,n.from).append(n.insert).append(t.state.doc.slice(n.to,i.to))}:(ut.mac||ut.android)&&n&&n.from==n.to&&n.from==i.head-1&&/^\. ?$/.test(n.insert.toString())&&t.contentDOM.getAttribute("autocorrect")=="off"?(r&&n.insert.length==2&&(r=je.single(r.main.anchor-1,r.main.head-1)),n={from:i.from,to:i.to,insert:xn.of([" "])}):ut.chrome&&n&&n.from==n.to&&n.from==i.head&&n.insert.toString()==`
 `&&t.lineWrapping&&(r&&(r=je.single(r.main.anchor-1,r.main.head-1)),n={from:i.from,to:i.to,insert:xn.of([" "])}),n)return E4(t,n,r,o);if(r&&!r.main.eq(i)){let a=!1,s="select";return t.inputState.lastSelectionTime>Date.now()-50&&(t.inputState.lastSelectionOrigin=="select"&&(a=!0),s=t.inputState.lastSelectionOrigin),t.dispatch({selection:r,scrollIntoView:a,userEvent:s}),!0}else return!1}function E4(t,e,n,r=-1){if(ut.ios&&t.inputState.flushIOSKey(e))return!0;let i=t.state.selection.main;if(ut.android&&(e.to==i.to&&(e.from==i.from||e.from==i.from-1&&t.state.sliceDoc(e.from,i.from)==" ")&&e.insert.length==1&&e.insert.lines==2&&Ag(t.contentDOM,"Enter",13)||(e.from==i.from-1&&e.to==i.to&&e.insert.length==0||r==8&&e.insert.length<e.to-e.from&&e.to>i.head)&&Ag(t.contentDOM,"Backspace",8)||e.from==i.from&&e.to==i.to+1&&e.insert.length==0&&Ag(t.contentDOM,"Delete",46)))return!0;let o=e.insert.toString();t.inputState.composing>=0&&t.inputState.composing++;let a,s=()=>a||(a=kit(t,e,n));return t.state.facet(cde).some(l=>l(t,e.from,e.to,o,s))||t.dispatch(s()),!0}function kit(t,e,n){let r,i=t.state,o=i.selection.main;if(e.from>=o.from&&e.to<=o.to&&e.to-e.from>=(o.to-o.from)/3&&(!n||n.main.empty&&n.main.from==e.from+e.insert.length)&&t.inputState.composing<0){let s=o.from<e.from?i.sliceDoc(o.from,e.from):"",l=o.to>e.to?i.sliceDoc(e.to,o.to):"";r=i.replaceSelection(t.state.toText(s+e.insert.sliceString(0,void 0,t.state.lineBreak)+l))}else{let s=i.changes(e),l=n&&n.main.to<=s.newLength?n.main:void 0;if(i.selection.ranges.length>1&&t.inputState.composing>=0&&e.to<=o.to&&e.to>=o.to-10){let c=t.state.sliceDoc(e.from,e.to),u,f=n&&bde(t,n.main.head);if(f){let p=e.insert.length-(e.to-e.from);u={from:f.from,to:f.to-p}}else u=t.state.doc.lineAt(o.head);let d=o.to-e.to,h=o.to-o.from;r=i.changeByRange(p=>{if(p.from==o.from&&p.to==o.to)return{changes:s,range:l||p.map(s)};let m=p.to-d,g=m-c.length;if(p.to-p.from!=h||t.state.sliceDoc(g,m)!=c||p.to>=u.from&&p.from<=u.to)return{range:p};let v=i.changes({from:g,to:m,insert:e.insert}),y=p.to-o.to;return{changes:v,range:l?je.range(Math.max(0,l.anchor+y),Math.max(0,l.head+y)):p.map(v)}})}else r={changes:s,selection:l&&i.selection.replaceRange(l)}}let a="input.type";return(t.composing||t.inputState.compositionPendingChange&&t.inputState.compositionEndedAt>Date.now()-50)&&(t.inputState.compositionPendingChange=!1,a+=".compose",t.inputState.compositionFirstChange&&(a+=".start",t.inputState.compositionFirstChange=!1)),i.update(r,{userEvent:a,scrollIntoView:!0})}function Ait(t,e,n,r){let i=Math.min(t.length,e.length),o=0;for(;o<i&&t.charCodeAt(o)==e.charCodeAt(o);)o++;if(o==i&&t.length==e.length)return null;let a=t.length,s=e.length;for(;a>0&&s>0&&t.charCodeAt(a-1)==e.charCodeAt(s-1);)a--,s--;if(r=="end"){let l=Math.max(0,o-Math.min(a,s));n-=a+l-o}if(a<o&&t.length<e.length){let l=n<=o&&n>=a?o-n:0;o-=l,s=o+(s-a),a=o}else if(s<o){let l=n<=o&&n>=s?o-n:0;o-=l,a=o+(a-s),s=o}return{from:o,toA:a,toB:s}}function Rit(t){let e=[];if(t.root.activeElement!=t.contentDOM)return e;let{anchorNode:n,anchorOffset:r,focusNode:i,focusOffset:o}=t.observer.selectionRange;return n&&(e.push(new E7(n,r)),(i!=n||o!=r)&&e.push(new E7(i,o))),e}function Iit(t,e){if(t.length==0)return null;let n=t[0].pos,r=t.length==2?t[1].pos:n;return n>-1&&r>-1?je.single(n+e,r+e):null}class Dit{setSelectionOrigin(e){this.lastSelectionOrigin=e,this.lastSelectionTime=Date.now()}constructor(e){this.view=e,this.lastKeyCode=0,this.lastKeyTime=0,this.lastTouchTime=0,this.lastFocusTime=0,this.lastScrollTop=0,this.lastScrollLeft=0,this.pendingIOSKey=void 0,this.tabFocusMode=-1,this.lastSelectionOrigin=null,this.lastSelectionTime=0,this.lastContextMenu=0,this.scrollHandlers=[],this.handlers=Object.create(null),this.composing=-1,this.compositionFirstChange=null,this.compositionEndedAt=0,this.compositionPendingKey=!1,this.compositionPendingChange=!1,this.mouseSelection=null,this.draggedContent=null,this.handleEvent=this.handleEvent.bind(this),this.notifiedFocused=e.hasFocus,ut.safari&&e.contentDOM.addEventListener("input",()=>null),ut.gecko&&Yit(e.contentDOM.ownerDocument)}handleEvent(e){!Uit(this.view,e)||this.ignoreDuringComposition(e)||e.type=="keydown"&&this.keydown(e)||this.runHandlers(e.type,e)}runHandlers(e,n){let r=this.handlers[e];if(r){for(let i of r.observers)i(this.view,n);for(let i of r.handlers){if(n.defaultPrevented)break;if(i(this.view,n)){n.preventDefault();break}}}}ensureHandlers(e){let n=Lit(e),r=this.handlers,i=this.view.contentDOM;for(let o in n)if(o!="scroll"){let a=!n[o].handlers.length,s=r[o];s&&a!=!s.handlers.length&&(i.removeEventListener(o,this.handleEvent),s=null),s||i.addEventListener(o,this.handleEvent,{passive:a})}for(let o in r)o!="scroll"&&!n[o]&&i.removeEventListener(o,this.handleEvent);this.handlers=n}keydown(e){if(this.lastKeyCode=e.keyCode,this.lastKeyTime=Date.now(),e.keyCode==9&&this.tabFocusMode>-1&&(!this.tabFocusMode||Date.now()<=this.tabFocusMode))return!0;if(this.tabFocusMode>0&&e.keyCode!=27&&Ode.indexOf(e.keyCode)<0&&(this.tabFocusMode=-1),ut.android&&ut.chrome&&!e.synthetic&&(e.keyCode==13||e.keyCode==8))return this.view.observer.delayAndroidKey(e.key,e.keyCode),!0;let n;return ut.ios&&!e.synthetic&&!e.altKey&&!e.metaKey&&((n=Sde.find(r=>r.keyCode==e.keyCode))&&!e.ctrlKey||Nit.indexOf(e.key)>-1&&e.ctrlKey&&!e.shiftKey)?(this.pendingIOSKey=n||e,setTimeout(()=>this.flushIOSKey(),250),!0):(e.keyCode!=229&&this.view.observer.forceFlush(),!1)}flushIOSKey(e){let n=this.pendingIOSKey;return!n||n.key=="Enter"&&e&&e.from<e.to&&/^\S+$/.test(e.insert.toString())?!1:(this.pendingIOSKey=void 0,Ag(this.view.contentDOM,n.key,n.keyCode,n instanceof KeyboardEvent?n:void 0))}ignoreDuringComposition(e){return/^key/.test(e.type)?this.composing>0?!0:ut.safari&&!ut.ios&&this.compositionPendingKey&&Date.now()-this.compositionEndedAt<100?(this.compositionPendingKey=!1,!0):!1:!1}startMouseSelection(e){this.mouseSelection&&this.mouseSelection.destroy(),this.mouseSelection=e}update(e){this.view.observer.update(e),this.mouseSelection&&this.mouseSelection.update(e),this.draggedContent&&e.docChanged&&(this.draggedContent=this.draggedContent.map(e.changes)),e.transactions.length&&(this.lastKeyCode=this.lastSelectionTime=0)}destroy(){this.mouseSelection&&this.mouseSelection.destroy()}}function P7(t,e){return(n,r)=>{try{return e.call(t,r,n)}catch(i){Ao(n.state,i)}}}function Lit(t){let e=Object.create(null);function n(r){return e[r]||(e[r]={observers:[],handlers:[]})}for(let r of t){let i=r.spec;if(i&&i.domEventHandlers)for(let o in i.domEventHandlers){let a=i.domEventHandlers[o];a&&n(o).handlers.push(P7(r.value,a))}if(i&&i.domEventObservers)for(let o in i.domEventObservers){let a=i.domEventObservers[o];a&&n(o).observers.push(P7(r.value,a))}}for(let r in tl)n(r).handlers.push(tl[r]);for(let r in ms)n(r).observers.push(ms[r]);return e}const Sde=[{key:"Backspace",keyCode:8,inputType:"deleteContentBackward"},{key:"Enter",keyCode:13,inputType:"insertParagraph"},{key:"Enter",keyCode:13,inputType:"insertLineBreak"},{key:"Delete",keyCode:46,inputType:"deleteContentForward"}],Nit="dthko",Ode=[16,17,18,20,91,92,224,225],QS=6;function YS(t){return Math.max(0,t)*.7+8}function $it(t,e){return Math.max(Math.abs(t.clientX-e.clientX),Math.abs(t.clientY-e.clientY))}class Fit{constructor(e,n,r,i){this.view=e,this.startEvent=n,this.style=r,this.mustSelect=i,this.scrollSpeed={x:0,y:0},this.scrolling=-1,this.lastEvent=n,this.scrollParents=qrt(e.contentDOM),this.atoms=e.state.facet(T4).map(a=>a(e));let o=e.contentDOM.ownerDocument;o.addEventListener("mousemove",this.move=this.move.bind(this)),o.addEventListener("mouseup",this.up=this.up.bind(this)),this.extend=n.shiftKey,this.multiple=e.state.facet(en.allowMultipleSelections)&&jit(e,n),this.dragging=zit(e,n)&&Ede(n)==1?null:!1}start(e){this.dragging===!1&&this.select(e)}move(e){if(e.buttons==0)return this.destroy();if(this.dragging||this.dragging==null&&$it(this.startEvent,e)<10)return;this.select(this.lastEvent=e);let n=0,r=0,i=0,o=0,a=this.view.win.innerWidth,s=this.view.win.innerHeight;this.scrollParents.x&&({left:i,right:a}=this.scrollParents.x.getBoundingClientRect()),this.scrollParents.y&&({top:o,bottom:s}=this.scrollParents.y.getBoundingClientRect());let l=xde(this.view);e.clientX-l.left<=i+QS?n=-YS(i-e.clientX):e.clientX+l.right>=a-QS&&(n=YS(e.clientX-a)),e.clientY-l.top<=o+QS?r=-YS(o-e.clientY):e.clientY+l.bottom>=s-QS&&(r=YS(e.clientY-s)),this.setScrollSpeed(n,r)}up(e){this.dragging==null&&this.select(this.lastEvent),this.dragging||e.preventDefault(),this.destroy()}destroy(){this.setScrollSpeed(0,0);let e=this.view.contentDOM.ownerDocument;e.removeEventListener("mousemove",this.move),e.removeEventListener("mouseup",this.up),this.view.inputState.mouseSelection=this.view.inputState.draggedContent=null}setScrollSpeed(e,n){this.scrollSpeed={x:e,y:n},e||n?this.scrolling<0&&(this.scrolling=setInterval(()=>this.scroll(),50)):this.scrolling>-1&&(clearInterval(this.scrolling),this.scrolling=-1)}scroll(){let{x:e,y:n}=this.scrollSpeed;e&&this.scrollParents.x&&(this.scrollParents.x.scrollLeft+=e,e=0),n&&this.scrollParents.y&&(this.scrollParents.y.scrollTop+=n,n=0),(e||n)&&this.view.win.scrollBy(e,n),this.dragging===!1&&this.select(this.lastEvent)}skipAtoms(e){let n=null;for(let r=0;r<e.ranges.length;r++){let i=e.ranges[r],o=null;if(i.empty){let a=BC(this.atoms,i.from,0);a!=i.from&&(o=je.cursor(a,-1))}else{let a=BC(this.atoms,i.from,-1),s=BC(this.atoms,i.to,1);(a!=i.from||s!=i.to)&&(o=je.range(i.from==i.anchor?a:s,i.from==i.head?a:s))}o&&(n||(n=e.ranges.slice()),n[r]=o)}return n?je.create(n,e.mainIndex):e}select(e){let{view:n}=this,r=this.skipAtoms(this.style.get(e,this.extend,this.multiple));(this.mustSelect||!r.eq(n.state.selection,this.dragging===!1))&&this.view.dispatch({selection:r,userEvent:"select.pointer"}),this.mustSelect=!1}update(e){e.transactions.some(n=>n.isUserEvent("input.type"))?this.destroy():this.style.update(e)&&setTimeout(()=>this.select(this.lastEvent),20)}}function jit(t,e){let n=t.state.facet(ode);return n.length?n[0](e):ut.mac?e.metaKey:e.ctrlKey}function Bit(t,e){let n=t.state.facet(ade);return n.length?n[0](e):ut.mac?!e.altKey:!e.ctrlKey}function zit(t,e){let{main:n}=t.state.selection;if(n.empty)return!1;let r=i_(t.root);if(!r||r.rangeCount==0)return!0;let i=r.getRangeAt(0).getClientRects();for(let o=0;o<i.length;o++){let a=i[o];if(a.left<=e.clientX&&a.right>=e.clientX&&a.top<=e.clientY&&a.bottom>=e.clientY)return!0}return!1}function Uit(t,e){if(!e.bubbles)return!0;if(e.defaultPrevented)return!1;for(let n=e.target,r;n!=t.contentDOM;n=n.parentNode)if(!n||n.nodeType==11||(r=Ln.get(n))&&r.ignoreEvent(e))return!1;return!0}const tl=Object.create(null),ms=Object.create(null),Cde=ut.ie&&ut.ie_version<15||ut.ios&&ut.webkit_version<604;function Wit(t){let e=t.dom.parentNode;if(!e)return;let n=e.appendChild(document.createElement("textarea"));n.style.cssText="position: fixed; left: -10000px; top: 10px",n.focus(),setTimeout(()=>{t.focus(),n.remove(),Tde(t,n.value)},50)}function Tde(t,e){let{state:n}=t,r,i=1,o=n.toText(e),a=o.lines==n.selection.ranges.length;if(kN!=null&&n.selection.ranges.every(l=>l.empty)&&kN==o.toString()){let l=-1;r=n.changeByRange(c=>{let u=n.doc.lineAt(c.from);if(u.from==l)return{range:c};l=u.from;let f=n.toText((a?o.line(i++).text:e)+n.lineBreak);return{changes:{from:u.from,insert:f},range:je.cursor(c.from+f.length)}})}else a?r=n.changeByRange(l=>{let c=o.line(i++);return{changes:{from:l.from,to:l.to,insert:c.text},range:je.cursor(l.from+c.length)}}):r=n.replaceSelection(o);t.dispatch(r,{userEvent:"input.paste",scrollIntoView:!0})}ms.scroll=t=>{t.inputState.lastScrollTop=t.scrollDOM.scrollTop,t.inputState.lastScrollLeft=t.scrollDOM.scrollLeft};tl.keydown=(t,e)=>(t.inputState.setSelectionOrigin("select"),e.keyCode==27&&t.inputState.tabFocusMode!=0&&(t.inputState.tabFocusMode=Date.now()+2e3),!1);ms.touchstart=(t,e)=>{t.inputState.lastTouchTime=Date.now(),t.inputState.setSelectionOrigin("select.pointer")};ms.touchmove=t=>{t.inputState.setSelectionOrigin("select.pointer")};tl.mousedown=(t,e)=>{if(t.observer.flush(),t.inputState.lastTouchTime>Date.now()-2e3)return!1;let n=null;for(let r of t.state.facet(sde))if(n=r(t,e),n)break;if(!n&&e.button==0&&(n=Hit(t,e)),n){let r=!t.hasFocus;t.inputState.startMouseSelection(new Fit(t,e,n,r)),r&&t.observer.ignore(()=>{Bfe(t.contentDOM);let o=t.root.activeElement;o&&!o.contains(t.contentDOM)&&o.blur()});let i=t.inputState.mouseSelection;if(i)return i.start(e),i.dragging===!1}return!1};function M7(t,e,n,r){if(r==1)return je.cursor(e,n);if(r==2)return xit(t.state,e,n);{let i=Nr.find(t.docView,e),o=t.state.doc.lineAt(i?i.posAtEnd:e),a=i?i.posAtStart:o.from,s=i?i.posAtEnd:o.to;return s<t.state.doc.length&&s==o.to&&s++,je.range(a,s)}}let k7=(t,e,n)=>e>=n.top&&e<=n.bottom&&t>=n.left&&t<=n.right;function Vit(t,e,n,r){let i=Nr.find(t.docView,e);if(!i)return 1;let o=e-i.posAtStart;if(o==0)return 1;if(o==i.length)return-1;let a=i.coordsAt(o,-1);if(a&&k7(n,r,a))return-1;let s=i.coordsAt(o,1);return s&&k7(n,r,s)?1:a&&a.bottom>=r?-1:1}function A7(t,e){let n=t.posAtCoords({x:e.clientX,y:e.clientY},!1);return{pos:n,bias:Vit(t,n,e.clientX,e.clientY)}}const Git=ut.ie&&ut.ie_version<=11;let R7=null,I7=0,D7=0;function Ede(t){if(!Git)return t.detail;let e=R7,n=D7;return R7=t,D7=Date.now(),I7=!e||n>Date.now()-400&&Math.abs(e.clientX-t.clientX)<2&&Math.abs(e.clientY-t.clientY)<2?(I7+1)%3:1}function Hit(t,e){let n=A7(t,e),r=Ede(e),i=t.state.selection;return{update(o){o.docChanged&&(n.pos=o.changes.mapPos(n.pos),i=i.map(o.changes))},get(o,a,s){let l=A7(t,o),c,u=M7(t,l.pos,l.bias,r);if(n.pos!=l.pos&&!a){let f=M7(t,n.pos,n.bias,r),d=Math.min(f.from,u.from),h=Math.max(f.to,u.to);u=d<u.from?je.range(d,h):je.range(h,d)}return a?i.replaceRange(i.main.extend(u.from,u.to)):s&&r==1&&i.ranges.length>1&&(c=qit(i,l.pos))?c:s?i.addRange(u):je.create([u])}}}function qit(t,e){for(let n=0;n<t.ranges.length;n++){let{from:r,to:i}=t.ranges[n];if(r<=e&&i>=e)return je.create(t.ranges.slice(0,n).concat(t.ranges.slice(n+1)),t.mainIndex==n?0:t.mainIndex-(t.mainIndex>n?1:0))}return null}tl.dragstart=(t,e)=>{let{selection:{main:n}}=t.state;if(e.target.draggable){let i=t.docView.nearest(e.target);if(i&&i.isWidget){let o=i.posAtStart,a=o+i.length;(o>=n.to||a<=n.from)&&(n=je.range(o,a))}}let{inputState:r}=t;return r.mouseSelection&&(r.mouseSelection.dragging=!0),r.draggedContent=n,e.dataTransfer&&(e.dataTransfer.setData("Text",t.state.sliceDoc(n.from,n.to)),e.dataTransfer.effectAllowed="copyMove"),!1};tl.dragend=t=>(t.inputState.draggedContent=null,!1);function L7(t,e,n,r){if(!n)return;let i=t.posAtCoords({x:e.clientX,y:e.clientY},!1),{draggedContent:o}=t.inputState,a=r&&o&&Bit(t,e)?{from:o.from,to:o.to}:null,s={from:i,insert:n},l=t.state.changes(a?[a,s]:s);t.focus(),t.dispatch({changes:l,selection:{anchor:l.mapPos(i,-1),head:l.mapPos(i,1)},userEvent:a?"move.drop":"input.drop"}),t.inputState.draggedContent=null}tl.drop=(t,e)=>{if(!e.dataTransfer)return!1;if(t.state.readOnly)return!0;let n=e.dataTransfer.files;if(n&&n.length){let r=Array(n.length),i=0,o=()=>{++i==n.length&&L7(t,e,r.filter(a=>a!=null).join(t.state.lineBreak),!1)};for(let a=0;a<n.length;a++){let s=new FileReader;s.onerror=o,s.onload=()=>{/[\x00-\x08\x0e-\x1f]{2}/.test(s.result)||(r[a]=s.result),o()},s.readAsText(n[a])}return!0}else{let r=e.dataTransfer.getData("Text");if(r)return L7(t,e,r,!0),!0}return!1};tl.paste=(t,e)=>{if(t.state.readOnly)return!0;t.observer.flush();let n=Cde?null:e.clipboardData;return n?(Tde(t,n.getData("text/plain")||n.getData("text/uri-list")),!0):(Wit(t),!1)};function Xit(t,e){let n=t.dom.parentNode;if(!n)return;let r=n.appendChild(document.createElement("textarea"));r.style.cssText="position: fixed; left: -10000px; top: 10px",r.value=e,r.focus(),r.selectionEnd=e.length,r.selectionStart=0,setTimeout(()=>{r.remove(),t.focus()},50)}function Qit(t){let e=[],n=[],r=!1;for(let i of t.selection.ranges)i.empty||(e.push(t.sliceDoc(i.from,i.to)),n.push(i));if(!e.length){let i=-1;for(let{from:o}of t.selection.ranges){let a=t.doc.lineAt(o);a.number>i&&(e.push(a.text),n.push({from:a.from,to:Math.min(t.doc.length,a.to+1)})),i=a.number}r=!0}return{text:e.join(t.lineBreak),ranges:n,linewise:r}}let kN=null;tl.copy=tl.cut=(t,e)=>{let{text:n,ranges:r,linewise:i}=Qit(t.state);if(!n&&!i)return!1;kN=i?n:null,e.type=="cut"&&!t.state.readOnly&&t.dispatch({changes:r,scrollIntoView:!0,userEvent:"delete.cut"});let o=Cde?null:e.clipboardData;return o?(o.clearData(),o.setData("text/plain",n),!0):(Xit(t,n),!1)};const Pde=lc.define();function Mde(t,e){let n=[];for(let r of t.facet(ude)){let i=r(t,e);i&&n.push(i)}return n?t.update({effects:n,annotations:Pde.of(!0)}):null}function kde(t){setTimeout(()=>{let e=t.hasFocus;if(e!=t.inputState.notifiedFocused){let n=Mde(t.state,e);n?t.dispatch(n):t.update([])}},10)}ms.focus=t=>{t.inputState.lastFocusTime=Date.now(),!t.scrollDOM.scrollTop&&(t.inputState.lastScrollTop||t.inputState.lastScrollLeft)&&(t.scrollDOM.scrollTop=t.inputState.lastScrollTop,t.scrollDOM.scrollLeft=t.inputState.lastScrollLeft),kde(t)};ms.blur=t=>{t.observer.clearSelectionRange(),kde(t)};ms.compositionstart=ms.compositionupdate=t=>{t.observer.editContext||(t.inputState.compositionFirstChange==null&&(t.inputState.compositionFirstChange=!0),t.inputState.composing<0&&(t.inputState.composing=0))};ms.compositionend=t=>{t.observer.editContext||(t.inputState.composing=-1,t.inputState.compositionEndedAt=Date.now(),t.inputState.compositionPendingKey=!0,t.inputState.compositionPendingChange=t.observer.pendingRecords().length>0,t.inputState.compositionFirstChange=null,ut.chrome&&ut.android?t.observer.flushSoon():t.inputState.compositionPendingChange?Promise.resolve().then(()=>t.observer.flush()):setTimeout(()=>{t.inputState.composing<0&&t.docView.hasComposition&&t.update([])},50))};ms.contextmenu=t=>{t.inputState.lastContextMenu=Date.now()};tl.beforeinput=(t,e)=>{var n,r;if(e.inputType=="insertReplacementText"&&t.observer.editContext){let o=(n=e.dataTransfer)===null||n===void 0?void 0:n.getData("text/plain"),a=e.getTargetRanges();if(o&&a.length){let s=a[0],l=t.posAtDOM(s.startContainer,s.startOffset),c=t.posAtDOM(s.endContainer,s.endOffset);return E4(t,{from:l,to:c,insert:t.state.toText(o)},null),!0}}let i;if(ut.chrome&&ut.android&&(i=Sde.find(o=>o.inputType==e.inputType))&&(t.observer.delayAndroidKey(i.key,i.keyCode),i.key=="Backspace"||i.key=="Delete")){let o=((r=window.visualViewport)===null||r===void 0?void 0:r.height)||0;setTimeout(()=>{var a;(((a=window.visualViewport)===null||a===void 0?void 0:a.height)||0)>o+10&&t.hasFocus&&(t.contentDOM.blur(),t.focus())},100)}return ut.ios&&e.inputType=="deleteContentForward"&&t.observer.flushSoon(),ut.safari&&e.inputType=="insertText"&&t.inputState.composing>=0&&setTimeout(()=>ms.compositionend(t,e),20),!1};const N7=new Set;function Yit(t){N7.has(t)||(N7.add(t),t.addEventListener("copy",()=>{}),t.addEventListener("cut",()=>{}))}const $7=["pre-wrap","normal","pre-line","break-spaces"];let dv=!1;function F7(){dv=!1}class Kit{constructor(e){this.lineWrapping=e,this.doc=xn.empty,this.heightSamples={},this.lineHeight=14,this.charWidth=7,this.textHeight=14,this.lineLength=30}heightForGap(e,n){let r=this.doc.lineAt(n).number-this.doc.lineAt(e).number+1;return this.lineWrapping&&(r+=Math.max(0,Math.ceil((n-e-r*this.lineLength*.5)/this.lineLength))),this.lineHeight*r}heightForLine(e){return this.lineWrapping?(1+Math.max(0,Math.ceil((e-this.lineLength)/(this.lineLength-5))))*this.lineHeight:this.lineHeight}setDoc(e){return this.doc=e,this}mustRefreshForWrapping(e){return $7.indexOf(e)>-1!=this.lineWrapping}mustRefreshForHeights(e){let n=!1;for(let r=0;r<e.length;r++){let i=e[r];i<0?r++:this.heightSamples[Math.floor(i*10)]||(n=!0,this.heightSamples[Math.floor(i*10)]=!0)}return n}refresh(e,n,r,i,o,a){let s=$7.indexOf(e)>-1,l=Math.round(n)!=Math.round(this.lineHeight)||this.lineWrapping!=s;if(this.lineWrapping=s,this.lineHeight=n,this.charWidth=r,this.textHeight=i,this.lineLength=o,l){this.heightSamples={};for(let c=0;c<a.length;c++){let u=a[c];u<0?c++:this.heightSamples[Math.floor(u*10)]=!0}}return l}}class Zit{constructor(e,n){this.from=e,this.heights=n,this.index=0}get more(){return this.index<this.heights.length}}class El{constructor(e,n,r,i,o){this.from=e,this.length=n,this.top=r,this.height=i,this._content=o}get type(){return typeof this._content=="number"?uo.Text:Array.isArray(this._content)?this._content:this._content.type}get to(){return this.from+this.length}get bottom(){return this.top+this.height}get widget(){return this._content instanceof sd?this._content.widget:null}get widgetLineBreaks(){return typeof this._content=="number"?this._content:0}join(e){let n=(Array.isArray(this._content)?this._content:[this]).concat(Array.isArray(e._content)?e._content:[e]);return new El(this.from,this.length+e.length,this.top,this.height+e.height,n)}}var Qn=function(t){return t[t.ByPos=0]="ByPos",t[t.ByHeight=1]="ByHeight",t[t.ByPosNoHeight=2]="ByPosNoHeight",t}(Qn||(Qn={}));const zC=.001;class fo{constructor(e,n,r=2){this.length=e,this.height=n,this.flags=r}get outdated(){return(this.flags&2)>0}set outdated(e){this.flags=(e?2:0)|this.flags&-3}setHeight(e){this.height!=e&&(Math.abs(this.height-e)>zC&&(dv=!0),this.height=e)}replace(e,n,r){return fo.of(r)}decomposeLeft(e,n){n.push(this)}decomposeRight(e,n){n.push(this)}applyChanges(e,n,r,i){let o=this,a=r.doc;for(let s=i.length-1;s>=0;s--){let{fromA:l,toA:c,fromB:u,toB:f}=i[s],d=o.lineAt(l,Qn.ByPosNoHeight,r.setDoc(n),0,0),h=d.to>=c?d:o.lineAt(c,Qn.ByPosNoHeight,r,0,0);for(f+=h.to-c,c=h.to;s>0&&d.from<=i[s-1].toA;)l=i[s-1].fromA,u=i[s-1].fromB,s--,l<d.from&&(d=o.lineAt(l,Qn.ByPosNoHeight,r,0,0));u+=d.from-l,l=d.from;let p=P4.build(r.setDoc(a),e,u,f);o=gE(o,o.replace(l,c,p))}return o.updateHeight(r,0)}static empty(){return new la(0,0)}static of(e){if(e.length==1)return e[0];let n=0,r=e.length,i=0,o=0;for(;;)if(n==r)if(i>o*2){let s=e[n-1];s.break?e.splice(--n,1,s.left,null,s.right):e.splice(--n,1,s.left,s.right),r+=1+s.break,i-=s.size}else if(o>i*2){let s=e[r];s.break?e.splice(r,1,s.left,null,s.right):e.splice(r,1,s.left,s.right),r+=2+s.break,o-=s.size}else break;else if(i<o){let s=e[n++];s&&(i+=s.size)}else{let s=e[--r];s&&(o+=s.size)}let a=0;return e[n-1]==null?(a=1,n--):e[n]==null&&(a=1,r++),new Jit(fo.of(e.slice(0,n)),a,fo.of(e.slice(r)))}}function gE(t,e){return t==e?t:(t.constructor!=e.constructor&&(dv=!0),e)}fo.prototype.size=1;class Ade extends fo{constructor(e,n,r){super(e,n),this.deco=r}blockAt(e,n,r,i){return new El(i,this.length,r,this.height,this.deco||0)}lineAt(e,n,r,i,o){return this.blockAt(0,r,i,o)}forEachLine(e,n,r,i,o,a){e<=o+this.length&&n>=o&&a(this.blockAt(0,r,i,o))}updateHeight(e,n=0,r=!1,i){return i&&i.from<=n&&i.more&&this.setHeight(i.heights[i.index++]),this.outdated=!1,this}toString(){return`block(${this.length})`}}class la extends Ade{constructor(e,n){super(e,n,null),this.collapsed=0,this.widgetHeight=0,this.breaks=0}blockAt(e,n,r,i){return new El(i,this.length,r,this.height,this.breaks)}replace(e,n,r){let i=r[0];return r.length==1&&(i instanceof la||i instanceof _i&&i.flags&4)&&Math.abs(this.length-i.length)<10?(i instanceof _i?i=new la(i.length,this.height):i.height=this.height,this.outdated||(i.outdated=!1),i):fo.of(r)}updateHeight(e,n=0,r=!1,i){return i&&i.from<=n&&i.more?this.setHeight(i.heights[i.index++]):(r||this.outdated)&&this.setHeight(Math.max(this.widgetHeight,e.heightForLine(this.length-this.collapsed))+this.breaks*e.lineHeight),this.outdated=!1,this}toString(){return`line(${this.length}${this.collapsed?-this.collapsed:""}${this.widgetHeight?":"+this.widgetHeight:""})`}}class _i extends fo{constructor(e){super(e,0)}heightMetrics(e,n){let r=e.doc.lineAt(n).number,i=e.doc.lineAt(n+this.length).number,o=i-r+1,a,s=0;if(e.lineWrapping){let l=Math.min(this.height,e.lineHeight*o);a=l/o,this.length>o+1&&(s=(this.height-l)/(this.length-o-1))}else a=this.height/o;return{firstLine:r,lastLine:i,perLine:a,perChar:s}}blockAt(e,n,r,i){let{firstLine:o,lastLine:a,perLine:s,perChar:l}=this.heightMetrics(n,i);if(n.lineWrapping){let c=i+(e<n.lineHeight?0:Math.round(Math.max(0,Math.min(1,(e-r)/this.height))*this.length)),u=n.doc.lineAt(c),f=s+u.length*l,d=Math.max(r,e-f/2);return new El(u.from,u.length,d,f,0)}else{let c=Math.max(0,Math.min(a-o,Math.floor((e-r)/s))),{from:u,length:f}=n.doc.line(o+c);return new El(u,f,r+s*c,s,0)}}lineAt(e,n,r,i,o){if(n==Qn.ByHeight)return this.blockAt(e,r,i,o);if(n==Qn.ByPosNoHeight){let{from:h,to:p}=r.doc.lineAt(e);return new El(h,p-h,0,0,0)}let{firstLine:a,perLine:s,perChar:l}=this.heightMetrics(r,o),c=r.doc.lineAt(e),u=s+c.length*l,f=c.number-a,d=i+s*f+l*(c.from-o-f);return new El(c.from,c.length,Math.max(i,Math.min(d,i+this.height-u)),u,0)}forEachLine(e,n,r,i,o,a){e=Math.max(e,o),n=Math.min(n,o+this.length);let{firstLine:s,perLine:l,perChar:c}=this.heightMetrics(r,o);for(let u=e,f=i;u<=n;){let d=r.doc.lineAt(u);if(u==e){let p=d.number-s;f+=l*p+c*(e-o-p)}let h=l+c*d.length;a(new El(d.from,d.length,f,h,0)),f+=h,u=d.to+1}}replace(e,n,r){let i=this.length-n;if(i>0){let o=r[r.length-1];o instanceof _i?r[r.length-1]=new _i(o.length+i):r.push(null,new _i(i-1))}if(e>0){let o=r[0];o instanceof _i?r[0]=new _i(e+o.length):r.unshift(new _i(e-1),null)}return fo.of(r)}decomposeLeft(e,n){n.push(new _i(e-1),null)}decomposeRight(e,n){n.push(null,new _i(this.length-e-1))}updateHeight(e,n=0,r=!1,i){let o=n+this.length;if(i&&i.from<=n+this.length&&i.more){let a=[],s=Math.max(n,i.from),l=-1;for(i.from>n&&a.push(new _i(i.from-n-1).updateHeight(e,n));s<=o&&i.more;){let u=e.doc.lineAt(s).length;a.length&&a.push(null);let f=i.heights[i.index++];l==-1?l=f:Math.abs(f-l)>=zC&&(l=-2);let d=new la(u,f);d.outdated=!1,a.push(d),s+=u+1}s<=o&&a.push(null,new _i(o-s).updateHeight(e,s));let c=fo.of(a);return(l<0||Math.abs(c.height-this.height)>=zC||Math.abs(l-this.heightMetrics(e,n).perLine)>=zC)&&(dv=!0),gE(this,c)}else(r||this.outdated)&&(this.setHeight(e.heightForGap(n,n+this.length)),this.outdated=!1);return this}toString(){return`gap(${this.length})`}}class Jit extends fo{constructor(e,n,r){super(e.length+n+r.length,e.height+r.height,n|(e.outdated||r.outdated?2:0)),this.left=e,this.right=r,this.size=e.size+r.size}get break(){return this.flags&1}blockAt(e,n,r,i){let o=r+this.left.height;return e<o?this.left.blockAt(e,n,r,i):this.right.blockAt(e,n,o,i+this.left.length+this.break)}lineAt(e,n,r,i,o){let a=i+this.left.height,s=o+this.left.length+this.break,l=n==Qn.ByHeight?e<a:e<s,c=l?this.left.lineAt(e,n,r,i,o):this.right.lineAt(e,n,r,a,s);if(this.break||(l?c.to<s:c.from>s))return c;let u=n==Qn.ByPosNoHeight?Qn.ByPosNoHeight:Qn.ByPos;return l?c.join(this.right.lineAt(s,u,r,a,s)):this.left.lineAt(s,u,r,i,o).join(c)}forEachLine(e,n,r,i,o,a){let s=i+this.left.height,l=o+this.left.length+this.break;if(this.break)e<l&&this.left.forEachLine(e,n,r,i,o,a),n>=l&&this.right.forEachLine(e,n,r,s,l,a);else{let c=this.lineAt(l,Qn.ByPos,r,i,o);e<c.from&&this.left.forEachLine(e,c.from-1,r,i,o,a),c.to>=e&&c.from<=n&&a(c),n>c.to&&this.right.forEachLine(c.to+1,n,r,s,l,a)}}replace(e,n,r){let i=this.left.length+this.break;if(n<i)return this.balanced(this.left.replace(e,n,r),this.right);if(e>this.left.length)return this.balanced(this.left,this.right.replace(e-i,n-i,r));let o=[];e>0&&this.decomposeLeft(e,o);let a=o.length;for(let s of r)o.push(s);if(e>0&&j7(o,a-1),n<this.length){let s=o.length;this.decomposeRight(n,o),j7(o,s)}return fo.of(o)}decomposeLeft(e,n){let r=this.left.length;if(e<=r)return this.left.decomposeLeft(e,n);n.push(this.left),this.break&&(r++,e>=r&&n.push(null)),e>r&&this.right.decomposeLeft(e-r,n)}decomposeRight(e,n){let r=this.left.length,i=r+this.break;if(e>=i)return this.right.decomposeRight(e-i,n);e<r&&this.left.decomposeRight(e,n),this.break&&e<i&&n.push(null),n.push(this.right)}balanced(e,n){return e.size>2*n.size||n.size>2*e.size?fo.of(this.break?[e,null,n]:[e,n]):(this.left=gE(this.left,e),this.right=gE(this.right,n),this.setHeight(e.height+n.height),this.outdated=e.outdated||n.outdated,this.size=e.size+n.size,this.length=e.length+this.break+n.length,this)}updateHeight(e,n=0,r=!1,i){let{left:o,right:a}=this,s=n+o.length+this.break,l=null;return i&&i.from<=n+o.length&&i.more?l=o=o.updateHeight(e,n,r,i):o.updateHeight(e,n,r),i&&i.from<=s+a.length&&i.more?l=a=a.updateHeight(e,s,r,i):a.updateHeight(e,s,r),l?this.balanced(o,a):(this.height=this.left.height+this.right.height,this.outdated=!1,this)}toString(){return this.left+(this.break?" ":"-")+this.right}}function j7(t,e){let n,r;t[e]==null&&(n=t[e-1])instanceof _i&&(r=t[e+1])instanceof _i&&t.splice(e-1,3,new _i(n.length+1+r.length))}const eot=5;class P4{constructor(e,n){this.pos=e,this.oracle=n,this.nodes=[],this.lineStart=-1,this.lineEnd=-1,this.covering=null,this.writtenTo=e}get isCovered(){return this.covering&&this.nodes[this.nodes.length-1]==this.covering}span(e,n){if(this.lineStart>-1){let r=Math.min(n,this.lineEnd),i=this.nodes[this.nodes.length-1];i instanceof la?i.length+=r-this.pos:(r>this.pos||!this.isCovered)&&this.nodes.push(new la(r-this.pos,-1)),this.writtenTo=r,n>r&&(this.nodes.push(null),this.writtenTo++,this.lineStart=-1)}this.pos=n}point(e,n,r){if(e<n||r.heightRelevant){let i=r.widget?r.widget.estimatedHeight:0,o=r.widget?r.widget.lineBreaks:0;i<0&&(i=this.oracle.lineHeight);let a=n-e;r.block?this.addBlock(new Ade(a,i,r)):(a||o||i>=eot)&&this.addLineDeco(i,o,a)}else n>e&&this.span(e,n);this.lineEnd>-1&&this.lineEnd<this.pos&&(this.lineEnd=this.oracle.doc.lineAt(this.pos).to)}enterLine(){if(this.lineStart>-1)return;let{from:e,to:n}=this.oracle.doc.lineAt(this.pos);this.lineStart=e,this.lineEnd=n,this.writtenTo<e&&((this.writtenTo<e-1||this.nodes[this.nodes.length-1]==null)&&this.nodes.push(this.blankContent(this.writtenTo,e-1)),this.nodes.push(null)),this.pos>e&&this.nodes.push(new la(this.pos-e,-1)),this.writtenTo=this.pos}blankContent(e,n){let r=new _i(n-e);return this.oracle.doc.lineAt(e).to==n&&(r.flags|=4),r}ensureLine(){this.enterLine();let e=this.nodes.length?this.nodes[this.nodes.length-1]:null;if(e instanceof la)return e;let n=new la(0,-1);return this.nodes.push(n),n}addBlock(e){this.enterLine();let n=e.deco;n&&n.startSide>0&&!this.isCovered&&this.ensureLine(),this.nodes.push(e),this.writtenTo=this.pos=this.pos+e.length,n&&n.endSide>0&&(this.covering=e)}addLineDeco(e,n,r){let i=this.ensureLine();i.length+=r,i.collapsed+=r,i.widgetHeight=Math.max(i.widgetHeight,e),i.breaks+=n,this.writtenTo=this.pos=this.pos+r}finish(e){let n=this.nodes.length==0?null:this.nodes[this.nodes.length-1];this.lineStart>-1&&!(n instanceof la)&&!this.isCovered?this.nodes.push(new la(0,-1)):(this.writtenTo<this.pos||n==null)&&this.nodes.push(this.blankContent(this.writtenTo,this.pos));let r=e;for(let i of this.nodes)i instanceof la&&i.updateHeight(this.oracle,r),r+=i?i.length:1;return this.nodes}static build(e,n,r,i){let o=new P4(r,e);return sn.spans(n,r,i,o,0),o.finish(r)}}function tot(t,e,n){let r=new not;return sn.compare(t,e,n,r,0),r.changes}class not{constructor(){this.changes=[]}compareRange(){}comparePoint(e,n,r,i){(e<n||r&&r.heightRelevant||i&&i.heightRelevant)&&wN(e,n,this.changes,5)}}function rot(t,e){let n=t.getBoundingClientRect(),r=t.ownerDocument,i=r.defaultView||window,o=Math.max(0,n.left),a=Math.min(i.innerWidth,n.right),s=Math.max(0,n.top),l=Math.min(i.innerHeight,n.bottom);for(let c=t.parentNode;c&&c!=r.body;)if(c.nodeType==1){let u=c,f=window.getComputedStyle(u);if((u.scrollHeight>u.clientHeight||u.scrollWidth>u.clientWidth)&&f.overflow!="visible"){let d=u.getBoundingClientRect();o=Math.max(o,d.left),a=Math.min(a,d.right),s=Math.max(s,d.top),l=Math.min(c==t.parentNode?i.innerHeight:l,d.bottom)}c=f.position=="absolute"||f.position=="fixed"?u.offsetParent:u.parentNode}else if(c.nodeType==11)c=c.host;else break;return{left:o-n.left,right:Math.max(o,a)-n.left,top:s-(n.top+e),bottom:Math.max(s,l)-(n.top+e)}}function iot(t,e){let n=t.getBoundingClientRect();return{left:0,right:n.right-n.left,top:e,bottom:n.bottom-(n.top+e)}}class BR{constructor(e,n,r){this.from=e,this.to=n,this.size=r}static same(e,n){if(e.length!=n.length)return!1;for(let r=0;r<e.length;r++){let i=e[r],o=n[r];if(i.from!=o.from||i.to!=o.to||i.size!=o.size)return!1}return!0}draw(e,n){return gt.replace({widget:new oot(this.size*(n?e.scaleY:e.scaleX),n)}).range(this.from,this.to)}}class oot extends uc{constructor(e,n){super(),this.size=e,this.vertical=n}eq(e){return e.size==this.size&&e.vertical==this.vertical}toDOM(){let e=document.createElement("div");return this.vertical?e.style.height=this.size+"px":(e.style.width=this.size+"px",e.style.height="2px",e.style.display="inline-block"),e}get estimatedHeight(){return this.vertical?this.size:-1}}class B7{constructor(e){this.state=e,this.pixelViewport={left:0,right:window.innerWidth,top:0,bottom:0},this.inView=!0,this.paddingTop=0,this.paddingBottom=0,this.contentDOMWidth=0,this.contentDOMHeight=0,this.editorHeight=0,this.editorWidth=0,this.scrollTop=0,this.scrolledToBottom=!1,this.scaleX=1,this.scaleY=1,this.scrollAnchorPos=0,this.scrollAnchorHeight=-1,this.scaler=z7,this.scrollTarget=null,this.printing=!1,this.mustMeasureContent=!0,this.defaultTextDirection=rr.LTR,this.visibleRanges=[],this.mustEnforceCursorAssoc=!1;let n=e.facet(C4).some(r=>typeof r!="function"&&r.class=="cm-lineWrapping");this.heightOracle=new Kit(n),this.stateDeco=e.facet(o_).filter(r=>typeof r!="function"),this.heightMap=fo.empty().applyChanges(this.stateDeco,xn.empty,this.heightOracle.setDoc(e.doc),[new rs(0,0,0,e.doc.length)]);for(let r=0;r<2&&(this.viewport=this.getViewport(0,null),!!this.updateForViewport());r++);this.updateViewportLines(),this.lineGaps=this.ensureLineGaps([]),this.lineGapDeco=gt.set(this.lineGaps.map(r=>r.draw(this,!1))),this.computeVisibleRanges()}updateForViewport(){let e=[this.viewport],{main:n}=this.state.selection;for(let r=0;r<=1;r++){let i=r?n.head:n.anchor;if(!e.some(({from:o,to:a})=>i>=o&&i<=a)){let{from:o,to:a}=this.lineBlockAt(i);e.push(new KS(o,a))}}return this.viewports=e.sort((r,i)=>r.from-i.from),this.updateScaler()}updateScaler(){let e=this.scaler;return this.scaler=this.heightMap.height<=7e6?z7:new M4(this.heightOracle,this.heightMap,this.viewports),e.eq(this.scaler)?0:2}updateViewportLines(){this.viewportLines=[],this.heightMap.forEachLine(this.viewport.from,this.viewport.to,this.heightOracle.setDoc(this.state.doc),0,0,e=>{this.viewportLines.push(vx(e,this.scaler))})}update(e,n=null){this.state=e.state;let r=this.stateDeco;this.stateDeco=this.state.facet(o_).filter(u=>typeof u!="function");let i=e.changedRanges,o=rs.extendWithRanges(i,tot(r,this.stateDeco,e?e.changes:Zr.empty(this.state.doc.length))),a=this.heightMap.height,s=this.scrolledToBottom?null:this.scrollAnchorAt(this.scrollTop);F7(),this.heightMap=this.heightMap.applyChanges(this.stateDeco,e.startState.doc,this.heightOracle.setDoc(this.state.doc),o),(this.heightMap.height!=a||dv)&&(e.flags|=2),s?(this.scrollAnchorPos=e.changes.mapPos(s.from,-1),this.scrollAnchorHeight=s.top):(this.scrollAnchorPos=-1,this.scrollAnchorHeight=this.heightMap.height);let l=o.length?this.mapViewport(this.viewport,e.changes):this.viewport;(n&&(n.range.head<l.from||n.range.head>l.to)||!this.viewportIsAppropriate(l))&&(l=this.getViewport(0,n));let c=l.from!=this.viewport.from||l.to!=this.viewport.to;this.viewport=l,e.flags|=this.updateForViewport(),(c||!e.changes.empty||e.flags&2)&&this.updateViewportLines(),(this.lineGaps.length||this.viewport.to-this.viewport.from>4e3)&&this.updateLineGaps(this.ensureLineGaps(this.mapLineGaps(this.lineGaps,e.changes))),e.flags|=this.computeVisibleRanges(),n&&(this.scrollTarget=n),!this.mustEnforceCursorAssoc&&e.selectionSet&&e.view.lineWrapping&&e.state.selection.main.empty&&e.state.selection.main.assoc&&!e.state.facet(dde)&&(this.mustEnforceCursorAssoc=!0)}measure(e){let n=e.contentDOM,r=window.getComputedStyle(n),i=this.heightOracle,o=r.whiteSpace;this.defaultTextDirection=r.direction=="rtl"?rr.RTL:rr.LTR;let a=this.heightOracle.mustRefreshForWrapping(o),s=n.getBoundingClientRect(),l=a||this.mustMeasureContent||this.contentDOMHeight!=s.height;this.contentDOMHeight=s.height,this.mustMeasureContent=!1;let c=0,u=0;if(s.width&&s.height){let{scaleX:b,scaleY:_}=jfe(n,s);(b>.005&&Math.abs(this.scaleX-b)>.005||_>.005&&Math.abs(this.scaleY-_)>.005)&&(this.scaleX=b,this.scaleY=_,c|=8,a=l=!0)}let f=(parseInt(r.paddingTop)||0)*this.scaleY,d=(parseInt(r.paddingBottom)||0)*this.scaleY;(this.paddingTop!=f||this.paddingBottom!=d)&&(this.paddingTop=f,this.paddingBottom=d,c|=10),this.editorWidth!=e.scrollDOM.clientWidth&&(i.lineWrapping&&(l=!0),this.editorWidth=e.scrollDOM.clientWidth,c|=8);let h=e.scrollDOM.scrollTop*this.scaleY;this.scrollTop!=h&&(this.scrollAnchorHeight=-1,this.scrollTop=h),this.scrolledToBottom=Ufe(e.scrollDOM);let p=(this.printing?iot:rot)(n,this.paddingTop),m=p.top-this.pixelViewport.top,g=p.bottom-this.pixelViewport.bottom;this.pixelViewport=p;let v=this.pixelViewport.bottom>this.pixelViewport.top&&this.pixelViewport.right>this.pixelViewport.left;if(v!=this.inView&&(this.inView=v,v&&(l=!0)),!this.inView&&!this.scrollTarget)return 0;let y=s.width;if((this.contentDOMWidth!=y||this.editorHeight!=e.scrollDOM.clientHeight)&&(this.contentDOMWidth=s.width,this.editorHeight=e.scrollDOM.clientHeight,c|=8),l){let b=e.docView.measureVisibleLineHeights(this.viewport);if(i.mustRefreshForHeights(b)&&(a=!0),a||i.lineWrapping&&Math.abs(y-this.contentDOMWidth)>i.charWidth){let{lineHeight:_,charWidth:S,textHeight:O}=e.docView.measureTextSize();a=_>0&&i.refresh(o,_,S,O,y/S,b),a&&(e.docView.minWidth=0,c|=8)}m>0&&g>0?u=Math.max(m,g):m<0&&g<0&&(u=Math.min(m,g)),F7();for(let _ of this.viewports){let S=_.from==this.viewport.from?b:e.docView.measureVisibleLineHeights(_);this.heightMap=(a?fo.empty().applyChanges(this.stateDeco,xn.empty,this.heightOracle,[new rs(0,0,0,e.state.doc.length)]):this.heightMap).updateHeight(i,0,a,new Zit(_.from,S))}dv&&(c|=2)}let x=!this.viewportIsAppropriate(this.viewport,u)||this.scrollTarget&&(this.scrollTarget.range.head<this.viewport.from||this.scrollTarget.range.head>this.viewport.to);return x&&(c&2&&(c|=this.updateScaler()),this.viewport=this.getViewport(u,this.scrollTarget),c|=this.updateForViewport()),(c&2||x)&&this.updateViewportLines(),(this.lineGaps.length||this.viewport.to-this.viewport.from>4e3)&&this.updateLineGaps(this.ensureLineGaps(a?[]:this.lineGaps,e)),c|=this.computeVisibleRanges(),this.mustEnforceCursorAssoc&&(this.mustEnforceCursorAssoc=!1,e.docView.enforceCursorAssoc()),c}get visibleTop(){return this.scaler.fromDOM(this.pixelViewport.top)}get visibleBottom(){return this.scaler.fromDOM(this.pixelViewport.bottom)}getViewport(e,n){let r=.5-Math.max(-.5,Math.min(.5,e/1e3/2)),i=this.heightMap,o=this.heightOracle,{visibleTop:a,visibleBottom:s}=this,l=new KS(i.lineAt(a-r*1e3,Qn.ByHeight,o,0,0).from,i.lineAt(s+(1-r)*1e3,Qn.ByHeight,o,0,0).to);if(n){let{head:c}=n.range;if(c<l.from||c>l.to){let u=Math.min(this.editorHeight,this.pixelViewport.bottom-this.pixelViewport.top),f=i.lineAt(c,Qn.ByPos,o,0,0),d;n.y=="center"?d=(f.top+f.bottom)/2-u/2:n.y=="start"||n.y=="nearest"&&c<l.from?d=f.top:d=f.bottom-u,l=new KS(i.lineAt(d-1e3/2,Qn.ByHeight,o,0,0).from,i.lineAt(d+u+1e3/2,Qn.ByHeight,o,0,0).to)}}return l}mapViewport(e,n){let r=n.mapPos(e.from,-1),i=n.mapPos(e.to,1);return new KS(this.heightMap.lineAt(r,Qn.ByPos,this.heightOracle,0,0).from,this.heightMap.lineAt(i,Qn.ByPos,this.heightOracle,0,0).to)}viewportIsAppropriate({from:e,to:n},r=0){if(!this.inView)return!0;let{top:i}=this.heightMap.lineAt(e,Qn.ByPos,this.heightOracle,0,0),{bottom:o}=this.heightMap.lineAt(n,Qn.ByPos,this.heightOracle,0,0),{visibleTop:a,visibleBottom:s}=this;return(e==0||i<=a-Math.max(10,Math.min(-r,250)))&&(n==this.state.doc.length||o>=s+Math.max(10,Math.min(r,250)))&&i>a-2*1e3&&o<s+2*1e3}mapLineGaps(e,n){if(!e.length||n.empty)return e;let r=[];for(let i of e)n.touchesRange(i.from,i.to)||r.push(new BR(n.mapPos(i.from),n.mapPos(i.to),i.size));return r}ensureLineGaps(e,n){let r=this.heightOracle.lineWrapping,i=r?1e4:2e3,o=i>>1,a=i<<1;if(this.defaultTextDirection!=rr.LTR&&!r)return[];let s=[],l=(u,f,d,h)=>{if(f-u<o)return;let p=this.state.selection.main,m=[p.from];p.empty||m.push(p.to);for(let v of m)if(v>u&&v<f){l(u,v-10,d,h),l(v+10,f,d,h);return}let g=sot(e,v=>v.from>=d.from&&v.to<=d.to&&Math.abs(v.from-u)<o&&Math.abs(v.to-f)<o&&!m.some(y=>v.from<y&&v.to>y));if(!g){if(f<d.to&&n&&r&&n.visibleRanges.some(v=>v.from<=f&&v.to>=f)){let v=n.moveToLineBoundary(je.cursor(f),!1,!0).head;v>u&&(f=v)}g=new BR(u,f,this.gapSize(d,u,f,h))}s.push(g)},c=u=>{if(u.length<a||u.type!=uo.Text)return;let f=aot(u.from,u.to,this.stateDeco);if(f.total<a)return;let d=this.scrollTarget?this.scrollTarget.range.head:null,h,p;if(r){let m=i/this.heightOracle.lineLength*this.heightOracle.lineHeight,g,v;if(d!=null){let y=JS(f,d),x=((this.visibleBottom-this.visibleTop)/2+m)/u.height;g=y-x,v=y+x}else g=(this.visibleTop-u.top-m)/u.height,v=(this.visibleBottom-u.top+m)/u.height;h=ZS(f,g),p=ZS(f,v)}else{let m=f.total*this.heightOracle.charWidth,g=i*this.heightOracle.charWidth,v,y;if(d!=null){let x=JS(f,d),b=((this.pixelViewport.right-this.pixelViewport.left)/2+g)/m;v=x-b,y=x+b}else v=(this.pixelViewport.left-g)/m,y=(this.pixelViewport.right+g)/m;h=ZS(f,v),p=ZS(f,y)}h>u.from&&l(u.from,h,u,f),p<u.to&&l(p,u.to,u,f)};for(let u of this.viewportLines)Array.isArray(u.type)?u.type.forEach(c):c(u);return s}gapSize(e,n,r,i){let o=JS(i,r)-JS(i,n);return this.heightOracle.lineWrapping?e.height*o:i.total*this.heightOracle.charWidth*o}updateLineGaps(e){BR.same(e,this.lineGaps)||(this.lineGaps=e,this.lineGapDeco=gt.set(e.map(n=>n.draw(this,this.heightOracle.lineWrapping))))}computeVisibleRanges(){let e=this.stateDeco;this.lineGaps.length&&(e=e.concat(this.lineGapDeco));let n=[];sn.spans(e,this.viewport.from,this.viewport.to,{span(i,o){n.push({from:i,to:o})},point(){}},20);let r=n.length!=this.visibleRanges.length||this.visibleRanges.some((i,o)=>i.from!=n[o].from||i.to!=n[o].to);return this.visibleRanges=n,r?4:0}lineBlockAt(e){return e>=this.viewport.from&&e<=this.viewport.to&&this.viewportLines.find(n=>n.from<=e&&n.to>=e)||vx(this.heightMap.lineAt(e,Qn.ByPos,this.heightOracle,0,0),this.scaler)}lineBlockAtHeight(e){return e>=this.viewportLines[0].top&&e<=this.viewportLines[this.viewportLines.length-1].bottom&&this.viewportLines.find(n=>n.top<=e&&n.bottom>=e)||vx(this.heightMap.lineAt(this.scaler.fromDOM(e),Qn.ByHeight,this.heightOracle,0,0),this.scaler)}scrollAnchorAt(e){let n=this.lineBlockAtHeight(e+8);return n.from>=this.viewport.from||this.viewportLines[0].top-e>200?n:this.viewportLines[0]}elementAtHeight(e){return vx(this.heightMap.blockAt(this.scaler.fromDOM(e),this.heightOracle,0,0),this.scaler)}get docHeight(){return this.scaler.toDOM(this.heightMap.height)}get contentHeight(){return this.docHeight+this.paddingTop+this.paddingBottom}}class KS{constructor(e,n){this.from=e,this.to=n}}function aot(t,e,n){let r=[],i=t,o=0;return sn.spans(n,t,e,{span(){},point(a,s){a>i&&(r.push({from:i,to:a}),o+=a-i),i=s}},20),i<e&&(r.push({from:i,to:e}),o+=e-i),{total:o,ranges:r}}function ZS({total:t,ranges:e},n){if(n<=0)return e[0].from;if(n>=1)return e[e.length-1].to;let r=Math.floor(t*n);for(let i=0;;i++){let{from:o,to:a}=e[i],s=a-o;if(r<=s)return o+r;r-=s}}function JS(t,e){let n=0;for(let{from:r,to:i}of t.ranges){if(e<=i){n+=e-r;break}n+=i-r}return n/t.total}function sot(t,e){for(let n of t)if(e(n))return n}const z7={toDOM(t){return t},fromDOM(t){return t},scale:1,eq(t){return t==this}};class M4{constructor(e,n,r){let i=0,o=0,a=0;this.viewports=r.map(({from:s,to:l})=>{let c=n.lineAt(s,Qn.ByPos,e,0,0).top,u=n.lineAt(l,Qn.ByPos,e,0,0).bottom;return i+=u-c,{from:s,to:l,top:c,bottom:u,domTop:0,domBottom:0}}),this.scale=(7e6-i)/(n.height-i);for(let s of this.viewports)s.domTop=a+(s.top-o)*this.scale,a=s.domBottom=s.domTop+(s.bottom-s.top),o=s.bottom}toDOM(e){for(let n=0,r=0,i=0;;n++){let o=n<this.viewports.length?this.viewports[n]:null;if(!o||e<o.top)return i+(e-r)*this.scale;if(e<=o.bottom)return o.domTop+(e-o.top);r=o.bottom,i=o.domBottom}}fromDOM(e){for(let n=0,r=0,i=0;;n++){let o=n<this.viewports.length?this.viewports[n]:null;if(!o||e<o.domTop)return r+(e-i)/this.scale;if(e<=o.domBottom)return o.top+(e-o.domTop);r=o.bottom,i=o.domBottom}}eq(e){return e instanceof M4?this.scale==e.scale&&this.viewports.length==e.viewports.length&&this.viewports.every((n,r)=>n.from==e.viewports[r].from&&n.to==e.viewports[r].to):!1}}function vx(t,e){if(e.scale==1)return t;let n=e.toDOM(t.top),r=e.toDOM(t.bottom);return new El(t.from,t.length,n,r-n,Array.isArray(t._content)?t._content.map(i=>vx(i,e)):t._content)}const eO=ct.define({combine:t=>t.join(" ")}),AN=ct.define({combine:t=>t.indexOf(!0)>-1}),RN=od.newName(),Rde=od.newName(),Ide=od.newName(),Dde={"&light":"."+Rde,"&dark":"."+Ide};function IN(t,e,n){return new od(e,{finish(r){return/&/.test(r)?r.replace(/&\w*/,i=>{if(i=="&")return t;if(!n||!n[i])throw new RangeError(`Unsupported selector: ${i}`);return n[i]}):t+" "+r}})}const lot=IN("."+RN,{"&":{position:"relative !important",boxSizing:"border-box","&.cm-focused":{outline:"1px dotted #212121"},display:"flex !important",flexDirection:"column"},".cm-scroller":{display:"flex !important",alignItems:"flex-start !important",fontFamily:"monospace",lineHeight:1.4,height:"100%",overflowX:"auto",position:"relative",zIndex:0,overflowAnchor:"none"},".cm-content":{margin:0,flexGrow:2,flexShrink:0,display:"block",whiteSpace:"pre",wordWrap:"normal",boxSizing:"border-box",minHeight:"100%",padding:"4px 0",outline:"none","&[contenteditable=true]":{WebkitUserModify:"read-write-plaintext-only"}},".cm-lineWrapping":{whiteSpace_fallback:"pre-wrap",whiteSpace:"break-spaces",wordBreak:"break-word",overflowWrap:"anywhere",flexShrink:1},"&light .cm-content":{caretColor:"black"},"&dark .cm-content":{caretColor:"white"},".cm-line":{display:"block",padding:"0 2px 0 6px"},".cm-layer":{position:"absolute",left:0,top:0,contain:"size style","& > *":{position:"absolute"}},"&light .cm-selectionBackground":{background:"#d9d9d9"},"&dark .cm-selectionBackground":{background:"#222"},"&light.cm-focused > .cm-scroller > .cm-selectionLayer .cm-selectionBackground":{background:"#d7d4f0"},"&dark.cm-focused > .cm-scroller > .cm-selectionLayer .cm-selectionBackground":{background:"#233"},".cm-cursorLayer":{pointerEvents:"none"},"&.cm-focused > .cm-scroller > .cm-cursorLayer":{animation:"steps(1) cm-blink 1.2s infinite"},"@keyframes cm-blink":{"0%":{},"50%":{opacity:0},"100%":{}},"@keyframes cm-blink2":{"0%":{},"50%":{opacity:0},"100%":{}},".cm-cursor, .cm-dropCursor":{borderLeft:"1.2px solid black",marginLeft:"-0.6px",pointerEvents:"none"},".cm-cursor":{display:"none"},"&dark .cm-cursor":{borderLeftColor:"#444"},".cm-dropCursor":{position:"absolute"},"&.cm-focused > .cm-scroller > .cm-cursorLayer .cm-cursor":{display:"block"},".cm-iso":{unicodeBidi:"isolate"},".cm-announced":{position:"fixed",top:"-10000px"},"@media print":{".cm-announced":{display:"none"}},"&light .cm-activeLine":{backgroundColor:"#cceeff44"},"&dark .cm-activeLine":{backgroundColor:"#99eeff33"},"&light .cm-specialChar":{color:"red"},"&dark .cm-specialChar":{color:"#f78"},".cm-gutters":{flexShrink:0,display:"flex",height:"100%",boxSizing:"border-box",insetInlineStart:0,zIndex:200},"&light .cm-gutters":{backgroundColor:"#f5f5f5",color:"#6c6c6c",borderRight:"1px solid #ddd"},"&dark .cm-gutters":{backgroundColor:"#333338",color:"#ccc"},".cm-gutter":{display:"flex !important",flexDirection:"column",flexShrink:0,boxSizing:"border-box",minHeight:"100%",overflow:"hidden"},".cm-gutterElement":{boxSizing:"border-box"},".cm-lineNumbers .cm-gutterElement":{padding:"0 3px 0 5px",minWidth:"20px",textAlign:"right",whiteSpace:"nowrap"},"&light .cm-activeLineGutter":{backgroundColor:"#e2f2ff"},"&dark .cm-activeLineGutter":{backgroundColor:"#222227"},".cm-panels":{boxSizing:"border-box",position:"sticky",left:0,right:0,zIndex:300},"&light .cm-panels":{backgroundColor:"#f5f5f5",color:"black"},"&light .cm-panels-top":{borderBottom:"1px solid #ddd"},"&light .cm-panels-bottom":{borderTop:"1px solid #ddd"},"&dark .cm-panels":{backgroundColor:"#333338",color:"white"},".cm-tab":{display:"inline-block",overflow:"hidden",verticalAlign:"bottom"},".cm-widgetBuffer":{verticalAlign:"text-top",height:"1em",width:0,display:"inline"},".cm-placeholder":{color:"#888",display:"inline-block",verticalAlign:"top"},".cm-highlightSpace:before":{content:"attr(data-display)",position:"absolute",pointerEvents:"none",color:"#888"},".cm-highlightTab":{backgroundImage:`url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" width="200" height="20"><path stroke="%23888" stroke-width="1" fill="none" d="M1 10H196L190 5M190 15L196 10M197 4L197 16"/></svg>')`,backgroundSize:"auto 100%",backgroundPosition:"right 90%",backgroundRepeat:"no-repeat"},".cm-trailingSpace":{backgroundColor:"#ff332255"},".cm-button":{verticalAlign:"middle",color:"inherit",fontSize:"70%",padding:".2em 1em",borderRadius:"1px"},"&light .cm-button":{backgroundImage:"linear-gradient(#eff1f5, #d9d9df)",border:"1px solid #888","&:active":{backgroundImage:"linear-gradient(#b4b4b4, #d0d3d6)"}},"&dark .cm-button":{backgroundImage:"linear-gradient(#393939, #111)",border:"1px solid #888","&:active":{backgroundImage:"linear-gradient(#111, #333)"}},".cm-textfield":{verticalAlign:"middle",color:"inherit",fontSize:"70%",border:"1px solid silver",padding:".2em .5em"},"&light .cm-textfield":{backgroundColor:"white"},"&dark .cm-textfield":{border:"1px solid #555",backgroundColor:"inherit"}},Dde),cot={childList:!0,characterData:!0,subtree:!0,attributes:!0,characterDataOldValue:!0},zR=ut.ie&&ut.ie_version<=11;class uot{constructor(e){this.view=e,this.active=!1,this.editContext=null,this.selectionRange=new Xrt,this.selectionChanged=!1,this.delayedFlush=-1,this.resizeTimeout=-1,this.queue=[],this.delayedAndroidKey=null,this.flushingAndroidKey=-1,this.lastChange=0,this.scrollTargets=[],this.intersection=null,this.resizeScroll=null,this.intersecting=!1,this.gapIntersection=null,this.gaps=[],this.printQuery=null,this.parentCheck=-1,this.dom=e.contentDOM,this.observer=new MutationObserver(n=>{for(let r of n)this.queue.push(r);(ut.ie&&ut.ie_version<=11||ut.ios&&e.composing)&&n.some(r=>r.type=="childList"&&r.removedNodes.length||r.type=="characterData"&&r.oldValue.length>r.target.nodeValue.length)?this.flushSoon():this.flush()}),window.EditContext&&e.constructor.EDIT_CONTEXT!==!1&&!(ut.chrome&&ut.chrome_version<126)&&(this.editContext=new dot(e),e.state.facet(pf)&&(e.contentDOM.editContext=this.editContext.editContext)),zR&&(this.onCharData=n=>{this.queue.push({target:n.target,type:"characterData",oldValue:n.prevValue}),this.flushSoon()}),this.onSelectionChange=this.onSelectionChange.bind(this),this.onResize=this.onResize.bind(this),this.onPrint=this.onPrint.bind(this),this.onScroll=this.onScroll.bind(this),window.matchMedia&&(this.printQuery=window.matchMedia("print")),typeof ResizeObserver=="function"&&(this.resizeScroll=new ResizeObserver(()=>{var n;((n=this.view.docView)===null||n===void 0?void 0:n.lastUpdate)<Date.now()-75&&this.onResize()}),this.resizeScroll.observe(e.scrollDOM)),this.addWindowListeners(this.win=e.win),this.start(),typeof IntersectionObserver=="function"&&(this.intersection=new IntersectionObserver(n=>{this.parentCheck<0&&(this.parentCheck=setTimeout(this.listenForScroll.bind(this),1e3)),n.length>0&&n[n.length-1].intersectionRatio>0!=this.intersecting&&(this.intersecting=!this.intersecting,this.intersecting!=this.view.inView&&this.onScrollChanged(document.createEvent("Event")))},{threshold:[0,.001]}),this.intersection.observe(this.dom),this.gapIntersection=new IntersectionObserver(n=>{n.length>0&&n[n.length-1].intersectionRatio>0&&this.onScrollChanged(document.createEvent("Event"))},{})),this.listenForScroll(),this.readSelectionRange()}onScrollChanged(e){this.view.inputState.runHandlers("scroll",e),this.intersecting&&this.view.measure()}onScroll(e){this.intersecting&&this.flush(!1),this.editContext&&this.view.requestMeasure(this.editContext.measureReq),this.onScrollChanged(e)}onResize(){this.resizeTimeout<0&&(this.resizeTimeout=setTimeout(()=>{this.resizeTimeout=-1,this.view.requestMeasure()},50))}onPrint(e){(e.type=="change"||!e.type)&&!e.matches||(this.view.viewState.printing=!0,this.view.measure(),setTimeout(()=>{this.view.viewState.printing=!1,this.view.requestMeasure()},500))}updateGaps(e){if(this.gapIntersection&&(e.length!=this.gaps.length||this.gaps.some((n,r)=>n!=e[r]))){this.gapIntersection.disconnect();for(let n of e)this.gapIntersection.observe(n);this.gaps=e}}onSelectionChange(e){let n=this.selectionChanged;if(!this.readSelectionRange()||this.delayedAndroidKey)return;let{view:r}=this,i=this.selectionRange;if(r.state.facet(pf)?r.root.activeElement!=this.dom:!jC(r.dom,i))return;let o=i.anchorNode&&r.docView.nearest(i.anchorNode);if(o&&o.ignoreEvent(e)){n||(this.selectionChanged=!1);return}(ut.ie&&ut.ie_version<=11||ut.android&&ut.chrome)&&!r.state.selection.main.empty&&i.focusNode&&nb(i.focusNode,i.focusOffset,i.anchorNode,i.anchorOffset)?this.flushSoon():this.flush(!1)}readSelectionRange(){let{view:e}=this,n=i_(e.root);if(!n)return!1;let r=ut.safari&&e.root.nodeType==11&&Vrt(this.dom.ownerDocument)==this.dom&&fot(this.view,n)||n;if(!r||this.selectionRange.eq(r))return!1;let i=jC(this.dom,r);return i&&!this.selectionChanged&&e.inputState.lastFocusTime>Date.now()-200&&e.inputState.lastTouchTime<Date.now()-300&&Yrt(this.dom,r)?(this.view.inputState.lastFocusTime=0,e.docView.updateSelection(),!1):(this.selectionRange.setRange(r),i&&(this.selectionChanged=!0),!0)}setSelectionRange(e,n){this.selectionRange.set(e.node,e.offset,n.node,n.offset),this.selectionChanged=!1}clearSelectionRange(){this.selectionRange.set(null,0,null,0)}listenForScroll(){this.parentCheck=-1;let e=0,n=null;for(let r=this.dom;r;)if(r.nodeType==1)!n&&e<this.scrollTargets.length&&this.scrollTargets[e]==r?e++:n||(n=this.scrollTargets.slice(0,e)),n&&n.push(r),r=r.assignedSlot||r.parentNode;else if(r.nodeType==11)r=r.host;else break;if(e<this.scrollTargets.length&&!n&&(n=this.scrollTargets.slice(0,e)),n){for(let r of this.scrollTargets)r.removeEventListener("scroll",this.onScroll);for(let r of this.scrollTargets=n)r.addEventListener("scroll",this.onScroll)}}ignore(e){if(!this.active)return e();try{return this.stop(),e()}finally{this.start(),this.clear()}}start(){this.active||(this.observer.observe(this.dom,cot),zR&&this.dom.addEventListener("DOMCharacterDataModified",this.onCharData),this.active=!0)}stop(){this.active&&(this.active=!1,this.observer.disconnect(),zR&&this.dom.removeEventListener("DOMCharacterDataModified",this.onCharData))}clear(){this.processRecords(),this.queue.length=0,this.selectionChanged=!1}delayAndroidKey(e,n){var r;if(!this.delayedAndroidKey){let i=()=>{let o=this.delayedAndroidKey;o&&(this.clearDelayedAndroidKey(),this.view.inputState.lastKeyCode=o.keyCode,this.view.inputState.lastKeyTime=Date.now(),!this.flush()&&o.force&&Ag(this.dom,o.key,o.keyCode))};this.flushingAndroidKey=this.view.win.requestAnimationFrame(i)}(!this.delayedAndroidKey||e=="Enter")&&(this.delayedAndroidKey={key:e,keyCode:n,force:this.lastChange<Date.now()-50||!!(!((r=this.delayedAndroidKey)===null||r===void 0)&&r.force)})}clearDelayedAndroidKey(){this.win.cancelAnimationFrame(this.flushingAndroidKey),this.delayedAndroidKey=null,this.flushingAndroidKey=-1}flushSoon(){this.delayedFlush<0&&(this.delayedFlush=this.view.win.requestAnimationFrame(()=>{this.delayedFlush=-1,this.flush()}))}forceFlush(){this.delayedFlush>=0&&(this.view.win.cancelAnimationFrame(this.delayedFlush),this.delayedFlush=-1),this.flush()}pendingRecords(){for(let e of this.observer.takeRecords())this.queue.push(e);return this.queue}processRecords(){let e=this.pendingRecords();e.length&&(this.queue=[]);let n=-1,r=-1,i=!1;for(let o of e){let a=this.readMutation(o);a&&(a.typeOver&&(i=!0),n==-1?{from:n,to:r}=a:(n=Math.min(a.from,n),r=Math.max(a.to,r)))}return{from:n,to:r,typeOver:i}}readChange(){let{from:e,to:n,typeOver:r}=this.processRecords(),i=this.selectionChanged&&jC(this.dom,this.selectionRange);if(e<0&&!i)return null;e>-1&&(this.lastChange=Date.now()),this.view.inputState.lastFocusTime=0,this.selectionChanged=!1;let o=new Mit(this.view,e,n,r);return this.view.docView.domChanged={newSel:o.newSel?o.newSel.main:null},o}flush(e=!0){if(this.delayedFlush>=0||this.delayedAndroidKey)return!1;e&&this.readSelectionRange();let n=this.readChange();if(!n)return this.view.requestMeasure(),!1;let r=this.view.state,i=wde(this.view,n);return this.view.state==r&&(n.domChanged||n.newSel&&!n.newSel.main.eq(this.view.state.selection.main))&&this.view.update([]),i}readMutation(e){let n=this.view.docView.nearest(e.target);if(!n||n.ignoreMutation(e))return null;if(n.markDirty(e.type=="attributes"),e.type=="attributes"&&(n.flags|=4),e.type=="childList"){let r=U7(n,e.previousSibling||e.target.previousSibling,-1),i=U7(n,e.nextSibling||e.target.nextSibling,1);return{from:r?n.posAfter(r):n.posAtStart,to:i?n.posBefore(i):n.posAtEnd,typeOver:!1}}else return e.type=="characterData"?{from:n.posAtStart,to:n.posAtEnd,typeOver:e.target.nodeValue==e.oldValue}:null}setWindow(e){e!=this.win&&(this.removeWindowListeners(this.win),this.win=e,this.addWindowListeners(this.win))}addWindowListeners(e){e.addEventListener("resize",this.onResize),this.printQuery?this.printQuery.addEventListener?this.printQuery.addEventListener("change",this.onPrint):this.printQuery.addListener(this.onPrint):e.addEventListener("beforeprint",this.onPrint),e.addEventListener("scroll",this.onScroll),e.document.addEventListener("selectionchange",this.onSelectionChange)}removeWindowListeners(e){e.removeEventListener("scroll",this.onScroll),e.removeEventListener("resize",this.onResize),this.printQuery?this.printQuery.removeEventListener?this.printQuery.removeEventListener("change",this.onPrint):this.printQuery.removeListener(this.onPrint):e.removeEventListener("beforeprint",this.onPrint),e.document.removeEventListener("selectionchange",this.onSelectionChange)}update(e){this.editContext&&(this.editContext.update(e),e.startState.facet(pf)!=e.state.facet(pf)&&(e.view.contentDOM.editContext=e.state.facet(pf)?this.editContext.editContext:null))}destroy(){var e,n,r;this.stop(),(e=this.intersection)===null||e===void 0||e.disconnect(),(n=this.gapIntersection)===null||n===void 0||n.disconnect(),(r=this.resizeScroll)===null||r===void 0||r.disconnect();for(let i of this.scrollTargets)i.removeEventListener("scroll",this.onScroll);this.removeWindowListeners(this.win),clearTimeout(this.parentCheck),clearTimeout(this.resizeTimeout),this.win.cancelAnimationFrame(this.delayedFlush),this.win.cancelAnimationFrame(this.flushingAndroidKey),this.editContext&&(this.view.contentDOM.editContext=null,this.editContext.destroy())}}function U7(t,e,n){for(;e;){let r=Ln.get(e);if(r&&r.parent==t)return r;let i=e.parentNode;e=i!=t.dom?i:n>0?e.nextSibling:e.previousSibling}return null}function W7(t,e){let n=e.startContainer,r=e.startOffset,i=e.endContainer,o=e.endOffset,a=t.docView.domAtPos(t.state.selection.main.anchor);return nb(a.node,a.offset,i,o)&&([n,r,i,o]=[i,o,n,r]),{anchorNode:n,anchorOffset:r,focusNode:i,focusOffset:o}}function fot(t,e){if(e.getComposedRanges){let i=e.getComposedRanges(t.root)[0];if(i)return W7(t,i)}let n=null;function r(i){i.preventDefault(),i.stopImmediatePropagation(),n=i.getTargetRanges()[0]}return t.contentDOM.addEventListener("beforeinput",r,!0),t.dom.ownerDocument.execCommand("indent"),t.contentDOM.removeEventListener("beforeinput",r,!0),n?W7(t,n):null}class dot{constructor(e){this.from=0,this.to=0,this.pendingContextChange=null,this.handlers=Object.create(null),this.resetRange(e.state);let n=this.editContext=new window.EditContext({text:e.state.doc.sliceString(this.from,this.to),selectionStart:this.toContextPos(Math.max(this.from,Math.min(this.to,e.state.selection.main.anchor))),selectionEnd:this.toContextPos(e.state.selection.main.head)});this.handlers.textupdate=r=>{let{anchor:i}=e.state.selection.main,o={from:this.toEditorPos(r.updateRangeStart),to:this.toEditorPos(r.updateRangeEnd),insert:xn.of(r.text.split(`
`))};o.from==this.from&&i<this.from?o.from=i:o.to==this.to&&i>this.to&&(o.to=i),!(o.from==o.to&&!o.insert.length)&&(this.pendingContextChange=o,e.state.readOnly||E4(e,o,je.single(this.toEditorPos(r.selectionStart),this.toEditorPos(r.selectionEnd))),this.pendingContextChange&&(this.revertPending(e.state),this.setSelection(e.state)))},this.handlers.characterboundsupdate=r=>{let i=[],o=null;for(let a=this.toEditorPos(r.rangeStart),s=this.toEditorPos(r.rangeEnd);a<s;a++){let l=e.coordsForChar(a);o=l&&new DOMRect(l.left,l.top,l.right-l.left,l.bottom-l.top)||o||new DOMRect,i.push(o)}n.updateCharacterBounds(r.rangeStart,i)},this.handlers.textformatupdate=r=>{let i=[];for(let o of r.getTextFormats()){let a=o.underlineStyle,s=o.underlineThickness;if(a!="None"&&s!="None"){let l=`text-decoration: underline ${a=="Dashed"?"dashed ":a=="Squiggle"?"wavy ":""}${s=="Thin"?1:2}px`;i.push(gt.mark({attributes:{style:l}}).range(this.toEditorPos(o.rangeStart),this.toEditorPos(o.rangeEnd)))}}e.dispatch({effects:pde.of(gt.set(i))})},this.handlers.compositionstart=()=>{e.inputState.composing<0&&(e.inputState.composing=0,e.inputState.compositionFirstChange=!0)},this.handlers.compositionend=()=>{e.inputState.composing=-1,e.inputState.compositionFirstChange=null};for(let r in this.handlers)n.addEventListener(r,this.handlers[r]);this.measureReq={read:r=>{this.editContext.updateControlBounds(r.contentDOM.getBoundingClientRect());let i=i_(r.root);i&&i.rangeCount&&this.editContext.updateSelectionBounds(i.getRangeAt(0).getBoundingClientRect())}}}applyEdits(e){let n=0,r=!1,i=this.pendingContextChange;return e.changes.iterChanges((o,a,s,l,c)=>{if(r)return;let u=c.length-(a-o);if(i&&a>=i.to)if(i.from==o&&i.to==a&&i.insert.eq(c)){i=this.pendingContextChange=null,n+=u,this.to+=u;return}else i=null,this.revertPending(e.state);if(o+=n,a+=n,a<=this.from)this.from+=u,this.to+=u;else if(o<this.to){if(o<this.from||a>this.to||this.to-this.from+c.length>3e4){r=!0;return}this.editContext.updateText(this.toContextPos(o),this.toContextPos(a),c.toString()),this.to+=u}n+=u}),i&&!r&&this.revertPending(e.state),!r}update(e){let n=this.pendingContextChange;!this.applyEdits(e)||!this.rangeIsValid(e.state)?(this.pendingContextChange=null,this.resetRange(e.state),this.editContext.updateText(0,this.editContext.text.length,e.state.doc.sliceString(this.from,this.to)),this.setSelection(e.state)):(e.docChanged||e.selectionSet||n)&&this.setSelection(e.state),(e.geometryChanged||e.docChanged||e.selectionSet)&&e.view.requestMeasure(this.measureReq)}resetRange(e){let{head:n}=e.selection.main;this.from=Math.max(0,n-1e4),this.to=Math.min(e.doc.length,n+1e4)}revertPending(e){let n=this.pendingContextChange;this.pendingContextChange=null,this.editContext.updateText(this.toContextPos(n.from),this.toContextPos(n.from+n.insert.length),e.doc.sliceString(n.from,n.to))}setSelection(e){let{main:n}=e.selection,r=this.toContextPos(Math.max(this.from,Math.min(this.to,n.anchor))),i=this.toContextPos(n.head);(this.editContext.selectionStart!=r||this.editContext.selectionEnd!=i)&&this.editContext.updateSelection(r,i)}rangeIsValid(e){let{head:n}=e.selection.main;return!(this.from>0&&n-this.from<500||this.to<e.doc.length&&this.to-n<500||this.to-this.from>1e4*3)}toEditorPos(e){return e+this.from}toContextPos(e){return e-this.from}destroy(){for(let e in this.handlers)this.editContext.removeEventListener(e,this.handlers[e])}}class rt{get state(){return this.viewState.state}get viewport(){return this.viewState.viewport}get visibleRanges(){return this.viewState.visibleRanges}get inView(){return this.viewState.inView}get composing(){return this.inputState.composing>0}get compositionStarted(){return this.inputState.composing>=0}get root(){return this._root}get win(){return this.dom.ownerDocument.defaultView||window}constructor(e={}){var n;this.plugins=[],this.pluginMap=new Map,this.editorAttrs={},this.contentAttrs={},this.bidiCache=[],this.destroyed=!1,this.updateState=2,this.measureScheduled=-1,this.measureRequests=[],this.contentDOM=document.createElement("div"),this.scrollDOM=document.createElement("div"),this.scrollDOM.tabIndex=-1,this.scrollDOM.className="cm-scroller",this.scrollDOM.appendChild(this.contentDOM),this.announceDOM=document.createElement("div"),this.announceDOM.className="cm-announced",this.announceDOM.setAttribute("aria-live","polite"),this.dom=document.createElement("div"),this.dom.appendChild(this.announceDOM),this.dom.appendChild(this.scrollDOM),e.parent&&e.parent.appendChild(this.dom);let{dispatch:r}=e;this.dispatchTransactions=e.dispatchTransactions||r&&(i=>i.forEach(o=>r(o,this)))||(i=>this.update(i)),this.dispatch=this.dispatch.bind(this),this._root=e.root||Qrt(e.parent)||document,this.viewState=new B7(e.state||en.create(e)),e.scrollTo&&e.scrollTo.is(XS)&&(this.viewState.scrollTarget=e.scrollTo.value.clip(this.viewState.state)),this.plugins=this.state.facet(px).map(i=>new $R(i));for(let i of this.plugins)i.update(this);this.observer=new uot(this),this.inputState=new Dit(this),this.inputState.ensureHandlers(this.plugins),this.docView=new _7(this),this.mountStyles(),this.updateAttrs(),this.updateState=0,this.requestMeasure(),!((n=document.fonts)===null||n===void 0)&&n.ready&&document.fonts.ready.then(()=>this.requestMeasure())}dispatch(...e){let n=e.length==1&&e[0]instanceof Ur?e:e.length==1&&Array.isArray(e[0])?e[0]:[this.state.update(...e)];this.dispatchTransactions(n,this)}update(e){if(this.updateState!=0)throw new Error("Calls to EditorView.update are not allowed while an update is in progress");let n=!1,r=!1,i,o=this.state;for(let d of e){if(d.startState!=o)throw new RangeError("Trying to update state with a transaction that doesn't start from the previous state.");o=d.state}if(this.destroyed){this.viewState.state=o;return}let a=this.hasFocus,s=0,l=null;e.some(d=>d.annotation(Pde))?(this.inputState.notifiedFocused=a,s=1):a!=this.inputState.notifiedFocused&&(this.inputState.notifiedFocused=a,l=Mde(o,a),l||(s=1));let c=this.observer.delayedAndroidKey,u=null;if(c?(this.observer.clearDelayedAndroidKey(),u=this.observer.readChange(),(u&&!this.state.doc.eq(o.doc)||!this.state.selection.eq(o.selection))&&(u=null)):this.observer.clear(),o.facet(en.phrases)!=this.state.facet(en.phrases))return this.setState(o);i=mE.create(this,o,e),i.flags|=s;let f=this.viewState.scrollTarget;try{this.updateState=2;for(let d of e){if(f&&(f=f.map(d.changes)),d.scrollIntoView){let{main:h}=d.state.selection;f=new Rg(h.empty?h:je.cursor(h.head,h.head>h.anchor?-1:1))}for(let h of d.effects)h.is(XS)&&(f=h.value.clip(this.state))}this.viewState.update(i,f),this.bidiCache=vE.update(this.bidiCache,i.changes),i.empty||(this.updatePlugins(i),this.inputState.update(i)),n=this.docView.update(i),this.state.facet(mx)!=this.styleModules&&this.mountStyles(),r=this.updateAttrs(),this.showAnnouncements(e),this.docView.updateSelection(n,e.some(d=>d.isUserEvent("select.pointer")))}finally{this.updateState=0}if(i.startState.facet(eO)!=i.state.facet(eO)&&(this.viewState.mustMeasureContent=!0),(n||r||f||this.viewState.mustEnforceCursorAssoc||this.viewState.mustMeasureContent)&&this.requestMeasure(),n&&this.docViewUpdate(),!i.empty)for(let d of this.state.facet(EN))try{d(i)}catch(h){Ao(this.state,h,"update listener")}(l||u)&&Promise.resolve().then(()=>{l&&this.state==l.startState&&this.dispatch(l),u&&!wde(this,u)&&c.force&&Ag(this.contentDOM,c.key,c.keyCode)})}setState(e){if(this.updateState!=0)throw new Error("Calls to EditorView.setState are not allowed while an update is in progress");if(this.destroyed){this.viewState.state=e;return}this.updateState=2;let n=this.hasFocus;try{for(let r of this.plugins)r.destroy(this);this.viewState=new B7(e),this.plugins=e.facet(px).map(r=>new $R(r)),this.pluginMap.clear();for(let r of this.plugins)r.update(this);this.docView.destroy(),this.docView=new _7(this),this.inputState.ensureHandlers(this.plugins),this.mountStyles(),this.updateAttrs(),this.bidiCache=[]}finally{this.updateState=0}n&&this.focus(),this.requestMeasure()}updatePlugins(e){let n=e.startState.facet(px),r=e.state.facet(px);if(n!=r){let i=[];for(let o of r){let a=n.indexOf(o);if(a<0)i.push(new $R(o));else{let s=this.plugins[a];s.mustUpdate=e,i.push(s)}}for(let o of this.plugins)o.mustUpdate!=e&&o.destroy(this);this.plugins=i,this.pluginMap.clear()}else for(let i of this.plugins)i.mustUpdate=e;for(let i=0;i<this.plugins.length;i++)this.plugins[i].update(this);n!=r&&this.inputState.ensureHandlers(this.plugins)}docViewUpdate(){for(let e of this.plugins){let n=e.value;if(n&&n.docViewUpdate)try{n.docViewUpdate(this)}catch(r){Ao(this.state,r,"doc view update listener")}}}measure(e=!0){if(this.destroyed)return;if(this.measureScheduled>-1&&this.win.cancelAnimationFrame(this.measureScheduled),this.observer.delayedAndroidKey){this.measureScheduled=-1,this.requestMeasure();return}this.measureScheduled=0,e&&this.observer.forceFlush();let n=null,r=this.scrollDOM,i=r.scrollTop*this.scaleY,{scrollAnchorPos:o,scrollAnchorHeight:a}=this.viewState;Math.abs(i-this.viewState.scrollTop)>1&&(a=-1),this.viewState.scrollAnchorHeight=-1;try{for(let s=0;;s++){if(a<0)if(Ufe(r))o=-1,a=this.viewState.heightMap.height;else{let h=this.viewState.scrollAnchorAt(i);o=h.from,a=h.top}this.updateState=1;let l=this.viewState.measure(this);if(!l&&!this.measureRequests.length&&this.viewState.scrollTarget==null)break;if(s>5){console.warn(this.measureRequests.length?"Measure loop restarted more than 5 times":"Viewport failed to stabilize");break}let c=[];l&4||([this.measureRequests,c]=[c,this.measureRequests]);let u=c.map(h=>{try{return h.read(this)}catch(p){return Ao(this.state,p),V7}}),f=mE.create(this,this.state,[]),d=!1;f.flags|=l,n?n.flags|=l:n=f,this.updateState=2,f.empty||(this.updatePlugins(f),this.inputState.update(f),this.updateAttrs(),d=this.docView.update(f),d&&this.docViewUpdate());for(let h=0;h<c.length;h++)if(u[h]!=V7)try{let p=c[h];p.write&&p.write(u[h],this)}catch(p){Ao(this.state,p)}if(d&&this.docView.updateSelection(!0),!f.viewportChanged&&this.measureRequests.length==0){if(this.viewState.editorHeight)if(this.viewState.scrollTarget){this.docView.scrollIntoView(this.viewState.scrollTarget),this.viewState.scrollTarget=null,a=-1;continue}else{let p=(o<0?this.viewState.heightMap.height:this.viewState.lineBlockAt(o).top)-a;if(p>1||p<-1){i=i+p,r.scrollTop=i/this.scaleY,a=-1;continue}}break}}}finally{this.updateState=0,this.measureScheduled=-1}if(n&&!n.empty)for(let s of this.state.facet(EN))s(n)}get themeClasses(){return RN+" "+(this.state.facet(AN)?Ide:Rde)+" "+this.state.facet(eO)}updateAttrs(){let e=G7(this,mde,{class:"cm-editor"+(this.hasFocus?" cm-focused ":" ")+this.themeClasses}),n={spellcheck:"false",autocorrect:"off",autocapitalize:"off",translate:"no",contenteditable:this.state.facet(pf)?"true":"false",class:"cm-content",style:`${ut.tabSize}: ${this.state.tabSize}`,role:"textbox","aria-multiline":"true"};this.state.readOnly&&(n["aria-readonly"]="true"),G7(this,C4,n);let r=this.observer.ignore(()=>{let i=_N(this.contentDOM,this.contentAttrs,n),o=_N(this.dom,this.editorAttrs,e);return i||o});return this.editorAttrs=e,this.contentAttrs=n,r}showAnnouncements(e){let n=!0;for(let r of e)for(let i of r.effects)if(i.is(rt.announce)){n&&(this.announceDOM.textContent=""),n=!1;let o=this.announceDOM.appendChild(document.createElement("div"));o.textContent=i.value}}mountStyles(){this.styleModules=this.state.facet(mx);let e=this.state.facet(rt.cspNonce);od.mount(this.root,this.styleModules.concat(lot).reverse(),e?{nonce:e}:void 0)}readMeasured(){if(this.updateState==2)throw new Error("Reading the editor layout isn't allowed during an update");this.updateState==0&&this.measureScheduled>-1&&this.measure(!1)}requestMeasure(e){if(this.measureScheduled<0&&(this.measureScheduled=this.win.requestAnimationFrame(()=>this.measure())),e){if(this.measureRequests.indexOf(e)>-1)return;if(e.key!=null){for(let n=0;n<this.measureRequests.length;n++)if(this.measureRequests[n].key===e.key){this.measureRequests[n]=e;return}}this.measureRequests.push(e)}}plugin(e){let n=this.pluginMap.get(e);return(n===void 0||n&&n.spec!=e)&&this.pluginMap.set(e,n=this.plugins.find(r=>r.spec==e)||null),n&&n.update(this).value}get documentTop(){return this.contentDOM.getBoundingClientRect().top+this.viewState.paddingTop}get documentPadding(){return{top:this.viewState.paddingTop,bottom:this.viewState.paddingBottom}}get scaleX(){return this.viewState.scaleX}get scaleY(){return this.viewState.scaleY}elementAtHeight(e){return this.readMeasured(),this.viewState.elementAtHeight(e)}lineBlockAtHeight(e){return this.readMeasured(),this.viewState.lineBlockAtHeight(e)}get viewportLineBlocks(){return this.viewState.viewportLines}lineBlockAt(e){return this.viewState.lineBlockAt(e)}get contentHeight(){return this.viewState.contentHeight}moveByChar(e,n,r){return jR(this,e,T7(this,e,n,r))}moveByGroup(e,n){return jR(this,e,T7(this,e,n,r=>Cit(this,e.head,r)))}visualLineSide(e,n){let r=this.bidiSpans(e),i=this.textDirectionAt(e.from),o=r[n?r.length-1:0];return je.cursor(o.side(n,i)+e.from,o.forward(!n,i)?1:-1)}moveToLineBoundary(e,n,r=!0){return Oit(this,e,n,r)}moveVertically(e,n,r){return jR(this,e,Tit(this,e,n,r))}domAtPos(e){return this.docView.domAtPos(e)}posAtDOM(e,n=0){return this.docView.posFromDOM(e,n)}posAtCoords(e,n=!0){return this.readMeasured(),_de(this,e,n)}coordsAtPos(e,n=1){this.readMeasured();let r=this.docView.coordsAt(e,n);if(!r||r.left==r.right)return r;let i=this.state.doc.lineAt(e),o=this.bidiSpans(i),a=o[Tf.find(o,e-i.from,-1,n)];return pw(r,a.dir==rr.LTR==n>0)}coordsForChar(e){return this.readMeasured(),this.docView.coordsForChar(e)}get defaultCharacterWidth(){return this.viewState.heightOracle.charWidth}get defaultLineHeight(){return this.viewState.heightOracle.lineHeight}get textDirection(){return this.viewState.defaultTextDirection}textDirectionAt(e){return!this.state.facet(fde)||e<this.viewport.from||e>this.viewport.to?this.textDirection:(this.readMeasured(),this.docView.textDirectionAt(e))}get lineWrapping(){return this.viewState.heightOracle.lineWrapping}bidiSpans(e){if(e.length>hot)return rde(e.length);let n=this.textDirectionAt(e.from),r;for(let o of this.bidiCache)if(o.from==e.from&&o.dir==n&&(o.fresh||nde(o.isolates,r=b7(this,e))))return o.order;r||(r=b7(this,e));let i=lit(e.text,n,r);return this.bidiCache.push(new vE(e.from,e.to,n,r,!0,i)),i}get hasFocus(){var e;return(this.dom.ownerDocument.hasFocus()||ut.safari&&((e=this.inputState)===null||e===void 0?void 0:e.lastContextMenu)>Date.now()-3e4)&&this.root.activeElement==this.contentDOM}focus(){this.observer.ignore(()=>{Bfe(this.contentDOM),this.docView.updateSelection()})}setRoot(e){this._root!=e&&(this._root=e,this.observer.setWindow((e.nodeType==9?e:e.ownerDocument).defaultView||window),this.mountStyles())}destroy(){this.root.activeElement==this.contentDOM&&this.contentDOM.blur();for(let e of this.plugins)e.destroy(this);this.plugins=[],this.inputState.destroy(),this.docView.destroy(),this.dom.remove(),this.observer.destroy(),this.measureScheduled>-1&&this.win.cancelAnimationFrame(this.measureScheduled),this.destroyed=!0}static scrollIntoView(e,n={}){return XS.of(new Rg(typeof e=="number"?je.cursor(e):e,n.y,n.x,n.yMargin,n.xMargin))}scrollSnapshot(){let{scrollTop:e,scrollLeft:n}=this.scrollDOM,r=this.viewState.scrollAnchorAt(e);return XS.of(new Rg(je.cursor(r.from),"start","start",r.top-e,n,!0))}setTabFocusMode(e){e==null?this.inputState.tabFocusMode=this.inputState.tabFocusMode<0?0:-1:typeof e=="boolean"?this.inputState.tabFocusMode=e?0:-1:this.inputState.tabFocusMode!=0&&(this.inputState.tabFocusMode=Date.now()+e)}static domEventHandlers(e){return kr.define(()=>({}),{eventHandlers:e})}static domEventObservers(e){return kr.define(()=>({}),{eventObservers:e})}static theme(e,n){let r=od.newName(),i=[eO.of(r),mx.of(IN(`.${r}`,e))];return n&&n.dark&&i.push(AN.of(!0)),i}static baseTheme(e){return Ed.lowest(mx.of(IN("."+RN,e,Dde)))}static findFromDOM(e){var n;let r=e.querySelector(".cm-content"),i=r&&Ln.get(r)||Ln.get(e);return((n=i==null?void 0:i.rootView)===null||n===void 0?void 0:n.view)||null}}rt.styleModule=mx;rt.inputHandler=cde;rt.scrollHandler=hde;rt.focusChangeEffect=ude;rt.perLineTextDirection=fde;rt.exceptionSink=lde;rt.updateListener=EN;rt.editable=pf;rt.mouseSelectionStyle=sde;rt.dragMovesSelection=ade;rt.clickAddsSelectionRange=ode;rt.decorations=o_;rt.outerDecorations=gde;rt.atomicRanges=T4;rt.bidiIsolatedRanges=vde;rt.scrollMargins=yde;rt.darkTheme=AN;rt.cspNonce=ct.define({combine:t=>t.length?t[0]:""});rt.contentAttributes=C4;rt.editorAttributes=mde;rt.lineWrapping=rt.contentAttributes.of({class:"cm-lineWrapping"});rt.announce=Rt.define();const hot=4096,V7={};class vE{constructor(e,n,r,i,o,a){this.from=e,this.to=n,this.dir=r,this.isolates=i,this.fresh=o,this.order=a}static update(e,n){if(n.empty&&!e.some(o=>o.fresh))return e;let r=[],i=e.length?e[e.length-1].dir:rr.LTR;for(let o=Math.max(0,e.length-10);o<e.length;o++){let a=e[o];a.dir==i&&!n.touchesRange(a.from,a.to)&&r.push(new vE(n.mapPos(a.from,1),n.mapPos(a.to,-1),a.dir,a.isolates,!1,a.order))}return r}}function G7(t,e,n){for(let r=t.state.facet(e),i=r.length-1;i>=0;i--){let o=r[i],a=typeof o=="function"?o(t):o;a&&bN(a,n)}return n}const pot=ut.mac?"mac":ut.windows?"win":ut.linux?"linux":"key";function mot(t,e){const n=t.split(/-(?!$)/);let r=n[n.length-1];r=="Space"&&(r=" ");let i,o,a,s;for(let l=0;l<n.length-1;++l){const c=n[l];if(/^(cmd|meta|m)$/i.test(c))s=!0;else if(/^a(lt)?$/i.test(c))i=!0;else if(/^(c|ctrl|control)$/i.test(c))o=!0;else if(/^s(hift)?$/i.test(c))a=!0;else if(/^mod$/i.test(c))e=="mac"?s=!0:o=!0;else throw new Error("Unrecognized modifier name: "+c)}return i&&(r="Alt-"+r),o&&(r="Ctrl-"+r),s&&(r="Meta-"+r),a&&(r="Shift-"+r),r}function tO(t,e,n){return e.altKey&&(t="Alt-"+t),e.ctrlKey&&(t="Ctrl-"+t),e.metaKey&&(t="Meta-"+t),n!==!1&&e.shiftKey&&(t="Shift-"+t),t}const got=Ed.default(rt.domEventHandlers({keydown(t,e){return Nde(Lde(e.state),t,e,"editor")}})),vw=ct.define({enables:got}),H7=new WeakMap;function Lde(t){let e=t.facet(vw),n=H7.get(e);return n||H7.set(e,n=xot(e.reduce((r,i)=>r.concat(i),[]))),n}function vot(t,e,n){return Nde(Lde(t.state),e,t,n)}let mf=null;const yot=4e3;function xot(t,e=pot){let n=Object.create(null),r=Object.create(null),i=(a,s)=>{let l=r[a];if(l==null)r[a]=s;else if(l!=s)throw new Error("Key binding "+a+" is used both as a regular binding and as a multi-stroke prefix")},o=(a,s,l,c,u)=>{var f,d;let h=n[a]||(n[a]=Object.create(null)),p=s.split(/ (?!$)/).map(v=>mot(v,e));for(let v=1;v<p.length;v++){let y=p.slice(0,v).join(" ");i(y,!0),h[y]||(h[y]={preventDefault:!0,stopPropagation:!1,run:[x=>{let b=mf={view:x,prefix:y,scope:a};return setTimeout(()=>{mf==b&&(mf=null)},yot),!0}]})}let m=p.join(" ");i(m,!1);let g=h[m]||(h[m]={preventDefault:!1,stopPropagation:!1,run:((d=(f=h._any)===null||f===void 0?void 0:f.run)===null||d===void 0?void 0:d.slice())||[]});l&&g.run.push(l),c&&(g.preventDefault=!0),u&&(g.stopPropagation=!0)};for(let a of t){let s=a.scope?a.scope.split(" "):["editor"];if(a.any)for(let c of s){let u=n[c]||(n[c]=Object.create(null));u._any||(u._any={preventDefault:!1,stopPropagation:!1,run:[]});let{any:f}=a;for(let d in u)u[d].run.push(h=>f(h,DN))}let l=a[e]||a.key;if(l)for(let c of s)o(c,l,a.run,a.preventDefault,a.stopPropagation),a.shift&&o(c,"Shift-"+l,a.shift,a.preventDefault,a.stopPropagation)}return n}let DN=null;function Nde(t,e,n,r){DN=e;let i=Wrt(e),o=Ci(i,0),a=Ha(o)==i.length&&i!=" ",s="",l=!1,c=!1,u=!1;mf&&mf.view==n&&mf.scope==r&&(s=mf.prefix+" ",Ode.indexOf(e.keyCode)<0&&(c=!0,mf=null));let f=new Set,d=g=>{if(g){for(let v of g.run)if(!f.has(v)&&(f.add(v),v(n)))return g.stopPropagation&&(u=!0),!0;g.preventDefault&&(g.stopPropagation&&(u=!0),c=!0)}return!1},h=t[r],p,m;return h&&(d(h[s+tO(i,e,!a)])?l=!0:a&&(e.altKey||e.metaKey||e.ctrlKey)&&!(ut.windows&&e.ctrlKey&&e.altKey)&&(p=ad[e.keyCode])&&p!=i?(d(h[s+tO(p,e,!0)])||e.shiftKey&&(m=r_[e.keyCode])!=i&&m!=p&&d(h[s+tO(m,e,!1)]))&&(l=!0):a&&e.shiftKey&&d(h[s+tO(i,e,!0)])&&(l=!0),!l&&d(h._any)&&(l=!0)),c&&(l=!0),l&&u&&e.stopPropagation(),DN=null,l}class yw{constructor(e,n,r,i,o){this.className=e,this.left=n,this.top=r,this.width=i,this.height=o}draw(){let e=document.createElement("div");return e.className=this.className,this.adjust(e),e}update(e,n){return n.className!=this.className?!1:(this.adjust(e),!0)}adjust(e){e.style.left=this.left+"px",e.style.top=this.top+"px",this.width!=null&&(e.style.width=this.width+"px"),e.style.height=this.height+"px"}eq(e){return this.left==e.left&&this.top==e.top&&this.width==e.width&&this.height==e.height&&this.className==e.className}static forRange(e,n,r){if(r.empty){let i=e.coordsAtPos(r.head,r.assoc||1);if(!i)return[];let o=$de(e);return[new yw(n,i.left-o.left,i.top-o.top,null,i.bottom-i.top)]}else return bot(e,n,r)}}function $de(t){let e=t.scrollDOM.getBoundingClientRect();return{left:(t.textDirection==rr.LTR?e.left:e.right-t.scrollDOM.clientWidth*t.scaleX)-t.scrollDOM.scrollLeft*t.scaleX,top:e.top-t.scrollDOM.scrollTop*t.scaleY}}function q7(t,e,n,r){let i=t.coordsAtPos(e,n*2);if(!i)return r;let o=t.dom.getBoundingClientRect(),a=(i.top+i.bottom)/2,s=t.posAtCoords({x:o.left+1,y:a}),l=t.posAtCoords({x:o.right-1,y:a});return s==null||l==null?r:{from:Math.max(r.from,Math.min(s,l)),to:Math.min(r.to,Math.max(s,l))}}function bot(t,e,n){if(n.to<=t.viewport.from||n.from>=t.viewport.to)return[];let r=Math.max(n.from,t.viewport.from),i=Math.min(n.to,t.viewport.to),o=t.textDirection==rr.LTR,a=t.contentDOM,s=a.getBoundingClientRect(),l=$de(t),c=a.querySelector(".cm-line"),u=c&&window.getComputedStyle(c),f=s.left+(u?parseInt(u.paddingLeft)+Math.min(0,parseInt(u.textIndent)):0),d=s.right-(u?parseInt(u.paddingRight):0),h=MN(t,r),p=MN(t,i),m=h.type==uo.Text?h:null,g=p.type==uo.Text?p:null;if(m&&(t.lineWrapping||h.widgetLineBreaks)&&(m=q7(t,r,1,m)),g&&(t.lineWrapping||p.widgetLineBreaks)&&(g=q7(t,i,-1,g)),m&&g&&m.from==g.from&&m.to==g.to)return y(x(n.from,n.to,m));{let _=m?x(n.from,null,m):b(h,!1),S=g?x(null,n.to,g):b(p,!0),O=[];return(m||h).to<(g||p).from-(m&&g?1:0)||h.widgetLineBreaks>1&&_.bottom+t.defaultLineHeight/2<S.top?O.push(v(f,_.bottom,d,S.top)):_.bottom<S.top&&t.elementAtHeight((_.bottom+S.top)/2).type==uo.Text&&(_.bottom=S.top=(_.bottom+S.top)/2),y(_).concat(O).concat(y(S))}function v(_,S,O,C){return new yw(e,_-l.left,S-l.top-.01,O-_,C-S+.01)}function y({top:_,bottom:S,horizontal:O}){let C=[];for(let E=0;E<O.length;E+=2)C.push(v(O[E],_,O[E+1],S));return C}function x(_,S,O){let C=1e9,E=-1e9,k=[];function I(T,L,z,B,U){let W=t.coordsAtPos(T,T==O.to?-2:2),$=t.coordsAtPos(z,z==O.from?2:-2);!W||!$||(C=Math.min(W.top,$.top,C),E=Math.max(W.bottom,$.bottom,E),U==rr.LTR?k.push(o&&L?f:W.left,o&&B?d:$.right):k.push(!o&&B?f:$.left,!o&&L?d:W.right))}let P=_??O.from,R=S??O.to;for(let T of t.visibleRanges)if(T.to>P&&T.from<R)for(let L=Math.max(T.from,P),z=Math.min(T.to,R);;){let B=t.state.doc.lineAt(L);for(let U of t.bidiSpans(B)){let W=U.from+B.from,$=U.to+B.from;if(W>=z)break;$>L&&I(Math.max(W,L),_==null&&W<=P,Math.min($,z),S==null&&$>=R,U.dir)}if(L=B.to+1,L>=z)break}return k.length==0&&I(P,_==null,R,S==null,t.textDirection),{top:C,bottom:E,horizontal:k}}function b(_,S){let O=s.top+(S?_.top:_.bottom);return{top:O,bottom:O,horizontal:[]}}}function _ot(t,e){return t.constructor==e.constructor&&t.eq(e)}class wot{constructor(e,n){this.view=e,this.layer=n,this.drawn=[],this.scaleX=1,this.scaleY=1,this.measureReq={read:this.measure.bind(this),write:this.draw.bind(this)},this.dom=e.scrollDOM.appendChild(document.createElement("div")),this.dom.classList.add("cm-layer"),n.above&&this.dom.classList.add("cm-layer-above"),n.class&&this.dom.classList.add(n.class),this.scale(),this.dom.setAttribute("aria-hidden","true"),this.setOrder(e.state),e.requestMeasure(this.measureReq),n.mount&&n.mount(this.dom,e)}update(e){e.startState.facet(UC)!=e.state.facet(UC)&&this.setOrder(e.state),(this.layer.update(e,this.dom)||e.geometryChanged)&&(this.scale(),e.view.requestMeasure(this.measureReq))}docViewUpdate(e){this.layer.updateOnDocViewUpdate!==!1&&e.requestMeasure(this.measureReq)}setOrder(e){let n=0,r=e.facet(UC);for(;n<r.length&&r[n]!=this.layer;)n++;this.dom.style.zIndex=String((this.layer.above?150:-1)-n)}measure(){return this.layer.markers(this.view)}scale(){let{scaleX:e,scaleY:n}=this.view;(e!=this.scaleX||n!=this.scaleY)&&(this.scaleX=e,this.scaleY=n,this.dom.style.transform=`scale(${1/e}, ${1/n})`)}draw(e){if(e.length!=this.drawn.length||e.some((n,r)=>!_ot(n,this.drawn[r]))){let n=this.dom.firstChild,r=0;for(let i of e)i.update&&n&&i.constructor&&this.drawn[r].constructor&&i.update(n,this.drawn[r])?(n=n.nextSibling,r++):this.dom.insertBefore(i.draw(),n);for(;n;){let i=n.nextSibling;n.remove(),n=i}this.drawn=e}}destroy(){this.layer.destroy&&this.layer.destroy(this.dom,this.view),this.dom.remove()}}const UC=ct.define();function Fde(t){return[kr.define(e=>new wot(e,t)),UC.of(t)]}const jde=!ut.ios,a_=ct.define({combine(t){return cc(t,{cursorBlinkRate:1200,drawRangeCursor:!0},{cursorBlinkRate:(e,n)=>Math.min(e,n),drawRangeCursor:(e,n)=>e||n})}});function Sot(t={}){return[a_.of(t),Oot,Cot,Tot,dde.of(!0)]}function Bde(t){return t.startState.facet(a_)!=t.state.facet(a_)}const Oot=Fde({above:!0,markers(t){let{state:e}=t,n=e.facet(a_),r=[];for(let i of e.selection.ranges){let o=i==e.selection.main;if(i.empty?!o||jde:n.drawRangeCursor){let a=o?"cm-cursor cm-cursor-primary":"cm-cursor cm-cursor-secondary",s=i.empty?i:je.cursor(i.head,i.head>i.anchor?-1:1);for(let l of yw.forRange(t,a,s))r.push(l)}}return r},update(t,e){t.transactions.some(r=>r.selection)&&(e.style.animationName=e.style.animationName=="cm-blink"?"cm-blink2":"cm-blink");let n=Bde(t);return n&&X7(t.state,e),t.docChanged||t.selectionSet||n},mount(t,e){X7(e.state,t)},class:"cm-cursorLayer"});function X7(t,e){e.style.animationDuration=t.facet(a_).cursorBlinkRate+"ms"}const Cot=Fde({above:!1,markers(t){return t.state.selection.ranges.map(e=>e.empty?[]:yw.forRange(t,"cm-selectionBackground",e)).reduce((e,n)=>e.concat(n))},update(t,e){return t.docChanged||t.selectionSet||t.viewportChanged||Bde(t)},class:"cm-selectionLayer"}),LN={".cm-line":{"& ::selection, &::selection":{backgroundColor:"transparent !important"}},".cm-content":{"& :focus":{caretColor:"initial !important","&::selection, & ::selection":{backgroundColor:"Highlight !important"}}}};jde&&(LN[".cm-line"].caretColor=LN[".cm-content"].caretColor="transparent !important");const Tot=Ed.highest(rt.theme(LN)),zde=Rt.define({map(t,e){return t==null?null:e.mapPos(t)}}),yx=mi.define({create(){return null},update(t,e){return t!=null&&(t=e.changes.mapPos(t)),e.effects.reduce((n,r)=>r.is(zde)?r.value:n,t)}}),Eot=kr.fromClass(class{constructor(t){this.view=t,this.cursor=null,this.measureReq={read:this.readPos.bind(this),write:this.drawCursor.bind(this)}}update(t){var e;let n=t.state.field(yx);n==null?this.cursor!=null&&((e=this.cursor)===null||e===void 0||e.remove(),this.cursor=null):(this.cursor||(this.cursor=this.view.scrollDOM.appendChild(document.createElement("div")),this.cursor.className="cm-dropCursor"),(t.startState.field(yx)!=n||t.docChanged||t.geometryChanged)&&this.view.requestMeasure(this.measureReq))}readPos(){let{view:t}=this,e=t.state.field(yx),n=e!=null&&t.coordsAtPos(e);if(!n)return null;let r=t.scrollDOM.getBoundingClientRect();return{left:n.left-r.left+t.scrollDOM.scrollLeft*t.scaleX,top:n.top-r.top+t.scrollDOM.scrollTop*t.scaleY,height:n.bottom-n.top}}drawCursor(t){if(this.cursor){let{scaleX:e,scaleY:n}=this.view;t?(this.cursor.style.left=t.left/e+"px",this.cursor.style.top=t.top/n+"px",this.cursor.style.height=t.height/n+"px"):this.cursor.style.left="-100000px"}}destroy(){this.cursor&&this.cursor.remove()}setDropPos(t){this.view.state.field(yx)!=t&&this.view.dispatch({effects:zde.of(t)})}},{eventObservers:{dragover(t){this.setDropPos(this.view.posAtCoords({x:t.clientX,y:t.clientY}))},dragleave(t){(t.target==this.view.contentDOM||!this.view.contentDOM.contains(t.relatedTarget))&&this.setDropPos(null)},dragend(){this.setDropPos(null)},drop(){this.setDropPos(null)}}});function Pot(){return[yx,Eot]}function Q7(t,e,n,r,i){e.lastIndex=0;for(let o=t.iterRange(n,r),a=n,s;!o.next().done;a+=o.value.length)if(!o.lineBreak)for(;s=e.exec(o.value);)i(a+s.index,s)}function Mot(t,e){let n=t.visibleRanges;if(n.length==1&&n[0].from==t.viewport.from&&n[0].to==t.viewport.to)return n;let r=[];for(let{from:i,to:o}of n)i=Math.max(t.state.doc.lineAt(i).from,i-e),o=Math.min(t.state.doc.lineAt(o).to,o+e),r.length&&r[r.length-1].to>=i?r[r.length-1].to=o:r.push({from:i,to:o});return r}class kot{constructor(e){const{regexp:n,decoration:r,decorate:i,boundary:o,maxLength:a=1e3}=e;if(!n.global)throw new RangeError("The regular expression given to MatchDecorator should have its 'g' flag set");if(this.regexp=n,i)this.addMatch=(s,l,c,u)=>i(u,c,c+s[0].length,s,l);else if(typeof r=="function")this.addMatch=(s,l,c,u)=>{let f=r(s,l,c);f&&u(c,c+s[0].length,f)};else if(r)this.addMatch=(s,l,c,u)=>u(c,c+s[0].length,r);else throw new RangeError("Either 'decorate' or 'decoration' should be provided to MatchDecorator");this.boundary=o,this.maxLength=a}createDeco(e){let n=new id,r=n.add.bind(n);for(let{from:i,to:o}of Mot(e,this.maxLength))Q7(e.state.doc,this.regexp,i,o,(a,s)=>this.addMatch(s,e,a,r));return n.finish()}updateDeco(e,n){let r=1e9,i=-1;return e.docChanged&&e.changes.iterChanges((o,a,s,l)=>{l>e.view.viewport.from&&s<e.view.viewport.to&&(r=Math.min(s,r),i=Math.max(l,i))}),e.viewportChanged||i-r>1e3?this.createDeco(e.view):i>-1?this.updateRange(e.view,n.map(e.changes),r,i):n}updateRange(e,n,r,i){for(let o of e.visibleRanges){let a=Math.max(o.from,r),s=Math.min(o.to,i);if(s>a){let l=e.state.doc.lineAt(a),c=l.to<s?e.state.doc.lineAt(s):l,u=Math.max(o.from,l.from),f=Math.min(o.to,c.to);if(this.boundary){for(;a>l.from;a--)if(this.boundary.test(l.text[a-1-l.from])){u=a;break}for(;s<c.to;s++)if(this.boundary.test(c.text[s-c.from])){f=s;break}}let d=[],h,p=(m,g,v)=>d.push(v.range(m,g));if(l==c)for(this.regexp.lastIndex=u-l.from;(h=this.regexp.exec(l.text))&&h.index<f-l.from;)this.addMatch(h,e,h.index+l.from,p);else Q7(e.state.doc,this.regexp,u,f,(m,g)=>this.addMatch(g,e,m,p));n=n.update({filterFrom:u,filterTo:f,filter:(m,g)=>m<u||g>f,add:d})}}return n}}const NN=/x/.unicode!=null?"gu":"g",Aot=new RegExp(`[\0-\b
--­؜​‎‏\u2028\u2029‭‮⁦⁧⁩\uFEFF￹-￼]`,NN),Rot={0:"null",7:"bell",8:"backspace",10:"newline",11:"vertical tab",13:"carriage return",27:"escape",8203:"zero width space",8204:"zero width non-joiner",8205:"zero width joiner",8206:"left-to-right mark",8207:"right-to-left mark",8232:"line separator",8237:"left-to-right override",8238:"right-to-left override",8294:"left-to-right isolate",8295:"right-to-left isolate",8297:"pop directional isolate",8233:"paragraph separator",65279:"zero width no-break space",65532:"object replacement"};let UR=null;function Iot(){var t;if(UR==null&&typeof document<"u"&&document.body){let e=document.body.style;UR=((t=e.tabSize)!==null&&t!==void 0?t:e.MozTabSize)!=null}return UR||!1}const WC=ct.define({combine(t){let e=cc(t,{render:null,specialChars:Aot,addSpecialChars:null});return(e.replaceTabs=!Iot())&&(e.specialChars=new RegExp("	|"+e.specialChars.source,NN)),e.addSpecialChars&&(e.specialChars=new RegExp(e.specialChars.source+"|"+e.addSpecialChars.source,NN)),e}});function Dot(t={}){return[WC.of(t),Lot()]}let Y7=null;function Lot(){return Y7||(Y7=kr.fromClass(class{constructor(t){this.view=t,this.decorations=gt.none,this.decorationCache=Object.create(null),this.decorator=this.makeDecorator(t.state.facet(WC)),this.decorations=this.decorator.createDeco(t)}makeDecorator(t){return new kot({regexp:t.specialChars,decoration:(e,n,r)=>{let{doc:i}=n.state,o=Ci(e[0],0);if(o==9){let a=i.lineAt(r),s=n.state.tabSize,l=My(a.text,s,r-a.from);return gt.replace({widget:new jot((s-l%s)*this.view.defaultCharacterWidth/this.view.scaleX)})}return this.decorationCache[o]||(this.decorationCache[o]=gt.replace({widget:new Fot(t,o)}))},boundary:t.replaceTabs?void 0:/[^]/})}update(t){let e=t.state.facet(WC);t.startState.facet(WC)!=e?(this.decorator=this.makeDecorator(e),this.decorations=this.decorator.createDeco(t.view)):this.decorations=this.decorator.updateDeco(t,this.decorations)}},{decorations:t=>t.decorations}))}const Not="•";function $ot(t){return t>=32?Not:t==10?"␤":String.fromCharCode(9216+t)}class Fot extends uc{constructor(e,n){super(),this.options=e,this.code=n}eq(e){return e.code==this.code}toDOM(e){let n=$ot(this.code),r=e.state.phrase("Control character")+" "+(Rot[this.code]||"0x"+this.code.toString(16)),i=this.options.render&&this.options.render(this.code,r,n);if(i)return i;let o=document.createElement("span");return o.textContent=n,o.title=r,o.setAttribute("aria-label",r),o.className="cm-specialChar",o}ignoreEvent(){return!1}}class jot extends uc{constructor(e){super(),this.width=e}eq(e){return e.width==this.width}toDOM(){let e=document.createElement("span");return e.textContent="	",e.className="cm-tab",e.style.width=this.width+"px",e}ignoreEvent(){return!1}}function Bot(){return Uot}const zot=gt.line({class:"cm-activeLine"}),Uot=kr.fromClass(class{constructor(t){this.decorations=this.getDeco(t)}update(t){(t.docChanged||t.selectionSet)&&(this.decorations=this.getDeco(t.view))}getDeco(t){let e=-1,n=[];for(let r of t.state.selection.ranges){let i=t.lineBlockAt(r.head);i.from>e&&(n.push(zot.range(i.from)),e=i.from)}return gt.set(n)}},{decorations:t=>t.decorations});class Wot extends uc{constructor(e){super(),this.content=e}toDOM(){let e=document.createElement("span");return e.className="cm-placeholder",e.style.pointerEvents="none",e.appendChild(typeof this.content=="string"?document.createTextNode(this.content):this.content),typeof this.content=="string"?e.setAttribute("aria-label","placeholder "+this.content):e.setAttribute("aria-hidden","true"),e}coordsAt(e){let n=e.firstChild?cv(e.firstChild):[];if(!n.length)return null;let r=window.getComputedStyle(e.parentNode),i=pw(n[0],r.direction!="rtl"),o=parseInt(r.lineHeight);return i.bottom-i.top>o*1.5?{left:i.left,right:i.right,top:i.top,bottom:i.top+o}:i}ignoreEvent(){return!1}}function Vot(t){return kr.fromClass(class{constructor(e){this.view=e,this.placeholder=t?gt.set([gt.widget({widget:new Wot(t),side:1}).range(0)]):gt.none}get decorations(){return this.view.state.doc.length?gt.none:this.placeholder}},{decorations:e=>e.decorations})}const $N=2e3;function Got(t,e,n){let r=Math.min(e.line,n.line),i=Math.max(e.line,n.line),o=[];if(e.off>$N||n.off>$N||e.col<0||n.col<0){let a=Math.min(e.off,n.off),s=Math.max(e.off,n.off);for(let l=r;l<=i;l++){let c=t.doc.line(l);c.length<=s&&o.push(je.range(c.from+a,c.to+s))}}else{let a=Math.min(e.col,n.col),s=Math.max(e.col,n.col);for(let l=r;l<=i;l++){let c=t.doc.line(l),u=hN(c.text,a,t.tabSize,!0);if(u<0)o.push(je.cursor(c.to));else{let f=hN(c.text,s,t.tabSize);o.push(je.range(c.from+u,c.from+f))}}}return o}function Hot(t,e){let n=t.coordsAtPos(t.viewport.from);return n?Math.round(Math.abs((n.left-e)/t.defaultCharacterWidth)):-1}function K7(t,e){let n=t.posAtCoords({x:e.clientX,y:e.clientY},!1),r=t.state.doc.lineAt(n),i=n-r.from,o=i>$N?-1:i==r.length?Hot(t,e.clientX):My(r.text,t.state.tabSize,n-r.from);return{line:r.number,col:o,off:i}}function qot(t,e){let n=K7(t,e),r=t.state.selection;return n?{update(i){if(i.docChanged){let o=i.changes.mapPos(i.startState.doc.line(n.line).from),a=i.state.doc.lineAt(o);n={line:a.number,col:n.col,off:Math.min(n.off,a.length)},r=r.map(i.changes)}},get(i,o,a){let s=K7(t,i);if(!s)return r;let l=Got(t.state,n,s);return l.length?a?je.create(l.concat(r.ranges)):je.create(l):r}}:null}function Xot(t){let e=n=>n.altKey&&n.button==0;return rt.mouseSelectionStyle.of((n,r)=>e(r)?qot(n,r):null)}const Qot={Alt:[18,t=>!!t.altKey],Control:[17,t=>!!t.ctrlKey],Shift:[16,t=>!!t.shiftKey],Meta:[91,t=>!!t.metaKey]},Yot={style:"cursor: crosshair"};function Kot(t={}){let[e,n]=Qot[t.key||"Alt"],r=kr.fromClass(class{constructor(i){this.view=i,this.isDown=!1}set(i){this.isDown!=i&&(this.isDown=i,this.view.update([]))}},{eventObservers:{keydown(i){this.set(i.keyCode==e||n(i))},keyup(i){(i.keyCode==e||!n(i))&&this.set(!1)},mousemove(i){this.set(n(i))}}});return[r,rt.contentAttributes.of(i=>{var o;return!((o=i.plugin(r))===null||o===void 0)&&o.isDown?Yot:null})]}const I0="-10000px";class Ude{constructor(e,n,r,i){this.facet=n,this.createTooltipView=r,this.removeTooltipView=i,this.input=e.state.facet(n),this.tooltips=this.input.filter(a=>a);let o=null;this.tooltipViews=this.tooltips.map(a=>o=r(a,o))}update(e,n){var r;let i=e.state.facet(this.facet),o=i.filter(l=>l);if(i===this.input){for(let l of this.tooltipViews)l.update&&l.update(e);return!1}let a=[],s=n?[]:null;for(let l=0;l<o.length;l++){let c=o[l],u=-1;if(c){for(let f=0;f<this.tooltips.length;f++){let d=this.tooltips[f];d&&d.create==c.create&&(u=f)}if(u<0)a[l]=this.createTooltipView(c,l?a[l-1]:null),s&&(s[l]=!!c.above);else{let f=a[l]=this.tooltipViews[u];s&&(s[l]=n[u]),f.update&&f.update(e)}}}for(let l of this.tooltipViews)a.indexOf(l)<0&&(this.removeTooltipView(l),(r=l.destroy)===null||r===void 0||r.call(l));return n&&(s.forEach((l,c)=>n[c]=l),n.length=s.length),this.input=i,this.tooltips=o,this.tooltipViews=a,!0}}function Zot(t){let{win:e}=t;return{top:0,left:0,bottom:e.innerHeight,right:e.innerWidth}}const WR=ct.define({combine:t=>{var e,n,r;return{position:ut.ios?"absolute":((e=t.find(i=>i.position))===null||e===void 0?void 0:e.position)||"fixed",parent:((n=t.find(i=>i.parent))===null||n===void 0?void 0:n.parent)||null,tooltipSpace:((r=t.find(i=>i.tooltipSpace))===null||r===void 0?void 0:r.tooltipSpace)||Zot}}}),Z7=new WeakMap,k4=kr.fromClass(class{constructor(t){this.view=t,this.above=[],this.inView=!0,this.madeAbsolute=!1,this.lastTransaction=0,this.measureTimeout=-1;let e=t.state.facet(WR);this.position=e.position,this.parent=e.parent,this.classes=t.themeClasses,this.createContainer(),this.measureReq={read:this.readMeasure.bind(this),write:this.writeMeasure.bind(this),key:this},this.resizeObserver=typeof ResizeObserver=="function"?new ResizeObserver(()=>this.measureSoon()):null,this.manager=new Ude(t,A4,(n,r)=>this.createTooltip(n,r),n=>{this.resizeObserver&&this.resizeObserver.unobserve(n.dom),n.dom.remove()}),this.above=this.manager.tooltips.map(n=>!!n.above),this.intersectionObserver=typeof IntersectionObserver=="function"?new IntersectionObserver(n=>{Date.now()>this.lastTransaction-50&&n.length>0&&n[n.length-1].intersectionRatio<1&&this.measureSoon()},{threshold:[1]}):null,this.observeIntersection(),t.win.addEventListener("resize",this.measureSoon=this.measureSoon.bind(this)),this.maybeMeasure()}createContainer(){this.parent?(this.container=document.createElement("div"),this.container.style.position="relative",this.container.className=this.view.themeClasses,this.parent.appendChild(this.container)):this.container=this.view.dom}observeIntersection(){if(this.intersectionObserver){this.intersectionObserver.disconnect();for(let t of this.manager.tooltipViews)this.intersectionObserver.observe(t.dom)}}measureSoon(){this.measureTimeout<0&&(this.measureTimeout=setTimeout(()=>{this.measureTimeout=-1,this.maybeMeasure()},50))}update(t){t.transactions.length&&(this.lastTransaction=Date.now());let e=this.manager.update(t,this.above);e&&this.observeIntersection();let n=e||t.geometryChanged,r=t.state.facet(WR);if(r.position!=this.position&&!this.madeAbsolute){this.position=r.position;for(let i of this.manager.tooltipViews)i.dom.style.position=this.position;n=!0}if(r.parent!=this.parent){this.parent&&this.container.remove(),this.parent=r.parent,this.createContainer();for(let i of this.manager.tooltipViews)this.container.appendChild(i.dom);n=!0}else this.parent&&this.view.themeClasses!=this.classes&&(this.classes=this.container.className=this.view.themeClasses);n&&this.maybeMeasure()}createTooltip(t,e){let n=t.create(this.view),r=e?e.dom:null;if(n.dom.classList.add("cm-tooltip"),t.arrow&&!n.dom.querySelector(".cm-tooltip > .cm-tooltip-arrow")){let i=document.createElement("div");i.className="cm-tooltip-arrow",n.dom.appendChild(i)}return n.dom.style.position=this.position,n.dom.style.top=I0,n.dom.style.left="0px",this.container.insertBefore(n.dom,r),n.mount&&n.mount(this.view),this.resizeObserver&&this.resizeObserver.observe(n.dom),n}destroy(){var t,e,n;this.view.win.removeEventListener("resize",this.measureSoon);for(let r of this.manager.tooltipViews)r.dom.remove(),(t=r.destroy)===null||t===void 0||t.call(r);this.parent&&this.container.remove(),(e=this.resizeObserver)===null||e===void 0||e.disconnect(),(n=this.intersectionObserver)===null||n===void 0||n.disconnect(),clearTimeout(this.measureTimeout)}readMeasure(){let t=this.view.dom.getBoundingClientRect(),e=1,n=1,r=!1;if(this.position=="fixed"&&this.manager.tooltipViews.length){let{dom:i}=this.manager.tooltipViews[0];if(ut.gecko)r=i.offsetParent!=this.container.ownerDocument.body;else if(i.style.top==I0&&i.style.left=="0px"){let o=i.getBoundingClientRect();r=Math.abs(o.top+1e4)>1||Math.abs(o.left)>1}}if(r||this.position=="absolute")if(this.parent){let i=this.parent.getBoundingClientRect();i.width&&i.height&&(e=i.width/this.parent.offsetWidth,n=i.height/this.parent.offsetHeight)}else({scaleX:e,scaleY:n}=this.view.viewState);return{editor:t,parent:this.parent?this.container.getBoundingClientRect():t,pos:this.manager.tooltips.map((i,o)=>{let a=this.manager.tooltipViews[o];return a.getCoords?a.getCoords(i.pos):this.view.coordsAtPos(i.pos)}),size:this.manager.tooltipViews.map(({dom:i})=>i.getBoundingClientRect()),space:this.view.state.facet(WR).tooltipSpace(this.view),scaleX:e,scaleY:n,makeAbsolute:r}}writeMeasure(t){var e;if(t.makeAbsolute){this.madeAbsolute=!0,this.position="absolute";for(let s of this.manager.tooltipViews)s.dom.style.position="absolute"}let{editor:n,space:r,scaleX:i,scaleY:o}=t,a=[];for(let s=0;s<this.manager.tooltips.length;s++){let l=this.manager.tooltips[s],c=this.manager.tooltipViews[s],{dom:u}=c,f=t.pos[s],d=t.size[s];if(!f||f.bottom<=Math.max(n.top,r.top)||f.top>=Math.min(n.bottom,r.bottom)||f.right<Math.max(n.left,r.left)-.1||f.left>Math.min(n.right,r.right)+.1){u.style.top=I0;continue}let h=l.arrow?c.dom.querySelector(".cm-tooltip-arrow"):null,p=h?7:0,m=d.right-d.left,g=(e=Z7.get(c))!==null&&e!==void 0?e:d.bottom-d.top,v=c.offset||eat,y=this.view.textDirection==rr.LTR,x=d.width>r.right-r.left?y?r.left:r.right-d.width:y?Math.max(r.left,Math.min(f.left-(h?14:0)+v.x,r.right-m)):Math.min(Math.max(r.left,f.left-m+(h?14:0)-v.x),r.right-m),b=this.above[s];!l.strictSide&&(b?f.top-(d.bottom-d.top)-v.y<r.top:f.bottom+(d.bottom-d.top)+v.y>r.bottom)&&b==r.bottom-f.bottom>f.top-r.top&&(b=this.above[s]=!b);let _=(b?f.top-r.top:r.bottom-f.bottom)-p;if(_<g&&c.resize!==!1){if(_<this.view.defaultLineHeight){u.style.top=I0;continue}Z7.set(c,g),u.style.height=(g=_)/o+"px"}else u.style.height&&(u.style.height="");let S=b?f.top-g-p-v.y:f.bottom+p+v.y,O=x+m;if(c.overlap!==!0)for(let C of a)C.left<O&&C.right>x&&C.top<S+g&&C.bottom>S&&(S=b?C.top-g-2-p:C.bottom+p+2);if(this.position=="absolute"?(u.style.top=(S-t.parent.top)/o+"px",u.style.left=(x-t.parent.left)/i+"px"):(u.style.top=S/o+"px",u.style.left=x/i+"px"),h){let C=f.left+(y?v.x:-v.x)-(x+14-7);h.style.left=C/i+"px"}c.overlap!==!0&&a.push({left:x,top:S,right:O,bottom:S+g}),u.classList.toggle("cm-tooltip-above",b),u.classList.toggle("cm-tooltip-below",!b),c.positioned&&c.positioned(t.space)}}maybeMeasure(){if(this.manager.tooltips.length&&(this.view.inView&&this.view.requestMeasure(this.measureReq),this.inView!=this.view.inView&&(this.inView=this.view.inView,!this.inView)))for(let t of this.manager.tooltipViews)t.dom.style.top=I0}},{eventObservers:{scroll(){this.maybeMeasure()}}}),Jot=rt.baseTheme({".cm-tooltip":{zIndex:100,boxSizing:"border-box"},"&light .cm-tooltip":{border:"1px solid #bbb",backgroundColor:"#f5f5f5"},"&light .cm-tooltip-section:not(:first-child)":{borderTop:"1px solid #bbb"},"&dark .cm-tooltip":{backgroundColor:"#333338",color:"white"},".cm-tooltip-arrow":{height:"7px",width:`${7*2}px`,position:"absolute",zIndex:-1,overflow:"hidden","&:before, &:after":{content:"''",position:"absolute",width:0,height:0,borderLeft:"7px solid transparent",borderRight:"7px solid transparent"},".cm-tooltip-above &":{bottom:"-7px","&:before":{borderTop:"7px solid #bbb"},"&:after":{borderTop:"7px solid #f5f5f5",bottom:"1px"}},".cm-tooltip-below &":{top:"-7px","&:before":{borderBottom:"7px solid #bbb"},"&:after":{borderBottom:"7px solid #f5f5f5",top:"1px"}}},"&dark .cm-tooltip .cm-tooltip-arrow":{"&:before":{borderTopColor:"#333338",borderBottomColor:"#333338"},"&:after":{borderTopColor:"transparent",borderBottomColor:"transparent"}}}),eat={x:0,y:0},A4=ct.define({enables:[k4,Jot]}),yE=ct.define({combine:t=>t.reduce((e,n)=>e.concat(n),[])});class Y2{static create(e){return new Y2(e)}constructor(e){this.view=e,this.mounted=!1,this.dom=document.createElement("div"),this.dom.classList.add("cm-tooltip-hover"),this.manager=new Ude(e,yE,(n,r)=>this.createHostedView(n,r),n=>n.dom.remove())}createHostedView(e,n){let r=e.create(this.view);return r.dom.classList.add("cm-tooltip-section"),this.dom.insertBefore(r.dom,n?n.dom.nextSibling:this.dom.firstChild),this.mounted&&r.mount&&r.mount(this.view),r}mount(e){for(let n of this.manager.tooltipViews)n.mount&&n.mount(e);this.mounted=!0}positioned(e){for(let n of this.manager.tooltipViews)n.positioned&&n.positioned(e)}update(e){this.manager.update(e)}destroy(){var e;for(let n of this.manager.tooltipViews)(e=n.destroy)===null||e===void 0||e.call(n)}passProp(e){let n;for(let r of this.manager.tooltipViews){let i=r[e];if(i!==void 0){if(n===void 0)n=i;else if(n!==i)return}}return n}get offset(){return this.passProp("offset")}get getCoords(){return this.passProp("getCoords")}get overlap(){return this.passProp("overlap")}get resize(){return this.passProp("resize")}}const tat=A4.compute([yE],t=>{let e=t.facet(yE);return e.length===0?null:{pos:Math.min(...e.map(n=>n.pos)),end:Math.max(...e.map(n=>{var r;return(r=n.end)!==null&&r!==void 0?r:n.pos})),create:Y2.create,above:e[0].above,arrow:e.some(n=>n.arrow)}});class nat{constructor(e,n,r,i,o){this.view=e,this.source=n,this.field=r,this.setHover=i,this.hoverTime=o,this.hoverTimeout=-1,this.restartTimeout=-1,this.pending=null,this.lastMove={x:0,y:0,target:e.dom,time:0},this.checkHover=this.checkHover.bind(this),e.dom.addEventListener("mouseleave",this.mouseleave=this.mouseleave.bind(this)),e.dom.addEventListener("mousemove",this.mousemove=this.mousemove.bind(this))}update(){this.pending&&(this.pending=null,clearTimeout(this.restartTimeout),this.restartTimeout=setTimeout(()=>this.startHover(),20))}get active(){return this.view.state.field(this.field)}checkHover(){if(this.hoverTimeout=-1,this.active.length)return;let e=Date.now()-this.lastMove.time;e<this.hoverTime?this.hoverTimeout=setTimeout(this.checkHover,this.hoverTime-e):this.startHover()}startHover(){clearTimeout(this.restartTimeout);let{view:e,lastMove:n}=this,r=e.docView.nearest(n.target);if(!r)return;let i,o=1;if(r instanceof Cf)i=r.posAtStart;else{if(i=e.posAtCoords(n),i==null)return;let s=e.coordsAtPos(i);if(!s||n.y<s.top||n.y>s.bottom||n.x<s.left-e.defaultCharacterWidth||n.x>s.right+e.defaultCharacterWidth)return;let l=e.bidiSpans(e.state.doc.lineAt(i)).find(u=>u.from<=i&&u.to>=i),c=l&&l.dir==rr.RTL?-1:1;o=n.x<s.left?-c:c}let a=this.source(e,i,o);if(a!=null&&a.then){let s=this.pending={pos:i};a.then(l=>{this.pending==s&&(this.pending=null,l&&!(Array.isArray(l)&&!l.length)&&e.dispatch({effects:this.setHover.of(Array.isArray(l)?l:[l])}))},l=>Ao(e.state,l,"hover tooltip"))}else a&&!(Array.isArray(a)&&!a.length)&&e.dispatch({effects:this.setHover.of(Array.isArray(a)?a:[a])})}get tooltip(){let e=this.view.plugin(k4),n=e?e.manager.tooltips.findIndex(r=>r.create==Y2.create):-1;return n>-1?e.manager.tooltipViews[n]:null}mousemove(e){var n,r;this.lastMove={x:e.clientX,y:e.clientY,target:e.target,time:Date.now()},this.hoverTimeout<0&&(this.hoverTimeout=setTimeout(this.checkHover,this.hoverTime));let{active:i,tooltip:o}=this;if(i.length&&o&&!rat(o.dom,e)||this.pending){let{pos:a}=i[0]||this.pending,s=(r=(n=i[0])===null||n===void 0?void 0:n.end)!==null&&r!==void 0?r:a;(a==s?this.view.posAtCoords(this.lastMove)!=a:!iat(this.view,a,s,e.clientX,e.clientY))&&(this.view.dispatch({effects:this.setHover.of([])}),this.pending=null)}}mouseleave(e){clearTimeout(this.hoverTimeout),this.hoverTimeout=-1;let{active:n}=this;if(n.length){let{tooltip:r}=this;r&&r.dom.contains(e.relatedTarget)?this.watchTooltipLeave(r.dom):this.view.dispatch({effects:this.setHover.of([])})}}watchTooltipLeave(e){let n=r=>{e.removeEventListener("mouseleave",n),this.active.length&&!this.view.dom.contains(r.relatedTarget)&&this.view.dispatch({effects:this.setHover.of([])})};e.addEventListener("mouseleave",n)}destroy(){clearTimeout(this.hoverTimeout),this.view.dom.removeEventListener("mouseleave",this.mouseleave),this.view.dom.removeEventListener("mousemove",this.mousemove)}}const nO=4;function rat(t,e){let n=t.getBoundingClientRect();return e.clientX>=n.left-nO&&e.clientX<=n.right+nO&&e.clientY>=n.top-nO&&e.clientY<=n.bottom+nO}function iat(t,e,n,r,i,o){let a=t.scrollDOM.getBoundingClientRect(),s=t.documentTop+t.documentPadding.top+t.contentHeight;if(a.left>r||a.right<r||a.top>i||Math.min(a.bottom,s)<i)return!1;let l=t.posAtCoords({x:r,y:i},!1);return l>=e&&l<=n}function oat(t,e={}){let n=Rt.define(),r=mi.define({create(){return[]},update(i,o){if(i.length&&(e.hideOnChange&&(o.docChanged||o.selection)?i=[]:e.hideOn&&(i=i.filter(a=>!e.hideOn(o,a))),o.docChanged)){let a=[];for(let s of i){let l=o.changes.mapPos(s.pos,-1,Pi.TrackDel);if(l!=null){let c=Object.assign(Object.create(null),s);c.pos=l,c.end!=null&&(c.end=o.changes.mapPos(c.end)),a.push(c)}}i=a}for(let a of o.effects)a.is(n)&&(i=a.value),a.is(aat)&&(i=[]);return i},provide:i=>yE.from(i)});return{active:r,extension:[r,kr.define(i=>new nat(i,t,r,n,e.hoverTime||300)),tat]}}function Wde(t,e){let n=t.plugin(k4);if(!n)return null;let r=n.manager.tooltips.indexOf(e);return r<0?null:n.manager.tooltipViews[r]}const aat=Rt.define(),J7=ct.define({combine(t){let e,n;for(let r of t)e=e||r.topContainer,n=n||r.bottomContainer;return{topContainer:e,bottomContainer:n}}});function s_(t,e){let n=t.plugin(Vde),r=n?n.specs.indexOf(e):-1;return r>-1?n.panels[r]:null}const Vde=kr.fromClass(class{constructor(t){this.input=t.state.facet(l_),this.specs=this.input.filter(n=>n),this.panels=this.specs.map(n=>n(t));let e=t.state.facet(J7);this.top=new rO(t,!0,e.topContainer),this.bottom=new rO(t,!1,e.bottomContainer),this.top.sync(this.panels.filter(n=>n.top)),this.bottom.sync(this.panels.filter(n=>!n.top));for(let n of this.panels)n.dom.classList.add("cm-panel"),n.mount&&n.mount()}update(t){let e=t.state.facet(J7);this.top.container!=e.topContainer&&(this.top.sync([]),this.top=new rO(t.view,!0,e.topContainer)),this.bottom.container!=e.bottomContainer&&(this.bottom.sync([]),this.bottom=new rO(t.view,!1,e.bottomContainer)),this.top.syncClasses(),this.bottom.syncClasses();let n=t.state.facet(l_);if(n!=this.input){let r=n.filter(l=>l),i=[],o=[],a=[],s=[];for(let l of r){let c=this.specs.indexOf(l),u;c<0?(u=l(t.view),s.push(u)):(u=this.panels[c],u.update&&u.update(t)),i.push(u),(u.top?o:a).push(u)}this.specs=r,this.panels=i,this.top.sync(o),this.bottom.sync(a);for(let l of s)l.dom.classList.add("cm-panel"),l.mount&&l.mount()}else for(let r of this.panels)r.update&&r.update(t)}destroy(){this.top.sync([]),this.bottom.sync([])}},{provide:t=>rt.scrollMargins.of(e=>{let n=e.plugin(t);return n&&{top:n.top.scrollMargin(),bottom:n.bottom.scrollMargin()}})});class rO{constructor(e,n,r){this.view=e,this.top=n,this.container=r,this.dom=void 0,this.classes="",this.panels=[],this.syncClasses()}sync(e){for(let n of this.panels)n.destroy&&e.indexOf(n)<0&&n.destroy();this.panels=e,this.syncDOM()}syncDOM(){if(this.panels.length==0){this.dom&&(this.dom.remove(),this.dom=void 0);return}if(!this.dom){this.dom=document.createElement("div"),this.dom.className=this.top?"cm-panels cm-panels-top":"cm-panels cm-panels-bottom",this.dom.style[this.top?"top":"bottom"]="0";let n=this.container||this.view.dom;n.insertBefore(this.dom,this.top?n.firstChild:null)}let e=this.dom.firstChild;for(let n of this.panels)if(n.dom.parentNode==this.dom){for(;e!=n.dom;)e=eq(e);e=e.nextSibling}else this.dom.insertBefore(n.dom,e);for(;e;)e=eq(e)}scrollMargin(){return!this.dom||this.container?0:Math.max(0,this.top?this.dom.getBoundingClientRect().bottom-Math.max(0,this.view.scrollDOM.getBoundingClientRect().top):Math.min(innerHeight,this.view.scrollDOM.getBoundingClientRect().bottom)-this.dom.getBoundingClientRect().top)}syncClasses(){if(!(!this.container||this.classes==this.view.themeClasses)){for(let e of this.classes.split(" "))e&&this.container.classList.remove(e);for(let e of(this.classes=this.view.themeClasses).split(" "))e&&this.container.classList.add(e)}}}function eq(t){let e=t.nextSibling;return t.remove(),e}const l_=ct.define({enables:Vde});class gu extends sp{compare(e){return this==e||this.constructor==e.constructor&&this.eq(e)}eq(e){return!1}destroy(e){}}gu.prototype.elementClass="";gu.prototype.toDOM=void 0;gu.prototype.mapMode=Pi.TrackBefore;gu.prototype.startSide=gu.prototype.endSide=-1;gu.prototype.point=!0;const VC=ct.define(),sat=ct.define(),lat={class:"",renderEmptyElements:!1,elementStyle:"",markers:()=>sn.empty,lineMarker:()=>null,widgetMarker:()=>null,lineMarkerChange:null,initialSpacer:null,updateSpacer:null,domEventHandlers:{}},ib=ct.define();function cat(t){return[Gde(),ib.of(Object.assign(Object.assign({},lat),t))]}const tq=ct.define({combine:t=>t.some(e=>e)});function Gde(t){return[uat]}const uat=kr.fromClass(class{constructor(t){this.view=t,this.prevViewport=t.viewport,this.dom=document.createElement("div"),this.dom.className="cm-gutters",this.dom.setAttribute("aria-hidden","true"),this.dom.style.minHeight=this.view.contentHeight/this.view.scaleY+"px",this.gutters=t.state.facet(ib).map(e=>new rq(t,e));for(let e of this.gutters)this.dom.appendChild(e.dom);this.fixed=!t.state.facet(tq),this.fixed&&(this.dom.style.position="sticky"),this.syncGutters(!1),t.scrollDOM.insertBefore(this.dom,t.contentDOM)}update(t){if(this.updateGutters(t)){let e=this.prevViewport,n=t.view.viewport,r=Math.min(e.to,n.to)-Math.max(e.from,n.from);this.syncGutters(r<(n.to-n.from)*.8)}t.geometryChanged&&(this.dom.style.minHeight=this.view.contentHeight/this.view.scaleY+"px"),this.view.state.facet(tq)!=!this.fixed&&(this.fixed=!this.fixed,this.dom.style.position=this.fixed?"sticky":""),this.prevViewport=t.view.viewport}syncGutters(t){let e=this.dom.nextSibling;t&&this.dom.remove();let n=sn.iter(this.view.state.facet(VC),this.view.viewport.from),r=[],i=this.gutters.map(o=>new fat(o,this.view.viewport,-this.view.documentPadding.top));for(let o of this.view.viewportLineBlocks)if(r.length&&(r=[]),Array.isArray(o.type)){let a=!0;for(let s of o.type)if(s.type==uo.Text&&a){FN(n,r,s.from);for(let l of i)l.line(this.view,s,r);a=!1}else if(s.widget)for(let l of i)l.widget(this.view,s)}else if(o.type==uo.Text){FN(n,r,o.from);for(let a of i)a.line(this.view,o,r)}else if(o.widget)for(let a of i)a.widget(this.view,o);for(let o of i)o.finish();t&&this.view.scrollDOM.insertBefore(this.dom,e)}updateGutters(t){let e=t.startState.facet(ib),n=t.state.facet(ib),r=t.docChanged||t.heightChanged||t.viewportChanged||!sn.eq(t.startState.facet(VC),t.state.facet(VC),t.view.viewport.from,t.view.viewport.to);if(e==n)for(let i of this.gutters)i.update(t)&&(r=!0);else{r=!0;let i=[];for(let o of n){let a=e.indexOf(o);a<0?i.push(new rq(this.view,o)):(this.gutters[a].update(t),i.push(this.gutters[a]))}for(let o of this.gutters)o.dom.remove(),i.indexOf(o)<0&&o.destroy();for(let o of i)this.dom.appendChild(o.dom);this.gutters=i}return r}destroy(){for(let t of this.gutters)t.destroy();this.dom.remove()}},{provide:t=>rt.scrollMargins.of(e=>{let n=e.plugin(t);return!n||n.gutters.length==0||!n.fixed?null:e.textDirection==rr.LTR?{left:n.dom.offsetWidth*e.scaleX}:{right:n.dom.offsetWidth*e.scaleX}})});function nq(t){return Array.isArray(t)?t:[t]}function FN(t,e,n){for(;t.value&&t.from<=n;)t.from==n&&e.push(t.value),t.next()}class fat{constructor(e,n,r){this.gutter=e,this.height=r,this.i=0,this.cursor=sn.iter(e.markers,n.from)}addElement(e,n,r){let{gutter:i}=this,o=(n.top-this.height)/e.scaleY,a=n.height/e.scaleY;if(this.i==i.elements.length){let s=new Hde(e,a,o,r);i.elements.push(s),i.dom.appendChild(s.dom)}else i.elements[this.i].update(e,a,o,r);this.height=n.bottom,this.i++}line(e,n,r){let i=[];FN(this.cursor,i,n.from),r.length&&(i=i.concat(r));let o=this.gutter.config.lineMarker(e,n,i);o&&i.unshift(o);let a=this.gutter;i.length==0&&!a.config.renderEmptyElements||this.addElement(e,n,i)}widget(e,n){let r=this.gutter.config.widgetMarker(e,n.widget,n),i=r?[r]:null;for(let o of e.state.facet(sat)){let a=o(e,n.widget,n);a&&(i||(i=[])).push(a)}i&&this.addElement(e,n,i)}finish(){let e=this.gutter;for(;e.elements.length>this.i;){let n=e.elements.pop();e.dom.removeChild(n.dom),n.destroy()}}}class rq{constructor(e,n){this.view=e,this.config=n,this.elements=[],this.spacer=null,this.dom=document.createElement("div"),this.dom.className="cm-gutter"+(this.config.class?" "+this.config.class:"");for(let r in n.domEventHandlers)this.dom.addEventListener(r,i=>{let o=i.target,a;if(o!=this.dom&&this.dom.contains(o)){for(;o.parentNode!=this.dom;)o=o.parentNode;let l=o.getBoundingClientRect();a=(l.top+l.bottom)/2}else a=i.clientY;let s=e.lineBlockAtHeight(a-e.documentTop);n.domEventHandlers[r](e,s,i)&&i.preventDefault()});this.markers=nq(n.markers(e)),n.initialSpacer&&(this.spacer=new Hde(e,0,0,[n.initialSpacer(e)]),this.dom.appendChild(this.spacer.dom),this.spacer.dom.style.cssText+="visibility: hidden; pointer-events: none")}update(e){let n=this.markers;if(this.markers=nq(this.config.markers(e.view)),this.spacer&&this.config.updateSpacer){let i=this.config.updateSpacer(this.spacer.markers[0],e);i!=this.spacer.markers[0]&&this.spacer.update(e.view,0,0,[i])}let r=e.view.viewport;return!sn.eq(this.markers,n,r.from,r.to)||(this.config.lineMarkerChange?this.config.lineMarkerChange(e):!1)}destroy(){for(let e of this.elements)e.destroy()}}class Hde{constructor(e,n,r,i){this.height=-1,this.above=0,this.markers=[],this.dom=document.createElement("div"),this.dom.className="cm-gutterElement",this.update(e,n,r,i)}update(e,n,r,i){this.height!=n&&(this.height=n,this.dom.style.height=n+"px"),this.above!=r&&(this.dom.style.marginTop=(this.above=r)?r+"px":""),dat(this.markers,i)||this.setMarkers(e,i)}setMarkers(e,n){let r="cm-gutterElement",i=this.dom.firstChild;for(let o=0,a=0;;){let s=a,l=o<n.length?n[o++]:null,c=!1;if(l){let u=l.elementClass;u&&(r+=" "+u);for(let f=a;f<this.markers.length;f++)if(this.markers[f].compare(l)){s=f,c=!0;break}}else s=this.markers.length;for(;a<s;){let u=this.markers[a++];if(u.toDOM){u.destroy(i);let f=i.nextSibling;i.remove(),i=f}}if(!l)break;l.toDOM&&(c?i=i.nextSibling:this.dom.insertBefore(l.toDOM(e),i)),c&&a++}this.dom.className=r,this.markers=n}destroy(){this.setMarkers(null,[])}}function dat(t,e){if(t.length!=e.length)return!1;for(let n=0;n<t.length;n++)if(!t[n].compare(e[n]))return!1;return!0}const hat=ct.define(),pat=ct.define(),ig=ct.define({combine(t){return cc(t,{formatNumber:String,domEventHandlers:{}},{domEventHandlers(e,n){let r=Object.assign({},e);for(let i in n){let o=r[i],a=n[i];r[i]=o?(s,l,c)=>o(s,l,c)||a(s,l,c):a}return r}})}});class VR extends gu{constructor(e){super(),this.number=e}eq(e){return this.number==e.number}toDOM(){return document.createTextNode(this.number)}}function GR(t,e){return t.state.facet(ig).formatNumber(e,t.state)}const mat=ib.compute([ig],t=>({class:"cm-lineNumbers",renderEmptyElements:!1,markers(e){return e.state.facet(hat)},lineMarker(e,n,r){return r.some(i=>i.toDOM)?null:new VR(GR(e,e.state.doc.lineAt(n.from).number))},widgetMarker:(e,n,r)=>{for(let i of e.state.facet(pat)){let o=i(e,n,r);if(o)return o}return null},lineMarkerChange:e=>e.startState.facet(ig)!=e.state.facet(ig),initialSpacer(e){return new VR(GR(e,iq(e.state.doc.lines)))},updateSpacer(e,n){let r=GR(n.view,iq(n.view.state.doc.lines));return r==e.number?e:new VR(r)},domEventHandlers:t.facet(ig).domEventHandlers}));function gat(t={}){return[ig.of(t),Gde(),mat]}function iq(t){let e=9;for(;e<t;)e=e*10+9;return e}const vat=new class extends gu{constructor(){super(...arguments),this.elementClass="cm-activeLineGutter"}},yat=VC.compute(["selection"],t=>{let e=[],n=-1;for(let r of t.selection.ranges){let i=t.doc.lineAt(r.head).from;i>n&&(n=i,e.push(vat.range(i)))}return sn.of(e)});function xat(){return yat}const qde=1024;let bat=0;class HR{constructor(e,n){this.from=e,this.to=n}}class Vt{constructor(e={}){this.id=bat++,this.perNode=!!e.perNode,this.deserialize=e.deserialize||(()=>{throw new Error("This node type doesn't define a deserialize function")})}add(e){if(this.perNode)throw new RangeError("Can't add per-node props to node types");return typeof e!="function"&&(e=Vo.match(e)),n=>{let r=e(n);return r===void 0?null:[this,r]}}}Vt.closedBy=new Vt({deserialize:t=>t.split(" ")});Vt.openedBy=new Vt({deserialize:t=>t.split(" ")});Vt.group=new Vt({deserialize:t=>t.split(" ")});Vt.isolate=new Vt({deserialize:t=>{if(t&&t!="rtl"&&t!="ltr"&&t!="auto")throw new RangeError("Invalid value for isolate: "+t);return t||"auto"}});Vt.contextHash=new Vt({perNode:!0});Vt.lookAhead=new Vt({perNode:!0});Vt.mounted=new Vt({perNode:!0});class xE{constructor(e,n,r){this.tree=e,this.overlay=n,this.parser=r}static get(e){return e&&e.props&&e.props[Vt.mounted.id]}}const _at=Object.create(null);class Vo{constructor(e,n,r,i=0){this.name=e,this.props=n,this.id=r,this.flags=i}static define(e){let n=e.props&&e.props.length?Object.create(null):_at,r=(e.top?1:0)|(e.skipped?2:0)|(e.error?4:0)|(e.name==null?8:0),i=new Vo(e.name||"",n,e.id,r);if(e.props){for(let o of e.props)if(Array.isArray(o)||(o=o(i)),o){if(o[0].perNode)throw new RangeError("Can't store a per-node prop on a node type");n[o[0].id]=o[1]}}return i}prop(e){return this.props[e.id]}get isTop(){return(this.flags&1)>0}get isSkipped(){return(this.flags&2)>0}get isError(){return(this.flags&4)>0}get isAnonymous(){return(this.flags&8)>0}is(e){if(typeof e=="string"){if(this.name==e)return!0;let n=this.prop(Vt.group);return n?n.indexOf(e)>-1:!1}return this.id==e}static match(e){let n=Object.create(null);for(let r in e)for(let i of r.split(" "))n[i]=e[r];return r=>{for(let i=r.prop(Vt.group),o=-1;o<(i?i.length:0);o++){let a=n[o<0?r.name:i[o]];if(a)return a}}}}Vo.none=new Vo("",Object.create(null),0,8);class R4{constructor(e){this.types=e;for(let n=0;n<e.length;n++)if(e[n].id!=n)throw new RangeError("Node type ids should correspond to array positions when creating a node set")}extend(...e){let n=[];for(let r of this.types){let i=null;for(let o of e){let a=o(r);a&&(i||(i=Object.assign({},r.props)),i[a[0].id]=a[1])}n.push(i?new Vo(r.name,i,r.id,r.flags):r)}return new R4(n)}}const iO=new WeakMap,oq=new WeakMap;var Jr;(function(t){t[t.ExcludeBuffers=1]="ExcludeBuffers",t[t.IncludeAnonymous=2]="IncludeAnonymous",t[t.IgnoreMounts=4]="IgnoreMounts",t[t.IgnoreOverlays=8]="IgnoreOverlays"})(Jr||(Jr={}));class Wr{constructor(e,n,r,i,o){if(this.type=e,this.children=n,this.positions=r,this.length=i,this.props=null,o&&o.length){this.props=Object.create(null);for(let[a,s]of o)this.props[typeof a=="number"?a:a.id]=s}}toString(){let e=xE.get(this);if(e&&!e.overlay)return e.tree.toString();let n="";for(let r of this.children){let i=r.toString();i&&(n&&(n+=","),n+=i)}return this.type.name?(/\W/.test(this.type.name)&&!this.type.isError?JSON.stringify(this.type.name):this.type.name)+(n.length?"("+n+")":""):n}cursor(e=0){return new BN(this.topNode,e)}cursorAt(e,n=0,r=0){let i=iO.get(this)||this.topNode,o=new BN(i);return o.moveTo(e,n),iO.set(this,o._tree),o}get topNode(){return new jo(this,0,0,null)}resolve(e,n=0){let r=c_(iO.get(this)||this.topNode,e,n,!1);return iO.set(this,r),r}resolveInner(e,n=0){let r=c_(oq.get(this)||this.topNode,e,n,!0);return oq.set(this,r),r}resolveStack(e,n=0){return Oat(this,e,n)}iterate(e){let{enter:n,leave:r,from:i=0,to:o=this.length}=e,a=e.mode||0,s=(a&Jr.IncludeAnonymous)>0;for(let l=this.cursor(a|Jr.IncludeAnonymous);;){let c=!1;if(l.from<=o&&l.to>=i&&(!s&&l.type.isAnonymous||n(l)!==!1)){if(l.firstChild())continue;c=!0}for(;c&&r&&(s||!l.type.isAnonymous)&&r(l),!l.nextSibling();){if(!l.parent())return;c=!0}}}prop(e){return e.perNode?this.props?this.props[e.id]:void 0:this.type.prop(e)}get propValues(){let e=[];if(this.props)for(let n in this.props)e.push([+n,this.props[n]]);return e}balance(e={}){return this.children.length<=8?this:L4(Vo.none,this.children,this.positions,0,this.children.length,0,this.length,(n,r,i)=>new Wr(this.type,n,r,i,this.propValues),e.makeTree||((n,r,i)=>new Wr(Vo.none,n,r,i)))}static build(e){return Cat(e)}}Wr.empty=new Wr(Vo.none,[],[],0);class I4{constructor(e,n){this.buffer=e,this.index=n}get id(){return this.buffer[this.index-4]}get start(){return this.buffer[this.index-3]}get end(){return this.buffer[this.index-2]}get size(){return this.buffer[this.index-1]}get pos(){return this.index}next(){this.index-=4}fork(){return new I4(this.buffer,this.index)}}class ld{constructor(e,n,r){this.buffer=e,this.length=n,this.set=r}get type(){return Vo.none}toString(){let e=[];for(let n=0;n<this.buffer.length;)e.push(this.childString(n)),n=this.buffer[n+3];return e.join(",")}childString(e){let n=this.buffer[e],r=this.buffer[e+3],i=this.set.types[n],o=i.name;if(/\W/.test(o)&&!i.isError&&(o=JSON.stringify(o)),e+=4,r==e)return o;let a=[];for(;e<r;)a.push(this.childString(e)),e=this.buffer[e+3];return o+"("+a.join(",")+")"}findChild(e,n,r,i,o){let{buffer:a}=this,s=-1;for(let l=e;l!=n&&!(Xde(o,i,a[l+1],a[l+2])&&(s=l,r>0));l=a[l+3]);return s}slice(e,n,r){let i=this.buffer,o=new Uint16Array(n-e),a=0;for(let s=e,l=0;s<n;){o[l++]=i[s++],o[l++]=i[s++]-r;let c=o[l++]=i[s++]-r;o[l++]=i[s++]-e,a=Math.max(a,c)}return new ld(o,a,this.set)}}function Xde(t,e,n,r){switch(t){case-2:return n<e;case-1:return r>=e&&n<e;case 0:return n<e&&r>e;case 1:return n<=e&&r>e;case 2:return r>e;case 4:return!0}}function c_(t,e,n,r){for(var i;t.from==t.to||(n<1?t.from>=e:t.from>e)||(n>-1?t.to<=e:t.to<e);){let a=!r&&t instanceof jo&&t.index<0?null:t.parent;if(!a)return t;t=a}let o=r?0:Jr.IgnoreOverlays;if(r)for(let a=t,s=a.parent;s;a=s,s=a.parent)a instanceof jo&&a.index<0&&((i=s.enter(e,n,o))===null||i===void 0?void 0:i.from)!=a.from&&(t=s);for(;;){let a=t.enter(e,n,o);if(!a)return t;t=a}}class Qde{cursor(e=0){return new BN(this,e)}getChild(e,n=null,r=null){let i=aq(this,e,n,r);return i.length?i[0]:null}getChildren(e,n=null,r=null){return aq(this,e,n,r)}resolve(e,n=0){return c_(this,e,n,!1)}resolveInner(e,n=0){return c_(this,e,n,!0)}matchContext(e){return jN(this,e)}enterUnfinishedNodesBefore(e){let n=this.childBefore(e),r=this;for(;n;){let i=n.lastChild;if(!i||i.to!=n.to)break;i.type.isError&&i.from==i.to?(r=n,n=i.prevSibling):n=i}return r}get node(){return this}get next(){return this.parent}}class jo extends Qde{constructor(e,n,r,i){super(),this._tree=e,this.from=n,this.index=r,this._parent=i}get type(){return this._tree.type}get name(){return this._tree.type.name}get to(){return this.from+this._tree.length}nextChild(e,n,r,i,o=0){for(let a=this;;){for(let{children:s,positions:l}=a._tree,c=n>0?s.length:-1;e!=c;e+=n){let u=s[e],f=l[e]+a.from;if(Xde(i,r,f,f+u.length)){if(u instanceof ld){if(o&Jr.ExcludeBuffers)continue;let d=u.findChild(0,u.buffer.length,n,r-f,i);if(d>-1)return new Dl(new wat(a,u,e,f),null,d)}else if(o&Jr.IncludeAnonymous||!u.type.isAnonymous||D4(u)){let d;if(!(o&Jr.IgnoreMounts)&&(d=xE.get(u))&&!d.overlay)return new jo(d.tree,f,e,a);let h=new jo(u,f,e,a);return o&Jr.IncludeAnonymous||!h.type.isAnonymous?h:h.nextChild(n<0?u.children.length-1:0,n,r,i)}}}if(o&Jr.IncludeAnonymous||!a.type.isAnonymous||(a.index>=0?e=a.index+n:e=n<0?-1:a._parent._tree.children.length,a=a._parent,!a))return null}}get firstChild(){return this.nextChild(0,1,0,4)}get lastChild(){return this.nextChild(this._tree.children.length-1,-1,0,4)}childAfter(e){return this.nextChild(0,1,e,2)}childBefore(e){return this.nextChild(this._tree.children.length-1,-1,e,-2)}enter(e,n,r=0){let i;if(!(r&Jr.IgnoreOverlays)&&(i=xE.get(this._tree))&&i.overlay){let o=e-this.from;for(let{from:a,to:s}of i.overlay)if((n>0?a<=o:a<o)&&(n<0?s>=o:s>o))return new jo(i.tree,i.overlay[0].from+this.from,-1,this)}return this.nextChild(0,1,e,n,r)}nextSignificantParent(){let e=this;for(;e.type.isAnonymous&&e._parent;)e=e._parent;return e}get parent(){return this._parent?this._parent.nextSignificantParent():null}get nextSibling(){return this._parent&&this.index>=0?this._parent.nextChild(this.index+1,1,0,4):null}get prevSibling(){return this._parent&&this.index>=0?this._parent.nextChild(this.index-1,-1,0,4):null}get tree(){return this._tree}toTree(){return this._tree}toString(){return this._tree.toString()}}function aq(t,e,n,r){let i=t.cursor(),o=[];if(!i.firstChild())return o;if(n!=null){for(let a=!1;!a;)if(a=i.type.is(n),!i.nextSibling())return o}for(;;){if(r!=null&&i.type.is(r))return o;if(i.type.is(e)&&o.push(i.node),!i.nextSibling())return r==null?o:[]}}function jN(t,e,n=e.length-1){for(let r=t.parent;n>=0;r=r.parent){if(!r)return!1;if(!r.type.isAnonymous){if(e[n]&&e[n]!=r.name)return!1;n--}}return!0}class wat{constructor(e,n,r,i){this.parent=e,this.buffer=n,this.index=r,this.start=i}}class Dl extends Qde{get name(){return this.type.name}get from(){return this.context.start+this.context.buffer.buffer[this.index+1]}get to(){return this.context.start+this.context.buffer.buffer[this.index+2]}constructor(e,n,r){super(),this.context=e,this._parent=n,this.index=r,this.type=e.buffer.set.types[e.buffer.buffer[r]]}child(e,n,r){let{buffer:i}=this.context,o=i.findChild(this.index+4,i.buffer[this.index+3],e,n-this.context.start,r);return o<0?null:new Dl(this.context,this,o)}get firstChild(){return this.child(1,0,4)}get lastChild(){return this.child(-1,0,4)}childAfter(e){return this.child(1,e,2)}childBefore(e){return this.child(-1,e,-2)}enter(e,n,r=0){if(r&Jr.ExcludeBuffers)return null;let{buffer:i}=this.context,o=i.findChild(this.index+4,i.buffer[this.index+3],n>0?1:-1,e-this.context.start,n);return o<0?null:new Dl(this.context,this,o)}get parent(){return this._parent||this.context.parent.nextSignificantParent()}externalSibling(e){return this._parent?null:this.context.parent.nextChild(this.context.index+e,e,0,4)}get nextSibling(){let{buffer:e}=this.context,n=e.buffer[this.index+3];return n<(this._parent?e.buffer[this._parent.index+3]:e.buffer.length)?new Dl(this.context,this._parent,n):this.externalSibling(1)}get prevSibling(){let{buffer:e}=this.context,n=this._parent?this._parent.index+4:0;return this.index==n?this.externalSibling(-1):new Dl(this.context,this._parent,e.findChild(n,this.index,-1,0,4))}get tree(){return null}toTree(){let e=[],n=[],{buffer:r}=this.context,i=this.index+4,o=r.buffer[this.index+3];if(o>i){let a=r.buffer[this.index+1];e.push(r.slice(i,o,a)),n.push(0)}return new Wr(this.type,e,n,this.to-this.from)}toString(){return this.context.buffer.childString(this.index)}}function Yde(t){if(!t.length)return null;let e=0,n=t[0];for(let o=1;o<t.length;o++){let a=t[o];(a.from>n.from||a.to<n.to)&&(n=a,e=o)}let r=n instanceof jo&&n.index<0?null:n.parent,i=t.slice();return r?i[e]=r:i.splice(e,1),new Sat(i,n)}class Sat{constructor(e,n){this.heads=e,this.node=n}get next(){return Yde(this.heads)}}function Oat(t,e,n){let r=t.resolveInner(e,n),i=null;for(let o=r instanceof jo?r:r.context.parent;o;o=o.parent)if(o.index<0){let a=o.parent;(i||(i=[r])).push(a.resolve(e,n)),o=a}else{let a=xE.get(o.tree);if(a&&a.overlay&&a.overlay[0].from<=e&&a.overlay[a.overlay.length-1].to>=e){let s=new jo(a.tree,a.overlay[0].from+o.from,-1,o);(i||(i=[r])).push(c_(s,e,n,!1))}}return i?Yde(i):r}class BN{get name(){return this.type.name}constructor(e,n=0){if(this.mode=n,this.buffer=null,this.stack=[],this.index=0,this.bufferNode=null,e instanceof jo)this.yieldNode(e);else{this._tree=e.context.parent,this.buffer=e.context;for(let r=e._parent;r;r=r._parent)this.stack.unshift(r.index);this.bufferNode=e,this.yieldBuf(e.index)}}yieldNode(e){return e?(this._tree=e,this.type=e.type,this.from=e.from,this.to=e.to,!0):!1}yieldBuf(e,n){this.index=e;let{start:r,buffer:i}=this.buffer;return this.type=n||i.set.types[i.buffer[e]],this.from=r+i.buffer[e+1],this.to=r+i.buffer[e+2],!0}yield(e){return e?e instanceof jo?(this.buffer=null,this.yieldNode(e)):(this.buffer=e.context,this.yieldBuf(e.index,e.type)):!1}toString(){return this.buffer?this.buffer.buffer.childString(this.index):this._tree.toString()}enterChild(e,n,r){if(!this.buffer)return this.yield(this._tree.nextChild(e<0?this._tree._tree.children.length-1:0,e,n,r,this.mode));let{buffer:i}=this.buffer,o=i.findChild(this.index+4,i.buffer[this.index+3],e,n-this.buffer.start,r);return o<0?!1:(this.stack.push(this.index),this.yieldBuf(o))}firstChild(){return this.enterChild(1,0,4)}lastChild(){return this.enterChild(-1,0,4)}childAfter(e){return this.enterChild(1,e,2)}childBefore(e){return this.enterChild(-1,e,-2)}enter(e,n,r=this.mode){return this.buffer?r&Jr.ExcludeBuffers?!1:this.enterChild(1,e,n):this.yield(this._tree.enter(e,n,r))}parent(){if(!this.buffer)return this.yieldNode(this.mode&Jr.IncludeAnonymous?this._tree._parent:this._tree.parent);if(this.stack.length)return this.yieldBuf(this.stack.pop());let e=this.mode&Jr.IncludeAnonymous?this.buffer.parent:this.buffer.parent.nextSignificantParent();return this.buffer=null,this.yieldNode(e)}sibling(e){if(!this.buffer)return this._tree._parent?this.yield(this._tree.index<0?null:this._tree._parent.nextChild(this._tree.index+e,e,0,4,this.mode)):!1;let{buffer:n}=this.buffer,r=this.stack.length-1;if(e<0){let i=r<0?0:this.stack[r]+4;if(this.index!=i)return this.yieldBuf(n.findChild(i,this.index,-1,0,4))}else{let i=n.buffer[this.index+3];if(i<(r<0?n.buffer.length:n.buffer[this.stack[r]+3]))return this.yieldBuf(i)}return r<0?this.yield(this.buffer.parent.nextChild(this.buffer.index+e,e,0,4,this.mode)):!1}nextSibling(){return this.sibling(1)}prevSibling(){return this.sibling(-1)}atLastNode(e){let n,r,{buffer:i}=this;if(i){if(e>0){if(this.index<i.buffer.buffer.length)return!1}else for(let o=0;o<this.index;o++)if(i.buffer.buffer[o+3]<this.index)return!1;({index:n,parent:r}=i)}else({index:n,_parent:r}=this._tree);for(;r;{index:n,_parent:r}=r)if(n>-1)for(let o=n+e,a=e<0?-1:r._tree.children.length;o!=a;o+=e){let s=r._tree.children[o];if(this.mode&Jr.IncludeAnonymous||s instanceof ld||!s.type.isAnonymous||D4(s))return!1}return!0}move(e,n){if(n&&this.enterChild(e,0,4))return!0;for(;;){if(this.sibling(e))return!0;if(this.atLastNode(e)||!this.parent())return!1}}next(e=!0){return this.move(1,e)}prev(e=!0){return this.move(-1,e)}moveTo(e,n=0){for(;(this.from==this.to||(n<1?this.from>=e:this.from>e)||(n>-1?this.to<=e:this.to<e))&&this.parent(););for(;this.enterChild(1,e,n););return this}get node(){if(!this.buffer)return this._tree;let e=this.bufferNode,n=null,r=0;if(e&&e.context==this.buffer)e:for(let i=this.index,o=this.stack.length;o>=0;){for(let a=e;a;a=a._parent)if(a.index==i){if(i==this.index)return a;n=a,r=o+1;break e}i=this.stack[--o]}for(let i=r;i<this.stack.length;i++)n=new Dl(this.buffer,n,this.stack[i]);return this.bufferNode=new Dl(this.buffer,n,this.index)}get tree(){return this.buffer?null:this._tree._tree}iterate(e,n){for(let r=0;;){let i=!1;if(this.type.isAnonymous||e(this)!==!1){if(this.firstChild()){r++;continue}this.type.isAnonymous||(i=!0)}for(;i&&n&&n(this),i=this.type.isAnonymous,!this.nextSibling();){if(!r)return;this.parent(),r--,i=!0}}}matchContext(e){if(!this.buffer)return jN(this.node,e);let{buffer:n}=this.buffer,{types:r}=n.set;for(let i=e.length-1,o=this.stack.length-1;i>=0;o--){if(o<0)return jN(this.node,e,i);let a=r[n.buffer[this.stack[o]]];if(!a.isAnonymous){if(e[i]&&e[i]!=a.name)return!1;i--}}return!0}}function D4(t){return t.children.some(e=>e instanceof ld||!e.type.isAnonymous||D4(e))}function Cat(t){var e;let{buffer:n,nodeSet:r,maxBufferLength:i=qde,reused:o=[],minRepeatType:a=r.types.length}=t,s=Array.isArray(n)?new I4(n,n.length):n,l=r.types,c=0,u=0;function f(_,S,O,C,E,k){let{id:I,start:P,end:R,size:T}=s,L=u;for(;T<0;)if(s.next(),T==-1){let $=o[I];O.push($),C.push(P-_);return}else if(T==-3){c=I;return}else if(T==-4){u=I;return}else throw new RangeError(`Unrecognized record size: ${T}`);let z=l[I],B,U,W=P-_;if(R-P<=i&&(U=g(s.pos-S,E))){let $=new Uint16Array(U.size-U.skip),N=s.pos-U.size,D=$.length;for(;s.pos>N;)D=v(U.start,$,D);B=new ld($,R-U.start,r),W=U.start-_}else{let $=s.pos-T;s.next();let N=[],D=[],A=I>=a?I:-1,q=0,Y=R;for(;s.pos>$;)A>=0&&s.id==A&&s.size>=0?(s.end<=Y-i&&(p(N,D,P,q,s.end,Y,A,L),q=N.length,Y=s.end),s.next()):k>2500?d(P,$,N,D):f(P,$,N,D,A,k+1);if(A>=0&&q>0&&q<N.length&&p(N,D,P,q,P,Y,A,L),N.reverse(),D.reverse(),A>-1&&q>0){let K=h(z);B=L4(z,N,D,0,N.length,0,R-P,K,K)}else B=m(z,N,D,R-P,L-R)}O.push(B),C.push(W)}function d(_,S,O,C){let E=[],k=0,I=-1;for(;s.pos>S;){let{id:P,start:R,end:T,size:L}=s;if(L>4)s.next();else{if(I>-1&&R<I)break;I<0&&(I=T-i),E.push(P,R,T),k++,s.next()}}if(k){let P=new Uint16Array(k*4),R=E[E.length-2];for(let T=E.length-3,L=0;T>=0;T-=3)P[L++]=E[T],P[L++]=E[T+1]-R,P[L++]=E[T+2]-R,P[L++]=L;O.push(new ld(P,E[2]-R,r)),C.push(R-_)}}function h(_){return(S,O,C)=>{let E=0,k=S.length-1,I,P;if(k>=0&&(I=S[k])instanceof Wr){if(!k&&I.type==_&&I.length==C)return I;(P=I.prop(Vt.lookAhead))&&(E=O[k]+I.length+P)}return m(_,S,O,C,E)}}function p(_,S,O,C,E,k,I,P){let R=[],T=[];for(;_.length>C;)R.push(_.pop()),T.push(S.pop()+O-E);_.push(m(r.types[I],R,T,k-E,P-k)),S.push(E-O)}function m(_,S,O,C,E=0,k){if(c){let I=[Vt.contextHash,c];k=k?[I].concat(k):[I]}if(E>25){let I=[Vt.lookAhead,E];k=k?[I].concat(k):[I]}return new Wr(_,S,O,C,k)}function g(_,S){let O=s.fork(),C=0,E=0,k=0,I=O.end-i,P={size:0,start:0,skip:0};e:for(let R=O.pos-_;O.pos>R;){let T=O.size;if(O.id==S&&T>=0){P.size=C,P.start=E,P.skip=k,k+=4,C+=4,O.next();continue}let L=O.pos-T;if(T<0||L<R||O.start<I)break;let z=O.id>=a?4:0,B=O.start;for(O.next();O.pos>L;){if(O.size<0)if(O.size==-3)z+=4;else break e;else O.id>=a&&(z+=4);O.next()}E=B,C+=T,k+=z}return(S<0||C==_)&&(P.size=C,P.start=E,P.skip=k),P.size>4?P:void 0}function v(_,S,O){let{id:C,start:E,end:k,size:I}=s;if(s.next(),I>=0&&C<a){let P=O;if(I>4){let R=s.pos-(I-4);for(;s.pos>R;)O=v(_,S,O)}S[--O]=P,S[--O]=k-_,S[--O]=E-_,S[--O]=C}else I==-3?c=C:I==-4&&(u=C);return O}let y=[],x=[];for(;s.pos>0;)f(t.start||0,t.bufferStart||0,y,x,-1,0);let b=(e=t.length)!==null&&e!==void 0?e:y.length?x[0]+y[0].length:0;return new Wr(l[t.topID],y.reverse(),x.reverse(),b)}const sq=new WeakMap;function GC(t,e){if(!t.isAnonymous||e instanceof ld||e.type!=t)return 1;let n=sq.get(e);if(n==null){n=1;for(let r of e.children){if(r.type!=t||!(r instanceof Wr)){n=1;break}n+=GC(t,r)}sq.set(e,n)}return n}function L4(t,e,n,r,i,o,a,s,l){let c=0;for(let p=r;p<i;p++)c+=GC(t,e[p]);let u=Math.ceil(c*1.5/8),f=[],d=[];function h(p,m,g,v,y){for(let x=g;x<v;){let b=x,_=m[x],S=GC(t,p[x]);for(x++;x<v;x++){let O=GC(t,p[x]);if(S+O>=u)break;S+=O}if(x==b+1){if(S>u){let O=p[b];h(O.children,O.positions,0,O.children.length,m[b]+y);continue}f.push(p[b])}else{let O=m[x-1]+p[x-1].length-_;f.push(L4(t,p,m,b,x,_,O,null,l))}d.push(_+y-o)}}return h(e,n,r,i,0),(s||l)(f,d,a)}class Tat{constructor(){this.map=new WeakMap}setBuffer(e,n,r){let i=this.map.get(e);i||this.map.set(e,i=new Map),i.set(n,r)}getBuffer(e,n){let r=this.map.get(e);return r&&r.get(n)}set(e,n){e instanceof Dl?this.setBuffer(e.context.buffer,e.index,n):e instanceof jo&&this.map.set(e.tree,n)}get(e){return e instanceof Dl?this.getBuffer(e.context.buffer,e.index):e instanceof jo?this.map.get(e.tree):void 0}cursorSet(e,n){e.buffer?this.setBuffer(e.buffer.buffer,e.index,n):this.map.set(e.tree,n)}cursorGet(e){return e.buffer?this.getBuffer(e.buffer.buffer,e.index):this.map.get(e.tree)}}class Wh{constructor(e,n,r,i,o=!1,a=!1){this.from=e,this.to=n,this.tree=r,this.offset=i,this.open=(o?1:0)|(a?2:0)}get openStart(){return(this.open&1)>0}get openEnd(){return(this.open&2)>0}static addTree(e,n=[],r=!1){let i=[new Wh(0,e.length,e,0,!1,r)];for(let o of n)o.to>e.length&&i.push(o);return i}static applyChanges(e,n,r=128){if(!n.length)return e;let i=[],o=1,a=e.length?e[0]:null;for(let s=0,l=0,c=0;;s++){let u=s<n.length?n[s]:null,f=u?u.fromA:1e9;if(f-l>=r)for(;a&&a.from<f;){let d=a;if(l>=d.from||f<=d.to||c){let h=Math.max(d.from,l)-c,p=Math.min(d.to,f)-c;d=h>=p?null:new Wh(h,p,d.tree,d.offset+c,s>0,!!u)}if(d&&i.push(d),a.to>f)break;a=o<e.length?e[o++]:null}if(!u)break;l=u.toA,c=u.toA-u.toB}return i}}class Kde{startParse(e,n,r){return typeof e=="string"&&(e=new Eat(e)),r=r?r.length?r.map(i=>new HR(i.from,i.to)):[new HR(0,0)]:[new HR(0,e.length)],this.createParse(e,n||[],r)}parse(e,n,r){let i=this.startParse(e,n,r);for(;;){let o=i.advance();if(o)return o}}}class Eat{constructor(e){this.string=e}get length(){return this.string.length}chunk(e){return this.string.slice(e)}get lineChunks(){return!1}read(e,n){return this.string.slice(e,n)}}new Vt({perNode:!0});let Pat=0;class za{constructor(e,n,r,i){this.name=e,this.set=n,this.base=r,this.modified=i,this.id=Pat++}toString(){let{name:e}=this;for(let n of this.modified)n.name&&(e=`${n.name}(${e})`);return e}static define(e,n){let r=typeof e=="string"?e:"?";if(e instanceof za&&(n=e),n!=null&&n.base)throw new Error("Can not derive from a modified tag");let i=new za(r,[],null,[]);if(i.set.push(i),n)for(let o of n.set)i.set.push(o);return i}static defineModifier(e){let n=new bE(e);return r=>r.modified.indexOf(n)>-1?r:bE.get(r.base||r,r.modified.concat(n).sort((i,o)=>i.id-o.id))}}let Mat=0;class bE{constructor(e){this.name=e,this.instances=[],this.id=Mat++}static get(e,n){if(!n.length)return e;let r=n[0].instances.find(s=>s.base==e&&kat(n,s.modified));if(r)return r;let i=[],o=new za(e.name,i,e,n);for(let s of n)s.instances.push(o);let a=Aat(n);for(let s of e.set)if(!s.modified.length)for(let l of a)i.push(bE.get(s,l));return o}}function kat(t,e){return t.length==e.length&&t.every((n,r)=>n==e[r])}function Aat(t){let e=[[]];for(let n=0;n<t.length;n++)for(let r=0,i=e.length;r<i;r++)e.push(e[r].concat(t[n]));return e.sort((n,r)=>r.length-n.length)}function N4(t){let e=Object.create(null);for(let n in t){let r=t[n];Array.isArray(r)||(r=[r]);for(let i of n.split(" "))if(i){let o=[],a=2,s=i;for(let f=0;;){if(s=="..."&&f>0&&f+3==i.length){a=1;break}let d=/^"(?:[^"\\]|\\.)*?"|[^\/!]+/.exec(s);if(!d)throw new RangeError("Invalid path: "+i);if(o.push(d[0]=="*"?"":d[0][0]=='"'?JSON.parse(d[0]):d[0]),f+=d[0].length,f==i.length)break;let h=i[f++];if(f==i.length&&h=="!"){a=0;break}if(h!="/")throw new RangeError("Invalid path: "+i);s=i.slice(f)}let l=o.length-1,c=o[l];if(!c)throw new RangeError("Invalid path: "+i);let u=new _E(r,a,l>0?o.slice(0,l):null);e[c]=u.sort(e[c])}}return Zde.add(e)}const Zde=new Vt;class _E{constructor(e,n,r,i){this.tags=e,this.mode=n,this.context=r,this.next=i}get opaque(){return this.mode==0}get inherit(){return this.mode==1}sort(e){return!e||e.depth<this.depth?(this.next=e,this):(e.next=this.sort(e.next),e)}get depth(){return this.context?this.context.length:0}}_E.empty=new _E([],2,null);function Jde(t,e){let n=Object.create(null);for(let o of t)if(!Array.isArray(o.tag))n[o.tag.id]=o.class;else for(let a of o.tag)n[a.id]=o.class;let{scope:r,all:i=null}=e||{};return{style:o=>{let a=i;for(let s of o)for(let l of s.set){let c=n[l.id];if(c){a=a?a+" "+c:c;break}}return a},scope:r}}function Rat(t,e){let n=null;for(let r of t){let i=r.style(e);i&&(n=n?n+" "+i:i)}return n}function Iat(t,e,n,r=0,i=t.length){let o=new Dat(r,Array.isArray(e)?e:[e],n);o.highlightRange(t.cursor(),r,i,"",o.highlighters),o.flush(i)}class Dat{constructor(e,n,r){this.at=e,this.highlighters=n,this.span=r,this.class=""}startSpan(e,n){n!=this.class&&(this.flush(e),e>this.at&&(this.at=e),this.class=n)}flush(e){e>this.at&&this.class&&this.span(this.at,e,this.class)}highlightRange(e,n,r,i,o){let{type:a,from:s,to:l}=e;if(s>=r||l<=n)return;a.isTop&&(o=this.highlighters.filter(h=>!h.scope||h.scope(a)));let c=i,u=Lat(e)||_E.empty,f=Rat(o,u.tags);if(f&&(c&&(c+=" "),c+=f,u.mode==1&&(i+=(i?" ":"")+f)),this.startSpan(Math.max(n,s),c),u.opaque)return;let d=e.tree&&e.tree.prop(Vt.mounted);if(d&&d.overlay){let h=e.node.enter(d.overlay[0].from+s,1),p=this.highlighters.filter(g=>!g.scope||g.scope(d.tree.type)),m=e.firstChild();for(let g=0,v=s;;g++){let y=g<d.overlay.length?d.overlay[g]:null,x=y?y.from+s:l,b=Math.max(n,v),_=Math.min(r,x);if(b<_&&m)for(;e.from<_&&(this.highlightRange(e,b,_,i,o),this.startSpan(Math.min(_,e.to),c),!(e.to>=x||!e.nextSibling())););if(!y||x>r)break;v=y.to+s,v>n&&(this.highlightRange(h.cursor(),Math.max(n,y.from+s),Math.min(r,v),"",p),this.startSpan(Math.min(r,v),c))}m&&e.parent()}else if(e.firstChild()){d&&(i="");do if(!(e.to<=n)){if(e.from>=r)break;this.highlightRange(e,n,r,i,o),this.startSpan(Math.min(r,e.to),c)}while(e.nextSibling());e.parent()}}}function Lat(t){let e=t.type.prop(Zde);for(;e&&e.context&&!t.matchContext(e.context);)e=e.next;return e||null}const et=za.define,oO=et(),cf=et(),lq=et(cf),cq=et(cf),uf=et(),aO=et(uf),qR=et(uf),dl=et(),Wd=et(dl),ul=et(),fl=et(),zN=et(),D0=et(zN),sO=et(),Ce={comment:oO,lineComment:et(oO),blockComment:et(oO),docComment:et(oO),name:cf,variableName:et(cf),typeName:lq,tagName:et(lq),propertyName:cq,attributeName:et(cq),className:et(cf),labelName:et(cf),namespace:et(cf),macroName:et(cf),literal:uf,string:aO,docString:et(aO),character:et(aO),attributeValue:et(aO),number:qR,integer:et(qR),float:et(qR),bool:et(uf),regexp:et(uf),escape:et(uf),color:et(uf),url:et(uf),keyword:ul,self:et(ul),null:et(ul),atom:et(ul),unit:et(ul),modifier:et(ul),operatorKeyword:et(ul),controlKeyword:et(ul),definitionKeyword:et(ul),moduleKeyword:et(ul),operator:fl,derefOperator:et(fl),arithmeticOperator:et(fl),logicOperator:et(fl),bitwiseOperator:et(fl),compareOperator:et(fl),updateOperator:et(fl),definitionOperator:et(fl),typeOperator:et(fl),controlOperator:et(fl),punctuation:zN,separator:et(zN),bracket:D0,angleBracket:et(D0),squareBracket:et(D0),paren:et(D0),brace:et(D0),content:dl,heading:Wd,heading1:et(Wd),heading2:et(Wd),heading3:et(Wd),heading4:et(Wd),heading5:et(Wd),heading6:et(Wd),contentSeparator:et(dl),list:et(dl),quote:et(dl),emphasis:et(dl),strong:et(dl),link:et(dl),monospace:et(dl),strikethrough:et(dl),inserted:et(),deleted:et(),changed:et(),invalid:et(),meta:sO,documentMeta:et(sO),annotation:et(sO),processingInstruction:et(sO),definition:za.defineModifier("definition"),constant:za.defineModifier("constant"),function:za.defineModifier("function"),standard:za.defineModifier("standard"),local:za.defineModifier("local"),special:za.defineModifier("special")};for(let t in Ce){let e=Ce[t];e instanceof za&&(e.name=t)}Jde([{tag:Ce.link,class:"tok-link"},{tag:Ce.heading,class:"tok-heading"},{tag:Ce.emphasis,class:"tok-emphasis"},{tag:Ce.strong,class:"tok-strong"},{tag:Ce.keyword,class:"tok-keyword"},{tag:Ce.atom,class:"tok-atom"},{tag:Ce.bool,class:"tok-bool"},{tag:Ce.url,class:"tok-url"},{tag:Ce.labelName,class:"tok-labelName"},{tag:Ce.inserted,class:"tok-inserted"},{tag:Ce.deleted,class:"tok-deleted"},{tag:Ce.literal,class:"tok-literal"},{tag:Ce.string,class:"tok-string"},{tag:Ce.number,class:"tok-number"},{tag:[Ce.regexp,Ce.escape,Ce.special(Ce.string)],class:"tok-string2"},{tag:Ce.variableName,class:"tok-variableName"},{tag:Ce.local(Ce.variableName),class:"tok-variableName tok-local"},{tag:Ce.definition(Ce.variableName),class:"tok-variableName tok-definition"},{tag:Ce.special(Ce.variableName),class:"tok-variableName2"},{tag:Ce.definition(Ce.propertyName),class:"tok-propertyName tok-definition"},{tag:Ce.typeName,class:"tok-typeName"},{tag:Ce.namespace,class:"tok-namespace"},{tag:Ce.className,class:"tok-className"},{tag:Ce.macroName,class:"tok-macroName"},{tag:Ce.propertyName,class:"tok-propertyName"},{tag:Ce.operator,class:"tok-operator"},{tag:Ce.comment,class:"tok-comment"},{tag:Ce.meta,class:"tok-meta"},{tag:Ce.invalid,class:"tok-invalid"},{tag:Ce.punctuation,class:"tok-punctuation"}]);var XR;const og=new Vt;function Nat(t){return ct.define({combine:t?e=>e.concat(t):void 0})}const $at=new Vt;class Hs{constructor(e,n,r=[],i=""){this.data=e,this.name=i,en.prototype.hasOwnProperty("tree")||Object.defineProperty(en.prototype,"tree",{get(){return fi(this)}}),this.parser=n,this.extension=[cd.of(this),en.languageData.of((o,a,s)=>{let l=uq(o,a,s),c=l.type.prop(og);if(!c)return[];let u=o.facet(c),f=l.type.prop($at);if(f){let d=l.resolve(a-l.from,s);for(let h of f)if(h.test(d,o)){let p=o.facet(h.facet);return h.type=="replace"?p:p.concat(u)}}return u})].concat(r)}isActiveAt(e,n,r=-1){return uq(e,n,r).type.prop(og)==this.data}findRegions(e){let n=e.facet(cd);if((n==null?void 0:n.data)==this.data)return[{from:0,to:e.doc.length}];if(!n||!n.allowsNesting)return[];let r=[],i=(o,a)=>{if(o.prop(og)==this.data){r.push({from:a,to:a+o.length});return}let s=o.prop(Vt.mounted);if(s){if(s.tree.prop(og)==this.data){if(s.overlay)for(let l of s.overlay)r.push({from:l.from+a,to:l.to+a});else r.push({from:a,to:a+o.length});return}else if(s.overlay){let l=r.length;if(i(s.tree,s.overlay[0].from+a),r.length>l)return}}for(let l=0;l<o.children.length;l++){let c=o.children[l];c instanceof Wr&&i(c,o.positions[l]+a)}};return i(fi(e),0),r}get allowsNesting(){return!0}}Hs.setState=Rt.define();function uq(t,e,n){let r=t.facet(cd),i=fi(t).topNode;if(!r||r.allowsNesting)for(let o=i;o;o=o.enter(e,n,Jr.ExcludeBuffers))o.type.isTop&&(i=o);return i}class u_ extends Hs{constructor(e,n,r){super(e,n,[],r),this.parser=n}static define(e){let n=Nat(e.languageData);return new u_(n,e.parser.configure({props:[og.add(r=>r.isTop?n:void 0)]}),e.name)}configure(e,n){return new u_(this.data,this.parser.configure(e),n||this.name)}get allowsNesting(){return this.parser.hasWrappers()}}function fi(t){let e=t.field(Hs.state,!1);return e?e.tree:Wr.empty}class Fat{constructor(e){this.doc=e,this.cursorPos=0,this.string="",this.cursor=e.iter()}get length(){return this.doc.length}syncTo(e){return this.string=this.cursor.next(e-this.cursorPos).value,this.cursorPos=e+this.string.length,this.cursorPos-this.string.length}chunk(e){return this.syncTo(e),this.string}get lineChunks(){return!0}read(e,n){let r=this.cursorPos-this.string.length;return e<r||n>=this.cursorPos?this.doc.sliceString(e,n):this.string.slice(e-r,n-r)}}let L0=null;class wE{constructor(e,n,r=[],i,o,a,s,l){this.parser=e,this.state=n,this.fragments=r,this.tree=i,this.treeLen=o,this.viewport=a,this.skipped=s,this.scheduleOn=l,this.parse=null,this.tempSkipped=[]}static create(e,n,r){return new wE(e,n,[],Wr.empty,0,r,[],null)}startParse(){return this.parser.startParse(new Fat(this.state.doc),this.fragments)}work(e,n){return n!=null&&n>=this.state.doc.length&&(n=void 0),this.tree!=Wr.empty&&this.isDone(n??this.state.doc.length)?(this.takeTree(),!0):this.withContext(()=>{var r;if(typeof e=="number"){let i=Date.now()+e;e=()=>Date.now()>i}for(this.parse||(this.parse=this.startParse()),n!=null&&(this.parse.stoppedAt==null||this.parse.stoppedAt>n)&&n<this.state.doc.length&&this.parse.stopAt(n);;){let i=this.parse.advance();if(i)if(this.fragments=this.withoutTempSkipped(Wh.addTree(i,this.fragments,this.parse.stoppedAt!=null)),this.treeLen=(r=this.parse.stoppedAt)!==null&&r!==void 0?r:this.state.doc.length,this.tree=i,this.parse=null,this.treeLen<(n??this.state.doc.length))this.parse=this.startParse();else return!0;if(e())return!1}})}takeTree(){let e,n;this.parse&&(e=this.parse.parsedPos)>=this.treeLen&&((this.parse.stoppedAt==null||this.parse.stoppedAt>e)&&this.parse.stopAt(e),this.withContext(()=>{for(;!(n=this.parse.advance()););}),this.treeLen=e,this.tree=n,this.fragments=this.withoutTempSkipped(Wh.addTree(this.tree,this.fragments,!0)),this.parse=null)}withContext(e){let n=L0;L0=this;try{return e()}finally{L0=n}}withoutTempSkipped(e){for(let n;n=this.tempSkipped.pop();)e=fq(e,n.from,n.to);return e}changes(e,n){let{fragments:r,tree:i,treeLen:o,viewport:a,skipped:s}=this;if(this.takeTree(),!e.empty){let l=[];if(e.iterChangedRanges((c,u,f,d)=>l.push({fromA:c,toA:u,fromB:f,toB:d})),r=Wh.applyChanges(r,l),i=Wr.empty,o=0,a={from:e.mapPos(a.from,-1),to:e.mapPos(a.to,1)},this.skipped.length){s=[];for(let c of this.skipped){let u=e.mapPos(c.from,1),f=e.mapPos(c.to,-1);u<f&&s.push({from:u,to:f})}}}return new wE(this.parser,n,r,i,o,a,s,this.scheduleOn)}updateViewport(e){if(this.viewport.from==e.from&&this.viewport.to==e.to)return!1;this.viewport=e;let n=this.skipped.length;for(let r=0;r<this.skipped.length;r++){let{from:i,to:o}=this.skipped[r];i<e.to&&o>e.from&&(this.fragments=fq(this.fragments,i,o),this.skipped.splice(r--,1))}return this.skipped.length>=n?!1:(this.reset(),!0)}reset(){this.parse&&(this.takeTree(),this.parse=null)}skipUntilInView(e,n){this.skipped.push({from:e,to:n})}static getSkippingParser(e){return new class extends Kde{createParse(n,r,i){let o=i[0].from,a=i[i.length-1].to;return{parsedPos:o,advance(){let l=L0;if(l){for(let c of i)l.tempSkipped.push(c);e&&(l.scheduleOn=l.scheduleOn?Promise.all([l.scheduleOn,e]):e)}return this.parsedPos=a,new Wr(Vo.none,[],[],a-o)},stoppedAt:null,stopAt(){}}}}}isDone(e){e=Math.min(e,this.state.doc.length);let n=this.fragments;return this.treeLen>=e&&n.length&&n[0].from==0&&n[0].to>=e}static get(){return L0}}function fq(t,e,n){return Wh.applyChanges(t,[{fromA:e,toA:n,fromB:e,toB:n}])}class hv{constructor(e){this.context=e,this.tree=e.tree}apply(e){if(!e.docChanged&&this.tree==this.context.tree)return this;let n=this.context.changes(e.changes,e.state),r=this.context.treeLen==e.startState.doc.length?void 0:Math.max(e.changes.mapPos(this.context.treeLen),n.viewport.to);return n.work(20,r)||n.takeTree(),new hv(n)}static init(e){let n=Math.min(3e3,e.doc.length),r=wE.create(e.facet(cd).parser,e,{from:0,to:n});return r.work(20,n)||r.takeTree(),new hv(r)}}Hs.state=mi.define({create:hv.init,update(t,e){for(let n of e.effects)if(n.is(Hs.setState))return n.value;return e.startState.facet(cd)!=e.state.facet(cd)?hv.init(e.state):t.apply(e)}});let ehe=t=>{let e=setTimeout(()=>t(),500);return()=>clearTimeout(e)};typeof requestIdleCallback<"u"&&(ehe=t=>{let e=-1,n=setTimeout(()=>{e=requestIdleCallback(t,{timeout:400})},100);return()=>e<0?clearTimeout(n):cancelIdleCallback(e)});const QR=typeof navigator<"u"&&(!((XR=navigator.scheduling)===null||XR===void 0)&&XR.isInputPending)?()=>navigator.scheduling.isInputPending():null,jat=kr.fromClass(class{constructor(e){this.view=e,this.working=null,this.workScheduled=0,this.chunkEnd=-1,this.chunkBudget=-1,this.work=this.work.bind(this),this.scheduleWork()}update(e){let n=this.view.state.field(Hs.state).context;(n.updateViewport(e.view.viewport)||this.view.viewport.to>n.treeLen)&&this.scheduleWork(),(e.docChanged||e.selectionSet)&&(this.view.hasFocus&&(this.chunkBudget+=50),this.scheduleWork()),this.checkAsyncSchedule(n)}scheduleWork(){if(this.working)return;let{state:e}=this.view,n=e.field(Hs.state);(n.tree!=n.context.tree||!n.context.isDone(e.doc.length))&&(this.working=ehe(this.work))}work(e){this.working=null;let n=Date.now();if(this.chunkEnd<n&&(this.chunkEnd<0||this.view.hasFocus)&&(this.chunkEnd=n+3e4,this.chunkBudget=3e3),this.chunkBudget<=0)return;let{state:r,viewport:{to:i}}=this.view,o=r.field(Hs.state);if(o.tree==o.context.tree&&o.context.isDone(i+1e5))return;let a=Date.now()+Math.min(this.chunkBudget,100,e&&!QR?Math.max(25,e.timeRemaining()-5):1e9),s=o.context.treeLen<i&&r.doc.length>i+1e3,l=o.context.work(()=>QR&&QR()||Date.now()>a,i+(s?0:1e5));this.chunkBudget-=Date.now()-n,(l||this.chunkBudget<=0)&&(o.context.takeTree(),this.view.dispatch({effects:Hs.setState.of(new hv(o.context))})),this.chunkBudget>0&&!(l&&!s)&&this.scheduleWork(),this.checkAsyncSchedule(o.context)}checkAsyncSchedule(e){e.scheduleOn&&(this.workScheduled++,e.scheduleOn.then(()=>this.scheduleWork()).catch(n=>Ao(this.view.state,n)).then(()=>this.workScheduled--),e.scheduleOn=null)}destroy(){this.working&&this.working()}isWorking(){return!!(this.working||this.workScheduled>0)}},{eventHandlers:{focus(){this.scheduleWork()}}}),cd=ct.define({combine(t){return t.length?t[0]:null},enables:t=>[Hs.state,jat,rt.contentAttributes.compute([t],e=>{let n=e.facet(t);return n&&n.name?{"data-language":n.name}:{}})]});class the{constructor(e,n=[]){this.language=e,this.support=n,this.extension=[e,n]}}const Bat=ct.define(),xw=ct.define({combine:t=>{if(!t.length)return"  ";let e=t[0];if(!e||/\S/.test(e)||Array.from(e).some(n=>n!=e[0]))throw new Error("Invalid indent unit: "+JSON.stringify(t[0]));return e}});function SE(t){let e=t.facet(xw);return e.charCodeAt(0)==9?t.tabSize*e.length:e.length}function f_(t,e){let n="",r=t.tabSize,i=t.facet(xw)[0];if(i=="	"){for(;e>=r;)n+="	",e-=r;i=" "}for(let o=0;o<e;o++)n+=i;return n}function $4(t,e){t instanceof en&&(t=new K2(t));for(let r of t.state.facet(Bat)){let i=r(t,e);if(i!==void 0)return i}let n=fi(t.state);return n.length>=e?zat(t,n,e):null}class K2{constructor(e,n={}){this.state=e,this.options=n,this.unit=SE(e)}lineAt(e,n=1){let r=this.state.doc.lineAt(e),{simulateBreak:i,simulateDoubleBreak:o}=this.options;return i!=null&&i>=r.from&&i<=r.to?o&&i==e?{text:"",from:e}:(n<0?i<e:i<=e)?{text:r.text.slice(i-r.from),from:i}:{text:r.text.slice(0,i-r.from),from:r.from}:r}textAfterPos(e,n=1){if(this.options.simulateDoubleBreak&&e==this.options.simulateBreak)return"";let{text:r,from:i}=this.lineAt(e,n);return r.slice(e-i,Math.min(r.length,e+100-i))}column(e,n=1){let{text:r,from:i}=this.lineAt(e,n),o=this.countColumn(r,e-i),a=this.options.overrideIndentation?this.options.overrideIndentation(i):-1;return a>-1&&(o+=a-this.countColumn(r,r.search(/\S|$/))),o}countColumn(e,n=e.length){return My(e,this.state.tabSize,n)}lineIndent(e,n=1){let{text:r,from:i}=this.lineAt(e,n),o=this.options.overrideIndentation;if(o){let a=o(i);if(a>-1)return a}return this.countColumn(r,r.search(/\S|$/))}get simulatedBreak(){return this.options.simulateBreak||null}}const F4=new Vt;function zat(t,e,n){let r=e.resolveStack(n),i=r.node.enterUnfinishedNodesBefore(n);if(i!=r.node){let o=[];for(let a=i;a!=r.node;a=a.parent)o.push(a);for(let a=o.length-1;a>=0;a--)r={node:o[a],next:r}}return nhe(r,t,n)}function nhe(t,e,n){for(let r=t;r;r=r.next){let i=Wat(r.node);if(i)return i(j4.create(e,n,r))}return 0}function Uat(t){return t.pos==t.options.simulateBreak&&t.options.simulateDoubleBreak}function Wat(t){let e=t.type.prop(F4);if(e)return e;let n=t.firstChild,r;if(n&&(r=n.type.prop(Vt.closedBy))){let i=t.lastChild,o=i&&r.indexOf(i.name)>-1;return a=>rhe(a,!0,1,void 0,o&&!Uat(a)?i.from:void 0)}return t.parent==null?Vat:null}function Vat(){return 0}class j4 extends K2{constructor(e,n,r){super(e.state,e.options),this.base=e,this.pos=n,this.context=r}get node(){return this.context.node}static create(e,n,r){return new j4(e,n,r)}get textAfter(){return this.textAfterPos(this.pos)}get baseIndent(){return this.baseIndentFor(this.node)}baseIndentFor(e){let n=this.state.doc.lineAt(e.from);for(;;){let r=e.resolve(n.from);for(;r.parent&&r.parent.from==r.from;)r=r.parent;if(Gat(r,e))break;n=this.state.doc.lineAt(r.from)}return this.lineIndent(n.from)}continue(){return nhe(this.context.next,this.base,this.pos)}}function Gat(t,e){for(let n=e;n;n=n.parent)if(t==n)return!0;return!1}function Hat(t){let e=t.node,n=e.childAfter(e.from),r=e.lastChild;if(!n)return null;let i=t.options.simulateBreak,o=t.state.doc.lineAt(n.from),a=i==null||i<=o.from?o.to:Math.min(o.to,i);for(let s=n.to;;){let l=e.childAfter(s);if(!l||l==r)return null;if(!l.type.isSkipped)return l.from<a?n:null;s=l.to}}function YR({closing:t,align:e=!0,units:n=1}){return r=>rhe(r,e,n,t)}function rhe(t,e,n,r,i){let o=t.textAfter,a=o.match(/^\s*/)[0].length,s=r&&o.slice(a,a+r.length)==r||i==t.pos+a,l=e?Hat(t):null;return l?s?t.column(l.from):t.column(l.to):t.baseIndent+(s?0:t.unit*n)}function dq({except:t,units:e=1}={}){return n=>{let r=t&&t.test(n.textAfter);return n.baseIndent+(r?0:e*n.unit)}}const qat=200;function Xat(){return en.transactionFilter.of(t=>{if(!t.docChanged||!t.isUserEvent("input.type")&&!t.isUserEvent("input.complete"))return t;let e=t.startState.languageDataAt("indentOnInput",t.startState.selection.main.head);if(!e.length)return t;let n=t.newDoc,{head:r}=t.newSelection.main,i=n.lineAt(r);if(r>i.from+qat)return t;let o=n.sliceString(i.from,r);if(!e.some(c=>c.test(o)))return t;let{state:a}=t,s=-1,l=[];for(let{head:c}of a.selection.ranges){let u=a.doc.lineAt(c);if(u.from==s)continue;s=u.from;let f=$4(a,u.from);if(f==null)continue;let d=/^\s*/.exec(u.text)[0],h=f_(a,f);d!=h&&l.push({from:u.from,to:u.from+d.length,insert:h})}return l.length?[t,{changes:l,sequential:!0}]:t})}const Qat=ct.define(),B4=new Vt;function ihe(t){let e=t.firstChild,n=t.lastChild;return e&&e.to<n.from?{from:e.to,to:n.type.isError?t.to:n.from}:null}function Yat(t,e,n){let r=fi(t);if(r.length<n)return null;let i=r.resolveStack(n,1),o=null;for(let a=i;a;a=a.next){let s=a.node;if(s.to<=n||s.from>n)continue;if(o&&s.from<e)break;let l=s.type.prop(B4);if(l&&(s.to<r.length-50||r.length==t.doc.length||!Kat(s))){let c=l(s,t);c&&c.from<=n&&c.from>=e&&c.to>n&&(o=c)}}return o}function Kat(t){let e=t.lastChild;return e&&e.to==t.to&&e.type.isError}function OE(t,e,n){for(let r of t.facet(Qat)){let i=r(t,e,n);if(i)return i}return Yat(t,e,n)}function ohe(t,e){let n=e.mapPos(t.from,1),r=e.mapPos(t.to,-1);return n>=r?void 0:{from:n,to:r}}const Z2=Rt.define({map:ohe}),bw=Rt.define({map:ohe});function ahe(t){let e=[];for(let{head:n}of t.state.selection.ranges)e.some(r=>r.from<=n&&r.to>=n)||e.push(t.lineBlockAt(n));return e}const fp=mi.define({create(){return gt.none},update(t,e){t=t.map(e.changes);for(let n of e.effects)if(n.is(Z2)&&!Zat(t,n.value.from,n.value.to)){let{preparePlaceholder:r}=e.state.facet(che),i=r?gt.replace({widget:new ost(r(e.state,n.value))}):hq;t=t.update({add:[i.range(n.value.from,n.value.to)]})}else n.is(bw)&&(t=t.update({filter:(r,i)=>n.value.from!=r||n.value.to!=i,filterFrom:n.value.from,filterTo:n.value.to}));if(e.selection){let n=!1,{head:r}=e.selection.main;t.between(r,r,(i,o)=>{i<r&&o>r&&(n=!0)}),n&&(t=t.update({filterFrom:r,filterTo:r,filter:(i,o)=>o<=r||i>=r}))}return t},provide:t=>rt.decorations.from(t),toJSON(t,e){let n=[];return t.between(0,e.doc.length,(r,i)=>{n.push(r,i)}),n},fromJSON(t){if(!Array.isArray(t)||t.length%2)throw new RangeError("Invalid JSON for fold state");let e=[];for(let n=0;n<t.length;){let r=t[n++],i=t[n++];if(typeof r!="number"||typeof i!="number")throw new RangeError("Invalid JSON for fold state");e.push(hq.range(r,i))}return gt.set(e,!0)}});function CE(t,e,n){var r;let i=null;return(r=t.field(fp,!1))===null||r===void 0||r.between(e,n,(o,a)=>{(!i||i.from>o)&&(i={from:o,to:a})}),i}function Zat(t,e,n){let r=!1;return t.between(e,e,(i,o)=>{i==e&&o==n&&(r=!0)}),r}function she(t,e){return t.field(fp,!1)?e:e.concat(Rt.appendConfig.of(uhe()))}const Jat=t=>{for(let e of ahe(t)){let n=OE(t.state,e.from,e.to);if(n)return t.dispatch({effects:she(t.state,[Z2.of(n),lhe(t,n)])}),!0}return!1},est=t=>{if(!t.state.field(fp,!1))return!1;let e=[];for(let n of ahe(t)){let r=CE(t.state,n.from,n.to);r&&e.push(bw.of(r),lhe(t,r,!1))}return e.length&&t.dispatch({effects:e}),e.length>0};function lhe(t,e,n=!0){let r=t.state.doc.lineAt(e.from).number,i=t.state.doc.lineAt(e.to).number;return rt.announce.of(`${t.state.phrase(n?"Folded lines":"Unfolded lines")} ${r} ${t.state.phrase("to")} ${i}.`)}const tst=t=>{let{state:e}=t,n=[];for(let r=0;r<e.doc.length;){let i=t.lineBlockAt(r),o=OE(e,i.from,i.to);o&&n.push(Z2.of(o)),r=(o?t.lineBlockAt(o.to):i).to+1}return n.length&&t.dispatch({effects:she(t.state,n)}),!!n.length},nst=t=>{let e=t.state.field(fp,!1);if(!e||!e.size)return!1;let n=[];return e.between(0,t.state.doc.length,(r,i)=>{n.push(bw.of({from:r,to:i}))}),t.dispatch({effects:n}),!0},rst=[{key:"Ctrl-Shift-[",mac:"Cmd-Alt-[",run:Jat},{key:"Ctrl-Shift-]",mac:"Cmd-Alt-]",run:est},{key:"Ctrl-Alt-[",run:tst},{key:"Ctrl-Alt-]",run:nst}],ist={placeholderDOM:null,preparePlaceholder:null,placeholderText:"…"},che=ct.define({combine(t){return cc(t,ist)}});function uhe(t){return[fp,lst]}function fhe(t,e){let{state:n}=t,r=n.facet(che),i=a=>{let s=t.lineBlockAt(t.posAtDOM(a.target)),l=CE(t.state,s.from,s.to);l&&t.dispatch({effects:bw.of(l)}),a.preventDefault()};if(r.placeholderDOM)return r.placeholderDOM(t,i,e);let o=document.createElement("span");return o.textContent=r.placeholderText,o.setAttribute("aria-label",n.phrase("folded code")),o.title=n.phrase("unfold"),o.className="cm-foldPlaceholder",o.onclick=i,o}const hq=gt.replace({widget:new class extends uc{toDOM(t){return fhe(t,null)}}});class ost extends uc{constructor(e){super(),this.value=e}eq(e){return this.value==e.value}toDOM(e){return fhe(e,this.value)}}const ast={openText:"⌄",closedText:"›",markerDOM:null,domEventHandlers:{},foldingChanged:()=>!1};class KR extends gu{constructor(e,n){super(),this.config=e,this.open=n}eq(e){return this.config==e.config&&this.open==e.open}toDOM(e){if(this.config.markerDOM)return this.config.markerDOM(this.open);let n=document.createElement("span");return n.textContent=this.open?this.config.openText:this.config.closedText,n.title=e.state.phrase(this.open?"Fold line":"Unfold line"),n}}function sst(t={}){let e=Object.assign(Object.assign({},ast),t),n=new KR(e,!0),r=new KR(e,!1),i=kr.fromClass(class{constructor(a){this.from=a.viewport.from,this.markers=this.buildMarkers(a)}update(a){(a.docChanged||a.viewportChanged||a.startState.facet(cd)!=a.state.facet(cd)||a.startState.field(fp,!1)!=a.state.field(fp,!1)||fi(a.startState)!=fi(a.state)||e.foldingChanged(a))&&(this.markers=this.buildMarkers(a.view))}buildMarkers(a){let s=new id;for(let l of a.viewportLineBlocks){let c=CE(a.state,l.from,l.to)?r:OE(a.state,l.from,l.to)?n:null;c&&s.add(l.from,l.from,c)}return s.finish()}}),{domEventHandlers:o}=e;return[i,cat({class:"cm-foldGutter",markers(a){var s;return((s=a.plugin(i))===null||s===void 0?void 0:s.markers)||sn.empty},initialSpacer(){return new KR(e,!1)},domEventHandlers:Object.assign(Object.assign({},o),{click:(a,s,l)=>{if(o.click&&o.click(a,s,l))return!0;let c=CE(a.state,s.from,s.to);if(c)return a.dispatch({effects:bw.of(c)}),!0;let u=OE(a.state,s.from,s.to);return u?(a.dispatch({effects:Z2.of(u)}),!0):!1}})}),uhe()]}const lst=rt.baseTheme({".cm-foldPlaceholder":{backgroundColor:"#eee",border:"1px solid #ddd",color:"#888",borderRadius:".2em",margin:"0 1px",padding:"0 1px",cursor:"pointer"},".cm-foldGutter span":{padding:"0 1px",cursor:"pointer"}});class _w{constructor(e,n){this.specs=e;let r;function i(s){let l=od.newName();return(r||(r=Object.create(null)))["."+l]=s,l}const o=typeof n.all=="string"?n.all:n.all?i(n.all):void 0,a=n.scope;this.scope=a instanceof Hs?s=>s.prop(og)==a.data:a?s=>s==a:void 0,this.style=Jde(e.map(s=>({tag:s.tag,class:s.class||i(Object.assign({},s,{tag:null}))})),{all:o}).style,this.module=r?new od(r):null,this.themeType=n.themeType}static define(e,n){return new _w(e,n||{})}}const UN=ct.define(),dhe=ct.define({combine(t){return t.length?[t[0]]:null}});function ZR(t){let e=t.facet(UN);return e.length?e:t.facet(dhe)}function hhe(t,e){let n=[ust],r;return t instanceof _w&&(t.module&&n.push(rt.styleModule.of(t.module)),r=t.themeType),e!=null&&e.fallback?n.push(dhe.of(t)):r?n.push(UN.computeN([rt.darkTheme],i=>i.facet(rt.darkTheme)==(r=="dark")?[t]:[])):n.push(UN.of(t)),n}class cst{constructor(e){this.markCache=Object.create(null),this.tree=fi(e.state),this.decorations=this.buildDeco(e,ZR(e.state)),this.decoratedTo=e.viewport.to}update(e){let n=fi(e.state),r=ZR(e.state),i=r!=ZR(e.startState),{viewport:o}=e.view,a=e.changes.mapPos(this.decoratedTo,1);n.length<o.to&&!i&&n.type==this.tree.type&&a>=o.to?(this.decorations=this.decorations.map(e.changes),this.decoratedTo=a):(n!=this.tree||e.viewportChanged||i)&&(this.tree=n,this.decorations=this.buildDeco(e.view,r),this.decoratedTo=o.to)}buildDeco(e,n){if(!n||!this.tree.length)return gt.none;let r=new id;for(let{from:i,to:o}of e.visibleRanges)Iat(this.tree,n,(a,s,l)=>{r.add(a,s,this.markCache[l]||(this.markCache[l]=gt.mark({class:l})))},i,o);return r.finish()}}const ust=Ed.high(kr.fromClass(cst,{decorations:t=>t.decorations})),fst=_w.define([{tag:Ce.meta,color:"#404740"},{tag:Ce.link,textDecoration:"underline"},{tag:Ce.heading,textDecoration:"underline",fontWeight:"bold"},{tag:Ce.emphasis,fontStyle:"italic"},{tag:Ce.strong,fontWeight:"bold"},{tag:Ce.strikethrough,textDecoration:"line-through"},{tag:Ce.keyword,color:"#708"},{tag:[Ce.atom,Ce.bool,Ce.url,Ce.contentSeparator,Ce.labelName],color:"#219"},{tag:[Ce.literal,Ce.inserted],color:"#164"},{tag:[Ce.string,Ce.deleted],color:"#a11"},{tag:[Ce.regexp,Ce.escape,Ce.special(Ce.string)],color:"#e40"},{tag:Ce.definition(Ce.variableName),color:"#00f"},{tag:Ce.local(Ce.variableName),color:"#30a"},{tag:[Ce.typeName,Ce.namespace],color:"#085"},{tag:Ce.className,color:"#167"},{tag:[Ce.special(Ce.variableName),Ce.macroName],color:"#256"},{tag:Ce.definition(Ce.propertyName),color:"#00c"},{tag:Ce.comment,color:"#940"},{tag:Ce.invalid,color:"#f00"}]),dst=rt.baseTheme({"&.cm-focused .cm-matchingBracket":{backgroundColor:"#328c8252"},"&.cm-focused .cm-nonmatchingBracket":{backgroundColor:"#bb555544"}}),phe=1e4,mhe="()[]{}",ghe=ct.define({combine(t){return cc(t,{afterCursor:!0,brackets:mhe,maxScanDistance:phe,renderMatch:mst})}}),hst=gt.mark({class:"cm-matchingBracket"}),pst=gt.mark({class:"cm-nonmatchingBracket"});function mst(t){let e=[],n=t.matched?hst:pst;return e.push(n.range(t.start.from,t.start.to)),t.end&&e.push(n.range(t.end.from,t.end.to)),e}const gst=mi.define({create(){return gt.none},update(t,e){if(!e.docChanged&&!e.selection)return t;let n=[],r=e.state.facet(ghe);for(let i of e.state.selection.ranges){if(!i.empty)continue;let o=Ll(e.state,i.head,-1,r)||i.head>0&&Ll(e.state,i.head-1,1,r)||r.afterCursor&&(Ll(e.state,i.head,1,r)||i.head<e.state.doc.length&&Ll(e.state,i.head+1,-1,r));o&&(n=n.concat(r.renderMatch(o,e.state)))}return gt.set(n,!0)},provide:t=>rt.decorations.from(t)}),vst=[gst,dst];function yst(t={}){return[ghe.of(t),vst]}const xst=new Vt;function WN(t,e,n){let r=t.prop(e<0?Vt.openedBy:Vt.closedBy);if(r)return r;if(t.name.length==1){let i=n.indexOf(t.name);if(i>-1&&i%2==(e<0?1:0))return[n[i+e]]}return null}function VN(t){let e=t.type.prop(xst);return e?e(t.node):t}function Ll(t,e,n,r={}){let i=r.maxScanDistance||phe,o=r.brackets||mhe,a=fi(t),s=a.resolveInner(e,n);for(let l=s;l;l=l.parent){let c=WN(l.type,n,o);if(c&&l.from<l.to){let u=VN(l);if(u&&(n>0?e>=u.from&&e<u.to:e>u.from&&e<=u.to))return bst(t,e,n,l,u,c,o)}}return _st(t,e,n,a,s.type,i,o)}function bst(t,e,n,r,i,o,a){let s=r.parent,l={from:i.from,to:i.to},c=0,u=s==null?void 0:s.cursor();if(u&&(n<0?u.childBefore(r.from):u.childAfter(r.to)))do if(n<0?u.to<=r.from:u.from>=r.to){if(c==0&&o.indexOf(u.type.name)>-1&&u.from<u.to){let f=VN(u);return{start:l,end:f?{from:f.from,to:f.to}:void 0,matched:!0}}else if(WN(u.type,n,a))c++;else if(WN(u.type,-n,a)){if(c==0){let f=VN(u);return{start:l,end:f&&f.from<f.to?{from:f.from,to:f.to}:void 0,matched:!1}}c--}}while(n<0?u.prevSibling():u.nextSibling());return{start:l,matched:!1}}function _st(t,e,n,r,i,o,a){let s=n<0?t.sliceDoc(e-1,e):t.sliceDoc(e,e+1),l=a.indexOf(s);if(l<0||l%2==0!=n>0)return null;let c={from:n<0?e-1:e,to:n>0?e+1:e},u=t.doc.iterRange(e,n>0?t.doc.length:0),f=0;for(let d=0;!u.next().done&&d<=o;){let h=u.value;n<0&&(d+=h.length);let p=e+d*n;for(let m=n>0?0:h.length-1,g=n>0?h.length:-1;m!=g;m+=n){let v=a.indexOf(h[m]);if(!(v<0||r.resolveInner(p+m,1).type!=i))if(v%2==0==n>0)f++;else{if(f==1)return{start:c,end:{from:p+m,to:p+m+1},matched:v>>1==l>>1};f--}}n>0&&(d+=h.length)}return u.done?{start:c,matched:!1}:null}const wst=Object.create(null),pq=[Vo.none],mq=[],gq=Object.create(null),Sst=Object.create(null);for(let[t,e]of[["variable","variableName"],["variable-2","variableName.special"],["string-2","string.special"],["def","variableName.definition"],["tag","tagName"],["attribute","attributeName"],["type","typeName"],["builtin","variableName.standard"],["qualifier","modifier"],["error","invalid"],["header","heading"],["property","propertyName"]])Sst[t]=Ost(wst,e);function JR(t,e){mq.indexOf(t)>-1||(mq.push(t),console.warn(e))}function Ost(t,e){let n=[];for(let s of e.split(" ")){let l=[];for(let c of s.split(".")){let u=t[c]||Ce[c];u?typeof u=="function"?l.length?l=l.map(u):JR(c,`Modifier ${c} used at start of tag`):l.length?JR(c,`Tag ${c} used as modifier`):l=Array.isArray(u)?u:[u]:JR(c,`Unknown highlighting tag ${c}`)}for(let c of l)n.push(c)}if(!n.length)return 0;let r=e.replace(/ /g,"_"),i=r+" "+n.map(s=>s.id),o=gq[i];if(o)return o.id;let a=gq[i]=Vo.define({id:pq.length,name:r,props:[N4({[r]:n})]});return pq.push(a),a.id}rr.RTL,rr.LTR;const Cst=t=>{let{state:e}=t,n=e.doc.lineAt(e.selection.main.from),r=U4(t.state,n.from);return r.line?Tst(t):r.block?Pst(t):!1};function z4(t,e){return({state:n,dispatch:r})=>{if(n.readOnly)return!1;let i=t(e,n);return i?(r(n.update(i)),!0):!1}}const Tst=z4(Ast,0),Est=z4(vhe,0),Pst=z4((t,e)=>vhe(t,e,kst(e)),0);function U4(t,e){let n=t.languageDataAt("commentTokens",e);return n.length?n[0]:{}}const N0=50;function Mst(t,{open:e,close:n},r,i){let o=t.sliceDoc(r-N0,r),a=t.sliceDoc(i,i+N0),s=/\s*$/.exec(o)[0].length,l=/^\s*/.exec(a)[0].length,c=o.length-s;if(o.slice(c-e.length,c)==e&&a.slice(l,l+n.length)==n)return{open:{pos:r-s,margin:s&&1},close:{pos:i+l,margin:l&&1}};let u,f;i-r<=2*N0?u=f=t.sliceDoc(r,i):(u=t.sliceDoc(r,r+N0),f=t.sliceDoc(i-N0,i));let d=/^\s*/.exec(u)[0].length,h=/\s*$/.exec(f)[0].length,p=f.length-h-n.length;return u.slice(d,d+e.length)==e&&f.slice(p,p+n.length)==n?{open:{pos:r+d+e.length,margin:/\s/.test(u.charAt(d+e.length))?1:0},close:{pos:i-h-n.length,margin:/\s/.test(f.charAt(p-1))?1:0}}:null}function kst(t){let e=[];for(let n of t.selection.ranges){let r=t.doc.lineAt(n.from),i=n.to<=r.to?r:t.doc.lineAt(n.to),o=e.length-1;o>=0&&e[o].to>r.from?e[o].to=i.to:e.push({from:r.from+/^\s*/.exec(r.text)[0].length,to:i.to})}return e}function vhe(t,e,n=e.selection.ranges){let r=n.map(o=>U4(e,o.from).block);if(!r.every(o=>o))return null;let i=n.map((o,a)=>Mst(e,r[a],o.from,o.to));if(t!=2&&!i.every(o=>o))return{changes:e.changes(n.map((o,a)=>i[a]?[]:[{from:o.from,insert:r[a].open+" "},{from:o.to,insert:" "+r[a].close}]))};if(t!=1&&i.some(o=>o)){let o=[];for(let a=0,s;a<i.length;a++)if(s=i[a]){let l=r[a],{open:c,close:u}=s;o.push({from:c.pos-l.open.length,to:c.pos+c.margin},{from:u.pos-u.margin,to:u.pos+l.close.length})}return{changes:o}}return null}function Ast(t,e,n=e.selection.ranges){let r=[],i=-1;for(let{from:o,to:a}of n){let s=r.length,l=1e9,c=U4(e,o).line;if(c){for(let u=o;u<=a;){let f=e.doc.lineAt(u);if(f.from>i&&(o==a||a>f.from)){i=f.from;let d=/^\s*/.exec(f.text)[0].length,h=d==f.length,p=f.text.slice(d,d+c.length)==c?d:-1;d<f.text.length&&d<l&&(l=d),r.push({line:f,comment:p,token:c,indent:d,empty:h,single:!1})}u=f.to+1}if(l<1e9)for(let u=s;u<r.length;u++)r[u].indent<r[u].line.text.length&&(r[u].indent=l);r.length==s+1&&(r[s].single=!0)}}if(t!=2&&r.some(o=>o.comment<0&&(!o.empty||o.single))){let o=[];for(let{line:s,token:l,indent:c,empty:u,single:f}of r)(f||!u)&&o.push({from:s.from+c,insert:l+" "});let a=e.changes(o);return{changes:a,selection:e.selection.map(a,1)}}else if(t!=1&&r.some(o=>o.comment>=0)){let o=[];for(let{line:a,comment:s,token:l}of r)if(s>=0){let c=a.from+s,u=c+l.length;a.text[u-a.from]==" "&&u++,o.push({from:c,to:u})}return{changes:o}}return null}const GN=lc.define(),Rst=lc.define(),Ist=ct.define(),yhe=ct.define({combine(t){return cc(t,{minDepth:100,newGroupDelay:500,joinToEvent:(e,n)=>n},{minDepth:Math.max,newGroupDelay:Math.min,joinToEvent:(e,n)=>(r,i)=>e(r,i)||n(r,i)})}}),xhe=mi.define({create(){return Nl.empty},update(t,e){let n=e.state.facet(yhe),r=e.annotation(GN);if(r){let l=Ro.fromTransaction(e,r.selection),c=r.side,u=c==0?t.undone:t.done;return l?u=TE(u,u.length,n.minDepth,l):u=whe(u,e.startState.selection),new Nl(c==0?r.rest:u,c==0?u:r.rest)}let i=e.annotation(Rst);if((i=="full"||i=="before")&&(t=t.isolate()),e.annotation(Ur.addToHistory)===!1)return e.changes.empty?t:t.addMapping(e.changes.desc);let o=Ro.fromTransaction(e),a=e.annotation(Ur.time),s=e.annotation(Ur.userEvent);return o?t=t.addChanges(o,a,s,n,e):e.selection&&(t=t.addSelection(e.startState.selection,a,s,n.newGroupDelay)),(i=="full"||i=="after")&&(t=t.isolate()),t},toJSON(t){return{done:t.done.map(e=>e.toJSON()),undone:t.undone.map(e=>e.toJSON())}},fromJSON(t){return new Nl(t.done.map(Ro.fromJSON),t.undone.map(Ro.fromJSON))}});function Dst(t={}){return[xhe,yhe.of(t),rt.domEventHandlers({beforeinput(e,n){let r=e.inputType=="historyUndo"?bhe:e.inputType=="historyRedo"?HN:null;return r?(e.preventDefault(),r(n)):!1}})]}function J2(t,e){return function({state:n,dispatch:r}){if(!e&&n.readOnly)return!1;let i=n.field(xhe,!1);if(!i)return!1;let o=i.pop(t,n,e);return o?(r(o),!0):!1}}const bhe=J2(0,!1),HN=J2(1,!1),Lst=J2(0,!0),Nst=J2(1,!0);class Ro{constructor(e,n,r,i,o){this.changes=e,this.effects=n,this.mapped=r,this.startSelection=i,this.selectionsAfter=o}setSelAfter(e){return new Ro(this.changes,this.effects,this.mapped,this.startSelection,e)}toJSON(){var e,n,r;return{changes:(e=this.changes)===null||e===void 0?void 0:e.toJSON(),mapped:(n=this.mapped)===null||n===void 0?void 0:n.toJSON(),startSelection:(r=this.startSelection)===null||r===void 0?void 0:r.toJSON(),selectionsAfter:this.selectionsAfter.map(i=>i.toJSON())}}static fromJSON(e){return new Ro(e.changes&&Zr.fromJSON(e.changes),[],e.mapped&&Ql.fromJSON(e.mapped),e.startSelection&&je.fromJSON(e.startSelection),e.selectionsAfter.map(je.fromJSON))}static fromTransaction(e,n){let r=Ka;for(let i of e.startState.facet(Ist)){let o=i(e);o.length&&(r=r.concat(o))}return!r.length&&e.changes.empty?null:new Ro(e.changes.invert(e.startState.doc),r,void 0,n||e.startState.selection,Ka)}static selection(e){return new Ro(void 0,Ka,void 0,void 0,e)}}function TE(t,e,n,r){let i=e+1>n+20?e-n-1:0,o=t.slice(i,e);return o.push(r),o}function $st(t,e){let n=[],r=!1;return t.iterChangedRanges((i,o)=>n.push(i,o)),e.iterChangedRanges((i,o,a,s)=>{for(let l=0;l<n.length;){let c=n[l++],u=n[l++];s>=c&&a<=u&&(r=!0)}}),r}function Fst(t,e){return t.ranges.length==e.ranges.length&&t.ranges.filter((n,r)=>n.empty!=e.ranges[r].empty).length===0}function _he(t,e){return t.length?e.length?t.concat(e):t:e}const Ka=[],jst=200;function whe(t,e){if(t.length){let n=t[t.length-1],r=n.selectionsAfter.slice(Math.max(0,n.selectionsAfter.length-jst));return r.length&&r[r.length-1].eq(e)?t:(r.push(e),TE(t,t.length-1,1e9,n.setSelAfter(r)))}else return[Ro.selection([e])]}function Bst(t){let e=t[t.length-1],n=t.slice();return n[t.length-1]=e.setSelAfter(e.selectionsAfter.slice(0,e.selectionsAfter.length-1)),n}function eI(t,e){if(!t.length)return t;let n=t.length,r=Ka;for(;n;){let i=zst(t[n-1],e,r);if(i.changes&&!i.changes.empty||i.effects.length){let o=t.slice(0,n);return o[n-1]=i,o}else e=i.mapped,n--,r=i.selectionsAfter}return r.length?[Ro.selection(r)]:Ka}function zst(t,e,n){let r=_he(t.selectionsAfter.length?t.selectionsAfter.map(s=>s.map(e)):Ka,n);if(!t.changes)return Ro.selection(r);let i=t.changes.map(e),o=e.mapDesc(t.changes,!0),a=t.mapped?t.mapped.composeDesc(o):o;return new Ro(i,Rt.mapEffects(t.effects,e),a,t.startSelection.map(o),r)}const Ust=/^(input\.type|delete)($|\.)/;class Nl{constructor(e,n,r=0,i=void 0){this.done=e,this.undone=n,this.prevTime=r,this.prevUserEvent=i}isolate(){return this.prevTime?new Nl(this.done,this.undone):this}addChanges(e,n,r,i,o){let a=this.done,s=a[a.length-1];return s&&s.changes&&!s.changes.empty&&e.changes&&(!r||Ust.test(r))&&(!s.selectionsAfter.length&&n-this.prevTime<i.newGroupDelay&&i.joinToEvent(o,$st(s.changes,e.changes))||r=="input.type.compose")?a=TE(a,a.length-1,i.minDepth,new Ro(e.changes.compose(s.changes),_he(e.effects,s.effects),s.mapped,s.startSelection,Ka)):a=TE(a,a.length,i.minDepth,e),new Nl(a,Ka,n,r)}addSelection(e,n,r,i){let o=this.done.length?this.done[this.done.length-1].selectionsAfter:Ka;return o.length>0&&n-this.prevTime<i&&r==this.prevUserEvent&&r&&/^select($|\.)/.test(r)&&Fst(o[o.length-1],e)?this:new Nl(whe(this.done,e),this.undone,n,r)}addMapping(e){return new Nl(eI(this.done,e),eI(this.undone,e),this.prevTime,this.prevUserEvent)}pop(e,n,r){let i=e==0?this.done:this.undone;if(i.length==0)return null;let o=i[i.length-1],a=o.selectionsAfter[0]||n.selection;if(r&&o.selectionsAfter.length)return n.update({selection:o.selectionsAfter[o.selectionsAfter.length-1],annotations:GN.of({side:e,rest:Bst(i),selection:a}),userEvent:e==0?"select.undo":"select.redo",scrollIntoView:!0});if(o.changes){let s=i.length==1?Ka:i.slice(0,i.length-1);return o.mapped&&(s=eI(s,o.mapped)),n.update({changes:o.changes,selection:o.startSelection,effects:o.effects,annotations:GN.of({side:e,rest:s,selection:a}),filter:!1,userEvent:e==0?"undo":"redo",scrollIntoView:!0})}else return null}}Nl.empty=new Nl(Ka,Ka);const Wst=[{key:"Mod-z",run:bhe,preventDefault:!0},{key:"Mod-y",mac:"Mod-Shift-z",run:HN,preventDefault:!0},{linux:"Ctrl-Shift-z",run:HN,preventDefault:!0},{key:"Mod-u",run:Lst,preventDefault:!0},{key:"Alt-u",mac:"Mod-Shift-u",run:Nst,preventDefault:!0}];function ky(t,e){return je.create(t.ranges.map(e),t.mainIndex)}function fc(t,e){return t.update({selection:e,scrollIntoView:!0,userEvent:"select"})}function il({state:t,dispatch:e},n){let r=ky(t.selection,n);return r.eq(t.selection,!0)?!1:(e(fc(t,r)),!0)}function ek(t,e){return je.cursor(e?t.to:t.from)}function She(t,e){return il(t,n=>n.empty?t.moveByChar(n,e):ek(n,e))}function eo(t){return t.textDirectionAt(t.state.selection.main.head)==rr.LTR}const Ohe=t=>She(t,!eo(t)),Che=t=>She(t,eo(t));function The(t,e){return il(t,n=>n.empty?t.moveByGroup(n,e):ek(n,e))}const Vst=t=>The(t,!eo(t)),Gst=t=>The(t,eo(t));function Hst(t,e,n){if(e.type.prop(n))return!0;let r=e.to-e.from;return r&&(r>2||/[^\s,.;:]/.test(t.sliceDoc(e.from,e.to)))||e.firstChild}function tk(t,e,n){let r=fi(t).resolveInner(e.head),i=n?Vt.closedBy:Vt.openedBy;for(let l=e.head;;){let c=n?r.childAfter(l):r.childBefore(l);if(!c)break;Hst(t,c,i)?r=c:l=n?c.to:c.from}let o=r.type.prop(i),a,s;return o&&(a=n?Ll(t,r.from,1):Ll(t,r.to,-1))&&a.matched?s=n?a.end.to:a.end.from:s=n?r.to:r.from,je.cursor(s,n?-1:1)}const qst=t=>il(t,e=>tk(t.state,e,!eo(t))),Xst=t=>il(t,e=>tk(t.state,e,eo(t)));function Ehe(t,e){return il(t,n=>{if(!n.empty)return ek(n,e);let r=t.moveVertically(n,e);return r.head!=n.head?r:t.moveToLineBoundary(n,e)})}const Phe=t=>Ehe(t,!1),Mhe=t=>Ehe(t,!0);function khe(t){let e=t.scrollDOM.clientHeight<t.scrollDOM.scrollHeight-2,n=0,r=0,i;if(e){for(let o of t.state.facet(rt.scrollMargins)){let a=o(t);a!=null&&a.top&&(n=Math.max(a==null?void 0:a.top,n)),a!=null&&a.bottom&&(r=Math.max(a==null?void 0:a.bottom,r))}i=t.scrollDOM.clientHeight-n-r}else i=(t.dom.ownerDocument.defaultView||window).innerHeight;return{marginTop:n,marginBottom:r,selfScroll:e,height:Math.max(t.defaultLineHeight,i-5)}}function Ahe(t,e){let n=khe(t),{state:r}=t,i=ky(r.selection,a=>a.empty?t.moveVertically(a,e,n.height):ek(a,e));if(i.eq(r.selection))return!1;let o;if(n.selfScroll){let a=t.coordsAtPos(r.selection.main.head),s=t.scrollDOM.getBoundingClientRect(),l=s.top+n.marginTop,c=s.bottom-n.marginBottom;a&&a.top>l&&a.bottom<c&&(o=rt.scrollIntoView(i.main.head,{y:"start",yMargin:a.top-l}))}return t.dispatch(fc(r,i),{effects:o}),!0}const vq=t=>Ahe(t,!1),qN=t=>Ahe(t,!0);function Pd(t,e,n){let r=t.lineBlockAt(e.head),i=t.moveToLineBoundary(e,n);if(i.head==e.head&&i.head!=(n?r.to:r.from)&&(i=t.moveToLineBoundary(e,n,!1)),!n&&i.head==r.from&&r.length){let o=/^\s*/.exec(t.state.sliceDoc(r.from,Math.min(r.from+100,r.to)))[0].length;o&&e.head!=r.from+o&&(i=je.cursor(r.from+o))}return i}const Qst=t=>il(t,e=>Pd(t,e,!0)),Yst=t=>il(t,e=>Pd(t,e,!1)),Kst=t=>il(t,e=>Pd(t,e,!eo(t))),Zst=t=>il(t,e=>Pd(t,e,eo(t))),Jst=t=>il(t,e=>je.cursor(t.lineBlockAt(e.head).from,1)),elt=t=>il(t,e=>je.cursor(t.lineBlockAt(e.head).to,-1));function tlt(t,e,n){let r=!1,i=ky(t.selection,o=>{let a=Ll(t,o.head,-1)||Ll(t,o.head,1)||o.head>0&&Ll(t,o.head-1,1)||o.head<t.doc.length&&Ll(t,o.head+1,-1);if(!a||!a.end)return o;r=!0;let s=a.start.from==o.head?a.end.to:a.end.from;return je.cursor(s)});return r?(e(fc(t,i)),!0):!1}const nlt=({state:t,dispatch:e})=>tlt(t,e);function Os(t,e){let n=ky(t.state.selection,r=>{let i=e(r);return je.range(r.anchor,i.head,i.goalColumn,i.bidiLevel||void 0)});return n.eq(t.state.selection)?!1:(t.dispatch(fc(t.state,n)),!0)}function Rhe(t,e){return Os(t,n=>t.moveByChar(n,e))}const Ihe=t=>Rhe(t,!eo(t)),Dhe=t=>Rhe(t,eo(t));function Lhe(t,e){return Os(t,n=>t.moveByGroup(n,e))}const rlt=t=>Lhe(t,!eo(t)),ilt=t=>Lhe(t,eo(t)),olt=t=>Os(t,e=>tk(t.state,e,!eo(t))),alt=t=>Os(t,e=>tk(t.state,e,eo(t)));function Nhe(t,e){return Os(t,n=>t.moveVertically(n,e))}const $he=t=>Nhe(t,!1),Fhe=t=>Nhe(t,!0);function jhe(t,e){return Os(t,n=>t.moveVertically(n,e,khe(t).height))}const yq=t=>jhe(t,!1),xq=t=>jhe(t,!0),slt=t=>Os(t,e=>Pd(t,e,!0)),llt=t=>Os(t,e=>Pd(t,e,!1)),clt=t=>Os(t,e=>Pd(t,e,!eo(t))),ult=t=>Os(t,e=>Pd(t,e,eo(t))),flt=t=>Os(t,e=>je.cursor(t.lineBlockAt(e.head).from)),dlt=t=>Os(t,e=>je.cursor(t.lineBlockAt(e.head).to)),bq=({state:t,dispatch:e})=>(e(fc(t,{anchor:0})),!0),_q=({state:t,dispatch:e})=>(e(fc(t,{anchor:t.doc.length})),!0),wq=({state:t,dispatch:e})=>(e(fc(t,{anchor:t.selection.main.anchor,head:0})),!0),Sq=({state:t,dispatch:e})=>(e(fc(t,{anchor:t.selection.main.anchor,head:t.doc.length})),!0),hlt=({state:t,dispatch:e})=>(e(t.update({selection:{anchor:0,head:t.doc.length},userEvent:"select"})),!0),plt=({state:t,dispatch:e})=>{let n=nk(t).map(({from:r,to:i})=>je.range(r,Math.min(i+1,t.doc.length)));return e(t.update({selection:je.create(n),userEvent:"select"})),!0},mlt=({state:t,dispatch:e})=>{let n=ky(t.selection,r=>{var i;let o=fi(t).resolveStack(r.from,1);for(let a=o;a;a=a.next){let{node:s}=a;if((s.from<r.from&&s.to>=r.to||s.to>r.to&&s.from<=r.from)&&(!((i=s.parent)===null||i===void 0)&&i.parent))return je.range(s.to,s.from)}return r});return e(fc(t,n)),!0},glt=({state:t,dispatch:e})=>{let n=t.selection,r=null;return n.ranges.length>1?r=je.create([n.main]):n.main.empty||(r=je.create([je.cursor(n.main.head)])),r?(e(fc(t,r)),!0):!1};function ww(t,e){if(t.state.readOnly)return!1;let n="delete.selection",{state:r}=t,i=r.changeByRange(o=>{let{from:a,to:s}=o;if(a==s){let l=e(o);l<a?(n="delete.backward",l=lO(t,l,!1)):l>a&&(n="delete.forward",l=lO(t,l,!0)),a=Math.min(a,l),s=Math.max(s,l)}else a=lO(t,a,!1),s=lO(t,s,!0);return a==s?{range:o}:{changes:{from:a,to:s},range:je.cursor(a,a<o.head?-1:1)}});return i.changes.empty?!1:(t.dispatch(r.update(i,{scrollIntoView:!0,userEvent:n,effects:n=="delete.selection"?rt.announce.of(r.phrase("Selection deleted")):void 0})),!0)}function lO(t,e,n){if(t instanceof rt)for(let r of t.state.facet(rt.atomicRanges).map(i=>i(t)))r.between(e,e,(i,o)=>{i<e&&o>e&&(e=n?o:i)});return e}const Bhe=(t,e,n)=>ww(t,r=>{let i=r.from,{state:o}=t,a=o.doc.lineAt(i),s,l;if(n&&!e&&i>a.from&&i<a.from+200&&!/[^ \t]/.test(s=a.text.slice(0,i-a.from))){if(s[s.length-1]=="	")return i-1;let c=My(s,o.tabSize),u=c%SE(o)||SE(o);for(let f=0;f<u&&s[s.length-1-f]==" ";f++)i--;l=i}else l=ki(a.text,i-a.from,e,e)+a.from,l==i&&a.number!=(e?o.doc.lines:1)?l+=e?1:-1:!e&&/[\ufe00-\ufe0f]/.test(a.text.slice(l-a.from,i-a.from))&&(l=ki(a.text,l-a.from,!1,!1)+a.from);return l}),XN=t=>Bhe(t,!1,!0),zhe=t=>Bhe(t,!0,!1),Uhe=(t,e)=>ww(t,n=>{let r=n.head,{state:i}=t,o=i.doc.lineAt(r),a=i.charCategorizer(r);for(let s=null;;){if(r==(e?o.to:o.from)){r==n.head&&o.number!=(e?i.doc.lines:1)&&(r+=e?1:-1);break}let l=ki(o.text,r-o.from,e)+o.from,c=o.text.slice(Math.min(r,l)-o.from,Math.max(r,l)-o.from),u=a(c);if(s!=null&&u!=s)break;(c!=" "||r!=n.head)&&(s=u),r=l}return r}),Whe=t=>Uhe(t,!1),vlt=t=>Uhe(t,!0),ylt=t=>ww(t,e=>{let n=t.lineBlockAt(e.head).to;return e.head<n?n:Math.min(t.state.doc.length,e.head+1)}),xlt=t=>ww(t,e=>{let n=t.moveToLineBoundary(e,!1).head;return e.head>n?n:Math.max(0,e.head-1)}),blt=t=>ww(t,e=>{let n=t.moveToLineBoundary(e,!0).head;return e.head<n?n:Math.min(t.state.doc.length,e.head+1)}),_lt=({state:t,dispatch:e})=>{if(t.readOnly)return!1;let n=t.changeByRange(r=>({changes:{from:r.from,to:r.to,insert:xn.of(["",""])},range:je.cursor(r.from)}));return e(t.update(n,{scrollIntoView:!0,userEvent:"input"})),!0},wlt=({state:t,dispatch:e})=>{if(t.readOnly)return!1;let n=t.changeByRange(r=>{if(!r.empty||r.from==0||r.from==t.doc.length)return{range:r};let i=r.from,o=t.doc.lineAt(i),a=i==o.from?i-1:ki(o.text,i-o.from,!1)+o.from,s=i==o.to?i+1:ki(o.text,i-o.from,!0)+o.from;return{changes:{from:a,to:s,insert:t.doc.slice(i,s).append(t.doc.slice(a,i))},range:je.cursor(s)}});return n.changes.empty?!1:(e(t.update(n,{scrollIntoView:!0,userEvent:"move.character"})),!0)};function nk(t){let e=[],n=-1;for(let r of t.selection.ranges){let i=t.doc.lineAt(r.from),o=t.doc.lineAt(r.to);if(!r.empty&&r.to==o.from&&(o=t.doc.lineAt(r.to-1)),n>=i.number){let a=e[e.length-1];a.to=o.to,a.ranges.push(r)}else e.push({from:i.from,to:o.to,ranges:[r]});n=o.number+1}return e}function Vhe(t,e,n){if(t.readOnly)return!1;let r=[],i=[];for(let o of nk(t)){if(n?o.to==t.doc.length:o.from==0)continue;let a=t.doc.lineAt(n?o.to+1:o.from-1),s=a.length+1;if(n){r.push({from:o.to,to:a.to},{from:o.from,insert:a.text+t.lineBreak});for(let l of o.ranges)i.push(je.range(Math.min(t.doc.length,l.anchor+s),Math.min(t.doc.length,l.head+s)))}else{r.push({from:a.from,to:o.from},{from:o.to,insert:t.lineBreak+a.text});for(let l of o.ranges)i.push(je.range(l.anchor-s,l.head-s))}}return r.length?(e(t.update({changes:r,scrollIntoView:!0,selection:je.create(i,t.selection.mainIndex),userEvent:"move.line"})),!0):!1}const Slt=({state:t,dispatch:e})=>Vhe(t,e,!1),Olt=({state:t,dispatch:e})=>Vhe(t,e,!0);function Ghe(t,e,n){if(t.readOnly)return!1;let r=[];for(let i of nk(t))n?r.push({from:i.from,insert:t.doc.slice(i.from,i.to)+t.lineBreak}):r.push({from:i.to,insert:t.lineBreak+t.doc.slice(i.from,i.to)});return e(t.update({changes:r,scrollIntoView:!0,userEvent:"input.copyline"})),!0}const Clt=({state:t,dispatch:e})=>Ghe(t,e,!1),Tlt=({state:t,dispatch:e})=>Ghe(t,e,!0),Elt=t=>{if(t.state.readOnly)return!1;let{state:e}=t,n=e.changes(nk(e).map(({from:i,to:o})=>(i>0?i--:o<e.doc.length&&o++,{from:i,to:o}))),r=ky(e.selection,i=>{let o;if(t.lineWrapping){let a=t.lineBlockAt(i.head),s=t.coordsAtPos(i.head,i.assoc||1);s&&(o=a.bottom+t.documentTop-s.bottom+t.defaultLineHeight/2)}return t.moveVertically(i,!0,o)}).map(n);return t.dispatch({changes:n,selection:r,scrollIntoView:!0,userEvent:"delete.line"}),!0};function Plt(t,e){if(/\(\)|\[\]|\{\}/.test(t.sliceDoc(e-1,e+1)))return{from:e,to:e};let n=fi(t).resolveInner(e),r=n.childBefore(e),i=n.childAfter(e),o;return r&&i&&r.to<=e&&i.from>=e&&(o=r.type.prop(Vt.closedBy))&&o.indexOf(i.name)>-1&&t.doc.lineAt(r.to).from==t.doc.lineAt(i.from).from&&!/\S/.test(t.sliceDoc(r.to,i.from))?{from:r.to,to:i.from}:null}const Mlt=Hhe(!1),klt=Hhe(!0);function Hhe(t){return({state:e,dispatch:n})=>{if(e.readOnly)return!1;let r=e.changeByRange(i=>{let{from:o,to:a}=i,s=e.doc.lineAt(o),l=!t&&o==a&&Plt(e,o);t&&(o=a=(a<=s.to?s:e.doc.lineAt(a)).to);let c=new K2(e,{simulateBreak:o,simulateDoubleBreak:!!l}),u=$4(c,o);for(u==null&&(u=My(/^\s*/.exec(e.doc.lineAt(o).text)[0],e.tabSize));a<s.to&&/\s/.test(s.text[a-s.from]);)a++;l?{from:o,to:a}=l:o>s.from&&o<s.from+100&&!/\S/.test(s.text.slice(0,o))&&(o=s.from);let f=["",f_(e,u)];return l&&f.push(f_(e,c.lineIndent(s.from,-1))),{changes:{from:o,to:a,insert:xn.of(f)},range:je.cursor(o+1+f[1].length)}});return n(e.update(r,{scrollIntoView:!0,userEvent:"input"})),!0}}function W4(t,e){let n=-1;return t.changeByRange(r=>{let i=[];for(let a=r.from;a<=r.to;){let s=t.doc.lineAt(a);s.number>n&&(r.empty||r.to>s.from)&&(e(s,i,r),n=s.number),a=s.to+1}let o=t.changes(i);return{changes:i,range:je.range(o.mapPos(r.anchor,1),o.mapPos(r.head,1))}})}const Alt=({state:t,dispatch:e})=>{if(t.readOnly)return!1;let n=Object.create(null),r=new K2(t,{overrideIndentation:o=>{let a=n[o];return a??-1}}),i=W4(t,(o,a,s)=>{let l=$4(r,o.from);if(l==null)return;/\S/.test(o.text)||(l=0);let c=/^\s*/.exec(o.text)[0],u=f_(t,l);(c!=u||s.from<o.from+c.length)&&(n[o.from]=l,a.push({from:o.from,to:o.from+c.length,insert:u}))});return i.changes.empty||e(t.update(i,{userEvent:"indent"})),!0},qhe=({state:t,dispatch:e})=>t.readOnly?!1:(e(t.update(W4(t,(n,r)=>{r.push({from:n.from,insert:t.facet(xw)})}),{userEvent:"input.indent"})),!0),Xhe=({state:t,dispatch:e})=>t.readOnly?!1:(e(t.update(W4(t,(n,r)=>{let i=/^\s*/.exec(n.text)[0];if(!i)return;let o=My(i,t.tabSize),a=0,s=f_(t,Math.max(0,o-SE(t)));for(;a<i.length&&a<s.length&&i.charCodeAt(a)==s.charCodeAt(a);)a++;r.push({from:n.from+a,to:n.from+i.length,insert:s.slice(a)})}),{userEvent:"delete.dedent"})),!0),Rlt=t=>(t.setTabFocusMode(),!0),Ilt=[{key:"Ctrl-b",run:Ohe,shift:Ihe,preventDefault:!0},{key:"Ctrl-f",run:Che,shift:Dhe},{key:"Ctrl-p",run:Phe,shift:$he},{key:"Ctrl-n",run:Mhe,shift:Fhe},{key:"Ctrl-a",run:Jst,shift:flt},{key:"Ctrl-e",run:elt,shift:dlt},{key:"Ctrl-d",run:zhe},{key:"Ctrl-h",run:XN},{key:"Ctrl-k",run:ylt},{key:"Ctrl-Alt-h",run:Whe},{key:"Ctrl-o",run:_lt},{key:"Ctrl-t",run:wlt},{key:"Ctrl-v",run:qN}],Dlt=[{key:"ArrowLeft",run:Ohe,shift:Ihe,preventDefault:!0},{key:"Mod-ArrowLeft",mac:"Alt-ArrowLeft",run:Vst,shift:rlt,preventDefault:!0},{mac:"Cmd-ArrowLeft",run:Kst,shift:clt,preventDefault:!0},{key:"ArrowRight",run:Che,shift:Dhe,preventDefault:!0},{key:"Mod-ArrowRight",mac:"Alt-ArrowRight",run:Gst,shift:ilt,preventDefault:!0},{mac:"Cmd-ArrowRight",run:Zst,shift:ult,preventDefault:!0},{key:"ArrowUp",run:Phe,shift:$he,preventDefault:!0},{mac:"Cmd-ArrowUp",run:bq,shift:wq},{mac:"Ctrl-ArrowUp",run:vq,shift:yq},{key:"ArrowDown",run:Mhe,shift:Fhe,preventDefault:!0},{mac:"Cmd-ArrowDown",run:_q,shift:Sq},{mac:"Ctrl-ArrowDown",run:qN,shift:xq},{key:"PageUp",run:vq,shift:yq},{key:"PageDown",run:qN,shift:xq},{key:"Home",run:Yst,shift:llt,preventDefault:!0},{key:"Mod-Home",run:bq,shift:wq},{key:"End",run:Qst,shift:slt,preventDefault:!0},{key:"Mod-End",run:_q,shift:Sq},{key:"Enter",run:Mlt},{key:"Mod-a",run:hlt},{key:"Backspace",run:XN,shift:XN},{key:"Delete",run:zhe},{key:"Mod-Backspace",mac:"Alt-Backspace",run:Whe},{key:"Mod-Delete",mac:"Alt-Delete",run:vlt},{mac:"Mod-Backspace",run:xlt},{mac:"Mod-Delete",run:blt}].concat(Ilt.map(t=>({mac:t.key,run:t.run,shift:t.shift}))),Llt=[{key:"Alt-ArrowLeft",mac:"Ctrl-ArrowLeft",run:qst,shift:olt},{key:"Alt-ArrowRight",mac:"Ctrl-ArrowRight",run:Xst,shift:alt},{key:"Alt-ArrowUp",run:Slt},{key:"Shift-Alt-ArrowUp",run:Clt},{key:"Alt-ArrowDown",run:Olt},{key:"Shift-Alt-ArrowDown",run:Tlt},{key:"Escape",run:glt},{key:"Mod-Enter",run:klt},{key:"Alt-l",mac:"Ctrl-l",run:plt},{key:"Mod-i",run:mlt,preventDefault:!0},{key:"Mod-[",run:Xhe},{key:"Mod-]",run:qhe},{key:"Mod-Alt-\\",run:Alt},{key:"Shift-Mod-k",run:Elt},{key:"Shift-Mod-\\",run:nlt},{key:"Mod-/",run:Cst},{key:"Alt-A",run:Est},{key:"Ctrl-m",mac:"Shift-Alt-m",run:Rlt}].concat(Dlt),Nlt={key:"Tab",run:qhe,shift:Xhe};function zn(){var t=arguments[0];typeof t=="string"&&(t=document.createElement(t));var e=1,n=arguments[1];if(n&&typeof n=="object"&&n.nodeType==null&&!Array.isArray(n)){for(var r in n)if(Object.prototype.hasOwnProperty.call(n,r)){var i=n[r];typeof i=="string"?t.setAttribute(r,i):i!=null&&(t[r]=i)}e++}for(;e<arguments.length;e++)Qhe(t,arguments[e]);return t}function Qhe(t,e){if(typeof e=="string")t.appendChild(document.createTextNode(e));else if(e!=null)if(e.nodeType!=null)t.appendChild(e);else if(Array.isArray(e))for(var n=0;n<e.length;n++)Qhe(t,e[n]);else throw new RangeError("Unsupported child node: "+e)}const Oq=typeof String.prototype.normalize=="function"?t=>t.normalize("NFKD"):t=>t;class pv{constructor(e,n,r=0,i=e.length,o,a){this.test=a,this.value={from:0,to:0},this.done=!1,this.matches=[],this.buffer="",this.bufferPos=0,this.iter=e.iterRange(r,i),this.bufferStart=r,this.normalize=o?s=>o(Oq(s)):Oq,this.query=this.normalize(n)}peek(){if(this.bufferPos==this.buffer.length){if(this.bufferStart+=this.buffer.length,this.iter.next(),this.iter.done)return-1;this.bufferPos=0,this.buffer=this.iter.value}return Ci(this.buffer,this.bufferPos)}next(){for(;this.matches.length;)this.matches.pop();return this.nextOverlapping()}nextOverlapping(){for(;;){let e=this.peek();if(e<0)return this.done=!0,this;let n=x4(e),r=this.bufferStart+this.bufferPos;this.bufferPos+=Ha(e);let i=this.normalize(n);for(let o=0,a=r;;o++){let s=i.charCodeAt(o),l=this.match(s,a,this.bufferPos+this.bufferStart);if(o==i.length-1){if(l)return this.value=l,this;break}a==r&&o<n.length&&n.charCodeAt(o)==s&&a++}}}match(e,n,r){let i=null;for(let o=0;o<this.matches.length;o+=2){let a=this.matches[o],s=!1;this.query.charCodeAt(a)==e&&(a==this.query.length-1?i={from:this.matches[o+1],to:r}:(this.matches[o]++,s=!0)),s||(this.matches.splice(o,2),o-=2)}return this.query.charCodeAt(0)==e&&(this.query.length==1?i={from:n,to:r}:this.matches.push(1,n)),i&&this.test&&!this.test(i.from,i.to,this.buffer,this.bufferStart)&&(i=null),i}}typeof Symbol<"u"&&(pv.prototype[Symbol.iterator]=function(){return this});const Yhe={from:-1,to:-1,match:/.*/.exec("")},V4="gm"+(/x/.unicode==null?"":"u");class Khe{constructor(e,n,r,i=0,o=e.length){if(this.text=e,this.to=o,this.curLine="",this.done=!1,this.value=Yhe,/\\[sWDnr]|\n|\r|\[\^/.test(n))return new Zhe(e,n,r,i,o);this.re=new RegExp(n,V4+(r!=null&&r.ignoreCase?"i":"")),this.test=r==null?void 0:r.test,this.iter=e.iter();let a=e.lineAt(i);this.curLineStart=a.from,this.matchPos=EE(e,i),this.getLine(this.curLineStart)}getLine(e){this.iter.next(e),this.iter.lineBreak?this.curLine="":(this.curLine=this.iter.value,this.curLineStart+this.curLine.length>this.to&&(this.curLine=this.curLine.slice(0,this.to-this.curLineStart)),this.iter.next())}nextLine(){this.curLineStart=this.curLineStart+this.curLine.length+1,this.curLineStart>this.to?this.curLine="":this.getLine(0)}next(){for(let e=this.matchPos-this.curLineStart;;){this.re.lastIndex=e;let n=this.matchPos<=this.to&&this.re.exec(this.curLine);if(n){let r=this.curLineStart+n.index,i=r+n[0].length;if(this.matchPos=EE(this.text,i+(r==i?1:0)),r==this.curLineStart+this.curLine.length&&this.nextLine(),(r<i||r>this.value.to)&&(!this.test||this.test(r,i,n)))return this.value={from:r,to:i,match:n},this;e=this.matchPos-this.curLineStart}else if(this.curLineStart+this.curLine.length<this.to)this.nextLine(),e=0;else return this.done=!0,this}}}const tI=new WeakMap;class Ig{constructor(e,n){this.from=e,this.text=n}get to(){return this.from+this.text.length}static get(e,n,r){let i=tI.get(e);if(!i||i.from>=r||i.to<=n){let s=new Ig(n,e.sliceString(n,r));return tI.set(e,s),s}if(i.from==n&&i.to==r)return i;let{text:o,from:a}=i;return a>n&&(o=e.sliceString(n,a)+o,a=n),i.to<r&&(o+=e.sliceString(i.to,r)),tI.set(e,new Ig(a,o)),new Ig(n,o.slice(n-a,r-a))}}class Zhe{constructor(e,n,r,i,o){this.text=e,this.to=o,this.done=!1,this.value=Yhe,this.matchPos=EE(e,i),this.re=new RegExp(n,V4+(r!=null&&r.ignoreCase?"i":"")),this.test=r==null?void 0:r.test,this.flat=Ig.get(e,i,this.chunkEnd(i+5e3))}chunkEnd(e){return e>=this.to?this.to:this.text.lineAt(e).to}next(){for(;;){let e=this.re.lastIndex=this.matchPos-this.flat.from,n=this.re.exec(this.flat.text);if(n&&!n[0]&&n.index==e&&(this.re.lastIndex=e+1,n=this.re.exec(this.flat.text)),n){let r=this.flat.from+n.index,i=r+n[0].length;if((this.flat.to>=this.to||n.index+n[0].length<=this.flat.text.length-10)&&(!this.test||this.test(r,i,n)))return this.value={from:r,to:i,match:n},this.matchPos=EE(this.text,i+(r==i?1:0)),this}if(this.flat.to==this.to)return this.done=!0,this;this.flat=Ig.get(this.text,this.flat.from,this.chunkEnd(this.flat.from+this.flat.text.length*2))}}}typeof Symbol<"u"&&(Khe.prototype[Symbol.iterator]=Zhe.prototype[Symbol.iterator]=function(){return this});function $lt(t){try{return new RegExp(t,V4),!0}catch{return!1}}function EE(t,e){if(e>=t.length)return e;let n=t.lineAt(e),r;for(;e<n.to&&(r=n.text.charCodeAt(e-n.from))>=56320&&r<57344;)e++;return e}function QN(t){let e=String(t.state.doc.lineAt(t.state.selection.main.head).number),n=zn("input",{class:"cm-textfield",name:"line",value:e}),r=zn("form",{class:"cm-gotoLine",onkeydown:o=>{o.keyCode==27?(o.preventDefault(),t.dispatch({effects:PE.of(!1)}),t.focus()):o.keyCode==13&&(o.preventDefault(),i())},onsubmit:o=>{o.preventDefault(),i()}},zn("label",t.state.phrase("Go to line"),": ",n)," ",zn("button",{class:"cm-button",type:"submit"},t.state.phrase("go")));function i(){let o=/^([+-])?(\d+)?(:\d+)?(%)?$/.exec(n.value);if(!o)return;let{state:a}=t,s=a.doc.lineAt(a.selection.main.head),[,l,c,u,f]=o,d=u?+u.slice(1):0,h=c?+c:s.number;if(c&&f){let g=h/100;l&&(g=g*(l=="-"?-1:1)+s.number/a.doc.lines),h=Math.round(a.doc.lines*g)}else c&&l&&(h=h*(l=="-"?-1:1)+s.number);let p=a.doc.line(Math.max(1,Math.min(a.doc.lines,h))),m=je.cursor(p.from+Math.max(0,Math.min(d,p.length)));t.dispatch({effects:[PE.of(!1),rt.scrollIntoView(m.from,{y:"center"})],selection:m}),t.focus()}return{dom:r}}const PE=Rt.define(),Cq=mi.define({create(){return!0},update(t,e){for(let n of e.effects)n.is(PE)&&(t=n.value);return t},provide:t=>l_.from(t,e=>e?QN:null)}),Flt=t=>{let e=s_(t,QN);if(!e){let n=[PE.of(!0)];t.state.field(Cq,!1)==null&&n.push(Rt.appendConfig.of([Cq,jlt])),t.dispatch({effects:n}),e=s_(t,QN)}return e&&e.dom.querySelector("input").select(),!0},jlt=rt.baseTheme({".cm-panel.cm-gotoLine":{padding:"2px 6px 4px","& label":{fontSize:"80%"}}}),Blt={highlightWordAroundCursor:!1,minSelectionLength:1,maxMatches:100,wholeWords:!1},zlt=ct.define({combine(t){return cc(t,Blt,{highlightWordAroundCursor:(e,n)=>e||n,minSelectionLength:Math.min,maxMatches:Math.min})}});function Ult(t){return[qlt,Hlt]}const Wlt=gt.mark({class:"cm-selectionMatch"}),Vlt=gt.mark({class:"cm-selectionMatch cm-selectionMatch-main"});function Tq(t,e,n,r){return(n==0||t(e.sliceDoc(n-1,n))!=fr.Word)&&(r==e.doc.length||t(e.sliceDoc(r,r+1))!=fr.Word)}function Glt(t,e,n,r){return t(e.sliceDoc(n,n+1))==fr.Word&&t(e.sliceDoc(r-1,r))==fr.Word}const Hlt=kr.fromClass(class{constructor(t){this.decorations=this.getDeco(t)}update(t){(t.selectionSet||t.docChanged||t.viewportChanged)&&(this.decorations=this.getDeco(t.view))}getDeco(t){let e=t.state.facet(zlt),{state:n}=t,r=n.selection;if(r.ranges.length>1)return gt.none;let i=r.main,o,a=null;if(i.empty){if(!e.highlightWordAroundCursor)return gt.none;let l=n.wordAt(i.head);if(!l)return gt.none;a=n.charCategorizer(i.head),o=n.sliceDoc(l.from,l.to)}else{let l=i.to-i.from;if(l<e.minSelectionLength||l>200)return gt.none;if(e.wholeWords){if(o=n.sliceDoc(i.from,i.to),a=n.charCategorizer(i.head),!(Tq(a,n,i.from,i.to)&&Glt(a,n,i.from,i.to)))return gt.none}else if(o=n.sliceDoc(i.from,i.to),!o)return gt.none}let s=[];for(let l of t.visibleRanges){let c=new pv(n.doc,o,l.from,l.to);for(;!c.next().done;){let{from:u,to:f}=c.value;if((!a||Tq(a,n,u,f))&&(i.empty&&u<=i.from&&f>=i.to?s.push(Vlt.range(u,f)):(u>=i.to||f<=i.from)&&s.push(Wlt.range(u,f)),s.length>e.maxMatches))return gt.none}}return gt.set(s)}},{decorations:t=>t.decorations}),qlt=rt.baseTheme({".cm-selectionMatch":{backgroundColor:"#99ff7780"},".cm-searchMatch .cm-selectionMatch":{backgroundColor:"transparent"}}),Xlt=({state:t,dispatch:e})=>{let{selection:n}=t,r=je.create(n.ranges.map(i=>t.wordAt(i.head)||je.cursor(i.head)),n.mainIndex);return r.eq(n)?!1:(e(t.update({selection:r})),!0)};function Qlt(t,e){let{main:n,ranges:r}=t.selection,i=t.wordAt(n.head),o=i&&i.from==n.from&&i.to==n.to;for(let a=!1,s=new pv(t.doc,e,r[r.length-1].to);;)if(s.next(),s.done){if(a)return null;s=new pv(t.doc,e,0,Math.max(0,r[r.length-1].from-1)),a=!0}else{if(a&&r.some(l=>l.from==s.value.from))continue;if(o){let l=t.wordAt(s.value.from);if(!l||l.from!=s.value.from||l.to!=s.value.to)continue}return s.value}}const Ylt=({state:t,dispatch:e})=>{let{ranges:n}=t.selection;if(n.some(o=>o.from===o.to))return Xlt({state:t,dispatch:e});let r=t.sliceDoc(n[0].from,n[0].to);if(t.selection.ranges.some(o=>t.sliceDoc(o.from,o.to)!=r))return!1;let i=Qlt(t,r);return i?(e(t.update({selection:t.selection.addRange(je.range(i.from,i.to),!1),effects:rt.scrollIntoView(i.to)})),!0):!1},Ay=ct.define({combine(t){return cc(t,{top:!1,caseSensitive:!1,literal:!1,regexp:!1,wholeWord:!1,createPanel:e=>new lct(e),scrollToMatch:e=>rt.scrollIntoView(e)})}});class Jhe{constructor(e){this.search=e.search,this.caseSensitive=!!e.caseSensitive,this.literal=!!e.literal,this.regexp=!!e.regexp,this.replace=e.replace||"",this.valid=!!this.search&&(!this.regexp||$lt(this.search)),this.unquoted=this.unquote(this.search),this.wholeWord=!!e.wholeWord}unquote(e){return this.literal?e:e.replace(/\\([nrt\\])/g,(n,r)=>r=="n"?`
`:r=="r"?"\r":r=="t"?"	":"\\")}eq(e){return this.search==e.search&&this.replace==e.replace&&this.caseSensitive==e.caseSensitive&&this.regexp==e.regexp&&this.wholeWord==e.wholeWord}create(){return this.regexp?new ect(this):new Zlt(this)}getCursor(e,n=0,r){let i=e.doc?e:en.create({doc:e});return r==null&&(r=i.doc.length),this.regexp?Wm(this,i,n,r):Um(this,i,n,r)}}class epe{constructor(e){this.spec=e}}function Um(t,e,n,r){return new pv(e.doc,t.unquoted,n,r,t.caseSensitive?void 0:i=>i.toLowerCase(),t.wholeWord?Klt(e.doc,e.charCategorizer(e.selection.main.head)):void 0)}function Klt(t,e){return(n,r,i,o)=>((o>n||o+i.length<r)&&(o=Math.max(0,n-2),i=t.sliceString(o,Math.min(t.length,r+2))),(e(ME(i,n-o))!=fr.Word||e(kE(i,n-o))!=fr.Word)&&(e(kE(i,r-o))!=fr.Word||e(ME(i,r-o))!=fr.Word))}class Zlt extends epe{constructor(e){super(e)}nextMatch(e,n,r){let i=Um(this.spec,e,r,e.doc.length).nextOverlapping();return i.done&&(i=Um(this.spec,e,0,n).nextOverlapping()),i.done?null:i.value}prevMatchInRange(e,n,r){for(let i=r;;){let o=Math.max(n,i-1e4-this.spec.unquoted.length),a=Um(this.spec,e,o,i),s=null;for(;!a.nextOverlapping().done;)s=a.value;if(s)return s;if(o==n)return null;i-=1e4}}prevMatch(e,n,r){return this.prevMatchInRange(e,0,n)||this.prevMatchInRange(e,r,e.doc.length)}getReplacement(e){return this.spec.unquote(this.spec.replace)}matchAll(e,n){let r=Um(this.spec,e,0,e.doc.length),i=[];for(;!r.next().done;){if(i.length>=n)return null;i.push(r.value)}return i}highlight(e,n,r,i){let o=Um(this.spec,e,Math.max(0,n-this.spec.unquoted.length),Math.min(r+this.spec.unquoted.length,e.doc.length));for(;!o.next().done;)i(o.value.from,o.value.to)}}function Wm(t,e,n,r){return new Khe(e.doc,t.search,{ignoreCase:!t.caseSensitive,test:t.wholeWord?Jlt(e.charCategorizer(e.selection.main.head)):void 0},n,r)}function ME(t,e){return t.slice(ki(t,e,!1),e)}function kE(t,e){return t.slice(e,ki(t,e))}function Jlt(t){return(e,n,r)=>!r[0].length||(t(ME(r.input,r.index))!=fr.Word||t(kE(r.input,r.index))!=fr.Word)&&(t(kE(r.input,r.index+r[0].length))!=fr.Word||t(ME(r.input,r.index+r[0].length))!=fr.Word)}class ect extends epe{nextMatch(e,n,r){let i=Wm(this.spec,e,r,e.doc.length).next();return i.done&&(i=Wm(this.spec,e,0,n).next()),i.done?null:i.value}prevMatchInRange(e,n,r){for(let i=1;;i++){let o=Math.max(n,r-i*1e4),a=Wm(this.spec,e,o,r),s=null;for(;!a.next().done;)s=a.value;if(s&&(o==n||s.from>o+10))return s;if(o==n)return null}}prevMatch(e,n,r){return this.prevMatchInRange(e,0,n)||this.prevMatchInRange(e,r,e.doc.length)}getReplacement(e){return this.spec.unquote(this.spec.replace).replace(/\$([$&\d+])/g,(n,r)=>r=="$"?"$":r=="&"?e.match[0]:r!="0"&&+r<e.match.length?e.match[r]:n)}matchAll(e,n){let r=Wm(this.spec,e,0,e.doc.length),i=[];for(;!r.next().done;){if(i.length>=n)return null;i.push(r.value)}return i}highlight(e,n,r,i){let o=Wm(this.spec,e,Math.max(0,n-250),Math.min(r+250,e.doc.length));for(;!o.next().done;)i(o.value.from,o.value.to)}}const d_=Rt.define(),G4=Rt.define(),Wf=mi.define({create(t){return new nI(YN(t).create(),null)},update(t,e){for(let n of e.effects)n.is(d_)?t=new nI(n.value.create(),t.panel):n.is(G4)&&(t=new nI(t.query,n.value?H4:null));return t},provide:t=>l_.from(t,e=>e.panel)});class nI{constructor(e,n){this.query=e,this.panel=n}}const tct=gt.mark({class:"cm-searchMatch"}),nct=gt.mark({class:"cm-searchMatch cm-searchMatch-selected"}),rct=kr.fromClass(class{constructor(t){this.view=t,this.decorations=this.highlight(t.state.field(Wf))}update(t){let e=t.state.field(Wf);(e!=t.startState.field(Wf)||t.docChanged||t.selectionSet||t.viewportChanged)&&(this.decorations=this.highlight(e))}highlight({query:t,panel:e}){if(!e||!t.spec.valid)return gt.none;let{view:n}=this,r=new id;for(let i=0,o=n.visibleRanges,a=o.length;i<a;i++){let{from:s,to:l}=o[i];for(;i<a-1&&l>o[i+1].from-2*250;)l=o[++i].to;t.highlight(n.state,s,l,(c,u)=>{let f=n.state.selection.ranges.some(d=>d.from==c&&d.to==u);r.add(c,u,f?nct:tct)})}return r.finish()}},{decorations:t=>t.decorations});function Sw(t){return e=>{let n=e.state.field(Wf,!1);return n&&n.query.spec.valid?t(e,n):rpe(e)}}const AE=Sw((t,{query:e})=>{let{to:n}=t.state.selection.main,r=e.nextMatch(t.state,n,n);if(!r)return!1;let i=je.single(r.from,r.to),o=t.state.facet(Ay);return t.dispatch({selection:i,effects:[q4(t,r),o.scrollToMatch(i.main,t)],userEvent:"select.search"}),npe(t),!0}),RE=Sw((t,{query:e})=>{let{state:n}=t,{from:r}=n.selection.main,i=e.prevMatch(n,r,r);if(!i)return!1;let o=je.single(i.from,i.to),a=t.state.facet(Ay);return t.dispatch({selection:o,effects:[q4(t,i),a.scrollToMatch(o.main,t)],userEvent:"select.search"}),npe(t),!0}),ict=Sw((t,{query:e})=>{let n=e.matchAll(t.state,1e3);return!n||!n.length?!1:(t.dispatch({selection:je.create(n.map(r=>je.range(r.from,r.to))),userEvent:"select.search.matches"}),!0)}),oct=({state:t,dispatch:e})=>{let n=t.selection;if(n.ranges.length>1||n.main.empty)return!1;let{from:r,to:i}=n.main,o=[],a=0;for(let s=new pv(t.doc,t.sliceDoc(r,i));!s.next().done;){if(o.length>1e3)return!1;s.value.from==r&&(a=o.length),o.push(je.range(s.value.from,s.value.to))}return e(t.update({selection:je.create(o,a),userEvent:"select.search.matches"})),!0},Eq=Sw((t,{query:e})=>{let{state:n}=t,{from:r,to:i}=n.selection.main;if(n.readOnly)return!1;let o=e.nextMatch(n,r,r);if(!o)return!1;let a=[],s,l,c=[];if(o.from==r&&o.to==i&&(l=n.toText(e.getReplacement(o)),a.push({from:o.from,to:o.to,insert:l}),o=e.nextMatch(n,o.from,o.to),c.push(rt.announce.of(n.phrase("replaced match on line $",n.doc.lineAt(r).number)+"."))),o){let u=a.length==0||a[0].from>=o.to?0:o.to-o.from-l.length;s=je.single(o.from-u,o.to-u),c.push(q4(t,o)),c.push(n.facet(Ay).scrollToMatch(s.main,t))}return t.dispatch({changes:a,selection:s,effects:c,userEvent:"input.replace"}),!0}),act=Sw((t,{query:e})=>{if(t.state.readOnly)return!1;let n=e.matchAll(t.state,1e9).map(i=>{let{from:o,to:a}=i;return{from:o,to:a,insert:e.getReplacement(i)}});if(!n.length)return!1;let r=t.state.phrase("replaced $ matches",n.length)+".";return t.dispatch({changes:n,effects:rt.announce.of(r),userEvent:"input.replace.all"}),!0});function H4(t){return t.state.facet(Ay).createPanel(t)}function YN(t,e){var n,r,i,o,a;let s=t.selection.main,l=s.empty||s.to>s.from+100?"":t.sliceDoc(s.from,s.to);if(e&&!l)return e;let c=t.facet(Ay);return new Jhe({search:((n=e==null?void 0:e.literal)!==null&&n!==void 0?n:c.literal)?l:l.replace(/\n/g,"\\n"),caseSensitive:(r=e==null?void 0:e.caseSensitive)!==null&&r!==void 0?r:c.caseSensitive,literal:(i=e==null?void 0:e.literal)!==null&&i!==void 0?i:c.literal,regexp:(o=e==null?void 0:e.regexp)!==null&&o!==void 0?o:c.regexp,wholeWord:(a=e==null?void 0:e.wholeWord)!==null&&a!==void 0?a:c.wholeWord})}function tpe(t){let e=s_(t,H4);return e&&e.dom.querySelector("[main-field]")}function npe(t){let e=tpe(t);e&&e==t.root.activeElement&&e.select()}const rpe=t=>{let e=t.state.field(Wf,!1);if(e&&e.panel){let n=tpe(t);if(n&&n!=t.root.activeElement){let r=YN(t.state,e.query.spec);r.valid&&t.dispatch({effects:d_.of(r)}),n.focus(),n.select()}}else t.dispatch({effects:[G4.of(!0),e?d_.of(YN(t.state,e.query.spec)):Rt.appendConfig.of(uct)]});return!0},ipe=t=>{let e=t.state.field(Wf,!1);if(!e||!e.panel)return!1;let n=s_(t,H4);return n&&n.dom.contains(t.root.activeElement)&&t.focus(),t.dispatch({effects:G4.of(!1)}),!0},sct=[{key:"Mod-f",run:rpe,scope:"editor search-panel"},{key:"F3",run:AE,shift:RE,scope:"editor search-panel",preventDefault:!0},{key:"Mod-g",run:AE,shift:RE,scope:"editor search-panel",preventDefault:!0},{key:"Escape",run:ipe,scope:"editor search-panel"},{key:"Mod-Shift-l",run:oct},{key:"Mod-Alt-g",run:Flt},{key:"Mod-d",run:Ylt,preventDefault:!0}];class lct{constructor(e){this.view=e;let n=this.query=e.state.field(Wf).query.spec;this.commit=this.commit.bind(this),this.searchField=zn("input",{value:n.search,placeholder:Yo(e,"Find"),"aria-label":Yo(e,"Find"),class:"cm-textfield",name:"search",form:"","main-field":"true",onchange:this.commit,onkeyup:this.commit}),this.replaceField=zn("input",{value:n.replace,placeholder:Yo(e,"Replace"),"aria-label":Yo(e,"Replace"),class:"cm-textfield",name:"replace",form:"",onchange:this.commit,onkeyup:this.commit}),this.caseField=zn("input",{type:"checkbox",name:"case",form:"",checked:n.caseSensitive,onchange:this.commit}),this.reField=zn("input",{type:"checkbox",name:"re",form:"",checked:n.regexp,onchange:this.commit}),this.wordField=zn("input",{type:"checkbox",name:"word",form:"",checked:n.wholeWord,onchange:this.commit});function r(i,o,a){return zn("button",{class:"cm-button",name:i,onclick:o,type:"button"},a)}this.dom=zn("div",{onkeydown:i=>this.keydown(i),class:"cm-search"},[this.searchField,r("next",()=>AE(e),[Yo(e,"next")]),r("prev",()=>RE(e),[Yo(e,"previous")]),r("select",()=>ict(e),[Yo(e,"all")]),zn("label",null,[this.caseField,Yo(e,"match case")]),zn("label",null,[this.reField,Yo(e,"regexp")]),zn("label",null,[this.wordField,Yo(e,"by word")]),...e.state.readOnly?[]:[zn("br"),this.replaceField,r("replace",()=>Eq(e),[Yo(e,"replace")]),r("replaceAll",()=>act(e),[Yo(e,"replace all")])],zn("button",{name:"close",onclick:()=>ipe(e),"aria-label":Yo(e,"close"),type:"button"},["×"])])}commit(){let e=new Jhe({search:this.searchField.value,caseSensitive:this.caseField.checked,regexp:this.reField.checked,wholeWord:this.wordField.checked,replace:this.replaceField.value});e.eq(this.query)||(this.query=e,this.view.dispatch({effects:d_.of(e)}))}keydown(e){vot(this.view,e,"search-panel")?e.preventDefault():e.keyCode==13&&e.target==this.searchField?(e.preventDefault(),(e.shiftKey?RE:AE)(this.view)):e.keyCode==13&&e.target==this.replaceField&&(e.preventDefault(),Eq(this.view))}update(e){for(let n of e.transactions)for(let r of n.effects)r.is(d_)&&!r.value.eq(this.query)&&this.setQuery(r.value)}setQuery(e){this.query=e,this.searchField.value=e.search,this.replaceField.value=e.replace,this.caseField.checked=e.caseSensitive,this.reField.checked=e.regexp,this.wordField.checked=e.wholeWord}mount(){this.searchField.select()}get pos(){return 80}get top(){return this.view.state.facet(Ay).top}}function Yo(t,e){return t.state.phrase(e)}const cO=30,uO=/[\s\.,:;?!]/;function q4(t,{from:e,to:n}){let r=t.state.doc.lineAt(e),i=t.state.doc.lineAt(n).to,o=Math.max(r.from,e-cO),a=Math.min(i,n+cO),s=t.state.sliceDoc(o,a);if(o!=r.from){for(let l=0;l<cO;l++)if(!uO.test(s[l+1])&&uO.test(s[l])){s=s.slice(l);break}}if(a!=i){for(let l=s.length-1;l>s.length-cO;l--)if(!uO.test(s[l-1])&&uO.test(s[l])){s=s.slice(0,l);break}}return rt.announce.of(`${t.state.phrase("current match")}. ${s} ${t.state.phrase("on line")} ${r.number}.`)}const cct=rt.baseTheme({".cm-panel.cm-search":{padding:"2px 6px 4px",position:"relative","& [name=close]":{position:"absolute",top:"0",right:"4px",backgroundColor:"inherit",border:"none",font:"inherit",padding:0,margin:0},"& input, & button, & label":{margin:".2em .6em .2em 0"},"& input[type=checkbox]":{marginRight:".2em"},"& label":{fontSize:"80%",whiteSpace:"pre"}},"&light .cm-searchMatch":{backgroundColor:"#ffff0054"},"&dark .cm-searchMatch":{backgroundColor:"#00ffff8a"},"&light .cm-searchMatch-selected":{backgroundColor:"#ff6a0054"},"&dark .cm-searchMatch-selected":{backgroundColor:"#ff00ff8a"}}),uct=[Wf,Ed.low(rct),cct];class ope{constructor(e,n,r,i){this.state=e,this.pos=n,this.explicit=r,this.view=i,this.abortListeners=[],this.abortOnDocChange=!1}tokenBefore(e){let n=fi(this.state).resolveInner(this.pos,-1);for(;n&&e.indexOf(n.name)<0;)n=n.parent;return n?{from:n.from,to:this.pos,text:this.state.sliceDoc(n.from,this.pos),type:n.type}:null}matchBefore(e){let n=this.state.doc.lineAt(this.pos),r=Math.max(n.from,this.pos-250),i=n.text.slice(r-n.from,this.pos-n.from),o=i.search(spe(e,!1));return o<0?null:{from:r+o,to:this.pos,text:i.slice(o)}}get aborted(){return this.abortListeners==null}addEventListener(e,n,r){e=="abort"&&this.abortListeners&&(this.abortListeners.push(n),r&&r.onDocChange&&(this.abortOnDocChange=!0))}}function Pq(t){let e=Object.keys(t).join(""),n=/\w/.test(e);return n&&(e=e.replace(/\w/g,"")),`[${n?"\\w":""}${e.replace(/[^\w\s]/g,"\\$&")}]`}function fct(t){let e=Object.create(null),n=Object.create(null);for(let{label:i}of t){e[i[0]]=!0;for(let o=1;o<i.length;o++)n[i[o]]=!0}let r=Pq(e)+Pq(n)+"*$";return[new RegExp("^"+r),new RegExp(r)]}function ape(t){let e=t.map(i=>typeof i=="string"?{label:i}:i),[n,r]=e.every(i=>/^\w+$/.test(i.label))?[/\w*$/,/\w+$/]:fct(e);return i=>{let o=i.matchBefore(r);return o||i.explicit?{from:o?o.from:i.pos,options:e,validFor:n}:null}}function dct(t,e){return n=>{for(let r=fi(n.state).resolveInner(n.pos,-1);r;r=r.parent){if(t.indexOf(r.name)>-1)return null;if(r.type.isTop)break}return e(n)}}class Mq{constructor(e,n,r,i){this.completion=e,this.source=n,this.match=r,this.score=i}}function Vf(t){return t.selection.main.from}function spe(t,e){var n;let{source:r}=t,i=e&&r[0]!="^",o=r[r.length-1]!="$";return!i&&!o?t:new RegExp(`${i?"^":""}(?:${r})${o?"$":""}`,(n=t.flags)!==null&&n!==void 0?n:t.ignoreCase?"i":"")}const X4=lc.define();function hct(t,e,n,r){let{main:i}=t.selection,o=n-i.from,a=r-i.from;return Object.assign(Object.assign({},t.changeByRange(s=>s!=i&&n!=r&&t.sliceDoc(s.from+o,s.from+a)!=t.sliceDoc(n,r)?{range:s}:{changes:{from:s.from+o,to:r==i.from?s.to:s.from+a,insert:e},range:je.cursor(s.from+o+e.length)})),{scrollIntoView:!0,userEvent:"input.complete"})}const kq=new WeakMap;function pct(t){if(!Array.isArray(t))return t;let e=kq.get(t);return e||kq.set(t,e=ape(t)),e}const IE=Rt.define(),h_=Rt.define();class mct{constructor(e){this.pattern=e,this.chars=[],this.folded=[],this.any=[],this.precise=[],this.byWord=[],this.score=0,this.matched=[];for(let n=0;n<e.length;){let r=Ci(e,n),i=Ha(r);this.chars.push(r);let o=e.slice(n,n+i),a=o.toUpperCase();this.folded.push(Ci(a==o?o.toLowerCase():a,0)),n+=i}this.astral=e.length!=this.chars.length}ret(e,n){return this.score=e,this.matched=n,this}match(e){if(this.pattern.length==0)return this.ret(-100,[]);if(e.length<this.pattern.length)return null;let{chars:n,folded:r,any:i,precise:o,byWord:a}=this;if(n.length==1){let y=Ci(e,0),x=Ha(y),b=x==e.length?0:-100;if(y!=n[0])if(y==r[0])b+=-200;else return null;return this.ret(b,[0,x])}let s=e.indexOf(this.pattern);if(s==0)return this.ret(e.length==this.pattern.length?0:-100,[0,this.pattern.length]);let l=n.length,c=0;if(s<0){for(let y=0,x=Math.min(e.length,200);y<x&&c<l;){let b=Ci(e,y);(b==n[c]||b==r[c])&&(i[c++]=y),y+=Ha(b)}if(c<l)return null}let u=0,f=0,d=!1,h=0,p=-1,m=-1,g=/[a-z]/.test(e),v=!0;for(let y=0,x=Math.min(e.length,200),b=0;y<x&&f<l;){let _=Ci(e,y);s<0&&(u<l&&_==n[u]&&(o[u++]=y),h<l&&(_==n[h]||_==r[h]?(h==0&&(p=y),m=y+1,h++):h=0));let S,O=_<255?_>=48&&_<=57||_>=97&&_<=122?2:_>=65&&_<=90?1:0:(S=x4(_))!=S.toLowerCase()?1:S!=S.toUpperCase()?2:0;(!y||O==1&&g||b==0&&O!=0)&&(n[f]==_||r[f]==_&&(d=!0)?a[f++]=y:a.length&&(v=!1)),b=O,y+=Ha(_)}return f==l&&a[0]==0&&v?this.result(-100+(d?-200:0),a,e):h==l&&p==0?this.ret(-200-e.length+(m==e.length?0:-100),[0,m]):s>-1?this.ret(-700-e.length,[s,s+this.pattern.length]):h==l?this.ret(-900-e.length,[p,m]):f==l?this.result(-100+(d?-200:0)+-700+(v?0:-1100),a,e):n.length==2?null:this.result((i[0]?-700:0)+-200+-1100,i,e)}result(e,n,r){let i=[],o=0;for(let a of n){let s=a+(this.astral?Ha(Ci(r,a)):1);o&&i[o-1]==a?i[o-1]=s:(i[o++]=a,i[o++]=s)}return this.ret(e-r.length,i)}}class gct{constructor(e){this.pattern=e,this.matched=[],this.score=0,this.folded=e.toLowerCase()}match(e){if(e.length<this.pattern.length)return null;let n=e.slice(0,this.pattern.length),r=n==this.pattern?0:n.toLowerCase()==this.folded?-200:null;return r==null?null:(this.matched=[0,n.length],this.score=r+(e.length==this.pattern.length?0:-100),this)}}const Mi=ct.define({combine(t){return cc(t,{activateOnTyping:!0,activateOnCompletion:()=>!1,activateOnTypingDelay:100,selectOnOpen:!0,override:null,closeOnBlur:!0,maxRenderedOptions:100,defaultKeymap:!0,tooltipClass:()=>"",optionClass:()=>"",aboveCursor:!1,icons:!0,addToOptions:[],positionInfo:vct,filterStrict:!1,compareCompletions:(e,n)=>e.label.localeCompare(n.label),interactionDelay:75,updateSyncTime:100},{defaultKeymap:(e,n)=>e&&n,closeOnBlur:(e,n)=>e&&n,icons:(e,n)=>e&&n,tooltipClass:(e,n)=>r=>Aq(e(r),n(r)),optionClass:(e,n)=>r=>Aq(e(r),n(r)),addToOptions:(e,n)=>e.concat(n),filterStrict:(e,n)=>e||n})}});function Aq(t,e){return t?e?t+" "+e:t:e}function vct(t,e,n,r,i,o){let a=t.textDirection==rr.RTL,s=a,l=!1,c="top",u,f,d=e.left-i.left,h=i.right-e.right,p=r.right-r.left,m=r.bottom-r.top;if(s&&d<Math.min(p,h)?s=!1:!s&&h<Math.min(p,d)&&(s=!0),p<=(s?d:h))u=Math.max(i.top,Math.min(n.top,i.bottom-m))-e.top,f=Math.min(400,s?d:h);else{l=!0,f=Math.min(400,(a?e.right:i.right-e.left)-30);let y=i.bottom-e.bottom;y>=m||y>e.top?u=n.bottom-e.top:(c="bottom",u=e.bottom-n.top)}let g=(e.bottom-e.top)/o.offsetHeight,v=(e.right-e.left)/o.offsetWidth;return{style:`${c}: ${u/g}px; max-width: ${f/v}px`,class:"cm-completionInfo-"+(l?a?"left-narrow":"right-narrow":s?"left":"right")}}function yct(t){let e=t.addToOptions.slice();return t.icons&&e.push({render(n){let r=document.createElement("div");return r.classList.add("cm-completionIcon"),n.type&&r.classList.add(...n.type.split(/\s+/g).map(i=>"cm-completionIcon-"+i)),r.setAttribute("aria-hidden","true"),r},position:20}),e.push({render(n,r,i,o){let a=document.createElement("span");a.className="cm-completionLabel";let s=n.displayLabel||n.label,l=0;for(let c=0;c<o.length;){let u=o[c++],f=o[c++];u>l&&a.appendChild(document.createTextNode(s.slice(l,u)));let d=a.appendChild(document.createElement("span"));d.appendChild(document.createTextNode(s.slice(u,f))),d.className="cm-completionMatchedText",l=f}return l<s.length&&a.appendChild(document.createTextNode(s.slice(l))),a},position:50},{render(n){if(!n.detail)return null;let r=document.createElement("span");return r.className="cm-completionDetail",r.textContent=n.detail,r},position:80}),e.sort((n,r)=>n.position-r.position).map(n=>n.render)}function rI(t,e,n){if(t<=n)return{from:0,to:t};if(e<0&&(e=0),e<=t>>1){let i=Math.floor(e/n);return{from:i*n,to:(i+1)*n}}let r=Math.floor((t-e)/n);return{from:t-(r+1)*n,to:t-r*n}}class xct{constructor(e,n,r){this.view=e,this.stateField=n,this.applyCompletion=r,this.info=null,this.infoDestroy=null,this.placeInfoReq={read:()=>this.measureInfo(),write:l=>this.placeInfo(l),key:this},this.space=null,this.currentClass="";let i=e.state.field(n),{options:o,selected:a}=i.open,s=e.state.facet(Mi);this.optionContent=yct(s),this.optionClass=s.optionClass,this.tooltipClass=s.tooltipClass,this.range=rI(o.length,a,s.maxRenderedOptions),this.dom=document.createElement("div"),this.dom.className="cm-tooltip-autocomplete",this.updateTooltipClass(e.state),this.dom.addEventListener("mousedown",l=>{let{options:c}=e.state.field(n).open;for(let u=l.target,f;u&&u!=this.dom;u=u.parentNode)if(u.nodeName=="LI"&&(f=/-(\d+)$/.exec(u.id))&&+f[1]<c.length){this.applyCompletion(e,c[+f[1]]),l.preventDefault();return}}),this.dom.addEventListener("focusout",l=>{let c=e.state.field(this.stateField,!1);c&&c.tooltip&&e.state.facet(Mi).closeOnBlur&&l.relatedTarget!=e.contentDOM&&e.dispatch({effects:h_.of(null)})}),this.showOptions(o,i.id)}mount(){this.updateSel()}showOptions(e,n){this.list&&this.list.remove(),this.list=this.dom.appendChild(this.createListBox(e,n,this.range)),this.list.addEventListener("scroll",()=>{this.info&&this.view.requestMeasure(this.placeInfoReq)})}update(e){var n;let r=e.state.field(this.stateField),i=e.startState.field(this.stateField);if(this.updateTooltipClass(e.state),r!=i){let{options:o,selected:a,disabled:s}=r.open;(!i.open||i.open.options!=o)&&(this.range=rI(o.length,a,e.state.facet(Mi).maxRenderedOptions),this.showOptions(o,r.id)),this.updateSel(),s!=((n=i.open)===null||n===void 0?void 0:n.disabled)&&this.dom.classList.toggle("cm-tooltip-autocomplete-disabled",!!s)}}updateTooltipClass(e){let n=this.tooltipClass(e);if(n!=this.currentClass){for(let r of this.currentClass.split(" "))r&&this.dom.classList.remove(r);for(let r of n.split(" "))r&&this.dom.classList.add(r);this.currentClass=n}}positioned(e){this.space=e,this.info&&this.view.requestMeasure(this.placeInfoReq)}updateSel(){let e=this.view.state.field(this.stateField),n=e.open;if((n.selected>-1&&n.selected<this.range.from||n.selected>=this.range.to)&&(this.range=rI(n.options.length,n.selected,this.view.state.facet(Mi).maxRenderedOptions),this.showOptions(n.options,e.id)),this.updateSelectedOption(n.selected)){this.destroyInfo();let{completion:r}=n.options[n.selected],{info:i}=r;if(!i)return;let o=typeof i=="string"?document.createTextNode(i):i(r);if(!o)return;"then"in o?o.then(a=>{a&&this.view.state.field(this.stateField,!1)==e&&this.addInfoPane(a,r)}).catch(a=>Ao(this.view.state,a,"completion info")):this.addInfoPane(o,r)}}addInfoPane(e,n){this.destroyInfo();let r=this.info=document.createElement("div");if(r.className="cm-tooltip cm-completionInfo",e.nodeType!=null)r.appendChild(e),this.infoDestroy=null;else{let{dom:i,destroy:o}=e;r.appendChild(i),this.infoDestroy=o||null}this.dom.appendChild(r),this.view.requestMeasure(this.placeInfoReq)}updateSelectedOption(e){let n=null;for(let r=this.list.firstChild,i=this.range.from;r;r=r.nextSibling,i++)r.nodeName!="LI"||!r.id?i--:i==e?r.hasAttribute("aria-selected")||(r.setAttribute("aria-selected","true"),n=r):r.hasAttribute("aria-selected")&&r.removeAttribute("aria-selected");return n&&_ct(this.list,n),n}measureInfo(){let e=this.dom.querySelector("[aria-selected]");if(!e||!this.info)return null;let n=this.dom.getBoundingClientRect(),r=this.info.getBoundingClientRect(),i=e.getBoundingClientRect(),o=this.space;if(!o){let a=this.dom.ownerDocument.defaultView||window;o={left:0,top:0,right:a.innerWidth,bottom:a.innerHeight}}return i.top>Math.min(o.bottom,n.bottom)-10||i.bottom<Math.max(o.top,n.top)+10?null:this.view.state.facet(Mi).positionInfo(this.view,n,i,r,o,this.dom)}placeInfo(e){this.info&&(e?(e.style&&(this.info.style.cssText=e.style),this.info.className="cm-tooltip cm-completionInfo "+(e.class||"")):this.info.style.cssText="top: -1e6px")}createListBox(e,n,r){const i=document.createElement("ul");i.id=n,i.setAttribute("role","listbox"),i.setAttribute("aria-expanded","true"),i.setAttribute("aria-label",this.view.state.phrase("Completions"));let o=null;for(let a=r.from;a<r.to;a++){let{completion:s,match:l}=e[a],{section:c}=s;if(c){let d=typeof c=="string"?c:c.name;if(d!=o&&(a>r.from||r.from==0))if(o=d,typeof c!="string"&&c.header)i.appendChild(c.header(c));else{let h=i.appendChild(document.createElement("completion-section"));h.textContent=d}}const u=i.appendChild(document.createElement("li"));u.id=n+"-"+a,u.setAttribute("role","option");let f=this.optionClass(s);f&&(u.className=f);for(let d of this.optionContent){let h=d(s,this.view.state,this.view,l);h&&u.appendChild(h)}}return r.from&&i.classList.add("cm-completionListIncompleteTop"),r.to<e.length&&i.classList.add("cm-completionListIncompleteBottom"),i}destroyInfo(){this.info&&(this.infoDestroy&&this.infoDestroy(),this.info.remove(),this.info=null)}destroy(){this.destroyInfo()}}function bct(t,e){return n=>new xct(n,t,e)}function _ct(t,e){let n=t.getBoundingClientRect(),r=e.getBoundingClientRect(),i=n.height/t.offsetHeight;r.top<n.top?t.scrollTop-=(n.top-r.top)/i:r.bottom>n.bottom&&(t.scrollTop+=(r.bottom-n.bottom)/i)}function Rq(t){return(t.boost||0)*100+(t.apply?10:0)+(t.info?5:0)+(t.type?1:0)}function wct(t,e){let n=[],r=null,i=c=>{n.push(c);let{section:u}=c.completion;if(u){r||(r=[]);let f=typeof u=="string"?u:u.name;r.some(d=>d.name==f)||r.push(typeof u=="string"?{name:f}:u)}},o=e.facet(Mi);for(let c of t)if(c.hasResult()){let u=c.result.getMatch;if(c.result.filter===!1)for(let f of c.result.options)i(new Mq(f,c.source,u?u(f):[],1e9-n.length));else{let f=e.sliceDoc(c.from,c.to),d,h=o.filterStrict?new gct(f):new mct(f);for(let p of c.result.options)if(d=h.match(p.label)){let m=p.displayLabel?u?u(p,d.matched):[]:d.matched;i(new Mq(p,c.source,m,d.score+(p.boost||0)))}}}if(r){let c=Object.create(null),u=0,f=(d,h)=>{var p,m;return((p=d.rank)!==null&&p!==void 0?p:1e9)-((m=h.rank)!==null&&m!==void 0?m:1e9)||(d.name<h.name?-1:1)};for(let d of r.sort(f))u-=1e5,c[d.name]=u;for(let d of n){let{section:h}=d.completion;h&&(d.score+=c[typeof h=="string"?h:h.name])}}let a=[],s=null,l=o.compareCompletions;for(let c of n.sort((u,f)=>f.score-u.score||l(u.completion,f.completion))){let u=c.completion;!s||s.label!=u.label||s.detail!=u.detail||s.type!=null&&u.type!=null&&s.type!=u.type||s.apply!=u.apply||s.boost!=u.boost?a.push(c):Rq(c.completion)>Rq(s)&&(a[a.length-1]=c),s=c.completion}return a}class ag{constructor(e,n,r,i,o,a){this.options=e,this.attrs=n,this.tooltip=r,this.timestamp=i,this.selected=o,this.disabled=a}setSelected(e,n){return e==this.selected||e>=this.options.length?this:new ag(this.options,Iq(n,e),this.tooltip,this.timestamp,e,this.disabled)}static build(e,n,r,i,o){let a=wct(e,n);if(!a.length)return i&&e.some(l=>l.state==1)?new ag(i.options,i.attrs,i.tooltip,i.timestamp,i.selected,!0):null;let s=n.facet(Mi).selectOnOpen?0:-1;if(i&&i.selected!=s&&i.selected!=-1){let l=i.options[i.selected].completion;for(let c=0;c<a.length;c++)if(a[c].completion==l){s=c;break}}return new ag(a,Iq(r,s),{pos:e.reduce((l,c)=>c.hasResult()?Math.min(l,c.from):l,1e8),create:Pct,above:o.aboveCursor},i?i.timestamp:Date.now(),s,!1)}map(e){return new ag(this.options,this.attrs,Object.assign(Object.assign({},this.tooltip),{pos:e.mapPos(this.tooltip.pos)}),this.timestamp,this.selected,this.disabled)}}class DE{constructor(e,n,r){this.active=e,this.id=n,this.open=r}static start(){return new DE(Tct,"cm-ac-"+Math.floor(Math.random()*2e6).toString(36),null)}update(e){let{state:n}=e,r=n.facet(Mi),o=(r.override||n.languageDataAt("autocomplete",Vf(n)).map(pct)).map(s=>(this.active.find(c=>c.source==s)||new da(s,this.active.some(c=>c.state!=0)?1:0)).update(e,r));o.length==this.active.length&&o.every((s,l)=>s==this.active[l])&&(o=this.active);let a=this.open;a&&e.docChanged&&(a=a.map(e.changes)),e.selection||o.some(s=>s.hasResult()&&e.changes.touchesRange(s.from,s.to))||!Sct(o,this.active)?a=ag.build(o,n,this.id,a,r):a&&a.disabled&&!o.some(s=>s.state==1)&&(a=null),!a&&o.every(s=>s.state!=1)&&o.some(s=>s.hasResult())&&(o=o.map(s=>s.hasResult()?new da(s.source,0):s));for(let s of e.effects)s.is(upe)&&(a=a&&a.setSelected(s.value,this.id));return o==this.active&&a==this.open?this:new DE(o,this.id,a)}get tooltip(){return this.open?this.open.tooltip:null}get attrs(){return this.open?this.open.attrs:this.active.length?Oct:Cct}}function Sct(t,e){if(t==e)return!0;for(let n=0,r=0;;){for(;n<t.length&&!t[n].hasResult;)n++;for(;r<e.length&&!e[r].hasResult;)r++;let i=n==t.length,o=r==e.length;if(i||o)return i==o;if(t[n++].result!=e[r++].result)return!1}}const Oct={"aria-autocomplete":"list"},Cct={};function Iq(t,e){let n={"aria-autocomplete":"list","aria-haspopup":"listbox","aria-controls":t};return e>-1&&(n["aria-activedescendant"]=t+"-"+e),n}const Tct=[];function lpe(t,e){if(t.isUserEvent("input.complete")){let r=t.annotation(X4);if(r&&e.activateOnCompletion(r))return 12}let n=t.isUserEvent("input.type");return n&&e.activateOnTyping?5:n?1:t.isUserEvent("delete.backward")?2:t.selection?8:t.docChanged?16:0}class da{constructor(e,n,r=-1){this.source=e,this.state=n,this.explicitPos=r}hasResult(){return!1}update(e,n){let r=lpe(e,n),i=this;(r&8||r&16&&this.touches(e))&&(i=new da(i.source,0)),r&4&&i.state==0&&(i=new da(this.source,1)),i=i.updateFor(e,r);for(let o of e.effects)if(o.is(IE))i=new da(i.source,1,o.value?Vf(e.state):-1);else if(o.is(h_))i=new da(i.source,0);else if(o.is(cpe))for(let a of o.value)a.source==i.source&&(i=a);return i}updateFor(e,n){return this.map(e.changes)}map(e){return e.empty||this.explicitPos<0?this:new da(this.source,this.state,e.mapPos(this.explicitPos))}touches(e){return e.changes.touchesRange(Vf(e.state))}}class Dg extends da{constructor(e,n,r,i,o){super(e,2,n),this.result=r,this.from=i,this.to=o}hasResult(){return!0}updateFor(e,n){var r;if(!(n&3))return this.map(e.changes);let i=this.result;i.map&&!e.changes.empty&&(i=i.map(i,e.changes));let o=e.changes.mapPos(this.from),a=e.changes.mapPos(this.to,1),s=Vf(e.state);if((this.explicitPos<0?s<=o:s<this.from)||s>a||!i||n&2&&Vf(e.startState)==this.from)return new da(this.source,n&4?1:0);let l=this.explicitPos<0?-1:e.changes.mapPos(this.explicitPos);return Ect(i.validFor,e.state,o,a)?new Dg(this.source,l,i,o,a):i.update&&(i=i.update(i,o,a,new ope(e.state,s,l>=0)))?new Dg(this.source,l,i,i.from,(r=i.to)!==null&&r!==void 0?r:Vf(e.state)):new da(this.source,1,l)}map(e){return e.empty?this:(this.result.map?this.result.map(this.result,e):this.result)?new Dg(this.source,this.explicitPos<0?-1:e.mapPos(this.explicitPos),this.result,e.mapPos(this.from),e.mapPos(this.to,1)):new da(this.source,0)}touches(e){return e.changes.touchesRange(this.from,this.to)}}function Ect(t,e,n,r){if(!t)return!1;let i=e.sliceDoc(n,r);return typeof t=="function"?t(i,n,r,e):spe(t,!0).test(i)}const cpe=Rt.define({map(t,e){return t.map(n=>n.map(e))}}),upe=Rt.define(),To=mi.define({create(){return DE.start()},update(t,e){return t.update(e)},provide:t=>[A4.from(t,e=>e.tooltip),rt.contentAttributes.from(t,e=>e.attrs)]});function Q4(t,e){const n=e.completion.apply||e.completion.label;let r=t.state.field(To).active.find(i=>i.source==e.source);return r instanceof Dg?(typeof n=="string"?t.dispatch(Object.assign(Object.assign({},hct(t.state,n,r.from,r.to)),{annotations:X4.of(e.completion)})):n(t,e.completion,r.from,r.to),!0):!1}const Pct=bct(To,Q4);function fO(t,e="option"){return n=>{let r=n.state.field(To,!1);if(!r||!r.open||r.open.disabled||Date.now()-r.open.timestamp<n.state.facet(Mi).interactionDelay)return!1;let i=1,o;e=="page"&&(o=Wde(n,r.open.tooltip))&&(i=Math.max(2,Math.floor(o.dom.offsetHeight/o.dom.querySelector("li").offsetHeight)-1));let{length:a}=r.open.options,s=r.open.selected>-1?r.open.selected+i*(t?1:-1):t?0:a-1;return s<0?s=e=="page"?0:a-1:s>=a&&(s=e=="page"?a-1:0),n.dispatch({effects:upe.of(s)}),!0}}const Mct=t=>{let e=t.state.field(To,!1);return t.state.readOnly||!e||!e.open||e.open.selected<0||e.open.disabled||Date.now()-e.open.timestamp<t.state.facet(Mi).interactionDelay?!1:Q4(t,e.open.options[e.open.selected])},kct=t=>t.state.field(To,!1)?(t.dispatch({effects:IE.of(!0)}),!0):!1,Act=t=>{let e=t.state.field(To,!1);return!e||!e.active.some(n=>n.state!=0)?!1:(t.dispatch({effects:h_.of(null)}),!0)};class Rct{constructor(e,n){this.active=e,this.context=n,this.time=Date.now(),this.updates=[],this.done=void 0}}const Ict=50,Dct=1e3,Lct=kr.fromClass(class{constructor(t){this.view=t,this.debounceUpdate=-1,this.running=[],this.debounceAccept=-1,this.pendingStart=!1,this.composing=0;for(let e of t.state.field(To).active)e.state==1&&this.startQuery(e)}update(t){let e=t.state.field(To),n=t.state.facet(Mi);if(!t.selectionSet&&!t.docChanged&&t.startState.field(To)==e)return;let r=t.transactions.some(o=>{let a=lpe(o,n);return a&8||(o.selection||o.docChanged)&&!(a&3)});for(let o=0;o<this.running.length;o++){let a=this.running[o];if(r||a.context.abortOnDocChange&&t.docChanged||a.updates.length+t.transactions.length>Ict&&Date.now()-a.time>Dct){for(let s of a.context.abortListeners)try{s()}catch(l){Ao(this.view.state,l)}a.context.abortListeners=null,this.running.splice(o--,1)}else a.updates.push(...t.transactions)}this.debounceUpdate>-1&&clearTimeout(this.debounceUpdate),t.transactions.some(o=>o.effects.some(a=>a.is(IE)))&&(this.pendingStart=!0);let i=this.pendingStart?50:n.activateOnTypingDelay;if(this.debounceUpdate=e.active.some(o=>o.state==1&&!this.running.some(a=>a.active.source==o.source))?setTimeout(()=>this.startUpdate(),i):-1,this.composing!=0)for(let o of t.transactions)o.isUserEvent("input.type")?this.composing=2:this.composing==2&&o.selection&&(this.composing=3)}startUpdate(){this.debounceUpdate=-1,this.pendingStart=!1;let{state:t}=this.view,e=t.field(To);for(let n of e.active)n.state==1&&!this.running.some(r=>r.active.source==n.source)&&this.startQuery(n)}startQuery(t){let{state:e}=this.view,n=Vf(e),r=new ope(e,n,t.explicitPos==n,this.view),i=new Rct(t,r);this.running.push(i),Promise.resolve(t.source(r)).then(o=>{i.context.aborted||(i.done=o||null,this.scheduleAccept())},o=>{this.view.dispatch({effects:h_.of(null)}),Ao(this.view.state,o)})}scheduleAccept(){this.running.every(t=>t.done!==void 0)?this.accept():this.debounceAccept<0&&(this.debounceAccept=setTimeout(()=>this.accept(),this.view.state.facet(Mi).updateSyncTime))}accept(){var t;this.debounceAccept>-1&&clearTimeout(this.debounceAccept),this.debounceAccept=-1;let e=[],n=this.view.state.facet(Mi);for(let r=0;r<this.running.length;r++){let i=this.running[r];if(i.done===void 0)continue;if(this.running.splice(r--,1),i.done){let a=new Dg(i.active.source,i.active.explicitPos,i.done,i.done.from,(t=i.done.to)!==null&&t!==void 0?t:Vf(i.updates.length?i.updates[0].startState:this.view.state));for(let s of i.updates)a=a.update(s,n);if(a.hasResult()){e.push(a);continue}}let o=this.view.state.field(To).active.find(a=>a.source==i.active.source);if(o&&o.state==1)if(i.done==null){let a=new da(i.active.source,0);for(let s of i.updates)a=a.update(s,n);a.state!=1&&e.push(a)}else this.startQuery(o)}e.length&&this.view.dispatch({effects:cpe.of(e)})}},{eventHandlers:{blur(t){let e=this.view.state.field(To,!1);if(e&&e.tooltip&&this.view.state.facet(Mi).closeOnBlur){let n=e.open&&Wde(this.view,e.open.tooltip);(!n||!n.dom.contains(t.relatedTarget))&&setTimeout(()=>this.view.dispatch({effects:h_.of(null)}),10)}},compositionstart(){this.composing=1},compositionend(){this.composing==3&&setTimeout(()=>this.view.dispatch({effects:IE.of(!1)}),20),this.composing=0}}}),Nct=typeof navigator=="object"&&/Win/.test(navigator.platform),$ct=Ed.highest(rt.domEventHandlers({keydown(t,e){let n=e.state.field(To,!1);if(!n||!n.open||n.open.disabled||n.open.selected<0||t.key.length>1||t.ctrlKey&&!(Nct&&t.altKey)||t.metaKey)return!1;let r=n.open.options[n.open.selected],i=n.active.find(a=>a.source==r.source),o=r.completion.commitCharacters||i.result.commitCharacters;return o&&o.indexOf(t.key)>-1&&Q4(e,r),!1}})),fpe=rt.baseTheme({".cm-tooltip.cm-tooltip-autocomplete":{"& > ul":{fontFamily:"monospace",whiteSpace:"nowrap",overflow:"hidden auto",maxWidth_fallback:"700px",maxWidth:"min(700px, 95vw)",minWidth:"250px",maxHeight:"10em",height:"100%",listStyle:"none",margin:0,padding:0,"& > li, & > completion-section":{padding:"1px 3px",lineHeight:1.2},"& > li":{overflowX:"hidden",textOverflow:"ellipsis",cursor:"pointer"},"& > completion-section":{display:"list-item",borderBottom:"1px solid silver",paddingLeft:"0.5em",opacity:.7}}},"&light .cm-tooltip-autocomplete ul li[aria-selected]":{background:"#17c",color:"white"},"&light .cm-tooltip-autocomplete-disabled ul li[aria-selected]":{background:"#777"},"&dark .cm-tooltip-autocomplete ul li[aria-selected]":{background:"#347",color:"white"},"&dark .cm-tooltip-autocomplete-disabled ul li[aria-selected]":{background:"#444"},".cm-completionListIncompleteTop:before, .cm-completionListIncompleteBottom:after":{content:'"···"',opacity:.5,display:"block",textAlign:"center"},".cm-tooltip.cm-completionInfo":{position:"absolute",padding:"3px 9px",width:"max-content",maxWidth:"400px",boxSizing:"border-box",whiteSpace:"pre-line"},".cm-completionInfo.cm-completionInfo-left":{right:"100%"},".cm-completionInfo.cm-completionInfo-right":{left:"100%"},".cm-completionInfo.cm-completionInfo-left-narrow":{right:"30px"},".cm-completionInfo.cm-completionInfo-right-narrow":{left:"30px"},"&light .cm-snippetField":{backgroundColor:"#00000022"},"&dark .cm-snippetField":{backgroundColor:"#ffffff22"},".cm-snippetFieldPosition":{verticalAlign:"text-top",width:0,height:"1.15em",display:"inline-block",margin:"0 -0.7px -.7em",borderLeft:"1.4px dotted #888"},".cm-completionMatchedText":{textDecoration:"underline"},".cm-completionDetail":{marginLeft:"0.5em",fontStyle:"italic"},".cm-completionIcon":{fontSize:"90%",width:".8em",display:"inline-block",textAlign:"center",paddingRight:".6em",opacity:"0.6",boxSizing:"content-box"},".cm-completionIcon-function, .cm-completionIcon-method":{"&:after":{content:"'ƒ'"}},".cm-completionIcon-class":{"&:after":{content:"'○'"}},".cm-completionIcon-interface":{"&:after":{content:"'◌'"}},".cm-completionIcon-variable":{"&:after":{content:"'𝑥'"}},".cm-completionIcon-constant":{"&:after":{content:"'𝐶'"}},".cm-completionIcon-type":{"&:after":{content:"'𝑡'"}},".cm-completionIcon-enum":{"&:after":{content:"'∪'"}},".cm-completionIcon-property":{"&:after":{content:"'□'"}},".cm-completionIcon-keyword":{"&:after":{content:"'🔑︎'"}},".cm-completionIcon-namespace":{"&:after":{content:"'▢'"}},".cm-completionIcon-text":{"&:after":{content:"'abc'",fontSize:"50%",verticalAlign:"middle"}}});class Fct{constructor(e,n,r,i){this.field=e,this.line=n,this.from=r,this.to=i}}class Y4{constructor(e,n,r){this.field=e,this.from=n,this.to=r}map(e){let n=e.mapPos(this.from,-1,Pi.TrackDel),r=e.mapPos(this.to,1,Pi.TrackDel);return n==null||r==null?null:new Y4(this.field,n,r)}}class K4{constructor(e,n){this.lines=e,this.fieldPositions=n}instantiate(e,n){let r=[],i=[n],o=e.doc.lineAt(n),a=/^\s*/.exec(o.text)[0];for(let l of this.lines){if(r.length){let c=a,u=/^\t*/.exec(l)[0].length;for(let f=0;f<u;f++)c+=e.facet(xw);i.push(n+c.length-u),l=c+l.slice(u)}r.push(l),n+=l.length+1}let s=this.fieldPositions.map(l=>new Y4(l.field,i[l.line]+l.from,i[l.line]+l.to));return{text:r,ranges:s}}static parse(e){let n=[],r=[],i=[],o;for(let a of e.split(/\r\n?|\n/)){for(;o=/[#$]\{(?:(\d+)(?::([^}]*))?|((?:\\[{}]|[^}])*))\}/.exec(a);){let s=o[1]?+o[1]:null,l=o[2]||o[3]||"",c=-1,u=l.replace(/\\[{}]/g,f=>f[1]);for(let f=0;f<n.length;f++)(s!=null?n[f].seq==s:u&&n[f].name==u)&&(c=f);if(c<0){let f=0;for(;f<n.length&&(s==null||n[f].seq!=null&&n[f].seq<s);)f++;n.splice(f,0,{seq:s,name:u}),c=f;for(let d of i)d.field>=c&&d.field++}i.push(new Fct(c,r.length,o.index,o.index+u.length)),a=a.slice(0,o.index)+l+a.slice(o.index+o[0].length)}a=a.replace(/\\([{}])/g,(s,l,c)=>{for(let u of i)u.line==r.length&&u.from>c&&(u.from--,u.to--);return l}),r.push(a)}return new K4(r,i)}}let jct=gt.widget({widget:new class extends uc{toDOM(){let t=document.createElement("span");return t.className="cm-snippetFieldPosition",t}ignoreEvent(){return!1}}}),Bct=gt.mark({class:"cm-snippetField"});class Ry{constructor(e,n){this.ranges=e,this.active=n,this.deco=gt.set(e.map(r=>(r.from==r.to?jct:Bct).range(r.from,r.to)))}map(e){let n=[];for(let r of this.ranges){let i=r.map(e);if(!i)return null;n.push(i)}return new Ry(n,this.active)}selectionInsideField(e){return e.ranges.every(n=>this.ranges.some(r=>r.field==this.active&&r.from<=n.from&&r.to>=n.to))}}const Ow=Rt.define({map(t,e){return t&&t.map(e)}}),zct=Rt.define(),p_=mi.define({create(){return null},update(t,e){for(let n of e.effects){if(n.is(Ow))return n.value;if(n.is(zct)&&t)return new Ry(t.ranges,n.value)}return t&&e.docChanged&&(t=t.map(e.changes)),t&&e.selection&&!t.selectionInsideField(e.selection)&&(t=null),t},provide:t=>rt.decorations.from(t,e=>e?e.deco:gt.none)});function Z4(t,e){return je.create(t.filter(n=>n.field==e).map(n=>je.range(n.from,n.to)))}function Uct(t){let e=K4.parse(t);return(n,r,i,o)=>{let{text:a,ranges:s}=e.instantiate(n.state,i),l={changes:{from:i,to:o,insert:xn.of(a)},scrollIntoView:!0,annotations:r?[X4.of(r),Ur.userEvent.of("input.complete")]:void 0};if(s.length&&(l.selection=Z4(s,0)),s.some(c=>c.field>0)){let c=new Ry(s,0),u=l.effects=[Ow.of(c)];n.state.field(p_,!1)===void 0&&u.push(Rt.appendConfig.of([p_,qct,Xct,fpe]))}n.dispatch(n.state.update(l))}}function dpe(t){return({state:e,dispatch:n})=>{let r=e.field(p_,!1);if(!r||t<0&&r.active==0)return!1;let i=r.active+t,o=t>0&&!r.ranges.some(a=>a.field==i+t);return n(e.update({selection:Z4(r.ranges,i),effects:Ow.of(o?null:new Ry(r.ranges,i)),scrollIntoView:!0})),!0}}const Wct=({state:t,dispatch:e})=>t.field(p_,!1)?(e(t.update({effects:Ow.of(null)})),!0):!1,Vct=dpe(1),Gct=dpe(-1),Hct=[{key:"Tab",run:Vct,shift:Gct},{key:"Escape",run:Wct}],Dq=ct.define({combine(t){return t.length?t[0]:Hct}}),qct=Ed.highest(vw.compute([Dq],t=>t.facet(Dq)));function yc(t,e){return Object.assign(Object.assign({},e),{apply:Uct(t)})}const Xct=rt.domEventHandlers({mousedown(t,e){let n=e.state.field(p_,!1),r;if(!n||(r=e.posAtCoords({x:t.clientX,y:t.clientY}))==null)return!1;let i=n.ranges.find(o=>o.from<=r&&o.to>=r);return!i||i.field==n.active?!1:(e.dispatch({selection:Z4(n.ranges,i.field),effects:Ow.of(n.ranges.some(o=>o.field>i.field)?new Ry(n.ranges,i.field):null),scrollIntoView:!0}),!0)}}),m_={brackets:["(","[","{","'",'"'],before:")]}:;>",stringPrefixes:[]},Oh=Rt.define({map(t,e){let n=e.mapPos(t,-1,Pi.TrackAfter);return n??void 0}}),J4=new class extends sp{};J4.startSide=1;J4.endSide=-1;const hpe=mi.define({create(){return sn.empty},update(t,e){if(t=t.map(e.changes),e.selection){let n=e.state.doc.lineAt(e.selection.main.head);t=t.update({filter:r=>r>=n.from&&r<=n.to})}for(let n of e.effects)n.is(Oh)&&(t=t.update({add:[J4.range(n.value,n.value+1)]}));return t}});function Qct(){return[Kct,hpe]}const iI="()[]{}<>";function ppe(t){for(let e=0;e<iI.length;e+=2)if(iI.charCodeAt(e)==t)return iI.charAt(e+1);return x4(t<128?t:t+1)}function mpe(t,e){return t.languageDataAt("closeBrackets",e)[0]||m_}const Yct=typeof navigator=="object"&&/Android\b/.test(navigator.userAgent),Kct=rt.inputHandler.of((t,e,n,r)=>{if((Yct?t.composing:t.compositionStarted)||t.state.readOnly)return!1;let i=t.state.selection.main;if(r.length>2||r.length==2&&Ha(Ci(r,0))==1||e!=i.from||n!=i.to)return!1;let o=eut(t.state,r);return o?(t.dispatch(o),!0):!1}),Zct=({state:t,dispatch:e})=>{if(t.readOnly)return!1;let r=mpe(t,t.selection.main.head).brackets||m_.brackets,i=null,o=t.changeByRange(a=>{if(a.empty){let s=tut(t.doc,a.head);for(let l of r)if(l==s&&rk(t.doc,a.head)==ppe(Ci(l,0)))return{changes:{from:a.head-l.length,to:a.head+l.length},range:je.cursor(a.head-l.length)}}return{range:i=a}});return i||e(t.update(o,{scrollIntoView:!0,userEvent:"delete.backward"})),!i},Jct=[{key:"Backspace",run:Zct}];function eut(t,e){let n=mpe(t,t.selection.main.head),r=n.brackets||m_.brackets;for(let i of r){let o=ppe(Ci(i,0));if(e==i)return o==i?iut(t,i,r.indexOf(i+i+i)>-1,n):nut(t,i,o,n.before||m_.before);if(e==o&&gpe(t,t.selection.main.from))return rut(t,i,o)}return null}function gpe(t,e){let n=!1;return t.field(hpe).between(0,t.doc.length,r=>{r==e&&(n=!0)}),n}function rk(t,e){let n=t.sliceString(e,e+2);return n.slice(0,Ha(Ci(n,0)))}function tut(t,e){let n=t.sliceString(e-2,e);return Ha(Ci(n,0))==n.length?n:n.slice(1)}function nut(t,e,n,r){let i=null,o=t.changeByRange(a=>{if(!a.empty)return{changes:[{insert:e,from:a.from},{insert:n,from:a.to}],effects:Oh.of(a.to+e.length),range:je.range(a.anchor+e.length,a.head+e.length)};let s=rk(t.doc,a.head);return!s||/\s/.test(s)||r.indexOf(s)>-1?{changes:{insert:e+n,from:a.head},effects:Oh.of(a.head+e.length),range:je.cursor(a.head+e.length)}:{range:i=a}});return i?null:t.update(o,{scrollIntoView:!0,userEvent:"input.type"})}function rut(t,e,n){let r=null,i=t.changeByRange(o=>o.empty&&rk(t.doc,o.head)==n?{changes:{from:o.head,to:o.head+n.length,insert:n},range:je.cursor(o.head+n.length)}:r={range:o});return r?null:t.update(i,{scrollIntoView:!0,userEvent:"input.type"})}function iut(t,e,n,r){let i=r.stringPrefixes||m_.stringPrefixes,o=null,a=t.changeByRange(s=>{if(!s.empty)return{changes:[{insert:e,from:s.from},{insert:e,from:s.to}],effects:Oh.of(s.to+e.length),range:je.range(s.anchor+e.length,s.head+e.length)};let l=s.head,c=rk(t.doc,l),u;if(c==e){if(Lq(t,l))return{changes:{insert:e+e,from:l},effects:Oh.of(l+e.length),range:je.cursor(l+e.length)};if(gpe(t,l)){let d=n&&t.sliceDoc(l,l+e.length*3)==e+e+e?e+e+e:e;return{changes:{from:l,to:l+d.length,insert:d},range:je.cursor(l+d.length)}}}else{if(n&&t.sliceDoc(l-2*e.length,l)==e+e&&(u=Nq(t,l-2*e.length,i))>-1&&Lq(t,u))return{changes:{insert:e+e+e+e,from:l},effects:Oh.of(l+e.length),range:je.cursor(l+e.length)};if(t.charCategorizer(l)(c)!=fr.Word&&Nq(t,l,i)>-1&&!out(t,l,e,i))return{changes:{insert:e+e,from:l},effects:Oh.of(l+e.length),range:je.cursor(l+e.length)}}return{range:o=s}});return o?null:t.update(a,{scrollIntoView:!0,userEvent:"input.type"})}function Lq(t,e){let n=fi(t).resolveInner(e+1);return n.parent&&n.from==e}function out(t,e,n,r){let i=fi(t).resolveInner(e,-1),o=r.reduce((a,s)=>Math.max(a,s.length),0);for(let a=0;a<5;a++){let s=t.sliceDoc(i.from,Math.min(i.to,i.from+n.length+o)),l=s.indexOf(n);if(!l||l>-1&&r.indexOf(s.slice(0,l))>-1){let u=i.firstChild;for(;u&&u.from==i.from&&u.to-u.from>n.length+l;){if(t.sliceDoc(u.to-n.length,u.to)==n)return!1;u=u.firstChild}return!0}let c=i.to==e&&i.parent;if(!c)break;i=c}return!1}function Nq(t,e,n){let r=t.charCategorizer(e);if(r(t.sliceDoc(e-1,e))!=fr.Word)return e;for(let i of n){let o=e-i.length;if(t.sliceDoc(o,e)==i&&r(t.sliceDoc(o-1,o))!=fr.Word)return o}return-1}function vpe(t={}){return[$ct,To,Mi.of(t),Lct,aut,fpe]}const ype=[{key:"Ctrl-Space",run:kct},{key:"Escape",run:Act},{key:"ArrowDown",run:fO(!0)},{key:"ArrowUp",run:fO(!1)},{key:"PageDown",run:fO(!0,"page")},{key:"PageUp",run:fO(!1,"page")},{key:"Enter",run:Mct}],aut=Ed.highest(vw.computeN([Mi],t=>t.facet(Mi).defaultKeymap?[ype]:[]));class sut{constructor(e,n,r){this.from=e,this.to=n,this.diagnostic=r}}class fh{constructor(e,n,r){this.diagnostics=e,this.panel=n,this.selected=r}static init(e,n,r){let i=e,o=r.facet(g_).markerFilter;o&&(i=o(i,r));let a=gt.set(i.map(s=>s.from==s.to||s.from==s.to-1&&r.doc.lineAt(s.from).to==s.from?gt.widget({widget:new gut(s),diagnostic:s}).range(s.from):gt.mark({attributes:{class:"cm-lintRange cm-lintRange-"+s.severity+(s.markClass?" "+s.markClass:"")},diagnostic:s}).range(s.from,s.to)),!0);return new fh(a,n,mv(a))}}function mv(t,e=null,n=0){let r=null;return t.between(n,1e9,(i,o,{spec:a})=>{if(!(e&&a.diagnostic!=e))return r=new sut(i,o,a.diagnostic),!1}),r}function lut(t,e){let n=e.pos,r=e.end||n,i=t.state.facet(g_).hideOn(t,n,r);if(i!=null)return i;let o=t.startState.doc.lineAt(e.pos);return!!(t.effects.some(a=>a.is(xpe))||t.changes.touchesRange(o.from,Math.max(o.to,r)))}function cut(t,e){return t.field(ga,!1)?e:e.concat(Rt.appendConfig.of(xut))}const xpe=Rt.define(),eU=Rt.define(),bpe=Rt.define(),ga=mi.define({create(){return new fh(gt.none,null,null)},update(t,e){if(e.docChanged&&t.diagnostics.size){let n=t.diagnostics.map(e.changes),r=null,i=t.panel;if(t.selected){let o=e.changes.mapPos(t.selected.from,1);r=mv(n,t.selected.diagnostic,o)||mv(n,null,o)}!n.size&&i&&e.state.facet(g_).autoPanel&&(i=null),t=new fh(n,i,r)}for(let n of e.effects)if(n.is(xpe)){let r=e.state.facet(g_).autoPanel?n.value.length?v_.open:null:t.panel;t=fh.init(n.value,r,e.state)}else n.is(eU)?t=new fh(t.diagnostics,n.value?v_.open:null,t.selected):n.is(bpe)&&(t=new fh(t.diagnostics,t.panel,n.value));return t},provide:t=>[l_.from(t,e=>e.panel),rt.decorations.from(t,e=>e.diagnostics)]}),uut=gt.mark({class:"cm-lintRange cm-lintRange-active"});function fut(t,e,n){let{diagnostics:r}=t.state.field(ga),i=[],o=2e8,a=0;r.between(e-(n<0?1:0),e+(n>0?1:0),(l,c,{spec:u})=>{e>=l&&e<=c&&(l==c||(e>l||n>0)&&(e<c||n<0))&&(i.push(u.diagnostic),o=Math.min(l,o),a=Math.max(c,a))});let s=t.state.facet(g_).tooltipFilter;return s&&(i=s(i,t.state)),i.length?{pos:o,end:a,above:t.state.doc.lineAt(o).to<a,create(){return{dom:dut(t,i)}}}:null}function dut(t,e){return zn("ul",{class:"cm-tooltip-lint"},e.map(n=>wpe(t,n,!1)))}const hut=t=>{let e=t.state.field(ga,!1);(!e||!e.panel)&&t.dispatch({effects:cut(t.state,[eU.of(!0)])});let n=s_(t,v_.open);return n&&n.dom.querySelector(".cm-panel-lint ul").focus(),!0},$q=t=>{let e=t.state.field(ga,!1);return!e||!e.panel?!1:(t.dispatch({effects:eU.of(!1)}),!0)},put=t=>{let e=t.state.field(ga,!1);if(!e)return!1;let n=t.state.selection.main,r=e.diagnostics.iter(n.to+1);return!r.value&&(r=e.diagnostics.iter(0),!r.value||r.from==n.from&&r.to==n.to)?!1:(t.dispatch({selection:{anchor:r.from,head:r.to},scrollIntoView:!0}),!0)},mut=[{key:"Mod-Shift-m",run:hut,preventDefault:!0},{key:"F8",run:put}],g_=ct.define({combine(t){return Object.assign({sources:t.map(e=>e.source).filter(e=>e!=null)},cc(t.map(e=>e.config),{delay:750,markerFilter:null,tooltipFilter:null,needsRefresh:null,hideOn:()=>null},{needsRefresh:(e,n)=>e?n?r=>e(r)||n(r):e:n}))}});function _pe(t){let e=[];if(t)e:for(let{name:n}of t){for(let r=0;r<n.length;r++){let i=n[r];if(/[a-zA-Z]/.test(i)&&!e.some(o=>o.toLowerCase()==i.toLowerCase())){e.push(i);continue e}}e.push("")}return e}function wpe(t,e,n){var r;let i=n?_pe(e.actions):[];return zn("li",{class:"cm-diagnostic cm-diagnostic-"+e.severity},zn("span",{class:"cm-diagnosticText"},e.renderMessage?e.renderMessage(t):e.message),(r=e.actions)===null||r===void 0?void 0:r.map((o,a)=>{let s=!1,l=d=>{if(d.preventDefault(),s)return;s=!0;let h=mv(t.state.field(ga).diagnostics,e);h&&o.apply(t,h.from,h.to)},{name:c}=o,u=i[a]?c.indexOf(i[a]):-1,f=u<0?c:[c.slice(0,u),zn("u",c.slice(u,u+1)),c.slice(u+1)];return zn("button",{type:"button",class:"cm-diagnosticAction",onclick:l,onmousedown:l,"aria-label":` Action: ${c}${u<0?"":` (access key "${i[a]})"`}.`},f)}),e.source&&zn("div",{class:"cm-diagnosticSource"},e.source))}class gut extends uc{constructor(e){super(),this.diagnostic=e}eq(e){return e.diagnostic==this.diagnostic}toDOM(){return zn("span",{class:"cm-lintPoint cm-lintPoint-"+this.diagnostic.severity})}}class Fq{constructor(e,n){this.diagnostic=n,this.id="item_"+Math.floor(Math.random()*4294967295).toString(16),this.dom=wpe(e,n,!0),this.dom.id=this.id,this.dom.setAttribute("role","option")}}class v_{constructor(e){this.view=e,this.items=[];let n=i=>{if(i.keyCode==27)$q(this.view),this.view.focus();else if(i.keyCode==38||i.keyCode==33)this.moveSelection((this.selectedIndex-1+this.items.length)%this.items.length);else if(i.keyCode==40||i.keyCode==34)this.moveSelection((this.selectedIndex+1)%this.items.length);else if(i.keyCode==36)this.moveSelection(0);else if(i.keyCode==35)this.moveSelection(this.items.length-1);else if(i.keyCode==13)this.view.focus();else if(i.keyCode>=65&&i.keyCode<=90&&this.selectedIndex>=0){let{diagnostic:o}=this.items[this.selectedIndex],a=_pe(o.actions);for(let s=0;s<a.length;s++)if(a[s].toUpperCase().charCodeAt(0)==i.keyCode){let l=mv(this.view.state.field(ga).diagnostics,o);l&&o.actions[s].apply(e,l.from,l.to)}}else return;i.preventDefault()},r=i=>{for(let o=0;o<this.items.length;o++)this.items[o].dom.contains(i.target)&&this.moveSelection(o)};this.list=zn("ul",{tabIndex:0,role:"listbox","aria-label":this.view.state.phrase("Diagnostics"),onkeydown:n,onclick:r}),this.dom=zn("div",{class:"cm-panel-lint"},this.list,zn("button",{type:"button",name:"close","aria-label":this.view.state.phrase("close"),onclick:()=>$q(this.view)},"×")),this.update()}get selectedIndex(){let e=this.view.state.field(ga).selected;if(!e)return-1;for(let n=0;n<this.items.length;n++)if(this.items[n].diagnostic==e.diagnostic)return n;return-1}update(){let{diagnostics:e,selected:n}=this.view.state.field(ga),r=0,i=!1,o=null;for(e.between(0,this.view.state.doc.length,(a,s,{spec:l})=>{let c=-1,u;for(let f=r;f<this.items.length;f++)if(this.items[f].diagnostic==l.diagnostic){c=f;break}c<0?(u=new Fq(this.view,l.diagnostic),this.items.splice(r,0,u),i=!0):(u=this.items[c],c>r&&(this.items.splice(r,c-r),i=!0)),n&&u.diagnostic==n.diagnostic?u.dom.hasAttribute("aria-selected")||(u.dom.setAttribute("aria-selected","true"),o=u):u.dom.hasAttribute("aria-selected")&&u.dom.removeAttribute("aria-selected"),r++});r<this.items.length&&!(this.items.length==1&&this.items[0].diagnostic.from<0);)i=!0,this.items.pop();this.items.length==0&&(this.items.push(new Fq(this.view,{from:-1,to:-1,severity:"info",message:this.view.state.phrase("No diagnostics")})),i=!0),o?(this.list.setAttribute("aria-activedescendant",o.id),this.view.requestMeasure({key:this,read:()=>({sel:o.dom.getBoundingClientRect(),panel:this.list.getBoundingClientRect()}),write:({sel:a,panel:s})=>{let l=s.height/this.list.offsetHeight;a.top<s.top?this.list.scrollTop-=(s.top-a.top)/l:a.bottom>s.bottom&&(this.list.scrollTop+=(a.bottom-s.bottom)/l)}})):this.selectedIndex<0&&this.list.removeAttribute("aria-activedescendant"),i&&this.sync()}sync(){let e=this.list.firstChild;function n(){let r=e;e=r.nextSibling,r.remove()}for(let r of this.items)if(r.dom.parentNode==this.list){for(;e!=r.dom;)n();e=r.dom.nextSibling}else this.list.insertBefore(r.dom,e);for(;e;)n()}moveSelection(e){if(this.selectedIndex<0)return;let n=this.view.state.field(ga),r=mv(n.diagnostics,this.items[e].diagnostic);r&&this.view.dispatch({selection:{anchor:r.from,head:r.to},scrollIntoView:!0,effects:bpe.of(r)})}static open(e){return new v_(e)}}function vut(t,e='viewBox="0 0 40 40"'){return`url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" ${e}>${encodeURIComponent(t)}</svg>')`}function dO(t){return vut(`<path d="m0 2.5 l2 -1.5 l1 0 l2 1.5 l1 0" stroke="${t}" fill="none" stroke-width=".7"/>`,'width="6" height="3"')}const yut=rt.baseTheme({".cm-diagnostic":{padding:"3px 6px 3px 8px",marginLeft:"-1px",display:"block",whiteSpace:"pre-wrap"},".cm-diagnostic-error":{borderLeft:"5px solid #d11"},".cm-diagnostic-warning":{borderLeft:"5px solid orange"},".cm-diagnostic-info":{borderLeft:"5px solid #999"},".cm-diagnostic-hint":{borderLeft:"5px solid #66d"},".cm-diagnosticAction":{font:"inherit",border:"none",padding:"2px 4px",backgroundColor:"#444",color:"white",borderRadius:"3px",marginLeft:"8px",cursor:"pointer"},".cm-diagnosticSource":{fontSize:"70%",opacity:.7},".cm-lintRange":{backgroundPosition:"left bottom",backgroundRepeat:"repeat-x",paddingBottom:"0.7px"},".cm-lintRange-error":{backgroundImage:dO("#d11")},".cm-lintRange-warning":{backgroundImage:dO("orange")},".cm-lintRange-info":{backgroundImage:dO("#999")},".cm-lintRange-hint":{backgroundImage:dO("#66d")},".cm-lintRange-active":{backgroundColor:"#ffdd9980"},".cm-tooltip-lint":{padding:0,margin:0},".cm-lintPoint":{position:"relative","&:after":{content:'""',position:"absolute",bottom:0,left:"-2px",borderLeft:"3px solid transparent",borderRight:"3px solid transparent",borderBottom:"4px solid #d11"}},".cm-lintPoint-warning":{"&:after":{borderBottomColor:"orange"}},".cm-lintPoint-info":{"&:after":{borderBottomColor:"#999"}},".cm-lintPoint-hint":{"&:after":{borderBottomColor:"#66d"}},".cm-panel.cm-panel-lint":{position:"relative","& ul":{maxHeight:"100px",overflowY:"auto","& [aria-selected]":{backgroundColor:"#ddd","& u":{textDecoration:"underline"}},"&:focus [aria-selected]":{background_fallback:"#bdf",backgroundColor:"Highlight",color_fallback:"white",color:"HighlightText"},"& u":{textDecoration:"none"},padding:0,margin:0},"& [name=close]":{position:"absolute",top:"0",right:"2px",background:"inherit",border:"none",font:"inherit",padding:0,margin:0}}}),xut=[ga,rt.decorations.compute([ga],t=>{let{selected:e,panel:n}=t.field(ga);return!e||!n||e.from==e.to?gt.none:gt.set([uut.range(e.from,e.to)])}),oat(fut,{hideOn:lut}),yut];var jq=function(e){e===void 0&&(e={});var n=[];e.closeBracketsKeymap!==!1&&(n=n.concat(Jct)),e.defaultKeymap!==!1&&(n=n.concat(Llt)),e.searchKeymap!==!1&&(n=n.concat(sct)),e.historyKeymap!==!1&&(n=n.concat(Wst)),e.foldKeymap!==!1&&(n=n.concat(rst)),e.completionKeymap!==!1&&(n=n.concat(ype)),e.lintKeymap!==!1&&(n=n.concat(mut));var r=[];return e.lineNumbers!==!1&&r.push(gat()),e.highlightActiveLineGutter!==!1&&r.push(xat()),e.highlightSpecialChars!==!1&&r.push(Dot()),e.history!==!1&&r.push(Dst()),e.foldGutter!==!1&&r.push(sst()),e.drawSelection!==!1&&r.push(Sot()),e.dropCursor!==!1&&r.push(Pot()),e.allowMultipleSelections!==!1&&r.push(en.allowMultipleSelections.of(!0)),e.indentOnInput!==!1&&r.push(Xat()),e.syntaxHighlighting!==!1&&r.push(hhe(fst,{fallback:!0})),e.bracketMatching!==!1&&r.push(yst()),e.closeBrackets!==!1&&r.push(Qct()),e.autocompletion!==!1&&r.push(vpe()),e.rectangularSelection!==!1&&r.push(Xot()),e.crosshairCursor!==!1&&r.push(Kot()),e.highlightActiveLine!==!1&&r.push(Bot()),e.highlightSelectionMatches!==!1&&r.push(Ult()),e.tabSize&&typeof e.tabSize=="number"&&r.push(xw.of(" ".repeat(e.tabSize))),r.concat([vw.of(n.flat())]).filter(Boolean)};const but="#e5c07b",Bq="#e06c75",_ut="#56b6c2",wut="#ffffff",HC="#abb2bf",KN="#7d8799",Sut="#61afef",Out="#98c379",zq="#d19a66",Cut="#c678dd",Tut="#21252b",Uq="#2c313a",Wq="#282c34",oI="#353a42",Eut="#3E4451",Vq="#528bff",Put=rt.theme({"&":{color:HC,backgroundColor:Wq},".cm-content":{caretColor:Vq},".cm-cursor, .cm-dropCursor":{borderLeftColor:Vq},"&.cm-focused > .cm-scroller > .cm-selectionLayer .cm-selectionBackground, .cm-selectionBackground, .cm-content ::selection":{backgroundColor:Eut},".cm-panels":{backgroundColor:Tut,color:HC},".cm-panels.cm-panels-top":{borderBottom:"2px solid black"},".cm-panels.cm-panels-bottom":{borderTop:"2px solid black"},".cm-searchMatch":{backgroundColor:"#72a1ff59",outline:"1px solid #457dff"},".cm-searchMatch.cm-searchMatch-selected":{backgroundColor:"#6199ff2f"},".cm-activeLine":{backgroundColor:"#6699ff0b"},".cm-selectionMatch":{backgroundColor:"#aafe661a"},"&.cm-focused .cm-matchingBracket, &.cm-focused .cm-nonmatchingBracket":{backgroundColor:"#bad0f847"},".cm-gutters":{backgroundColor:Wq,color:KN,border:"none"},".cm-activeLineGutter":{backgroundColor:Uq},".cm-foldPlaceholder":{backgroundColor:"transparent",border:"none",color:"#ddd"},".cm-tooltip":{border:"none",backgroundColor:oI},".cm-tooltip .cm-tooltip-arrow:before":{borderTopColor:"transparent",borderBottomColor:"transparent"},".cm-tooltip .cm-tooltip-arrow:after":{borderTopColor:oI,borderBottomColor:oI},".cm-tooltip-autocomplete":{"& > ul > li[aria-selected]":{backgroundColor:Uq,color:HC}}},{dark:!0}),Mut=_w.define([{tag:Ce.keyword,color:Cut},{tag:[Ce.name,Ce.deleted,Ce.character,Ce.propertyName,Ce.macroName],color:Bq},{tag:[Ce.function(Ce.variableName),Ce.labelName],color:Sut},{tag:[Ce.color,Ce.constant(Ce.name),Ce.standard(Ce.name)],color:zq},{tag:[Ce.definition(Ce.name),Ce.separator],color:HC},{tag:[Ce.typeName,Ce.className,Ce.number,Ce.changed,Ce.annotation,Ce.modifier,Ce.self,Ce.namespace],color:but},{tag:[Ce.operator,Ce.operatorKeyword,Ce.url,Ce.escape,Ce.regexp,Ce.link,Ce.special(Ce.string)],color:_ut},{tag:[Ce.meta,Ce.comment],color:KN},{tag:Ce.strong,fontWeight:"bold"},{tag:Ce.emphasis,fontStyle:"italic"},{tag:Ce.strikethrough,textDecoration:"line-through"},{tag:Ce.link,color:KN,textDecoration:"underline"},{tag:Ce.heading,fontWeight:"bold",color:Bq},{tag:[Ce.atom,Ce.bool,Ce.special(Ce.variableName)],color:zq},{tag:[Ce.processingInstruction,Ce.string,Ce.inserted],color:Out},{tag:Ce.invalid,color:wut}]),kut=[Put,hhe(Mut)];var Aut=rt.theme({"&":{backgroundColor:"#fff"}},{dark:!1}),Rut=function(e){e===void 0&&(e={});var{indentWithTab:n=!0,editable:r=!0,readOnly:i=!1,theme:o="light",placeholder:a="",basicSetup:s=!0}=e,l=[];switch(n&&l.unshift(vw.of([Nlt])),s&&(typeof s=="boolean"?l.unshift(jq()):l.unshift(jq(s))),a&&l.unshift(Vot(a)),o){case"light":l.push(Aut);break;case"dark":l.push(kut);break;case"none":break;default:l.push(o);break}return r===!1&&l.push(rt.editable.of(!1)),i&&l.push(en.readOnly.of(!0)),[...l]},Iut=t=>({line:t.state.doc.lineAt(t.state.selection.main.from),lineCount:t.state.doc.lines,lineBreak:t.state.lineBreak,length:t.state.doc.length,readOnly:t.state.readOnly,tabSize:t.state.tabSize,selection:t.state.selection,selectionAsSingle:t.state.selection.asSingle().main,ranges:t.state.selection.ranges,selectionCode:t.state.sliceDoc(t.state.selection.main.from,t.state.selection.main.to),selections:t.state.selection.ranges.map(e=>t.state.sliceDoc(e.from,e.to)),selectedText:t.state.selection.ranges.some(e=>!e.empty)}),Gq=lc.define(),Dut=[];function Lut(t){var{value:e,selection:n,onChange:r,onStatistics:i,onCreateEditor:o,onUpdate:a,extensions:s=Dut,autoFocus:l,theme:c="light",height:u="",minHeight:f="",maxHeight:d="",placeholder:h="",width:p="",minWidth:m="",maxWidth:g="",editable:v=!0,readOnly:y=!1,indentWithTab:x=!0,basicSetup:b=!0,root:_,initialState:S}=t,[O,C]=M.useState(),[E,k]=M.useState(),[I,P]=M.useState(),R=rt.theme({"&":{height:u,minHeight:f,maxHeight:d,width:p,minWidth:m,maxWidth:g},"& .cm-scroller":{height:"100% !important"}}),T=rt.updateListener.of(B=>{if(B.docChanged&&typeof r=="function"&&!B.transactions.some($=>$.annotation(Gq))){var U=B.state.doc,W=U.toString();r(W,B)}i&&i(Iut(B))}),L=Rut({theme:c,editable:v,readOnly:y,placeholder:h,indentWithTab:x,basicSetup:b}),z=[T,R,...L];return a&&typeof a=="function"&&z.push(rt.updateListener.of(a)),z=z.concat(s),M.useEffect(()=>{if(O&&!I){var B={doc:e,selection:n,extensions:z},U=S?en.fromJSON(S.json,B,S.fields):en.create(B);if(P(U),!E){var W=new rt({state:U,parent:O,root:_});k(W),o&&o(W,U)}}return()=>{E&&(P(void 0),k(void 0))}},[O,I]),M.useEffect(()=>C(t.container),[t.container]),M.useEffect(()=>()=>{E&&(E.destroy(),k(void 0))},[E]),M.useEffect(()=>{l&&E&&E.focus()},[l,E]),M.useEffect(()=>{E&&E.dispatch({effects:Rt.reconfigure.of(z)})},[c,s,u,f,d,p,m,g,h,v,y,x,b,r,a]),M.useEffect(()=>{if(e!==void 0){var B=E?E.state.doc.toString():"";E&&e!==B&&E.dispatch({changes:{from:0,to:B.length,insert:e||""},annotations:[Gq.of(!0)]})}},[e,E]),{state:I,setState:P,view:E,setView:k,container:O,setContainer:C}}var Nut=["className","value","selection","extensions","onChange","onStatistics","onCreateEditor","onUpdate","autoFocus","theme","height","minHeight","maxHeight","width","minWidth","maxWidth","basicSetup","placeholder","indentWithTab","editable","readOnly","root","initialState"],ik=M.forwardRef((t,e)=>{var{className:n,value:r="",selection:i,extensions:o=[],onChange:a,onStatistics:s,onCreateEditor:l,onUpdate:c,autoFocus:u,theme:f="light",height:d,minHeight:h,maxHeight:p,width:m,minWidth:g,maxWidth:v,basicSetup:y,placeholder:x,indentWithTab:b,editable:_,readOnly:S,root:O,initialState:C}=t,E=Ae(t,Nut),k=M.useRef(null),{state:I,view:P,container:R}=Lut({container:k.current,root:O,value:r,autoFocus:u,theme:f,height:d,minHeight:h,maxHeight:p,width:m,minWidth:g,maxWidth:v,basicSetup:y,placeholder:x,indentWithTab:b,editable:_,readOnly:S,selection:i,onChange:a,onStatistics:s,onCreateEditor:l,onUpdate:c,extensions:o,initialState:C});if(M.useImperativeHandle(e,()=>({editor:k.current,state:I,view:P}),[k,R,I,P]),typeof r!="string")throw new Error("value must be typeof string but got "+typeof r);var T=typeof f=="string"?"cm-theme-"+f:"cm-theme";return w.jsx("div",j({ref:k,className:""+T+(n?" "+n:"")},E))});ik.displayName="CodeMirror";var Hq={};let $ut=class ZN{constructor(e,n,r,i,o,a,s,l,c,u=0,f){this.p=e,this.stack=n,this.state=r,this.reducePos=i,this.pos=o,this.score=a,this.buffer=s,this.bufferBase=l,this.curContext=c,this.lookAhead=u,this.parent=f}toString(){return`[${this.stack.filter((e,n)=>n%3==0).concat(this.state)}]@${this.pos}${this.score?"!"+this.score:""}`}static start(e,n,r=0){let i=e.parser.context;return new ZN(e,[],n,r,r,0,[],0,i?new qq(i,i.start):null,0,null)}get context(){return this.curContext?this.curContext.context:null}pushState(e,n){this.stack.push(this.state,n,this.bufferBase+this.buffer.length),this.state=e}reduce(e){var n;let r=e>>19,i=e&65535,{parser:o}=this.p,a=this.reducePos<this.pos-25;a&&this.setLookAhead(this.pos);let s=o.dynamicPrecedence(i);if(s&&(this.score+=s),r==0){this.pushState(o.getGoto(this.state,i,!0),this.reducePos),i<o.minRepeatTerm&&this.storeNode(i,this.reducePos,this.reducePos,a?8:4,!0),this.reduceContext(i,this.reducePos);return}let l=this.stack.length-(r-1)*3-(e&262144?6:0),c=l?this.stack[l-2]:this.p.ranges[0].from,u=this.reducePos-c;u>=2e3&&!(!((n=this.p.parser.nodeSet.types[i])===null||n===void 0)&&n.isAnonymous)&&(c==this.p.lastBigReductionStart?(this.p.bigReductionCount++,this.p.lastBigReductionSize=u):this.p.lastBigReductionSize<u&&(this.p.bigReductionCount=1,this.p.lastBigReductionStart=c,this.p.lastBigReductionSize=u));let f=l?this.stack[l-1]:0,d=this.bufferBase+this.buffer.length-f;if(i<o.minRepeatTerm||e&131072){let h=o.stateFlag(this.state,1)?this.pos:this.reducePos;this.storeNode(i,c,h,d+4,!0)}if(e&262144)this.state=this.stack[l];else{let h=this.stack[l-3];this.state=o.getGoto(h,i,!0)}for(;this.stack.length>l;)this.stack.pop();this.reduceContext(i,c)}storeNode(e,n,r,i=4,o=!1){if(e==0&&(!this.stack.length||this.stack[this.stack.length-1]<this.buffer.length+this.bufferBase)){let a=this,s=this.buffer.length;if(s==0&&a.parent&&(s=a.bufferBase-a.parent.bufferBase,a=a.parent),s>0&&a.buffer[s-4]==0&&a.buffer[s-1]>-1){if(n==r)return;if(a.buffer[s-2]>=n){a.buffer[s-2]=r;return}}}if(!o||this.pos==r)this.buffer.push(e,n,r,i);else{let a=this.buffer.length;if(a>0&&this.buffer[a-4]!=0){let s=!1;for(let l=a;l>0&&this.buffer[l-2]>r;l-=4)if(this.buffer[l-1]>=0){s=!0;break}if(s)for(;a>0&&this.buffer[a-2]>r;)this.buffer[a]=this.buffer[a-4],this.buffer[a+1]=this.buffer[a-3],this.buffer[a+2]=this.buffer[a-2],this.buffer[a+3]=this.buffer[a-1],a-=4,i>4&&(i-=4)}this.buffer[a]=e,this.buffer[a+1]=n,this.buffer[a+2]=r,this.buffer[a+3]=i}}shift(e,n,r,i){if(e&131072)this.pushState(e&65535,this.pos);else if(e&262144)this.pos=i,this.shiftContext(n,r),n<=this.p.parser.maxNode&&this.buffer.push(n,r,i,4);else{let o=e,{parser:a}=this.p;(i>this.pos||n<=a.maxNode)&&(this.pos=i,a.stateFlag(o,1)||(this.reducePos=i)),this.pushState(o,r),this.shiftContext(n,r),n<=a.maxNode&&this.buffer.push(n,r,i,4)}}apply(e,n,r,i){e&65536?this.reduce(e):this.shift(e,n,r,i)}useNode(e,n){let r=this.p.reused.length-1;(r<0||this.p.reused[r]!=e)&&(this.p.reused.push(e),r++);let i=this.pos;this.reducePos=this.pos=i+e.length,this.pushState(n,i),this.buffer.push(r,i,this.reducePos,-1),this.curContext&&this.updateContext(this.curContext.tracker.reuse(this.curContext.context,e,this,this.p.stream.reset(this.pos-e.length)))}split(){let e=this,n=e.buffer.length;for(;n>0&&e.buffer[n-2]>e.reducePos;)n-=4;let r=e.buffer.slice(n),i=e.bufferBase+n;for(;e&&i==e.bufferBase;)e=e.parent;return new ZN(this.p,this.stack.slice(),this.state,this.reducePos,this.pos,this.score,r,i,this.curContext,this.lookAhead,e)}recoverByDelete(e,n){let r=e<=this.p.parser.maxNode;r&&this.storeNode(e,this.pos,n,4),this.storeNode(0,this.pos,n,r?8:4),this.pos=this.reducePos=n,this.score-=190}canShift(e){for(let n=new Fut(this);;){let r=this.p.parser.stateSlot(n.state,4)||this.p.parser.hasAction(n.state,e);if(r==0)return!1;if(!(r&65536))return!0;n.reduce(r)}}recoverByInsert(e){if(this.stack.length>=300)return[];let n=this.p.parser.nextStates(this.state);if(n.length>8||this.stack.length>=120){let i=[];for(let o=0,a;o<n.length;o+=2)(a=n[o+1])!=this.state&&this.p.parser.hasAction(a,e)&&i.push(n[o],a);if(this.stack.length<120)for(let o=0;i.length<8&&o<n.length;o+=2){let a=n[o+1];i.some((s,l)=>l&1&&s==a)||i.push(n[o],a)}n=i}let r=[];for(let i=0;i<n.length&&r.length<4;i+=2){let o=n[i+1];if(o==this.state)continue;let a=this.split();a.pushState(o,this.pos),a.storeNode(0,a.pos,a.pos,4,!0),a.shiftContext(n[i],this.pos),a.reducePos=this.pos,a.score-=200,r.push(a)}return r}forceReduce(){let{parser:e}=this.p,n=e.stateSlot(this.state,5);if(!(n&65536))return!1;if(!e.validAction(this.state,n)){let r=n>>19,i=n&65535,o=this.stack.length-r*3;if(o<0||e.getGoto(this.stack[o],i,!1)<0){let a=this.findForcedReduction();if(a==null)return!1;n=a}this.storeNode(0,this.pos,this.pos,4,!0),this.score-=100}return this.reducePos=this.pos,this.reduce(n),!0}findForcedReduction(){let{parser:e}=this.p,n=[],r=(i,o)=>{if(!n.includes(i))return n.push(i),e.allActions(i,a=>{if(!(a&393216))if(a&65536){let s=(a>>19)-o;if(s>1){let l=a&65535,c=this.stack.length-s*3;if(c>=0&&e.getGoto(this.stack[c],l,!1)>=0)return s<<19|65536|l}}else{let s=r(a,o+1);if(s!=null)return s}})};return r(this.state,0)}forceAll(){for(;!this.p.parser.stateFlag(this.state,2);)if(!this.forceReduce()){this.storeNode(0,this.pos,this.pos,4,!0);break}return this}get deadEnd(){if(this.stack.length!=3)return!1;let{parser:e}=this.p;return e.data[e.stateSlot(this.state,1)]==65535&&!e.stateSlot(this.state,4)}restart(){this.storeNode(0,this.pos,this.pos,4,!0),this.state=this.stack[0],this.stack.length=0}sameState(e){if(this.state!=e.state||this.stack.length!=e.stack.length)return!1;for(let n=0;n<this.stack.length;n+=3)if(this.stack[n]!=e.stack[n])return!1;return!0}get parser(){return this.p.parser}dialectEnabled(e){return this.p.parser.dialect.flags[e]}shiftContext(e,n){this.curContext&&this.updateContext(this.curContext.tracker.shift(this.curContext.context,e,this,this.p.stream.reset(n)))}reduceContext(e,n){this.curContext&&this.updateContext(this.curContext.tracker.reduce(this.curContext.context,e,this,this.p.stream.reset(n)))}emitContext(){let e=this.buffer.length-1;(e<0||this.buffer[e]!=-3)&&this.buffer.push(this.curContext.hash,this.pos,this.pos,-3)}emitLookAhead(){let e=this.buffer.length-1;(e<0||this.buffer[e]!=-4)&&this.buffer.push(this.lookAhead,this.pos,this.pos,-4)}updateContext(e){if(e!=this.curContext.context){let n=new qq(this.curContext.tracker,e);n.hash!=this.curContext.hash&&this.emitContext(),this.curContext=n}}setLookAhead(e){e>this.lookAhead&&(this.emitLookAhead(),this.lookAhead=e)}close(){this.curContext&&this.curContext.tracker.strict&&this.emitContext(),this.lookAhead>0&&this.emitLookAhead()}};class qq{constructor(e,n){this.tracker=e,this.context=n,this.hash=e.strict?e.hash(n):0}}class Fut{constructor(e){this.start=e,this.state=e.state,this.stack=e.stack,this.base=this.stack.length}reduce(e){let n=e&65535,r=e>>19;r==0?(this.stack==this.start.stack&&(this.stack=this.stack.slice()),this.stack.push(this.state,0,0),this.base+=3):this.base-=(r-1)*3;let i=this.start.p.parser.getGoto(this.stack[this.base-3],n,!0);this.state=i}}class LE{constructor(e,n,r){this.stack=e,this.pos=n,this.index=r,this.buffer=e.buffer,this.index==0&&this.maybeNext()}static create(e,n=e.bufferBase+e.buffer.length){return new LE(e,n,n-e.bufferBase)}maybeNext(){let e=this.stack.parent;e!=null&&(this.index=this.stack.bufferBase-e.bufferBase,this.stack=e,this.buffer=e.buffer)}get id(){return this.buffer[this.index-4]}get start(){return this.buffer[this.index-3]}get end(){return this.buffer[this.index-2]}get size(){return this.buffer[this.index-1]}next(){this.index-=4,this.pos-=4,this.index==0&&this.maybeNext()}fork(){return new LE(this.stack,this.pos,this.index)}}function hO(t,e=Uint16Array){if(typeof t!="string")return t;let n=null;for(let r=0,i=0;r<t.length;){let o=0;for(;;){let a=t.charCodeAt(r++),s=!1;if(a==126){o=65535;break}a>=92&&a--,a>=34&&a--;let l=a-32;if(l>=46&&(l-=46,s=!0),o+=l,s)break;o*=46}n?n[i++]=o:n=new e(o)}return n}class qC{constructor(){this.start=-1,this.value=-1,this.end=-1,this.extended=-1,this.lookAhead=0,this.mask=0,this.context=0}}const Xq=new qC;class jut{constructor(e,n){this.input=e,this.ranges=n,this.chunk="",this.chunkOff=0,this.chunk2="",this.chunk2Pos=0,this.next=-1,this.token=Xq,this.rangeIndex=0,this.pos=this.chunkPos=n[0].from,this.range=n[0],this.end=n[n.length-1].to,this.readNext()}resolveOffset(e,n){let r=this.range,i=this.rangeIndex,o=this.pos+e;for(;o<r.from;){if(!i)return null;let a=this.ranges[--i];o-=r.from-a.to,r=a}for(;n<0?o>r.to:o>=r.to;){if(i==this.ranges.length-1)return null;let a=this.ranges[++i];o+=a.from-r.to,r=a}return o}clipPos(e){if(e>=this.range.from&&e<this.range.to)return e;for(let n of this.ranges)if(n.to>e)return Math.max(e,n.from);return this.end}peek(e){let n=this.chunkOff+e,r,i;if(n>=0&&n<this.chunk.length)r=this.pos+e,i=this.chunk.charCodeAt(n);else{let o=this.resolveOffset(e,1);if(o==null)return-1;if(r=o,r>=this.chunk2Pos&&r<this.chunk2Pos+this.chunk2.length)i=this.chunk2.charCodeAt(r-this.chunk2Pos);else{let a=this.rangeIndex,s=this.range;for(;s.to<=r;)s=this.ranges[++a];this.chunk2=this.input.chunk(this.chunk2Pos=r),r+this.chunk2.length>s.to&&(this.chunk2=this.chunk2.slice(0,s.to-r)),i=this.chunk2.charCodeAt(0)}}return r>=this.token.lookAhead&&(this.token.lookAhead=r+1),i}acceptToken(e,n=0){let r=n?this.resolveOffset(n,-1):this.pos;if(r==null||r<this.token.start)throw new RangeError("Token end out of bounds");this.token.value=e,this.token.end=r}acceptTokenTo(e,n){this.token.value=e,this.token.end=n}getChunk(){if(this.pos>=this.chunk2Pos&&this.pos<this.chunk2Pos+this.chunk2.length){let{chunk:e,chunkPos:n}=this;this.chunk=this.chunk2,this.chunkPos=this.chunk2Pos,this.chunk2=e,this.chunk2Pos=n,this.chunkOff=this.pos-this.chunkPos}else{this.chunk2=this.chunk,this.chunk2Pos=this.chunkPos;let e=this.input.chunk(this.pos),n=this.pos+e.length;this.chunk=n>this.range.to?e.slice(0,this.range.to-this.pos):e,this.chunkPos=this.pos,this.chunkOff=0}}readNext(){return this.chunkOff>=this.chunk.length&&(this.getChunk(),this.chunkOff==this.chunk.length)?this.next=-1:this.next=this.chunk.charCodeAt(this.chunkOff)}advance(e=1){for(this.chunkOff+=e;this.pos+e>=this.range.to;){if(this.rangeIndex==this.ranges.length-1)return this.setDone();e-=this.range.to-this.pos,this.range=this.ranges[++this.rangeIndex],this.pos=this.range.from}return this.pos+=e,this.pos>=this.token.lookAhead&&(this.token.lookAhead=this.pos+1),this.readNext()}setDone(){return this.pos=this.chunkPos=this.end,this.range=this.ranges[this.rangeIndex=this.ranges.length-1],this.chunk="",this.next=-1}reset(e,n){if(n?(this.token=n,n.start=e,n.lookAhead=e+1,n.value=n.extended=-1):this.token=Xq,this.pos!=e){if(this.pos=e,e==this.end)return this.setDone(),this;for(;e<this.range.from;)this.range=this.ranges[--this.rangeIndex];for(;e>=this.range.to;)this.range=this.ranges[++this.rangeIndex];e>=this.chunkPos&&e<this.chunkPos+this.chunk.length?this.chunkOff=e-this.chunkPos:(this.chunk="",this.chunkOff=0),this.readNext()}return this}read(e,n){if(e>=this.chunkPos&&n<=this.chunkPos+this.chunk.length)return this.chunk.slice(e-this.chunkPos,n-this.chunkPos);if(e>=this.chunk2Pos&&n<=this.chunk2Pos+this.chunk2.length)return this.chunk2.slice(e-this.chunk2Pos,n-this.chunk2Pos);if(e>=this.range.from&&n<=this.range.to)return this.input.read(e,n);let r="";for(let i of this.ranges){if(i.from>=n)break;i.to>e&&(r+=this.input.read(Math.max(i.from,e),Math.min(i.to,n)))}return r}}class Lg{constructor(e,n){this.data=e,this.id=n}token(e,n){let{parser:r}=n.p;But(this.data,e,n,this.id,r.data,r.tokenPrecTable)}}Lg.prototype.contextual=Lg.prototype.fallback=Lg.prototype.extend=!1;Lg.prototype.fallback=Lg.prototype.extend=!1;class ok{constructor(e,n={}){this.token=e,this.contextual=!!n.contextual,this.fallback=!!n.fallback,this.extend=!!n.extend}}function But(t,e,n,r,i,o){let a=0,s=1<<r,{dialect:l}=n.p.parser;e:for(;s&t[a];){let c=t[a+1];for(let h=a+3;h<c;h+=2)if((t[h+1]&s)>0){let p=t[h];if(l.allows(p)&&(e.token.value==-1||e.token.value==p||zut(p,e.token.value,i,o))){e.acceptToken(p);break}}let u=e.next,f=0,d=t[a+2];if(e.next<0&&d>f&&t[c+d*3-3]==65535){a=t[c+d*3-1];continue e}for(;f<d;){let h=f+d>>1,p=c+h+(h<<1),m=t[p],g=t[p+1]||65536;if(u<m)d=h;else if(u>=g)f=h+1;else{a=t[p+2],e.advance();continue e}}break}}function Qq(t,e,n){for(let r=e,i;(i=t[r])!=65535;r++)if(i==n)return r-e;return-1}function zut(t,e,n,r){let i=Qq(n,r,e);return i<0||Qq(n,r,t)<i}const Ko=typeof process<"u"&&Hq&&/\bparse\b/.test(Hq.LOG);let aI=null;function Yq(t,e,n){let r=t.cursor(Jr.IncludeAnonymous);for(r.moveTo(e);;)if(!(n<0?r.childBefore(e):r.childAfter(e)))for(;;){if((n<0?r.to<e:r.from>e)&&!r.type.isError)return n<0?Math.max(0,Math.min(r.to-1,e-25)):Math.min(t.length,Math.max(r.from+1,e+25));if(n<0?r.prevSibling():r.nextSibling())break;if(!r.parent())return n<0?0:t.length}}class Uut{constructor(e,n){this.fragments=e,this.nodeSet=n,this.i=0,this.fragment=null,this.safeFrom=-1,this.safeTo=-1,this.trees=[],this.start=[],this.index=[],this.nextFragment()}nextFragment(){let e=this.fragment=this.i==this.fragments.length?null:this.fragments[this.i++];if(e){for(this.safeFrom=e.openStart?Yq(e.tree,e.from+e.offset,1)-e.offset:e.from,this.safeTo=e.openEnd?Yq(e.tree,e.to+e.offset,-1)-e.offset:e.to;this.trees.length;)this.trees.pop(),this.start.pop(),this.index.pop();this.trees.push(e.tree),this.start.push(-e.offset),this.index.push(0),this.nextStart=this.safeFrom}else this.nextStart=1e9}nodeAt(e){if(e<this.nextStart)return null;for(;this.fragment&&this.safeTo<=e;)this.nextFragment();if(!this.fragment)return null;for(;;){let n=this.trees.length-1;if(n<0)return this.nextFragment(),null;let r=this.trees[n],i=this.index[n];if(i==r.children.length){this.trees.pop(),this.start.pop(),this.index.pop();continue}let o=r.children[i],a=this.start[n]+r.positions[i];if(a>e)return this.nextStart=a,null;if(o instanceof Wr){if(a==e){if(a<this.safeFrom)return null;let s=a+o.length;if(s<=this.safeTo){let l=o.prop(Vt.lookAhead);if(!l||s+l<this.fragment.to)return o}}this.index[n]++,a+o.length>=Math.max(this.safeFrom,e)&&(this.trees.push(o),this.start.push(a),this.index.push(0))}else this.index[n]++,this.nextStart=a+o.length}}}class Wut{constructor(e,n){this.stream=n,this.tokens=[],this.mainToken=null,this.actions=[],this.tokens=e.tokenizers.map(r=>new qC)}getActions(e){let n=0,r=null,{parser:i}=e.p,{tokenizers:o}=i,a=i.stateSlot(e.state,3),s=e.curContext?e.curContext.hash:0,l=0;for(let c=0;c<o.length;c++){if(!(1<<c&a))continue;let u=o[c],f=this.tokens[c];if(!(r&&!u.fallback)&&((u.contextual||f.start!=e.pos||f.mask!=a||f.context!=s)&&(this.updateCachedToken(f,u,e),f.mask=a,f.context=s),f.lookAhead>f.end+25&&(l=Math.max(f.lookAhead,l)),f.value!=0)){let d=n;if(f.extended>-1&&(n=this.addActions(e,f.extended,f.end,n)),n=this.addActions(e,f.value,f.end,n),!u.extend&&(r=f,n>d))break}}for(;this.actions.length>n;)this.actions.pop();return l&&e.setLookAhead(l),!r&&e.pos==this.stream.end&&(r=new qC,r.value=e.p.parser.eofTerm,r.start=r.end=e.pos,n=this.addActions(e,r.value,r.end,n)),this.mainToken=r,this.actions}getMainToken(e){if(this.mainToken)return this.mainToken;let n=new qC,{pos:r,p:i}=e;return n.start=r,n.end=Math.min(r+1,i.stream.end),n.value=r==i.stream.end?i.parser.eofTerm:0,n}updateCachedToken(e,n,r){let i=this.stream.clipPos(r.pos);if(n.token(this.stream.reset(i,e),r),e.value>-1){let{parser:o}=r.p;for(let a=0;a<o.specialized.length;a++)if(o.specialized[a]==e.value){let s=o.specializers[a](this.stream.read(e.start,e.end),r);if(s>=0&&r.p.parser.dialect.allows(s>>1)){s&1?e.extended=s>>1:e.value=s>>1;break}}}else e.value=0,e.end=this.stream.clipPos(i+1)}putAction(e,n,r,i){for(let o=0;o<i;o+=3)if(this.actions[o]==e)return i;return this.actions[i++]=e,this.actions[i++]=n,this.actions[i++]=r,i}addActions(e,n,r,i){let{state:o}=e,{parser:a}=e.p,{data:s}=a;for(let l=0;l<2;l++)for(let c=a.stateSlot(o,l?2:1);;c+=3){if(s[c]==65535)if(s[c+1]==1)c=$c(s,c+2);else{i==0&&s[c+1]==2&&(i=this.putAction($c(s,c+2),n,r,i));break}s[c]==n&&(i=this.putAction($c(s,c+1),n,r,i))}return i}}class Vut{constructor(e,n,r,i){this.parser=e,this.input=n,this.ranges=i,this.recovering=0,this.nextStackID=9812,this.minStackPos=0,this.reused=[],this.stoppedAt=null,this.lastBigReductionStart=-1,this.lastBigReductionSize=0,this.bigReductionCount=0,this.stream=new jut(n,i),this.tokens=new Wut(e,this.stream),this.topTerm=e.top[1];let{from:o}=i[0];this.stacks=[$ut.start(this,e.top[0],o)],this.fragments=r.length&&this.stream.end-o>e.bufferLength*4?new Uut(r,e.nodeSet):null}get parsedPos(){return this.minStackPos}advance(){let e=this.stacks,n=this.minStackPos,r=this.stacks=[],i,o;if(this.bigReductionCount>300&&e.length==1){let[a]=e;for(;a.forceReduce()&&a.stack.length&&a.stack[a.stack.length-2]>=this.lastBigReductionStart;);this.bigReductionCount=this.lastBigReductionSize=0}for(let a=0;a<e.length;a++){let s=e[a];for(;;){if(this.tokens.mainToken=null,s.pos>n)r.push(s);else{if(this.advanceStack(s,r,e))continue;{i||(i=[],o=[]),i.push(s);let l=this.tokens.getMainToken(s);o.push(l.value,l.end)}}break}}if(!r.length){let a=i&&qut(i);if(a)return Ko&&console.log("Finish with "+this.stackID(a)),this.stackToTree(a);if(this.parser.strict)throw Ko&&i&&console.log("Stuck with token "+(this.tokens.mainToken?this.parser.getName(this.tokens.mainToken.value):"none")),new SyntaxError("No parse at "+n);this.recovering||(this.recovering=5)}if(this.recovering&&i){let a=this.stoppedAt!=null&&i[0].pos>this.stoppedAt?i[0]:this.runRecovery(i,o,r);if(a)return Ko&&console.log("Force-finish "+this.stackID(a)),this.stackToTree(a.forceAll())}if(this.recovering){let a=this.recovering==1?1:this.recovering*3;if(r.length>a)for(r.sort((s,l)=>l.score-s.score);r.length>a;)r.pop();r.some(s=>s.reducePos>n)&&this.recovering--}else if(r.length>1){e:for(let a=0;a<r.length-1;a++){let s=r[a];for(let l=a+1;l<r.length;l++){let c=r[l];if(s.sameState(c)||s.buffer.length>500&&c.buffer.length>500)if((s.score-c.score||s.buffer.length-c.buffer.length)>0)r.splice(l--,1);else{r.splice(a--,1);continue e}}}r.length>12&&r.splice(12,r.length-12)}this.minStackPos=r[0].pos;for(let a=1;a<r.length;a++)r[a].pos<this.minStackPos&&(this.minStackPos=r[a].pos);return null}stopAt(e){if(this.stoppedAt!=null&&this.stoppedAt<e)throw new RangeError("Can't move stoppedAt forward");this.stoppedAt=e}advanceStack(e,n,r){let i=e.pos,{parser:o}=this,a=Ko?this.stackID(e)+" -> ":"";if(this.stoppedAt!=null&&i>this.stoppedAt)return e.forceReduce()?e:null;if(this.fragments){let c=e.curContext&&e.curContext.tracker.strict,u=c?e.curContext.hash:0;for(let f=this.fragments.nodeAt(i);f;){let d=this.parser.nodeSet.types[f.type.id]==f.type?o.getGoto(e.state,f.type.id):-1;if(d>-1&&f.length&&(!c||(f.prop(Vt.contextHash)||0)==u))return e.useNode(f,d),Ko&&console.log(a+this.stackID(e)+` (via reuse of ${o.getName(f.type.id)})`),!0;if(!(f instanceof Wr)||f.children.length==0||f.positions[0]>0)break;let h=f.children[0];if(h instanceof Wr&&f.positions[0]==0)f=h;else break}}let s=o.stateSlot(e.state,4);if(s>0)return e.reduce(s),Ko&&console.log(a+this.stackID(e)+` (via always-reduce ${o.getName(s&65535)})`),!0;if(e.stack.length>=8400)for(;e.stack.length>6e3&&e.forceReduce(););let l=this.tokens.getActions(e);for(let c=0;c<l.length;){let u=l[c++],f=l[c++],d=l[c++],h=c==l.length||!r,p=h?e:e.split(),m=this.tokens.mainToken;if(p.apply(u,f,m?m.start:p.pos,d),Ko&&console.log(a+this.stackID(p)+` (via ${u&65536?`reduce of ${o.getName(u&65535)}`:"shift"} for ${o.getName(f)} @ ${i}${p==e?"":", split"})`),h)return!0;p.pos>i?n.push(p):r.push(p)}return!1}advanceFully(e,n){let r=e.pos;for(;;){if(!this.advanceStack(e,null,null))return!1;if(e.pos>r)return Kq(e,n),!0}}runRecovery(e,n,r){let i=null,o=!1;for(let a=0;a<e.length;a++){let s=e[a],l=n[a<<1],c=n[(a<<1)+1],u=Ko?this.stackID(s)+" -> ":"";if(s.deadEnd&&(o||(o=!0,s.restart(),Ko&&console.log(u+this.stackID(s)+" (restarted)"),this.advanceFully(s,r))))continue;let f=s.split(),d=u;for(let h=0;f.forceReduce()&&h<10&&(Ko&&console.log(d+this.stackID(f)+" (via force-reduce)"),!this.advanceFully(f,r));h++)Ko&&(d=this.stackID(f)+" -> ");for(let h of s.recoverByInsert(l))Ko&&console.log(u+this.stackID(h)+" (via recover-insert)"),this.advanceFully(h,r);this.stream.end>s.pos?(c==s.pos&&(c++,l=0),s.recoverByDelete(l,c),Ko&&console.log(u+this.stackID(s)+` (via recover-delete ${this.parser.getName(l)})`),Kq(s,r)):(!i||i.score<s.score)&&(i=s)}return i}stackToTree(e){return e.close(),Wr.build({buffer:LE.create(e),nodeSet:this.parser.nodeSet,topID:this.topTerm,maxBufferLength:this.parser.bufferLength,reused:this.reused,start:this.ranges[0].from,length:e.pos-this.ranges[0].from,minRepeatType:this.parser.minRepeatTerm})}stackID(e){let n=(aI||(aI=new WeakMap)).get(e);return n||aI.set(e,n=String.fromCodePoint(this.nextStackID++)),n+e}}function Kq(t,e){for(let n=0;n<e.length;n++){let r=e[n];if(r.pos==t.pos&&r.sameState(t)){e[n].score<t.score&&(e[n]=t);return}}e.push(t)}class Gut{constructor(e,n,r){this.source=e,this.flags=n,this.disabled=r}allows(e){return!this.disabled||this.disabled[e]==0}}const sI=t=>t;class Hut{constructor(e){this.start=e.start,this.shift=e.shift||sI,this.reduce=e.reduce||sI,this.reuse=e.reuse||sI,this.hash=e.hash||(()=>0),this.strict=e.strict!==!1}}class y_ extends Kde{constructor(e){if(super(),this.wrappers=[],e.version!=14)throw new RangeError(`Parser version (${e.version}) doesn't match runtime version (14)`);let n=e.nodeNames.split(" ");this.minRepeatTerm=n.length;for(let s=0;s<e.repeatNodeCount;s++)n.push("");let r=Object.keys(e.topRules).map(s=>e.topRules[s][1]),i=[];for(let s=0;s<n.length;s++)i.push([]);function o(s,l,c){i[s].push([l,l.deserialize(String(c))])}if(e.nodeProps)for(let s of e.nodeProps){let l=s[0];typeof l=="string"&&(l=Vt[l]);for(let c=1;c<s.length;){let u=s[c++];if(u>=0)o(u,l,s[c++]);else{let f=s[c+-u];for(let d=-u;d>0;d--)o(s[c++],l,f);c++}}}this.nodeSet=new R4(n.map((s,l)=>Vo.define({name:l>=this.minRepeatTerm?void 0:s,id:l,props:i[l],top:r.indexOf(l)>-1,error:l==0,skipped:e.skippedNodes&&e.skippedNodes.indexOf(l)>-1}))),e.propSources&&(this.nodeSet=this.nodeSet.extend(...e.propSources)),this.strict=!1,this.bufferLength=qde;let a=hO(e.tokenData);this.context=e.context,this.specializerSpecs=e.specialized||[],this.specialized=new Uint16Array(this.specializerSpecs.length);for(let s=0;s<this.specializerSpecs.length;s++)this.specialized[s]=this.specializerSpecs[s].term;this.specializers=this.specializerSpecs.map(Zq),this.states=hO(e.states,Uint32Array),this.data=hO(e.stateData),this.goto=hO(e.goto),this.maxTerm=e.maxTerm,this.tokenizers=e.tokenizers.map(s=>typeof s=="number"?new Lg(a,s):s),this.topRules=e.topRules,this.dialects=e.dialects||{},this.dynamicPrecedences=e.dynamicPrecedences||null,this.tokenPrecTable=e.tokenPrec,this.termNames=e.termNames||null,this.maxNode=this.nodeSet.types.length-1,this.dialect=this.parseDialect(),this.top=this.topRules[Object.keys(this.topRules)[0]]}createParse(e,n,r){let i=new Vut(this,e,n,r);for(let o of this.wrappers)i=o(i,e,n,r);return i}getGoto(e,n,r=!1){let i=this.goto;if(n>=i[0])return-1;for(let o=i[n+1];;){let a=i[o++],s=a&1,l=i[o++];if(s&&r)return l;for(let c=o+(a>>1);o<c;o++)if(i[o]==e)return l;if(s)return-1}}hasAction(e,n){let r=this.data;for(let i=0;i<2;i++)for(let o=this.stateSlot(e,i?2:1),a;;o+=3){if((a=r[o])==65535)if(r[o+1]==1)a=r[o=$c(r,o+2)];else{if(r[o+1]==2)return $c(r,o+2);break}if(a==n||a==0)return $c(r,o+1)}return 0}stateSlot(e,n){return this.states[e*6+n]}stateFlag(e,n){return(this.stateSlot(e,0)&n)>0}validAction(e,n){return!!this.allActions(e,r=>r==n?!0:null)}allActions(e,n){let r=this.stateSlot(e,4),i=r?n(r):void 0;for(let o=this.stateSlot(e,1);i==null;o+=3){if(this.data[o]==65535)if(this.data[o+1]==1)o=$c(this.data,o+2);else break;i=n($c(this.data,o+1))}return i}nextStates(e){let n=[];for(let r=this.stateSlot(e,1);;r+=3){if(this.data[r]==65535)if(this.data[r+1]==1)r=$c(this.data,r+2);else break;if(!(this.data[r+2]&1)){let i=this.data[r+1];n.some((o,a)=>a&1&&o==i)||n.push(this.data[r],i)}}return n}configure(e){let n=Object.assign(Object.create(y_.prototype),this);if(e.props&&(n.nodeSet=this.nodeSet.extend(...e.props)),e.top){let r=this.topRules[e.top];if(!r)throw new RangeError(`Invalid top rule name ${e.top}`);n.top=r}return e.tokenizers&&(n.tokenizers=this.tokenizers.map(r=>{let i=e.tokenizers.find(o=>o.from==r);return i?i.to:r})),e.specializers&&(n.specializers=this.specializers.slice(),n.specializerSpecs=this.specializerSpecs.map((r,i)=>{let o=e.specializers.find(s=>s.from==r.external);if(!o)return r;let a=Object.assign(Object.assign({},r),{external:o.to});return n.specializers[i]=Zq(a),a})),e.contextTracker&&(n.context=e.contextTracker),e.dialect&&(n.dialect=this.parseDialect(e.dialect)),e.strict!=null&&(n.strict=e.strict),e.wrap&&(n.wrappers=n.wrappers.concat(e.wrap)),e.bufferLength!=null&&(n.bufferLength=e.bufferLength),n}hasWrappers(){return this.wrappers.length>0}getName(e){return this.termNames?this.termNames[e]:String(e<=this.maxNode&&this.nodeSet.types[e].name||e)}get eofTerm(){return this.maxNode+1}get topNode(){return this.nodeSet.types[this.top[1]]}dynamicPrecedence(e){let n=this.dynamicPrecedences;return n==null?0:n[e]||0}parseDialect(e){let n=Object.keys(this.dialects),r=n.map(()=>!1);if(e)for(let o of e.split(" ")){let a=n.indexOf(o);a>=0&&(r[a]=!0)}let i=null;for(let o=0;o<n.length;o++)if(!r[o])for(let a=this.dialects[n[o]],s;(s=this.data[a++])!=65535;)(i||(i=new Uint8Array(this.maxTerm+1)))[s]=1;return new Gut(e,r,i)}static deserialize(e){return new y_(e)}}function $c(t,e){return t[e]|t[e+1]<<16}function qut(t){let e=null;for(let n of t){let r=n.p.stoppedAt;(n.pos==n.p.stream.end||r!=null&&n.pos>r)&&n.p.parser.stateFlag(n.state,2)&&(!e||e.score<n.score)&&(e=n)}return e}function Zq(t){if(t.external){let e=t.extend?1:0;return(n,r)=>t.external(n,r)<<1|e}return t.get}const Xut=N4({String:Ce.string,Number:Ce.number,"True False":Ce.bool,PropertyName:Ce.propertyName,Null:Ce.null,",":Ce.separator,"[ ]":Ce.squareBracket,"{ }":Ce.brace}),Qut=y_.deserialize({version:14,states:"$bOVQPOOOOQO'#Cb'#CbOnQPO'#CeOvQPO'#CjOOQO'#Cp'#CpQOQPOOOOQO'#Cg'#CgO}QPO'#CfO!SQPO'#CrOOQO,59P,59PO![QPO,59PO!aQPO'#CuOOQO,59U,59UO!iQPO,59UOVQPO,59QOqQPO'#CkO!nQPO,59^OOQO1G.k1G.kOVQPO'#ClO!vQPO,59aOOQO1G.p1G.pOOQO1G.l1G.lOOQO,59V,59VOOQO-E6i-E6iOOQO,59W,59WOOQO-E6j-E6j",stateData:"#O~OcOS~OQSORSOSSOTSOWQO]ROePO~OVXOeUO~O[[O~PVOg^O~Oh_OVfX~OVaO~OhbO[iX~O[dO~Oh_OVfa~OhbO[ia~O",goto:"!kjPPPPPPkPPkqwPPk{!RPPP!XP!ePP!hXSOR^bQWQRf_TVQ_Q`WRg`QcZRicQTOQZRQe^RhbRYQR]R",nodeNames:"⚠ JsonText True False Null Number String } { Object Property PropertyName ] [ Array",maxTerm:25,nodeProps:[["isolate",-2,6,11,""],["openedBy",7,"{",12,"["],["closedBy",8,"}",13,"]"]],propSources:[Xut],skippedNodes:[0],repeatNodeCount:2,tokenData:"(|~RaXY!WYZ!W]^!Wpq!Wrs!]|}$u}!O$z!Q!R%T!R![&c![!]&t!}#O&y#P#Q'O#Y#Z'T#b#c'r#h#i(Z#o#p(r#q#r(w~!]Oc~~!`Wpq!]qr!]rs!xs#O!]#O#P!}#P;'S!];'S;=`$o<%lO!]~!}Oe~~#QXrs!]!P!Q!]#O#P!]#U#V!]#Y#Z!]#b#c!]#f#g!]#h#i!]#i#j#m~#pR!Q![#y!c!i#y#T#Z#y~#|R!Q![$V!c!i$V#T#Z$V~$YR!Q![$c!c!i$c#T#Z$c~$fR!Q![!]!c!i!]#T#Z!]~$rP;=`<%l!]~$zOh~~$}Q!Q!R%T!R![&c~%YRT~!O!P%c!g!h%w#X#Y%w~%fP!Q![%i~%nRT~!Q![%i!g!h%w#X#Y%w~%zR{|&T}!O&T!Q![&Z~&WP!Q![&Z~&`PT~!Q![&Z~&hST~!O!P%c!Q![&c!g!h%w#X#Y%w~&yOg~~'OO]~~'TO[~~'WP#T#U'Z~'^P#`#a'a~'dP#g#h'g~'jP#X#Y'm~'rOR~~'uP#i#j'x~'{P#`#a(O~(RP#`#a(U~(ZOS~~(^P#f#g(a~(dP#i#j(g~(jP#X#Y(m~(rOQ~~(wOW~~(|OV~",tokenizers:[0],topRules:{JsonText:[0,1]},tokenPrec:0}),Yut=u_.define({name:"json",parser:Qut.configure({props:[F4.add({Object:dq({except:/^\s*\}/}),Array:dq({except:/^\s*\]/})}),B4.add({"Object Array":ihe})]}),languageData:{closeBrackets:{brackets:["[","{",'"']},indentOnInput:/^\s*[\}\]]$/}});function Spe(){return new the(Yut)}const Kut=1,Ope=194,Cpe=195,Zut=196,Jq=197,Jut=198,eft=199,tft=200,nft=2,Tpe=3,eX=201,rft=24,ift=25,oft=49,aft=50,sft=55,lft=56,cft=57,uft=59,fft=60,dft=61,hft=62,pft=63,mft=65,gft=238,vft=71,yft=241,xft=242,bft=243,_ft=244,wft=245,Sft=246,Oft=247,Cft=248,Epe=72,Tft=249,Eft=250,Pft=251,Mft=252,kft=253,Aft=254,Rft=255,Ift=256,Dft=73,Lft=77,Nft=263,$ft=112,Fft=130,jft=151,Bft=152,zft=155,dp=10,x_=13,tU=32,ak=9,nU=35,Uft=40,Wft=46,JN=123,tX=125,Ppe=39,Mpe=34,Vft=92,Gft=111,Hft=120,qft=78,Xft=117,Qft=85,Yft=new Set([ift,oft,aft,Nft,mft,Fft,lft,cft,gft,hft,pft,Epe,Dft,Lft,fft,dft,jft,Bft,zft,$ft]);function lI(t){return t==dp||t==x_}function cI(t){return t>=48&&t<=57||t>=65&&t<=70||t>=97&&t<=102}const Kft=new ok((t,e)=>{let n;if(t.next<0)t.acceptToken(eft);else if(e.context.flags&XC)lI(t.next)&&t.acceptToken(Jut,1);else if(((n=t.peek(-1))<0||lI(n))&&e.canShift(Jq)){let r=0;for(;t.next==tU||t.next==ak;)t.advance(),r++;(t.next==dp||t.next==x_||t.next==nU)&&t.acceptToken(Jq,-r)}else lI(t.next)&&t.acceptToken(Zut,1)},{contextual:!0}),Zft=new ok((t,e)=>{let n=e.context;if(n.flags)return;let r=t.peek(-1);if(r==dp||r==x_){let i=0,o=0;for(;;){if(t.next==tU)i++;else if(t.next==ak)i+=8-i%8;else break;t.advance(),o++}i!=n.indent&&t.next!=dp&&t.next!=x_&&t.next!=nU&&(i<n.indent?t.acceptToken(Cpe,-o):t.acceptToken(Ope))}}),XC=1,kpe=2,Ec=4,Pc=8,Mc=16,kc=32;function QC(t,e,n){this.parent=t,this.indent=e,this.flags=n,this.hash=(t?t.hash+t.hash<<8:0)+e+(e<<4)+n+(n<<6)}const Jft=new QC(null,0,0);function edt(t){let e=0;for(let n=0;n<t.length;n++)e+=t.charCodeAt(n)==ak?8-e%8:1;return e}const nX=new Map([[yft,0],[xft,Ec],[bft,Pc],[_ft,Pc|Ec],[wft,Mc],[Sft,Mc|Ec],[Oft,Mc|Pc],[Cft,Mc|Pc|Ec],[Tft,kc],[Eft,kc|Ec],[Pft,kc|Pc],[Mft,kc|Pc|Ec],[kft,kc|Mc],[Aft,kc|Mc|Ec],[Rft,kc|Mc|Pc],[Ift,kc|Mc|Pc|Ec]].map(([t,e])=>[t,e|kpe])),tdt=new Hut({start:Jft,reduce(t,e,n,r){return t.flags&XC&&Yft.has(e)||(e==vft||e==Epe)&&t.flags&kpe?t.parent:t},shift(t,e,n,r){return e==Ope?new QC(t,edt(r.read(r.pos,n.pos)),0):e==Cpe?t.parent:e==rft||e==sft||e==uft||e==Tpe?new QC(t,0,XC):nX.has(e)?new QC(t,0,nX.get(e)|t.flags&XC):t},hash(t){return t.hash}}),ndt=new ok(t=>{for(let e=0;e<5;e++){if(t.next!="print".charCodeAt(e))return;t.advance()}if(!/\w/.test(String.fromCharCode(t.next)))for(let e=0;;e++){let n=t.peek(e);if(!(n==tU||n==ak)){n!=Uft&&n!=Wft&&n!=dp&&n!=x_&&n!=nU&&t.acceptToken(Kut);return}}}),rdt=new ok((t,e)=>{let{flags:n}=e.context,r=n&Ec?Mpe:Ppe,i=(n&Pc)>0,o=!(n&Mc),a=(n&kc)>0,s=t.pos;for(;!(t.next<0);)if(a&&t.next==JN)if(t.peek(1)==JN)t.advance(2);else{if(t.pos==s){t.acceptToken(Tpe,1);return}break}else if(o&&t.next==Vft){if(t.pos==s){t.advance();let l=t.next;l>=0&&(t.advance(),idt(t,l)),t.acceptToken(nft);return}break}else if(t.next==r&&(!i||t.peek(1)==r&&t.peek(2)==r)){if(t.pos==s){t.acceptToken(eX,i?3:1);return}break}else if(t.next==dp){if(i)t.advance();else if(t.pos==s){t.acceptToken(eX);return}break}else t.advance();t.pos>s&&t.acceptToken(tft)});function idt(t,e){if(e==Gft)for(let n=0;n<2&&t.next>=48&&t.next<=55;n++)t.advance();else if(e==Hft)for(let n=0;n<2&&cI(t.next);n++)t.advance();else if(e==Xft)for(let n=0;n<4&&cI(t.next);n++)t.advance();else if(e==Qft)for(let n=0;n<8&&cI(t.next);n++)t.advance();else if(e==qft&&t.next==JN){for(t.advance();t.next>=0&&t.next!=tX&&t.next!=Ppe&&t.next!=Mpe&&t.next!=dp;)t.advance();t.next==tX&&t.advance()}}const odt=N4({'async "*" "**" FormatConversion FormatSpec':Ce.modifier,"for while if elif else try except finally return raise break continue with pass assert await yield match case":Ce.controlKeyword,"in not and or is del":Ce.operatorKeyword,"from def class global nonlocal lambda":Ce.definitionKeyword,import:Ce.moduleKeyword,"with as print":Ce.keyword,Boolean:Ce.bool,None:Ce.null,VariableName:Ce.variableName,"CallExpression/VariableName":Ce.function(Ce.variableName),"FunctionDefinition/VariableName":Ce.function(Ce.definition(Ce.variableName)),"ClassDefinition/VariableName":Ce.definition(Ce.className),PropertyName:Ce.propertyName,"CallExpression/MemberExpression/PropertyName":Ce.function(Ce.propertyName),Comment:Ce.lineComment,Number:Ce.number,String:Ce.string,FormatString:Ce.special(Ce.string),Escape:Ce.escape,UpdateOp:Ce.updateOperator,"ArithOp!":Ce.arithmeticOperator,BitOp:Ce.bitwiseOperator,CompareOp:Ce.compareOperator,AssignOp:Ce.definitionOperator,Ellipsis:Ce.punctuation,At:Ce.meta,"( )":Ce.paren,"[ ]":Ce.squareBracket,"{ }":Ce.brace,".":Ce.derefOperator,", ;":Ce.separator}),adt={__proto__:null,await:44,or:54,and:56,in:60,not:62,is:64,if:70,else:72,lambda:76,yield:94,from:96,async:102,for:104,None:162,True:164,False:164,del:178,pass:182,break:186,continue:190,return:194,raise:202,import:206,as:208,global:212,nonlocal:214,assert:218,type:223,elif:236,while:240,try:246,except:248,finally:250,with:254,def:258,class:268,match:279,case:285},sdt=y_.deserialize({version:14,states:"##jO`QeOOP$}OSOOO&WQtO'#HUOOQS'#Co'#CoOOQS'#Cp'#CpO'vQdO'#CnO*UQtO'#HTOOQS'#HU'#HUOOQS'#DU'#DUOOQS'#HT'#HTO*rQdO'#D_O+VQdO'#DfO+gQdO'#DjO+zOWO'#DuO,VOWO'#DvO.[QtO'#GuOOQS'#Gu'#GuO'vQdO'#GtO0ZQtO'#GtOOQS'#Eb'#EbO0rQdO'#EcOOQS'#Gs'#GsO0|QdO'#GrOOQV'#Gr'#GrO1XQdO'#FYOOQS'#G^'#G^O1^QdO'#FXOOQV'#IS'#ISOOQV'#Gq'#GqOOQV'#Fq'#FqQ`QeOOO'vQdO'#CqO1lQdO'#C}O1sQdO'#DRO2RQdO'#HYO2cQtO'#EVO'vQdO'#EWOOQS'#EY'#EYOOQS'#E['#E[OOQS'#E^'#E^O2wQdO'#E`O3_QdO'#EdO3rQdO'#EfO3zQtO'#EfO1XQdO'#EiO0rQdO'#ElO1XQdO'#EnO0rQdO'#EtO0rQdO'#EwO4VQdO'#EyO4^QdO'#FOO4iQdO'#EzO0rQdO'#FOO1XQdO'#FQO1XQdO'#FVO4nQdO'#F[P4uOdO'#GpPOOO)CBd)CBdOOQS'#Ce'#CeOOQS'#Cf'#CfOOQS'#Cg'#CgOOQS'#Ch'#ChOOQS'#Ci'#CiOOQS'#Cj'#CjOOQS'#Cl'#ClO'vQdO,59OO'vQdO,59OO'vQdO,59OO'vQdO,59OO'vQdO,59OO'vQdO,59OO5QQdO'#DoOOQS,5:Y,5:YO5eQdO'#HdOOQS,5:],5:]O5rQ!fO,5:]O5wQtO,59YO1lQdO,59bO1lQdO,59bO1lQdO,59bO8gQdO,59bO8lQdO,59bO8sQdO,59jO8zQdO'#HTO:QQdO'#HSOOQS'#HS'#HSOOQS'#D['#D[O:iQdO,59aO'vQdO,59aO:wQdO,59aOOQS,59y,59yO:|QdO,5:RO'vQdO,5:ROOQS,5:Q,5:QO;[QdO,5:QO;aQdO,5:XO'vQdO,5:XO'vQdO,5:VOOQS,5:U,5:UO;rQdO,5:UO;wQdO,5:WOOOW'#Fy'#FyO;|OWO,5:aOOQS,5:a,5:aO<XQdO'#HwOOOW'#Dw'#DwOOOW'#Fz'#FzO<iOWO,5:bOOQS,5:b,5:bOOQS'#F}'#F}O<wQtO,5:iO?iQtO,5=`O@SQ#xO,5=`O@sQtO,5=`OOQS,5:},5:}OA[QeO'#GWOBnQdO,5;^OOQV,5=^,5=^OByQtO'#IPOChQdO,5;tOOQS-E:[-E:[OOQV,5;s,5;sO4dQdO'#FQOOQV-E9o-E9oOCpQtO,59]OEwQtO,59iOFbQdO'#HVOFmQdO'#HVO1XQdO'#HVOFxQdO'#DTOGQQdO,59mOGVQdO'#HZO'vQdO'#HZO0rQdO,5=tOOQS,5=t,5=tO0rQdO'#EROOQS'#ES'#ESOGtQdO'#GPOHUQdO,58|OHUQdO,58|O*xQdO,5:oOHdQtO'#H]OOQS,5:r,5:rOOQS,5:z,5:zOHwQdO,5;OOIYQdO'#IOO1XQdO'#H}OOQS,5;Q,5;QOOQS'#GT'#GTOInQtO,5;QOI|QdO,5;QOJRQdO'#IQOOQS,5;T,5;TOJaQdO'#H|OOQS,5;W,5;WOJrQdO,5;YO4iQdO,5;`O4iQdO,5;cOJzQtO'#ITO'vQdO'#ITOKUQdO,5;eO4VQdO,5;eO0rQdO,5;jO1XQdO,5;lOKZQeO'#EuOLgQgO,5;fO!!hQdO'#IUO4iQdO,5;jO!!sQdO,5;lO!!{QdO,5;qO!#WQtO,5;vO'vQdO,5;vPOOO,5=[,5=[P!#_OSO,5=[P!#dOdO,5=[O!&XQtO1G.jO!&`QtO1G.jO!)PQtO1G.jO!)ZQtO1G.jO!+tQtO1G.jO!,XQtO1G.jO!,lQdO'#HcO!,zQtO'#GuO0rQdO'#HcO!-UQdO'#HbOOQS,5:Z,5:ZO!-^QdO,5:ZO!-cQdO'#HeO!-nQdO'#HeO!.RQdO,5>OOOQS'#Ds'#DsOOQS1G/w1G/wOOQS1G.|1G.|O!/RQtO1G.|O!/YQtO1G.|O1lQdO1G.|O!/uQdO1G/UOOQS'#DZ'#DZO0rQdO,59tOOQS1G.{1G.{O!/|QdO1G/eO!0^QdO1G/eO!0fQdO1G/fO'vQdO'#H[O!0kQdO'#H[O!0pQtO1G.{O!1QQdO,59iO!2WQdO,5=zO!2hQdO,5=zO!2pQdO1G/mO!2uQtO1G/mOOQS1G/l1G/lO!3VQdO,5=uO!3|QdO,5=uO0rQdO1G/qO!4kQdO1G/sO!4pQtO1G/sO!5QQtO1G/qOOQS1G/p1G/pOOQS1G/r1G/rOOOW-E9w-E9wOOQS1G/{1G/{O!5bQdO'#HxO0rQdO'#HxO!5sQdO,5>cOOOW-E9x-E9xOOQS1G/|1G/|OOQS-E9{-E9{O!6RQ#xO1G2zO!6rQtO1G2zO'vQdO,5<jOOQS,5<j,5<jOOQS-E9|-E9|OOQS,5<r,5<rOOQS-E:U-E:UOOQV1G0x1G0xO1XQdO'#GRO!7ZQtO,5>kOOQS1G1`1G1`O!7xQdO1G1`OOQS'#DV'#DVO0rQdO,5=qOOQS,5=q,5=qO!7}QdO'#FrO!8YQdO,59oO!8bQdO1G/XO!8lQtO,5=uOOQS1G3`1G3`OOQS,5:m,5:mO!9]QdO'#GtOOQS,5<k,5<kOOQS-E9}-E9}O!9nQdO1G.hOOQS1G0Z1G0ZO!9|QdO,5=wO!:^QdO,5=wO0rQdO1G0jO0rQdO1G0jO!:oQdO,5>jO!;QQdO,5>jO1XQdO,5>jO!;cQdO,5>iOOQS-E:R-E:RO!;hQdO1G0lO!;sQdO1G0lO!;xQdO,5>lO!<WQdO,5>lO!<fQdO,5>hO!<|QdO,5>hO!=_QdO'#EpO0rQdO1G0tO!=jQdO1G0tO!=oQgO1G0zO!AmQgO1G0}O!EhQdO,5>oO!ErQdO,5>oO!EzQtO,5>oO0rQdO1G1PO!FUQdO1G1PO4iQdO1G1UO!!sQdO1G1WOOQV,5;a,5;aO!FZQfO,5;aO!F`QgO1G1QO!JaQdO'#GZO4iQdO1G1QO4iQdO1G1QO!JqQdO,5>pO!KOQdO,5>pO1XQdO,5>pOOQV1G1U1G1UO!KWQdO'#FSO!KiQ!fO1G1WO!KqQdO1G1WOOQV1G1]1G1]O4iQdO1G1]O!KvQdO1G1]O!LOQdO'#F^OOQV1G1b1G1bO!#WQtO1G1bPOOO1G2v1G2vP!LTOSO1G2vOOQS,5=},5=}OOQS'#Dp'#DpO0rQdO,5=}O!LYQdO,5=|O!LmQdO,5=|OOQS1G/u1G/uO!LuQdO,5>PO!MVQdO,5>PO!M_QdO,5>PO!MrQdO,5>PO!NSQdO,5>POOQS1G3j1G3jOOQS7+$h7+$hO!8bQdO7+$pO# uQdO1G.|O# |QdO1G.|OOQS1G/`1G/`OOQS,5<`,5<`O'vQdO,5<`OOQS7+%P7+%PO#!TQdO7+%POOQS-E9r-E9rOOQS7+%Q7+%QO#!eQdO,5=vO'vQdO,5=vOOQS7+$g7+$gO#!jQdO7+%PO#!rQdO7+%QO#!wQdO1G3fOOQS7+%X7+%XO##XQdO1G3fO##aQdO7+%XOOQS,5<_,5<_O'vQdO,5<_O##fQdO1G3aOOQS-E9q-E9qO#$]QdO7+%]OOQS7+%_7+%_O#$kQdO1G3aO#%YQdO7+%_O#%_QdO1G3gO#%oQdO1G3gO#%wQdO7+%]O#%|QdO,5>dO#&gQdO,5>dO#&gQdO,5>dOOQS'#Dx'#DxO#&xO&jO'#DzO#'TO`O'#HyOOOW1G3}1G3}O#'YQdO1G3}O#'bQdO1G3}O#'mQ#xO7+(fO#(^QtO1G2UP#(wQdO'#GOOOQS,5<m,5<mOOQS-E:P-E:POOQS7+&z7+&zOOQS1G3]1G3]OOQS,5<^,5<^OOQS-E9p-E9pOOQS7+$s7+$sO#)UQdO,5=`O#)oQdO,5=`O#*QQtO,5<aO#*eQdO1G3cOOQS-E9s-E9sOOQS7+&U7+&UO#*uQdO7+&UO#+TQdO,5<nO#+iQdO1G4UOOQS-E:Q-E:QO#+zQdO1G4UOOQS1G4T1G4TOOQS7+&W7+&WO#,]QdO7+&WOOQS,5<p,5<pO#,hQdO1G4WOOQS-E:S-E:SOOQS,5<l,5<lO#,vQdO1G4SOOQS-E:O-E:OO1XQdO'#EqO#-^QdO'#EqO#-iQdO'#IRO#-qQdO,5;[OOQS7+&`7+&`O0rQdO7+&`O#-vQgO7+&fO!JdQdO'#GXO4iQdO7+&fO4iQdO7+&iO#1tQtO,5<tO'vQdO,5<tO#2OQdO1G4ZOOQS-E:W-E:WO#2YQdO1G4ZO4iQdO7+&kO0rQdO7+&kOOQV7+&p7+&pO!KiQ!fO7+&rO!KqQdO7+&rO`QeO1G0{OOQV-E:X-E:XO4iQdO7+&lO4iQdO7+&lOOQV,5<u,5<uO#2bQdO,5<uO!JdQdO,5<uOOQV7+&l7+&lO#2mQgO7+&lO#6hQdO,5<vO#6sQdO1G4[OOQS-E:Y-E:YO#7QQdO1G4[O#7YQdO'#IWO#7hQdO'#IWO1XQdO'#IWOOQS'#IW'#IWO#7sQdO'#IVOOQS,5;n,5;nO#7{QdO,5;nO0rQdO'#FUOOQV7+&r7+&rO4iQdO7+&rOOQV7+&w7+&wO4iQdO7+&wO#8QQfO,5;xOOQV7+&|7+&|POOO7+(b7+(bO#8VQdO1G3iOOQS,5<c,5<cO#8eQdO1G3hOOQS-E9u-E9uO#8xQdO,5<dO#9TQdO,5<dO#9hQdO1G3kOOQS-E9v-E9vO#9xQdO1G3kO#:QQdO1G3kO#:bQdO1G3kO#9xQdO1G3kOOQS<<H[<<H[O#:mQtO1G1zOOQS<<Hk<<HkP#:zQdO'#FtO8sQdO1G3bO#;XQdO1G3bO#;^QdO<<HkOOQS<<Hl<<HlO#;nQdO7+)QOOQS<<Hs<<HsO#<OQtO1G1yP#<oQdO'#FsO#<|QdO7+)RO#=^QdO7+)RO#=fQdO<<HwO#=kQdO7+({OOQS<<Hy<<HyO#>bQdO,5<bO'vQdO,5<bOOQS-E9t-E9tOOQS<<Hw<<HwOOQS,5<g,5<gO0rQdO,5<gO#>gQdO1G4OOOQS-E9y-E9yO#?QQdO1G4OO<XQdO'#H{OOOO'#D{'#D{OOOO'#F|'#F|O#?cO&jO,5:fOOOW,5>e,5>eOOOW7+)i7+)iO#?nQdO7+)iO#?vQdO1G2zO#@aQdO1G2zP'vQdO'#FuO0rQdO<<IpO1XQdO1G2YP1XQdO'#GSO#@rQdO7+)pO#ATQdO7+)pOOQS<<Ir<<IrP1XQdO'#GUP0rQdO'#GQOOQS,5;],5;]O#AfQdO,5>mO#AtQdO,5>mOOQS1G0v1G0vOOQS<<Iz<<IzOOQV-E:V-E:VO4iQdO<<JQOOQV,5<s,5<sO4iQdO,5<sOOQV<<JQ<<JQOOQV<<JT<<JTO#A|QtO1G2`P#BWQdO'#GYO#B_QdO7+)uO#BiQgO<<JVO4iQdO<<JVOOQV<<J^<<J^O4iQdO<<J^O!KiQ!fO<<J^O#FdQgO7+&gOOQV<<JW<<JWO#FnQgO<<JWOOQV1G2a1G2aO1XQdO1G2aO#JiQdO1G2aO4iQdO<<JWO1XQdO1G2bP0rQdO'#G[O#JtQdO7+)vO#KRQdO7+)vOOQS'#FT'#FTO0rQdO,5>rO#KZQdO,5>rOOQS,5>r,5>rO#KfQdO,5>qO#KwQdO,5>qOOQS1G1Y1G1YOOQS,5;p,5;pOOQV<<Jc<<JcO#LPQdO1G1dOOQS7+)T7+)TP#LUQdO'#FwO#LfQdO1G2OO#LyQdO1G2OO#MZQdO1G2OP#MfQdO'#FxO#MsQdO7+)VO#NTQdO7+)VO#NTQdO7+)VO#N]QdO7+)VO#NmQdO7+(|O8sQdO7+(|OOQSAN>VAN>VO$ WQdO<<LmOOQSAN>cAN>cO0rQdO1G1|O$ hQtO1G1|P$ rQdO'#FvOOQS1G2R1G2RP$!PQdO'#F{O$!^QdO7+)jO$!wQdO,5>gOOOO-E9z-E9zOOOW<<MT<<MTO$#VQdO7+(fOOQSAN?[AN?[OOQS7+'t7+'tO$#pQdO<<M[OOQS,5<q,5<qO$$RQdO1G4XOOQS-E:T-E:TOOQVAN?lAN?lOOQV1G2_1G2_O4iQdOAN?qO$$aQgOAN?qOOQVAN?xAN?xO4iQdOAN?xOOQV<<JR<<JRO4iQdOAN?rO4iQdO7+'{OOQV7+'{7+'{O1XQdO7+'{OOQVAN?rAN?rOOQS7+'|7+'|O$([QdO<<MbOOQS1G4^1G4^O0rQdO1G4^OOQS,5<w,5<wO$(iQdO1G4]OOQS-E:Z-E:ZOOQU'#G_'#G_O$(zQfO7+'OO$)VQdO'#F_O$*^QdO7+'jO$*nQdO7+'jOOQS7+'j7+'jO$*yQdO<<LqO$+ZQdO<<LqO$+ZQdO<<LqO$+cQdO'#H^OOQS<<Lh<<LhO$+mQdO<<LhOOQS7+'h7+'hOOQS'#D|'#D|OOOO1G4R1G4RO$,WQdO1G4RO$,`QdO1G4RP!=_QdO'#GVOOQVG25]G25]O4iQdOG25]OOQVG25dG25dOOQVG25^G25^OOQV<<Kg<<KgO4iQdO<<KgOOQS7+)x7+)xP$,kQdO'#G]OOQU-E:]-E:]OOQV<<Jj<<JjO$-_QtO'#FaOOQS'#Fc'#FcO$-oQdO'#FbO$.aQdO'#FbOOQS'#Fb'#FbO$.fQdO'#IYO$)VQdO'#FiO$)VQdO'#FiO$.}QdO'#FjO$)VQdO'#FkO$/UQdO'#IZOOQS'#IZ'#IZO$/sQdO,5;yOOQS<<KU<<KUO$/{QdO<<KUO$0]QdOANB]O$0mQdOANB]O$0uQdO'#H_OOQS'#H_'#H_O1sQdO'#DcO$1`QdO,5=xOOQSANBSANBSOOOO7+)m7+)mO$1wQdO7+)mOOQVLD*wLD*wOOQVANARANARO5rQ!fO'#GaO$2PQtO,5<SO$)VQdO'#FmOOQS,5<W,5<WOOQS'#Fd'#FdO$2qQdO,5;|O$2vQdO,5;|OOQS'#Fg'#FgO$)VQdO'#G`O$3hQdO,5<QO$4SQdO,5>tO$4dQdO,5>tO1XQdO,5<PO$4uQdO,5<TO$4zQdO,5<TO$)VQdO'#I[O$5PQdO'#I[O$5UQdO,5<UOOQS,5<V,5<VO'vQdO'#FpOOQU1G1e1G1eO4iQdO1G1eOOQSAN@pAN@pO$5ZQdOG27wO$5kQdO,59}OOQS1G3d1G3dOOOO<<MX<<MXOOQS,5<{,5<{OOQS-E:_-E:_O$5pQtO'#FaO$5wQdO'#I]O$6VQdO'#I]O$6_QdO,5<XOOQS1G1h1G1hO$6dQdO1G1hO$6iQdO,5<zOOQS-E:^-E:^O$7TQdO,5=OO$7lQdO1G4`OOQS-E:b-E:bOOQS1G1k1G1kOOQS1G1o1G1oO$7|QdO,5>vO$)VQdO,5>vOOQS1G1p1G1pO$8[QtO,5<[OOQU7+'P7+'PO$+cQdO1G/iO$)VQdO,5<YO$8cQdO,5>wO$8jQdO,5>wOOQS1G1s1G1sOOQS7+'S7+'SP$)VQdO'#GdO$8rQdO1G4bO$8|QdO1G4bO$9UQdO1G4bOOQS7+%T7+%TO$9dQdO1G1tO$9rQtO'#FaO$9yQdO,5<}OOQS,5<},5<}O$:XQdO1G4cOOQS-E:a-E:aO$)VQdO,5<|O$:`QdO,5<|O$:eQdO7+)|OOQS-E:`-E:`O$:oQdO7+)|O$)VQdO,5<ZP$)VQdO'#GcO$:wQdO1G2hO$)VQdO1G2hP$;VQdO'#GbO$;^QdO<<MhO$;hQdO1G1uO$;vQdO7+(SO8sQdO'#C}O8sQdO,59bO8sQdO,59bO8sQdO,59bO$<UQtO,5=`O8sQdO1G.|O0rQdO1G/XO0rQdO7+$pP$<iQdO'#GOO'vQdO'#GtO$<vQdO,59bO$<{QdO,59bO$=SQdO,59mO$=XQdO1G/UO1sQdO'#DRO8sQdO,59j",stateData:"$=r~O%cOS%^OSSOS%]PQ~OPdOVaOfoOhYOopOs!POvqO!PrO!Q{O!T!SO!U!RO!XZO!][O!h`O!r`O!s`O!t`O!{tO!}uO#PvO#RwO#TxO#XyO#ZzO#^|O#_|O#a}O#c!OO#l!QO#o!TO#s!UO#u!VO#z!WO#}hO$P!XO%oRO%pRO%tSO%uWO&Z]O&[]O&]]O&^]O&_]O&`]O&a]O&b]O&c^O&d^O&e^O&f^O&g^O&h^O&i^O&j^O~O%]!YO~OV!aO_!aOa!bOh!iO!X!kO!f!mO%j![O%k!]O%l!^O%m!_O%n!_O%o!`O%p!`O%q!aO%r!aO%s!aO~Ok%xXl%xXm%xXn%xXo%xXp%xXs%xXz%xX{%xX!x%xX#g%xX%[%xX%_%xX%z%xXg%xX!T%xX!U%xX%{%xX!W%xX![%xX!Q%xX#[%xXt%xX!m%xX~P%SOfoOhYO!XZO!][O!h`O!r`O!s`O!t`O%oRO%pRO%tSO%uWO&Z]O&[]O&]]O&^]O&_]O&`]O&a]O&b]O&c^O&d^O&e^O&f^O&g^O&h^O&i^O&j^O~Oz%wX{%wX#g%wX%[%wX%_%wX%z%wX~Ok!pOl!qOm!oOn!oOo!rOp!sOs!tO!x%wX~P)pOV!zOg!|Oo0cOv0qO!PrO~P'vOV#OOo0cOv0qO!W#PO~P'vOV#SOa#TOo0cOv0qO![#UO~P'vOQ#XO%`#XO%a#ZO~OQ#^OR#[O%`#^O%a#`O~OV%iX_%iXa%iXh%iXk%iXl%iXm%iXn%iXo%iXp%iXs%iXz%iX!X%iX!f%iX%j%iX%k%iX%l%iX%m%iX%n%iX%o%iX%p%iX%q%iX%r%iX%s%iXg%iX!T%iX!U%iX~O&Z]O&[]O&]]O&^]O&_]O&`]O&a]O&b]O&c^O&d^O&e^O&f^O&g^O&h^O&i^O&j^O{%iX!x%iX#g%iX%[%iX%_%iX%z%iX%{%iX!W%iX![%iX!Q%iX#[%iXt%iX!m%iX~P,eOz#dO{%hX!x%hX#g%hX%[%hX%_%hX%z%hX~Oo0cOv0qO~P'vO#g#gO%[#iO%_#iO~O%uWO~O!T#nO#u!VO#z!WO#}hO~OopO~P'vOV#sOa#tO%uWO{wP~OV#xOo0cOv0qO!Q#yO~P'vO{#{O!x$QO%z#|O#g!yX%[!yX%_!yX~OV#xOo0cOv0qO#g#SX%[#SX%_#SX~P'vOo0cOv0qO#g#WX%[#WX%_#WX~P'vOh$WO%uWO~O!f$YO!r$YO%uWO~OV$eO~P'vO!U$gO#s$hO#u$iO~O{$jO~OV$qO~P'vOS$sO%[$rO%c$tO~OV$}Oa$}Og%POo0cOv0qO~P'vOo0cOv0qO{%SO~P'vO&Y%UO~Oa!bOh!iO!X!kO!f!mOVba_bakbalbambanbaobapbasbazba{ba!xba#gba%[ba%_ba%jba%kba%lba%mba%nba%oba%pba%qba%rba%sba%zbagba!Tba!Uba%{ba!Wba![ba!Qba#[batba!mba~On%ZO~Oo%ZO~P'vOo0cO~P'vOk0eOl0fOm0dOn0dOo0mOp0nOs0rOg%wX!T%wX!U%wX%{%wX!W%wX![%wX!Q%wX#[%wX!m%wX~P)pO%{%]Og%vXz%vX!T%vX!U%vX!W%vX{%vX~Og%_Oz%`O!T%dO!U%cO~Og%_O~Oz%gO!T%dO!U%cO!W&SX~O!W%kO~Oz%lO{%nO!T%dO!U%cO![%}X~O![%rO~O![%sO~OQ#XO%`#XO%a%uO~OV%wOo0cOv0qO!PrO~P'vOQ#^OR#[O%`#^O%a%zO~OV!qa_!qaa!qah!qak!qal!qam!qan!qao!qap!qas!qaz!qa{!qa!X!qa!f!qa!x!qa#g!qa%[!qa%_!qa%j!qa%k!qa%l!qa%m!qa%n!qa%o!qa%p!qa%q!qa%r!qa%s!qa%z!qag!qa!T!qa!U!qa%{!qa!W!qa![!qa!Q!qa#[!qat!qa!m!qa~P#yOz%|O{%ha!x%ha#g%ha%[%ha%_%ha%z%ha~P%SOV&OOopOvqO{%ha!x%ha#g%ha%[%ha%_%ha%z%ha~P'vOz%|O{%ha!x%ha#g%ha%[%ha%_%ha%z%ha~OPdOVaOopOvqO!PrO!Q{O!{tO!}uO#PvO#RwO#TxO#XyO#ZzO#^|O#_|O#a}O#c!OO#g$zX%[$zX%_$zX~P'vO#g#gO%[&TO%_&TO~O!f&UOh&sX%[&sXz&sX#[&sX#g&sX%_&sX#Z&sXg&sX~Oh!iO%[&WO~Okealeameaneaoeapeaseazea{ea!xea#gea%[ea%_ea%zeagea!Tea!Uea%{ea!Wea![ea!Qea#[eatea!mea~P%SOsqazqa{qa#gqa%[qa%_qa%zqa~Ok!pOl!qOm!oOn!oOo!rOp!sO!xqa~PE`O%z&YOz%yX{%yX~O%uWOz%yX{%yX~Oz&]O{wX~O{&_O~Oz%lO#g%}X%[%}X%_%}Xg%}X{%}X![%}X!m%}X%z%}X~OV0lOo0cOv0qO!PrO~P'vO%z#|O#gUa%[Ua%_Ua~Oz&hO#g&PX%[&PX%_&PXn&PX~P%SOz&kO!Q&jO#g#Wa%[#Wa%_#Wa~Oz&lO#[&nO#g&rX%[&rX%_&rXg&rX~O!f$YO!r$YO#Z&qO%uWO~O#Z&qO~Oz&sO#g&tX%[&tX%_&tX~Oz&uO#g&pX%[&pX%_&pX{&pX~O!X&wO%z&xO~Oz&|On&wX~P%SOn'PO~OPdOVaOopOvqO!PrO!Q{O!{tO!}uO#PvO#RwO#TxO#XyO#ZzO#^|O#_|O#a}O#c!OO%['UO~P'vOt'YO#p'WO#q'XOP#naV#naf#nah#nao#nas#nav#na!P#na!Q#na!T#na!U#na!X#na!]#na!h#na!r#na!s#na!t#na!{#na!}#na#P#na#R#na#T#na#X#na#Z#na#^#na#_#na#a#na#c#na#l#na#o#na#s#na#u#na#z#na#}#na$P#na%X#na%o#na%p#na%t#na%u#na&Z#na&[#na&]#na&^#na&_#na&`#na&a#na&b#na&c#na&d#na&e#na&f#na&g#na&h#na&i#na&j#na%Z#na%_#na~Oz'ZO#[']O{&xX~Oh'_O!X&wO~Oh!iO{$jO!X&wO~O{'eO~P%SO%['hO~OS'iO%['hO~OV!aO_!aOa!bOh!iO!X!kO!f!mO%l!^O%m!_O%n!_O%o!`O%p!`O%q!aO%r!aO%s!aOkWilWimWinWioWipWisWizWi{Wi!xWi#gWi%[Wi%_Wi%jWi%zWigWi!TWi!UWi%{Wi!WWi![Wi!QWi#[WitWi!mWi~O%k!]O~P!#lO%kWi~P!#lOV!aO_!aOa!bOh!iO!X!kO!f!mO%o!`O%p!`O%q!aO%r!aO%s!aOkWilWimWinWioWipWisWizWi{Wi!xWi#gWi%[Wi%_Wi%jWi%kWi%lWi%zWigWi!TWi!UWi%{Wi!WWi![Wi!QWi#[WitWi!mWi~O%m!_O%n!_O~P!&gO%mWi%nWi~P!&gOa!bOh!iO!X!kO!f!mOkWilWimWinWioWipWisWizWi{Wi!xWi#gWi%[Wi%_Wi%jWi%kWi%lWi%mWi%nWi%oWi%pWi%zWigWi!TWi!UWi%{Wi!WWi![Wi!QWi#[WitWi!mWi~OV!aO_!aO%q!aO%r!aO%s!aO~P!)eOVWi_Wi%qWi%rWi%sWi~P!)eO!T%dO!U%cOg&VXz&VX~O%z'kO%{'kO~P,eOz'mOg&UX~Og'oO~Oz'pO{'rO!W&XX~Oo0cOv0qOz'pO{'sO!W&XX~P'vO!W'uO~Om!oOn!oOo!rOp!sOkjisjizji{ji!xji#gji%[ji%_ji%zji~Ol!qO~P!.WOlji~P!.WOk0eOl0fOm0dOn0dOo0mOp0nO~Ot'wO~P!/aOV'|Og'}Oo0cOv0qO~P'vOg'}Oz(OO~Og(QO~O!U(SO~Og(TOz(OO!T%dO!U%cO~P%SOk0eOl0fOm0dOn0dOo0mOp0nOgqa!Tqa!Uqa%{qa!Wqa![qa!Qqa#[qatqa!mqa~PE`OV'|Oo0cOv0qO!W&Sa~P'vOz(WO!W&Sa~O!W(XO~Oz(WO!T%dO!U%cO!W&Sa~P%SOV(]Oo0cOv0qO![%}a#g%}a%[%}a%_%}ag%}a{%}a!m%}a%z%}a~P'vOz(^O![%}a#g%}a%[%}a%_%}ag%}a{%}a!m%}a%z%}a~O![(aO~Oz(^O!T%dO!U%cO![%}a~P%SOz(dO!T%dO!U%cO![&Ta~P%SOz(gO{&lX![&lX!m&lX%z&lX~O{(kO![(mO!m(nO%z(jO~OV&OOopOvqO{%hi!x%hi#g%hi%[%hi%_%hi%z%hi~P'vOz(pO{%hi!x%hi#g%hi%[%hi%_%hi%z%hi~O!f&UOh&sa%[&saz&sa#[&sa#g&sa%_&sa#Z&sag&sa~O%[(uO~OV#sOa#tO%uWO~Oz&]O{wa~OopOvqO~P'vOz(^O#g%}a%[%}a%_%}ag%}a{%}a![%}a!m%}a%z%}a~P%SOz(zO#g%hX%[%hX%_%hX%z%hX~O%z#|O#gUi%[Ui%_Ui~O#g&Pa%[&Pa%_&Pan&Pa~P'vOz(}O#g&Pa%[&Pa%_&Pan&Pa~O%uWO#g&ra%[&ra%_&rag&ra~Oz)SO#g&ra%[&ra%_&rag&ra~Og)VO~OV)WOh$WO%uWO~O#Z)XO~O%uWO#g&ta%[&ta%_&ta~Oz)ZO#g&ta%[&ta%_&ta~Oo0cOv0qO#g&pa%[&pa%_&pa{&pa~P'vOz)^O#g&pa%[&pa%_&pa{&pa~OV)`Oa)`O%uWO~O%z)eO~Ot)hO#j)gOP#hiV#hif#hih#hio#his#hiv#hi!P#hi!Q#hi!T#hi!U#hi!X#hi!]#hi!h#hi!r#hi!s#hi!t#hi!{#hi!}#hi#P#hi#R#hi#T#hi#X#hi#Z#hi#^#hi#_#hi#a#hi#c#hi#l#hi#o#hi#s#hi#u#hi#z#hi#}#hi$P#hi%X#hi%o#hi%p#hi%t#hi%u#hi&Z#hi&[#hi&]#hi&^#hi&_#hi&`#hi&a#hi&b#hi&c#hi&d#hi&e#hi&f#hi&g#hi&h#hi&i#hi&j#hi%Z#hi%_#hi~Ot)iOP#kiV#kif#kih#kio#kis#kiv#ki!P#ki!Q#ki!T#ki!U#ki!X#ki!]#ki!h#ki!r#ki!s#ki!t#ki!{#ki!}#ki#P#ki#R#ki#T#ki#X#ki#Z#ki#^#ki#_#ki#a#ki#c#ki#l#ki#o#ki#s#ki#u#ki#z#ki#}#ki$P#ki%X#ki%o#ki%p#ki%t#ki%u#ki&Z#ki&[#ki&]#ki&^#ki&_#ki&`#ki&a#ki&b#ki&c#ki&d#ki&e#ki&f#ki&g#ki&h#ki&i#ki&j#ki%Z#ki%_#ki~OV)kOn&wa~P'vOz)lOn&wa~Oz)lOn&wa~P%SOn)pO~O%Y)tO~Ot)wO#p'WO#q)vOP#niV#nif#nih#nio#nis#niv#ni!P#ni!Q#ni!T#ni!U#ni!X#ni!]#ni!h#ni!r#ni!s#ni!t#ni!{#ni!}#ni#P#ni#R#ni#T#ni#X#ni#Z#ni#^#ni#_#ni#a#ni#c#ni#l#ni#o#ni#s#ni#u#ni#z#ni#}#ni$P#ni%X#ni%o#ni%p#ni%t#ni%u#ni&Z#ni&[#ni&]#ni&^#ni&_#ni&`#ni&a#ni&b#ni&c#ni&d#ni&e#ni&f#ni&g#ni&h#ni&i#ni&j#ni%Z#ni%_#ni~OV)zOo0cOv0qO{$jO~P'vOo0cOv0qO{&xa~P'vOz*OO{&xa~OV*SOa*TOg*WO%q*UO%uWO~O{$jO&{*YO~Oh'_O~Oh!iO{$jO~O%[*_O~O%[*aO~OV$}Oa$}Oo0cOv0qOg&Ua~P'vOz*dOg&Ua~Oo0cOv0qO{*gO!W&Xa~P'vOz*hO!W&Xa~Oo0cOv0qOz*hO{*kO!W&Xa~P'vOo0cOv0qOz*hO!W&Xa~P'vOz*hO{*kO!W&Xa~Om0dOn0dOo0mOp0nOgjikjisjizji!Tji!Uji%{ji!Wji{ji![ji#gji%[ji%_ji!Qji#[jitji!mji%zji~Ol0fO~P!N_Olji~P!N_OV'|Og*pOo0cOv0qO~P'vOn*rO~Og*pOz*tO~Og*uO~OV'|Oo0cOv0qO!W&Si~P'vOz*vO!W&Si~O!W*wO~OV(]Oo0cOv0qO![%}i#g%}i%[%}i%_%}ig%}i{%}i!m%}i%z%}i~P'vOz*zO!T%dO!U%cO![&Ti~Oz*}O![%}i#g%}i%[%}i%_%}ig%}i{%}i!m%}i%z%}i~O![+OO~Oa+QOo0cOv0qO![&Ti~P'vOz*zO![&Ti~O![+SO~OV+UOo0cOv0qO{&la![&la!m&la%z&la~P'vOz+VO{&la![&la!m&la%z&la~O!]+YO&n+[O![!nX~O![+^O~O{(kO![+_O~O{(kO![+_O!m+`O~OV&OOopOvqO{%hq!x%hq#g%hq%[%hq%_%hq%z%hq~P'vOz$ri{$ri!x$ri#g$ri%[$ri%_$ri%z$ri~P%SOV&OOopOvqO~P'vOV&OOo0cOv0qO#g%ha%[%ha%_%ha%z%ha~P'vOz+aO#g%ha%[%ha%_%ha%z%ha~Oz$ia#g$ia%[$ia%_$ian$ia~P%SO#g&Pi%[&Pi%_&Pin&Pi~P'vOz+dO#g#Wq%[#Wq%_#Wq~O#[+eOz$va#g$va%[$va%_$vag$va~O%uWO#g&ri%[&ri%_&rig&ri~Oz+gO#g&ri%[&ri%_&rig&ri~OV+iOh$WO%uWO~O%uWO#g&ti%[&ti%_&ti~Oo0cOv0qO#g&pi%[&pi%_&pi{&pi~P'vO{#{Oz#eX!W#eX~Oz+mO!W&uX~O!W+oO~Ot+rO#j)gOP#hqV#hqf#hqh#hqo#hqs#hqv#hq!P#hq!Q#hq!T#hq!U#hq!X#hq!]#hq!h#hq!r#hq!s#hq!t#hq!{#hq!}#hq#P#hq#R#hq#T#hq#X#hq#Z#hq#^#hq#_#hq#a#hq#c#hq#l#hq#o#hq#s#hq#u#hq#z#hq#}#hq$P#hq%X#hq%o#hq%p#hq%t#hq%u#hq&Z#hq&[#hq&]#hq&^#hq&_#hq&`#hq&a#hq&b#hq&c#hq&d#hq&e#hq&f#hq&g#hq&h#hq&i#hq&j#hq%Z#hq%_#hq~On$|az$|a~P%SOV)kOn&wi~P'vOz+yOn&wi~Oz,TO{$jO#[,TO~O#q,VOP#nqV#nqf#nqh#nqo#nqs#nqv#nq!P#nq!Q#nq!T#nq!U#nq!X#nq!]#nq!h#nq!r#nq!s#nq!t#nq!{#nq!}#nq#P#nq#R#nq#T#nq#X#nq#Z#nq#^#nq#_#nq#a#nq#c#nq#l#nq#o#nq#s#nq#u#nq#z#nq#}#nq$P#nq%X#nq%o#nq%p#nq%t#nq%u#nq&Z#nq&[#nq&]#nq&^#nq&_#nq&`#nq&a#nq&b#nq&c#nq&d#nq&e#nq&f#nq&g#nq&h#nq&i#nq&j#nq%Z#nq%_#nq~O#[,WOz%Oa{%Oa~Oo0cOv0qO{&xi~P'vOz,YO{&xi~O{#{O%z,[Og&zXz&zX~O%uWOg&zXz&zX~Oz,`Og&yX~Og,bO~O%Y,eO~O!T%dO!U%cOg&Viz&Vi~OV$}Oa$}Oo0cOv0qOg&Ui~P'vO{,hOz$la!W$la~Oo0cOv0qO{,iOz$la!W$la~P'vOo0cOv0qO{*gO!W&Xi~P'vOz,lO!W&Xi~Oo0cOv0qOz,lO!W&Xi~P'vOz,lO{,oO!W&Xi~Og$hiz$hi!W$hi~P%SOV'|Oo0cOv0qO~P'vOn,qO~OV'|Og,rOo0cOv0qO~P'vOV'|Oo0cOv0qO!W&Sq~P'vOz$gi![$gi#g$gi%[$gi%_$gig$gi{$gi!m$gi%z$gi~P%SOV(]Oo0cOv0qO~P'vOa+QOo0cOv0qO![&Tq~P'vOz,sO![&Tq~O![,tO~OV(]Oo0cOv0qO![%}q#g%}q%[%}q%_%}qg%}q{%}q!m%}q%z%}q~P'vO{,uO~OV+UOo0cOv0qO{&li![&li!m&li%z&li~P'vOz,zO{&li![&li!m&li%z&li~O!]+YO&n+[O![!na~O{(kO![,}O~OV&OOo0cOv0qO#g%hi%[%hi%_%hi%z%hi~P'vOz-OO#g%hi%[%hi%_%hi%z%hi~O%uWO#g&rq%[&rq%_&rqg&rq~Oz-RO#g&rq%[&rq%_&rqg&rq~OV)`Oa)`O%uWO!W&ua~Oz-TO!W&ua~On$|iz$|i~P%SOV)kO~P'vOV)kOn&wq~P'vOt-XOP#myV#myf#myh#myo#mys#myv#my!P#my!Q#my!T#my!U#my!X#my!]#my!h#my!r#my!s#my!t#my!{#my!}#my#P#my#R#my#T#my#X#my#Z#my#^#my#_#my#a#my#c#my#l#my#o#my#s#my#u#my#z#my#}#my$P#my%X#my%o#my%p#my%t#my%u#my&Z#my&[#my&]#my&^#my&_#my&`#my&a#my&b#my&c#my&d#my&e#my&f#my&g#my&h#my&i#my&j#my%Z#my%_#my~O%Z-]O%_-]O~P`O#q-^OP#nyV#nyf#nyh#nyo#nys#nyv#ny!P#ny!Q#ny!T#ny!U#ny!X#ny!]#ny!h#ny!r#ny!s#ny!t#ny!{#ny!}#ny#P#ny#R#ny#T#ny#X#ny#Z#ny#^#ny#_#ny#a#ny#c#ny#l#ny#o#ny#s#ny#u#ny#z#ny#}#ny$P#ny%X#ny%o#ny%p#ny%t#ny%u#ny&Z#ny&[#ny&]#ny&^#ny&_#ny&`#ny&a#ny&b#ny&c#ny&d#ny&e#ny&f#ny&g#ny&h#ny&i#ny&j#ny%Z#ny%_#ny~Oz-aO{$jO#[-aO~Oo0cOv0qO{&xq~P'vOz-dO{&xq~O%z,[Og&zaz&za~OV*SOa*TO%q*UO%uWOg&ya~Oz-hOg&ya~O$S-lO~OV$}Oa$}Oo0cOv0qO~P'vOo0cOv0qO{-mOz$li!W$li~P'vOo0cOv0qOz$li!W$li~P'vO{-mOz$li!W$li~Oo0cOv0qO{*gO~P'vOo0cOv0qO{*gO!W&Xq~P'vOz-pO!W&Xq~Oo0cOv0qOz-pO!W&Xq~P'vOs-sO!T%dO!U%cOg&Oq!W&Oq![&Oqz&Oq~P!/aOa+QOo0cOv0qO![&Ty~P'vOz$ji![$ji~P%SOa+QOo0cOv0qO~P'vOV+UOo0cOv0qO~P'vOV+UOo0cOv0qO{&lq![&lq!m&lq%z&lq~P'vO{(kO![-xO!m-yO%z-wO~OV&OOo0cOv0qO#g%hq%[%hq%_%hq%z%hq~P'vO%uWO#g&ry%[&ry%_&ryg&ry~OV)`Oa)`O%uWO!W&ui~Ot-}OP#m!RV#m!Rf#m!Rh#m!Ro#m!Rs#m!Rv#m!R!P#m!R!Q#m!R!T#m!R!U#m!R!X#m!R!]#m!R!h#m!R!r#m!R!s#m!R!t#m!R!{#m!R!}#m!R#P#m!R#R#m!R#T#m!R#X#m!R#Z#m!R#^#m!R#_#m!R#a#m!R#c#m!R#l#m!R#o#m!R#s#m!R#u#m!R#z#m!R#}#m!R$P#m!R%X#m!R%o#m!R%p#m!R%t#m!R%u#m!R&Z#m!R&[#m!R&]#m!R&^#m!R&_#m!R&`#m!R&a#m!R&b#m!R&c#m!R&d#m!R&e#m!R&f#m!R&g#m!R&h#m!R&i#m!R&j#m!R%Z#m!R%_#m!R~Oo0cOv0qO{&xy~P'vOV*SOa*TO%q*UO%uWOg&yi~O$S-lO%Z.VO%_.VO~OV.aOh._O!X.^O!].`O!h.YO!s.[O!t.[O%p.XO%uWO&Z]O&[]O&]]O&^]O&_]O&`]O&a]O&b]O~Oo0cOv0qOz$lq!W$lq~P'vO{.fOz$lq!W$lq~Oo0cOv0qO{*gO!W&Xy~P'vOz.gO!W&Xy~Oo0cOv.kO~P'vOs-sO!T%dO!U%cOg&Oy!W&Oy![&Oyz&Oy~P!/aO{(kO![.nO~O{(kO![.nO!m.oO~OV*SOa*TO%q*UO%uWO~Oh.tO!f.rOz$TX#[$TX%j$TXg$TX~Os$TX{$TX!W$TX![$TX~P$,yO%o.vO%p.vOs$UXz$UX{$UX#[$UX%j$UX!W$UXg$UX![$UX~O!h.xO~Oz.|O#[/OO%j.yOs&|X{&|X!W&|Xg&|X~Oa/RO~P$)cOh.tOs&}Xz&}X{&}X#[&}X%j&}X!W&}Xg&}X![&}X~Os/VO{$jO~Oo0cOv0qOz$ly!W$ly~P'vOo0cOv0qO{*gO!W&X!R~P'vOz/ZO!W&X!R~Og&RXs&RX!T&RX!U&RX!W&RX![&RXz&RX~P!/aOs-sO!T%dO!U%cOg&Qa!W&Qa![&Qaz&Qa~O{(kO![/^O~O!f.rOh$[as$[az$[a{$[a#[$[a%j$[a!W$[ag$[a![$[a~O!h/eO~O%o.vO%p.vOs$Uaz$Ua{$Ua#[$Ua%j$Ua!W$Uag$Ua![$Ua~O%j.yOs$Yaz$Ya{$Ya#[$Ya!W$Yag$Ya![$Ya~Os&|a{&|a!W&|ag&|a~P$)VOz/jOs&|a{&|a!W&|ag&|a~O!W/mO~Og/mO~O{/oO~O![/pO~Oo0cOv0qO{*gO!W&X!Z~P'vO{/sO~O%z/tO~P$,yOz/uO#[/OO%j.yOg'PX~Oz/uOg'PX~Og/wO~O!h/xO~O#[/OOs%Saz%Sa{%Sa%j%Sa!W%Sag%Sa![%Sa~O#[/OO%j.yOs%Waz%Wa{%Wa!W%Wag%Wa~Os&|i{&|i!W&|ig&|i~P$)VOz/zO#[/OO%j.yO!['Oa~O{$da~P%SOg'Pa~P$)VOz0SOg'Pa~Oa0UO!['Oi~P$)cOz0WO!['Oi~Oz0WO#[/OO%j.yO!['Oi~O#[/OO%j.yOg$biz$bi~O%z0ZO~P$,yO#[/OO%j.yOg%Vaz%Va~Og'Pi~P$)VO{0^O~Oa0UO!['Oq~P$)cOz0`O!['Oq~O#[/OO%j.yOz%Ui![%Ui~Oa0UO~P$)cOa0UO!['Oy~P$)cO#[/OO%j.yOg$ciz$ci~O#[/OO%j.yOz%Uq![%Uq~Oz+aO#g%ha%[%ha%_%ha%z%ha~P%SOV&OOo0cOv0qO~P'vOn0hO~Oo0hO~P'vO{0iO~Ot0jO~P!/aO&]&Z&j&h&i&g&f&d&e&c&b&`&a&_&^&[%u~",goto:"!=l'QPPPPPP'RP'Z*s+]+v,b,}-kP.YP'Z.y.y'ZPPP'Z2cPPPPPP2c5VPP5VP7g7p=xPP={>m>pPP'Z'ZPP?PPP'Z'ZPP'Z'Z'Z'Z'Z?T?}'ZP@QP@WD_G{HPPHSH^Hb'ZPPPHeHn'RP'R'RP'RP'RP'RP'RP'R'R'RP'RPP'RPP'RP'RPHtIQIYPIaIgPIaPIaIaPPPIaPKuPLOLYL`KuPIaLiPIaPLpLvPLzM`M}NhLzLzNnN{LzLzLzLz! a! g! j! o! r! |!!S!!`!!r!!x!#S!#Y!#v!#|!$S!$^!$d!$j!$|!%W!%^!%d!%n!%t!%z!&Q!&W!&^!&h!&n!&x!'O!'X!'_!'n!'v!(Q!(XPPPPPPPPPPP!(_!(b!(h!(q!({!)WPPPPPPPPPPPP!-z!/`!3`!6pPP!6x!7X!7b!8Z!8Q!8d!8j!8m!8p!8s!8{!9lPPPPPPPPPPPPPPPPP!9o!9s!9yP!:_!:c!:o!:x!;U!;l!;o!;r!;x!<O!<U!<XP!<a!<j!=f!=i]eOn#g$j)t,P'}`OTYZ[adnoprtxy}!P!Q!R!U!X!c!d!e!f!g!h!i!k!o!p!q!s!t!z#O#S#T#[#d#g#x#y#{#}$Q$e$g$h$j$q$}%S%Z%^%`%c%g%l%n%w%|&O&Z&_&h&j&k&u&x&|'P'W'Z'l'm'p'r's'w'|(O(S(W(](^(d(g(p(r(z(})^)e)g)k)l)p)t)z*O*Y*d*g*h*k*q*r*t*v*y*z*}+Q+U+V+Y+a+c+d+k+x+y,P,X,Y,],g,h,i,k,l,o,q,s,u,w,y,z-O-d-f-m-p-s.f.g/V/Z/s0c0d0e0f0h0i0j0k0l0n0r}!cQ#c#p$R$d$p%e%j%p%q&`'O'g(q(|)j*o*x+w,v/q0g!P!dQ#c#p$R$d$p$u%e%j%p%q&`'O'g(q(|)j*o*x+w,v/q0g!R!eQ#c#p$R$d$p$u$v%e%j%p%q&`'O'g(q(|)j*o*x+w,v/q0g!T!fQ#c#p$R$d$p$u$v$w%e%j%p%q&`'O'g(q(|)j*o*x+w,v/q0g!V!gQ#c#p$R$d$p$u$v$w$x%e%j%p%q&`'O'g(q(|)j*o*x+w,v/q0g!X!hQ#c#p$R$d$p$u$v$w$x$y%e%j%p%q&`'O'g(q(|)j*o*x+w,v/q0g!]!hQ!n#c#p$R$d$p$u$v$w$x$y$z%e%j%p%q&`'O'g(q(|)j*o*x+w,v/q0g'}TOTYZ[adnoprtxy}!P!Q!R!U!X!c!d!e!f!g!h!i!k!o!p!q!s!t!z#O#S#T#[#d#g#x#y#{#}$Q$e$g$h$j$q$}%S%Z%^%`%c%g%l%n%w%|&O&Z&_&h&j&k&u&x&|'P'W'Z'l'm'p'r's'w'|(O(S(W(](^(d(g(p(r(z(})^)e)g)k)l)p)t)z*O*Y*d*g*h*k*q*r*t*v*y*z*}+Q+U+V+Y+a+c+d+k+x+y,P,X,Y,],g,h,i,k,l,o,q,s,u,w,y,z-O-d-f-m-p-s.f.g/V/Z/s0c0d0e0f0h0i0j0k0l0n0r&cVOYZ[dnprxy}!P!Q!U!i!k!o!p!q!s!t#[#d#g#y#{#}$Q$h$j$}%S%Z%^%`%g%l%n%w%|&Z&_&j&k&u&x'P'W'Z'l'm'p'r's'w(O(W(^(d(g(p(r(z)^)e)g)p)t)z*O*Y*d*g*h*k*q*r*t*v*y*z*}+U+V+Y+a+d+k,P,X,Y,],g,h,i,k,l,o,q,s,u,w,y,z-O-d-f-m-p-s.f.g/Z/s0c0d0e0f0h0i0j0k0n0r%mXOYZ[dnrxy}!P!Q!U!i!k#[#d#g#y#{#}$Q$h$j$}%S%^%`%g%l%n%w%|&Z&_&j&k&u&x'P'W'Z'l'm'p'r's'w(O(W(^(d(g(p(r(z)^)e)g)p)t)z*O*Y*d*g*h*k*q*t*v*y*z*}+U+V+Y+a+d+k,P,X,Y,],g,h,i,k,l,o,s,u,w,y,z-O-d-f-m-p.f.g/Z0i0j0kQ#vqQ/[.kR0o0q't`OTYZ[adnoprtxy}!P!Q!R!U!X!c!d!e!f!g!h!k!o!p!q!s!t!z#O#S#T#[#d#g#x#y#{#}$Q$e$g$h$j$q$}%S%Z%^%`%c%g%l%n%w%|&O&Z&_&h&j&k&u&x&|'P'W'Z'l'p'r's'w'|(O(S(W(](^(d(g(p(r(z(})^)e)g)k)l)p)t)z*O*Y*g*h*k*q*r*t*v*y*z*}+Q+U+V+Y+a+c+d+k+x+y,P,X,Y,],h,i,k,l,o,q,s,u,w,y,z-O-d-f-m-p-s.f.g/V/Z/s0c0d0e0f0h0i0j0k0l0n0rh#jhz{$W$Z&l&q)S)X+f+g-RW#rq&].k0qQ$]|Q$a!OQ$n!VQ$o!WW$|!i'm*d,gS&[#s#tQ'S$iQ(s&UQ)U&nU)Y&s)Z+jW)a&w+m-T-{Q*Q']W*R'_,`-h.TQ+l)`S,_*S*TQ-Q+eQ-_,TQ-c,WQ.R-al.W-l.^._.a.z.|/R/j/o/t/y0U0Z0^Q/S.`Q/a.tQ/l/OU0P/u0S0[X0V/z0W0_0`R&Z#r!_!wYZ!P!Q!k%S%`%g'p'r's(O(W)g*g*h*k*q*t*v,h,i,k,l,o-m-p.f.g/ZR%^!vQ!{YQ%x#[Q&d#}Q&g$QR,{+YT.j-s/s![!jQ!n#c#p$R$d$p$u$v$w$x$y$z%e%j%p%q&`'O'g(q(|)j*o*x+w,v/q0gQ&X#kQ'c$oR*^'dR'l$|Q%V!mR/_.r'|_OTYZ[adnoprtxy}!P!Q!R!U!X!c!d!e!f!g!h!i!k!o!p!q!s!t!z#O#S#T#[#d#g#x#y#{#}$Q$e$g$h$j$q$}%S%Z%^%`%c%g%l%n%w%|&O&Z&_&h&j&k&u&x&|'P'W'Z'l'm'p'r's'w'|(O(S(W(](^(d(g(p(r(z(})^)e)g)k)l)p)t)z*O*Y*d*g*h*k*q*r*t*v*y*z*}+Q+U+V+Y+a+c+d+k+x+y,P,X,Y,],g,h,i,k,l,o,q,s,u,w,y,z-O-d-f-m-p-s.f.g/V/Z/s0c0d0e0f0h0i0j0k0l0n0rS#a_#b!P.[-l.^._.`.a.t.z.|/R/j/o/t/u/y/z0S0U0W0Z0[0^0_0`'|_OTYZ[adnoprtxy}!P!Q!R!U!X!c!d!e!f!g!h!i!k!o!p!q!s!t!z#O#S#T#[#d#g#x#y#{#}$Q$e$g$h$j$q$}%S%Z%^%`%c%g%l%n%w%|&O&Z&_&h&j&k&u&x&|'P'W'Z'l'm'p'r's'w'|(O(S(W(](^(d(g(p(r(z(})^)e)g)k)l)p)t)z*O*Y*d*g*h*k*q*r*t*v*y*z*}+Q+U+V+Y+a+c+d+k+x+y,P,X,Y,],g,h,i,k,l,o,q,s,u,w,y,z-O-d-f-m-p-s.f.g/V/Z/s0c0d0e0f0h0i0j0k0l0n0rT#a_#bT#^^#_R(o%xa(l%x(n(o+`,{-y-z.oT+[(k+]R-z,{Q$PsQ+l)aR,^*RX#}s$O$P&fQ&y$aQ'a$nQ'd$oR)s'SQ)b&wV-S+m-T-{ZgOn$j)t,PXkOn)t,PQ$k!TQ&z$bQ&{$cQ'^$mQ'b$oQ)q'RQ)x'WQ){'XQ)|'YQ*Z'`S*]'c'dQ+s)gQ+u)hQ+v)iQ+z)oS+|)r*[Q,Q)vQ,R)wS,S)y)zQ,d*^Q-V+rQ-W+tQ-Y+{S-Z+},OQ-`,UQ-b,VQ-|-XQ.O-[Q.P-^Q.Q-_Q.p-}Q.q.RQ/W.dR/r/XWkOn)t,PR#mjQ'`$nS)r'S'aR,O)sQ,]*RR-f,^Q*['`Q+})rR-[,OZiOjn)t,PQ'f$pR*`'gT-j,e-ku.c-l.^._.a.t.z.|/R/j/o/t/u/y0S0U0Z0[0^t.c-l.^._.a.t.z.|/R/j/o/t/u/y0S0U0Z0[0^Q/S.`X0V/z0W0_0`!P.Z-l.^._.`.a.t.z.|/R/j/o/t/u/y/z0S0U0W0Z0[0^0_0`Q.w.YR/f.xg.z.].{/b/i/n/|0O0Q0]0a0bu.b-l.^._.a.t.z.|/R/j/o/t/u/y0S0U0Z0[0^X.u.W.b/a0PR/c.tV0R/u0S0[R/X.dQnOS#on,PR,P)tQ&^#uR(x&^S%m#R#wS(_%m(bT(b%p&`Q%a!yQ%h!}W(P%a%h(U(YQ(U%eR(Y%jQ&i$RR)O&iQ(e%qQ*{(`T+R(e*{Q'n%OR*e'nS'q%R%SY*i'q*j,m-q.hU*j'r's'tU,m*k*l*mS-q,n,oR.h-rQ#Y]R%t#YQ#_^R%y#_Q(h%vS+W(h+XR+X(iQ+](kR,|+]Q#b_R%{#bQ#ebQ%}#cW&Q#e%}({+bQ({&cR+b0gQ$OsS&e$O&fR&f$PQ&v$_R)_&vQ&V#jR(t&VQ&m$VS)T&m+hR+h)UQ$Z{R&p$ZQ&t$]R)[&tQ+n)bR-U+nQ#hfR&S#hQ)f&zR+q)fQ&}$dS)m&})nR)n'OQ'V$kR)u'VQ'[$lS*P'[,ZR,Z*QQ,a*VR-i,aWjOn)t,PR#ljQ-k,eR.U-kd.{.]/b/i/n/|0O0Q0]0a0bR/h.{U.s.W/a0PR/`.sQ/{/nS0X/{0YR0Y/|S/v/b/cR0T/vQ.}.]R/k.}R!ZPXmOn)t,PWlOn)t,PR'T$jYfOn$j)t,PR&R#g[sOn#g$j)t,PR&d#}&bQOYZ[dnprxy}!P!Q!U!i!k!o!p!q!s!t#[#d#g#y#{#}$Q$h$j$}%S%Z%^%`%g%l%n%w%|&Z&_&j&k&u&x'P'W'Z'l'm'p'r's'w(O(W(^(d(g(p(r(z)^)e)g)p)t)z*O*Y*d*g*h*k*q*r*t*v*y*z*}+U+V+Y+a+d+k,P,X,Y,],g,h,i,k,l,o,q,s,u,w,y,z-O-d-f-m-p-s.f.g/Z/s0c0d0e0f0h0i0j0k0n0rQ!nTQ#caQ#poU$Rt%c(SS$d!R$gQ$p!XQ$u!cQ$v!dQ$w!eQ$x!fQ$y!gQ$z!hQ%e!zQ%j#OQ%p#SQ%q#TQ&`#xQ'O$eQ'g$qQ(q&OU(|&h(}+cW)j&|)l+x+yQ*o'|Q*x(]Q+w)kQ,v+QQ/q/VR0g0lQ!yYQ!}ZQ$b!PQ$c!QQ%R!kQ't%S^'{%`%g(O(W*q*t*v^*f'p*h,k,l-p.g/ZQ*l'rQ*m'sQ+t)gQ,j*gQ,n*kQ-n,hQ-o,iQ-r,oQ.e-mR/Y.f[bOn#g$j)t,P!^!vYZ!P!Q!k%S%`%g'p'r's(O(W)g*g*h*k*q*t*v,h,i,k,l,o-m-p.f.g/ZQ#R[Q#fdS#wrxQ$UyW$_}$Q'P)pS$l!U$hW${!i'm*d,gS%v#[+Y`&P#d%|(p(r(z+a-O0kQ&a#yQ&b#{Q&c#}Q'j$}Q'z%^W([%l(^*y*}Q(`%nQ(i%wQ(v&ZS(y&_0iQ)P&jQ)Q&kU)]&u)^+kQ)d&xQ)y'WY)}'Z*O,X,Y-dQ*b'lS*n'w0jW+P(d*z,s,wW+T(g+V,y,zQ+p)eQ,U)zQ,c*YQ,x+UQ-P+dQ-e,]Q-v,uR.S-fhUOn#d#g$j%|&_'w(p(r)t,P%S!uYZ[drxy}!P!Q!U!i!k#[#y#{#}$Q$h$}%S%^%`%g%l%n%w&Z&j&k&u&x'P'W'Z'l'm'p'r's(O(W(^(d(g(z)^)e)g)p)z*O*Y*d*g*h*k*q*t*v*y*z*}+U+V+Y+a+d+k,X,Y,],g,h,i,k,l,o,s,u,w,y,z-O-d-f-m-p.f.g/Z0i0j0kQ#qpW%W!o!s0d0nQ%X!pQ%Y!qQ%[!tQ%f0cS'v%Z0hQ'x0eQ'y0fQ,p*rQ-u,qS.i-s/sR0p0rU#uq.k0qR(w&][cOn#g$j)t,PZ!xY#[#}$Q+YQ#W[Q#zrR$TxQ%b!yQ%i!}Q%o#RQ'j${Q(V%eQ(Z%jQ(c%pQ(f%qQ*|(`Q,f*bQ-t,pQ.m-uR/].lQ$StQ(R%cR*s(SQ.l-sR/}/sR#QZR#V[R%Q!iQ%O!iV*c'm*d,g!]!lQ!n#c#p$R$d$p$u$v$w$x$y$z%e%j%p%q&`'O'g(q(|)j*o*x+w,v/q0gR%T!kT#]^#_Q%x#[R,{+YQ(m%xS+_(n(oQ,}+`Q-x,{S.n-y-zR/^.oT+Z(k+]Q$`}Q&g$QQ)o'PR+{)pQ$XzQ)W&qR+i)XQ$XzQ&o$WQ)W&qR+i)XQ#khW$Vz$W&q)XQ$[{Q&r$ZZ)R&l)S+f+g-RR$^|R)c&wXlOn)t,PQ$f!RR'Q$gQ$m!UR'R$hR*X'_Q*V'_V-g,`-h.TQ.d-lQ/P.^R/Q._U.]-l.^._Q/U.aQ/b.tQ/g.zU/i.|/j/yQ/n/RQ/|/oQ0O/tU0Q/u0S0[Q0]0UQ0a0ZR0b0^R/T.`R/d.t",nodeNames:"⚠ print Escape { Comment Script AssignStatement * BinaryExpression BitOp BitOp BitOp BitOp ArithOp ArithOp @ ArithOp ** UnaryExpression ArithOp BitOp AwaitExpression await ) ( ParenthesizedExpression BinaryExpression or and CompareOp in not is UnaryExpression ConditionalExpression if else LambdaExpression lambda ParamList VariableName AssignOp , : NamedExpression AssignOp YieldExpression yield from TupleExpression ComprehensionExpression async for LambdaExpression ] [ ArrayExpression ArrayComprehensionExpression } { DictionaryExpression DictionaryComprehensionExpression SetExpression SetComprehensionExpression CallExpression ArgList AssignOp MemberExpression . PropertyName Number String FormatString FormatReplacement FormatSelfDoc FormatConversion FormatSpec FormatReplacement FormatSelfDoc ContinuedString Ellipsis None Boolean TypeDef AssignOp UpdateStatement UpdateOp ExpressionStatement DeleteStatement del PassStatement pass BreakStatement break ContinueStatement continue ReturnStatement return YieldStatement PrintStatement RaiseStatement raise ImportStatement import as ScopeStatement global nonlocal AssertStatement assert TypeDefinition type TypeParamList TypeParam StatementGroup ; IfStatement Body elif WhileStatement while ForStatement TryStatement try except finally WithStatement with FunctionDefinition def ParamList AssignOp TypeDef ClassDefinition class DecoratedStatement Decorator At MatchStatement match MatchBody MatchClause case CapturePattern LiteralPattern ArithOp ArithOp AsPattern OrPattern LogicOp AttributePattern SequencePattern MappingPattern StarPattern ClassPattern PatternArgList KeywordPattern KeywordPattern Guard",maxTerm:277,context:tdt,nodeProps:[["isolate",-5,4,71,72,73,77,""],["group",-15,6,85,87,88,90,92,94,96,98,99,100,102,105,108,110,"Statement Statement",-22,8,18,21,25,40,49,50,56,57,60,61,62,63,64,67,70,71,72,79,80,81,82,"Expression",-10,114,116,119,121,122,126,128,133,135,138,"Statement",-9,143,144,147,148,150,151,152,153,154,"Pattern"],["openedBy",23,"(",54,"[",58,"{"],["closedBy",24,")",55,"]",59,"}"]],propSources:[odt],skippedNodes:[0,4],repeatNodeCount:34,tokenData:"!2|~R!`OX%TXY%oY[%T[]%o]p%Tpq%oqr'ars)Yst*xtu%Tuv,dvw-hwx.Uxy/tyz0[z{0r{|2S|}2p}!O3W!O!P4_!P!Q:Z!Q!R;k!R![>_![!]Do!]!^Es!^!_FZ!_!`Gk!`!aHX!a!b%T!b!cIf!c!dJU!d!eK^!e!hJU!h!i!#f!i!tJU!t!u!,|!u!wJU!w!x!.t!x!}JU!}#O!0S#O#P&o#P#Q!0j#Q#R!1Q#R#SJU#S#T%T#T#UJU#U#VK^#V#YJU#Y#Z!#f#Z#fJU#f#g!,|#g#iJU#i#j!.t#j#oJU#o#p!1n#p#q!1s#q#r!2a#r#s!2f#s$g%T$g;'SJU;'S;=`KW<%lOJU`%YT&n`O#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%T`%lP;=`<%l%To%v]&n`%c_OX%TXY%oY[%T[]%o]p%Tpq%oq#O%T#O#P&o#P#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%To&tX&n`OY%TYZ%oZ]%T]^%o^#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%Tc'f[&n`O!_%T!_!`([!`#T%T#T#U(r#U#f%T#f#g(r#g#h(r#h#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%Tc(cTmR&n`O#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%Tc(yT!mR&n`O#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%Tk)aV&n`&[ZOr%Trs)vs#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%Tk){V&n`Or%Trs*bs#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%Tk*iT&n`&^ZO#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%To+PZS_&n`OY*xYZ%TZ]*x]^%T^#o*x#o#p+r#p#q*x#q#r+r#r;'S*x;'S;=`,^<%lO*x_+wTS_OY+rZ]+r^;'S+r;'S;=`,W<%lO+r_,ZP;=`<%l+ro,aP;=`<%l*xj,kV%rQ&n`O!_%T!_!`-Q!`#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%Tj-XT!xY&n`O#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%Tj-oV%lQ&n`O!_%T!_!`-Q!`#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%Tk.]V&n`&ZZOw%Twx.rx#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%Tk.wV&n`Ow%Twx/^x#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%Tk/eT&n`&]ZO#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%Tk/{ThZ&n`O#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%Tc0cTgR&n`O#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%Tk0yXVZ&n`Oz%Tz{1f{!_%T!_!`-Q!`#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%Tk1mVaR&n`O!_%T!_!`-Q!`#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%Tk2ZV%oZ&n`O!_%T!_!`-Q!`#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%Tc2wTzR&n`O#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%To3_W%pZ&n`O!_%T!_!`-Q!`!a3w!a#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%Td4OT&{S&n`O#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%Tk4fX!fQ&n`O!O%T!O!P5R!P!Q%T!Q![6T![#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%Tk5WV&n`O!O%T!O!P5m!P#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%Tk5tT!rZ&n`O#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%Ti6[a!hX&n`O!Q%T!Q![6T![!g%T!g!h7a!h!l%T!l!m9s!m#R%T#R#S6T#S#X%T#X#Y7a#Y#^%T#^#_9s#_#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%Ti7fZ&n`O{%T{|8X|}%T}!O8X!O!Q%T!Q![8s![#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%Ti8^V&n`O!Q%T!Q![8s![#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%Ti8z]!hX&n`O!Q%T!Q![8s![!l%T!l!m9s!m#R%T#R#S8s#S#^%T#^#_9s#_#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%Ti9zT!hX&n`O#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%Tk:bX%qR&n`O!P%T!P!Q:}!Q!_%T!_!`-Q!`#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%Tj;UV%sQ&n`O!_%T!_!`-Q!`#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%Ti;ro!hX&n`O!O%T!O!P=s!P!Q%T!Q![>_![!d%T!d!e?q!e!g%T!g!h7a!h!l%T!l!m9s!m!q%T!q!rA]!r!z%T!z!{Bq!{#R%T#R#S>_#S#U%T#U#V?q#V#X%T#X#Y7a#Y#^%T#^#_9s#_#c%T#c#dA]#d#l%T#l#mBq#m#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%Ti=xV&n`O!Q%T!Q![6T![#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%Ti>fc!hX&n`O!O%T!O!P=s!P!Q%T!Q![>_![!g%T!g!h7a!h!l%T!l!m9s!m#R%T#R#S>_#S#X%T#X#Y7a#Y#^%T#^#_9s#_#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%Ti?vY&n`O!Q%T!Q!R@f!R!S@f!S#R%T#R#S@f#S#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%Ti@mY!hX&n`O!Q%T!Q!R@f!R!S@f!S#R%T#R#S@f#S#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%TiAbX&n`O!Q%T!Q!YA}!Y#R%T#R#SA}#S#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%TiBUX!hX&n`O!Q%T!Q!YA}!Y#R%T#R#SA}#S#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%TiBv]&n`O!Q%T!Q![Co![!c%T!c!iCo!i#R%T#R#SCo#S#T%T#T#ZCo#Z#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%TiCv]!hX&n`O!Q%T!Q![Co![!c%T!c!iCo!i#R%T#R#SCo#S#T%T#T#ZCo#Z#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%ToDvV{_&n`O!_%T!_!`E]!`#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%TcEdT%{R&n`O#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%TkEzT#gZ&n`O#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%TkFbXmR&n`O!^%T!^!_F}!_!`([!`!a([!a#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%TjGUV%mQ&n`O!_%T!_!`-Q!`#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%TkGrV%zZ&n`O!_%T!_!`([!`#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%TkH`WmR&n`O!_%T!_!`([!`!aHx!a#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%TjIPV%nQ&n`O!_%T!_!`-Q!`#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%TkIoV_Q#}P&n`O!_%T!_!`-Q!`#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%ToJ_]&n`&YS%uZO!Q%T!Q![JU![!c%T!c!}JU!}#R%T#R#SJU#S#T%T#T#oJU#p#q%T#r$g%T$g;'SJU;'S;=`KW<%lOJUoKZP;=`<%lJUoKge&n`&YS%uZOr%Trs)Ysw%Twx.Ux!Q%T!Q![JU![!c%T!c!tJU!t!uLx!u!}JU!}#R%T#R#SJU#S#T%T#T#fJU#f#gLx#g#oJU#p#q%T#r$g%T$g;'SJU;'S;=`KW<%lOJUoMRa&n`&YS%uZOr%TrsNWsw%Twx! vx!Q%T!Q![JU![!c%T!c!}JU!}#R%T#R#SJU#S#T%T#T#oJU#p#q%T#r$g%T$g;'SJU;'S;=`KW<%lOJUkN_V&n`&`ZOr%TrsNts#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%TkNyV&n`Or%Trs! `s#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%Tk! gT&n`&bZO#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%Tk! }V&n`&_ZOw%Twx!!dx#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%Tk!!iV&n`Ow%Twx!#Ox#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%Tk!#VT&n`&aZO#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%To!#oe&n`&YS%uZOr%Trs!%Qsw%Twx!&px!Q%T!Q![JU![!c%T!c!tJU!t!u!(`!u!}JU!}#R%T#R#SJU#S#T%T#T#fJU#f#g!(`#g#oJU#p#q%T#r$g%T$g;'SJU;'S;=`KW<%lOJUk!%XV&n`&dZOr%Trs!%ns#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%Tk!%sV&n`Or%Trs!&Ys#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%Tk!&aT&n`&fZO#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%Tk!&wV&n`&cZOw%Twx!'^x#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%Tk!'cV&n`Ow%Twx!'xx#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%Tk!(PT&n`&eZO#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%To!(ia&n`&YS%uZOr%Trs!)nsw%Twx!+^x!Q%T!Q![JU![!c%T!c!}JU!}#R%T#R#SJU#S#T%T#T#oJU#p#q%T#r$g%T$g;'SJU;'S;=`KW<%lOJUk!)uV&n`&hZOr%Trs!*[s#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%Tk!*aV&n`Or%Trs!*vs#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%Tk!*}T&n`&jZO#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%Tk!+eV&n`&gZOw%Twx!+zx#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%Tk!,PV&n`Ow%Twx!,fx#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%Tk!,mT&n`&iZO#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%To!-Vi&n`&YS%uZOr%TrsNWsw%Twx! vx!Q%T!Q![JU![!c%T!c!dJU!d!eLx!e!hJU!h!i!(`!i!}JU!}#R%T#R#SJU#S#T%T#T#UJU#U#VLx#V#YJU#Y#Z!(`#Z#oJU#p#q%T#r$g%T$g;'SJU;'S;=`KW<%lOJUo!.}a&n`&YS%uZOr%Trs)Ysw%Twx.Ux!Q%T!Q![JU![!c%T!c!}JU!}#R%T#R#SJU#S#T%T#T#oJU#p#q%T#r$g%T$g;'SJU;'S;=`KW<%lOJUk!0ZT!XZ&n`O#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%Tc!0qT!WR&n`O#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%Tj!1XV%kQ&n`O!_%T!_!`-Q!`#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%T~!1sO!]~k!1zV%jR&n`O!_%T!_!`-Q!`#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%T~!2fO![~i!2mT%tX&n`O#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%T",tokenizers:[ndt,Zft,Kft,rdt,0,1,2,3,4],topRules:{Script:[0,5]},specialized:[{term:221,get:t=>adt[t]||-1}],tokenPrec:7652}),rX=new Tat,Ape=new Set(["Script","Body","FunctionDefinition","ClassDefinition","LambdaExpression","ForStatement","MatchClause"]);function pO(t){return(e,n,r)=>{if(r)return!1;let i=e.node.getChild("VariableName");return i&&n(i,t),!0}}const ldt={FunctionDefinition:pO("function"),ClassDefinition:pO("class"),ForStatement(t,e,n){if(n){for(let r=t.node.firstChild;r;r=r.nextSibling)if(r.name=="VariableName")e(r,"variable");else if(r.name=="in")break}},ImportStatement(t,e){var n,r;let{node:i}=t,o=((n=i.firstChild)===null||n===void 0?void 0:n.name)=="from";for(let a=i.getChild("import");a;a=a.nextSibling)a.name=="VariableName"&&((r=a.nextSibling)===null||r===void 0?void 0:r.name)!="as"&&e(a,o?"variable":"namespace")},AssignStatement(t,e){for(let n=t.node.firstChild;n;n=n.nextSibling)if(n.name=="VariableName")e(n,"variable");else if(n.name==":"||n.name=="AssignOp")break},ParamList(t,e){for(let n=null,r=t.node.firstChild;r;r=r.nextSibling)r.name=="VariableName"&&(!n||!/\*|AssignOp/.test(n.name))&&e(r,"variable"),n=r},CapturePattern:pO("variable"),AsPattern:pO("variable"),__proto__:null};function Rpe(t,e){let n=rX.get(e);if(n)return n;let r=[],i=!0;function o(a,s){let l=t.sliceString(a.from,a.to);r.push({label:l,type:s})}return e.cursor(Jr.IncludeAnonymous).iterate(a=>{if(a.name){let s=ldt[a.name];if(s&&s(a,o,i)||!i&&Ape.has(a.name))return!1;i=!1}else if(a.to-a.from>8192){for(let s of Rpe(t,a.node))r.push(s);return!1}}),rX.set(e,r),r}const iX=/^[\w\xa1-\uffff][\w\d\xa1-\uffff]*$/,Ipe=["String","FormatString","Comment","PropertyName"];function cdt(t){let e=fi(t.state).resolveInner(t.pos,-1);if(Ipe.indexOf(e.name)>-1)return null;let n=e.name=="VariableName"||e.to-e.from<20&&iX.test(t.state.sliceDoc(e.from,e.to));if(!n&&!t.explicit)return null;let r=[];for(let i=e;i;i=i.parent)Ape.has(i.name)&&(r=r.concat(Rpe(t.state.doc,i)));return{options:r,from:n?e.from:t.pos,validFor:iX}}const udt=["__annotations__","__builtins__","__debug__","__doc__","__import__","__name__","__loader__","__package__","__spec__","False","None","True"].map(t=>({label:t,type:"constant"})).concat(["ArithmeticError","AssertionError","AttributeError","BaseException","BlockingIOError","BrokenPipeError","BufferError","BytesWarning","ChildProcessError","ConnectionAbortedError","ConnectionError","ConnectionRefusedError","ConnectionResetError","DeprecationWarning","EOFError","Ellipsis","EncodingWarning","EnvironmentError","Exception","FileExistsError","FileNotFoundError","FloatingPointError","FutureWarning","GeneratorExit","IOError","ImportError","ImportWarning","IndentationError","IndexError","InterruptedError","IsADirectoryError","KeyError","KeyboardInterrupt","LookupError","MemoryError","ModuleNotFoundError","NameError","NotADirectoryError","NotImplemented","NotImplementedError","OSError","OverflowError","PendingDeprecationWarning","PermissionError","ProcessLookupError","RecursionError","ReferenceError","ResourceWarning","RuntimeError","RuntimeWarning","StopAsyncIteration","StopIteration","SyntaxError","SyntaxWarning","SystemError","SystemExit","TabError","TimeoutError","TypeError","UnboundLocalError","UnicodeDecodeError","UnicodeEncodeError","UnicodeError","UnicodeTranslateError","UnicodeWarning","UserWarning","ValueError","Warning","ZeroDivisionError"].map(t=>({label:t,type:"type"}))).concat(["bool","bytearray","bytes","classmethod","complex","float","frozenset","int","list","map","memoryview","object","range","set","staticmethod","str","super","tuple","type"].map(t=>({label:t,type:"class"}))).concat(["abs","aiter","all","anext","any","ascii","bin","breakpoint","callable","chr","compile","delattr","dict","dir","divmod","enumerate","eval","exec","exit","filter","format","getattr","globals","hasattr","hash","help","hex","id","input","isinstance","issubclass","iter","len","license","locals","max","min","next","oct","open","ord","pow","print","property","quit","repr","reversed","round","setattr","slice","sorted","sum","vars","zip"].map(t=>({label:t,type:"function"}))),fdt=[yc("def ${name}(${params}):\n	${}",{label:"def",detail:"function",type:"keyword"}),yc("for ${name} in ${collection}:\n	${}",{label:"for",detail:"loop",type:"keyword"}),yc("while ${}:\n	${}",{label:"while",detail:"loop",type:"keyword"}),yc("try:\n	${}\nexcept ${error}:\n	${}",{label:"try",detail:"/ except block",type:"keyword"}),yc(`if \${}:
	
`,{label:"if",detail:"block",type:"keyword"}),yc("if ${}:\n	${}\nelse:\n	${}",{label:"if",detail:"/ else block",type:"keyword"}),yc("class ${name}:\n	def __init__(self, ${params}):\n			${}",{label:"class",detail:"definition",type:"keyword"}),yc("import ${module}",{label:"import",detail:"statement",type:"keyword"}),yc("from ${module} import ${names}",{label:"from",detail:"import",type:"keyword"})],ddt=dct(Ipe,ape(udt.concat(fdt)));function oX(t,e){let n=t.baseIndentFor(e),r=t.lineAt(t.pos,-1),i=r.from+r.text.length;return/^\s*($|#)/.test(r.text)&&t.node.to<i+100&&!/\S/.test(t.state.sliceDoc(i,t.node.to))&&t.lineIndent(t.pos,-1)<=n||/^\s*(else:|elif |except |finally:)/.test(t.textAfter)&&t.lineIndent(t.pos,-1)>n?null:n+t.unit}const uI=u_.define({name:"python",parser:sdt.configure({props:[F4.add({Body:t=>{var e;return(e=oX(t,t.node))!==null&&e!==void 0?e:t.continue()},IfStatement:t=>/^\s*(else:|elif )/.test(t.textAfter)?t.baseIndent:t.continue(),TryStatement:t=>/^\s*(except |finally:|else:)/.test(t.textAfter)?t.baseIndent:t.continue(),"TupleExpression ComprehensionExpression ParamList ArgList ParenthesizedExpression":YR({closing:")"}),"DictionaryExpression DictionaryComprehensionExpression SetExpression SetComprehensionExpression":YR({closing:"}"}),"ArrayExpression ArrayComprehensionExpression":YR({closing:"]"}),"String FormatString":()=>null,Script:t=>{if(t.pos+/\s*/.exec(t.textAfter)[0].length>=t.node.to){let e=null;for(let n=t.node,r=n.to;n=n.lastChild,!(!n||n.to!=r);)n.type.name=="Body"&&(e=n);if(e){let n=oX(t,e);if(n!=null)return n}}return t.continue()}}),B4.add({"ArrayExpression DictionaryExpression SetExpression TupleExpression":ihe,Body:(t,e)=>({from:t.from+1,to:t.to-(t.to==e.doc.length?0:1)})})]}),languageData:{closeBrackets:{brackets:["(","[","{","'",'"',"'''",'"""'],stringPrefixes:["f","fr","rf","r","u","b","br","rb","F","FR","RF","R","U","B","BR","RB"]},commentTokens:{line:"#"},indentOnInput:/^\s*([\}\]\)]|else:|elif |except |finally:)$/}});function hdt(){return new the(uI,[uI.data.of({autocomplete:cdt}),uI.data.of({autocomplete:ddt})])}const pdt=""+new URL("python-bw-BV0FRHt1.png",import.meta.url).href,gv={card:t=>({maxWidth:"100%",marginBottom:t.spacing(1),marginRight:t.spacing(1)}),info:t=>({marginRight:t.spacing(1)}),close:{marginLeft:"auto"},table:{},keyValueTableContainer:t=>({background:t.palette.divider}),variableHtmlReprContainer:t=>({background:t.palette.divider,padding:t.spacing(1),marginTop:t.spacing(1),marginBottom:t.spacing(1)}),media:{height:200},cardContent:{padding:"8px"},code:{fontFamily:"Monospace"}},mdt=({visibleInfoCardElements:t,setVisibleInfoCardElements:e,infoCardElementViewModes:n,updateInfoCardElementViewMode:r,selectedDataset:i,selectedVariable:o,selectedPlaceInfo:a,selectedTime:s,serverConfig:l,allowViewModePython:c})=>{const u=(p,m)=>{e(m)};let f,d,h;if(i){const p="dataset",m=n[p],g=y=>r(p,y),v=t.includes(p);f=w.jsx(gdt,{isIn:v,viewMode:m,setViewMode:g,dataset:i,serverConfig:l,hasPython:c})}if(i&&o){const p="variable",m=n[p],g=y=>r(p,y),v=t.includes(p);d=w.jsx(vdt,{isIn:v,viewMode:m,setViewMode:g,variable:o,time:s,serverConfig:l,hasPython:c})}if(a){const p="place",m=n[p],g=y=>r(p,y),v=t.includes(p);h=w.jsx(ydt,{isIn:v,viewMode:m,setViewMode:g,placeInfo:a})}return w.jsxs(Ure,{sx:gv.card,children:[w.jsx(Wre,{disableSpacing:!0,children:w.jsxs(iy,{size:"small",value:t,onChange:u,children:[w.jsx(Pn,{value:"dataset",disabled:i===null,size:"small",sx:ko.toggleButton,children:w.jsx(_t,{arrow:!0,title:fe.get("Dataset information"),children:w.jsx(xfe,{})})},0),w.jsx(Pn,{value:"variable",disabled:o===null,size:"small",sx:ko.toggleButton,children:w.jsx(_t,{arrow:!0,title:fe.get("Variable information"),children:w.jsx(l4,{})})},1),w.jsx(Pn,{value:"place",disabled:a===null,size:"small",sx:ko.toggleButton,children:w.jsx(_t,{arrow:!0,title:fe.get("Place information"),children:w.jsx(vfe,{})})},2)]},0)}),f,d,h]})},gdt=({isIn:t,viewMode:e,setViewMode:n,dataset:r,serverConfig:i,hasPython:o})=>{let a;if(e==="code"){const s=r.dimensions.map(c=>e$(c,["name","size","dtype"])),l=e$(r,["id","title","bbox","attrs"]);l.dimensions=s,a=w.jsx(iU,{code:JSON.stringify(l,null,2)})}else if(e==="list")a=w.jsx(tu,{children:w.jsx(b_,{data:Object.getOwnPropertyNames(r.attrs||{}).map(s=>[s,r.attrs[s]])})});else if(e==="text"){const s=[[fe.get("Dimension names"),r.dimensions.map(l=>l.name).join(", ")],[fe.get("Dimension data types"),r.dimensions.map(l=>l.dtype).join(", ")],[fe.get("Dimension lengths"),r.dimensions.map(l=>l.size).join(", ")],[fe.get("Geographical extent")+" (x1, y1, x2, y2)",r.bbox.map(l=>l+"").join(", ")],[fe.get("Spatial reference system"),r.spatialRef]];a=w.jsx(tu,{children:w.jsx(b_,{data:s})})}else e==="python"&&(a=w.jsx(Lpe,{code:xdt(i,r)}));return w.jsx(rU,{title:r.title||"?",subheader:r.title&&`ID: ${r.id}`,isIn:t,viewMode:e,setViewMode:n,hasPython:o,children:a})},vdt=({isIn:t,viewMode:e,setViewMode:n,variable:r,time:i,serverConfig:o,hasPython:a})=>{let s,l;if(e==="code"){const c=e$(r,["id","name","title","units","expression","shape","dtype","shape","timeChunkSize","colorBarMin","colorBarMax","colorBarName","attrs"]);s=w.jsx(iU,{code:JSON.stringify(c,null,2)})}else if(e==="list"){if(s=w.jsx(tu,{children:w.jsx(b_,{data:Object.getOwnPropertyNames(r.attrs||{}).map(c=>[c,r.attrs[c]])})}),r.htmlRepr){const c=u=>{u&&r.htmlRepr&&(u.innerHTML=r.htmlRepr)};l=w.jsx(tu,{children:w.jsx(Ho,{ref:c,sx:gv.variableHtmlReprContainer})})}}else if(e==="text"){let c=[[fe.get("Name"),r.name],[fe.get("Title"),r.title],[fe.get("Units"),r.units]];V1(r)?c.push([fe.get("Expression"),r.expression]):c=[...c,[fe.get("Data type"),r.dtype],[fe.get("Dimension names"),r.dims.join(", ")],[fe.get("Dimension lengths"),r.shape.map(u=>u+"").join(", ")],[fe.get("Time chunk size"),r.timeChunkSize]],s=w.jsx(tu,{children:w.jsx(b_,{data:c})})}else e==="python"&&(s=w.jsx(Lpe,{code:bdt(o,r,i)}));return w.jsxs(rU,{title:r.title||r.name,subheader:`${fe.get("Name")}: ${r.name}`,isIn:t,viewMode:e,setViewMode:n,hasPython:a,children:[l,s]})},ydt=({isIn:t,viewMode:e,setViewMode:n,placeInfo:r})=>{const i=r.place;let o,a,s;if(e==="code")o=w.jsx(iU,{code:JSON.stringify(i,null,2)});else if(e==="list")if(i.properties){const l=Object.getOwnPropertyNames(i.properties).map(c=>[c,i.properties[c]]);o=w.jsx(tu,{children:w.jsx(b_,{data:l})})}else o=w.jsx(tu,{children:w.jsx(At,{children:fe.get("There is no information available for this location.")})});else r.image&&r.image.startsWith("http")&&(a=w.jsx(RMe,{sx:gv.media,image:r.image,title:r.label})),r.description&&(s=w.jsx(tu,{children:w.jsx(At,{children:r.description})}));return w.jsxs(rU,{title:r.label,subheader:`${fe.get("Geometry type")}: ${fe.get(i.geometry.type)}`,isIn:t,viewMode:e,setViewMode:n,children:[a,s,o]})},rU=({isIn:t,title:e,subheader:n,viewMode:r,setViewMode:i,hasPython:o,children:a})=>{const s=(l,c)=>{i(c)};return w.jsxs(d5,{in:t,timeout:"auto",unmountOnExit:!0,children:[w.jsx(CMe,{title:e,subheader:n,titleTypographyProps:{fontSize:"1.1em"},action:w.jsxs(iy,{size:"small",value:r,exclusive:!0,onChange:s,children:[w.jsx(Pn,{value:"text",size:"small",sx:ko.toggleButton,children:w.jsx(yfe,{})},0),w.jsx(Pn,{value:"list",size:"small",sx:ko.toggleButton,children:w.jsx(gfe,{})},1),w.jsx(Pn,{value:"code",size:"small",sx:ko.toggleButton,children:w.jsx(mfe,{})},2),o&&w.jsx(Pn,{value:"python",size:"small",sx:{...ko.toggleButton,width:"30px"},children:w.jsx("img",{src:pdt,width:16,alt:"python logo"})},3)]},0)}),a]})},b_=({data:t})=>w.jsx(lie,{component:Ho,sx:gv.keyValueTableContainer,children:w.jsx(M5,{sx:gv.table,size:"small",children:w.jsx(k5,{children:t.map((e,n)=>{const[r,i]=e;let o=i;return typeof i=="string"&&(i.startsWith("http://")||i.startsWith("https://"))?o=w.jsx(nAe,{href:i,target:"_blank",rel:"noreferrer",children:i}):Array.isArray(i)&&(o="["+i.map(a=>a+"").join(", ")+"]"),w.jsxs(vl,{children:[w.jsx(sr,{children:r}),w.jsx(sr,{align:"right",children:o})]},n)})})})}),tu=({children:t})=>w.jsx(Vre,{sx:gv.cardContent,children:t}),Dpe=({code:t,extension:e})=>w.jsx(tu,{children:w.jsx(ik,{theme:Kt.instance.branding.themeName||"light",height:"320px",extensions:[e],value:t,readOnly:!0})}),iU=({code:t})=>w.jsx(Dpe,{code:t,extension:Spe()}),Lpe=({code:t})=>w.jsx(Dpe,{code:t,extension:hdt()});function e$(t,e){const n={};for(const r of e)r in t&&(n[r]=t[r]);return n}function xdt(t,e){const n=_dt(e.id);return["from xcube.core.store import new_data_store","","store = new_data_store(",'    "s3",','    root="datasets",  # can also use "pyramids" here',"    storage_options={",'        "anon": True,','        "client_kwargs": {',`            "endpoint_url": "${t.url}/s3"`,"        }","    }",")","# store.list_data_ids()",`dataset = store.open_data(data_id="${n}")`].join(`
`)}function bdt(t,e,n){const r=e.name,i=e.colorBarMin,o=e.colorBarMax,a=e.colorBarName;let s="";n!==null&&(s=`sel(time="${gy(n)}", method="nearest")`);const l=[];if(V1(e)){const c=e.expression;l.push("from xcube.util.expression import compute_array_expr"),l.push("from xcube.util.expression import new_dataset_namespace"),l.push(""),l.push("namespace = new_dataset_namespace(dataset)"),l.push(`${r} = compute_array_expr("${c}", namespace`),s&&l.push(`${r} = ${r}.${s}`)}else s?l.push(`${r} = dataset.${r}.${s}`):l.push(`${r} = dataset.${r}`);return l.push(`${r}.plot.imshow(vmin=${i}, vmax=${o}, cmap="${a}")`),l.join(`
`)}function _dt(t){return wdt(t)[0]+".zarr"}function wdt(t){const e=t.lastIndexOf(".");return e>=0?[t.substring(0,e),t.substring(e)]:[t,""]}const Sdt=t=>({locale:t.controlState.locale,visibleInfoCardElements:_Ve(t),infoCardElementViewModes:wVe(t),selectedDataset:qr(t),selectedVariable:vo(t),selectedPlaceInfo:iw(t),selectedTime:by(t),serverConfig:pi(t),allowViewModePython:!!Kt.instance.branding.allowViewModePython}),Odt={setVisibleInfoCardElements:j8e,updateInfoCardElementViewMode:B8e},Cdt=Jt(Sdt,Odt)(mdt),fI=5,Tdt={container:t=>({marginTop:t.spacing(1),marginLeft:t.spacing(fI),marginRight:t.spacing(fI),width:`calc(100% - ${t.spacing(3*(fI+1))})`,height:"5em",display:"flex",alignItems:"flex-end"})};function Edt({dataTimeRange:t,selectedTimeRange:e,selectTimeRange:n}){const[r,i]=M.useState(e);M.useEffect(()=>{i(e)},[e]);const o=(u,f)=>{Array.isArray(f)&&i([f[0],f[1]])},a=(u,f)=>{n&&Array.isArray(f)&&n([f[0],f[1]])};function s(u){return gy(u)}const l=Array.isArray(t);l||(t=[Date.now()-2*Rae.years,Date.now()]);const c=[{value:t[0],label:Qb(t[0])},{value:t[1],label:Qb(t[1])}];return w.jsx(Ke,{sx:Tdt.container,children:w.jsx(ry,{disabled:!l,min:t[0],max:t[1],value:r,marks:c,onChange:o,onChangeCommitted:a,size:"small",valueLabelDisplay:"on",valueLabelFormat:s})})}var Pdt=Array.isArray,qo=Pdt,Mdt=typeof Zn=="object"&&Zn&&Zn.Object===Object&&Zn,Npe=Mdt,kdt=Npe,Adt=typeof self=="object"&&self&&self.Object===Object&&self,Rdt=kdt||Adt||Function("return this")(),dc=Rdt,Idt=dc,Ddt=Idt.Symbol,Cw=Ddt,aX=Cw,$pe=Object.prototype,Ldt=$pe.hasOwnProperty,Ndt=$pe.toString,$0=aX?aX.toStringTag:void 0;function $dt(t){var e=Ldt.call(t,$0),n=t[$0];try{t[$0]=void 0;var r=!0}catch{}var i=Ndt.call(t);return r&&(e?t[$0]=n:delete t[$0]),i}var Fdt=$dt,jdt=Object.prototype,Bdt=jdt.toString;function zdt(t){return Bdt.call(t)}var Udt=zdt,sX=Cw,Wdt=Fdt,Vdt=Udt,Gdt="[object Null]",Hdt="[object Undefined]",lX=sX?sX.toStringTag:void 0;function qdt(t){return t==null?t===void 0?Hdt:Gdt:lX&&lX in Object(t)?Wdt(t):Vdt(t)}var Ou=qdt;function Xdt(t){return t!=null&&typeof t=="object"}var Cu=Xdt,Qdt=Ou,Ydt=Cu,Kdt="[object Symbol]";function Zdt(t){return typeof t=="symbol"||Ydt(t)&&Qdt(t)==Kdt}var Iy=Zdt,Jdt=qo,eht=Iy,tht=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,nht=/^\w*$/;function rht(t,e){if(Jdt(t))return!1;var n=typeof t;return n=="number"||n=="symbol"||n=="boolean"||t==null||eht(t)?!0:nht.test(t)||!tht.test(t)||e!=null&&t in Object(e)}var oU=rht;function iht(t){var e=typeof t;return t!=null&&(e=="object"||e=="function")}var Md=iht;const Dy=$t(Md);var oht=Ou,aht=Md,sht="[object AsyncFunction]",lht="[object Function]",cht="[object GeneratorFunction]",uht="[object Proxy]";function fht(t){if(!aht(t))return!1;var e=oht(t);return e==lht||e==cht||e==sht||e==uht}var aU=fht;const Bt=$t(aU);var dht=dc,hht=dht["__core-js_shared__"],pht=hht,dI=pht,cX=function(){var t=/[^.]+$/.exec(dI&&dI.keys&&dI.keys.IE_PROTO||"");return t?"Symbol(src)_1."+t:""}();function mht(t){return!!cX&&cX in t}var ght=mht,vht=Function.prototype,yht=vht.toString;function xht(t){if(t!=null){try{return yht.call(t)}catch{}try{return t+""}catch{}}return""}var Fpe=xht,bht=aU,_ht=ght,wht=Md,Sht=Fpe,Oht=/[\\^$.*+?()[\]{}|]/g,Cht=/^\[object .+?Constructor\]$/,Tht=Function.prototype,Eht=Object.prototype,Pht=Tht.toString,Mht=Eht.hasOwnProperty,kht=RegExp("^"+Pht.call(Mht).replace(Oht,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$");function Aht(t){if(!wht(t)||_ht(t))return!1;var e=bht(t)?kht:Cht;return e.test(Sht(t))}var Rht=Aht;function Iht(t,e){return t==null?void 0:t[e]}var Dht=Iht,Lht=Rht,Nht=Dht;function $ht(t,e){var n=Nht(t,e);return Lht(n)?n:void 0}var jp=$ht,Fht=jp,jht=Fht(Object,"create"),sk=jht,uX=sk;function Bht(){this.__data__=uX?uX(null):{},this.size=0}var zht=Bht;function Uht(t){var e=this.has(t)&&delete this.__data__[t];return this.size-=e?1:0,e}var Wht=Uht,Vht=sk,Ght="__lodash_hash_undefined__",Hht=Object.prototype,qht=Hht.hasOwnProperty;function Xht(t){var e=this.__data__;if(Vht){var n=e[t];return n===Ght?void 0:n}return qht.call(e,t)?e[t]:void 0}var Qht=Xht,Yht=sk,Kht=Object.prototype,Zht=Kht.hasOwnProperty;function Jht(t){var e=this.__data__;return Yht?e[t]!==void 0:Zht.call(e,t)}var ept=Jht,tpt=sk,npt="__lodash_hash_undefined__";function rpt(t,e){var n=this.__data__;return this.size+=this.has(t)?0:1,n[t]=tpt&&e===void 0?npt:e,this}var ipt=rpt,opt=zht,apt=Wht,spt=Qht,lpt=ept,cpt=ipt;function Ly(t){var e=-1,n=t==null?0:t.length;for(this.clear();++e<n;){var r=t[e];this.set(r[0],r[1])}}Ly.prototype.clear=opt;Ly.prototype.delete=apt;Ly.prototype.get=spt;Ly.prototype.has=lpt;Ly.prototype.set=cpt;var upt=Ly;function fpt(){this.__data__=[],this.size=0}var dpt=fpt;function hpt(t,e){return t===e||t!==t&&e!==e}var sU=hpt,ppt=sU;function mpt(t,e){for(var n=t.length;n--;)if(ppt(t[n][0],e))return n;return-1}var lk=mpt,gpt=lk,vpt=Array.prototype,ypt=vpt.splice;function xpt(t){var e=this.__data__,n=gpt(e,t);if(n<0)return!1;var r=e.length-1;return n==r?e.pop():ypt.call(e,n,1),--this.size,!0}var bpt=xpt,_pt=lk;function wpt(t){var e=this.__data__,n=_pt(e,t);return n<0?void 0:e[n][1]}var Spt=wpt,Opt=lk;function Cpt(t){return Opt(this.__data__,t)>-1}var Tpt=Cpt,Ept=lk;function Ppt(t,e){var n=this.__data__,r=Ept(n,t);return r<0?(++this.size,n.push([t,e])):n[r][1]=e,this}var Mpt=Ppt,kpt=dpt,Apt=bpt,Rpt=Spt,Ipt=Tpt,Dpt=Mpt;function Ny(t){var e=-1,n=t==null?0:t.length;for(this.clear();++e<n;){var r=t[e];this.set(r[0],r[1])}}Ny.prototype.clear=kpt;Ny.prototype.delete=Apt;Ny.prototype.get=Rpt;Ny.prototype.has=Ipt;Ny.prototype.set=Dpt;var ck=Ny,Lpt=jp,Npt=dc,$pt=Lpt(Npt,"Map"),lU=$pt,fX=upt,Fpt=ck,jpt=lU;function Bpt(){this.size=0,this.__data__={hash:new fX,map:new(jpt||Fpt),string:new fX}}var zpt=Bpt;function Upt(t){var e=typeof t;return e=="string"||e=="number"||e=="symbol"||e=="boolean"?t!=="__proto__":t===null}var Wpt=Upt,Vpt=Wpt;function Gpt(t,e){var n=t.__data__;return Vpt(e)?n[typeof e=="string"?"string":"hash"]:n.map}var uk=Gpt,Hpt=uk;function qpt(t){var e=Hpt(this,t).delete(t);return this.size-=e?1:0,e}var Xpt=qpt,Qpt=uk;function Ypt(t){return Qpt(this,t).get(t)}var Kpt=Ypt,Zpt=uk;function Jpt(t){return Zpt(this,t).has(t)}var emt=Jpt,tmt=uk;function nmt(t,e){var n=tmt(this,t),r=n.size;return n.set(t,e),this.size+=n.size==r?0:1,this}var rmt=nmt,imt=zpt,omt=Xpt,amt=Kpt,smt=emt,lmt=rmt;function $y(t){var e=-1,n=t==null?0:t.length;for(this.clear();++e<n;){var r=t[e];this.set(r[0],r[1])}}$y.prototype.clear=imt;$y.prototype.delete=omt;$y.prototype.get=amt;$y.prototype.has=smt;$y.prototype.set=lmt;var cU=$y,jpe=cU,cmt="Expected a function";function uU(t,e){if(typeof t!="function"||e!=null&&typeof e!="function")throw new TypeError(cmt);var n=function(){var r=arguments,i=e?e.apply(this,r):r[0],o=n.cache;if(o.has(i))return o.get(i);var a=t.apply(this,r);return n.cache=o.set(i,a)||o,a};return n.cache=new(uU.Cache||jpe),n}uU.Cache=jpe;var Bpe=uU;const umt=$t(Bpe);var fmt=Bpe,dmt=500;function hmt(t){var e=fmt(t,function(r){return n.size===dmt&&n.clear(),r}),n=e.cache;return e}var pmt=hmt,mmt=pmt,gmt=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,vmt=/\\(\\)?/g,ymt=mmt(function(t){var e=[];return t.charCodeAt(0)===46&&e.push(""),t.replace(gmt,function(n,r,i,o){e.push(i?o.replace(vmt,"$1"):r||n)}),e}),xmt=ymt;function bmt(t,e){for(var n=-1,r=t==null?0:t.length,i=Array(r);++n<r;)i[n]=e(t[n],n,t);return i}var fU=bmt,dX=Cw,_mt=fU,wmt=qo,Smt=Iy,Omt=1/0,hX=dX?dX.prototype:void 0,pX=hX?hX.toString:void 0;function zpe(t){if(typeof t=="string")return t;if(wmt(t))return _mt(t,zpe)+"";if(Smt(t))return pX?pX.call(t):"";var e=t+"";return e=="0"&&1/t==-Omt?"-0":e}var Cmt=zpe,Tmt=Cmt;function Emt(t){return t==null?"":Tmt(t)}var Upe=Emt,Pmt=qo,Mmt=oU,kmt=xmt,Amt=Upe;function Rmt(t,e){return Pmt(t)?t:Mmt(t,e)?[t]:kmt(Amt(t))}var Wpe=Rmt,Imt=Iy,Dmt=1/0;function Lmt(t){if(typeof t=="string"||Imt(t))return t;var e=t+"";return e=="0"&&1/t==-Dmt?"-0":e}var fk=Lmt,Nmt=Wpe,$mt=fk;function Fmt(t,e){e=Nmt(e,t);for(var n=0,r=e.length;t!=null&&n<r;)t=t[$mt(e[n++])];return n&&n==r?t:void 0}var dU=Fmt,jmt=dU;function Bmt(t,e,n){var r=t==null?void 0:jmt(t,e);return r===void 0?n:r}var Vpe=Bmt;const is=$t(Vpe);function zmt(t){return t==null}var Umt=zmt;const Wt=$t(Umt);var Wmt=Ou,Vmt=qo,Gmt=Cu,Hmt="[object String]";function qmt(t){return typeof t=="string"||!Vmt(t)&&Gmt(t)&&Wmt(t)==Hmt}var Xmt=qmt;const Tw=$t(Xmt);var Qmt=Ou,Ymt=Cu,Kmt="[object Number]";function Zmt(t){return typeof t=="number"||Ymt(t)&&Qmt(t)==Kmt}var Gpe=Zmt;const Jmt=$t(Gpe);var egt=Gpe;function tgt(t){return egt(t)&&t!=+t}var ngt=tgt;const Fy=$t(ngt);var qs=function(e){return e===0?0:e>0?1:-1},Ch=function(e){return Tw(e)&&e.indexOf("%")===e.length-1},Ye=function(e){return Jmt(e)&&!Fy(e)},ti=function(e){return Ye(e)||Tw(e)},rgt=0,jy=function(e){var n=++rgt;return"".concat(e||"").concat(n)},hp=function(e,n){var r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:0,i=arguments.length>3&&arguments[3]!==void 0?arguments[3]:!1;if(!Ye(e)&&!Tw(e))return r;var o;if(Ch(e)){var a=e.indexOf("%");o=n*parseFloat(e.slice(0,a))/100}else o=+e;return Fy(o)&&(o=r),i&&o>n&&(o=n),o},gf=function(e){if(!e)return null;var n=Object.keys(e);return n&&n.length?e[n[0]]:null},igt=function(e){if(!Array.isArray(e))return!1;for(var n=e.length,r={},i=0;i<n;i++)if(!r[e[i]])r[e[i]]=!0;else return!0;return!1},Ei=function(e,n){return Ye(e)&&Ye(n)?function(r){return e+r*(n-e)}:function(){return n}};function NE(t,e,n){return!t||!t.length?null:t.find(function(r){return r&&(typeof e=="function"?e(r):is(r,e))===n})}function Ng(t,e){for(var n in t)if({}.hasOwnProperty.call(t,n)&&(!{}.hasOwnProperty.call(e,n)||t[n]!==e[n]))return!1;for(var r in e)if({}.hasOwnProperty.call(e,r)&&!{}.hasOwnProperty.call(t,r))return!1;return!0}function t$(t){"@babel/helpers - typeof";return t$=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(e){return typeof e}:function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},t$(t)}var ogt=["viewBox","children"],agt=["aria-activedescendant","aria-atomic","aria-autocomplete","aria-busy","aria-checked","aria-colcount","aria-colindex","aria-colspan","aria-controls","aria-current","aria-describedby","aria-details","aria-disabled","aria-errormessage","aria-expanded","aria-flowto","aria-haspopup","aria-hidden","aria-invalid","aria-keyshortcuts","aria-label","aria-labelledby","aria-level","aria-live","aria-modal","aria-multiline","aria-multiselectable","aria-orientation","aria-owns","aria-placeholder","aria-posinset","aria-pressed","aria-readonly","aria-relevant","aria-required","aria-roledescription","aria-rowcount","aria-rowindex","aria-rowspan","aria-selected","aria-setsize","aria-sort","aria-valuemax","aria-valuemin","aria-valuenow","aria-valuetext","className","color","height","id","lang","max","media","method","min","name","style","target","width","role","tabIndex","accentHeight","accumulate","additive","alignmentBaseline","allowReorder","alphabetic","amplitude","arabicForm","ascent","attributeName","attributeType","autoReverse","azimuth","baseFrequency","baselineShift","baseProfile","bbox","begin","bias","by","calcMode","capHeight","clip","clipPath","clipPathUnits","clipRule","colorInterpolation","colorInterpolationFilters","colorProfile","colorRendering","contentScriptType","contentStyleType","cursor","cx","cy","d","decelerate","descent","diffuseConstant","direction","display","divisor","dominantBaseline","dur","dx","dy","edgeMode","elevation","enableBackground","end","exponent","externalResourcesRequired","fill","fillOpacity","fillRule","filter","filterRes","filterUnits","floodColor","floodOpacity","focusable","fontFamily","fontSize","fontSizeAdjust","fontStretch","fontStyle","fontVariant","fontWeight","format","from","fx","fy","g1","g2","glyphName","glyphOrientationHorizontal","glyphOrientationVertical","glyphRef","gradientTransform","gradientUnits","hanging","horizAdvX","horizOriginX","href","ideographic","imageRendering","in2","in","intercept","k1","k2","k3","k4","k","kernelMatrix","kernelUnitLength","kerning","keyPoints","keySplines","keyTimes","lengthAdjust","letterSpacing","lightingColor","limitingConeAngle","local","markerEnd","markerHeight","markerMid","markerStart","markerUnits","markerWidth","mask","maskContentUnits","maskUnits","mathematical","mode","numOctaves","offset","opacity","operator","order","orient","orientation","origin","overflow","overlinePosition","overlineThickness","paintOrder","panose1","pathLength","patternContentUnits","patternTransform","patternUnits","pointerEvents","pointsAtX","pointsAtY","pointsAtZ","preserveAlpha","preserveAspectRatio","primitiveUnits","r","radius","refX","refY","renderingIntent","repeatCount","repeatDur","requiredExtensions","requiredFeatures","restart","result","rotate","rx","ry","seed","shapeRendering","slope","spacing","specularConstant","specularExponent","speed","spreadMethod","startOffset","stdDeviation","stemh","stemv","stitchTiles","stopColor","stopOpacity","strikethroughPosition","strikethroughThickness","string","stroke","strokeDasharray","strokeDashoffset","strokeLinecap","strokeLinejoin","strokeMiterlimit","strokeOpacity","strokeWidth","surfaceScale","systemLanguage","tableValues","targetX","targetY","textAnchor","textDecoration","textLength","textRendering","to","transform","u1","u2","underlinePosition","underlineThickness","unicode","unicodeBidi","unicodeRange","unitsPerEm","vAlphabetic","values","vectorEffect","version","vertAdvY","vertOriginX","vertOriginY","vHanging","vIdeographic","viewTarget","visibility","vMathematical","widths","wordSpacing","writingMode","x1","x2","x","xChannelSelector","xHeight","xlinkActuate","xlinkArcrole","xlinkHref","xlinkRole","xlinkShow","xlinkTitle","xlinkType","xmlBase","xmlLang","xmlns","xmlnsXlink","xmlSpace","y1","y2","y","yChannelSelector","z","zoomAndPan","ref","key","angle"],mX=["points","pathLength"],hI={svg:ogt,polygon:mX,polyline:mX},hU=["dangerouslySetInnerHTML","onCopy","onCopyCapture","onCut","onCutCapture","onPaste","onPasteCapture","onCompositionEnd","onCompositionEndCapture","onCompositionStart","onCompositionStartCapture","onCompositionUpdate","onCompositionUpdateCapture","onFocus","onFocusCapture","onBlur","onBlurCapture","onChange","onChangeCapture","onBeforeInput","onBeforeInputCapture","onInput","onInputCapture","onReset","onResetCapture","onSubmit","onSubmitCapture","onInvalid","onInvalidCapture","onLoad","onLoadCapture","onError","onErrorCapture","onKeyDown","onKeyDownCapture","onKeyPress","onKeyPressCapture","onKeyUp","onKeyUpCapture","onAbort","onAbortCapture","onCanPlay","onCanPlayCapture","onCanPlayThrough","onCanPlayThroughCapture","onDurationChange","onDurationChangeCapture","onEmptied","onEmptiedCapture","onEncrypted","onEncryptedCapture","onEnded","onEndedCapture","onLoadedData","onLoadedDataCapture","onLoadedMetadata","onLoadedMetadataCapture","onLoadStart","onLoadStartCapture","onPause","onPauseCapture","onPlay","onPlayCapture","onPlaying","onPlayingCapture","onProgress","onProgressCapture","onRateChange","onRateChangeCapture","onSeeked","onSeekedCapture","onSeeking","onSeekingCapture","onStalled","onStalledCapture","onSuspend","onSuspendCapture","onTimeUpdate","onTimeUpdateCapture","onVolumeChange","onVolumeChangeCapture","onWaiting","onWaitingCapture","onAuxClick","onAuxClickCapture","onClick","onClickCapture","onContextMenu","onContextMenuCapture","onDoubleClick","onDoubleClickCapture","onDrag","onDragCapture","onDragEnd","onDragEndCapture","onDragEnter","onDragEnterCapture","onDragExit","onDragExitCapture","onDragLeave","onDragLeaveCapture","onDragOver","onDragOverCapture","onDragStart","onDragStartCapture","onDrop","onDropCapture","onMouseDown","onMouseDownCapture","onMouseEnter","onMouseLeave","onMouseMove","onMouseMoveCapture","onMouseOut","onMouseOutCapture","onMouseOver","onMouseOverCapture","onMouseUp","onMouseUpCapture","onSelect","onSelectCapture","onTouchCancel","onTouchCancelCapture","onTouchEnd","onTouchEndCapture","onTouchMove","onTouchMoveCapture","onTouchStart","onTouchStartCapture","onPointerDown","onPointerDownCapture","onPointerMove","onPointerMoveCapture","onPointerUp","onPointerUpCapture","onPointerCancel","onPointerCancelCapture","onPointerEnter","onPointerEnterCapture","onPointerLeave","onPointerLeaveCapture","onPointerOver","onPointerOverCapture","onPointerOut","onPointerOutCapture","onGotPointerCapture","onGotPointerCaptureCapture","onLostPointerCapture","onLostPointerCaptureCapture","onScroll","onScrollCapture","onWheel","onWheelCapture","onAnimationStart","onAnimationStartCapture","onAnimationEnd","onAnimationEndCapture","onAnimationIteration","onAnimationIterationCapture","onTransitionEnd","onTransitionEndCapture"],$E=function(e,n){if(!e||typeof e=="function"||typeof e=="boolean")return null;var r=e;if(M.isValidElement(e)&&(r=e.props),!Dy(r))return null;var i={};return Object.keys(r).forEach(function(o){hU.includes(o)&&(i[o]=n||function(a){return r[o](r,a)})}),i},sgt=function(e,n,r){return function(i){return e(n,r,i),null}},FE=function(e,n,r){if(!Dy(e)||t$(e)!=="object")return null;var i=null;return Object.keys(e).forEach(function(o){var a=e[o];hU.includes(o)&&typeof a=="function"&&(i||(i={}),i[o]=sgt(a,n,r))}),i},lgt=["children"],cgt=["children"];function gX(t,e){if(t==null)return{};var n=ugt(t,e),r,i;if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(t);for(i=0;i<o.length;i++)r=o[i],!(e.indexOf(r)>=0)&&Object.prototype.propertyIsEnumerable.call(t,r)&&(n[r]=t[r])}return n}function ugt(t,e){if(t==null)return{};var n={},r=Object.keys(t),i,o;for(o=0;o<r.length;o++)i=r[o],!(e.indexOf(i)>=0)&&(n[i]=t[i]);return n}function n$(t){"@babel/helpers - typeof";return n$=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(e){return typeof e}:function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},n$(t)}var vX={click:"onClick",mousedown:"onMouseDown",mouseup:"onMouseUp",mouseover:"onMouseOver",mousemove:"onMouseMove",mouseout:"onMouseOut",mouseenter:"onMouseEnter",mouseleave:"onMouseLeave",touchcancel:"onTouchCancel",touchend:"onTouchEnd",touchmove:"onTouchMove",touchstart:"onTouchStart"},nu=function(e){return typeof e=="string"?e:e?e.displayName||e.name||"Component":""},yX=null,pI=null,pU=function t(e){if(e===yX&&Array.isArray(pI))return pI;var n=[];return M.Children.forEach(e,function(r){Wt(r)||(_T.isFragment(r)?n=n.concat(t(r.props.children)):n.push(r))}),pI=n,yX=e,n};function os(t,e){var n=[],r=[];return Array.isArray(e)?r=e.map(function(i){return nu(i)}):r=[nu(e)],pU(t).forEach(function(i){var o=is(i,"type.displayName")||is(i,"type.name");r.indexOf(o)!==-1&&n.push(i)}),n}function ca(t,e){var n=os(t,e);return n&&n[0]}var xX=function(e){if(!e||!e.props)return!1;var n=e.props,r=n.width,i=n.height;return!(!Ye(r)||r<=0||!Ye(i)||i<=0)},fgt=["a","altGlyph","altGlyphDef","altGlyphItem","animate","animateColor","animateMotion","animateTransform","circle","clipPath","color-profile","cursor","defs","desc","ellipse","feBlend","feColormatrix","feComponentTransfer","feComposite","feConvolveMatrix","feDiffuseLighting","feDisplacementMap","feDistantLight","feFlood","feFuncA","feFuncB","feFuncG","feFuncR","feGaussianBlur","feImage","feMerge","feMergeNode","feMorphology","feOffset","fePointLight","feSpecularLighting","feSpotLight","feTile","feTurbulence","filter","font","font-face","font-face-format","font-face-name","font-face-url","foreignObject","g","glyph","glyphRef","hkern","image","line","lineGradient","marker","mask","metadata","missing-glyph","mpath","path","pattern","polygon","polyline","radialGradient","rect","script","set","stop","style","svg","switch","symbol","text","textPath","title","tref","tspan","use","view","vkern"],dgt=function(e){return e&&e.type&&Tw(e.type)&&fgt.indexOf(e.type)>=0},Hpe=function(e){return e&&n$(e)==="object"&&"cx"in e&&"cy"in e&&"r"in e},hgt=function(e,n,r,i){var o,a=(o=hI==null?void 0:hI[i])!==null&&o!==void 0?o:[];return!Bt(e)&&(i&&a.includes(n)||agt.includes(n))||r&&hU.includes(n)},jt=function(e,n,r){if(!e||typeof e=="function"||typeof e=="boolean")return null;var i=e;if(M.isValidElement(e)&&(i=e.props),!Dy(i))return null;var o={};return Object.keys(i).forEach(function(a){var s;hgt((s=i)===null||s===void 0?void 0:s[a],a,n,r)&&(o[a]=i[a])}),o},r$=function t(e,n){if(e===n)return!0;var r=M.Children.count(e);if(r!==M.Children.count(n))return!1;if(r===0)return!0;if(r===1)return bX(Array.isArray(e)?e[0]:e,Array.isArray(n)?n[0]:n);for(var i=0;i<r;i++){var o=e[i],a=n[i];if(Array.isArray(o)||Array.isArray(a)){if(!t(o,a))return!1}else if(!bX(o,a))return!1}return!0},bX=function(e,n){if(Wt(e)&&Wt(n))return!0;if(!Wt(e)&&!Wt(n)){var r=e.props||{},i=r.children,o=gX(r,lgt),a=n.props||{},s=a.children,l=gX(a,cgt);return i&&s?Ng(o,l)&&r$(i,s):!i&&!s?Ng(o,l):!1}return!1},_X=function(e,n){var r=[],i={};return pU(e).forEach(function(o,a){if(dgt(o))r.push(o);else if(o){var s=nu(o.type),l=n[s]||{},c=l.handler,u=l.once;if(c&&(!u||!i[s])){var f=c(o,s,a);r.push(f),i[s]=!0}}}),r},pgt=function(e){var n=e&&e.type;return n&&vX[n]?vX[n]:null},mgt=function(e,n){return pU(n).indexOf(e)},ggt=["children","width","height","viewBox","className","style","title","desc"];function i$(){return i$=Object.assign?Object.assign.bind():function(t){for(var e=1;e<arguments.length;e++){var n=arguments[e];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(t[r]=n[r])}return t},i$.apply(this,arguments)}function vgt(t,e){if(t==null)return{};var n=ygt(t,e),r,i;if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(t);for(i=0;i<o.length;i++)r=o[i],!(e.indexOf(r)>=0)&&Object.prototype.propertyIsEnumerable.call(t,r)&&(n[r]=t[r])}return n}function ygt(t,e){if(t==null)return{};var n={},r=Object.keys(t),i,o;for(o=0;o<r.length;o++)i=r[o],!(e.indexOf(i)>=0)&&(n[i]=t[i]);return n}function o$(t){var e=t.children,n=t.width,r=t.height,i=t.viewBox,o=t.className,a=t.style,s=t.title,l=t.desc,c=vgt(t,ggt),u=i||{width:n,height:r,x:0,y:0},f=ke("recharts-surface",o);return ue.createElement("svg",i$({},jt(c,!0,"svg"),{className:f,width:n,height:r,style:a,viewBox:"".concat(u.x," ").concat(u.y," ").concat(u.width," ").concat(u.height)}),ue.createElement("title",null,s),ue.createElement("desc",null,l),e)}var xgt=["children","className"];function a$(){return a$=Object.assign?Object.assign.bind():function(t){for(var e=1;e<arguments.length;e++){var n=arguments[e];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(t[r]=n[r])}return t},a$.apply(this,arguments)}function bgt(t,e){if(t==null)return{};var n=_gt(t,e),r,i;if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(t);for(i=0;i<o.length;i++)r=o[i],!(e.indexOf(r)>=0)&&Object.prototype.propertyIsEnumerable.call(t,r)&&(n[r]=t[r])}return n}function _gt(t,e){if(t==null)return{};var n={},r=Object.keys(t),i,o;for(o=0;o<r.length;o++)i=r[o],!(e.indexOf(i)>=0)&&(n[i]=t[i]);return n}var Gn=ue.forwardRef(function(t,e){var n=t.children,r=t.className,i=bgt(t,xgt),o=ke("recharts-layer",r);return ue.createElement("g",a$({className:o},jt(i,!0),{ref:e}),n)}),ru=function(e,n){for(var r=arguments.length,i=new Array(r>2?r-2:0),o=2;o<r;o++)i[o-2]=arguments[o]};function wgt(t,e,n){var r=-1,i=t.length;e<0&&(e=-e>i?0:i+e),n=n>i?i:n,n<0&&(n+=i),i=e>n?0:n-e>>>0,e>>>=0;for(var o=Array(i);++r<i;)o[r]=t[r+e];return o}var Sgt=wgt,Ogt=Sgt;function Cgt(t,e,n){var r=t.length;return n=n===void 0?r:n,!e&&n>=r?t:Ogt(t,e,n)}var Tgt=Cgt,Egt="\\ud800-\\udfff",Pgt="\\u0300-\\u036f",Mgt="\\ufe20-\\ufe2f",kgt="\\u20d0-\\u20ff",Agt=Pgt+Mgt+kgt,Rgt="\\ufe0e\\ufe0f",Igt="\\u200d",Dgt=RegExp("["+Igt+Egt+Agt+Rgt+"]");function Lgt(t){return Dgt.test(t)}var qpe=Lgt;function Ngt(t){return t.split("")}var $gt=Ngt,Xpe="\\ud800-\\udfff",Fgt="\\u0300-\\u036f",jgt="\\ufe20-\\ufe2f",Bgt="\\u20d0-\\u20ff",zgt=Fgt+jgt+Bgt,Ugt="\\ufe0e\\ufe0f",Wgt="["+Xpe+"]",s$="["+zgt+"]",l$="\\ud83c[\\udffb-\\udfff]",Vgt="(?:"+s$+"|"+l$+")",Qpe="[^"+Xpe+"]",Ype="(?:\\ud83c[\\udde6-\\uddff]){2}",Kpe="[\\ud800-\\udbff][\\udc00-\\udfff]",Ggt="\\u200d",Zpe=Vgt+"?",Jpe="["+Ugt+"]?",Hgt="(?:"+Ggt+"(?:"+[Qpe,Ype,Kpe].join("|")+")"+Jpe+Zpe+")*",qgt=Jpe+Zpe+Hgt,Xgt="(?:"+[Qpe+s$+"?",s$,Ype,Kpe,Wgt].join("|")+")",Qgt=RegExp(l$+"(?="+l$+")|"+Xgt+qgt,"g");function Ygt(t){return t.match(Qgt)||[]}var Kgt=Ygt,Zgt=$gt,Jgt=qpe,evt=Kgt;function tvt(t){return Jgt(t)?evt(t):Zgt(t)}var nvt=tvt,rvt=Tgt,ivt=qpe,ovt=nvt,avt=Upe;function svt(t){return function(e){e=avt(e);var n=ivt(e)?ovt(e):void 0,r=n?n[0]:e.charAt(0),i=n?rvt(n,1).join(""):e.slice(1);return r[t]()+i}}var lvt=svt,cvt=lvt,uvt=cvt("toUpperCase"),fvt=uvt;const dk=$t(fvt);function Un(t){return function(){return t}}const eme=Math.cos,jE=Math.sin,ol=Math.sqrt,BE=Math.PI,hk=2*BE,c$=Math.PI,u$=2*c$,eh=1e-6,dvt=u$-eh;function tme(t){this._+=t[0];for(let e=1,n=t.length;e<n;++e)this._+=arguments[e]+t[e]}function hvt(t){let e=Math.floor(t);if(!(e>=0))throw new Error(`invalid digits: ${t}`);if(e>15)return tme;const n=10**e;return function(r){this._+=r[0];for(let i=1,o=r.length;i<o;++i)this._+=Math.round(arguments[i]*n)/n+r[i]}}class pvt{constructor(e){this._x0=this._y0=this._x1=this._y1=null,this._="",this._append=e==null?tme:hvt(e)}moveTo(e,n){this._append`M${this._x0=this._x1=+e},${this._y0=this._y1=+n}`}closePath(){this._x1!==null&&(this._x1=this._x0,this._y1=this._y0,this._append`Z`)}lineTo(e,n){this._append`L${this._x1=+e},${this._y1=+n}`}quadraticCurveTo(e,n,r,i){this._append`Q${+e},${+n},${this._x1=+r},${this._y1=+i}`}bezierCurveTo(e,n,r,i,o,a){this._append`C${+e},${+n},${+r},${+i},${this._x1=+o},${this._y1=+a}`}arcTo(e,n,r,i,o){if(e=+e,n=+n,r=+r,i=+i,o=+o,o<0)throw new Error(`negative radius: ${o}`);let a=this._x1,s=this._y1,l=r-e,c=i-n,u=a-e,f=s-n,d=u*u+f*f;if(this._x1===null)this._append`M${this._x1=e},${this._y1=n}`;else if(d>eh)if(!(Math.abs(f*l-c*u)>eh)||!o)this._append`L${this._x1=e},${this._y1=n}`;else{let h=r-a,p=i-s,m=l*l+c*c,g=h*h+p*p,v=Math.sqrt(m),y=Math.sqrt(d),x=o*Math.tan((c$-Math.acos((m+d-g)/(2*v*y)))/2),b=x/y,_=x/v;Math.abs(b-1)>eh&&this._append`L${e+b*u},${n+b*f}`,this._append`A${o},${o},0,0,${+(f*h>u*p)},${this._x1=e+_*l},${this._y1=n+_*c}`}}arc(e,n,r,i,o,a){if(e=+e,n=+n,r=+r,a=!!a,r<0)throw new Error(`negative radius: ${r}`);let s=r*Math.cos(i),l=r*Math.sin(i),c=e+s,u=n+l,f=1^a,d=a?i-o:o-i;this._x1===null?this._append`M${c},${u}`:(Math.abs(this._x1-c)>eh||Math.abs(this._y1-u)>eh)&&this._append`L${c},${u}`,r&&(d<0&&(d=d%u$+u$),d>dvt?this._append`A${r},${r},0,1,${f},${e-s},${n-l}A${r},${r},0,1,${f},${this._x1=c},${this._y1=u}`:d>eh&&this._append`A${r},${r},0,${+(d>=c$)},${f},${this._x1=e+r*Math.cos(o)},${this._y1=n+r*Math.sin(o)}`)}rect(e,n,r,i){this._append`M${this._x0=this._x1=+e},${this._y0=this._y1=+n}h${r=+r}v${+i}h${-r}Z`}toString(){return this._}}function mU(t){let e=3;return t.digits=function(n){if(!arguments.length)return e;if(n==null)e=null;else{const r=Math.floor(n);if(!(r>=0))throw new RangeError(`invalid digits: ${n}`);e=r}return t},()=>new pvt(e)}function gU(t){return typeof t=="object"&&"length"in t?t:Array.from(t)}function nme(t){this._context=t}nme.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._point=0},lineEnd:function(){(this._line||this._line!==0&&this._point===1)&&this._context.closePath(),this._line=1-this._line},point:function(t,e){switch(t=+t,e=+e,this._point){case 0:this._point=1,this._line?this._context.lineTo(t,e):this._context.moveTo(t,e);break;case 1:this._point=2;default:this._context.lineTo(t,e);break}}};function pk(t){return new nme(t)}function rme(t){return t[0]}function ime(t){return t[1]}function ome(t,e){var n=Un(!0),r=null,i=pk,o=null,a=mU(s);t=typeof t=="function"?t:t===void 0?rme:Un(t),e=typeof e=="function"?e:e===void 0?ime:Un(e);function s(l){var c,u=(l=gU(l)).length,f,d=!1,h;for(r==null&&(o=i(h=a())),c=0;c<=u;++c)!(c<u&&n(f=l[c],c,l))===d&&((d=!d)?o.lineStart():o.lineEnd()),d&&o.point(+t(f,c,l),+e(f,c,l));if(h)return o=null,h+""||null}return s.x=function(l){return arguments.length?(t=typeof l=="function"?l:Un(+l),s):t},s.y=function(l){return arguments.length?(e=typeof l=="function"?l:Un(+l),s):e},s.defined=function(l){return arguments.length?(n=typeof l=="function"?l:Un(!!l),s):n},s.curve=function(l){return arguments.length?(i=l,r!=null&&(o=i(r)),s):i},s.context=function(l){return arguments.length?(l==null?r=o=null:o=i(r=l),s):r},s}function mO(t,e,n){var r=null,i=Un(!0),o=null,a=pk,s=null,l=mU(c);t=typeof t=="function"?t:t===void 0?rme:Un(+t),e=typeof e=="function"?e:Un(e===void 0?0:+e),n=typeof n=="function"?n:n===void 0?ime:Un(+n);function c(f){var d,h,p,m=(f=gU(f)).length,g,v=!1,y,x=new Array(m),b=new Array(m);for(o==null&&(s=a(y=l())),d=0;d<=m;++d){if(!(d<m&&i(g=f[d],d,f))===v)if(v=!v)h=d,s.areaStart(),s.lineStart();else{for(s.lineEnd(),s.lineStart(),p=d-1;p>=h;--p)s.point(x[p],b[p]);s.lineEnd(),s.areaEnd()}v&&(x[d]=+t(g,d,f),b[d]=+e(g,d,f),s.point(r?+r(g,d,f):x[d],n?+n(g,d,f):b[d]))}if(y)return s=null,y+""||null}function u(){return ome().defined(i).curve(a).context(o)}return c.x=function(f){return arguments.length?(t=typeof f=="function"?f:Un(+f),r=null,c):t},c.x0=function(f){return arguments.length?(t=typeof f=="function"?f:Un(+f),c):t},c.x1=function(f){return arguments.length?(r=f==null?null:typeof f=="function"?f:Un(+f),c):r},c.y=function(f){return arguments.length?(e=typeof f=="function"?f:Un(+f),n=null,c):e},c.y0=function(f){return arguments.length?(e=typeof f=="function"?f:Un(+f),c):e},c.y1=function(f){return arguments.length?(n=f==null?null:typeof f=="function"?f:Un(+f),c):n},c.lineX0=c.lineY0=function(){return u().x(t).y(e)},c.lineY1=function(){return u().x(t).y(n)},c.lineX1=function(){return u().x(r).y(e)},c.defined=function(f){return arguments.length?(i=typeof f=="function"?f:Un(!!f),c):i},c.curve=function(f){return arguments.length?(a=f,o!=null&&(s=a(o)),c):a},c.context=function(f){return arguments.length?(f==null?o=s=null:s=a(o=f),c):o},c}class ame{constructor(e,n){this._context=e,this._x=n}areaStart(){this._line=0}areaEnd(){this._line=NaN}lineStart(){this._point=0}lineEnd(){(this._line||this._line!==0&&this._point===1)&&this._context.closePath(),this._line=1-this._line}point(e,n){switch(e=+e,n=+n,this._point){case 0:{this._point=1,this._line?this._context.lineTo(e,n):this._context.moveTo(e,n);break}case 1:this._point=2;default:{this._x?this._context.bezierCurveTo(this._x0=(this._x0+e)/2,this._y0,this._x0,n,e,n):this._context.bezierCurveTo(this._x0,this._y0=(this._y0+n)/2,e,this._y0,e,n);break}}this._x0=e,this._y0=n}}function mvt(t){return new ame(t,!0)}function gvt(t){return new ame(t,!1)}const vU={draw(t,e){const n=ol(e/BE);t.moveTo(n,0),t.arc(0,0,n,0,hk)}},vvt={draw(t,e){const n=ol(e/5)/2;t.moveTo(-3*n,-n),t.lineTo(-n,-n),t.lineTo(-n,-3*n),t.lineTo(n,-3*n),t.lineTo(n,-n),t.lineTo(3*n,-n),t.lineTo(3*n,n),t.lineTo(n,n),t.lineTo(n,3*n),t.lineTo(-n,3*n),t.lineTo(-n,n),t.lineTo(-3*n,n),t.closePath()}},sme=ol(1/3),yvt=sme*2,xvt={draw(t,e){const n=ol(e/yvt),r=n*sme;t.moveTo(0,-n),t.lineTo(r,0),t.lineTo(0,n),t.lineTo(-r,0),t.closePath()}},bvt={draw(t,e){const n=ol(e),r=-n/2;t.rect(r,r,n,n)}},_vt=.8908130915292852,lme=jE(BE/10)/jE(7*BE/10),wvt=jE(hk/10)*lme,Svt=-eme(hk/10)*lme,Ovt={draw(t,e){const n=ol(e*_vt),r=wvt*n,i=Svt*n;t.moveTo(0,-n),t.lineTo(r,i);for(let o=1;o<5;++o){const a=hk*o/5,s=eme(a),l=jE(a);t.lineTo(l*n,-s*n),t.lineTo(s*r-l*i,l*r+s*i)}t.closePath()}},mI=ol(3),Cvt={draw(t,e){const n=-ol(e/(mI*3));t.moveTo(0,n*2),t.lineTo(-mI*n,-n),t.lineTo(mI*n,-n),t.closePath()}},Ia=-.5,Da=ol(3)/2,f$=1/ol(12),Tvt=(f$/2+1)*3,Evt={draw(t,e){const n=ol(e/Tvt),r=n/2,i=n*f$,o=r,a=n*f$+n,s=-o,l=a;t.moveTo(r,i),t.lineTo(o,a),t.lineTo(s,l),t.lineTo(Ia*r-Da*i,Da*r+Ia*i),t.lineTo(Ia*o-Da*a,Da*o+Ia*a),t.lineTo(Ia*s-Da*l,Da*s+Ia*l),t.lineTo(Ia*r+Da*i,Ia*i-Da*r),t.lineTo(Ia*o+Da*a,Ia*a-Da*o),t.lineTo(Ia*s+Da*l,Ia*l-Da*s),t.closePath()}};function Pvt(t,e){let n=null,r=mU(i);t=typeof t=="function"?t:Un(t||vU),e=typeof e=="function"?e:Un(e===void 0?64:+e);function i(){let o;if(n||(n=o=r()),t.apply(this,arguments).draw(n,+e.apply(this,arguments)),o)return n=null,o+""||null}return i.type=function(o){return arguments.length?(t=typeof o=="function"?o:Un(o),i):t},i.size=function(o){return arguments.length?(e=typeof o=="function"?o:Un(+o),i):e},i.context=function(o){return arguments.length?(n=o??null,i):n},i}function zE(){}function UE(t,e,n){t._context.bezierCurveTo((2*t._x0+t._x1)/3,(2*t._y0+t._y1)/3,(t._x0+2*t._x1)/3,(t._y0+2*t._y1)/3,(t._x0+4*t._x1+e)/6,(t._y0+4*t._y1+n)/6)}function cme(t){this._context=t}cme.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._y0=this._y1=NaN,this._point=0},lineEnd:function(){switch(this._point){case 3:UE(this,this._x1,this._y1);case 2:this._context.lineTo(this._x1,this._y1);break}(this._line||this._line!==0&&this._point===1)&&this._context.closePath(),this._line=1-this._line},point:function(t,e){switch(t=+t,e=+e,this._point){case 0:this._point=1,this._line?this._context.lineTo(t,e):this._context.moveTo(t,e);break;case 1:this._point=2;break;case 2:this._point=3,this._context.lineTo((5*this._x0+this._x1)/6,(5*this._y0+this._y1)/6);default:UE(this,t,e);break}this._x0=this._x1,this._x1=t,this._y0=this._y1,this._y1=e}};function Mvt(t){return new cme(t)}function ume(t){this._context=t}ume.prototype={areaStart:zE,areaEnd:zE,lineStart:function(){this._x0=this._x1=this._x2=this._x3=this._x4=this._y0=this._y1=this._y2=this._y3=this._y4=NaN,this._point=0},lineEnd:function(){switch(this._point){case 1:{this._context.moveTo(this._x2,this._y2),this._context.closePath();break}case 2:{this._context.moveTo((this._x2+2*this._x3)/3,(this._y2+2*this._y3)/3),this._context.lineTo((this._x3+2*this._x2)/3,(this._y3+2*this._y2)/3),this._context.closePath();break}case 3:{this.point(this._x2,this._y2),this.point(this._x3,this._y3),this.point(this._x4,this._y4);break}}},point:function(t,e){switch(t=+t,e=+e,this._point){case 0:this._point=1,this._x2=t,this._y2=e;break;case 1:this._point=2,this._x3=t,this._y3=e;break;case 2:this._point=3,this._x4=t,this._y4=e,this._context.moveTo((this._x0+4*this._x1+t)/6,(this._y0+4*this._y1+e)/6);break;default:UE(this,t,e);break}this._x0=this._x1,this._x1=t,this._y0=this._y1,this._y1=e}};function kvt(t){return new ume(t)}function fme(t){this._context=t}fme.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._y0=this._y1=NaN,this._point=0},lineEnd:function(){(this._line||this._line!==0&&this._point===3)&&this._context.closePath(),this._line=1-this._line},point:function(t,e){switch(t=+t,e=+e,this._point){case 0:this._point=1;break;case 1:this._point=2;break;case 2:this._point=3;var n=(this._x0+4*this._x1+t)/6,r=(this._y0+4*this._y1+e)/6;this._line?this._context.lineTo(n,r):this._context.moveTo(n,r);break;case 3:this._point=4;default:UE(this,t,e);break}this._x0=this._x1,this._x1=t,this._y0=this._y1,this._y1=e}};function Avt(t){return new fme(t)}function dme(t){this._context=t}dme.prototype={areaStart:zE,areaEnd:zE,lineStart:function(){this._point=0},lineEnd:function(){this._point&&this._context.closePath()},point:function(t,e){t=+t,e=+e,this._point?this._context.lineTo(t,e):(this._point=1,this._context.moveTo(t,e))}};function Rvt(t){return new dme(t)}function wX(t){return t<0?-1:1}function SX(t,e,n){var r=t._x1-t._x0,i=e-t._x1,o=(t._y1-t._y0)/(r||i<0&&-0),a=(n-t._y1)/(i||r<0&&-0),s=(o*i+a*r)/(r+i);return(wX(o)+wX(a))*Math.min(Math.abs(o),Math.abs(a),.5*Math.abs(s))||0}function OX(t,e){var n=t._x1-t._x0;return n?(3*(t._y1-t._y0)/n-e)/2:e}function gI(t,e,n){var r=t._x0,i=t._y0,o=t._x1,a=t._y1,s=(o-r)/3;t._context.bezierCurveTo(r+s,i+s*e,o-s,a-s*n,o,a)}function WE(t){this._context=t}WE.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._y0=this._y1=this._t0=NaN,this._point=0},lineEnd:function(){switch(this._point){case 2:this._context.lineTo(this._x1,this._y1);break;case 3:gI(this,this._t0,OX(this,this._t0));break}(this._line||this._line!==0&&this._point===1)&&this._context.closePath(),this._line=1-this._line},point:function(t,e){var n=NaN;if(t=+t,e=+e,!(t===this._x1&&e===this._y1)){switch(this._point){case 0:this._point=1,this._line?this._context.lineTo(t,e):this._context.moveTo(t,e);break;case 1:this._point=2;break;case 2:this._point=3,gI(this,OX(this,n=SX(this,t,e)),n);break;default:gI(this,this._t0,n=SX(this,t,e));break}this._x0=this._x1,this._x1=t,this._y0=this._y1,this._y1=e,this._t0=n}}};function hme(t){this._context=new pme(t)}(hme.prototype=Object.create(WE.prototype)).point=function(t,e){WE.prototype.point.call(this,e,t)};function pme(t){this._context=t}pme.prototype={moveTo:function(t,e){this._context.moveTo(e,t)},closePath:function(){this._context.closePath()},lineTo:function(t,e){this._context.lineTo(e,t)},bezierCurveTo:function(t,e,n,r,i,o){this._context.bezierCurveTo(e,t,r,n,o,i)}};function Ivt(t){return new WE(t)}function Dvt(t){return new hme(t)}function mme(t){this._context=t}mme.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x=[],this._y=[]},lineEnd:function(){var t=this._x,e=this._y,n=t.length;if(n)if(this._line?this._context.lineTo(t[0],e[0]):this._context.moveTo(t[0],e[0]),n===2)this._context.lineTo(t[1],e[1]);else for(var r=CX(t),i=CX(e),o=0,a=1;a<n;++o,++a)this._context.bezierCurveTo(r[0][o],i[0][o],r[1][o],i[1][o],t[a],e[a]);(this._line||this._line!==0&&n===1)&&this._context.closePath(),this._line=1-this._line,this._x=this._y=null},point:function(t,e){this._x.push(+t),this._y.push(+e)}};function CX(t){var e,n=t.length-1,r,i=new Array(n),o=new Array(n),a=new Array(n);for(i[0]=0,o[0]=2,a[0]=t[0]+2*t[1],e=1;e<n-1;++e)i[e]=1,o[e]=4,a[e]=4*t[e]+2*t[e+1];for(i[n-1]=2,o[n-1]=7,a[n-1]=8*t[n-1]+t[n],e=1;e<n;++e)r=i[e]/o[e-1],o[e]-=r,a[e]-=r*a[e-1];for(i[n-1]=a[n-1]/o[n-1],e=n-2;e>=0;--e)i[e]=(a[e]-i[e+1])/o[e];for(o[n-1]=(t[n]+i[n-1])/2,e=0;e<n-1;++e)o[e]=2*t[e+1]-i[e+1];return[i,o]}function Lvt(t){return new mme(t)}function mk(t,e){this._context=t,this._t=e}mk.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x=this._y=NaN,this._point=0},lineEnd:function(){0<this._t&&this._t<1&&this._point===2&&this._context.lineTo(this._x,this._y),(this._line||this._line!==0&&this._point===1)&&this._context.closePath(),this._line>=0&&(this._t=1-this._t,this._line=1-this._line)},point:function(t,e){switch(t=+t,e=+e,this._point){case 0:this._point=1,this._line?this._context.lineTo(t,e):this._context.moveTo(t,e);break;case 1:this._point=2;default:{if(this._t<=0)this._context.lineTo(this._x,e),this._context.lineTo(t,e);else{var n=this._x*(1-this._t)+t*this._t;this._context.lineTo(n,this._y),this._context.lineTo(n,e)}break}}this._x=t,this._y=e}};function Nvt(t){return new mk(t,.5)}function $vt(t){return new mk(t,0)}function Fvt(t){return new mk(t,1)}function vv(t,e){if((a=t.length)>1)for(var n=1,r,i,o=t[e[0]],a,s=o.length;n<a;++n)for(i=o,o=t[e[n]],r=0;r<s;++r)o[r][1]+=o[r][0]=isNaN(i[r][1])?i[r][0]:i[r][1]}function d$(t){for(var e=t.length,n=new Array(e);--e>=0;)n[e]=e;return n}function jvt(t,e){return t[e]}function Bvt(t){const e=[];return e.key=t,e}function zvt(){var t=Un([]),e=d$,n=vv,r=jvt;function i(o){var a=Array.from(t.apply(this,arguments),Bvt),s,l=a.length,c=-1,u;for(const f of o)for(s=0,++c;s<l;++s)(a[s][c]=[0,+r(f,a[s].key,c,o)]).data=f;for(s=0,u=gU(e(a));s<l;++s)a[u[s]].index=s;return n(a,u),a}return i.keys=function(o){return arguments.length?(t=typeof o=="function"?o:Un(Array.from(o)),i):t},i.value=function(o){return arguments.length?(r=typeof o=="function"?o:Un(+o),i):r},i.order=function(o){return arguments.length?(e=o==null?d$:typeof o=="function"?o:Un(Array.from(o)),i):e},i.offset=function(o){return arguments.length?(n=o??vv,i):n},i}function Uvt(t,e){if((r=t.length)>0){for(var n,r,i=0,o=t[0].length,a;i<o;++i){for(a=n=0;n<r;++n)a+=t[n][i][1]||0;if(a)for(n=0;n<r;++n)t[n][i][1]/=a}vv(t,e)}}function Wvt(t,e){if((i=t.length)>0){for(var n=0,r=t[e[0]],i,o=r.length;n<o;++n){for(var a=0,s=0;a<i;++a)s+=t[a][n][1]||0;r[n][1]+=r[n][0]=-s/2}vv(t,e)}}function Vvt(t,e){if(!(!((a=t.length)>0)||!((o=(i=t[e[0]]).length)>0))){for(var n=0,r=1,i,o,a;r<o;++r){for(var s=0,l=0,c=0;s<a;++s){for(var u=t[e[s]],f=u[r][1]||0,d=u[r-1][1]||0,h=(f-d)/2,p=0;p<s;++p){var m=t[e[p]],g=m[r][1]||0,v=m[r-1][1]||0;h+=g-v}l+=f,c+=h*f}i[r-1][1]+=i[r-1][0]=n,l&&(n-=c/l)}i[r-1][1]+=i[r-1][0]=n,vv(t,e)}}function __(t){"@babel/helpers - typeof";return __=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(e){return typeof e}:function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},__(t)}var Gvt=["type","size","sizeType"];function h$(){return h$=Object.assign?Object.assign.bind():function(t){for(var e=1;e<arguments.length;e++){var n=arguments[e];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(t[r]=n[r])}return t},h$.apply(this,arguments)}function TX(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(t,i).enumerable})),n.push.apply(n,r)}return n}function EX(t){for(var e=1;e<arguments.length;e++){var n=arguments[e]!=null?arguments[e]:{};e%2?TX(Object(n),!0).forEach(function(r){Hvt(t,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):TX(Object(n)).forEach(function(r){Object.defineProperty(t,r,Object.getOwnPropertyDescriptor(n,r))})}return t}function Hvt(t,e,n){return e=qvt(e),e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function qvt(t){var e=Xvt(t,"string");return __(e)=="symbol"?e:String(e)}function Xvt(t,e){if(__(t)!="object"||!t)return t;var n=t[Symbol.toPrimitive];if(n!==void 0){var r=n.call(t,e||"default");if(__(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}function Qvt(t,e){if(t==null)return{};var n=Yvt(t,e),r,i;if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(t);for(i=0;i<o.length;i++)r=o[i],!(e.indexOf(r)>=0)&&Object.prototype.propertyIsEnumerable.call(t,r)&&(n[r]=t[r])}return n}function Yvt(t,e){if(t==null)return{};var n={},r=Object.keys(t),i,o;for(o=0;o<r.length;o++)i=r[o],!(e.indexOf(i)>=0)&&(n[i]=t[i]);return n}var gme={symbolCircle:vU,symbolCross:vvt,symbolDiamond:xvt,symbolSquare:bvt,symbolStar:Ovt,symbolTriangle:Cvt,symbolWye:Evt},Kvt=Math.PI/180,Zvt=function(e){var n="symbol".concat(dk(e));return gme[n]||vU},Jvt=function(e,n,r){if(n==="area")return e;switch(r){case"cross":return 5*e*e/9;case"diamond":return .5*e*e/Math.sqrt(3);case"square":return e*e;case"star":{var i=18*Kvt;return 1.25*e*e*(Math.tan(i)-Math.tan(i*2)*Math.pow(Math.tan(i),2))}case"triangle":return Math.sqrt(3)*e*e/4;case"wye":return(21-10*Math.sqrt(3))*e*e/8;default:return Math.PI*e*e/4}},eyt=function(e,n){gme["symbol".concat(dk(e))]=n},yU=function(e){var n=e.type,r=n===void 0?"circle":n,i=e.size,o=i===void 0?64:i,a=e.sizeType,s=a===void 0?"area":a,l=Qvt(e,Gvt),c=EX(EX({},l),{},{type:r,size:o,sizeType:s}),u=function(){var g=Zvt(r),v=Pvt().type(g).size(Jvt(o,s,r));return v()},f=c.className,d=c.cx,h=c.cy,p=jt(c,!0);return d===+d&&h===+h&&o===+o?ue.createElement("path",h$({},p,{className:ke("recharts-symbols",f),transform:"translate(".concat(d,", ").concat(h,")"),d:u()})):null};yU.registerSymbol=eyt;function yv(t){"@babel/helpers - typeof";return yv=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(e){return typeof e}:function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},yv(t)}function p$(){return p$=Object.assign?Object.assign.bind():function(t){for(var e=1;e<arguments.length;e++){var n=arguments[e];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(t[r]=n[r])}return t},p$.apply(this,arguments)}function PX(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(t,i).enumerable})),n.push.apply(n,r)}return n}function tyt(t){for(var e=1;e<arguments.length;e++){var n=arguments[e]!=null?arguments[e]:{};e%2?PX(Object(n),!0).forEach(function(r){w_(t,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):PX(Object(n)).forEach(function(r){Object.defineProperty(t,r,Object.getOwnPropertyDescriptor(n,r))})}return t}function nyt(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function ryt(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,yme(r.key),r)}}function iyt(t,e,n){return e&&ryt(t.prototype,e),Object.defineProperty(t,"prototype",{writable:!1}),t}function oyt(t,e,n){return e=VE(e),ayt(t,vme()?Reflect.construct(e,n||[],VE(t).constructor):e.apply(t,n))}function ayt(t,e){if(e&&(yv(e)==="object"||typeof e=="function"))return e;if(e!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return syt(t)}function syt(t){if(t===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}function vme(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch{}return(vme=function(){return!!t})()}function VE(t){return VE=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(n){return n.__proto__||Object.getPrototypeOf(n)},VE(t)}function lyt(t,e){if(typeof e!="function"&&e!==null)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&m$(t,e)}function m$(t,e){return m$=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(r,i){return r.__proto__=i,r},m$(t,e)}function w_(t,e,n){return e=yme(e),e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function yme(t){var e=cyt(t,"string");return yv(e)=="symbol"?e:String(e)}function cyt(t,e){if(yv(t)!="object"||!t)return t;var n=t[Symbol.toPrimitive];if(n!==void 0){var r=n.call(t,e||"default");if(yv(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}var La=32,xU=function(t){lyt(e,t);function e(){return nyt(this,e),oyt(this,e,arguments)}return iyt(e,[{key:"renderIcon",value:function(r){var i=this.props.inactiveColor,o=La/2,a=La/6,s=La/3,l=r.inactive?i:r.color;if(r.type==="plainline")return ue.createElement("line",{strokeWidth:4,fill:"none",stroke:l,strokeDasharray:r.payload.strokeDasharray,x1:0,y1:o,x2:La,y2:o,className:"recharts-legend-icon"});if(r.type==="line")return ue.createElement("path",{strokeWidth:4,fill:"none",stroke:l,d:"M0,".concat(o,"h").concat(s,`
            A`).concat(a,",").concat(a,",0,1,1,").concat(2*s,",").concat(o,`
            H`).concat(La,"M").concat(2*s,",").concat(o,`
            A`).concat(a,",").concat(a,",0,1,1,").concat(s,",").concat(o),className:"recharts-legend-icon"});if(r.type==="rect")return ue.createElement("path",{stroke:"none",fill:l,d:"M0,".concat(La/8,"h").concat(La,"v").concat(La*3/4,"h").concat(-La,"z"),className:"recharts-legend-icon"});if(ue.isValidElement(r.legendIcon)){var c=tyt({},r);return delete c.legendIcon,ue.cloneElement(r.legendIcon,c)}return ue.createElement(yU,{fill:l,cx:o,cy:o,size:La,sizeType:"diameter",type:r.type})}},{key:"renderItems",value:function(){var r=this,i=this.props,o=i.payload,a=i.iconSize,s=i.layout,l=i.formatter,c=i.inactiveColor,u={x:0,y:0,width:La,height:La},f={display:s==="horizontal"?"inline-block":"block",marginRight:10},d={display:"inline-block",verticalAlign:"middle",marginRight:4};return o.map(function(h,p){var m=h.formatter||l,g=ke(w_(w_({"recharts-legend-item":!0},"legend-item-".concat(p),!0),"inactive",h.inactive));if(h.type==="none")return null;var v=Bt(h.value)?null:h.value;ru(!Bt(h.value),`The name property is also required when using a function for the dataKey of a chart's cartesian components. Ex: <Bar name="Name of my Data"/>`);var y=h.inactive?c:h.color;return ue.createElement("li",p$({className:g,style:f,key:"legend-item-".concat(p)},FE(r.props,h,p)),ue.createElement(o$,{width:a,height:a,viewBox:u,style:d},r.renderIcon(h)),ue.createElement("span",{className:"recharts-legend-item-text",style:{color:y}},m?m(v,h,p):v))})}},{key:"render",value:function(){var r=this.props,i=r.payload,o=r.layout,a=r.align;if(!i||!i.length)return null;var s={padding:0,margin:0,textAlign:o==="horizontal"?a:"left"};return ue.createElement("ul",{className:"recharts-default-legend",style:s},this.renderItems())}}]),e}(M.PureComponent);w_(xU,"displayName","Legend");w_(xU,"defaultProps",{iconSize:14,layout:"horizontal",align:"center",verticalAlign:"middle",inactiveColor:"#ccc"});var uyt=ck;function fyt(){this.__data__=new uyt,this.size=0}var dyt=fyt;function hyt(t){var e=this.__data__,n=e.delete(t);return this.size=e.size,n}var pyt=hyt;function myt(t){return this.__data__.get(t)}var gyt=myt;function vyt(t){return this.__data__.has(t)}var yyt=vyt,xyt=ck,byt=lU,_yt=cU,wyt=200;function Syt(t,e){var n=this.__data__;if(n instanceof xyt){var r=n.__data__;if(!byt||r.length<wyt-1)return r.push([t,e]),this.size=++n.size,this;n=this.__data__=new _yt(r)}return n.set(t,e),this.size=n.size,this}var Oyt=Syt,Cyt=ck,Tyt=dyt,Eyt=pyt,Pyt=gyt,Myt=yyt,kyt=Oyt;function By(t){var e=this.__data__=new Cyt(t);this.size=e.size}By.prototype.clear=Tyt;By.prototype.delete=Eyt;By.prototype.get=Pyt;By.prototype.has=Myt;By.prototype.set=kyt;var xme=By,Ayt="__lodash_hash_undefined__";function Ryt(t){return this.__data__.set(t,Ayt),this}var Iyt=Ryt;function Dyt(t){return this.__data__.has(t)}var Lyt=Dyt,Nyt=cU,$yt=Iyt,Fyt=Lyt;function GE(t){var e=-1,n=t==null?0:t.length;for(this.__data__=new Nyt;++e<n;)this.add(t[e])}GE.prototype.add=GE.prototype.push=$yt;GE.prototype.has=Fyt;var bme=GE;function jyt(t,e){for(var n=-1,r=t==null?0:t.length;++n<r;)if(e(t[n],n,t))return!0;return!1}var _me=jyt;function Byt(t,e){return t.has(e)}var wme=Byt,zyt=bme,Uyt=_me,Wyt=wme,Vyt=1,Gyt=2;function Hyt(t,e,n,r,i,o){var a=n&Vyt,s=t.length,l=e.length;if(s!=l&&!(a&&l>s))return!1;var c=o.get(t),u=o.get(e);if(c&&u)return c==e&&u==t;var f=-1,d=!0,h=n&Gyt?new zyt:void 0;for(o.set(t,e),o.set(e,t);++f<s;){var p=t[f],m=e[f];if(r)var g=a?r(m,p,f,e,t,o):r(p,m,f,t,e,o);if(g!==void 0){if(g)continue;d=!1;break}if(h){if(!Uyt(e,function(v,y){if(!Wyt(h,y)&&(p===v||i(p,v,n,r,o)))return h.push(y)})){d=!1;break}}else if(!(p===m||i(p,m,n,r,o))){d=!1;break}}return o.delete(t),o.delete(e),d}var Sme=Hyt,qyt=dc,Xyt=qyt.Uint8Array,Qyt=Xyt;function Yyt(t){var e=-1,n=Array(t.size);return t.forEach(function(r,i){n[++e]=[i,r]}),n}var Kyt=Yyt;function Zyt(t){var e=-1,n=Array(t.size);return t.forEach(function(r){n[++e]=r}),n}var bU=Zyt,MX=Cw,kX=Qyt,Jyt=sU,e0t=Sme,t0t=Kyt,n0t=bU,r0t=1,i0t=2,o0t="[object Boolean]",a0t="[object Date]",s0t="[object Error]",l0t="[object Map]",c0t="[object Number]",u0t="[object RegExp]",f0t="[object Set]",d0t="[object String]",h0t="[object Symbol]",p0t="[object ArrayBuffer]",m0t="[object DataView]",AX=MX?MX.prototype:void 0,vI=AX?AX.valueOf:void 0;function g0t(t,e,n,r,i,o,a){switch(n){case m0t:if(t.byteLength!=e.byteLength||t.byteOffset!=e.byteOffset)return!1;t=t.buffer,e=e.buffer;case p0t:return!(t.byteLength!=e.byteLength||!o(new kX(t),new kX(e)));case o0t:case a0t:case c0t:return Jyt(+t,+e);case s0t:return t.name==e.name&&t.message==e.message;case u0t:case d0t:return t==e+"";case l0t:var s=t0t;case f0t:var l=r&r0t;if(s||(s=n0t),t.size!=e.size&&!l)return!1;var c=a.get(t);if(c)return c==e;r|=i0t,a.set(t,e);var u=e0t(s(t),s(e),r,i,o,a);return a.delete(t),u;case h0t:if(vI)return vI.call(t)==vI.call(e)}return!1}var v0t=g0t;function y0t(t,e){for(var n=-1,r=e.length,i=t.length;++n<r;)t[i+n]=e[n];return t}var Ome=y0t,x0t=Ome,b0t=qo;function _0t(t,e,n){var r=e(t);return b0t(t)?r:x0t(r,n(t))}var w0t=_0t;function S0t(t,e){for(var n=-1,r=t==null?0:t.length,i=0,o=[];++n<r;){var a=t[n];e(a,n,t)&&(o[i++]=a)}return o}var O0t=S0t;function C0t(){return[]}var T0t=C0t,E0t=O0t,P0t=T0t,M0t=Object.prototype,k0t=M0t.propertyIsEnumerable,RX=Object.getOwnPropertySymbols,A0t=RX?function(t){return t==null?[]:(t=Object(t),E0t(RX(t),function(e){return k0t.call(t,e)}))}:P0t,R0t=A0t;function I0t(t,e){for(var n=-1,r=Array(t);++n<t;)r[n]=e(n);return r}var D0t=I0t,L0t=Ou,N0t=Cu,$0t="[object Arguments]";function F0t(t){return N0t(t)&&L0t(t)==$0t}var j0t=F0t,IX=j0t,B0t=Cu,Cme=Object.prototype,z0t=Cme.hasOwnProperty,U0t=Cme.propertyIsEnumerable,W0t=IX(function(){return arguments}())?IX:function(t){return B0t(t)&&z0t.call(t,"callee")&&!U0t.call(t,"callee")},_U=W0t,HE={exports:{}};function V0t(){return!1}var G0t=V0t;HE.exports;(function(t,e){var n=dc,r=G0t,i=e&&!e.nodeType&&e,o=i&&!0&&t&&!t.nodeType&&t,a=o&&o.exports===i,s=a?n.Buffer:void 0,l=s?s.isBuffer:void 0,c=l||r;t.exports=c})(HE,HE.exports);var Tme=HE.exports,H0t=9007199254740991,q0t=/^(?:0|[1-9]\d*)$/;function X0t(t,e){var n=typeof t;return e=e??H0t,!!e&&(n=="number"||n!="symbol"&&q0t.test(t))&&t>-1&&t%1==0&&t<e}var wU=X0t,Q0t=9007199254740991;function Y0t(t){return typeof t=="number"&&t>-1&&t%1==0&&t<=Q0t}var SU=Y0t,K0t=Ou,Z0t=SU,J0t=Cu,ext="[object Arguments]",txt="[object Array]",nxt="[object Boolean]",rxt="[object Date]",ixt="[object Error]",oxt="[object Function]",axt="[object Map]",sxt="[object Number]",lxt="[object Object]",cxt="[object RegExp]",uxt="[object Set]",fxt="[object String]",dxt="[object WeakMap]",hxt="[object ArrayBuffer]",pxt="[object DataView]",mxt="[object Float32Array]",gxt="[object Float64Array]",vxt="[object Int8Array]",yxt="[object Int16Array]",xxt="[object Int32Array]",bxt="[object Uint8Array]",_xt="[object Uint8ClampedArray]",wxt="[object Uint16Array]",Sxt="[object Uint32Array]",Xn={};Xn[mxt]=Xn[gxt]=Xn[vxt]=Xn[yxt]=Xn[xxt]=Xn[bxt]=Xn[_xt]=Xn[wxt]=Xn[Sxt]=!0;Xn[ext]=Xn[txt]=Xn[hxt]=Xn[nxt]=Xn[pxt]=Xn[rxt]=Xn[ixt]=Xn[oxt]=Xn[axt]=Xn[sxt]=Xn[lxt]=Xn[cxt]=Xn[uxt]=Xn[fxt]=Xn[dxt]=!1;function Oxt(t){return J0t(t)&&Z0t(t.length)&&!!Xn[K0t(t)]}var Cxt=Oxt;function Txt(t){return function(e){return t(e)}}var Eme=Txt,qE={exports:{}};qE.exports;(function(t,e){var n=Npe,r=e&&!e.nodeType&&e,i=r&&!0&&t&&!t.nodeType&&t,o=i&&i.exports===r,a=o&&n.process,s=function(){try{var l=i&&i.require&&i.require("util").types;return l||a&&a.binding&&a.binding("util")}catch{}}();t.exports=s})(qE,qE.exports);var Ext=qE.exports,Pxt=Cxt,Mxt=Eme,DX=Ext,LX=DX&&DX.isTypedArray,kxt=LX?Mxt(LX):Pxt,Pme=kxt,Axt=D0t,Rxt=_U,Ixt=qo,Dxt=Tme,Lxt=wU,Nxt=Pme,$xt=Object.prototype,Fxt=$xt.hasOwnProperty;function jxt(t,e){var n=Ixt(t),r=!n&&Rxt(t),i=!n&&!r&&Dxt(t),o=!n&&!r&&!i&&Nxt(t),a=n||r||i||o,s=a?Axt(t.length,String):[],l=s.length;for(var c in t)(e||Fxt.call(t,c))&&!(a&&(c=="length"||i&&(c=="offset"||c=="parent")||o&&(c=="buffer"||c=="byteLength"||c=="byteOffset")||Lxt(c,l)))&&s.push(c);return s}var Bxt=jxt,zxt=Object.prototype;function Uxt(t){var e=t&&t.constructor,n=typeof e=="function"&&e.prototype||zxt;return t===n}var Wxt=Uxt;function Vxt(t,e){return function(n){return t(e(n))}}var Mme=Vxt,Gxt=Mme,Hxt=Gxt(Object.keys,Object),qxt=Hxt,Xxt=Wxt,Qxt=qxt,Yxt=Object.prototype,Kxt=Yxt.hasOwnProperty;function Zxt(t){if(!Xxt(t))return Qxt(t);var e=[];for(var n in Object(t))Kxt.call(t,n)&&n!="constructor"&&e.push(n);return e}var Jxt=Zxt,ebt=aU,tbt=SU;function nbt(t){return t!=null&&tbt(t.length)&&!ebt(t)}var Ew=nbt,rbt=Bxt,ibt=Jxt,obt=Ew;function abt(t){return obt(t)?rbt(t):ibt(t)}var gk=abt,sbt=w0t,lbt=R0t,cbt=gk;function ubt(t){return sbt(t,cbt,lbt)}var fbt=ubt,NX=fbt,dbt=1,hbt=Object.prototype,pbt=hbt.hasOwnProperty;function mbt(t,e,n,r,i,o){var a=n&dbt,s=NX(t),l=s.length,c=NX(e),u=c.length;if(l!=u&&!a)return!1;for(var f=l;f--;){var d=s[f];if(!(a?d in e:pbt.call(e,d)))return!1}var h=o.get(t),p=o.get(e);if(h&&p)return h==e&&p==t;var m=!0;o.set(t,e),o.set(e,t);for(var g=a;++f<l;){d=s[f];var v=t[d],y=e[d];if(r)var x=a?r(y,v,d,e,t,o):r(v,y,d,t,e,o);if(!(x===void 0?v===y||i(v,y,n,r,o):x)){m=!1;break}g||(g=d=="constructor")}if(m&&!g){var b=t.constructor,_=e.constructor;b!=_&&"constructor"in t&&"constructor"in e&&!(typeof b=="function"&&b instanceof b&&typeof _=="function"&&_ instanceof _)&&(m=!1)}return o.delete(t),o.delete(e),m}var gbt=mbt,vbt=jp,ybt=dc,xbt=vbt(ybt,"DataView"),bbt=xbt,_bt=jp,wbt=dc,Sbt=_bt(wbt,"Promise"),Obt=Sbt,Cbt=jp,Tbt=dc,Ebt=Cbt(Tbt,"Set"),kme=Ebt,Pbt=jp,Mbt=dc,kbt=Pbt(Mbt,"WeakMap"),Abt=kbt,g$=bbt,v$=lU,y$=Obt,x$=kme,b$=Abt,Ame=Ou,zy=Fpe,$X="[object Map]",Rbt="[object Object]",FX="[object Promise]",jX="[object Set]",BX="[object WeakMap]",zX="[object DataView]",Ibt=zy(g$),Dbt=zy(v$),Lbt=zy(y$),Nbt=zy(x$),$bt=zy(b$),th=Ame;(g$&&th(new g$(new ArrayBuffer(1)))!=zX||v$&&th(new v$)!=$X||y$&&th(y$.resolve())!=FX||x$&&th(new x$)!=jX||b$&&th(new b$)!=BX)&&(th=function(t){var e=Ame(t),n=e==Rbt?t.constructor:void 0,r=n?zy(n):"";if(r)switch(r){case Ibt:return zX;case Dbt:return $X;case Lbt:return FX;case Nbt:return jX;case $bt:return BX}return e});var Fbt=th,yI=xme,jbt=Sme,Bbt=v0t,zbt=gbt,UX=Fbt,WX=qo,VX=Tme,Ubt=Pme,Wbt=1,GX="[object Arguments]",HX="[object Array]",gO="[object Object]",Vbt=Object.prototype,qX=Vbt.hasOwnProperty;function Gbt(t,e,n,r,i,o){var a=WX(t),s=WX(e),l=a?HX:UX(t),c=s?HX:UX(e);l=l==GX?gO:l,c=c==GX?gO:c;var u=l==gO,f=c==gO,d=l==c;if(d&&VX(t)){if(!VX(e))return!1;a=!0,u=!1}if(d&&!u)return o||(o=new yI),a||Ubt(t)?jbt(t,e,n,r,i,o):Bbt(t,e,l,n,r,i,o);if(!(n&Wbt)){var h=u&&qX.call(t,"__wrapped__"),p=f&&qX.call(e,"__wrapped__");if(h||p){var m=h?t.value():t,g=p?e.value():e;return o||(o=new yI),i(m,g,n,r,o)}}return d?(o||(o=new yI),zbt(t,e,n,r,i,o)):!1}var Hbt=Gbt,qbt=Hbt,XX=Cu;function Rme(t,e,n,r,i){return t===e?!0:t==null||e==null||!XX(t)&&!XX(e)?t!==t&&e!==e:qbt(t,e,n,r,Rme,i)}var OU=Rme,Xbt=xme,Qbt=OU,Ybt=1,Kbt=2;function Zbt(t,e,n,r){var i=n.length,o=i,a=!r;if(t==null)return!o;for(t=Object(t);i--;){var s=n[i];if(a&&s[2]?s[1]!==t[s[0]]:!(s[0]in t))return!1}for(;++i<o;){s=n[i];var l=s[0],c=t[l],u=s[1];if(a&&s[2]){if(c===void 0&&!(l in t))return!1}else{var f=new Xbt;if(r)var d=r(c,u,l,t,e,f);if(!(d===void 0?Qbt(u,c,Ybt|Kbt,r,f):d))return!1}}return!0}var Jbt=Zbt,e_t=Md;function t_t(t){return t===t&&!e_t(t)}var Ime=t_t,n_t=Ime,r_t=gk;function i_t(t){for(var e=r_t(t),n=e.length;n--;){var r=e[n],i=t[r];e[n]=[r,i,n_t(i)]}return e}var o_t=i_t;function a_t(t,e){return function(n){return n==null?!1:n[t]===e&&(e!==void 0||t in Object(n))}}var Dme=a_t,s_t=Jbt,l_t=o_t,c_t=Dme;function u_t(t){var e=l_t(t);return e.length==1&&e[0][2]?c_t(e[0][0],e[0][1]):function(n){return n===t||s_t(n,t,e)}}var f_t=u_t;function d_t(t,e){return t!=null&&e in Object(t)}var h_t=d_t,p_t=Wpe,m_t=_U,g_t=qo,v_t=wU,y_t=SU,x_t=fk;function b_t(t,e,n){e=p_t(e,t);for(var r=-1,i=e.length,o=!1;++r<i;){var a=x_t(e[r]);if(!(o=t!=null&&n(t,a)))break;t=t[a]}return o||++r!=i?o:(i=t==null?0:t.length,!!i&&y_t(i)&&v_t(a,i)&&(g_t(t)||m_t(t)))}var __t=b_t,w_t=h_t,S_t=__t;function O_t(t,e){return t!=null&&S_t(t,e,w_t)}var C_t=O_t,T_t=OU,E_t=Vpe,P_t=C_t,M_t=oU,k_t=Ime,A_t=Dme,R_t=fk,I_t=1,D_t=2;function L_t(t,e){return M_t(t)&&k_t(e)?A_t(R_t(t),e):function(n){var r=E_t(n,t);return r===void 0&&r===e?P_t(n,t):T_t(e,r,I_t|D_t)}}var N_t=L_t;function $_t(t){return t}var Uy=$_t;function F_t(t){return function(e){return e==null?void 0:e[t]}}var j_t=F_t,B_t=dU;function z_t(t){return function(e){return B_t(e,t)}}var U_t=z_t,W_t=j_t,V_t=U_t,G_t=oU,H_t=fk;function q_t(t){return G_t(t)?W_t(H_t(t)):V_t(t)}var X_t=q_t,Q_t=f_t,Y_t=N_t,K_t=Uy,Z_t=qo,J_t=X_t;function e1t(t){return typeof t=="function"?t:t==null?K_t:typeof t=="object"?Z_t(t)?Y_t(t[0],t[1]):Q_t(t):J_t(t)}var kd=e1t;function t1t(t,e,n,r){for(var i=t.length,o=n+(r?1:-1);r?o--:++o<i;)if(e(t[o],o,t))return o;return-1}var Lme=t1t;function n1t(t){return t!==t}var r1t=n1t;function i1t(t,e,n){for(var r=n-1,i=t.length;++r<i;)if(t[r]===e)return r;return-1}var o1t=i1t,a1t=Lme,s1t=r1t,l1t=o1t;function c1t(t,e,n){return e===e?l1t(t,e,n):a1t(t,s1t,n)}var u1t=c1t,f1t=u1t;function d1t(t,e){var n=t==null?0:t.length;return!!n&&f1t(t,e,0)>-1}var h1t=d1t;function p1t(t,e,n){for(var r=-1,i=t==null?0:t.length;++r<i;)if(n(e,t[r]))return!0;return!1}var m1t=p1t;function g1t(){}var v1t=g1t,xI=kme,y1t=v1t,x1t=bU,b1t=1/0,_1t=xI&&1/x1t(new xI([,-0]))[1]==b1t?function(t){return new xI(t)}:y1t,w1t=_1t,S1t=bme,O1t=h1t,C1t=m1t,T1t=wme,E1t=w1t,P1t=bU,M1t=200;function k1t(t,e,n){var r=-1,i=O1t,o=t.length,a=!0,s=[],l=s;if(n)a=!1,i=C1t;else if(o>=M1t){var c=e?null:E1t(t);if(c)return P1t(c);a=!1,i=T1t,l=new S1t}else l=e?[]:s;e:for(;++r<o;){var u=t[r],f=e?e(u):u;if(u=n||u!==0?u:0,a&&f===f){for(var d=l.length;d--;)if(l[d]===f)continue e;e&&l.push(f),s.push(u)}else i(l,f,n)||(l!==s&&l.push(f),s.push(u))}return s}var A1t=k1t,R1t=kd,I1t=A1t;function D1t(t,e){return t&&t.length?I1t(t,R1t(e)):[]}var L1t=D1t;const QX=$t(L1t);function Nme(t,e,n){return e===!0?QX(t,n):Bt(e)?QX(t,e):t}function xv(t){"@babel/helpers - typeof";return xv=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(e){return typeof e}:function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},xv(t)}var N1t=["ref"];function YX(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(t,i).enumerable})),n.push.apply(n,r)}return n}function Vd(t){for(var e=1;e<arguments.length;e++){var n=arguments[e]!=null?arguments[e]:{};e%2?YX(Object(n),!0).forEach(function(r){vk(t,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):YX(Object(n)).forEach(function(r){Object.defineProperty(t,r,Object.getOwnPropertyDescriptor(n,r))})}return t}function $1t(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function KX(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,jme(r.key),r)}}function F1t(t,e,n){return e&&KX(t.prototype,e),n&&KX(t,n),Object.defineProperty(t,"prototype",{writable:!1}),t}function j1t(t,e,n){return e=XE(e),B1t(t,$me()?Reflect.construct(e,n||[],XE(t).constructor):e.apply(t,n))}function B1t(t,e){if(e&&(xv(e)==="object"||typeof e=="function"))return e;if(e!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return Fme(t)}function $me(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch{}return($me=function(){return!!t})()}function XE(t){return XE=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(n){return n.__proto__||Object.getPrototypeOf(n)},XE(t)}function Fme(t){if(t===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}function z1t(t,e){if(typeof e!="function"&&e!==null)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&_$(t,e)}function _$(t,e){return _$=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(r,i){return r.__proto__=i,r},_$(t,e)}function vk(t,e,n){return e=jme(e),e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function jme(t){var e=U1t(t,"string");return xv(e)=="symbol"?e:String(e)}function U1t(t,e){if(xv(t)!="object"||!t)return t;var n=t[Symbol.toPrimitive];if(n!==void 0){var r=n.call(t,e||"default");if(xv(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}function W1t(t,e){if(t==null)return{};var n=V1t(t,e),r,i;if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(t);for(i=0;i<o.length;i++)r=o[i],!(e.indexOf(r)>=0)&&Object.prototype.propertyIsEnumerable.call(t,r)&&(n[r]=t[r])}return n}function V1t(t,e){if(t==null)return{};var n={},r=Object.keys(t),i,o;for(o=0;o<r.length;o++)i=r[o],!(e.indexOf(i)>=0)&&(n[i]=t[i]);return n}function G1t(t){return t.value}function H1t(t,e){if(ue.isValidElement(t))return ue.cloneElement(t,e);if(typeof t=="function")return ue.createElement(t,e);e.ref;var n=W1t(e,N1t);return ue.createElement(xU,n)}var ZX=1,bv=function(t){z1t(e,t);function e(){var n;$1t(this,e);for(var r=arguments.length,i=new Array(r),o=0;o<r;o++)i[o]=arguments[o];return n=j1t(this,e,[].concat(i)),vk(Fme(n),"lastBoundingBox",{width:-1,height:-1}),n}return F1t(e,[{key:"componentDidMount",value:function(){this.updateBBox()}},{key:"componentDidUpdate",value:function(){this.updateBBox()}},{key:"getBBox",value:function(){if(this.wrapperNode&&this.wrapperNode.getBoundingClientRect){var r=this.wrapperNode.getBoundingClientRect();return r.height=this.wrapperNode.offsetHeight,r.width=this.wrapperNode.offsetWidth,r}return null}},{key:"updateBBox",value:function(){var r=this.props.onBBoxUpdate,i=this.getBBox();i?(Math.abs(i.width-this.lastBoundingBox.width)>ZX||Math.abs(i.height-this.lastBoundingBox.height)>ZX)&&(this.lastBoundingBox.width=i.width,this.lastBoundingBox.height=i.height,r&&r(i)):(this.lastBoundingBox.width!==-1||this.lastBoundingBox.height!==-1)&&(this.lastBoundingBox.width=-1,this.lastBoundingBox.height=-1,r&&r(null))}},{key:"getBBoxSnapshot",value:function(){return this.lastBoundingBox.width>=0&&this.lastBoundingBox.height>=0?Vd({},this.lastBoundingBox):{width:0,height:0}}},{key:"getDefaultPosition",value:function(r){var i=this.props,o=i.layout,a=i.align,s=i.verticalAlign,l=i.margin,c=i.chartWidth,u=i.chartHeight,f,d;if(!r||(r.left===void 0||r.left===null)&&(r.right===void 0||r.right===null))if(a==="center"&&o==="vertical"){var h=this.getBBoxSnapshot();f={left:((c||0)-h.width)/2}}else f=a==="right"?{right:l&&l.right||0}:{left:l&&l.left||0};if(!r||(r.top===void 0||r.top===null)&&(r.bottom===void 0||r.bottom===null))if(s==="middle"){var p=this.getBBoxSnapshot();d={top:((u||0)-p.height)/2}}else d=s==="bottom"?{bottom:l&&l.bottom||0}:{top:l&&l.top||0};return Vd(Vd({},f),d)}},{key:"render",value:function(){var r=this,i=this.props,o=i.content,a=i.width,s=i.height,l=i.wrapperStyle,c=i.payloadUniqBy,u=i.payload,f=Vd(Vd({position:"absolute",width:a||"auto",height:s||"auto"},this.getDefaultPosition(l)),l);return ue.createElement("div",{className:"recharts-legend-wrapper",style:f,ref:function(h){r.wrapperNode=h}},H1t(o,Vd(Vd({},this.props),{},{payload:Nme(u,c,G1t)})))}}],[{key:"getWithHeight",value:function(r,i){var o=r.props.layout;return o==="vertical"&&Ye(r.props.height)?{height:r.props.height}:o==="horizontal"?{width:r.props.width||i}:null}}]),e}(M.PureComponent);vk(bv,"displayName","Legend");vk(bv,"defaultProps",{iconSize:14,layout:"horizontal",align:"center",verticalAlign:"bottom"});var JX=Cw,q1t=_U,X1t=qo,eQ=JX?JX.isConcatSpreadable:void 0;function Q1t(t){return X1t(t)||q1t(t)||!!(eQ&&t&&t[eQ])}var Y1t=Q1t,K1t=Ome,Z1t=Y1t;function Bme(t,e,n,r,i){var o=-1,a=t.length;for(n||(n=Z1t),i||(i=[]);++o<a;){var s=t[o];e>0&&n(s)?e>1?Bme(s,e-1,n,r,i):K1t(i,s):r||(i[i.length]=s)}return i}var zme=Bme;function J1t(t){return function(e,n,r){for(var i=-1,o=Object(e),a=r(e),s=a.length;s--;){var l=a[t?s:++i];if(n(o[l],l,o)===!1)break}return e}}var ewt=J1t,twt=ewt,nwt=twt(),rwt=nwt,iwt=rwt,owt=gk;function awt(t,e){return t&&iwt(t,e,owt)}var Ume=awt,swt=Ew;function lwt(t,e){return function(n,r){if(n==null)return n;if(!swt(n))return t(n,r);for(var i=n.length,o=e?i:-1,a=Object(n);(e?o--:++o<i)&&r(a[o],o,a)!==!1;);return n}}var cwt=lwt,uwt=Ume,fwt=cwt,dwt=fwt(uwt),CU=dwt,hwt=CU,pwt=Ew;function mwt(t,e){var n=-1,r=pwt(t)?Array(t.length):[];return hwt(t,function(i,o,a){r[++n]=e(i,o,a)}),r}var Wme=mwt;function gwt(t,e){var n=t.length;for(t.sort(e);n--;)t[n]=t[n].value;return t}var vwt=gwt,tQ=Iy;function ywt(t,e){if(t!==e){var n=t!==void 0,r=t===null,i=t===t,o=tQ(t),a=e!==void 0,s=e===null,l=e===e,c=tQ(e);if(!s&&!c&&!o&&t>e||o&&a&&l&&!s&&!c||r&&a&&l||!n&&l||!i)return 1;if(!r&&!o&&!c&&t<e||c&&n&&i&&!r&&!o||s&&n&&i||!a&&i||!l)return-1}return 0}var xwt=ywt,bwt=xwt;function _wt(t,e,n){for(var r=-1,i=t.criteria,o=e.criteria,a=i.length,s=n.length;++r<a;){var l=bwt(i[r],o[r]);if(l){if(r>=s)return l;var c=n[r];return l*(c=="desc"?-1:1)}}return t.index-e.index}var wwt=_wt,bI=fU,Swt=dU,Owt=kd,Cwt=Wme,Twt=vwt,Ewt=Eme,Pwt=wwt,Mwt=Uy,kwt=qo;function Awt(t,e,n){e.length?e=bI(e,function(o){return kwt(o)?function(a){return Swt(a,o.length===1?o[0]:o)}:o}):e=[Mwt];var r=-1;e=bI(e,Ewt(Owt));var i=Cwt(t,function(o,a,s){var l=bI(e,function(c){return c(o)});return{criteria:l,index:++r,value:o}});return Twt(i,function(o,a){return Pwt(o,a,n)})}var Rwt=Awt;function Iwt(t,e,n){switch(n.length){case 0:return t.call(e);case 1:return t.call(e,n[0]);case 2:return t.call(e,n[0],n[1]);case 3:return t.call(e,n[0],n[1],n[2])}return t.apply(e,n)}var Dwt=Iwt,Lwt=Dwt,nQ=Math.max;function Nwt(t,e,n){return e=nQ(e===void 0?t.length-1:e,0),function(){for(var r=arguments,i=-1,o=nQ(r.length-e,0),a=Array(o);++i<o;)a[i]=r[e+i];i=-1;for(var s=Array(e+1);++i<e;)s[i]=r[i];return s[e]=n(a),Lwt(t,this,s)}}var $wt=Nwt;function Fwt(t){return function(){return t}}var jwt=Fwt,Bwt=jp,zwt=function(){try{var t=Bwt(Object,"defineProperty");return t({},"",{}),t}catch{}}(),Vme=zwt,Uwt=jwt,rQ=Vme,Wwt=Uy,Vwt=rQ?function(t,e){return rQ(t,"toString",{configurable:!0,enumerable:!1,value:Uwt(e),writable:!0})}:Wwt,Gwt=Vwt,Hwt=800,qwt=16,Xwt=Date.now;function Qwt(t){var e=0,n=0;return function(){var r=Xwt(),i=qwt-(r-n);if(n=r,i>0){if(++e>=Hwt)return arguments[0]}else e=0;return t.apply(void 0,arguments)}}var Ywt=Qwt,Kwt=Gwt,Zwt=Ywt,Jwt=Zwt(Kwt),eSt=Jwt,tSt=Uy,nSt=$wt,rSt=eSt;function iSt(t,e){return rSt(nSt(t,e,tSt),t+"")}var oSt=iSt,aSt=sU,sSt=Ew,lSt=wU,cSt=Md;function uSt(t,e,n){if(!cSt(n))return!1;var r=typeof e;return(r=="number"?sSt(n)&&lSt(e,n.length):r=="string"&&e in n)?aSt(n[e],t):!1}var yk=uSt,fSt=zme,dSt=Rwt,hSt=oSt,iQ=yk,pSt=hSt(function(t,e){if(t==null)return[];var n=e.length;return n>1&&iQ(t,e[0],e[1])?e=[]:n>2&&iQ(e[0],e[1],e[2])&&(e=[e[0]]),dSt(t,fSt(e,1),[])}),mSt=pSt;const TU=$t(mSt);function S_(t){"@babel/helpers - typeof";return S_=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(e){return typeof e}:function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},S_(t)}function w$(){return w$=Object.assign?Object.assign.bind():function(t){for(var e=1;e<arguments.length;e++){var n=arguments[e];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(t[r]=n[r])}return t},w$.apply(this,arguments)}function gSt(t,e){return bSt(t)||xSt(t,e)||ySt(t,e)||vSt()}function vSt(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function ySt(t,e){if(t){if(typeof t=="string")return oQ(t,e);var n=Object.prototype.toString.call(t).slice(8,-1);if(n==="Object"&&t.constructor&&(n=t.constructor.name),n==="Map"||n==="Set")return Array.from(t);if(n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return oQ(t,e)}}function oQ(t,e){(e==null||e>t.length)&&(e=t.length);for(var n=0,r=new Array(e);n<e;n++)r[n]=t[n];return r}function xSt(t,e){var n=t==null?null:typeof Symbol<"u"&&t[Symbol.iterator]||t["@@iterator"];if(n!=null){var r,i,o,a,s=[],l=!0,c=!1;try{if(o=(n=n.call(t)).next,e!==0)for(;!(l=(r=o.call(n)).done)&&(s.push(r.value),s.length!==e);l=!0);}catch(u){c=!0,i=u}finally{try{if(!l&&n.return!=null&&(a=n.return(),Object(a)!==a))return}finally{if(c)throw i}}return s}}function bSt(t){if(Array.isArray(t))return t}function aQ(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(t,i).enumerable})),n.push.apply(n,r)}return n}function _I(t){for(var e=1;e<arguments.length;e++){var n=arguments[e]!=null?arguments[e]:{};e%2?aQ(Object(n),!0).forEach(function(r){_St(t,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):aQ(Object(n)).forEach(function(r){Object.defineProperty(t,r,Object.getOwnPropertyDescriptor(n,r))})}return t}function _St(t,e,n){return e=wSt(e),e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function wSt(t){var e=SSt(t,"string");return S_(e)=="symbol"?e:String(e)}function SSt(t,e){if(S_(t)!="object"||!t)return t;var n=t[Symbol.toPrimitive];if(n!==void 0){var r=n.call(t,e||"default");if(S_(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}function OSt(t){return Array.isArray(t)&&ti(t[0])&&ti(t[1])?t.join(" ~ "):t}var CSt=function(e){var n=e.separator,r=n===void 0?" : ":n,i=e.contentStyle,o=i===void 0?{}:i,a=e.itemStyle,s=a===void 0?{}:a,l=e.labelStyle,c=l===void 0?{}:l,u=e.payload,f=e.formatter,d=e.itemSorter,h=e.wrapperClassName,p=e.labelClassName,m=e.label,g=e.labelFormatter,v=e.accessibilityLayer,y=v===void 0?!1:v,x=function(){if(u&&u.length){var P={padding:0,margin:0},R=(d?TU(u,d):u).map(function(T,L){if(T.type==="none")return null;var z=_I({display:"block",paddingTop:4,paddingBottom:4,color:T.color||"#000"},s),B=T.formatter||f||OSt,U=T.value,W=T.name,$=U,N=W;if(B&&$!=null&&N!=null){var D=B(U,W,T,L,u);if(Array.isArray(D)){var A=gSt(D,2);$=A[0],N=A[1]}else $=D}return ue.createElement("li",{className:"recharts-tooltip-item",key:"tooltip-item-".concat(L),style:z},ti(N)?ue.createElement("span",{className:"recharts-tooltip-item-name"},N):null,ti(N)?ue.createElement("span",{className:"recharts-tooltip-item-separator"},r):null,ue.createElement("span",{className:"recharts-tooltip-item-value"},$),ue.createElement("span",{className:"recharts-tooltip-item-unit"},T.unit||""))});return ue.createElement("ul",{className:"recharts-tooltip-item-list",style:P},R)}return null},b=_I({margin:0,padding:10,backgroundColor:"#fff",border:"1px solid #ccc",whiteSpace:"nowrap"},o),_=_I({margin:0},c),S=!Wt(m),O=S?m:"",C=ke("recharts-default-tooltip",h),E=ke("recharts-tooltip-label",p);S&&g&&u!==void 0&&u!==null&&(O=g(m,u));var k=y?{role:"status","aria-live":"assertive"}:{};return ue.createElement("div",w$({className:C,style:b},k),ue.createElement("p",{className:E,style:_},ue.isValidElement(O)?O:"".concat(O)),x())};function O_(t){"@babel/helpers - typeof";return O_=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(e){return typeof e}:function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},O_(t)}function vO(t,e,n){return e=TSt(e),e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function TSt(t){var e=ESt(t,"string");return O_(e)=="symbol"?e:String(e)}function ESt(t,e){if(O_(t)!="object"||!t)return t;var n=t[Symbol.toPrimitive];if(n!==void 0){var r=n.call(t,e||"default");if(O_(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}var F0="recharts-tooltip-wrapper",PSt={visibility:"hidden"};function MSt(t){var e=t.coordinate,n=t.translateX,r=t.translateY;return ke(F0,vO(vO(vO(vO({},"".concat(F0,"-right"),Ye(n)&&e&&Ye(e.x)&&n>=e.x),"".concat(F0,"-left"),Ye(n)&&e&&Ye(e.x)&&n<e.x),"".concat(F0,"-bottom"),Ye(r)&&e&&Ye(e.y)&&r>=e.y),"".concat(F0,"-top"),Ye(r)&&e&&Ye(e.y)&&r<e.y))}function sQ(t){var e=t.allowEscapeViewBox,n=t.coordinate,r=t.key,i=t.offsetTopLeft,o=t.position,a=t.reverseDirection,s=t.tooltipDimension,l=t.viewBox,c=t.viewBoxDimension;if(o&&Ye(o[r]))return o[r];var u=n[r]-s-i,f=n[r]+i;if(e[r])return a[r]?u:f;if(a[r]){var d=u,h=l[r];return d<h?Math.max(f,l[r]):Math.max(u,l[r])}var p=f+s,m=l[r]+c;return p>m?Math.max(u,l[r]):Math.max(f,l[r])}function kSt(t){var e=t.translateX,n=t.translateY,r=t.useTranslate3d;return{transform:r?"translate3d(".concat(e,"px, ").concat(n,"px, 0)"):"translate(".concat(e,"px, ").concat(n,"px)")}}function ASt(t){var e=t.allowEscapeViewBox,n=t.coordinate,r=t.offsetTopLeft,i=t.position,o=t.reverseDirection,a=t.tooltipBox,s=t.useTranslate3d,l=t.viewBox,c,u,f;return a.height>0&&a.width>0&&n?(u=sQ({allowEscapeViewBox:e,coordinate:n,key:"x",offsetTopLeft:r,position:i,reverseDirection:o,tooltipDimension:a.width,viewBox:l,viewBoxDimension:l.width}),f=sQ({allowEscapeViewBox:e,coordinate:n,key:"y",offsetTopLeft:r,position:i,reverseDirection:o,tooltipDimension:a.height,viewBox:l,viewBoxDimension:l.height}),c=kSt({translateX:u,translateY:f,useTranslate3d:s})):c=PSt,{cssProperties:c,cssClasses:MSt({translateX:u,translateY:f,coordinate:n})}}function _v(t){"@babel/helpers - typeof";return _v=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(e){return typeof e}:function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},_v(t)}function lQ(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(t,i).enumerable})),n.push.apply(n,r)}return n}function cQ(t){for(var e=1;e<arguments.length;e++){var n=arguments[e]!=null?arguments[e]:{};e%2?lQ(Object(n),!0).forEach(function(r){C$(t,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):lQ(Object(n)).forEach(function(r){Object.defineProperty(t,r,Object.getOwnPropertyDescriptor(n,r))})}return t}function RSt(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function ISt(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,Hme(r.key),r)}}function DSt(t,e,n){return e&&ISt(t.prototype,e),Object.defineProperty(t,"prototype",{writable:!1}),t}function LSt(t,e,n){return e=QE(e),NSt(t,Gme()?Reflect.construct(e,n||[],QE(t).constructor):e.apply(t,n))}function NSt(t,e){if(e&&(_v(e)==="object"||typeof e=="function"))return e;if(e!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return S$(t)}function Gme(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch{}return(Gme=function(){return!!t})()}function QE(t){return QE=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(n){return n.__proto__||Object.getPrototypeOf(n)},QE(t)}function S$(t){if(t===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}function $St(t,e){if(typeof e!="function"&&e!==null)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&O$(t,e)}function O$(t,e){return O$=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(r,i){return r.__proto__=i,r},O$(t,e)}function C$(t,e,n){return e=Hme(e),e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function Hme(t){var e=FSt(t,"string");return _v(e)=="symbol"?e:String(e)}function FSt(t,e){if(_v(t)!="object"||!t)return t;var n=t[Symbol.toPrimitive];if(n!==void 0){var r=n.call(t,e||"default");if(_v(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}var uQ=1,jSt=function(t){$St(e,t);function e(){var n;RSt(this,e);for(var r=arguments.length,i=new Array(r),o=0;o<r;o++)i[o]=arguments[o];return n=LSt(this,e,[].concat(i)),C$(S$(n),"state",{dismissed:!1,dismissedAtCoordinate:{x:0,y:0},lastBoundingBox:{width:-1,height:-1}}),C$(S$(n),"handleKeyDown",function(a){if(a.key==="Escape"){var s,l,c,u;n.setState({dismissed:!0,dismissedAtCoordinate:{x:(s=(l=n.props.coordinate)===null||l===void 0?void 0:l.x)!==null&&s!==void 0?s:0,y:(c=(u=n.props.coordinate)===null||u===void 0?void 0:u.y)!==null&&c!==void 0?c:0}})}}),n}return DSt(e,[{key:"updateBBox",value:function(){if(this.wrapperNode&&this.wrapperNode.getBoundingClientRect){var r=this.wrapperNode.getBoundingClientRect();(Math.abs(r.width-this.state.lastBoundingBox.width)>uQ||Math.abs(r.height-this.state.lastBoundingBox.height)>uQ)&&this.setState({lastBoundingBox:{width:r.width,height:r.height}})}else(this.state.lastBoundingBox.width!==-1||this.state.lastBoundingBox.height!==-1)&&this.setState({lastBoundingBox:{width:-1,height:-1}})}},{key:"componentDidMount",value:function(){document.addEventListener("keydown",this.handleKeyDown),this.updateBBox()}},{key:"componentWillUnmount",value:function(){document.removeEventListener("keydown",this.handleKeyDown)}},{key:"componentDidUpdate",value:function(){var r,i;this.props.active&&this.updateBBox(),this.state.dismissed&&(((r=this.props.coordinate)===null||r===void 0?void 0:r.x)!==this.state.dismissedAtCoordinate.x||((i=this.props.coordinate)===null||i===void 0?void 0:i.y)!==this.state.dismissedAtCoordinate.y)&&(this.state.dismissed=!1)}},{key:"render",value:function(){var r=this,i=this.props,o=i.active,a=i.allowEscapeViewBox,s=i.animationDuration,l=i.animationEasing,c=i.children,u=i.coordinate,f=i.hasPayload,d=i.isAnimationActive,h=i.offset,p=i.position,m=i.reverseDirection,g=i.useTranslate3d,v=i.viewBox,y=i.wrapperStyle,x=ASt({allowEscapeViewBox:a,coordinate:u,offsetTopLeft:h,position:p,reverseDirection:m,tooltipBox:this.state.lastBoundingBox,useTranslate3d:g,viewBox:v}),b=x.cssClasses,_=x.cssProperties,S=cQ(cQ({transition:d&&o?"transform ".concat(s,"ms ").concat(l):void 0},_),{},{pointerEvents:"none",visibility:!this.state.dismissed&&o&&f?"visible":"hidden",position:"absolute",top:0,left:0},y);return ue.createElement("div",{tabIndex:-1,className:b,style:S,ref:function(C){r.wrapperNode=C}},c)}}]),e}(M.PureComponent),BSt=function(){return!(typeof window<"u"&&window.document&&window.document.createElement&&window.setTimeout)},Yl={isSsr:BSt(),get:function(e){return Yl[e]},set:function(e,n){if(typeof e=="string")Yl[e]=n;else{var r=Object.keys(e);r&&r.length&&r.forEach(function(i){Yl[i]=e[i]})}}};function wv(t){"@babel/helpers - typeof";return wv=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(e){return typeof e}:function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},wv(t)}function fQ(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(t,i).enumerable})),n.push.apply(n,r)}return n}function dQ(t){for(var e=1;e<arguments.length;e++){var n=arguments[e]!=null?arguments[e]:{};e%2?fQ(Object(n),!0).forEach(function(r){EU(t,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):fQ(Object(n)).forEach(function(r){Object.defineProperty(t,r,Object.getOwnPropertyDescriptor(n,r))})}return t}function zSt(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function USt(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,Xme(r.key),r)}}function WSt(t,e,n){return e&&USt(t.prototype,e),Object.defineProperty(t,"prototype",{writable:!1}),t}function VSt(t,e,n){return e=YE(e),GSt(t,qme()?Reflect.construct(e,n||[],YE(t).constructor):e.apply(t,n))}function GSt(t,e){if(e&&(wv(e)==="object"||typeof e=="function"))return e;if(e!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return HSt(t)}function HSt(t){if(t===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}function qme(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch{}return(qme=function(){return!!t})()}function YE(t){return YE=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(n){return n.__proto__||Object.getPrototypeOf(n)},YE(t)}function qSt(t,e){if(typeof e!="function"&&e!==null)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&T$(t,e)}function T$(t,e){return T$=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(r,i){return r.__proto__=i,r},T$(t,e)}function EU(t,e,n){return e=Xme(e),e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function Xme(t){var e=XSt(t,"string");return wv(e)=="symbol"?e:String(e)}function XSt(t,e){if(wv(t)!="object"||!t)return t;var n=t[Symbol.toPrimitive];if(n!==void 0){var r=n.call(t,e||"default");if(wv(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}function QSt(t){return t.dataKey}function YSt(t,e){return ue.isValidElement(t)?ue.cloneElement(t,e):typeof t=="function"?ue.createElement(t,e):ue.createElement(CSt,e)}var yl=function(t){qSt(e,t);function e(){return zSt(this,e),VSt(this,e,arguments)}return WSt(e,[{key:"render",value:function(){var r=this,i=this.props,o=i.active,a=i.allowEscapeViewBox,s=i.animationDuration,l=i.animationEasing,c=i.content,u=i.coordinate,f=i.filterNull,d=i.isAnimationActive,h=i.offset,p=i.payload,m=i.payloadUniqBy,g=i.position,v=i.reverseDirection,y=i.useTranslate3d,x=i.viewBox,b=i.wrapperStyle,_=p??[];f&&_.length&&(_=Nme(p.filter(function(O){return O.value!=null&&(O.hide!==!0||r.props.includeHidden)}),m,QSt));var S=_.length>0;return ue.createElement(jSt,{allowEscapeViewBox:a,animationDuration:s,animationEasing:l,isAnimationActive:d,active:o,coordinate:u,hasPayload:S,offset:h,position:g,reverseDirection:v,useTranslate3d:y,viewBox:x,wrapperStyle:b},YSt(c,dQ(dQ({},this.props),{},{payload:_})))}}]),e}(M.PureComponent);EU(yl,"displayName","Tooltip");EU(yl,"defaultProps",{accessibilityLayer:!1,allowEscapeViewBox:{x:!1,y:!1},animationDuration:400,animationEasing:"ease",contentStyle:{},coordinate:{x:0,y:0},cursor:!0,cursorStyle:{},filterNull:!0,isAnimationActive:!Yl.isSsr,itemStyle:{},labelStyle:{},offset:10,reverseDirection:{x:!1,y:!1},separator:" : ",trigger:"hover",useTranslate3d:!1,viewBox:{x:0,y:0,height:0,width:0},wrapperStyle:{}});var KSt=dc,ZSt=function(){return KSt.Date.now()},JSt=ZSt,eOt=/\s/;function tOt(t){for(var e=t.length;e--&&eOt.test(t.charAt(e)););return e}var nOt=tOt,rOt=nOt,iOt=/^\s+/;function oOt(t){return t&&t.slice(0,rOt(t)+1).replace(iOt,"")}var aOt=oOt,sOt=aOt,hQ=Md,lOt=Iy,pQ=NaN,cOt=/^[-+]0x[0-9a-f]+$/i,uOt=/^0b[01]+$/i,fOt=/^0o[0-7]+$/i,dOt=parseInt;function hOt(t){if(typeof t=="number")return t;if(lOt(t))return pQ;if(hQ(t)){var e=typeof t.valueOf=="function"?t.valueOf():t;t=hQ(e)?e+"":e}if(typeof t!="string")return t===0?t:+t;t=sOt(t);var n=uOt.test(t);return n||fOt.test(t)?dOt(t.slice(2),n?2:8):cOt.test(t)?pQ:+t}var Qme=hOt,pOt=Md,wI=JSt,mQ=Qme,mOt="Expected a function",gOt=Math.max,vOt=Math.min;function yOt(t,e,n){var r,i,o,a,s,l,c=0,u=!1,f=!1,d=!0;if(typeof t!="function")throw new TypeError(mOt);e=mQ(e)||0,pOt(n)&&(u=!!n.leading,f="maxWait"in n,o=f?gOt(mQ(n.maxWait)||0,e):o,d="trailing"in n?!!n.trailing:d);function h(S){var O=r,C=i;return r=i=void 0,c=S,a=t.apply(C,O),a}function p(S){return c=S,s=setTimeout(v,e),u?h(S):a}function m(S){var O=S-l,C=S-c,E=e-O;return f?vOt(E,o-C):E}function g(S){var O=S-l,C=S-c;return l===void 0||O>=e||O<0||f&&C>=o}function v(){var S=wI();if(g(S))return y(S);s=setTimeout(v,m(S))}function y(S){return s=void 0,d&&r?h(S):(r=i=void 0,a)}function x(){s!==void 0&&clearTimeout(s),c=0,r=l=i=s=void 0}function b(){return s===void 0?a:y(wI())}function _(){var S=wI(),O=g(S);if(r=arguments,i=this,l=S,O){if(s===void 0)return p(l);if(f)return clearTimeout(s),s=setTimeout(v,e),h(l)}return s===void 0&&(s=setTimeout(v,e)),a}return _.cancel=x,_.flush=b,_}var xOt=yOt,bOt=xOt,_Ot=Md,wOt="Expected a function";function SOt(t,e,n){var r=!0,i=!0;if(typeof t!="function")throw new TypeError(wOt);return _Ot(n)&&(r="leading"in n?!!n.leading:r,i="trailing"in n?!!n.trailing:i),bOt(t,e,{leading:r,maxWait:e,trailing:i})}var OOt=SOt;const Yme=$t(OOt);function C_(t){"@babel/helpers - typeof";return C_=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(e){return typeof e}:function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},C_(t)}function gQ(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(t,i).enumerable})),n.push.apply(n,r)}return n}function yO(t){for(var e=1;e<arguments.length;e++){var n=arguments[e]!=null?arguments[e]:{};e%2?gQ(Object(n),!0).forEach(function(r){COt(t,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):gQ(Object(n)).forEach(function(r){Object.defineProperty(t,r,Object.getOwnPropertyDescriptor(n,r))})}return t}function COt(t,e,n){return e=TOt(e),e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function TOt(t){var e=EOt(t,"string");return C_(e)=="symbol"?e:String(e)}function EOt(t,e){if(C_(t)!="object"||!t)return t;var n=t[Symbol.toPrimitive];if(n!==void 0){var r=n.call(t,e||"default");if(C_(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}function POt(t,e){return ROt(t)||AOt(t,e)||kOt(t,e)||MOt()}function MOt(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function kOt(t,e){if(t){if(typeof t=="string")return vQ(t,e);var n=Object.prototype.toString.call(t).slice(8,-1);if(n==="Object"&&t.constructor&&(n=t.constructor.name),n==="Map"||n==="Set")return Array.from(t);if(n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return vQ(t,e)}}function vQ(t,e){(e==null||e>t.length)&&(e=t.length);for(var n=0,r=new Array(e);n<e;n++)r[n]=t[n];return r}function AOt(t,e){var n=t==null?null:typeof Symbol<"u"&&t[Symbol.iterator]||t["@@iterator"];if(n!=null){var r,i,o,a,s=[],l=!0,c=!1;try{if(o=(n=n.call(t)).next,e!==0)for(;!(l=(r=o.call(n)).done)&&(s.push(r.value),s.length!==e);l=!0);}catch(u){c=!0,i=u}finally{try{if(!l&&n.return!=null&&(a=n.return(),Object(a)!==a))return}finally{if(c)throw i}}return s}}function ROt(t){if(Array.isArray(t))return t}var Kme=M.forwardRef(function(t,e){var n=t.aspect,r=t.initialDimension,i=r===void 0?{width:-1,height:-1}:r,o=t.width,a=o===void 0?"100%":o,s=t.height,l=s===void 0?"100%":s,c=t.minWidth,u=c===void 0?0:c,f=t.minHeight,d=t.maxHeight,h=t.children,p=t.debounce,m=p===void 0?0:p,g=t.id,v=t.className,y=t.onResize,x=t.style,b=x===void 0?{}:x,_=M.useRef(null),S=M.useRef();S.current=y,M.useImperativeHandle(e,function(){return Object.defineProperty(_.current,"current",{get:function(){return console.warn("The usage of ref.current.current is deprecated and will no longer be supported."),_.current},configurable:!0})});var O=M.useState({containerWidth:i.width,containerHeight:i.height}),C=POt(O,2),E=C[0],k=C[1],I=M.useCallback(function(R,T){k(function(L){var z=Math.round(R),B=Math.round(T);return L.containerWidth===z&&L.containerHeight===B?L:{containerWidth:z,containerHeight:B}})},[]);M.useEffect(function(){var R=function(W){var $,N=W[0].contentRect,D=N.width,A=N.height;I(D,A),($=S.current)===null||$===void 0||$.call(S,D,A)};m>0&&(R=Yme(R,m,{trailing:!0,leading:!1}));var T=new ResizeObserver(R),L=_.current.getBoundingClientRect(),z=L.width,B=L.height;return I(z,B),T.observe(_.current),function(){T.disconnect()}},[I,m]);var P=M.useMemo(function(){var R=E.containerWidth,T=E.containerHeight;if(R<0||T<0)return null;ru(Ch(a)||Ch(l),`The width(%s) and height(%s) are both fixed numbers,
       maybe you don't need to use a ResponsiveContainer.`,a,l),ru(!n||n>0,"The aspect(%s) must be greater than zero.",n);var L=Ch(a)?R:a,z=Ch(l)?T:l;n&&n>0&&(L?z=L/n:z&&(L=z*n),d&&z>d&&(z=d)),ru(L>0||z>0,`The width(%s) and height(%s) of chart should be greater than 0,
       please check the style of container, or the props width(%s) and height(%s),
       or add a minWidth(%s) or minHeight(%s) or use aspect(%s) to control the
       height and width.`,L,z,a,l,u,f,n);var B=!Array.isArray(h)&&_T.isElement(h)&&nu(h.type).endsWith("Chart");return ue.Children.map(h,function(U){return _T.isElement(U)?M.cloneElement(U,yO({width:L,height:z},B?{style:yO({height:"100%",width:"100%",maxHeight:z,maxWidth:L},U.props.style)}:{})):U})},[n,h,l,d,f,u,E,a]);return ue.createElement("div",{id:g?"".concat(g):void 0,className:ke("recharts-responsive-container",v),style:yO(yO({},b),{},{width:a,height:l,minWidth:u,minHeight:f,maxHeight:d}),ref:_},P)}),Zme=function(e){return null};Zme.displayName="Cell";function T_(t){"@babel/helpers - typeof";return T_=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(e){return typeof e}:function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},T_(t)}function yQ(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(t,i).enumerable})),n.push.apply(n,r)}return n}function E$(t){for(var e=1;e<arguments.length;e++){var n=arguments[e]!=null?arguments[e]:{};e%2?yQ(Object(n),!0).forEach(function(r){IOt(t,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):yQ(Object(n)).forEach(function(r){Object.defineProperty(t,r,Object.getOwnPropertyDescriptor(n,r))})}return t}function IOt(t,e,n){return e=DOt(e),e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function DOt(t){var e=LOt(t,"string");return T_(e)=="symbol"?e:String(e)}function LOt(t,e){if(T_(t)!="object"||!t)return t;var n=t[Symbol.toPrimitive];if(n!==void 0){var r=n.call(t,e||"default");if(T_(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}var dm={widthCache:{},cacheCount:0},NOt=2e3,$Ot={position:"absolute",top:"-20000px",left:0,padding:0,margin:0,border:"none",whiteSpace:"pre"},xQ="recharts_measurement_span";function FOt(t){var e=E$({},t);return Object.keys(e).forEach(function(n){e[n]||delete e[n]}),e}var ob=function(e){var n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};if(e==null||Yl.isSsr)return{width:0,height:0};var r=FOt(n),i=JSON.stringify({text:e,copyStyle:r});if(dm.widthCache[i])return dm.widthCache[i];try{var o=document.getElementById(xQ);o||(o=document.createElement("span"),o.setAttribute("id",xQ),o.setAttribute("aria-hidden","true"),document.body.appendChild(o));var a=E$(E$({},$Ot),r);Object.assign(o.style,a),o.textContent="".concat(e);var s=o.getBoundingClientRect(),l={width:s.width,height:s.height};return dm.widthCache[i]=l,++dm.cacheCount>NOt&&(dm.cacheCount=0,dm.widthCache={}),l}catch{return{width:0,height:0}}},jOt=function(e){return{top:e.top+window.scrollY-document.documentElement.clientTop,left:e.left+window.scrollX-document.documentElement.clientLeft}};function E_(t){"@babel/helpers - typeof";return E_=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(e){return typeof e}:function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},E_(t)}function KE(t,e){return WOt(t)||UOt(t,e)||zOt(t,e)||BOt()}function BOt(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function zOt(t,e){if(t){if(typeof t=="string")return bQ(t,e);var n=Object.prototype.toString.call(t).slice(8,-1);if(n==="Object"&&t.constructor&&(n=t.constructor.name),n==="Map"||n==="Set")return Array.from(t);if(n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return bQ(t,e)}}function bQ(t,e){(e==null||e>t.length)&&(e=t.length);for(var n=0,r=new Array(e);n<e;n++)r[n]=t[n];return r}function UOt(t,e){var n=t==null?null:typeof Symbol<"u"&&t[Symbol.iterator]||t["@@iterator"];if(n!=null){var r,i,o,a,s=[],l=!0,c=!1;try{if(o=(n=n.call(t)).next,e===0){if(Object(n)!==n)return;l=!1}else for(;!(l=(r=o.call(n)).done)&&(s.push(r.value),s.length!==e);l=!0);}catch(u){c=!0,i=u}finally{try{if(!l&&n.return!=null&&(a=n.return(),Object(a)!==a))return}finally{if(c)throw i}}return s}}function WOt(t){if(Array.isArray(t))return t}function VOt(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function _Q(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,HOt(r.key),r)}}function GOt(t,e,n){return e&&_Q(t.prototype,e),n&&_Q(t,n),Object.defineProperty(t,"prototype",{writable:!1}),t}function HOt(t){var e=qOt(t,"string");return E_(e)=="symbol"?e:String(e)}function qOt(t,e){if(E_(t)!="object"||!t)return t;var n=t[Symbol.toPrimitive];if(n!==void 0){var r=n.call(t,e);if(E_(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}var wQ=/(-?\d+(?:\.\d+)?[a-zA-Z%]*)([*/])(-?\d+(?:\.\d+)?[a-zA-Z%]*)/,SQ=/(-?\d+(?:\.\d+)?[a-zA-Z%]*)([+-])(-?\d+(?:\.\d+)?[a-zA-Z%]*)/,XOt=/^px|cm|vh|vw|em|rem|%|mm|in|pt|pc|ex|ch|vmin|vmax|Q$/,QOt=/(-?\d+(?:\.\d+)?)([a-zA-Z%]+)?/,Jme={cm:96/2.54,mm:96/25.4,pt:96/72,pc:96/6,in:96,Q:96/(2.54*40),px:1},YOt=Object.keys(Jme),sg="NaN";function KOt(t,e){return t*Jme[e]}var xO=function(){function t(e,n){VOt(this,t),this.num=e,this.unit=n,this.num=e,this.unit=n,Number.isNaN(e)&&(this.unit=""),n!==""&&!XOt.test(n)&&(this.num=NaN,this.unit=""),YOt.includes(n)&&(this.num=KOt(e,n),this.unit="px")}return GOt(t,[{key:"add",value:function(n){return this.unit!==n.unit?new t(NaN,""):new t(this.num+n.num,this.unit)}},{key:"subtract",value:function(n){return this.unit!==n.unit?new t(NaN,""):new t(this.num-n.num,this.unit)}},{key:"multiply",value:function(n){return this.unit!==""&&n.unit!==""&&this.unit!==n.unit?new t(NaN,""):new t(this.num*n.num,this.unit||n.unit)}},{key:"divide",value:function(n){return this.unit!==""&&n.unit!==""&&this.unit!==n.unit?new t(NaN,""):new t(this.num/n.num,this.unit||n.unit)}},{key:"toString",value:function(){return"".concat(this.num).concat(this.unit)}},{key:"isNaN",value:function(){return Number.isNaN(this.num)}}],[{key:"parse",value:function(n){var r,i=(r=QOt.exec(n))!==null&&r!==void 0?r:[],o=KE(i,3),a=o[1],s=o[2];return new t(parseFloat(a),s??"")}}]),t}();function ege(t){if(t.includes(sg))return sg;for(var e=t;e.includes("*")||e.includes("/");){var n,r=(n=wQ.exec(e))!==null&&n!==void 0?n:[],i=KE(r,4),o=i[1],a=i[2],s=i[3],l=xO.parse(o??""),c=xO.parse(s??""),u=a==="*"?l.multiply(c):l.divide(c);if(u.isNaN())return sg;e=e.replace(wQ,u.toString())}for(;e.includes("+")||/.-\d+(?:\.\d+)?/.test(e);){var f,d=(f=SQ.exec(e))!==null&&f!==void 0?f:[],h=KE(d,4),p=h[1],m=h[2],g=h[3],v=xO.parse(p??""),y=xO.parse(g??""),x=m==="+"?v.add(y):v.subtract(y);if(x.isNaN())return sg;e=e.replace(SQ,x.toString())}return e}var OQ=/\(([^()]*)\)/;function ZOt(t){for(var e=t;e.includes("(");){var n=OQ.exec(e),r=KE(n,2),i=r[1];e=e.replace(OQ,ege(i))}return e}function JOt(t){var e=t.replace(/\s+/g,"");return e=ZOt(e),e=ege(e),e}function eCt(t){try{return JOt(t)}catch{return sg}}function SI(t){var e=eCt(t.slice(5,-1));return e===sg?"":e}var tCt=["x","y","lineHeight","capHeight","scaleToFit","textAnchor","verticalAnchor","fill"],nCt=["dx","dy","angle","className","breakAll"];function P$(){return P$=Object.assign?Object.assign.bind():function(t){for(var e=1;e<arguments.length;e++){var n=arguments[e];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(t[r]=n[r])}return t},P$.apply(this,arguments)}function CQ(t,e){if(t==null)return{};var n=rCt(t,e),r,i;if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(t);for(i=0;i<o.length;i++)r=o[i],!(e.indexOf(r)>=0)&&Object.prototype.propertyIsEnumerable.call(t,r)&&(n[r]=t[r])}return n}function rCt(t,e){if(t==null)return{};var n={},r=Object.keys(t),i,o;for(o=0;o<r.length;o++)i=r[o],!(e.indexOf(i)>=0)&&(n[i]=t[i]);return n}function TQ(t,e){return sCt(t)||aCt(t,e)||oCt(t,e)||iCt()}function iCt(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function oCt(t,e){if(t){if(typeof t=="string")return EQ(t,e);var n=Object.prototype.toString.call(t).slice(8,-1);if(n==="Object"&&t.constructor&&(n=t.constructor.name),n==="Map"||n==="Set")return Array.from(t);if(n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return EQ(t,e)}}function EQ(t,e){(e==null||e>t.length)&&(e=t.length);for(var n=0,r=new Array(e);n<e;n++)r[n]=t[n];return r}function aCt(t,e){var n=t==null?null:typeof Symbol<"u"&&t[Symbol.iterator]||t["@@iterator"];if(n!=null){var r,i,o,a,s=[],l=!0,c=!1;try{if(o=(n=n.call(t)).next,e===0){if(Object(n)!==n)return;l=!1}else for(;!(l=(r=o.call(n)).done)&&(s.push(r.value),s.length!==e);l=!0);}catch(u){c=!0,i=u}finally{try{if(!l&&n.return!=null&&(a=n.return(),Object(a)!==a))return}finally{if(c)throw i}}return s}}function sCt(t){if(Array.isArray(t))return t}var tge=/[ \f\n\r\t\v\u2028\u2029]+/,nge=function(e){var n=e.children,r=e.breakAll,i=e.style;try{var o=[];Wt(n)||(r?o=n.toString().split(""):o=n.toString().split(tge));var a=o.map(function(l){return{word:l,width:ob(l,i).width}}),s=r?0:ob(" ",i).width;return{wordsWithComputedWidth:a,spaceWidth:s}}catch{return null}},lCt=function(e,n,r,i,o){var a=e.maxLines,s=e.children,l=e.style,c=e.breakAll,u=Ye(a),f=s,d=function(){var L=arguments.length>0&&arguments[0]!==void 0?arguments[0]:[];return L.reduce(function(z,B){var U=B.word,W=B.width,$=z[z.length-1];if($&&(i==null||o||$.width+W+r<Number(i)))$.words.push(U),$.width+=W+r;else{var N={words:[U],width:W};z.push(N)}return z},[])},h=d(n),p=function(L){return L.reduce(function(z,B){return z.width>B.width?z:B})};if(!u)return h;for(var m="…",g=function(L){var z=f.slice(0,L),B=nge({breakAll:c,style:l,children:z+m}).wordsWithComputedWidth,U=d(B),W=U.length>a||p(U).width>Number(i);return[W,U]},v=0,y=f.length-1,x=0,b;v<=y&&x<=f.length-1;){var _=Math.floor((v+y)/2),S=_-1,O=g(S),C=TQ(O,2),E=C[0],k=C[1],I=g(_),P=TQ(I,1),R=P[0];if(!E&&!R&&(v=_+1),E&&R&&(y=_-1),!E&&R){b=k;break}x++}return b||h},PQ=function(e){var n=Wt(e)?[]:e.toString().split(tge);return[{words:n}]},cCt=function(e){var n=e.width,r=e.scaleToFit,i=e.children,o=e.style,a=e.breakAll,s=e.maxLines;if((n||r)&&!Yl.isSsr){var l,c,u=nge({breakAll:a,children:i,style:o});if(u){var f=u.wordsWithComputedWidth,d=u.spaceWidth;l=f,c=d}else return PQ(i);return lCt({breakAll:a,children:i,maxLines:s,style:o},l,c,n,r)}return PQ(i)},MQ="#808080",ZE=function(e){var n=e.x,r=n===void 0?0:n,i=e.y,o=i===void 0?0:i,a=e.lineHeight,s=a===void 0?"1em":a,l=e.capHeight,c=l===void 0?"0.71em":l,u=e.scaleToFit,f=u===void 0?!1:u,d=e.textAnchor,h=d===void 0?"start":d,p=e.verticalAnchor,m=p===void 0?"end":p,g=e.fill,v=g===void 0?MQ:g,y=CQ(e,tCt),x=M.useMemo(function(){return cCt({breakAll:y.breakAll,children:y.children,maxLines:y.maxLines,scaleToFit:f,style:y.style,width:y.width})},[y.breakAll,y.children,y.maxLines,f,y.style,y.width]),b=y.dx,_=y.dy,S=y.angle,O=y.className,C=y.breakAll,E=CQ(y,nCt);if(!ti(r)||!ti(o))return null;var k=r+(Ye(b)?b:0),I=o+(Ye(_)?_:0),P;switch(m){case"start":P=SI("calc(".concat(c,")"));break;case"middle":P=SI("calc(".concat((x.length-1)/2," * -").concat(s," + (").concat(c," / 2))"));break;default:P=SI("calc(".concat(x.length-1," * -").concat(s,")"));break}var R=[];if(f){var T=x[0].width,L=y.width;R.push("scale(".concat((Ye(L)?L/T:1)/T,")"))}return S&&R.push("rotate(".concat(S,", ").concat(k,", ").concat(I,")")),R.length&&(E.transform=R.join(" ")),ue.createElement("text",P$({},jt(E,!0),{x:k,y:I,className:ke("recharts-text",O),textAnchor:h,fill:v.includes("url")?MQ:v}),x.map(function(z,B){var U=z.words.join(C?"":" ");return ue.createElement("tspan",{x:k,dy:B===0?P:s,key:U},U)}))};function Gf(t,e){return t==null||e==null?NaN:t<e?-1:t>e?1:t>=e?0:NaN}function uCt(t,e){return t==null||e==null?NaN:e<t?-1:e>t?1:e>=t?0:NaN}function PU(t){let e,n,r;t.length!==2?(e=Gf,n=(s,l)=>Gf(t(s),l),r=(s,l)=>t(s)-l):(e=t===Gf||t===uCt?t:fCt,n=t,r=t);function i(s,l,c=0,u=s.length){if(c<u){if(e(l,l)!==0)return u;do{const f=c+u>>>1;n(s[f],l)<0?c=f+1:u=f}while(c<u)}return c}function o(s,l,c=0,u=s.length){if(c<u){if(e(l,l)!==0)return u;do{const f=c+u>>>1;n(s[f],l)<=0?c=f+1:u=f}while(c<u)}return c}function a(s,l,c=0,u=s.length){const f=i(s,l,c,u-1);return f>c&&r(s[f-1],l)>-r(s[f],l)?f-1:f}return{left:i,center:a,right:o}}function fCt(){return 0}function rge(t){return t===null?NaN:+t}function*dCt(t,e){for(let n of t)n!=null&&(n=+n)>=n&&(yield n)}const hCt=PU(Gf),Pw=hCt.right;PU(rge).center;class kQ extends Map{constructor(e,n=gCt){if(super(),Object.defineProperties(this,{_intern:{value:new Map},_key:{value:n}}),e!=null)for(const[r,i]of e)this.set(r,i)}get(e){return super.get(AQ(this,e))}has(e){return super.has(AQ(this,e))}set(e,n){return super.set(pCt(this,e),n)}delete(e){return super.delete(mCt(this,e))}}function AQ({_intern:t,_key:e},n){const r=e(n);return t.has(r)?t.get(r):n}function pCt({_intern:t,_key:e},n){const r=e(n);return t.has(r)?t.get(r):(t.set(r,n),n)}function mCt({_intern:t,_key:e},n){const r=e(n);return t.has(r)&&(n=t.get(r),t.delete(r)),n}function gCt(t){return t!==null&&typeof t=="object"?t.valueOf():t}function vCt(t=Gf){if(t===Gf)return ige;if(typeof t!="function")throw new TypeError("compare is not a function");return(e,n)=>{const r=t(e,n);return r||r===0?r:(t(n,n)===0)-(t(e,e)===0)}}function ige(t,e){return(t==null||!(t>=t))-(e==null||!(e>=e))||(t<e?-1:t>e?1:0)}const yCt=Math.sqrt(50),xCt=Math.sqrt(10),bCt=Math.sqrt(2);function JE(t,e,n){const r=(e-t)/Math.max(0,n),i=Math.floor(Math.log10(r)),o=r/Math.pow(10,i),a=o>=yCt?10:o>=xCt?5:o>=bCt?2:1;let s,l,c;return i<0?(c=Math.pow(10,-i)/a,s=Math.round(t*c),l=Math.round(e*c),s/c<t&&++s,l/c>e&&--l,c=-c):(c=Math.pow(10,i)*a,s=Math.round(t/c),l=Math.round(e/c),s*c<t&&++s,l*c>e&&--l),l<s&&.5<=n&&n<2?JE(t,e,n*2):[s,l,c]}function M$(t,e,n){if(e=+e,t=+t,n=+n,!(n>0))return[];if(t===e)return[t];const r=e<t,[i,o,a]=r?JE(e,t,n):JE(t,e,n);if(!(o>=i))return[];const s=o-i+1,l=new Array(s);if(r)if(a<0)for(let c=0;c<s;++c)l[c]=(o-c)/-a;else for(let c=0;c<s;++c)l[c]=(o-c)*a;else if(a<0)for(let c=0;c<s;++c)l[c]=(i+c)/-a;else for(let c=0;c<s;++c)l[c]=(i+c)*a;return l}function k$(t,e,n){return e=+e,t=+t,n=+n,JE(t,e,n)[2]}function A$(t,e,n){e=+e,t=+t,n=+n;const r=e<t,i=r?k$(e,t,n):k$(t,e,n);return(r?-1:1)*(i<0?1/-i:i)}function RQ(t,e){let n;for(const r of t)r!=null&&(n<r||n===void 0&&r>=r)&&(n=r);return n}function IQ(t,e){let n;for(const r of t)r!=null&&(n>r||n===void 0&&r>=r)&&(n=r);return n}function oge(t,e,n=0,r=1/0,i){if(e=Math.floor(e),n=Math.floor(Math.max(0,n)),r=Math.floor(Math.min(t.length-1,r)),!(n<=e&&e<=r))return t;for(i=i===void 0?ige:vCt(i);r>n;){if(r-n>600){const l=r-n+1,c=e-n+1,u=Math.log(l),f=.5*Math.exp(2*u/3),d=.5*Math.sqrt(u*f*(l-f)/l)*(c-l/2<0?-1:1),h=Math.max(n,Math.floor(e-c*f/l+d)),p=Math.min(r,Math.floor(e+(l-c)*f/l+d));oge(t,e,h,p,i)}const o=t[e];let a=n,s=r;for(j0(t,n,e),i(t[r],o)>0&&j0(t,n,r);a<s;){for(j0(t,a,s),++a,--s;i(t[a],o)<0;)++a;for(;i(t[s],o)>0;)--s}i(t[n],o)===0?j0(t,n,s):(++s,j0(t,s,r)),s<=e&&(n=s+1),e<=s&&(r=s-1)}return t}function j0(t,e,n){const r=t[e];t[e]=t[n],t[n]=r}function _Ct(t,e,n){if(t=Float64Array.from(dCt(t)),!(!(r=t.length)||isNaN(e=+e))){if(e<=0||r<2)return IQ(t);if(e>=1)return RQ(t);var r,i=(r-1)*e,o=Math.floor(i),a=RQ(oge(t,o).subarray(0,o+1)),s=IQ(t.subarray(o+1));return a+(s-a)*(i-o)}}function wCt(t,e,n=rge){if(!(!(r=t.length)||isNaN(e=+e))){if(e<=0||r<2)return+n(t[0],0,t);if(e>=1)return+n(t[r-1],r-1,t);var r,i=(r-1)*e,o=Math.floor(i),a=+n(t[o],o,t),s=+n(t[o+1],o+1,t);return a+(s-a)*(i-o)}}function SCt(t,e,n){t=+t,e=+e,n=(i=arguments.length)<2?(e=t,t=0,1):i<3?1:+n;for(var r=-1,i=Math.max(0,Math.ceil((e-t)/n))|0,o=new Array(i);++r<i;)o[r]=t+r*n;return o}function Cs(t,e){switch(arguments.length){case 0:break;case 1:this.range(t);break;default:this.range(e).domain(t);break}return this}function Tu(t,e){switch(arguments.length){case 0:break;case 1:{typeof t=="function"?this.interpolator(t):this.range(t);break}default:{this.domain(t),typeof e=="function"?this.interpolator(e):this.range(e);break}}return this}const R$=Symbol("implicit");function MU(){var t=new kQ,e=[],n=[],r=R$;function i(o){let a=t.get(o);if(a===void 0){if(r!==R$)return r;t.set(o,a=e.push(o)-1)}return n[a%n.length]}return i.domain=function(o){if(!arguments.length)return e.slice();e=[],t=new kQ;for(const a of o)t.has(a)||t.set(a,e.push(a)-1);return i},i.range=function(o){return arguments.length?(n=Array.from(o),i):n.slice()},i.unknown=function(o){return arguments.length?(r=o,i):r},i.copy=function(){return MU(e,n).unknown(r)},Cs.apply(i,arguments),i}function P_(){var t=MU().unknown(void 0),e=t.domain,n=t.range,r=0,i=1,o,a,s=!1,l=0,c=0,u=.5;delete t.unknown;function f(){var d=e().length,h=i<r,p=h?i:r,m=h?r:i;o=(m-p)/Math.max(1,d-l+c*2),s&&(o=Math.floor(o)),p+=(m-p-o*(d-l))*u,a=o*(1-l),s&&(p=Math.round(p),a=Math.round(a));var g=SCt(d).map(function(v){return p+o*v});return n(h?g.reverse():g)}return t.domain=function(d){return arguments.length?(e(d),f()):e()},t.range=function(d){return arguments.length?([r,i]=d,r=+r,i=+i,f()):[r,i]},t.rangeRound=function(d){return[r,i]=d,r=+r,i=+i,s=!0,f()},t.bandwidth=function(){return a},t.step=function(){return o},t.round=function(d){return arguments.length?(s=!!d,f()):s},t.padding=function(d){return arguments.length?(l=Math.min(1,c=+d),f()):l},t.paddingInner=function(d){return arguments.length?(l=Math.min(1,d),f()):l},t.paddingOuter=function(d){return arguments.length?(c=+d,f()):c},t.align=function(d){return arguments.length?(u=Math.max(0,Math.min(1,d)),f()):u},t.copy=function(){return P_(e(),[r,i]).round(s).paddingInner(l).paddingOuter(c).align(u)},Cs.apply(f(),arguments)}function age(t){var e=t.copy;return t.padding=t.paddingOuter,delete t.paddingInner,delete t.paddingOuter,t.copy=function(){return age(e())},t}function ab(){return age(P_.apply(null,arguments).paddingInner(1))}function kU(t,e,n){t.prototype=e.prototype=n,n.constructor=t}function sge(t,e){var n=Object.create(t.prototype);for(var r in e)n[r]=e[r];return n}function Mw(){}var M_=.7,eP=1/M_,$g="\\s*([+-]?\\d+)\\s*",k_="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)\\s*",Kl="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)%\\s*",OCt=/^#([0-9a-f]{3,8})$/,CCt=new RegExp(`^rgb\\(${$g},${$g},${$g}\\)$`),TCt=new RegExp(`^rgb\\(${Kl},${Kl},${Kl}\\)$`),ECt=new RegExp(`^rgba\\(${$g},${$g},${$g},${k_}\\)$`),PCt=new RegExp(`^rgba\\(${Kl},${Kl},${Kl},${k_}\\)$`),MCt=new RegExp(`^hsl\\(${k_},${Kl},${Kl}\\)$`),kCt=new RegExp(`^hsla\\(${k_},${Kl},${Kl},${k_}\\)$`),DQ={aliceblue:15792383,antiquewhite:16444375,aqua:65535,aquamarine:8388564,azure:15794175,beige:16119260,bisque:16770244,black:0,blanchedalmond:16772045,blue:255,blueviolet:9055202,brown:10824234,burlywood:14596231,cadetblue:6266528,chartreuse:8388352,chocolate:13789470,coral:16744272,cornflowerblue:6591981,cornsilk:16775388,crimson:14423100,cyan:65535,darkblue:139,darkcyan:35723,darkgoldenrod:12092939,darkgray:11119017,darkgreen:25600,darkgrey:11119017,darkkhaki:12433259,darkmagenta:9109643,darkolivegreen:5597999,darkorange:16747520,darkorchid:10040012,darkred:9109504,darksalmon:15308410,darkseagreen:9419919,darkslateblue:4734347,darkslategray:3100495,darkslategrey:3100495,darkturquoise:52945,darkviolet:9699539,deeppink:16716947,deepskyblue:49151,dimgray:6908265,dimgrey:6908265,dodgerblue:2003199,firebrick:11674146,floralwhite:16775920,forestgreen:2263842,fuchsia:16711935,gainsboro:14474460,ghostwhite:16316671,gold:16766720,goldenrod:14329120,gray:8421504,green:32768,greenyellow:11403055,grey:8421504,honeydew:15794160,hotpink:16738740,indianred:13458524,indigo:4915330,ivory:16777200,khaki:15787660,lavender:15132410,lavenderblush:16773365,lawngreen:8190976,lemonchiffon:16775885,lightblue:11393254,lightcoral:15761536,lightcyan:14745599,lightgoldenrodyellow:16448210,lightgray:13882323,lightgreen:9498256,lightgrey:13882323,lightpink:16758465,lightsalmon:16752762,lightseagreen:2142890,lightskyblue:8900346,lightslategray:7833753,lightslategrey:7833753,lightsteelblue:11584734,lightyellow:16777184,lime:65280,limegreen:3329330,linen:16445670,magenta:16711935,maroon:8388608,mediumaquamarine:6737322,mediumblue:205,mediumorchid:12211667,mediumpurple:9662683,mediumseagreen:3978097,mediumslateblue:8087790,mediumspringgreen:64154,mediumturquoise:4772300,mediumvioletred:13047173,midnightblue:1644912,mintcream:16121850,mistyrose:16770273,moccasin:16770229,navajowhite:16768685,navy:128,oldlace:16643558,olive:8421376,olivedrab:7048739,orange:16753920,orangered:16729344,orchid:14315734,palegoldenrod:15657130,palegreen:10025880,paleturquoise:11529966,palevioletred:14381203,papayawhip:16773077,peachpuff:16767673,peru:13468991,pink:16761035,plum:14524637,powderblue:11591910,purple:8388736,rebeccapurple:6697881,red:16711680,rosybrown:12357519,royalblue:4286945,saddlebrown:9127187,salmon:16416882,sandybrown:16032864,seagreen:3050327,seashell:16774638,sienna:10506797,silver:12632256,skyblue:8900331,slateblue:6970061,slategray:7372944,slategrey:7372944,snow:16775930,springgreen:65407,steelblue:4620980,tan:13808780,teal:32896,thistle:14204888,tomato:16737095,turquoise:4251856,violet:15631086,wheat:16113331,white:16777215,whitesmoke:16119285,yellow:16776960,yellowgreen:10145074};kU(Mw,A_,{copy(t){return Object.assign(new this.constructor,this,t)},displayable(){return this.rgb().displayable()},hex:LQ,formatHex:LQ,formatHex8:ACt,formatHsl:RCt,formatRgb:NQ,toString:NQ});function LQ(){return this.rgb().formatHex()}function ACt(){return this.rgb().formatHex8()}function RCt(){return lge(this).formatHsl()}function NQ(){return this.rgb().formatRgb()}function A_(t){var e,n;return t=(t+"").trim().toLowerCase(),(e=OCt.exec(t))?(n=e[1].length,e=parseInt(e[1],16),n===6?$Q(e):n===3?new Io(e>>8&15|e>>4&240,e>>4&15|e&240,(e&15)<<4|e&15,1):n===8?bO(e>>24&255,e>>16&255,e>>8&255,(e&255)/255):n===4?bO(e>>12&15|e>>8&240,e>>8&15|e>>4&240,e>>4&15|e&240,((e&15)<<4|e&15)/255):null):(e=CCt.exec(t))?new Io(e[1],e[2],e[3],1):(e=TCt.exec(t))?new Io(e[1]*255/100,e[2]*255/100,e[3]*255/100,1):(e=ECt.exec(t))?bO(e[1],e[2],e[3],e[4]):(e=PCt.exec(t))?bO(e[1]*255/100,e[2]*255/100,e[3]*255/100,e[4]):(e=MCt.exec(t))?BQ(e[1],e[2]/100,e[3]/100,1):(e=kCt.exec(t))?BQ(e[1],e[2]/100,e[3]/100,e[4]):DQ.hasOwnProperty(t)?$Q(DQ[t]):t==="transparent"?new Io(NaN,NaN,NaN,0):null}function $Q(t){return new Io(t>>16&255,t>>8&255,t&255,1)}function bO(t,e,n,r){return r<=0&&(t=e=n=NaN),new Io(t,e,n,r)}function ICt(t){return t instanceof Mw||(t=A_(t)),t?(t=t.rgb(),new Io(t.r,t.g,t.b,t.opacity)):new Io}function I$(t,e,n,r){return arguments.length===1?ICt(t):new Io(t,e,n,r??1)}function Io(t,e,n,r){this.r=+t,this.g=+e,this.b=+n,this.opacity=+r}kU(Io,I$,sge(Mw,{brighter(t){return t=t==null?eP:Math.pow(eP,t),new Io(this.r*t,this.g*t,this.b*t,this.opacity)},darker(t){return t=t==null?M_:Math.pow(M_,t),new Io(this.r*t,this.g*t,this.b*t,this.opacity)},rgb(){return this},clamp(){return new Io(Vh(this.r),Vh(this.g),Vh(this.b),tP(this.opacity))},displayable(){return-.5<=this.r&&this.r<255.5&&-.5<=this.g&&this.g<255.5&&-.5<=this.b&&this.b<255.5&&0<=this.opacity&&this.opacity<=1},hex:FQ,formatHex:FQ,formatHex8:DCt,formatRgb:jQ,toString:jQ}));function FQ(){return`#${Th(this.r)}${Th(this.g)}${Th(this.b)}`}function DCt(){return`#${Th(this.r)}${Th(this.g)}${Th(this.b)}${Th((isNaN(this.opacity)?1:this.opacity)*255)}`}function jQ(){const t=tP(this.opacity);return`${t===1?"rgb(":"rgba("}${Vh(this.r)}, ${Vh(this.g)}, ${Vh(this.b)}${t===1?")":`, ${t})`}`}function tP(t){return isNaN(t)?1:Math.max(0,Math.min(1,t))}function Vh(t){return Math.max(0,Math.min(255,Math.round(t)||0))}function Th(t){return t=Vh(t),(t<16?"0":"")+t.toString(16)}function BQ(t,e,n,r){return r<=0?t=e=n=NaN:n<=0||n>=1?t=e=NaN:e<=0&&(t=NaN),new Vs(t,e,n,r)}function lge(t){if(t instanceof Vs)return new Vs(t.h,t.s,t.l,t.opacity);if(t instanceof Mw||(t=A_(t)),!t)return new Vs;if(t instanceof Vs)return t;t=t.rgb();var e=t.r/255,n=t.g/255,r=t.b/255,i=Math.min(e,n,r),o=Math.max(e,n,r),a=NaN,s=o-i,l=(o+i)/2;return s?(e===o?a=(n-r)/s+(n<r)*6:n===o?a=(r-e)/s+2:a=(e-n)/s+4,s/=l<.5?o+i:2-o-i,a*=60):s=l>0&&l<1?0:a,new Vs(a,s,l,t.opacity)}function LCt(t,e,n,r){return arguments.length===1?lge(t):new Vs(t,e,n,r??1)}function Vs(t,e,n,r){this.h=+t,this.s=+e,this.l=+n,this.opacity=+r}kU(Vs,LCt,sge(Mw,{brighter(t){return t=t==null?eP:Math.pow(eP,t),new Vs(this.h,this.s,this.l*t,this.opacity)},darker(t){return t=t==null?M_:Math.pow(M_,t),new Vs(this.h,this.s,this.l*t,this.opacity)},rgb(){var t=this.h%360+(this.h<0)*360,e=isNaN(t)||isNaN(this.s)?0:this.s,n=this.l,r=n+(n<.5?n:1-n)*e,i=2*n-r;return new Io(OI(t>=240?t-240:t+120,i,r),OI(t,i,r),OI(t<120?t+240:t-120,i,r),this.opacity)},clamp(){return new Vs(zQ(this.h),_O(this.s),_O(this.l),tP(this.opacity))},displayable(){return(0<=this.s&&this.s<=1||isNaN(this.s))&&0<=this.l&&this.l<=1&&0<=this.opacity&&this.opacity<=1},formatHsl(){const t=tP(this.opacity);return`${t===1?"hsl(":"hsla("}${zQ(this.h)}, ${_O(this.s)*100}%, ${_O(this.l)*100}%${t===1?")":`, ${t})`}`}}));function zQ(t){return t=(t||0)%360,t<0?t+360:t}function _O(t){return Math.max(0,Math.min(1,t||0))}function OI(t,e,n){return(t<60?e+(n-e)*t/60:t<180?n:t<240?e+(n-e)*(240-t)/60:e)*255}const AU=t=>()=>t;function NCt(t,e){return function(n){return t+n*e}}function $Ct(t,e,n){return t=Math.pow(t,n),e=Math.pow(e,n)-t,n=1/n,function(r){return Math.pow(t+r*e,n)}}function FCt(t){return(t=+t)==1?cge:function(e,n){return n-e?$Ct(e,n,t):AU(isNaN(e)?n:e)}}function cge(t,e){var n=e-t;return n?NCt(t,n):AU(isNaN(t)?e:t)}const UQ=function t(e){var n=FCt(e);function r(i,o){var a=n((i=I$(i)).r,(o=I$(o)).r),s=n(i.g,o.g),l=n(i.b,o.b),c=cge(i.opacity,o.opacity);return function(u){return i.r=a(u),i.g=s(u),i.b=l(u),i.opacity=c(u),i+""}}return r.gamma=t,r}(1);function jCt(t,e){e||(e=[]);var n=t?Math.min(e.length,t.length):0,r=e.slice(),i;return function(o){for(i=0;i<n;++i)r[i]=t[i]*(1-o)+e[i]*o;return r}}function BCt(t){return ArrayBuffer.isView(t)&&!(t instanceof DataView)}function zCt(t,e){var n=e?e.length:0,r=t?Math.min(n,t.length):0,i=new Array(r),o=new Array(n),a;for(a=0;a<r;++a)i[a]=Wy(t[a],e[a]);for(;a<n;++a)o[a]=e[a];return function(s){for(a=0;a<r;++a)o[a]=i[a](s);return o}}function UCt(t,e){var n=new Date;return t=+t,e=+e,function(r){return n.setTime(t*(1-r)+e*r),n}}function nP(t,e){return t=+t,e=+e,function(n){return t*(1-n)+e*n}}function WCt(t,e){var n={},r={},i;(t===null||typeof t!="object")&&(t={}),(e===null||typeof e!="object")&&(e={});for(i in e)i in t?n[i]=Wy(t[i],e[i]):r[i]=e[i];return function(o){for(i in n)r[i]=n[i](o);return r}}var D$=/[-+]?(?:\d+\.?\d*|\.?\d+)(?:[eE][-+]?\d+)?/g,CI=new RegExp(D$.source,"g");function VCt(t){return function(){return t}}function GCt(t){return function(e){return t(e)+""}}function HCt(t,e){var n=D$.lastIndex=CI.lastIndex=0,r,i,o,a=-1,s=[],l=[];for(t=t+"",e=e+"";(r=D$.exec(t))&&(i=CI.exec(e));)(o=i.index)>n&&(o=e.slice(n,o),s[a]?s[a]+=o:s[++a]=o),(r=r[0])===(i=i[0])?s[a]?s[a]+=i:s[++a]=i:(s[++a]=null,l.push({i:a,x:nP(r,i)})),n=CI.lastIndex;return n<e.length&&(o=e.slice(n),s[a]?s[a]+=o:s[++a]=o),s.length<2?l[0]?GCt(l[0].x):VCt(e):(e=l.length,function(c){for(var u=0,f;u<e;++u)s[(f=l[u]).i]=f.x(c);return s.join("")})}function Wy(t,e){var n=typeof e,r;return e==null||n==="boolean"?AU(e):(n==="number"?nP:n==="string"?(r=A_(e))?(e=r,UQ):HCt:e instanceof A_?UQ:e instanceof Date?UCt:BCt(e)?jCt:Array.isArray(e)?zCt:typeof e.valueOf!="function"&&typeof e.toString!="function"||isNaN(e)?WCt:nP)(t,e)}function RU(t,e){return t=+t,e=+e,function(n){return Math.round(t*(1-n)+e*n)}}function qCt(t,e){e===void 0&&(e=t,t=Wy);for(var n=0,r=e.length-1,i=e[0],o=new Array(r<0?0:r);n<r;)o[n]=t(i,i=e[++n]);return function(a){var s=Math.max(0,Math.min(r-1,Math.floor(a*=r)));return o[s](a-s)}}function XCt(t){return function(){return t}}function rP(t){return+t}var WQ=[0,1];function lo(t){return t}function L$(t,e){return(e-=t=+t)?function(n){return(n-t)/e}:XCt(isNaN(e)?NaN:.5)}function QCt(t,e){var n;return t>e&&(n=t,t=e,e=n),function(r){return Math.max(t,Math.min(e,r))}}function YCt(t,e,n){var r=t[0],i=t[1],o=e[0],a=e[1];return i<r?(r=L$(i,r),o=n(a,o)):(r=L$(r,i),o=n(o,a)),function(s){return o(r(s))}}function KCt(t,e,n){var r=Math.min(t.length,e.length)-1,i=new Array(r),o=new Array(r),a=-1;for(t[r]<t[0]&&(t=t.slice().reverse(),e=e.slice().reverse());++a<r;)i[a]=L$(t[a],t[a+1]),o[a]=n(e[a],e[a+1]);return function(s){var l=Pw(t,s,1,r)-1;return o[l](i[l](s))}}function kw(t,e){return e.domain(t.domain()).range(t.range()).interpolate(t.interpolate()).clamp(t.clamp()).unknown(t.unknown())}function xk(){var t=WQ,e=WQ,n=Wy,r,i,o,a=lo,s,l,c;function u(){var d=Math.min(t.length,e.length);return a!==lo&&(a=QCt(t[0],t[d-1])),s=d>2?KCt:YCt,l=c=null,f}function f(d){return d==null||isNaN(d=+d)?o:(l||(l=s(t.map(r),e,n)))(r(a(d)))}return f.invert=function(d){return a(i((c||(c=s(e,t.map(r),nP)))(d)))},f.domain=function(d){return arguments.length?(t=Array.from(d,rP),u()):t.slice()},f.range=function(d){return arguments.length?(e=Array.from(d),u()):e.slice()},f.rangeRound=function(d){return e=Array.from(d),n=RU,u()},f.clamp=function(d){return arguments.length?(a=d?!0:lo,u()):a!==lo},f.interpolate=function(d){return arguments.length?(n=d,u()):n},f.unknown=function(d){return arguments.length?(o=d,f):o},function(d,h){return r=d,i=h,u()}}function IU(){return xk()(lo,lo)}function ZCt(t){return Math.abs(t=Math.round(t))>=1e21?t.toLocaleString("en").replace(/,/g,""):t.toString(10)}function iP(t,e){if((n=(t=e?t.toExponential(e-1):t.toExponential()).indexOf("e"))<0)return null;var n,r=t.slice(0,n);return[r.length>1?r[0]+r.slice(2):r,+t.slice(n+1)]}function Sv(t){return t=iP(Math.abs(t)),t?t[1]:NaN}function JCt(t,e){return function(n,r){for(var i=n.length,o=[],a=0,s=t[0],l=0;i>0&&s>0&&(l+s+1>r&&(s=Math.max(1,r-l)),o.push(n.substring(i-=s,i+s)),!((l+=s+1)>r));)s=t[a=(a+1)%t.length];return o.reverse().join(e)}}function eTt(t){return function(e){return e.replace(/[0-9]/g,function(n){return t[+n]})}}var tTt=/^(?:(.)?([<>=^]))?([+\-( ])?([$#])?(0)?(\d+)?(,)?(\.\d+)?(~)?([a-z%])?$/i;function R_(t){if(!(e=tTt.exec(t)))throw new Error("invalid format: "+t);var e;return new DU({fill:e[1],align:e[2],sign:e[3],symbol:e[4],zero:e[5],width:e[6],comma:e[7],precision:e[8]&&e[8].slice(1),trim:e[9],type:e[10]})}R_.prototype=DU.prototype;function DU(t){this.fill=t.fill===void 0?" ":t.fill+"",this.align=t.align===void 0?">":t.align+"",this.sign=t.sign===void 0?"-":t.sign+"",this.symbol=t.symbol===void 0?"":t.symbol+"",this.zero=!!t.zero,this.width=t.width===void 0?void 0:+t.width,this.comma=!!t.comma,this.precision=t.precision===void 0?void 0:+t.precision,this.trim=!!t.trim,this.type=t.type===void 0?"":t.type+""}DU.prototype.toString=function(){return this.fill+this.align+this.sign+this.symbol+(this.zero?"0":"")+(this.width===void 0?"":Math.max(1,this.width|0))+(this.comma?",":"")+(this.precision===void 0?"":"."+Math.max(0,this.precision|0))+(this.trim?"~":"")+this.type};function nTt(t){e:for(var e=t.length,n=1,r=-1,i;n<e;++n)switch(t[n]){case".":r=i=n;break;case"0":r===0&&(r=n),i=n;break;default:if(!+t[n])break e;r>0&&(r=0);break}return r>0?t.slice(0,r)+t.slice(i+1):t}var uge;function rTt(t,e){var n=iP(t,e);if(!n)return t+"";var r=n[0],i=n[1],o=i-(uge=Math.max(-8,Math.min(8,Math.floor(i/3)))*3)+1,a=r.length;return o===a?r:o>a?r+new Array(o-a+1).join("0"):o>0?r.slice(0,o)+"."+r.slice(o):"0."+new Array(1-o).join("0")+iP(t,Math.max(0,e+o-1))[0]}function VQ(t,e){var n=iP(t,e);if(!n)return t+"";var r=n[0],i=n[1];return i<0?"0."+new Array(-i).join("0")+r:r.length>i+1?r.slice(0,i+1)+"."+r.slice(i+1):r+new Array(i-r.length+2).join("0")}const GQ={"%":(t,e)=>(t*100).toFixed(e),b:t=>Math.round(t).toString(2),c:t=>t+"",d:ZCt,e:(t,e)=>t.toExponential(e),f:(t,e)=>t.toFixed(e),g:(t,e)=>t.toPrecision(e),o:t=>Math.round(t).toString(8),p:(t,e)=>VQ(t*100,e),r:VQ,s:rTt,X:t=>Math.round(t).toString(16).toUpperCase(),x:t=>Math.round(t).toString(16)};function HQ(t){return t}var qQ=Array.prototype.map,XQ=["y","z","a","f","p","n","µ","m","","k","M","G","T","P","E","Z","Y"];function iTt(t){var e=t.grouping===void 0||t.thousands===void 0?HQ:JCt(qQ.call(t.grouping,Number),t.thousands+""),n=t.currency===void 0?"":t.currency[0]+"",r=t.currency===void 0?"":t.currency[1]+"",i=t.decimal===void 0?".":t.decimal+"",o=t.numerals===void 0?HQ:eTt(qQ.call(t.numerals,String)),a=t.percent===void 0?"%":t.percent+"",s=t.minus===void 0?"−":t.minus+"",l=t.nan===void 0?"NaN":t.nan+"";function c(f){f=R_(f);var d=f.fill,h=f.align,p=f.sign,m=f.symbol,g=f.zero,v=f.width,y=f.comma,x=f.precision,b=f.trim,_=f.type;_==="n"?(y=!0,_="g"):GQ[_]||(x===void 0&&(x=12),b=!0,_="g"),(g||d==="0"&&h==="=")&&(g=!0,d="0",h="=");var S=m==="$"?n:m==="#"&&/[boxX]/.test(_)?"0"+_.toLowerCase():"",O=m==="$"?r:/[%p]/.test(_)?a:"",C=GQ[_],E=/[defgprs%]/.test(_);x=x===void 0?6:/[gprs]/.test(_)?Math.max(1,Math.min(21,x)):Math.max(0,Math.min(20,x));function k(I){var P=S,R=O,T,L,z;if(_==="c")R=C(I)+R,I="";else{I=+I;var B=I<0||1/I<0;if(I=isNaN(I)?l:C(Math.abs(I),x),b&&(I=nTt(I)),B&&+I==0&&p!=="+"&&(B=!1),P=(B?p==="("?p:s:p==="-"||p==="("?"":p)+P,R=(_==="s"?XQ[8+uge/3]:"")+R+(B&&p==="("?")":""),E){for(T=-1,L=I.length;++T<L;)if(z=I.charCodeAt(T),48>z||z>57){R=(z===46?i+I.slice(T+1):I.slice(T))+R,I=I.slice(0,T);break}}}y&&!g&&(I=e(I,1/0));var U=P.length+I.length+R.length,W=U<v?new Array(v-U+1).join(d):"";switch(y&&g&&(I=e(W+I,W.length?v-R.length:1/0),W=""),h){case"<":I=P+I+R+W;break;case"=":I=P+W+I+R;break;case"^":I=W.slice(0,U=W.length>>1)+P+I+R+W.slice(U);break;default:I=W+P+I+R;break}return o(I)}return k.toString=function(){return f+""},k}function u(f,d){var h=c((f=R_(f),f.type="f",f)),p=Math.max(-8,Math.min(8,Math.floor(Sv(d)/3)))*3,m=Math.pow(10,-p),g=XQ[8+p/3];return function(v){return h(m*v)+g}}return{format:c,formatPrefix:u}}var wO,LU,fge;oTt({thousands:",",grouping:[3],currency:["$",""]});function oTt(t){return wO=iTt(t),LU=wO.format,fge=wO.formatPrefix,wO}function aTt(t){return Math.max(0,-Sv(Math.abs(t)))}function sTt(t,e){return Math.max(0,Math.max(-8,Math.min(8,Math.floor(Sv(e)/3)))*3-Sv(Math.abs(t)))}function lTt(t,e){return t=Math.abs(t),e=Math.abs(e)-t,Math.max(0,Sv(e)-Sv(t))+1}function dge(t,e,n,r){var i=A$(t,e,n),o;switch(r=R_(r??",f"),r.type){case"s":{var a=Math.max(Math.abs(t),Math.abs(e));return r.precision==null&&!isNaN(o=sTt(i,a))&&(r.precision=o),fge(r,a)}case"":case"e":case"g":case"p":case"r":{r.precision==null&&!isNaN(o=lTt(i,Math.max(Math.abs(t),Math.abs(e))))&&(r.precision=o-(r.type==="e"));break}case"f":case"%":{r.precision==null&&!isNaN(o=aTt(i))&&(r.precision=o-(r.type==="%")*2);break}}return LU(r)}function Ad(t){var e=t.domain;return t.ticks=function(n){var r=e();return M$(r[0],r[r.length-1],n??10)},t.tickFormat=function(n,r){var i=e();return dge(i[0],i[i.length-1],n??10,r)},t.nice=function(n){n==null&&(n=10);var r=e(),i=0,o=r.length-1,a=r[i],s=r[o],l,c,u=10;for(s<a&&(c=a,a=s,s=c,c=i,i=o,o=c);u-- >0;){if(c=k$(a,s,n),c===l)return r[i]=a,r[o]=s,e(r);if(c>0)a=Math.floor(a/c)*c,s=Math.ceil(s/c)*c;else if(c<0)a=Math.ceil(a*c)/c,s=Math.floor(s*c)/c;else break;l=c}return t},t}function oP(){var t=IU();return t.copy=function(){return kw(t,oP())},Cs.apply(t,arguments),Ad(t)}function hge(t){var e;function n(r){return r==null||isNaN(r=+r)?e:r}return n.invert=n,n.domain=n.range=function(r){return arguments.length?(t=Array.from(r,rP),n):t.slice()},n.unknown=function(r){return arguments.length?(e=r,n):e},n.copy=function(){return hge(t).unknown(e)},t=arguments.length?Array.from(t,rP):[0,1],Ad(n)}function pge(t,e){t=t.slice();var n=0,r=t.length-1,i=t[n],o=t[r],a;return o<i&&(a=n,n=r,r=a,a=i,i=o,o=a),t[n]=e.floor(i),t[r]=e.ceil(o),t}function QQ(t){return Math.log(t)}function YQ(t){return Math.exp(t)}function cTt(t){return-Math.log(-t)}function uTt(t){return-Math.exp(-t)}function fTt(t){return isFinite(t)?+("1e"+t):t<0?0:t}function dTt(t){return t===10?fTt:t===Math.E?Math.exp:e=>Math.pow(t,e)}function hTt(t){return t===Math.E?Math.log:t===10&&Math.log10||t===2&&Math.log2||(t=Math.log(t),e=>Math.log(e)/t)}function KQ(t){return(e,n)=>-t(-e,n)}function NU(t){const e=t(QQ,YQ),n=e.domain;let r=10,i,o;function a(){return i=hTt(r),o=dTt(r),n()[0]<0?(i=KQ(i),o=KQ(o),t(cTt,uTt)):t(QQ,YQ),e}return e.base=function(s){return arguments.length?(r=+s,a()):r},e.domain=function(s){return arguments.length?(n(s),a()):n()},e.ticks=s=>{const l=n();let c=l[0],u=l[l.length-1];const f=u<c;f&&([c,u]=[u,c]);let d=i(c),h=i(u),p,m;const g=s==null?10:+s;let v=[];if(!(r%1)&&h-d<g){if(d=Math.floor(d),h=Math.ceil(h),c>0){for(;d<=h;++d)for(p=1;p<r;++p)if(m=d<0?p/o(-d):p*o(d),!(m<c)){if(m>u)break;v.push(m)}}else for(;d<=h;++d)for(p=r-1;p>=1;--p)if(m=d>0?p/o(-d):p*o(d),!(m<c)){if(m>u)break;v.push(m)}v.length*2<g&&(v=M$(c,u,g))}else v=M$(d,h,Math.min(h-d,g)).map(o);return f?v.reverse():v},e.tickFormat=(s,l)=>{if(s==null&&(s=10),l==null&&(l=r===10?"s":","),typeof l!="function"&&(!(r%1)&&(l=R_(l)).precision==null&&(l.trim=!0),l=LU(l)),s===1/0)return l;const c=Math.max(1,r*s/e.ticks().length);return u=>{let f=u/o(Math.round(i(u)));return f*r<r-.5&&(f*=r),f<=c?l(u):""}},e.nice=()=>n(pge(n(),{floor:s=>o(Math.floor(i(s))),ceil:s=>o(Math.ceil(i(s)))})),e}function mge(){const t=NU(xk()).domain([1,10]);return t.copy=()=>kw(t,mge()).base(t.base()),Cs.apply(t,arguments),t}function ZQ(t){return function(e){return Math.sign(e)*Math.log1p(Math.abs(e/t))}}function JQ(t){return function(e){return Math.sign(e)*Math.expm1(Math.abs(e))*t}}function $U(t){var e=1,n=t(ZQ(e),JQ(e));return n.constant=function(r){return arguments.length?t(ZQ(e=+r),JQ(e)):e},Ad(n)}function gge(){var t=$U(xk());return t.copy=function(){return kw(t,gge()).constant(t.constant())},Cs.apply(t,arguments)}function eY(t){return function(e){return e<0?-Math.pow(-e,t):Math.pow(e,t)}}function pTt(t){return t<0?-Math.sqrt(-t):Math.sqrt(t)}function mTt(t){return t<0?-t*t:t*t}function FU(t){var e=t(lo,lo),n=1;function r(){return n===1?t(lo,lo):n===.5?t(pTt,mTt):t(eY(n),eY(1/n))}return e.exponent=function(i){return arguments.length?(n=+i,r()):n},Ad(e)}function jU(){var t=FU(xk());return t.copy=function(){return kw(t,jU()).exponent(t.exponent())},Cs.apply(t,arguments),t}function gTt(){return jU.apply(null,arguments).exponent(.5)}function tY(t){return Math.sign(t)*t*t}function vTt(t){return Math.sign(t)*Math.sqrt(Math.abs(t))}function vge(){var t=IU(),e=[0,1],n=!1,r;function i(o){var a=vTt(t(o));return isNaN(a)?r:n?Math.round(a):a}return i.invert=function(o){return t.invert(tY(o))},i.domain=function(o){return arguments.length?(t.domain(o),i):t.domain()},i.range=function(o){return arguments.length?(t.range((e=Array.from(o,rP)).map(tY)),i):e.slice()},i.rangeRound=function(o){return i.range(o).round(!0)},i.round=function(o){return arguments.length?(n=!!o,i):n},i.clamp=function(o){return arguments.length?(t.clamp(o),i):t.clamp()},i.unknown=function(o){return arguments.length?(r=o,i):r},i.copy=function(){return vge(t.domain(),e).round(n).clamp(t.clamp()).unknown(r)},Cs.apply(i,arguments),Ad(i)}function yge(){var t=[],e=[],n=[],r;function i(){var a=0,s=Math.max(1,e.length);for(n=new Array(s-1);++a<s;)n[a-1]=wCt(t,a/s);return o}function o(a){return a==null||isNaN(a=+a)?r:e[Pw(n,a)]}return o.invertExtent=function(a){var s=e.indexOf(a);return s<0?[NaN,NaN]:[s>0?n[s-1]:t[0],s<n.length?n[s]:t[t.length-1]]},o.domain=function(a){if(!arguments.length)return t.slice();t=[];for(let s of a)s!=null&&!isNaN(s=+s)&&t.push(s);return t.sort(Gf),i()},o.range=function(a){return arguments.length?(e=Array.from(a),i()):e.slice()},o.unknown=function(a){return arguments.length?(r=a,o):r},o.quantiles=function(){return n.slice()},o.copy=function(){return yge().domain(t).range(e).unknown(r)},Cs.apply(o,arguments)}function xge(){var t=0,e=1,n=1,r=[.5],i=[0,1],o;function a(l){return l!=null&&l<=l?i[Pw(r,l,0,n)]:o}function s(){var l=-1;for(r=new Array(n);++l<n;)r[l]=((l+1)*e-(l-n)*t)/(n+1);return a}return a.domain=function(l){return arguments.length?([t,e]=l,t=+t,e=+e,s()):[t,e]},a.range=function(l){return arguments.length?(n=(i=Array.from(l)).length-1,s()):i.slice()},a.invertExtent=function(l){var c=i.indexOf(l);return c<0?[NaN,NaN]:c<1?[t,r[0]]:c>=n?[r[n-1],e]:[r[c-1],r[c]]},a.unknown=function(l){return arguments.length&&(o=l),a},a.thresholds=function(){return r.slice()},a.copy=function(){return xge().domain([t,e]).range(i).unknown(o)},Cs.apply(Ad(a),arguments)}function bge(){var t=[.5],e=[0,1],n,r=1;function i(o){return o!=null&&o<=o?e[Pw(t,o,0,r)]:n}return i.domain=function(o){return arguments.length?(t=Array.from(o),r=Math.min(t.length,e.length-1),i):t.slice()},i.range=function(o){return arguments.length?(e=Array.from(o),r=Math.min(t.length,e.length-1),i):e.slice()},i.invertExtent=function(o){var a=e.indexOf(o);return[t[a-1],t[a]]},i.unknown=function(o){return arguments.length?(n=o,i):n},i.copy=function(){return bge().domain(t).range(e).unknown(n)},Cs.apply(i,arguments)}const TI=new Date,EI=new Date;function ri(t,e,n,r){function i(o){return t(o=arguments.length===0?new Date:new Date(+o)),o}return i.floor=o=>(t(o=new Date(+o)),o),i.ceil=o=>(t(o=new Date(o-1)),e(o,1),t(o),o),i.round=o=>{const a=i(o),s=i.ceil(o);return o-a<s-o?a:s},i.offset=(o,a)=>(e(o=new Date(+o),a==null?1:Math.floor(a)),o),i.range=(o,a,s)=>{const l=[];if(o=i.ceil(o),s=s==null?1:Math.floor(s),!(o<a)||!(s>0))return l;let c;do l.push(c=new Date(+o)),e(o,s),t(o);while(c<o&&o<a);return l},i.filter=o=>ri(a=>{if(a>=a)for(;t(a),!o(a);)a.setTime(a-1)},(a,s)=>{if(a>=a)if(s<0)for(;++s<=0;)for(;e(a,-1),!o(a););else for(;--s>=0;)for(;e(a,1),!o(a););}),n&&(i.count=(o,a)=>(TI.setTime(+o),EI.setTime(+a),t(TI),t(EI),Math.floor(n(TI,EI))),i.every=o=>(o=Math.floor(o),!isFinite(o)||!(o>0)?null:o>1?i.filter(r?a=>r(a)%o===0:a=>i.count(0,a)%o===0):i)),i}const aP=ri(()=>{},(t,e)=>{t.setTime(+t+e)},(t,e)=>e-t);aP.every=t=>(t=Math.floor(t),!isFinite(t)||!(t>0)?null:t>1?ri(e=>{e.setTime(Math.floor(e/t)*t)},(e,n)=>{e.setTime(+e+n*t)},(e,n)=>(n-e)/t):aP);aP.range;const qc=1e3,Za=qc*60,Xc=Za*60,vu=Xc*24,BU=vu*7,nY=vu*30,PI=vu*365,Eh=ri(t=>{t.setTime(t-t.getMilliseconds())},(t,e)=>{t.setTime(+t+e*qc)},(t,e)=>(e-t)/qc,t=>t.getUTCSeconds());Eh.range;const zU=ri(t=>{t.setTime(t-t.getMilliseconds()-t.getSeconds()*qc)},(t,e)=>{t.setTime(+t+e*Za)},(t,e)=>(e-t)/Za,t=>t.getMinutes());zU.range;const UU=ri(t=>{t.setUTCSeconds(0,0)},(t,e)=>{t.setTime(+t+e*Za)},(t,e)=>(e-t)/Za,t=>t.getUTCMinutes());UU.range;const WU=ri(t=>{t.setTime(t-t.getMilliseconds()-t.getSeconds()*qc-t.getMinutes()*Za)},(t,e)=>{t.setTime(+t+e*Xc)},(t,e)=>(e-t)/Xc,t=>t.getHours());WU.range;const VU=ri(t=>{t.setUTCMinutes(0,0,0)},(t,e)=>{t.setTime(+t+e*Xc)},(t,e)=>(e-t)/Xc,t=>t.getUTCHours());VU.range;const Aw=ri(t=>t.setHours(0,0,0,0),(t,e)=>t.setDate(t.getDate()+e),(t,e)=>(e-t-(e.getTimezoneOffset()-t.getTimezoneOffset())*Za)/vu,t=>t.getDate()-1);Aw.range;const bk=ri(t=>{t.setUTCHours(0,0,0,0)},(t,e)=>{t.setUTCDate(t.getUTCDate()+e)},(t,e)=>(e-t)/vu,t=>t.getUTCDate()-1);bk.range;const _ge=ri(t=>{t.setUTCHours(0,0,0,0)},(t,e)=>{t.setUTCDate(t.getUTCDate()+e)},(t,e)=>(e-t)/vu,t=>Math.floor(t/vu));_ge.range;function Bp(t){return ri(e=>{e.setDate(e.getDate()-(e.getDay()+7-t)%7),e.setHours(0,0,0,0)},(e,n)=>{e.setDate(e.getDate()+n*7)},(e,n)=>(n-e-(n.getTimezoneOffset()-e.getTimezoneOffset())*Za)/BU)}const _k=Bp(0),sP=Bp(1),yTt=Bp(2),xTt=Bp(3),Ov=Bp(4),bTt=Bp(5),_Tt=Bp(6);_k.range;sP.range;yTt.range;xTt.range;Ov.range;bTt.range;_Tt.range;function zp(t){return ri(e=>{e.setUTCDate(e.getUTCDate()-(e.getUTCDay()+7-t)%7),e.setUTCHours(0,0,0,0)},(e,n)=>{e.setUTCDate(e.getUTCDate()+n*7)},(e,n)=>(n-e)/BU)}const wk=zp(0),lP=zp(1),wTt=zp(2),STt=zp(3),Cv=zp(4),OTt=zp(5),CTt=zp(6);wk.range;lP.range;wTt.range;STt.range;Cv.range;OTt.range;CTt.range;const GU=ri(t=>{t.setDate(1),t.setHours(0,0,0,0)},(t,e)=>{t.setMonth(t.getMonth()+e)},(t,e)=>e.getMonth()-t.getMonth()+(e.getFullYear()-t.getFullYear())*12,t=>t.getMonth());GU.range;const HU=ri(t=>{t.setUTCDate(1),t.setUTCHours(0,0,0,0)},(t,e)=>{t.setUTCMonth(t.getUTCMonth()+e)},(t,e)=>e.getUTCMonth()-t.getUTCMonth()+(e.getUTCFullYear()-t.getUTCFullYear())*12,t=>t.getUTCMonth());HU.range;const yu=ri(t=>{t.setMonth(0,1),t.setHours(0,0,0,0)},(t,e)=>{t.setFullYear(t.getFullYear()+e)},(t,e)=>e.getFullYear()-t.getFullYear(),t=>t.getFullYear());yu.every=t=>!isFinite(t=Math.floor(t))||!(t>0)?null:ri(e=>{e.setFullYear(Math.floor(e.getFullYear()/t)*t),e.setMonth(0,1),e.setHours(0,0,0,0)},(e,n)=>{e.setFullYear(e.getFullYear()+n*t)});yu.range;const xu=ri(t=>{t.setUTCMonth(0,1),t.setUTCHours(0,0,0,0)},(t,e)=>{t.setUTCFullYear(t.getUTCFullYear()+e)},(t,e)=>e.getUTCFullYear()-t.getUTCFullYear(),t=>t.getUTCFullYear());xu.every=t=>!isFinite(t=Math.floor(t))||!(t>0)?null:ri(e=>{e.setUTCFullYear(Math.floor(e.getUTCFullYear()/t)*t),e.setUTCMonth(0,1),e.setUTCHours(0,0,0,0)},(e,n)=>{e.setUTCFullYear(e.getUTCFullYear()+n*t)});xu.range;function wge(t,e,n,r,i,o){const a=[[Eh,1,qc],[Eh,5,5*qc],[Eh,15,15*qc],[Eh,30,30*qc],[o,1,Za],[o,5,5*Za],[o,15,15*Za],[o,30,30*Za],[i,1,Xc],[i,3,3*Xc],[i,6,6*Xc],[i,12,12*Xc],[r,1,vu],[r,2,2*vu],[n,1,BU],[e,1,nY],[e,3,3*nY],[t,1,PI]];function s(c,u,f){const d=u<c;d&&([c,u]=[u,c]);const h=f&&typeof f.range=="function"?f:l(c,u,f),p=h?h.range(c,+u+1):[];return d?p.reverse():p}function l(c,u,f){const d=Math.abs(u-c)/f,h=PU(([,,g])=>g).right(a,d);if(h===a.length)return t.every(A$(c/PI,u/PI,f));if(h===0)return aP.every(Math.max(A$(c,u,f),1));const[p,m]=a[d/a[h-1][2]<a[h][2]/d?h-1:h];return p.every(m)}return[s,l]}const[TTt,ETt]=wge(xu,HU,wk,_ge,VU,UU),[PTt,MTt]=wge(yu,GU,_k,Aw,WU,zU);function MI(t){if(0<=t.y&&t.y<100){var e=new Date(-1,t.m,t.d,t.H,t.M,t.S,t.L);return e.setFullYear(t.y),e}return new Date(t.y,t.m,t.d,t.H,t.M,t.S,t.L)}function kI(t){if(0<=t.y&&t.y<100){var e=new Date(Date.UTC(-1,t.m,t.d,t.H,t.M,t.S,t.L));return e.setUTCFullYear(t.y),e}return new Date(Date.UTC(t.y,t.m,t.d,t.H,t.M,t.S,t.L))}function B0(t,e,n){return{y:t,m:e,d:n,H:0,M:0,S:0,L:0}}function kTt(t){var e=t.dateTime,n=t.date,r=t.time,i=t.periods,o=t.days,a=t.shortDays,s=t.months,l=t.shortMonths,c=z0(i),u=U0(i),f=z0(o),d=U0(o),h=z0(a),p=U0(a),m=z0(s),g=U0(s),v=z0(l),y=U0(l),x={a:B,A:U,b:W,B:$,c:null,d:lY,e:lY,f:JTt,g:cEt,G:fEt,H:YTt,I:KTt,j:ZTt,L:Sge,m:eEt,M:tEt,p:N,q:D,Q:fY,s:dY,S:nEt,u:rEt,U:iEt,V:oEt,w:aEt,W:sEt,x:null,X:null,y:lEt,Y:uEt,Z:dEt,"%":uY},b={a:A,A:q,b:Y,B:K,c:null,d:cY,e:cY,f:gEt,g:TEt,G:PEt,H:hEt,I:pEt,j:mEt,L:Cge,m:vEt,M:yEt,p:se,q:te,Q:fY,s:dY,S:xEt,u:bEt,U:_Et,V:wEt,w:SEt,W:OEt,x:null,X:null,y:CEt,Y:EEt,Z:MEt,"%":uY},_={a:k,A:I,b:P,B:R,c:T,d:aY,e:aY,f:HTt,g:oY,G:iY,H:sY,I:sY,j:UTt,L:GTt,m:zTt,M:WTt,p:E,q:BTt,Q:XTt,s:QTt,S:VTt,u:LTt,U:NTt,V:$Tt,w:DTt,W:FTt,x:L,X:z,y:oY,Y:iY,Z:jTt,"%":qTt};x.x=S(n,x),x.X=S(r,x),x.c=S(e,x),b.x=S(n,b),b.X=S(r,b),b.c=S(e,b);function S(J,pe){return function(be){var re=[],ve=-1,F=0,ce=J.length,le,Q,X;for(be instanceof Date||(be=new Date(+be));++ve<ce;)J.charCodeAt(ve)===37&&(re.push(J.slice(F,ve)),(Q=rY[le=J.charAt(++ve)])!=null?le=J.charAt(++ve):Q=le==="e"?" ":"0",(X=pe[le])&&(le=X(be,Q)),re.push(le),F=ve+1);return re.push(J.slice(F,ve)),re.join("")}}function O(J,pe){return function(be){var re=B0(1900,void 0,1),ve=C(re,J,be+="",0),F,ce;if(ve!=be.length)return null;if("Q"in re)return new Date(re.Q);if("s"in re)return new Date(re.s*1e3+("L"in re?re.L:0));if(pe&&!("Z"in re)&&(re.Z=0),"p"in re&&(re.H=re.H%12+re.p*12),re.m===void 0&&(re.m="q"in re?re.q:0),"V"in re){if(re.V<1||re.V>53)return null;"w"in re||(re.w=1),"Z"in re?(F=kI(B0(re.y,0,1)),ce=F.getUTCDay(),F=ce>4||ce===0?lP.ceil(F):lP(F),F=bk.offset(F,(re.V-1)*7),re.y=F.getUTCFullYear(),re.m=F.getUTCMonth(),re.d=F.getUTCDate()+(re.w+6)%7):(F=MI(B0(re.y,0,1)),ce=F.getDay(),F=ce>4||ce===0?sP.ceil(F):sP(F),F=Aw.offset(F,(re.V-1)*7),re.y=F.getFullYear(),re.m=F.getMonth(),re.d=F.getDate()+(re.w+6)%7)}else("W"in re||"U"in re)&&("w"in re||(re.w="u"in re?re.u%7:"W"in re?1:0),ce="Z"in re?kI(B0(re.y,0,1)).getUTCDay():MI(B0(re.y,0,1)).getDay(),re.m=0,re.d="W"in re?(re.w+6)%7+re.W*7-(ce+5)%7:re.w+re.U*7-(ce+6)%7);return"Z"in re?(re.H+=re.Z/100|0,re.M+=re.Z%100,kI(re)):MI(re)}}function C(J,pe,be,re){for(var ve=0,F=pe.length,ce=be.length,le,Q;ve<F;){if(re>=ce)return-1;if(le=pe.charCodeAt(ve++),le===37){if(le=pe.charAt(ve++),Q=_[le in rY?pe.charAt(ve++):le],!Q||(re=Q(J,be,re))<0)return-1}else if(le!=be.charCodeAt(re++))return-1}return re}function E(J,pe,be){var re=c.exec(pe.slice(be));return re?(J.p=u.get(re[0].toLowerCase()),be+re[0].length):-1}function k(J,pe,be){var re=h.exec(pe.slice(be));return re?(J.w=p.get(re[0].toLowerCase()),be+re[0].length):-1}function I(J,pe,be){var re=f.exec(pe.slice(be));return re?(J.w=d.get(re[0].toLowerCase()),be+re[0].length):-1}function P(J,pe,be){var re=v.exec(pe.slice(be));return re?(J.m=y.get(re[0].toLowerCase()),be+re[0].length):-1}function R(J,pe,be){var re=m.exec(pe.slice(be));return re?(J.m=g.get(re[0].toLowerCase()),be+re[0].length):-1}function T(J,pe,be){return C(J,e,pe,be)}function L(J,pe,be){return C(J,n,pe,be)}function z(J,pe,be){return C(J,r,pe,be)}function B(J){return a[J.getDay()]}function U(J){return o[J.getDay()]}function W(J){return l[J.getMonth()]}function $(J){return s[J.getMonth()]}function N(J){return i[+(J.getHours()>=12)]}function D(J){return 1+~~(J.getMonth()/3)}function A(J){return a[J.getUTCDay()]}function q(J){return o[J.getUTCDay()]}function Y(J){return l[J.getUTCMonth()]}function K(J){return s[J.getUTCMonth()]}function se(J){return i[+(J.getUTCHours()>=12)]}function te(J){return 1+~~(J.getUTCMonth()/3)}return{format:function(J){var pe=S(J+="",x);return pe.toString=function(){return J},pe},parse:function(J){var pe=O(J+="",!1);return pe.toString=function(){return J},pe},utcFormat:function(J){var pe=S(J+="",b);return pe.toString=function(){return J},pe},utcParse:function(J){var pe=O(J+="",!0);return pe.toString=function(){return J},pe}}}var rY={"-":"",_:" ",0:"0"},gi=/^\s*\d+/,ATt=/^%/,RTt=/[\\^$*+?|[\]().{}]/g;function hn(t,e,n){var r=t<0?"-":"",i=(r?-t:t)+"",o=i.length;return r+(o<n?new Array(n-o+1).join(e)+i:i)}function ITt(t){return t.replace(RTt,"\\$&")}function z0(t){return new RegExp("^(?:"+t.map(ITt).join("|")+")","i")}function U0(t){return new Map(t.map((e,n)=>[e.toLowerCase(),n]))}function DTt(t,e,n){var r=gi.exec(e.slice(n,n+1));return r?(t.w=+r[0],n+r[0].length):-1}function LTt(t,e,n){var r=gi.exec(e.slice(n,n+1));return r?(t.u=+r[0],n+r[0].length):-1}function NTt(t,e,n){var r=gi.exec(e.slice(n,n+2));return r?(t.U=+r[0],n+r[0].length):-1}function $Tt(t,e,n){var r=gi.exec(e.slice(n,n+2));return r?(t.V=+r[0],n+r[0].length):-1}function FTt(t,e,n){var r=gi.exec(e.slice(n,n+2));return r?(t.W=+r[0],n+r[0].length):-1}function iY(t,e,n){var r=gi.exec(e.slice(n,n+4));return r?(t.y=+r[0],n+r[0].length):-1}function oY(t,e,n){var r=gi.exec(e.slice(n,n+2));return r?(t.y=+r[0]+(+r[0]>68?1900:2e3),n+r[0].length):-1}function jTt(t,e,n){var r=/^(Z)|([+-]\d\d)(?::?(\d\d))?/.exec(e.slice(n,n+6));return r?(t.Z=r[1]?0:-(r[2]+(r[3]||"00")),n+r[0].length):-1}function BTt(t,e,n){var r=gi.exec(e.slice(n,n+1));return r?(t.q=r[0]*3-3,n+r[0].length):-1}function zTt(t,e,n){var r=gi.exec(e.slice(n,n+2));return r?(t.m=r[0]-1,n+r[0].length):-1}function aY(t,e,n){var r=gi.exec(e.slice(n,n+2));return r?(t.d=+r[0],n+r[0].length):-1}function UTt(t,e,n){var r=gi.exec(e.slice(n,n+3));return r?(t.m=0,t.d=+r[0],n+r[0].length):-1}function sY(t,e,n){var r=gi.exec(e.slice(n,n+2));return r?(t.H=+r[0],n+r[0].length):-1}function WTt(t,e,n){var r=gi.exec(e.slice(n,n+2));return r?(t.M=+r[0],n+r[0].length):-1}function VTt(t,e,n){var r=gi.exec(e.slice(n,n+2));return r?(t.S=+r[0],n+r[0].length):-1}function GTt(t,e,n){var r=gi.exec(e.slice(n,n+3));return r?(t.L=+r[0],n+r[0].length):-1}function HTt(t,e,n){var r=gi.exec(e.slice(n,n+6));return r?(t.L=Math.floor(r[0]/1e3),n+r[0].length):-1}function qTt(t,e,n){var r=ATt.exec(e.slice(n,n+1));return r?n+r[0].length:-1}function XTt(t,e,n){var r=gi.exec(e.slice(n));return r?(t.Q=+r[0],n+r[0].length):-1}function QTt(t,e,n){var r=gi.exec(e.slice(n));return r?(t.s=+r[0],n+r[0].length):-1}function lY(t,e){return hn(t.getDate(),e,2)}function YTt(t,e){return hn(t.getHours(),e,2)}function KTt(t,e){return hn(t.getHours()%12||12,e,2)}function ZTt(t,e){return hn(1+Aw.count(yu(t),t),e,3)}function Sge(t,e){return hn(t.getMilliseconds(),e,3)}function JTt(t,e){return Sge(t,e)+"000"}function eEt(t,e){return hn(t.getMonth()+1,e,2)}function tEt(t,e){return hn(t.getMinutes(),e,2)}function nEt(t,e){return hn(t.getSeconds(),e,2)}function rEt(t){var e=t.getDay();return e===0?7:e}function iEt(t,e){return hn(_k.count(yu(t)-1,t),e,2)}function Oge(t){var e=t.getDay();return e>=4||e===0?Ov(t):Ov.ceil(t)}function oEt(t,e){return t=Oge(t),hn(Ov.count(yu(t),t)+(yu(t).getDay()===4),e,2)}function aEt(t){return t.getDay()}function sEt(t,e){return hn(sP.count(yu(t)-1,t),e,2)}function lEt(t,e){return hn(t.getFullYear()%100,e,2)}function cEt(t,e){return t=Oge(t),hn(t.getFullYear()%100,e,2)}function uEt(t,e){return hn(t.getFullYear()%1e4,e,4)}function fEt(t,e){var n=t.getDay();return t=n>=4||n===0?Ov(t):Ov.ceil(t),hn(t.getFullYear()%1e4,e,4)}function dEt(t){var e=t.getTimezoneOffset();return(e>0?"-":(e*=-1,"+"))+hn(e/60|0,"0",2)+hn(e%60,"0",2)}function cY(t,e){return hn(t.getUTCDate(),e,2)}function hEt(t,e){return hn(t.getUTCHours(),e,2)}function pEt(t,e){return hn(t.getUTCHours()%12||12,e,2)}function mEt(t,e){return hn(1+bk.count(xu(t),t),e,3)}function Cge(t,e){return hn(t.getUTCMilliseconds(),e,3)}function gEt(t,e){return Cge(t,e)+"000"}function vEt(t,e){return hn(t.getUTCMonth()+1,e,2)}function yEt(t,e){return hn(t.getUTCMinutes(),e,2)}function xEt(t,e){return hn(t.getUTCSeconds(),e,2)}function bEt(t){var e=t.getUTCDay();return e===0?7:e}function _Et(t,e){return hn(wk.count(xu(t)-1,t),e,2)}function Tge(t){var e=t.getUTCDay();return e>=4||e===0?Cv(t):Cv.ceil(t)}function wEt(t,e){return t=Tge(t),hn(Cv.count(xu(t),t)+(xu(t).getUTCDay()===4),e,2)}function SEt(t){return t.getUTCDay()}function OEt(t,e){return hn(lP.count(xu(t)-1,t),e,2)}function CEt(t,e){return hn(t.getUTCFullYear()%100,e,2)}function TEt(t,e){return t=Tge(t),hn(t.getUTCFullYear()%100,e,2)}function EEt(t,e){return hn(t.getUTCFullYear()%1e4,e,4)}function PEt(t,e){var n=t.getUTCDay();return t=n>=4||n===0?Cv(t):Cv.ceil(t),hn(t.getUTCFullYear()%1e4,e,4)}function MEt(){return"+0000"}function uY(){return"%"}function fY(t){return+t}function dY(t){return Math.floor(+t/1e3)}var hm,Ege,Pge;kEt({dateTime:"%x, %X",date:"%-m/%-d/%Y",time:"%-I:%M:%S %p",periods:["AM","PM"],days:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],shortDays:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],months:["January","February","March","April","May","June","July","August","September","October","November","December"],shortMonths:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"]});function kEt(t){return hm=kTt(t),Ege=hm.format,hm.parse,Pge=hm.utcFormat,hm.utcParse,hm}function AEt(t){return new Date(t)}function REt(t){return t instanceof Date?+t:+new Date(+t)}function qU(t,e,n,r,i,o,a,s,l,c){var u=IU(),f=u.invert,d=u.domain,h=c(".%L"),p=c(":%S"),m=c("%I:%M"),g=c("%I %p"),v=c("%a %d"),y=c("%b %d"),x=c("%B"),b=c("%Y");function _(S){return(l(S)<S?h:s(S)<S?p:a(S)<S?m:o(S)<S?g:r(S)<S?i(S)<S?v:y:n(S)<S?x:b)(S)}return u.invert=function(S){return new Date(f(S))},u.domain=function(S){return arguments.length?d(Array.from(S,REt)):d().map(AEt)},u.ticks=function(S){var O=d();return t(O[0],O[O.length-1],S??10)},u.tickFormat=function(S,O){return O==null?_:c(O)},u.nice=function(S){var O=d();return(!S||typeof S.range!="function")&&(S=e(O[0],O[O.length-1],S??10)),S?d(pge(O,S)):u},u.copy=function(){return kw(u,qU(t,e,n,r,i,o,a,s,l,c))},u}function IEt(){return Cs.apply(qU(PTt,MTt,yu,GU,_k,Aw,WU,zU,Eh,Ege).domain([new Date(2e3,0,1),new Date(2e3,0,2)]),arguments)}function DEt(){return Cs.apply(qU(TTt,ETt,xu,HU,wk,bk,VU,UU,Eh,Pge).domain([Date.UTC(2e3,0,1),Date.UTC(2e3,0,2)]),arguments)}function Sk(){var t=0,e=1,n,r,i,o,a=lo,s=!1,l;function c(f){return f==null||isNaN(f=+f)?l:a(i===0?.5:(f=(o(f)-n)*i,s?Math.max(0,Math.min(1,f)):f))}c.domain=function(f){return arguments.length?([t,e]=f,n=o(t=+t),r=o(e=+e),i=n===r?0:1/(r-n),c):[t,e]},c.clamp=function(f){return arguments.length?(s=!!f,c):s},c.interpolator=function(f){return arguments.length?(a=f,c):a};function u(f){return function(d){var h,p;return arguments.length?([h,p]=d,a=f(h,p),c):[a(0),a(1)]}}return c.range=u(Wy),c.rangeRound=u(RU),c.unknown=function(f){return arguments.length?(l=f,c):l},function(f){return o=f,n=f(t),r=f(e),i=n===r?0:1/(r-n),c}}function Rd(t,e){return e.domain(t.domain()).interpolator(t.interpolator()).clamp(t.clamp()).unknown(t.unknown())}function Mge(){var t=Ad(Sk()(lo));return t.copy=function(){return Rd(t,Mge())},Tu.apply(t,arguments)}function kge(){var t=NU(Sk()).domain([1,10]);return t.copy=function(){return Rd(t,kge()).base(t.base())},Tu.apply(t,arguments)}function Age(){var t=$U(Sk());return t.copy=function(){return Rd(t,Age()).constant(t.constant())},Tu.apply(t,arguments)}function XU(){var t=FU(Sk());return t.copy=function(){return Rd(t,XU()).exponent(t.exponent())},Tu.apply(t,arguments)}function LEt(){return XU.apply(null,arguments).exponent(.5)}function Rge(){var t=[],e=lo;function n(r){if(r!=null&&!isNaN(r=+r))return e((Pw(t,r,1)-1)/(t.length-1))}return n.domain=function(r){if(!arguments.length)return t.slice();t=[];for(let i of r)i!=null&&!isNaN(i=+i)&&t.push(i);return t.sort(Gf),n},n.interpolator=function(r){return arguments.length?(e=r,n):e},n.range=function(){return t.map((r,i)=>e(i/(t.length-1)))},n.quantiles=function(r){return Array.from({length:r+1},(i,o)=>_Ct(t,o/r))},n.copy=function(){return Rge(e).domain(t)},Tu.apply(n,arguments)}function Ok(){var t=0,e=.5,n=1,r=1,i,o,a,s,l,c=lo,u,f=!1,d;function h(m){return isNaN(m=+m)?d:(m=.5+((m=+u(m))-o)*(r*m<r*o?s:l),c(f?Math.max(0,Math.min(1,m)):m))}h.domain=function(m){return arguments.length?([t,e,n]=m,i=u(t=+t),o=u(e=+e),a=u(n=+n),s=i===o?0:.5/(o-i),l=o===a?0:.5/(a-o),r=o<i?-1:1,h):[t,e,n]},h.clamp=function(m){return arguments.length?(f=!!m,h):f},h.interpolator=function(m){return arguments.length?(c=m,h):c};function p(m){return function(g){var v,y,x;return arguments.length?([v,y,x]=g,c=qCt(m,[v,y,x]),h):[c(0),c(.5),c(1)]}}return h.range=p(Wy),h.rangeRound=p(RU),h.unknown=function(m){return arguments.length?(d=m,h):d},function(m){return u=m,i=m(t),o=m(e),a=m(n),s=i===o?0:.5/(o-i),l=o===a?0:.5/(a-o),r=o<i?-1:1,h}}function Ige(){var t=Ad(Ok()(lo));return t.copy=function(){return Rd(t,Ige())},Tu.apply(t,arguments)}function Dge(){var t=NU(Ok()).domain([.1,1,10]);return t.copy=function(){return Rd(t,Dge()).base(t.base())},Tu.apply(t,arguments)}function Lge(){var t=$U(Ok());return t.copy=function(){return Rd(t,Lge()).constant(t.constant())},Tu.apply(t,arguments)}function QU(){var t=FU(Ok());return t.copy=function(){return Rd(t,QU()).exponent(t.exponent())},Tu.apply(t,arguments)}function NEt(){return QU.apply(null,arguments).exponent(.5)}const hY=Object.freeze(Object.defineProperty({__proto__:null,scaleBand:P_,scaleDiverging:Ige,scaleDivergingLog:Dge,scaleDivergingPow:QU,scaleDivergingSqrt:NEt,scaleDivergingSymlog:Lge,scaleIdentity:hge,scaleImplicit:R$,scaleLinear:oP,scaleLog:mge,scaleOrdinal:MU,scalePoint:ab,scalePow:jU,scaleQuantile:yge,scaleQuantize:xge,scaleRadial:vge,scaleSequential:Mge,scaleSequentialLog:kge,scaleSequentialPow:XU,scaleSequentialQuantile:Rge,scaleSequentialSqrt:LEt,scaleSequentialSymlog:Age,scaleSqrt:gTt,scaleSymlog:gge,scaleThreshold:bge,scaleTime:IEt,scaleUtc:DEt,tickFormat:dge},Symbol.toStringTag,{value:"Module"}));var $Et=Iy;function FEt(t,e,n){for(var r=-1,i=t.length;++r<i;){var o=t[r],a=e(o);if(a!=null&&(s===void 0?a===a&&!$Et(a):n(a,s)))var s=a,l=o}return l}var Nge=FEt;function jEt(t,e){return t>e}var BEt=jEt,zEt=Nge,UEt=BEt,WEt=Uy;function VEt(t){return t&&t.length?zEt(t,WEt,UEt):void 0}var GEt=VEt;const Ef=$t(GEt);function HEt(t,e){return t<e}var qEt=HEt,XEt=Nge,QEt=qEt,YEt=Uy;function KEt(t){return t&&t.length?XEt(t,YEt,QEt):void 0}var ZEt=KEt;const Ck=$t(ZEt);var JEt=fU,ePt=kd,tPt=Wme,nPt=qo;function rPt(t,e){var n=nPt(t)?JEt:tPt;return n(t,ePt(e))}var iPt=rPt,oPt=zme,aPt=iPt;function sPt(t,e){return oPt(aPt(t,e),1)}var lPt=sPt;const cPt=$t(lPt);var uPt=OU;function fPt(t,e){return uPt(t,e)}var dPt=fPt;const Tv=$t(dPt);var Vy=1e9,hPt={precision:20,rounding:4,toExpNeg:-7,toExpPos:21,LN10:"2.302585092994045684017991454684364207601101488628772976033327900967572609677352480235997205089598298341967784042286"},KU,dr=!0,gs="[DecimalError] ",Gh=gs+"Invalid argument: ",YU=gs+"Exponent out of range: ",Gy=Math.floor,nh=Math.pow,pPt=/^(\d+(\.\d*)?|\.\d+)(e[+-]?\d+)?$/i,ha,li=1e7,Yn=7,$ge=9007199254740991,cP=Gy($ge/Yn),dt={};dt.absoluteValue=dt.abs=function(){var t=new this.constructor(this);return t.s&&(t.s=1),t};dt.comparedTo=dt.cmp=function(t){var e,n,r,i,o=this;if(t=new o.constructor(t),o.s!==t.s)return o.s||-t.s;if(o.e!==t.e)return o.e>t.e^o.s<0?1:-1;for(r=o.d.length,i=t.d.length,e=0,n=r<i?r:i;e<n;++e)if(o.d[e]!==t.d[e])return o.d[e]>t.d[e]^o.s<0?1:-1;return r===i?0:r>i^o.s<0?1:-1};dt.decimalPlaces=dt.dp=function(){var t=this,e=t.d.length-1,n=(e-t.e)*Yn;if(e=t.d[e],e)for(;e%10==0;e/=10)n--;return n<0?0:n};dt.dividedBy=dt.div=function(t){return iu(this,new this.constructor(t))};dt.dividedToIntegerBy=dt.idiv=function(t){var e=this,n=e.constructor;return Nn(iu(e,new n(t),0,1),n.precision)};dt.equals=dt.eq=function(t){return!this.cmp(t)};dt.exponent=function(){return Gr(this)};dt.greaterThan=dt.gt=function(t){return this.cmp(t)>0};dt.greaterThanOrEqualTo=dt.gte=function(t){return this.cmp(t)>=0};dt.isInteger=dt.isint=function(){return this.e>this.d.length-2};dt.isNegative=dt.isneg=function(){return this.s<0};dt.isPositive=dt.ispos=function(){return this.s>0};dt.isZero=function(){return this.s===0};dt.lessThan=dt.lt=function(t){return this.cmp(t)<0};dt.lessThanOrEqualTo=dt.lte=function(t){return this.cmp(t)<1};dt.logarithm=dt.log=function(t){var e,n=this,r=n.constructor,i=r.precision,o=i+5;if(t===void 0)t=new r(10);else if(t=new r(t),t.s<1||t.eq(ha))throw Error(gs+"NaN");if(n.s<1)throw Error(gs+(n.s?"NaN":"-Infinity"));return n.eq(ha)?new r(0):(dr=!1,e=iu(I_(n,o),I_(t,o),o),dr=!0,Nn(e,i))};dt.minus=dt.sub=function(t){var e=this;return t=new e.constructor(t),e.s==t.s?Bge(e,t):Fge(e,(t.s=-t.s,t))};dt.modulo=dt.mod=function(t){var e,n=this,r=n.constructor,i=r.precision;if(t=new r(t),!t.s)throw Error(gs+"NaN");return n.s?(dr=!1,e=iu(n,t,0,1).times(t),dr=!0,n.minus(e)):Nn(new r(n),i)};dt.naturalExponential=dt.exp=function(){return jge(this)};dt.naturalLogarithm=dt.ln=function(){return I_(this)};dt.negated=dt.neg=function(){var t=new this.constructor(this);return t.s=-t.s||0,t};dt.plus=dt.add=function(t){var e=this;return t=new e.constructor(t),e.s==t.s?Fge(e,t):Bge(e,(t.s=-t.s,t))};dt.precision=dt.sd=function(t){var e,n,r,i=this;if(t!==void 0&&t!==!!t&&t!==1&&t!==0)throw Error(Gh+t);if(e=Gr(i)+1,r=i.d.length-1,n=r*Yn+1,r=i.d[r],r){for(;r%10==0;r/=10)n--;for(r=i.d[0];r>=10;r/=10)n++}return t&&e>n?e:n};dt.squareRoot=dt.sqrt=function(){var t,e,n,r,i,o,a,s=this,l=s.constructor;if(s.s<1){if(!s.s)return new l(0);throw Error(gs+"NaN")}for(t=Gr(s),dr=!1,i=Math.sqrt(+s),i==0||i==1/0?(e=$l(s.d),(e.length+t)%2==0&&(e+="0"),i=Math.sqrt(e),t=Gy((t+1)/2)-(t<0||t%2),i==1/0?e="5e"+t:(e=i.toExponential(),e=e.slice(0,e.indexOf("e")+1)+t),r=new l(e)):r=new l(i.toString()),n=l.precision,i=a=n+3;;)if(o=r,r=o.plus(iu(s,o,a+2)).times(.5),$l(o.d).slice(0,a)===(e=$l(r.d)).slice(0,a)){if(e=e.slice(a-3,a+1),i==a&&e=="4999"){if(Nn(o,n+1,0),o.times(o).eq(s)){r=o;break}}else if(e!="9999")break;a+=4}return dr=!0,Nn(r,n)};dt.times=dt.mul=function(t){var e,n,r,i,o,a,s,l,c,u=this,f=u.constructor,d=u.d,h=(t=new f(t)).d;if(!u.s||!t.s)return new f(0);for(t.s*=u.s,n=u.e+t.e,l=d.length,c=h.length,l<c&&(o=d,d=h,h=o,a=l,l=c,c=a),o=[],a=l+c,r=a;r--;)o.push(0);for(r=c;--r>=0;){for(e=0,i=l+r;i>r;)s=o[i]+h[r]*d[i-r-1]+e,o[i--]=s%li|0,e=s/li|0;o[i]=(o[i]+e)%li|0}for(;!o[--a];)o.pop();return e?++n:o.shift(),t.d=o,t.e=n,dr?Nn(t,f.precision):t};dt.toDecimalPlaces=dt.todp=function(t,e){var n=this,r=n.constructor;return n=new r(n),t===void 0?n:(nc(t,0,Vy),e===void 0?e=r.rounding:nc(e,0,8),Nn(n,t+Gr(n)+1,e))};dt.toExponential=function(t,e){var n,r=this,i=r.constructor;return t===void 0?n=pp(r,!0):(nc(t,0,Vy),e===void 0?e=i.rounding:nc(e,0,8),r=Nn(new i(r),t+1,e),n=pp(r,!0,t+1)),n};dt.toFixed=function(t,e){var n,r,i=this,o=i.constructor;return t===void 0?pp(i):(nc(t,0,Vy),e===void 0?e=o.rounding:nc(e,0,8),r=Nn(new o(i),t+Gr(i)+1,e),n=pp(r.abs(),!1,t+Gr(r)+1),i.isneg()&&!i.isZero()?"-"+n:n)};dt.toInteger=dt.toint=function(){var t=this,e=t.constructor;return Nn(new e(t),Gr(t)+1,e.rounding)};dt.toNumber=function(){return+this};dt.toPower=dt.pow=function(t){var e,n,r,i,o,a,s=this,l=s.constructor,c=12,u=+(t=new l(t));if(!t.s)return new l(ha);if(s=new l(s),!s.s){if(t.s<1)throw Error(gs+"Infinity");return s}if(s.eq(ha))return s;if(r=l.precision,t.eq(ha))return Nn(s,r);if(e=t.e,n=t.d.length-1,a=e>=n,o=s.s,a){if((n=u<0?-u:u)<=$ge){for(i=new l(ha),e=Math.ceil(r/Yn+4),dr=!1;n%2&&(i=i.times(s),mY(i.d,e)),n=Gy(n/2),n!==0;)s=s.times(s),mY(s.d,e);return dr=!0,t.s<0?new l(ha).div(i):Nn(i,r)}}else if(o<0)throw Error(gs+"NaN");return o=o<0&&t.d[Math.max(e,n)]&1?-1:1,s.s=1,dr=!1,i=t.times(I_(s,r+c)),dr=!0,i=jge(i),i.s=o,i};dt.toPrecision=function(t,e){var n,r,i=this,o=i.constructor;return t===void 0?(n=Gr(i),r=pp(i,n<=o.toExpNeg||n>=o.toExpPos)):(nc(t,1,Vy),e===void 0?e=o.rounding:nc(e,0,8),i=Nn(new o(i),t,e),n=Gr(i),r=pp(i,t<=n||n<=o.toExpNeg,t)),r};dt.toSignificantDigits=dt.tosd=function(t,e){var n=this,r=n.constructor;return t===void 0?(t=r.precision,e=r.rounding):(nc(t,1,Vy),e===void 0?e=r.rounding:nc(e,0,8)),Nn(new r(n),t,e)};dt.toString=dt.valueOf=dt.val=dt.toJSON=dt[Symbol.for("nodejs.util.inspect.custom")]=function(){var t=this,e=Gr(t),n=t.constructor;return pp(t,e<=n.toExpNeg||e>=n.toExpPos)};function Fge(t,e){var n,r,i,o,a,s,l,c,u=t.constructor,f=u.precision;if(!t.s||!e.s)return e.s||(e=new u(t)),dr?Nn(e,f):e;if(l=t.d,c=e.d,a=t.e,i=e.e,l=l.slice(),o=a-i,o){for(o<0?(r=l,o=-o,s=c.length):(r=c,i=a,s=l.length),a=Math.ceil(f/Yn),s=a>s?a+1:s+1,o>s&&(o=s,r.length=1),r.reverse();o--;)r.push(0);r.reverse()}for(s=l.length,o=c.length,s-o<0&&(o=s,r=c,c=l,l=r),n=0;o;)n=(l[--o]=l[o]+c[o]+n)/li|0,l[o]%=li;for(n&&(l.unshift(n),++i),s=l.length;l[--s]==0;)l.pop();return e.d=l,e.e=i,dr?Nn(e,f):e}function nc(t,e,n){if(t!==~~t||t<e||t>n)throw Error(Gh+t)}function $l(t){var e,n,r,i=t.length-1,o="",a=t[0];if(i>0){for(o+=a,e=1;e<i;e++)r=t[e]+"",n=Yn-r.length,n&&(o+=ff(n)),o+=r;a=t[e],r=a+"",n=Yn-r.length,n&&(o+=ff(n))}else if(a===0)return"0";for(;a%10===0;)a/=10;return o+a}var iu=function(){function t(r,i){var o,a=0,s=r.length;for(r=r.slice();s--;)o=r[s]*i+a,r[s]=o%li|0,a=o/li|0;return a&&r.unshift(a),r}function e(r,i,o,a){var s,l;if(o!=a)l=o>a?1:-1;else for(s=l=0;s<o;s++)if(r[s]!=i[s]){l=r[s]>i[s]?1:-1;break}return l}function n(r,i,o){for(var a=0;o--;)r[o]-=a,a=r[o]<i[o]?1:0,r[o]=a*li+r[o]-i[o];for(;!r[0]&&r.length>1;)r.shift()}return function(r,i,o,a){var s,l,c,u,f,d,h,p,m,g,v,y,x,b,_,S,O,C,E=r.constructor,k=r.s==i.s?1:-1,I=r.d,P=i.d;if(!r.s)return new E(r);if(!i.s)throw Error(gs+"Division by zero");for(l=r.e-i.e,O=P.length,_=I.length,h=new E(k),p=h.d=[],c=0;P[c]==(I[c]||0);)++c;if(P[c]>(I[c]||0)&&--l,o==null?y=o=E.precision:a?y=o+(Gr(r)-Gr(i))+1:y=o,y<0)return new E(0);if(y=y/Yn+2|0,c=0,O==1)for(u=0,P=P[0],y++;(c<_||u)&&y--;c++)x=u*li+(I[c]||0),p[c]=x/P|0,u=x%P|0;else{for(u=li/(P[0]+1)|0,u>1&&(P=t(P,u),I=t(I,u),O=P.length,_=I.length),b=O,m=I.slice(0,O),g=m.length;g<O;)m[g++]=0;C=P.slice(),C.unshift(0),S=P[0],P[1]>=li/2&&++S;do u=0,s=e(P,m,O,g),s<0?(v=m[0],O!=g&&(v=v*li+(m[1]||0)),u=v/S|0,u>1?(u>=li&&(u=li-1),f=t(P,u),d=f.length,g=m.length,s=e(f,m,d,g),s==1&&(u--,n(f,O<d?C:P,d))):(u==0&&(s=u=1),f=P.slice()),d=f.length,d<g&&f.unshift(0),n(m,f,g),s==-1&&(g=m.length,s=e(P,m,O,g),s<1&&(u++,n(m,O<g?C:P,g))),g=m.length):s===0&&(u++,m=[0]),p[c++]=u,s&&m[0]?m[g++]=I[b]||0:(m=[I[b]],g=1);while((b++<_||m[0]!==void 0)&&y--)}return p[0]||p.shift(),h.e=l,Nn(h,a?o+Gr(h)+1:o)}}();function jge(t,e){var n,r,i,o,a,s,l=0,c=0,u=t.constructor,f=u.precision;if(Gr(t)>16)throw Error(YU+Gr(t));if(!t.s)return new u(ha);for(e==null?(dr=!1,s=f):s=e,a=new u(.03125);t.abs().gte(.1);)t=t.times(a),c+=5;for(r=Math.log(nh(2,c))/Math.LN10*2+5|0,s+=r,n=i=o=new u(ha),u.precision=s;;){if(i=Nn(i.times(t),s),n=n.times(++l),a=o.plus(iu(i,n,s)),$l(a.d).slice(0,s)===$l(o.d).slice(0,s)){for(;c--;)o=Nn(o.times(o),s);return u.precision=f,e==null?(dr=!0,Nn(o,f)):o}o=a}}function Gr(t){for(var e=t.e*Yn,n=t.d[0];n>=10;n/=10)e++;return e}function AI(t,e,n){if(e>t.LN10.sd())throw dr=!0,n&&(t.precision=n),Error(gs+"LN10 precision limit exceeded");return Nn(new t(t.LN10),e)}function ff(t){for(var e="";t--;)e+="0";return e}function I_(t,e){var n,r,i,o,a,s,l,c,u,f=1,d=10,h=t,p=h.d,m=h.constructor,g=m.precision;if(h.s<1)throw Error(gs+(h.s?"NaN":"-Infinity"));if(h.eq(ha))return new m(0);if(e==null?(dr=!1,c=g):c=e,h.eq(10))return e==null&&(dr=!0),AI(m,c);if(c+=d,m.precision=c,n=$l(p),r=n.charAt(0),o=Gr(h),Math.abs(o)<15e14){for(;r<7&&r!=1||r==1&&n.charAt(1)>3;)h=h.times(t),n=$l(h.d),r=n.charAt(0),f++;o=Gr(h),r>1?(h=new m("0."+n),o++):h=new m(r+"."+n.slice(1))}else return l=AI(m,c+2,g).times(o+""),h=I_(new m(r+"."+n.slice(1)),c-d).plus(l),m.precision=g,e==null?(dr=!0,Nn(h,g)):h;for(s=a=h=iu(h.minus(ha),h.plus(ha),c),u=Nn(h.times(h),c),i=3;;){if(a=Nn(a.times(u),c),l=s.plus(iu(a,new m(i),c)),$l(l.d).slice(0,c)===$l(s.d).slice(0,c))return s=s.times(2),o!==0&&(s=s.plus(AI(m,c+2,g).times(o+""))),s=iu(s,new m(f),c),m.precision=g,e==null?(dr=!0,Nn(s,g)):s;s=l,i+=2}}function pY(t,e){var n,r,i;for((n=e.indexOf("."))>-1&&(e=e.replace(".","")),(r=e.search(/e/i))>0?(n<0&&(n=r),n+=+e.slice(r+1),e=e.substring(0,r)):n<0&&(n=e.length),r=0;e.charCodeAt(r)===48;)++r;for(i=e.length;e.charCodeAt(i-1)===48;)--i;if(e=e.slice(r,i),e){if(i-=r,n=n-r-1,t.e=Gy(n/Yn),t.d=[],r=(n+1)%Yn,n<0&&(r+=Yn),r<i){for(r&&t.d.push(+e.slice(0,r)),i-=Yn;r<i;)t.d.push(+e.slice(r,r+=Yn));e=e.slice(r),r=Yn-e.length}else r-=i;for(;r--;)e+="0";if(t.d.push(+e),dr&&(t.e>cP||t.e<-cP))throw Error(YU+n)}else t.s=0,t.e=0,t.d=[0];return t}function Nn(t,e,n){var r,i,o,a,s,l,c,u,f=t.d;for(a=1,o=f[0];o>=10;o/=10)a++;if(r=e-a,r<0)r+=Yn,i=e,c=f[u=0];else{if(u=Math.ceil((r+1)/Yn),o=f.length,u>=o)return t;for(c=o=f[u],a=1;o>=10;o/=10)a++;r%=Yn,i=r-Yn+a}if(n!==void 0&&(o=nh(10,a-i-1),s=c/o%10|0,l=e<0||f[u+1]!==void 0||c%o,l=n<4?(s||l)&&(n==0||n==(t.s<0?3:2)):s>5||s==5&&(n==4||l||n==6&&(r>0?i>0?c/nh(10,a-i):0:f[u-1])%10&1||n==(t.s<0?8:7))),e<1||!f[0])return l?(o=Gr(t),f.length=1,e=e-o-1,f[0]=nh(10,(Yn-e%Yn)%Yn),t.e=Gy(-e/Yn)||0):(f.length=1,f[0]=t.e=t.s=0),t;if(r==0?(f.length=u,o=1,u--):(f.length=u+1,o=nh(10,Yn-r),f[u]=i>0?(c/nh(10,a-i)%nh(10,i)|0)*o:0),l)for(;;)if(u==0){(f[0]+=o)==li&&(f[0]=1,++t.e);break}else{if(f[u]+=o,f[u]!=li)break;f[u--]=0,o=1}for(r=f.length;f[--r]===0;)f.pop();if(dr&&(t.e>cP||t.e<-cP))throw Error(YU+Gr(t));return t}function Bge(t,e){var n,r,i,o,a,s,l,c,u,f,d=t.constructor,h=d.precision;if(!t.s||!e.s)return e.s?e.s=-e.s:e=new d(t),dr?Nn(e,h):e;if(l=t.d,f=e.d,r=e.e,c=t.e,l=l.slice(),a=c-r,a){for(u=a<0,u?(n=l,a=-a,s=f.length):(n=f,r=c,s=l.length),i=Math.max(Math.ceil(h/Yn),s)+2,a>i&&(a=i,n.length=1),n.reverse(),i=a;i--;)n.push(0);n.reverse()}else{for(i=l.length,s=f.length,u=i<s,u&&(s=i),i=0;i<s;i++)if(l[i]!=f[i]){u=l[i]<f[i];break}a=0}for(u&&(n=l,l=f,f=n,e.s=-e.s),s=l.length,i=f.length-s;i>0;--i)l[s++]=0;for(i=f.length;i>a;){if(l[--i]<f[i]){for(o=i;o&&l[--o]===0;)l[o]=li-1;--l[o],l[i]+=li}l[i]-=f[i]}for(;l[--s]===0;)l.pop();for(;l[0]===0;l.shift())--r;return l[0]?(e.d=l,e.e=r,dr?Nn(e,h):e):new d(0)}function pp(t,e,n){var r,i=Gr(t),o=$l(t.d),a=o.length;return e?(n&&(r=n-a)>0?o=o.charAt(0)+"."+o.slice(1)+ff(r):a>1&&(o=o.charAt(0)+"."+o.slice(1)),o=o+(i<0?"e":"e+")+i):i<0?(o="0."+ff(-i-1)+o,n&&(r=n-a)>0&&(o+=ff(r))):i>=a?(o+=ff(i+1-a),n&&(r=n-i-1)>0&&(o=o+"."+ff(r))):((r=i+1)<a&&(o=o.slice(0,r)+"."+o.slice(r)),n&&(r=n-a)>0&&(i+1===a&&(o+="."),o+=ff(r))),t.s<0?"-"+o:o}function mY(t,e){if(t.length>e)return t.length=e,!0}function zge(t){var e,n,r;function i(o){var a=this;if(!(a instanceof i))return new i(o);if(a.constructor=i,o instanceof i){a.s=o.s,a.e=o.e,a.d=(o=o.d)?o.slice():o;return}if(typeof o=="number"){if(o*0!==0)throw Error(Gh+o);if(o>0)a.s=1;else if(o<0)o=-o,a.s=-1;else{a.s=0,a.e=0,a.d=[0];return}if(o===~~o&&o<1e7){a.e=0,a.d=[o];return}return pY(a,o.toString())}else if(typeof o!="string")throw Error(Gh+o);if(o.charCodeAt(0)===45?(o=o.slice(1),a.s=-1):a.s=1,pPt.test(o))pY(a,o);else throw Error(Gh+o)}if(i.prototype=dt,i.ROUND_UP=0,i.ROUND_DOWN=1,i.ROUND_CEIL=2,i.ROUND_FLOOR=3,i.ROUND_HALF_UP=4,i.ROUND_HALF_DOWN=5,i.ROUND_HALF_EVEN=6,i.ROUND_HALF_CEIL=7,i.ROUND_HALF_FLOOR=8,i.clone=zge,i.config=i.set=mPt,t===void 0&&(t={}),t)for(r=["precision","rounding","toExpNeg","toExpPos","LN10"],e=0;e<r.length;)t.hasOwnProperty(n=r[e++])||(t[n]=this[n]);return i.config(t),i}function mPt(t){if(!t||typeof t!="object")throw Error(gs+"Object expected");var e,n,r,i=["precision",1,Vy,"rounding",0,8,"toExpNeg",-1/0,0,"toExpPos",0,1/0];for(e=0;e<i.length;e+=3)if((r=t[n=i[e]])!==void 0)if(Gy(r)===r&&r>=i[e+1]&&r<=i[e+2])this[n]=r;else throw Error(Gh+n+": "+r);if((r=t[n="LN10"])!==void 0)if(r==Math.LN10)this[n]=new this(r);else throw Error(Gh+n+": "+r);return this}var KU=zge(hPt);ha=new KU(1);const Rn=KU;function gPt(t){return bPt(t)||xPt(t)||yPt(t)||vPt()}function vPt(){throw new TypeError(`Invalid attempt to spread non-iterable instance.
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function yPt(t,e){if(t){if(typeof t=="string")return N$(t,e);var n=Object.prototype.toString.call(t).slice(8,-1);if(n==="Object"&&t.constructor&&(n=t.constructor.name),n==="Map"||n==="Set")return Array.from(t);if(n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return N$(t,e)}}function xPt(t){if(typeof Symbol<"u"&&Symbol.iterator in Object(t))return Array.from(t)}function bPt(t){if(Array.isArray(t))return N$(t)}function N$(t,e){(e==null||e>t.length)&&(e=t.length);for(var n=0,r=new Array(e);n<e;n++)r[n]=t[n];return r}var _Pt=function(e){return e},Uge={"@@functional/placeholder":!0},Wge=function(e){return e===Uge},gY=function(e){return function n(){return arguments.length===0||arguments.length===1&&Wge(arguments.length<=0?void 0:arguments[0])?n:e.apply(void 0,arguments)}},wPt=function t(e,n){return e===1?n:gY(function(){for(var r=arguments.length,i=new Array(r),o=0;o<r;o++)i[o]=arguments[o];var a=i.filter(function(s){return s!==Uge}).length;return a>=e?n.apply(void 0,i):t(e-a,gY(function(){for(var s=arguments.length,l=new Array(s),c=0;c<s;c++)l[c]=arguments[c];var u=i.map(function(f){return Wge(f)?l.shift():f});return n.apply(void 0,gPt(u).concat(l))}))})},Tk=function(e){return wPt(e.length,e)},$$=function(e,n){for(var r=[],i=e;i<n;++i)r[i-e]=i;return r},SPt=Tk(function(t,e){return Array.isArray(e)?e.map(t):Object.keys(e).map(function(n){return e[n]}).map(t)}),OPt=function(){for(var e=arguments.length,n=new Array(e),r=0;r<e;r++)n[r]=arguments[r];if(!n.length)return _Pt;var i=n.reverse(),o=i[0],a=i.slice(1);return function(){return a.reduce(function(s,l){return l(s)},o.apply(void 0,arguments))}},F$=function(e){return Array.isArray(e)?e.reverse():e.split("").reverse.join("")},Vge=function(e){var n=null,r=null;return function(){for(var i=arguments.length,o=new Array(i),a=0;a<i;a++)o[a]=arguments[a];return n&&o.every(function(s,l){return s===n[l]})||(n=o,r=e.apply(void 0,o)),r}};function CPt(t){var e;return t===0?e=1:e=Math.floor(new Rn(t).abs().log(10).toNumber())+1,e}function TPt(t,e,n){for(var r=new Rn(t),i=0,o=[];r.lt(e)&&i<1e5;)o.push(r.toNumber()),r=r.add(n),i++;return o}var EPt=Tk(function(t,e,n){var r=+t,i=+e;return r+n*(i-r)}),PPt=Tk(function(t,e,n){var r=e-+t;return r=r||1/0,(n-t)/r}),MPt=Tk(function(t,e,n){var r=e-+t;return r=r||1/0,Math.max(0,Math.min(1,(n-t)/r))});const Ek={rangeStep:TPt,getDigitCount:CPt,interpolateNumber:EPt,uninterpolateNumber:PPt,uninterpolateTruncation:MPt};function j$(t){return RPt(t)||APt(t)||Gge(t)||kPt()}function kPt(){throw new TypeError(`Invalid attempt to spread non-iterable instance.
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function APt(t){if(typeof Symbol<"u"&&Symbol.iterator in Object(t))return Array.from(t)}function RPt(t){if(Array.isArray(t))return B$(t)}function D_(t,e){return LPt(t)||DPt(t,e)||Gge(t,e)||IPt()}function IPt(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function Gge(t,e){if(t){if(typeof t=="string")return B$(t,e);var n=Object.prototype.toString.call(t).slice(8,-1);if(n==="Object"&&t.constructor&&(n=t.constructor.name),n==="Map"||n==="Set")return Array.from(t);if(n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return B$(t,e)}}function B$(t,e){(e==null||e>t.length)&&(e=t.length);for(var n=0,r=new Array(e);n<e;n++)r[n]=t[n];return r}function DPt(t,e){if(!(typeof Symbol>"u"||!(Symbol.iterator in Object(t)))){var n=[],r=!0,i=!1,o=void 0;try{for(var a=t[Symbol.iterator](),s;!(r=(s=a.next()).done)&&(n.push(s.value),!(e&&n.length===e));r=!0);}catch(l){i=!0,o=l}finally{try{!r&&a.return!=null&&a.return()}finally{if(i)throw o}}return n}}function LPt(t){if(Array.isArray(t))return t}function Hge(t){var e=D_(t,2),n=e[0],r=e[1],i=n,o=r;return n>r&&(i=r,o=n),[i,o]}function qge(t,e,n){if(t.lte(0))return new Rn(0);var r=Ek.getDigitCount(t.toNumber()),i=new Rn(10).pow(r),o=t.div(i),a=r!==1?.05:.1,s=new Rn(Math.ceil(o.div(a).toNumber())).add(n).mul(a),l=s.mul(i);return e?l:new Rn(Math.ceil(l))}function NPt(t,e,n){var r=1,i=new Rn(t);if(!i.isint()&&n){var o=Math.abs(t);o<1?(r=new Rn(10).pow(Ek.getDigitCount(t)-1),i=new Rn(Math.floor(i.div(r).toNumber())).mul(r)):o>1&&(i=new Rn(Math.floor(t)))}else t===0?i=new Rn(Math.floor((e-1)/2)):n||(i=new Rn(Math.floor(t)));var a=Math.floor((e-1)/2),s=OPt(SPt(function(l){return i.add(new Rn(l-a).mul(r)).toNumber()}),$$);return s(0,e)}function Xge(t,e,n,r){var i=arguments.length>4&&arguments[4]!==void 0?arguments[4]:0;if(!Number.isFinite((e-t)/(n-1)))return{step:new Rn(0),tickMin:new Rn(0),tickMax:new Rn(0)};var o=qge(new Rn(e).sub(t).div(n-1),r,i),a;t<=0&&e>=0?a=new Rn(0):(a=new Rn(t).add(e).div(2),a=a.sub(new Rn(a).mod(o)));var s=Math.ceil(a.sub(t).div(o).toNumber()),l=Math.ceil(new Rn(e).sub(a).div(o).toNumber()),c=s+l+1;return c>n?Xge(t,e,n,r,i+1):(c<n&&(l=e>0?l+(n-c):l,s=e>0?s:s+(n-c)),{step:o,tickMin:a.sub(new Rn(s).mul(o)),tickMax:a.add(new Rn(l).mul(o))})}function $Pt(t){var e=D_(t,2),n=e[0],r=e[1],i=arguments.length>1&&arguments[1]!==void 0?arguments[1]:6,o=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!0,a=Math.max(i,2),s=Hge([n,r]),l=D_(s,2),c=l[0],u=l[1];if(c===-1/0||u===1/0){var f=u===1/0?[c].concat(j$($$(0,i-1).map(function(){return 1/0}))):[].concat(j$($$(0,i-1).map(function(){return-1/0})),[u]);return n>r?F$(f):f}if(c===u)return NPt(c,i,o);var d=Xge(c,u,a,o),h=d.step,p=d.tickMin,m=d.tickMax,g=Ek.rangeStep(p,m.add(new Rn(.1).mul(h)),h);return n>r?F$(g):g}function FPt(t,e){var n=D_(t,2),r=n[0],i=n[1],o=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!0,a=Hge([r,i]),s=D_(a,2),l=s[0],c=s[1];if(l===-1/0||c===1/0)return[r,i];if(l===c)return[l];var u=Math.max(e,2),f=qge(new Rn(c).sub(l).div(u-1),o,0),d=[].concat(j$(Ek.rangeStep(new Rn(l),new Rn(c).sub(new Rn(.99).mul(f)),f)),[c]);return r>i?F$(d):d}var jPt=Vge($Pt),BPt=Vge(FPt),zPt="Invariant failed";function mp(t,e){throw new Error(zPt)}var UPt=["offset","layout","width","dataKey","data","dataPointFormatter","xAxis","yAxis"];function uP(){return uP=Object.assign?Object.assign.bind():function(t){for(var e=1;e<arguments.length;e++){var n=arguments[e];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(t[r]=n[r])}return t},uP.apply(this,arguments)}function WPt(t,e){return qPt(t)||HPt(t,e)||GPt(t,e)||VPt()}function VPt(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function GPt(t,e){if(t){if(typeof t=="string")return vY(t,e);var n=Object.prototype.toString.call(t).slice(8,-1);if(n==="Object"&&t.constructor&&(n=t.constructor.name),n==="Map"||n==="Set")return Array.from(t);if(n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return vY(t,e)}}function vY(t,e){(e==null||e>t.length)&&(e=t.length);for(var n=0,r=new Array(e);n<e;n++)r[n]=t[n];return r}function HPt(t,e){var n=t==null?null:typeof Symbol<"u"&&t[Symbol.iterator]||t["@@iterator"];if(n!=null){var r,i,o,a,s=[],l=!0,c=!1;try{if(o=(n=n.call(t)).next,e!==0)for(;!(l=(r=o.call(n)).done)&&(s.push(r.value),s.length!==e);l=!0);}catch(u){c=!0,i=u}finally{try{if(!l&&n.return!=null&&(a=n.return(),Object(a)!==a))return}finally{if(c)throw i}}return s}}function qPt(t){if(Array.isArray(t))return t}function XPt(t,e){if(t==null)return{};var n=QPt(t,e),r,i;if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(t);for(i=0;i<o.length;i++)r=o[i],!(e.indexOf(r)>=0)&&Object.prototype.propertyIsEnumerable.call(t,r)&&(n[r]=t[r])}return n}function QPt(t,e){if(t==null)return{};var n={},r=Object.keys(t),i,o;for(o=0;o<r.length;o++)i=r[o],!(e.indexOf(i)>=0)&&(n[i]=t[i]);return n}function Hy(t){var e=t.offset,n=t.layout,r=t.width,i=t.dataKey,o=t.data,a=t.dataPointFormatter,s=t.xAxis,l=t.yAxis,c=XPt(t,UPt),u=jt(c,!1);t.direction==="x"&&s.type!=="number"&&mp();var f=o.map(function(d){var h=a(d,i),p=h.x,m=h.y,g=h.value,v=h.errorVal;if(!v)return null;var y=[],x,b;if(Array.isArray(v)){var _=WPt(v,2);x=_[0],b=_[1]}else x=b=v;if(n==="vertical"){var S=s.scale,O=m+e,C=O+r,E=O-r,k=S(g-x),I=S(g+b);y.push({x1:I,y1:C,x2:I,y2:E}),y.push({x1:k,y1:O,x2:I,y2:O}),y.push({x1:k,y1:C,x2:k,y2:E})}else if(n==="horizontal"){var P=l.scale,R=p+e,T=R-r,L=R+r,z=P(g-x),B=P(g+b);y.push({x1:T,y1:B,x2:L,y2:B}),y.push({x1:R,y1:z,x2:R,y2:B}),y.push({x1:T,y1:z,x2:L,y2:z})}return ue.createElement(Gn,uP({className:"recharts-errorBar",key:"bar-".concat(y.map(function(U){return"".concat(U.x1,"-").concat(U.x2,"-").concat(U.y1,"-").concat(U.y2)}))},u),y.map(function(U){return ue.createElement("line",uP({},U,{key:"line-".concat(U.x1,"-").concat(U.x2,"-").concat(U.y1,"-").concat(U.y2)}))}))});return ue.createElement(Gn,{className:"recharts-errorBars"},f)}Hy.defaultProps={stroke:"black",strokeWidth:1.5,width:5,offset:0,layout:"horizontal"};Hy.displayName="ErrorBar";function L_(t){"@babel/helpers - typeof";return L_=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(e){return typeof e}:function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},L_(t)}function yY(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(t,i).enumerable})),n.push.apply(n,r)}return n}function RI(t){for(var e=1;e<arguments.length;e++){var n=arguments[e]!=null?arguments[e]:{};e%2?yY(Object(n),!0).forEach(function(r){YPt(t,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):yY(Object(n)).forEach(function(r){Object.defineProperty(t,r,Object.getOwnPropertyDescriptor(n,r))})}return t}function YPt(t,e,n){return e=KPt(e),e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function KPt(t){var e=ZPt(t,"string");return L_(e)=="symbol"?e:String(e)}function ZPt(t,e){if(L_(t)!="object"||!t)return t;var n=t[Symbol.toPrimitive];if(n!==void 0){var r=n.call(t,e||"default");if(L_(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}var Qge=function(e){var n=e.children,r=e.formattedGraphicalItems,i=e.legendWidth,o=e.legendContent,a=ca(n,bv);if(!a)return null;var s;return a.props&&a.props.payload?s=a.props&&a.props.payload:o==="children"?s=(r||[]).reduce(function(l,c){var u=c.item,f=c.props,d=f.sectors||f.data||[];return l.concat(d.map(function(h){return{type:a.props.iconType||u.props.legendType,value:h.name,color:h.fill,payload:h}}))},[]):s=(r||[]).map(function(l){var c=l.item,u=c.props,f=u.dataKey,d=u.name,h=u.legendType,p=u.hide;return{inactive:p,dataKey:f,type:a.props.iconType||h||"square",color:ZU(c),value:d||f,payload:c.props}}),RI(RI(RI({},a.props),bv.getWithHeight(a,i)),{},{payload:s,item:a})};function N_(t){"@babel/helpers - typeof";return N_=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(e){return typeof e}:function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},N_(t)}function xY(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(t,i).enumerable})),n.push.apply(n,r)}return n}function Ua(t){for(var e=1;e<arguments.length;e++){var n=arguments[e]!=null?arguments[e]:{};e%2?xY(Object(n),!0).forEach(function(r){Fg(t,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):xY(Object(n)).forEach(function(r){Object.defineProperty(t,r,Object.getOwnPropertyDescriptor(n,r))})}return t}function Fg(t,e,n){return e=JPt(e),e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function JPt(t){var e=eMt(t,"string");return N_(e)=="symbol"?e:String(e)}function eMt(t,e){if(N_(t)!="object"||!t)return t;var n=t[Symbol.toPrimitive];if(n!==void 0){var r=n.call(t,e||"default");if(N_(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}function bY(t){return iMt(t)||rMt(t)||nMt(t)||tMt()}function tMt(){throw new TypeError(`Invalid attempt to spread non-iterable instance.
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function nMt(t,e){if(t){if(typeof t=="string")return z$(t,e);var n=Object.prototype.toString.call(t).slice(8,-1);if(n==="Object"&&t.constructor&&(n=t.constructor.name),n==="Map"||n==="Set")return Array.from(t);if(n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return z$(t,e)}}function rMt(t){if(typeof Symbol<"u"&&t[Symbol.iterator]!=null||t["@@iterator"]!=null)return Array.from(t)}function iMt(t){if(Array.isArray(t))return z$(t)}function z$(t,e){(e==null||e>t.length)&&(e=t.length);for(var n=0,r=new Array(e);n<e;n++)r[n]=t[n];return r}function ho(t,e,n){return Wt(t)||Wt(e)?n:ti(e)?is(t,e,n):Bt(e)?e(t):n}function sb(t,e,n,r){var i=cPt(t,function(s){return ho(s,e)});if(n==="number"){var o=i.filter(function(s){return Ye(s)||parseFloat(s)});return o.length?[Ck(o),Ef(o)]:[1/0,-1/0]}var a=r?i.filter(function(s){return!Wt(s)}):i;return a.map(function(s){return ti(s)||s instanceof Date?s:""})}var oMt=function(e){var n,r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:[],i=arguments.length>2?arguments[2]:void 0,o=arguments.length>3?arguments[3]:void 0,a=-1,s=(n=r==null?void 0:r.length)!==null&&n!==void 0?n:0;if(s<=1)return 0;if(o&&o.axisType==="angleAxis"&&Math.abs(Math.abs(o.range[1]-o.range[0])-360)<=1e-6)for(var l=o.range,c=0;c<s;c++){var u=c>0?i[c-1].coordinate:i[s-1].coordinate,f=i[c].coordinate,d=c>=s-1?i[0].coordinate:i[c+1].coordinate,h=void 0;if(qs(f-u)!==qs(d-f)){var p=[];if(qs(d-f)===qs(l[1]-l[0])){h=d;var m=f+l[1]-l[0];p[0]=Math.min(m,(m+u)/2),p[1]=Math.max(m,(m+u)/2)}else{h=u;var g=d+l[1]-l[0];p[0]=Math.min(f,(g+f)/2),p[1]=Math.max(f,(g+f)/2)}var v=[Math.min(f,(h+f)/2),Math.max(f,(h+f)/2)];if(e>v[0]&&e<=v[1]||e>=p[0]&&e<=p[1]){a=i[c].index;break}}else{var y=Math.min(u,d),x=Math.max(u,d);if(e>(y+f)/2&&e<=(x+f)/2){a=i[c].index;break}}}else for(var b=0;b<s;b++)if(b===0&&e<=(r[b].coordinate+r[b+1].coordinate)/2||b>0&&b<s-1&&e>(r[b].coordinate+r[b-1].coordinate)/2&&e<=(r[b].coordinate+r[b+1].coordinate)/2||b===s-1&&e>(r[b].coordinate+r[b-1].coordinate)/2){a=r[b].index;break}return a},ZU=function(e){var n=e,r=n.type.displayName,i=e.props,o=i.stroke,a=i.fill,s;switch(r){case"Line":s=o;break;case"Area":case"Radar":s=o&&o!=="none"?o:a;break;default:s=a;break}return s},aMt=function(e){var n=e.barSize,r=e.totalSize,i=e.stackGroups,o=i===void 0?{}:i;if(!o)return{};for(var a={},s=Object.keys(o),l=0,c=s.length;l<c;l++)for(var u=o[s[l]].stackGroups,f=Object.keys(u),d=0,h=f.length;d<h;d++){var p=u[f[d]],m=p.items,g=p.cateAxisId,v=m.filter(function(_){return nu(_.type).indexOf("Bar")>=0});if(v&&v.length){var y=v[0].props.barSize,x=v[0].props[g];a[x]||(a[x]=[]);var b=Wt(y)?n:y;a[x].push({item:v[0],stackList:v.slice(1),barSize:Wt(b)?void 0:hp(b,r,0)})}}return a},sMt=function(e){var n=e.barGap,r=e.barCategoryGap,i=e.bandSize,o=e.sizeList,a=o===void 0?[]:o,s=e.maxBarSize,l=a.length;if(l<1)return null;var c=hp(n,i,0,!0),u,f=[];if(a[0].barSize===+a[0].barSize){var d=!1,h=i/l,p=a.reduce(function(b,_){return b+_.barSize||0},0);p+=(l-1)*c,p>=i&&(p-=(l-1)*c,c=0),p>=i&&h>0&&(d=!0,h*=.9,p=l*h);var m=(i-p)/2>>0,g={offset:m-c,size:0};u=a.reduce(function(b,_){var S={item:_.item,position:{offset:g.offset+g.size+c,size:d?h:_.barSize}},O=[].concat(bY(b),[S]);return g=O[O.length-1].position,_.stackList&&_.stackList.length&&_.stackList.forEach(function(C){O.push({item:C,position:g})}),O},f)}else{var v=hp(r,i,0,!0);i-2*v-(l-1)*c<=0&&(c=0);var y=(i-2*v-(l-1)*c)/l;y>1&&(y>>=0);var x=s===+s?Math.min(y,s):y;u=a.reduce(function(b,_,S){var O=[].concat(bY(b),[{item:_.item,position:{offset:v+(y+c)*S+(y-x)/2,size:x}}]);return _.stackList&&_.stackList.length&&_.stackList.forEach(function(C){O.push({item:C,position:O[O.length-1].position})}),O},f)}return u},lMt=function(e,n,r,i){var o=r.children,a=r.width,s=r.margin,l=a-(s.left||0)-(s.right||0),c=Qge({children:o,legendWidth:l});if(c){var u=i||{},f=u.width,d=u.height,h=c.align,p=c.verticalAlign,m=c.layout;if((m==="vertical"||m==="horizontal"&&p==="middle")&&h!=="center"&&Ye(e[h]))return Ua(Ua({},e),{},Fg({},h,e[h]+(f||0)));if((m==="horizontal"||m==="vertical"&&h==="center")&&p!=="middle"&&Ye(e[p]))return Ua(Ua({},e),{},Fg({},p,e[p]+(d||0)))}return e},cMt=function(e,n,r){return Wt(n)?!0:e==="horizontal"?n==="yAxis":e==="vertical"||r==="x"?n==="xAxis":r==="y"?n==="yAxis":!0},Yge=function(e,n,r,i,o){var a=n.props.children,s=os(a,Hy).filter(function(c){return cMt(i,o,c.props.direction)});if(s&&s.length){var l=s.map(function(c){return c.props.dataKey});return e.reduce(function(c,u){var f=ho(u,r);if(Wt(f))return c;var d=Array.isArray(f)?[Ck(f),Ef(f)]:[f,f],h=l.reduce(function(p,m){var g=ho(u,m,0),v=d[0]-Math.abs(Array.isArray(g)?g[0]:g),y=d[1]+Math.abs(Array.isArray(g)?g[1]:g);return[Math.min(v,p[0]),Math.max(y,p[1])]},[1/0,-1/0]);return[Math.min(h[0],c[0]),Math.max(h[1],c[1])]},[1/0,-1/0])}return null},uMt=function(e,n,r,i,o){var a=n.map(function(s){return Yge(e,s,r,o,i)}).filter(function(s){return!Wt(s)});return a&&a.length?a.reduce(function(s,l){return[Math.min(s[0],l[0]),Math.max(s[1],l[1])]},[1/0,-1/0]):null},Kge=function(e,n,r,i,o){var a=n.map(function(l){var c=l.props.dataKey;return r==="number"&&c&&Yge(e,l,c,i)||sb(e,c,r,o)});if(r==="number")return a.reduce(function(l,c){return[Math.min(l[0],c[0]),Math.max(l[1],c[1])]},[1/0,-1/0]);var s={};return a.reduce(function(l,c){for(var u=0,f=c.length;u<f;u++)s[c[u]]||(s[c[u]]=!0,l.push(c[u]));return l},[])},Zge=function(e,n){return e==="horizontal"&&n==="xAxis"||e==="vertical"&&n==="yAxis"||e==="centric"&&n==="angleAxis"||e==="radial"&&n==="radiusAxis"},Jge=function(e,n,r,i){if(i)return e.map(function(l){return l.coordinate});var o,a,s=e.map(function(l){return l.coordinate===n&&(o=!0),l.coordinate===r&&(a=!0),l.coordinate});return o||s.push(n),a||s.push(r),s},Qc=function(e,n,r){if(!e)return null;var i=e.scale,o=e.duplicateDomain,a=e.type,s=e.range,l=e.realScaleType==="scaleBand"?i.bandwidth()/2:2,c=(n||r)&&a==="category"&&i.bandwidth?i.bandwidth()/l:0;if(c=e.axisType==="angleAxis"&&(s==null?void 0:s.length)>=2?qs(s[0]-s[1])*2*c:c,n&&(e.ticks||e.niceTicks)){var u=(e.ticks||e.niceTicks).map(function(f){var d=o?o.indexOf(f):f;return{coordinate:i(d)+c,value:f,offset:c}});return u.filter(function(f){return!Fy(f.coordinate)})}return e.isCategorical&&e.categoricalDomain?e.categoricalDomain.map(function(f,d){return{coordinate:i(f)+c,value:f,index:d,offset:c}}):i.ticks&&!r?i.ticks(e.tickCount).map(function(f){return{coordinate:i(f)+c,value:f,offset:c}}):i.domain().map(function(f,d){return{coordinate:i(f)+c,value:o?o[f]:f,index:d,offset:c}})},II=new WeakMap,SO=function(e,n){if(typeof n!="function")return e;II.has(e)||II.set(e,new WeakMap);var r=II.get(e);if(r.has(n))return r.get(n);var i=function(){e.apply(void 0,arguments),n.apply(void 0,arguments)};return r.set(n,i),i},fMt=function(e,n,r){var i=e.scale,o=e.type,a=e.layout,s=e.axisType;if(i==="auto")return a==="radial"&&s==="radiusAxis"?{scale:P_(),realScaleType:"band"}:a==="radial"&&s==="angleAxis"?{scale:oP(),realScaleType:"linear"}:o==="category"&&n&&(n.indexOf("LineChart")>=0||n.indexOf("AreaChart")>=0||n.indexOf("ComposedChart")>=0&&!r)?{scale:ab(),realScaleType:"point"}:o==="category"?{scale:P_(),realScaleType:"band"}:{scale:oP(),realScaleType:"linear"};if(Tw(i)){var l="scale".concat(dk(i));return{scale:(hY[l]||ab)(),realScaleType:hY[l]?l:"point"}}return Bt(i)?{scale:i}:{scale:ab(),realScaleType:"point"}},_Y=1e-4,dMt=function(e){var n=e.domain();if(!(!n||n.length<=2)){var r=n.length,i=e.range(),o=Math.min(i[0],i[1])-_Y,a=Math.max(i[0],i[1])+_Y,s=e(n[0]),l=e(n[r-1]);(s<o||s>a||l<o||l>a)&&e.domain([n[0],n[r-1]])}},hMt=function(e,n){if(!e)return null;for(var r=0,i=e.length;r<i;r++)if(e[r].item===n)return e[r].position;return null},pMt=function(e,n){if(!n||n.length!==2||!Ye(n[0])||!Ye(n[1]))return e;var r=Math.min(n[0],n[1]),i=Math.max(n[0],n[1]),o=[e[0],e[1]];return(!Ye(e[0])||e[0]<r)&&(o[0]=r),(!Ye(e[1])||e[1]>i)&&(o[1]=i),o[0]>i&&(o[0]=i),o[1]<r&&(o[1]=r),o},mMt=function(e){var n=e.length;if(!(n<=0))for(var r=0,i=e[0].length;r<i;++r)for(var o=0,a=0,s=0;s<n;++s){var l=Fy(e[s][r][1])?e[s][r][0]:e[s][r][1];l>=0?(e[s][r][0]=o,e[s][r][1]=o+l,o=e[s][r][1]):(e[s][r][0]=a,e[s][r][1]=a+l,a=e[s][r][1])}},gMt=function(e){var n=e.length;if(!(n<=0))for(var r=0,i=e[0].length;r<i;++r)for(var o=0,a=0;a<n;++a){var s=Fy(e[a][r][1])?e[a][r][0]:e[a][r][1];s>=0?(e[a][r][0]=o,e[a][r][1]=o+s,o=e[a][r][1]):(e[a][r][0]=0,e[a][r][1]=0)}},vMt={sign:mMt,expand:Uvt,none:vv,silhouette:Wvt,wiggle:Vvt,positive:gMt},yMt=function(e,n,r){var i=n.map(function(s){return s.props.dataKey}),o=vMt[r],a=zvt().keys(i).value(function(s,l){return+ho(s,l,0)}).order(d$).offset(o);return a(e)},xMt=function(e,n,r,i,o,a){if(!e)return null;var s=a?n.reverse():n,l={},c=s.reduce(function(f,d){var h=d.props,p=h.stackId,m=h.hide;if(m)return f;var g=d.props[r],v=f[g]||{hasStack:!1,stackGroups:{}};if(ti(p)){var y=v.stackGroups[p]||{numericAxisId:r,cateAxisId:i,items:[]};y.items.push(d),v.hasStack=!0,v.stackGroups[p]=y}else v.stackGroups[jy("_stackId_")]={numericAxisId:r,cateAxisId:i,items:[d]};return Ua(Ua({},f),{},Fg({},g,v))},l),u={};return Object.keys(c).reduce(function(f,d){var h=c[d];if(h.hasStack){var p={};h.stackGroups=Object.keys(h.stackGroups).reduce(function(m,g){var v=h.stackGroups[g];return Ua(Ua({},m),{},Fg({},g,{numericAxisId:r,cateAxisId:i,items:v.items,stackedData:yMt(e,v.items,o)}))},p)}return Ua(Ua({},f),{},Fg({},d,h))},u)},bMt=function(e,n){var r=n.realScaleType,i=n.type,o=n.tickCount,a=n.originalDomain,s=n.allowDecimals,l=r||n.scale;if(l!=="auto"&&l!=="linear")return null;if(o&&i==="number"&&a&&(a[0]==="auto"||a[1]==="auto")){var c=e.domain();if(!c.length)return null;var u=jPt(c,o,s);return e.domain([Ck(u),Ef(u)]),{niceTicks:u}}if(o&&i==="number"){var f=e.domain(),d=BPt(f,o,s);return{niceTicks:d}}return null};function fP(t){var e=t.axis,n=t.ticks,r=t.bandSize,i=t.entry,o=t.index,a=t.dataKey;if(e.type==="category"){if(!e.allowDuplicatedCategory&&e.dataKey&&!Wt(i[e.dataKey])){var s=NE(n,"value",i[e.dataKey]);if(s)return s.coordinate+r/2}return n[o]?n[o].coordinate+r/2:null}var l=ho(i,Wt(a)?e.dataKey:a);return Wt(l)?null:e.scale(l)}var wY=function(e){var n=e.axis,r=e.ticks,i=e.offset,o=e.bandSize,a=e.entry,s=e.index;if(n.type==="category")return r[s]?r[s].coordinate+i:null;var l=ho(a,n.dataKey,n.domain[s]);return Wt(l)?null:n.scale(l)-o/2+i},_Mt=function(e){var n=e.numericAxis,r=n.scale.domain();if(n.type==="number"){var i=Math.min(r[0],r[1]),o=Math.max(r[0],r[1]);return i<=0&&o>=0?0:o<0?o:i}return r[0]},wMt=function(e,n){var r=e.props.stackId;if(ti(r)){var i=n[r];if(i){var o=i.items.indexOf(e);return o>=0?i.stackedData[o]:null}}return null},SMt=function(e){return e.reduce(function(n,r){return[Ck(r.concat([n[0]]).filter(Ye)),Ef(r.concat([n[1]]).filter(Ye))]},[1/0,-1/0])},eve=function(e,n,r){return Object.keys(e).reduce(function(i,o){var a=e[o],s=a.stackedData,l=s.reduce(function(c,u){var f=SMt(u.slice(n,r+1));return[Math.min(c[0],f[0]),Math.max(c[1],f[1])]},[1/0,-1/0]);return[Math.min(l[0],i[0]),Math.max(l[1],i[1])]},[1/0,-1/0]).map(function(i){return i===1/0||i===-1/0?0:i})},SY=/^dataMin[\s]*-[\s]*([0-9]+([.]{1}[0-9]+){0,1})$/,OY=/^dataMax[\s]*\+[\s]*([0-9]+([.]{1}[0-9]+){0,1})$/,U$=function(e,n,r){if(Bt(e))return e(n,r);if(!Array.isArray(e))return n;var i=[];if(Ye(e[0]))i[0]=r?e[0]:Math.min(e[0],n[0]);else if(SY.test(e[0])){var o=+SY.exec(e[0])[1];i[0]=n[0]-o}else Bt(e[0])?i[0]=e[0](n[0]):i[0]=n[0];if(Ye(e[1]))i[1]=r?e[1]:Math.max(e[1],n[1]);else if(OY.test(e[1])){var a=+OY.exec(e[1])[1];i[1]=n[1]+a}else Bt(e[1])?i[1]=e[1](n[1]):i[1]=n[1];return i},dP=function(e,n,r){if(e&&e.scale&&e.scale.bandwidth){var i=e.scale.bandwidth();if(!r||i>0)return i}if(e&&n&&n.length>=2){for(var o=TU(n,function(f){return f.coordinate}),a=1/0,s=1,l=o.length;s<l;s++){var c=o[s],u=o[s-1];a=Math.min((c.coordinate||0)-(u.coordinate||0),a)}return a===1/0?0:a}return r?void 0:0},CY=function(e,n,r){return!e||!e.length||Tv(e,is(r,"type.defaultProps.domain"))?n:e},tve=function(e,n){var r=e.props,i=r.dataKey,o=r.name,a=r.unit,s=r.formatter,l=r.tooltipType,c=r.chartType,u=r.hide;return Ua(Ua({},jt(e,!1)),{},{dataKey:i,unit:a,formatter:s,name:o||i,color:ZU(e),value:ho(n,i),type:l,payload:n,chartType:c,hide:u})};function $_(t){"@babel/helpers - typeof";return $_=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(e){return typeof e}:function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},$_(t)}function TY(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(t,i).enumerable})),n.push.apply(n,r)}return n}function EY(t){for(var e=1;e<arguments.length;e++){var n=arguments[e]!=null?arguments[e]:{};e%2?TY(Object(n),!0).forEach(function(r){OMt(t,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):TY(Object(n)).forEach(function(r){Object.defineProperty(t,r,Object.getOwnPropertyDescriptor(n,r))})}return t}function OMt(t,e,n){return e=CMt(e),e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function CMt(t){var e=TMt(t,"string");return $_(e)=="symbol"?e:String(e)}function TMt(t,e){if($_(t)!="object"||!t)return t;var n=t[Symbol.toPrimitive];if(n!==void 0){var r=n.call(t,e||"default");if($_(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}var hP=Math.PI/180,EMt=function(e){return e*180/Math.PI},Ai=function(e,n,r,i){return{x:e+Math.cos(-hP*i)*r,y:n+Math.sin(-hP*i)*r}},PMt=function(e,n){var r=e.x,i=e.y,o=n.x,a=n.y;return Math.sqrt(Math.pow(r-o,2)+Math.pow(i-a,2))},MMt=function(e,n){var r=e.x,i=e.y,o=n.cx,a=n.cy,s=PMt({x:r,y:i},{x:o,y:a});if(s<=0)return{radius:s};var l=(r-o)/s,c=Math.acos(l);return i>a&&(c=2*Math.PI-c),{radius:s,angle:EMt(c),angleInRadian:c}},kMt=function(e){var n=e.startAngle,r=e.endAngle,i=Math.floor(n/360),o=Math.floor(r/360),a=Math.min(i,o);return{startAngle:n-a*360,endAngle:r-a*360}},AMt=function(e,n){var r=n.startAngle,i=n.endAngle,o=Math.floor(r/360),a=Math.floor(i/360),s=Math.min(o,a);return e+s*360},PY=function(e,n){var r=e.x,i=e.y,o=MMt({x:r,y:i},n),a=o.radius,s=o.angle,l=n.innerRadius,c=n.outerRadius;if(a<l||a>c)return!1;if(a===0)return!0;var u=kMt(n),f=u.startAngle,d=u.endAngle,h=s,p;if(f<=d){for(;h>d;)h-=360;for(;h<f;)h+=360;p=h>=f&&h<=d}else{for(;h>f;)h-=360;for(;h<d;)h+=360;p=h>=d&&h<=f}return p?EY(EY({},n),{},{radius:a,angle:AMt(h,n)}):null};function F_(t){"@babel/helpers - typeof";return F_=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(e){return typeof e}:function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},F_(t)}var RMt=["offset"];function IMt(t){return $Mt(t)||NMt(t)||LMt(t)||DMt()}function DMt(){throw new TypeError(`Invalid attempt to spread non-iterable instance.
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function LMt(t,e){if(t){if(typeof t=="string")return W$(t,e);var n=Object.prototype.toString.call(t).slice(8,-1);if(n==="Object"&&t.constructor&&(n=t.constructor.name),n==="Map"||n==="Set")return Array.from(t);if(n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return W$(t,e)}}function NMt(t){if(typeof Symbol<"u"&&t[Symbol.iterator]!=null||t["@@iterator"]!=null)return Array.from(t)}function $Mt(t){if(Array.isArray(t))return W$(t)}function W$(t,e){(e==null||e>t.length)&&(e=t.length);for(var n=0,r=new Array(e);n<e;n++)r[n]=t[n];return r}function FMt(t,e){if(t==null)return{};var n=jMt(t,e),r,i;if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(t);for(i=0;i<o.length;i++)r=o[i],!(e.indexOf(r)>=0)&&Object.prototype.propertyIsEnumerable.call(t,r)&&(n[r]=t[r])}return n}function jMt(t,e){if(t==null)return{};var n={},r=Object.keys(t),i,o;for(o=0;o<r.length;o++)i=r[o],!(e.indexOf(i)>=0)&&(n[i]=t[i]);return n}function MY(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(t,i).enumerable})),n.push.apply(n,r)}return n}function Kr(t){for(var e=1;e<arguments.length;e++){var n=arguments[e]!=null?arguments[e]:{};e%2?MY(Object(n),!0).forEach(function(r){BMt(t,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):MY(Object(n)).forEach(function(r){Object.defineProperty(t,r,Object.getOwnPropertyDescriptor(n,r))})}return t}function BMt(t,e,n){return e=zMt(e),e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function zMt(t){var e=UMt(t,"string");return F_(e)=="symbol"?e:String(e)}function UMt(t,e){if(F_(t)!="object"||!t)return t;var n=t[Symbol.toPrimitive];if(n!==void 0){var r=n.call(t,e||"default");if(F_(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}function j_(){return j_=Object.assign?Object.assign.bind():function(t){for(var e=1;e<arguments.length;e++){var n=arguments[e];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(t[r]=n[r])}return t},j_.apply(this,arguments)}var WMt=function(e){var n=e.value,r=e.formatter,i=Wt(e.children)?n:e.children;return Bt(r)?r(i):i},VMt=function(e,n){var r=qs(n-e),i=Math.min(Math.abs(n-e),360);return r*i},GMt=function(e,n,r){var i=e.position,o=e.viewBox,a=e.offset,s=e.className,l=o,c=l.cx,u=l.cy,f=l.innerRadius,d=l.outerRadius,h=l.startAngle,p=l.endAngle,m=l.clockWise,g=(f+d)/2,v=VMt(h,p),y=v>=0?1:-1,x,b;i==="insideStart"?(x=h+y*a,b=m):i==="insideEnd"?(x=p-y*a,b=!m):i==="end"&&(x=p+y*a,b=m),b=v<=0?b:!b;var _=Ai(c,u,g,x),S=Ai(c,u,g,x+(b?1:-1)*359),O="M".concat(_.x,",").concat(_.y,`
    A`).concat(g,",").concat(g,",0,1,").concat(b?0:1,`,
    `).concat(S.x,",").concat(S.y),C=Wt(e.id)?jy("recharts-radial-line-"):e.id;return ue.createElement("text",j_({},r,{dominantBaseline:"central",className:ke("recharts-radial-bar-label",s)}),ue.createElement("defs",null,ue.createElement("path",{id:C,d:O})),ue.createElement("textPath",{xlinkHref:"#".concat(C)},n))},HMt=function(e){var n=e.viewBox,r=e.offset,i=e.position,o=n,a=o.cx,s=o.cy,l=o.innerRadius,c=o.outerRadius,u=o.startAngle,f=o.endAngle,d=(u+f)/2;if(i==="outside"){var h=Ai(a,s,c+r,d),p=h.x,m=h.y;return{x:p,y:m,textAnchor:p>=a?"start":"end",verticalAnchor:"middle"}}if(i==="center")return{x:a,y:s,textAnchor:"middle",verticalAnchor:"middle"};if(i==="centerTop")return{x:a,y:s,textAnchor:"middle",verticalAnchor:"start"};if(i==="centerBottom")return{x:a,y:s,textAnchor:"middle",verticalAnchor:"end"};var g=(l+c)/2,v=Ai(a,s,g,d),y=v.x,x=v.y;return{x:y,y:x,textAnchor:"middle",verticalAnchor:"middle"}},qMt=function(e){var n=e.viewBox,r=e.parentViewBox,i=e.offset,o=e.position,a=n,s=a.x,l=a.y,c=a.width,u=a.height,f=u>=0?1:-1,d=f*i,h=f>0?"end":"start",p=f>0?"start":"end",m=c>=0?1:-1,g=m*i,v=m>0?"end":"start",y=m>0?"start":"end";if(o==="top"){var x={x:s+c/2,y:l-f*i,textAnchor:"middle",verticalAnchor:h};return Kr(Kr({},x),r?{height:Math.max(l-r.y,0),width:c}:{})}if(o==="bottom"){var b={x:s+c/2,y:l+u+d,textAnchor:"middle",verticalAnchor:p};return Kr(Kr({},b),r?{height:Math.max(r.y+r.height-(l+u),0),width:c}:{})}if(o==="left"){var _={x:s-g,y:l+u/2,textAnchor:v,verticalAnchor:"middle"};return Kr(Kr({},_),r?{width:Math.max(_.x-r.x,0),height:u}:{})}if(o==="right"){var S={x:s+c+g,y:l+u/2,textAnchor:y,verticalAnchor:"middle"};return Kr(Kr({},S),r?{width:Math.max(r.x+r.width-S.x,0),height:u}:{})}var O=r?{width:c,height:u}:{};return o==="insideLeft"?Kr({x:s+g,y:l+u/2,textAnchor:y,verticalAnchor:"middle"},O):o==="insideRight"?Kr({x:s+c-g,y:l+u/2,textAnchor:v,verticalAnchor:"middle"},O):o==="insideTop"?Kr({x:s+c/2,y:l+d,textAnchor:"middle",verticalAnchor:p},O):o==="insideBottom"?Kr({x:s+c/2,y:l+u-d,textAnchor:"middle",verticalAnchor:h},O):o==="insideTopLeft"?Kr({x:s+g,y:l+d,textAnchor:y,verticalAnchor:p},O):o==="insideTopRight"?Kr({x:s+c-g,y:l+d,textAnchor:v,verticalAnchor:p},O):o==="insideBottomLeft"?Kr({x:s+g,y:l+u-d,textAnchor:y,verticalAnchor:h},O):o==="insideBottomRight"?Kr({x:s+c-g,y:l+u-d,textAnchor:v,verticalAnchor:h},O):Dy(o)&&(Ye(o.x)||Ch(o.x))&&(Ye(o.y)||Ch(o.y))?Kr({x:s+hp(o.x,c),y:l+hp(o.y,u),textAnchor:"end",verticalAnchor:"end"},O):Kr({x:s+c/2,y:l+u/2,textAnchor:"middle",verticalAnchor:"middle"},O)},XMt=function(e){return"cx"in e&&Ye(e.cx)};function Xi(t){var e=t.offset,n=e===void 0?5:e,r=FMt(t,RMt),i=Kr({offset:n},r),o=i.viewBox,a=i.position,s=i.value,l=i.children,c=i.content,u=i.className,f=u===void 0?"":u,d=i.textBreakAll;if(!o||Wt(s)&&Wt(l)&&!M.isValidElement(c)&&!Bt(c))return null;if(M.isValidElement(c))return M.cloneElement(c,i);var h;if(Bt(c)){if(h=M.createElement(c,i),M.isValidElement(h))return h}else h=WMt(i);var p=XMt(o),m=jt(i,!0);if(p&&(a==="insideStart"||a==="insideEnd"||a==="end"))return GMt(i,h,m);var g=p?HMt(i):qMt(i);return ue.createElement(ZE,j_({className:ke("recharts-label",f)},m,g,{breakAll:d}),h)}Xi.displayName="Label";var nve=function(e){var n=e.cx,r=e.cy,i=e.angle,o=e.startAngle,a=e.endAngle,s=e.r,l=e.radius,c=e.innerRadius,u=e.outerRadius,f=e.x,d=e.y,h=e.top,p=e.left,m=e.width,g=e.height,v=e.clockWise,y=e.labelViewBox;if(y)return y;if(Ye(m)&&Ye(g)){if(Ye(f)&&Ye(d))return{x:f,y:d,width:m,height:g};if(Ye(h)&&Ye(p))return{x:h,y:p,width:m,height:g}}return Ye(f)&&Ye(d)?{x:f,y:d,width:0,height:0}:Ye(n)&&Ye(r)?{cx:n,cy:r,startAngle:o||i||0,endAngle:a||i||0,innerRadius:c||0,outerRadius:u||l||s||0,clockWise:v}:e.viewBox?e.viewBox:{}},QMt=function(e,n){return e?e===!0?ue.createElement(Xi,{key:"label-implicit",viewBox:n}):ti(e)?ue.createElement(Xi,{key:"label-implicit",viewBox:n,value:e}):M.isValidElement(e)?e.type===Xi?M.cloneElement(e,{key:"label-implicit",viewBox:n}):ue.createElement(Xi,{key:"label-implicit",content:e,viewBox:n}):Bt(e)?ue.createElement(Xi,{key:"label-implicit",content:e,viewBox:n}):Dy(e)?ue.createElement(Xi,j_({viewBox:n},e,{key:"label-implicit"})):null:null},YMt=function(e,n){var r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!0;if(!e||!e.children&&r&&!e.label)return null;var i=e.children,o=nve(e),a=os(i,Xi).map(function(l,c){return M.cloneElement(l,{viewBox:n||o,key:"label-".concat(c)})});if(!r)return a;var s=QMt(e.label,n||o);return[s].concat(IMt(a))};Xi.parseViewBox=nve;Xi.renderCallByParent=YMt;function KMt(t){var e=t==null?0:t.length;return e?t[e-1]:void 0}var ZMt=KMt;const JMt=$t(ZMt);function B_(t){"@babel/helpers - typeof";return B_=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(e){return typeof e}:function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},B_(t)}var e2t=["valueAccessor"],t2t=["data","dataKey","clockWise","id","textBreakAll"];function n2t(t){return a2t(t)||o2t(t)||i2t(t)||r2t()}function r2t(){throw new TypeError(`Invalid attempt to spread non-iterable instance.
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function i2t(t,e){if(t){if(typeof t=="string")return V$(t,e);var n=Object.prototype.toString.call(t).slice(8,-1);if(n==="Object"&&t.constructor&&(n=t.constructor.name),n==="Map"||n==="Set")return Array.from(t);if(n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return V$(t,e)}}function o2t(t){if(typeof Symbol<"u"&&t[Symbol.iterator]!=null||t["@@iterator"]!=null)return Array.from(t)}function a2t(t){if(Array.isArray(t))return V$(t)}function V$(t,e){(e==null||e>t.length)&&(e=t.length);for(var n=0,r=new Array(e);n<e;n++)r[n]=t[n];return r}function pP(){return pP=Object.assign?Object.assign.bind():function(t){for(var e=1;e<arguments.length;e++){var n=arguments[e];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(t[r]=n[r])}return t},pP.apply(this,arguments)}function kY(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(t,i).enumerable})),n.push.apply(n,r)}return n}function AY(t){for(var e=1;e<arguments.length;e++){var n=arguments[e]!=null?arguments[e]:{};e%2?kY(Object(n),!0).forEach(function(r){s2t(t,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):kY(Object(n)).forEach(function(r){Object.defineProperty(t,r,Object.getOwnPropertyDescriptor(n,r))})}return t}function s2t(t,e,n){return e=l2t(e),e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function l2t(t){var e=c2t(t,"string");return B_(e)=="symbol"?e:String(e)}function c2t(t,e){if(B_(t)!="object"||!t)return t;var n=t[Symbol.toPrimitive];if(n!==void 0){var r=n.call(t,e||"default");if(B_(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}function RY(t,e){if(t==null)return{};var n=u2t(t,e),r,i;if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(t);for(i=0;i<o.length;i++)r=o[i],!(e.indexOf(r)>=0)&&Object.prototype.propertyIsEnumerable.call(t,r)&&(n[r]=t[r])}return n}function u2t(t,e){if(t==null)return{};var n={},r=Object.keys(t),i,o;for(o=0;o<r.length;o++)i=r[o],!(e.indexOf(i)>=0)&&(n[i]=t[i]);return n}var f2t=function(e){return Array.isArray(e.value)?JMt(e.value):e.value};function ou(t){var e=t.valueAccessor,n=e===void 0?f2t:e,r=RY(t,e2t),i=r.data,o=r.dataKey,a=r.clockWise,s=r.id,l=r.textBreakAll,c=RY(r,t2t);return!i||!i.length?null:ue.createElement(Gn,{className:"recharts-label-list"},i.map(function(u,f){var d=Wt(o)?n(u,f):ho(u&&u.payload,o),h=Wt(s)?{}:{id:"".concat(s,"-").concat(f)};return ue.createElement(Xi,pP({},jt(u,!0),c,h,{parentViewBox:u.parentViewBox,value:d,textBreakAll:l,viewBox:Xi.parseViewBox(Wt(a)?u:AY(AY({},u),{},{clockWise:a})),key:"label-".concat(f),index:f}))}))}ou.displayName="LabelList";function d2t(t,e){return t?t===!0?ue.createElement(ou,{key:"labelList-implicit",data:e}):ue.isValidElement(t)||Bt(t)?ue.createElement(ou,{key:"labelList-implicit",data:e,content:t}):Dy(t)?ue.createElement(ou,pP({data:e},t,{key:"labelList-implicit"})):null:null}function h2t(t,e){var n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!0;if(!t||!t.children&&n&&!t.label)return null;var r=t.children,i=os(r,ou).map(function(a,s){return M.cloneElement(a,{data:e,key:"labelList-".concat(s)})});if(!n)return i;var o=d2t(t.label,e);return[o].concat(n2t(i))}ou.renderCallByParent=h2t;function z_(t){"@babel/helpers - typeof";return z_=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(e){return typeof e}:function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},z_(t)}function G$(){return G$=Object.assign?Object.assign.bind():function(t){for(var e=1;e<arguments.length;e++){var n=arguments[e];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(t[r]=n[r])}return t},G$.apply(this,arguments)}function IY(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(t,i).enumerable})),n.push.apply(n,r)}return n}function DY(t){for(var e=1;e<arguments.length;e++){var n=arguments[e]!=null?arguments[e]:{};e%2?IY(Object(n),!0).forEach(function(r){p2t(t,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):IY(Object(n)).forEach(function(r){Object.defineProperty(t,r,Object.getOwnPropertyDescriptor(n,r))})}return t}function p2t(t,e,n){return e=m2t(e),e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function m2t(t){var e=g2t(t,"string");return z_(e)=="symbol"?e:String(e)}function g2t(t,e){if(z_(t)!="object"||!t)return t;var n=t[Symbol.toPrimitive];if(n!==void 0){var r=n.call(t,e||"default");if(z_(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}var v2t=function(e,n){var r=qs(n-e),i=Math.min(Math.abs(n-e),359.999);return r*i},OO=function(e){var n=e.cx,r=e.cy,i=e.radius,o=e.angle,a=e.sign,s=e.isExternal,l=e.cornerRadius,c=e.cornerIsExternal,u=l*(s?1:-1)+i,f=Math.asin(l/u)/hP,d=c?o:o+a*f,h=Ai(n,r,u,d),p=Ai(n,r,i,d),m=c?o-a*f:o,g=Ai(n,r,u*Math.cos(f*hP),m);return{center:h,circleTangency:p,lineTangency:g,theta:f}},rve=function(e){var n=e.cx,r=e.cy,i=e.innerRadius,o=e.outerRadius,a=e.startAngle,s=e.endAngle,l=v2t(a,s),c=a+l,u=Ai(n,r,o,a),f=Ai(n,r,o,c),d="M ".concat(u.x,",").concat(u.y,`
    A `).concat(o,",").concat(o,`,0,
    `).concat(+(Math.abs(l)>180),",").concat(+(a>c),`,
    `).concat(f.x,",").concat(f.y,`
  `);if(i>0){var h=Ai(n,r,i,a),p=Ai(n,r,i,c);d+="L ".concat(p.x,",").concat(p.y,`
            A `).concat(i,",").concat(i,`,0,
            `).concat(+(Math.abs(l)>180),",").concat(+(a<=c),`,
            `).concat(h.x,",").concat(h.y," Z")}else d+="L ".concat(n,",").concat(r," Z");return d},y2t=function(e){var n=e.cx,r=e.cy,i=e.innerRadius,o=e.outerRadius,a=e.cornerRadius,s=e.forceCornerRadius,l=e.cornerIsExternal,c=e.startAngle,u=e.endAngle,f=qs(u-c),d=OO({cx:n,cy:r,radius:o,angle:c,sign:f,cornerRadius:a,cornerIsExternal:l}),h=d.circleTangency,p=d.lineTangency,m=d.theta,g=OO({cx:n,cy:r,radius:o,angle:u,sign:-f,cornerRadius:a,cornerIsExternal:l}),v=g.circleTangency,y=g.lineTangency,x=g.theta,b=l?Math.abs(c-u):Math.abs(c-u)-m-x;if(b<0)return s?"M ".concat(p.x,",").concat(p.y,`
        a`).concat(a,",").concat(a,",0,0,1,").concat(a*2,`,0
        a`).concat(a,",").concat(a,",0,0,1,").concat(-a*2,`,0
      `):rve({cx:n,cy:r,innerRadius:i,outerRadius:o,startAngle:c,endAngle:u});var _="M ".concat(p.x,",").concat(p.y,`
    A`).concat(a,",").concat(a,",0,0,").concat(+(f<0),",").concat(h.x,",").concat(h.y,`
    A`).concat(o,",").concat(o,",0,").concat(+(b>180),",").concat(+(f<0),",").concat(v.x,",").concat(v.y,`
    A`).concat(a,",").concat(a,",0,0,").concat(+(f<0),",").concat(y.x,",").concat(y.y,`
  `);if(i>0){var S=OO({cx:n,cy:r,radius:i,angle:c,sign:f,isExternal:!0,cornerRadius:a,cornerIsExternal:l}),O=S.circleTangency,C=S.lineTangency,E=S.theta,k=OO({cx:n,cy:r,radius:i,angle:u,sign:-f,isExternal:!0,cornerRadius:a,cornerIsExternal:l}),I=k.circleTangency,P=k.lineTangency,R=k.theta,T=l?Math.abs(c-u):Math.abs(c-u)-E-R;if(T<0&&a===0)return"".concat(_,"L").concat(n,",").concat(r,"Z");_+="L".concat(P.x,",").concat(P.y,`
      A`).concat(a,",").concat(a,",0,0,").concat(+(f<0),",").concat(I.x,",").concat(I.y,`
      A`).concat(i,",").concat(i,",0,").concat(+(T>180),",").concat(+(f>0),",").concat(O.x,",").concat(O.y,`
      A`).concat(a,",").concat(a,",0,0,").concat(+(f<0),",").concat(C.x,",").concat(C.y,"Z")}else _+="L".concat(n,",").concat(r,"Z");return _},x2t={cx:0,cy:0,innerRadius:0,outerRadius:0,startAngle:0,endAngle:0,cornerRadius:0,forceCornerRadius:!1,cornerIsExternal:!1},ive=function(e){var n=DY(DY({},x2t),e),r=n.cx,i=n.cy,o=n.innerRadius,a=n.outerRadius,s=n.cornerRadius,l=n.forceCornerRadius,c=n.cornerIsExternal,u=n.startAngle,f=n.endAngle,d=n.className;if(a<o||u===f)return null;var h=ke("recharts-sector",d),p=a-o,m=hp(s,p,0,!0),g;return m>0&&Math.abs(u-f)<360?g=y2t({cx:r,cy:i,innerRadius:o,outerRadius:a,cornerRadius:Math.min(m,p/2),forceCornerRadius:l,cornerIsExternal:c,startAngle:u,endAngle:f}):g=rve({cx:r,cy:i,innerRadius:o,outerRadius:a,startAngle:u,endAngle:f}),ue.createElement("path",G$({},jt(n,!0),{className:h,d:g,role:"img"}))};function U_(t){"@babel/helpers - typeof";return U_=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(e){return typeof e}:function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},U_(t)}function H$(){return H$=Object.assign?Object.assign.bind():function(t){for(var e=1;e<arguments.length;e++){var n=arguments[e];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(t[r]=n[r])}return t},H$.apply(this,arguments)}function LY(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(t,i).enumerable})),n.push.apply(n,r)}return n}function NY(t){for(var e=1;e<arguments.length;e++){var n=arguments[e]!=null?arguments[e]:{};e%2?LY(Object(n),!0).forEach(function(r){b2t(t,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):LY(Object(n)).forEach(function(r){Object.defineProperty(t,r,Object.getOwnPropertyDescriptor(n,r))})}return t}function b2t(t,e,n){return e=_2t(e),e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function _2t(t){var e=w2t(t,"string");return U_(e)=="symbol"?e:String(e)}function w2t(t,e){if(U_(t)!="object"||!t)return t;var n=t[Symbol.toPrimitive];if(n!==void 0){var r=n.call(t,e||"default");if(U_(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}var $Y={curveBasisClosed:kvt,curveBasisOpen:Avt,curveBasis:Mvt,curveBumpX:mvt,curveBumpY:gvt,curveLinearClosed:Rvt,curveLinear:pk,curveMonotoneX:Ivt,curveMonotoneY:Dvt,curveNatural:Lvt,curveStep:Nvt,curveStepAfter:Fvt,curveStepBefore:$vt},CO=function(e){return e.x===+e.x&&e.y===+e.y},W0=function(e){return e.x},V0=function(e){return e.y},S2t=function(e,n){if(Bt(e))return e;var r="curve".concat(dk(e));return(r==="curveMonotone"||r==="curveBump")&&n?$Y["".concat(r).concat(n==="vertical"?"Y":"X")]:$Y[r]||pk},O2t=function(e){var n=e.type,r=n===void 0?"linear":n,i=e.points,o=i===void 0?[]:i,a=e.baseLine,s=e.layout,l=e.connectNulls,c=l===void 0?!1:l,u=S2t(r,s),f=c?o.filter(function(m){return CO(m)}):o,d;if(Array.isArray(a)){var h=c?a.filter(function(m){return CO(m)}):a,p=f.map(function(m,g){return NY(NY({},m),{},{base:h[g]})});return s==="vertical"?d=mO().y(V0).x1(W0).x0(function(m){return m.base.x}):d=mO().x(W0).y1(V0).y0(function(m){return m.base.y}),d.defined(CO).curve(u),d(p)}return s==="vertical"&&Ye(a)?d=mO().y(V0).x1(W0).x0(a):Ye(a)?d=mO().x(W0).y1(V0).y0(a):d=ome().x(W0).y(V0),d.defined(CO).curve(u),d(f)},jg=function(e){var n=e.className,r=e.points,i=e.path,o=e.pathRef;if((!r||!r.length)&&!i)return null;var a=r&&r.length?O2t(e):i;return ue.createElement("path",H$({},jt(e,!1),$E(e),{className:ke("recharts-curve",n),d:a,ref:o}))},C2t=Object.getOwnPropertyNames,T2t=Object.getOwnPropertySymbols,E2t=Object.prototype.hasOwnProperty;function FY(t,e){return function(r,i,o){return t(r,i,o)&&e(r,i,o)}}function TO(t){return function(n,r,i){if(!n||!r||typeof n!="object"||typeof r!="object")return t(n,r,i);var o=i.cache,a=o.get(n),s=o.get(r);if(a&&s)return a===r&&s===n;o.set(n,r),o.set(r,n);var l=t(n,r,i);return o.delete(n),o.delete(r),l}}function jY(t){return C2t(t).concat(T2t(t))}var ove=Object.hasOwn||function(t,e){return E2t.call(t,e)};function qy(t,e){return t||e?t===e:t===e||t!==t&&e!==e}var ave="_owner",BY=Object.getOwnPropertyDescriptor,zY=Object.keys;function P2t(t,e,n){var r=t.length;if(e.length!==r)return!1;for(;r-- >0;)if(!n.equals(t[r],e[r],r,r,t,e,n))return!1;return!0}function M2t(t,e){return qy(t.getTime(),e.getTime())}function UY(t,e,n){if(t.size!==e.size)return!1;for(var r={},i=t.entries(),o=0,a,s;(a=i.next())&&!a.done;){for(var l=e.entries(),c=!1,u=0;(s=l.next())&&!s.done;){var f=a.value,d=f[0],h=f[1],p=s.value,m=p[0],g=p[1];!c&&!r[u]&&(c=n.equals(d,m,o,u,t,e,n)&&n.equals(h,g,d,m,t,e,n))&&(r[u]=!0),u++}if(!c)return!1;o++}return!0}function k2t(t,e,n){var r=zY(t),i=r.length;if(zY(e).length!==i)return!1;for(var o;i-- >0;)if(o=r[i],o===ave&&(t.$$typeof||e.$$typeof)&&t.$$typeof!==e.$$typeof||!ove(e,o)||!n.equals(t[o],e[o],o,o,t,e,n))return!1;return!0}function G0(t,e,n){var r=jY(t),i=r.length;if(jY(e).length!==i)return!1;for(var o,a,s;i-- >0;)if(o=r[i],o===ave&&(t.$$typeof||e.$$typeof)&&t.$$typeof!==e.$$typeof||!ove(e,o)||!n.equals(t[o],e[o],o,o,t,e,n)||(a=BY(t,o),s=BY(e,o),(a||s)&&(!a||!s||a.configurable!==s.configurable||a.enumerable!==s.enumerable||a.writable!==s.writable)))return!1;return!0}function A2t(t,e){return qy(t.valueOf(),e.valueOf())}function R2t(t,e){return t.source===e.source&&t.flags===e.flags}function WY(t,e,n){if(t.size!==e.size)return!1;for(var r={},i=t.values(),o,a;(o=i.next())&&!o.done;){for(var s=e.values(),l=!1,c=0;(a=s.next())&&!a.done;)!l&&!r[c]&&(l=n.equals(o.value,a.value,o.value,a.value,t,e,n))&&(r[c]=!0),c++;if(!l)return!1}return!0}function I2t(t,e){var n=t.length;if(e.length!==n)return!1;for(;n-- >0;)if(t[n]!==e[n])return!1;return!0}var D2t="[object Arguments]",L2t="[object Boolean]",N2t="[object Date]",$2t="[object Map]",F2t="[object Number]",j2t="[object Object]",B2t="[object RegExp]",z2t="[object Set]",U2t="[object String]",W2t=Array.isArray,VY=typeof ArrayBuffer=="function"&&ArrayBuffer.isView?ArrayBuffer.isView:null,GY=Object.assign,V2t=Object.prototype.toString.call.bind(Object.prototype.toString);function G2t(t){var e=t.areArraysEqual,n=t.areDatesEqual,r=t.areMapsEqual,i=t.areObjectsEqual,o=t.arePrimitiveWrappersEqual,a=t.areRegExpsEqual,s=t.areSetsEqual,l=t.areTypedArraysEqual;return function(u,f,d){if(u===f)return!0;if(u==null||f==null||typeof u!="object"||typeof f!="object")return u!==u&&f!==f;var h=u.constructor;if(h!==f.constructor)return!1;if(h===Object)return i(u,f,d);if(W2t(u))return e(u,f,d);if(VY!=null&&VY(u))return l(u,f,d);if(h===Date)return n(u,f,d);if(h===RegExp)return a(u,f,d);if(h===Map)return r(u,f,d);if(h===Set)return s(u,f,d);var p=V2t(u);return p===N2t?n(u,f,d):p===B2t?a(u,f,d):p===$2t?r(u,f,d):p===z2t?s(u,f,d):p===j2t?typeof u.then!="function"&&typeof f.then!="function"&&i(u,f,d):p===D2t?i(u,f,d):p===L2t||p===F2t||p===U2t?o(u,f,d):!1}}function H2t(t){var e=t.circular,n=t.createCustomConfig,r=t.strict,i={areArraysEqual:r?G0:P2t,areDatesEqual:M2t,areMapsEqual:r?FY(UY,G0):UY,areObjectsEqual:r?G0:k2t,arePrimitiveWrappersEqual:A2t,areRegExpsEqual:R2t,areSetsEqual:r?FY(WY,G0):WY,areTypedArraysEqual:r?G0:I2t};if(n&&(i=GY({},i,n(i))),e){var o=TO(i.areArraysEqual),a=TO(i.areMapsEqual),s=TO(i.areObjectsEqual),l=TO(i.areSetsEqual);i=GY({},i,{areArraysEqual:o,areMapsEqual:a,areObjectsEqual:s,areSetsEqual:l})}return i}function q2t(t){return function(e,n,r,i,o,a,s){return t(e,n,s)}}function X2t(t){var e=t.circular,n=t.comparator,r=t.createState,i=t.equals,o=t.strict;if(r)return function(l,c){var u=r(),f=u.cache,d=f===void 0?e?new WeakMap:void 0:f,h=u.meta;return n(l,c,{cache:d,equals:i,meta:h,strict:o})};if(e)return function(l,c){return n(l,c,{cache:new WeakMap,equals:i,meta:void 0,strict:o})};var a={cache:void 0,equals:i,meta:void 0,strict:o};return function(l,c){return n(l,c,a)}}var Q2t=Id();Id({strict:!0});Id({circular:!0});Id({circular:!0,strict:!0});Id({createInternalComparator:function(){return qy}});Id({strict:!0,createInternalComparator:function(){return qy}});Id({circular:!0,createInternalComparator:function(){return qy}});Id({circular:!0,createInternalComparator:function(){return qy},strict:!0});function Id(t){t===void 0&&(t={});var e=t.circular,n=e===void 0?!1:e,r=t.createInternalComparator,i=t.createState,o=t.strict,a=o===void 0?!1:o,s=H2t(t),l=G2t(s),c=r?r(l):q2t(l);return X2t({circular:n,comparator:l,createState:i,equals:c,strict:a})}function Y2t(t){typeof requestAnimationFrame<"u"&&requestAnimationFrame(t)}function HY(t){var e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0,n=-1,r=function i(o){n<0&&(n=o),o-n>e?(t(o),n=-1):Y2t(i)};requestAnimationFrame(r)}function q$(t){"@babel/helpers - typeof";return q$=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(e){return typeof e}:function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},q$(t)}function K2t(t){return tkt(t)||ekt(t)||J2t(t)||Z2t()}function Z2t(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function J2t(t,e){if(t){if(typeof t=="string")return qY(t,e);var n=Object.prototype.toString.call(t).slice(8,-1);if(n==="Object"&&t.constructor&&(n=t.constructor.name),n==="Map"||n==="Set")return Array.from(t);if(n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return qY(t,e)}}function qY(t,e){(e==null||e>t.length)&&(e=t.length);for(var n=0,r=new Array(e);n<e;n++)r[n]=t[n];return r}function ekt(t){if(typeof Symbol<"u"&&t[Symbol.iterator]!=null||t["@@iterator"]!=null)return Array.from(t)}function tkt(t){if(Array.isArray(t))return t}function nkt(){var t={},e=function(){return null},n=!1,r=function i(o){if(!n){if(Array.isArray(o)){if(!o.length)return;var a=o,s=K2t(a),l=s[0],c=s.slice(1);if(typeof l=="number"){HY(i.bind(null,c),l);return}i(l),HY(i.bind(null,c));return}q$(o)==="object"&&(t=o,e(t)),typeof o=="function"&&o()}};return{stop:function(){n=!0},start:function(o){n=!1,r(o)},subscribe:function(o){return e=o,function(){e=function(){return null}}}}}function W_(t){"@babel/helpers - typeof";return W_=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(e){return typeof e}:function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},W_(t)}function XY(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(t,i).enumerable})),n.push.apply(n,r)}return n}function QY(t){for(var e=1;e<arguments.length;e++){var n=arguments[e]!=null?arguments[e]:{};e%2?XY(Object(n),!0).forEach(function(r){sve(t,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):XY(Object(n)).forEach(function(r){Object.defineProperty(t,r,Object.getOwnPropertyDescriptor(n,r))})}return t}function sve(t,e,n){return e=rkt(e),e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function rkt(t){var e=ikt(t,"string");return W_(e)==="symbol"?e:String(e)}function ikt(t,e){if(W_(t)!=="object"||t===null)return t;var n=t[Symbol.toPrimitive];if(n!==void 0){var r=n.call(t,e||"default");if(W_(r)!=="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}var okt=function(e,n){return[Object.keys(e),Object.keys(n)].reduce(function(r,i){return r.filter(function(o){return i.includes(o)})})},akt=function(e){return e},skt=function(e){return e.replace(/([A-Z])/g,function(n){return"-".concat(n.toLowerCase())})},lb=function(e,n){return Object.keys(n).reduce(function(r,i){return QY(QY({},r),{},sve({},i,e(i,n[i])))},{})},YY=function(e,n,r){return e.map(function(i){return"".concat(skt(i)," ").concat(n,"ms ").concat(r)}).join(",")};function lkt(t,e){return fkt(t)||ukt(t,e)||lve(t,e)||ckt()}function ckt(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function ukt(t,e){var n=t==null?null:typeof Symbol<"u"&&t[Symbol.iterator]||t["@@iterator"];if(n!=null){var r,i,o,a,s=[],l=!0,c=!1;try{if(o=(n=n.call(t)).next,e!==0)for(;!(l=(r=o.call(n)).done)&&(s.push(r.value),s.length!==e);l=!0);}catch(u){c=!0,i=u}finally{try{if(!l&&n.return!=null&&(a=n.return(),Object(a)!==a))return}finally{if(c)throw i}}return s}}function fkt(t){if(Array.isArray(t))return t}function dkt(t){return mkt(t)||pkt(t)||lve(t)||hkt()}function hkt(){throw new TypeError(`Invalid attempt to spread non-iterable instance.
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function lve(t,e){if(t){if(typeof t=="string")return X$(t,e);var n=Object.prototype.toString.call(t).slice(8,-1);if(n==="Object"&&t.constructor&&(n=t.constructor.name),n==="Map"||n==="Set")return Array.from(t);if(n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return X$(t,e)}}function pkt(t){if(typeof Symbol<"u"&&t[Symbol.iterator]!=null||t["@@iterator"]!=null)return Array.from(t)}function mkt(t){if(Array.isArray(t))return X$(t)}function X$(t,e){(e==null||e>t.length)&&(e=t.length);for(var n=0,r=new Array(e);n<e;n++)r[n]=t[n];return r}var mP=1e-4,cve=function(e,n){return[0,3*e,3*n-6*e,3*e-3*n+1]},uve=function(e,n){return e.map(function(r,i){return r*Math.pow(n,i)}).reduce(function(r,i){return r+i})},KY=function(e,n){return function(r){var i=cve(e,n);return uve(i,r)}},gkt=function(e,n){return function(r){var i=cve(e,n),o=[].concat(dkt(i.map(function(a,s){return a*s}).slice(1)),[0]);return uve(o,r)}},ZY=function(){for(var e=arguments.length,n=new Array(e),r=0;r<e;r++)n[r]=arguments[r];var i=n[0],o=n[1],a=n[2],s=n[3];if(n.length===1)switch(n[0]){case"linear":i=0,o=0,a=1,s=1;break;case"ease":i=.25,o=.1,a=.25,s=1;break;case"ease-in":i=.42,o=0,a=1,s=1;break;case"ease-out":i=.42,o=0,a=.58,s=1;break;case"ease-in-out":i=0,o=0,a=.58,s=1;break;default:{var l=n[0].split("(");if(l[0]==="cubic-bezier"&&l[1].split(")")[0].split(",").length===4){var c=l[1].split(")")[0].split(",").map(function(g){return parseFloat(g)}),u=lkt(c,4);i=u[0],o=u[1],a=u[2],s=u[3]}}}var f=KY(i,a),d=KY(o,s),h=gkt(i,a),p=function(v){return v>1?1:v<0?0:v},m=function(v){for(var y=v>1?1:v,x=y,b=0;b<8;++b){var _=f(x)-y,S=h(x);if(Math.abs(_-y)<mP||S<mP)return d(x);x=p(x-_/S)}return d(x)};return m.isStepper=!1,m},vkt=function(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},n=e.stiff,r=n===void 0?100:n,i=e.damping,o=i===void 0?8:i,a=e.dt,s=a===void 0?17:a,l=function(u,f,d){var h=-(u-f)*r,p=d*o,m=d+(h-p)*s/1e3,g=d*s/1e3+u;return Math.abs(g-f)<mP&&Math.abs(m)<mP?[f,0]:[g,m]};return l.isStepper=!0,l.dt=s,l},ykt=function(){for(var e=arguments.length,n=new Array(e),r=0;r<e;r++)n[r]=arguments[r];var i=n[0];if(typeof i=="string")switch(i){case"ease":case"ease-in-out":case"ease-out":case"ease-in":case"linear":return ZY(i);case"spring":return vkt();default:if(i.split("(")[0]==="cubic-bezier")return ZY(i)}return typeof i=="function"?i:null};function V_(t){"@babel/helpers - typeof";return V_=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(e){return typeof e}:function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},V_(t)}function JY(t){return _kt(t)||bkt(t)||fve(t)||xkt()}function xkt(){throw new TypeError(`Invalid attempt to spread non-iterable instance.
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function bkt(t){if(typeof Symbol<"u"&&t[Symbol.iterator]!=null||t["@@iterator"]!=null)return Array.from(t)}function _kt(t){if(Array.isArray(t))return Y$(t)}function eK(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(t,i).enumerable})),n.push.apply(n,r)}return n}function bi(t){for(var e=1;e<arguments.length;e++){var n=arguments[e]!=null?arguments[e]:{};e%2?eK(Object(n),!0).forEach(function(r){Q$(t,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):eK(Object(n)).forEach(function(r){Object.defineProperty(t,r,Object.getOwnPropertyDescriptor(n,r))})}return t}function Q$(t,e,n){return e=wkt(e),e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function wkt(t){var e=Skt(t,"string");return V_(e)==="symbol"?e:String(e)}function Skt(t,e){if(V_(t)!=="object"||t===null)return t;var n=t[Symbol.toPrimitive];if(n!==void 0){var r=n.call(t,e||"default");if(V_(r)!=="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}function Okt(t,e){return Ekt(t)||Tkt(t,e)||fve(t,e)||Ckt()}function Ckt(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function fve(t,e){if(t){if(typeof t=="string")return Y$(t,e);var n=Object.prototype.toString.call(t).slice(8,-1);if(n==="Object"&&t.constructor&&(n=t.constructor.name),n==="Map"||n==="Set")return Array.from(t);if(n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return Y$(t,e)}}function Y$(t,e){(e==null||e>t.length)&&(e=t.length);for(var n=0,r=new Array(e);n<e;n++)r[n]=t[n];return r}function Tkt(t,e){var n=t==null?null:typeof Symbol<"u"&&t[Symbol.iterator]||t["@@iterator"];if(n!=null){var r,i,o,a,s=[],l=!0,c=!1;try{if(o=(n=n.call(t)).next,e!==0)for(;!(l=(r=o.call(n)).done)&&(s.push(r.value),s.length!==e);l=!0);}catch(u){c=!0,i=u}finally{try{if(!l&&n.return!=null&&(a=n.return(),Object(a)!==a))return}finally{if(c)throw i}}return s}}function Ekt(t){if(Array.isArray(t))return t}var gP=function(e,n,r){return e+(n-e)*r},K$=function(e){var n=e.from,r=e.to;return n!==r},Pkt=function t(e,n,r){var i=lb(function(o,a){if(K$(a)){var s=e(a.from,a.to,a.velocity),l=Okt(s,2),c=l[0],u=l[1];return bi(bi({},a),{},{from:c,velocity:u})}return a},n);return r<1?lb(function(o,a){return K$(a)?bi(bi({},a),{},{velocity:gP(a.velocity,i[o].velocity,r),from:gP(a.from,i[o].from,r)}):a},n):t(e,i,r-1)};const Mkt=function(t,e,n,r,i){var o=okt(t,e),a=o.reduce(function(g,v){return bi(bi({},g),{},Q$({},v,[t[v],e[v]]))},{}),s=o.reduce(function(g,v){return bi(bi({},g),{},Q$({},v,{from:t[v],velocity:0,to:e[v]}))},{}),l=-1,c,u,f=function(){return null},d=function(){return lb(function(v,y){return y.from},s)},h=function(){return!Object.values(s).filter(K$).length},p=function(v){c||(c=v);var y=v-c,x=y/n.dt;s=Pkt(n,s,x),i(bi(bi(bi({},t),e),d())),c=v,h()||(l=requestAnimationFrame(f))},m=function(v){u||(u=v);var y=(v-u)/r,x=lb(function(_,S){return gP.apply(void 0,JY(S).concat([n(y)]))},a);if(i(bi(bi(bi({},t),e),x)),y<1)l=requestAnimationFrame(f);else{var b=lb(function(_,S){return gP.apply(void 0,JY(S).concat([n(1)]))},a);i(bi(bi(bi({},t),e),b))}};return f=n.isStepper?p:m,function(){return requestAnimationFrame(f),function(){cancelAnimationFrame(l)}}};function Ev(t){"@babel/helpers - typeof";return Ev=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(e){return typeof e}:function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},Ev(t)}var kkt=["children","begin","duration","attributeName","easing","isActive","steps","from","to","canBegin","onAnimationEnd","shouldReAnimate","onAnimationReStart"];function Akt(t,e){if(t==null)return{};var n=Rkt(t,e),r,i;if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(t);for(i=0;i<o.length;i++)r=o[i],!(e.indexOf(r)>=0)&&Object.prototype.propertyIsEnumerable.call(t,r)&&(n[r]=t[r])}return n}function Rkt(t,e){if(t==null)return{};var n={},r=Object.keys(t),i,o;for(o=0;o<r.length;o++)i=r[o],!(e.indexOf(i)>=0)&&(n[i]=t[i]);return n}function DI(t){return Nkt(t)||Lkt(t)||Dkt(t)||Ikt()}function Ikt(){throw new TypeError(`Invalid attempt to spread non-iterable instance.
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function Dkt(t,e){if(t){if(typeof t=="string")return Z$(t,e);var n=Object.prototype.toString.call(t).slice(8,-1);if(n==="Object"&&t.constructor&&(n=t.constructor.name),n==="Map"||n==="Set")return Array.from(t);if(n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return Z$(t,e)}}function Lkt(t){if(typeof Symbol<"u"&&t[Symbol.iterator]!=null||t["@@iterator"]!=null)return Array.from(t)}function Nkt(t){if(Array.isArray(t))return Z$(t)}function Z$(t,e){(e==null||e>t.length)&&(e=t.length);for(var n=0,r=new Array(e);n<e;n++)r[n]=t[n];return r}function tK(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(t,i).enumerable})),n.push.apply(n,r)}return n}function ks(t){for(var e=1;e<arguments.length;e++){var n=arguments[e]!=null?arguments[e]:{};e%2?tK(Object(n),!0).forEach(function(r){xx(t,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):tK(Object(n)).forEach(function(r){Object.defineProperty(t,r,Object.getOwnPropertyDescriptor(n,r))})}return t}function xx(t,e,n){return e=dve(e),e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function $kt(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function Fkt(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,dve(r.key),r)}}function jkt(t,e,n){return e&&Fkt(t.prototype,e),Object.defineProperty(t,"prototype",{writable:!1}),t}function dve(t){var e=Bkt(t,"string");return Ev(e)==="symbol"?e:String(e)}function Bkt(t,e){if(Ev(t)!=="object"||t===null)return t;var n=t[Symbol.toPrimitive];if(n!==void 0){var r=n.call(t,e||"default");if(Ev(r)!=="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}function zkt(t,e){if(typeof e!="function"&&e!==null)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&J$(t,e)}function J$(t,e){return J$=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(r,i){return r.__proto__=i,r},J$(t,e)}function Ukt(t){var e=Wkt();return function(){var r=vP(t),i;if(e){var o=vP(this).constructor;i=Reflect.construct(r,arguments,o)}else i=r.apply(this,arguments);return eF(this,i)}}function eF(t,e){if(e&&(Ev(e)==="object"||typeof e=="function"))return e;if(e!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return tF(t)}function tF(t){if(t===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}function Wkt(){if(typeof Reflect>"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch{return!1}}function vP(t){return vP=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(n){return n.__proto__||Object.getPrototypeOf(n)},vP(t)}var rc=function(t){zkt(n,t);var e=Ukt(n);function n(r,i){var o;$kt(this,n),o=e.call(this,r,i);var a=o.props,s=a.isActive,l=a.attributeName,c=a.from,u=a.to,f=a.steps,d=a.children,h=a.duration;if(o.handleStyleChange=o.handleStyleChange.bind(tF(o)),o.changeStyle=o.changeStyle.bind(tF(o)),!s||h<=0)return o.state={style:{}},typeof d=="function"&&(o.state={style:u}),eF(o);if(f&&f.length)o.state={style:f[0].style};else if(c){if(typeof d=="function")return o.state={style:c},eF(o);o.state={style:l?xx({},l,c):c}}else o.state={style:{}};return o}return jkt(n,[{key:"componentDidMount",value:function(){var i=this.props,o=i.isActive,a=i.canBegin;this.mounted=!0,!(!o||!a)&&this.runAnimation(this.props)}},{key:"componentDidUpdate",value:function(i){var o=this.props,a=o.isActive,s=o.canBegin,l=o.attributeName,c=o.shouldReAnimate,u=o.to,f=o.from,d=this.state.style;if(s){if(!a){var h={style:l?xx({},l,u):u};this.state&&d&&(l&&d[l]!==u||!l&&d!==u)&&this.setState(h);return}if(!(Q2t(i.to,u)&&i.canBegin&&i.isActive)){var p=!i.canBegin||!i.isActive;this.manager&&this.manager.stop(),this.stopJSAnimation&&this.stopJSAnimation();var m=p||c?f:i.to;if(this.state&&d){var g={style:l?xx({},l,m):m};(l&&d[l]!==m||!l&&d!==m)&&this.setState(g)}this.runAnimation(ks(ks({},this.props),{},{from:m,begin:0}))}}}},{key:"componentWillUnmount",value:function(){this.mounted=!1;var i=this.props.onAnimationEnd;this.unSubscribe&&this.unSubscribe(),this.manager&&(this.manager.stop(),this.manager=null),this.stopJSAnimation&&this.stopJSAnimation(),i&&i()}},{key:"handleStyleChange",value:function(i){this.changeStyle(i)}},{key:"changeStyle",value:function(i){this.mounted&&this.setState({style:i})}},{key:"runJSAnimation",value:function(i){var o=this,a=i.from,s=i.to,l=i.duration,c=i.easing,u=i.begin,f=i.onAnimationEnd,d=i.onAnimationStart,h=Mkt(a,s,ykt(c),l,this.changeStyle),p=function(){o.stopJSAnimation=h()};this.manager.start([d,u,p,l,f])}},{key:"runStepAnimation",value:function(i){var o=this,a=i.steps,s=i.begin,l=i.onAnimationStart,c=a[0],u=c.style,f=c.duration,d=f===void 0?0:f,h=function(m,g,v){if(v===0)return m;var y=g.duration,x=g.easing,b=x===void 0?"ease":x,_=g.style,S=g.properties,O=g.onAnimationEnd,C=v>0?a[v-1]:g,E=S||Object.keys(_);if(typeof b=="function"||b==="spring")return[].concat(DI(m),[o.runJSAnimation.bind(o,{from:C.style,to:_,duration:y,easing:b}),y]);var k=YY(E,y,b),I=ks(ks(ks({},C.style),_),{},{transition:k});return[].concat(DI(m),[I,y,O]).filter(akt)};return this.manager.start([l].concat(DI(a.reduce(h,[u,Math.max(d,s)])),[i.onAnimationEnd]))}},{key:"runAnimation",value:function(i){this.manager||(this.manager=nkt());var o=i.begin,a=i.duration,s=i.attributeName,l=i.to,c=i.easing,u=i.onAnimationStart,f=i.onAnimationEnd,d=i.steps,h=i.children,p=this.manager;if(this.unSubscribe=p.subscribe(this.handleStyleChange),typeof c=="function"||typeof h=="function"||c==="spring"){this.runJSAnimation(i);return}if(d.length>1){this.runStepAnimation(i);return}var m=s?xx({},s,l):l,g=YY(Object.keys(m),a,c);p.start([u,o,ks(ks({},m),{},{transition:g}),a,f])}},{key:"render",value:function(){var i=this.props,o=i.children;i.begin;var a=i.duration;i.attributeName,i.easing;var s=i.isActive;i.steps,i.from,i.to,i.canBegin,i.onAnimationEnd,i.shouldReAnimate,i.onAnimationReStart;var l=Akt(i,kkt),c=M.Children.count(o),u=this.state.style;if(typeof o=="function")return o(u);if(!s||c===0||a<=0)return o;var f=function(h){var p=h.props,m=p.style,g=m===void 0?{}:m,v=p.className,y=M.cloneElement(h,ks(ks({},l),{},{style:ks(ks({},g),u),className:v}));return y};return c===1?f(M.Children.only(o)):ue.createElement("div",null,M.Children.map(o,function(d){return f(d)}))}}]),n}(M.PureComponent);rc.displayName="Animate";rc.defaultProps={begin:0,duration:1e3,from:"",to:"",attributeName:"",easing:"ease",isActive:!0,canBegin:!0,steps:[],onAnimationEnd:function(){},onAnimationStart:function(){}};rc.propTypes={from:Qe.oneOfType([Qe.object,Qe.string]),to:Qe.oneOfType([Qe.object,Qe.string]),attributeName:Qe.string,duration:Qe.number,begin:Qe.number,easing:Qe.oneOfType([Qe.string,Qe.func]),steps:Qe.arrayOf(Qe.shape({duration:Qe.number.isRequired,style:Qe.object.isRequired,easing:Qe.oneOfType([Qe.oneOf(["ease","ease-in","ease-out","ease-in-out","linear"]),Qe.func]),properties:Qe.arrayOf("string"),onAnimationEnd:Qe.func})),children:Qe.oneOfType([Qe.node,Qe.func]),isActive:Qe.bool,canBegin:Qe.bool,onAnimationEnd:Qe.func,shouldReAnimate:Qe.bool,onAnimationStart:Qe.func,onAnimationReStart:Qe.func};Qe.object,Qe.object,Qe.object,Qe.element;Qe.object,Qe.object,Qe.object,Qe.oneOfType([Qe.array,Qe.element]),Qe.any;function G_(t){"@babel/helpers - typeof";return G_=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(e){return typeof e}:function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},G_(t)}function yP(){return yP=Object.assign?Object.assign.bind():function(t){for(var e=1;e<arguments.length;e++){var n=arguments[e];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(t[r]=n[r])}return t},yP.apply(this,arguments)}function Vkt(t,e){return Xkt(t)||qkt(t,e)||Hkt(t,e)||Gkt()}function Gkt(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function Hkt(t,e){if(t){if(typeof t=="string")return nK(t,e);var n=Object.prototype.toString.call(t).slice(8,-1);if(n==="Object"&&t.constructor&&(n=t.constructor.name),n==="Map"||n==="Set")return Array.from(t);if(n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return nK(t,e)}}function nK(t,e){(e==null||e>t.length)&&(e=t.length);for(var n=0,r=new Array(e);n<e;n++)r[n]=t[n];return r}function qkt(t,e){var n=t==null?null:typeof Symbol<"u"&&t[Symbol.iterator]||t["@@iterator"];if(n!=null){var r,i,o,a,s=[],l=!0,c=!1;try{if(o=(n=n.call(t)).next,e!==0)for(;!(l=(r=o.call(n)).done)&&(s.push(r.value),s.length!==e);l=!0);}catch(u){c=!0,i=u}finally{try{if(!l&&n.return!=null&&(a=n.return(),Object(a)!==a))return}finally{if(c)throw i}}return s}}function Xkt(t){if(Array.isArray(t))return t}function rK(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(t,i).enumerable})),n.push.apply(n,r)}return n}function iK(t){for(var e=1;e<arguments.length;e++){var n=arguments[e]!=null?arguments[e]:{};e%2?rK(Object(n),!0).forEach(function(r){Qkt(t,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):rK(Object(n)).forEach(function(r){Object.defineProperty(t,r,Object.getOwnPropertyDescriptor(n,r))})}return t}function Qkt(t,e,n){return e=Ykt(e),e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function Ykt(t){var e=Kkt(t,"string");return G_(e)=="symbol"?e:String(e)}function Kkt(t,e){if(G_(t)!="object"||!t)return t;var n=t[Symbol.toPrimitive];if(n!==void 0){var r=n.call(t,e||"default");if(G_(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}var oK=function(e,n,r,i,o){var a=Math.min(Math.abs(r)/2,Math.abs(i)/2),s=i>=0?1:-1,l=r>=0?1:-1,c=i>=0&&r>=0||i<0&&r<0?1:0,u;if(a>0&&o instanceof Array){for(var f=[0,0,0,0],d=0,h=4;d<h;d++)f[d]=o[d]>a?a:o[d];u="M".concat(e,",").concat(n+s*f[0]),f[0]>0&&(u+="A ".concat(f[0],",").concat(f[0],",0,0,").concat(c,",").concat(e+l*f[0],",").concat(n)),u+="L ".concat(e+r-l*f[1],",").concat(n),f[1]>0&&(u+="A ".concat(f[1],",").concat(f[1],",0,0,").concat(c,`,
        `).concat(e+r,",").concat(n+s*f[1])),u+="L ".concat(e+r,",").concat(n+i-s*f[2]),f[2]>0&&(u+="A ".concat(f[2],",").concat(f[2],",0,0,").concat(c,`,
        `).concat(e+r-l*f[2],",").concat(n+i)),u+="L ".concat(e+l*f[3],",").concat(n+i),f[3]>0&&(u+="A ".concat(f[3],",").concat(f[3],",0,0,").concat(c,`,
        `).concat(e,",").concat(n+i-s*f[3])),u+="Z"}else if(a>0&&o===+o&&o>0){var p=Math.min(a,o);u="M ".concat(e,",").concat(n+s*p,`
            A `).concat(p,",").concat(p,",0,0,").concat(c,",").concat(e+l*p,",").concat(n,`
            L `).concat(e+r-l*p,",").concat(n,`
            A `).concat(p,",").concat(p,",0,0,").concat(c,",").concat(e+r,",").concat(n+s*p,`
            L `).concat(e+r,",").concat(n+i-s*p,`
            A `).concat(p,",").concat(p,",0,0,").concat(c,",").concat(e+r-l*p,",").concat(n+i,`
            L `).concat(e+l*p,",").concat(n+i,`
            A `).concat(p,",").concat(p,",0,0,").concat(c,",").concat(e,",").concat(n+i-s*p," Z")}else u="M ".concat(e,",").concat(n," h ").concat(r," v ").concat(i," h ").concat(-r," Z");return u},Zkt=function(e,n){if(!e||!n)return!1;var r=e.x,i=e.y,o=n.x,a=n.y,s=n.width,l=n.height;if(Math.abs(s)>0&&Math.abs(l)>0){var c=Math.min(o,o+s),u=Math.max(o,o+s),f=Math.min(a,a+l),d=Math.max(a,a+l);return r>=c&&r<=u&&i>=f&&i<=d}return!1},Jkt={x:0,y:0,width:0,height:0,radius:0,isAnimationActive:!1,isUpdateAnimationActive:!1,animationBegin:0,animationDuration:1500,animationEasing:"ease"},JU=function(e){var n=iK(iK({},Jkt),e),r=M.useRef(),i=M.useState(-1),o=Vkt(i,2),a=o[0],s=o[1];M.useEffect(function(){if(r.current&&r.current.getTotalLength)try{var b=r.current.getTotalLength();b&&s(b)}catch{}},[]);var l=n.x,c=n.y,u=n.width,f=n.height,d=n.radius,h=n.className,p=n.animationEasing,m=n.animationDuration,g=n.animationBegin,v=n.isAnimationActive,y=n.isUpdateAnimationActive;if(l!==+l||c!==+c||u!==+u||f!==+f||u===0||f===0)return null;var x=ke("recharts-rectangle",h);return y?ue.createElement(rc,{canBegin:a>0,from:{width:u,height:f,x:l,y:c},to:{width:u,height:f,x:l,y:c},duration:m,animationEasing:p,isActive:y},function(b){var _=b.width,S=b.height,O=b.x,C=b.y;return ue.createElement(rc,{canBegin:a>0,from:"0px ".concat(a===-1?1:a,"px"),to:"".concat(a,"px 0px"),attributeName:"strokeDasharray",begin:g,duration:m,isActive:v,easing:p},ue.createElement("path",yP({},jt(n,!0),{className:x,d:oK(O,C,_,S,d),ref:r})))}):ue.createElement("path",yP({},jt(n,!0),{className:x,d:oK(l,c,u,f,d)}))};function nF(){return nF=Object.assign?Object.assign.bind():function(t){for(var e=1;e<arguments.length;e++){var n=arguments[e];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(t[r]=n[r])}return t},nF.apply(this,arguments)}var Pk=function(e){var n=e.cx,r=e.cy,i=e.r,o=e.className,a=ke("recharts-dot",o);return n===+n&&r===+r&&i===+i?ue.createElement("circle",nF({},jt(e,!1),$E(e),{className:a,cx:n,cy:r,r:i})):null};function H_(t){"@babel/helpers - typeof";return H_=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(e){return typeof e}:function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},H_(t)}var eAt=["x","y","top","left","width","height","className"];function rF(){return rF=Object.assign?Object.assign.bind():function(t){for(var e=1;e<arguments.length;e++){var n=arguments[e];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(t[r]=n[r])}return t},rF.apply(this,arguments)}function aK(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(t,i).enumerable})),n.push.apply(n,r)}return n}function tAt(t){for(var e=1;e<arguments.length;e++){var n=arguments[e]!=null?arguments[e]:{};e%2?aK(Object(n),!0).forEach(function(r){nAt(t,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):aK(Object(n)).forEach(function(r){Object.defineProperty(t,r,Object.getOwnPropertyDescriptor(n,r))})}return t}function nAt(t,e,n){return e=rAt(e),e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function rAt(t){var e=iAt(t,"string");return H_(e)=="symbol"?e:String(e)}function iAt(t,e){if(H_(t)!="object"||!t)return t;var n=t[Symbol.toPrimitive];if(n!==void 0){var r=n.call(t,e||"default");if(H_(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}function oAt(t,e){if(t==null)return{};var n=aAt(t,e),r,i;if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(t);for(i=0;i<o.length;i++)r=o[i],!(e.indexOf(r)>=0)&&Object.prototype.propertyIsEnumerable.call(t,r)&&(n[r]=t[r])}return n}function aAt(t,e){if(t==null)return{};var n={},r=Object.keys(t),i,o;for(o=0;o<r.length;o++)i=r[o],!(e.indexOf(i)>=0)&&(n[i]=t[i]);return n}var sAt=function(e,n,r,i,o,a){return"M".concat(e,",").concat(o,"v").concat(i,"M").concat(a,",").concat(n,"h").concat(r)},lAt=function(e){var n=e.x,r=n===void 0?0:n,i=e.y,o=i===void 0?0:i,a=e.top,s=a===void 0?0:a,l=e.left,c=l===void 0?0:l,u=e.width,f=u===void 0?0:u,d=e.height,h=d===void 0?0:d,p=e.className,m=oAt(e,eAt),g=tAt({x:r,y:o,top:s,left:c,width:f,height:h},m);return!Ye(r)||!Ye(o)||!Ye(f)||!Ye(h)||!Ye(s)||!Ye(c)?null:ue.createElement("path",rF({},jt(g,!0),{className:ke("recharts-cross",p),d:sAt(r,o,f,h,s,c)}))},cAt=Mme,uAt=cAt(Object.getPrototypeOf,Object),fAt=uAt,dAt=Ou,hAt=fAt,pAt=Cu,mAt="[object Object]",gAt=Function.prototype,vAt=Object.prototype,hve=gAt.toString,yAt=vAt.hasOwnProperty,xAt=hve.call(Object);function bAt(t){if(!pAt(t)||dAt(t)!=mAt)return!1;var e=hAt(t);if(e===null)return!0;var n=yAt.call(e,"constructor")&&e.constructor;return typeof n=="function"&&n instanceof n&&hve.call(n)==xAt}var _At=bAt;const wAt=$t(_At);var SAt=Ou,OAt=Cu,CAt="[object Boolean]";function TAt(t){return t===!0||t===!1||OAt(t)&&SAt(t)==CAt}var EAt=TAt;const PAt=$t(EAt);function q_(t){"@babel/helpers - typeof";return q_=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(e){return typeof e}:function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},q_(t)}function xP(){return xP=Object.assign?Object.assign.bind():function(t){for(var e=1;e<arguments.length;e++){var n=arguments[e];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(t[r]=n[r])}return t},xP.apply(this,arguments)}function MAt(t,e){return IAt(t)||RAt(t,e)||AAt(t,e)||kAt()}function kAt(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function AAt(t,e){if(t){if(typeof t=="string")return sK(t,e);var n=Object.prototype.toString.call(t).slice(8,-1);if(n==="Object"&&t.constructor&&(n=t.constructor.name),n==="Map"||n==="Set")return Array.from(t);if(n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return sK(t,e)}}function sK(t,e){(e==null||e>t.length)&&(e=t.length);for(var n=0,r=new Array(e);n<e;n++)r[n]=t[n];return r}function RAt(t,e){var n=t==null?null:typeof Symbol<"u"&&t[Symbol.iterator]||t["@@iterator"];if(n!=null){var r,i,o,a,s=[],l=!0,c=!1;try{if(o=(n=n.call(t)).next,e!==0)for(;!(l=(r=o.call(n)).done)&&(s.push(r.value),s.length!==e);l=!0);}catch(u){c=!0,i=u}finally{try{if(!l&&n.return!=null&&(a=n.return(),Object(a)!==a))return}finally{if(c)throw i}}return s}}function IAt(t){if(Array.isArray(t))return t}function lK(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(t,i).enumerable})),n.push.apply(n,r)}return n}function cK(t){for(var e=1;e<arguments.length;e++){var n=arguments[e]!=null?arguments[e]:{};e%2?lK(Object(n),!0).forEach(function(r){DAt(t,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):lK(Object(n)).forEach(function(r){Object.defineProperty(t,r,Object.getOwnPropertyDescriptor(n,r))})}return t}function DAt(t,e,n){return e=LAt(e),e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function LAt(t){var e=NAt(t,"string");return q_(e)=="symbol"?e:String(e)}function NAt(t,e){if(q_(t)!="object"||!t)return t;var n=t[Symbol.toPrimitive];if(n!==void 0){var r=n.call(t,e||"default");if(q_(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}var uK=function(e,n,r,i,o){var a=r-i,s;return s="M ".concat(e,",").concat(n),s+="L ".concat(e+r,",").concat(n),s+="L ".concat(e+r-a/2,",").concat(n+o),s+="L ".concat(e+r-a/2-i,",").concat(n+o),s+="L ".concat(e,",").concat(n," Z"),s},$At={x:0,y:0,upperWidth:0,lowerWidth:0,height:0,isUpdateAnimationActive:!1,animationBegin:0,animationDuration:1500,animationEasing:"ease"},FAt=function(e){var n=cK(cK({},$At),e),r=M.useRef(),i=M.useState(-1),o=MAt(i,2),a=o[0],s=o[1];M.useEffect(function(){if(r.current&&r.current.getTotalLength)try{var x=r.current.getTotalLength();x&&s(x)}catch{}},[]);var l=n.x,c=n.y,u=n.upperWidth,f=n.lowerWidth,d=n.height,h=n.className,p=n.animationEasing,m=n.animationDuration,g=n.animationBegin,v=n.isUpdateAnimationActive;if(l!==+l||c!==+c||u!==+u||f!==+f||d!==+d||u===0&&f===0||d===0)return null;var y=ke("recharts-trapezoid",h);return v?ue.createElement(rc,{canBegin:a>0,from:{upperWidth:0,lowerWidth:0,height:d,x:l,y:c},to:{upperWidth:u,lowerWidth:f,height:d,x:l,y:c},duration:m,animationEasing:p,isActive:v},function(x){var b=x.upperWidth,_=x.lowerWidth,S=x.height,O=x.x,C=x.y;return ue.createElement(rc,{canBegin:a>0,from:"0px ".concat(a===-1?1:a,"px"),to:"".concat(a,"px 0px"),attributeName:"strokeDasharray",begin:g,duration:m,easing:p},ue.createElement("path",xP({},jt(n,!0),{className:y,d:uK(O,C,b,_,S),ref:r})))}):ue.createElement("g",null,ue.createElement("path",xP({},jt(n,!0),{className:y,d:uK(l,c,u,f,d)})))},jAt=["option","shapeType","propTransformer","activeClassName","isActive"];function X_(t){"@babel/helpers - typeof";return X_=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(e){return typeof e}:function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},X_(t)}function BAt(t,e){if(t==null)return{};var n=zAt(t,e),r,i;if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(t);for(i=0;i<o.length;i++)r=o[i],!(e.indexOf(r)>=0)&&Object.prototype.propertyIsEnumerable.call(t,r)&&(n[r]=t[r])}return n}function zAt(t,e){if(t==null)return{};var n={},r=Object.keys(t),i,o;for(o=0;o<r.length;o++)i=r[o],!(e.indexOf(i)>=0)&&(n[i]=t[i]);return n}function fK(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(t,i).enumerable})),n.push.apply(n,r)}return n}function bP(t){for(var e=1;e<arguments.length;e++){var n=arguments[e]!=null?arguments[e]:{};e%2?fK(Object(n),!0).forEach(function(r){UAt(t,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):fK(Object(n)).forEach(function(r){Object.defineProperty(t,r,Object.getOwnPropertyDescriptor(n,r))})}return t}function UAt(t,e,n){return e=WAt(e),e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function WAt(t){var e=VAt(t,"string");return X_(e)=="symbol"?e:String(e)}function VAt(t,e){if(X_(t)!="object"||!t)return t;var n=t[Symbol.toPrimitive];if(n!==void 0){var r=n.call(t,e||"default");if(X_(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}function GAt(t,e){return bP(bP({},e),t)}function HAt(t,e){return t==="symbols"}function dK(t){var e=t.shapeType,n=t.elementProps;switch(e){case"rectangle":return ue.createElement(JU,n);case"trapezoid":return ue.createElement(FAt,n);case"sector":return ue.createElement(ive,n);case"symbols":if(HAt(e))return ue.createElement(yU,n);break;default:return null}}function qAt(t){return M.isValidElement(t)?t.props:t}function XAt(t){var e=t.option,n=t.shapeType,r=t.propTransformer,i=r===void 0?GAt:r,o=t.activeClassName,a=o===void 0?"recharts-active-shape":o,s=t.isActive,l=BAt(t,jAt),c;if(M.isValidElement(e))c=M.cloneElement(e,bP(bP({},l),qAt(e)));else if(Bt(e))c=e(l);else if(wAt(e)&&!PAt(e)){var u=i(e,l);c=ue.createElement(dK,{shapeType:n,elementProps:u})}else{var f=l;c=ue.createElement(dK,{shapeType:n,elementProps:f})}return s?ue.createElement(Gn,{className:a},c):c}function Mk(t,e){return e!=null&&"trapezoids"in t.props}function kk(t,e){return e!=null&&"sectors"in t.props}function Q_(t,e){return e!=null&&"points"in t.props}function QAt(t,e){var n,r,i=t.x===(e==null||(n=e.labelViewBox)===null||n===void 0?void 0:n.x)||t.x===e.x,o=t.y===(e==null||(r=e.labelViewBox)===null||r===void 0?void 0:r.y)||t.y===e.y;return i&&o}function YAt(t,e){var n=t.endAngle===e.endAngle,r=t.startAngle===e.startAngle;return n&&r}function KAt(t,e){var n=t.x===e.x,r=t.y===e.y,i=t.z===e.z;return n&&r&&i}function ZAt(t,e){var n;return Mk(t,e)?n=QAt:kk(t,e)?n=YAt:Q_(t,e)&&(n=KAt),n}function JAt(t,e){var n;return Mk(t,e)?n="trapezoids":kk(t,e)?n="sectors":Q_(t,e)&&(n="points"),n}function eRt(t,e){if(Mk(t,e)){var n;return(n=e.tooltipPayload)===null||n===void 0||(n=n[0])===null||n===void 0||(n=n.payload)===null||n===void 0?void 0:n.payload}if(kk(t,e)){var r;return(r=e.tooltipPayload)===null||r===void 0||(r=r[0])===null||r===void 0||(r=r.payload)===null||r===void 0?void 0:r.payload}return Q_(t,e)?e.payload:{}}function tRt(t){var e=t.activeTooltipItem,n=t.graphicalItem,r=t.itemData,i=JAt(n,e),o=eRt(n,e),a=r.filter(function(l,c){var u=Tv(o,l),f=n.props[i].filter(function(p){var m=ZAt(n,e);return m(p,e)}),d=n.props[i].indexOf(f[f.length-1]),h=c===d;return u&&h}),s=r.indexOf(a[a.length-1]);return s}var nRt=Math.ceil,rRt=Math.max;function iRt(t,e,n,r){for(var i=-1,o=rRt(nRt((e-t)/(n||1)),0),a=Array(o);o--;)a[r?o:++i]=t,t+=n;return a}var oRt=iRt,aRt=Qme,hK=1/0,sRt=17976931348623157e292;function lRt(t){if(!t)return t===0?t:0;if(t=aRt(t),t===hK||t===-hK){var e=t<0?-1:1;return e*sRt}return t===t?t:0}var pve=lRt,cRt=oRt,uRt=yk,LI=pve;function fRt(t){return function(e,n,r){return r&&typeof r!="number"&&uRt(e,n,r)&&(n=r=void 0),e=LI(e),n===void 0?(n=e,e=0):n=LI(n),r=r===void 0?e<n?1:-1:LI(r),cRt(e,n,r,t)}}var dRt=fRt,hRt=dRt,pRt=hRt(),mRt=pRt;const _P=$t(mRt);function Y_(t){"@babel/helpers - typeof";return Y_=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(e){return typeof e}:function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},Y_(t)}function pK(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(t,i).enumerable})),n.push.apply(n,r)}return n}function mK(t){for(var e=1;e<arguments.length;e++){var n=arguments[e]!=null?arguments[e]:{};e%2?pK(Object(n),!0).forEach(function(r){mve(t,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):pK(Object(n)).forEach(function(r){Object.defineProperty(t,r,Object.getOwnPropertyDescriptor(n,r))})}return t}function mve(t,e,n){return e=gRt(e),e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function gRt(t){var e=vRt(t,"string");return Y_(e)=="symbol"?e:String(e)}function vRt(t,e){if(Y_(t)!="object"||!t)return t;var n=t[Symbol.toPrimitive];if(n!==void 0){var r=n.call(t,e||"default");if(Y_(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}var yRt=["Webkit","Moz","O","ms"],xRt=function(e,n){var r=e.replace(/(\w)/,function(o){return o.toUpperCase()}),i=yRt.reduce(function(o,a){return mK(mK({},o),{},mve({},a+r,n))},{});return i[e]=n,i};function Pv(t){"@babel/helpers - typeof";return Pv=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(e){return typeof e}:function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},Pv(t)}function wP(){return wP=Object.assign?Object.assign.bind():function(t){for(var e=1;e<arguments.length;e++){var n=arguments[e];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(t[r]=n[r])}return t},wP.apply(this,arguments)}function gK(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(t,i).enumerable})),n.push.apply(n,r)}return n}function NI(t){for(var e=1;e<arguments.length;e++){var n=arguments[e]!=null?arguments[e]:{};e%2?gK(Object(n),!0).forEach(function(r){aa(t,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):gK(Object(n)).forEach(function(r){Object.defineProperty(t,r,Object.getOwnPropertyDescriptor(n,r))})}return t}function bRt(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function vK(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,vve(r.key),r)}}function _Rt(t,e,n){return e&&vK(t.prototype,e),n&&vK(t,n),Object.defineProperty(t,"prototype",{writable:!1}),t}function wRt(t,e,n){return e=SP(e),SRt(t,gve()?Reflect.construct(e,n||[],SP(t).constructor):e.apply(t,n))}function SRt(t,e){if(e&&(Pv(e)==="object"||typeof e=="function"))return e;if(e!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return hl(t)}function gve(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch{}return(gve=function(){return!!t})()}function SP(t){return SP=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(n){return n.__proto__||Object.getPrototypeOf(n)},SP(t)}function hl(t){if(t===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}function ORt(t,e){if(typeof e!="function"&&e!==null)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&iF(t,e)}function iF(t,e){return iF=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(r,i){return r.__proto__=i,r},iF(t,e)}function aa(t,e,n){return e=vve(e),e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function vve(t){var e=CRt(t,"string");return Pv(e)=="symbol"?e:String(e)}function CRt(t,e){if(Pv(t)!="object"||!t)return t;var n=t[Symbol.toPrimitive];if(n!==void 0){var r=n.call(t,e||"default");if(Pv(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}var TRt=function(e){var n=e.data,r=e.startIndex,i=e.endIndex,o=e.x,a=e.width,s=e.travellerWidth;if(!n||!n.length)return{};var l=n.length,c=ab().domain(_P(0,l)).range([o,o+a-s]),u=c.domain().map(function(f){return c(f)});return{isTextActive:!1,isSlideMoving:!1,isTravellerMoving:!1,isTravellerFocused:!1,startX:c(r),endX:c(i),scale:c,scaleValues:u}},yK=function(e){return e.changedTouches&&!!e.changedTouches.length},gp=function(t){ORt(e,t);function e(n){var r;return bRt(this,e),r=wRt(this,e,[n]),aa(hl(r),"handleDrag",function(i){r.leaveTimer&&(clearTimeout(r.leaveTimer),r.leaveTimer=null),r.state.isTravellerMoving?r.handleTravellerMove(i):r.state.isSlideMoving&&r.handleSlideDrag(i)}),aa(hl(r),"handleTouchMove",function(i){i.changedTouches!=null&&i.changedTouches.length>0&&r.handleDrag(i.changedTouches[0])}),aa(hl(r),"handleDragEnd",function(){r.setState({isTravellerMoving:!1,isSlideMoving:!1},function(){var i=r.props,o=i.endIndex,a=i.onDragEnd,s=i.startIndex;a==null||a({endIndex:o,startIndex:s})}),r.detachDragEndListener()}),aa(hl(r),"handleLeaveWrapper",function(){(r.state.isTravellerMoving||r.state.isSlideMoving)&&(r.leaveTimer=window.setTimeout(r.handleDragEnd,r.props.leaveTimeOut))}),aa(hl(r),"handleEnterSlideOrTraveller",function(){r.setState({isTextActive:!0})}),aa(hl(r),"handleLeaveSlideOrTraveller",function(){r.setState({isTextActive:!1})}),aa(hl(r),"handleSlideDragStart",function(i){var o=yK(i)?i.changedTouches[0]:i;r.setState({isTravellerMoving:!1,isSlideMoving:!0,slideMoveStartX:o.pageX}),r.attachDragEndListener()}),r.travellerDragStartHandlers={startX:r.handleTravellerDragStart.bind(hl(r),"startX"),endX:r.handleTravellerDragStart.bind(hl(r),"endX")},r.state={},r}return _Rt(e,[{key:"componentWillUnmount",value:function(){this.leaveTimer&&(clearTimeout(this.leaveTimer),this.leaveTimer=null),this.detachDragEndListener()}},{key:"getIndex",value:function(r){var i=r.startX,o=r.endX,a=this.state.scaleValues,s=this.props,l=s.gap,c=s.data,u=c.length-1,f=Math.min(i,o),d=Math.max(i,o),h=e.getIndexInRange(a,f),p=e.getIndexInRange(a,d);return{startIndex:h-h%l,endIndex:p===u?u:p-p%l}}},{key:"getTextOfTick",value:function(r){var i=this.props,o=i.data,a=i.tickFormatter,s=i.dataKey,l=ho(o[r],s,r);return Bt(a)?a(l,r):l}},{key:"attachDragEndListener",value:function(){window.addEventListener("mouseup",this.handleDragEnd,!0),window.addEventListener("touchend",this.handleDragEnd,!0),window.addEventListener("mousemove",this.handleDrag,!0)}},{key:"detachDragEndListener",value:function(){window.removeEventListener("mouseup",this.handleDragEnd,!0),window.removeEventListener("touchend",this.handleDragEnd,!0),window.removeEventListener("mousemove",this.handleDrag,!0)}},{key:"handleSlideDrag",value:function(r){var i=this.state,o=i.slideMoveStartX,a=i.startX,s=i.endX,l=this.props,c=l.x,u=l.width,f=l.travellerWidth,d=l.startIndex,h=l.endIndex,p=l.onChange,m=r.pageX-o;m>0?m=Math.min(m,c+u-f-s,c+u-f-a):m<0&&(m=Math.max(m,c-a,c-s));var g=this.getIndex({startX:a+m,endX:s+m});(g.startIndex!==d||g.endIndex!==h)&&p&&p(g),this.setState({startX:a+m,endX:s+m,slideMoveStartX:r.pageX})}},{key:"handleTravellerDragStart",value:function(r,i){var o=yK(i)?i.changedTouches[0]:i;this.setState({isSlideMoving:!1,isTravellerMoving:!0,movingTravellerId:r,brushMoveStartX:o.pageX}),this.attachDragEndListener()}},{key:"handleTravellerMove",value:function(r){var i=this.state,o=i.brushMoveStartX,a=i.movingTravellerId,s=i.endX,l=i.startX,c=this.state[a],u=this.props,f=u.x,d=u.width,h=u.travellerWidth,p=u.onChange,m=u.gap,g=u.data,v={startX:this.state.startX,endX:this.state.endX},y=r.pageX-o;y>0?y=Math.min(y,f+d-h-c):y<0&&(y=Math.max(y,f-c)),v[a]=c+y;var x=this.getIndex(v),b=x.startIndex,_=x.endIndex,S=function(){var C=g.length-1;return a==="startX"&&(s>l?b%m===0:_%m===0)||s<l&&_===C||a==="endX"&&(s>l?_%m===0:b%m===0)||s>l&&_===C};this.setState(aa(aa({},a,c+y),"brushMoveStartX",r.pageX),function(){p&&S()&&p(x)})}},{key:"handleTravellerMoveKeyboard",value:function(r,i){var o=this,a=this.state,s=a.scaleValues,l=a.startX,c=a.endX,u=this.state[i],f=s.indexOf(u);if(f!==-1){var d=f+r;if(!(d===-1||d>=s.length)){var h=s[d];i==="startX"&&h>=c||i==="endX"&&h<=l||this.setState(aa({},i,h),function(){o.props.onChange(o.getIndex({startX:o.state.startX,endX:o.state.endX}))})}}}},{key:"renderBackground",value:function(){var r=this.props,i=r.x,o=r.y,a=r.width,s=r.height,l=r.fill,c=r.stroke;return ue.createElement("rect",{stroke:c,fill:l,x:i,y:o,width:a,height:s})}},{key:"renderPanorama",value:function(){var r=this.props,i=r.x,o=r.y,a=r.width,s=r.height,l=r.data,c=r.children,u=r.padding,f=M.Children.only(c);return f?ue.cloneElement(f,{x:i,y:o,width:a,height:s,margin:u,compact:!0,data:l}):null}},{key:"renderTravellerLayer",value:function(r,i){var o,a,s=this,l=this.props,c=l.y,u=l.travellerWidth,f=l.height,d=l.traveller,h=l.ariaLabel,p=l.data,m=l.startIndex,g=l.endIndex,v=Math.max(r,this.props.x),y=NI(NI({},jt(this.props,!1)),{},{x:v,y:c,width:u,height:f}),x=h||"Min value: ".concat((o=p[m])===null||o===void 0?void 0:o.name,", Max value: ").concat((a=p[g])===null||a===void 0?void 0:a.name);return ue.createElement(Gn,{tabIndex:0,role:"slider","aria-label":x,"aria-valuenow":r,className:"recharts-brush-traveller",onMouseEnter:this.handleEnterSlideOrTraveller,onMouseLeave:this.handleLeaveSlideOrTraveller,onMouseDown:this.travellerDragStartHandlers[i],onTouchStart:this.travellerDragStartHandlers[i],onKeyDown:function(_){["ArrowLeft","ArrowRight"].includes(_.key)&&(_.preventDefault(),_.stopPropagation(),s.handleTravellerMoveKeyboard(_.key==="ArrowRight"?1:-1,i))},onFocus:function(){s.setState({isTravellerFocused:!0})},onBlur:function(){s.setState({isTravellerFocused:!1})},style:{cursor:"col-resize"}},e.renderTraveller(d,y))}},{key:"renderSlide",value:function(r,i){var o=this.props,a=o.y,s=o.height,l=o.stroke,c=o.travellerWidth,u=Math.min(r,i)+c,f=Math.max(Math.abs(i-r)-c,0);return ue.createElement("rect",{className:"recharts-brush-slide",onMouseEnter:this.handleEnterSlideOrTraveller,onMouseLeave:this.handleLeaveSlideOrTraveller,onMouseDown:this.handleSlideDragStart,onTouchStart:this.handleSlideDragStart,style:{cursor:"move"},stroke:"none",fill:l,fillOpacity:.2,x:u,y:a,width:f,height:s})}},{key:"renderText",value:function(){var r=this.props,i=r.startIndex,o=r.endIndex,a=r.y,s=r.height,l=r.travellerWidth,c=r.stroke,u=this.state,f=u.startX,d=u.endX,h=5,p={pointerEvents:"none",fill:c};return ue.createElement(Gn,{className:"recharts-brush-texts"},ue.createElement(ZE,wP({textAnchor:"end",verticalAnchor:"middle",x:Math.min(f,d)-h,y:a+s/2},p),this.getTextOfTick(i)),ue.createElement(ZE,wP({textAnchor:"start",verticalAnchor:"middle",x:Math.max(f,d)+l+h,y:a+s/2},p),this.getTextOfTick(o)))}},{key:"render",value:function(){var r=this.props,i=r.data,o=r.className,a=r.children,s=r.x,l=r.y,c=r.width,u=r.height,f=r.alwaysShowText,d=this.state,h=d.startX,p=d.endX,m=d.isTextActive,g=d.isSlideMoving,v=d.isTravellerMoving,y=d.isTravellerFocused;if(!i||!i.length||!Ye(s)||!Ye(l)||!Ye(c)||!Ye(u)||c<=0||u<=0)return null;var x=ke("recharts-brush",o),b=ue.Children.count(a)===1,_=xRt("userSelect","none");return ue.createElement(Gn,{className:x,onMouseLeave:this.handleLeaveWrapper,onTouchMove:this.handleTouchMove,style:_},this.renderBackground(),b&&this.renderPanorama(),this.renderSlide(h,p),this.renderTravellerLayer(h,"startX"),this.renderTravellerLayer(p,"endX"),(m||g||v||y||f)&&this.renderText())}}],[{key:"renderDefaultTraveller",value:function(r){var i=r.x,o=r.y,a=r.width,s=r.height,l=r.stroke,c=Math.floor(o+s/2)-1;return ue.createElement(ue.Fragment,null,ue.createElement("rect",{x:i,y:o,width:a,height:s,fill:l,stroke:"none"}),ue.createElement("line",{x1:i+1,y1:c,x2:i+a-1,y2:c,fill:"none",stroke:"#fff"}),ue.createElement("line",{x1:i+1,y1:c+2,x2:i+a-1,y2:c+2,fill:"none",stroke:"#fff"}))}},{key:"renderTraveller",value:function(r,i){var o;return ue.isValidElement(r)?o=ue.cloneElement(r,i):Bt(r)?o=r(i):o=e.renderDefaultTraveller(i),o}},{key:"getDerivedStateFromProps",value:function(r,i){var o=r.data,a=r.width,s=r.x,l=r.travellerWidth,c=r.updateId,u=r.startIndex,f=r.endIndex;if(o!==i.prevData||c!==i.prevUpdateId)return NI({prevData:o,prevTravellerWidth:l,prevUpdateId:c,prevX:s,prevWidth:a},o&&o.length?TRt({data:o,width:a,x:s,travellerWidth:l,startIndex:u,endIndex:f}):{scale:null,scaleValues:null});if(i.scale&&(a!==i.prevWidth||s!==i.prevX||l!==i.prevTravellerWidth)){i.scale.range([s,s+a-l]);var d=i.scale.domain().map(function(h){return i.scale(h)});return{prevData:o,prevTravellerWidth:l,prevUpdateId:c,prevX:s,prevWidth:a,startX:i.scale(r.startIndex),endX:i.scale(r.endIndex),scaleValues:d}}return null}},{key:"getIndexInRange",value:function(r,i){for(var o=r.length,a=0,s=o-1;s-a>1;){var l=Math.floor((a+s)/2);r[l]>i?s=l:a=l}return i>=r[s]?s:a}}]),e}(M.PureComponent);aa(gp,"displayName","Brush");aa(gp,"defaultProps",{height:40,travellerWidth:5,gap:1,fill:"#fff",stroke:"#666",padding:{top:1,right:1,bottom:1,left:1},leaveTimeOut:1e3,alwaysShowText:!1});var ERt=CU;function PRt(t,e){var n;return ERt(t,function(r,i,o){return n=e(r,i,o),!n}),!!n}var MRt=PRt,kRt=_me,ARt=kd,RRt=MRt,IRt=qo,DRt=yk;function LRt(t,e,n){var r=IRt(t)?kRt:RRt;return n&&DRt(t,e,n)&&(e=void 0),r(t,ARt(e))}var NRt=LRt;const $Rt=$t(NRt);var Zl=function(e,n){var r=e.alwaysShow,i=e.ifOverflow;return r&&(i="extendDomain"),i===n},xK=Vme;function FRt(t,e,n){e=="__proto__"&&xK?xK(t,e,{configurable:!0,enumerable:!0,value:n,writable:!0}):t[e]=n}var jRt=FRt,BRt=jRt,zRt=Ume,URt=kd;function WRt(t,e){var n={};return e=URt(e),zRt(t,function(r,i,o){BRt(n,i,e(r,i,o))}),n}var VRt=WRt;const GRt=$t(VRt);function HRt(t,e){for(var n=-1,r=t==null?0:t.length;++n<r;)if(!e(t[n],n,t))return!1;return!0}var qRt=HRt,XRt=CU;function QRt(t,e){var n=!0;return XRt(t,function(r,i,o){return n=!!e(r,i,o),n}),n}var YRt=QRt,KRt=qRt,ZRt=YRt,JRt=kd,eIt=qo,tIt=yk;function nIt(t,e,n){var r=eIt(t)?KRt:ZRt;return n&&tIt(t,e,n)&&(e=void 0),r(t,JRt(e))}var rIt=nIt;const yve=$t(rIt);var iIt=["x","y"];function K_(t){"@babel/helpers - typeof";return K_=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(e){return typeof e}:function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},K_(t)}function oF(){return oF=Object.assign?Object.assign.bind():function(t){for(var e=1;e<arguments.length;e++){var n=arguments[e];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(t[r]=n[r])}return t},oF.apply(this,arguments)}function bK(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(t,i).enumerable})),n.push.apply(n,r)}return n}function H0(t){for(var e=1;e<arguments.length;e++){var n=arguments[e]!=null?arguments[e]:{};e%2?bK(Object(n),!0).forEach(function(r){oIt(t,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):bK(Object(n)).forEach(function(r){Object.defineProperty(t,r,Object.getOwnPropertyDescriptor(n,r))})}return t}function oIt(t,e,n){return e=aIt(e),e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function aIt(t){var e=sIt(t,"string");return K_(e)=="symbol"?e:String(e)}function sIt(t,e){if(K_(t)!="object"||!t)return t;var n=t[Symbol.toPrimitive];if(n!==void 0){var r=n.call(t,e||"default");if(K_(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}function lIt(t,e){if(t==null)return{};var n=cIt(t,e),r,i;if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(t);for(i=0;i<o.length;i++)r=o[i],!(e.indexOf(r)>=0)&&Object.prototype.propertyIsEnumerable.call(t,r)&&(n[r]=t[r])}return n}function cIt(t,e){if(t==null)return{};var n={},r=Object.keys(t),i,o;for(o=0;o<r.length;o++)i=r[o],!(e.indexOf(i)>=0)&&(n[i]=t[i]);return n}function uIt(t,e){var n=t.x,r=t.y,i=lIt(t,iIt),o="".concat(n),a=parseInt(o,10),s="".concat(r),l=parseInt(s,10),c="".concat(e.height||i.height),u=parseInt(c,10),f="".concat(e.width||i.width),d=parseInt(f,10);return H0(H0(H0(H0(H0({},e),i),a?{x:a}:{}),l?{y:l}:{}),{},{height:u,width:d,name:e.name,radius:e.radius})}function _K(t){return ue.createElement(XAt,oF({shapeType:"rectangle",propTransformer:uIt,activeClassName:"recharts-active-bar"},t))}var fIt=function(e){var n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0;return function(r,i){if(typeof e=="number")return e;var o=typeof r=="number";return o?e(r,i):(o||mp(),n)}},dIt=["value","background"],xve;function Mv(t){"@babel/helpers - typeof";return Mv=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(e){return typeof e}:function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},Mv(t)}function hIt(t,e){if(t==null)return{};var n=pIt(t,e),r,i;if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(t);for(i=0;i<o.length;i++)r=o[i],!(e.indexOf(r)>=0)&&Object.prototype.propertyIsEnumerable.call(t,r)&&(n[r]=t[r])}return n}function pIt(t,e){if(t==null)return{};var n={},r=Object.keys(t),i,o;for(o=0;o<r.length;o++)i=r[o],!(e.indexOf(i)>=0)&&(n[i]=t[i]);return n}function OP(){return OP=Object.assign?Object.assign.bind():function(t){for(var e=1;e<arguments.length;e++){var n=arguments[e];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(t[r]=n[r])}return t},OP.apply(this,arguments)}function wK(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(t,i).enumerable})),n.push.apply(n,r)}return n}function ai(t){for(var e=1;e<arguments.length;e++){var n=arguments[e]!=null?arguments[e]:{};e%2?wK(Object(n),!0).forEach(function(r){Pf(t,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):wK(Object(n)).forEach(function(r){Object.defineProperty(t,r,Object.getOwnPropertyDescriptor(n,r))})}return t}function mIt(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function SK(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,_ve(r.key),r)}}function gIt(t,e,n){return e&&SK(t.prototype,e),n&&SK(t,n),Object.defineProperty(t,"prototype",{writable:!1}),t}function vIt(t,e,n){return e=CP(e),yIt(t,bve()?Reflect.construct(e,n||[],CP(t).constructor):e.apply(t,n))}function yIt(t,e){if(e&&(Mv(e)==="object"||typeof e=="function"))return e;if(e!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return bx(t)}function bve(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch{}return(bve=function(){return!!t})()}function CP(t){return CP=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(n){return n.__proto__||Object.getPrototypeOf(n)},CP(t)}function bx(t){if(t===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}function xIt(t,e){if(typeof e!="function"&&e!==null)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&aF(t,e)}function aF(t,e){return aF=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(r,i){return r.__proto__=i,r},aF(t,e)}function Pf(t,e,n){return e=_ve(e),e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function _ve(t){var e=bIt(t,"string");return Mv(e)=="symbol"?e:String(e)}function bIt(t,e){if(Mv(t)!="object"||!t)return t;var n=t[Symbol.toPrimitive];if(n!==void 0){var r=n.call(t,e||"default");if(Mv(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}var Up=function(t){xIt(e,t);function e(){var n;mIt(this,e);for(var r=arguments.length,i=new Array(r),o=0;o<r;o++)i[o]=arguments[o];return n=vIt(this,e,[].concat(i)),Pf(bx(n),"state",{isAnimationFinished:!1}),Pf(bx(n),"id",jy("recharts-bar-")),Pf(bx(n),"handleAnimationEnd",function(){var a=n.props.onAnimationEnd;n.setState({isAnimationFinished:!0}),a&&a()}),Pf(bx(n),"handleAnimationStart",function(){var a=n.props.onAnimationStart;n.setState({isAnimationFinished:!1}),a&&a()}),n}return gIt(e,[{key:"renderRectanglesStatically",value:function(r){var i=this,o=this.props,a=o.shape,s=o.dataKey,l=o.activeIndex,c=o.activeBar,u=jt(this.props,!1);return r&&r.map(function(f,d){var h=d===l,p=h?c:a,m=ai(ai(ai({},u),f),{},{isActive:h,option:p,index:d,dataKey:s,onAnimationStart:i.handleAnimationStart,onAnimationEnd:i.handleAnimationEnd});return ue.createElement(Gn,OP({className:"recharts-bar-rectangle"},FE(i.props,f,d),{key:"rectangle-".concat(f==null?void 0:f.x,"-").concat(f==null?void 0:f.y,"-").concat(f==null?void 0:f.value)}),ue.createElement(_K,m))})}},{key:"renderRectanglesWithAnimation",value:function(){var r=this,i=this.props,o=i.data,a=i.layout,s=i.isAnimationActive,l=i.animationBegin,c=i.animationDuration,u=i.animationEasing,f=i.animationId,d=this.state.prevData;return ue.createElement(rc,{begin:l,duration:c,isActive:s,easing:u,from:{t:0},to:{t:1},key:"bar-".concat(f),onAnimationEnd:this.handleAnimationEnd,onAnimationStart:this.handleAnimationStart},function(h){var p=h.t,m=o.map(function(g,v){var y=d&&d[v];if(y){var x=Ei(y.x,g.x),b=Ei(y.y,g.y),_=Ei(y.width,g.width),S=Ei(y.height,g.height);return ai(ai({},g),{},{x:x(p),y:b(p),width:_(p),height:S(p)})}if(a==="horizontal"){var O=Ei(0,g.height),C=O(p);return ai(ai({},g),{},{y:g.y+g.height-C,height:C})}var E=Ei(0,g.width),k=E(p);return ai(ai({},g),{},{width:k})});return ue.createElement(Gn,null,r.renderRectanglesStatically(m))})}},{key:"renderRectangles",value:function(){var r=this.props,i=r.data,o=r.isAnimationActive,a=this.state.prevData;return o&&i&&i.length&&(!a||!Tv(a,i))?this.renderRectanglesWithAnimation():this.renderRectanglesStatically(i)}},{key:"renderBackground",value:function(){var r=this,i=this.props,o=i.data,a=i.dataKey,s=i.activeIndex,l=jt(this.props.background,!1);return o.map(function(c,u){c.value;var f=c.background,d=hIt(c,dIt);if(!f)return null;var h=ai(ai(ai(ai(ai({},d),{},{fill:"#eee"},f),l),FE(r.props,c,u)),{},{onAnimationStart:r.handleAnimationStart,onAnimationEnd:r.handleAnimationEnd,dataKey:a,index:u,key:"background-bar-".concat(u),className:"recharts-bar-background-rectangle"});return ue.createElement(_K,OP({option:r.props.background,isActive:u===s},h))})}},{key:"renderErrorBar",value:function(r,i){if(this.props.isAnimationActive&&!this.state.isAnimationFinished)return null;var o=this.props,a=o.data,s=o.xAxis,l=o.yAxis,c=o.layout,u=o.children,f=os(u,Hy);if(!f)return null;var d=c==="vertical"?a[0].height/2:a[0].width/2,h=function(g,v){var y=Array.isArray(g.value)?g.value[1]:g.value;return{x:g.x,y:g.y,value:y,errorVal:ho(g,v)}},p={clipPath:r?"url(#clipPath-".concat(i,")"):null};return ue.createElement(Gn,p,f.map(function(m){return ue.cloneElement(m,{key:"error-bar-".concat(i,"-").concat(m.props.dataKey),data:a,xAxis:s,yAxis:l,layout:c,offset:d,dataPointFormatter:h})}))}},{key:"render",value:function(){var r=this.props,i=r.hide,o=r.data,a=r.className,s=r.xAxis,l=r.yAxis,c=r.left,u=r.top,f=r.width,d=r.height,h=r.isAnimationActive,p=r.background,m=r.id;if(i||!o||!o.length)return null;var g=this.state.isAnimationFinished,v=ke("recharts-bar",a),y=s&&s.allowDataOverflow,x=l&&l.allowDataOverflow,b=y||x,_=Wt(m)?this.id:m;return ue.createElement(Gn,{className:v},y||x?ue.createElement("defs",null,ue.createElement("clipPath",{id:"clipPath-".concat(_)},ue.createElement("rect",{x:y?c:c-f/2,y:x?u:u-d/2,width:y?f:f*2,height:x?d:d*2}))):null,ue.createElement(Gn,{className:"recharts-bar-rectangles",clipPath:b?"url(#clipPath-".concat(_,")"):null},p?this.renderBackground():null,this.renderRectangles()),this.renderErrorBar(b,_),(!h||g)&&ou.renderCallByParent(this.props,o))}}],[{key:"getDerivedStateFromProps",value:function(r,i){return r.animationId!==i.prevAnimationId?{prevAnimationId:r.animationId,curData:r.data,prevData:i.curData}:r.data!==i.curData?{curData:r.data}:null}}]),e}(M.PureComponent);xve=Up;Pf(Up,"displayName","Bar");Pf(Up,"defaultProps",{xAxisId:0,yAxisId:0,legendType:"rect",minPointSize:0,hide:!1,data:[],layout:"vertical",activeBar:!1,isAnimationActive:!Yl.isSsr,animationBegin:0,animationDuration:400,animationEasing:"ease"});Pf(Up,"getComposedData",function(t){var e=t.props,n=t.item,r=t.barPosition,i=t.bandSize,o=t.xAxis,a=t.yAxis,s=t.xAxisTicks,l=t.yAxisTicks,c=t.stackedData,u=t.dataStartIndex,f=t.displayedData,d=t.offset,h=hMt(r,n);if(!h)return null;var p=e.layout,m=n.props,g=m.dataKey,v=m.children,y=m.minPointSize,x=p==="horizontal"?a:o,b=c?x.scale.domain():null,_=_Mt({numericAxis:x}),S=os(v,Zme),O=f.map(function(C,E){var k,I,P,R,T,L;c?k=pMt(c[u+E],b):(k=ho(C,g),Array.isArray(k)||(k=[_,k]));var z=fIt(y,xve.defaultProps.minPointSize)(k[1],E);if(p==="horizontal"){var B,U=[a.scale(k[0]),a.scale(k[1])],W=U[0],$=U[1];I=wY({axis:o,ticks:s,bandSize:i,offset:h.offset,entry:C,index:E}),P=(B=$??W)!==null&&B!==void 0?B:void 0,R=h.size;var N=W-$;if(T=Number.isNaN(N)?0:N,L={x:I,y:a.y,width:R,height:a.height},Math.abs(z)>0&&Math.abs(T)<Math.abs(z)){var D=qs(T||z)*(Math.abs(z)-Math.abs(T));P-=D,T+=D}}else{var A=[o.scale(k[0]),o.scale(k[1])],q=A[0],Y=A[1];if(I=q,P=wY({axis:a,ticks:l,bandSize:i,offset:h.offset,entry:C,index:E}),R=Y-q,T=h.size,L={x:o.x,y:P,width:o.width,height:T},Math.abs(z)>0&&Math.abs(R)<Math.abs(z)){var K=qs(R||z)*(Math.abs(z)-Math.abs(R));R+=K}}return ai(ai(ai({},C),{},{x:I,y:P,width:R,height:T,value:c?k:k[1],payload:C,background:L},S&&S[E]&&S[E].props),{},{tooltipPayload:[tve(n,C)],tooltipPosition:{x:I+R/2,y:P+T/2}})});return ai({data:O,layout:p},d)});function Z_(t){"@babel/helpers - typeof";return Z_=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(e){return typeof e}:function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},Z_(t)}function _It(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function OK(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,wve(r.key),r)}}function wIt(t,e,n){return e&&OK(t.prototype,e),n&&OK(t,n),Object.defineProperty(t,"prototype",{writable:!1}),t}function CK(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(t,i).enumerable})),n.push.apply(n,r)}return n}function Bs(t){for(var e=1;e<arguments.length;e++){var n=arguments[e]!=null?arguments[e]:{};e%2?CK(Object(n),!0).forEach(function(r){Ak(t,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):CK(Object(n)).forEach(function(r){Object.defineProperty(t,r,Object.getOwnPropertyDescriptor(n,r))})}return t}function Ak(t,e,n){return e=wve(e),e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function wve(t){var e=SIt(t,"string");return Z_(e)=="symbol"?e:String(e)}function SIt(t,e){if(Z_(t)!="object"||!t)return t;var n=t[Symbol.toPrimitive];if(n!==void 0){var r=n.call(t,e||"default");if(Z_(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}var e6=function(e,n,r,i,o){var a=e.width,s=e.height,l=e.layout,c=e.children,u=Object.keys(n),f={left:r.left,leftMirror:r.left,right:a-r.right,rightMirror:a-r.right,top:r.top,topMirror:r.top,bottom:s-r.bottom,bottomMirror:s-r.bottom},d=!!ca(c,Up);return u.reduce(function(h,p){var m=n[p],g=m.orientation,v=m.domain,y=m.padding,x=y===void 0?{}:y,b=m.mirror,_=m.reversed,S="".concat(g).concat(b?"Mirror":""),O,C,E,k,I;if(m.type==="number"&&(m.padding==="gap"||m.padding==="no-gap")){var P=v[1]-v[0],R=1/0,T=m.categoricalDomain.sort();if(T.forEach(function(q,Y){Y>0&&(R=Math.min((q||0)-(T[Y-1]||0),R))}),Number.isFinite(R)){var L=R/P,z=m.layout==="vertical"?r.height:r.width;if(m.padding==="gap"&&(O=L*z/2),m.padding==="no-gap"){var B=hp(e.barCategoryGap,L*z),U=L*z/2;O=U-B-(U-B)/z*B}}}i==="xAxis"?C=[r.left+(x.left||0)+(O||0),r.left+r.width-(x.right||0)-(O||0)]:i==="yAxis"?C=l==="horizontal"?[r.top+r.height-(x.bottom||0),r.top+(x.top||0)]:[r.top+(x.top||0)+(O||0),r.top+r.height-(x.bottom||0)-(O||0)]:C=m.range,_&&(C=[C[1],C[0]]);var W=fMt(m,o,d),$=W.scale,N=W.realScaleType;$.domain(v).range(C),dMt($);var D=bMt($,Bs(Bs({},m),{},{realScaleType:N}));i==="xAxis"?(I=g==="top"&&!b||g==="bottom"&&b,E=r.left,k=f[S]-I*m.height):i==="yAxis"&&(I=g==="left"&&!b||g==="right"&&b,E=f[S]-I*m.width,k=r.top);var A=Bs(Bs(Bs({},m),D),{},{realScaleType:N,x:E,y:k,scale:$,width:i==="xAxis"?r.width:m.width,height:i==="yAxis"?r.height:m.height});return A.bandSize=dP(A,D),!m.hide&&i==="xAxis"?f[S]+=(I?-1:1)*A.height:m.hide||(f[S]+=(I?-1:1)*A.width),Bs(Bs({},h),{},Ak({},p,A))},{})},Sve=function(e,n){var r=e.x,i=e.y,o=n.x,a=n.y;return{x:Math.min(r,o),y:Math.min(i,a),width:Math.abs(o-r),height:Math.abs(a-i)}},OIt=function(e){var n=e.x1,r=e.y1,i=e.x2,o=e.y2;return Sve({x:n,y:r},{x:i,y:o})},Ove=function(){function t(e){_It(this,t),this.scale=e}return wIt(t,[{key:"domain",get:function(){return this.scale.domain}},{key:"range",get:function(){return this.scale.range}},{key:"rangeMin",get:function(){return this.range()[0]}},{key:"rangeMax",get:function(){return this.range()[1]}},{key:"bandwidth",get:function(){return this.scale.bandwidth}},{key:"apply",value:function(n){var r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},i=r.bandAware,o=r.position;if(n!==void 0){if(o)switch(o){case"start":return this.scale(n);case"middle":{var a=this.bandwidth?this.bandwidth()/2:0;return this.scale(n)+a}case"end":{var s=this.bandwidth?this.bandwidth():0;return this.scale(n)+s}default:return this.scale(n)}if(i){var l=this.bandwidth?this.bandwidth()/2:0;return this.scale(n)+l}return this.scale(n)}}},{key:"isInRange",value:function(n){var r=this.range(),i=r[0],o=r[r.length-1];return i<=o?n>=i&&n<=o:n>=o&&n<=i}}],[{key:"create",value:function(n){return new t(n)}}]),t}();Ak(Ove,"EPS",1e-4);var t6=function(e){var n=Object.keys(e).reduce(function(r,i){return Bs(Bs({},r),{},Ak({},i,Ove.create(e[i])))},{});return Bs(Bs({},n),{},{apply:function(i){var o=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},a=o.bandAware,s=o.position;return GRt(i,function(l,c){return n[c].apply(l,{bandAware:a,position:s})})},isInRange:function(i){return yve(i,function(o,a){return n[a].isInRange(o)})}})};function CIt(t){return(t%180+180)%180}var TIt=function(e){var n=e.width,r=e.height,i=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0,o=CIt(i),a=o*Math.PI/180,s=Math.atan(r/n),l=a>s&&a<Math.PI-s?r/Math.sin(a):n/Math.cos(a);return Math.abs(l)},EIt=kd,PIt=Ew,MIt=gk;function kIt(t){return function(e,n,r){var i=Object(e);if(!PIt(e)){var o=EIt(n);e=MIt(e),n=function(s){return o(i[s],s,i)}}var a=t(e,n,r);return a>-1?i[o?e[a]:a]:void 0}}var AIt=kIt,RIt=pve;function IIt(t){var e=RIt(t),n=e%1;return e===e?n?e-n:e:0}var DIt=IIt,LIt=Lme,NIt=kd,$It=DIt,FIt=Math.max;function jIt(t,e,n){var r=t==null?0:t.length;if(!r)return-1;var i=n==null?0:$It(n);return i<0&&(i=FIt(r+i,0)),LIt(t,NIt(e),i)}var BIt=jIt,zIt=AIt,UIt=BIt,WIt=zIt(UIt),VIt=WIt;const GIt=$t(VIt);var HIt=umt(function(t){return{x:t.left,y:t.top,width:t.width,height:t.height}},function(t){return["l",t.left,"t",t.top,"w",t.width,"h",t.height].join("")}),n6=M.createContext(void 0),r6=M.createContext(void 0),Cve=M.createContext(void 0),Tve=M.createContext({}),Eve=M.createContext(void 0),Pve=M.createContext(0),Mve=M.createContext(0),TK=function(e){var n=e.state,r=n.xAxisMap,i=n.yAxisMap,o=n.offset,a=e.clipPathId,s=e.children,l=e.width,c=e.height,u=HIt(o);return ue.createElement(n6.Provider,{value:r},ue.createElement(r6.Provider,{value:i},ue.createElement(Tve.Provider,{value:o},ue.createElement(Cve.Provider,{value:u},ue.createElement(Eve.Provider,{value:a},ue.createElement(Pve.Provider,{value:c},ue.createElement(Mve.Provider,{value:l},s)))))))},qIt=function(){return M.useContext(Eve)},kve=function(e){var n=M.useContext(n6);n==null&&mp();var r=n[e];return r==null&&mp(),r},XIt=function(){var e=M.useContext(n6);return gf(e)},QIt=function(){var e=M.useContext(r6),n=GIt(e,function(r){return yve(r.domain,Number.isFinite)});return n||gf(e)},Ave=function(e){var n=M.useContext(r6);n==null&&mp();var r=n[e];return r==null&&mp(),r},YIt=function(){var e=M.useContext(Cve);return e},KIt=function(){return M.useContext(Tve)},i6=function(){return M.useContext(Mve)},o6=function(){return M.useContext(Pve)};function J_(t){"@babel/helpers - typeof";return J_=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(e){return typeof e}:function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},J_(t)}function EK(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(t,i).enumerable})),n.push.apply(n,r)}return n}function PK(t){for(var e=1;e<arguments.length;e++){var n=arguments[e]!=null?arguments[e]:{};e%2?EK(Object(n),!0).forEach(function(r){ZIt(t,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):EK(Object(n)).forEach(function(r){Object.defineProperty(t,r,Object.getOwnPropertyDescriptor(n,r))})}return t}function ZIt(t,e,n){return e=JIt(e),e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function JIt(t){var e=eDt(t,"string");return J_(e)=="symbol"?e:String(e)}function eDt(t,e){if(J_(t)!="object"||!t)return t;var n=t[Symbol.toPrimitive];if(n!==void 0){var r=n.call(t,e||"default");if(J_(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}function tDt(t,e){return oDt(t)||iDt(t,e)||rDt(t,e)||nDt()}function nDt(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function rDt(t,e){if(t){if(typeof t=="string")return MK(t,e);var n=Object.prototype.toString.call(t).slice(8,-1);if(n==="Object"&&t.constructor&&(n=t.constructor.name),n==="Map"||n==="Set")return Array.from(t);if(n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return MK(t,e)}}function MK(t,e){(e==null||e>t.length)&&(e=t.length);for(var n=0,r=new Array(e);n<e;n++)r[n]=t[n];return r}function iDt(t,e){var n=t==null?null:typeof Symbol<"u"&&t[Symbol.iterator]||t["@@iterator"];if(n!=null){var r,i,o,a,s=[],l=!0,c=!1;try{if(o=(n=n.call(t)).next,e!==0)for(;!(l=(r=o.call(n)).done)&&(s.push(r.value),s.length!==e);l=!0);}catch(u){c=!0,i=u}finally{try{if(!l&&n.return!=null&&(a=n.return(),Object(a)!==a))return}finally{if(c)throw i}}return s}}function oDt(t){if(Array.isArray(t))return t}function sF(){return sF=Object.assign?Object.assign.bind():function(t){for(var e=1;e<arguments.length;e++){var n=arguments[e];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(t[r]=n[r])}return t},sF.apply(this,arguments)}var aDt=function(e,n){var r;return ue.isValidElement(e)?r=ue.cloneElement(e,n):Bt(e)?r=e(n):r=ue.createElement("line",sF({},n,{className:"recharts-reference-line-line"})),r},sDt=function(e,n,r,i,o,a,s,l,c){var u=o.x,f=o.y,d=o.width,h=o.height;if(r){var p=c.y,m=e.y.apply(p,{position:a});if(Zl(c,"discard")&&!e.y.isInRange(m))return null;var g=[{x:u+d,y:m},{x:u,y:m}];return l==="left"?g.reverse():g}if(n){var v=c.x,y=e.x.apply(v,{position:a});if(Zl(c,"discard")&&!e.x.isInRange(y))return null;var x=[{x:y,y:f+h},{x:y,y:f}];return s==="top"?x.reverse():x}if(i){var b=c.segment,_=b.map(function(S){return e.apply(S,{position:a})});return Zl(c,"discard")&&$Rt(_,function(S){return!e.isInRange(S)})?null:_}return null};function Rw(t){var e=t.x,n=t.y,r=t.segment,i=t.xAxisId,o=t.yAxisId,a=t.shape,s=t.className,l=t.alwaysShow,c=qIt(),u=kve(i),f=Ave(o),d=YIt();if(!c||!d)return null;ru(l===void 0,'The alwaysShow prop is deprecated. Please use ifOverflow="extendDomain" instead.');var h=t6({x:u.scale,y:f.scale}),p=ti(e),m=ti(n),g=r&&r.length===2,v=sDt(h,p,m,g,d,t.position,u.orientation,f.orientation,t);if(!v)return null;var y=tDt(v,2),x=y[0],b=x.x,_=x.y,S=y[1],O=S.x,C=S.y,E=Zl(t,"hidden")?"url(#".concat(c,")"):void 0,k=PK(PK({clipPath:E},jt(t,!0)),{},{x1:b,y1:_,x2:O,y2:C});return ue.createElement(Gn,{className:ke("recharts-reference-line",s)},aDt(a,k),Xi.renderCallByParent(t,OIt({x1:b,y1:_,x2:O,y2:C})))}Rw.displayName="ReferenceLine";Rw.defaultProps={isFront:!1,ifOverflow:"discard",xAxisId:0,yAxisId:0,fill:"none",stroke:"#ccc",fillOpacity:1,strokeWidth:1,position:"middle"};function e1(t){"@babel/helpers - typeof";return e1=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(e){return typeof e}:function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},e1(t)}function lF(){return lF=Object.assign?Object.assign.bind():function(t){for(var e=1;e<arguments.length;e++){var n=arguments[e];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(t[r]=n[r])}return t},lF.apply(this,arguments)}function kK(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(t,i).enumerable})),n.push.apply(n,r)}return n}function AK(t){for(var e=1;e<arguments.length;e++){var n=arguments[e]!=null?arguments[e]:{};e%2?kK(Object(n),!0).forEach(function(r){lDt(t,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):kK(Object(n)).forEach(function(r){Object.defineProperty(t,r,Object.getOwnPropertyDescriptor(n,r))})}return t}function lDt(t,e,n){return e=cDt(e),e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function cDt(t){var e=uDt(t,"string");return e1(e)=="symbol"?e:String(e)}function uDt(t,e){if(e1(t)!="object"||!t)return t;var n=t[Symbol.toPrimitive];if(n!==void 0){var r=n.call(t,e||"default");if(e1(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}var fDt=function(e){var n=e.x,r=e.y,i=e.xAxis,o=e.yAxis,a=t6({x:i.scale,y:o.scale}),s=a.apply({x:n,y:r},{bandAware:!0});return Zl(e,"discard")&&!a.isInRange(s)?null:s};function Iw(t){var e=t.x,n=t.y,r=t.r,i=t.alwaysShow,o=t.clipPathId,a=ti(e),s=ti(n);if(ru(i===void 0,'The alwaysShow prop is deprecated. Please use ifOverflow="extendDomain" instead.'),!a||!s)return null;var l=fDt(t);if(!l)return null;var c=l.x,u=l.y,f=t.shape,d=t.className,h=Zl(t,"hidden")?"url(#".concat(o,")"):void 0,p=AK(AK({clipPath:h},jt(t,!0)),{},{cx:c,cy:u});return ue.createElement(Gn,{className:ke("recharts-reference-dot",d)},Iw.renderDot(f,p),Xi.renderCallByParent(t,{x:c-r,y:u-r,width:2*r,height:2*r}))}Iw.displayName="ReferenceDot";Iw.defaultProps={isFront:!1,ifOverflow:"discard",xAxisId:0,yAxisId:0,r:10,fill:"#fff",stroke:"#ccc",fillOpacity:1,strokeWidth:1};Iw.renderDot=function(t,e){var n;return ue.isValidElement(t)?n=ue.cloneElement(t,e):Bt(t)?n=t(e):n=ue.createElement(Pk,lF({},e,{cx:e.cx,cy:e.cy,className:"recharts-reference-dot-dot"})),n};function t1(t){"@babel/helpers - typeof";return t1=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(e){return typeof e}:function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},t1(t)}function cF(){return cF=Object.assign?Object.assign.bind():function(t){for(var e=1;e<arguments.length;e++){var n=arguments[e];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(t[r]=n[r])}return t},cF.apply(this,arguments)}function RK(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(t,i).enumerable})),n.push.apply(n,r)}return n}function IK(t){for(var e=1;e<arguments.length;e++){var n=arguments[e]!=null?arguments[e]:{};e%2?RK(Object(n),!0).forEach(function(r){dDt(t,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):RK(Object(n)).forEach(function(r){Object.defineProperty(t,r,Object.getOwnPropertyDescriptor(n,r))})}return t}function dDt(t,e,n){return e=hDt(e),e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function hDt(t){var e=pDt(t,"string");return t1(e)=="symbol"?e:String(e)}function pDt(t,e){if(t1(t)!="object"||!t)return t;var n=t[Symbol.toPrimitive];if(n!==void 0){var r=n.call(t,e||"default");if(t1(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}var mDt=function(e,n,r,i,o){var a=o.x1,s=o.x2,l=o.y1,c=o.y2,u=o.xAxis,f=o.yAxis;if(!u||!f)return null;var d=t6({x:u.scale,y:f.scale}),h={x:e?d.x.apply(a,{position:"start"}):d.x.rangeMin,y:r?d.y.apply(l,{position:"start"}):d.y.rangeMin},p={x:n?d.x.apply(s,{position:"end"}):d.x.rangeMax,y:i?d.y.apply(c,{position:"end"}):d.y.rangeMax};return Zl(o,"discard")&&(!d.isInRange(h)||!d.isInRange(p))?null:Sve(h,p)};function Wp(t){var e=t.x1,n=t.x2,r=t.y1,i=t.y2,o=t.className,a=t.alwaysShow,s=t.clipPathId;ru(a===void 0,'The alwaysShow prop is deprecated. Please use ifOverflow="extendDomain" instead.');var l=ti(e),c=ti(n),u=ti(r),f=ti(i),d=t.shape;if(!l&&!c&&!u&&!f&&!d)return null;var h=mDt(l,c,u,f,t);if(!h&&!d)return null;var p=Zl(t,"hidden")?"url(#".concat(s,")"):void 0;return ue.createElement(Gn,{className:ke("recharts-reference-area",o)},Wp.renderRect(d,IK(IK({clipPath:p},jt(t,!0)),h)),Xi.renderCallByParent(t,h))}Wp.displayName="ReferenceArea";Wp.defaultProps={isFront:!1,ifOverflow:"discard",xAxisId:0,yAxisId:0,r:10,fill:"#ccc",fillOpacity:.5,stroke:"none",strokeWidth:1};Wp.renderRect=function(t,e){var n;return ue.isValidElement(t)?n=ue.cloneElement(t,e):Bt(t)?n=t(e):n=ue.createElement(JU,cF({},e,{className:"recharts-reference-area-rect"})),n};function Rve(t,e,n){if(e<1)return[];if(e===1&&n===void 0)return t;for(var r=[],i=0;i<t.length;i+=e)r.push(t[i]);return r}function gDt(t,e,n){var r={width:t.width+e.width,height:t.height+e.height};return TIt(r,n)}function vDt(t,e,n){var r=n==="width",i=t.x,o=t.y,a=t.width,s=t.height;return e===1?{start:r?i:o,end:r?i+a:o+s}:{start:r?i+a:o+s,end:r?i:o}}function TP(t,e,n,r,i){if(t*e<t*r||t*e>t*i)return!1;var o=n();return t*(e-t*o/2-r)>=0&&t*(e+t*o/2-i)<=0}function yDt(t,e){return Rve(t,e+1)}function xDt(t,e,n,r,i){for(var o=(r||[]).slice(),a=e.start,s=e.end,l=0,c=1,u=a,f=function(){var p=r==null?void 0:r[l];if(p===void 0)return{v:Rve(r,c)};var m=l,g,v=function(){return g===void 0&&(g=n(p,m)),g},y=p.coordinate,x=l===0||TP(t,y,v,u,s);x||(l=0,u=a,c+=1),x&&(u=y+t*(v()/2+i),l+=c)},d;c<=o.length;)if(d=f(),d)return d.v;return[]}function n1(t){"@babel/helpers - typeof";return n1=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(e){return typeof e}:function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},n1(t)}function DK(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(t,i).enumerable})),n.push.apply(n,r)}return n}function Vi(t){for(var e=1;e<arguments.length;e++){var n=arguments[e]!=null?arguments[e]:{};e%2?DK(Object(n),!0).forEach(function(r){bDt(t,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):DK(Object(n)).forEach(function(r){Object.defineProperty(t,r,Object.getOwnPropertyDescriptor(n,r))})}return t}function bDt(t,e,n){return e=_Dt(e),e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function _Dt(t){var e=wDt(t,"string");return n1(e)=="symbol"?e:String(e)}function wDt(t,e){if(n1(t)!="object"||!t)return t;var n=t[Symbol.toPrimitive];if(n!==void 0){var r=n.call(t,e||"default");if(n1(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}function SDt(t,e,n,r,i){for(var o=(r||[]).slice(),a=o.length,s=e.start,l=e.end,c=function(d){var h=o[d],p,m=function(){return p===void 0&&(p=n(h,d)),p};if(d===a-1){var g=t*(h.coordinate+t*m()/2-l);o[d]=h=Vi(Vi({},h),{},{tickCoord:g>0?h.coordinate-g*t:h.coordinate})}else o[d]=h=Vi(Vi({},h),{},{tickCoord:h.coordinate});var v=TP(t,h.tickCoord,m,s,l);v&&(l=h.tickCoord-t*(m()/2+i),o[d]=Vi(Vi({},h),{},{isShow:!0}))},u=a-1;u>=0;u--)c(u);return o}function ODt(t,e,n,r,i,o){var a=(r||[]).slice(),s=a.length,l=e.start,c=e.end;if(o){var u=r[s-1],f=n(u,s-1),d=t*(u.coordinate+t*f/2-c);a[s-1]=u=Vi(Vi({},u),{},{tickCoord:d>0?u.coordinate-d*t:u.coordinate});var h=TP(t,u.tickCoord,function(){return f},l,c);h&&(c=u.tickCoord-t*(f/2+i),a[s-1]=Vi(Vi({},u),{},{isShow:!0}))}for(var p=o?s-1:s,m=function(y){var x=a[y],b,_=function(){return b===void 0&&(b=n(x,y)),b};if(y===0){var S=t*(x.coordinate-t*_()/2-l);a[y]=x=Vi(Vi({},x),{},{tickCoord:S<0?x.coordinate-S*t:x.coordinate})}else a[y]=x=Vi(Vi({},x),{},{tickCoord:x.coordinate});var O=TP(t,x.tickCoord,_,l,c);O&&(l=x.tickCoord+t*(_()/2+i),a[y]=Vi(Vi({},x),{},{isShow:!0}))},g=0;g<p;g++)m(g);return a}function a6(t,e,n){var r=t.tick,i=t.ticks,o=t.viewBox,a=t.minTickGap,s=t.orientation,l=t.interval,c=t.tickFormatter,u=t.unit,f=t.angle;if(!i||!i.length||!r)return[];if(Ye(l)||Yl.isSsr)return yDt(i,typeof l=="number"&&Ye(l)?l:0);var d=[],h=s==="top"||s==="bottom"?"width":"height",p=u&&h==="width"?ob(u,{fontSize:e,letterSpacing:n}):{width:0,height:0},m=function(x,b){var _=Bt(c)?c(x.value,b):x.value;return h==="width"?gDt(ob(_,{fontSize:e,letterSpacing:n}),p,f):ob(_,{fontSize:e,letterSpacing:n})[h]},g=i.length>=2?qs(i[1].coordinate-i[0].coordinate):1,v=vDt(o,g,h);return l==="equidistantPreserveStart"?xDt(g,v,m,i,a):(l==="preserveStart"||l==="preserveStartEnd"?d=ODt(g,v,m,i,a,l==="preserveStartEnd"):d=SDt(g,v,m,i,a),d.filter(function(y){return y.isShow}))}var CDt=["viewBox"],TDt=["viewBox"],EDt=["ticks"];function kv(t){"@babel/helpers - typeof";return kv=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(e){return typeof e}:function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},kv(t)}function lg(){return lg=Object.assign?Object.assign.bind():function(t){for(var e=1;e<arguments.length;e++){var n=arguments[e];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(t[r]=n[r])}return t},lg.apply(this,arguments)}function LK(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(t,i).enumerable})),n.push.apply(n,r)}return n}function ro(t){for(var e=1;e<arguments.length;e++){var n=arguments[e]!=null?arguments[e]:{};e%2?LK(Object(n),!0).forEach(function(r){s6(t,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):LK(Object(n)).forEach(function(r){Object.defineProperty(t,r,Object.getOwnPropertyDescriptor(n,r))})}return t}function $I(t,e){if(t==null)return{};var n=PDt(t,e),r,i;if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(t);for(i=0;i<o.length;i++)r=o[i],!(e.indexOf(r)>=0)&&Object.prototype.propertyIsEnumerable.call(t,r)&&(n[r]=t[r])}return n}function PDt(t,e){if(t==null)return{};var n={},r=Object.keys(t),i,o;for(o=0;o<r.length;o++)i=r[o],!(e.indexOf(i)>=0)&&(n[i]=t[i]);return n}function MDt(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function NK(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,Dve(r.key),r)}}function kDt(t,e,n){return e&&NK(t.prototype,e),n&&NK(t,n),Object.defineProperty(t,"prototype",{writable:!1}),t}function ADt(t,e,n){return e=EP(e),RDt(t,Ive()?Reflect.construct(e,n||[],EP(t).constructor):e.apply(t,n))}function RDt(t,e){if(e&&(kv(e)==="object"||typeof e=="function"))return e;if(e!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return IDt(t)}function IDt(t){if(t===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}function Ive(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch{}return(Ive=function(){return!!t})()}function EP(t){return EP=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(n){return n.__proto__||Object.getPrototypeOf(n)},EP(t)}function DDt(t,e){if(typeof e!="function"&&e!==null)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&uF(t,e)}function uF(t,e){return uF=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(r,i){return r.__proto__=i,r},uF(t,e)}function s6(t,e,n){return e=Dve(e),e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function Dve(t){var e=LDt(t,"string");return kv(e)=="symbol"?e:String(e)}function LDt(t,e){if(kv(t)!="object"||!t)return t;var n=t[Symbol.toPrimitive];if(n!==void 0){var r=n.call(t,e||"default");if(kv(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}var Xy=function(t){DDt(e,t);function e(n){var r;return MDt(this,e),r=ADt(this,e,[n]),r.state={fontSize:"",letterSpacing:""},r}return kDt(e,[{key:"shouldComponentUpdate",value:function(r,i){var o=r.viewBox,a=$I(r,CDt),s=this.props,l=s.viewBox,c=$I(s,TDt);return!Ng(o,l)||!Ng(a,c)||!Ng(i,this.state)}},{key:"componentDidMount",value:function(){var r=this.layerReference;if(r){var i=r.getElementsByClassName("recharts-cartesian-axis-tick-value")[0];i&&this.setState({fontSize:window.getComputedStyle(i).fontSize,letterSpacing:window.getComputedStyle(i).letterSpacing})}}},{key:"getTickLineCoord",value:function(r){var i=this.props,o=i.x,a=i.y,s=i.width,l=i.height,c=i.orientation,u=i.tickSize,f=i.mirror,d=i.tickMargin,h,p,m,g,v,y,x=f?-1:1,b=r.tickSize||u,_=Ye(r.tickCoord)?r.tickCoord:r.coordinate;switch(c){case"top":h=p=r.coordinate,g=a+ +!f*l,m=g-x*b,y=m-x*d,v=_;break;case"left":m=g=r.coordinate,p=o+ +!f*s,h=p-x*b,v=h-x*d,y=_;break;case"right":m=g=r.coordinate,p=o+ +f*s,h=p+x*b,v=h+x*d,y=_;break;default:h=p=r.coordinate,g=a+ +f*l,m=g+x*b,y=m+x*d,v=_;break}return{line:{x1:h,y1:m,x2:p,y2:g},tick:{x:v,y}}}},{key:"getTickTextAnchor",value:function(){var r=this.props,i=r.orientation,o=r.mirror,a;switch(i){case"left":a=o?"start":"end";break;case"right":a=o?"end":"start";break;default:a="middle";break}return a}},{key:"getTickVerticalAnchor",value:function(){var r=this.props,i=r.orientation,o=r.mirror,a="end";switch(i){case"left":case"right":a="middle";break;case"top":a=o?"start":"end";break;default:a=o?"end":"start";break}return a}},{key:"renderAxisLine",value:function(){var r=this.props,i=r.x,o=r.y,a=r.width,s=r.height,l=r.orientation,c=r.mirror,u=r.axisLine,f=ro(ro(ro({},jt(this.props,!1)),jt(u,!1)),{},{fill:"none"});if(l==="top"||l==="bottom"){var d=+(l==="top"&&!c||l==="bottom"&&c);f=ro(ro({},f),{},{x1:i,y1:o+d*s,x2:i+a,y2:o+d*s})}else{var h=+(l==="left"&&!c||l==="right"&&c);f=ro(ro({},f),{},{x1:i+h*a,y1:o,x2:i+h*a,y2:o+s})}return ue.createElement("line",lg({},f,{className:ke("recharts-cartesian-axis-line",is(u,"className"))}))}},{key:"renderTicks",value:function(r,i,o){var a=this,s=this.props,l=s.tickLine,c=s.stroke,u=s.tick,f=s.tickFormatter,d=s.unit,h=a6(ro(ro({},this.props),{},{ticks:r}),i,o),p=this.getTickTextAnchor(),m=this.getTickVerticalAnchor(),g=jt(this.props,!1),v=jt(u,!1),y=ro(ro({},g),{},{fill:"none"},jt(l,!1)),x=h.map(function(b,_){var S=a.getTickLineCoord(b),O=S.line,C=S.tick,E=ro(ro(ro(ro({textAnchor:p,verticalAnchor:m},g),{},{stroke:"none",fill:c},v),C),{},{index:_,payload:b,visibleTicksCount:h.length,tickFormatter:f});return ue.createElement(Gn,lg({className:"recharts-cartesian-axis-tick",key:"tick-".concat(b.value,"-").concat(b.coordinate,"-").concat(b.tickCoord)},FE(a.props,b,_)),l&&ue.createElement("line",lg({},y,O,{className:ke("recharts-cartesian-axis-tick-line",is(l,"className"))})),u&&e.renderTickItem(u,E,"".concat(Bt(f)?f(b.value,_):b.value).concat(d||"")))});return ue.createElement("g",{className:"recharts-cartesian-axis-ticks"},x)}},{key:"render",value:function(){var r=this,i=this.props,o=i.axisLine,a=i.width,s=i.height,l=i.ticksGenerator,c=i.className,u=i.hide;if(u)return null;var f=this.props,d=f.ticks,h=$I(f,EDt),p=d;return Bt(l)&&(p=d&&d.length>0?l(this.props):l(h)),a<=0||s<=0||!p||!p.length?null:ue.createElement(Gn,{className:ke("recharts-cartesian-axis",c),ref:function(g){r.layerReference=g}},o&&this.renderAxisLine(),this.renderTicks(p,this.state.fontSize,this.state.letterSpacing),Xi.renderCallByParent(this.props))}}],[{key:"renderTickItem",value:function(r,i,o){var a;return ue.isValidElement(r)?a=ue.cloneElement(r,i):Bt(r)?a=r(i):a=ue.createElement(ZE,lg({},i,{className:"recharts-cartesian-axis-tick-value"}),o),a}}]),e}(M.Component);s6(Xy,"displayName","CartesianAxis");s6(Xy,"defaultProps",{x:0,y:0,width:0,height:0,viewBox:{x:0,y:0,width:0,height:0},orientation:"bottom",ticks:[],stroke:"#666",tickLine:!0,axisLine:!0,tick:!0,mirror:!1,minTickGap:5,tickSize:6,tickMargin:2,interval:"preserveEnd"});var NDt=["x1","y1","x2","y2","key"],$Dt=["offset"];function vp(t){"@babel/helpers - typeof";return vp=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(e){return typeof e}:function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},vp(t)}function $K(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(t,i).enumerable})),n.push.apply(n,r)}return n}function Qi(t){for(var e=1;e<arguments.length;e++){var n=arguments[e]!=null?arguments[e]:{};e%2?$K(Object(n),!0).forEach(function(r){FDt(t,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):$K(Object(n)).forEach(function(r){Object.defineProperty(t,r,Object.getOwnPropertyDescriptor(n,r))})}return t}function FDt(t,e,n){return e=jDt(e),e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function jDt(t){var e=BDt(t,"string");return vp(e)=="symbol"?e:String(e)}function BDt(t,e){if(vp(t)!="object"||!t)return t;var n=t[Symbol.toPrimitive];if(n!==void 0){var r=n.call(t,e||"default");if(vp(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}function Ph(){return Ph=Object.assign?Object.assign.bind():function(t){for(var e=1;e<arguments.length;e++){var n=arguments[e];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(t[r]=n[r])}return t},Ph.apply(this,arguments)}function FK(t,e){if(t==null)return{};var n=zDt(t,e),r,i;if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(t);for(i=0;i<o.length;i++)r=o[i],!(e.indexOf(r)>=0)&&Object.prototype.propertyIsEnumerable.call(t,r)&&(n[r]=t[r])}return n}function zDt(t,e){if(t==null)return{};var n={},r=Object.keys(t),i,o;for(o=0;o<r.length;o++)i=r[o],!(e.indexOf(i)>=0)&&(n[i]=t[i]);return n}var UDt=function(e){var n=e.fill;if(!n||n==="none")return null;var r=e.fillOpacity,i=e.x,o=e.y,a=e.width,s=e.height;return ue.createElement("rect",{x:i,y:o,width:a,height:s,stroke:"none",fill:n,fillOpacity:r,className:"recharts-cartesian-grid-bg"})};function Lve(t,e){var n;if(ue.isValidElement(t))n=ue.cloneElement(t,e);else if(Bt(t))n=t(e);else{var r=e.x1,i=e.y1,o=e.x2,a=e.y2,s=e.key,l=FK(e,NDt),c=jt(l,!1);c.offset;var u=FK(c,$Dt);n=ue.createElement("line",Ph({},u,{x1:r,y1:i,x2:o,y2:a,fill:"none",key:s}))}return n}function WDt(t){var e=t.x,n=t.width,r=t.horizontal,i=r===void 0?!0:r,o=t.horizontalPoints;if(!i||!o||!o.length)return null;var a=o.map(function(s,l){var c=Qi(Qi({},t),{},{x1:e,y1:s,x2:e+n,y2:s,key:"line-".concat(l),index:l});return Lve(i,c)});return ue.createElement("g",{className:"recharts-cartesian-grid-horizontal"},a)}function VDt(t){var e=t.y,n=t.height,r=t.vertical,i=r===void 0?!0:r,o=t.verticalPoints;if(!i||!o||!o.length)return null;var a=o.map(function(s,l){var c=Qi(Qi({},t),{},{x1:s,y1:e,x2:s,y2:e+n,key:"line-".concat(l),index:l});return Lve(i,c)});return ue.createElement("g",{className:"recharts-cartesian-grid-vertical"},a)}function GDt(t){var e=t.horizontalFill,n=t.fillOpacity,r=t.x,i=t.y,o=t.width,a=t.height,s=t.horizontalPoints,l=t.horizontal,c=l===void 0?!0:l;if(!c||!e||!e.length)return null;var u=s.map(function(d){return Math.round(d+i-i)}).sort(function(d,h){return d-h});i!==u[0]&&u.unshift(0);var f=u.map(function(d,h){var p=!u[h+1],m=p?i+a-d:u[h+1]-d;if(m<=0)return null;var g=h%e.length;return ue.createElement("rect",{key:"react-".concat(h),y:d,x:r,height:m,width:o,stroke:"none",fill:e[g],fillOpacity:n,className:"recharts-cartesian-grid-bg"})});return ue.createElement("g",{className:"recharts-cartesian-gridstripes-horizontal"},f)}function HDt(t){var e=t.vertical,n=e===void 0?!0:e,r=t.verticalFill,i=t.fillOpacity,o=t.x,a=t.y,s=t.width,l=t.height,c=t.verticalPoints;if(!n||!r||!r.length)return null;var u=c.map(function(d){return Math.round(d+o-o)}).sort(function(d,h){return d-h});o!==u[0]&&u.unshift(0);var f=u.map(function(d,h){var p=!u[h+1],m=p?o+s-d:u[h+1]-d;if(m<=0)return null;var g=h%r.length;return ue.createElement("rect",{key:"react-".concat(h),x:d,y:a,width:m,height:l,stroke:"none",fill:r[g],fillOpacity:i,className:"recharts-cartesian-grid-bg"})});return ue.createElement("g",{className:"recharts-cartesian-gridstripes-vertical"},f)}var qDt=function(e,n){var r=e.xAxis,i=e.width,o=e.height,a=e.offset;return Jge(a6(Qi(Qi(Qi({},Xy.defaultProps),r),{},{ticks:Qc(r,!0),viewBox:{x:0,y:0,width:i,height:o}})),a.left,a.left+a.width,n)},XDt=function(e,n){var r=e.yAxis,i=e.width,o=e.height,a=e.offset;return Jge(a6(Qi(Qi(Qi({},Xy.defaultProps),r),{},{ticks:Qc(r,!0),viewBox:{x:0,y:0,width:i,height:o}})),a.top,a.top+a.height,n)},pm={horizontal:!0,vertical:!0,horizontalPoints:[],verticalPoints:[],stroke:"#ccc",fill:"none",verticalFill:[],horizontalFill:[]};function l6(t){var e,n,r,i,o,a,s=i6(),l=o6(),c=KIt(),u=Qi(Qi({},t),{},{stroke:(e=t.stroke)!==null&&e!==void 0?e:pm.stroke,fill:(n=t.fill)!==null&&n!==void 0?n:pm.fill,horizontal:(r=t.horizontal)!==null&&r!==void 0?r:pm.horizontal,horizontalFill:(i=t.horizontalFill)!==null&&i!==void 0?i:pm.horizontalFill,vertical:(o=t.vertical)!==null&&o!==void 0?o:pm.vertical,verticalFill:(a=t.verticalFill)!==null&&a!==void 0?a:pm.verticalFill,x:Ye(t.x)?t.x:c.left,y:Ye(t.y)?t.y:c.top,width:Ye(t.width)?t.width:c.width,height:Ye(t.height)?t.height:c.height}),f=u.x,d=u.y,h=u.width,p=u.height,m=u.syncWithTicks,g=u.horizontalValues,v=u.verticalValues,y=XIt(),x=QIt();if(!Ye(h)||h<=0||!Ye(p)||p<=0||!Ye(f)||f!==+f||!Ye(d)||d!==+d)return null;var b=u.verticalCoordinatesGenerator||qDt,_=u.horizontalCoordinatesGenerator||XDt,S=u.horizontalPoints,O=u.verticalPoints;if((!S||!S.length)&&Bt(_)){var C=g&&g.length,E=_({yAxis:x?Qi(Qi({},x),{},{ticks:C?g:x.ticks}):void 0,width:s,height:l,offset:c},C?!0:m);ru(Array.isArray(E),"horizontalCoordinatesGenerator should return Array but instead it returned [".concat(vp(E),"]")),Array.isArray(E)&&(S=E)}if((!O||!O.length)&&Bt(b)){var k=v&&v.length,I=b({xAxis:y?Qi(Qi({},y),{},{ticks:k?v:y.ticks}):void 0,width:s,height:l,offset:c},k?!0:m);ru(Array.isArray(I),"verticalCoordinatesGenerator should return Array but instead it returned [".concat(vp(I),"]")),Array.isArray(I)&&(O=I)}return ue.createElement("g",{className:"recharts-cartesian-grid"},ue.createElement(UDt,{fill:u.fill,fillOpacity:u.fillOpacity,x:u.x,y:u.y,width:u.width,height:u.height}),ue.createElement(WDt,Ph({},u,{offset:c,horizontalPoints:S,xAxis:y,yAxis:x})),ue.createElement(VDt,Ph({},u,{offset:c,verticalPoints:O,xAxis:y,yAxis:x})),ue.createElement(GDt,Ph({},u,{horizontalPoints:S})),ue.createElement(HDt,Ph({},u,{verticalPoints:O})))}l6.displayName="CartesianGrid";var QDt=["type","layout","connectNulls","ref"];function Av(t){"@babel/helpers - typeof";return Av=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(e){return typeof e}:function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},Av(t)}function YDt(t,e){if(t==null)return{};var n=KDt(t,e),r,i;if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(t);for(i=0;i<o.length;i++)r=o[i],!(e.indexOf(r)>=0)&&Object.prototype.propertyIsEnumerable.call(t,r)&&(n[r]=t[r])}return n}function KDt(t,e){if(t==null)return{};var n={},r=Object.keys(t),i,o;for(o=0;o<r.length;o++)i=r[o],!(e.indexOf(i)>=0)&&(n[i]=t[i]);return n}function cb(){return cb=Object.assign?Object.assign.bind():function(t){for(var e=1;e<arguments.length;e++){var n=arguments[e];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(t[r]=n[r])}return t},cb.apply(this,arguments)}function jK(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(t,i).enumerable})),n.push.apply(n,r)}return n}function ia(t){for(var e=1;e<arguments.length;e++){var n=arguments[e]!=null?arguments[e]:{};e%2?jK(Object(n),!0).forEach(function(r){zs(t,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):jK(Object(n)).forEach(function(r){Object.defineProperty(t,r,Object.getOwnPropertyDescriptor(n,r))})}return t}function mm(t){return tLt(t)||eLt(t)||JDt(t)||ZDt()}function ZDt(){throw new TypeError(`Invalid attempt to spread non-iterable instance.
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function JDt(t,e){if(t){if(typeof t=="string")return fF(t,e);var n=Object.prototype.toString.call(t).slice(8,-1);if(n==="Object"&&t.constructor&&(n=t.constructor.name),n==="Map"||n==="Set")return Array.from(t);if(n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return fF(t,e)}}function eLt(t){if(typeof Symbol<"u"&&t[Symbol.iterator]!=null||t["@@iterator"]!=null)return Array.from(t)}function tLt(t){if(Array.isArray(t))return fF(t)}function fF(t,e){(e==null||e>t.length)&&(e=t.length);for(var n=0,r=new Array(e);n<e;n++)r[n]=t[n];return r}function nLt(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function BK(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,$ve(r.key),r)}}function rLt(t,e,n){return e&&BK(t.prototype,e),n&&BK(t,n),Object.defineProperty(t,"prototype",{writable:!1}),t}function iLt(t,e,n){return e=PP(e),oLt(t,Nve()?Reflect.construct(e,n||[],PP(t).constructor):e.apply(t,n))}function oLt(t,e){if(e&&(Av(e)==="object"||typeof e=="function"))return e;if(e!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return Zu(t)}function Nve(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch{}return(Nve=function(){return!!t})()}function PP(t){return PP=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(n){return n.__proto__||Object.getPrototypeOf(n)},PP(t)}function Zu(t){if(t===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}function aLt(t,e){if(typeof e!="function"&&e!==null)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&dF(t,e)}function dF(t,e){return dF=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(r,i){return r.__proto__=i,r},dF(t,e)}function zs(t,e,n){return e=$ve(e),e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function $ve(t){var e=sLt(t,"string");return Av(e)=="symbol"?e:String(e)}function sLt(t,e){if(Av(t)!="object"||!t)return t;var n=t[Symbol.toPrimitive];if(n!==void 0){var r=n.call(t,e||"default");if(Av(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}var Dw=function(t){aLt(e,t);function e(){var n;nLt(this,e);for(var r=arguments.length,i=new Array(r),o=0;o<r;o++)i[o]=arguments[o];return n=iLt(this,e,[].concat(i)),zs(Zu(n),"state",{isAnimationFinished:!0,totalLength:0}),zs(Zu(n),"generateSimpleStrokeDasharray",function(a,s){return"".concat(s,"px ").concat(a-s,"px")}),zs(Zu(n),"getStrokeDasharray",function(a,s,l){var c=l.reduce(function(v,y){return v+y});if(!c)return n.generateSimpleStrokeDasharray(s,a);for(var u=Math.floor(a/c),f=a%c,d=s-a,h=[],p=0,m=0;p<l.length;m+=l[p],++p)if(m+l[p]>f){h=[].concat(mm(l.slice(0,p)),[f-m]);break}var g=h.length%2===0?[0,d]:[d];return[].concat(mm(e.repeat(l,u)),mm(h),g).map(function(v){return"".concat(v,"px")}).join(", ")}),zs(Zu(n),"id",jy("recharts-line-")),zs(Zu(n),"pathRef",function(a){n.mainCurve=a}),zs(Zu(n),"handleAnimationEnd",function(){n.setState({isAnimationFinished:!0}),n.props.onAnimationEnd&&n.props.onAnimationEnd()}),zs(Zu(n),"handleAnimationStart",function(){n.setState({isAnimationFinished:!1}),n.props.onAnimationStart&&n.props.onAnimationStart()}),n}return rLt(e,[{key:"componentDidMount",value:function(){if(this.props.isAnimationActive){var r=this.getTotalLength();this.setState({totalLength:r})}}},{key:"componentDidUpdate",value:function(){if(this.props.isAnimationActive){var r=this.getTotalLength();r!==this.state.totalLength&&this.setState({totalLength:r})}}},{key:"getTotalLength",value:function(){var r=this.mainCurve;try{return r&&r.getTotalLength&&r.getTotalLength()||0}catch{return 0}}},{key:"renderErrorBar",value:function(r,i){if(this.props.isAnimationActive&&!this.state.isAnimationFinished)return null;var o=this.props,a=o.points,s=o.xAxis,l=o.yAxis,c=o.layout,u=o.children,f=os(u,Hy);if(!f)return null;var d=function(m,g){return{x:m.x,y:m.y,value:m.value,errorVal:ho(m.payload,g)}},h={clipPath:r?"url(#clipPath-".concat(i,")"):null};return ue.createElement(Gn,h,f.map(function(p){return ue.cloneElement(p,{key:"bar-".concat(p.props.dataKey),data:a,xAxis:s,yAxis:l,layout:c,dataPointFormatter:d})}))}},{key:"renderDots",value:function(r,i,o){var a=this.props.isAnimationActive;if(a&&!this.state.isAnimationFinished)return null;var s=this.props,l=s.dot,c=s.points,u=s.dataKey,f=jt(this.props,!1),d=jt(l,!0),h=c.map(function(m,g){var v=ia(ia(ia({key:"dot-".concat(g),r:3},f),d),{},{value:m.value,dataKey:u,cx:m.x,cy:m.y,index:g,payload:m.payload});return e.renderDotItem(l,v)}),p={clipPath:r?"url(#clipPath-".concat(i?"":"dots-").concat(o,")"):null};return ue.createElement(Gn,cb({className:"recharts-line-dots",key:"dots"},p),h)}},{key:"renderCurveStatically",value:function(r,i,o,a){var s=this.props,l=s.type,c=s.layout,u=s.connectNulls;s.ref;var f=YDt(s,QDt),d=ia(ia(ia({},jt(f,!0)),{},{fill:"none",className:"recharts-line-curve",clipPath:i?"url(#clipPath-".concat(o,")"):null,points:r},a),{},{type:l,layout:c,connectNulls:u});return ue.createElement(jg,cb({},d,{pathRef:this.pathRef}))}},{key:"renderCurveWithAnimation",value:function(r,i){var o=this,a=this.props,s=a.points,l=a.strokeDasharray,c=a.isAnimationActive,u=a.animationBegin,f=a.animationDuration,d=a.animationEasing,h=a.animationId,p=a.animateNewValues,m=a.width,g=a.height,v=this.state,y=v.prevPoints,x=v.totalLength;return ue.createElement(rc,{begin:u,duration:f,isActive:c,easing:d,from:{t:0},to:{t:1},key:"line-".concat(h),onAnimationEnd:this.handleAnimationEnd,onAnimationStart:this.handleAnimationStart},function(b){var _=b.t;if(y){var S=y.length/s.length,O=s.map(function(P,R){var T=Math.floor(R*S);if(y[T]){var L=y[T],z=Ei(L.x,P.x),B=Ei(L.y,P.y);return ia(ia({},P),{},{x:z(_),y:B(_)})}if(p){var U=Ei(m*2,P.x),W=Ei(g/2,P.y);return ia(ia({},P),{},{x:U(_),y:W(_)})}return ia(ia({},P),{},{x:P.x,y:P.y})});return o.renderCurveStatically(O,r,i)}var C=Ei(0,x),E=C(_),k;if(l){var I="".concat(l).split(/[,\s]+/gim).map(function(P){return parseFloat(P)});k=o.getStrokeDasharray(E,x,I)}else k=o.generateSimpleStrokeDasharray(x,E);return o.renderCurveStatically(s,r,i,{strokeDasharray:k})})}},{key:"renderCurve",value:function(r,i){var o=this.props,a=o.points,s=o.isAnimationActive,l=this.state,c=l.prevPoints,u=l.totalLength;return s&&a&&a.length&&(!c&&u>0||!Tv(c,a))?this.renderCurveWithAnimation(r,i):this.renderCurveStatically(a,r,i)}},{key:"render",value:function(){var r,i=this.props,o=i.hide,a=i.dot,s=i.points,l=i.className,c=i.xAxis,u=i.yAxis,f=i.top,d=i.left,h=i.width,p=i.height,m=i.isAnimationActive,g=i.id;if(o||!s||!s.length)return null;var v=this.state.isAnimationFinished,y=s.length===1,x=ke("recharts-line",l),b=c&&c.allowDataOverflow,_=u&&u.allowDataOverflow,S=b||_,O=Wt(g)?this.id:g,C=(r=jt(a,!1))!==null&&r!==void 0?r:{r:3,strokeWidth:2},E=C.r,k=E===void 0?3:E,I=C.strokeWidth,P=I===void 0?2:I,R=Hpe(a)?a:{},T=R.clipDot,L=T===void 0?!0:T,z=k*2+P;return ue.createElement(Gn,{className:x},b||_?ue.createElement("defs",null,ue.createElement("clipPath",{id:"clipPath-".concat(O)},ue.createElement("rect",{x:b?d:d-h/2,y:_?f:f-p/2,width:b?h:h*2,height:_?p:p*2})),!L&&ue.createElement("clipPath",{id:"clipPath-dots-".concat(O)},ue.createElement("rect",{x:d-z/2,y:f-z/2,width:h+z,height:p+z}))):null,!y&&this.renderCurve(S,O),this.renderErrorBar(S,O),(y||a)&&this.renderDots(S,L,O),(!m||v)&&ou.renderCallByParent(this.props,s))}}],[{key:"getDerivedStateFromProps",value:function(r,i){return r.animationId!==i.prevAnimationId?{prevAnimationId:r.animationId,curPoints:r.points,prevPoints:i.curPoints}:r.points!==i.curPoints?{curPoints:r.points}:null}},{key:"repeat",value:function(r,i){for(var o=r.length%2!==0?[].concat(mm(r),[0]):r,a=[],s=0;s<i;++s)a=[].concat(mm(a),mm(o));return a}},{key:"renderDotItem",value:function(r,i){var o;if(ue.isValidElement(r))o=ue.cloneElement(r,i);else if(Bt(r))o=r(i);else{var a=ke("recharts-line-dot",typeof r!="boolean"?r.className:"");o=ue.createElement(Pk,cb({},i,{className:a}))}return o}}]),e}(M.PureComponent);zs(Dw,"displayName","Line");zs(Dw,"defaultProps",{xAxisId:0,yAxisId:0,connectNulls:!1,activeDot:!0,dot:!0,legendType:"line",stroke:"#3182bd",strokeWidth:1,fill:"#fff",points:[],isAnimationActive:!Yl.isSsr,animateNewValues:!0,animationBegin:0,animationDuration:1500,animationEasing:"ease",hide:!1,label:!1});zs(Dw,"getComposedData",function(t){var e=t.props,n=t.xAxis,r=t.yAxis,i=t.xAxisTicks,o=t.yAxisTicks,a=t.dataKey,s=t.bandSize,l=t.displayedData,c=t.offset,u=e.layout,f=l.map(function(d,h){var p=ho(d,a);return u==="horizontal"?{x:fP({axis:n,ticks:i,bandSize:s,entry:d,index:h}),y:Wt(p)?null:r.scale(p),value:p,payload:d}:{x:Wt(p)?null:n.scale(p),y:fP({axis:r,ticks:o,bandSize:s,entry:d,index:h}),value:p,payload:d}});return ia({points:f,layout:u},c)});var lLt=["layout","type","stroke","connectNulls","isRange","ref"],Fve;function Rv(t){"@babel/helpers - typeof";return Rv=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(e){return typeof e}:function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},Rv(t)}function cLt(t,e){if(t==null)return{};var n=uLt(t,e),r,i;if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(t);for(i=0;i<o.length;i++)r=o[i],!(e.indexOf(r)>=0)&&Object.prototype.propertyIsEnumerable.call(t,r)&&(n[r]=t[r])}return n}function uLt(t,e){if(t==null)return{};var n={},r=Object.keys(t),i,o;for(o=0;o<r.length;o++)i=r[o],!(e.indexOf(i)>=0)&&(n[i]=t[i]);return n}function Mh(){return Mh=Object.assign?Object.assign.bind():function(t){for(var e=1;e<arguments.length;e++){var n=arguments[e];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(t[r]=n[r])}return t},Mh.apply(this,arguments)}function zK(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(t,i).enumerable})),n.push.apply(n,r)}return n}function Ju(t){for(var e=1;e<arguments.length;e++){var n=arguments[e]!=null?arguments[e]:{};e%2?zK(Object(n),!0).forEach(function(r){Fl(t,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):zK(Object(n)).forEach(function(r){Object.defineProperty(t,r,Object.getOwnPropertyDescriptor(n,r))})}return t}function fLt(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function UK(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,Bve(r.key),r)}}function dLt(t,e,n){return e&&UK(t.prototype,e),n&&UK(t,n),Object.defineProperty(t,"prototype",{writable:!1}),t}function hLt(t,e,n){return e=MP(e),pLt(t,jve()?Reflect.construct(e,n||[],MP(t).constructor):e.apply(t,n))}function pLt(t,e){if(e&&(Rv(e)==="object"||typeof e=="function"))return e;if(e!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return _x(t)}function jve(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch{}return(jve=function(){return!!t})()}function MP(t){return MP=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(n){return n.__proto__||Object.getPrototypeOf(n)},MP(t)}function _x(t){if(t===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}function mLt(t,e){if(typeof e!="function"&&e!==null)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&hF(t,e)}function hF(t,e){return hF=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(r,i){return r.__proto__=i,r},hF(t,e)}function Fl(t,e,n){return e=Bve(e),e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function Bve(t){var e=gLt(t,"string");return Rv(e)=="symbol"?e:String(e)}function gLt(t,e){if(Rv(t)!="object"||!t)return t;var n=t[Symbol.toPrimitive];if(n!==void 0){var r=n.call(t,e||"default");if(Rv(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}var Dd=function(t){mLt(e,t);function e(){var n;fLt(this,e);for(var r=arguments.length,i=new Array(r),o=0;o<r;o++)i[o]=arguments[o];return n=hLt(this,e,[].concat(i)),Fl(_x(n),"state",{isAnimationFinished:!0}),Fl(_x(n),"id",jy("recharts-area-")),Fl(_x(n),"handleAnimationEnd",function(){var a=n.props.onAnimationEnd;n.setState({isAnimationFinished:!0}),Bt(a)&&a()}),Fl(_x(n),"handleAnimationStart",function(){var a=n.props.onAnimationStart;n.setState({isAnimationFinished:!1}),Bt(a)&&a()}),n}return dLt(e,[{key:"renderDots",value:function(r,i,o){var a=this.props.isAnimationActive,s=this.state.isAnimationFinished;if(a&&!s)return null;var l=this.props,c=l.dot,u=l.points,f=l.dataKey,d=jt(this.props,!1),h=jt(c,!0),p=u.map(function(g,v){var y=Ju(Ju(Ju({key:"dot-".concat(v),r:3},d),h),{},{index:v,cx:g.x,cy:g.y,dataKey:f,value:g.value,payload:g.payload,points:u});return e.renderDotItem(c,y)}),m={clipPath:r?"url(#clipPath-".concat(i?"":"dots-").concat(o,")"):null};return ue.createElement(Gn,Mh({className:"recharts-area-dots"},m),p)}},{key:"renderHorizontalRect",value:function(r){var i=this.props,o=i.baseLine,a=i.points,s=i.strokeWidth,l=a[0].x,c=a[a.length-1].x,u=r*Math.abs(l-c),f=Ef(a.map(function(d){return d.y||0}));return Ye(o)&&typeof o=="number"?f=Math.max(o,f):o&&Array.isArray(o)&&o.length&&(f=Math.max(Ef(o.map(function(d){return d.y||0})),f)),Ye(f)?ue.createElement("rect",{x:l<c?l:l-u,y:0,width:u,height:Math.floor(f+(s?parseInt("".concat(s),10):1))}):null}},{key:"renderVerticalRect",value:function(r){var i=this.props,o=i.baseLine,a=i.points,s=i.strokeWidth,l=a[0].y,c=a[a.length-1].y,u=r*Math.abs(l-c),f=Ef(a.map(function(d){return d.x||0}));return Ye(o)&&typeof o=="number"?f=Math.max(o,f):o&&Array.isArray(o)&&o.length&&(f=Math.max(Ef(o.map(function(d){return d.x||0})),f)),Ye(f)?ue.createElement("rect",{x:0,y:l<c?l:l-u,width:f+(s?parseInt("".concat(s),10):1),height:Math.floor(u)}):null}},{key:"renderClipRect",value:function(r){var i=this.props.layout;return i==="vertical"?this.renderVerticalRect(r):this.renderHorizontalRect(r)}},{key:"renderAreaStatically",value:function(r,i,o,a){var s=this.props,l=s.layout,c=s.type,u=s.stroke,f=s.connectNulls,d=s.isRange;s.ref;var h=cLt(s,lLt);return ue.createElement(Gn,{clipPath:o?"url(#clipPath-".concat(a,")"):null},ue.createElement(jg,Mh({},jt(h,!0),{points:r,connectNulls:f,type:c,baseLine:i,layout:l,stroke:"none",className:"recharts-area-area"})),u!=="none"&&ue.createElement(jg,Mh({},jt(this.props,!1),{className:"recharts-area-curve",layout:l,type:c,connectNulls:f,fill:"none",points:r})),u!=="none"&&d&&ue.createElement(jg,Mh({},jt(this.props,!1),{className:"recharts-area-curve",layout:l,type:c,connectNulls:f,fill:"none",points:i})))}},{key:"renderAreaWithAnimation",value:function(r,i){var o=this,a=this.props,s=a.points,l=a.baseLine,c=a.isAnimationActive,u=a.animationBegin,f=a.animationDuration,d=a.animationEasing,h=a.animationId,p=this.state,m=p.prevPoints,g=p.prevBaseLine;return ue.createElement(rc,{begin:u,duration:f,isActive:c,easing:d,from:{t:0},to:{t:1},key:"area-".concat(h),onAnimationEnd:this.handleAnimationEnd,onAnimationStart:this.handleAnimationStart},function(v){var y=v.t;if(m){var x=m.length/s.length,b=s.map(function(C,E){var k=Math.floor(E*x);if(m[k]){var I=m[k],P=Ei(I.x,C.x),R=Ei(I.y,C.y);return Ju(Ju({},C),{},{x:P(y),y:R(y)})}return C}),_;if(Ye(l)&&typeof l=="number"){var S=Ei(g,l);_=S(y)}else if(Wt(l)||Fy(l)){var O=Ei(g,0);_=O(y)}else _=l.map(function(C,E){var k=Math.floor(E*x);if(g[k]){var I=g[k],P=Ei(I.x,C.x),R=Ei(I.y,C.y);return Ju(Ju({},C),{},{x:P(y),y:R(y)})}return C});return o.renderAreaStatically(b,_,r,i)}return ue.createElement(Gn,null,ue.createElement("defs",null,ue.createElement("clipPath",{id:"animationClipPath-".concat(i)},o.renderClipRect(y))),ue.createElement(Gn,{clipPath:"url(#animationClipPath-".concat(i,")")},o.renderAreaStatically(s,l,r,i)))})}},{key:"renderArea",value:function(r,i){var o=this.props,a=o.points,s=o.baseLine,l=o.isAnimationActive,c=this.state,u=c.prevPoints,f=c.prevBaseLine,d=c.totalLength;return l&&a&&a.length&&(!u&&d>0||!Tv(u,a)||!Tv(f,s))?this.renderAreaWithAnimation(r,i):this.renderAreaStatically(a,s,r,i)}},{key:"render",value:function(){var r,i=this.props,o=i.hide,a=i.dot,s=i.points,l=i.className,c=i.top,u=i.left,f=i.xAxis,d=i.yAxis,h=i.width,p=i.height,m=i.isAnimationActive,g=i.id;if(o||!s||!s.length)return null;var v=this.state.isAnimationFinished,y=s.length===1,x=ke("recharts-area",l),b=f&&f.allowDataOverflow,_=d&&d.allowDataOverflow,S=b||_,O=Wt(g)?this.id:g,C=(r=jt(a,!1))!==null&&r!==void 0?r:{r:3,strokeWidth:2},E=C.r,k=E===void 0?3:E,I=C.strokeWidth,P=I===void 0?2:I,R=Hpe(a)?a:{},T=R.clipDot,L=T===void 0?!0:T,z=k*2+P;return ue.createElement(Gn,{className:x},b||_?ue.createElement("defs",null,ue.createElement("clipPath",{id:"clipPath-".concat(O)},ue.createElement("rect",{x:b?u:u-h/2,y:_?c:c-p/2,width:b?h:h*2,height:_?p:p*2})),!L&&ue.createElement("clipPath",{id:"clipPath-dots-".concat(O)},ue.createElement("rect",{x:u-z/2,y:c-z/2,width:h+z,height:p+z}))):null,y?null:this.renderArea(S,O),(a||y)&&this.renderDots(S,L,O),(!m||v)&&ou.renderCallByParent(this.props,s))}}],[{key:"getDerivedStateFromProps",value:function(r,i){return r.animationId!==i.prevAnimationId?{prevAnimationId:r.animationId,curPoints:r.points,curBaseLine:r.baseLine,prevPoints:i.curPoints,prevBaseLine:i.curBaseLine}:r.points!==i.curPoints||r.baseLine!==i.curBaseLine?{curPoints:r.points,curBaseLine:r.baseLine}:null}}]),e}(M.PureComponent);Fve=Dd;Fl(Dd,"displayName","Area");Fl(Dd,"defaultProps",{stroke:"#3182bd",fill:"#3182bd",fillOpacity:.6,xAxisId:0,yAxisId:0,legendType:"line",connectNulls:!1,points:[],dot:!1,activeDot:!0,hide:!1,isAnimationActive:!Yl.isSsr,animationBegin:0,animationDuration:1500,animationEasing:"ease"});Fl(Dd,"getBaseValue",function(t,e,n,r){var i=t.layout,o=t.baseValue,a=e.props.baseValue,s=a??o;if(Ye(s)&&typeof s=="number")return s;var l=i==="horizontal"?r:n,c=l.scale.domain();if(l.type==="number"){var u=Math.max(c[0],c[1]),f=Math.min(c[0],c[1]);return s==="dataMin"?f:s==="dataMax"||u<0?u:Math.max(Math.min(c[0],c[1]),0)}return s==="dataMin"?c[0]:s==="dataMax"?c[1]:c[0]});Fl(Dd,"getComposedData",function(t){var e=t.props,n=t.item,r=t.xAxis,i=t.yAxis,o=t.xAxisTicks,a=t.yAxisTicks,s=t.bandSize,l=t.dataKey,c=t.stackedData,u=t.dataStartIndex,f=t.displayedData,d=t.offset,h=e.layout,p=c&&c.length,m=Fve.getBaseValue(e,n,r,i),g=h==="horizontal",v=!1,y=f.map(function(b,_){var S;p?S=c[u+_]:(S=ho(b,l),Array.isArray(S)?v=!0:S=[m,S]);var O=S[1]==null||p&&ho(b,l)==null;return g?{x:fP({axis:r,ticks:o,bandSize:s,entry:b,index:_}),y:O?null:i.scale(S[1]),value:S,payload:b}:{x:O?null:r.scale(S[1]),y:fP({axis:i,ticks:a,bandSize:s,entry:b,index:_}),value:S,payload:b}}),x;return p||v?x=y.map(function(b){var _=Array.isArray(b.value)?b.value[0]:null;return g?{x:b.x,y:_!=null&&b.y!=null?i.scale(_):null}:{x:_!=null?r.scale(_):null,y:b.y}}):x=g?i.scale(m):r.scale(m),Ju({points:y,baseLine:x,layout:h,isRange:v},d)});Fl(Dd,"renderDotItem",function(t,e){var n;if(ue.isValidElement(t))n=ue.cloneElement(t,e);else if(Bt(t))n=t(e);else{var r=ke("recharts-area-dot",typeof t!="boolean"?t.className:"");n=ue.createElement(Pk,Mh({},e,{className:r}))}return n});function pF(){return pF=Object.assign?Object.assign.bind():function(t){for(var e=1;e<arguments.length;e++){var n=arguments[e];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(t[r]=n[r])}return t},pF.apply(this,arguments)}var Vp=function(e){var n=e.xAxisId,r=i6(),i=o6(),o=kve(n);return o==null?null:ue.createElement(Xy,pF({},o,{className:ke("recharts-".concat(o.axisType," ").concat(o.axisType),o.className),viewBox:{x:0,y:0,width:r,height:i},ticksGenerator:function(s){return Qc(s,!0)}}))};Vp.displayName="XAxis";Vp.defaultProps={allowDecimals:!0,hide:!1,orientation:"bottom",width:0,height:30,mirror:!1,xAxisId:0,tickCount:5,type:"category",padding:{left:0,right:0},allowDataOverflow:!1,scale:"auto",reversed:!1,allowDuplicatedCategory:!0};function mF(){return mF=Object.assign?Object.assign.bind():function(t){for(var e=1;e<arguments.length;e++){var n=arguments[e];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(t[r]=n[r])}return t},mF.apply(this,arguments)}var Gp=function(e){var n=e.yAxisId,r=i6(),i=o6(),o=Ave(n);return o==null?null:ue.createElement(Xy,mF({},o,{className:ke("recharts-".concat(o.axisType," ").concat(o.axisType),o.className),viewBox:{x:0,y:0,width:r,height:i},ticksGenerator:function(s){return Qc(s,!0)}}))};Gp.displayName="YAxis";Gp.defaultProps={allowDuplicatedCategory:!0,allowDecimals:!0,hide:!1,orientation:"left",width:60,height:0,mirror:!1,yAxisId:0,tickCount:5,type:"number",padding:{top:0,bottom:0},allowDataOverflow:!1,scale:"auto",reversed:!1};function WK(t){return bLt(t)||xLt(t)||yLt(t)||vLt()}function vLt(){throw new TypeError(`Invalid attempt to spread non-iterable instance.
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function yLt(t,e){if(t){if(typeof t=="string")return gF(t,e);var n=Object.prototype.toString.call(t).slice(8,-1);if(n==="Object"&&t.constructor&&(n=t.constructor.name),n==="Map"||n==="Set")return Array.from(t);if(n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return gF(t,e)}}function xLt(t){if(typeof Symbol<"u"&&t[Symbol.iterator]!=null||t["@@iterator"]!=null)return Array.from(t)}function bLt(t){if(Array.isArray(t))return gF(t)}function gF(t,e){(e==null||e>t.length)&&(e=t.length);for(var n=0,r=new Array(e);n<e;n++)r[n]=t[n];return r}var vF=function(e,n,r,i,o){var a=os(e,Rw),s=os(e,Iw),l=[].concat(WK(a),WK(s)),c=os(e,Wp),u="".concat(i,"Id"),f=i[0],d=n;if(l.length&&(d=l.reduce(function(m,g){if(g.props[u]===r&&Zl(g.props,"extendDomain")&&Ye(g.props[f])){var v=g.props[f];return[Math.min(m[0],v),Math.max(m[1],v)]}return m},d)),c.length){var h="".concat(f,"1"),p="".concat(f,"2");d=c.reduce(function(m,g){if(g.props[u]===r&&Zl(g.props,"extendDomain")&&Ye(g.props[h])&&Ye(g.props[p])){var v=g.props[h],y=g.props[p];return[Math.min(m[0],v,y),Math.max(m[1],v,y)]}return m},d)}return o&&o.length&&(d=o.reduce(function(m,g){return Ye(g)?[Math.min(m[0],g),Math.max(m[1],g)]:m},d)),d},zve={exports:{}};(function(t){var e=Object.prototype.hasOwnProperty,n="~";function r(){}Object.create&&(r.prototype=Object.create(null),new r().__proto__||(n=!1));function i(l,c,u){this.fn=l,this.context=c,this.once=u||!1}function o(l,c,u,f,d){if(typeof u!="function")throw new TypeError("The listener must be a function");var h=new i(u,f||l,d),p=n?n+c:c;return l._events[p]?l._events[p].fn?l._events[p]=[l._events[p],h]:l._events[p].push(h):(l._events[p]=h,l._eventsCount++),l}function a(l,c){--l._eventsCount===0?l._events=new r:delete l._events[c]}function s(){this._events=new r,this._eventsCount=0}s.prototype.eventNames=function(){var c=[],u,f;if(this._eventsCount===0)return c;for(f in u=this._events)e.call(u,f)&&c.push(n?f.slice(1):f);return Object.getOwnPropertySymbols?c.concat(Object.getOwnPropertySymbols(u)):c},s.prototype.listeners=function(c){var u=n?n+c:c,f=this._events[u];if(!f)return[];if(f.fn)return[f.fn];for(var d=0,h=f.length,p=new Array(h);d<h;d++)p[d]=f[d].fn;return p},s.prototype.listenerCount=function(c){var u=n?n+c:c,f=this._events[u];return f?f.fn?1:f.length:0},s.prototype.emit=function(c,u,f,d,h,p){var m=n?n+c:c;if(!this._events[m])return!1;var g=this._events[m],v=arguments.length,y,x;if(g.fn){switch(g.once&&this.removeListener(c,g.fn,void 0,!0),v){case 1:return g.fn.call(g.context),!0;case 2:return g.fn.call(g.context,u),!0;case 3:return g.fn.call(g.context,u,f),!0;case 4:return g.fn.call(g.context,u,f,d),!0;case 5:return g.fn.call(g.context,u,f,d,h),!0;case 6:return g.fn.call(g.context,u,f,d,h,p),!0}for(x=1,y=new Array(v-1);x<v;x++)y[x-1]=arguments[x];g.fn.apply(g.context,y)}else{var b=g.length,_;for(x=0;x<b;x++)switch(g[x].once&&this.removeListener(c,g[x].fn,void 0,!0),v){case 1:g[x].fn.call(g[x].context);break;case 2:g[x].fn.call(g[x].context,u);break;case 3:g[x].fn.call(g[x].context,u,f);break;case 4:g[x].fn.call(g[x].context,u,f,d);break;default:if(!y)for(_=1,y=new Array(v-1);_<v;_++)y[_-1]=arguments[_];g[x].fn.apply(g[x].context,y)}}return!0},s.prototype.on=function(c,u,f){return o(this,c,u,f,!1)},s.prototype.once=function(c,u,f){return o(this,c,u,f,!0)},s.prototype.removeListener=function(c,u,f,d){var h=n?n+c:c;if(!this._events[h])return this;if(!u)return a(this,h),this;var p=this._events[h];if(p.fn)p.fn===u&&(!d||p.once)&&(!f||p.context===f)&&a(this,h);else{for(var m=0,g=[],v=p.length;m<v;m++)(p[m].fn!==u||d&&!p[m].once||f&&p[m].context!==f)&&g.push(p[m]);g.length?this._events[h]=g.length===1?g[0]:g:a(this,h)}return this},s.prototype.removeAllListeners=function(c){var u;return c?(u=n?n+c:c,this._events[u]&&a(this,u)):(this._events=new r,this._eventsCount=0),this},s.prototype.off=s.prototype.removeListener,s.prototype.addListener=s.prototype.on,s.prefixed=n,s.EventEmitter=s,t.exports=s})(zve);var _Lt=zve.exports;const wLt=$t(_Lt);var FI=new wLt,jI="recharts.syncMouseEvents";function r1(t){"@babel/helpers - typeof";return r1=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(e){return typeof e}:function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},r1(t)}function SLt(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function OLt(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,Uve(r.key),r)}}function CLt(t,e,n){return e&&OLt(t.prototype,e),Object.defineProperty(t,"prototype",{writable:!1}),t}function BI(t,e,n){return e=Uve(e),e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function Uve(t){var e=TLt(t,"string");return r1(e)=="symbol"?e:String(e)}function TLt(t,e){if(r1(t)!="object"||!t)return t;var n=t[Symbol.toPrimitive];if(n!==void 0){var r=n.call(t,e||"default");if(r1(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}var ELt=function(){function t(){SLt(this,t),BI(this,"activeIndex",0),BI(this,"coordinateList",[]),BI(this,"layout","horizontal")}return CLt(t,[{key:"setDetails",value:function(n){var r,i=n.coordinateList,o=i===void 0?null:i,a=n.container,s=a===void 0?null:a,l=n.layout,c=l===void 0?null:l,u=n.offset,f=u===void 0?null:u,d=n.mouseHandlerCallback,h=d===void 0?null:d;this.coordinateList=(r=o??this.coordinateList)!==null&&r!==void 0?r:[],this.container=s??this.container,this.layout=c??this.layout,this.offset=f??this.offset,this.mouseHandlerCallback=h??this.mouseHandlerCallback,this.activeIndex=Math.min(Math.max(this.activeIndex,0),this.coordinateList.length-1)}},{key:"focus",value:function(){this.spoofMouse()}},{key:"keyboardEvent",value:function(n){if(this.coordinateList.length!==0)switch(n.key){case"ArrowRight":{if(this.layout!=="horizontal")return;this.activeIndex=Math.min(this.activeIndex+1,this.coordinateList.length-1),this.spoofMouse();break}case"ArrowLeft":{if(this.layout!=="horizontal")return;this.activeIndex=Math.max(this.activeIndex-1,0),this.spoofMouse();break}}}},{key:"setIndex",value:function(n){this.activeIndex=n}},{key:"spoofMouse",value:function(){var n,r;if(this.layout==="horizontal"&&this.coordinateList.length!==0){var i=this.container.getBoundingClientRect(),o=i.x,a=i.y,s=i.height,l=this.coordinateList[this.activeIndex].coordinate,c=((n=window)===null||n===void 0?void 0:n.scrollX)||0,u=((r=window)===null||r===void 0?void 0:r.scrollY)||0,f=o+l+c,d=a+this.offset.top+s/2+u;this.mouseHandlerCallback({pageX:f,pageY:d})}}}]),t}();function PLt(t,e,n){if(n==="number"&&e===!0&&Array.isArray(t)){var r=t==null?void 0:t[0],i=t==null?void 0:t[1];if(r&&i&&Ye(r)&&Ye(i))return!0}return!1}function MLt(t,e,n,r){var i=r/2;return{stroke:"none",fill:"#ccc",x:t==="horizontal"?e.x-i:n.left+.5,y:t==="horizontal"?n.top+.5:e.y-i,width:t==="horizontal"?r:n.width-1,height:t==="horizontal"?n.height-1:r}}function Wve(t){var e=t.cx,n=t.cy,r=t.radius,i=t.startAngle,o=t.endAngle,a=Ai(e,n,r,i),s=Ai(e,n,r,o);return{points:[a,s],cx:e,cy:n,radius:r,startAngle:i,endAngle:o}}function kLt(t,e,n){var r,i,o,a;if(t==="horizontal")r=e.x,o=r,i=n.top,a=n.top+n.height;else if(t==="vertical")i=e.y,a=i,r=n.left,o=n.left+n.width;else if(e.cx!=null&&e.cy!=null)if(t==="centric"){var s=e.cx,l=e.cy,c=e.innerRadius,u=e.outerRadius,f=e.angle,d=Ai(s,l,c,f),h=Ai(s,l,u,f);r=d.x,i=d.y,o=h.x,a=h.y}else return Wve(e);return[{x:r,y:i},{x:o,y:a}]}function i1(t){"@babel/helpers - typeof";return i1=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(e){return typeof e}:function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},i1(t)}function VK(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(t,i).enumerable})),n.push.apply(n,r)}return n}function EO(t){for(var e=1;e<arguments.length;e++){var n=arguments[e]!=null?arguments[e]:{};e%2?VK(Object(n),!0).forEach(function(r){ALt(t,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):VK(Object(n)).forEach(function(r){Object.defineProperty(t,r,Object.getOwnPropertyDescriptor(n,r))})}return t}function ALt(t,e,n){return e=RLt(e),e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function RLt(t){var e=ILt(t,"string");return i1(e)=="symbol"?e:String(e)}function ILt(t,e){if(i1(t)!="object"||!t)return t;var n=t[Symbol.toPrimitive];if(n!==void 0){var r=n.call(t,e||"default");if(i1(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}function DLt(t){var e=t.element,n=t.tooltipEventType,r=t.isActive,i=t.activeCoordinate,o=t.activePayload,a=t.offset,s=t.activeTooltipIndex,l=t.tooltipAxisBandSize,c=t.layout,u=t.chartName;if(!e||!e.props.cursor||!r||!i||u!=="ScatterChart"&&n!=="axis")return null;var f,d=jg;if(u==="ScatterChart")f=i,d=lAt;else if(u==="BarChart")f=MLt(c,i,a,l),d=JU;else if(c==="radial"){var h=Wve(i),p=h.cx,m=h.cy,g=h.radius,v=h.startAngle,y=h.endAngle;f={cx:p,cy:m,startAngle:v,endAngle:y,innerRadius:g,outerRadius:g},d=ive}else f={points:kLt(c,i,a)},d=jg;var x=EO(EO(EO(EO({stroke:"#ccc",pointerEvents:"none"},a),f),jt(e.props.cursor,!1)),{},{payload:o,payloadIndex:s,className:ke("recharts-tooltip-cursor",e.props.cursor.className)});return M.isValidElement(e.props.cursor)?M.cloneElement(e.props.cursor,x):M.createElement(d,x)}var LLt=["item"],NLt=["children","className","width","height","style","compact","title","desc"];function Iv(t){"@babel/helpers - typeof";return Iv=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(e){return typeof e}:function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},Iv(t)}function ub(){return ub=Object.assign?Object.assign.bind():function(t){for(var e=1;e<arguments.length;e++){var n=arguments[e];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(t[r]=n[r])}return t},ub.apply(this,arguments)}function GK(t,e){return jLt(t)||FLt(t,e)||Gve(t,e)||$Lt()}function $Lt(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function FLt(t,e){var n=t==null?null:typeof Symbol<"u"&&t[Symbol.iterator]||t["@@iterator"];if(n!=null){var r,i,o,a,s=[],l=!0,c=!1;try{if(o=(n=n.call(t)).next,e!==0)for(;!(l=(r=o.call(n)).done)&&(s.push(r.value),s.length!==e);l=!0);}catch(u){c=!0,i=u}finally{try{if(!l&&n.return!=null&&(a=n.return(),Object(a)!==a))return}finally{if(c)throw i}}return s}}function jLt(t){if(Array.isArray(t))return t}function HK(t,e){if(t==null)return{};var n=BLt(t,e),r,i;if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(t);for(i=0;i<o.length;i++)r=o[i],!(e.indexOf(r)>=0)&&Object.prototype.propertyIsEnumerable.call(t,r)&&(n[r]=t[r])}return n}function BLt(t,e){if(t==null)return{};var n={},r=Object.keys(t),i,o;for(o=0;o<r.length;o++)i=r[o],!(e.indexOf(i)>=0)&&(n[i]=t[i]);return n}function zLt(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function ULt(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,Hve(r.key),r)}}function WLt(t,e,n){return e&&ULt(t.prototype,e),Object.defineProperty(t,"prototype",{writable:!1}),t}function VLt(t,e,n){return e=kP(e),GLt(t,Vve()?Reflect.construct(e,n||[],kP(t).constructor):e.apply(t,n))}function GLt(t,e){if(e&&(Iv(e)==="object"||typeof e=="function"))return e;if(e!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return on(t)}function Vve(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch{}return(Vve=function(){return!!t})()}function kP(t){return kP=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(n){return n.__proto__||Object.getPrototypeOf(n)},kP(t)}function on(t){if(t===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}function HLt(t,e){if(typeof e!="function"&&e!==null)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&yF(t,e)}function yF(t,e){return yF=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(r,i){return r.__proto__=i,r},yF(t,e)}function Dv(t){return QLt(t)||XLt(t)||Gve(t)||qLt()}function qLt(){throw new TypeError(`Invalid attempt to spread non-iterable instance.
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function Gve(t,e){if(t){if(typeof t=="string")return xF(t,e);var n=Object.prototype.toString.call(t).slice(8,-1);if(n==="Object"&&t.constructor&&(n=t.constructor.name),n==="Map"||n==="Set")return Array.from(t);if(n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return xF(t,e)}}function XLt(t){if(typeof Symbol<"u"&&t[Symbol.iterator]!=null||t["@@iterator"]!=null)return Array.from(t)}function QLt(t){if(Array.isArray(t))return xF(t)}function xF(t,e){(e==null||e>t.length)&&(e=t.length);for(var n=0,r=new Array(e);n<e;n++)r[n]=t[n];return r}function qK(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(t,i).enumerable})),n.push.apply(n,r)}return n}function Be(t){for(var e=1;e<arguments.length;e++){var n=arguments[e]!=null?arguments[e]:{};e%2?qK(Object(n),!0).forEach(function(r){Ct(t,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):qK(Object(n)).forEach(function(r){Object.defineProperty(t,r,Object.getOwnPropertyDescriptor(n,r))})}return t}function Ct(t,e,n){return e=Hve(e),e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function Hve(t){var e=YLt(t,"string");return Iv(e)=="symbol"?e:String(e)}function YLt(t,e){if(Iv(t)!="object"||!t)return t;var n=t[Symbol.toPrimitive];if(n!==void 0){var r=n.call(t,e||"default");if(Iv(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}var KLt={xAxis:["bottom","top"],yAxis:["left","right"]},ZLt={width:"100%",height:"100%"},qve={x:0,y:0};function PO(t){return t}var JLt=function(e,n){return n==="horizontal"?e.x:n==="vertical"?e.y:n==="centric"?e.angle:e.radius},e3t=function(e,n,r,i){var o=n.find(function(u){return u&&u.index===r});if(o){if(e==="horizontal")return{x:o.coordinate,y:i.y};if(e==="vertical")return{x:i.x,y:o.coordinate};if(e==="centric"){var a=o.coordinate,s=i.radius;return Be(Be(Be({},i),Ai(i.cx,i.cy,s,a)),{},{angle:a,radius:s})}var l=o.coordinate,c=i.angle;return Be(Be(Be({},i),Ai(i.cx,i.cy,l,c)),{},{angle:c,radius:l})}return qve},Rk=function(e,n){var r=n.graphicalItems,i=n.dataStartIndex,o=n.dataEndIndex,a=(r??[]).reduce(function(s,l){var c=l.props.data;return c&&c.length?[].concat(Dv(s),Dv(c)):s},[]);return a.length>0?a:e&&e.length&&Ye(i)&&Ye(o)?e.slice(i,o+1):[]};function Xve(t){return t==="number"?[0,"auto"]:void 0}var bF=function(e,n,r,i){var o=e.graphicalItems,a=e.tooltipAxis,s=Rk(n,e);return r<0||!o||!o.length||r>=s.length?null:o.reduce(function(l,c){var u,f=(u=c.props.data)!==null&&u!==void 0?u:n;f&&e.dataStartIndex+e.dataEndIndex!==0&&(f=f.slice(e.dataStartIndex,e.dataEndIndex+1));var d;if(a.dataKey&&!a.allowDuplicatedCategory){var h=f===void 0?s:f;d=NE(h,a.dataKey,i)}else d=f&&f[r]||s[r];return d?[].concat(Dv(l),[tve(c,d)]):l},[])},XK=function(e,n,r,i){var o=i||{x:e.chartX,y:e.chartY},a=JLt(o,r),s=e.orderedTooltipTicks,l=e.tooltipAxis,c=e.tooltipTicks,u=oMt(a,s,c,l);if(u>=0&&c){var f=c[u]&&c[u].value,d=bF(e,n,u,f),h=e3t(r,s,u,o);return{activeTooltipIndex:u,activeLabel:f,activePayload:d,activeCoordinate:h}}return null},t3t=function(e,n){var r=n.axes,i=n.graphicalItems,o=n.axisType,a=n.axisIdKey,s=n.stackGroups,l=n.dataStartIndex,c=n.dataEndIndex,u=e.layout,f=e.children,d=e.stackOffset,h=Zge(u,o);return r.reduce(function(p,m){var g,v=m.props,y=v.type,x=v.dataKey,b=v.allowDataOverflow,_=v.allowDuplicatedCategory,S=v.scale,O=v.ticks,C=v.includeHidden,E=m.props[a];if(p[E])return p;var k=Rk(e.data,{graphicalItems:i.filter(function(D){return D.props[a]===E}),dataStartIndex:l,dataEndIndex:c}),I=k.length,P,R,T;PLt(m.props.domain,b,y)&&(P=U$(m.props.domain,null,b),h&&(y==="number"||S!=="auto")&&(T=sb(k,x,"category")));var L=Xve(y);if(!P||P.length===0){var z,B=(z=m.props.domain)!==null&&z!==void 0?z:L;if(x){if(P=sb(k,x,y),y==="category"&&h){var U=igt(P);_&&U?(R=P,P=_P(0,I)):_||(P=CY(B,P,m).reduce(function(D,A){return D.indexOf(A)>=0?D:[].concat(Dv(D),[A])},[]))}else if(y==="category")_?P=P.filter(function(D){return D!==""&&!Wt(D)}):P=CY(B,P,m).reduce(function(D,A){return D.indexOf(A)>=0||A===""||Wt(A)?D:[].concat(Dv(D),[A])},[]);else if(y==="number"){var W=uMt(k,i.filter(function(D){return D.props[a]===E&&(C||!D.props.hide)}),x,o,u);W&&(P=W)}h&&(y==="number"||S!=="auto")&&(T=sb(k,x,"category"))}else h?P=_P(0,I):s&&s[E]&&s[E].hasStack&&y==="number"?P=d==="expand"?[0,1]:eve(s[E].stackGroups,l,c):P=Kge(k,i.filter(function(D){return D.props[a]===E&&(C||!D.props.hide)}),y,u,!0);if(y==="number")P=vF(f,P,E,o,O),B&&(P=U$(B,P,b));else if(y==="category"&&B){var $=B,N=P.every(function(D){return $.indexOf(D)>=0});N&&(P=$)}}return Be(Be({},p),{},Ct({},E,Be(Be({},m.props),{},{axisType:o,domain:P,categoricalDomain:T,duplicateDomain:R,originalDomain:(g=m.props.domain)!==null&&g!==void 0?g:L,isCategorical:h,layout:u})))},{})},n3t=function(e,n){var r=n.graphicalItems,i=n.Axis,o=n.axisType,a=n.axisIdKey,s=n.stackGroups,l=n.dataStartIndex,c=n.dataEndIndex,u=e.layout,f=e.children,d=Rk(e.data,{graphicalItems:r,dataStartIndex:l,dataEndIndex:c}),h=d.length,p=Zge(u,o),m=-1;return r.reduce(function(g,v){var y=v.props[a],x=Xve("number");if(!g[y]){m++;var b;return p?b=_P(0,h):s&&s[y]&&s[y].hasStack?(b=eve(s[y].stackGroups,l,c),b=vF(f,b,y,o)):(b=U$(x,Kge(d,r.filter(function(_){return _.props[a]===y&&!_.props.hide}),"number",u),i.defaultProps.allowDataOverflow),b=vF(f,b,y,o)),Be(Be({},g),{},Ct({},y,Be(Be({axisType:o},i.defaultProps),{},{hide:!0,orientation:is(KLt,"".concat(o,".").concat(m%2),null),domain:b,originalDomain:x,isCategorical:p,layout:u})))}return g},{})},r3t=function(e,n){var r=n.axisType,i=r===void 0?"xAxis":r,o=n.AxisComp,a=n.graphicalItems,s=n.stackGroups,l=n.dataStartIndex,c=n.dataEndIndex,u=e.children,f="".concat(i,"Id"),d=os(u,o),h={};return d&&d.length?h=t3t(e,{axes:d,graphicalItems:a,axisType:i,axisIdKey:f,stackGroups:s,dataStartIndex:l,dataEndIndex:c}):a&&a.length&&(h=n3t(e,{Axis:o,graphicalItems:a,axisType:i,axisIdKey:f,stackGroups:s,dataStartIndex:l,dataEndIndex:c})),h},i3t=function(e){var n=gf(e),r=Qc(n,!1,!0);return{tooltipTicks:r,orderedTooltipTicks:TU(r,function(i){return i.coordinate}),tooltipAxis:n,tooltipAxisBandSize:dP(n,r)}},QK=function(e){var n=e.children,r=e.defaultShowTooltip,i=ca(n,gp),o=0,a=0;return e.data&&e.data.length!==0&&(a=e.data.length-1),i&&i.props&&(i.props.startIndex>=0&&(o=i.props.startIndex),i.props.endIndex>=0&&(a=i.props.endIndex)),{chartX:0,chartY:0,dataStartIndex:o,dataEndIndex:a,activeTooltipIndex:-1,isTooltipActive:!!r}},o3t=function(e){return!e||!e.length?!1:e.some(function(n){var r=nu(n&&n.type);return r&&r.indexOf("Bar")>=0})},YK=function(e){return e==="horizontal"?{numericAxisName:"yAxis",cateAxisName:"xAxis"}:e==="vertical"?{numericAxisName:"xAxis",cateAxisName:"yAxis"}:e==="centric"?{numericAxisName:"radiusAxis",cateAxisName:"angleAxis"}:{numericAxisName:"angleAxis",cateAxisName:"radiusAxis"}},a3t=function(e,n){var r=e.props,i=e.graphicalItems,o=e.xAxisMap,a=o===void 0?{}:o,s=e.yAxisMap,l=s===void 0?{}:s,c=r.width,u=r.height,f=r.children,d=r.margin||{},h=ca(f,gp),p=ca(f,bv),m=Object.keys(l).reduce(function(_,S){var O=l[S],C=O.orientation;return!O.mirror&&!O.hide?Be(Be({},_),{},Ct({},C,_[C]+O.width)):_},{left:d.left||0,right:d.right||0}),g=Object.keys(a).reduce(function(_,S){var O=a[S],C=O.orientation;return!O.mirror&&!O.hide?Be(Be({},_),{},Ct({},C,is(_,"".concat(C))+O.height)):_},{top:d.top||0,bottom:d.bottom||0}),v=Be(Be({},g),m),y=v.bottom;h&&(v.bottom+=h.props.height||gp.defaultProps.height),p&&n&&(v=lMt(v,i,r,n));var x=c-v.left-v.right,b=u-v.top-v.bottom;return Be(Be({brushBottom:y},v),{},{width:Math.max(x,0),height:Math.max(b,0)})},s3t=function(e,n){if(n==="xAxis")return e[n].width;if(n==="yAxis")return e[n].height},c6=function(e){var n,r=e.chartName,i=e.GraphicalChild,o=e.defaultTooltipEventType,a=o===void 0?"axis":o,s=e.validateTooltipEventTypes,l=s===void 0?["axis"]:s,c=e.axisComponents,u=e.legendContent,f=e.formatAxisMap,d=e.defaultProps,h=function(g,v){var y=v.graphicalItems,x=v.stackGroups,b=v.offset,_=v.updateId,S=v.dataStartIndex,O=v.dataEndIndex,C=g.barSize,E=g.layout,k=g.barGap,I=g.barCategoryGap,P=g.maxBarSize,R=YK(E),T=R.numericAxisName,L=R.cateAxisName,z=o3t(y),B=[];return y.forEach(function(U,W){var $=Rk(g.data,{graphicalItems:[U],dataStartIndex:S,dataEndIndex:O}),N=U.props,D=N.dataKey,A=N.maxBarSize,q=U.props["".concat(T,"Id")],Y=U.props["".concat(L,"Id")],K={},se=c.reduce(function(ge,ye){var H=v["".concat(ye.axisType,"Map")],G=U.props["".concat(ye.axisType,"Id")];H&&H[G]||ye.axisType==="zAxis"||mp();var ie=H[G];return Be(Be({},ge),{},Ct(Ct({},ye.axisType,ie),"".concat(ye.axisType,"Ticks"),Qc(ie)))},K),te=se[L],J=se["".concat(L,"Ticks")],pe=x&&x[q]&&x[q].hasStack&&wMt(U,x[q].stackGroups),be=nu(U.type).indexOf("Bar")>=0,re=dP(te,J),ve=[],F=z&&aMt({barSize:C,stackGroups:x,totalSize:s3t(se,L)});if(be){var ce,le,Q=Wt(A)?P:A,X=(ce=(le=dP(te,J,!0))!==null&&le!==void 0?le:Q)!==null&&ce!==void 0?ce:0;ve=sMt({barGap:k,barCategoryGap:I,bandSize:X!==re?X:re,sizeList:F[Y],maxBarSize:Q}),X!==re&&(ve=ve.map(function(ge){return Be(Be({},ge),{},{position:Be(Be({},ge.position),{},{offset:ge.position.offset-X/2})})}))}var ee=U&&U.type&&U.type.getComposedData;ee&&B.push({props:Be(Be({},ee(Be(Be({},se),{},{displayedData:$,props:g,dataKey:D,item:U,bandSize:re,barPosition:ve,offset:b,stackedData:pe,layout:E,dataStartIndex:S,dataEndIndex:O}))),{},Ct(Ct(Ct({key:U.key||"item-".concat(W)},T,se[T]),L,se[L]),"animationId",_)),childIndex:mgt(U,g.children),item:U})}),B},p=function(g,v){var y=g.props,x=g.dataStartIndex,b=g.dataEndIndex,_=g.updateId;if(!xX({props:y}))return null;var S=y.children,O=y.layout,C=y.stackOffset,E=y.data,k=y.reverseStackOrder,I=YK(O),P=I.numericAxisName,R=I.cateAxisName,T=os(S,i),L=xMt(E,T,"".concat(P,"Id"),"".concat(R,"Id"),C,k),z=c.reduce(function(N,D){var A="".concat(D.axisType,"Map");return Be(Be({},N),{},Ct({},A,r3t(y,Be(Be({},D),{},{graphicalItems:T,stackGroups:D.axisType===P&&L,dataStartIndex:x,dataEndIndex:b}))))},{}),B=a3t(Be(Be({},z),{},{props:y,graphicalItems:T}),v==null?void 0:v.legendBBox);Object.keys(z).forEach(function(N){z[N]=f(y,z[N],B,N.replace("Map",""),r)});var U=z["".concat(R,"Map")],W=i3t(U),$=h(y,Be(Be({},z),{},{dataStartIndex:x,dataEndIndex:b,updateId:_,graphicalItems:T,stackGroups:L,offset:B}));return Be(Be({formattedGraphicalItems:$,graphicalItems:T,offset:B,stackGroups:L},W),z)};return n=function(m){HLt(g,m);function g(v){var y,x,b;return zLt(this,g),b=VLt(this,g,[v]),Ct(on(b),"eventEmitterSymbol",Symbol("rechartsEventEmitter")),Ct(on(b),"accessibilityManager",new ELt),Ct(on(b),"handleLegendBBoxUpdate",function(_){if(_){var S=b.state,O=S.dataStartIndex,C=S.dataEndIndex,E=S.updateId;b.setState(Be({legendBBox:_},p({props:b.props,dataStartIndex:O,dataEndIndex:C,updateId:E},Be(Be({},b.state),{},{legendBBox:_}))))}}),Ct(on(b),"handleReceiveSyncEvent",function(_,S,O){if(b.props.syncId===_){if(O===b.eventEmitterSymbol&&typeof b.props.syncMethod!="function")return;b.applySyncEvent(S)}}),Ct(on(b),"handleBrushChange",function(_){var S=_.startIndex,O=_.endIndex;if(S!==b.state.dataStartIndex||O!==b.state.dataEndIndex){var C=b.state.updateId;b.setState(function(){return Be({dataStartIndex:S,dataEndIndex:O},p({props:b.props,dataStartIndex:S,dataEndIndex:O,updateId:C},b.state))}),b.triggerSyncEvent({dataStartIndex:S,dataEndIndex:O})}}),Ct(on(b),"handleMouseEnter",function(_){var S=b.getMouseInfo(_);if(S){var O=Be(Be({},S),{},{isTooltipActive:!0});b.setState(O),b.triggerSyncEvent(O);var C=b.props.onMouseEnter;Bt(C)&&C(O,_)}}),Ct(on(b),"triggeredAfterMouseMove",function(_){var S=b.getMouseInfo(_),O=S?Be(Be({},S),{},{isTooltipActive:!0}):{isTooltipActive:!1};b.setState(O),b.triggerSyncEvent(O);var C=b.props.onMouseMove;Bt(C)&&C(O,_)}),Ct(on(b),"handleItemMouseEnter",function(_){b.setState(function(){return{isTooltipActive:!0,activeItem:_,activePayload:_.tooltipPayload,activeCoordinate:_.tooltipPosition||{x:_.cx,y:_.cy}}})}),Ct(on(b),"handleItemMouseLeave",function(){b.setState(function(){return{isTooltipActive:!1}})}),Ct(on(b),"handleMouseMove",function(_){_.persist(),b.throttleTriggeredAfterMouseMove(_)}),Ct(on(b),"handleMouseLeave",function(_){b.throttleTriggeredAfterMouseMove.cancel();var S={isTooltipActive:!1};b.setState(S),b.triggerSyncEvent(S);var O=b.props.onMouseLeave;Bt(O)&&O(S,_)}),Ct(on(b),"handleOuterEvent",function(_){var S=pgt(_),O=is(b.props,"".concat(S));if(S&&Bt(O)){var C,E;/.*touch.*/i.test(S)?E=b.getMouseInfo(_.changedTouches[0]):E=b.getMouseInfo(_),O((C=E)!==null&&C!==void 0?C:{},_)}}),Ct(on(b),"handleClick",function(_){var S=b.getMouseInfo(_);if(S){var O=Be(Be({},S),{},{isTooltipActive:!0});b.setState(O),b.triggerSyncEvent(O);var C=b.props.onClick;Bt(C)&&C(O,_)}}),Ct(on(b),"handleMouseDown",function(_){var S=b.props.onMouseDown;if(Bt(S)){var O=b.getMouseInfo(_);S(O,_)}}),Ct(on(b),"handleMouseUp",function(_){var S=b.props.onMouseUp;if(Bt(S)){var O=b.getMouseInfo(_);S(O,_)}}),Ct(on(b),"handleTouchMove",function(_){_.changedTouches!=null&&_.changedTouches.length>0&&b.throttleTriggeredAfterMouseMove(_.changedTouches[0])}),Ct(on(b),"handleTouchStart",function(_){_.changedTouches!=null&&_.changedTouches.length>0&&b.handleMouseDown(_.changedTouches[0])}),Ct(on(b),"handleTouchEnd",function(_){_.changedTouches!=null&&_.changedTouches.length>0&&b.handleMouseUp(_.changedTouches[0])}),Ct(on(b),"triggerSyncEvent",function(_){b.props.syncId!==void 0&&FI.emit(jI,b.props.syncId,_,b.eventEmitterSymbol)}),Ct(on(b),"applySyncEvent",function(_){var S=b.props,O=S.layout,C=S.syncMethod,E=b.state.updateId,k=_.dataStartIndex,I=_.dataEndIndex;if(_.dataStartIndex!==void 0||_.dataEndIndex!==void 0)b.setState(Be({dataStartIndex:k,dataEndIndex:I},p({props:b.props,dataStartIndex:k,dataEndIndex:I,updateId:E},b.state)));else if(_.activeTooltipIndex!==void 0){var P=_.chartX,R=_.chartY,T=_.activeTooltipIndex,L=b.state,z=L.offset,B=L.tooltipTicks;if(!z)return;if(typeof C=="function")T=C(B,_);else if(C==="value"){T=-1;for(var U=0;U<B.length;U++)if(B[U].value===_.activeLabel){T=U;break}}var W=Be(Be({},z),{},{x:z.left,y:z.top}),$=Math.min(P,W.x+W.width),N=Math.min(R,W.y+W.height),D=B[T]&&B[T].value,A=bF(b.state,b.props.data,T),q=B[T]?{x:O==="horizontal"?B[T].coordinate:$,y:O==="horizontal"?N:B[T].coordinate}:qve;b.setState(Be(Be({},_),{},{activeLabel:D,activeCoordinate:q,activePayload:A,activeTooltipIndex:T}))}else b.setState(_)}),Ct(on(b),"renderCursor",function(_){var S,O=b.state,C=O.isTooltipActive,E=O.activeCoordinate,k=O.activePayload,I=O.offset,P=O.activeTooltipIndex,R=O.tooltipAxisBandSize,T=b.getTooltipEventType(),L=(S=_.props.active)!==null&&S!==void 0?S:C,z=b.props.layout,B=_.key||"_recharts-cursor";return ue.createElement(DLt,{key:B,activeCoordinate:E,activePayload:k,activeTooltipIndex:P,chartName:r,element:_,isActive:L,layout:z,offset:I,tooltipAxisBandSize:R,tooltipEventType:T})}),Ct(on(b),"renderPolarAxis",function(_,S,O){var C=is(_,"type.axisType"),E=is(b.state,"".concat(C,"Map")),k=E&&E[_.props["".concat(C,"Id")]];return M.cloneElement(_,Be(Be({},k),{},{className:ke(C,k.className),key:_.key||"".concat(S,"-").concat(O),ticks:Qc(k,!0)}))}),Ct(on(b),"renderPolarGrid",function(_){var S=_.props,O=S.radialLines,C=S.polarAngles,E=S.polarRadius,k=b.state,I=k.radiusAxisMap,P=k.angleAxisMap,R=gf(I),T=gf(P),L=T.cx,z=T.cy,B=T.innerRadius,U=T.outerRadius;return M.cloneElement(_,{polarAngles:Array.isArray(C)?C:Qc(T,!0).map(function(W){return W.coordinate}),polarRadius:Array.isArray(E)?E:Qc(R,!0).map(function(W){return W.coordinate}),cx:L,cy:z,innerRadius:B,outerRadius:U,key:_.key||"polar-grid",radialLines:O})}),Ct(on(b),"renderLegend",function(){var _=b.state.formattedGraphicalItems,S=b.props,O=S.children,C=S.width,E=S.height,k=b.props.margin||{},I=C-(k.left||0)-(k.right||0),P=Qge({children:O,formattedGraphicalItems:_,legendWidth:I,legendContent:u});if(!P)return null;var R=P.item,T=HK(P,LLt);return M.cloneElement(R,Be(Be({},T),{},{chartWidth:C,chartHeight:E,margin:k,onBBoxUpdate:b.handleLegendBBoxUpdate}))}),Ct(on(b),"renderTooltip",function(){var _,S=b.props,O=S.children,C=S.accessibilityLayer,E=ca(O,yl);if(!E)return null;var k=b.state,I=k.isTooltipActive,P=k.activeCoordinate,R=k.activePayload,T=k.activeLabel,L=k.offset,z=(_=E.props.active)!==null&&_!==void 0?_:I;return M.cloneElement(E,{viewBox:Be(Be({},L),{},{x:L.left,y:L.top}),active:z,label:T,payload:z?R:[],coordinate:P,accessibilityLayer:C})}),Ct(on(b),"renderBrush",function(_){var S=b.props,O=S.margin,C=S.data,E=b.state,k=E.offset,I=E.dataStartIndex,P=E.dataEndIndex,R=E.updateId;return M.cloneElement(_,{key:_.key||"_recharts-brush",onChange:SO(b.handleBrushChange,_.props.onChange),data:C,x:Ye(_.props.x)?_.props.x:k.left,y:Ye(_.props.y)?_.props.y:k.top+k.height+k.brushBottom-(O.bottom||0),width:Ye(_.props.width)?_.props.width:k.width,startIndex:I,endIndex:P,updateId:"brush-".concat(R)})}),Ct(on(b),"renderReferenceElement",function(_,S,O){if(!_)return null;var C=on(b),E=C.clipPathId,k=b.state,I=k.xAxisMap,P=k.yAxisMap,R=k.offset,T=_.props,L=T.xAxisId,z=T.yAxisId;return M.cloneElement(_,{key:_.key||"".concat(S,"-").concat(O),xAxis:I[L],yAxis:P[z],viewBox:{x:R.left,y:R.top,width:R.width,height:R.height},clipPathId:E})}),Ct(on(b),"renderActivePoints",function(_){var S=_.item,O=_.activePoint,C=_.basePoint,E=_.childIndex,k=_.isRange,I=[],P=S.props.key,R=S.item.props,T=R.activeDot,L=R.dataKey,z=Be(Be({index:E,dataKey:L,cx:O.x,cy:O.y,r:4,fill:ZU(S.item),strokeWidth:2,stroke:"#fff",payload:O.payload,value:O.value,key:"".concat(P,"-activePoint-").concat(E)},jt(T,!1)),$E(T));return I.push(g.renderActiveDot(T,z)),C?I.push(g.renderActiveDot(T,Be(Be({},z),{},{cx:C.x,cy:C.y,key:"".concat(P,"-basePoint-").concat(E)}))):k&&I.push(null),I}),Ct(on(b),"renderGraphicChild",function(_,S,O){var C=b.filterFormatItem(_,S,O);if(!C)return null;var E=b.getTooltipEventType(),k=b.state,I=k.isTooltipActive,P=k.tooltipAxis,R=k.activeTooltipIndex,T=k.activeLabel,L=b.props.children,z=ca(L,yl),B=C.props,U=B.points,W=B.isRange,$=B.baseLine,N=C.item.props,D=N.activeDot,A=N.hide,q=N.activeBar,Y=N.activeShape,K=!!(!A&&I&&z&&(D||q||Y)),se={};E!=="axis"&&z&&z.props.trigger==="click"?se={onClick:SO(b.handleItemMouseEnter,_.props.onClick)}:E!=="axis"&&(se={onMouseLeave:SO(b.handleItemMouseLeave,_.props.onMouseLeave),onMouseEnter:SO(b.handleItemMouseEnter,_.props.onMouseEnter)});var te=M.cloneElement(_,Be(Be({},C.props),se));function J(ye){return typeof P.dataKey=="function"?P.dataKey(ye.payload):null}if(K)if(R>=0){var pe,be;if(P.dataKey&&!P.allowDuplicatedCategory){var re=typeof P.dataKey=="function"?J:"payload.".concat(P.dataKey.toString());pe=NE(U,re,T),be=W&&$&&NE($,re,T)}else pe=U==null?void 0:U[R],be=W&&$&&$[R];if(Y||q){var ve=_.props.activeIndex!==void 0?_.props.activeIndex:R;return[M.cloneElement(_,Be(Be(Be({},C.props),se),{},{activeIndex:ve})),null,null]}if(!Wt(pe))return[te].concat(Dv(b.renderActivePoints({item:C,activePoint:pe,basePoint:be,childIndex:R,isRange:W})))}else{var F,ce=(F=b.getItemByXY(b.state.activeCoordinate))!==null&&F!==void 0?F:{graphicalItem:te},le=ce.graphicalItem,Q=le.item,X=Q===void 0?_:Q,ee=le.childIndex,ge=Be(Be(Be({},C.props),se),{},{activeIndex:ee});return[M.cloneElement(X,ge),null,null]}return W?[te,null,null]:[te,null]}),Ct(on(b),"renderCustomized",function(_,S,O){return M.cloneElement(_,Be(Be({key:"recharts-customized-".concat(O)},b.props),b.state))}),Ct(on(b),"renderMap",{CartesianGrid:{handler:PO,once:!0},ReferenceArea:{handler:b.renderReferenceElement},ReferenceLine:{handler:PO},ReferenceDot:{handler:b.renderReferenceElement},XAxis:{handler:PO},YAxis:{handler:PO},Brush:{handler:b.renderBrush,once:!0},Bar:{handler:b.renderGraphicChild},Line:{handler:b.renderGraphicChild},Area:{handler:b.renderGraphicChild},Radar:{handler:b.renderGraphicChild},RadialBar:{handler:b.renderGraphicChild},Scatter:{handler:b.renderGraphicChild},Pie:{handler:b.renderGraphicChild},Funnel:{handler:b.renderGraphicChild},Tooltip:{handler:b.renderCursor,once:!0},PolarGrid:{handler:b.renderPolarGrid,once:!0},PolarAngleAxis:{handler:b.renderPolarAxis},PolarRadiusAxis:{handler:b.renderPolarAxis},Customized:{handler:b.renderCustomized}}),b.clipPathId="".concat((y=v.id)!==null&&y!==void 0?y:jy("recharts"),"-clip"),b.throttleTriggeredAfterMouseMove=Yme(b.triggeredAfterMouseMove,(x=v.throttleDelay)!==null&&x!==void 0?x:1e3/60),b.state={},b}return WLt(g,[{key:"componentDidMount",value:function(){var y,x;this.addListener(),this.accessibilityManager.setDetails({container:this.container,offset:{left:(y=this.props.margin.left)!==null&&y!==void 0?y:0,top:(x=this.props.margin.top)!==null&&x!==void 0?x:0},coordinateList:this.state.tooltipTicks,mouseHandlerCallback:this.triggeredAfterMouseMove,layout:this.props.layout}),this.displayDefaultTooltip()}},{key:"displayDefaultTooltip",value:function(){var y=this.props,x=y.children,b=y.data,_=y.height,S=y.layout,O=ca(x,yl);if(O){var C=O.props.defaultIndex;if(!(typeof C!="number"||C<0||C>this.state.tooltipTicks.length)){var E=this.state.tooltipTicks[C]&&this.state.tooltipTicks[C].value,k=bF(this.state,b,C,E),I=this.state.tooltipTicks[C].coordinate,P=(this.state.offset.top+_)/2,R=S==="horizontal",T=R?{x:I,y:P}:{y:I,x:P},L=this.state.formattedGraphicalItems.find(function(B){var U=B.item;return U.type.name==="Scatter"});L&&(T=Be(Be({},T),L.props.points[C].tooltipPosition),k=L.props.points[C].tooltipPayload);var z={activeTooltipIndex:C,isTooltipActive:!0,activeLabel:E,activePayload:k,activeCoordinate:T};this.setState(z),this.renderCursor(O),this.accessibilityManager.setIndex(C)}}}},{key:"getSnapshotBeforeUpdate",value:function(y,x){if(!this.props.accessibilityLayer)return null;if(this.state.tooltipTicks!==x.tooltipTicks&&this.accessibilityManager.setDetails({coordinateList:this.state.tooltipTicks}),this.props.layout!==y.layout&&this.accessibilityManager.setDetails({layout:this.props.layout}),this.props.margin!==y.margin){var b,_;this.accessibilityManager.setDetails({offset:{left:(b=this.props.margin.left)!==null&&b!==void 0?b:0,top:(_=this.props.margin.top)!==null&&_!==void 0?_:0}})}return null}},{key:"componentDidUpdate",value:function(y){r$([ca(y.children,yl)],[ca(this.props.children,yl)])||this.displayDefaultTooltip()}},{key:"componentWillUnmount",value:function(){this.removeListener(),this.throttleTriggeredAfterMouseMove.cancel()}},{key:"getTooltipEventType",value:function(){var y=ca(this.props.children,yl);if(y&&typeof y.props.shared=="boolean"){var x=y.props.shared?"axis":"item";return l.indexOf(x)>=0?x:a}return a}},{key:"getMouseInfo",value:function(y){if(!this.container)return null;var x=this.container,b=x.getBoundingClientRect(),_=jOt(b),S={chartX:Math.round(y.pageX-_.left),chartY:Math.round(y.pageY-_.top)},O=b.width/x.offsetWidth||1,C=this.inRange(S.chartX,S.chartY,O);if(!C)return null;var E=this.state,k=E.xAxisMap,I=E.yAxisMap,P=this.getTooltipEventType();if(P!=="axis"&&k&&I){var R=gf(k).scale,T=gf(I).scale,L=R&&R.invert?R.invert(S.chartX):null,z=T&&T.invert?T.invert(S.chartY):null;return Be(Be({},S),{},{xValue:L,yValue:z})}var B=XK(this.state,this.props.data,this.props.layout,C);return B?Be(Be({},S),B):null}},{key:"inRange",value:function(y,x){var b=arguments.length>2&&arguments[2]!==void 0?arguments[2]:1,_=this.props.layout,S=y/b,O=x/b;if(_==="horizontal"||_==="vertical"){var C=this.state.offset,E=S>=C.left&&S<=C.left+C.width&&O>=C.top&&O<=C.top+C.height;return E?{x:S,y:O}:null}var k=this.state,I=k.angleAxisMap,P=k.radiusAxisMap;if(I&&P){var R=gf(I);return PY({x:S,y:O},R)}return null}},{key:"parseEventsOfWrapper",value:function(){var y=this.props.children,x=this.getTooltipEventType(),b=ca(y,yl),_={};b&&x==="axis"&&(b.props.trigger==="click"?_={onClick:this.handleClick}:_={onMouseEnter:this.handleMouseEnter,onMouseMove:this.handleMouseMove,onMouseLeave:this.handleMouseLeave,onTouchMove:this.handleTouchMove,onTouchStart:this.handleTouchStart,onTouchEnd:this.handleTouchEnd});var S=$E(this.props,this.handleOuterEvent);return Be(Be({},S),_)}},{key:"addListener",value:function(){FI.on(jI,this.handleReceiveSyncEvent)}},{key:"removeListener",value:function(){FI.removeListener(jI,this.handleReceiveSyncEvent)}},{key:"filterFormatItem",value:function(y,x,b){for(var _=this.state.formattedGraphicalItems,S=0,O=_.length;S<O;S++){var C=_[S];if(C.item===y||C.props.key===y.key||x===nu(C.item.type)&&b===C.childIndex)return C}return null}},{key:"renderClipPath",value:function(){var y=this.clipPathId,x=this.state.offset,b=x.left,_=x.top,S=x.height,O=x.width;return ue.createElement("defs",null,ue.createElement("clipPath",{id:y},ue.createElement("rect",{x:b,y:_,height:S,width:O})))}},{key:"getXScales",value:function(){var y=this.state.xAxisMap;return y?Object.entries(y).reduce(function(x,b){var _=GK(b,2),S=_[0],O=_[1];return Be(Be({},x),{},Ct({},S,O.scale))},{}):null}},{key:"getYScales",value:function(){var y=this.state.yAxisMap;return y?Object.entries(y).reduce(function(x,b){var _=GK(b,2),S=_[0],O=_[1];return Be(Be({},x),{},Ct({},S,O.scale))},{}):null}},{key:"getXScaleByAxisId",value:function(y){var x;return(x=this.state.xAxisMap)===null||x===void 0||(x=x[y])===null||x===void 0?void 0:x.scale}},{key:"getYScaleByAxisId",value:function(y){var x;return(x=this.state.yAxisMap)===null||x===void 0||(x=x[y])===null||x===void 0?void 0:x.scale}},{key:"getItemByXY",value:function(y){var x=this.state,b=x.formattedGraphicalItems,_=x.activeItem;if(b&&b.length)for(var S=0,O=b.length;S<O;S++){var C=b[S],E=C.props,k=C.item,I=nu(k.type);if(I==="Bar"){var P=(E.data||[]).find(function(z){return Zkt(y,z)});if(P)return{graphicalItem:C,payload:P}}else if(I==="RadialBar"){var R=(E.data||[]).find(function(z){return PY(y,z)});if(R)return{graphicalItem:C,payload:R}}else if(Mk(C,_)||kk(C,_)||Q_(C,_)){var T=tRt({graphicalItem:C,activeTooltipItem:_,itemData:k.props.data}),L=k.props.activeIndex===void 0?T:k.props.activeIndex;return{graphicalItem:Be(Be({},C),{},{childIndex:L}),payload:Q_(C,_)?k.props.data[T]:C.props.data[T]}}}return null}},{key:"render",value:function(){var y=this;if(!xX(this))return null;var x=this.props,b=x.children,_=x.className,S=x.width,O=x.height,C=x.style,E=x.compact,k=x.title,I=x.desc,P=HK(x,NLt),R=jt(P,!1);if(E)return ue.createElement(TK,{state:this.state,width:this.props.width,height:this.props.height,clipPathId:this.clipPathId},ue.createElement(o$,ub({},R,{width:S,height:O,title:k,desc:I}),this.renderClipPath(),_X(b,this.renderMap)));if(this.props.accessibilityLayer){var T,L;R.tabIndex=(T=this.props.tabIndex)!==null&&T!==void 0?T:0,R.role=(L=this.props.role)!==null&&L!==void 0?L:"application",R.onKeyDown=function(B){y.accessibilityManager.keyboardEvent(B)},R.onFocus=function(){y.accessibilityManager.focus()}}var z=this.parseEventsOfWrapper();return ue.createElement(TK,{state:this.state,width:this.props.width,height:this.props.height,clipPathId:this.clipPathId},ue.createElement("div",ub({className:ke("recharts-wrapper",_),style:Be({position:"relative",cursor:"default",width:S,height:O},C)},z,{ref:function(U){y.container=U}}),ue.createElement(o$,ub({},R,{width:S,height:O,title:k,desc:I,style:ZLt}),this.renderClipPath(),_X(b,this.renderMap)),this.renderLegend(),this.renderTooltip()))}}]),g}(M.Component),Ct(n,"displayName",r),Ct(n,"defaultProps",Be({layout:"horizontal",stackOffset:"none",barCategoryGap:"10%",barGap:4,margin:{top:5,right:5,bottom:5,left:5},reverseStackOrder:!1,syncMethod:"index"},d)),Ct(n,"getDerivedStateFromProps",function(m,g){var v=m.dataKey,y=m.data,x=m.children,b=m.width,_=m.height,S=m.layout,O=m.stackOffset,C=m.margin,E=g.dataStartIndex,k=g.dataEndIndex;if(g.updateId===void 0){var I=QK(m);return Be(Be(Be({},I),{},{updateId:0},p(Be(Be({props:m},I),{},{updateId:0}),g)),{},{prevDataKey:v,prevData:y,prevWidth:b,prevHeight:_,prevLayout:S,prevStackOffset:O,prevMargin:C,prevChildren:x})}if(v!==g.prevDataKey||y!==g.prevData||b!==g.prevWidth||_!==g.prevHeight||S!==g.prevLayout||O!==g.prevStackOffset||!Ng(C,g.prevMargin)){var P=QK(m),R={chartX:g.chartX,chartY:g.chartY,isTooltipActive:g.isTooltipActive},T=Be(Be({},XK(g,y,S)),{},{updateId:g.updateId+1}),L=Be(Be(Be({},P),R),T);return Be(Be(Be({},L),p(Be({props:m},L),g)),{},{prevDataKey:v,prevData:y,prevWidth:b,prevHeight:_,prevLayout:S,prevStackOffset:O,prevMargin:C,prevChildren:x})}if(!r$(x,g.prevChildren)){var z,B,U,W,$=ca(x,gp),N=$&&(z=(B=$.props)===null||B===void 0?void 0:B.startIndex)!==null&&z!==void 0?z:E,D=$&&(U=(W=$.props)===null||W===void 0?void 0:W.endIndex)!==null&&U!==void 0?U:k,A=N!==E||D!==k,q=!Wt(y),Y=q&&!A?g.updateId:g.updateId+1;return Be(Be({updateId:Y},p(Be(Be({props:m},g),{},{updateId:Y,dataStartIndex:N,dataEndIndex:D}),g)),{},{prevChildren:x,dataStartIndex:N,dataEndIndex:D})}return null}),Ct(n,"renderActiveDot",function(m,g){var v;return M.isValidElement(m)?v=M.cloneElement(m,g):Bt(m)?v=m(g):v=ue.createElement(Pk,g),ue.createElement(Gn,{className:"recharts-active-dot",key:g.key},v)}),n},l3t=c6({chartName:"LineChart",GraphicalChild:Dw,axisComponents:[{axisType:"xAxis",AxisComp:Vp},{axisType:"yAxis",AxisComp:Gp}],formatAxisMap:e6}),c3t=c6({chartName:"BarChart",GraphicalChild:Up,defaultTooltipEventType:"axis",validateTooltipEventTypes:["axis","item"],axisComponents:[{axisType:"xAxis",AxisComp:Vp},{axisType:"yAxis",AxisComp:Gp}],formatAxisMap:e6}),u3t=c6({chartName:"AreaChart",GraphicalChild:Dd,axisComponents:[{axisType:"xAxis",AxisComp:Vp},{axisType:"yAxis",AxisComp:Gp}],formatAxisMap:e6});const f3t=t=>!En(t)||!Number.isFinite(t)?"":Qb(t),d3t=t=>t.toPrecision(3),zI={legendContainer:{display:"flex",justifyContent:"center",columnGap:"12px",flexWrap:"wrap"},legendItem:{display:"flex",alignItems:"center"},legendCloseIcon:{marginLeft:"4px",cursor:"pointer",display:"flex",alignItems:"center"}};function h3t({payload:t,removeTimeSeries:e}){return!t||t.length===0?null:w.jsx(Ke,{sx:zI.legendContainer,children:t.map((n,r)=>w.jsxs(Ke,{sx:{...zI.legendItem,color:n.color},children:[w.jsx("span",{children:n.value}),e&&w.jsx(Ke,{component:"span",sx:zI.legendCloseIcon,onMouseUp:()=>e(r),children:w.jsx(lw,{fontSize:"small"})})]},n.value))})}const UI={toolTipContainer:t=>({backgroundColor:"black",opacity:.8,color:"white",border:"2px solid black",borderRadius:t.spacing(2),padding:t.spacing(1.5)}),toolTipValue:{fontWeight:"bold"},toolTipLabel:t=>({fontWeight:"bold",paddingBottom:t.spacing(1)})},p3t="#00000000",m3t="#FAFFDD";function g3t({active:t,label:e,payload:n}){if(!t||!En(e)||!n||n.length===0)return null;const r=n.map((i,o)=>{const{name:a,value:s,unit:l,dataKey:c}=i;let u=i.color;if(!En(s))return null;const f=a||"?",d=s.toFixed(3);u===p3t&&(u=m3t);let p=f.indexOf(":")!==-1?"":` (${c})`;return typeof l=="string"&&(p!==""?p=`${l} ${p}`:p=l),w.jsxs("div",{children:[w.jsxs("span",{children:[f,": "]}),w.jsx(Ke,{component:"span",sx:UI.toolTipValue,style:{color:u},children:d}),w.jsxs("span",{children:[" ",p]})]},o)});return r?w.jsxs(Ke,{sx:UI.toolTipContainer,children:[w.jsx(Ke,{component:"span",sx:UI.toolTipLabel,children:`${gy(e)} UTC`}),r]}):null}function KK({cx:t,cy:e,radius:n,stroke:r,fill:i,strokeWidth:o,symbol:a}){const l=n+.5*o,c=2*l,u=Math.floor(100*o/c+.5)+"%";let f;if(a==="diamond"){const m=1024*(n/c);f=w.jsx("polygon",{points:`${512-m},512 512,${512-m} ${512+m},512 512,${512+m}`,strokeWidth:u,stroke:r,fill:i})}else{const d=Math.floor(100*n/c+.5)+"%";f=w.jsx("circle",{cx:"50%",cy:"50%",r:d,strokeWidth:u,stroke:r,fill:i})}return En(t)&&En(e)?w.jsx("svg",{x:t-l,y:e-l,width:c,height:c,viewBox:"0 0 1024 1024",children:f}):null}function v3t({timeSeriesGroup:t,timeSeriesIndex:e,selectTimeSeries:n,places:r,selectPlace:i,placeInfos:o,placeGroupTimeSeries:a,paletteMode:s,chartType:l,stdevBars:c}){const u=t.timeSeriesArray[e],f=u.source,d=()=>{n&&n(t.id,e,u),i(u.source.placeId,r,!0)};let h=f.variableName,p="red";if(f.placeId===null){h=`${f.datasetTitle}/${h}`;let x=null;a.forEach(b=>{if(x===null&&b.placeGroup.id===f.datasetId){const _=b.placeGroup.features;_.length>0&&_[0].properties&&(x=_[0].properties.color||null)}}),p=x||"red"}else if(o){const x=o[f.placeId];if(x){const{place:b,label:_,color:S}=x;if(b.geometry.type==="Point"){const O=b.geometry.coordinates[0],C=b.geometry.coordinates[1];h+=` (${_}: ${C.toFixed(5)},${O.toFixed(5)})`}else h+=` (${_})`;p=S}}const m=die(p,s);let g,v;u.source.placeId===null?(g=0,v={radius:5,strokeWidth:1.5,symbol:"diamond"}):(g=l==="point"?0:u.dataProgress,v={radius:3,strokeWidth:2,symbol:"circle"});const y=c&&f.valueDataKey&&f.errorDataKey&&w.jsx(Hy,{dataKey:`ev${e}`,width:4,strokeWidth:1,stroke:m,strokeOpacity:.5});return l==="bar"?w.jsx(Up,{type:"monotone",name:h,unit:f.variableUnits,dataKey:`v${e}`,fill:m,fillOpacity:g,isAnimationActive:!1,onClick:d,children:y},e):w.jsx(Dw,{type:"monotone",name:h,unit:f.variableUnits,dataKey:`v${e}`,dot:w.jsx(KK,{...v,stroke:m,fill:"white"}),activeDot:w.jsx(KK,{...v,stroke:"white",fill:m}),stroke:m,strokeOpacity:g,isAnimationActive:!1,onClick:d,children:y},e)}var u6={},y3t=ft;Object.defineProperty(u6,"__esModule",{value:!0});var Qve=u6.default=void 0,x3t=y3t(pt()),b3t=w;Qve=u6.default=(0,x3t.default)((0,b3t.jsx)("path",{d:"M19 12h-2v3h-3v2h5zM7 9h3V7H5v5h2zm14-6H3c-1.1 0-2 .9-2 2v14c0 1.1.9 2 2 2h18c1.1 0 2-.9 2-2V5c0-1.1-.9-2-2-2m0 16.01H3V4.99h18z"}),"AspectRatio");var f6={},_3t=ft;Object.defineProperty(f6,"__esModule",{value:!0});var Yve=f6.default=void 0,w3t=_3t(pt()),S3t=w;Yve=f6.default=(0,w3t.default)((0,S3t.jsx)("path",{d:"M4 9h4v11H4zm12 4h4v7h-4zm-6-9h4v16h-4z"}),"BarChart");var d6={},O3t=ft;Object.defineProperty(d6,"__esModule",{value:!0});var Kve=d6.default=void 0,C3t=O3t(pt()),T3t=w;Kve=d6.default=(0,C3t.default)((0,T3t.jsx)("path",{d:"M21.99 4c0-1.1-.89-2-1.99-2H4c-1.1 0-2 .9-2 2v12c0 1.1.9 2 2 2h14l4 4zM18 14H6v-2h12zm0-3H6V9h12zm0-3H6V6h12z"}),"Comment");var h6={},E3t=ft;Object.defineProperty(h6,"__esModule",{value:!0});var Zve=h6.default=void 0,P3t=E3t(pt()),M3t=w;Zve=h6.default=(0,P3t.default)((0,M3t.jsx)("path",{d:"M4 20h16v2H4zM4 2h16v2H4zm9 7h3l-4-4-4 4h3v6H8l4 4 4-4h-3z"}),"Expand");var p6={},k3t=ft;Object.defineProperty(p6,"__esModule",{value:!0});var Jve=p6.default=void 0,A3t=k3t(pt()),R3t=w;Jve=p6.default=(0,A3t.default)((0,R3t.jsx)("path",{d:"M17 4h3c1.1 0 2 .9 2 2v2h-2V6h-3zM4 8V6h3V4H4c-1.1 0-2 .9-2 2v2zm16 8v2h-3v2h3c1.1 0 2-.9 2-2v-2zM7 18H4v-2H2v2c0 1.1.9 2 2 2h3zM18 8H6v8h12z"}),"FitScreen");var m6={},I3t=ft;Object.defineProperty(m6,"__esModule",{value:!0});var g6=m6.default=void 0,D3t=I3t(pt()),L3t=w;g6=m6.default=(0,D3t.default)((0,L3t.jsx)("path",{d:"M19 3H5c-1.1 0-2 .9-2 2v14c0 1.1.9 2 2 2h14c1.1 0 2-.9 2-2V5c0-1.1-.9-2-2-2M5.5 7.5h2v-2H9v2h2V9H9v2H7.5V9h-2zM19 19H5L19 5zm-2-2v-1.5h-5V17z"}),"Iso");var v6={},N3t=ft;Object.defineProperty(v6,"__esModule",{value:!0});var eye=v6.default=void 0,$3t=N3t(pt()),WI=w;eye=v6.default=(0,$3t.default)([(0,WI.jsx)("circle",{cx:"7",cy:"14",r:"3"},"0"),(0,WI.jsx)("circle",{cx:"11",cy:"6",r:"3"},"1"),(0,WI.jsx)("circle",{cx:"16.6",cy:"17.6",r:"3"},"2")],"ScatterPlot");var y6={},F3t=ft;Object.defineProperty(y6,"__esModule",{value:!0});var tye=y6.default=void 0,j3t=F3t(pt()),B3t=w;tye=y6.default=(0,j3t.default)((0,B3t.jsx)("path",{d:"m3.5 18.49 6-6.01 4 4L22 6.92l-1.41-1.41-7.09 7.97-4-4L2 16.99z"}),"ShowChart");var x6={},z3t=ft;Object.defineProperty(x6,"__esModule",{value:!0});var nye=x6.default=void 0,U3t=z3t(pt()),ZK=w;nye=x6.default=(0,U3t.default)([(0,ZK.jsx)("circle",{cx:"12",cy:"12",r:"3.2"},"0"),(0,ZK.jsx)("path",{d:"M9 2 7.17 4H4c-1.1 0-2 .9-2 2v12c0 1.1.9 2 2 2h16c1.1 0 2-.9 2-2V6c0-1.1-.9-2-2-2h-3.17L15 2zm3 15c-2.76 0-5-2.24-5-5s2.24-5 5-5 5 2.24 5 5-2.24 5-5 5"},"1")],"CameraAlt");function W3t(t,e){if(t.match(/^[a-z]+:\/\//i))return t;if(t.match(/^\/\//))return window.location.protocol+t;if(t.match(/^[a-z]+:/i))return t;const n=document.implementation.createHTMLDocument(),r=n.createElement("base"),i=n.createElement("a");return n.head.appendChild(r),n.body.appendChild(i),e&&(r.href=e),i.href=t,i.href}const V3t=(()=>{let t=0;const e=()=>`0000${(Math.random()*36**4<<0).toString(36)}`.slice(-4);return()=>(t+=1,`u${e()}${t}`)})();function au(t){const e=[];for(let n=0,r=t.length;n<r;n++)e.push(t[n]);return e}function AP(t,e){const r=(t.ownerDocument.defaultView||window).getComputedStyle(t).getPropertyValue(e);return r?parseFloat(r.replace("px","")):0}function G3t(t){const e=AP(t,"border-left-width"),n=AP(t,"border-right-width");return t.clientWidth+e+n}function H3t(t){const e=AP(t,"border-top-width"),n=AP(t,"border-bottom-width");return t.clientHeight+e+n}function rye(t,e={}){const n=e.width||G3t(t),r=e.height||H3t(t);return{width:n,height:r}}function q3t(){let t,e;try{e=process}catch{}const n=e&&e.env?e.env.devicePixelRatio:null;return n&&(t=parseInt(n,10),Number.isNaN(t)&&(t=1)),t||window.devicePixelRatio||1}const Zo=16384;function X3t(t){(t.width>Zo||t.height>Zo)&&(t.width>Zo&&t.height>Zo?t.width>t.height?(t.height*=Zo/t.width,t.width=Zo):(t.width*=Zo/t.height,t.height=Zo):t.width>Zo?(t.height*=Zo/t.width,t.width=Zo):(t.width*=Zo/t.height,t.height=Zo))}function RP(t){return new Promise((e,n)=>{const r=new Image;r.decode=()=>e(r),r.onload=()=>e(r),r.onerror=n,r.crossOrigin="anonymous",r.decoding="async",r.src=t})}async function Q3t(t){return Promise.resolve().then(()=>new XMLSerializer().serializeToString(t)).then(encodeURIComponent).then(e=>`data:image/svg+xml;charset=utf-8,${e}`)}async function Y3t(t,e,n){const r="http://www.w3.org/2000/svg",i=document.createElementNS(r,"svg"),o=document.createElementNS(r,"foreignObject");return i.setAttribute("width",`${e}`),i.setAttribute("height",`${n}`),i.setAttribute("viewBox",`0 0 ${e} ${n}`),o.setAttribute("width","100%"),o.setAttribute("height","100%"),o.setAttribute("x","0"),o.setAttribute("y","0"),o.setAttribute("externalResourcesRequired","true"),i.appendChild(o),o.appendChild(t),Q3t(i)}const Bo=(t,e)=>{if(t instanceof e)return!0;const n=Object.getPrototypeOf(t);return n===null?!1:n.constructor.name===e.name||Bo(n,e)};function K3t(t){const e=t.getPropertyValue("content");return`${t.cssText} content: '${e.replace(/'|"/g,"")}';`}function Z3t(t){return au(t).map(e=>{const n=t.getPropertyValue(e),r=t.getPropertyPriority(e);return`${e}: ${n}${r?" !important":""};`}).join(" ")}function J3t(t,e,n){const r=`.${t}:${e}`,i=n.cssText?K3t(n):Z3t(n);return document.createTextNode(`${r}{${i}}`)}function JK(t,e,n){const r=window.getComputedStyle(t,n),i=r.getPropertyValue("content");if(i===""||i==="none")return;const o=V3t();try{e.className=`${e.className} ${o}`}catch{return}const a=document.createElement("style");a.appendChild(J3t(o,n,r)),e.appendChild(a)}function eNt(t,e){JK(t,e,":before"),JK(t,e,":after")}const eZ="application/font-woff",tZ="image/jpeg",tNt={woff:eZ,woff2:eZ,ttf:"application/font-truetype",eot:"application/vnd.ms-fontobject",png:"image/png",jpg:tZ,jpeg:tZ,gif:"image/gif",tiff:"image/tiff",svg:"image/svg+xml",webp:"image/webp"};function nNt(t){const e=/\.([^./]*?)$/g.exec(t);return e?e[1]:""}function b6(t){const e=nNt(t).toLowerCase();return tNt[e]||""}function rNt(t){return t.split(/,/)[1]}function _F(t){return t.search(/^(data:)/)!==-1}function iNt(t,e){return`data:${e};base64,${t}`}async function iye(t,e,n){const r=await fetch(t,e);if(r.status===404)throw new Error(`Resource "${r.url}" not found`);const i=await r.blob();return new Promise((o,a)=>{const s=new FileReader;s.onerror=a,s.onloadend=()=>{try{o(n({res:r,result:s.result}))}catch(l){a(l)}},s.readAsDataURL(i)})}const VI={};function oNt(t,e,n){let r=t.replace(/\?.*/,"");return n&&(r=t),/ttf|otf|eot|woff2?/i.test(r)&&(r=r.replace(/.*\//,"")),e?`[${e}]${r}`:r}async function _6(t,e,n){const r=oNt(t,e,n.includeQueryParams);if(VI[r]!=null)return VI[r];n.cacheBust&&(t+=(/\?/.test(t)?"&":"?")+new Date().getTime());let i;try{const o=await iye(t,n.fetchRequestInit,({res:a,result:s})=>(e||(e=a.headers.get("Content-Type")||""),rNt(s)));i=iNt(o,e)}catch(o){i=n.imagePlaceholder||"";let a=`Failed to fetch resource: ${t}`;o&&(a=typeof o=="string"?o:o.message),a&&console.warn(a)}return VI[r]=i,i}async function aNt(t){const e=t.toDataURL();return e==="data:,"?t.cloneNode(!1):RP(e)}async function sNt(t,e){if(t.currentSrc){const o=document.createElement("canvas"),a=o.getContext("2d");o.width=t.clientWidth,o.height=t.clientHeight,a==null||a.drawImage(t,0,0,o.width,o.height);const s=o.toDataURL();return RP(s)}const n=t.poster,r=b6(n),i=await _6(n,r,e);return RP(i)}async function lNt(t){var e;try{if(!((e=t==null?void 0:t.contentDocument)===null||e===void 0)&&e.body)return await Ik(t.contentDocument.body,{},!0)}catch{}return t.cloneNode(!1)}async function cNt(t,e){return Bo(t,HTMLCanvasElement)?aNt(t):Bo(t,HTMLVideoElement)?sNt(t,e):Bo(t,HTMLIFrameElement)?lNt(t):t.cloneNode(!1)}const uNt=t=>t.tagName!=null&&t.tagName.toUpperCase()==="SLOT";async function fNt(t,e,n){var r,i;let o=[];return uNt(t)&&t.assignedNodes?o=au(t.assignedNodes()):Bo(t,HTMLIFrameElement)&&(!((r=t.contentDocument)===null||r===void 0)&&r.body)?o=au(t.contentDocument.body.childNodes):o=au(((i=t.shadowRoot)!==null&&i!==void 0?i:t).childNodes),o.length===0||Bo(t,HTMLVideoElement)||await o.reduce((a,s)=>a.then(()=>Ik(s,n)).then(l=>{l&&e.appendChild(l)}),Promise.resolve()),e}function dNt(t,e){const n=e.style;if(!n)return;const r=window.getComputedStyle(t);r.cssText?(n.cssText=r.cssText,n.transformOrigin=r.transformOrigin):au(r).forEach(i=>{let o=r.getPropertyValue(i);i==="font-size"&&o.endsWith("px")&&(o=`${Math.floor(parseFloat(o.substring(0,o.length-2)))-.1}px`),Bo(t,HTMLIFrameElement)&&i==="display"&&o==="inline"&&(o="block"),i==="d"&&e.getAttribute("d")&&(o=`path(${e.getAttribute("d")})`),n.setProperty(i,o,r.getPropertyPriority(i))})}function hNt(t,e){Bo(t,HTMLTextAreaElement)&&(e.innerHTML=t.value),Bo(t,HTMLInputElement)&&e.setAttribute("value",t.value)}function pNt(t,e){if(Bo(t,HTMLSelectElement)){const n=e,r=Array.from(n.children).find(i=>t.value===i.getAttribute("value"));r&&r.setAttribute("selected","")}}function mNt(t,e){return Bo(e,Element)&&(dNt(t,e),eNt(t,e),hNt(t,e),pNt(t,e)),e}async function gNt(t,e){const n=t.querySelectorAll?t.querySelectorAll("use"):[];if(n.length===0)return t;const r={};for(let o=0;o<n.length;o++){const s=n[o].getAttribute("xlink:href");if(s){const l=t.querySelector(s),c=document.querySelector(s);!l&&c&&!r[s]&&(r[s]=await Ik(c,e,!0))}}const i=Object.values(r);if(i.length){const o="http://www.w3.org/1999/xhtml",a=document.createElementNS(o,"svg");a.setAttribute("xmlns",o),a.style.position="absolute",a.style.width="0",a.style.height="0",a.style.overflow="hidden",a.style.display="none";const s=document.createElementNS(o,"defs");a.appendChild(s);for(let l=0;l<i.length;l++)s.appendChild(i[l]);t.appendChild(a)}return t}async function Ik(t,e,n){return!n&&e.filter&&!e.filter(t)?null:Promise.resolve(t).then(r=>cNt(r,e)).then(r=>fNt(t,r,e)).then(r=>mNt(t,r)).then(r=>gNt(r,e))}const oye=/url\((['"]?)([^'"]+?)\1\)/g,vNt=/url\([^)]+\)\s*format\((["']?)([^"']+)\1\)/g,yNt=/src:\s*(?:url\([^)]+\)\s*format\([^)]+\)[,;]\s*)+/g;function xNt(t){const e=t.replace(/([.*+?^${}()|\[\]\/\\])/g,"\\$1");return new RegExp(`(url\\(['"]?)(${e})(['"]?\\))`,"g")}function bNt(t){const e=[];return t.replace(oye,(n,r,i)=>(e.push(i),n)),e.filter(n=>!_F(n))}async function _Nt(t,e,n,r,i){try{const o=n?W3t(e,n):e,a=b6(e);let s;return i||(s=await _6(o,a,r)),t.replace(xNt(e),`$1${s}$3`)}catch{}return t}function wNt(t,{preferredFontFormat:e}){return e?t.replace(yNt,n=>{for(;;){const[r,,i]=vNt.exec(n)||[];if(!i)return"";if(i===e)return`src: ${r};`}}):t}function aye(t){return t.search(oye)!==-1}async function sye(t,e,n){if(!aye(t))return t;const r=wNt(t,n);return bNt(r).reduce((o,a)=>o.then(s=>_Nt(s,a,e,n)),Promise.resolve(r))}async function MO(t,e,n){var r;const i=(r=e.style)===null||r===void 0?void 0:r.getPropertyValue(t);if(i){const o=await sye(i,null,n);return e.style.setProperty(t,o,e.style.getPropertyPriority(t)),!0}return!1}async function SNt(t,e){await MO("background",t,e)||await MO("background-image",t,e),await MO("mask",t,e)||await MO("mask-image",t,e)}async function ONt(t,e){const n=Bo(t,HTMLImageElement);if(!(n&&!_F(t.src))&&!(Bo(t,SVGImageElement)&&!_F(t.href.baseVal)))return;const r=n?t.src:t.href.baseVal,i=await _6(r,b6(r),e);await new Promise((o,a)=>{t.onload=o,t.onerror=a;const s=t;s.decode&&(s.decode=o),s.loading==="lazy"&&(s.loading="eager"),n?(t.srcset="",t.src=i):t.href.baseVal=i})}async function CNt(t,e){const r=au(t.childNodes).map(i=>lye(i,e));await Promise.all(r).then(()=>t)}async function lye(t,e){Bo(t,Element)&&(await SNt(t,e),await ONt(t,e),await CNt(t,e))}function TNt(t,e){const{style:n}=t;e.backgroundColor&&(n.backgroundColor=e.backgroundColor),e.width&&(n.width=`${e.width}px`),e.height&&(n.height=`${e.height}px`);const r=e.style;return r!=null&&Object.keys(r).forEach(i=>{n[i]=r[i]}),t}const nZ={};async function rZ(t){let e=nZ[t];if(e!=null)return e;const r=await(await fetch(t)).text();return e={url:t,cssText:r},nZ[t]=e,e}async function iZ(t,e){let n=t.cssText;const r=/url\(["']?([^"')]+)["']?\)/g,o=(n.match(/url\([^)]+\)/g)||[]).map(async a=>{let s=a.replace(r,"$1");return s.startsWith("https://")||(s=new URL(s,t.url).href),iye(s,e.fetchRequestInit,({result:l})=>(n=n.replace(a,`url(${l})`),[a,l]))});return Promise.all(o).then(()=>n)}function oZ(t){if(t==null)return[];const e=[],n=/(\/\*[\s\S]*?\*\/)/gi;let r=t.replace(n,"");const i=new RegExp("((@.*?keyframes [\\s\\S]*?){([\\s\\S]*?}\\s*?)})","gi");for(;;){const l=i.exec(r);if(l===null)break;e.push(l[0])}r=r.replace(i,"");const o=/@import[\s\S]*?url\([^)]*\)[\s\S]*?;/gi,a="((\\s*?(?:\\/\\*[\\s\\S]*?\\*\\/)?\\s*?@media[\\s\\S]*?){([\\s\\S]*?)}\\s*?})|(([\\s\\S]*?){([\\s\\S]*?)})",s=new RegExp(a,"gi");for(;;){let l=o.exec(r);if(l===null){if(l=s.exec(r),l===null)break;o.lastIndex=s.lastIndex}else s.lastIndex=o.lastIndex;e.push(l[0])}return e}async function ENt(t,e){const n=[],r=[];return t.forEach(i=>{if("cssRules"in i)try{au(i.cssRules||[]).forEach((o,a)=>{if(o.type===CSSRule.IMPORT_RULE){let s=a+1;const l=o.href,c=rZ(l).then(u=>iZ(u,e)).then(u=>oZ(u).forEach(f=>{try{i.insertRule(f,f.startsWith("@import")?s+=1:i.cssRules.length)}catch(d){console.error("Error inserting rule from remote css",{rule:f,error:d})}})).catch(u=>{console.error("Error loading remote css",u.toString())});r.push(c)}})}catch(o){const a=t.find(s=>s.href==null)||document.styleSheets[0];i.href!=null&&r.push(rZ(i.href).then(s=>iZ(s,e)).then(s=>oZ(s).forEach(l=>{a.insertRule(l,i.cssRules.length)})).catch(s=>{console.error("Error loading remote stylesheet",s)})),console.error("Error inlining remote css file",o)}}),Promise.all(r).then(()=>(t.forEach(i=>{if("cssRules"in i)try{au(i.cssRules||[]).forEach(o=>{n.push(o)})}catch(o){console.error(`Error while reading CSS rules from ${i.href}`,o)}}),n))}function PNt(t){return t.filter(e=>e.type===CSSRule.FONT_FACE_RULE).filter(e=>aye(e.style.getPropertyValue("src")))}async function MNt(t,e){if(t.ownerDocument==null)throw new Error("Provided element is not within a Document");const n=au(t.ownerDocument.styleSheets),r=await ENt(n,e);return PNt(r)}async function kNt(t,e){const n=await MNt(t,e);return(await Promise.all(n.map(i=>{const o=i.parentStyleSheet?i.parentStyleSheet.href:null;return sye(i.cssText,o,e)}))).join(`
`)}async function ANt(t,e){const n=e.fontEmbedCSS!=null?e.fontEmbedCSS:e.skipFonts?null:await kNt(t,e);if(n){const r=document.createElement("style"),i=document.createTextNode(n);r.appendChild(i),t.firstChild?t.insertBefore(r,t.firstChild):t.appendChild(r)}}async function RNt(t,e={}){const{width:n,height:r}=rye(t,e),i=await Ik(t,e,!0);return await ANt(i,e),await lye(i,e),TNt(i,e),await Y3t(i,n,r)}async function cye(t,e={}){const{width:n,height:r}=rye(t,e),i=await RNt(t,e),o=await RP(i),a=document.createElement("canvas"),s=a.getContext("2d"),l=e.pixelRatio||q3t(),c=e.canvasWidth||n,u=e.canvasHeight||r;return a.width=c*l,a.height=u*l,e.skipAutoScale||X3t(a),a.style.width=`${c}`,a.style.height=`${u}`,e.backgroundColor&&(s.fillStyle=e.backgroundColor,s.fillRect(0,0,a.width,a.height)),s.drawImage(o,0,0,a.width,a.height),a}async function INt(t,e={}){return(await cye(t,e)).toDataURL()}async function DNt(t,e={}){return(await cye(t,e)).toDataURL("image/jpeg",e.quality||1)}const aZ={png:INt,jpeg:DNt};function LNt(t,e){NNt(t,e).then(()=>{e!=null&&e.handleSuccess&&e.handleSuccess()}).catch(n=>{if(e!=null&&e.handleError)e.handleError(n);else throw n})}async function NNt(t,e={}){const n=t,r=e.format||"png";if(!(r in aZ))throw new Error(`Image format '${r}' is unknown or not supported.`);const i=await aZ[r](n,{backgroundColor:"#00000000",canvasWidth:e.width||(e.height||n.clientHeight)*n.clientWidth/n.clientHeight,canvasHeight:e.height||(e.width||n.clientWidth)*n.clientHeight/n.clientWidth}),a=await(await fetch(i)).blob();await navigator.clipboard.write([new ClipboardItem({"image/png":a})])}function uye({elementRef:t,postMessage:e}){const n=()=>{e("success",fe.get("Snapshot copied to clipboard"))},r=o=>{const a="Error copying snapshot to clipboard";console.error(a+":",o),e("error",fe.get(a))},i=()=>{t.current?LNt(t.current,{format:"png",width:2e3,handleSuccess:n,handleError:r}):r(new Error("missing element reference"))};return w.jsx(Ya,{tooltipText:fe.get("Copy snapshot of chart to clipboard"),onClick:i,icon:w.jsx(nye,{fontSize:"inherit"})})}function $Nt({sx:t,timeSeriesGroupId:e,placeGroupTimeSeries:n,addPlaceGroupTimeSeries:r}){const[i,o]=ue.useState(null),a=f=>{o(f.currentTarget)},s=()=>{o(null)},l=f=>{o(null),r(e,f)},c=[];n.forEach(f=>{Object.getOwnPropertyNames(f.timeSeries).forEach(d=>{const h=`${f.placeGroup.title} / ${d}`;c.push(w.jsx(jr,{onClick:()=>l(f.timeSeries[d]),children:h},h))})});const u=!!i;return w.jsxs(w.Fragment,{children:[w.jsx(Ot,{size:"small",sx:t,"aria-label":"Add","aria-controls":u?"basic-menu":void 0,"aria-haspopup":"true","aria-expanded":u?"true":void 0,onClick:a,disabled:c.length===0,children:w.jsx(_t,{arrow:!0,title:fe.get("Add time-series from places"),children:w.jsx(dw,{fontSize:"inherit"})})}),w.jsx(Pp,{id:"basic-menu",anchorEl:i,open:u,onClose:s,MenuListProps:{"aria-labelledby":"basic-button"},children:c})]})}const kO={container:t=>({padding:t.spacing(1),display:"flex",flexDirection:"column",gap:t.spacing(1)}),minMaxBox:t=>({display:"flex",justifyContent:"center",gap:t.spacing(1)}),minTextField:{maxWidth:"8em"},maxTextField:{maxWidth:"8em"}};function FNt({anchorEl:t,valueRange:e,setValueRange:n}){const[r,i]=M.useState(e?[e[0]+"",e[1]+""]:["0","1"]);if(!t)return null;const o=[Number.parseFloat(r[0]),Number.parseFloat(r[1])],a=Number.isFinite(o[0])&&Number.isFinite(o[1])&&o[0]<o[1],s=f=>{const d=f.target.value;i([d,r[1]])},l=f=>{const d=f.target.value;i([r[0],d])},c=()=>{n(o)},u=()=>{n(void 0)};return w.jsx(Ep,{anchorEl:t,open:!0,onClose:u,anchorOrigin:{vertical:"bottom",horizontal:"left"},transformOrigin:{vertical:"top",horizontal:"center"},children:w.jsxs(Ke,{sx:kO.container,children:[w.jsxs(Ke,{component:"form",sx:kO.minMaxBox,children:[w.jsx(cr,{sx:kO.minTextField,label:"Y-Minimum",variant:"filled",size:"small",value:r[0],error:!a,onChange:f=>s(f)}),w.jsx(cr,{sx:kO.maxTextField,label:"Y-Maximum",variant:"filled",size:"small",value:r[1],error:!a,onChange:f=>l(f)})]}),w.jsx(hw,{onDone:c,doneDisabled:!a,onCancel:u,size:"medium"})]})})}const AO="stddev",Gd={headerContainer:{display:"flex",flexDirection:"row",justifyContent:"right"},actionsContainer:{display:"flex",flexDirection:"row",flexWrap:"nowrap",alignItems:"center",gap:"1px"},responsiveContainer:{flexGrow:"1px"},actionButton:{zIndex:1e3,opacity:.8},chartTitle:{fontSize:"inherit",fontWeight:"normal"},chartTypes:t=>({paddingLeft:t.spacing(1),paddingRight:t.spacing(1)})};function jNt({timeSeriesGroup:t,placeGroupTimeSeries:e,addPlaceGroupTimeSeries:n,removeTimeSeriesGroup:r,resetZoom:i,loading:o,zoomed:a,zoomMode:s,setZoomMode:l,showTooltips:c,setShowTooltips:u,chartType:f,setChartType:d,stdevBarsDisabled:h,stdevBars:p,setStdevBars:m,valueRange:g,setValueRange:v,chartElement:y,postMessage:x}){const b=M.useRef(null),[_,S]=M.useState(!1),O=()=>{S(!_)},C=k=>{S(!1),k&&v(k)},E=(k,I)=>{const P=new Set(I),R=P.has(AO);P.delete(AO),P.delete(f),I=Array.from(P),d(I.length===1?I[0]:f),m(R)};return w.jsx(Ke,{sx:Gd.headerContainer,children:w.jsxs(Ke,{sx:Gd.actionsContainer,children:[a&&w.jsx(_t,{arrow:!0,title:fe.get("Zoom to full range"),children:w.jsx(Ot,{sx:Gd.actionButton,onClick:i,size:"small",children:w.jsx(Jve,{fontSize:"inherit"})},"zoomOutButton")}),w.jsx(_t,{arrow:!0,title:fe.get("Toggle zoom mode (or press CTRL key)"),children:w.jsx(Pn,{value:"zoomMode",selected:s,onClick:()=>l(!s),size:"small",children:w.jsx(Qve,{fontSize:"inherit"})})}),w.jsx(FNt,{anchorEl:_?b.current:null,valueRange:g,setValueRange:C}),w.jsx(_t,{arrow:!0,title:fe.get("Enter fixed y-range"),children:w.jsx(Pn,{ref:b,value:"valueRange",selected:_,onClick:O,size:"small",children:w.jsx(Zve,{fontSize:"inherit"})})}),w.jsx(_t,{arrow:!0,title:fe.get("Toggle showing info popup on hover"),children:w.jsx(Pn,{value:"showTooltips",selected:c,onClick:()=>u(!c),size:"small",children:w.jsx(Kve,{fontSize:"inherit"})})}),w.jsxs(iy,{value:p?[f,AO]:[f],onChange:E,size:"small",sx:Gd.chartTypes,children:[w.jsx(_t,{arrow:!0,title:fe.get("Show points"),children:w.jsx(Pn,{value:"point",size:"small",children:w.jsx(eye,{fontSize:"inherit"})})}),w.jsx(_t,{arrow:!0,title:fe.get("Show lines"),children:w.jsx(Pn,{value:"line",size:"small",children:w.jsx(tye,{fontSize:"inherit"})})}),w.jsx(_t,{arrow:!0,title:fe.get("Show bars"),children:w.jsx(Pn,{value:"bar",size:"small",children:w.jsx(Yve,{fontSize:"inherit"})})}),w.jsx(_t,{arrow:!0,title:fe.get("Show standard deviation (if any)"),children:w.jsx(Pn,{value:AO,size:"small",disabled:h,children:w.jsx(g6,{fontSize:"inherit"})})})]}),w.jsx(uye,{elementRef:y,postMessage:x}),w.jsx($Nt,{sx:Gd.actionButton,timeSeriesGroupId:t.id,placeGroupTimeSeries:e,addPlaceGroupTimeSeries:n}),o?w.jsx(ey,{size:24,sx:Gd.actionButton,color:"secondary"}):w.jsx(Ot,{sx:Gd.actionButton,"aria-label":"Close",onClick:()=>r(t.id),size:"small",children:w.jsx($p,{fontSize:"inherit"})})]})})}const BNt=Li("div")(({theme:t})=>({userSelect:"none",marginTop:t.spacing(1),width:"99%",height:"32vh",display:"flex",flexDirection:"column",alignItems:"flex-stretch"})),zNt={style:{textAnchor:"middle"},angle:-90,position:"left",offset:0};function UNt({timeSeriesGroup:t,selectTimeSeries:e,selectedTime:n,selectTime:r,selectedTimeRange:i,selectTimeRange:o,places:a,selectPlace:s,placeInfos:l,dataTimeRange:c,chartTypeDefault:u,includeStdev:f,removeTimeSeries:d,removeTimeSeriesGroup:h,placeGroupTimeSeries:p,addPlaceGroupTimeSeries:m,postMessage:g}){const v=hd(),[y,x]=M.useState(!1),[b,_]=M.useState(!0),[S,O]=M.useState(u),[C,E]=M.useState(f),[k,I]=M.useState({}),P=M.useRef(),R=M.useRef(),T=M.useRef(),L=M.useRef(null),z=M.useRef(null),B=M.useMemo(()=>{const G=new Map;t.timeSeriesArray.forEach((he,_e)=>{const oe=`v${_e}`,Z=`ev${_e}`,V=he.source.valueDataKey,de=he.source.errorDataKey;he.data.forEach(xe=>{const Me=G.get(xe.time);let me;Me===void 0?(me={time:xe.time},G.set(xe.time,me)):me=Me;const $e=xe[V];if(En($e)&&isFinite($e)&&(me[oe]=$e),de){const Te=xe[de];En(Te)&&isFinite(Te)&&(me[Z]=Te)}})});const ie=Array.from(G.values());return ie.sort((he,_e)=>he.time-_e.time),ie},[t]),U=M.useMemo(()=>t.timeSeriesArray.map(G=>G.dataProgress?G.dataProgress:0),[t]),W=U.reduce((G,ie)=>G+ie,0)/U.length,$=W>0&&W<1,N=!!i&&!n6e(i,c||null);t.timeSeriesArray.forEach(G=>{G.source.valueDataKey});const D=t.variableUnits||fe.get("unknown units"),A=`${fe.get("Quantity")} (${D})`,q=v.palette.primary.light,Y=v.palette.primary.main,K=v.palette.text.primary,se=()=>{En(k.x1)&&I({})},te=G=>{if(!G)return;const{chartX:ie,chartY:he}=G;if(!En(ie)||!En(he))return;const _e=ee(ie,he);if(_e){const[oe,Z]=_e;I({x1:oe,y1:Z})}},J=(G,ie)=>{const{x1:he,y1:_e}=k;if(!En(he)||!En(_e)||!G)return;const{chartX:oe,chartY:Z}=G;if(!En(oe)||!En(Z))return;const V=ee(oe,Z);if(V){const[de,xe]=V;ie.ctrlKey||y?de!==he&&xe!==_e&&I({x1:he,y1:_e,x2:de,y2:xe}):de!==he&&I({x1:he,y1:_e,x2:de})}},pe=G=>{const[ie,he]=sZ(k);se(),ie&&ie[0]<ie[1]?he?o(ie,t.id,he):o(ie,t.id,null):G&&En(G.activeLabel)&&Number.isFinite(G.activeLabel)&&r(G.activeLabel)},be=()=>{se()},re=()=>{se()},ve=G=>{d(t.id,G)},F=()=>{se(),o(c||null,t.id,null)},ce=G=>{G&&o(i,t.id,G)},le=(G,ie)=>{if(T.current=[G,ie],L.current){const he=L.current.getElementsByClassName("recharts-legend-wrapper");he.length!==0&&(z.current=he.item(0))}},Q=([G,ie])=>{const he=(ie-G)*.1;return i?P.current=i:P.current=[G-he,ie+he],P.current},X=([G,ie])=>{const he=(ie-G)*.1;if(t.variableRange)R.current=t.variableRange;else{const _e=G-he;R.current=[_e<0&&G-1e-6>0?0:_e,ie+he]}return R.current},ee=(G,ie)=>{const he=z.current;if(!T.current||!P.current||!R.current||!he)return;const[_e,oe]=P.current,[Z,V]=R.current,[de,xe]=T.current,Me=he.clientHeight,me=65,$e=5,Te=5,Re=38,ae=de-me-Te,Le=xe-$e-Re-Me,Ee=(G-me)/ae,ze=(ie-$e)/Le;return[_e+Ee*(oe-_e),V-ze*(V-Z)]},[ge,ye]=sZ(k),H=S==="bar"?c3t:l3t;return w.jsxs(BNt,{children:[w.jsx(jNt,{timeSeriesGroup:t,placeGroupTimeSeries:p,addPlaceGroupTimeSeries:m,removeTimeSeriesGroup:h,resetZoom:F,loading:$,zoomed:N,zoomMode:y,setZoomMode:x,showTooltips:b,setShowTooltips:_,chartType:S,setChartType:O,stdevBarsDisabled:!f,stdevBars:C,setStdevBars:E,valueRange:R.current,setValueRange:ce,chartElement:L,postMessage:g}),w.jsx(Kme,{width:"98%",onResize:le,ref:L,children:w.jsxs(H,{onMouseDown:te,onMouseMove:J,onMouseUp:pe,onMouseEnter:be,onMouseLeave:re,syncId:"anyId",style:{color:K,fontSize:"0.8em"},data:B,barGap:1,barSize:30,maxBarSize:30,children:[w.jsx(Vp,{dataKey:"time",type:"number",tickCount:6,domain:Q,tickFormatter:f3t,stroke:K,allowDataOverflow:!0}),w.jsx(Gp,{type:"number",tickCount:5,domain:X,tickFormatter:d3t,stroke:K,allowDataOverflow:!0,label:{...zNt,value:A}}),w.jsx(l6,{strokeDasharray:"3 3"}),b&&!En(k.x1)&&w.jsx(yl,{content:w.jsx(g3t,{})}),w.jsx(bv,{content:w.jsx(h3t,{removeTimeSeries:ve})}),t.timeSeriesArray.map((G,ie)=>v3t({timeSeriesGroup:t,timeSeriesIndex:ie,selectTimeSeries:e,places:a,selectPlace:s,placeGroupTimeSeries:p,placeInfos:l,chartType:S,stdevBars:C,paletteMode:v.palette.mode})),ge&&w.jsx(Wp,{x1:ge[0],y1:ye?ye[0]:void 0,x2:ge[1],y2:ye?ye[1]:void 0,strokeOpacity:.3,fill:q,fillOpacity:.3}),n!==null&&w.jsx(Rw,{isFront:!0,x:n,stroke:Y,strokeWidth:3,strokeOpacity:.5})]})})]})}function sZ(t){const{x1:e,x2:n,y1:r,y2:i}=t;let o,a;return En(e)&&En(n)&&(o=e<n?[e,n]:[n,e],En(r)&&En(i)&&(a=r<i?[r,i]:[i,r])),[o,a]}const WNt={container:{display:"flex",flexDirection:"column",alignItems:"center",paddingTop:6,gap:2}};function VNt({canAddTimeSeries:t,addTimeSeries:e}){return w.jsxs(Ke,{sx:WNt.container,children:[w.jsx(tr,{disabled:!t,onClick:e,children:fe.get("Add Time-Series")}),w.jsx(At,{fontSize:"smaller",children:fe.get("No time-series have been obtained yet. Select a variable and a place first.")})]})}const GNt={chartContainer:{display:"flex",flexDirection:"column",flexWrap:"wrap",flexFlow:"flex-start",alignItems:"center"}};function HNt(t){const{timeSeriesGroups:e,dataTimeRange:n,selectedTimeRange:r,selectTimeRange:i,canAddTimeSeries:o,addTimeSeries:a,...s}=t;return e.length===0?w.jsx(VNt,{canAddTimeSeries:o,addTimeSeries:a}):w.jsxs(Ke,{sx:GNt.chartContainer,children:[w.jsx(Edt,{dataTimeRange:n,selectedTimeRange:r,selectTimeRange:i}),e.map(l=>w.jsx(UNt,{timeSeriesGroup:l,dataTimeRange:n,selectedTimeRange:r,selectTimeRange:i,...s},l.id))]})}const qNt=t=>({locale:t.controlState.locale,timeSeriesGroups:t.dataState.timeSeriesGroups,selectedTime:t.controlState.selectedTime,selectedTimeRange:t.controlState.selectedTimeRange,dataTimeRange:HWe(t),chartTypeDefault:t.controlState.timeSeriesChartTypeDefault,includeStdev:t.controlState.timeSeriesIncludeStdev,placeInfos:ZWe(t),places:rw(t),placeGroupTimeSeries:c6e(t),canAddTimeSeries:bse(t)}),XNt={selectTime:k2,selectTimeRange:Sle,removeTimeSeries:o8e,removeTimeSeriesGroup:a8e,selectPlace:M2,addPlaceGroupTimeSeries:i8e,addTimeSeries:P2,postMessage:ba},QNt=Jt(qNt,XNt)(HNt);var w6={},YNt=ft;Object.defineProperty(w6,"__esModule",{value:!0});var fye=w6.default=void 0,KNt=YNt(pt()),ZNt=w;fye=w6.default=(0,KNt.default)((0,ZNt.jsx)("path",{d:"M22 18v-2H8V4h2L7 1 4 4h2v2H2v2h4v8c0 1.1.9 2 2 2h8v2h-2l3 3 3-3h-2v-2zM10 8h6v6h2V8c0-1.1-.9-2-2-2h-6z"}),"Transform");function JNt(t){return t.count===0}function e$t(t){return t.count===1}function t$t(t){return t.count>1}function n$t({statisticsRecord:t}){const e=t.statistics;return w.jsx(M5,{size:"small",children:w.jsx(k5,{children:JNt(e)?w.jsxs(vl,{children:[w.jsx(sr,{children:fe.get("Value")}),w.jsx(sr,{align:"right",children:"NaN"})]}):e$t(e)?w.jsxs(vl,{children:[w.jsx(sr,{children:fe.get("Value")}),w.jsx(sr,{align:"right",children:q0(e.mean)})]}):w.jsxs(w.Fragment,{children:[w.jsxs(vl,{children:[w.jsx(sr,{children:fe.get("Count")}),w.jsx(sr,{align:"right",children:e.count})]}),w.jsxs(vl,{children:[w.jsx(sr,{children:fe.get("Minimum")}),w.jsx(sr,{align:"right",children:q0(e.minimum)})]}),w.jsxs(vl,{children:[w.jsx(sr,{children:fe.get("Maximum")}),w.jsx(sr,{align:"right",children:q0(e.maximum)})]}),w.jsxs(vl,{children:[w.jsx(sr,{children:fe.get("Mean")}),w.jsx(sr,{align:"right",children:q0(e.mean)})]}),w.jsxs(vl,{children:[w.jsx(sr,{children:fe.get("Deviation")}),w.jsx(sr,{align:"right",children:q0(e.deviation)})]})]})})})}function q0(t){return rd(t,3)}function r$t({statisticsRecord:t,showBrush:e,showDetails:n}){const r=Go(),i=t.statistics,o=M.useMemo(()=>{if(!i.histogram)return null;const{values:y,edges:x}=i.histogram;return y.map((b,_)=>({x:.5*(x[_]+x[_+1]),y:b,i:_}))},[i]),[a,s]=M.useState([0,o?o.length-1:-1]);if(M.useEffect(()=>{o&&s([0,o.length-1])},[o]),o===null)return null;const{placeInfo:l}=t.source,[c,u]=a,f=o[c]?o[c].x:NaN,d=o[u]?o[u].x:NaN,h=Math.max(i.mean-i.deviation,i.minimum,f),p=Math.min(i.mean+i.deviation,i.maximum,d),m=r.palette.text.primary,g=r.palette.text.primary,v=({startIndex:y,endIndex:x})=>{En(y)&&En(x)&&s([y,x])};return w.jsx(Kme,{width:"100%",height:"100%",children:w.jsxs(u3t,{data:o,margin:{top:0,right:e?30:5,bottom:1,left:2},style:{color:g,fontSize:"0.8em"},children:[w.jsx(l6,{strokeDasharray:"3 3"}),w.jsx(Vp,{type:"number",dataKey:"x",domain:[f,d],tickCount:10,tickFormatter:y=>rd(y,2)}),w.jsx(Gp,{}),w.jsx(Dd,{type:"monotone",dataKey:"y",stroke:l.color,fill:l.color}),n&&w.jsx(Rw,{x:i.mean,isFront:!0,stroke:m,strokeWidth:2,strokeOpacity:.5}),n&&w.jsx(Wp,{x1:h,x2:p,isFront:!1,stroke:m,strokeWidth:1,strokeOpacity:.3,fill:m,fillOpacity:.05}),e&&w.jsx(gp,{dataKey:"i",height:22,startIndex:c,endIndex:u,tickFormatter:y=>rd(o[y].x,1),onChange:v})]})})}const RO={container:{padding:1,width:"100%"},header:{display:"flex",justifyContent:"space-between",alignItems:"center",paddingBottom:.5},actions:{display:"flex",gap:.1},body:{display:"flex"}};function IO({phrase:t}){return w.jsx("span",{style:{color:"red"},children:`<${fe.get(t)}?>`})}function dye({dataset:t,variable:e,time:n,placeInfo:r,actions:i,body:o,containerRef:a}){const s=t?t.title:w.jsx(IO,{phrase:"Dataset"}),l=e?e.name:w.jsx(IO,{phrase:"Variable"}),c=n?Aae(n):w.jsx(IO,{phrase:"Time"}),u=r?r.label:w.jsx(IO,{phrase:"Place"});return w.jsxs(Ke,{sx:RO.container,ref:a,children:[w.jsxs(Ke,{sx:RO.header,children:[w.jsxs(At,{fontSize:"small",children:[s," / ",l,", ",c,", ",u]}),w.jsx(Ke,{sx:RO.actions,children:i})]}),o&&w.jsx(Ke,{sx:RO.body,children:o})]})}const lZ={table:{flexGrow:0},chart:{flexGrow:1}};function i$t({locale:t,statisticsRecord:e,rowIndex:n,removeStatistics:r,postMessage:i}){const o=M.useRef(null),[a,s]=M.useState(!1),[l,c]=M.useState(!1),{dataset:u,variable:f,time:d,placeInfo:h}=e.source,p=t$t(e.statistics),m=()=>{c(!l)},g=()=>{s(!a)},v=()=>{r(n)};return w.jsx(dye,{dataset:u,variable:f,time:d,placeInfo:h,containerRef:o,actions:w.jsxs(w.Fragment,{children:[p&&w.jsxs(iy,{size:"small",children:[w.jsx(_t,{arrow:!0,title:fe.get("Toggle adjustable x-range"),children:w.jsx(Pn,{selected:a,onClick:g,value:"brush",size:"small",children:w.jsx(fye,{fontSize:"inherit"})})}),w.jsx(_t,{arrow:!0,title:fe.get("Show standard deviation (if any)"),children:w.jsx(Pn,{selected:l,onClick:m,value:"details",size:"small",children:w.jsx(g6,{fontSize:"inherit"})})})]}),p&&w.jsx(uye,{elementRef:o,postMessage:i}),w.jsx(Ot,{size:"small",onClick:v,children:w.jsx($p,{fontSize:"inherit"})})]}),body:w.jsxs(w.Fragment,{children:[w.jsx(Ke,{sx:lZ.table,children:w.jsx(n$t,{locale:t,statisticsRecord:e})}),w.jsx(Ke,{sx:lZ.chart,children:w.jsx(r$t,{showBrush:a,showDetails:l,statisticsRecord:e})})]})})}const o$t={progress:{color:"primary"}};function a$t({selectedDataset:t,selectedVariable:e,selectedTime:n,selectedPlaceInfo:r,canAddStatistics:i,addStatistics:o,statisticsLoading:a}){return w.jsx(dye,{dataset:t,variable:e,time:n,placeInfo:r,actions:a?w.jsx(ey,{size:20,sx:o$t.progress}):w.jsx(Ot,{size:"small",disabled:!i,onClick:o,color:"primary",children:w.jsx(dw,{fontSize:"inherit"})})})}const s$t={container:{padding:1,display:"flex",flexDirection:"column",alignItems:"flex-start"}};function l$t({selectedDataset:t,selectedVariable:e,selectedTime:n,selectedPlaceInfo:r,statisticsLoading:i,statisticsRecords:o,canAddStatistics:a,addStatistics:s,removeStatistics:l,postMessage:c}){return w.jsxs(Ke,{sx:s$t.container,children:[w.jsx(a$t,{selectedDataset:t,selectedVariable:e,selectedTime:n,selectedPlaceInfo:r,canAddStatistics:a,addStatistics:s,statisticsLoading:i}),o.map((u,f)=>w.jsx(i$t,{statisticsRecord:u,rowIndex:f,removeStatistics:l,postMessage:c},f))]})}const c$t=t=>({selectedDataset:qr(t),selectedVariable:vo(t),selectedTime:Sy(t),selectedPlaceInfo:iw(t),statisticsLoading:s6e(t),statisticsRecords:JWe(t),canAddStatistics:_se(t)}),u$t={addStatistics:Xse,removeStatistics:n8e,postMessage:ba},f$t=Jt(c$t,u$t)(l$t);/**
 * @license
 * Copyright 2010-2022 Three.js Authors
 * SPDX-License-Identifier: MIT
 */const S6="144",gm={LEFT:0,MIDDLE:1,RIGHT:2,ROTATE:0,DOLLY:1,PAN:2},vm={ROTATE:0,PAN:1,DOLLY_PAN:2,DOLLY_ROTATE:3},d$t=0,cZ=1,h$t=2,hye=1,p$t=2,wx=3,Lv=0,_a=1,Yc=2,Hf=0,Bg=1,uZ=2,fZ=3,dZ=4,m$t=5,Vm=100,g$t=101,v$t=102,hZ=103,pZ=104,y$t=200,x$t=201,b$t=202,_$t=203,pye=204,mye=205,w$t=206,S$t=207,O$t=208,C$t=209,T$t=210,E$t=0,P$t=1,M$t=2,wF=3,k$t=4,A$t=5,R$t=6,I$t=7,gye=0,D$t=1,L$t=2,su=0,N$t=1,$$t=2,F$t=3,j$t=4,B$t=5,vye=300,Nv=301,$v=302,SF=303,OF=304,Dk=306,CF=1e3,qa=1001,TF=1002,Eo=1003,mZ=1004,gZ=1005,Po=1006,z$t=1007,Lk=1008,yp=1009,U$t=1010,W$t=1011,yye=1012,V$t=1013,kh=1014,Mf=1015,o1=1016,G$t=1017,H$t=1018,zg=1020,q$t=1021,X$t=1022,jl=1023,Q$t=1024,Y$t=1025,Hh=1026,Fv=1027,xye=1028,K$t=1029,Z$t=1030,J$t=1031,eFt=1033,GI=33776,HI=33777,qI=33778,XI=33779,vZ=35840,yZ=35841,xZ=35842,bZ=35843,tFt=36196,_Z=37492,wZ=37496,SZ=37808,OZ=37809,CZ=37810,TZ=37811,EZ=37812,PZ=37813,MZ=37814,kZ=37815,AZ=37816,RZ=37817,IZ=37818,DZ=37819,LZ=37820,NZ=37821,$Z=36492,xp=3e3,yr=3001,nFt=3200,rFt=3201,iFt=0,oFt=1,Rc="srgb",Ah="srgb-linear",QI=7680,aFt=519,FZ=35044,jZ="300 es",EF=1035;class Hp{addEventListener(e,n){this._listeners===void 0&&(this._listeners={});const r=this._listeners;r[e]===void 0&&(r[e]=[]),r[e].indexOf(n)===-1&&r[e].push(n)}hasEventListener(e,n){if(this._listeners===void 0)return!1;const r=this._listeners;return r[e]!==void 0&&r[e].indexOf(n)!==-1}removeEventListener(e,n){if(this._listeners===void 0)return;const i=this._listeners[e];if(i!==void 0){const o=i.indexOf(n);o!==-1&&i.splice(o,1)}}dispatchEvent(e){if(this._listeners===void 0)return;const r=this._listeners[e.type];if(r!==void 0){e.target=this;const i=r.slice(0);for(let o=0,a=i.length;o<a;o++)i[o].call(this,e);e.target=null}}}const Fi=["00","01","02","03","04","05","06","07","08","09","0a","0b","0c","0d","0e","0f","10","11","12","13","14","15","16","17","18","19","1a","1b","1c","1d","1e","1f","20","21","22","23","24","25","26","27","28","29","2a","2b","2c","2d","2e","2f","30","31","32","33","34","35","36","37","38","39","3a","3b","3c","3d","3e","3f","40","41","42","43","44","45","46","47","48","49","4a","4b","4c","4d","4e","4f","50","51","52","53","54","55","56","57","58","59","5a","5b","5c","5d","5e","5f","60","61","62","63","64","65","66","67","68","69","6a","6b","6c","6d","6e","6f","70","71","72","73","74","75","76","77","78","79","7a","7b","7c","7d","7e","7f","80","81","82","83","84","85","86","87","88","89","8a","8b","8c","8d","8e","8f","90","91","92","93","94","95","96","97","98","99","9a","9b","9c","9d","9e","9f","a0","a1","a2","a3","a4","a5","a6","a7","a8","a9","aa","ab","ac","ad","ae","af","b0","b1","b2","b3","b4","b5","b6","b7","b8","b9","ba","bb","bc","bd","be","bf","c0","c1","c2","c3","c4","c5","c6","c7","c8","c9","ca","cb","cc","cd","ce","cf","d0","d1","d2","d3","d4","d5","d6","d7","d8","d9","da","db","dc","dd","de","df","e0","e1","e2","e3","e4","e5","e6","e7","e8","e9","ea","eb","ec","ed","ee","ef","f0","f1","f2","f3","f4","f5","f6","f7","f8","f9","fa","fb","fc","fd","fe","ff"],YI=Math.PI/180,BZ=180/Math.PI;function Lw(){const t=Math.random()*4294967295|0,e=Math.random()*4294967295|0,n=Math.random()*4294967295|0,r=Math.random()*4294967295|0;return(Fi[t&255]+Fi[t>>8&255]+Fi[t>>16&255]+Fi[t>>24&255]+"-"+Fi[e&255]+Fi[e>>8&255]+"-"+Fi[e>>16&15|64]+Fi[e>>24&255]+"-"+Fi[n&63|128]+Fi[n>>8&255]+"-"+Fi[n>>16&255]+Fi[n>>24&255]+Fi[r&255]+Fi[r>>8&255]+Fi[r>>16&255]+Fi[r>>24&255]).toLowerCase()}function Mo(t,e,n){return Math.max(e,Math.min(n,t))}function sFt(t,e){return(t%e+e)%e}function KI(t,e,n){return(1-n)*t+n*e}function zZ(t){return(t&t-1)===0&&t!==0}function PF(t){return Math.pow(2,Math.floor(Math.log(t)/Math.LN2))}function DO(t,e){switch(e.constructor){case Float32Array:return t;case Uint16Array:return t/65535;case Uint8Array:return t/255;case Int16Array:return Math.max(t/32767,-1);case Int8Array:return Math.max(t/127,-1);default:throw new Error("Invalid component type.")}}function Jo(t,e){switch(e.constructor){case Float32Array:return t;case Uint16Array:return Math.round(t*65535);case Uint8Array:return Math.round(t*255);case Int16Array:return Math.round(t*32767);case Int8Array:return Math.round(t*127);default:throw new Error("Invalid component type.")}}class qt{constructor(e=0,n=0){qt.prototype.isVector2=!0,this.x=e,this.y=n}get width(){return this.x}set width(e){this.x=e}get height(){return this.y}set height(e){this.y=e}set(e,n){return this.x=e,this.y=n,this}setScalar(e){return this.x=e,this.y=e,this}setX(e){return this.x=e,this}setY(e){return this.y=e,this}setComponent(e,n){switch(e){case 0:this.x=n;break;case 1:this.y=n;break;default:throw new Error("index is out of range: "+e)}return this}getComponent(e){switch(e){case 0:return this.x;case 1:return this.y;default:throw new Error("index is out of range: "+e)}}clone(){return new this.constructor(this.x,this.y)}copy(e){return this.x=e.x,this.y=e.y,this}add(e){return this.x+=e.x,this.y+=e.y,this}addScalar(e){return this.x+=e,this.y+=e,this}addVectors(e,n){return this.x=e.x+n.x,this.y=e.y+n.y,this}addScaledVector(e,n){return this.x+=e.x*n,this.y+=e.y*n,this}sub(e){return this.x-=e.x,this.y-=e.y,this}subScalar(e){return this.x-=e,this.y-=e,this}subVectors(e,n){return this.x=e.x-n.x,this.y=e.y-n.y,this}multiply(e){return this.x*=e.x,this.y*=e.y,this}multiplyScalar(e){return this.x*=e,this.y*=e,this}divide(e){return this.x/=e.x,this.y/=e.y,this}divideScalar(e){return this.multiplyScalar(1/e)}applyMatrix3(e){const n=this.x,r=this.y,i=e.elements;return this.x=i[0]*n+i[3]*r+i[6],this.y=i[1]*n+i[4]*r+i[7],this}min(e){return this.x=Math.min(this.x,e.x),this.y=Math.min(this.y,e.y),this}max(e){return this.x=Math.max(this.x,e.x),this.y=Math.max(this.y,e.y),this}clamp(e,n){return this.x=Math.max(e.x,Math.min(n.x,this.x)),this.y=Math.max(e.y,Math.min(n.y,this.y)),this}clampScalar(e,n){return this.x=Math.max(e,Math.min(n,this.x)),this.y=Math.max(e,Math.min(n,this.y)),this}clampLength(e,n){const r=this.length();return this.divideScalar(r||1).multiplyScalar(Math.max(e,Math.min(n,r)))}floor(){return this.x=Math.floor(this.x),this.y=Math.floor(this.y),this}ceil(){return this.x=Math.ceil(this.x),this.y=Math.ceil(this.y),this}round(){return this.x=Math.round(this.x),this.y=Math.round(this.y),this}roundToZero(){return this.x=this.x<0?Math.ceil(this.x):Math.floor(this.x),this.y=this.y<0?Math.ceil(this.y):Math.floor(this.y),this}negate(){return this.x=-this.x,this.y=-this.y,this}dot(e){return this.x*e.x+this.y*e.y}cross(e){return this.x*e.y-this.y*e.x}lengthSq(){return this.x*this.x+this.y*this.y}length(){return Math.sqrt(this.x*this.x+this.y*this.y)}manhattanLength(){return Math.abs(this.x)+Math.abs(this.y)}normalize(){return this.divideScalar(this.length()||1)}angle(){return Math.atan2(-this.y,-this.x)+Math.PI}distanceTo(e){return Math.sqrt(this.distanceToSquared(e))}distanceToSquared(e){const n=this.x-e.x,r=this.y-e.y;return n*n+r*r}manhattanDistanceTo(e){return Math.abs(this.x-e.x)+Math.abs(this.y-e.y)}setLength(e){return this.normalize().multiplyScalar(e)}lerp(e,n){return this.x+=(e.x-this.x)*n,this.y+=(e.y-this.y)*n,this}lerpVectors(e,n,r){return this.x=e.x+(n.x-e.x)*r,this.y=e.y+(n.y-e.y)*r,this}equals(e){return e.x===this.x&&e.y===this.y}fromArray(e,n=0){return this.x=e[n],this.y=e[n+1],this}toArray(e=[],n=0){return e[n]=this.x,e[n+1]=this.y,e}fromBufferAttribute(e,n){return this.x=e.getX(n),this.y=e.getY(n),this}rotateAround(e,n){const r=Math.cos(n),i=Math.sin(n),o=this.x-e.x,a=this.y-e.y;return this.x=o*r-a*i+e.x,this.y=o*i+a*r+e.y,this}random(){return this.x=Math.random(),this.y=Math.random(),this}*[Symbol.iterator](){yield this.x,yield this.y}}class va{constructor(){va.prototype.isMatrix3=!0,this.elements=[1,0,0,0,1,0,0,0,1]}set(e,n,r,i,o,a,s,l,c){const u=this.elements;return u[0]=e,u[1]=i,u[2]=s,u[3]=n,u[4]=o,u[5]=l,u[6]=r,u[7]=a,u[8]=c,this}identity(){return this.set(1,0,0,0,1,0,0,0,1),this}copy(e){const n=this.elements,r=e.elements;return n[0]=r[0],n[1]=r[1],n[2]=r[2],n[3]=r[3],n[4]=r[4],n[5]=r[5],n[6]=r[6],n[7]=r[7],n[8]=r[8],this}extractBasis(e,n,r){return e.setFromMatrix3Column(this,0),n.setFromMatrix3Column(this,1),r.setFromMatrix3Column(this,2),this}setFromMatrix4(e){const n=e.elements;return this.set(n[0],n[4],n[8],n[1],n[5],n[9],n[2],n[6],n[10]),this}multiply(e){return this.multiplyMatrices(this,e)}premultiply(e){return this.multiplyMatrices(e,this)}multiplyMatrices(e,n){const r=e.elements,i=n.elements,o=this.elements,a=r[0],s=r[3],l=r[6],c=r[1],u=r[4],f=r[7],d=r[2],h=r[5],p=r[8],m=i[0],g=i[3],v=i[6],y=i[1],x=i[4],b=i[7],_=i[2],S=i[5],O=i[8];return o[0]=a*m+s*y+l*_,o[3]=a*g+s*x+l*S,o[6]=a*v+s*b+l*O,o[1]=c*m+u*y+f*_,o[4]=c*g+u*x+f*S,o[7]=c*v+u*b+f*O,o[2]=d*m+h*y+p*_,o[5]=d*g+h*x+p*S,o[8]=d*v+h*b+p*O,this}multiplyScalar(e){const n=this.elements;return n[0]*=e,n[3]*=e,n[6]*=e,n[1]*=e,n[4]*=e,n[7]*=e,n[2]*=e,n[5]*=e,n[8]*=e,this}determinant(){const e=this.elements,n=e[0],r=e[1],i=e[2],o=e[3],a=e[4],s=e[5],l=e[6],c=e[7],u=e[8];return n*a*u-n*s*c-r*o*u+r*s*l+i*o*c-i*a*l}invert(){const e=this.elements,n=e[0],r=e[1],i=e[2],o=e[3],a=e[4],s=e[5],l=e[6],c=e[7],u=e[8],f=u*a-s*c,d=s*l-u*o,h=c*o-a*l,p=n*f+r*d+i*h;if(p===0)return this.set(0,0,0,0,0,0,0,0,0);const m=1/p;return e[0]=f*m,e[1]=(i*c-u*r)*m,e[2]=(s*r-i*a)*m,e[3]=d*m,e[4]=(u*n-i*l)*m,e[5]=(i*o-s*n)*m,e[6]=h*m,e[7]=(r*l-c*n)*m,e[8]=(a*n-r*o)*m,this}transpose(){let e;const n=this.elements;return e=n[1],n[1]=n[3],n[3]=e,e=n[2],n[2]=n[6],n[6]=e,e=n[5],n[5]=n[7],n[7]=e,this}getNormalMatrix(e){return this.setFromMatrix4(e).invert().transpose()}transposeIntoArray(e){const n=this.elements;return e[0]=n[0],e[1]=n[3],e[2]=n[6],e[3]=n[1],e[4]=n[4],e[5]=n[7],e[6]=n[2],e[7]=n[5],e[8]=n[8],this}setUvTransform(e,n,r,i,o,a,s){const l=Math.cos(o),c=Math.sin(o);return this.set(r*l,r*c,-r*(l*a+c*s)+a+e,-i*c,i*l,-i*(-c*a+l*s)+s+n,0,0,1),this}scale(e,n){const r=this.elements;return r[0]*=e,r[3]*=e,r[6]*=e,r[1]*=n,r[4]*=n,r[7]*=n,this}rotate(e){const n=Math.cos(e),r=Math.sin(e),i=this.elements,o=i[0],a=i[3],s=i[6],l=i[1],c=i[4],u=i[7];return i[0]=n*o+r*l,i[3]=n*a+r*c,i[6]=n*s+r*u,i[1]=-r*o+n*l,i[4]=-r*a+n*c,i[7]=-r*s+n*u,this}translate(e,n){const r=this.elements;return r[0]+=e*r[2],r[3]+=e*r[5],r[6]+=e*r[8],r[1]+=n*r[2],r[4]+=n*r[5],r[7]+=n*r[8],this}equals(e){const n=this.elements,r=e.elements;for(let i=0;i<9;i++)if(n[i]!==r[i])return!1;return!0}fromArray(e,n=0){for(let r=0;r<9;r++)this.elements[r]=e[r+n];return this}toArray(e=[],n=0){const r=this.elements;return e[n]=r[0],e[n+1]=r[1],e[n+2]=r[2],e[n+3]=r[3],e[n+4]=r[4],e[n+5]=r[5],e[n+6]=r[6],e[n+7]=r[7],e[n+8]=r[8],e}clone(){return new this.constructor().fromArray(this.elements)}}function bye(t){for(let e=t.length-1;e>=0;--e)if(t[e]>=65535)return!0;return!1}function a1(t){return document.createElementNS("http://www.w3.org/1999/xhtml",t)}function qh(t){return t<.04045?t*.0773993808:Math.pow(t*.9478672986+.0521327014,2.4)}function YC(t){return t<.0031308?t*12.92:1.055*Math.pow(t,.41666)-.055}const ZI={[Rc]:{[Ah]:qh},[Ah]:{[Rc]:YC}},As={legacyMode:!0,get workingColorSpace(){return Ah},set workingColorSpace(t){console.warn("THREE.ColorManagement: .workingColorSpace is readonly.")},convert:function(t,e,n){if(this.legacyMode||e===n||!e||!n)return t;if(ZI[e]&&ZI[e][n]!==void 0){const r=ZI[e][n];return t.r=r(t.r),t.g=r(t.g),t.b=r(t.b),t}throw new Error("Unsupported color space conversion.")},fromWorkingColorSpace:function(t,e){return this.convert(t,this.workingColorSpace,e)},toWorkingColorSpace:function(t,e){return this.convert(t,e,this.workingColorSpace)}},_ye={aliceblue:15792383,antiquewhite:16444375,aqua:65535,aquamarine:8388564,azure:15794175,beige:16119260,bisque:16770244,black:0,blanchedalmond:16772045,blue:255,blueviolet:9055202,brown:10824234,burlywood:14596231,cadetblue:6266528,chartreuse:8388352,chocolate:13789470,coral:16744272,cornflowerblue:6591981,cornsilk:16775388,crimson:14423100,cyan:65535,darkblue:139,darkcyan:35723,darkgoldenrod:12092939,darkgray:11119017,darkgreen:25600,darkgrey:11119017,darkkhaki:12433259,darkmagenta:9109643,darkolivegreen:5597999,darkorange:16747520,darkorchid:10040012,darkred:9109504,darksalmon:15308410,darkseagreen:9419919,darkslateblue:4734347,darkslategray:3100495,darkslategrey:3100495,darkturquoise:52945,darkviolet:9699539,deeppink:16716947,deepskyblue:49151,dimgray:6908265,dimgrey:6908265,dodgerblue:2003199,firebrick:11674146,floralwhite:16775920,forestgreen:2263842,fuchsia:16711935,gainsboro:14474460,ghostwhite:16316671,gold:16766720,goldenrod:14329120,gray:8421504,green:32768,greenyellow:11403055,grey:8421504,honeydew:15794160,hotpink:16738740,indianred:13458524,indigo:4915330,ivory:16777200,khaki:15787660,lavender:15132410,lavenderblush:16773365,lawngreen:8190976,lemonchiffon:16775885,lightblue:11393254,lightcoral:15761536,lightcyan:14745599,lightgoldenrodyellow:16448210,lightgray:13882323,lightgreen:9498256,lightgrey:13882323,lightpink:16758465,lightsalmon:16752762,lightseagreen:2142890,lightskyblue:8900346,lightslategray:7833753,lightslategrey:7833753,lightsteelblue:11584734,lightyellow:16777184,lime:65280,limegreen:3329330,linen:16445670,magenta:16711935,maroon:8388608,mediumaquamarine:6737322,mediumblue:205,mediumorchid:12211667,mediumpurple:9662683,mediumseagreen:3978097,mediumslateblue:8087790,mediumspringgreen:64154,mediumturquoise:4772300,mediumvioletred:13047173,midnightblue:1644912,mintcream:16121850,mistyrose:16770273,moccasin:16770229,navajowhite:16768685,navy:128,oldlace:16643558,olive:8421376,olivedrab:7048739,orange:16753920,orangered:16729344,orchid:14315734,palegoldenrod:15657130,palegreen:10025880,paleturquoise:11529966,palevioletred:14381203,papayawhip:16773077,peachpuff:16767673,peru:13468991,pink:16761035,plum:14524637,powderblue:11591910,purple:8388736,rebeccapurple:6697881,red:16711680,rosybrown:12357519,royalblue:4286945,saddlebrown:9127187,salmon:16416882,sandybrown:16032864,seagreen:3050327,seashell:16774638,sienna:10506797,silver:12632256,skyblue:8900331,slateblue:6970061,slategray:7372944,slategrey:7372944,snow:16775930,springgreen:65407,steelblue:4620980,tan:13808780,teal:32896,thistle:14204888,tomato:16737095,turquoise:4251856,violet:15631086,wheat:16113331,white:16777215,whitesmoke:16119285,yellow:16776960,yellowgreen:10145074},Yr={r:0,g:0,b:0},Rs={h:0,s:0,l:0},LO={h:0,s:0,l:0};function JI(t,e,n){return n<0&&(n+=1),n>1&&(n-=1),n<1/6?t+(e-t)*6*n:n<1/2?e:n<2/3?t+(e-t)*6*(2/3-n):t}function NO(t,e){return e.r=t.r,e.g=t.g,e.b=t.b,e}class lr{constructor(e,n,r){return this.isColor=!0,this.r=1,this.g=1,this.b=1,n===void 0&&r===void 0?this.set(e):this.setRGB(e,n,r)}set(e){return e&&e.isColor?this.copy(e):typeof e=="number"?this.setHex(e):typeof e=="string"&&this.setStyle(e),this}setScalar(e){return this.r=e,this.g=e,this.b=e,this}setHex(e,n=Rc){return e=Math.floor(e),this.r=(e>>16&255)/255,this.g=(e>>8&255)/255,this.b=(e&255)/255,As.toWorkingColorSpace(this,n),this}setRGB(e,n,r,i=Ah){return this.r=e,this.g=n,this.b=r,As.toWorkingColorSpace(this,i),this}setHSL(e,n,r,i=Ah){if(e=sFt(e,1),n=Mo(n,0,1),r=Mo(r,0,1),n===0)this.r=this.g=this.b=r;else{const o=r<=.5?r*(1+n):r+n-r*n,a=2*r-o;this.r=JI(a,o,e+1/3),this.g=JI(a,o,e),this.b=JI(a,o,e-1/3)}return As.toWorkingColorSpace(this,i),this}setStyle(e,n=Rc){function r(o){o!==void 0&&parseFloat(o)<1&&console.warn("THREE.Color: Alpha component of "+e+" will be ignored.")}let i;if(i=/^((?:rgb|hsl)a?)\(([^\)]*)\)/.exec(e)){let o;const a=i[1],s=i[2];switch(a){case"rgb":case"rgba":if(o=/^\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d+)\s*(?:,\s*(\d*\.?\d+)\s*)?$/.exec(s))return this.r=Math.min(255,parseInt(o[1],10))/255,this.g=Math.min(255,parseInt(o[2],10))/255,this.b=Math.min(255,parseInt(o[3],10))/255,As.toWorkingColorSpace(this,n),r(o[4]),this;if(o=/^\s*(\d+)\%\s*,\s*(\d+)\%\s*,\s*(\d+)\%\s*(?:,\s*(\d*\.?\d+)\s*)?$/.exec(s))return this.r=Math.min(100,parseInt(o[1],10))/100,this.g=Math.min(100,parseInt(o[2],10))/100,this.b=Math.min(100,parseInt(o[3],10))/100,As.toWorkingColorSpace(this,n),r(o[4]),this;break;case"hsl":case"hsla":if(o=/^\s*(\d*\.?\d+)\s*,\s*(\d*\.?\d+)\%\s*,\s*(\d*\.?\d+)\%\s*(?:,\s*(\d*\.?\d+)\s*)?$/.exec(s)){const l=parseFloat(o[1])/360,c=parseFloat(o[2])/100,u=parseFloat(o[3])/100;return r(o[4]),this.setHSL(l,c,u,n)}break}}else if(i=/^\#([A-Fa-f\d]+)$/.exec(e)){const o=i[1],a=o.length;if(a===3)return this.r=parseInt(o.charAt(0)+o.charAt(0),16)/255,this.g=parseInt(o.charAt(1)+o.charAt(1),16)/255,this.b=parseInt(o.charAt(2)+o.charAt(2),16)/255,As.toWorkingColorSpace(this,n),this;if(a===6)return this.r=parseInt(o.charAt(0)+o.charAt(1),16)/255,this.g=parseInt(o.charAt(2)+o.charAt(3),16)/255,this.b=parseInt(o.charAt(4)+o.charAt(5),16)/255,As.toWorkingColorSpace(this,n),this}return e&&e.length>0?this.setColorName(e,n):this}setColorName(e,n=Rc){const r=_ye[e.toLowerCase()];return r!==void 0?this.setHex(r,n):console.warn("THREE.Color: Unknown color "+e),this}clone(){return new this.constructor(this.r,this.g,this.b)}copy(e){return this.r=e.r,this.g=e.g,this.b=e.b,this}copySRGBToLinear(e){return this.r=qh(e.r),this.g=qh(e.g),this.b=qh(e.b),this}copyLinearToSRGB(e){return this.r=YC(e.r),this.g=YC(e.g),this.b=YC(e.b),this}convertSRGBToLinear(){return this.copySRGBToLinear(this),this}convertLinearToSRGB(){return this.copyLinearToSRGB(this),this}getHex(e=Rc){return As.fromWorkingColorSpace(NO(this,Yr),e),Mo(Yr.r*255,0,255)<<16^Mo(Yr.g*255,0,255)<<8^Mo(Yr.b*255,0,255)<<0}getHexString(e=Rc){return("000000"+this.getHex(e).toString(16)).slice(-6)}getHSL(e,n=Ah){As.fromWorkingColorSpace(NO(this,Yr),n);const r=Yr.r,i=Yr.g,o=Yr.b,a=Math.max(r,i,o),s=Math.min(r,i,o);let l,c;const u=(s+a)/2;if(s===a)l=0,c=0;else{const f=a-s;switch(c=u<=.5?f/(a+s):f/(2-a-s),a){case r:l=(i-o)/f+(i<o?6:0);break;case i:l=(o-r)/f+2;break;case o:l=(r-i)/f+4;break}l/=6}return e.h=l,e.s=c,e.l=u,e}getRGB(e,n=Ah){return As.fromWorkingColorSpace(NO(this,Yr),n),e.r=Yr.r,e.g=Yr.g,e.b=Yr.b,e}getStyle(e=Rc){return As.fromWorkingColorSpace(NO(this,Yr),e),e!==Rc?`color(${e} ${Yr.r} ${Yr.g} ${Yr.b})`:`rgb(${Yr.r*255|0},${Yr.g*255|0},${Yr.b*255|0})`}offsetHSL(e,n,r){return this.getHSL(Rs),Rs.h+=e,Rs.s+=n,Rs.l+=r,this.setHSL(Rs.h,Rs.s,Rs.l),this}add(e){return this.r+=e.r,this.g+=e.g,this.b+=e.b,this}addColors(e,n){return this.r=e.r+n.r,this.g=e.g+n.g,this.b=e.b+n.b,this}addScalar(e){return this.r+=e,this.g+=e,this.b+=e,this}sub(e){return this.r=Math.max(0,this.r-e.r),this.g=Math.max(0,this.g-e.g),this.b=Math.max(0,this.b-e.b),this}multiply(e){return this.r*=e.r,this.g*=e.g,this.b*=e.b,this}multiplyScalar(e){return this.r*=e,this.g*=e,this.b*=e,this}lerp(e,n){return this.r+=(e.r-this.r)*n,this.g+=(e.g-this.g)*n,this.b+=(e.b-this.b)*n,this}lerpColors(e,n,r){return this.r=e.r+(n.r-e.r)*r,this.g=e.g+(n.g-e.g)*r,this.b=e.b+(n.b-e.b)*r,this}lerpHSL(e,n){this.getHSL(Rs),e.getHSL(LO);const r=KI(Rs.h,LO.h,n),i=KI(Rs.s,LO.s,n),o=KI(Rs.l,LO.l,n);return this.setHSL(r,i,o),this}equals(e){return e.r===this.r&&e.g===this.g&&e.b===this.b}fromArray(e,n=0){return this.r=e[n],this.g=e[n+1],this.b=e[n+2],this}toArray(e=[],n=0){return e[n]=this.r,e[n+1]=this.g,e[n+2]=this.b,e}fromBufferAttribute(e,n){return this.r=e.getX(n),this.g=e.getY(n),this.b=e.getZ(n),this}toJSON(){return this.getHex()}*[Symbol.iterator](){yield this.r,yield this.g,yield this.b}}lr.NAMES=_ye;let ym;class wye{static getDataURL(e){if(/^data:/i.test(e.src)||typeof HTMLCanvasElement>"u")return e.src;let n;if(e instanceof HTMLCanvasElement)n=e;else{ym===void 0&&(ym=a1("canvas")),ym.width=e.width,ym.height=e.height;const r=ym.getContext("2d");e instanceof ImageData?r.putImageData(e,0,0):r.drawImage(e,0,0,e.width,e.height),n=ym}return n.width>2048||n.height>2048?(console.warn("THREE.ImageUtils.getDataURL: Image converted to jpg for performance reasons",e),n.toDataURL("image/jpeg",.6)):n.toDataURL("image/png")}static sRGBToLinear(e){if(typeof HTMLImageElement<"u"&&e instanceof HTMLImageElement||typeof HTMLCanvasElement<"u"&&e instanceof HTMLCanvasElement||typeof ImageBitmap<"u"&&e instanceof ImageBitmap){const n=a1("canvas");n.width=e.width,n.height=e.height;const r=n.getContext("2d");r.drawImage(e,0,0,e.width,e.height);const i=r.getImageData(0,0,e.width,e.height),o=i.data;for(let a=0;a<o.length;a++)o[a]=qh(o[a]/255)*255;return r.putImageData(i,0,0),n}else if(e.data){const n=e.data.slice(0);for(let r=0;r<n.length;r++)n instanceof Uint8Array||n instanceof Uint8ClampedArray?n[r]=Math.floor(qh(n[r]/255)*255):n[r]=qh(n[r]);return{data:n,width:e.width,height:e.height}}else return console.warn("THREE.ImageUtils.sRGBToLinear(): Unsupported image type. No color space conversion applied."),e}}class Sye{constructor(e=null){this.isSource=!0,this.uuid=Lw(),this.data=e,this.version=0}set needsUpdate(e){e===!0&&this.version++}toJSON(e){const n=e===void 0||typeof e=="string";if(!n&&e.images[this.uuid]!==void 0)return e.images[this.uuid];const r={uuid:this.uuid,url:""},i=this.data;if(i!==null){let o;if(Array.isArray(i)){o=[];for(let a=0,s=i.length;a<s;a++)i[a].isDataTexture?o.push(eD(i[a].image)):o.push(eD(i[a]))}else o=eD(i);r.url=o}return n||(e.images[this.uuid]=r),r}}function eD(t){return typeof HTMLImageElement<"u"&&t instanceof HTMLImageElement||typeof HTMLCanvasElement<"u"&&t instanceof HTMLCanvasElement||typeof ImageBitmap<"u"&&t instanceof ImageBitmap?wye.getDataURL(t):t.data?{data:Array.from(t.data),width:t.width,height:t.height,type:t.data.constructor.name}:(console.warn("THREE.Texture: Unable to serialize Texture."),{})}let lFt=0;class Ta extends Hp{constructor(e=Ta.DEFAULT_IMAGE,n=Ta.DEFAULT_MAPPING,r=qa,i=qa,o=Po,a=Lk,s=jl,l=yp,c=1,u=xp){super(),this.isTexture=!0,Object.defineProperty(this,"id",{value:lFt++}),this.uuid=Lw(),this.name="",this.source=new Sye(e),this.mipmaps=[],this.mapping=n,this.wrapS=r,this.wrapT=i,this.magFilter=o,this.minFilter=a,this.anisotropy=c,this.format=s,this.internalFormat=null,this.type=l,this.offset=new qt(0,0),this.repeat=new qt(1,1),this.center=new qt(0,0),this.rotation=0,this.matrixAutoUpdate=!0,this.matrix=new va,this.generateMipmaps=!0,this.premultiplyAlpha=!1,this.flipY=!0,this.unpackAlignment=4,this.encoding=u,this.userData={},this.version=0,this.onUpdate=null,this.isRenderTargetTexture=!1,this.needsPMREMUpdate=!1}get image(){return this.source.data}set image(e){this.source.data=e}updateMatrix(){this.matrix.setUvTransform(this.offset.x,this.offset.y,this.repeat.x,this.repeat.y,this.rotation,this.center.x,this.center.y)}clone(){return new this.constructor().copy(this)}copy(e){return this.name=e.name,this.source=e.source,this.mipmaps=e.mipmaps.slice(0),this.mapping=e.mapping,this.wrapS=e.wrapS,this.wrapT=e.wrapT,this.magFilter=e.magFilter,this.minFilter=e.minFilter,this.anisotropy=e.anisotropy,this.format=e.format,this.internalFormat=e.internalFormat,this.type=e.type,this.offset.copy(e.offset),this.repeat.copy(e.repeat),this.center.copy(e.center),this.rotation=e.rotation,this.matrixAutoUpdate=e.matrixAutoUpdate,this.matrix.copy(e.matrix),this.generateMipmaps=e.generateMipmaps,this.premultiplyAlpha=e.premultiplyAlpha,this.flipY=e.flipY,this.unpackAlignment=e.unpackAlignment,this.encoding=e.encoding,this.userData=JSON.parse(JSON.stringify(e.userData)),this.needsUpdate=!0,this}toJSON(e){const n=e===void 0||typeof e=="string";if(!n&&e.textures[this.uuid]!==void 0)return e.textures[this.uuid];const r={metadata:{version:4.5,type:"Texture",generator:"Texture.toJSON"},uuid:this.uuid,name:this.name,image:this.source.toJSON(e).uuid,mapping:this.mapping,repeat:[this.repeat.x,this.repeat.y],offset:[this.offset.x,this.offset.y],center:[this.center.x,this.center.y],rotation:this.rotation,wrap:[this.wrapS,this.wrapT],format:this.format,type:this.type,encoding:this.encoding,minFilter:this.minFilter,magFilter:this.magFilter,anisotropy:this.anisotropy,flipY:this.flipY,premultiplyAlpha:this.premultiplyAlpha,unpackAlignment:this.unpackAlignment};return JSON.stringify(this.userData)!=="{}"&&(r.userData=this.userData),n||(e.textures[this.uuid]=r),r}dispose(){this.dispatchEvent({type:"dispose"})}transformUv(e){if(this.mapping!==vye)return e;if(e.applyMatrix3(this.matrix),e.x<0||e.x>1)switch(this.wrapS){case CF:e.x=e.x-Math.floor(e.x);break;case qa:e.x=e.x<0?0:1;break;case TF:Math.abs(Math.floor(e.x)%2)===1?e.x=Math.ceil(e.x)-e.x:e.x=e.x-Math.floor(e.x);break}if(e.y<0||e.y>1)switch(this.wrapT){case CF:e.y=e.y-Math.floor(e.y);break;case qa:e.y=e.y<0?0:1;break;case TF:Math.abs(Math.floor(e.y)%2)===1?e.y=Math.ceil(e.y)-e.y:e.y=e.y-Math.floor(e.y);break}return this.flipY&&(e.y=1-e.y),e}set needsUpdate(e){e===!0&&(this.version++,this.source.needsUpdate=!0)}}Ta.DEFAULT_IMAGE=null;Ta.DEFAULT_MAPPING=vye;class Ri{constructor(e=0,n=0,r=0,i=1){Ri.prototype.isVector4=!0,this.x=e,this.y=n,this.z=r,this.w=i}get width(){return this.z}set width(e){this.z=e}get height(){return this.w}set height(e){this.w=e}set(e,n,r,i){return this.x=e,this.y=n,this.z=r,this.w=i,this}setScalar(e){return this.x=e,this.y=e,this.z=e,this.w=e,this}setX(e){return this.x=e,this}setY(e){return this.y=e,this}setZ(e){return this.z=e,this}setW(e){return this.w=e,this}setComponent(e,n){switch(e){case 0:this.x=n;break;case 1:this.y=n;break;case 2:this.z=n;break;case 3:this.w=n;break;default:throw new Error("index is out of range: "+e)}return this}getComponent(e){switch(e){case 0:return this.x;case 1:return this.y;case 2:return this.z;case 3:return this.w;default:throw new Error("index is out of range: "+e)}}clone(){return new this.constructor(this.x,this.y,this.z,this.w)}copy(e){return this.x=e.x,this.y=e.y,this.z=e.z,this.w=e.w!==void 0?e.w:1,this}add(e){return this.x+=e.x,this.y+=e.y,this.z+=e.z,this.w+=e.w,this}addScalar(e){return this.x+=e,this.y+=e,this.z+=e,this.w+=e,this}addVectors(e,n){return this.x=e.x+n.x,this.y=e.y+n.y,this.z=e.z+n.z,this.w=e.w+n.w,this}addScaledVector(e,n){return this.x+=e.x*n,this.y+=e.y*n,this.z+=e.z*n,this.w+=e.w*n,this}sub(e){return this.x-=e.x,this.y-=e.y,this.z-=e.z,this.w-=e.w,this}subScalar(e){return this.x-=e,this.y-=e,this.z-=e,this.w-=e,this}subVectors(e,n){return this.x=e.x-n.x,this.y=e.y-n.y,this.z=e.z-n.z,this.w=e.w-n.w,this}multiply(e){return this.x*=e.x,this.y*=e.y,this.z*=e.z,this.w*=e.w,this}multiplyScalar(e){return this.x*=e,this.y*=e,this.z*=e,this.w*=e,this}applyMatrix4(e){const n=this.x,r=this.y,i=this.z,o=this.w,a=e.elements;return this.x=a[0]*n+a[4]*r+a[8]*i+a[12]*o,this.y=a[1]*n+a[5]*r+a[9]*i+a[13]*o,this.z=a[2]*n+a[6]*r+a[10]*i+a[14]*o,this.w=a[3]*n+a[7]*r+a[11]*i+a[15]*o,this}divideScalar(e){return this.multiplyScalar(1/e)}setAxisAngleFromQuaternion(e){this.w=2*Math.acos(e.w);const n=Math.sqrt(1-e.w*e.w);return n<1e-4?(this.x=1,this.y=0,this.z=0):(this.x=e.x/n,this.y=e.y/n,this.z=e.z/n),this}setAxisAngleFromRotationMatrix(e){let n,r,i,o;const l=e.elements,c=l[0],u=l[4],f=l[8],d=l[1],h=l[5],p=l[9],m=l[2],g=l[6],v=l[10];if(Math.abs(u-d)<.01&&Math.abs(f-m)<.01&&Math.abs(p-g)<.01){if(Math.abs(u+d)<.1&&Math.abs(f+m)<.1&&Math.abs(p+g)<.1&&Math.abs(c+h+v-3)<.1)return this.set(1,0,0,0),this;n=Math.PI;const x=(c+1)/2,b=(h+1)/2,_=(v+1)/2,S=(u+d)/4,O=(f+m)/4,C=(p+g)/4;return x>b&&x>_?x<.01?(r=0,i=.707106781,o=.707106781):(r=Math.sqrt(x),i=S/r,o=O/r):b>_?b<.01?(r=.707106781,i=0,o=.707106781):(i=Math.sqrt(b),r=S/i,o=C/i):_<.01?(r=.707106781,i=.707106781,o=0):(o=Math.sqrt(_),r=O/o,i=C/o),this.set(r,i,o,n),this}let y=Math.sqrt((g-p)*(g-p)+(f-m)*(f-m)+(d-u)*(d-u));return Math.abs(y)<.001&&(y=1),this.x=(g-p)/y,this.y=(f-m)/y,this.z=(d-u)/y,this.w=Math.acos((c+h+v-1)/2),this}min(e){return this.x=Math.min(this.x,e.x),this.y=Math.min(this.y,e.y),this.z=Math.min(this.z,e.z),this.w=Math.min(this.w,e.w),this}max(e){return this.x=Math.max(this.x,e.x),this.y=Math.max(this.y,e.y),this.z=Math.max(this.z,e.z),this.w=Math.max(this.w,e.w),this}clamp(e,n){return this.x=Math.max(e.x,Math.min(n.x,this.x)),this.y=Math.max(e.y,Math.min(n.y,this.y)),this.z=Math.max(e.z,Math.min(n.z,this.z)),this.w=Math.max(e.w,Math.min(n.w,this.w)),this}clampScalar(e,n){return this.x=Math.max(e,Math.min(n,this.x)),this.y=Math.max(e,Math.min(n,this.y)),this.z=Math.max(e,Math.min(n,this.z)),this.w=Math.max(e,Math.min(n,this.w)),this}clampLength(e,n){const r=this.length();return this.divideScalar(r||1).multiplyScalar(Math.max(e,Math.min(n,r)))}floor(){return this.x=Math.floor(this.x),this.y=Math.floor(this.y),this.z=Math.floor(this.z),this.w=Math.floor(this.w),this}ceil(){return this.x=Math.ceil(this.x),this.y=Math.ceil(this.y),this.z=Math.ceil(this.z),this.w=Math.ceil(this.w),this}round(){return this.x=Math.round(this.x),this.y=Math.round(this.y),this.z=Math.round(this.z),this.w=Math.round(this.w),this}roundToZero(){return this.x=this.x<0?Math.ceil(this.x):Math.floor(this.x),this.y=this.y<0?Math.ceil(this.y):Math.floor(this.y),this.z=this.z<0?Math.ceil(this.z):Math.floor(this.z),this.w=this.w<0?Math.ceil(this.w):Math.floor(this.w),this}negate(){return this.x=-this.x,this.y=-this.y,this.z=-this.z,this.w=-this.w,this}dot(e){return this.x*e.x+this.y*e.y+this.z*e.z+this.w*e.w}lengthSq(){return this.x*this.x+this.y*this.y+this.z*this.z+this.w*this.w}length(){return Math.sqrt(this.x*this.x+this.y*this.y+this.z*this.z+this.w*this.w)}manhattanLength(){return Math.abs(this.x)+Math.abs(this.y)+Math.abs(this.z)+Math.abs(this.w)}normalize(){return this.divideScalar(this.length()||1)}setLength(e){return this.normalize().multiplyScalar(e)}lerp(e,n){return this.x+=(e.x-this.x)*n,this.y+=(e.y-this.y)*n,this.z+=(e.z-this.z)*n,this.w+=(e.w-this.w)*n,this}lerpVectors(e,n,r){return this.x=e.x+(n.x-e.x)*r,this.y=e.y+(n.y-e.y)*r,this.z=e.z+(n.z-e.z)*r,this.w=e.w+(n.w-e.w)*r,this}equals(e){return e.x===this.x&&e.y===this.y&&e.z===this.z&&e.w===this.w}fromArray(e,n=0){return this.x=e[n],this.y=e[n+1],this.z=e[n+2],this.w=e[n+3],this}toArray(e=[],n=0){return e[n]=this.x,e[n+1]=this.y,e[n+2]=this.z,e[n+3]=this.w,e}fromBufferAttribute(e,n){return this.x=e.getX(n),this.y=e.getY(n),this.z=e.getZ(n),this.w=e.getW(n),this}random(){return this.x=Math.random(),this.y=Math.random(),this.z=Math.random(),this.w=Math.random(),this}*[Symbol.iterator](){yield this.x,yield this.y,yield this.z,yield this.w}}class bp extends Hp{constructor(e,n,r={}){super(),this.isWebGLRenderTarget=!0,this.width=e,this.height=n,this.depth=1,this.scissor=new Ri(0,0,e,n),this.scissorTest=!1,this.viewport=new Ri(0,0,e,n);const i={width:e,height:n,depth:1};this.texture=new Ta(i,r.mapping,r.wrapS,r.wrapT,r.magFilter,r.minFilter,r.format,r.type,r.anisotropy,r.encoding),this.texture.isRenderTargetTexture=!0,this.texture.flipY=!1,this.texture.generateMipmaps=r.generateMipmaps!==void 0?r.generateMipmaps:!1,this.texture.internalFormat=r.internalFormat!==void 0?r.internalFormat:null,this.texture.minFilter=r.minFilter!==void 0?r.minFilter:Po,this.depthBuffer=r.depthBuffer!==void 0?r.depthBuffer:!0,this.stencilBuffer=r.stencilBuffer!==void 0?r.stencilBuffer:!1,this.depthTexture=r.depthTexture!==void 0?r.depthTexture:null,this.samples=r.samples!==void 0?r.samples:0}setSize(e,n,r=1){(this.width!==e||this.height!==n||this.depth!==r)&&(this.width=e,this.height=n,this.depth=r,this.texture.image.width=e,this.texture.image.height=n,this.texture.image.depth=r,this.dispose()),this.viewport.set(0,0,e,n),this.scissor.set(0,0,e,n)}clone(){return new this.constructor().copy(this)}copy(e){this.width=e.width,this.height=e.height,this.depth=e.depth,this.viewport.copy(e.viewport),this.texture=e.texture.clone(),this.texture.isRenderTargetTexture=!0;const n=Object.assign({},e.texture.image);return this.texture.source=new Sye(n),this.depthBuffer=e.depthBuffer,this.stencilBuffer=e.stencilBuffer,e.depthTexture!==null&&(this.depthTexture=e.depthTexture.clone()),this.samples=e.samples,this}dispose(){this.dispatchEvent({type:"dispose"})}}class Oye extends Ta{constructor(e=null,n=1,r=1,i=1){super(null),this.isDataArrayTexture=!0,this.image={data:e,width:n,height:r,depth:i},this.magFilter=Eo,this.minFilter=Eo,this.wrapR=qa,this.generateMipmaps=!1,this.flipY=!1,this.unpackAlignment=1}}class Cye extends Ta{constructor(e=null,n=1,r=1,i=1){super(null),this.isData3DTexture=!0,this.image={data:e,width:n,height:r,depth:i},this.magFilter=Eo,this.minFilter=Eo,this.wrapR=qa,this.generateMipmaps=!1,this.flipY=!1,this.unpackAlignment=1}}class _p{constructor(e=0,n=0,r=0,i=1){this.isQuaternion=!0,this._x=e,this._y=n,this._z=r,this._w=i}static slerpFlat(e,n,r,i,o,a,s){let l=r[i+0],c=r[i+1],u=r[i+2],f=r[i+3];const d=o[a+0],h=o[a+1],p=o[a+2],m=o[a+3];if(s===0){e[n+0]=l,e[n+1]=c,e[n+2]=u,e[n+3]=f;return}if(s===1){e[n+0]=d,e[n+1]=h,e[n+2]=p,e[n+3]=m;return}if(f!==m||l!==d||c!==h||u!==p){let g=1-s;const v=l*d+c*h+u*p+f*m,y=v>=0?1:-1,x=1-v*v;if(x>Number.EPSILON){const _=Math.sqrt(x),S=Math.atan2(_,v*y);g=Math.sin(g*S)/_,s=Math.sin(s*S)/_}const b=s*y;if(l=l*g+d*b,c=c*g+h*b,u=u*g+p*b,f=f*g+m*b,g===1-s){const _=1/Math.sqrt(l*l+c*c+u*u+f*f);l*=_,c*=_,u*=_,f*=_}}e[n]=l,e[n+1]=c,e[n+2]=u,e[n+3]=f}static multiplyQuaternionsFlat(e,n,r,i,o,a){const s=r[i],l=r[i+1],c=r[i+2],u=r[i+3],f=o[a],d=o[a+1],h=o[a+2],p=o[a+3];return e[n]=s*p+u*f+l*h-c*d,e[n+1]=l*p+u*d+c*f-s*h,e[n+2]=c*p+u*h+s*d-l*f,e[n+3]=u*p-s*f-l*d-c*h,e}get x(){return this._x}set x(e){this._x=e,this._onChangeCallback()}get y(){return this._y}set y(e){this._y=e,this._onChangeCallback()}get z(){return this._z}set z(e){this._z=e,this._onChangeCallback()}get w(){return this._w}set w(e){this._w=e,this._onChangeCallback()}set(e,n,r,i){return this._x=e,this._y=n,this._z=r,this._w=i,this._onChangeCallback(),this}clone(){return new this.constructor(this._x,this._y,this._z,this._w)}copy(e){return this._x=e.x,this._y=e.y,this._z=e.z,this._w=e.w,this._onChangeCallback(),this}setFromEuler(e,n){const r=e._x,i=e._y,o=e._z,a=e._order,s=Math.cos,l=Math.sin,c=s(r/2),u=s(i/2),f=s(o/2),d=l(r/2),h=l(i/2),p=l(o/2);switch(a){case"XYZ":this._x=d*u*f+c*h*p,this._y=c*h*f-d*u*p,this._z=c*u*p+d*h*f,this._w=c*u*f-d*h*p;break;case"YXZ":this._x=d*u*f+c*h*p,this._y=c*h*f-d*u*p,this._z=c*u*p-d*h*f,this._w=c*u*f+d*h*p;break;case"ZXY":this._x=d*u*f-c*h*p,this._y=c*h*f+d*u*p,this._z=c*u*p+d*h*f,this._w=c*u*f-d*h*p;break;case"ZYX":this._x=d*u*f-c*h*p,this._y=c*h*f+d*u*p,this._z=c*u*p-d*h*f,this._w=c*u*f+d*h*p;break;case"YZX":this._x=d*u*f+c*h*p,this._y=c*h*f+d*u*p,this._z=c*u*p-d*h*f,this._w=c*u*f-d*h*p;break;case"XZY":this._x=d*u*f-c*h*p,this._y=c*h*f-d*u*p,this._z=c*u*p+d*h*f,this._w=c*u*f+d*h*p;break;default:console.warn("THREE.Quaternion: .setFromEuler() encountered an unknown order: "+a)}return n!==!1&&this._onChangeCallback(),this}setFromAxisAngle(e,n){const r=n/2,i=Math.sin(r);return this._x=e.x*i,this._y=e.y*i,this._z=e.z*i,this._w=Math.cos(r),this._onChangeCallback(),this}setFromRotationMatrix(e){const n=e.elements,r=n[0],i=n[4],o=n[8],a=n[1],s=n[5],l=n[9],c=n[2],u=n[6],f=n[10],d=r+s+f;if(d>0){const h=.5/Math.sqrt(d+1);this._w=.25/h,this._x=(u-l)*h,this._y=(o-c)*h,this._z=(a-i)*h}else if(r>s&&r>f){const h=2*Math.sqrt(1+r-s-f);this._w=(u-l)/h,this._x=.25*h,this._y=(i+a)/h,this._z=(o+c)/h}else if(s>f){const h=2*Math.sqrt(1+s-r-f);this._w=(o-c)/h,this._x=(i+a)/h,this._y=.25*h,this._z=(l+u)/h}else{const h=2*Math.sqrt(1+f-r-s);this._w=(a-i)/h,this._x=(o+c)/h,this._y=(l+u)/h,this._z=.25*h}return this._onChangeCallback(),this}setFromUnitVectors(e,n){let r=e.dot(n)+1;return r<Number.EPSILON?(r=0,Math.abs(e.x)>Math.abs(e.z)?(this._x=-e.y,this._y=e.x,this._z=0,this._w=r):(this._x=0,this._y=-e.z,this._z=e.y,this._w=r)):(this._x=e.y*n.z-e.z*n.y,this._y=e.z*n.x-e.x*n.z,this._z=e.x*n.y-e.y*n.x,this._w=r),this.normalize()}angleTo(e){return 2*Math.acos(Math.abs(Mo(this.dot(e),-1,1)))}rotateTowards(e,n){const r=this.angleTo(e);if(r===0)return this;const i=Math.min(1,n/r);return this.slerp(e,i),this}identity(){return this.set(0,0,0,1)}invert(){return this.conjugate()}conjugate(){return this._x*=-1,this._y*=-1,this._z*=-1,this._onChangeCallback(),this}dot(e){return this._x*e._x+this._y*e._y+this._z*e._z+this._w*e._w}lengthSq(){return this._x*this._x+this._y*this._y+this._z*this._z+this._w*this._w}length(){return Math.sqrt(this._x*this._x+this._y*this._y+this._z*this._z+this._w*this._w)}normalize(){let e=this.length();return e===0?(this._x=0,this._y=0,this._z=0,this._w=1):(e=1/e,this._x=this._x*e,this._y=this._y*e,this._z=this._z*e,this._w=this._w*e),this._onChangeCallback(),this}multiply(e){return this.multiplyQuaternions(this,e)}premultiply(e){return this.multiplyQuaternions(e,this)}multiplyQuaternions(e,n){const r=e._x,i=e._y,o=e._z,a=e._w,s=n._x,l=n._y,c=n._z,u=n._w;return this._x=r*u+a*s+i*c-o*l,this._y=i*u+a*l+o*s-r*c,this._z=o*u+a*c+r*l-i*s,this._w=a*u-r*s-i*l-o*c,this._onChangeCallback(),this}slerp(e,n){if(n===0)return this;if(n===1)return this.copy(e);const r=this._x,i=this._y,o=this._z,a=this._w;let s=a*e._w+r*e._x+i*e._y+o*e._z;if(s<0?(this._w=-e._w,this._x=-e._x,this._y=-e._y,this._z=-e._z,s=-s):this.copy(e),s>=1)return this._w=a,this._x=r,this._y=i,this._z=o,this;const l=1-s*s;if(l<=Number.EPSILON){const h=1-n;return this._w=h*a+n*this._w,this._x=h*r+n*this._x,this._y=h*i+n*this._y,this._z=h*o+n*this._z,this.normalize(),this._onChangeCallback(),this}const c=Math.sqrt(l),u=Math.atan2(c,s),f=Math.sin((1-n)*u)/c,d=Math.sin(n*u)/c;return this._w=a*f+this._w*d,this._x=r*f+this._x*d,this._y=i*f+this._y*d,this._z=o*f+this._z*d,this._onChangeCallback(),this}slerpQuaternions(e,n,r){return this.copy(e).slerp(n,r)}random(){const e=Math.random(),n=Math.sqrt(1-e),r=Math.sqrt(e),i=2*Math.PI*Math.random(),o=2*Math.PI*Math.random();return this.set(n*Math.cos(i),r*Math.sin(o),r*Math.cos(o),n*Math.sin(i))}equals(e){return e._x===this._x&&e._y===this._y&&e._z===this._z&&e._w===this._w}fromArray(e,n=0){return this._x=e[n],this._y=e[n+1],this._z=e[n+2],this._w=e[n+3],this._onChangeCallback(),this}toArray(e=[],n=0){return e[n]=this._x,e[n+1]=this._y,e[n+2]=this._z,e[n+3]=this._w,e}fromBufferAttribute(e,n){return this._x=e.getX(n),this._y=e.getY(n),this._z=e.getZ(n),this._w=e.getW(n),this}_onChange(e){return this._onChangeCallback=e,this}_onChangeCallback(){}*[Symbol.iterator](){yield this._x,yield this._y,yield this._z,yield this._w}}class Se{constructor(e=0,n=0,r=0){Se.prototype.isVector3=!0,this.x=e,this.y=n,this.z=r}set(e,n,r){return r===void 0&&(r=this.z),this.x=e,this.y=n,this.z=r,this}setScalar(e){return this.x=e,this.y=e,this.z=e,this}setX(e){return this.x=e,this}setY(e){return this.y=e,this}setZ(e){return this.z=e,this}setComponent(e,n){switch(e){case 0:this.x=n;break;case 1:this.y=n;break;case 2:this.z=n;break;default:throw new Error("index is out of range: "+e)}return this}getComponent(e){switch(e){case 0:return this.x;case 1:return this.y;case 2:return this.z;default:throw new Error("index is out of range: "+e)}}clone(){return new this.constructor(this.x,this.y,this.z)}copy(e){return this.x=e.x,this.y=e.y,this.z=e.z,this}add(e){return this.x+=e.x,this.y+=e.y,this.z+=e.z,this}addScalar(e){return this.x+=e,this.y+=e,this.z+=e,this}addVectors(e,n){return this.x=e.x+n.x,this.y=e.y+n.y,this.z=e.z+n.z,this}addScaledVector(e,n){return this.x+=e.x*n,this.y+=e.y*n,this.z+=e.z*n,this}sub(e){return this.x-=e.x,this.y-=e.y,this.z-=e.z,this}subScalar(e){return this.x-=e,this.y-=e,this.z-=e,this}subVectors(e,n){return this.x=e.x-n.x,this.y=e.y-n.y,this.z=e.z-n.z,this}multiply(e){return this.x*=e.x,this.y*=e.y,this.z*=e.z,this}multiplyScalar(e){return this.x*=e,this.y*=e,this.z*=e,this}multiplyVectors(e,n){return this.x=e.x*n.x,this.y=e.y*n.y,this.z=e.z*n.z,this}applyEuler(e){return this.applyQuaternion(UZ.setFromEuler(e))}applyAxisAngle(e,n){return this.applyQuaternion(UZ.setFromAxisAngle(e,n))}applyMatrix3(e){const n=this.x,r=this.y,i=this.z,o=e.elements;return this.x=o[0]*n+o[3]*r+o[6]*i,this.y=o[1]*n+o[4]*r+o[7]*i,this.z=o[2]*n+o[5]*r+o[8]*i,this}applyNormalMatrix(e){return this.applyMatrix3(e).normalize()}applyMatrix4(e){const n=this.x,r=this.y,i=this.z,o=e.elements,a=1/(o[3]*n+o[7]*r+o[11]*i+o[15]);return this.x=(o[0]*n+o[4]*r+o[8]*i+o[12])*a,this.y=(o[1]*n+o[5]*r+o[9]*i+o[13])*a,this.z=(o[2]*n+o[6]*r+o[10]*i+o[14])*a,this}applyQuaternion(e){const n=this.x,r=this.y,i=this.z,o=e.x,a=e.y,s=e.z,l=e.w,c=l*n+a*i-s*r,u=l*r+s*n-o*i,f=l*i+o*r-a*n,d=-o*n-a*r-s*i;return this.x=c*l+d*-o+u*-s-f*-a,this.y=u*l+d*-a+f*-o-c*-s,this.z=f*l+d*-s+c*-a-u*-o,this}project(e){return this.applyMatrix4(e.matrixWorldInverse).applyMatrix4(e.projectionMatrix)}unproject(e){return this.applyMatrix4(e.projectionMatrixInverse).applyMatrix4(e.matrixWorld)}transformDirection(e){const n=this.x,r=this.y,i=this.z,o=e.elements;return this.x=o[0]*n+o[4]*r+o[8]*i,this.y=o[1]*n+o[5]*r+o[9]*i,this.z=o[2]*n+o[6]*r+o[10]*i,this.normalize()}divide(e){return this.x/=e.x,this.y/=e.y,this.z/=e.z,this}divideScalar(e){return this.multiplyScalar(1/e)}min(e){return this.x=Math.min(this.x,e.x),this.y=Math.min(this.y,e.y),this.z=Math.min(this.z,e.z),this}max(e){return this.x=Math.max(this.x,e.x),this.y=Math.max(this.y,e.y),this.z=Math.max(this.z,e.z),this}clamp(e,n){return this.x=Math.max(e.x,Math.min(n.x,this.x)),this.y=Math.max(e.y,Math.min(n.y,this.y)),this.z=Math.max(e.z,Math.min(n.z,this.z)),this}clampScalar(e,n){return this.x=Math.max(e,Math.min(n,this.x)),this.y=Math.max(e,Math.min(n,this.y)),this.z=Math.max(e,Math.min(n,this.z)),this}clampLength(e,n){const r=this.length();return this.divideScalar(r||1).multiplyScalar(Math.max(e,Math.min(n,r)))}floor(){return this.x=Math.floor(this.x),this.y=Math.floor(this.y),this.z=Math.floor(this.z),this}ceil(){return this.x=Math.ceil(this.x),this.y=Math.ceil(this.y),this.z=Math.ceil(this.z),this}round(){return this.x=Math.round(this.x),this.y=Math.round(this.y),this.z=Math.round(this.z),this}roundToZero(){return this.x=this.x<0?Math.ceil(this.x):Math.floor(this.x),this.y=this.y<0?Math.ceil(this.y):Math.floor(this.y),this.z=this.z<0?Math.ceil(this.z):Math.floor(this.z),this}negate(){return this.x=-this.x,this.y=-this.y,this.z=-this.z,this}dot(e){return this.x*e.x+this.y*e.y+this.z*e.z}lengthSq(){return this.x*this.x+this.y*this.y+this.z*this.z}length(){return Math.sqrt(this.x*this.x+this.y*this.y+this.z*this.z)}manhattanLength(){return Math.abs(this.x)+Math.abs(this.y)+Math.abs(this.z)}normalize(){return this.divideScalar(this.length()||1)}setLength(e){return this.normalize().multiplyScalar(e)}lerp(e,n){return this.x+=(e.x-this.x)*n,this.y+=(e.y-this.y)*n,this.z+=(e.z-this.z)*n,this}lerpVectors(e,n,r){return this.x=e.x+(n.x-e.x)*r,this.y=e.y+(n.y-e.y)*r,this.z=e.z+(n.z-e.z)*r,this}cross(e){return this.crossVectors(this,e)}crossVectors(e,n){const r=e.x,i=e.y,o=e.z,a=n.x,s=n.y,l=n.z;return this.x=i*l-o*s,this.y=o*a-r*l,this.z=r*s-i*a,this}projectOnVector(e){const n=e.lengthSq();if(n===0)return this.set(0,0,0);const r=e.dot(this)/n;return this.copy(e).multiplyScalar(r)}projectOnPlane(e){return tD.copy(this).projectOnVector(e),this.sub(tD)}reflect(e){return this.sub(tD.copy(e).multiplyScalar(2*this.dot(e)))}angleTo(e){const n=Math.sqrt(this.lengthSq()*e.lengthSq());if(n===0)return Math.PI/2;const r=this.dot(e)/n;return Math.acos(Mo(r,-1,1))}distanceTo(e){return Math.sqrt(this.distanceToSquared(e))}distanceToSquared(e){const n=this.x-e.x,r=this.y-e.y,i=this.z-e.z;return n*n+r*r+i*i}manhattanDistanceTo(e){return Math.abs(this.x-e.x)+Math.abs(this.y-e.y)+Math.abs(this.z-e.z)}setFromSpherical(e){return this.setFromSphericalCoords(e.radius,e.phi,e.theta)}setFromSphericalCoords(e,n,r){const i=Math.sin(n)*e;return this.x=i*Math.sin(r),this.y=Math.cos(n)*e,this.z=i*Math.cos(r),this}setFromCylindrical(e){return this.setFromCylindricalCoords(e.radius,e.theta,e.y)}setFromCylindricalCoords(e,n,r){return this.x=e*Math.sin(n),this.y=r,this.z=e*Math.cos(n),this}setFromMatrixPosition(e){const n=e.elements;return this.x=n[12],this.y=n[13],this.z=n[14],this}setFromMatrixScale(e){const n=this.setFromMatrixColumn(e,0).length(),r=this.setFromMatrixColumn(e,1).length(),i=this.setFromMatrixColumn(e,2).length();return this.x=n,this.y=r,this.z=i,this}setFromMatrixColumn(e,n){return this.fromArray(e.elements,n*4)}setFromMatrix3Column(e,n){return this.fromArray(e.elements,n*3)}setFromEuler(e){return this.x=e._x,this.y=e._y,this.z=e._z,this}equals(e){return e.x===this.x&&e.y===this.y&&e.z===this.z}fromArray(e,n=0){return this.x=e[n],this.y=e[n+1],this.z=e[n+2],this}toArray(e=[],n=0){return e[n]=this.x,e[n+1]=this.y,e[n+2]=this.z,e}fromBufferAttribute(e,n){return this.x=e.getX(n),this.y=e.getY(n),this.z=e.getZ(n),this}random(){return this.x=Math.random(),this.y=Math.random(),this.z=Math.random(),this}randomDirection(){const e=(Math.random()-.5)*2,n=Math.random()*Math.PI*2,r=Math.sqrt(1-e**2);return this.x=r*Math.cos(n),this.y=r*Math.sin(n),this.z=e,this}*[Symbol.iterator](){yield this.x,yield this.y,yield this.z}}const tD=new Se,UZ=new _p;class Qy{constructor(e=new Se(1/0,1/0,1/0),n=new Se(-1/0,-1/0,-1/0)){this.isBox3=!0,this.min=e,this.max=n}set(e,n){return this.min.copy(e),this.max.copy(n),this}setFromArray(e){let n=1/0,r=1/0,i=1/0,o=-1/0,a=-1/0,s=-1/0;for(let l=0,c=e.length;l<c;l+=3){const u=e[l],f=e[l+1],d=e[l+2];u<n&&(n=u),f<r&&(r=f),d<i&&(i=d),u>o&&(o=u),f>a&&(a=f),d>s&&(s=d)}return this.min.set(n,r,i),this.max.set(o,a,s),this}setFromBufferAttribute(e){let n=1/0,r=1/0,i=1/0,o=-1/0,a=-1/0,s=-1/0;for(let l=0,c=e.count;l<c;l++){const u=e.getX(l),f=e.getY(l),d=e.getZ(l);u<n&&(n=u),f<r&&(r=f),d<i&&(i=d),u>o&&(o=u),f>a&&(a=f),d>s&&(s=d)}return this.min.set(n,r,i),this.max.set(o,a,s),this}setFromPoints(e){this.makeEmpty();for(let n=0,r=e.length;n<r;n++)this.expandByPoint(e[n]);return this}setFromCenterAndSize(e,n){const r=Hd.copy(n).multiplyScalar(.5);return this.min.copy(e).sub(r),this.max.copy(e).add(r),this}setFromObject(e,n=!1){return this.makeEmpty(),this.expandByObject(e,n)}clone(){return new this.constructor().copy(this)}copy(e){return this.min.copy(e.min),this.max.copy(e.max),this}makeEmpty(){return this.min.x=this.min.y=this.min.z=1/0,this.max.x=this.max.y=this.max.z=-1/0,this}isEmpty(){return this.max.x<this.min.x||this.max.y<this.min.y||this.max.z<this.min.z}getCenter(e){return this.isEmpty()?e.set(0,0,0):e.addVectors(this.min,this.max).multiplyScalar(.5)}getSize(e){return this.isEmpty()?e.set(0,0,0):e.subVectors(this.max,this.min)}expandByPoint(e){return this.min.min(e),this.max.max(e),this}expandByVector(e){return this.min.sub(e),this.max.add(e),this}expandByScalar(e){return this.min.addScalar(-e),this.max.addScalar(e),this}expandByObject(e,n=!1){e.updateWorldMatrix(!1,!1);const r=e.geometry;if(r!==void 0)if(n&&r.attributes!=null&&r.attributes.position!==void 0){const o=r.attributes.position;for(let a=0,s=o.count;a<s;a++)Hd.fromBufferAttribute(o,a).applyMatrix4(e.matrixWorld),this.expandByPoint(Hd)}else r.boundingBox===null&&r.computeBoundingBox(),nD.copy(r.boundingBox),nD.applyMatrix4(e.matrixWorld),this.union(nD);const i=e.children;for(let o=0,a=i.length;o<a;o++)this.expandByObject(i[o],n);return this}containsPoint(e){return!(e.x<this.min.x||e.x>this.max.x||e.y<this.min.y||e.y>this.max.y||e.z<this.min.z||e.z>this.max.z)}containsBox(e){return this.min.x<=e.min.x&&e.max.x<=this.max.x&&this.min.y<=e.min.y&&e.max.y<=this.max.y&&this.min.z<=e.min.z&&e.max.z<=this.max.z}getParameter(e,n){return n.set((e.x-this.min.x)/(this.max.x-this.min.x),(e.y-this.min.y)/(this.max.y-this.min.y),(e.z-this.min.z)/(this.max.z-this.min.z))}intersectsBox(e){return!(e.max.x<this.min.x||e.min.x>this.max.x||e.max.y<this.min.y||e.min.y>this.max.y||e.max.z<this.min.z||e.min.z>this.max.z)}intersectsSphere(e){return this.clampPoint(e.center,Hd),Hd.distanceToSquared(e.center)<=e.radius*e.radius}intersectsPlane(e){let n,r;return e.normal.x>0?(n=e.normal.x*this.min.x,r=e.normal.x*this.max.x):(n=e.normal.x*this.max.x,r=e.normal.x*this.min.x),e.normal.y>0?(n+=e.normal.y*this.min.y,r+=e.normal.y*this.max.y):(n+=e.normal.y*this.max.y,r+=e.normal.y*this.min.y),e.normal.z>0?(n+=e.normal.z*this.min.z,r+=e.normal.z*this.max.z):(n+=e.normal.z*this.max.z,r+=e.normal.z*this.min.z),n<=-e.constant&&r>=-e.constant}intersectsTriangle(e){if(this.isEmpty())return!1;this.getCenter(X0),$O.subVectors(this.max,X0),xm.subVectors(e.a,X0),bm.subVectors(e.b,X0),_m.subVectors(e.c,X0),Bu.subVectors(bm,xm),zu.subVectors(_m,bm),qd.subVectors(xm,_m);let n=[0,-Bu.z,Bu.y,0,-zu.z,zu.y,0,-qd.z,qd.y,Bu.z,0,-Bu.x,zu.z,0,-zu.x,qd.z,0,-qd.x,-Bu.y,Bu.x,0,-zu.y,zu.x,0,-qd.y,qd.x,0];return!rD(n,xm,bm,_m,$O)||(n=[1,0,0,0,1,0,0,0,1],!rD(n,xm,bm,_m,$O))?!1:(FO.crossVectors(Bu,zu),n=[FO.x,FO.y,FO.z],rD(n,xm,bm,_m,$O))}clampPoint(e,n){return n.copy(e).clamp(this.min,this.max)}distanceToPoint(e){return Hd.copy(e).clamp(this.min,this.max).sub(e).length()}getBoundingSphere(e){return this.getCenter(e.center),e.radius=this.getSize(Hd).length()*.5,e}intersect(e){return this.min.max(e.min),this.max.min(e.max),this.isEmpty()&&this.makeEmpty(),this}union(e){return this.min.min(e.min),this.max.max(e.max),this}applyMatrix4(e){return this.isEmpty()?this:(xc[0].set(this.min.x,this.min.y,this.min.z).applyMatrix4(e),xc[1].set(this.min.x,this.min.y,this.max.z).applyMatrix4(e),xc[2].set(this.min.x,this.max.y,this.min.z).applyMatrix4(e),xc[3].set(this.min.x,this.max.y,this.max.z).applyMatrix4(e),xc[4].set(this.max.x,this.min.y,this.min.z).applyMatrix4(e),xc[5].set(this.max.x,this.min.y,this.max.z).applyMatrix4(e),xc[6].set(this.max.x,this.max.y,this.min.z).applyMatrix4(e),xc[7].set(this.max.x,this.max.y,this.max.z).applyMatrix4(e),this.setFromPoints(xc),this)}translate(e){return this.min.add(e),this.max.add(e),this}equals(e){return e.min.equals(this.min)&&e.max.equals(this.max)}}const xc=[new Se,new Se,new Se,new Se,new Se,new Se,new Se,new Se],Hd=new Se,nD=new Qy,xm=new Se,bm=new Se,_m=new Se,Bu=new Se,zu=new Se,qd=new Se,X0=new Se,$O=new Se,FO=new Se,Xd=new Se;function rD(t,e,n,r,i){for(let o=0,a=t.length-3;o<=a;o+=3){Xd.fromArray(t,o);const s=i.x*Math.abs(Xd.x)+i.y*Math.abs(Xd.y)+i.z*Math.abs(Xd.z),l=e.dot(Xd),c=n.dot(Xd),u=r.dot(Xd);if(Math.max(-Math.max(l,c,u),Math.min(l,c,u))>s)return!1}return!0}const cFt=new Qy,WZ=new Se,jO=new Se,iD=new Se;class Nk{constructor(e=new Se,n=-1){this.center=e,this.radius=n}set(e,n){return this.center.copy(e),this.radius=n,this}setFromPoints(e,n){const r=this.center;n!==void 0?r.copy(n):cFt.setFromPoints(e).getCenter(r);let i=0;for(let o=0,a=e.length;o<a;o++)i=Math.max(i,r.distanceToSquared(e[o]));return this.radius=Math.sqrt(i),this}copy(e){return this.center.copy(e.center),this.radius=e.radius,this}isEmpty(){return this.radius<0}makeEmpty(){return this.center.set(0,0,0),this.radius=-1,this}containsPoint(e){return e.distanceToSquared(this.center)<=this.radius*this.radius}distanceToPoint(e){return e.distanceTo(this.center)-this.radius}intersectsSphere(e){const n=this.radius+e.radius;return e.center.distanceToSquared(this.center)<=n*n}intersectsBox(e){return e.intersectsSphere(this)}intersectsPlane(e){return Math.abs(e.distanceToPoint(this.center))<=this.radius}clampPoint(e,n){const r=this.center.distanceToSquared(e);return n.copy(e),r>this.radius*this.radius&&(n.sub(this.center).normalize(),n.multiplyScalar(this.radius).add(this.center)),n}getBoundingBox(e){return this.isEmpty()?(e.makeEmpty(),e):(e.set(this.center,this.center),e.expandByScalar(this.radius),e)}applyMatrix4(e){return this.center.applyMatrix4(e),this.radius=this.radius*e.getMaxScaleOnAxis(),this}translate(e){return this.center.add(e),this}expandByPoint(e){iD.subVectors(e,this.center);const n=iD.lengthSq();if(n>this.radius*this.radius){const r=Math.sqrt(n),i=(r-this.radius)*.5;this.center.add(iD.multiplyScalar(i/r)),this.radius+=i}return this}union(e){return this.center.equals(e.center)===!0?jO.set(0,0,1).multiplyScalar(e.radius):jO.subVectors(e.center,this.center).normalize().multiplyScalar(e.radius),this.expandByPoint(WZ.copy(e.center).add(jO)),this.expandByPoint(WZ.copy(e.center).sub(jO)),this}equals(e){return e.center.equals(this.center)&&e.radius===this.radius}clone(){return new this.constructor().copy(this)}}const bc=new Se,oD=new Se,BO=new Se,Uu=new Se,aD=new Se,zO=new Se,sD=new Se;class Tye{constructor(e=new Se,n=new Se(0,0,-1)){this.origin=e,this.direction=n}set(e,n){return this.origin.copy(e),this.direction.copy(n),this}copy(e){return this.origin.copy(e.origin),this.direction.copy(e.direction),this}at(e,n){return n.copy(this.direction).multiplyScalar(e).add(this.origin)}lookAt(e){return this.direction.copy(e).sub(this.origin).normalize(),this}recast(e){return this.origin.copy(this.at(e,bc)),this}closestPointToPoint(e,n){n.subVectors(e,this.origin);const r=n.dot(this.direction);return r<0?n.copy(this.origin):n.copy(this.direction).multiplyScalar(r).add(this.origin)}distanceToPoint(e){return Math.sqrt(this.distanceSqToPoint(e))}distanceSqToPoint(e){const n=bc.subVectors(e,this.origin).dot(this.direction);return n<0?this.origin.distanceToSquared(e):(bc.copy(this.direction).multiplyScalar(n).add(this.origin),bc.distanceToSquared(e))}distanceSqToSegment(e,n,r,i){oD.copy(e).add(n).multiplyScalar(.5),BO.copy(n).sub(e).normalize(),Uu.copy(this.origin).sub(oD);const o=e.distanceTo(n)*.5,a=-this.direction.dot(BO),s=Uu.dot(this.direction),l=-Uu.dot(BO),c=Uu.lengthSq(),u=Math.abs(1-a*a);let f,d,h,p;if(u>0)if(f=a*l-s,d=a*s-l,p=o*u,f>=0)if(d>=-p)if(d<=p){const m=1/u;f*=m,d*=m,h=f*(f+a*d+2*s)+d*(a*f+d+2*l)+c}else d=o,f=Math.max(0,-(a*d+s)),h=-f*f+d*(d+2*l)+c;else d=-o,f=Math.max(0,-(a*d+s)),h=-f*f+d*(d+2*l)+c;else d<=-p?(f=Math.max(0,-(-a*o+s)),d=f>0?-o:Math.min(Math.max(-o,-l),o),h=-f*f+d*(d+2*l)+c):d<=p?(f=0,d=Math.min(Math.max(-o,-l),o),h=d*(d+2*l)+c):(f=Math.max(0,-(a*o+s)),d=f>0?o:Math.min(Math.max(-o,-l),o),h=-f*f+d*(d+2*l)+c);else d=a>0?-o:o,f=Math.max(0,-(a*d+s)),h=-f*f+d*(d+2*l)+c;return r&&r.copy(this.direction).multiplyScalar(f).add(this.origin),i&&i.copy(BO).multiplyScalar(d).add(oD),h}intersectSphere(e,n){bc.subVectors(e.center,this.origin);const r=bc.dot(this.direction),i=bc.dot(bc)-r*r,o=e.radius*e.radius;if(i>o)return null;const a=Math.sqrt(o-i),s=r-a,l=r+a;return s<0&&l<0?null:s<0?this.at(l,n):this.at(s,n)}intersectsSphere(e){return this.distanceSqToPoint(e.center)<=e.radius*e.radius}distanceToPlane(e){const n=e.normal.dot(this.direction);if(n===0)return e.distanceToPoint(this.origin)===0?0:null;const r=-(this.origin.dot(e.normal)+e.constant)/n;return r>=0?r:null}intersectPlane(e,n){const r=this.distanceToPlane(e);return r===null?null:this.at(r,n)}intersectsPlane(e){const n=e.distanceToPoint(this.origin);return n===0||e.normal.dot(this.direction)*n<0}intersectBox(e,n){let r,i,o,a,s,l;const c=1/this.direction.x,u=1/this.direction.y,f=1/this.direction.z,d=this.origin;return c>=0?(r=(e.min.x-d.x)*c,i=(e.max.x-d.x)*c):(r=(e.max.x-d.x)*c,i=(e.min.x-d.x)*c),u>=0?(o=(e.min.y-d.y)*u,a=(e.max.y-d.y)*u):(o=(e.max.y-d.y)*u,a=(e.min.y-d.y)*u),r>a||o>i||((o>r||r!==r)&&(r=o),(a<i||i!==i)&&(i=a),f>=0?(s=(e.min.z-d.z)*f,l=(e.max.z-d.z)*f):(s=(e.max.z-d.z)*f,l=(e.min.z-d.z)*f),r>l||s>i)||((s>r||r!==r)&&(r=s),(l<i||i!==i)&&(i=l),i<0)?null:this.at(r>=0?r:i,n)}intersectsBox(e){return this.intersectBox(e,bc)!==null}intersectTriangle(e,n,r,i,o){aD.subVectors(n,e),zO.subVectors(r,e),sD.crossVectors(aD,zO);let a=this.direction.dot(sD),s;if(a>0){if(i)return null;s=1}else if(a<0)s=-1,a=-a;else return null;Uu.subVectors(this.origin,e);const l=s*this.direction.dot(zO.crossVectors(Uu,zO));if(l<0)return null;const c=s*this.direction.dot(aD.cross(Uu));if(c<0||l+c>a)return null;const u=-s*Uu.dot(sD);return u<0?null:this.at(u/a,o)}applyMatrix4(e){return this.origin.applyMatrix4(e),this.direction.transformDirection(e),this}equals(e){return e.origin.equals(this.origin)&&e.direction.equals(this.direction)}clone(){return new this.constructor().copy(this)}}class Hn{constructor(){Hn.prototype.isMatrix4=!0,this.elements=[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1]}set(e,n,r,i,o,a,s,l,c,u,f,d,h,p,m,g){const v=this.elements;return v[0]=e,v[4]=n,v[8]=r,v[12]=i,v[1]=o,v[5]=a,v[9]=s,v[13]=l,v[2]=c,v[6]=u,v[10]=f,v[14]=d,v[3]=h,v[7]=p,v[11]=m,v[15]=g,this}identity(){return this.set(1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1),this}clone(){return new Hn().fromArray(this.elements)}copy(e){const n=this.elements,r=e.elements;return n[0]=r[0],n[1]=r[1],n[2]=r[2],n[3]=r[3],n[4]=r[4],n[5]=r[5],n[6]=r[6],n[7]=r[7],n[8]=r[8],n[9]=r[9],n[10]=r[10],n[11]=r[11],n[12]=r[12],n[13]=r[13],n[14]=r[14],n[15]=r[15],this}copyPosition(e){const n=this.elements,r=e.elements;return n[12]=r[12],n[13]=r[13],n[14]=r[14],this}setFromMatrix3(e){const n=e.elements;return this.set(n[0],n[3],n[6],0,n[1],n[4],n[7],0,n[2],n[5],n[8],0,0,0,0,1),this}extractBasis(e,n,r){return e.setFromMatrixColumn(this,0),n.setFromMatrixColumn(this,1),r.setFromMatrixColumn(this,2),this}makeBasis(e,n,r){return this.set(e.x,n.x,r.x,0,e.y,n.y,r.y,0,e.z,n.z,r.z,0,0,0,0,1),this}extractRotation(e){const n=this.elements,r=e.elements,i=1/wm.setFromMatrixColumn(e,0).length(),o=1/wm.setFromMatrixColumn(e,1).length(),a=1/wm.setFromMatrixColumn(e,2).length();return n[0]=r[0]*i,n[1]=r[1]*i,n[2]=r[2]*i,n[3]=0,n[4]=r[4]*o,n[5]=r[5]*o,n[6]=r[6]*o,n[7]=0,n[8]=r[8]*a,n[9]=r[9]*a,n[10]=r[10]*a,n[11]=0,n[12]=0,n[13]=0,n[14]=0,n[15]=1,this}makeRotationFromEuler(e){const n=this.elements,r=e.x,i=e.y,o=e.z,a=Math.cos(r),s=Math.sin(r),l=Math.cos(i),c=Math.sin(i),u=Math.cos(o),f=Math.sin(o);if(e.order==="XYZ"){const d=a*u,h=a*f,p=s*u,m=s*f;n[0]=l*u,n[4]=-l*f,n[8]=c,n[1]=h+p*c,n[5]=d-m*c,n[9]=-s*l,n[2]=m-d*c,n[6]=p+h*c,n[10]=a*l}else if(e.order==="YXZ"){const d=l*u,h=l*f,p=c*u,m=c*f;n[0]=d+m*s,n[4]=p*s-h,n[8]=a*c,n[1]=a*f,n[5]=a*u,n[9]=-s,n[2]=h*s-p,n[6]=m+d*s,n[10]=a*l}else if(e.order==="ZXY"){const d=l*u,h=l*f,p=c*u,m=c*f;n[0]=d-m*s,n[4]=-a*f,n[8]=p+h*s,n[1]=h+p*s,n[5]=a*u,n[9]=m-d*s,n[2]=-a*c,n[6]=s,n[10]=a*l}else if(e.order==="ZYX"){const d=a*u,h=a*f,p=s*u,m=s*f;n[0]=l*u,n[4]=p*c-h,n[8]=d*c+m,n[1]=l*f,n[5]=m*c+d,n[9]=h*c-p,n[2]=-c,n[6]=s*l,n[10]=a*l}else if(e.order==="YZX"){const d=a*l,h=a*c,p=s*l,m=s*c;n[0]=l*u,n[4]=m-d*f,n[8]=p*f+h,n[1]=f,n[5]=a*u,n[9]=-s*u,n[2]=-c*u,n[6]=h*f+p,n[10]=d-m*f}else if(e.order==="XZY"){const d=a*l,h=a*c,p=s*l,m=s*c;n[0]=l*u,n[4]=-f,n[8]=c*u,n[1]=d*f+m,n[5]=a*u,n[9]=h*f-p,n[2]=p*f-h,n[6]=s*u,n[10]=m*f+d}return n[3]=0,n[7]=0,n[11]=0,n[12]=0,n[13]=0,n[14]=0,n[15]=1,this}makeRotationFromQuaternion(e){return this.compose(uFt,e,fFt)}lookAt(e,n,r){const i=this.elements;return ea.subVectors(e,n),ea.lengthSq()===0&&(ea.z=1),ea.normalize(),Wu.crossVectors(r,ea),Wu.lengthSq()===0&&(Math.abs(r.z)===1?ea.x+=1e-4:ea.z+=1e-4,ea.normalize(),Wu.crossVectors(r,ea)),Wu.normalize(),UO.crossVectors(ea,Wu),i[0]=Wu.x,i[4]=UO.x,i[8]=ea.x,i[1]=Wu.y,i[5]=UO.y,i[9]=ea.y,i[2]=Wu.z,i[6]=UO.z,i[10]=ea.z,this}multiply(e){return this.multiplyMatrices(this,e)}premultiply(e){return this.multiplyMatrices(e,this)}multiplyMatrices(e,n){const r=e.elements,i=n.elements,o=this.elements,a=r[0],s=r[4],l=r[8],c=r[12],u=r[1],f=r[5],d=r[9],h=r[13],p=r[2],m=r[6],g=r[10],v=r[14],y=r[3],x=r[7],b=r[11],_=r[15],S=i[0],O=i[4],C=i[8],E=i[12],k=i[1],I=i[5],P=i[9],R=i[13],T=i[2],L=i[6],z=i[10],B=i[14],U=i[3],W=i[7],$=i[11],N=i[15];return o[0]=a*S+s*k+l*T+c*U,o[4]=a*O+s*I+l*L+c*W,o[8]=a*C+s*P+l*z+c*$,o[12]=a*E+s*R+l*B+c*N,o[1]=u*S+f*k+d*T+h*U,o[5]=u*O+f*I+d*L+h*W,o[9]=u*C+f*P+d*z+h*$,o[13]=u*E+f*R+d*B+h*N,o[2]=p*S+m*k+g*T+v*U,o[6]=p*O+m*I+g*L+v*W,o[10]=p*C+m*P+g*z+v*$,o[14]=p*E+m*R+g*B+v*N,o[3]=y*S+x*k+b*T+_*U,o[7]=y*O+x*I+b*L+_*W,o[11]=y*C+x*P+b*z+_*$,o[15]=y*E+x*R+b*B+_*N,this}multiplyScalar(e){const n=this.elements;return n[0]*=e,n[4]*=e,n[8]*=e,n[12]*=e,n[1]*=e,n[5]*=e,n[9]*=e,n[13]*=e,n[2]*=e,n[6]*=e,n[10]*=e,n[14]*=e,n[3]*=e,n[7]*=e,n[11]*=e,n[15]*=e,this}determinant(){const e=this.elements,n=e[0],r=e[4],i=e[8],o=e[12],a=e[1],s=e[5],l=e[9],c=e[13],u=e[2],f=e[6],d=e[10],h=e[14],p=e[3],m=e[7],g=e[11],v=e[15];return p*(+o*l*f-i*c*f-o*s*d+r*c*d+i*s*h-r*l*h)+m*(+n*l*h-n*c*d+o*a*d-i*a*h+i*c*u-o*l*u)+g*(+n*c*f-n*s*h-o*a*f+r*a*h+o*s*u-r*c*u)+v*(-i*s*u-n*l*f+n*s*d+i*a*f-r*a*d+r*l*u)}transpose(){const e=this.elements;let n;return n=e[1],e[1]=e[4],e[4]=n,n=e[2],e[2]=e[8],e[8]=n,n=e[6],e[6]=e[9],e[9]=n,n=e[3],e[3]=e[12],e[12]=n,n=e[7],e[7]=e[13],e[13]=n,n=e[11],e[11]=e[14],e[14]=n,this}setPosition(e,n,r){const i=this.elements;return e.isVector3?(i[12]=e.x,i[13]=e.y,i[14]=e.z):(i[12]=e,i[13]=n,i[14]=r),this}invert(){const e=this.elements,n=e[0],r=e[1],i=e[2],o=e[3],a=e[4],s=e[5],l=e[6],c=e[7],u=e[8],f=e[9],d=e[10],h=e[11],p=e[12],m=e[13],g=e[14],v=e[15],y=f*g*c-m*d*c+m*l*h-s*g*h-f*l*v+s*d*v,x=p*d*c-u*g*c-p*l*h+a*g*h+u*l*v-a*d*v,b=u*m*c-p*f*c+p*s*h-a*m*h-u*s*v+a*f*v,_=p*f*l-u*m*l-p*s*d+a*m*d+u*s*g-a*f*g,S=n*y+r*x+i*b+o*_;if(S===0)return this.set(0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0);const O=1/S;return e[0]=y*O,e[1]=(m*d*o-f*g*o-m*i*h+r*g*h+f*i*v-r*d*v)*O,e[2]=(s*g*o-m*l*o+m*i*c-r*g*c-s*i*v+r*l*v)*O,e[3]=(f*l*o-s*d*o-f*i*c+r*d*c+s*i*h-r*l*h)*O,e[4]=x*O,e[5]=(u*g*o-p*d*o+p*i*h-n*g*h-u*i*v+n*d*v)*O,e[6]=(p*l*o-a*g*o-p*i*c+n*g*c+a*i*v-n*l*v)*O,e[7]=(a*d*o-u*l*o+u*i*c-n*d*c-a*i*h+n*l*h)*O,e[8]=b*O,e[9]=(p*f*o-u*m*o-p*r*h+n*m*h+u*r*v-n*f*v)*O,e[10]=(a*m*o-p*s*o+p*r*c-n*m*c-a*r*v+n*s*v)*O,e[11]=(u*s*o-a*f*o-u*r*c+n*f*c+a*r*h-n*s*h)*O,e[12]=_*O,e[13]=(u*m*i-p*f*i+p*r*d-n*m*d-u*r*g+n*f*g)*O,e[14]=(p*s*i-a*m*i-p*r*l+n*m*l+a*r*g-n*s*g)*O,e[15]=(a*f*i-u*s*i+u*r*l-n*f*l-a*r*d+n*s*d)*O,this}scale(e){const n=this.elements,r=e.x,i=e.y,o=e.z;return n[0]*=r,n[4]*=i,n[8]*=o,n[1]*=r,n[5]*=i,n[9]*=o,n[2]*=r,n[6]*=i,n[10]*=o,n[3]*=r,n[7]*=i,n[11]*=o,this}getMaxScaleOnAxis(){const e=this.elements,n=e[0]*e[0]+e[1]*e[1]+e[2]*e[2],r=e[4]*e[4]+e[5]*e[5]+e[6]*e[6],i=e[8]*e[8]+e[9]*e[9]+e[10]*e[10];return Math.sqrt(Math.max(n,r,i))}makeTranslation(e,n,r){return this.set(1,0,0,e,0,1,0,n,0,0,1,r,0,0,0,1),this}makeRotationX(e){const n=Math.cos(e),r=Math.sin(e);return this.set(1,0,0,0,0,n,-r,0,0,r,n,0,0,0,0,1),this}makeRotationY(e){const n=Math.cos(e),r=Math.sin(e);return this.set(n,0,r,0,0,1,0,0,-r,0,n,0,0,0,0,1),this}makeRotationZ(e){const n=Math.cos(e),r=Math.sin(e);return this.set(n,-r,0,0,r,n,0,0,0,0,1,0,0,0,0,1),this}makeRotationAxis(e,n){const r=Math.cos(n),i=Math.sin(n),o=1-r,a=e.x,s=e.y,l=e.z,c=o*a,u=o*s;return this.set(c*a+r,c*s-i*l,c*l+i*s,0,c*s+i*l,u*s+r,u*l-i*a,0,c*l-i*s,u*l+i*a,o*l*l+r,0,0,0,0,1),this}makeScale(e,n,r){return this.set(e,0,0,0,0,n,0,0,0,0,r,0,0,0,0,1),this}makeShear(e,n,r,i,o,a){return this.set(1,r,o,0,e,1,a,0,n,i,1,0,0,0,0,1),this}compose(e,n,r){const i=this.elements,o=n._x,a=n._y,s=n._z,l=n._w,c=o+o,u=a+a,f=s+s,d=o*c,h=o*u,p=o*f,m=a*u,g=a*f,v=s*f,y=l*c,x=l*u,b=l*f,_=r.x,S=r.y,O=r.z;return i[0]=(1-(m+v))*_,i[1]=(h+b)*_,i[2]=(p-x)*_,i[3]=0,i[4]=(h-b)*S,i[5]=(1-(d+v))*S,i[6]=(g+y)*S,i[7]=0,i[8]=(p+x)*O,i[9]=(g-y)*O,i[10]=(1-(d+m))*O,i[11]=0,i[12]=e.x,i[13]=e.y,i[14]=e.z,i[15]=1,this}decompose(e,n,r){const i=this.elements;let o=wm.set(i[0],i[1],i[2]).length();const a=wm.set(i[4],i[5],i[6]).length(),s=wm.set(i[8],i[9],i[10]).length();this.determinant()<0&&(o=-o),e.x=i[12],e.y=i[13],e.z=i[14],Is.copy(this);const c=1/o,u=1/a,f=1/s;return Is.elements[0]*=c,Is.elements[1]*=c,Is.elements[2]*=c,Is.elements[4]*=u,Is.elements[5]*=u,Is.elements[6]*=u,Is.elements[8]*=f,Is.elements[9]*=f,Is.elements[10]*=f,n.setFromRotationMatrix(Is),r.x=o,r.y=a,r.z=s,this}makePerspective(e,n,r,i,o,a){const s=this.elements,l=2*o/(n-e),c=2*o/(r-i),u=(n+e)/(n-e),f=(r+i)/(r-i),d=-(a+o)/(a-o),h=-2*a*o/(a-o);return s[0]=l,s[4]=0,s[8]=u,s[12]=0,s[1]=0,s[5]=c,s[9]=f,s[13]=0,s[2]=0,s[6]=0,s[10]=d,s[14]=h,s[3]=0,s[7]=0,s[11]=-1,s[15]=0,this}makeOrthographic(e,n,r,i,o,a){const s=this.elements,l=1/(n-e),c=1/(r-i),u=1/(a-o),f=(n+e)*l,d=(r+i)*c,h=(a+o)*u;return s[0]=2*l,s[4]=0,s[8]=0,s[12]=-f,s[1]=0,s[5]=2*c,s[9]=0,s[13]=-d,s[2]=0,s[6]=0,s[10]=-2*u,s[14]=-h,s[3]=0,s[7]=0,s[11]=0,s[15]=1,this}equals(e){const n=this.elements,r=e.elements;for(let i=0;i<16;i++)if(n[i]!==r[i])return!1;return!0}fromArray(e,n=0){for(let r=0;r<16;r++)this.elements[r]=e[r+n];return this}toArray(e=[],n=0){const r=this.elements;return e[n]=r[0],e[n+1]=r[1],e[n+2]=r[2],e[n+3]=r[3],e[n+4]=r[4],e[n+5]=r[5],e[n+6]=r[6],e[n+7]=r[7],e[n+8]=r[8],e[n+9]=r[9],e[n+10]=r[10],e[n+11]=r[11],e[n+12]=r[12],e[n+13]=r[13],e[n+14]=r[14],e[n+15]=r[15],e}}const wm=new Se,Is=new Hn,uFt=new Se(0,0,0),fFt=new Se(1,1,1),Wu=new Se,UO=new Se,ea=new Se,VZ=new Hn,GZ=new _p;class Nw{constructor(e=0,n=0,r=0,i=Nw.DefaultOrder){this.isEuler=!0,this._x=e,this._y=n,this._z=r,this._order=i}get x(){return this._x}set x(e){this._x=e,this._onChangeCallback()}get y(){return this._y}set y(e){this._y=e,this._onChangeCallback()}get z(){return this._z}set z(e){this._z=e,this._onChangeCallback()}get order(){return this._order}set order(e){this._order=e,this._onChangeCallback()}set(e,n,r,i=this._order){return this._x=e,this._y=n,this._z=r,this._order=i,this._onChangeCallback(),this}clone(){return new this.constructor(this._x,this._y,this._z,this._order)}copy(e){return this._x=e._x,this._y=e._y,this._z=e._z,this._order=e._order,this._onChangeCallback(),this}setFromRotationMatrix(e,n=this._order,r=!0){const i=e.elements,o=i[0],a=i[4],s=i[8],l=i[1],c=i[5],u=i[9],f=i[2],d=i[6],h=i[10];switch(n){case"XYZ":this._y=Math.asin(Mo(s,-1,1)),Math.abs(s)<.9999999?(this._x=Math.atan2(-u,h),this._z=Math.atan2(-a,o)):(this._x=Math.atan2(d,c),this._z=0);break;case"YXZ":this._x=Math.asin(-Mo(u,-1,1)),Math.abs(u)<.9999999?(this._y=Math.atan2(s,h),this._z=Math.atan2(l,c)):(this._y=Math.atan2(-f,o),this._z=0);break;case"ZXY":this._x=Math.asin(Mo(d,-1,1)),Math.abs(d)<.9999999?(this._y=Math.atan2(-f,h),this._z=Math.atan2(-a,c)):(this._y=0,this._z=Math.atan2(l,o));break;case"ZYX":this._y=Math.asin(-Mo(f,-1,1)),Math.abs(f)<.9999999?(this._x=Math.atan2(d,h),this._z=Math.atan2(l,o)):(this._x=0,this._z=Math.atan2(-a,c));break;case"YZX":this._z=Math.asin(Mo(l,-1,1)),Math.abs(l)<.9999999?(this._x=Math.atan2(-u,c),this._y=Math.atan2(-f,o)):(this._x=0,this._y=Math.atan2(s,h));break;case"XZY":this._z=Math.asin(-Mo(a,-1,1)),Math.abs(a)<.9999999?(this._x=Math.atan2(d,c),this._y=Math.atan2(s,o)):(this._x=Math.atan2(-u,h),this._y=0);break;default:console.warn("THREE.Euler: .setFromRotationMatrix() encountered an unknown order: "+n)}return this._order=n,r===!0&&this._onChangeCallback(),this}setFromQuaternion(e,n,r){return VZ.makeRotationFromQuaternion(e),this.setFromRotationMatrix(VZ,n,r)}setFromVector3(e,n=this._order){return this.set(e.x,e.y,e.z,n)}reorder(e){return GZ.setFromEuler(this),this.setFromQuaternion(GZ,e)}equals(e){return e._x===this._x&&e._y===this._y&&e._z===this._z&&e._order===this._order}fromArray(e){return this._x=e[0],this._y=e[1],this._z=e[2],e[3]!==void 0&&(this._order=e[3]),this._onChangeCallback(),this}toArray(e=[],n=0){return e[n]=this._x,e[n+1]=this._y,e[n+2]=this._z,e[n+3]=this._order,e}_onChange(e){return this._onChangeCallback=e,this}_onChangeCallback(){}*[Symbol.iterator](){yield this._x,yield this._y,yield this._z,yield this._order}toVector3(){console.error("THREE.Euler: .toVector3() has been removed. Use Vector3.setFromEuler() instead")}}Nw.DefaultOrder="XYZ";Nw.RotationOrders=["XYZ","YZX","ZXY","XZY","YXZ","ZYX"];class Eye{constructor(){this.mask=1}set(e){this.mask=(1<<e|0)>>>0}enable(e){this.mask|=1<<e|0}enableAll(){this.mask=-1}toggle(e){this.mask^=1<<e|0}disable(e){this.mask&=~(1<<e|0)}disableAll(){this.mask=0}test(e){return(this.mask&e.mask)!==0}isEnabled(e){return(this.mask&(1<<e|0))!==0}}let dFt=0;const HZ=new Se,Sm=new _p,_c=new Hn,WO=new Se,Q0=new Se,hFt=new Se,pFt=new _p,qZ=new Se(1,0,0),XZ=new Se(0,1,0),QZ=new Se(0,0,1),mFt={type:"added"},YZ={type:"removed"};class zo extends Hp{constructor(){super(),this.isObject3D=!0,Object.defineProperty(this,"id",{value:dFt++}),this.uuid=Lw(),this.name="",this.type="Object3D",this.parent=null,this.children=[],this.up=zo.DefaultUp.clone();const e=new Se,n=new Nw,r=new _p,i=new Se(1,1,1);function o(){r.setFromEuler(n,!1)}function a(){n.setFromQuaternion(r,void 0,!1)}n._onChange(o),r._onChange(a),Object.defineProperties(this,{position:{configurable:!0,enumerable:!0,value:e},rotation:{configurable:!0,enumerable:!0,value:n},quaternion:{configurable:!0,enumerable:!0,value:r},scale:{configurable:!0,enumerable:!0,value:i},modelViewMatrix:{value:new Hn},normalMatrix:{value:new va}}),this.matrix=new Hn,this.matrixWorld=new Hn,this.matrixAutoUpdate=zo.DefaultMatrixAutoUpdate,this.matrixWorldNeedsUpdate=!1,this.matrixWorldAutoUpdate=zo.DefaultMatrixWorldAutoUpdate,this.layers=new Eye,this.visible=!0,this.castShadow=!1,this.receiveShadow=!1,this.frustumCulled=!0,this.renderOrder=0,this.animations=[],this.userData={}}onBeforeRender(){}onAfterRender(){}applyMatrix4(e){this.matrixAutoUpdate&&this.updateMatrix(),this.matrix.premultiply(e),this.matrix.decompose(this.position,this.quaternion,this.scale)}applyQuaternion(e){return this.quaternion.premultiply(e),this}setRotationFromAxisAngle(e,n){this.quaternion.setFromAxisAngle(e,n)}setRotationFromEuler(e){this.quaternion.setFromEuler(e,!0)}setRotationFromMatrix(e){this.quaternion.setFromRotationMatrix(e)}setRotationFromQuaternion(e){this.quaternion.copy(e)}rotateOnAxis(e,n){return Sm.setFromAxisAngle(e,n),this.quaternion.multiply(Sm),this}rotateOnWorldAxis(e,n){return Sm.setFromAxisAngle(e,n),this.quaternion.premultiply(Sm),this}rotateX(e){return this.rotateOnAxis(qZ,e)}rotateY(e){return this.rotateOnAxis(XZ,e)}rotateZ(e){return this.rotateOnAxis(QZ,e)}translateOnAxis(e,n){return HZ.copy(e).applyQuaternion(this.quaternion),this.position.add(HZ.multiplyScalar(n)),this}translateX(e){return this.translateOnAxis(qZ,e)}translateY(e){return this.translateOnAxis(XZ,e)}translateZ(e){return this.translateOnAxis(QZ,e)}localToWorld(e){return e.applyMatrix4(this.matrixWorld)}worldToLocal(e){return e.applyMatrix4(_c.copy(this.matrixWorld).invert())}lookAt(e,n,r){e.isVector3?WO.copy(e):WO.set(e,n,r);const i=this.parent;this.updateWorldMatrix(!0,!1),Q0.setFromMatrixPosition(this.matrixWorld),this.isCamera||this.isLight?_c.lookAt(Q0,WO,this.up):_c.lookAt(WO,Q0,this.up),this.quaternion.setFromRotationMatrix(_c),i&&(_c.extractRotation(i.matrixWorld),Sm.setFromRotationMatrix(_c),this.quaternion.premultiply(Sm.invert()))}add(e){if(arguments.length>1){for(let n=0;n<arguments.length;n++)this.add(arguments[n]);return this}return e===this?(console.error("THREE.Object3D.add: object can't be added as a child of itself.",e),this):(e&&e.isObject3D?(e.parent!==null&&e.parent.remove(e),e.parent=this,this.children.push(e),e.dispatchEvent(mFt)):console.error("THREE.Object3D.add: object not an instance of THREE.Object3D.",e),this)}remove(e){if(arguments.length>1){for(let r=0;r<arguments.length;r++)this.remove(arguments[r]);return this}const n=this.children.indexOf(e);return n!==-1&&(e.parent=null,this.children.splice(n,1),e.dispatchEvent(YZ)),this}removeFromParent(){const e=this.parent;return e!==null&&e.remove(this),this}clear(){for(let e=0;e<this.children.length;e++){const n=this.children[e];n.parent=null,n.dispatchEvent(YZ)}return this.children.length=0,this}attach(e){return this.updateWorldMatrix(!0,!1),_c.copy(this.matrixWorld).invert(),e.parent!==null&&(e.parent.updateWorldMatrix(!0,!1),_c.multiply(e.parent.matrixWorld)),e.applyMatrix4(_c),this.add(e),e.updateWorldMatrix(!1,!0),this}getObjectById(e){return this.getObjectByProperty("id",e)}getObjectByName(e){return this.getObjectByProperty("name",e)}getObjectByProperty(e,n){if(this[e]===n)return this;for(let r=0,i=this.children.length;r<i;r++){const a=this.children[r].getObjectByProperty(e,n);if(a!==void 0)return a}}getWorldPosition(e){return this.updateWorldMatrix(!0,!1),e.setFromMatrixPosition(this.matrixWorld)}getWorldQuaternion(e){return this.updateWorldMatrix(!0,!1),this.matrixWorld.decompose(Q0,e,hFt),e}getWorldScale(e){return this.updateWorldMatrix(!0,!1),this.matrixWorld.decompose(Q0,pFt,e),e}getWorldDirection(e){this.updateWorldMatrix(!0,!1);const n=this.matrixWorld.elements;return e.set(n[8],n[9],n[10]).normalize()}raycast(){}traverse(e){e(this);const n=this.children;for(let r=0,i=n.length;r<i;r++)n[r].traverse(e)}traverseVisible(e){if(this.visible===!1)return;e(this);const n=this.children;for(let r=0,i=n.length;r<i;r++)n[r].traverseVisible(e)}traverseAncestors(e){const n=this.parent;n!==null&&(e(n),n.traverseAncestors(e))}updateMatrix(){this.matrix.compose(this.position,this.quaternion,this.scale),this.matrixWorldNeedsUpdate=!0}updateMatrixWorld(e){this.matrixAutoUpdate&&this.updateMatrix(),(this.matrixWorldNeedsUpdate||e)&&(this.parent===null?this.matrixWorld.copy(this.matrix):this.matrixWorld.multiplyMatrices(this.parent.matrixWorld,this.matrix),this.matrixWorldNeedsUpdate=!1,e=!0);const n=this.children;for(let r=0,i=n.length;r<i;r++){const o=n[r];(o.matrixWorldAutoUpdate===!0||e===!0)&&o.updateMatrixWorld(e)}}updateWorldMatrix(e,n){const r=this.parent;if(e===!0&&r!==null&&r.matrixWorldAutoUpdate===!0&&r.updateWorldMatrix(!0,!1),this.matrixAutoUpdate&&this.updateMatrix(),this.parent===null?this.matrixWorld.copy(this.matrix):this.matrixWorld.multiplyMatrices(this.parent.matrixWorld,this.matrix),n===!0){const i=this.children;for(let o=0,a=i.length;o<a;o++){const s=i[o];s.matrixWorldAutoUpdate===!0&&s.updateWorldMatrix(!1,!0)}}}toJSON(e){const n=e===void 0||typeof e=="string",r={};n&&(e={geometries:{},materials:{},textures:{},images:{},shapes:{},skeletons:{},animations:{},nodes:{}},r.metadata={version:4.5,type:"Object",generator:"Object3D.toJSON"});const i={};i.uuid=this.uuid,i.type=this.type,this.name!==""&&(i.name=this.name),this.castShadow===!0&&(i.castShadow=!0),this.receiveShadow===!0&&(i.receiveShadow=!0),this.visible===!1&&(i.visible=!1),this.frustumCulled===!1&&(i.frustumCulled=!1),this.renderOrder!==0&&(i.renderOrder=this.renderOrder),JSON.stringify(this.userData)!=="{}"&&(i.userData=this.userData),i.layers=this.layers.mask,i.matrix=this.matrix.toArray(),this.matrixAutoUpdate===!1&&(i.matrixAutoUpdate=!1),this.isInstancedMesh&&(i.type="InstancedMesh",i.count=this.count,i.instanceMatrix=this.instanceMatrix.toJSON(),this.instanceColor!==null&&(i.instanceColor=this.instanceColor.toJSON()));function o(s,l){return s[l.uuid]===void 0&&(s[l.uuid]=l.toJSON(e)),l.uuid}if(this.isScene)this.background&&(this.background.isColor?i.background=this.background.toJSON():this.background.isTexture&&(i.background=this.background.toJSON(e).uuid)),this.environment&&this.environment.isTexture&&this.environment.isRenderTargetTexture!==!0&&(i.environment=this.environment.toJSON(e).uuid);else if(this.isMesh||this.isLine||this.isPoints){i.geometry=o(e.geometries,this.geometry);const s=this.geometry.parameters;if(s!==void 0&&s.shapes!==void 0){const l=s.shapes;if(Array.isArray(l))for(let c=0,u=l.length;c<u;c++){const f=l[c];o(e.shapes,f)}else o(e.shapes,l)}}if(this.isSkinnedMesh&&(i.bindMode=this.bindMode,i.bindMatrix=this.bindMatrix.toArray(),this.skeleton!==void 0&&(o(e.skeletons,this.skeleton),i.skeleton=this.skeleton.uuid)),this.material!==void 0)if(Array.isArray(this.material)){const s=[];for(let l=0,c=this.material.length;l<c;l++)s.push(o(e.materials,this.material[l]));i.material=s}else i.material=o(e.materials,this.material);if(this.children.length>0){i.children=[];for(let s=0;s<this.children.length;s++)i.children.push(this.children[s].toJSON(e).object)}if(this.animations.length>0){i.animations=[];for(let s=0;s<this.animations.length;s++){const l=this.animations[s];i.animations.push(o(e.animations,l))}}if(n){const s=a(e.geometries),l=a(e.materials),c=a(e.textures),u=a(e.images),f=a(e.shapes),d=a(e.skeletons),h=a(e.animations),p=a(e.nodes);s.length>0&&(r.geometries=s),l.length>0&&(r.materials=l),c.length>0&&(r.textures=c),u.length>0&&(r.images=u),f.length>0&&(r.shapes=f),d.length>0&&(r.skeletons=d),h.length>0&&(r.animations=h),p.length>0&&(r.nodes=p)}return r.object=i,r;function a(s){const l=[];for(const c in s){const u=s[c];delete u.metadata,l.push(u)}return l}}clone(e){return new this.constructor().copy(this,e)}copy(e,n=!0){if(this.name=e.name,this.up.copy(e.up),this.position.copy(e.position),this.rotation.order=e.rotation.order,this.quaternion.copy(e.quaternion),this.scale.copy(e.scale),this.matrix.copy(e.matrix),this.matrixWorld.copy(e.matrixWorld),this.matrixAutoUpdate=e.matrixAutoUpdate,this.matrixWorldNeedsUpdate=e.matrixWorldNeedsUpdate,this.matrixWorldAutoUpdate=e.matrixWorldAutoUpdate,this.layers.mask=e.layers.mask,this.visible=e.visible,this.castShadow=e.castShadow,this.receiveShadow=e.receiveShadow,this.frustumCulled=e.frustumCulled,this.renderOrder=e.renderOrder,this.userData=JSON.parse(JSON.stringify(e.userData)),n===!0)for(let r=0;r<e.children.length;r++){const i=e.children[r];this.add(i.clone())}return this}}zo.DefaultUp=new Se(0,1,0);zo.DefaultMatrixAutoUpdate=!0;zo.DefaultMatrixWorldAutoUpdate=!0;const Ds=new Se,wc=new Se,lD=new Se,Sc=new Se,Om=new Se,Cm=new Se,KZ=new Se,cD=new Se,uD=new Se,fD=new Se;class Wc{constructor(e=new Se,n=new Se,r=new Se){this.a=e,this.b=n,this.c=r}static getNormal(e,n,r,i){i.subVectors(r,n),Ds.subVectors(e,n),i.cross(Ds);const o=i.lengthSq();return o>0?i.multiplyScalar(1/Math.sqrt(o)):i.set(0,0,0)}static getBarycoord(e,n,r,i,o){Ds.subVectors(i,n),wc.subVectors(r,n),lD.subVectors(e,n);const a=Ds.dot(Ds),s=Ds.dot(wc),l=Ds.dot(lD),c=wc.dot(wc),u=wc.dot(lD),f=a*c-s*s;if(f===0)return o.set(-2,-1,-1);const d=1/f,h=(c*l-s*u)*d,p=(a*u-s*l)*d;return o.set(1-h-p,p,h)}static containsPoint(e,n,r,i){return this.getBarycoord(e,n,r,i,Sc),Sc.x>=0&&Sc.y>=0&&Sc.x+Sc.y<=1}static getUV(e,n,r,i,o,a,s,l){return this.getBarycoord(e,n,r,i,Sc),l.set(0,0),l.addScaledVector(o,Sc.x),l.addScaledVector(a,Sc.y),l.addScaledVector(s,Sc.z),l}static isFrontFacing(e,n,r,i){return Ds.subVectors(r,n),wc.subVectors(e,n),Ds.cross(wc).dot(i)<0}set(e,n,r){return this.a.copy(e),this.b.copy(n),this.c.copy(r),this}setFromPointsAndIndices(e,n,r,i){return this.a.copy(e[n]),this.b.copy(e[r]),this.c.copy(e[i]),this}setFromAttributeAndIndices(e,n,r,i){return this.a.fromBufferAttribute(e,n),this.b.fromBufferAttribute(e,r),this.c.fromBufferAttribute(e,i),this}clone(){return new this.constructor().copy(this)}copy(e){return this.a.copy(e.a),this.b.copy(e.b),this.c.copy(e.c),this}getArea(){return Ds.subVectors(this.c,this.b),wc.subVectors(this.a,this.b),Ds.cross(wc).length()*.5}getMidpoint(e){return e.addVectors(this.a,this.b).add(this.c).multiplyScalar(1/3)}getNormal(e){return Wc.getNormal(this.a,this.b,this.c,e)}getPlane(e){return e.setFromCoplanarPoints(this.a,this.b,this.c)}getBarycoord(e,n){return Wc.getBarycoord(e,this.a,this.b,this.c,n)}getUV(e,n,r,i,o){return Wc.getUV(e,this.a,this.b,this.c,n,r,i,o)}containsPoint(e){return Wc.containsPoint(e,this.a,this.b,this.c)}isFrontFacing(e){return Wc.isFrontFacing(this.a,this.b,this.c,e)}intersectsBox(e){return e.intersectsTriangle(this)}closestPointToPoint(e,n){const r=this.a,i=this.b,o=this.c;let a,s;Om.subVectors(i,r),Cm.subVectors(o,r),cD.subVectors(e,r);const l=Om.dot(cD),c=Cm.dot(cD);if(l<=0&&c<=0)return n.copy(r);uD.subVectors(e,i);const u=Om.dot(uD),f=Cm.dot(uD);if(u>=0&&f<=u)return n.copy(i);const d=l*f-u*c;if(d<=0&&l>=0&&u<=0)return a=l/(l-u),n.copy(r).addScaledVector(Om,a);fD.subVectors(e,o);const h=Om.dot(fD),p=Cm.dot(fD);if(p>=0&&h<=p)return n.copy(o);const m=h*c-l*p;if(m<=0&&c>=0&&p<=0)return s=c/(c-p),n.copy(r).addScaledVector(Cm,s);const g=u*p-h*f;if(g<=0&&f-u>=0&&h-p>=0)return KZ.subVectors(o,i),s=(f-u)/(f-u+(h-p)),n.copy(i).addScaledVector(KZ,s);const v=1/(g+m+d);return a=m*v,s=d*v,n.copy(r).addScaledVector(Om,a).addScaledVector(Cm,s)}equals(e){return e.a.equals(this.a)&&e.b.equals(this.b)&&e.c.equals(this.c)}}let gFt=0;class $w extends Hp{constructor(){super(),this.isMaterial=!0,Object.defineProperty(this,"id",{value:gFt++}),this.uuid=Lw(),this.name="",this.type="Material",this.blending=Bg,this.side=Lv,this.vertexColors=!1,this.opacity=1,this.transparent=!1,this.blendSrc=pye,this.blendDst=mye,this.blendEquation=Vm,this.blendSrcAlpha=null,this.blendDstAlpha=null,this.blendEquationAlpha=null,this.depthFunc=wF,this.depthTest=!0,this.depthWrite=!0,this.stencilWriteMask=255,this.stencilFunc=aFt,this.stencilRef=0,this.stencilFuncMask=255,this.stencilFail=QI,this.stencilZFail=QI,this.stencilZPass=QI,this.stencilWrite=!1,this.clippingPlanes=null,this.clipIntersection=!1,this.clipShadows=!1,this.shadowSide=null,this.colorWrite=!0,this.precision=null,this.polygonOffset=!1,this.polygonOffsetFactor=0,this.polygonOffsetUnits=0,this.dithering=!1,this.alphaToCoverage=!1,this.premultipliedAlpha=!1,this.visible=!0,this.toneMapped=!0,this.userData={},this.version=0,this._alphaTest=0}get alphaTest(){return this._alphaTest}set alphaTest(e){this._alphaTest>0!=e>0&&this.version++,this._alphaTest=e}onBuild(){}onBeforeRender(){}onBeforeCompile(){}customProgramCacheKey(){return this.onBeforeCompile.toString()}setValues(e){if(e!==void 0)for(const n in e){const r=e[n];if(r===void 0){console.warn("THREE.Material: '"+n+"' parameter is undefined.");continue}const i=this[n];if(i===void 0){console.warn("THREE."+this.type+": '"+n+"' is not a property of this material.");continue}i&&i.isColor?i.set(r):i&&i.isVector3&&r&&r.isVector3?i.copy(r):this[n]=r}}toJSON(e){const n=e===void 0||typeof e=="string";n&&(e={textures:{},images:{}});const r={metadata:{version:4.5,type:"Material",generator:"Material.toJSON"}};r.uuid=this.uuid,r.type=this.type,this.name!==""&&(r.name=this.name),this.color&&this.color.isColor&&(r.color=this.color.getHex()),this.roughness!==void 0&&(r.roughness=this.roughness),this.metalness!==void 0&&(r.metalness=this.metalness),this.sheen!==void 0&&(r.sheen=this.sheen),this.sheenColor&&this.sheenColor.isColor&&(r.sheenColor=this.sheenColor.getHex()),this.sheenRoughness!==void 0&&(r.sheenRoughness=this.sheenRoughness),this.emissive&&this.emissive.isColor&&(r.emissive=this.emissive.getHex()),this.emissiveIntensity&&this.emissiveIntensity!==1&&(r.emissiveIntensity=this.emissiveIntensity),this.specular&&this.specular.isColor&&(r.specular=this.specular.getHex()),this.specularIntensity!==void 0&&(r.specularIntensity=this.specularIntensity),this.specularColor&&this.specularColor.isColor&&(r.specularColor=this.specularColor.getHex()),this.shininess!==void 0&&(r.shininess=this.shininess),this.clearcoat!==void 0&&(r.clearcoat=this.clearcoat),this.clearcoatRoughness!==void 0&&(r.clearcoatRoughness=this.clearcoatRoughness),this.clearcoatMap&&this.clearcoatMap.isTexture&&(r.clearcoatMap=this.clearcoatMap.toJSON(e).uuid),this.clearcoatRoughnessMap&&this.clearcoatRoughnessMap.isTexture&&(r.clearcoatRoughnessMap=this.clearcoatRoughnessMap.toJSON(e).uuid),this.clearcoatNormalMap&&this.clearcoatNormalMap.isTexture&&(r.clearcoatNormalMap=this.clearcoatNormalMap.toJSON(e).uuid,r.clearcoatNormalScale=this.clearcoatNormalScale.toArray()),this.iridescence!==void 0&&(r.iridescence=this.iridescence),this.iridescenceIOR!==void 0&&(r.iridescenceIOR=this.iridescenceIOR),this.iridescenceThicknessRange!==void 0&&(r.iridescenceThicknessRange=this.iridescenceThicknessRange),this.iridescenceMap&&this.iridescenceMap.isTexture&&(r.iridescenceMap=this.iridescenceMap.toJSON(e).uuid),this.iridescenceThicknessMap&&this.iridescenceThicknessMap.isTexture&&(r.iridescenceThicknessMap=this.iridescenceThicknessMap.toJSON(e).uuid),this.map&&this.map.isTexture&&(r.map=this.map.toJSON(e).uuid),this.matcap&&this.matcap.isTexture&&(r.matcap=this.matcap.toJSON(e).uuid),this.alphaMap&&this.alphaMap.isTexture&&(r.alphaMap=this.alphaMap.toJSON(e).uuid),this.lightMap&&this.lightMap.isTexture&&(r.lightMap=this.lightMap.toJSON(e).uuid,r.lightMapIntensity=this.lightMapIntensity),this.aoMap&&this.aoMap.isTexture&&(r.aoMap=this.aoMap.toJSON(e).uuid,r.aoMapIntensity=this.aoMapIntensity),this.bumpMap&&this.bumpMap.isTexture&&(r.bumpMap=this.bumpMap.toJSON(e).uuid,r.bumpScale=this.bumpScale),this.normalMap&&this.normalMap.isTexture&&(r.normalMap=this.normalMap.toJSON(e).uuid,r.normalMapType=this.normalMapType,r.normalScale=this.normalScale.toArray()),this.displacementMap&&this.displacementMap.isTexture&&(r.displacementMap=this.displacementMap.toJSON(e).uuid,r.displacementScale=this.displacementScale,r.displacementBias=this.displacementBias),this.roughnessMap&&this.roughnessMap.isTexture&&(r.roughnessMap=this.roughnessMap.toJSON(e).uuid),this.metalnessMap&&this.metalnessMap.isTexture&&(r.metalnessMap=this.metalnessMap.toJSON(e).uuid),this.emissiveMap&&this.emissiveMap.isTexture&&(r.emissiveMap=this.emissiveMap.toJSON(e).uuid),this.specularMap&&this.specularMap.isTexture&&(r.specularMap=this.specularMap.toJSON(e).uuid),this.specularIntensityMap&&this.specularIntensityMap.isTexture&&(r.specularIntensityMap=this.specularIntensityMap.toJSON(e).uuid),this.specularColorMap&&this.specularColorMap.isTexture&&(r.specularColorMap=this.specularColorMap.toJSON(e).uuid),this.envMap&&this.envMap.isTexture&&(r.envMap=this.envMap.toJSON(e).uuid,this.combine!==void 0&&(r.combine=this.combine)),this.envMapIntensity!==void 0&&(r.envMapIntensity=this.envMapIntensity),this.reflectivity!==void 0&&(r.reflectivity=this.reflectivity),this.refractionRatio!==void 0&&(r.refractionRatio=this.refractionRatio),this.gradientMap&&this.gradientMap.isTexture&&(r.gradientMap=this.gradientMap.toJSON(e).uuid),this.transmission!==void 0&&(r.transmission=this.transmission),this.transmissionMap&&this.transmissionMap.isTexture&&(r.transmissionMap=this.transmissionMap.toJSON(e).uuid),this.thickness!==void 0&&(r.thickness=this.thickness),this.thicknessMap&&this.thicknessMap.isTexture&&(r.thicknessMap=this.thicknessMap.toJSON(e).uuid),this.attenuationDistance!==void 0&&(r.attenuationDistance=this.attenuationDistance),this.attenuationColor!==void 0&&(r.attenuationColor=this.attenuationColor.getHex()),this.size!==void 0&&(r.size=this.size),this.shadowSide!==null&&(r.shadowSide=this.shadowSide),this.sizeAttenuation!==void 0&&(r.sizeAttenuation=this.sizeAttenuation),this.blending!==Bg&&(r.blending=this.blending),this.side!==Lv&&(r.side=this.side),this.vertexColors&&(r.vertexColors=!0),this.opacity<1&&(r.opacity=this.opacity),this.transparent===!0&&(r.transparent=this.transparent),r.depthFunc=this.depthFunc,r.depthTest=this.depthTest,r.depthWrite=this.depthWrite,r.colorWrite=this.colorWrite,r.stencilWrite=this.stencilWrite,r.stencilWriteMask=this.stencilWriteMask,r.stencilFunc=this.stencilFunc,r.stencilRef=this.stencilRef,r.stencilFuncMask=this.stencilFuncMask,r.stencilFail=this.stencilFail,r.stencilZFail=this.stencilZFail,r.stencilZPass=this.stencilZPass,this.rotation!==void 0&&this.rotation!==0&&(r.rotation=this.rotation),this.polygonOffset===!0&&(r.polygonOffset=!0),this.polygonOffsetFactor!==0&&(r.polygonOffsetFactor=this.polygonOffsetFactor),this.polygonOffsetUnits!==0&&(r.polygonOffsetUnits=this.polygonOffsetUnits),this.linewidth!==void 0&&this.linewidth!==1&&(r.linewidth=this.linewidth),this.dashSize!==void 0&&(r.dashSize=this.dashSize),this.gapSize!==void 0&&(r.gapSize=this.gapSize),this.scale!==void 0&&(r.scale=this.scale),this.dithering===!0&&(r.dithering=!0),this.alphaTest>0&&(r.alphaTest=this.alphaTest),this.alphaToCoverage===!0&&(r.alphaToCoverage=this.alphaToCoverage),this.premultipliedAlpha===!0&&(r.premultipliedAlpha=this.premultipliedAlpha),this.wireframe===!0&&(r.wireframe=this.wireframe),this.wireframeLinewidth>1&&(r.wireframeLinewidth=this.wireframeLinewidth),this.wireframeLinecap!=="round"&&(r.wireframeLinecap=this.wireframeLinecap),this.wireframeLinejoin!=="round"&&(r.wireframeLinejoin=this.wireframeLinejoin),this.flatShading===!0&&(r.flatShading=this.flatShading),this.visible===!1&&(r.visible=!1),this.toneMapped===!1&&(r.toneMapped=!1),this.fog===!1&&(r.fog=!1),JSON.stringify(this.userData)!=="{}"&&(r.userData=this.userData);function i(o){const a=[];for(const s in o){const l=o[s];delete l.metadata,a.push(l)}return a}if(n){const o=i(e.textures),a=i(e.images);o.length>0&&(r.textures=o),a.length>0&&(r.images=a)}return r}clone(){return new this.constructor().copy(this)}copy(e){this.name=e.name,this.blending=e.blending,this.side=e.side,this.vertexColors=e.vertexColors,this.opacity=e.opacity,this.transparent=e.transparent,this.blendSrc=e.blendSrc,this.blendDst=e.blendDst,this.blendEquation=e.blendEquation,this.blendSrcAlpha=e.blendSrcAlpha,this.blendDstAlpha=e.blendDstAlpha,this.blendEquationAlpha=e.blendEquationAlpha,this.depthFunc=e.depthFunc,this.depthTest=e.depthTest,this.depthWrite=e.depthWrite,this.stencilWriteMask=e.stencilWriteMask,this.stencilFunc=e.stencilFunc,this.stencilRef=e.stencilRef,this.stencilFuncMask=e.stencilFuncMask,this.stencilFail=e.stencilFail,this.stencilZFail=e.stencilZFail,this.stencilZPass=e.stencilZPass,this.stencilWrite=e.stencilWrite;const n=e.clippingPlanes;let r=null;if(n!==null){const i=n.length;r=new Array(i);for(let o=0;o!==i;++o)r[o]=n[o].clone()}return this.clippingPlanes=r,this.clipIntersection=e.clipIntersection,this.clipShadows=e.clipShadows,this.shadowSide=e.shadowSide,this.colorWrite=e.colorWrite,this.precision=e.precision,this.polygonOffset=e.polygonOffset,this.polygonOffsetFactor=e.polygonOffsetFactor,this.polygonOffsetUnits=e.polygonOffsetUnits,this.dithering=e.dithering,this.alphaTest=e.alphaTest,this.alphaToCoverage=e.alphaToCoverage,this.premultipliedAlpha=e.premultipliedAlpha,this.visible=e.visible,this.toneMapped=e.toneMapped,this.userData=JSON.parse(JSON.stringify(e.userData)),this}dispose(){this.dispatchEvent({type:"dispose"})}set needsUpdate(e){e===!0&&this.version++}}class O6 extends $w{constructor(e){super(),this.isMeshBasicMaterial=!0,this.type="MeshBasicMaterial",this.color=new lr(16777215),this.map=null,this.lightMap=null,this.lightMapIntensity=1,this.aoMap=null,this.aoMapIntensity=1,this.specularMap=null,this.alphaMap=null,this.envMap=null,this.combine=gye,this.reflectivity=1,this.refractionRatio=.98,this.wireframe=!1,this.wireframeLinewidth=1,this.wireframeLinecap="round",this.wireframeLinejoin="round",this.fog=!0,this.setValues(e)}copy(e){return super.copy(e),this.color.copy(e.color),this.map=e.map,this.lightMap=e.lightMap,this.lightMapIntensity=e.lightMapIntensity,this.aoMap=e.aoMap,this.aoMapIntensity=e.aoMapIntensity,this.specularMap=e.specularMap,this.alphaMap=e.alphaMap,this.envMap=e.envMap,this.combine=e.combine,this.reflectivity=e.reflectivity,this.refractionRatio=e.refractionRatio,this.wireframe=e.wireframe,this.wireframeLinewidth=e.wireframeLinewidth,this.wireframeLinecap=e.wireframeLinecap,this.wireframeLinejoin=e.wireframeLinejoin,this.fog=e.fog,this}}const Dr=new Se,VO=new qt;class as{constructor(e,n,r){if(Array.isArray(e))throw new TypeError("THREE.BufferAttribute: array should be a Typed Array.");this.isBufferAttribute=!0,this.name="",this.array=e,this.itemSize=n,this.count=e!==void 0?e.length/n:0,this.normalized=r===!0,this.usage=FZ,this.updateRange={offset:0,count:-1},this.version=0}onUploadCallback(){}set needsUpdate(e){e===!0&&this.version++}setUsage(e){return this.usage=e,this}copy(e){return this.name=e.name,this.array=new e.array.constructor(e.array),this.itemSize=e.itemSize,this.count=e.count,this.normalized=e.normalized,this.usage=e.usage,this}copyAt(e,n,r){e*=this.itemSize,r*=n.itemSize;for(let i=0,o=this.itemSize;i<o;i++)this.array[e+i]=n.array[r+i];return this}copyArray(e){return this.array.set(e),this}applyMatrix3(e){if(this.itemSize===2)for(let n=0,r=this.count;n<r;n++)VO.fromBufferAttribute(this,n),VO.applyMatrix3(e),this.setXY(n,VO.x,VO.y);else if(this.itemSize===3)for(let n=0,r=this.count;n<r;n++)Dr.fromBufferAttribute(this,n),Dr.applyMatrix3(e),this.setXYZ(n,Dr.x,Dr.y,Dr.z);return this}applyMatrix4(e){for(let n=0,r=this.count;n<r;n++)Dr.fromBufferAttribute(this,n),Dr.applyMatrix4(e),this.setXYZ(n,Dr.x,Dr.y,Dr.z);return this}applyNormalMatrix(e){for(let n=0,r=this.count;n<r;n++)Dr.fromBufferAttribute(this,n),Dr.applyNormalMatrix(e),this.setXYZ(n,Dr.x,Dr.y,Dr.z);return this}transformDirection(e){for(let n=0,r=this.count;n<r;n++)Dr.fromBufferAttribute(this,n),Dr.transformDirection(e),this.setXYZ(n,Dr.x,Dr.y,Dr.z);return this}set(e,n=0){return this.array.set(e,n),this}getX(e){let n=this.array[e*this.itemSize];return this.normalized&&(n=DO(n,this.array)),n}setX(e,n){return this.normalized&&(n=Jo(n,this.array)),this.array[e*this.itemSize]=n,this}getY(e){let n=this.array[e*this.itemSize+1];return this.normalized&&(n=DO(n,this.array)),n}setY(e,n){return this.normalized&&(n=Jo(n,this.array)),this.array[e*this.itemSize+1]=n,this}getZ(e){let n=this.array[e*this.itemSize+2];return this.normalized&&(n=DO(n,this.array)),n}setZ(e,n){return this.normalized&&(n=Jo(n,this.array)),this.array[e*this.itemSize+2]=n,this}getW(e){let n=this.array[e*this.itemSize+3];return this.normalized&&(n=DO(n,this.array)),n}setW(e,n){return this.normalized&&(n=Jo(n,this.array)),this.array[e*this.itemSize+3]=n,this}setXY(e,n,r){return e*=this.itemSize,this.normalized&&(n=Jo(n,this.array),r=Jo(r,this.array)),this.array[e+0]=n,this.array[e+1]=r,this}setXYZ(e,n,r,i){return e*=this.itemSize,this.normalized&&(n=Jo(n,this.array),r=Jo(r,this.array),i=Jo(i,this.array)),this.array[e+0]=n,this.array[e+1]=r,this.array[e+2]=i,this}setXYZW(e,n,r,i,o){return e*=this.itemSize,this.normalized&&(n=Jo(n,this.array),r=Jo(r,this.array),i=Jo(i,this.array),o=Jo(o,this.array)),this.array[e+0]=n,this.array[e+1]=r,this.array[e+2]=i,this.array[e+3]=o,this}onUpload(e){return this.onUploadCallback=e,this}clone(){return new this.constructor(this.array,this.itemSize).copy(this)}toJSON(){const e={itemSize:this.itemSize,type:this.array.constructor.name,array:Array.from(this.array),normalized:this.normalized};return this.name!==""&&(e.name=this.name),this.usage!==FZ&&(e.usage=this.usage),(this.updateRange.offset!==0||this.updateRange.count!==-1)&&(e.updateRange=this.updateRange),e}copyColorsArray(){console.error("THREE.BufferAttribute: copyColorsArray() was removed in r144.")}copyVector2sArray(){console.error("THREE.BufferAttribute: copyVector2sArray() was removed in r144.")}copyVector3sArray(){console.error("THREE.BufferAttribute: copyVector3sArray() was removed in r144.")}copyVector4sArray(){console.error("THREE.BufferAttribute: copyVector4sArray() was removed in r144.")}}class Pye extends as{constructor(e,n,r){super(new Uint16Array(e),n,r)}}class Mye extends as{constructor(e,n,r){super(new Uint32Array(e),n,r)}}class lu extends as{constructor(e,n,r){super(new Float32Array(e),n,r)}}let vFt=0;const Na=new Hn,dD=new zo,Tm=new Se,ta=new Qy,Y0=new Qy,oi=new Se;class Eu extends Hp{constructor(){super(),this.isBufferGeometry=!0,Object.defineProperty(this,"id",{value:vFt++}),this.uuid=Lw(),this.name="",this.type="BufferGeometry",this.index=null,this.attributes={},this.morphAttributes={},this.morphTargetsRelative=!1,this.groups=[],this.boundingBox=null,this.boundingSphere=null,this.drawRange={start:0,count:1/0},this.userData={}}getIndex(){return this.index}setIndex(e){return Array.isArray(e)?this.index=new(bye(e)?Mye:Pye)(e,1):this.index=e,this}getAttribute(e){return this.attributes[e]}setAttribute(e,n){return this.attributes[e]=n,this}deleteAttribute(e){return delete this.attributes[e],this}hasAttribute(e){return this.attributes[e]!==void 0}addGroup(e,n,r=0){this.groups.push({start:e,count:n,materialIndex:r})}clearGroups(){this.groups=[]}setDrawRange(e,n){this.drawRange.start=e,this.drawRange.count=n}applyMatrix4(e){const n=this.attributes.position;n!==void 0&&(n.applyMatrix4(e),n.needsUpdate=!0);const r=this.attributes.normal;if(r!==void 0){const o=new va().getNormalMatrix(e);r.applyNormalMatrix(o),r.needsUpdate=!0}const i=this.attributes.tangent;return i!==void 0&&(i.transformDirection(e),i.needsUpdate=!0),this.boundingBox!==null&&this.computeBoundingBox(),this.boundingSphere!==null&&this.computeBoundingSphere(),this}applyQuaternion(e){return Na.makeRotationFromQuaternion(e),this.applyMatrix4(Na),this}rotateX(e){return Na.makeRotationX(e),this.applyMatrix4(Na),this}rotateY(e){return Na.makeRotationY(e),this.applyMatrix4(Na),this}rotateZ(e){return Na.makeRotationZ(e),this.applyMatrix4(Na),this}translate(e,n,r){return Na.makeTranslation(e,n,r),this.applyMatrix4(Na),this}scale(e,n,r){return Na.makeScale(e,n,r),this.applyMatrix4(Na),this}lookAt(e){return dD.lookAt(e),dD.updateMatrix(),this.applyMatrix4(dD.matrix),this}center(){return this.computeBoundingBox(),this.boundingBox.getCenter(Tm).negate(),this.translate(Tm.x,Tm.y,Tm.z),this}setFromPoints(e){const n=[];for(let r=0,i=e.length;r<i;r++){const o=e[r];n.push(o.x,o.y,o.z||0)}return this.setAttribute("position",new lu(n,3)),this}computeBoundingBox(){this.boundingBox===null&&(this.boundingBox=new Qy);const e=this.attributes.position,n=this.morphAttributes.position;if(e&&e.isGLBufferAttribute){console.error('THREE.BufferGeometry.computeBoundingBox(): GLBufferAttribute requires a manual bounding box. Alternatively set "mesh.frustumCulled" to "false".',this),this.boundingBox.set(new Se(-1/0,-1/0,-1/0),new Se(1/0,1/0,1/0));return}if(e!==void 0){if(this.boundingBox.setFromBufferAttribute(e),n)for(let r=0,i=n.length;r<i;r++){const o=n[r];ta.setFromBufferAttribute(o),this.morphTargetsRelative?(oi.addVectors(this.boundingBox.min,ta.min),this.boundingBox.expandByPoint(oi),oi.addVectors(this.boundingBox.max,ta.max),this.boundingBox.expandByPoint(oi)):(this.boundingBox.expandByPoint(ta.min),this.boundingBox.expandByPoint(ta.max))}}else this.boundingBox.makeEmpty();(isNaN(this.boundingBox.min.x)||isNaN(this.boundingBox.min.y)||isNaN(this.boundingBox.min.z))&&console.error('THREE.BufferGeometry.computeBoundingBox(): Computed min/max have NaN values. The "position" attribute is likely to have NaN values.',this)}computeBoundingSphere(){this.boundingSphere===null&&(this.boundingSphere=new Nk);const e=this.attributes.position,n=this.morphAttributes.position;if(e&&e.isGLBufferAttribute){console.error('THREE.BufferGeometry.computeBoundingSphere(): GLBufferAttribute requires a manual bounding sphere. Alternatively set "mesh.frustumCulled" to "false".',this),this.boundingSphere.set(new Se,1/0);return}if(e){const r=this.boundingSphere.center;if(ta.setFromBufferAttribute(e),n)for(let o=0,a=n.length;o<a;o++){const s=n[o];Y0.setFromBufferAttribute(s),this.morphTargetsRelative?(oi.addVectors(ta.min,Y0.min),ta.expandByPoint(oi),oi.addVectors(ta.max,Y0.max),ta.expandByPoint(oi)):(ta.expandByPoint(Y0.min),ta.expandByPoint(Y0.max))}ta.getCenter(r);let i=0;for(let o=0,a=e.count;o<a;o++)oi.fromBufferAttribute(e,o),i=Math.max(i,r.distanceToSquared(oi));if(n)for(let o=0,a=n.length;o<a;o++){const s=n[o],l=this.morphTargetsRelative;for(let c=0,u=s.count;c<u;c++)oi.fromBufferAttribute(s,c),l&&(Tm.fromBufferAttribute(e,c),oi.add(Tm)),i=Math.max(i,r.distanceToSquared(oi))}this.boundingSphere.radius=Math.sqrt(i),isNaN(this.boundingSphere.radius)&&console.error('THREE.BufferGeometry.computeBoundingSphere(): Computed radius is NaN. The "position" attribute is likely to have NaN values.',this)}}computeTangents(){const e=this.index,n=this.attributes;if(e===null||n.position===void 0||n.normal===void 0||n.uv===void 0){console.error("THREE.BufferGeometry: .computeTangents() failed. Missing required attributes (index, position, normal or uv)");return}const r=e.array,i=n.position.array,o=n.normal.array,a=n.uv.array,s=i.length/3;this.hasAttribute("tangent")===!1&&this.setAttribute("tangent",new as(new Float32Array(4*s),4));const l=this.getAttribute("tangent").array,c=[],u=[];for(let k=0;k<s;k++)c[k]=new Se,u[k]=new Se;const f=new Se,d=new Se,h=new Se,p=new qt,m=new qt,g=new qt,v=new Se,y=new Se;function x(k,I,P){f.fromArray(i,k*3),d.fromArray(i,I*3),h.fromArray(i,P*3),p.fromArray(a,k*2),m.fromArray(a,I*2),g.fromArray(a,P*2),d.sub(f),h.sub(f),m.sub(p),g.sub(p);const R=1/(m.x*g.y-g.x*m.y);isFinite(R)&&(v.copy(d).multiplyScalar(g.y).addScaledVector(h,-m.y).multiplyScalar(R),y.copy(h).multiplyScalar(m.x).addScaledVector(d,-g.x).multiplyScalar(R),c[k].add(v),c[I].add(v),c[P].add(v),u[k].add(y),u[I].add(y),u[P].add(y))}let b=this.groups;b.length===0&&(b=[{start:0,count:r.length}]);for(let k=0,I=b.length;k<I;++k){const P=b[k],R=P.start,T=P.count;for(let L=R,z=R+T;L<z;L+=3)x(r[L+0],r[L+1],r[L+2])}const _=new Se,S=new Se,O=new Se,C=new Se;function E(k){O.fromArray(o,k*3),C.copy(O);const I=c[k];_.copy(I),_.sub(O.multiplyScalar(O.dot(I))).normalize(),S.crossVectors(C,I);const R=S.dot(u[k])<0?-1:1;l[k*4]=_.x,l[k*4+1]=_.y,l[k*4+2]=_.z,l[k*4+3]=R}for(let k=0,I=b.length;k<I;++k){const P=b[k],R=P.start,T=P.count;for(let L=R,z=R+T;L<z;L+=3)E(r[L+0]),E(r[L+1]),E(r[L+2])}}computeVertexNormals(){const e=this.index,n=this.getAttribute("position");if(n!==void 0){let r=this.getAttribute("normal");if(r===void 0)r=new as(new Float32Array(n.count*3),3),this.setAttribute("normal",r);else for(let d=0,h=r.count;d<h;d++)r.setXYZ(d,0,0,0);const i=new Se,o=new Se,a=new Se,s=new Se,l=new Se,c=new Se,u=new Se,f=new Se;if(e)for(let d=0,h=e.count;d<h;d+=3){const p=e.getX(d+0),m=e.getX(d+1),g=e.getX(d+2);i.fromBufferAttribute(n,p),o.fromBufferAttribute(n,m),a.fromBufferAttribute(n,g),u.subVectors(a,o),f.subVectors(i,o),u.cross(f),s.fromBufferAttribute(r,p),l.fromBufferAttribute(r,m),c.fromBufferAttribute(r,g),s.add(u),l.add(u),c.add(u),r.setXYZ(p,s.x,s.y,s.z),r.setXYZ(m,l.x,l.y,l.z),r.setXYZ(g,c.x,c.y,c.z)}else for(let d=0,h=n.count;d<h;d+=3)i.fromBufferAttribute(n,d+0),o.fromBufferAttribute(n,d+1),a.fromBufferAttribute(n,d+2),u.subVectors(a,o),f.subVectors(i,o),u.cross(f),r.setXYZ(d+0,u.x,u.y,u.z),r.setXYZ(d+1,u.x,u.y,u.z),r.setXYZ(d+2,u.x,u.y,u.z);this.normalizeNormals(),r.needsUpdate=!0}}merge(){return console.error("THREE.BufferGeometry.merge() has been removed. Use THREE.BufferGeometryUtils.mergeBufferGeometries() instead."),this}normalizeNormals(){const e=this.attributes.normal;for(let n=0,r=e.count;n<r;n++)oi.fromBufferAttribute(e,n),oi.normalize(),e.setXYZ(n,oi.x,oi.y,oi.z)}toNonIndexed(){function e(s,l){const c=s.array,u=s.itemSize,f=s.normalized,d=new c.constructor(l.length*u);let h=0,p=0;for(let m=0,g=l.length;m<g;m++){s.isInterleavedBufferAttribute?h=l[m]*s.data.stride+s.offset:h=l[m]*u;for(let v=0;v<u;v++)d[p++]=c[h++]}return new as(d,u,f)}if(this.index===null)return console.warn("THREE.BufferGeometry.toNonIndexed(): BufferGeometry is already non-indexed."),this;const n=new Eu,r=this.index.array,i=this.attributes;for(const s in i){const l=i[s],c=e(l,r);n.setAttribute(s,c)}const o=this.morphAttributes;for(const s in o){const l=[],c=o[s];for(let u=0,f=c.length;u<f;u++){const d=c[u],h=e(d,r);l.push(h)}n.morphAttributes[s]=l}n.morphTargetsRelative=this.morphTargetsRelative;const a=this.groups;for(let s=0,l=a.length;s<l;s++){const c=a[s];n.addGroup(c.start,c.count,c.materialIndex)}return n}toJSON(){const e={metadata:{version:4.5,type:"BufferGeometry",generator:"BufferGeometry.toJSON"}};if(e.uuid=this.uuid,e.type=this.type,this.name!==""&&(e.name=this.name),Object.keys(this.userData).length>0&&(e.userData=this.userData),this.parameters!==void 0){const l=this.parameters;for(const c in l)l[c]!==void 0&&(e[c]=l[c]);return e}e.data={attributes:{}};const n=this.index;n!==null&&(e.data.index={type:n.array.constructor.name,array:Array.prototype.slice.call(n.array)});const r=this.attributes;for(const l in r){const c=r[l];e.data.attributes[l]=c.toJSON(e.data)}const i={};let o=!1;for(const l in this.morphAttributes){const c=this.morphAttributes[l],u=[];for(let f=0,d=c.length;f<d;f++){const h=c[f];u.push(h.toJSON(e.data))}u.length>0&&(i[l]=u,o=!0)}o&&(e.data.morphAttributes=i,e.data.morphTargetsRelative=this.morphTargetsRelative);const a=this.groups;a.length>0&&(e.data.groups=JSON.parse(JSON.stringify(a)));const s=this.boundingSphere;return s!==null&&(e.data.boundingSphere={center:s.center.toArray(),radius:s.radius}),e}clone(){return new this.constructor().copy(this)}copy(e){this.index=null,this.attributes={},this.morphAttributes={},this.groups=[],this.boundingBox=null,this.boundingSphere=null;const n={};this.name=e.name;const r=e.index;r!==null&&this.setIndex(r.clone(n));const i=e.attributes;for(const c in i){const u=i[c];this.setAttribute(c,u.clone(n))}const o=e.morphAttributes;for(const c in o){const u=[],f=o[c];for(let d=0,h=f.length;d<h;d++)u.push(f[d].clone(n));this.morphAttributes[c]=u}this.morphTargetsRelative=e.morphTargetsRelative;const a=e.groups;for(let c=0,u=a.length;c<u;c++){const f=a[c];this.addGroup(f.start,f.count,f.materialIndex)}const s=e.boundingBox;s!==null&&(this.boundingBox=s.clone());const l=e.boundingSphere;return l!==null&&(this.boundingSphere=l.clone()),this.drawRange.start=e.drawRange.start,this.drawRange.count=e.drawRange.count,this.userData=e.userData,e.parameters!==void 0&&(this.parameters=Object.assign({},e.parameters)),this}dispose(){this.dispatchEvent({type:"dispose"})}}const ZZ=new Hn,Em=new Tye,hD=new Nk,Vu=new Se,Gu=new Se,Hu=new Se,pD=new Se,mD=new Se,gD=new Se,GO=new Se,HO=new Se,qO=new Se,XO=new qt,QO=new qt,YO=new qt,vD=new Se,KO=new Se;class Bl extends zo{constructor(e=new Eu,n=new O6){super(),this.isMesh=!0,this.type="Mesh",this.geometry=e,this.material=n,this.updateMorphTargets()}copy(e,n){return super.copy(e,n),e.morphTargetInfluences!==void 0&&(this.morphTargetInfluences=e.morphTargetInfluences.slice()),e.morphTargetDictionary!==void 0&&(this.morphTargetDictionary=Object.assign({},e.morphTargetDictionary)),this.material=e.material,this.geometry=e.geometry,this}updateMorphTargets(){const n=this.geometry.morphAttributes,r=Object.keys(n);if(r.length>0){const i=n[r[0]];if(i!==void 0){this.morphTargetInfluences=[],this.morphTargetDictionary={};for(let o=0,a=i.length;o<a;o++){const s=i[o].name||String(o);this.morphTargetInfluences.push(0),this.morphTargetDictionary[s]=o}}}}raycast(e,n){const r=this.geometry,i=this.material,o=this.matrixWorld;if(i===void 0||(r.boundingSphere===null&&r.computeBoundingSphere(),hD.copy(r.boundingSphere),hD.applyMatrix4(o),e.ray.intersectsSphere(hD)===!1)||(ZZ.copy(o).invert(),Em.copy(e.ray).applyMatrix4(ZZ),r.boundingBox!==null&&Em.intersectsBox(r.boundingBox)===!1))return;let a;const s=r.index,l=r.attributes.position,c=r.morphAttributes.position,u=r.morphTargetsRelative,f=r.attributes.uv,d=r.attributes.uv2,h=r.groups,p=r.drawRange;if(s!==null)if(Array.isArray(i))for(let m=0,g=h.length;m<g;m++){const v=h[m],y=i[v.materialIndex],x=Math.max(v.start,p.start),b=Math.min(s.count,Math.min(v.start+v.count,p.start+p.count));for(let _=x,S=b;_<S;_+=3){const O=s.getX(_),C=s.getX(_+1),E=s.getX(_+2);a=ZO(this,y,e,Em,l,c,u,f,d,O,C,E),a&&(a.faceIndex=Math.floor(_/3),a.face.materialIndex=v.materialIndex,n.push(a))}}else{const m=Math.max(0,p.start),g=Math.min(s.count,p.start+p.count);for(let v=m,y=g;v<y;v+=3){const x=s.getX(v),b=s.getX(v+1),_=s.getX(v+2);a=ZO(this,i,e,Em,l,c,u,f,d,x,b,_),a&&(a.faceIndex=Math.floor(v/3),n.push(a))}}else if(l!==void 0)if(Array.isArray(i))for(let m=0,g=h.length;m<g;m++){const v=h[m],y=i[v.materialIndex],x=Math.max(v.start,p.start),b=Math.min(l.count,Math.min(v.start+v.count,p.start+p.count));for(let _=x,S=b;_<S;_+=3){const O=_,C=_+1,E=_+2;a=ZO(this,y,e,Em,l,c,u,f,d,O,C,E),a&&(a.faceIndex=Math.floor(_/3),a.face.materialIndex=v.materialIndex,n.push(a))}}else{const m=Math.max(0,p.start),g=Math.min(l.count,p.start+p.count);for(let v=m,y=g;v<y;v+=3){const x=v,b=v+1,_=v+2;a=ZO(this,i,e,Em,l,c,u,f,d,x,b,_),a&&(a.faceIndex=Math.floor(v/3),n.push(a))}}}}function yFt(t,e,n,r,i,o,a,s){let l;if(e.side===_a?l=r.intersectTriangle(a,o,i,!0,s):l=r.intersectTriangle(i,o,a,e.side!==Yc,s),l===null)return null;KO.copy(s),KO.applyMatrix4(t.matrixWorld);const c=n.ray.origin.distanceTo(KO);return c<n.near||c>n.far?null:{distance:c,point:KO.clone(),object:t}}function ZO(t,e,n,r,i,o,a,s,l,c,u,f){Vu.fromBufferAttribute(i,c),Gu.fromBufferAttribute(i,u),Hu.fromBufferAttribute(i,f);const d=t.morphTargetInfluences;if(o&&d){GO.set(0,0,0),HO.set(0,0,0),qO.set(0,0,0);for(let p=0,m=o.length;p<m;p++){const g=d[p],v=o[p];g!==0&&(pD.fromBufferAttribute(v,c),mD.fromBufferAttribute(v,u),gD.fromBufferAttribute(v,f),a?(GO.addScaledVector(pD,g),HO.addScaledVector(mD,g),qO.addScaledVector(gD,g)):(GO.addScaledVector(pD.sub(Vu),g),HO.addScaledVector(mD.sub(Gu),g),qO.addScaledVector(gD.sub(Hu),g)))}Vu.add(GO),Gu.add(HO),Hu.add(qO)}t.isSkinnedMesh&&(t.boneTransform(c,Vu),t.boneTransform(u,Gu),t.boneTransform(f,Hu));const h=yFt(t,e,n,r,Vu,Gu,Hu,vD);if(h){s&&(XO.fromBufferAttribute(s,c),QO.fromBufferAttribute(s,u),YO.fromBufferAttribute(s,f),h.uv=Wc.getUV(vD,Vu,Gu,Hu,XO,QO,YO,new qt)),l&&(XO.fromBufferAttribute(l,c),QO.fromBufferAttribute(l,u),YO.fromBufferAttribute(l,f),h.uv2=Wc.getUV(vD,Vu,Gu,Hu,XO,QO,YO,new qt));const p={a:c,b:u,c:f,normal:new Se,materialIndex:0};Wc.getNormal(Vu,Gu,Hu,p.normal),h.face=p}return h}class Yy extends Eu{constructor(e=1,n=1,r=1,i=1,o=1,a=1){super(),this.type="BoxGeometry",this.parameters={width:e,height:n,depth:r,widthSegments:i,heightSegments:o,depthSegments:a};const s=this;i=Math.floor(i),o=Math.floor(o),a=Math.floor(a);const l=[],c=[],u=[],f=[];let d=0,h=0;p("z","y","x",-1,-1,r,n,e,a,o,0),p("z","y","x",1,-1,r,n,-e,a,o,1),p("x","z","y",1,1,e,r,n,i,a,2),p("x","z","y",1,-1,e,r,-n,i,a,3),p("x","y","z",1,-1,e,n,r,i,o,4),p("x","y","z",-1,-1,e,n,-r,i,o,5),this.setIndex(l),this.setAttribute("position",new lu(c,3)),this.setAttribute("normal",new lu(u,3)),this.setAttribute("uv",new lu(f,2));function p(m,g,v,y,x,b,_,S,O,C,E){const k=b/O,I=_/C,P=b/2,R=_/2,T=S/2,L=O+1,z=C+1;let B=0,U=0;const W=new Se;for(let $=0;$<z;$++){const N=$*I-R;for(let D=0;D<L;D++){const A=D*k-P;W[m]=A*y,W[g]=N*x,W[v]=T,c.push(W.x,W.y,W.z),W[m]=0,W[g]=0,W[v]=S>0?1:-1,u.push(W.x,W.y,W.z),f.push(D/O),f.push(1-$/C),B+=1}}for(let $=0;$<C;$++)for(let N=0;N<O;N++){const D=d+N+L*$,A=d+N+L*($+1),q=d+(N+1)+L*($+1),Y=d+(N+1)+L*$;l.push(D,A,Y),l.push(A,q,Y),U+=6}s.addGroup(h,U,E),h+=U,d+=B}}static fromJSON(e){return new Yy(e.width,e.height,e.depth,e.widthSegments,e.heightSegments,e.depthSegments)}}function jv(t){const e={};for(const n in t){e[n]={};for(const r in t[n]){const i=t[n][r];i&&(i.isColor||i.isMatrix3||i.isMatrix4||i.isVector2||i.isVector3||i.isVector4||i.isTexture||i.isQuaternion)?e[n][r]=i.clone():Array.isArray(i)?e[n][r]=i.slice():e[n][r]=i}}return e}function zi(t){const e={};for(let n=0;n<t.length;n++){const r=jv(t[n]);for(const i in r)e[i]=r[i]}return e}function xFt(t){const e=[];for(let n=0;n<t.length;n++)e.push(t[n].clone());return e}const kye={clone:jv,merge:zi};var bFt=`void main() {
	gl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );
}`,_Ft=`void main() {
	gl_FragColor = vec4( 1.0, 0.0, 0.0, 1.0 );
}`;class ud extends $w{constructor(e){super(),this.isShaderMaterial=!0,this.type="ShaderMaterial",this.defines={},this.uniforms={},this.uniformsGroups=[],this.vertexShader=bFt,this.fragmentShader=_Ft,this.linewidth=1,this.wireframe=!1,this.wireframeLinewidth=1,this.fog=!1,this.lights=!1,this.clipping=!1,this.extensions={derivatives:!1,fragDepth:!1,drawBuffers:!1,shaderTextureLOD:!1},this.defaultAttributeValues={color:[1,1,1],uv:[0,0],uv2:[0,0]},this.index0AttributeName=void 0,this.uniformsNeedUpdate=!1,this.glslVersion=null,e!==void 0&&this.setValues(e)}copy(e){return super.copy(e),this.fragmentShader=e.fragmentShader,this.vertexShader=e.vertexShader,this.uniforms=jv(e.uniforms),this.uniformsGroups=xFt(e.uniformsGroups),this.defines=Object.assign({},e.defines),this.wireframe=e.wireframe,this.wireframeLinewidth=e.wireframeLinewidth,this.fog=e.fog,this.lights=e.lights,this.clipping=e.clipping,this.extensions=Object.assign({},e.extensions),this.glslVersion=e.glslVersion,this}toJSON(e){const n=super.toJSON(e);n.glslVersion=this.glslVersion,n.uniforms={};for(const i in this.uniforms){const a=this.uniforms[i].value;a&&a.isTexture?n.uniforms[i]={type:"t",value:a.toJSON(e).uuid}:a&&a.isColor?n.uniforms[i]={type:"c",value:a.getHex()}:a&&a.isVector2?n.uniforms[i]={type:"v2",value:a.toArray()}:a&&a.isVector3?n.uniforms[i]={type:"v3",value:a.toArray()}:a&&a.isVector4?n.uniforms[i]={type:"v4",value:a.toArray()}:a&&a.isMatrix3?n.uniforms[i]={type:"m3",value:a.toArray()}:a&&a.isMatrix4?n.uniforms[i]={type:"m4",value:a.toArray()}:n.uniforms[i]={value:a}}Object.keys(this.defines).length>0&&(n.defines=this.defines),n.vertexShader=this.vertexShader,n.fragmentShader=this.fragmentShader;const r={};for(const i in this.extensions)this.extensions[i]===!0&&(r[i]=!0);return Object.keys(r).length>0&&(n.extensions=r),n}}class Aye extends zo{constructor(){super(),this.isCamera=!0,this.type="Camera",this.matrixWorldInverse=new Hn,this.projectionMatrix=new Hn,this.projectionMatrixInverse=new Hn}copy(e,n){return super.copy(e,n),this.matrixWorldInverse.copy(e.matrixWorldInverse),this.projectionMatrix.copy(e.projectionMatrix),this.projectionMatrixInverse.copy(e.projectionMatrixInverse),this}getWorldDirection(e){this.updateWorldMatrix(!0,!1);const n=this.matrixWorld.elements;return e.set(-n[8],-n[9],-n[10]).normalize()}updateMatrixWorld(e){super.updateMatrixWorld(e),this.matrixWorldInverse.copy(this.matrixWorld).invert()}updateWorldMatrix(e,n){super.updateWorldMatrix(e,n),this.matrixWorldInverse.copy(this.matrixWorld).invert()}clone(){return new this.constructor().copy(this)}}class Us extends Aye{constructor(e=50,n=1,r=.1,i=2e3){super(),this.isPerspectiveCamera=!0,this.type="PerspectiveCamera",this.fov=e,this.zoom=1,this.near=r,this.far=i,this.focus=10,this.aspect=n,this.view=null,this.filmGauge=35,this.filmOffset=0,this.updateProjectionMatrix()}copy(e,n){return super.copy(e,n),this.fov=e.fov,this.zoom=e.zoom,this.near=e.near,this.far=e.far,this.focus=e.focus,this.aspect=e.aspect,this.view=e.view===null?null:Object.assign({},e.view),this.filmGauge=e.filmGauge,this.filmOffset=e.filmOffset,this}setFocalLength(e){const n=.5*this.getFilmHeight()/e;this.fov=BZ*2*Math.atan(n),this.updateProjectionMatrix()}getFocalLength(){const e=Math.tan(YI*.5*this.fov);return .5*this.getFilmHeight()/e}getEffectiveFOV(){return BZ*2*Math.atan(Math.tan(YI*.5*this.fov)/this.zoom)}getFilmWidth(){return this.filmGauge*Math.min(this.aspect,1)}getFilmHeight(){return this.filmGauge/Math.max(this.aspect,1)}setViewOffset(e,n,r,i,o,a){this.aspect=e/n,this.view===null&&(this.view={enabled:!0,fullWidth:1,fullHeight:1,offsetX:0,offsetY:0,width:1,height:1}),this.view.enabled=!0,this.view.fullWidth=e,this.view.fullHeight=n,this.view.offsetX=r,this.view.offsetY=i,this.view.width=o,this.view.height=a,this.updateProjectionMatrix()}clearViewOffset(){this.view!==null&&(this.view.enabled=!1),this.updateProjectionMatrix()}updateProjectionMatrix(){const e=this.near;let n=e*Math.tan(YI*.5*this.fov)/this.zoom,r=2*n,i=this.aspect*r,o=-.5*i;const a=this.view;if(this.view!==null&&this.view.enabled){const l=a.fullWidth,c=a.fullHeight;o+=a.offsetX*i/l,n-=a.offsetY*r/c,i*=a.width/l,r*=a.height/c}const s=this.filmOffset;s!==0&&(o+=e*s/this.getFilmWidth()),this.projectionMatrix.makePerspective(o,o+i,n,n-r,e,this.far),this.projectionMatrixInverse.copy(this.projectionMatrix).invert()}toJSON(e){const n=super.toJSON(e);return n.object.fov=this.fov,n.object.zoom=this.zoom,n.object.near=this.near,n.object.far=this.far,n.object.focus=this.focus,n.object.aspect=this.aspect,this.view!==null&&(n.object.view=Object.assign({},this.view)),n.object.filmGauge=this.filmGauge,n.object.filmOffset=this.filmOffset,n}}const Pm=90,Mm=1;class wFt extends zo{constructor(e,n,r){super(),this.type="CubeCamera",this.renderTarget=r;const i=new Us(Pm,Mm,e,n);i.layers=this.layers,i.up.set(0,-1,0),i.lookAt(new Se(1,0,0)),this.add(i);const o=new Us(Pm,Mm,e,n);o.layers=this.layers,o.up.set(0,-1,0),o.lookAt(new Se(-1,0,0)),this.add(o);const a=new Us(Pm,Mm,e,n);a.layers=this.layers,a.up.set(0,0,1),a.lookAt(new Se(0,1,0)),this.add(a);const s=new Us(Pm,Mm,e,n);s.layers=this.layers,s.up.set(0,0,-1),s.lookAt(new Se(0,-1,0)),this.add(s);const l=new Us(Pm,Mm,e,n);l.layers=this.layers,l.up.set(0,-1,0),l.lookAt(new Se(0,0,1)),this.add(l);const c=new Us(Pm,Mm,e,n);c.layers=this.layers,c.up.set(0,-1,0),c.lookAt(new Se(0,0,-1)),this.add(c)}update(e,n){this.parent===null&&this.updateMatrixWorld();const r=this.renderTarget,[i,o,a,s,l,c]=this.children,u=e.getRenderTarget(),f=e.toneMapping,d=e.xr.enabled;e.toneMapping=su,e.xr.enabled=!1;const h=r.texture.generateMipmaps;r.texture.generateMipmaps=!1,e.setRenderTarget(r,0),e.render(n,i),e.setRenderTarget(r,1),e.render(n,o),e.setRenderTarget(r,2),e.render(n,a),e.setRenderTarget(r,3),e.render(n,s),e.setRenderTarget(r,4),e.render(n,l),r.texture.generateMipmaps=h,e.setRenderTarget(r,5),e.render(n,c),e.setRenderTarget(u),e.toneMapping=f,e.xr.enabled=d,r.texture.needsPMREMUpdate=!0}}class Rye extends Ta{constructor(e,n,r,i,o,a,s,l,c,u){e=e!==void 0?e:[],n=n!==void 0?n:Nv,super(e,n,r,i,o,a,s,l,c,u),this.isCubeTexture=!0,this.flipY=!1}get images(){return this.image}set images(e){this.image=e}}class SFt extends bp{constructor(e,n={}){super(e,e,n),this.isWebGLCubeRenderTarget=!0;const r={width:e,height:e,depth:1},i=[r,r,r,r,r,r];this.texture=new Rye(i,n.mapping,n.wrapS,n.wrapT,n.magFilter,n.minFilter,n.format,n.type,n.anisotropy,n.encoding),this.texture.isRenderTargetTexture=!0,this.texture.generateMipmaps=n.generateMipmaps!==void 0?n.generateMipmaps:!1,this.texture.minFilter=n.minFilter!==void 0?n.minFilter:Po}fromEquirectangularTexture(e,n){this.texture.type=n.type,this.texture.encoding=n.encoding,this.texture.generateMipmaps=n.generateMipmaps,this.texture.minFilter=n.minFilter,this.texture.magFilter=n.magFilter;const r={uniforms:{tEquirect:{value:null}},vertexShader:`

				varying vec3 vWorldDirection;

				vec3 transformDirection( in vec3 dir, in mat4 matrix ) {

					return normalize( ( matrix * vec4( dir, 0.0 ) ).xyz );

				}

				void main() {

					vWorldDirection = transformDirection( position, modelMatrix );

					#include <begin_vertex>
					#include <project_vertex>

				}
			`,fragmentShader:`

				uniform sampler2D tEquirect;

				varying vec3 vWorldDirection;

				#include <common>

				void main() {

					vec3 direction = normalize( vWorldDirection );

					vec2 sampleUV = equirectUv( direction );

					gl_FragColor = texture2D( tEquirect, sampleUV );

				}
			`},i=new Yy(5,5,5),o=new ud({name:"CubemapFromEquirect",uniforms:jv(r.uniforms),vertexShader:r.vertexShader,fragmentShader:r.fragmentShader,side:_a,blending:Hf});o.uniforms.tEquirect.value=n;const a=new Bl(i,o),s=n.minFilter;return n.minFilter===Lk&&(n.minFilter=Po),new wFt(1,10,this).update(e,a),n.minFilter=s,a.geometry.dispose(),a.material.dispose(),this}clear(e,n,r,i){const o=e.getRenderTarget();for(let a=0;a<6;a++)e.setRenderTarget(this,a),e.clear(n,r,i);e.setRenderTarget(o)}}const yD=new Se,OFt=new Se,CFt=new va;class rh{constructor(e=new Se(1,0,0),n=0){this.isPlane=!0,this.normal=e,this.constant=n}set(e,n){return this.normal.copy(e),this.constant=n,this}setComponents(e,n,r,i){return this.normal.set(e,n,r),this.constant=i,this}setFromNormalAndCoplanarPoint(e,n){return this.normal.copy(e),this.constant=-n.dot(this.normal),this}setFromCoplanarPoints(e,n,r){const i=yD.subVectors(r,n).cross(OFt.subVectors(e,n)).normalize();return this.setFromNormalAndCoplanarPoint(i,e),this}copy(e){return this.normal.copy(e.normal),this.constant=e.constant,this}normalize(){const e=1/this.normal.length();return this.normal.multiplyScalar(e),this.constant*=e,this}negate(){return this.constant*=-1,this.normal.negate(),this}distanceToPoint(e){return this.normal.dot(e)+this.constant}distanceToSphere(e){return this.distanceToPoint(e.center)-e.radius}projectPoint(e,n){return n.copy(this.normal).multiplyScalar(-this.distanceToPoint(e)).add(e)}intersectLine(e,n){const r=e.delta(yD),i=this.normal.dot(r);if(i===0)return this.distanceToPoint(e.start)===0?n.copy(e.start):null;const o=-(e.start.dot(this.normal)+this.constant)/i;return o<0||o>1?null:n.copy(r).multiplyScalar(o).add(e.start)}intersectsLine(e){const n=this.distanceToPoint(e.start),r=this.distanceToPoint(e.end);return n<0&&r>0||r<0&&n>0}intersectsBox(e){return e.intersectsPlane(this)}intersectsSphere(e){return e.intersectsPlane(this)}coplanarPoint(e){return e.copy(this.normal).multiplyScalar(-this.constant)}applyMatrix4(e,n){const r=n||CFt.getNormalMatrix(e),i=this.coplanarPoint(yD).applyMatrix4(e),o=this.normal.applyMatrix3(r).normalize();return this.constant=-i.dot(o),this}translate(e){return this.constant-=e.dot(this.normal),this}equals(e){return e.normal.equals(this.normal)&&e.constant===this.constant}clone(){return new this.constructor().copy(this)}}const km=new Nk,JO=new Se;class Iye{constructor(e=new rh,n=new rh,r=new rh,i=new rh,o=new rh,a=new rh){this.planes=[e,n,r,i,o,a]}set(e,n,r,i,o,a){const s=this.planes;return s[0].copy(e),s[1].copy(n),s[2].copy(r),s[3].copy(i),s[4].copy(o),s[5].copy(a),this}copy(e){const n=this.planes;for(let r=0;r<6;r++)n[r].copy(e.planes[r]);return this}setFromProjectionMatrix(e){const n=this.planes,r=e.elements,i=r[0],o=r[1],a=r[2],s=r[3],l=r[4],c=r[5],u=r[6],f=r[7],d=r[8],h=r[9],p=r[10],m=r[11],g=r[12],v=r[13],y=r[14],x=r[15];return n[0].setComponents(s-i,f-l,m-d,x-g).normalize(),n[1].setComponents(s+i,f+l,m+d,x+g).normalize(),n[2].setComponents(s+o,f+c,m+h,x+v).normalize(),n[3].setComponents(s-o,f-c,m-h,x-v).normalize(),n[4].setComponents(s-a,f-u,m-p,x-y).normalize(),n[5].setComponents(s+a,f+u,m+p,x+y).normalize(),this}intersectsObject(e){const n=e.geometry;return n.boundingSphere===null&&n.computeBoundingSphere(),km.copy(n.boundingSphere).applyMatrix4(e.matrixWorld),this.intersectsSphere(km)}intersectsSprite(e){return km.center.set(0,0,0),km.radius=.7071067811865476,km.applyMatrix4(e.matrixWorld),this.intersectsSphere(km)}intersectsSphere(e){const n=this.planes,r=e.center,i=-e.radius;for(let o=0;o<6;o++)if(n[o].distanceToPoint(r)<i)return!1;return!0}intersectsBox(e){const n=this.planes;for(let r=0;r<6;r++){const i=n[r];if(JO.x=i.normal.x>0?e.max.x:e.min.x,JO.y=i.normal.y>0?e.max.y:e.min.y,JO.z=i.normal.z>0?e.max.z:e.min.z,i.distanceToPoint(JO)<0)return!1}return!0}containsPoint(e){const n=this.planes;for(let r=0;r<6;r++)if(n[r].distanceToPoint(e)<0)return!1;return!0}clone(){return new this.constructor().copy(this)}}function Dye(){let t=null,e=!1,n=null,r=null;function i(o,a){n(o,a),r=t.requestAnimationFrame(i)}return{start:function(){e!==!0&&n!==null&&(r=t.requestAnimationFrame(i),e=!0)},stop:function(){t.cancelAnimationFrame(r),e=!1},setAnimationLoop:function(o){n=o},setContext:function(o){t=o}}}function TFt(t,e){const n=e.isWebGL2,r=new WeakMap;function i(c,u){const f=c.array,d=c.usage,h=t.createBuffer();t.bindBuffer(u,h),t.bufferData(u,f,d),c.onUploadCallback();let p;if(f instanceof Float32Array)p=5126;else if(f instanceof Uint16Array)if(c.isFloat16BufferAttribute)if(n)p=5131;else throw new Error("THREE.WebGLAttributes: Usage of Float16BufferAttribute requires WebGL2.");else p=5123;else if(f instanceof Int16Array)p=5122;else if(f instanceof Uint32Array)p=5125;else if(f instanceof Int32Array)p=5124;else if(f instanceof Int8Array)p=5120;else if(f instanceof Uint8Array)p=5121;else if(f instanceof Uint8ClampedArray)p=5121;else throw new Error("THREE.WebGLAttributes: Unsupported buffer data format: "+f);return{buffer:h,type:p,bytesPerElement:f.BYTES_PER_ELEMENT,version:c.version}}function o(c,u,f){const d=u.array,h=u.updateRange;t.bindBuffer(f,c),h.count===-1?t.bufferSubData(f,0,d):(n?t.bufferSubData(f,h.offset*d.BYTES_PER_ELEMENT,d,h.offset,h.count):t.bufferSubData(f,h.offset*d.BYTES_PER_ELEMENT,d.subarray(h.offset,h.offset+h.count)),h.count=-1)}function a(c){return c.isInterleavedBufferAttribute&&(c=c.data),r.get(c)}function s(c){c.isInterleavedBufferAttribute&&(c=c.data);const u=r.get(c);u&&(t.deleteBuffer(u.buffer),r.delete(c))}function l(c,u){if(c.isGLBufferAttribute){const d=r.get(c);(!d||d.version<c.version)&&r.set(c,{buffer:c.buffer,type:c.type,bytesPerElement:c.elementSize,version:c.version});return}c.isInterleavedBufferAttribute&&(c=c.data);const f=r.get(c);f===void 0?r.set(c,i(c,u)):f.version<c.version&&(o(f.buffer,c,u),f.version=c.version)}return{get:a,remove:s,update:l}}class $k extends Eu{constructor(e=1,n=1,r=1,i=1){super(),this.type="PlaneGeometry",this.parameters={width:e,height:n,widthSegments:r,heightSegments:i};const o=e/2,a=n/2,s=Math.floor(r),l=Math.floor(i),c=s+1,u=l+1,f=e/s,d=n/l,h=[],p=[],m=[],g=[];for(let v=0;v<u;v++){const y=v*d-a;for(let x=0;x<c;x++){const b=x*f-o;p.push(b,-y,0),m.push(0,0,1),g.push(x/s),g.push(1-v/l)}}for(let v=0;v<l;v++)for(let y=0;y<s;y++){const x=y+c*v,b=y+c*(v+1),_=y+1+c*(v+1),S=y+1+c*v;h.push(x,b,S),h.push(b,_,S)}this.setIndex(h),this.setAttribute("position",new lu(p,3)),this.setAttribute("normal",new lu(m,3)),this.setAttribute("uv",new lu(g,2))}static fromJSON(e){return new $k(e.width,e.height,e.widthSegments,e.heightSegments)}}var EFt=`#ifdef USE_ALPHAMAP
	diffuseColor.a *= texture2D( alphaMap, vUv ).g;
#endif`,PFt=`#ifdef USE_ALPHAMAP
	uniform sampler2D alphaMap;
#endif`,MFt=`#ifdef USE_ALPHATEST
	if ( diffuseColor.a < alphaTest ) discard;
#endif`,kFt=`#ifdef USE_ALPHATEST
	uniform float alphaTest;
#endif`,AFt=`#ifdef USE_AOMAP
	float ambientOcclusion = ( texture2D( aoMap, vUv2 ).r - 1.0 ) * aoMapIntensity + 1.0;
	reflectedLight.indirectDiffuse *= ambientOcclusion;
	#if defined( USE_ENVMAP ) && defined( STANDARD )
		float dotNV = saturate( dot( geometry.normal, geometry.viewDir ) );
		reflectedLight.indirectSpecular *= computeSpecularOcclusion( dotNV, ambientOcclusion, material.roughness );
	#endif
#endif`,RFt=`#ifdef USE_AOMAP
	uniform sampler2D aoMap;
	uniform float aoMapIntensity;
#endif`,IFt="vec3 transformed = vec3( position );",DFt=`vec3 objectNormal = vec3( normal );
#ifdef USE_TANGENT
	vec3 objectTangent = vec3( tangent.xyz );
#endif`,LFt=`vec3 BRDF_Lambert( const in vec3 diffuseColor ) {
	return RECIPROCAL_PI * diffuseColor;
}
vec3 F_Schlick( const in vec3 f0, const in float f90, const in float dotVH ) {
	float fresnel = exp2( ( - 5.55473 * dotVH - 6.98316 ) * dotVH );
	return f0 * ( 1.0 - fresnel ) + ( f90 * fresnel );
}
float F_Schlick( const in float f0, const in float f90, const in float dotVH ) {
	float fresnel = exp2( ( - 5.55473 * dotVH - 6.98316 ) * dotVH );
	return f0 * ( 1.0 - fresnel ) + ( f90 * fresnel );
}
vec3 Schlick_to_F0( const in vec3 f, const in float f90, const in float dotVH ) {
    float x = clamp( 1.0 - dotVH, 0.0, 1.0 );
    float x2 = x * x;
    float x5 = clamp( x * x2 * x2, 0.0, 0.9999 );
    return ( f - vec3( f90 ) * x5 ) / ( 1.0 - x5 );
}
float V_GGX_SmithCorrelated( const in float alpha, const in float dotNL, const in float dotNV ) {
	float a2 = pow2( alpha );
	float gv = dotNL * sqrt( a2 + ( 1.0 - a2 ) * pow2( dotNV ) );
	float gl = dotNV * sqrt( a2 + ( 1.0 - a2 ) * pow2( dotNL ) );
	return 0.5 / max( gv + gl, EPSILON );
}
float D_GGX( const in float alpha, const in float dotNH ) {
	float a2 = pow2( alpha );
	float denom = pow2( dotNH ) * ( a2 - 1.0 ) + 1.0;
	return RECIPROCAL_PI * a2 / pow2( denom );
}
vec3 BRDF_GGX( const in vec3 lightDir, const in vec3 viewDir, const in vec3 normal, const in vec3 f0, const in float f90, const in float roughness ) {
	float alpha = pow2( roughness );
	vec3 halfDir = normalize( lightDir + viewDir );
	float dotNL = saturate( dot( normal, lightDir ) );
	float dotNV = saturate( dot( normal, viewDir ) );
	float dotNH = saturate( dot( normal, halfDir ) );
	float dotVH = saturate( dot( viewDir, halfDir ) );
	vec3 F = F_Schlick( f0, f90, dotVH );
	float V = V_GGX_SmithCorrelated( alpha, dotNL, dotNV );
	float D = D_GGX( alpha, dotNH );
	return F * ( V * D );
}
#ifdef USE_IRIDESCENCE
	vec3 BRDF_GGX_Iridescence( const in vec3 lightDir, const in vec3 viewDir, const in vec3 normal, const in vec3 f0, const in float f90, const in float iridescence, const in vec3 iridescenceFresnel, const in float roughness ) {
		float alpha = pow2( roughness );
		vec3 halfDir = normalize( lightDir + viewDir );
		float dotNL = saturate( dot( normal, lightDir ) );
		float dotNV = saturate( dot( normal, viewDir ) );
		float dotNH = saturate( dot( normal, halfDir ) );
		float dotVH = saturate( dot( viewDir, halfDir ) );
		vec3 F = mix( F_Schlick( f0, f90, dotVH ), iridescenceFresnel, iridescence );
		float V = V_GGX_SmithCorrelated( alpha, dotNL, dotNV );
		float D = D_GGX( alpha, dotNH );
		return F * ( V * D );
	}
#endif
vec2 LTC_Uv( const in vec3 N, const in vec3 V, const in float roughness ) {
	const float LUT_SIZE = 64.0;
	const float LUT_SCALE = ( LUT_SIZE - 1.0 ) / LUT_SIZE;
	const float LUT_BIAS = 0.5 / LUT_SIZE;
	float dotNV = saturate( dot( N, V ) );
	vec2 uv = vec2( roughness, sqrt( 1.0 - dotNV ) );
	uv = uv * LUT_SCALE + LUT_BIAS;
	return uv;
}
float LTC_ClippedSphereFormFactor( const in vec3 f ) {
	float l = length( f );
	return max( ( l * l + f.z ) / ( l + 1.0 ), 0.0 );
}
vec3 LTC_EdgeVectorFormFactor( const in vec3 v1, const in vec3 v2 ) {
	float x = dot( v1, v2 );
	float y = abs( x );
	float a = 0.8543985 + ( 0.4965155 + 0.0145206 * y ) * y;
	float b = 3.4175940 + ( 4.1616724 + y ) * y;
	float v = a / b;
	float theta_sintheta = ( x > 0.0 ) ? v : 0.5 * inversesqrt( max( 1.0 - x * x, 1e-7 ) ) - v;
	return cross( v1, v2 ) * theta_sintheta;
}
vec3 LTC_Evaluate( const in vec3 N, const in vec3 V, const in vec3 P, const in mat3 mInv, const in vec3 rectCoords[ 4 ] ) {
	vec3 v1 = rectCoords[ 1 ] - rectCoords[ 0 ];
	vec3 v2 = rectCoords[ 3 ] - rectCoords[ 0 ];
	vec3 lightNormal = cross( v1, v2 );
	if( dot( lightNormal, P - rectCoords[ 0 ] ) < 0.0 ) return vec3( 0.0 );
	vec3 T1, T2;
	T1 = normalize( V - N * dot( V, N ) );
	T2 = - cross( N, T1 );
	mat3 mat = mInv * transposeMat3( mat3( T1, T2, N ) );
	vec3 coords[ 4 ];
	coords[ 0 ] = mat * ( rectCoords[ 0 ] - P );
	coords[ 1 ] = mat * ( rectCoords[ 1 ] - P );
	coords[ 2 ] = mat * ( rectCoords[ 2 ] - P );
	coords[ 3 ] = mat * ( rectCoords[ 3 ] - P );
	coords[ 0 ] = normalize( coords[ 0 ] );
	coords[ 1 ] = normalize( coords[ 1 ] );
	coords[ 2 ] = normalize( coords[ 2 ] );
	coords[ 3 ] = normalize( coords[ 3 ] );
	vec3 vectorFormFactor = vec3( 0.0 );
	vectorFormFactor += LTC_EdgeVectorFormFactor( coords[ 0 ], coords[ 1 ] );
	vectorFormFactor += LTC_EdgeVectorFormFactor( coords[ 1 ], coords[ 2 ] );
	vectorFormFactor += LTC_EdgeVectorFormFactor( coords[ 2 ], coords[ 3 ] );
	vectorFormFactor += LTC_EdgeVectorFormFactor( coords[ 3 ], coords[ 0 ] );
	float result = LTC_ClippedSphereFormFactor( vectorFormFactor );
	return vec3( result );
}
float G_BlinnPhong_Implicit( ) {
	return 0.25;
}
float D_BlinnPhong( const in float shininess, const in float dotNH ) {
	return RECIPROCAL_PI * ( shininess * 0.5 + 1.0 ) * pow( dotNH, shininess );
}
vec3 BRDF_BlinnPhong( const in vec3 lightDir, const in vec3 viewDir, const in vec3 normal, const in vec3 specularColor, const in float shininess ) {
	vec3 halfDir = normalize( lightDir + viewDir );
	float dotNH = saturate( dot( normal, halfDir ) );
	float dotVH = saturate( dot( viewDir, halfDir ) );
	vec3 F = F_Schlick( specularColor, 1.0, dotVH );
	float G = G_BlinnPhong_Implicit( );
	float D = D_BlinnPhong( shininess, dotNH );
	return F * ( G * D );
}
#if defined( USE_SHEEN )
float D_Charlie( float roughness, float dotNH ) {
	float alpha = pow2( roughness );
	float invAlpha = 1.0 / alpha;
	float cos2h = dotNH * dotNH;
	float sin2h = max( 1.0 - cos2h, 0.0078125 );
	return ( 2.0 + invAlpha ) * pow( sin2h, invAlpha * 0.5 ) / ( 2.0 * PI );
}
float V_Neubelt( float dotNV, float dotNL ) {
	return saturate( 1.0 / ( 4.0 * ( dotNL + dotNV - dotNL * dotNV ) ) );
}
vec3 BRDF_Sheen( const in vec3 lightDir, const in vec3 viewDir, const in vec3 normal, vec3 sheenColor, const in float sheenRoughness ) {
	vec3 halfDir = normalize( lightDir + viewDir );
	float dotNL = saturate( dot( normal, lightDir ) );
	float dotNV = saturate( dot( normal, viewDir ) );
	float dotNH = saturate( dot( normal, halfDir ) );
	float D = D_Charlie( sheenRoughness, dotNH );
	float V = V_Neubelt( dotNV, dotNL );
	return sheenColor * ( D * V );
}
#endif`,NFt=`#ifdef USE_IRIDESCENCE
	const mat3 XYZ_TO_REC709 = mat3(
		 3.2404542, -0.9692660,  0.0556434,
		-1.5371385,  1.8760108, -0.2040259,
		-0.4985314,  0.0415560,  1.0572252
	);
	vec3 Fresnel0ToIor( vec3 fresnel0 ) {
		vec3 sqrtF0 = sqrt( fresnel0 );
		return ( vec3( 1.0 ) + sqrtF0 ) / ( vec3( 1.0 ) - sqrtF0 );
	}
	vec3 IorToFresnel0( vec3 transmittedIor, float incidentIor ) {
		return pow2( ( transmittedIor - vec3( incidentIor ) ) / ( transmittedIor + vec3( incidentIor ) ) );
	}
	float IorToFresnel0( float transmittedIor, float incidentIor ) {
		return pow2( ( transmittedIor - incidentIor ) / ( transmittedIor + incidentIor ));
	}
	vec3 evalSensitivity( float OPD, vec3 shift ) {
		float phase = 2.0 * PI * OPD * 1.0e-9;
		vec3 val = vec3( 5.4856e-13, 4.4201e-13, 5.2481e-13 );
		vec3 pos = vec3( 1.6810e+06, 1.7953e+06, 2.2084e+06 );
		vec3 var = vec3( 4.3278e+09, 9.3046e+09, 6.6121e+09 );
		vec3 xyz = val * sqrt( 2.0 * PI * var ) * cos( pos * phase + shift ) * exp( - pow2( phase ) * var );
		xyz.x += 9.7470e-14 * sqrt( 2.0 * PI * 4.5282e+09 ) * cos( 2.2399e+06 * phase + shift[ 0 ] ) * exp( - 4.5282e+09 * pow2( phase ) );
		xyz /= 1.0685e-7;
		vec3 rgb = XYZ_TO_REC709 * xyz;
		return rgb;
	}
	vec3 evalIridescence( float outsideIOR, float eta2, float cosTheta1, float thinFilmThickness, vec3 baseF0 ) {
		vec3 I;
		float iridescenceIOR = mix( outsideIOR, eta2, smoothstep( 0.0, 0.03, thinFilmThickness ) );
		float sinTheta2Sq = pow2( outsideIOR / iridescenceIOR ) * ( 1.0 - pow2( cosTheta1 ) );
		float cosTheta2Sq = 1.0 - sinTheta2Sq;
		if ( cosTheta2Sq < 0.0 ) {
			 return vec3( 1.0 );
		}
		float cosTheta2 = sqrt( cosTheta2Sq );
		float R0 = IorToFresnel0( iridescenceIOR, outsideIOR );
		float R12 = F_Schlick( R0, 1.0, cosTheta1 );
		float R21 = R12;
		float T121 = 1.0 - R12;
		float phi12 = 0.0;
		if ( iridescenceIOR < outsideIOR ) phi12 = PI;
		float phi21 = PI - phi12;
		vec3 baseIOR = Fresnel0ToIor( clamp( baseF0, 0.0, 0.9999 ) );		vec3 R1 = IorToFresnel0( baseIOR, iridescenceIOR );
		vec3 R23 = F_Schlick( R1, 1.0, cosTheta2 );
		vec3 phi23 = vec3( 0.0 );
		if ( baseIOR[ 0 ] < iridescenceIOR ) phi23[ 0 ] = PI;
		if ( baseIOR[ 1 ] < iridescenceIOR ) phi23[ 1 ] = PI;
		if ( baseIOR[ 2 ] < iridescenceIOR ) phi23[ 2 ] = PI;
		float OPD = 2.0 * iridescenceIOR * thinFilmThickness * cosTheta2;
		vec3 phi = vec3( phi21 ) + phi23;
		vec3 R123 = clamp( R12 * R23, 1e-5, 0.9999 );
		vec3 r123 = sqrt( R123 );
		vec3 Rs = pow2( T121 ) * R23 / ( vec3( 1.0 ) - R123 );
		vec3 C0 = R12 + Rs;
		I = C0;
		vec3 Cm = Rs - T121;
		for ( int m = 1; m <= 2; ++ m ) {
			Cm *= r123;
			vec3 Sm = 2.0 * evalSensitivity( float( m ) * OPD, float( m ) * phi );
			I += Cm * Sm;
		}
		return max( I, vec3( 0.0 ) );
	}
#endif`,$Ft=`#ifdef USE_BUMPMAP
	uniform sampler2D bumpMap;
	uniform float bumpScale;
	vec2 dHdxy_fwd() {
		vec2 dSTdx = dFdx( vUv );
		vec2 dSTdy = dFdy( vUv );
		float Hll = bumpScale * texture2D( bumpMap, vUv ).x;
		float dBx = bumpScale * texture2D( bumpMap, vUv + dSTdx ).x - Hll;
		float dBy = bumpScale * texture2D( bumpMap, vUv + dSTdy ).x - Hll;
		return vec2( dBx, dBy );
	}
	vec3 perturbNormalArb( vec3 surf_pos, vec3 surf_norm, vec2 dHdxy, float faceDirection ) {
		vec3 vSigmaX = dFdx( surf_pos.xyz );
		vec3 vSigmaY = dFdy( surf_pos.xyz );
		vec3 vN = surf_norm;
		vec3 R1 = cross( vSigmaY, vN );
		vec3 R2 = cross( vN, vSigmaX );
		float fDet = dot( vSigmaX, R1 ) * faceDirection;
		vec3 vGrad = sign( fDet ) * ( dHdxy.x * R1 + dHdxy.y * R2 );
		return normalize( abs( fDet ) * surf_norm - vGrad );
	}
#endif`,FFt=`#if NUM_CLIPPING_PLANES > 0
	vec4 plane;
	#pragma unroll_loop_start
	for ( int i = 0; i < UNION_CLIPPING_PLANES; i ++ ) {
		plane = clippingPlanes[ i ];
		if ( dot( vClipPosition, plane.xyz ) > plane.w ) discard;
	}
	#pragma unroll_loop_end
	#if UNION_CLIPPING_PLANES < NUM_CLIPPING_PLANES
		bool clipped = true;
		#pragma unroll_loop_start
		for ( int i = UNION_CLIPPING_PLANES; i < NUM_CLIPPING_PLANES; i ++ ) {
			plane = clippingPlanes[ i ];
			clipped = ( dot( vClipPosition, plane.xyz ) > plane.w ) && clipped;
		}
		#pragma unroll_loop_end
		if ( clipped ) discard;
	#endif
#endif`,jFt=`#if NUM_CLIPPING_PLANES > 0
	varying vec3 vClipPosition;
	uniform vec4 clippingPlanes[ NUM_CLIPPING_PLANES ];
#endif`,BFt=`#if NUM_CLIPPING_PLANES > 0
	varying vec3 vClipPosition;
#endif`,zFt=`#if NUM_CLIPPING_PLANES > 0
	vClipPosition = - mvPosition.xyz;
#endif`,UFt=`#if defined( USE_COLOR_ALPHA )
	diffuseColor *= vColor;
#elif defined( USE_COLOR )
	diffuseColor.rgb *= vColor;
#endif`,WFt=`#if defined( USE_COLOR_ALPHA )
	varying vec4 vColor;
#elif defined( USE_COLOR )
	varying vec3 vColor;
#endif`,VFt=`#if defined( USE_COLOR_ALPHA )
	varying vec4 vColor;
#elif defined( USE_COLOR ) || defined( USE_INSTANCING_COLOR )
	varying vec3 vColor;
#endif`,GFt=`#if defined( USE_COLOR_ALPHA )
	vColor = vec4( 1.0 );
#elif defined( USE_COLOR ) || defined( USE_INSTANCING_COLOR )
	vColor = vec3( 1.0 );
#endif
#ifdef USE_COLOR
	vColor *= color;
#endif
#ifdef USE_INSTANCING_COLOR
	vColor.xyz *= instanceColor.xyz;
#endif`,HFt=`#define PI 3.141592653589793
#define PI2 6.283185307179586
#define PI_HALF 1.5707963267948966
#define RECIPROCAL_PI 0.3183098861837907
#define RECIPROCAL_PI2 0.15915494309189535
#define EPSILON 1e-6
#ifndef saturate
#define saturate( a ) clamp( a, 0.0, 1.0 )
#endif
#define whiteComplement( a ) ( 1.0 - saturate( a ) )
float pow2( const in float x ) { return x*x; }
vec3 pow2( const in vec3 x ) { return x*x; }
float pow3( const in float x ) { return x*x*x; }
float pow4( const in float x ) { float x2 = x*x; return x2*x2; }
float max3( const in vec3 v ) { return max( max( v.x, v.y ), v.z ); }
float average( const in vec3 v ) { return dot( v, vec3( 0.3333333 ) ); }
highp float rand( const in vec2 uv ) {
	const highp float a = 12.9898, b = 78.233, c = 43758.5453;
	highp float dt = dot( uv.xy, vec2( a,b ) ), sn = mod( dt, PI );
	return fract( sin( sn ) * c );
}
#ifdef HIGH_PRECISION
	float precisionSafeLength( vec3 v ) { return length( v ); }
#else
	float precisionSafeLength( vec3 v ) {
		float maxComponent = max3( abs( v ) );
		return length( v / maxComponent ) * maxComponent;
	}
#endif
struct IncidentLight {
	vec3 color;
	vec3 direction;
	bool visible;
};
struct ReflectedLight {
	vec3 directDiffuse;
	vec3 directSpecular;
	vec3 indirectDiffuse;
	vec3 indirectSpecular;
};
struct GeometricContext {
	vec3 position;
	vec3 normal;
	vec3 viewDir;
#ifdef USE_CLEARCOAT
	vec3 clearcoatNormal;
#endif
};
vec3 transformDirection( in vec3 dir, in mat4 matrix ) {
	return normalize( ( matrix * vec4( dir, 0.0 ) ).xyz );
}
vec3 inverseTransformDirection( in vec3 dir, in mat4 matrix ) {
	return normalize( ( vec4( dir, 0.0 ) * matrix ).xyz );
}
mat3 transposeMat3( const in mat3 m ) {
	mat3 tmp;
	tmp[ 0 ] = vec3( m[ 0 ].x, m[ 1 ].x, m[ 2 ].x );
	tmp[ 1 ] = vec3( m[ 0 ].y, m[ 1 ].y, m[ 2 ].y );
	tmp[ 2 ] = vec3( m[ 0 ].z, m[ 1 ].z, m[ 2 ].z );
	return tmp;
}
float luminance( const in vec3 rgb ) {
	const vec3 weights = vec3( 0.2126729, 0.7151522, 0.0721750 );
	return dot( weights, rgb );
}
bool isPerspectiveMatrix( mat4 m ) {
	return m[ 2 ][ 3 ] == - 1.0;
}
vec2 equirectUv( in vec3 dir ) {
	float u = atan( dir.z, dir.x ) * RECIPROCAL_PI2 + 0.5;
	float v = asin( clamp( dir.y, - 1.0, 1.0 ) ) * RECIPROCAL_PI + 0.5;
	return vec2( u, v );
}`,qFt=`#ifdef ENVMAP_TYPE_CUBE_UV
	#define cubeUV_minMipLevel 4.0
	#define cubeUV_minTileSize 16.0
	float getFace( vec3 direction ) {
		vec3 absDirection = abs( direction );
		float face = - 1.0;
		if ( absDirection.x > absDirection.z ) {
			if ( absDirection.x > absDirection.y )
				face = direction.x > 0.0 ? 0.0 : 3.0;
			else
				face = direction.y > 0.0 ? 1.0 : 4.0;
		} else {
			if ( absDirection.z > absDirection.y )
				face = direction.z > 0.0 ? 2.0 : 5.0;
			else
				face = direction.y > 0.0 ? 1.0 : 4.0;
		}
		return face;
	}
	vec2 getUV( vec3 direction, float face ) {
		vec2 uv;
		if ( face == 0.0 ) {
			uv = vec2( direction.z, direction.y ) / abs( direction.x );
		} else if ( face == 1.0 ) {
			uv = vec2( - direction.x, - direction.z ) / abs( direction.y );
		} else if ( face == 2.0 ) {
			uv = vec2( - direction.x, direction.y ) / abs( direction.z );
		} else if ( face == 3.0 ) {
			uv = vec2( - direction.z, direction.y ) / abs( direction.x );
		} else if ( face == 4.0 ) {
			uv = vec2( - direction.x, direction.z ) / abs( direction.y );
		} else {
			uv = vec2( direction.x, direction.y ) / abs( direction.z );
		}
		return 0.5 * ( uv + 1.0 );
	}
	vec3 bilinearCubeUV( sampler2D envMap, vec3 direction, float mipInt ) {
		float face = getFace( direction );
		float filterInt = max( cubeUV_minMipLevel - mipInt, 0.0 );
		mipInt = max( mipInt, cubeUV_minMipLevel );
		float faceSize = exp2( mipInt );
		vec2 uv = getUV( direction, face ) * ( faceSize - 2.0 ) + 1.0;
		if ( face > 2.0 ) {
			uv.y += faceSize;
			face -= 3.0;
		}
		uv.x += face * faceSize;
		uv.x += filterInt * 3.0 * cubeUV_minTileSize;
		uv.y += 4.0 * ( exp2( CUBEUV_MAX_MIP ) - faceSize );
		uv.x *= CUBEUV_TEXEL_WIDTH;
		uv.y *= CUBEUV_TEXEL_HEIGHT;
		#ifdef texture2DGradEXT
			return texture2DGradEXT( envMap, uv, vec2( 0.0 ), vec2( 0.0 ) ).rgb;
		#else
			return texture2D( envMap, uv ).rgb;
		#endif
	}
	#define cubeUV_r0 1.0
	#define cubeUV_v0 0.339
	#define cubeUV_m0 - 2.0
	#define cubeUV_r1 0.8
	#define cubeUV_v1 0.276
	#define cubeUV_m1 - 1.0
	#define cubeUV_r4 0.4
	#define cubeUV_v4 0.046
	#define cubeUV_m4 2.0
	#define cubeUV_r5 0.305
	#define cubeUV_v5 0.016
	#define cubeUV_m5 3.0
	#define cubeUV_r6 0.21
	#define cubeUV_v6 0.0038
	#define cubeUV_m6 4.0
	float roughnessToMip( float roughness ) {
		float mip = 0.0;
		if ( roughness >= cubeUV_r1 ) {
			mip = ( cubeUV_r0 - roughness ) * ( cubeUV_m1 - cubeUV_m0 ) / ( cubeUV_r0 - cubeUV_r1 ) + cubeUV_m0;
		} else if ( roughness >= cubeUV_r4 ) {
			mip = ( cubeUV_r1 - roughness ) * ( cubeUV_m4 - cubeUV_m1 ) / ( cubeUV_r1 - cubeUV_r4 ) + cubeUV_m1;
		} else if ( roughness >= cubeUV_r5 ) {
			mip = ( cubeUV_r4 - roughness ) * ( cubeUV_m5 - cubeUV_m4 ) / ( cubeUV_r4 - cubeUV_r5 ) + cubeUV_m4;
		} else if ( roughness >= cubeUV_r6 ) {
			mip = ( cubeUV_r5 - roughness ) * ( cubeUV_m6 - cubeUV_m5 ) / ( cubeUV_r5 - cubeUV_r6 ) + cubeUV_m5;
		} else {
			mip = - 2.0 * log2( 1.16 * roughness );		}
		return mip;
	}
	vec4 textureCubeUV( sampler2D envMap, vec3 sampleDir, float roughness ) {
		float mip = clamp( roughnessToMip( roughness ), cubeUV_m0, CUBEUV_MAX_MIP );
		float mipF = fract( mip );
		float mipInt = floor( mip );
		vec3 color0 = bilinearCubeUV( envMap, sampleDir, mipInt );
		if ( mipF == 0.0 ) {
			return vec4( color0, 1.0 );
		} else {
			vec3 color1 = bilinearCubeUV( envMap, sampleDir, mipInt + 1.0 );
			return vec4( mix( color0, color1, mipF ), 1.0 );
		}
	}
#endif`,XFt=`vec3 transformedNormal = objectNormal;
#ifdef USE_INSTANCING
	mat3 m = mat3( instanceMatrix );
	transformedNormal /= vec3( dot( m[ 0 ], m[ 0 ] ), dot( m[ 1 ], m[ 1 ] ), dot( m[ 2 ], m[ 2 ] ) );
	transformedNormal = m * transformedNormal;
#endif
transformedNormal = normalMatrix * transformedNormal;
#ifdef FLIP_SIDED
	transformedNormal = - transformedNormal;
#endif
#ifdef USE_TANGENT
	vec3 transformedTangent = ( modelViewMatrix * vec4( objectTangent, 0.0 ) ).xyz;
	#ifdef FLIP_SIDED
		transformedTangent = - transformedTangent;
	#endif
#endif`,QFt=`#ifdef USE_DISPLACEMENTMAP
	uniform sampler2D displacementMap;
	uniform float displacementScale;
	uniform float displacementBias;
#endif`,YFt=`#ifdef USE_DISPLACEMENTMAP
	transformed += normalize( objectNormal ) * ( texture2D( displacementMap, vUv ).x * displacementScale + displacementBias );
#endif`,KFt=`#ifdef USE_EMISSIVEMAP
	vec4 emissiveColor = texture2D( emissiveMap, vUv );
	totalEmissiveRadiance *= emissiveColor.rgb;
#endif`,ZFt=`#ifdef USE_EMISSIVEMAP
	uniform sampler2D emissiveMap;
#endif`,JFt="gl_FragColor = linearToOutputTexel( gl_FragColor );",ejt=`vec4 LinearToLinear( in vec4 value ) {
	return value;
}
vec4 LinearTosRGB( in vec4 value ) {
	return vec4( mix( pow( value.rgb, vec3( 0.41666 ) ) * 1.055 - vec3( 0.055 ), value.rgb * 12.92, vec3( lessThanEqual( value.rgb, vec3( 0.0031308 ) ) ) ), value.a );
}`,tjt=`#ifdef USE_ENVMAP
	#ifdef ENV_WORLDPOS
		vec3 cameraToFrag;
		if ( isOrthographic ) {
			cameraToFrag = normalize( vec3( - viewMatrix[ 0 ][ 2 ], - viewMatrix[ 1 ][ 2 ], - viewMatrix[ 2 ][ 2 ] ) );
		} else {
			cameraToFrag = normalize( vWorldPosition - cameraPosition );
		}
		vec3 worldNormal = inverseTransformDirection( normal, viewMatrix );
		#ifdef ENVMAP_MODE_REFLECTION
			vec3 reflectVec = reflect( cameraToFrag, worldNormal );
		#else
			vec3 reflectVec = refract( cameraToFrag, worldNormal, refractionRatio );
		#endif
	#else
		vec3 reflectVec = vReflect;
	#endif
	#ifdef ENVMAP_TYPE_CUBE
		vec4 envColor = textureCube( envMap, vec3( flipEnvMap * reflectVec.x, reflectVec.yz ) );
	#elif defined( ENVMAP_TYPE_CUBE_UV )
		vec4 envColor = textureCubeUV( envMap, reflectVec, 0.0 );
	#else
		vec4 envColor = vec4( 0.0 );
	#endif
	#ifdef ENVMAP_BLENDING_MULTIPLY
		outgoingLight = mix( outgoingLight, outgoingLight * envColor.xyz, specularStrength * reflectivity );
	#elif defined( ENVMAP_BLENDING_MIX )
		outgoingLight = mix( outgoingLight, envColor.xyz, specularStrength * reflectivity );
	#elif defined( ENVMAP_BLENDING_ADD )
		outgoingLight += envColor.xyz * specularStrength * reflectivity;
	#endif
#endif`,njt=`#ifdef USE_ENVMAP
	uniform float envMapIntensity;
	uniform float flipEnvMap;
	#ifdef ENVMAP_TYPE_CUBE
		uniform samplerCube envMap;
	#else
		uniform sampler2D envMap;
	#endif
	
#endif`,rjt=`#ifdef USE_ENVMAP
	uniform float reflectivity;
	#if defined( USE_BUMPMAP ) || defined( USE_NORMALMAP ) || defined( PHONG ) || defined( LAMBERT )
		#define ENV_WORLDPOS
	#endif
	#ifdef ENV_WORLDPOS
		varying vec3 vWorldPosition;
		uniform float refractionRatio;
	#else
		varying vec3 vReflect;
	#endif
#endif`,ijt=`#ifdef USE_ENVMAP
	#if defined( USE_BUMPMAP ) || defined( USE_NORMALMAP ) || defined( PHONG ) || defined( LAMBERT )
		#define ENV_WORLDPOS
	#endif
	#ifdef ENV_WORLDPOS
		
		varying vec3 vWorldPosition;
	#else
		varying vec3 vReflect;
		uniform float refractionRatio;
	#endif
#endif`,ojt=`#ifdef USE_ENVMAP
	#ifdef ENV_WORLDPOS
		vWorldPosition = worldPosition.xyz;
	#else
		vec3 cameraToVertex;
		if ( isOrthographic ) {
			cameraToVertex = normalize( vec3( - viewMatrix[ 0 ][ 2 ], - viewMatrix[ 1 ][ 2 ], - viewMatrix[ 2 ][ 2 ] ) );
		} else {
			cameraToVertex = normalize( worldPosition.xyz - cameraPosition );
		}
		vec3 worldNormal = inverseTransformDirection( transformedNormal, viewMatrix );
		#ifdef ENVMAP_MODE_REFLECTION
			vReflect = reflect( cameraToVertex, worldNormal );
		#else
			vReflect = refract( cameraToVertex, worldNormal, refractionRatio );
		#endif
	#endif
#endif`,ajt=`#ifdef USE_FOG
	vFogDepth = - mvPosition.z;
#endif`,sjt=`#ifdef USE_FOG
	varying float vFogDepth;
#endif`,ljt=`#ifdef USE_FOG
	#ifdef FOG_EXP2
		float fogFactor = 1.0 - exp( - fogDensity * fogDensity * vFogDepth * vFogDepth );
	#else
		float fogFactor = smoothstep( fogNear, fogFar, vFogDepth );
	#endif
	gl_FragColor.rgb = mix( gl_FragColor.rgb, fogColor, fogFactor );
#endif`,cjt=`#ifdef USE_FOG
	uniform vec3 fogColor;
	varying float vFogDepth;
	#ifdef FOG_EXP2
		uniform float fogDensity;
	#else
		uniform float fogNear;
		uniform float fogFar;
	#endif
#endif`,ujt=`#ifdef USE_GRADIENTMAP
	uniform sampler2D gradientMap;
#endif
vec3 getGradientIrradiance( vec3 normal, vec3 lightDirection ) {
	float dotNL = dot( normal, lightDirection );
	vec2 coord = vec2( dotNL * 0.5 + 0.5, 0.0 );
	#ifdef USE_GRADIENTMAP
		return vec3( texture2D( gradientMap, coord ).r );
	#else
		vec2 fw = fwidth( coord ) * 0.5;
		return mix( vec3( 0.7 ), vec3( 1.0 ), smoothstep( 0.7 - fw.x, 0.7 + fw.x, coord.x ) );
	#endif
}`,fjt=`#ifdef USE_LIGHTMAP
	vec4 lightMapTexel = texture2D( lightMap, vUv2 );
	vec3 lightMapIrradiance = lightMapTexel.rgb * lightMapIntensity;
	reflectedLight.indirectDiffuse += lightMapIrradiance;
#endif`,djt=`#ifdef USE_LIGHTMAP
	uniform sampler2D lightMap;
	uniform float lightMapIntensity;
#endif`,hjt=`LambertMaterial material;
material.diffuseColor = diffuseColor.rgb;
material.specularStrength = specularStrength;`,pjt=`varying vec3 vViewPosition;
struct LambertMaterial {
	vec3 diffuseColor;
	float specularStrength;
};
void RE_Direct_Lambert( const in IncidentLight directLight, const in GeometricContext geometry, const in LambertMaterial material, inout ReflectedLight reflectedLight ) {
	float dotNL = saturate( dot( geometry.normal, directLight.direction ) );
	vec3 irradiance = dotNL * directLight.color;
	reflectedLight.directDiffuse += irradiance * BRDF_Lambert( material.diffuseColor );
}
void RE_IndirectDiffuse_Lambert( const in vec3 irradiance, const in GeometricContext geometry, const in LambertMaterial material, inout ReflectedLight reflectedLight ) {
	reflectedLight.indirectDiffuse += irradiance * BRDF_Lambert( material.diffuseColor );
}
#define RE_Direct				RE_Direct_Lambert
#define RE_IndirectDiffuse		RE_IndirectDiffuse_Lambert
#define Material_LightProbeLOD( material )	(0)`,mjt=`uniform bool receiveShadow;
uniform vec3 ambientLightColor;
uniform vec3 lightProbe[ 9 ];
vec3 shGetIrradianceAt( in vec3 normal, in vec3 shCoefficients[ 9 ] ) {
	float x = normal.x, y = normal.y, z = normal.z;
	vec3 result = shCoefficients[ 0 ] * 0.886227;
	result += shCoefficients[ 1 ] * 2.0 * 0.511664 * y;
	result += shCoefficients[ 2 ] * 2.0 * 0.511664 * z;
	result += shCoefficients[ 3 ] * 2.0 * 0.511664 * x;
	result += shCoefficients[ 4 ] * 2.0 * 0.429043 * x * y;
	result += shCoefficients[ 5 ] * 2.0 * 0.429043 * y * z;
	result += shCoefficients[ 6 ] * ( 0.743125 * z * z - 0.247708 );
	result += shCoefficients[ 7 ] * 2.0 * 0.429043 * x * z;
	result += shCoefficients[ 8 ] * 0.429043 * ( x * x - y * y );
	return result;
}
vec3 getLightProbeIrradiance( const in vec3 lightProbe[ 9 ], const in vec3 normal ) {
	vec3 worldNormal = inverseTransformDirection( normal, viewMatrix );
	vec3 irradiance = shGetIrradianceAt( worldNormal, lightProbe );
	return irradiance;
}
vec3 getAmbientLightIrradiance( const in vec3 ambientLightColor ) {
	vec3 irradiance = ambientLightColor;
	return irradiance;
}
float getDistanceAttenuation( const in float lightDistance, const in float cutoffDistance, const in float decayExponent ) {
	#if defined ( PHYSICALLY_CORRECT_LIGHTS )
		float distanceFalloff = 1.0 / max( pow( lightDistance, decayExponent ), 0.01 );
		if ( cutoffDistance > 0.0 ) {
			distanceFalloff *= pow2( saturate( 1.0 - pow4( lightDistance / cutoffDistance ) ) );
		}
		return distanceFalloff;
	#else
		if ( cutoffDistance > 0.0 && decayExponent > 0.0 ) {
			return pow( saturate( - lightDistance / cutoffDistance + 1.0 ), decayExponent );
		}
		return 1.0;
	#endif
}
float getSpotAttenuation( const in float coneCosine, const in float penumbraCosine, const in float angleCosine ) {
	return smoothstep( coneCosine, penumbraCosine, angleCosine );
}
#if NUM_DIR_LIGHTS > 0
	struct DirectionalLight {
		vec3 direction;
		vec3 color;
	};
	uniform DirectionalLight directionalLights[ NUM_DIR_LIGHTS ];
	void getDirectionalLightInfo( const in DirectionalLight directionalLight, const in GeometricContext geometry, out IncidentLight light ) {
		light.color = directionalLight.color;
		light.direction = directionalLight.direction;
		light.visible = true;
	}
#endif
#if NUM_POINT_LIGHTS > 0
	struct PointLight {
		vec3 position;
		vec3 color;
		float distance;
		float decay;
	};
	uniform PointLight pointLights[ NUM_POINT_LIGHTS ];
	void getPointLightInfo( const in PointLight pointLight, const in GeometricContext geometry, out IncidentLight light ) {
		vec3 lVector = pointLight.position - geometry.position;
		light.direction = normalize( lVector );
		float lightDistance = length( lVector );
		light.color = pointLight.color;
		light.color *= getDistanceAttenuation( lightDistance, pointLight.distance, pointLight.decay );
		light.visible = ( light.color != vec3( 0.0 ) );
	}
#endif
#if NUM_SPOT_LIGHTS > 0
	struct SpotLight {
		vec3 position;
		vec3 direction;
		vec3 color;
		float distance;
		float decay;
		float coneCos;
		float penumbraCos;
	};
	uniform SpotLight spotLights[ NUM_SPOT_LIGHTS ];
	void getSpotLightInfo( const in SpotLight spotLight, const in GeometricContext geometry, out IncidentLight light ) {
		vec3 lVector = spotLight.position - geometry.position;
		light.direction = normalize( lVector );
		float angleCos = dot( light.direction, spotLight.direction );
		float spotAttenuation = getSpotAttenuation( spotLight.coneCos, spotLight.penumbraCos, angleCos );
		if ( spotAttenuation > 0.0 ) {
			float lightDistance = length( lVector );
			light.color = spotLight.color * spotAttenuation;
			light.color *= getDistanceAttenuation( lightDistance, spotLight.distance, spotLight.decay );
			light.visible = ( light.color != vec3( 0.0 ) );
		} else {
			light.color = vec3( 0.0 );
			light.visible = false;
		}
	}
#endif
#if NUM_RECT_AREA_LIGHTS > 0
	struct RectAreaLight {
		vec3 color;
		vec3 position;
		vec3 halfWidth;
		vec3 halfHeight;
	};
	uniform sampler2D ltc_1;	uniform sampler2D ltc_2;
	uniform RectAreaLight rectAreaLights[ NUM_RECT_AREA_LIGHTS ];
#endif
#if NUM_HEMI_LIGHTS > 0
	struct HemisphereLight {
		vec3 direction;
		vec3 skyColor;
		vec3 groundColor;
	};
	uniform HemisphereLight hemisphereLights[ NUM_HEMI_LIGHTS ];
	vec3 getHemisphereLightIrradiance( const in HemisphereLight hemiLight, const in vec3 normal ) {
		float dotNL = dot( normal, hemiLight.direction );
		float hemiDiffuseWeight = 0.5 * dotNL + 0.5;
		vec3 irradiance = mix( hemiLight.groundColor, hemiLight.skyColor, hemiDiffuseWeight );
		return irradiance;
	}
#endif`,gjt=`#if defined( USE_ENVMAP )
	vec3 getIBLIrradiance( const in vec3 normal ) {
		#if defined( ENVMAP_TYPE_CUBE_UV )
			vec3 worldNormal = inverseTransformDirection( normal, viewMatrix );
			vec4 envMapColor = textureCubeUV( envMap, worldNormal, 1.0 );
			return PI * envMapColor.rgb * envMapIntensity;
		#else
			return vec3( 0.0 );
		#endif
	}
	vec3 getIBLRadiance( const in vec3 viewDir, const in vec3 normal, const in float roughness ) {
		#if defined( ENVMAP_TYPE_CUBE_UV )
			vec3 reflectVec = reflect( - viewDir, normal );
			reflectVec = normalize( mix( reflectVec, normal, roughness * roughness) );
			reflectVec = inverseTransformDirection( reflectVec, viewMatrix );
			vec4 envMapColor = textureCubeUV( envMap, reflectVec, roughness );
			return envMapColor.rgb * envMapIntensity;
		#else
			return vec3( 0.0 );
		#endif
	}
#endif`,vjt=`ToonMaterial material;
material.diffuseColor = diffuseColor.rgb;`,yjt=`varying vec3 vViewPosition;
struct ToonMaterial {
	vec3 diffuseColor;
};
void RE_Direct_Toon( const in IncidentLight directLight, const in GeometricContext geometry, const in ToonMaterial material, inout ReflectedLight reflectedLight ) {
	vec3 irradiance = getGradientIrradiance( geometry.normal, directLight.direction ) * directLight.color;
	reflectedLight.directDiffuse += irradiance * BRDF_Lambert( material.diffuseColor );
}
void RE_IndirectDiffuse_Toon( const in vec3 irradiance, const in GeometricContext geometry, const in ToonMaterial material, inout ReflectedLight reflectedLight ) {
	reflectedLight.indirectDiffuse += irradiance * BRDF_Lambert( material.diffuseColor );
}
#define RE_Direct				RE_Direct_Toon
#define RE_IndirectDiffuse		RE_IndirectDiffuse_Toon
#define Material_LightProbeLOD( material )	(0)`,xjt=`BlinnPhongMaterial material;
material.diffuseColor = diffuseColor.rgb;
material.specularColor = specular;
material.specularShininess = shininess;
material.specularStrength = specularStrength;`,bjt=`varying vec3 vViewPosition;
struct BlinnPhongMaterial {
	vec3 diffuseColor;
	vec3 specularColor;
	float specularShininess;
	float specularStrength;
};
void RE_Direct_BlinnPhong( const in IncidentLight directLight, const in GeometricContext geometry, const in BlinnPhongMaterial material, inout ReflectedLight reflectedLight ) {
	float dotNL = saturate( dot( geometry.normal, directLight.direction ) );
	vec3 irradiance = dotNL * directLight.color;
	reflectedLight.directDiffuse += irradiance * BRDF_Lambert( material.diffuseColor );
	reflectedLight.directSpecular += irradiance * BRDF_BlinnPhong( directLight.direction, geometry.viewDir, geometry.normal, material.specularColor, material.specularShininess ) * material.specularStrength;
}
void RE_IndirectDiffuse_BlinnPhong( const in vec3 irradiance, const in GeometricContext geometry, const in BlinnPhongMaterial material, inout ReflectedLight reflectedLight ) {
	reflectedLight.indirectDiffuse += irradiance * BRDF_Lambert( material.diffuseColor );
}
#define RE_Direct				RE_Direct_BlinnPhong
#define RE_IndirectDiffuse		RE_IndirectDiffuse_BlinnPhong
#define Material_LightProbeLOD( material )	(0)`,_jt=`PhysicalMaterial material;
material.diffuseColor = diffuseColor.rgb * ( 1.0 - metalnessFactor );
vec3 dxy = max( abs( dFdx( geometryNormal ) ), abs( dFdy( geometryNormal ) ) );
float geometryRoughness = max( max( dxy.x, dxy.y ), dxy.z );
material.roughness = max( roughnessFactor, 0.0525 );material.roughness += geometryRoughness;
material.roughness = min( material.roughness, 1.0 );
#ifdef IOR
	material.ior = ior;
	#ifdef SPECULAR
		float specularIntensityFactor = specularIntensity;
		vec3 specularColorFactor = specularColor;
		#ifdef USE_SPECULARINTENSITYMAP
			specularIntensityFactor *= texture2D( specularIntensityMap, vUv ).a;
		#endif
		#ifdef USE_SPECULARCOLORMAP
			specularColorFactor *= texture2D( specularColorMap, vUv ).rgb;
		#endif
		material.specularF90 = mix( specularIntensityFactor, 1.0, metalnessFactor );
	#else
		float specularIntensityFactor = 1.0;
		vec3 specularColorFactor = vec3( 1.0 );
		material.specularF90 = 1.0;
	#endif
	material.specularColor = mix( min( pow2( ( material.ior - 1.0 ) / ( material.ior + 1.0 ) ) * specularColorFactor, vec3( 1.0 ) ) * specularIntensityFactor, diffuseColor.rgb, metalnessFactor );
#else
	material.specularColor = mix( vec3( 0.04 ), diffuseColor.rgb, metalnessFactor );
	material.specularF90 = 1.0;
#endif
#ifdef USE_CLEARCOAT
	material.clearcoat = clearcoat;
	material.clearcoatRoughness = clearcoatRoughness;
	material.clearcoatF0 = vec3( 0.04 );
	material.clearcoatF90 = 1.0;
	#ifdef USE_CLEARCOATMAP
		material.clearcoat *= texture2D( clearcoatMap, vUv ).x;
	#endif
	#ifdef USE_CLEARCOAT_ROUGHNESSMAP
		material.clearcoatRoughness *= texture2D( clearcoatRoughnessMap, vUv ).y;
	#endif
	material.clearcoat = saturate( material.clearcoat );	material.clearcoatRoughness = max( material.clearcoatRoughness, 0.0525 );
	material.clearcoatRoughness += geometryRoughness;
	material.clearcoatRoughness = min( material.clearcoatRoughness, 1.0 );
#endif
#ifdef USE_IRIDESCENCE
	material.iridescence = iridescence;
	material.iridescenceIOR = iridescenceIOR;
	#ifdef USE_IRIDESCENCEMAP
		material.iridescence *= texture2D( iridescenceMap, vUv ).r;
	#endif
	#ifdef USE_IRIDESCENCE_THICKNESSMAP
		material.iridescenceThickness = (iridescenceThicknessMaximum - iridescenceThicknessMinimum) * texture2D( iridescenceThicknessMap, vUv ).g + iridescenceThicknessMinimum;
	#else
		material.iridescenceThickness = iridescenceThicknessMaximum;
	#endif
#endif
#ifdef USE_SHEEN
	material.sheenColor = sheenColor;
	#ifdef USE_SHEENCOLORMAP
		material.sheenColor *= texture2D( sheenColorMap, vUv ).rgb;
	#endif
	material.sheenRoughness = clamp( sheenRoughness, 0.07, 1.0 );
	#ifdef USE_SHEENROUGHNESSMAP
		material.sheenRoughness *= texture2D( sheenRoughnessMap, vUv ).a;
	#endif
#endif`,wjt=`struct PhysicalMaterial {
	vec3 diffuseColor;
	float roughness;
	vec3 specularColor;
	float specularF90;
	#ifdef USE_CLEARCOAT
		float clearcoat;
		float clearcoatRoughness;
		vec3 clearcoatF0;
		float clearcoatF90;
	#endif
	#ifdef USE_IRIDESCENCE
		float iridescence;
		float iridescenceIOR;
		float iridescenceThickness;
		vec3 iridescenceFresnel;
		vec3 iridescenceF0;
	#endif
	#ifdef USE_SHEEN
		vec3 sheenColor;
		float sheenRoughness;
	#endif
	#ifdef IOR
		float ior;
	#endif
	#ifdef USE_TRANSMISSION
		float transmission;
		float transmissionAlpha;
		float thickness;
		float attenuationDistance;
		vec3 attenuationColor;
	#endif
};
vec3 clearcoatSpecular = vec3( 0.0 );
vec3 sheenSpecular = vec3( 0.0 );
float IBLSheenBRDF( const in vec3 normal, const in vec3 viewDir, const in float roughness ) {
	float dotNV = saturate( dot( normal, viewDir ) );
	float r2 = roughness * roughness;
	float a = roughness < 0.25 ? -339.2 * r2 + 161.4 * roughness - 25.9 : -8.48 * r2 + 14.3 * roughness - 9.95;
	float b = roughness < 0.25 ? 44.0 * r2 - 23.7 * roughness + 3.26 : 1.97 * r2 - 3.27 * roughness + 0.72;
	float DG = exp( a * dotNV + b ) + ( roughness < 0.25 ? 0.0 : 0.1 * ( roughness - 0.25 ) );
	return saturate( DG * RECIPROCAL_PI );
}
vec2 DFGApprox( const in vec3 normal, const in vec3 viewDir, const in float roughness ) {
	float dotNV = saturate( dot( normal, viewDir ) );
	const vec4 c0 = vec4( - 1, - 0.0275, - 0.572, 0.022 );
	const vec4 c1 = vec4( 1, 0.0425, 1.04, - 0.04 );
	vec4 r = roughness * c0 + c1;
	float a004 = min( r.x * r.x, exp2( - 9.28 * dotNV ) ) * r.x + r.y;
	vec2 fab = vec2( - 1.04, 1.04 ) * a004 + r.zw;
	return fab;
}
vec3 EnvironmentBRDF( const in vec3 normal, const in vec3 viewDir, const in vec3 specularColor, const in float specularF90, const in float roughness ) {
	vec2 fab = DFGApprox( normal, viewDir, roughness );
	return specularColor * fab.x + specularF90 * fab.y;
}
#ifdef USE_IRIDESCENCE
void computeMultiscatteringIridescence( const in vec3 normal, const in vec3 viewDir, const in vec3 specularColor, const in float specularF90, const in float iridescence, const in vec3 iridescenceF0, const in float roughness, inout vec3 singleScatter, inout vec3 multiScatter ) {
#else
void computeMultiscattering( const in vec3 normal, const in vec3 viewDir, const in vec3 specularColor, const in float specularF90, const in float roughness, inout vec3 singleScatter, inout vec3 multiScatter ) {
#endif
	vec2 fab = DFGApprox( normal, viewDir, roughness );
	#ifdef USE_IRIDESCENCE
		vec3 Fr = mix( specularColor, iridescenceF0, iridescence );
	#else
		vec3 Fr = specularColor;
	#endif
	vec3 FssEss = Fr * fab.x + specularF90 * fab.y;
	float Ess = fab.x + fab.y;
	float Ems = 1.0 - Ess;
	vec3 Favg = Fr + ( 1.0 - Fr ) * 0.047619;	vec3 Fms = FssEss * Favg / ( 1.0 - Ems * Favg );
	singleScatter += FssEss;
	multiScatter += Fms * Ems;
}
#if NUM_RECT_AREA_LIGHTS > 0
	void RE_Direct_RectArea_Physical( const in RectAreaLight rectAreaLight, const in GeometricContext geometry, const in PhysicalMaterial material, inout ReflectedLight reflectedLight ) {
		vec3 normal = geometry.normal;
		vec3 viewDir = geometry.viewDir;
		vec3 position = geometry.position;
		vec3 lightPos = rectAreaLight.position;
		vec3 halfWidth = rectAreaLight.halfWidth;
		vec3 halfHeight = rectAreaLight.halfHeight;
		vec3 lightColor = rectAreaLight.color;
		float roughness = material.roughness;
		vec3 rectCoords[ 4 ];
		rectCoords[ 0 ] = lightPos + halfWidth - halfHeight;		rectCoords[ 1 ] = lightPos - halfWidth - halfHeight;
		rectCoords[ 2 ] = lightPos - halfWidth + halfHeight;
		rectCoords[ 3 ] = lightPos + halfWidth + halfHeight;
		vec2 uv = LTC_Uv( normal, viewDir, roughness );
		vec4 t1 = texture2D( ltc_1, uv );
		vec4 t2 = texture2D( ltc_2, uv );
		mat3 mInv = mat3(
			vec3( t1.x, 0, t1.y ),
			vec3(    0, 1,    0 ),
			vec3( t1.z, 0, t1.w )
		);
		vec3 fresnel = ( material.specularColor * t2.x + ( vec3( 1.0 ) - material.specularColor ) * t2.y );
		reflectedLight.directSpecular += lightColor * fresnel * LTC_Evaluate( normal, viewDir, position, mInv, rectCoords );
		reflectedLight.directDiffuse += lightColor * material.diffuseColor * LTC_Evaluate( normal, viewDir, position, mat3( 1.0 ), rectCoords );
	}
#endif
void RE_Direct_Physical( const in IncidentLight directLight, const in GeometricContext geometry, const in PhysicalMaterial material, inout ReflectedLight reflectedLight ) {
	float dotNL = saturate( dot( geometry.normal, directLight.direction ) );
	vec3 irradiance = dotNL * directLight.color;
	#ifdef USE_CLEARCOAT
		float dotNLcc = saturate( dot( geometry.clearcoatNormal, directLight.direction ) );
		vec3 ccIrradiance = dotNLcc * directLight.color;
		clearcoatSpecular += ccIrradiance * BRDF_GGX( directLight.direction, geometry.viewDir, geometry.clearcoatNormal, material.clearcoatF0, material.clearcoatF90, material.clearcoatRoughness );
	#endif
	#ifdef USE_SHEEN
		sheenSpecular += irradiance * BRDF_Sheen( directLight.direction, geometry.viewDir, geometry.normal, material.sheenColor, material.sheenRoughness );
	#endif
	#ifdef USE_IRIDESCENCE
		reflectedLight.directSpecular += irradiance * BRDF_GGX_Iridescence( directLight.direction, geometry.viewDir, geometry.normal, material.specularColor, material.specularF90, material.iridescence, material.iridescenceFresnel, material.roughness );
	#else
		reflectedLight.directSpecular += irradiance * BRDF_GGX( directLight.direction, geometry.viewDir, geometry.normal, material.specularColor, material.specularF90, material.roughness );
	#endif
	reflectedLight.directDiffuse += irradiance * BRDF_Lambert( material.diffuseColor );
}
void RE_IndirectDiffuse_Physical( const in vec3 irradiance, const in GeometricContext geometry, const in PhysicalMaterial material, inout ReflectedLight reflectedLight ) {
	reflectedLight.indirectDiffuse += irradiance * BRDF_Lambert( material.diffuseColor );
}
void RE_IndirectSpecular_Physical( const in vec3 radiance, const in vec3 irradiance, const in vec3 clearcoatRadiance, const in GeometricContext geometry, const in PhysicalMaterial material, inout ReflectedLight reflectedLight) {
	#ifdef USE_CLEARCOAT
		clearcoatSpecular += clearcoatRadiance * EnvironmentBRDF( geometry.clearcoatNormal, geometry.viewDir, material.clearcoatF0, material.clearcoatF90, material.clearcoatRoughness );
	#endif
	#ifdef USE_SHEEN
		sheenSpecular += irradiance * material.sheenColor * IBLSheenBRDF( geometry.normal, geometry.viewDir, material.sheenRoughness );
	#endif
	vec3 singleScattering = vec3( 0.0 );
	vec3 multiScattering = vec3( 0.0 );
	vec3 cosineWeightedIrradiance = irradiance * RECIPROCAL_PI;
	#ifdef USE_IRIDESCENCE
		computeMultiscatteringIridescence( geometry.normal, geometry.viewDir, material.specularColor, material.specularF90, material.iridescence, material.iridescenceFresnel, material.roughness, singleScattering, multiScattering );
	#else
		computeMultiscattering( geometry.normal, geometry.viewDir, material.specularColor, material.specularF90, material.roughness, singleScattering, multiScattering );
	#endif
	vec3 totalScattering = singleScattering + multiScattering;
	vec3 diffuse = material.diffuseColor * ( 1.0 - max( max( totalScattering.r, totalScattering.g ), totalScattering.b ) );
	reflectedLight.indirectSpecular += radiance * singleScattering;
	reflectedLight.indirectSpecular += multiScattering * cosineWeightedIrradiance;
	reflectedLight.indirectDiffuse += diffuse * cosineWeightedIrradiance;
}
#define RE_Direct				RE_Direct_Physical
#define RE_Direct_RectArea		RE_Direct_RectArea_Physical
#define RE_IndirectDiffuse		RE_IndirectDiffuse_Physical
#define RE_IndirectSpecular		RE_IndirectSpecular_Physical
float computeSpecularOcclusion( const in float dotNV, const in float ambientOcclusion, const in float roughness ) {
	return saturate( pow( dotNV + ambientOcclusion, exp2( - 16.0 * roughness - 1.0 ) ) - 1.0 + ambientOcclusion );
}`,Sjt=`
GeometricContext geometry;
geometry.position = - vViewPosition;
geometry.normal = normal;
geometry.viewDir = ( isOrthographic ) ? vec3( 0, 0, 1 ) : normalize( vViewPosition );
#ifdef USE_CLEARCOAT
	geometry.clearcoatNormal = clearcoatNormal;
#endif
#ifdef USE_IRIDESCENCE
	float dotNVi = saturate( dot( normal, geometry.viewDir ) );
	if ( material.iridescenceThickness == 0.0 ) {
		material.iridescence = 0.0;
	} else {
		material.iridescence = saturate( material.iridescence );
	}
	if ( material.iridescence > 0.0 ) {
		material.iridescenceFresnel = evalIridescence( 1.0, material.iridescenceIOR, dotNVi, material.iridescenceThickness, material.specularColor );
		material.iridescenceF0 = Schlick_to_F0( material.iridescenceFresnel, 1.0, dotNVi );
	}
#endif
IncidentLight directLight;
#if ( NUM_POINT_LIGHTS > 0 ) && defined( RE_Direct )
	PointLight pointLight;
	#if defined( USE_SHADOWMAP ) && NUM_POINT_LIGHT_SHADOWS > 0
	PointLightShadow pointLightShadow;
	#endif
	#pragma unroll_loop_start
	for ( int i = 0; i < NUM_POINT_LIGHTS; i ++ ) {
		pointLight = pointLights[ i ];
		getPointLightInfo( pointLight, geometry, directLight );
		#if defined( USE_SHADOWMAP ) && ( UNROLLED_LOOP_INDEX < NUM_POINT_LIGHT_SHADOWS )
		pointLightShadow = pointLightShadows[ i ];
		directLight.color *= all( bvec2( directLight.visible, receiveShadow ) ) ? getPointShadow( pointShadowMap[ i ], pointLightShadow.shadowMapSize, pointLightShadow.shadowBias, pointLightShadow.shadowRadius, vPointShadowCoord[ i ], pointLightShadow.shadowCameraNear, pointLightShadow.shadowCameraFar ) : 1.0;
		#endif
		RE_Direct( directLight, geometry, material, reflectedLight );
	}
	#pragma unroll_loop_end
#endif
#if ( NUM_SPOT_LIGHTS > 0 ) && defined( RE_Direct )
	SpotLight spotLight;
	vec4 spotColor;
	vec3 spotLightCoord;
	bool inSpotLightMap;
	#if defined( USE_SHADOWMAP ) && NUM_SPOT_LIGHT_SHADOWS > 0
	SpotLightShadow spotLightShadow;
	#endif
	#pragma unroll_loop_start
	for ( int i = 0; i < NUM_SPOT_LIGHTS; i ++ ) {
		spotLight = spotLights[ i ];
		getSpotLightInfo( spotLight, geometry, directLight );
		#if ( UNROLLED_LOOP_INDEX < NUM_SPOT_LIGHT_SHADOWS_WITH_MAPS )
		#define SPOT_LIGHT_MAP_INDEX UNROLLED_LOOP_INDEX
		#elif ( UNROLLED_LOOP_INDEX < NUM_SPOT_LIGHT_SHADOWS )
		#define SPOT_LIGHT_MAP_INDEX NUM_SPOT_LIGHT_MAPS
		#else
		#define SPOT_LIGHT_MAP_INDEX ( UNROLLED_LOOP_INDEX - NUM_SPOT_LIGHT_SHADOWS + NUM_SPOT_LIGHT_SHADOWS_WITH_MAPS )
		#endif
		#if ( SPOT_LIGHT_MAP_INDEX < NUM_SPOT_LIGHT_MAPS )
			spotLightCoord = vSpotLightCoord[ i ].xyz / vSpotLightCoord[ i ].w;
			inSpotLightMap = all( lessThan( abs( spotLightCoord * 2. - 1. ), vec3( 1.0 ) ) );
			spotColor = texture2D( spotLightMap[ SPOT_LIGHT_MAP_INDEX ], spotLightCoord.xy );
			directLight.color = inSpotLightMap ? directLight.color * spotColor.rgb : directLight.color;
		#endif
		#undef SPOT_LIGHT_MAP_INDEX
		#if defined( USE_SHADOWMAP ) && ( UNROLLED_LOOP_INDEX < NUM_SPOT_LIGHT_SHADOWS )
		spotLightShadow = spotLightShadows[ i ];
		directLight.color *= all( bvec2( directLight.visible, receiveShadow ) ) ? getShadow( spotShadowMap[ i ], spotLightShadow.shadowMapSize, spotLightShadow.shadowBias, spotLightShadow.shadowRadius, vSpotLightCoord[ i ] ) : 1.0;
		#endif
		RE_Direct( directLight, geometry, material, reflectedLight );
	}
	#pragma unroll_loop_end
#endif
#if ( NUM_DIR_LIGHTS > 0 ) && defined( RE_Direct )
	DirectionalLight directionalLight;
	#if defined( USE_SHADOWMAP ) && NUM_DIR_LIGHT_SHADOWS > 0
	DirectionalLightShadow directionalLightShadow;
	#endif
	#pragma unroll_loop_start
	for ( int i = 0; i < NUM_DIR_LIGHTS; i ++ ) {
		directionalLight = directionalLights[ i ];
		getDirectionalLightInfo( directionalLight, geometry, directLight );
		#if defined( USE_SHADOWMAP ) && ( UNROLLED_LOOP_INDEX < NUM_DIR_LIGHT_SHADOWS )
		directionalLightShadow = directionalLightShadows[ i ];
		directLight.color *= all( bvec2( directLight.visible, receiveShadow ) ) ? getShadow( directionalShadowMap[ i ], directionalLightShadow.shadowMapSize, directionalLightShadow.shadowBias, directionalLightShadow.shadowRadius, vDirectionalShadowCoord[ i ] ) : 1.0;
		#endif
		RE_Direct( directLight, geometry, material, reflectedLight );
	}
	#pragma unroll_loop_end
#endif
#if ( NUM_RECT_AREA_LIGHTS > 0 ) && defined( RE_Direct_RectArea )
	RectAreaLight rectAreaLight;
	#pragma unroll_loop_start
	for ( int i = 0; i < NUM_RECT_AREA_LIGHTS; i ++ ) {
		rectAreaLight = rectAreaLights[ i ];
		RE_Direct_RectArea( rectAreaLight, geometry, material, reflectedLight );
	}
	#pragma unroll_loop_end
#endif
#if defined( RE_IndirectDiffuse )
	vec3 iblIrradiance = vec3( 0.0 );
	vec3 irradiance = getAmbientLightIrradiance( ambientLightColor );
	irradiance += getLightProbeIrradiance( lightProbe, geometry.normal );
	#if ( NUM_HEMI_LIGHTS > 0 )
		#pragma unroll_loop_start
		for ( int i = 0; i < NUM_HEMI_LIGHTS; i ++ ) {
			irradiance += getHemisphereLightIrradiance( hemisphereLights[ i ], geometry.normal );
		}
		#pragma unroll_loop_end
	#endif
#endif
#if defined( RE_IndirectSpecular )
	vec3 radiance = vec3( 0.0 );
	vec3 clearcoatRadiance = vec3( 0.0 );
#endif`,Ojt=`#if defined( RE_IndirectDiffuse )
	#ifdef USE_LIGHTMAP
		vec4 lightMapTexel = texture2D( lightMap, vUv2 );
		vec3 lightMapIrradiance = lightMapTexel.rgb * lightMapIntensity;
		irradiance += lightMapIrradiance;
	#endif
	#if defined( USE_ENVMAP ) && defined( STANDARD ) && defined( ENVMAP_TYPE_CUBE_UV )
		iblIrradiance += getIBLIrradiance( geometry.normal );
	#endif
#endif
#if defined( USE_ENVMAP ) && defined( RE_IndirectSpecular )
	radiance += getIBLRadiance( geometry.viewDir, geometry.normal, material.roughness );
	#ifdef USE_CLEARCOAT
		clearcoatRadiance += getIBLRadiance( geometry.viewDir, geometry.clearcoatNormal, material.clearcoatRoughness );
	#endif
#endif`,Cjt=`#if defined( RE_IndirectDiffuse )
	RE_IndirectDiffuse( irradiance, geometry, material, reflectedLight );
#endif
#if defined( RE_IndirectSpecular )
	RE_IndirectSpecular( radiance, iblIrradiance, clearcoatRadiance, geometry, material, reflectedLight );
#endif`,Tjt=`#if defined( USE_LOGDEPTHBUF ) && defined( USE_LOGDEPTHBUF_EXT )
	gl_FragDepthEXT = vIsPerspective == 0.0 ? gl_FragCoord.z : log2( vFragDepth ) * logDepthBufFC * 0.5;
#endif`,Ejt=`#if defined( USE_LOGDEPTHBUF ) && defined( USE_LOGDEPTHBUF_EXT )
	uniform float logDepthBufFC;
	varying float vFragDepth;
	varying float vIsPerspective;
#endif`,Pjt=`#ifdef USE_LOGDEPTHBUF
	#ifdef USE_LOGDEPTHBUF_EXT
		varying float vFragDepth;
		varying float vIsPerspective;
	#else
		uniform float logDepthBufFC;
	#endif
#endif`,Mjt=`#ifdef USE_LOGDEPTHBUF
	#ifdef USE_LOGDEPTHBUF_EXT
		vFragDepth = 1.0 + gl_Position.w;
		vIsPerspective = float( isPerspectiveMatrix( projectionMatrix ) );
	#else
		if ( isPerspectiveMatrix( projectionMatrix ) ) {
			gl_Position.z = log2( max( EPSILON, gl_Position.w + 1.0 ) ) * logDepthBufFC - 1.0;
			gl_Position.z *= gl_Position.w;
		}
	#endif
#endif`,kjt=`#ifdef USE_MAP
	vec4 sampledDiffuseColor = texture2D( map, vUv );
	#ifdef DECODE_VIDEO_TEXTURE
		sampledDiffuseColor = vec4( mix( pow( sampledDiffuseColor.rgb * 0.9478672986 + vec3( 0.0521327014 ), vec3( 2.4 ) ), sampledDiffuseColor.rgb * 0.0773993808, vec3( lessThanEqual( sampledDiffuseColor.rgb, vec3( 0.04045 ) ) ) ), sampledDiffuseColor.w );
	#endif
	diffuseColor *= sampledDiffuseColor;
#endif`,Ajt=`#ifdef USE_MAP
	uniform sampler2D map;
#endif`,Rjt=`#if defined( USE_MAP ) || defined( USE_ALPHAMAP )
	vec2 uv = ( uvTransform * vec3( gl_PointCoord.x, 1.0 - gl_PointCoord.y, 1 ) ).xy;
#endif
#ifdef USE_MAP
	diffuseColor *= texture2D( map, uv );
#endif
#ifdef USE_ALPHAMAP
	diffuseColor.a *= texture2D( alphaMap, uv ).g;
#endif`,Ijt=`#if defined( USE_MAP ) || defined( USE_ALPHAMAP )
	uniform mat3 uvTransform;
#endif
#ifdef USE_MAP
	uniform sampler2D map;
#endif
#ifdef USE_ALPHAMAP
	uniform sampler2D alphaMap;
#endif`,Djt=`float metalnessFactor = metalness;
#ifdef USE_METALNESSMAP
	vec4 texelMetalness = texture2D( metalnessMap, vUv );
	metalnessFactor *= texelMetalness.b;
#endif`,Ljt=`#ifdef USE_METALNESSMAP
	uniform sampler2D metalnessMap;
#endif`,Njt=`#if defined( USE_MORPHCOLORS ) && defined( MORPHTARGETS_TEXTURE )
	vColor *= morphTargetBaseInfluence;
	for ( int i = 0; i < MORPHTARGETS_COUNT; i ++ ) {
		#if defined( USE_COLOR_ALPHA )
			if ( morphTargetInfluences[ i ] != 0.0 ) vColor += getMorph( gl_VertexID, i, 2 ) * morphTargetInfluences[ i ];
		#elif defined( USE_COLOR )
			if ( morphTargetInfluences[ i ] != 0.0 ) vColor += getMorph( gl_VertexID, i, 2 ).rgb * morphTargetInfluences[ i ];
		#endif
	}
#endif`,$jt=`#ifdef USE_MORPHNORMALS
	objectNormal *= morphTargetBaseInfluence;
	#ifdef MORPHTARGETS_TEXTURE
		for ( int i = 0; i < MORPHTARGETS_COUNT; i ++ ) {
			if ( morphTargetInfluences[ i ] != 0.0 ) objectNormal += getMorph( gl_VertexID, i, 1 ).xyz * morphTargetInfluences[ i ];
		}
	#else
		objectNormal += morphNormal0 * morphTargetInfluences[ 0 ];
		objectNormal += morphNormal1 * morphTargetInfluences[ 1 ];
		objectNormal += morphNormal2 * morphTargetInfluences[ 2 ];
		objectNormal += morphNormal3 * morphTargetInfluences[ 3 ];
	#endif
#endif`,Fjt=`#ifdef USE_MORPHTARGETS
	uniform float morphTargetBaseInfluence;
	#ifdef MORPHTARGETS_TEXTURE
		uniform float morphTargetInfluences[ MORPHTARGETS_COUNT ];
		uniform sampler2DArray morphTargetsTexture;
		uniform ivec2 morphTargetsTextureSize;
		vec4 getMorph( const in int vertexIndex, const in int morphTargetIndex, const in int offset ) {
			int texelIndex = vertexIndex * MORPHTARGETS_TEXTURE_STRIDE + offset;
			int y = texelIndex / morphTargetsTextureSize.x;
			int x = texelIndex - y * morphTargetsTextureSize.x;
			ivec3 morphUV = ivec3( x, y, morphTargetIndex );
			return texelFetch( morphTargetsTexture, morphUV, 0 );
		}
	#else
		#ifndef USE_MORPHNORMALS
			uniform float morphTargetInfluences[ 8 ];
		#else
			uniform float morphTargetInfluences[ 4 ];
		#endif
	#endif
#endif`,jjt=`#ifdef USE_MORPHTARGETS
	transformed *= morphTargetBaseInfluence;
	#ifdef MORPHTARGETS_TEXTURE
		for ( int i = 0; i < MORPHTARGETS_COUNT; i ++ ) {
			if ( morphTargetInfluences[ i ] != 0.0 ) transformed += getMorph( gl_VertexID, i, 0 ).xyz * morphTargetInfluences[ i ];
		}
	#else
		transformed += morphTarget0 * morphTargetInfluences[ 0 ];
		transformed += morphTarget1 * morphTargetInfluences[ 1 ];
		transformed += morphTarget2 * morphTargetInfluences[ 2 ];
		transformed += morphTarget3 * morphTargetInfluences[ 3 ];
		#ifndef USE_MORPHNORMALS
			transformed += morphTarget4 * morphTargetInfluences[ 4 ];
			transformed += morphTarget5 * morphTargetInfluences[ 5 ];
			transformed += morphTarget6 * morphTargetInfluences[ 6 ];
			transformed += morphTarget7 * morphTargetInfluences[ 7 ];
		#endif
	#endif
#endif`,Bjt=`float faceDirection = gl_FrontFacing ? 1.0 : - 1.0;
#ifdef FLAT_SHADED
	vec3 fdx = vec3( dFdx( vViewPosition.x ), dFdx( vViewPosition.y ), dFdx( vViewPosition.z ) );
	vec3 fdy = vec3( dFdy( vViewPosition.x ), dFdy( vViewPosition.y ), dFdy( vViewPosition.z ) );
	vec3 normal = normalize( cross( fdx, fdy ) );
#else
	vec3 normal = normalize( vNormal );
	#ifdef DOUBLE_SIDED
		normal = normal * faceDirection;
	#endif
	#ifdef USE_TANGENT
		vec3 tangent = normalize( vTangent );
		vec3 bitangent = normalize( vBitangent );
		#ifdef DOUBLE_SIDED
			tangent = tangent * faceDirection;
			bitangent = bitangent * faceDirection;
		#endif
		#if defined( TANGENTSPACE_NORMALMAP ) || defined( USE_CLEARCOAT_NORMALMAP )
			mat3 vTBN = mat3( tangent, bitangent, normal );
		#endif
	#endif
#endif
vec3 geometryNormal = normal;`,zjt=`#ifdef OBJECTSPACE_NORMALMAP
	normal = texture2D( normalMap, vUv ).xyz * 2.0 - 1.0;
	#ifdef FLIP_SIDED
		normal = - normal;
	#endif
	#ifdef DOUBLE_SIDED
		normal = normal * faceDirection;
	#endif
	normal = normalize( normalMatrix * normal );
#elif defined( TANGENTSPACE_NORMALMAP )
	vec3 mapN = texture2D( normalMap, vUv ).xyz * 2.0 - 1.0;
	mapN.xy *= normalScale;
	#ifdef USE_TANGENT
		normal = normalize( vTBN * mapN );
	#else
		normal = perturbNormal2Arb( - vViewPosition, normal, mapN, faceDirection );
	#endif
#elif defined( USE_BUMPMAP )
	normal = perturbNormalArb( - vViewPosition, normal, dHdxy_fwd(), faceDirection );
#endif`,Ujt=`#ifndef FLAT_SHADED
	varying vec3 vNormal;
	#ifdef USE_TANGENT
		varying vec3 vTangent;
		varying vec3 vBitangent;
	#endif
#endif`,Wjt=`#ifndef FLAT_SHADED
	varying vec3 vNormal;
	#ifdef USE_TANGENT
		varying vec3 vTangent;
		varying vec3 vBitangent;
	#endif
#endif`,Vjt=`#ifndef FLAT_SHADED
	vNormal = normalize( transformedNormal );
	#ifdef USE_TANGENT
		vTangent = normalize( transformedTangent );
		vBitangent = normalize( cross( vNormal, vTangent ) * tangent.w );
	#endif
#endif`,Gjt=`#ifdef USE_NORMALMAP
	uniform sampler2D normalMap;
	uniform vec2 normalScale;
#endif
#ifdef OBJECTSPACE_NORMALMAP
	uniform mat3 normalMatrix;
#endif
#if ! defined ( USE_TANGENT ) && ( defined ( TANGENTSPACE_NORMALMAP ) || defined ( USE_CLEARCOAT_NORMALMAP ) )
	vec3 perturbNormal2Arb( vec3 eye_pos, vec3 surf_norm, vec3 mapN, float faceDirection ) {
		vec3 q0 = dFdx( eye_pos.xyz );
		vec3 q1 = dFdy( eye_pos.xyz );
		vec2 st0 = dFdx( vUv.st );
		vec2 st1 = dFdy( vUv.st );
		vec3 N = surf_norm;
		vec3 q1perp = cross( q1, N );
		vec3 q0perp = cross( N, q0 );
		vec3 T = q1perp * st0.x + q0perp * st1.x;
		vec3 B = q1perp * st0.y + q0perp * st1.y;
		float det = max( dot( T, T ), dot( B, B ) );
		float scale = ( det == 0.0 ) ? 0.0 : faceDirection * inversesqrt( det );
		return normalize( T * ( mapN.x * scale ) + B * ( mapN.y * scale ) + N * mapN.z );
	}
#endif`,Hjt=`#ifdef USE_CLEARCOAT
	vec3 clearcoatNormal = geometryNormal;
#endif`,qjt=`#ifdef USE_CLEARCOAT_NORMALMAP
	vec3 clearcoatMapN = texture2D( clearcoatNormalMap, vUv ).xyz * 2.0 - 1.0;
	clearcoatMapN.xy *= clearcoatNormalScale;
	#ifdef USE_TANGENT
		clearcoatNormal = normalize( vTBN * clearcoatMapN );
	#else
		clearcoatNormal = perturbNormal2Arb( - vViewPosition, clearcoatNormal, clearcoatMapN, faceDirection );
	#endif
#endif`,Xjt=`#ifdef USE_CLEARCOATMAP
	uniform sampler2D clearcoatMap;
#endif
#ifdef USE_CLEARCOAT_ROUGHNESSMAP
	uniform sampler2D clearcoatRoughnessMap;
#endif
#ifdef USE_CLEARCOAT_NORMALMAP
	uniform sampler2D clearcoatNormalMap;
	uniform vec2 clearcoatNormalScale;
#endif`,Qjt=`#ifdef USE_IRIDESCENCEMAP
	uniform sampler2D iridescenceMap;
#endif
#ifdef USE_IRIDESCENCE_THICKNESSMAP
	uniform sampler2D iridescenceThicknessMap;
#endif`,Yjt=`#ifdef OPAQUE
diffuseColor.a = 1.0;
#endif
#ifdef USE_TRANSMISSION
diffuseColor.a *= material.transmissionAlpha + 0.1;
#endif
gl_FragColor = vec4( outgoingLight, diffuseColor.a );`,Kjt=`vec3 packNormalToRGB( const in vec3 normal ) {
	return normalize( normal ) * 0.5 + 0.5;
}
vec3 unpackRGBToNormal( const in vec3 rgb ) {
	return 2.0 * rgb.xyz - 1.0;
}
const float PackUpscale = 256. / 255.;const float UnpackDownscale = 255. / 256.;
const vec3 PackFactors = vec3( 256. * 256. * 256., 256. * 256., 256. );
const vec4 UnpackFactors = UnpackDownscale / vec4( PackFactors, 1. );
const float ShiftRight8 = 1. / 256.;
vec4 packDepthToRGBA( const in float v ) {
	vec4 r = vec4( fract( v * PackFactors ), v );
	r.yzw -= r.xyz * ShiftRight8;	return r * PackUpscale;
}
float unpackRGBAToDepth( const in vec4 v ) {
	return dot( v, UnpackFactors );
}
vec4 pack2HalfToRGBA( vec2 v ) {
	vec4 r = vec4( v.x, fract( v.x * 255.0 ), v.y, fract( v.y * 255.0 ) );
	return vec4( r.x - r.y / 255.0, r.y, r.z - r.w / 255.0, r.w );
}
vec2 unpackRGBATo2Half( vec4 v ) {
	return vec2( v.x + ( v.y / 255.0 ), v.z + ( v.w / 255.0 ) );
}
float viewZToOrthographicDepth( const in float viewZ, const in float near, const in float far ) {
	return ( viewZ + near ) / ( near - far );
}
float orthographicDepthToViewZ( const in float linearClipZ, const in float near, const in float far ) {
	return linearClipZ * ( near - far ) - near;
}
float viewZToPerspectiveDepth( const in float viewZ, const in float near, const in float far ) {
	return ( ( near + viewZ ) * far ) / ( ( far - near ) * viewZ );
}
float perspectiveDepthToViewZ( const in float invClipZ, const in float near, const in float far ) {
	return ( near * far ) / ( ( far - near ) * invClipZ - far );
}`,Zjt=`#ifdef PREMULTIPLIED_ALPHA
	gl_FragColor.rgb *= gl_FragColor.a;
#endif`,Jjt=`vec4 mvPosition = vec4( transformed, 1.0 );
#ifdef USE_INSTANCING
	mvPosition = instanceMatrix * mvPosition;
#endif
mvPosition = modelViewMatrix * mvPosition;
gl_Position = projectionMatrix * mvPosition;`,e5t=`#ifdef DITHERING
	gl_FragColor.rgb = dithering( gl_FragColor.rgb );
#endif`,t5t=`#ifdef DITHERING
	vec3 dithering( vec3 color ) {
		float grid_position = rand( gl_FragCoord.xy );
		vec3 dither_shift_RGB = vec3( 0.25 / 255.0, -0.25 / 255.0, 0.25 / 255.0 );
		dither_shift_RGB = mix( 2.0 * dither_shift_RGB, -2.0 * dither_shift_RGB, grid_position );
		return color + dither_shift_RGB;
	}
#endif`,n5t=`float roughnessFactor = roughness;
#ifdef USE_ROUGHNESSMAP
	vec4 texelRoughness = texture2D( roughnessMap, vUv );
	roughnessFactor *= texelRoughness.g;
#endif`,r5t=`#ifdef USE_ROUGHNESSMAP
	uniform sampler2D roughnessMap;
#endif`,i5t=`#if NUM_SPOT_LIGHT_COORDS > 0
  varying vec4 vSpotLightCoord[ NUM_SPOT_LIGHT_COORDS ];
#endif
#if NUM_SPOT_LIGHT_MAPS > 0
  uniform sampler2D spotLightMap[ NUM_SPOT_LIGHT_MAPS ];
#endif
#ifdef USE_SHADOWMAP
	#if NUM_DIR_LIGHT_SHADOWS > 0
		uniform sampler2D directionalShadowMap[ NUM_DIR_LIGHT_SHADOWS ];
		varying vec4 vDirectionalShadowCoord[ NUM_DIR_LIGHT_SHADOWS ];
		struct DirectionalLightShadow {
			float shadowBias;
			float shadowNormalBias;
			float shadowRadius;
			vec2 shadowMapSize;
		};
		uniform DirectionalLightShadow directionalLightShadows[ NUM_DIR_LIGHT_SHADOWS ];
	#endif
	#if NUM_SPOT_LIGHT_SHADOWS > 0
		uniform sampler2D spotShadowMap[ NUM_SPOT_LIGHT_SHADOWS ];
		struct SpotLightShadow {
			float shadowBias;
			float shadowNormalBias;
			float shadowRadius;
			vec2 shadowMapSize;
		};
		uniform SpotLightShadow spotLightShadows[ NUM_SPOT_LIGHT_SHADOWS ];
	#endif
	#if NUM_POINT_LIGHT_SHADOWS > 0
		uniform sampler2D pointShadowMap[ NUM_POINT_LIGHT_SHADOWS ];
		varying vec4 vPointShadowCoord[ NUM_POINT_LIGHT_SHADOWS ];
		struct PointLightShadow {
			float shadowBias;
			float shadowNormalBias;
			float shadowRadius;
			vec2 shadowMapSize;
			float shadowCameraNear;
			float shadowCameraFar;
		};
		uniform PointLightShadow pointLightShadows[ NUM_POINT_LIGHT_SHADOWS ];
	#endif
	float texture2DCompare( sampler2D depths, vec2 uv, float compare ) {
		return step( compare, unpackRGBAToDepth( texture2D( depths, uv ) ) );
	}
	vec2 texture2DDistribution( sampler2D shadow, vec2 uv ) {
		return unpackRGBATo2Half( texture2D( shadow, uv ) );
	}
	float VSMShadow (sampler2D shadow, vec2 uv, float compare ){
		float occlusion = 1.0;
		vec2 distribution = texture2DDistribution( shadow, uv );
		float hard_shadow = step( compare , distribution.x );
		if (hard_shadow != 1.0 ) {
			float distance = compare - distribution.x ;
			float variance = max( 0.00000, distribution.y * distribution.y );
			float softness_probability = variance / (variance + distance * distance );			softness_probability = clamp( ( softness_probability - 0.3 ) / ( 0.95 - 0.3 ), 0.0, 1.0 );			occlusion = clamp( max( hard_shadow, softness_probability ), 0.0, 1.0 );
		}
		return occlusion;
	}
	float getShadow( sampler2D shadowMap, vec2 shadowMapSize, float shadowBias, float shadowRadius, vec4 shadowCoord ) {
		float shadow = 1.0;
		shadowCoord.xyz /= shadowCoord.w;
		shadowCoord.z += shadowBias;
		bvec4 inFrustumVec = bvec4 ( shadowCoord.x >= 0.0, shadowCoord.x <= 1.0, shadowCoord.y >= 0.0, shadowCoord.y <= 1.0 );
		bool inFrustum = all( inFrustumVec );
		bvec2 frustumTestVec = bvec2( inFrustum, shadowCoord.z <= 1.0 );
		bool frustumTest = all( frustumTestVec );
		if ( frustumTest ) {
		#if defined( SHADOWMAP_TYPE_PCF )
			vec2 texelSize = vec2( 1.0 ) / shadowMapSize;
			float dx0 = - texelSize.x * shadowRadius;
			float dy0 = - texelSize.y * shadowRadius;
			float dx1 = + texelSize.x * shadowRadius;
			float dy1 = + texelSize.y * shadowRadius;
			float dx2 = dx0 / 2.0;
			float dy2 = dy0 / 2.0;
			float dx3 = dx1 / 2.0;
			float dy3 = dy1 / 2.0;
			shadow = (
				texture2DCompare( shadowMap, shadowCoord.xy + vec2( dx0, dy0 ), shadowCoord.z ) +
				texture2DCompare( shadowMap, shadowCoord.xy + vec2( 0.0, dy0 ), shadowCoord.z ) +
				texture2DCompare( shadowMap, shadowCoord.xy + vec2( dx1, dy0 ), shadowCoord.z ) +
				texture2DCompare( shadowMap, shadowCoord.xy + vec2( dx2, dy2 ), shadowCoord.z ) +
				texture2DCompare( shadowMap, shadowCoord.xy + vec2( 0.0, dy2 ), shadowCoord.z ) +
				texture2DCompare( shadowMap, shadowCoord.xy + vec2( dx3, dy2 ), shadowCoord.z ) +
				texture2DCompare( shadowMap, shadowCoord.xy + vec2( dx0, 0.0 ), shadowCoord.z ) +
				texture2DCompare( shadowMap, shadowCoord.xy + vec2( dx2, 0.0 ), shadowCoord.z ) +
				texture2DCompare( shadowMap, shadowCoord.xy, shadowCoord.z ) +
				texture2DCompare( shadowMap, shadowCoord.xy + vec2( dx3, 0.0 ), shadowCoord.z ) +
				texture2DCompare( shadowMap, shadowCoord.xy + vec2( dx1, 0.0 ), shadowCoord.z ) +
				texture2DCompare( shadowMap, shadowCoord.xy + vec2( dx2, dy3 ), shadowCoord.z ) +
				texture2DCompare( shadowMap, shadowCoord.xy + vec2( 0.0, dy3 ), shadowCoord.z ) +
				texture2DCompare( shadowMap, shadowCoord.xy + vec2( dx3, dy3 ), shadowCoord.z ) +
				texture2DCompare( shadowMap, shadowCoord.xy + vec2( dx0, dy1 ), shadowCoord.z ) +
				texture2DCompare( shadowMap, shadowCoord.xy + vec2( 0.0, dy1 ), shadowCoord.z ) +
				texture2DCompare( shadowMap, shadowCoord.xy + vec2( dx1, dy1 ), shadowCoord.z )
			) * ( 1.0 / 17.0 );
		#elif defined( SHADOWMAP_TYPE_PCF_SOFT )
			vec2 texelSize = vec2( 1.0 ) / shadowMapSize;
			float dx = texelSize.x;
			float dy = texelSize.y;
			vec2 uv = shadowCoord.xy;
			vec2 f = fract( uv * shadowMapSize + 0.5 );
			uv -= f * texelSize;
			shadow = (
				texture2DCompare( shadowMap, uv, shadowCoord.z ) +
				texture2DCompare( shadowMap, uv + vec2( dx, 0.0 ), shadowCoord.z ) +
				texture2DCompare( shadowMap, uv + vec2( 0.0, dy ), shadowCoord.z ) +
				texture2DCompare( shadowMap, uv + texelSize, shadowCoord.z ) +
				mix( texture2DCompare( shadowMap, uv + vec2( -dx, 0.0 ), shadowCoord.z ),
					 texture2DCompare( shadowMap, uv + vec2( 2.0 * dx, 0.0 ), shadowCoord.z ),
					 f.x ) +
				mix( texture2DCompare( shadowMap, uv + vec2( -dx, dy ), shadowCoord.z ),
					 texture2DCompare( shadowMap, uv + vec2( 2.0 * dx, dy ), shadowCoord.z ),
					 f.x ) +
				mix( texture2DCompare( shadowMap, uv + vec2( 0.0, -dy ), shadowCoord.z ),
					 texture2DCompare( shadowMap, uv + vec2( 0.0, 2.0 * dy ), shadowCoord.z ),
					 f.y ) +
				mix( texture2DCompare( shadowMap, uv + vec2( dx, -dy ), shadowCoord.z ),
					 texture2DCompare( shadowMap, uv + vec2( dx, 2.0 * dy ), shadowCoord.z ),
					 f.y ) +
				mix( mix( texture2DCompare( shadowMap, uv + vec2( -dx, -dy ), shadowCoord.z ),
						  texture2DCompare( shadowMap, uv + vec2( 2.0 * dx, -dy ), shadowCoord.z ),
						  f.x ),
					 mix( texture2DCompare( shadowMap, uv + vec2( -dx, 2.0 * dy ), shadowCoord.z ),
						  texture2DCompare( shadowMap, uv + vec2( 2.0 * dx, 2.0 * dy ), shadowCoord.z ),
						  f.x ),
					 f.y )
			) * ( 1.0 / 9.0 );
		#elif defined( SHADOWMAP_TYPE_VSM )
			shadow = VSMShadow( shadowMap, shadowCoord.xy, shadowCoord.z );
		#else
			shadow = texture2DCompare( shadowMap, shadowCoord.xy, shadowCoord.z );
		#endif
		}
		return shadow;
	}
	vec2 cubeToUV( vec3 v, float texelSizeY ) {
		vec3 absV = abs( v );
		float scaleToCube = 1.0 / max( absV.x, max( absV.y, absV.z ) );
		absV *= scaleToCube;
		v *= scaleToCube * ( 1.0 - 2.0 * texelSizeY );
		vec2 planar = v.xy;
		float almostATexel = 1.5 * texelSizeY;
		float almostOne = 1.0 - almostATexel;
		if ( absV.z >= almostOne ) {
			if ( v.z > 0.0 )
				planar.x = 4.0 - v.x;
		} else if ( absV.x >= almostOne ) {
			float signX = sign( v.x );
			planar.x = v.z * signX + 2.0 * signX;
		} else if ( absV.y >= almostOne ) {
			float signY = sign( v.y );
			planar.x = v.x + 2.0 * signY + 2.0;
			planar.y = v.z * signY - 2.0;
		}
		return vec2( 0.125, 0.25 ) * planar + vec2( 0.375, 0.75 );
	}
	float getPointShadow( sampler2D shadowMap, vec2 shadowMapSize, float shadowBias, float shadowRadius, vec4 shadowCoord, float shadowCameraNear, float shadowCameraFar ) {
		vec2 texelSize = vec2( 1.0 ) / ( shadowMapSize * vec2( 4.0, 2.0 ) );
		vec3 lightToPosition = shadowCoord.xyz;
		float dp = ( length( lightToPosition ) - shadowCameraNear ) / ( shadowCameraFar - shadowCameraNear );		dp += shadowBias;
		vec3 bd3D = normalize( lightToPosition );
		#if defined( SHADOWMAP_TYPE_PCF ) || defined( SHADOWMAP_TYPE_PCF_SOFT ) || defined( SHADOWMAP_TYPE_VSM )
			vec2 offset = vec2( - 1, 1 ) * shadowRadius * texelSize.y;
			return (
				texture2DCompare( shadowMap, cubeToUV( bd3D + offset.xyy, texelSize.y ), dp ) +
				texture2DCompare( shadowMap, cubeToUV( bd3D + offset.yyy, texelSize.y ), dp ) +
				texture2DCompare( shadowMap, cubeToUV( bd3D + offset.xyx, texelSize.y ), dp ) +
				texture2DCompare( shadowMap, cubeToUV( bd3D + offset.yyx, texelSize.y ), dp ) +
				texture2DCompare( shadowMap, cubeToUV( bd3D, texelSize.y ), dp ) +
				texture2DCompare( shadowMap, cubeToUV( bd3D + offset.xxy, texelSize.y ), dp ) +
				texture2DCompare( shadowMap, cubeToUV( bd3D + offset.yxy, texelSize.y ), dp ) +
				texture2DCompare( shadowMap, cubeToUV( bd3D + offset.xxx, texelSize.y ), dp ) +
				texture2DCompare( shadowMap, cubeToUV( bd3D + offset.yxx, texelSize.y ), dp )
			) * ( 1.0 / 9.0 );
		#else
			return texture2DCompare( shadowMap, cubeToUV( bd3D, texelSize.y ), dp );
		#endif
	}
#endif`,o5t=`#if NUM_SPOT_LIGHT_COORDS > 0
  uniform mat4 spotLightMatrix[ NUM_SPOT_LIGHT_COORDS ];
  varying vec4 vSpotLightCoord[ NUM_SPOT_LIGHT_COORDS ];
#endif
#ifdef USE_SHADOWMAP
	#if NUM_DIR_LIGHT_SHADOWS > 0
		uniform mat4 directionalShadowMatrix[ NUM_DIR_LIGHT_SHADOWS ];
		varying vec4 vDirectionalShadowCoord[ NUM_DIR_LIGHT_SHADOWS ];
		struct DirectionalLightShadow {
			float shadowBias;
			float shadowNormalBias;
			float shadowRadius;
			vec2 shadowMapSize;
		};
		uniform DirectionalLightShadow directionalLightShadows[ NUM_DIR_LIGHT_SHADOWS ];
	#endif
	#if NUM_SPOT_LIGHT_SHADOWS > 0
		struct SpotLightShadow {
			float shadowBias;
			float shadowNormalBias;
			float shadowRadius;
			vec2 shadowMapSize;
		};
		uniform SpotLightShadow spotLightShadows[ NUM_SPOT_LIGHT_SHADOWS ];
	#endif
	#if NUM_POINT_LIGHT_SHADOWS > 0
		uniform mat4 pointShadowMatrix[ NUM_POINT_LIGHT_SHADOWS ];
		varying vec4 vPointShadowCoord[ NUM_POINT_LIGHT_SHADOWS ];
		struct PointLightShadow {
			float shadowBias;
			float shadowNormalBias;
			float shadowRadius;
			vec2 shadowMapSize;
			float shadowCameraNear;
			float shadowCameraFar;
		};
		uniform PointLightShadow pointLightShadows[ NUM_POINT_LIGHT_SHADOWS ];
	#endif
#endif`,a5t=`#if defined( USE_SHADOWMAP ) || ( NUM_SPOT_LIGHT_COORDS > 0 )
	#if NUM_DIR_LIGHT_SHADOWS > 0 || NUM_SPOT_LIGHT_COORDS > 0 || NUM_POINT_LIGHT_SHADOWS > 0
		vec3 shadowWorldNormal = inverseTransformDirection( transformedNormal, viewMatrix );
		vec4 shadowWorldPosition;
	#endif
	#if NUM_DIR_LIGHT_SHADOWS > 0
	#pragma unroll_loop_start
	for ( int i = 0; i < NUM_DIR_LIGHT_SHADOWS; i ++ ) {
		shadowWorldPosition = worldPosition + vec4( shadowWorldNormal * directionalLightShadows[ i ].shadowNormalBias, 0 );
		vDirectionalShadowCoord[ i ] = directionalShadowMatrix[ i ] * shadowWorldPosition;
	}
	#pragma unroll_loop_end
	#endif
	#if NUM_SPOT_LIGHT_COORDS > 0
	#pragma unroll_loop_start
	for ( int i = 0; i < NUM_SPOT_LIGHT_COORDS; i ++ ) {
		shadowWorldPosition = worldPosition;
		#if ( defined( USE_SHADOWMAP ) && UNROLLED_LOOP_INDEX < NUM_SPOT_LIGHT_SHADOWS )
			shadowWorldPosition.xyz += shadowWorldNormal * spotLightShadows[ i ].shadowNormalBias;
		#endif
		vSpotLightCoord[ i ] = spotLightMatrix[ i ] * shadowWorldPosition;
	}
	#pragma unroll_loop_end
	#endif
	#if NUM_POINT_LIGHT_SHADOWS > 0
	#pragma unroll_loop_start
	for ( int i = 0; i < NUM_POINT_LIGHT_SHADOWS; i ++ ) {
		shadowWorldPosition = worldPosition + vec4( shadowWorldNormal * pointLightShadows[ i ].shadowNormalBias, 0 );
		vPointShadowCoord[ i ] = pointShadowMatrix[ i ] * shadowWorldPosition;
	}
	#pragma unroll_loop_end
	#endif
#endif`,s5t=`float getShadowMask() {
	float shadow = 1.0;
	#ifdef USE_SHADOWMAP
	#if NUM_DIR_LIGHT_SHADOWS > 0
	DirectionalLightShadow directionalLight;
	#pragma unroll_loop_start
	for ( int i = 0; i < NUM_DIR_LIGHT_SHADOWS; i ++ ) {
		directionalLight = directionalLightShadows[ i ];
		shadow *= receiveShadow ? getShadow( directionalShadowMap[ i ], directionalLight.shadowMapSize, directionalLight.shadowBias, directionalLight.shadowRadius, vDirectionalShadowCoord[ i ] ) : 1.0;
	}
	#pragma unroll_loop_end
	#endif
	#if NUM_SPOT_LIGHT_SHADOWS > 0
	SpotLightShadow spotLight;
	#pragma unroll_loop_start
	for ( int i = 0; i < NUM_SPOT_LIGHT_SHADOWS; i ++ ) {
		spotLight = spotLightShadows[ i ];
		shadow *= receiveShadow ? getShadow( spotShadowMap[ i ], spotLight.shadowMapSize, spotLight.shadowBias, spotLight.shadowRadius, vSpotLightCoord[ i ] ) : 1.0;
	}
	#pragma unroll_loop_end
	#endif
	#if NUM_POINT_LIGHT_SHADOWS > 0
	PointLightShadow pointLight;
	#pragma unroll_loop_start
	for ( int i = 0; i < NUM_POINT_LIGHT_SHADOWS; i ++ ) {
		pointLight = pointLightShadows[ i ];
		shadow *= receiveShadow ? getPointShadow( pointShadowMap[ i ], pointLight.shadowMapSize, pointLight.shadowBias, pointLight.shadowRadius, vPointShadowCoord[ i ], pointLight.shadowCameraNear, pointLight.shadowCameraFar ) : 1.0;
	}
	#pragma unroll_loop_end
	#endif
	#endif
	return shadow;
}`,l5t=`#ifdef USE_SKINNING
	mat4 boneMatX = getBoneMatrix( skinIndex.x );
	mat4 boneMatY = getBoneMatrix( skinIndex.y );
	mat4 boneMatZ = getBoneMatrix( skinIndex.z );
	mat4 boneMatW = getBoneMatrix( skinIndex.w );
#endif`,c5t=`#ifdef USE_SKINNING
	uniform mat4 bindMatrix;
	uniform mat4 bindMatrixInverse;
	uniform highp sampler2D boneTexture;
	uniform int boneTextureSize;
	mat4 getBoneMatrix( const in float i ) {
		float j = i * 4.0;
		float x = mod( j, float( boneTextureSize ) );
		float y = floor( j / float( boneTextureSize ) );
		float dx = 1.0 / float( boneTextureSize );
		float dy = 1.0 / float( boneTextureSize );
		y = dy * ( y + 0.5 );
		vec4 v1 = texture2D( boneTexture, vec2( dx * ( x + 0.5 ), y ) );
		vec4 v2 = texture2D( boneTexture, vec2( dx * ( x + 1.5 ), y ) );
		vec4 v3 = texture2D( boneTexture, vec2( dx * ( x + 2.5 ), y ) );
		vec4 v4 = texture2D( boneTexture, vec2( dx * ( x + 3.5 ), y ) );
		mat4 bone = mat4( v1, v2, v3, v4 );
		return bone;
	}
#endif`,u5t=`#ifdef USE_SKINNING
	vec4 skinVertex = bindMatrix * vec4( transformed, 1.0 );
	vec4 skinned = vec4( 0.0 );
	skinned += boneMatX * skinVertex * skinWeight.x;
	skinned += boneMatY * skinVertex * skinWeight.y;
	skinned += boneMatZ * skinVertex * skinWeight.z;
	skinned += boneMatW * skinVertex * skinWeight.w;
	transformed = ( bindMatrixInverse * skinned ).xyz;
#endif`,f5t=`#ifdef USE_SKINNING
	mat4 skinMatrix = mat4( 0.0 );
	skinMatrix += skinWeight.x * boneMatX;
	skinMatrix += skinWeight.y * boneMatY;
	skinMatrix += skinWeight.z * boneMatZ;
	skinMatrix += skinWeight.w * boneMatW;
	skinMatrix = bindMatrixInverse * skinMatrix * bindMatrix;
	objectNormal = vec4( skinMatrix * vec4( objectNormal, 0.0 ) ).xyz;
	#ifdef USE_TANGENT
		objectTangent = vec4( skinMatrix * vec4( objectTangent, 0.0 ) ).xyz;
	#endif
#endif`,d5t=`float specularStrength;
#ifdef USE_SPECULARMAP
	vec4 texelSpecular = texture2D( specularMap, vUv );
	specularStrength = texelSpecular.r;
#else
	specularStrength = 1.0;
#endif`,h5t=`#ifdef USE_SPECULARMAP
	uniform sampler2D specularMap;
#endif`,p5t=`#if defined( TONE_MAPPING )
	gl_FragColor.rgb = toneMapping( gl_FragColor.rgb );
#endif`,m5t=`#ifndef saturate
#define saturate( a ) clamp( a, 0.0, 1.0 )
#endif
uniform float toneMappingExposure;
vec3 LinearToneMapping( vec3 color ) {
	return toneMappingExposure * color;
}
vec3 ReinhardToneMapping( vec3 color ) {
	color *= toneMappingExposure;
	return saturate( color / ( vec3( 1.0 ) + color ) );
}
vec3 OptimizedCineonToneMapping( vec3 color ) {
	color *= toneMappingExposure;
	color = max( vec3( 0.0 ), color - 0.004 );
	return pow( ( color * ( 6.2 * color + 0.5 ) ) / ( color * ( 6.2 * color + 1.7 ) + 0.06 ), vec3( 2.2 ) );
}
vec3 RRTAndODTFit( vec3 v ) {
	vec3 a = v * ( v + 0.0245786 ) - 0.000090537;
	vec3 b = v * ( 0.983729 * v + 0.4329510 ) + 0.238081;
	return a / b;
}
vec3 ACESFilmicToneMapping( vec3 color ) {
	const mat3 ACESInputMat = mat3(
		vec3( 0.59719, 0.07600, 0.02840 ),		vec3( 0.35458, 0.90834, 0.13383 ),
		vec3( 0.04823, 0.01566, 0.83777 )
	);
	const mat3 ACESOutputMat = mat3(
		vec3(  1.60475, -0.10208, -0.00327 ),		vec3( -0.53108,  1.10813, -0.07276 ),
		vec3( -0.07367, -0.00605,  1.07602 )
	);
	color *= toneMappingExposure / 0.6;
	color = ACESInputMat * color;
	color = RRTAndODTFit( color );
	color = ACESOutputMat * color;
	return saturate( color );
}
vec3 CustomToneMapping( vec3 color ) { return color; }`,g5t=`#ifdef USE_TRANSMISSION
	material.transmission = transmission;
	material.transmissionAlpha = 1.0;
	material.thickness = thickness;
	material.attenuationDistance = attenuationDistance;
	material.attenuationColor = attenuationColor;
	#ifdef USE_TRANSMISSIONMAP
		material.transmission *= texture2D( transmissionMap, vUv ).r;
	#endif
	#ifdef USE_THICKNESSMAP
		material.thickness *= texture2D( thicknessMap, vUv ).g;
	#endif
	vec3 pos = vWorldPosition;
	vec3 v = normalize( cameraPosition - pos );
	vec3 n = inverseTransformDirection( normal, viewMatrix );
	vec4 transmission = getIBLVolumeRefraction(
		n, v, material.roughness, material.diffuseColor, material.specularColor, material.specularF90,
		pos, modelMatrix, viewMatrix, projectionMatrix, material.ior, material.thickness,
		material.attenuationColor, material.attenuationDistance );
	material.transmissionAlpha = mix( material.transmissionAlpha, transmission.a, material.transmission );
	totalDiffuse = mix( totalDiffuse, transmission.rgb, material.transmission );
#endif`,v5t=`#ifdef USE_TRANSMISSION
	uniform float transmission;
	uniform float thickness;
	uniform float attenuationDistance;
	uniform vec3 attenuationColor;
	#ifdef USE_TRANSMISSIONMAP
		uniform sampler2D transmissionMap;
	#endif
	#ifdef USE_THICKNESSMAP
		uniform sampler2D thicknessMap;
	#endif
	uniform vec2 transmissionSamplerSize;
	uniform sampler2D transmissionSamplerMap;
	uniform mat4 modelMatrix;
	uniform mat4 projectionMatrix;
	varying vec3 vWorldPosition;
	vec3 getVolumeTransmissionRay( const in vec3 n, const in vec3 v, const in float thickness, const in float ior, const in mat4 modelMatrix ) {
		vec3 refractionVector = refract( - v, normalize( n ), 1.0 / ior );
		vec3 modelScale;
		modelScale.x = length( vec3( modelMatrix[ 0 ].xyz ) );
		modelScale.y = length( vec3( modelMatrix[ 1 ].xyz ) );
		modelScale.z = length( vec3( modelMatrix[ 2 ].xyz ) );
		return normalize( refractionVector ) * thickness * modelScale;
	}
	float applyIorToRoughness( const in float roughness, const in float ior ) {
		return roughness * clamp( ior * 2.0 - 2.0, 0.0, 1.0 );
	}
	vec4 getTransmissionSample( const in vec2 fragCoord, const in float roughness, const in float ior ) {
		float framebufferLod = log2( transmissionSamplerSize.x ) * applyIorToRoughness( roughness, ior );
		#ifdef texture2DLodEXT
			return texture2DLodEXT( transmissionSamplerMap, fragCoord.xy, framebufferLod );
		#else
			return texture2D( transmissionSamplerMap, fragCoord.xy, framebufferLod );
		#endif
	}
	vec3 applyVolumeAttenuation( const in vec3 radiance, const in float transmissionDistance, const in vec3 attenuationColor, const in float attenuationDistance ) {
		if ( attenuationDistance == 0.0 ) {
			return radiance;
		} else {
			vec3 attenuationCoefficient = -log( attenuationColor ) / attenuationDistance;
			vec3 transmittance = exp( - attenuationCoefficient * transmissionDistance );			return transmittance * radiance;
		}
	}
	vec4 getIBLVolumeRefraction( const in vec3 n, const in vec3 v, const in float roughness, const in vec3 diffuseColor,
		const in vec3 specularColor, const in float specularF90, const in vec3 position, const in mat4 modelMatrix,
		const in mat4 viewMatrix, const in mat4 projMatrix, const in float ior, const in float thickness,
		const in vec3 attenuationColor, const in float attenuationDistance ) {
		vec3 transmissionRay = getVolumeTransmissionRay( n, v, thickness, ior, modelMatrix );
		vec3 refractedRayExit = position + transmissionRay;
		vec4 ndcPos = projMatrix * viewMatrix * vec4( refractedRayExit, 1.0 );
		vec2 refractionCoords = ndcPos.xy / ndcPos.w;
		refractionCoords += 1.0;
		refractionCoords /= 2.0;
		vec4 transmittedLight = getTransmissionSample( refractionCoords, roughness, ior );
		vec3 attenuatedColor = applyVolumeAttenuation( transmittedLight.rgb, length( transmissionRay ), attenuationColor, attenuationDistance );
		vec3 F = EnvironmentBRDF( n, v, specularColor, specularF90, roughness );
		return vec4( ( 1.0 - F ) * attenuatedColor * diffuseColor, transmittedLight.a );
	}
#endif`,y5t=`#if ( defined( USE_UV ) && ! defined( UVS_VERTEX_ONLY ) )
	varying vec2 vUv;
#endif`,x5t=`#ifdef USE_UV
	#ifdef UVS_VERTEX_ONLY
		vec2 vUv;
	#else
		varying vec2 vUv;
	#endif
	uniform mat3 uvTransform;
#endif`,b5t=`#ifdef USE_UV
	vUv = ( uvTransform * vec3( uv, 1 ) ).xy;
#endif`,_5t=`#if defined( USE_LIGHTMAP ) || defined( USE_AOMAP )
	varying vec2 vUv2;
#endif`,w5t=`#if defined( USE_LIGHTMAP ) || defined( USE_AOMAP )
	attribute vec2 uv2;
	varying vec2 vUv2;
	uniform mat3 uv2Transform;
#endif`,S5t=`#if defined( USE_LIGHTMAP ) || defined( USE_AOMAP )
	vUv2 = ( uv2Transform * vec3( uv2, 1 ) ).xy;
#endif`,O5t=`#if defined( USE_ENVMAP ) || defined( DISTANCE ) || defined ( USE_SHADOWMAP ) || defined ( USE_TRANSMISSION ) || NUM_SPOT_LIGHT_COORDS > 0
	vec4 worldPosition = vec4( transformed, 1.0 );
	#ifdef USE_INSTANCING
		worldPosition = instanceMatrix * worldPosition;
	#endif
	worldPosition = modelMatrix * worldPosition;
#endif`;const C5t=`varying vec2 vUv;
uniform mat3 uvTransform;
void main() {
	vUv = ( uvTransform * vec3( uv, 1 ) ).xy;
	gl_Position = vec4( position.xy, 1.0, 1.0 );
}`,T5t=`uniform sampler2D t2D;
varying vec2 vUv;
void main() {
	gl_FragColor = texture2D( t2D, vUv );
	#ifdef DECODE_VIDEO_TEXTURE
		gl_FragColor = vec4( mix( pow( gl_FragColor.rgb * 0.9478672986 + vec3( 0.0521327014 ), vec3( 2.4 ) ), gl_FragColor.rgb * 0.0773993808, vec3( lessThanEqual( gl_FragColor.rgb, vec3( 0.04045 ) ) ) ), gl_FragColor.w );
	#endif
	#include <tonemapping_fragment>
	#include <encodings_fragment>
}`,E5t=`varying vec3 vWorldDirection;
#include <common>
void main() {
	vWorldDirection = transformDirection( position, modelMatrix );
	#include <begin_vertex>
	#include <project_vertex>
	gl_Position.z = gl_Position.w;
}`,P5t=`#include <envmap_common_pars_fragment>
uniform float opacity;
varying vec3 vWorldDirection;
#include <cube_uv_reflection_fragment>
void main() {
	vec3 vReflect = vWorldDirection;
	#include <envmap_fragment>
	gl_FragColor = envColor;
	gl_FragColor.a *= opacity;
	#include <tonemapping_fragment>
	#include <encodings_fragment>
}`,M5t=`#include <common>
#include <uv_pars_vertex>
#include <displacementmap_pars_vertex>
#include <morphtarget_pars_vertex>
#include <skinning_pars_vertex>
#include <logdepthbuf_pars_vertex>
#include <clipping_planes_pars_vertex>
varying vec2 vHighPrecisionZW;
void main() {
	#include <uv_vertex>
	#include <skinbase_vertex>
	#ifdef USE_DISPLACEMENTMAP
		#include <beginnormal_vertex>
		#include <morphnormal_vertex>
		#include <skinnormal_vertex>
	#endif
	#include <begin_vertex>
	#include <morphtarget_vertex>
	#include <skinning_vertex>
	#include <displacementmap_vertex>
	#include <project_vertex>
	#include <logdepthbuf_vertex>
	#include <clipping_planes_vertex>
	vHighPrecisionZW = gl_Position.zw;
}`,k5t=`#if DEPTH_PACKING == 3200
	uniform float opacity;
#endif
#include <common>
#include <packing>
#include <uv_pars_fragment>
#include <map_pars_fragment>
#include <alphamap_pars_fragment>
#include <alphatest_pars_fragment>
#include <logdepthbuf_pars_fragment>
#include <clipping_planes_pars_fragment>
varying vec2 vHighPrecisionZW;
void main() {
	#include <clipping_planes_fragment>
	vec4 diffuseColor = vec4( 1.0 );
	#if DEPTH_PACKING == 3200
		diffuseColor.a = opacity;
	#endif
	#include <map_fragment>
	#include <alphamap_fragment>
	#include <alphatest_fragment>
	#include <logdepthbuf_fragment>
	float fragCoordZ = 0.5 * vHighPrecisionZW[0] / vHighPrecisionZW[1] + 0.5;
	#if DEPTH_PACKING == 3200
		gl_FragColor = vec4( vec3( 1.0 - fragCoordZ ), opacity );
	#elif DEPTH_PACKING == 3201
		gl_FragColor = packDepthToRGBA( fragCoordZ );
	#endif
}`,A5t=`#define DISTANCE
varying vec3 vWorldPosition;
#include <common>
#include <uv_pars_vertex>
#include <displacementmap_pars_vertex>
#include <morphtarget_pars_vertex>
#include <skinning_pars_vertex>
#include <clipping_planes_pars_vertex>
void main() {
	#include <uv_vertex>
	#include <skinbase_vertex>
	#ifdef USE_DISPLACEMENTMAP
		#include <beginnormal_vertex>
		#include <morphnormal_vertex>
		#include <skinnormal_vertex>
	#endif
	#include <begin_vertex>
	#include <morphtarget_vertex>
	#include <skinning_vertex>
	#include <displacementmap_vertex>
	#include <project_vertex>
	#include <worldpos_vertex>
	#include <clipping_planes_vertex>
	vWorldPosition = worldPosition.xyz;
}`,R5t=`#define DISTANCE
uniform vec3 referencePosition;
uniform float nearDistance;
uniform float farDistance;
varying vec3 vWorldPosition;
#include <common>
#include <packing>
#include <uv_pars_fragment>
#include <map_pars_fragment>
#include <alphamap_pars_fragment>
#include <alphatest_pars_fragment>
#include <clipping_planes_pars_fragment>
void main () {
	#include <clipping_planes_fragment>
	vec4 diffuseColor = vec4( 1.0 );
	#include <map_fragment>
	#include <alphamap_fragment>
	#include <alphatest_fragment>
	float dist = length( vWorldPosition - referencePosition );
	dist = ( dist - nearDistance ) / ( farDistance - nearDistance );
	dist = saturate( dist );
	gl_FragColor = packDepthToRGBA( dist );
}`,I5t=`varying vec3 vWorldDirection;
#include <common>
void main() {
	vWorldDirection = transformDirection( position, modelMatrix );
	#include <begin_vertex>
	#include <project_vertex>
}`,D5t=`uniform sampler2D tEquirect;
varying vec3 vWorldDirection;
#include <common>
void main() {
	vec3 direction = normalize( vWorldDirection );
	vec2 sampleUV = equirectUv( direction );
	gl_FragColor = texture2D( tEquirect, sampleUV );
	#include <tonemapping_fragment>
	#include <encodings_fragment>
}`,L5t=`uniform float scale;
attribute float lineDistance;
varying float vLineDistance;
#include <common>
#include <color_pars_vertex>
#include <fog_pars_vertex>
#include <morphtarget_pars_vertex>
#include <logdepthbuf_pars_vertex>
#include <clipping_planes_pars_vertex>
void main() {
	vLineDistance = scale * lineDistance;
	#include <color_vertex>
	#include <morphcolor_vertex>
	#include <begin_vertex>
	#include <morphtarget_vertex>
	#include <project_vertex>
	#include <logdepthbuf_vertex>
	#include <clipping_planes_vertex>
	#include <fog_vertex>
}`,N5t=`uniform vec3 diffuse;
uniform float opacity;
uniform float dashSize;
uniform float totalSize;
varying float vLineDistance;
#include <common>
#include <color_pars_fragment>
#include <fog_pars_fragment>
#include <logdepthbuf_pars_fragment>
#include <clipping_planes_pars_fragment>
void main() {
	#include <clipping_planes_fragment>
	if ( mod( vLineDistance, totalSize ) > dashSize ) {
		discard;
	}
	vec3 outgoingLight = vec3( 0.0 );
	vec4 diffuseColor = vec4( diffuse, opacity );
	#include <logdepthbuf_fragment>
	#include <color_fragment>
	outgoingLight = diffuseColor.rgb;
	#include <output_fragment>
	#include <tonemapping_fragment>
	#include <encodings_fragment>
	#include <fog_fragment>
	#include <premultiplied_alpha_fragment>
}`,$5t=`#include <common>
#include <uv_pars_vertex>
#include <uv2_pars_vertex>
#include <envmap_pars_vertex>
#include <color_pars_vertex>
#include <fog_pars_vertex>
#include <morphtarget_pars_vertex>
#include <skinning_pars_vertex>
#include <logdepthbuf_pars_vertex>
#include <clipping_planes_pars_vertex>
void main() {
	#include <uv_vertex>
	#include <uv2_vertex>
	#include <color_vertex>
	#include <morphcolor_vertex>
	#if defined ( USE_ENVMAP ) || defined ( USE_SKINNING )
		#include <beginnormal_vertex>
		#include <morphnormal_vertex>
		#include <skinbase_vertex>
		#include <skinnormal_vertex>
		#include <defaultnormal_vertex>
	#endif
	#include <begin_vertex>
	#include <morphtarget_vertex>
	#include <skinning_vertex>
	#include <project_vertex>
	#include <logdepthbuf_vertex>
	#include <clipping_planes_vertex>
	#include <worldpos_vertex>
	#include <envmap_vertex>
	#include <fog_vertex>
}`,F5t=`uniform vec3 diffuse;
uniform float opacity;
#ifndef FLAT_SHADED
	varying vec3 vNormal;
#endif
#include <common>
#include <dithering_pars_fragment>
#include <color_pars_fragment>
#include <uv_pars_fragment>
#include <uv2_pars_fragment>
#include <map_pars_fragment>
#include <alphamap_pars_fragment>
#include <alphatest_pars_fragment>
#include <aomap_pars_fragment>
#include <lightmap_pars_fragment>
#include <envmap_common_pars_fragment>
#include <envmap_pars_fragment>
#include <fog_pars_fragment>
#include <specularmap_pars_fragment>
#include <logdepthbuf_pars_fragment>
#include <clipping_planes_pars_fragment>
void main() {
	#include <clipping_planes_fragment>
	vec4 diffuseColor = vec4( diffuse, opacity );
	#include <logdepthbuf_fragment>
	#include <map_fragment>
	#include <color_fragment>
	#include <alphamap_fragment>
	#include <alphatest_fragment>
	#include <specularmap_fragment>
	ReflectedLight reflectedLight = ReflectedLight( vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ) );
	#ifdef USE_LIGHTMAP
		vec4 lightMapTexel = texture2D( lightMap, vUv2 );
		reflectedLight.indirectDiffuse += lightMapTexel.rgb * lightMapIntensity * RECIPROCAL_PI;
	#else
		reflectedLight.indirectDiffuse += vec3( 1.0 );
	#endif
	#include <aomap_fragment>
	reflectedLight.indirectDiffuse *= diffuseColor.rgb;
	vec3 outgoingLight = reflectedLight.indirectDiffuse;
	#include <envmap_fragment>
	#include <output_fragment>
	#include <tonemapping_fragment>
	#include <encodings_fragment>
	#include <fog_fragment>
	#include <premultiplied_alpha_fragment>
	#include <dithering_fragment>
}`,j5t=`#define LAMBERT
varying vec3 vViewPosition;
#include <common>
#include <uv_pars_vertex>
#include <uv2_pars_vertex>
#include <displacementmap_pars_vertex>
#include <envmap_pars_vertex>
#include <color_pars_vertex>
#include <fog_pars_vertex>
#include <normal_pars_vertex>
#include <morphtarget_pars_vertex>
#include <skinning_pars_vertex>
#include <shadowmap_pars_vertex>
#include <logdepthbuf_pars_vertex>
#include <clipping_planes_pars_vertex>
void main() {
	#include <uv_vertex>
	#include <uv2_vertex>
	#include <color_vertex>
	#include <morphcolor_vertex>
	#include <beginnormal_vertex>
	#include <morphnormal_vertex>
	#include <skinbase_vertex>
	#include <skinnormal_vertex>
	#include <defaultnormal_vertex>
	#include <normal_vertex>
	#include <begin_vertex>
	#include <morphtarget_vertex>
	#include <skinning_vertex>
	#include <displacementmap_vertex>
	#include <project_vertex>
	#include <logdepthbuf_vertex>
	#include <clipping_planes_vertex>
	vViewPosition = - mvPosition.xyz;
	#include <worldpos_vertex>
	#include <envmap_vertex>
	#include <shadowmap_vertex>
	#include <fog_vertex>
}`,B5t=`#define LAMBERT
uniform vec3 diffuse;
uniform vec3 emissive;
uniform float opacity;
#include <common>
#include <packing>
#include <dithering_pars_fragment>
#include <color_pars_fragment>
#include <uv_pars_fragment>
#include <uv2_pars_fragment>
#include <map_pars_fragment>
#include <alphamap_pars_fragment>
#include <alphatest_pars_fragment>
#include <aomap_pars_fragment>
#include <lightmap_pars_fragment>
#include <emissivemap_pars_fragment>
#include <envmap_common_pars_fragment>
#include <envmap_pars_fragment>
#include <fog_pars_fragment>
#include <bsdfs>
#include <lights_pars_begin>
#include <normal_pars_fragment>
#include <lights_lambert_pars_fragment>
#include <shadowmap_pars_fragment>
#include <bumpmap_pars_fragment>
#include <normalmap_pars_fragment>
#include <specularmap_pars_fragment>
#include <logdepthbuf_pars_fragment>
#include <clipping_planes_pars_fragment>
void main() {
	#include <clipping_planes_fragment>
	vec4 diffuseColor = vec4( diffuse, opacity );
	ReflectedLight reflectedLight = ReflectedLight( vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ) );
	vec3 totalEmissiveRadiance = emissive;
	#include <logdepthbuf_fragment>
	#include <map_fragment>
	#include <color_fragment>
	#include <alphamap_fragment>
	#include <alphatest_fragment>
	#include <specularmap_fragment>
	#include <normal_fragment_begin>
	#include <normal_fragment_maps>
	#include <emissivemap_fragment>
	#include <lights_lambert_fragment>
	#include <lights_fragment_begin>
	#include <lights_fragment_maps>
	#include <lights_fragment_end>
	#include <aomap_fragment>
	vec3 outgoingLight = reflectedLight.directDiffuse + reflectedLight.indirectDiffuse + totalEmissiveRadiance;
	#include <envmap_fragment>
	#include <output_fragment>
	#include <tonemapping_fragment>
	#include <encodings_fragment>
	#include <fog_fragment>
	#include <premultiplied_alpha_fragment>
	#include <dithering_fragment>
}`,z5t=`#define MATCAP
varying vec3 vViewPosition;
#include <common>
#include <uv_pars_vertex>
#include <color_pars_vertex>
#include <displacementmap_pars_vertex>
#include <fog_pars_vertex>
#include <normal_pars_vertex>
#include <morphtarget_pars_vertex>
#include <skinning_pars_vertex>
#include <logdepthbuf_pars_vertex>
#include <clipping_planes_pars_vertex>
void main() {
	#include <uv_vertex>
	#include <color_vertex>
	#include <morphcolor_vertex>
	#include <beginnormal_vertex>
	#include <morphnormal_vertex>
	#include <skinbase_vertex>
	#include <skinnormal_vertex>
	#include <defaultnormal_vertex>
	#include <normal_vertex>
	#include <begin_vertex>
	#include <morphtarget_vertex>
	#include <skinning_vertex>
	#include <displacementmap_vertex>
	#include <project_vertex>
	#include <logdepthbuf_vertex>
	#include <clipping_planes_vertex>
	#include <fog_vertex>
	vViewPosition = - mvPosition.xyz;
}`,U5t=`#define MATCAP
uniform vec3 diffuse;
uniform float opacity;
uniform sampler2D matcap;
varying vec3 vViewPosition;
#include <common>
#include <dithering_pars_fragment>
#include <color_pars_fragment>
#include <uv_pars_fragment>
#include <map_pars_fragment>
#include <alphamap_pars_fragment>
#include <alphatest_pars_fragment>
#include <fog_pars_fragment>
#include <normal_pars_fragment>
#include <bumpmap_pars_fragment>
#include <normalmap_pars_fragment>
#include <logdepthbuf_pars_fragment>
#include <clipping_planes_pars_fragment>
void main() {
	#include <clipping_planes_fragment>
	vec4 diffuseColor = vec4( diffuse, opacity );
	#include <logdepthbuf_fragment>
	#include <map_fragment>
	#include <color_fragment>
	#include <alphamap_fragment>
	#include <alphatest_fragment>
	#include <normal_fragment_begin>
	#include <normal_fragment_maps>
	vec3 viewDir = normalize( vViewPosition );
	vec3 x = normalize( vec3( viewDir.z, 0.0, - viewDir.x ) );
	vec3 y = cross( viewDir, x );
	vec2 uv = vec2( dot( x, normal ), dot( y, normal ) ) * 0.495 + 0.5;
	#ifdef USE_MATCAP
		vec4 matcapColor = texture2D( matcap, uv );
	#else
		vec4 matcapColor = vec4( vec3( mix( 0.2, 0.8, uv.y ) ), 1.0 );
	#endif
	vec3 outgoingLight = diffuseColor.rgb * matcapColor.rgb;
	#include <output_fragment>
	#include <tonemapping_fragment>
	#include <encodings_fragment>
	#include <fog_fragment>
	#include <premultiplied_alpha_fragment>
	#include <dithering_fragment>
}`,W5t=`#define NORMAL
#if defined( FLAT_SHADED ) || defined( USE_BUMPMAP ) || defined( TANGENTSPACE_NORMALMAP )
	varying vec3 vViewPosition;
#endif
#include <common>
#include <uv_pars_vertex>
#include <displacementmap_pars_vertex>
#include <normal_pars_vertex>
#include <morphtarget_pars_vertex>
#include <skinning_pars_vertex>
#include <logdepthbuf_pars_vertex>
#include <clipping_planes_pars_vertex>
void main() {
	#include <uv_vertex>
	#include <beginnormal_vertex>
	#include <morphnormal_vertex>
	#include <skinbase_vertex>
	#include <skinnormal_vertex>
	#include <defaultnormal_vertex>
	#include <normal_vertex>
	#include <begin_vertex>
	#include <morphtarget_vertex>
	#include <skinning_vertex>
	#include <displacementmap_vertex>
	#include <project_vertex>
	#include <logdepthbuf_vertex>
	#include <clipping_planes_vertex>
#if defined( FLAT_SHADED ) || defined( USE_BUMPMAP ) || defined( TANGENTSPACE_NORMALMAP )
	vViewPosition = - mvPosition.xyz;
#endif
}`,V5t=`#define NORMAL
uniform float opacity;
#if defined( FLAT_SHADED ) || defined( USE_BUMPMAP ) || defined( TANGENTSPACE_NORMALMAP )
	varying vec3 vViewPosition;
#endif
#include <packing>
#include <uv_pars_fragment>
#include <normal_pars_fragment>
#include <bumpmap_pars_fragment>
#include <normalmap_pars_fragment>
#include <logdepthbuf_pars_fragment>
#include <clipping_planes_pars_fragment>
void main() {
	#include <clipping_planes_fragment>
	#include <logdepthbuf_fragment>
	#include <normal_fragment_begin>
	#include <normal_fragment_maps>
	gl_FragColor = vec4( packNormalToRGB( normal ), opacity );
	#ifdef OPAQUE
		gl_FragColor.a = 1.0;
	#endif
}`,G5t=`#define PHONG
varying vec3 vViewPosition;
#include <common>
#include <uv_pars_vertex>
#include <uv2_pars_vertex>
#include <displacementmap_pars_vertex>
#include <envmap_pars_vertex>
#include <color_pars_vertex>
#include <fog_pars_vertex>
#include <normal_pars_vertex>
#include <morphtarget_pars_vertex>
#include <skinning_pars_vertex>
#include <shadowmap_pars_vertex>
#include <logdepthbuf_pars_vertex>
#include <clipping_planes_pars_vertex>
void main() {
	#include <uv_vertex>
	#include <uv2_vertex>
	#include <color_vertex>
	#include <morphcolor_vertex>
	#include <beginnormal_vertex>
	#include <morphnormal_vertex>
	#include <skinbase_vertex>
	#include <skinnormal_vertex>
	#include <defaultnormal_vertex>
	#include <normal_vertex>
	#include <begin_vertex>
	#include <morphtarget_vertex>
	#include <skinning_vertex>
	#include <displacementmap_vertex>
	#include <project_vertex>
	#include <logdepthbuf_vertex>
	#include <clipping_planes_vertex>
	vViewPosition = - mvPosition.xyz;
	#include <worldpos_vertex>
	#include <envmap_vertex>
	#include <shadowmap_vertex>
	#include <fog_vertex>
}`,H5t=`#define PHONG
uniform vec3 diffuse;
uniform vec3 emissive;
uniform vec3 specular;
uniform float shininess;
uniform float opacity;
#include <common>
#include <packing>
#include <dithering_pars_fragment>
#include <color_pars_fragment>
#include <uv_pars_fragment>
#include <uv2_pars_fragment>
#include <map_pars_fragment>
#include <alphamap_pars_fragment>
#include <alphatest_pars_fragment>
#include <aomap_pars_fragment>
#include <lightmap_pars_fragment>
#include <emissivemap_pars_fragment>
#include <envmap_common_pars_fragment>
#include <envmap_pars_fragment>
#include <fog_pars_fragment>
#include <bsdfs>
#include <lights_pars_begin>
#include <normal_pars_fragment>
#include <lights_phong_pars_fragment>
#include <shadowmap_pars_fragment>
#include <bumpmap_pars_fragment>
#include <normalmap_pars_fragment>
#include <specularmap_pars_fragment>
#include <logdepthbuf_pars_fragment>
#include <clipping_planes_pars_fragment>
void main() {
	#include <clipping_planes_fragment>
	vec4 diffuseColor = vec4( diffuse, opacity );
	ReflectedLight reflectedLight = ReflectedLight( vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ) );
	vec3 totalEmissiveRadiance = emissive;
	#include <logdepthbuf_fragment>
	#include <map_fragment>
	#include <color_fragment>
	#include <alphamap_fragment>
	#include <alphatest_fragment>
	#include <specularmap_fragment>
	#include <normal_fragment_begin>
	#include <normal_fragment_maps>
	#include <emissivemap_fragment>
	#include <lights_phong_fragment>
	#include <lights_fragment_begin>
	#include <lights_fragment_maps>
	#include <lights_fragment_end>
	#include <aomap_fragment>
	vec3 outgoingLight = reflectedLight.directDiffuse + reflectedLight.indirectDiffuse + reflectedLight.directSpecular + reflectedLight.indirectSpecular + totalEmissiveRadiance;
	#include <envmap_fragment>
	#include <output_fragment>
	#include <tonemapping_fragment>
	#include <encodings_fragment>
	#include <fog_fragment>
	#include <premultiplied_alpha_fragment>
	#include <dithering_fragment>
}`,q5t=`#define STANDARD
varying vec3 vViewPosition;
#ifdef USE_TRANSMISSION
	varying vec3 vWorldPosition;
#endif
#include <common>
#include <uv_pars_vertex>
#include <uv2_pars_vertex>
#include <displacementmap_pars_vertex>
#include <color_pars_vertex>
#include <fog_pars_vertex>
#include <normal_pars_vertex>
#include <morphtarget_pars_vertex>
#include <skinning_pars_vertex>
#include <shadowmap_pars_vertex>
#include <logdepthbuf_pars_vertex>
#include <clipping_planes_pars_vertex>
void main() {
	#include <uv_vertex>
	#include <uv2_vertex>
	#include <color_vertex>
	#include <morphcolor_vertex>
	#include <beginnormal_vertex>
	#include <morphnormal_vertex>
	#include <skinbase_vertex>
	#include <skinnormal_vertex>
	#include <defaultnormal_vertex>
	#include <normal_vertex>
	#include <begin_vertex>
	#include <morphtarget_vertex>
	#include <skinning_vertex>
	#include <displacementmap_vertex>
	#include <project_vertex>
	#include <logdepthbuf_vertex>
	#include <clipping_planes_vertex>
	vViewPosition = - mvPosition.xyz;
	#include <worldpos_vertex>
	#include <shadowmap_vertex>
	#include <fog_vertex>
#ifdef USE_TRANSMISSION
	vWorldPosition = worldPosition.xyz;
#endif
}`,X5t=`#define STANDARD
#ifdef PHYSICAL
	#define IOR
	#define SPECULAR
#endif
uniform vec3 diffuse;
uniform vec3 emissive;
uniform float roughness;
uniform float metalness;
uniform float opacity;
#ifdef IOR
	uniform float ior;
#endif
#ifdef SPECULAR
	uniform float specularIntensity;
	uniform vec3 specularColor;
	#ifdef USE_SPECULARINTENSITYMAP
		uniform sampler2D specularIntensityMap;
	#endif
	#ifdef USE_SPECULARCOLORMAP
		uniform sampler2D specularColorMap;
	#endif
#endif
#ifdef USE_CLEARCOAT
	uniform float clearcoat;
	uniform float clearcoatRoughness;
#endif
#ifdef USE_IRIDESCENCE
	uniform float iridescence;
	uniform float iridescenceIOR;
	uniform float iridescenceThicknessMinimum;
	uniform float iridescenceThicknessMaximum;
#endif
#ifdef USE_SHEEN
	uniform vec3 sheenColor;
	uniform float sheenRoughness;
	#ifdef USE_SHEENCOLORMAP
		uniform sampler2D sheenColorMap;
	#endif
	#ifdef USE_SHEENROUGHNESSMAP
		uniform sampler2D sheenRoughnessMap;
	#endif
#endif
varying vec3 vViewPosition;
#include <common>
#include <packing>
#include <dithering_pars_fragment>
#include <color_pars_fragment>
#include <uv_pars_fragment>
#include <uv2_pars_fragment>
#include <map_pars_fragment>
#include <alphamap_pars_fragment>
#include <alphatest_pars_fragment>
#include <aomap_pars_fragment>
#include <lightmap_pars_fragment>
#include <emissivemap_pars_fragment>
#include <bsdfs>
#include <iridescence_fragment>
#include <cube_uv_reflection_fragment>
#include <envmap_common_pars_fragment>
#include <envmap_physical_pars_fragment>
#include <fog_pars_fragment>
#include <lights_pars_begin>
#include <normal_pars_fragment>
#include <lights_physical_pars_fragment>
#include <transmission_pars_fragment>
#include <shadowmap_pars_fragment>
#include <bumpmap_pars_fragment>
#include <normalmap_pars_fragment>
#include <clearcoat_pars_fragment>
#include <iridescence_pars_fragment>
#include <roughnessmap_pars_fragment>
#include <metalnessmap_pars_fragment>
#include <logdepthbuf_pars_fragment>
#include <clipping_planes_pars_fragment>
void main() {
	#include <clipping_planes_fragment>
	vec4 diffuseColor = vec4( diffuse, opacity );
	ReflectedLight reflectedLight = ReflectedLight( vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ) );
	vec3 totalEmissiveRadiance = emissive;
	#include <logdepthbuf_fragment>
	#include <map_fragment>
	#include <color_fragment>
	#include <alphamap_fragment>
	#include <alphatest_fragment>
	#include <roughnessmap_fragment>
	#include <metalnessmap_fragment>
	#include <normal_fragment_begin>
	#include <normal_fragment_maps>
	#include <clearcoat_normal_fragment_begin>
	#include <clearcoat_normal_fragment_maps>
	#include <emissivemap_fragment>
	#include <lights_physical_fragment>
	#include <lights_fragment_begin>
	#include <lights_fragment_maps>
	#include <lights_fragment_end>
	#include <aomap_fragment>
	vec3 totalDiffuse = reflectedLight.directDiffuse + reflectedLight.indirectDiffuse;
	vec3 totalSpecular = reflectedLight.directSpecular + reflectedLight.indirectSpecular;
	#include <transmission_fragment>
	vec3 outgoingLight = totalDiffuse + totalSpecular + totalEmissiveRadiance;
	#ifdef USE_SHEEN
		float sheenEnergyComp = 1.0 - 0.157 * max3( material.sheenColor );
		outgoingLight = outgoingLight * sheenEnergyComp + sheenSpecular;
	#endif
	#ifdef USE_CLEARCOAT
		float dotNVcc = saturate( dot( geometry.clearcoatNormal, geometry.viewDir ) );
		vec3 Fcc = F_Schlick( material.clearcoatF0, material.clearcoatF90, dotNVcc );
		outgoingLight = outgoingLight * ( 1.0 - material.clearcoat * Fcc ) + clearcoatSpecular * material.clearcoat;
	#endif
	#include <output_fragment>
	#include <tonemapping_fragment>
	#include <encodings_fragment>
	#include <fog_fragment>
	#include <premultiplied_alpha_fragment>
	#include <dithering_fragment>
}`,Q5t=`#define TOON
varying vec3 vViewPosition;
#include <common>
#include <uv_pars_vertex>
#include <uv2_pars_vertex>
#include <displacementmap_pars_vertex>
#include <color_pars_vertex>
#include <fog_pars_vertex>
#include <normal_pars_vertex>
#include <morphtarget_pars_vertex>
#include <skinning_pars_vertex>
#include <shadowmap_pars_vertex>
#include <logdepthbuf_pars_vertex>
#include <clipping_planes_pars_vertex>
void main() {
	#include <uv_vertex>
	#include <uv2_vertex>
	#include <color_vertex>
	#include <morphcolor_vertex>
	#include <beginnormal_vertex>
	#include <morphnormal_vertex>
	#include <skinbase_vertex>
	#include <skinnormal_vertex>
	#include <defaultnormal_vertex>
	#include <normal_vertex>
	#include <begin_vertex>
	#include <morphtarget_vertex>
	#include <skinning_vertex>
	#include <displacementmap_vertex>
	#include <project_vertex>
	#include <logdepthbuf_vertex>
	#include <clipping_planes_vertex>
	vViewPosition = - mvPosition.xyz;
	#include <worldpos_vertex>
	#include <shadowmap_vertex>
	#include <fog_vertex>
}`,Y5t=`#define TOON
uniform vec3 diffuse;
uniform vec3 emissive;
uniform float opacity;
#include <common>
#include <packing>
#include <dithering_pars_fragment>
#include <color_pars_fragment>
#include <uv_pars_fragment>
#include <uv2_pars_fragment>
#include <map_pars_fragment>
#include <alphamap_pars_fragment>
#include <alphatest_pars_fragment>
#include <aomap_pars_fragment>
#include <lightmap_pars_fragment>
#include <emissivemap_pars_fragment>
#include <gradientmap_pars_fragment>
#include <fog_pars_fragment>
#include <bsdfs>
#include <lights_pars_begin>
#include <normal_pars_fragment>
#include <lights_toon_pars_fragment>
#include <shadowmap_pars_fragment>
#include <bumpmap_pars_fragment>
#include <normalmap_pars_fragment>
#include <logdepthbuf_pars_fragment>
#include <clipping_planes_pars_fragment>
void main() {
	#include <clipping_planes_fragment>
	vec4 diffuseColor = vec4( diffuse, opacity );
	ReflectedLight reflectedLight = ReflectedLight( vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ) );
	vec3 totalEmissiveRadiance = emissive;
	#include <logdepthbuf_fragment>
	#include <map_fragment>
	#include <color_fragment>
	#include <alphamap_fragment>
	#include <alphatest_fragment>
	#include <normal_fragment_begin>
	#include <normal_fragment_maps>
	#include <emissivemap_fragment>
	#include <lights_toon_fragment>
	#include <lights_fragment_begin>
	#include <lights_fragment_maps>
	#include <lights_fragment_end>
	#include <aomap_fragment>
	vec3 outgoingLight = reflectedLight.directDiffuse + reflectedLight.indirectDiffuse + totalEmissiveRadiance;
	#include <output_fragment>
	#include <tonemapping_fragment>
	#include <encodings_fragment>
	#include <fog_fragment>
	#include <premultiplied_alpha_fragment>
	#include <dithering_fragment>
}`,K5t=`uniform float size;
uniform float scale;
#include <common>
#include <color_pars_vertex>
#include <fog_pars_vertex>
#include <morphtarget_pars_vertex>
#include <logdepthbuf_pars_vertex>
#include <clipping_planes_pars_vertex>
void main() {
	#include <color_vertex>
	#include <morphcolor_vertex>
	#include <begin_vertex>
	#include <morphtarget_vertex>
	#include <project_vertex>
	gl_PointSize = size;
	#ifdef USE_SIZEATTENUATION
		bool isPerspective = isPerspectiveMatrix( projectionMatrix );
		if ( isPerspective ) gl_PointSize *= ( scale / - mvPosition.z );
	#endif
	#include <logdepthbuf_vertex>
	#include <clipping_planes_vertex>
	#include <worldpos_vertex>
	#include <fog_vertex>
}`,Z5t=`uniform vec3 diffuse;
uniform float opacity;
#include <common>
#include <color_pars_fragment>
#include <map_particle_pars_fragment>
#include <alphatest_pars_fragment>
#include <fog_pars_fragment>
#include <logdepthbuf_pars_fragment>
#include <clipping_planes_pars_fragment>
void main() {
	#include <clipping_planes_fragment>
	vec3 outgoingLight = vec3( 0.0 );
	vec4 diffuseColor = vec4( diffuse, opacity );
	#include <logdepthbuf_fragment>
	#include <map_particle_fragment>
	#include <color_fragment>
	#include <alphatest_fragment>
	outgoingLight = diffuseColor.rgb;
	#include <output_fragment>
	#include <tonemapping_fragment>
	#include <encodings_fragment>
	#include <fog_fragment>
	#include <premultiplied_alpha_fragment>
}`,J5t=`#include <common>
#include <fog_pars_vertex>
#include <morphtarget_pars_vertex>
#include <skinning_pars_vertex>
#include <shadowmap_pars_vertex>
void main() {
	#include <beginnormal_vertex>
	#include <morphnormal_vertex>
	#include <skinbase_vertex>
	#include <skinnormal_vertex>
	#include <defaultnormal_vertex>
	#include <begin_vertex>
	#include <morphtarget_vertex>
	#include <skinning_vertex>
	#include <project_vertex>
	#include <worldpos_vertex>
	#include <shadowmap_vertex>
	#include <fog_vertex>
}`,eBt=`uniform vec3 color;
uniform float opacity;
#include <common>
#include <packing>
#include <fog_pars_fragment>
#include <bsdfs>
#include <lights_pars_begin>
#include <shadowmap_pars_fragment>
#include <shadowmask_pars_fragment>
void main() {
	gl_FragColor = vec4( color, opacity * ( 1.0 - getShadowMask() ) );
	#include <tonemapping_fragment>
	#include <encodings_fragment>
	#include <fog_fragment>
}`,tBt=`uniform float rotation;
uniform vec2 center;
#include <common>
#include <uv_pars_vertex>
#include <fog_pars_vertex>
#include <logdepthbuf_pars_vertex>
#include <clipping_planes_pars_vertex>
void main() {
	#include <uv_vertex>
	vec4 mvPosition = modelViewMatrix * vec4( 0.0, 0.0, 0.0, 1.0 );
	vec2 scale;
	scale.x = length( vec3( modelMatrix[ 0 ].x, modelMatrix[ 0 ].y, modelMatrix[ 0 ].z ) );
	scale.y = length( vec3( modelMatrix[ 1 ].x, modelMatrix[ 1 ].y, modelMatrix[ 1 ].z ) );
	#ifndef USE_SIZEATTENUATION
		bool isPerspective = isPerspectiveMatrix( projectionMatrix );
		if ( isPerspective ) scale *= - mvPosition.z;
	#endif
	vec2 alignedPosition = ( position.xy - ( center - vec2( 0.5 ) ) ) * scale;
	vec2 rotatedPosition;
	rotatedPosition.x = cos( rotation ) * alignedPosition.x - sin( rotation ) * alignedPosition.y;
	rotatedPosition.y = sin( rotation ) * alignedPosition.x + cos( rotation ) * alignedPosition.y;
	mvPosition.xy += rotatedPosition;
	gl_Position = projectionMatrix * mvPosition;
	#include <logdepthbuf_vertex>
	#include <clipping_planes_vertex>
	#include <fog_vertex>
}`,nBt=`uniform vec3 diffuse;
uniform float opacity;
#include <common>
#include <uv_pars_fragment>
#include <map_pars_fragment>
#include <alphamap_pars_fragment>
#include <alphatest_pars_fragment>
#include <fog_pars_fragment>
#include <logdepthbuf_pars_fragment>
#include <clipping_planes_pars_fragment>
void main() {
	#include <clipping_planes_fragment>
	vec3 outgoingLight = vec3( 0.0 );
	vec4 diffuseColor = vec4( diffuse, opacity );
	#include <logdepthbuf_fragment>
	#include <map_fragment>
	#include <alphamap_fragment>
	#include <alphatest_fragment>
	outgoingLight = diffuseColor.rgb;
	#include <output_fragment>
	#include <tonemapping_fragment>
	#include <encodings_fragment>
	#include <fog_fragment>
}`,Gt={alphamap_fragment:EFt,alphamap_pars_fragment:PFt,alphatest_fragment:MFt,alphatest_pars_fragment:kFt,aomap_fragment:AFt,aomap_pars_fragment:RFt,begin_vertex:IFt,beginnormal_vertex:DFt,bsdfs:LFt,iridescence_fragment:NFt,bumpmap_pars_fragment:$Ft,clipping_planes_fragment:FFt,clipping_planes_pars_fragment:jFt,clipping_planes_pars_vertex:BFt,clipping_planes_vertex:zFt,color_fragment:UFt,color_pars_fragment:WFt,color_pars_vertex:VFt,color_vertex:GFt,common:HFt,cube_uv_reflection_fragment:qFt,defaultnormal_vertex:XFt,displacementmap_pars_vertex:QFt,displacementmap_vertex:YFt,emissivemap_fragment:KFt,emissivemap_pars_fragment:ZFt,encodings_fragment:JFt,encodings_pars_fragment:ejt,envmap_fragment:tjt,envmap_common_pars_fragment:njt,envmap_pars_fragment:rjt,envmap_pars_vertex:ijt,envmap_physical_pars_fragment:gjt,envmap_vertex:ojt,fog_vertex:ajt,fog_pars_vertex:sjt,fog_fragment:ljt,fog_pars_fragment:cjt,gradientmap_pars_fragment:ujt,lightmap_fragment:fjt,lightmap_pars_fragment:djt,lights_lambert_fragment:hjt,lights_lambert_pars_fragment:pjt,lights_pars_begin:mjt,lights_toon_fragment:vjt,lights_toon_pars_fragment:yjt,lights_phong_fragment:xjt,lights_phong_pars_fragment:bjt,lights_physical_fragment:_jt,lights_physical_pars_fragment:wjt,lights_fragment_begin:Sjt,lights_fragment_maps:Ojt,lights_fragment_end:Cjt,logdepthbuf_fragment:Tjt,logdepthbuf_pars_fragment:Ejt,logdepthbuf_pars_vertex:Pjt,logdepthbuf_vertex:Mjt,map_fragment:kjt,map_pars_fragment:Ajt,map_particle_fragment:Rjt,map_particle_pars_fragment:Ijt,metalnessmap_fragment:Djt,metalnessmap_pars_fragment:Ljt,morphcolor_vertex:Njt,morphnormal_vertex:$jt,morphtarget_pars_vertex:Fjt,morphtarget_vertex:jjt,normal_fragment_begin:Bjt,normal_fragment_maps:zjt,normal_pars_fragment:Ujt,normal_pars_vertex:Wjt,normal_vertex:Vjt,normalmap_pars_fragment:Gjt,clearcoat_normal_fragment_begin:Hjt,clearcoat_normal_fragment_maps:qjt,clearcoat_pars_fragment:Xjt,iridescence_pars_fragment:Qjt,output_fragment:Yjt,packing:Kjt,premultiplied_alpha_fragment:Zjt,project_vertex:Jjt,dithering_fragment:e5t,dithering_pars_fragment:t5t,roughnessmap_fragment:n5t,roughnessmap_pars_fragment:r5t,shadowmap_pars_fragment:i5t,shadowmap_pars_vertex:o5t,shadowmap_vertex:a5t,shadowmask_pars_fragment:s5t,skinbase_vertex:l5t,skinning_pars_vertex:c5t,skinning_vertex:u5t,skinnormal_vertex:f5t,specularmap_fragment:d5t,specularmap_pars_fragment:h5t,tonemapping_fragment:p5t,tonemapping_pars_fragment:m5t,transmission_fragment:g5t,transmission_pars_fragment:v5t,uv_pars_fragment:y5t,uv_pars_vertex:x5t,uv_vertex:b5t,uv2_pars_fragment:_5t,uv2_pars_vertex:w5t,uv2_vertex:S5t,worldpos_vertex:O5t,background_vert:C5t,background_frag:T5t,cube_vert:E5t,cube_frag:P5t,depth_vert:M5t,depth_frag:k5t,distanceRGBA_vert:A5t,distanceRGBA_frag:R5t,equirect_vert:I5t,equirect_frag:D5t,linedashed_vert:L5t,linedashed_frag:N5t,meshbasic_vert:$5t,meshbasic_frag:F5t,meshlambert_vert:j5t,meshlambert_frag:B5t,meshmatcap_vert:z5t,meshmatcap_frag:U5t,meshnormal_vert:W5t,meshnormal_frag:V5t,meshphong_vert:G5t,meshphong_frag:H5t,meshphysical_vert:q5t,meshphysical_frag:X5t,meshtoon_vert:Q5t,meshtoon_frag:Y5t,points_vert:K5t,points_frag:Z5t,shadow_vert:J5t,shadow_frag:eBt,sprite_vert:tBt,sprite_frag:nBt},Je={common:{diffuse:{value:new lr(16777215)},opacity:{value:1},map:{value:null},uvTransform:{value:new va},uv2Transform:{value:new va},alphaMap:{value:null},alphaTest:{value:0}},specularmap:{specularMap:{value:null}},envmap:{envMap:{value:null},flipEnvMap:{value:-1},reflectivity:{value:1},ior:{value:1.5},refractionRatio:{value:.98}},aomap:{aoMap:{value:null},aoMapIntensity:{value:1}},lightmap:{lightMap:{value:null},lightMapIntensity:{value:1}},emissivemap:{emissiveMap:{value:null}},bumpmap:{bumpMap:{value:null},bumpScale:{value:1}},normalmap:{normalMap:{value:null},normalScale:{value:new qt(1,1)}},displacementmap:{displacementMap:{value:null},displacementScale:{value:1},displacementBias:{value:0}},roughnessmap:{roughnessMap:{value:null}},metalnessmap:{metalnessMap:{value:null}},gradientmap:{gradientMap:{value:null}},fog:{fogDensity:{value:25e-5},fogNear:{value:1},fogFar:{value:2e3},fogColor:{value:new lr(16777215)}},lights:{ambientLightColor:{value:[]},lightProbe:{value:[]},directionalLights:{value:[],properties:{direction:{},color:{}}},directionalLightShadows:{value:[],properties:{shadowBias:{},shadowNormalBias:{},shadowRadius:{},shadowMapSize:{}}},directionalShadowMap:{value:[]},directionalShadowMatrix:{value:[]},spotLights:{value:[],properties:{color:{},position:{},direction:{},distance:{},coneCos:{},penumbraCos:{},decay:{}}},spotLightShadows:{value:[],properties:{shadowBias:{},shadowNormalBias:{},shadowRadius:{},shadowMapSize:{}}},spotLightMap:{value:[]},spotShadowMap:{value:[]},spotLightMatrix:{value:[]},pointLights:{value:[],properties:{color:{},position:{},decay:{},distance:{}}},pointLightShadows:{value:[],properties:{shadowBias:{},shadowNormalBias:{},shadowRadius:{},shadowMapSize:{},shadowCameraNear:{},shadowCameraFar:{}}},pointShadowMap:{value:[]},pointShadowMatrix:{value:[]},hemisphereLights:{value:[],properties:{direction:{},skyColor:{},groundColor:{}}},rectAreaLights:{value:[],properties:{color:{},position:{},width:{},height:{}}},ltc_1:{value:null},ltc_2:{value:null}},points:{diffuse:{value:new lr(16777215)},opacity:{value:1},size:{value:1},scale:{value:1},map:{value:null},alphaMap:{value:null},alphaTest:{value:0},uvTransform:{value:new va}},sprite:{diffuse:{value:new lr(16777215)},opacity:{value:1},center:{value:new qt(.5,.5)},rotation:{value:0},map:{value:null},alphaMap:{value:null},alphaTest:{value:0},uvTransform:{value:new va}}},_l={basic:{uniforms:zi([Je.common,Je.specularmap,Je.envmap,Je.aomap,Je.lightmap,Je.fog]),vertexShader:Gt.meshbasic_vert,fragmentShader:Gt.meshbasic_frag},lambert:{uniforms:zi([Je.common,Je.specularmap,Je.envmap,Je.aomap,Je.lightmap,Je.emissivemap,Je.bumpmap,Je.normalmap,Je.displacementmap,Je.fog,Je.lights,{emissive:{value:new lr(0)}}]),vertexShader:Gt.meshlambert_vert,fragmentShader:Gt.meshlambert_frag},phong:{uniforms:zi([Je.common,Je.specularmap,Je.envmap,Je.aomap,Je.lightmap,Je.emissivemap,Je.bumpmap,Je.normalmap,Je.displacementmap,Je.fog,Je.lights,{emissive:{value:new lr(0)},specular:{value:new lr(1118481)},shininess:{value:30}}]),vertexShader:Gt.meshphong_vert,fragmentShader:Gt.meshphong_frag},standard:{uniforms:zi([Je.common,Je.envmap,Je.aomap,Je.lightmap,Je.emissivemap,Je.bumpmap,Je.normalmap,Je.displacementmap,Je.roughnessmap,Je.metalnessmap,Je.fog,Je.lights,{emissive:{value:new lr(0)},roughness:{value:1},metalness:{value:0},envMapIntensity:{value:1}}]),vertexShader:Gt.meshphysical_vert,fragmentShader:Gt.meshphysical_frag},toon:{uniforms:zi([Je.common,Je.aomap,Je.lightmap,Je.emissivemap,Je.bumpmap,Je.normalmap,Je.displacementmap,Je.gradientmap,Je.fog,Je.lights,{emissive:{value:new lr(0)}}]),vertexShader:Gt.meshtoon_vert,fragmentShader:Gt.meshtoon_frag},matcap:{uniforms:zi([Je.common,Je.bumpmap,Je.normalmap,Je.displacementmap,Je.fog,{matcap:{value:null}}]),vertexShader:Gt.meshmatcap_vert,fragmentShader:Gt.meshmatcap_frag},points:{uniforms:zi([Je.points,Je.fog]),vertexShader:Gt.points_vert,fragmentShader:Gt.points_frag},dashed:{uniforms:zi([Je.common,Je.fog,{scale:{value:1},dashSize:{value:1},totalSize:{value:2}}]),vertexShader:Gt.linedashed_vert,fragmentShader:Gt.linedashed_frag},depth:{uniforms:zi([Je.common,Je.displacementmap]),vertexShader:Gt.depth_vert,fragmentShader:Gt.depth_frag},normal:{uniforms:zi([Je.common,Je.bumpmap,Je.normalmap,Je.displacementmap,{opacity:{value:1}}]),vertexShader:Gt.meshnormal_vert,fragmentShader:Gt.meshnormal_frag},sprite:{uniforms:zi([Je.sprite,Je.fog]),vertexShader:Gt.sprite_vert,fragmentShader:Gt.sprite_frag},background:{uniforms:{uvTransform:{value:new va},t2D:{value:null}},vertexShader:Gt.background_vert,fragmentShader:Gt.background_frag},cube:{uniforms:zi([Je.envmap,{opacity:{value:1}}]),vertexShader:Gt.cube_vert,fragmentShader:Gt.cube_frag},equirect:{uniforms:{tEquirect:{value:null}},vertexShader:Gt.equirect_vert,fragmentShader:Gt.equirect_frag},distanceRGBA:{uniforms:zi([Je.common,Je.displacementmap,{referencePosition:{value:new Se},nearDistance:{value:1},farDistance:{value:1e3}}]),vertexShader:Gt.distanceRGBA_vert,fragmentShader:Gt.distanceRGBA_frag},shadow:{uniforms:zi([Je.lights,Je.fog,{color:{value:new lr(0)},opacity:{value:1}}]),vertexShader:Gt.shadow_vert,fragmentShader:Gt.shadow_frag}};_l.physical={uniforms:zi([_l.standard.uniforms,{clearcoat:{value:0},clearcoatMap:{value:null},clearcoatRoughness:{value:0},clearcoatRoughnessMap:{value:null},clearcoatNormalScale:{value:new qt(1,1)},clearcoatNormalMap:{value:null},iridescence:{value:0},iridescenceMap:{value:null},iridescenceIOR:{value:1.3},iridescenceThicknessMinimum:{value:100},iridescenceThicknessMaximum:{value:400},iridescenceThicknessMap:{value:null},sheen:{value:0},sheenColor:{value:new lr(0)},sheenColorMap:{value:null},sheenRoughness:{value:1},sheenRoughnessMap:{value:null},transmission:{value:0},transmissionMap:{value:null},transmissionSamplerSize:{value:new qt},transmissionSamplerMap:{value:null},thickness:{value:0},thicknessMap:{value:null},attenuationDistance:{value:0},attenuationColor:{value:new lr(0)},specularIntensity:{value:1},specularIntensityMap:{value:null},specularColor:{value:new lr(1,1,1)},specularColorMap:{value:null}}]),vertexShader:Gt.meshphysical_vert,fragmentShader:Gt.meshphysical_frag};function rBt(t,e,n,r,i,o){const a=new lr(0);let s=i===!0?0:1,l,c,u=null,f=0,d=null;function h(m,g){let v=!1,y=g.isScene===!0?g.background:null;y&&y.isTexture&&(y=e.get(y));const x=t.xr,b=x.getSession&&x.getSession();b&&b.environmentBlendMode==="additive"&&(y=null),y===null?p(a,s):y&&y.isColor&&(p(y,1),v=!0),(t.autoClear||v)&&t.clear(t.autoClearColor,t.autoClearDepth,t.autoClearStencil),y&&(y.isCubeTexture||y.mapping===Dk)?(c===void 0&&(c=new Bl(new Yy(1,1,1),new ud({name:"BackgroundCubeMaterial",uniforms:jv(_l.cube.uniforms),vertexShader:_l.cube.vertexShader,fragmentShader:_l.cube.fragmentShader,side:_a,depthTest:!1,depthWrite:!1,fog:!1})),c.geometry.deleteAttribute("normal"),c.geometry.deleteAttribute("uv"),c.onBeforeRender=function(_,S,O){this.matrixWorld.copyPosition(O.matrixWorld)},Object.defineProperty(c.material,"envMap",{get:function(){return this.uniforms.envMap.value}}),r.update(c)),c.material.uniforms.envMap.value=y,c.material.uniforms.flipEnvMap.value=y.isCubeTexture&&y.isRenderTargetTexture===!1?-1:1,(u!==y||f!==y.version||d!==t.toneMapping)&&(c.material.needsUpdate=!0,u=y,f=y.version,d=t.toneMapping),c.layers.enableAll(),m.unshift(c,c.geometry,c.material,0,0,null)):y&&y.isTexture&&(l===void 0&&(l=new Bl(new $k(2,2),new ud({name:"BackgroundMaterial",uniforms:jv(_l.background.uniforms),vertexShader:_l.background.vertexShader,fragmentShader:_l.background.fragmentShader,side:Lv,depthTest:!1,depthWrite:!1,fog:!1})),l.geometry.deleteAttribute("normal"),Object.defineProperty(l.material,"map",{get:function(){return this.uniforms.t2D.value}}),r.update(l)),l.material.uniforms.t2D.value=y,y.matrixAutoUpdate===!0&&y.updateMatrix(),l.material.uniforms.uvTransform.value.copy(y.matrix),(u!==y||f!==y.version||d!==t.toneMapping)&&(l.material.needsUpdate=!0,u=y,f=y.version,d=t.toneMapping),l.layers.enableAll(),m.unshift(l,l.geometry,l.material,0,0,null))}function p(m,g){n.buffers.color.setClear(m.r,m.g,m.b,g,o)}return{getClearColor:function(){return a},setClearColor:function(m,g=1){a.set(m),s=g,p(a,s)},getClearAlpha:function(){return s},setClearAlpha:function(m){s=m,p(a,s)},render:h}}function iBt(t,e,n,r){const i=t.getParameter(34921),o=r.isWebGL2?null:e.get("OES_vertex_array_object"),a=r.isWebGL2||o!==null,s={},l=g(null);let c=l,u=!1;function f(T,L,z,B,U){let W=!1;if(a){const $=m(B,z,L);c!==$&&(c=$,h(c.object)),W=v(T,B,z,U),W&&y(T,B,z,U)}else{const $=L.wireframe===!0;(c.geometry!==B.id||c.program!==z.id||c.wireframe!==$)&&(c.geometry=B.id,c.program=z.id,c.wireframe=$,W=!0)}U!==null&&n.update(U,34963),(W||u)&&(u=!1,C(T,L,z,B),U!==null&&t.bindBuffer(34963,n.get(U).buffer))}function d(){return r.isWebGL2?t.createVertexArray():o.createVertexArrayOES()}function h(T){return r.isWebGL2?t.bindVertexArray(T):o.bindVertexArrayOES(T)}function p(T){return r.isWebGL2?t.deleteVertexArray(T):o.deleteVertexArrayOES(T)}function m(T,L,z){const B=z.wireframe===!0;let U=s[T.id];U===void 0&&(U={},s[T.id]=U);let W=U[L.id];W===void 0&&(W={},U[L.id]=W);let $=W[B];return $===void 0&&($=g(d()),W[B]=$),$}function g(T){const L=[],z=[],B=[];for(let U=0;U<i;U++)L[U]=0,z[U]=0,B[U]=0;return{geometry:null,program:null,wireframe:!1,newAttributes:L,enabledAttributes:z,attributeDivisors:B,object:T,attributes:{},index:null}}function v(T,L,z,B){const U=c.attributes,W=L.attributes;let $=0;const N=z.getAttributes();for(const D in N)if(N[D].location>=0){const q=U[D];let Y=W[D];if(Y===void 0&&(D==="instanceMatrix"&&T.instanceMatrix&&(Y=T.instanceMatrix),D==="instanceColor"&&T.instanceColor&&(Y=T.instanceColor)),q===void 0||q.attribute!==Y||Y&&q.data!==Y.data)return!0;$++}return c.attributesNum!==$||c.index!==B}function y(T,L,z,B){const U={},W=L.attributes;let $=0;const N=z.getAttributes();for(const D in N)if(N[D].location>=0){let q=W[D];q===void 0&&(D==="instanceMatrix"&&T.instanceMatrix&&(q=T.instanceMatrix),D==="instanceColor"&&T.instanceColor&&(q=T.instanceColor));const Y={};Y.attribute=q,q&&q.data&&(Y.data=q.data),U[D]=Y,$++}c.attributes=U,c.attributesNum=$,c.index=B}function x(){const T=c.newAttributes;for(let L=0,z=T.length;L<z;L++)T[L]=0}function b(T){_(T,0)}function _(T,L){const z=c.newAttributes,B=c.enabledAttributes,U=c.attributeDivisors;z[T]=1,B[T]===0&&(t.enableVertexAttribArray(T),B[T]=1),U[T]!==L&&((r.isWebGL2?t:e.get("ANGLE_instanced_arrays"))[r.isWebGL2?"vertexAttribDivisor":"vertexAttribDivisorANGLE"](T,L),U[T]=L)}function S(){const T=c.newAttributes,L=c.enabledAttributes;for(let z=0,B=L.length;z<B;z++)L[z]!==T[z]&&(t.disableVertexAttribArray(z),L[z]=0)}function O(T,L,z,B,U,W){r.isWebGL2===!0&&(z===5124||z===5125)?t.vertexAttribIPointer(T,L,z,U,W):t.vertexAttribPointer(T,L,z,B,U,W)}function C(T,L,z,B){if(r.isWebGL2===!1&&(T.isInstancedMesh||B.isInstancedBufferGeometry)&&e.get("ANGLE_instanced_arrays")===null)return;x();const U=B.attributes,W=z.getAttributes(),$=L.defaultAttributeValues;for(const N in W){const D=W[N];if(D.location>=0){let A=U[N];if(A===void 0&&(N==="instanceMatrix"&&T.instanceMatrix&&(A=T.instanceMatrix),N==="instanceColor"&&T.instanceColor&&(A=T.instanceColor)),A!==void 0){const q=A.normalized,Y=A.itemSize,K=n.get(A);if(K===void 0)continue;const se=K.buffer,te=K.type,J=K.bytesPerElement;if(A.isInterleavedBufferAttribute){const pe=A.data,be=pe.stride,re=A.offset;if(pe.isInstancedInterleavedBuffer){for(let ve=0;ve<D.locationSize;ve++)_(D.location+ve,pe.meshPerAttribute);T.isInstancedMesh!==!0&&B._maxInstanceCount===void 0&&(B._maxInstanceCount=pe.meshPerAttribute*pe.count)}else for(let ve=0;ve<D.locationSize;ve++)b(D.location+ve);t.bindBuffer(34962,se);for(let ve=0;ve<D.locationSize;ve++)O(D.location+ve,Y/D.locationSize,te,q,be*J,(re+Y/D.locationSize*ve)*J)}else{if(A.isInstancedBufferAttribute){for(let pe=0;pe<D.locationSize;pe++)_(D.location+pe,A.meshPerAttribute);T.isInstancedMesh!==!0&&B._maxInstanceCount===void 0&&(B._maxInstanceCount=A.meshPerAttribute*A.count)}else for(let pe=0;pe<D.locationSize;pe++)b(D.location+pe);t.bindBuffer(34962,se);for(let pe=0;pe<D.locationSize;pe++)O(D.location+pe,Y/D.locationSize,te,q,Y*J,Y/D.locationSize*pe*J)}}else if($!==void 0){const q=$[N];if(q!==void 0)switch(q.length){case 2:t.vertexAttrib2fv(D.location,q);break;case 3:t.vertexAttrib3fv(D.location,q);break;case 4:t.vertexAttrib4fv(D.location,q);break;default:t.vertexAttrib1fv(D.location,q)}}}}S()}function E(){P();for(const T in s){const L=s[T];for(const z in L){const B=L[z];for(const U in B)p(B[U].object),delete B[U];delete L[z]}delete s[T]}}function k(T){if(s[T.id]===void 0)return;const L=s[T.id];for(const z in L){const B=L[z];for(const U in B)p(B[U].object),delete B[U];delete L[z]}delete s[T.id]}function I(T){for(const L in s){const z=s[L];if(z[T.id]===void 0)continue;const B=z[T.id];for(const U in B)p(B[U].object),delete B[U];delete z[T.id]}}function P(){R(),u=!0,c!==l&&(c=l,h(c.object))}function R(){l.geometry=null,l.program=null,l.wireframe=!1}return{setup:f,reset:P,resetDefaultState:R,dispose:E,releaseStatesOfGeometry:k,releaseStatesOfProgram:I,initAttributes:x,enableAttribute:b,disableUnusedAttributes:S}}function oBt(t,e,n,r){const i=r.isWebGL2;let o;function a(c){o=c}function s(c,u){t.drawArrays(o,c,u),n.update(u,o,1)}function l(c,u,f){if(f===0)return;let d,h;if(i)d=t,h="drawArraysInstanced";else if(d=e.get("ANGLE_instanced_arrays"),h="drawArraysInstancedANGLE",d===null){console.error("THREE.WebGLBufferRenderer: using THREE.InstancedBufferGeometry but hardware does not support extension ANGLE_instanced_arrays.");return}d[h](o,c,u,f),n.update(u,o,f)}this.setMode=a,this.render=s,this.renderInstances=l}function aBt(t,e,n){let r;function i(){if(r!==void 0)return r;if(e.has("EXT_texture_filter_anisotropic")===!0){const O=e.get("EXT_texture_filter_anisotropic");r=t.getParameter(O.MAX_TEXTURE_MAX_ANISOTROPY_EXT)}else r=0;return r}function o(O){if(O==="highp"){if(t.getShaderPrecisionFormat(35633,36338).precision>0&&t.getShaderPrecisionFormat(35632,36338).precision>0)return"highp";O="mediump"}return O==="mediump"&&t.getShaderPrecisionFormat(35633,36337).precision>0&&t.getShaderPrecisionFormat(35632,36337).precision>0?"mediump":"lowp"}const a=typeof WebGL2RenderingContext<"u"&&t instanceof WebGL2RenderingContext||typeof WebGL2ComputeRenderingContext<"u"&&t instanceof WebGL2ComputeRenderingContext;let s=n.precision!==void 0?n.precision:"highp";const l=o(s);l!==s&&(console.warn("THREE.WebGLRenderer:",s,"not supported, using",l,"instead."),s=l);const c=a||e.has("WEBGL_draw_buffers"),u=n.logarithmicDepthBuffer===!0,f=t.getParameter(34930),d=t.getParameter(35660),h=t.getParameter(3379),p=t.getParameter(34076),m=t.getParameter(34921),g=t.getParameter(36347),v=t.getParameter(36348),y=t.getParameter(36349),x=d>0,b=a||e.has("OES_texture_float"),_=x&&b,S=a?t.getParameter(36183):0;return{isWebGL2:a,drawBuffers:c,getMaxAnisotropy:i,getMaxPrecision:o,precision:s,logarithmicDepthBuffer:u,maxTextures:f,maxVertexTextures:d,maxTextureSize:h,maxCubemapSize:p,maxAttributes:m,maxVertexUniforms:g,maxVaryings:v,maxFragmentUniforms:y,vertexTextures:x,floatFragmentTextures:b,floatVertexTextures:_,maxSamples:S}}function sBt(t){const e=this;let n=null,r=0,i=!1,o=!1;const a=new rh,s=new va,l={value:null,needsUpdate:!1};this.uniform=l,this.numPlanes=0,this.numIntersection=0,this.init=function(f,d,h){const p=f.length!==0||d||r!==0||i;return i=d,n=u(f,h,0),r=f.length,p},this.beginShadows=function(){o=!0,u(null)},this.endShadows=function(){o=!1,c()},this.setState=function(f,d,h){const p=f.clippingPlanes,m=f.clipIntersection,g=f.clipShadows,v=t.get(f);if(!i||p===null||p.length===0||o&&!g)o?u(null):c();else{const y=o?0:r,x=y*4;let b=v.clippingState||null;l.value=b,b=u(p,d,x,h);for(let _=0;_!==x;++_)b[_]=n[_];v.clippingState=b,this.numIntersection=m?this.numPlanes:0,this.numPlanes+=y}};function c(){l.value!==n&&(l.value=n,l.needsUpdate=r>0),e.numPlanes=r,e.numIntersection=0}function u(f,d,h,p){const m=f!==null?f.length:0;let g=null;if(m!==0){if(g=l.value,p!==!0||g===null){const v=h+m*4,y=d.matrixWorldInverse;s.getNormalMatrix(y),(g===null||g.length<v)&&(g=new Float32Array(v));for(let x=0,b=h;x!==m;++x,b+=4)a.copy(f[x]).applyMatrix4(y,s),a.normal.toArray(g,b),g[b+3]=a.constant}l.value=g,l.needsUpdate=!0}return e.numPlanes=m,e.numIntersection=0,g}}function lBt(t){let e=new WeakMap;function n(a,s){return s===SF?a.mapping=Nv:s===OF&&(a.mapping=$v),a}function r(a){if(a&&a.isTexture&&a.isRenderTargetTexture===!1){const s=a.mapping;if(s===SF||s===OF)if(e.has(a)){const l=e.get(a).texture;return n(l,a.mapping)}else{const l=a.image;if(l&&l.height>0){const c=new SFt(l.height/2);return c.fromEquirectangularTexture(t,a),e.set(a,c),a.addEventListener("dispose",i),n(c.texture,a.mapping)}else return null}}return a}function i(a){const s=a.target;s.removeEventListener("dispose",i);const l=e.get(s);l!==void 0&&(e.delete(s),l.dispose())}function o(){e=new WeakMap}return{get:r,dispose:o}}class Lye extends Aye{constructor(e=-1,n=1,r=1,i=-1,o=.1,a=2e3){super(),this.isOrthographicCamera=!0,this.type="OrthographicCamera",this.zoom=1,this.view=null,this.left=e,this.right=n,this.top=r,this.bottom=i,this.near=o,this.far=a,this.updateProjectionMatrix()}copy(e,n){return super.copy(e,n),this.left=e.left,this.right=e.right,this.top=e.top,this.bottom=e.bottom,this.near=e.near,this.far=e.far,this.zoom=e.zoom,this.view=e.view===null?null:Object.assign({},e.view),this}setViewOffset(e,n,r,i,o,a){this.view===null&&(this.view={enabled:!0,fullWidth:1,fullHeight:1,offsetX:0,offsetY:0,width:1,height:1}),this.view.enabled=!0,this.view.fullWidth=e,this.view.fullHeight=n,this.view.offsetX=r,this.view.offsetY=i,this.view.width=o,this.view.height=a,this.updateProjectionMatrix()}clearViewOffset(){this.view!==null&&(this.view.enabled=!1),this.updateProjectionMatrix()}updateProjectionMatrix(){const e=(this.right-this.left)/(2*this.zoom),n=(this.top-this.bottom)/(2*this.zoom),r=(this.right+this.left)/2,i=(this.top+this.bottom)/2;let o=r-e,a=r+e,s=i+n,l=i-n;if(this.view!==null&&this.view.enabled){const c=(this.right-this.left)/this.view.fullWidth/this.zoom,u=(this.top-this.bottom)/this.view.fullHeight/this.zoom;o+=c*this.view.offsetX,a=o+c*this.view.width,s-=u*this.view.offsetY,l=s-u*this.view.height}this.projectionMatrix.makeOrthographic(o,a,s,l,this.near,this.far),this.projectionMatrixInverse.copy(this.projectionMatrix).invert()}toJSON(e){const n=super.toJSON(e);return n.object.zoom=this.zoom,n.object.left=this.left,n.object.right=this.right,n.object.top=this.top,n.object.bottom=this.bottom,n.object.near=this.near,n.object.far=this.far,this.view!==null&&(n.object.view=Object.assign({},this.view)),n}}const cg=4,JZ=[.125,.215,.35,.446,.526,.582],dh=20,xD=new Lye,eJ=new lr;let bD=null;const ih=(1+Math.sqrt(5))/2,Am=1/ih,tJ=[new Se(1,1,1),new Se(-1,1,1),new Se(1,1,-1),new Se(-1,1,-1),new Se(0,ih,Am),new Se(0,ih,-Am),new Se(Am,0,ih),new Se(-Am,0,ih),new Se(ih,Am,0),new Se(-ih,Am,0)];class nJ{constructor(e){this._renderer=e,this._pingPongRenderTarget=null,this._lodMax=0,this._cubeSize=0,this._lodPlanes=[],this._sizeLods=[],this._sigmas=[],this._blurMaterial=null,this._cubemapMaterial=null,this._equirectMaterial=null,this._compileMaterial(this._blurMaterial)}fromScene(e,n=0,r=.1,i=100){bD=this._renderer.getRenderTarget(),this._setSize(256);const o=this._allocateTargets();return o.depthBuffer=!0,this._sceneToCubeUV(e,r,i,o),n>0&&this._blur(o,0,0,n),this._applyPMREM(o),this._cleanup(o),o}fromEquirectangular(e,n=null){return this._fromTexture(e,n)}fromCubemap(e,n=null){return this._fromTexture(e,n)}compileCubemapShader(){this._cubemapMaterial===null&&(this._cubemapMaterial=oJ(),this._compileMaterial(this._cubemapMaterial))}compileEquirectangularShader(){this._equirectMaterial===null&&(this._equirectMaterial=iJ(),this._compileMaterial(this._equirectMaterial))}dispose(){this._dispose(),this._cubemapMaterial!==null&&this._cubemapMaterial.dispose(),this._equirectMaterial!==null&&this._equirectMaterial.dispose()}_setSize(e){this._lodMax=Math.floor(Math.log2(e)),this._cubeSize=Math.pow(2,this._lodMax)}_dispose(){this._blurMaterial!==null&&this._blurMaterial.dispose(),this._pingPongRenderTarget!==null&&this._pingPongRenderTarget.dispose();for(let e=0;e<this._lodPlanes.length;e++)this._lodPlanes[e].dispose()}_cleanup(e){this._renderer.setRenderTarget(bD),e.scissorTest=!1,eC(e,0,0,e.width,e.height)}_fromTexture(e,n){e.mapping===Nv||e.mapping===$v?this._setSize(e.image.length===0?16:e.image[0].width||e.image[0].image.width):this._setSize(e.image.width/4),bD=this._renderer.getRenderTarget();const r=n||this._allocateTargets();return this._textureToCubeUV(e,r),this._applyPMREM(r),this._cleanup(r),r}_allocateTargets(){const e=3*Math.max(this._cubeSize,112),n=4*this._cubeSize,r={magFilter:Po,minFilter:Po,generateMipmaps:!1,type:o1,format:jl,encoding:xp,depthBuffer:!1},i=rJ(e,n,r);if(this._pingPongRenderTarget===null||this._pingPongRenderTarget.width!==e){this._pingPongRenderTarget!==null&&this._dispose(),this._pingPongRenderTarget=rJ(e,n,r);const{_lodMax:o}=this;({sizeLods:this._sizeLods,lodPlanes:this._lodPlanes,sigmas:this._sigmas}=cBt(o)),this._blurMaterial=uBt(o,e,n)}return i}_compileMaterial(e){const n=new Bl(this._lodPlanes[0],e);this._renderer.compile(n,xD)}_sceneToCubeUV(e,n,r,i){const s=new Us(90,1,n,r),l=[1,-1,1,1,1,1],c=[1,1,1,-1,-1,-1],u=this._renderer,f=u.autoClear,d=u.toneMapping;u.getClearColor(eJ),u.toneMapping=su,u.autoClear=!1;const h=new O6({name:"PMREM.Background",side:_a,depthWrite:!1,depthTest:!1}),p=new Bl(new Yy,h);let m=!1;const g=e.background;g?g.isColor&&(h.color.copy(g),e.background=null,m=!0):(h.color.copy(eJ),m=!0);for(let v=0;v<6;v++){const y=v%3;y===0?(s.up.set(0,l[v],0),s.lookAt(c[v],0,0)):y===1?(s.up.set(0,0,l[v]),s.lookAt(0,c[v],0)):(s.up.set(0,l[v],0),s.lookAt(0,0,c[v]));const x=this._cubeSize;eC(i,y*x,v>2?x:0,x,x),u.setRenderTarget(i),m&&u.render(p,s),u.render(e,s)}p.geometry.dispose(),p.material.dispose(),u.toneMapping=d,u.autoClear=f,e.background=g}_textureToCubeUV(e,n){const r=this._renderer,i=e.mapping===Nv||e.mapping===$v;i?(this._cubemapMaterial===null&&(this._cubemapMaterial=oJ()),this._cubemapMaterial.uniforms.flipEnvMap.value=e.isRenderTargetTexture===!1?-1:1):this._equirectMaterial===null&&(this._equirectMaterial=iJ());const o=i?this._cubemapMaterial:this._equirectMaterial,a=new Bl(this._lodPlanes[0],o),s=o.uniforms;s.envMap.value=e;const l=this._cubeSize;eC(n,0,0,3*l,2*l),r.setRenderTarget(n),r.render(a,xD)}_applyPMREM(e){const n=this._renderer,r=n.autoClear;n.autoClear=!1;for(let i=1;i<this._lodPlanes.length;i++){const o=Math.sqrt(this._sigmas[i]*this._sigmas[i]-this._sigmas[i-1]*this._sigmas[i-1]),a=tJ[(i-1)%tJ.length];this._blur(e,i-1,i,o,a)}n.autoClear=r}_blur(e,n,r,i,o){const a=this._pingPongRenderTarget;this._halfBlur(e,a,n,r,i,"latitudinal",o),this._halfBlur(a,e,r,r,i,"longitudinal",o)}_halfBlur(e,n,r,i,o,a,s){const l=this._renderer,c=this._blurMaterial;a!=="latitudinal"&&a!=="longitudinal"&&console.error("blur direction must be either latitudinal or longitudinal!");const u=3,f=new Bl(this._lodPlanes[i],c),d=c.uniforms,h=this._sizeLods[r]-1,p=isFinite(o)?Math.PI/(2*h):2*Math.PI/(2*dh-1),m=o/p,g=isFinite(o)?1+Math.floor(u*m):dh;g>dh&&console.warn(`sigmaRadians, ${o}, is too large and will clip, as it requested ${g} samples when the maximum is set to ${dh}`);const v=[];let y=0;for(let O=0;O<dh;++O){const C=O/m,E=Math.exp(-C*C/2);v.push(E),O===0?y+=E:O<g&&(y+=2*E)}for(let O=0;O<v.length;O++)v[O]=v[O]/y;d.envMap.value=e.texture,d.samples.value=g,d.weights.value=v,d.latitudinal.value=a==="latitudinal",s&&(d.poleAxis.value=s);const{_lodMax:x}=this;d.dTheta.value=p,d.mipInt.value=x-r;const b=this._sizeLods[i],_=3*b*(i>x-cg?i-x+cg:0),S=4*(this._cubeSize-b);eC(n,_,S,3*b,2*b),l.setRenderTarget(n),l.render(f,xD)}}function cBt(t){const e=[],n=[],r=[];let i=t;const o=t-cg+1+JZ.length;for(let a=0;a<o;a++){const s=Math.pow(2,i);n.push(s);let l=1/s;a>t-cg?l=JZ[a-t+cg-1]:a===0&&(l=0),r.push(l);const c=1/(s-2),u=-c,f=1+c,d=[u,u,f,u,f,f,u,u,f,f,u,f],h=6,p=6,m=3,g=2,v=1,y=new Float32Array(m*p*h),x=new Float32Array(g*p*h),b=new Float32Array(v*p*h);for(let S=0;S<h;S++){const O=S%3*2/3-1,C=S>2?0:-1,E=[O,C,0,O+2/3,C,0,O+2/3,C+1,0,O,C,0,O+2/3,C+1,0,O,C+1,0];y.set(E,m*p*S),x.set(d,g*p*S);const k=[S,S,S,S,S,S];b.set(k,v*p*S)}const _=new Eu;_.setAttribute("position",new as(y,m)),_.setAttribute("uv",new as(x,g)),_.setAttribute("faceIndex",new as(b,v)),e.push(_),i>cg&&i--}return{lodPlanes:e,sizeLods:n,sigmas:r}}function rJ(t,e,n){const r=new bp(t,e,n);return r.texture.mapping=Dk,r.texture.name="PMREM.cubeUv",r.scissorTest=!0,r}function eC(t,e,n,r,i){t.viewport.set(e,n,r,i),t.scissor.set(e,n,r,i)}function uBt(t,e,n){const r=new Float32Array(dh),i=new Se(0,1,0);return new ud({name:"SphericalGaussianBlur",defines:{n:dh,CUBEUV_TEXEL_WIDTH:1/e,CUBEUV_TEXEL_HEIGHT:1/n,CUBEUV_MAX_MIP:`${t}.0`},uniforms:{envMap:{value:null},samples:{value:1},weights:{value:r},latitudinal:{value:!1},dTheta:{value:0},mipInt:{value:0},poleAxis:{value:i}},vertexShader:C6(),fragmentShader:`

			precision mediump float;
			precision mediump int;

			varying vec3 vOutputDirection;

			uniform sampler2D envMap;
			uniform int samples;
			uniform float weights[ n ];
			uniform bool latitudinal;
			uniform float dTheta;
			uniform float mipInt;
			uniform vec3 poleAxis;

			#define ENVMAP_TYPE_CUBE_UV
			#include <cube_uv_reflection_fragment>

			vec3 getSample( float theta, vec3 axis ) {

				float cosTheta = cos( theta );
				// Rodrigues' axis-angle rotation
				vec3 sampleDirection = vOutputDirection * cosTheta
					+ cross( axis, vOutputDirection ) * sin( theta )
					+ axis * dot( axis, vOutputDirection ) * ( 1.0 - cosTheta );

				return bilinearCubeUV( envMap, sampleDirection, mipInt );

			}

			void main() {

				vec3 axis = latitudinal ? poleAxis : cross( poleAxis, vOutputDirection );

				if ( all( equal( axis, vec3( 0.0 ) ) ) ) {

					axis = vec3( vOutputDirection.z, 0.0, - vOutputDirection.x );

				}

				axis = normalize( axis );

				gl_FragColor = vec4( 0.0, 0.0, 0.0, 1.0 );
				gl_FragColor.rgb += weights[ 0 ] * getSample( 0.0, axis );

				for ( int i = 1; i < n; i++ ) {

					if ( i >= samples ) {

						break;

					}

					float theta = dTheta * float( i );
					gl_FragColor.rgb += weights[ i ] * getSample( -1.0 * theta, axis );
					gl_FragColor.rgb += weights[ i ] * getSample( theta, axis );

				}

			}
		`,blending:Hf,depthTest:!1,depthWrite:!1})}function iJ(){return new ud({name:"EquirectangularToCubeUV",uniforms:{envMap:{value:null}},vertexShader:C6(),fragmentShader:`

			precision mediump float;
			precision mediump int;

			varying vec3 vOutputDirection;

			uniform sampler2D envMap;

			#include <common>

			void main() {

				vec3 outputDirection = normalize( vOutputDirection );
				vec2 uv = equirectUv( outputDirection );

				gl_FragColor = vec4( texture2D ( envMap, uv ).rgb, 1.0 );

			}
		`,blending:Hf,depthTest:!1,depthWrite:!1})}function oJ(){return new ud({name:"CubemapToCubeUV",uniforms:{envMap:{value:null},flipEnvMap:{value:-1}},vertexShader:C6(),fragmentShader:`

			precision mediump float;
			precision mediump int;

			uniform float flipEnvMap;

			varying vec3 vOutputDirection;

			uniform samplerCube envMap;

			void main() {

				gl_FragColor = textureCube( envMap, vec3( flipEnvMap * vOutputDirection.x, vOutputDirection.yz ) );

			}
		`,blending:Hf,depthTest:!1,depthWrite:!1})}function C6(){return`

		precision mediump float;
		precision mediump int;

		attribute float faceIndex;

		varying vec3 vOutputDirection;

		// RH coordinate system; PMREM face-indexing convention
		vec3 getDirection( vec2 uv, float face ) {

			uv = 2.0 * uv - 1.0;

			vec3 direction = vec3( uv, 1.0 );

			if ( face == 0.0 ) {

				direction = direction.zyx; // ( 1, v, u ) pos x

			} else if ( face == 1.0 ) {

				direction = direction.xzy;
				direction.xz *= -1.0; // ( -u, 1, -v ) pos y

			} else if ( face == 2.0 ) {

				direction.x *= -1.0; // ( -u, v, 1 ) pos z

			} else if ( face == 3.0 ) {

				direction = direction.zyx;
				direction.xz *= -1.0; // ( -1, v, -u ) neg x

			} else if ( face == 4.0 ) {

				direction = direction.xzy;
				direction.xy *= -1.0; // ( -u, -1, v ) neg y

			} else if ( face == 5.0 ) {

				direction.z *= -1.0; // ( u, v, -1 ) neg z

			}

			return direction;

		}

		void main() {

			vOutputDirection = getDirection( uv, faceIndex );
			gl_Position = vec4( position, 1.0 );

		}
	`}function fBt(t){let e=new WeakMap,n=null;function r(s){if(s&&s.isTexture){const l=s.mapping,c=l===SF||l===OF,u=l===Nv||l===$v;if(c||u)if(s.isRenderTargetTexture&&s.needsPMREMUpdate===!0){s.needsPMREMUpdate=!1;let f=e.get(s);return n===null&&(n=new nJ(t)),f=c?n.fromEquirectangular(s,f):n.fromCubemap(s,f),e.set(s,f),f.texture}else{if(e.has(s))return e.get(s).texture;{const f=s.image;if(c&&f&&f.height>0||u&&f&&i(f)){n===null&&(n=new nJ(t));const d=c?n.fromEquirectangular(s):n.fromCubemap(s);return e.set(s,d),s.addEventListener("dispose",o),d.texture}else return null}}}return s}function i(s){let l=0;const c=6;for(let u=0;u<c;u++)s[u]!==void 0&&l++;return l===c}function o(s){const l=s.target;l.removeEventListener("dispose",o);const c=e.get(l);c!==void 0&&(e.delete(l),c.dispose())}function a(){e=new WeakMap,n!==null&&(n.dispose(),n=null)}return{get:r,dispose:a}}function dBt(t){const e={};function n(r){if(e[r]!==void 0)return e[r];let i;switch(r){case"WEBGL_depth_texture":i=t.getExtension("WEBGL_depth_texture")||t.getExtension("MOZ_WEBGL_depth_texture")||t.getExtension("WEBKIT_WEBGL_depth_texture");break;case"EXT_texture_filter_anisotropic":i=t.getExtension("EXT_texture_filter_anisotropic")||t.getExtension("MOZ_EXT_texture_filter_anisotropic")||t.getExtension("WEBKIT_EXT_texture_filter_anisotropic");break;case"WEBGL_compressed_texture_s3tc":i=t.getExtension("WEBGL_compressed_texture_s3tc")||t.getExtension("MOZ_WEBGL_compressed_texture_s3tc")||t.getExtension("WEBKIT_WEBGL_compressed_texture_s3tc");break;case"WEBGL_compressed_texture_pvrtc":i=t.getExtension("WEBGL_compressed_texture_pvrtc")||t.getExtension("WEBKIT_WEBGL_compressed_texture_pvrtc");break;default:i=t.getExtension(r)}return e[r]=i,i}return{has:function(r){return n(r)!==null},init:function(r){r.isWebGL2?n("EXT_color_buffer_float"):(n("WEBGL_depth_texture"),n("OES_texture_float"),n("OES_texture_half_float"),n("OES_texture_half_float_linear"),n("OES_standard_derivatives"),n("OES_element_index_uint"),n("OES_vertex_array_object"),n("ANGLE_instanced_arrays")),n("OES_texture_float_linear"),n("EXT_color_buffer_half_float"),n("WEBGL_multisampled_render_to_texture")},get:function(r){const i=n(r);return i===null&&console.warn("THREE.WebGLRenderer: "+r+" extension not supported."),i}}}function hBt(t,e,n,r){const i={},o=new WeakMap;function a(f){const d=f.target;d.index!==null&&e.remove(d.index);for(const p in d.attributes)e.remove(d.attributes[p]);d.removeEventListener("dispose",a),delete i[d.id];const h=o.get(d);h&&(e.remove(h),o.delete(d)),r.releaseStatesOfGeometry(d),d.isInstancedBufferGeometry===!0&&delete d._maxInstanceCount,n.memory.geometries--}function s(f,d){return i[d.id]===!0||(d.addEventListener("dispose",a),i[d.id]=!0,n.memory.geometries++),d}function l(f){const d=f.attributes;for(const p in d)e.update(d[p],34962);const h=f.morphAttributes;for(const p in h){const m=h[p];for(let g=0,v=m.length;g<v;g++)e.update(m[g],34962)}}function c(f){const d=[],h=f.index,p=f.attributes.position;let m=0;if(h!==null){const y=h.array;m=h.version;for(let x=0,b=y.length;x<b;x+=3){const _=y[x+0],S=y[x+1],O=y[x+2];d.push(_,S,S,O,O,_)}}else{const y=p.array;m=p.version;for(let x=0,b=y.length/3-1;x<b;x+=3){const _=x+0,S=x+1,O=x+2;d.push(_,S,S,O,O,_)}}const g=new(bye(d)?Mye:Pye)(d,1);g.version=m;const v=o.get(f);v&&e.remove(v),o.set(f,g)}function u(f){const d=o.get(f);if(d){const h=f.index;h!==null&&d.version<h.version&&c(f)}else c(f);return o.get(f)}return{get:s,update:l,getWireframeAttribute:u}}function pBt(t,e,n,r){const i=r.isWebGL2;let o;function a(d){o=d}let s,l;function c(d){s=d.type,l=d.bytesPerElement}function u(d,h){t.drawElements(o,h,s,d*l),n.update(h,o,1)}function f(d,h,p){if(p===0)return;let m,g;if(i)m=t,g="drawElementsInstanced";else if(m=e.get("ANGLE_instanced_arrays"),g="drawElementsInstancedANGLE",m===null){console.error("THREE.WebGLIndexedBufferRenderer: using THREE.InstancedBufferGeometry but hardware does not support extension ANGLE_instanced_arrays.");return}m[g](o,h,s,d*l,p),n.update(h,o,p)}this.setMode=a,this.setIndex=c,this.render=u,this.renderInstances=f}function mBt(t){const e={geometries:0,textures:0},n={frame:0,calls:0,triangles:0,points:0,lines:0};function r(o,a,s){switch(n.calls++,a){case 4:n.triangles+=s*(o/3);break;case 1:n.lines+=s*(o/2);break;case 3:n.lines+=s*(o-1);break;case 2:n.lines+=s*o;break;case 0:n.points+=s*o;break;default:console.error("THREE.WebGLInfo: Unknown draw mode:",a);break}}function i(){n.frame++,n.calls=0,n.triangles=0,n.points=0,n.lines=0}return{memory:e,render:n,programs:null,autoReset:!0,reset:i,update:r}}function gBt(t,e){return t[0]-e[0]}function vBt(t,e){return Math.abs(e[1])-Math.abs(t[1])}function yBt(t,e,n){const r={},i=new Float32Array(8),o=new WeakMap,a=new Ri,s=[];for(let c=0;c<8;c++)s[c]=[c,0];function l(c,u,f,d){const h=c.morphTargetInfluences;if(e.isWebGL2===!0){const p=u.morphAttributes.position||u.morphAttributes.normal||u.morphAttributes.color,m=p!==void 0?p.length:0;let g=o.get(u);if(g===void 0||g.count!==m){let L=function(){R.dispose(),o.delete(u),u.removeEventListener("dispose",L)};g!==void 0&&g.texture.dispose();const x=u.morphAttributes.position!==void 0,b=u.morphAttributes.normal!==void 0,_=u.morphAttributes.color!==void 0,S=u.morphAttributes.position||[],O=u.morphAttributes.normal||[],C=u.morphAttributes.color||[];let E=0;x===!0&&(E=1),b===!0&&(E=2),_===!0&&(E=3);let k=u.attributes.position.count*E,I=1;k>e.maxTextureSize&&(I=Math.ceil(k/e.maxTextureSize),k=e.maxTextureSize);const P=new Float32Array(k*I*4*m),R=new Oye(P,k,I,m);R.type=Mf,R.needsUpdate=!0;const T=E*4;for(let z=0;z<m;z++){const B=S[z],U=O[z],W=C[z],$=k*I*4*z;for(let N=0;N<B.count;N++){const D=N*T;x===!0&&(a.fromBufferAttribute(B,N),P[$+D+0]=a.x,P[$+D+1]=a.y,P[$+D+2]=a.z,P[$+D+3]=0),b===!0&&(a.fromBufferAttribute(U,N),P[$+D+4]=a.x,P[$+D+5]=a.y,P[$+D+6]=a.z,P[$+D+7]=0),_===!0&&(a.fromBufferAttribute(W,N),P[$+D+8]=a.x,P[$+D+9]=a.y,P[$+D+10]=a.z,P[$+D+11]=W.itemSize===4?a.w:1)}}g={count:m,texture:R,size:new qt(k,I)},o.set(u,g),u.addEventListener("dispose",L)}let v=0;for(let x=0;x<h.length;x++)v+=h[x];const y=u.morphTargetsRelative?1:1-v;d.getUniforms().setValue(t,"morphTargetBaseInfluence",y),d.getUniforms().setValue(t,"morphTargetInfluences",h),d.getUniforms().setValue(t,"morphTargetsTexture",g.texture,n),d.getUniforms().setValue(t,"morphTargetsTextureSize",g.size)}else{const p=h===void 0?0:h.length;let m=r[u.id];if(m===void 0||m.length!==p){m=[];for(let b=0;b<p;b++)m[b]=[b,0];r[u.id]=m}for(let b=0;b<p;b++){const _=m[b];_[0]=b,_[1]=h[b]}m.sort(vBt);for(let b=0;b<8;b++)b<p&&m[b][1]?(s[b][0]=m[b][0],s[b][1]=m[b][1]):(s[b][0]=Number.MAX_SAFE_INTEGER,s[b][1]=0);s.sort(gBt);const g=u.morphAttributes.position,v=u.morphAttributes.normal;let y=0;for(let b=0;b<8;b++){const _=s[b],S=_[0],O=_[1];S!==Number.MAX_SAFE_INTEGER&&O?(g&&u.getAttribute("morphTarget"+b)!==g[S]&&u.setAttribute("morphTarget"+b,g[S]),v&&u.getAttribute("morphNormal"+b)!==v[S]&&u.setAttribute("morphNormal"+b,v[S]),i[b]=O,y+=O):(g&&u.hasAttribute("morphTarget"+b)===!0&&u.deleteAttribute("morphTarget"+b),v&&u.hasAttribute("morphNormal"+b)===!0&&u.deleteAttribute("morphNormal"+b),i[b]=0)}const x=u.morphTargetsRelative?1:1-y;d.getUniforms().setValue(t,"morphTargetBaseInfluence",x),d.getUniforms().setValue(t,"morphTargetInfluences",i)}}return{update:l}}function xBt(t,e,n,r){let i=new WeakMap;function o(l){const c=r.render.frame,u=l.geometry,f=e.get(l,u);return i.get(f)!==c&&(e.update(f),i.set(f,c)),l.isInstancedMesh&&(l.hasEventListener("dispose",s)===!1&&l.addEventListener("dispose",s),n.update(l.instanceMatrix,34962),l.instanceColor!==null&&n.update(l.instanceColor,34962)),f}function a(){i=new WeakMap}function s(l){const c=l.target;c.removeEventListener("dispose",s),n.remove(c.instanceMatrix),c.instanceColor!==null&&n.remove(c.instanceColor)}return{update:o,dispose:a}}const Nye=new Ta,$ye=new Oye,Fye=new Cye,jye=new Rye,aJ=[],sJ=[],lJ=new Float32Array(16),cJ=new Float32Array(9),uJ=new Float32Array(4);function Ky(t,e,n){const r=t[0];if(r<=0||r>0)return t;const i=e*n;let o=aJ[i];if(o===void 0&&(o=new Float32Array(i),aJ[i]=o),e!==0){r.toArray(o,0);for(let a=1,s=0;a!==e;++a)s+=n,t[a].toArray(o,s)}return o}function po(t,e){if(t.length!==e.length)return!1;for(let n=0,r=t.length;n<r;n++)if(t[n]!==e[n])return!1;return!0}function mo(t,e){for(let n=0,r=e.length;n<r;n++)t[n]=e[n]}function Fk(t,e){let n=sJ[e];n===void 0&&(n=new Int32Array(e),sJ[e]=n);for(let r=0;r!==e;++r)n[r]=t.allocateTextureUnit();return n}function bBt(t,e){const n=this.cache;n[0]!==e&&(t.uniform1f(this.addr,e),n[0]=e)}function _Bt(t,e){const n=this.cache;if(e.x!==void 0)(n[0]!==e.x||n[1]!==e.y)&&(t.uniform2f(this.addr,e.x,e.y),n[0]=e.x,n[1]=e.y);else{if(po(n,e))return;t.uniform2fv(this.addr,e),mo(n,e)}}function wBt(t,e){const n=this.cache;if(e.x!==void 0)(n[0]!==e.x||n[1]!==e.y||n[2]!==e.z)&&(t.uniform3f(this.addr,e.x,e.y,e.z),n[0]=e.x,n[1]=e.y,n[2]=e.z);else if(e.r!==void 0)(n[0]!==e.r||n[1]!==e.g||n[2]!==e.b)&&(t.uniform3f(this.addr,e.r,e.g,e.b),n[0]=e.r,n[1]=e.g,n[2]=e.b);else{if(po(n,e))return;t.uniform3fv(this.addr,e),mo(n,e)}}function SBt(t,e){const n=this.cache;if(e.x!==void 0)(n[0]!==e.x||n[1]!==e.y||n[2]!==e.z||n[3]!==e.w)&&(t.uniform4f(this.addr,e.x,e.y,e.z,e.w),n[0]=e.x,n[1]=e.y,n[2]=e.z,n[3]=e.w);else{if(po(n,e))return;t.uniform4fv(this.addr,e),mo(n,e)}}function OBt(t,e){const n=this.cache,r=e.elements;if(r===void 0){if(po(n,e))return;t.uniformMatrix2fv(this.addr,!1,e),mo(n,e)}else{if(po(n,r))return;uJ.set(r),t.uniformMatrix2fv(this.addr,!1,uJ),mo(n,r)}}function CBt(t,e){const n=this.cache,r=e.elements;if(r===void 0){if(po(n,e))return;t.uniformMatrix3fv(this.addr,!1,e),mo(n,e)}else{if(po(n,r))return;cJ.set(r),t.uniformMatrix3fv(this.addr,!1,cJ),mo(n,r)}}function TBt(t,e){const n=this.cache,r=e.elements;if(r===void 0){if(po(n,e))return;t.uniformMatrix4fv(this.addr,!1,e),mo(n,e)}else{if(po(n,r))return;lJ.set(r),t.uniformMatrix4fv(this.addr,!1,lJ),mo(n,r)}}function EBt(t,e){const n=this.cache;n[0]!==e&&(t.uniform1i(this.addr,e),n[0]=e)}function PBt(t,e){const n=this.cache;po(n,e)||(t.uniform2iv(this.addr,e),mo(n,e))}function MBt(t,e){const n=this.cache;po(n,e)||(t.uniform3iv(this.addr,e),mo(n,e))}function kBt(t,e){const n=this.cache;po(n,e)||(t.uniform4iv(this.addr,e),mo(n,e))}function ABt(t,e){const n=this.cache;n[0]!==e&&(t.uniform1ui(this.addr,e),n[0]=e)}function RBt(t,e){const n=this.cache;po(n,e)||(t.uniform2uiv(this.addr,e),mo(n,e))}function IBt(t,e){const n=this.cache;po(n,e)||(t.uniform3uiv(this.addr,e),mo(n,e))}function DBt(t,e){const n=this.cache;po(n,e)||(t.uniform4uiv(this.addr,e),mo(n,e))}function LBt(t,e,n){const r=this.cache,i=n.allocateTextureUnit();r[0]!==i&&(t.uniform1i(this.addr,i),r[0]=i),n.setTexture2D(e||Nye,i)}function NBt(t,e,n){const r=this.cache,i=n.allocateTextureUnit();r[0]!==i&&(t.uniform1i(this.addr,i),r[0]=i),n.setTexture3D(e||Fye,i)}function $Bt(t,e,n){const r=this.cache,i=n.allocateTextureUnit();r[0]!==i&&(t.uniform1i(this.addr,i),r[0]=i),n.setTextureCube(e||jye,i)}function FBt(t,e,n){const r=this.cache,i=n.allocateTextureUnit();r[0]!==i&&(t.uniform1i(this.addr,i),r[0]=i),n.setTexture2DArray(e||$ye,i)}function jBt(t){switch(t){case 5126:return bBt;case 35664:return _Bt;case 35665:return wBt;case 35666:return SBt;case 35674:return OBt;case 35675:return CBt;case 35676:return TBt;case 5124:case 35670:return EBt;case 35667:case 35671:return PBt;case 35668:case 35672:return MBt;case 35669:case 35673:return kBt;case 5125:return ABt;case 36294:return RBt;case 36295:return IBt;case 36296:return DBt;case 35678:case 36198:case 36298:case 36306:case 35682:return LBt;case 35679:case 36299:case 36307:return NBt;case 35680:case 36300:case 36308:case 36293:return $Bt;case 36289:case 36303:case 36311:case 36292:return FBt}}function BBt(t,e){t.uniform1fv(this.addr,e)}function zBt(t,e){const n=Ky(e,this.size,2);t.uniform2fv(this.addr,n)}function UBt(t,e){const n=Ky(e,this.size,3);t.uniform3fv(this.addr,n)}function WBt(t,e){const n=Ky(e,this.size,4);t.uniform4fv(this.addr,n)}function VBt(t,e){const n=Ky(e,this.size,4);t.uniformMatrix2fv(this.addr,!1,n)}function GBt(t,e){const n=Ky(e,this.size,9);t.uniformMatrix3fv(this.addr,!1,n)}function HBt(t,e){const n=Ky(e,this.size,16);t.uniformMatrix4fv(this.addr,!1,n)}function qBt(t,e){t.uniform1iv(this.addr,e)}function XBt(t,e){t.uniform2iv(this.addr,e)}function QBt(t,e){t.uniform3iv(this.addr,e)}function YBt(t,e){t.uniform4iv(this.addr,e)}function KBt(t,e){t.uniform1uiv(this.addr,e)}function ZBt(t,e){t.uniform2uiv(this.addr,e)}function JBt(t,e){t.uniform3uiv(this.addr,e)}function ezt(t,e){t.uniform4uiv(this.addr,e)}function tzt(t,e,n){const r=e.length,i=Fk(n,r);t.uniform1iv(this.addr,i);for(let o=0;o!==r;++o)n.setTexture2D(e[o]||Nye,i[o])}function nzt(t,e,n){const r=e.length,i=Fk(n,r);t.uniform1iv(this.addr,i);for(let o=0;o!==r;++o)n.setTexture3D(e[o]||Fye,i[o])}function rzt(t,e,n){const r=e.length,i=Fk(n,r);t.uniform1iv(this.addr,i);for(let o=0;o!==r;++o)n.setTextureCube(e[o]||jye,i[o])}function izt(t,e,n){const r=e.length,i=Fk(n,r);t.uniform1iv(this.addr,i);for(let o=0;o!==r;++o)n.setTexture2DArray(e[o]||$ye,i[o])}function ozt(t){switch(t){case 5126:return BBt;case 35664:return zBt;case 35665:return UBt;case 35666:return WBt;case 35674:return VBt;case 35675:return GBt;case 35676:return HBt;case 5124:case 35670:return qBt;case 35667:case 35671:return XBt;case 35668:case 35672:return QBt;case 35669:case 35673:return YBt;case 5125:return KBt;case 36294:return ZBt;case 36295:return JBt;case 36296:return ezt;case 35678:case 36198:case 36298:case 36306:case 35682:return tzt;case 35679:case 36299:case 36307:return nzt;case 35680:case 36300:case 36308:case 36293:return rzt;case 36289:case 36303:case 36311:case 36292:return izt}}class azt{constructor(e,n,r){this.id=e,this.addr=r,this.cache=[],this.setValue=jBt(n.type)}}class szt{constructor(e,n,r){this.id=e,this.addr=r,this.cache=[],this.size=n.size,this.setValue=ozt(n.type)}}class lzt{constructor(e){this.id=e,this.seq=[],this.map={}}setValue(e,n,r){const i=this.seq;for(let o=0,a=i.length;o!==a;++o){const s=i[o];s.setValue(e,n[s.id],r)}}}const _D=/(\w+)(\])?(\[|\.)?/g;function fJ(t,e){t.seq.push(e),t.map[e.id]=e}function czt(t,e,n){const r=t.name,i=r.length;for(_D.lastIndex=0;;){const o=_D.exec(r),a=_D.lastIndex;let s=o[1];const l=o[2]==="]",c=o[3];if(l&&(s=s|0),c===void 0||c==="["&&a+2===i){fJ(n,c===void 0?new azt(s,t,e):new szt(s,t,e));break}else{let f=n.map[s];f===void 0&&(f=new lzt(s),fJ(n,f)),n=f}}}class KC{constructor(e,n){this.seq=[],this.map={};const r=e.getProgramParameter(n,35718);for(let i=0;i<r;++i){const o=e.getActiveUniform(n,i),a=e.getUniformLocation(n,o.name);czt(o,a,this)}}setValue(e,n,r,i){const o=this.map[n];o!==void 0&&o.setValue(e,r,i)}setOptional(e,n,r){const i=n[r];i!==void 0&&this.setValue(e,r,i)}static upload(e,n,r,i){for(let o=0,a=n.length;o!==a;++o){const s=n[o],l=r[s.id];l.needsUpdate!==!1&&s.setValue(e,l.value,i)}}static seqWithValue(e,n){const r=[];for(let i=0,o=e.length;i!==o;++i){const a=e[i];a.id in n&&r.push(a)}return r}}function dJ(t,e,n){const r=t.createShader(e);return t.shaderSource(r,n),t.compileShader(r),r}let uzt=0;function fzt(t,e){const n=t.split(`
`),r=[],i=Math.max(e-6,0),o=Math.min(e+6,n.length);for(let a=i;a<o;a++){const s=a+1;r.push(`${s===e?">":" "} ${s}: ${n[a]}`)}return r.join(`
`)}function dzt(t){switch(t){case xp:return["Linear","( value )"];case yr:return["sRGB","( value )"];default:return console.warn("THREE.WebGLProgram: Unsupported encoding:",t),["Linear","( value )"]}}function hJ(t,e,n){const r=t.getShaderParameter(e,35713),i=t.getShaderInfoLog(e).trim();if(r&&i==="")return"";const o=/ERROR: 0:(\d+)/.exec(i);if(o){const a=parseInt(o[1]);return n.toUpperCase()+`

`+i+`

`+fzt(t.getShaderSource(e),a)}else return i}function hzt(t,e){const n=dzt(e);return"vec4 "+t+"( vec4 value ) { return LinearTo"+n[0]+n[1]+"; }"}function pzt(t,e){let n;switch(e){case N$t:n="Linear";break;case $$t:n="Reinhard";break;case F$t:n="OptimizedCineon";break;case j$t:n="ACESFilmic";break;case B$t:n="Custom";break;default:console.warn("THREE.WebGLProgram: Unsupported toneMapping:",e),n="Linear"}return"vec3 "+t+"( vec3 color ) { return "+n+"ToneMapping( color ); }"}function mzt(t){return[t.extensionDerivatives||t.envMapCubeUVHeight||t.bumpMap||t.tangentSpaceNormalMap||t.clearcoatNormalMap||t.flatShading||t.shaderID==="physical"?"#extension GL_OES_standard_derivatives : enable":"",(t.extensionFragDepth||t.logarithmicDepthBuffer)&&t.rendererExtensionFragDepth?"#extension GL_EXT_frag_depth : enable":"",t.extensionDrawBuffers&&t.rendererExtensionDrawBuffers?"#extension GL_EXT_draw_buffers : require":"",(t.extensionShaderTextureLOD||t.envMap||t.transmission)&&t.rendererExtensionShaderTextureLod?"#extension GL_EXT_shader_texture_lod : enable":""].filter(Sx).join(`
`)}function gzt(t){const e=[];for(const n in t){const r=t[n];r!==!1&&e.push("#define "+n+" "+r)}return e.join(`
`)}function vzt(t,e){const n={},r=t.getProgramParameter(e,35721);for(let i=0;i<r;i++){const o=t.getActiveAttrib(e,i),a=o.name;let s=1;o.type===35674&&(s=2),o.type===35675&&(s=3),o.type===35676&&(s=4),n[a]={type:o.type,location:t.getAttribLocation(e,a),locationSize:s}}return n}function Sx(t){return t!==""}function pJ(t,e){const n=e.numSpotLightShadows+e.numSpotLightMaps-e.numSpotLightShadowsWithMaps;return t.replace(/NUM_DIR_LIGHTS/g,e.numDirLights).replace(/NUM_SPOT_LIGHTS/g,e.numSpotLights).replace(/NUM_SPOT_LIGHT_MAPS/g,e.numSpotLightMaps).replace(/NUM_SPOT_LIGHT_COORDS/g,n).replace(/NUM_RECT_AREA_LIGHTS/g,e.numRectAreaLights).replace(/NUM_POINT_LIGHTS/g,e.numPointLights).replace(/NUM_HEMI_LIGHTS/g,e.numHemiLights).replace(/NUM_DIR_LIGHT_SHADOWS/g,e.numDirLightShadows).replace(/NUM_SPOT_LIGHT_SHADOWS_WITH_MAPS/g,e.numSpotLightShadowsWithMaps).replace(/NUM_SPOT_LIGHT_SHADOWS/g,e.numSpotLightShadows).replace(/NUM_POINT_LIGHT_SHADOWS/g,e.numPointLightShadows)}function mJ(t,e){return t.replace(/NUM_CLIPPING_PLANES/g,e.numClippingPlanes).replace(/UNION_CLIPPING_PLANES/g,e.numClippingPlanes-e.numClipIntersection)}const yzt=/^[ \t]*#include +<([\w\d./]+)>/gm;function MF(t){return t.replace(yzt,xzt)}function xzt(t,e){const n=Gt[e];if(n===void 0)throw new Error("Can not resolve #include <"+e+">");return MF(n)}const bzt=/#pragma unroll_loop_start\s+for\s*\(\s*int\s+i\s*=\s*(\d+)\s*;\s*i\s*<\s*(\d+)\s*;\s*i\s*\+\+\s*\)\s*{([\s\S]+?)}\s+#pragma unroll_loop_end/g;function gJ(t){return t.replace(bzt,_zt)}function _zt(t,e,n,r){let i="";for(let o=parseInt(e);o<parseInt(n);o++)i+=r.replace(/\[\s*i\s*\]/g,"[ "+o+" ]").replace(/UNROLLED_LOOP_INDEX/g,o);return i}function vJ(t){let e="precision "+t.precision+` float;
precision `+t.precision+" int;";return t.precision==="highp"?e+=`
#define HIGH_PRECISION`:t.precision==="mediump"?e+=`
#define MEDIUM_PRECISION`:t.precision==="lowp"&&(e+=`
#define LOW_PRECISION`),e}function wzt(t){let e="SHADOWMAP_TYPE_BASIC";return t.shadowMapType===hye?e="SHADOWMAP_TYPE_PCF":t.shadowMapType===p$t?e="SHADOWMAP_TYPE_PCF_SOFT":t.shadowMapType===wx&&(e="SHADOWMAP_TYPE_VSM"),e}function Szt(t){let e="ENVMAP_TYPE_CUBE";if(t.envMap)switch(t.envMapMode){case Nv:case $v:e="ENVMAP_TYPE_CUBE";break;case Dk:e="ENVMAP_TYPE_CUBE_UV";break}return e}function Ozt(t){let e="ENVMAP_MODE_REFLECTION";if(t.envMap)switch(t.envMapMode){case $v:e="ENVMAP_MODE_REFRACTION";break}return e}function Czt(t){let e="ENVMAP_BLENDING_NONE";if(t.envMap)switch(t.combine){case gye:e="ENVMAP_BLENDING_MULTIPLY";break;case D$t:e="ENVMAP_BLENDING_MIX";break;case L$t:e="ENVMAP_BLENDING_ADD";break}return e}function Tzt(t){const e=t.envMapCubeUVHeight;if(e===null)return null;const n=Math.log2(e)-2,r=1/e;return{texelWidth:1/(3*Math.max(Math.pow(2,n),7*16)),texelHeight:r,maxMip:n}}function Ezt(t,e,n,r){const i=t.getContext(),o=n.defines;let a=n.vertexShader,s=n.fragmentShader;const l=wzt(n),c=Szt(n),u=Ozt(n),f=Czt(n),d=Tzt(n),h=n.isWebGL2?"":mzt(n),p=gzt(o),m=i.createProgram();let g,v,y=n.glslVersion?"#version "+n.glslVersion+`
`:"";n.isRawShaderMaterial?(g=[p].filter(Sx).join(`
`),g.length>0&&(g+=`
`),v=[h,p].filter(Sx).join(`
`),v.length>0&&(v+=`
`)):(g=[vJ(n),"#define SHADER_NAME "+n.shaderName,p,n.instancing?"#define USE_INSTANCING":"",n.instancingColor?"#define USE_INSTANCING_COLOR":"",n.supportsVertexTextures?"#define VERTEX_TEXTURES":"",n.useFog&&n.fog?"#define USE_FOG":"",n.useFog&&n.fogExp2?"#define FOG_EXP2":"",n.map?"#define USE_MAP":"",n.envMap?"#define USE_ENVMAP":"",n.envMap?"#define "+u:"",n.lightMap?"#define USE_LIGHTMAP":"",n.aoMap?"#define USE_AOMAP":"",n.emissiveMap?"#define USE_EMISSIVEMAP":"",n.bumpMap?"#define USE_BUMPMAP":"",n.normalMap?"#define USE_NORMALMAP":"",n.normalMap&&n.objectSpaceNormalMap?"#define OBJECTSPACE_NORMALMAP":"",n.normalMap&&n.tangentSpaceNormalMap?"#define TANGENTSPACE_NORMALMAP":"",n.clearcoatMap?"#define USE_CLEARCOATMAP":"",n.clearcoatRoughnessMap?"#define USE_CLEARCOAT_ROUGHNESSMAP":"",n.clearcoatNormalMap?"#define USE_CLEARCOAT_NORMALMAP":"",n.iridescenceMap?"#define USE_IRIDESCENCEMAP":"",n.iridescenceThicknessMap?"#define USE_IRIDESCENCE_THICKNESSMAP":"",n.displacementMap&&n.supportsVertexTextures?"#define USE_DISPLACEMENTMAP":"",n.specularMap?"#define USE_SPECULARMAP":"",n.specularIntensityMap?"#define USE_SPECULARINTENSITYMAP":"",n.specularColorMap?"#define USE_SPECULARCOLORMAP":"",n.roughnessMap?"#define USE_ROUGHNESSMAP":"",n.metalnessMap?"#define USE_METALNESSMAP":"",n.alphaMap?"#define USE_ALPHAMAP":"",n.transmission?"#define USE_TRANSMISSION":"",n.transmissionMap?"#define USE_TRANSMISSIONMAP":"",n.thicknessMap?"#define USE_THICKNESSMAP":"",n.sheenColorMap?"#define USE_SHEENCOLORMAP":"",n.sheenRoughnessMap?"#define USE_SHEENROUGHNESSMAP":"",n.vertexTangents?"#define USE_TANGENT":"",n.vertexColors?"#define USE_COLOR":"",n.vertexAlphas?"#define USE_COLOR_ALPHA":"",n.vertexUvs?"#define USE_UV":"",n.uvsVertexOnly?"#define UVS_VERTEX_ONLY":"",n.flatShading?"#define FLAT_SHADED":"",n.skinning?"#define USE_SKINNING":"",n.morphTargets?"#define USE_MORPHTARGETS":"",n.morphNormals&&n.flatShading===!1?"#define USE_MORPHNORMALS":"",n.morphColors&&n.isWebGL2?"#define USE_MORPHCOLORS":"",n.morphTargetsCount>0&&n.isWebGL2?"#define MORPHTARGETS_TEXTURE":"",n.morphTargetsCount>0&&n.isWebGL2?"#define MORPHTARGETS_TEXTURE_STRIDE "+n.morphTextureStride:"",n.morphTargetsCount>0&&n.isWebGL2?"#define MORPHTARGETS_COUNT "+n.morphTargetsCount:"",n.doubleSided?"#define DOUBLE_SIDED":"",n.flipSided?"#define FLIP_SIDED":"",n.shadowMapEnabled?"#define USE_SHADOWMAP":"",n.shadowMapEnabled?"#define "+l:"",n.sizeAttenuation?"#define USE_SIZEATTENUATION":"",n.logarithmicDepthBuffer?"#define USE_LOGDEPTHBUF":"",n.logarithmicDepthBuffer&&n.rendererExtensionFragDepth?"#define USE_LOGDEPTHBUF_EXT":"","uniform mat4 modelMatrix;","uniform mat4 modelViewMatrix;","uniform mat4 projectionMatrix;","uniform mat4 viewMatrix;","uniform mat3 normalMatrix;","uniform vec3 cameraPosition;","uniform bool isOrthographic;","#ifdef USE_INSTANCING","	attribute mat4 instanceMatrix;","#endif","#ifdef USE_INSTANCING_COLOR","	attribute vec3 instanceColor;","#endif","attribute vec3 position;","attribute vec3 normal;","attribute vec2 uv;","#ifdef USE_TANGENT","	attribute vec4 tangent;","#endif","#if defined( USE_COLOR_ALPHA )","	attribute vec4 color;","#elif defined( USE_COLOR )","	attribute vec3 color;","#endif","#if ( defined( USE_MORPHTARGETS ) && ! defined( MORPHTARGETS_TEXTURE ) )","	attribute vec3 morphTarget0;","	attribute vec3 morphTarget1;","	attribute vec3 morphTarget2;","	attribute vec3 morphTarget3;","	#ifdef USE_MORPHNORMALS","		attribute vec3 morphNormal0;","		attribute vec3 morphNormal1;","		attribute vec3 morphNormal2;","		attribute vec3 morphNormal3;","	#else","		attribute vec3 morphTarget4;","		attribute vec3 morphTarget5;","		attribute vec3 morphTarget6;","		attribute vec3 morphTarget7;","	#endif","#endif","#ifdef USE_SKINNING","	attribute vec4 skinIndex;","	attribute vec4 skinWeight;","#endif",`
`].filter(Sx).join(`
`),v=[h,vJ(n),"#define SHADER_NAME "+n.shaderName,p,n.useFog&&n.fog?"#define USE_FOG":"",n.useFog&&n.fogExp2?"#define FOG_EXP2":"",n.map?"#define USE_MAP":"",n.matcap?"#define USE_MATCAP":"",n.envMap?"#define USE_ENVMAP":"",n.envMap?"#define "+c:"",n.envMap?"#define "+u:"",n.envMap?"#define "+f:"",d?"#define CUBEUV_TEXEL_WIDTH "+d.texelWidth:"",d?"#define CUBEUV_TEXEL_HEIGHT "+d.texelHeight:"",d?"#define CUBEUV_MAX_MIP "+d.maxMip+".0":"",n.lightMap?"#define USE_LIGHTMAP":"",n.aoMap?"#define USE_AOMAP":"",n.emissiveMap?"#define USE_EMISSIVEMAP":"",n.bumpMap?"#define USE_BUMPMAP":"",n.normalMap?"#define USE_NORMALMAP":"",n.normalMap&&n.objectSpaceNormalMap?"#define OBJECTSPACE_NORMALMAP":"",n.normalMap&&n.tangentSpaceNormalMap?"#define TANGENTSPACE_NORMALMAP":"",n.clearcoat?"#define USE_CLEARCOAT":"",n.clearcoatMap?"#define USE_CLEARCOATMAP":"",n.clearcoatRoughnessMap?"#define USE_CLEARCOAT_ROUGHNESSMAP":"",n.clearcoatNormalMap?"#define USE_CLEARCOAT_NORMALMAP":"",n.iridescence?"#define USE_IRIDESCENCE":"",n.iridescenceMap?"#define USE_IRIDESCENCEMAP":"",n.iridescenceThicknessMap?"#define USE_IRIDESCENCE_THICKNESSMAP":"",n.specularMap?"#define USE_SPECULARMAP":"",n.specularIntensityMap?"#define USE_SPECULARINTENSITYMAP":"",n.specularColorMap?"#define USE_SPECULARCOLORMAP":"",n.roughnessMap?"#define USE_ROUGHNESSMAP":"",n.metalnessMap?"#define USE_METALNESSMAP":"",n.alphaMap?"#define USE_ALPHAMAP":"",n.alphaTest?"#define USE_ALPHATEST":"",n.sheen?"#define USE_SHEEN":"",n.sheenColorMap?"#define USE_SHEENCOLORMAP":"",n.sheenRoughnessMap?"#define USE_SHEENROUGHNESSMAP":"",n.transmission?"#define USE_TRANSMISSION":"",n.transmissionMap?"#define USE_TRANSMISSIONMAP":"",n.thicknessMap?"#define USE_THICKNESSMAP":"",n.decodeVideoTexture?"#define DECODE_VIDEO_TEXTURE":"",n.vertexTangents?"#define USE_TANGENT":"",n.vertexColors||n.instancingColor?"#define USE_COLOR":"",n.vertexAlphas?"#define USE_COLOR_ALPHA":"",n.vertexUvs?"#define USE_UV":"",n.uvsVertexOnly?"#define UVS_VERTEX_ONLY":"",n.gradientMap?"#define USE_GRADIENTMAP":"",n.flatShading?"#define FLAT_SHADED":"",n.doubleSided?"#define DOUBLE_SIDED":"",n.flipSided?"#define FLIP_SIDED":"",n.shadowMapEnabled?"#define USE_SHADOWMAP":"",n.shadowMapEnabled?"#define "+l:"",n.premultipliedAlpha?"#define PREMULTIPLIED_ALPHA":"",n.physicallyCorrectLights?"#define PHYSICALLY_CORRECT_LIGHTS":"",n.logarithmicDepthBuffer?"#define USE_LOGDEPTHBUF":"",n.logarithmicDepthBuffer&&n.rendererExtensionFragDepth?"#define USE_LOGDEPTHBUF_EXT":"","uniform mat4 viewMatrix;","uniform vec3 cameraPosition;","uniform bool isOrthographic;",n.toneMapping!==su?"#define TONE_MAPPING":"",n.toneMapping!==su?Gt.tonemapping_pars_fragment:"",n.toneMapping!==su?pzt("toneMapping",n.toneMapping):"",n.dithering?"#define DITHERING":"",n.opaque?"#define OPAQUE":"",Gt.encodings_pars_fragment,hzt("linearToOutputTexel",n.outputEncoding),n.useDepthPacking?"#define DEPTH_PACKING "+n.depthPacking:"",`
`].filter(Sx).join(`
`)),a=MF(a),a=pJ(a,n),a=mJ(a,n),s=MF(s),s=pJ(s,n),s=mJ(s,n),a=gJ(a),s=gJ(s),n.isWebGL2&&n.isRawShaderMaterial!==!0&&(y=`#version 300 es
`,g=["precision mediump sampler2DArray;","#define attribute in","#define varying out","#define texture2D texture"].join(`
`)+`
`+g,v=["#define varying in",n.glslVersion===jZ?"":"layout(location = 0) out highp vec4 pc_fragColor;",n.glslVersion===jZ?"":"#define gl_FragColor pc_fragColor","#define gl_FragDepthEXT gl_FragDepth","#define texture2D texture","#define textureCube texture","#define texture2DProj textureProj","#define texture2DLodEXT textureLod","#define texture2DProjLodEXT textureProjLod","#define textureCubeLodEXT textureLod","#define texture2DGradEXT textureGrad","#define texture2DProjGradEXT textureProjGrad","#define textureCubeGradEXT textureGrad"].join(`
`)+`
`+v);const x=y+g+a,b=y+v+s,_=dJ(i,35633,x),S=dJ(i,35632,b);if(i.attachShader(m,_),i.attachShader(m,S),n.index0AttributeName!==void 0?i.bindAttribLocation(m,0,n.index0AttributeName):n.morphTargets===!0&&i.bindAttribLocation(m,0,"position"),i.linkProgram(m),t.debug.checkShaderErrors){const E=i.getProgramInfoLog(m).trim(),k=i.getShaderInfoLog(_).trim(),I=i.getShaderInfoLog(S).trim();let P=!0,R=!0;if(i.getProgramParameter(m,35714)===!1){P=!1;const T=hJ(i,_,"vertex"),L=hJ(i,S,"fragment");console.error("THREE.WebGLProgram: Shader Error "+i.getError()+" - VALIDATE_STATUS "+i.getProgramParameter(m,35715)+`

Program Info Log: `+E+`
`+T+`
`+L)}else E!==""?console.warn("THREE.WebGLProgram: Program Info Log:",E):(k===""||I==="")&&(R=!1);R&&(this.diagnostics={runnable:P,programLog:E,vertexShader:{log:k,prefix:g},fragmentShader:{log:I,prefix:v}})}i.deleteShader(_),i.deleteShader(S);let O;this.getUniforms=function(){return O===void 0&&(O=new KC(i,m)),O};let C;return this.getAttributes=function(){return C===void 0&&(C=vzt(i,m)),C},this.destroy=function(){r.releaseStatesOfProgram(this),i.deleteProgram(m),this.program=void 0},this.name=n.shaderName,this.id=uzt++,this.cacheKey=e,this.usedTimes=1,this.program=m,this.vertexShader=_,this.fragmentShader=S,this}let Pzt=0;class Mzt{constructor(){this.shaderCache=new Map,this.materialCache=new Map}update(e){const n=e.vertexShader,r=e.fragmentShader,i=this._getShaderStage(n),o=this._getShaderStage(r),a=this._getShaderCacheForMaterial(e);return a.has(i)===!1&&(a.add(i),i.usedTimes++),a.has(o)===!1&&(a.add(o),o.usedTimes++),this}remove(e){const n=this.materialCache.get(e);for(const r of n)r.usedTimes--,r.usedTimes===0&&this.shaderCache.delete(r.code);return this.materialCache.delete(e),this}getVertexShaderID(e){return this._getShaderStage(e.vertexShader).id}getFragmentShaderID(e){return this._getShaderStage(e.fragmentShader).id}dispose(){this.shaderCache.clear(),this.materialCache.clear()}_getShaderCacheForMaterial(e){const n=this.materialCache;let r=n.get(e);return r===void 0&&(r=new Set,n.set(e,r)),r}_getShaderStage(e){const n=this.shaderCache;let r=n.get(e);return r===void 0&&(r=new kzt(e),n.set(e,r)),r}}class kzt{constructor(e){this.id=Pzt++,this.code=e,this.usedTimes=0}}function Azt(t,e,n,r,i,o,a){const s=new Eye,l=new Mzt,c=[],u=i.isWebGL2,f=i.logarithmicDepthBuffer,d=i.vertexTextures;let h=i.precision;const p={MeshDepthMaterial:"depth",MeshDistanceMaterial:"distanceRGBA",MeshNormalMaterial:"normal",MeshBasicMaterial:"basic",MeshLambertMaterial:"lambert",MeshPhongMaterial:"phong",MeshToonMaterial:"toon",MeshStandardMaterial:"physical",MeshPhysicalMaterial:"physical",MeshMatcapMaterial:"matcap",LineBasicMaterial:"basic",LineDashedMaterial:"dashed",PointsMaterial:"points",ShadowMaterial:"shadow",SpriteMaterial:"sprite"};function m(C,E,k,I,P){const R=I.fog,T=P.geometry,L=C.isMeshStandardMaterial?I.environment:null,z=(C.isMeshStandardMaterial?n:e).get(C.envMap||L),B=z&&z.mapping===Dk?z.image.height:null,U=p[C.type];C.precision!==null&&(h=i.getMaxPrecision(C.precision),h!==C.precision&&console.warn("THREE.WebGLProgram.getParameters:",C.precision,"not supported, using",h,"instead."));const W=T.morphAttributes.position||T.morphAttributes.normal||T.morphAttributes.color,$=W!==void 0?W.length:0;let N=0;T.morphAttributes.position!==void 0&&(N=1),T.morphAttributes.normal!==void 0&&(N=2),T.morphAttributes.color!==void 0&&(N=3);let D,A,q,Y;if(U){const be=_l[U];D=be.vertexShader,A=be.fragmentShader}else D=C.vertexShader,A=C.fragmentShader,l.update(C),q=l.getVertexShaderID(C),Y=l.getFragmentShaderID(C);const K=t.getRenderTarget(),se=C.alphaTest>0,te=C.clearcoat>0,J=C.iridescence>0;return{isWebGL2:u,shaderID:U,shaderName:C.type,vertexShader:D,fragmentShader:A,defines:C.defines,customVertexShaderID:q,customFragmentShaderID:Y,isRawShaderMaterial:C.isRawShaderMaterial===!0,glslVersion:C.glslVersion,precision:h,instancing:P.isInstancedMesh===!0,instancingColor:P.isInstancedMesh===!0&&P.instanceColor!==null,supportsVertexTextures:d,outputEncoding:K===null?t.outputEncoding:K.isXRRenderTarget===!0?K.texture.encoding:xp,map:!!C.map,matcap:!!C.matcap,envMap:!!z,envMapMode:z&&z.mapping,envMapCubeUVHeight:B,lightMap:!!C.lightMap,aoMap:!!C.aoMap,emissiveMap:!!C.emissiveMap,bumpMap:!!C.bumpMap,normalMap:!!C.normalMap,objectSpaceNormalMap:C.normalMapType===oFt,tangentSpaceNormalMap:C.normalMapType===iFt,decodeVideoTexture:!!C.map&&C.map.isVideoTexture===!0&&C.map.encoding===yr,clearcoat:te,clearcoatMap:te&&!!C.clearcoatMap,clearcoatRoughnessMap:te&&!!C.clearcoatRoughnessMap,clearcoatNormalMap:te&&!!C.clearcoatNormalMap,iridescence:J,iridescenceMap:J&&!!C.iridescenceMap,iridescenceThicknessMap:J&&!!C.iridescenceThicknessMap,displacementMap:!!C.displacementMap,roughnessMap:!!C.roughnessMap,metalnessMap:!!C.metalnessMap,specularMap:!!C.specularMap,specularIntensityMap:!!C.specularIntensityMap,specularColorMap:!!C.specularColorMap,opaque:C.transparent===!1&&C.blending===Bg,alphaMap:!!C.alphaMap,alphaTest:se,gradientMap:!!C.gradientMap,sheen:C.sheen>0,sheenColorMap:!!C.sheenColorMap,sheenRoughnessMap:!!C.sheenRoughnessMap,transmission:C.transmission>0,transmissionMap:!!C.transmissionMap,thicknessMap:!!C.thicknessMap,combine:C.combine,vertexTangents:!!C.normalMap&&!!T.attributes.tangent,vertexColors:C.vertexColors,vertexAlphas:C.vertexColors===!0&&!!T.attributes.color&&T.attributes.color.itemSize===4,vertexUvs:!!C.map||!!C.bumpMap||!!C.normalMap||!!C.specularMap||!!C.alphaMap||!!C.emissiveMap||!!C.roughnessMap||!!C.metalnessMap||!!C.clearcoatMap||!!C.clearcoatRoughnessMap||!!C.clearcoatNormalMap||!!C.iridescenceMap||!!C.iridescenceThicknessMap||!!C.displacementMap||!!C.transmissionMap||!!C.thicknessMap||!!C.specularIntensityMap||!!C.specularColorMap||!!C.sheenColorMap||!!C.sheenRoughnessMap,uvsVertexOnly:!(C.map||C.bumpMap||C.normalMap||C.specularMap||C.alphaMap||C.emissiveMap||C.roughnessMap||C.metalnessMap||C.clearcoatNormalMap||C.iridescenceMap||C.iridescenceThicknessMap||C.transmission>0||C.transmissionMap||C.thicknessMap||C.specularIntensityMap||C.specularColorMap||C.sheen>0||C.sheenColorMap||C.sheenRoughnessMap)&&!!C.displacementMap,fog:!!R,useFog:C.fog===!0,fogExp2:R&&R.isFogExp2,flatShading:!!C.flatShading,sizeAttenuation:C.sizeAttenuation,logarithmicDepthBuffer:f,skinning:P.isSkinnedMesh===!0,morphTargets:T.morphAttributes.position!==void 0,morphNormals:T.morphAttributes.normal!==void 0,morphColors:T.morphAttributes.color!==void 0,morphTargetsCount:$,morphTextureStride:N,numDirLights:E.directional.length,numPointLights:E.point.length,numSpotLights:E.spot.length,numSpotLightMaps:E.spotLightMap.length,numRectAreaLights:E.rectArea.length,numHemiLights:E.hemi.length,numDirLightShadows:E.directionalShadowMap.length,numPointLightShadows:E.pointShadowMap.length,numSpotLightShadows:E.spotShadowMap.length,numSpotLightShadowsWithMaps:E.numSpotLightShadowsWithMaps,numClippingPlanes:a.numPlanes,numClipIntersection:a.numIntersection,dithering:C.dithering,shadowMapEnabled:t.shadowMap.enabled&&k.length>0,shadowMapType:t.shadowMap.type,toneMapping:C.toneMapped?t.toneMapping:su,physicallyCorrectLights:t.physicallyCorrectLights,premultipliedAlpha:C.premultipliedAlpha,doubleSided:C.side===Yc,flipSided:C.side===_a,useDepthPacking:!!C.depthPacking,depthPacking:C.depthPacking||0,index0AttributeName:C.index0AttributeName,extensionDerivatives:C.extensions&&C.extensions.derivatives,extensionFragDepth:C.extensions&&C.extensions.fragDepth,extensionDrawBuffers:C.extensions&&C.extensions.drawBuffers,extensionShaderTextureLOD:C.extensions&&C.extensions.shaderTextureLOD,rendererExtensionFragDepth:u||r.has("EXT_frag_depth"),rendererExtensionDrawBuffers:u||r.has("WEBGL_draw_buffers"),rendererExtensionShaderTextureLod:u||r.has("EXT_shader_texture_lod"),customProgramCacheKey:C.customProgramCacheKey()}}function g(C){const E=[];if(C.shaderID?E.push(C.shaderID):(E.push(C.customVertexShaderID),E.push(C.customFragmentShaderID)),C.defines!==void 0)for(const k in C.defines)E.push(k),E.push(C.defines[k]);return C.isRawShaderMaterial===!1&&(v(E,C),y(E,C),E.push(t.outputEncoding)),E.push(C.customProgramCacheKey),E.join()}function v(C,E){C.push(E.precision),C.push(E.outputEncoding),C.push(E.envMapMode),C.push(E.envMapCubeUVHeight),C.push(E.combine),C.push(E.vertexUvs),C.push(E.fogExp2),C.push(E.sizeAttenuation),C.push(E.morphTargetsCount),C.push(E.morphAttributeCount),C.push(E.numDirLights),C.push(E.numPointLights),C.push(E.numSpotLights),C.push(E.numSpotLightMaps),C.push(E.numHemiLights),C.push(E.numRectAreaLights),C.push(E.numDirLightShadows),C.push(E.numPointLightShadows),C.push(E.numSpotLightShadows),C.push(E.numSpotLightShadowsWithMaps),C.push(E.shadowMapType),C.push(E.toneMapping),C.push(E.numClippingPlanes),C.push(E.numClipIntersection),C.push(E.depthPacking)}function y(C,E){s.disableAll(),E.isWebGL2&&s.enable(0),E.supportsVertexTextures&&s.enable(1),E.instancing&&s.enable(2),E.instancingColor&&s.enable(3),E.map&&s.enable(4),E.matcap&&s.enable(5),E.envMap&&s.enable(6),E.lightMap&&s.enable(7),E.aoMap&&s.enable(8),E.emissiveMap&&s.enable(9),E.bumpMap&&s.enable(10),E.normalMap&&s.enable(11),E.objectSpaceNormalMap&&s.enable(12),E.tangentSpaceNormalMap&&s.enable(13),E.clearcoat&&s.enable(14),E.clearcoatMap&&s.enable(15),E.clearcoatRoughnessMap&&s.enable(16),E.clearcoatNormalMap&&s.enable(17),E.iridescence&&s.enable(18),E.iridescenceMap&&s.enable(19),E.iridescenceThicknessMap&&s.enable(20),E.displacementMap&&s.enable(21),E.specularMap&&s.enable(22),E.roughnessMap&&s.enable(23),E.metalnessMap&&s.enable(24),E.gradientMap&&s.enable(25),E.alphaMap&&s.enable(26),E.alphaTest&&s.enable(27),E.vertexColors&&s.enable(28),E.vertexAlphas&&s.enable(29),E.vertexUvs&&s.enable(30),E.vertexTangents&&s.enable(31),E.uvsVertexOnly&&s.enable(32),C.push(s.mask),s.disableAll(),E.fog&&s.enable(0),E.useFog&&s.enable(1),E.flatShading&&s.enable(2),E.logarithmicDepthBuffer&&s.enable(3),E.skinning&&s.enable(4),E.morphTargets&&s.enable(5),E.morphNormals&&s.enable(6),E.morphColors&&s.enable(7),E.premultipliedAlpha&&s.enable(8),E.shadowMapEnabled&&s.enable(9),E.physicallyCorrectLights&&s.enable(10),E.doubleSided&&s.enable(11),E.flipSided&&s.enable(12),E.useDepthPacking&&s.enable(13),E.dithering&&s.enable(14),E.specularIntensityMap&&s.enable(15),E.specularColorMap&&s.enable(16),E.transmission&&s.enable(17),E.transmissionMap&&s.enable(18),E.thicknessMap&&s.enable(19),E.sheen&&s.enable(20),E.sheenColorMap&&s.enable(21),E.sheenRoughnessMap&&s.enable(22),E.decodeVideoTexture&&s.enable(23),E.opaque&&s.enable(24),C.push(s.mask)}function x(C){const E=p[C.type];let k;if(E){const I=_l[E];k=kye.clone(I.uniforms)}else k=C.uniforms;return k}function b(C,E){let k;for(let I=0,P=c.length;I<P;I++){const R=c[I];if(R.cacheKey===E){k=R,++k.usedTimes;break}}return k===void 0&&(k=new Ezt(t,E,C,o),c.push(k)),k}function _(C){if(--C.usedTimes===0){const E=c.indexOf(C);c[E]=c[c.length-1],c.pop(),C.destroy()}}function S(C){l.remove(C)}function O(){l.dispose()}return{getParameters:m,getProgramCacheKey:g,getUniforms:x,acquireProgram:b,releaseProgram:_,releaseShaderCache:S,programs:c,dispose:O}}function Rzt(){let t=new WeakMap;function e(o){let a=t.get(o);return a===void 0&&(a={},t.set(o,a)),a}function n(o){t.delete(o)}function r(o,a,s){t.get(o)[a]=s}function i(){t=new WeakMap}return{get:e,remove:n,update:r,dispose:i}}function Izt(t,e){return t.groupOrder!==e.groupOrder?t.groupOrder-e.groupOrder:t.renderOrder!==e.renderOrder?t.renderOrder-e.renderOrder:t.material.id!==e.material.id?t.material.id-e.material.id:t.z!==e.z?t.z-e.z:t.id-e.id}function yJ(t,e){return t.groupOrder!==e.groupOrder?t.groupOrder-e.groupOrder:t.renderOrder!==e.renderOrder?t.renderOrder-e.renderOrder:t.z!==e.z?e.z-t.z:t.id-e.id}function xJ(){const t=[];let e=0;const n=[],r=[],i=[];function o(){e=0,n.length=0,r.length=0,i.length=0}function a(f,d,h,p,m,g){let v=t[e];return v===void 0?(v={id:f.id,object:f,geometry:d,material:h,groupOrder:p,renderOrder:f.renderOrder,z:m,group:g},t[e]=v):(v.id=f.id,v.object=f,v.geometry=d,v.material=h,v.groupOrder=p,v.renderOrder=f.renderOrder,v.z=m,v.group=g),e++,v}function s(f,d,h,p,m,g){const v=a(f,d,h,p,m,g);h.transmission>0?r.push(v):h.transparent===!0?i.push(v):n.push(v)}function l(f,d,h,p,m,g){const v=a(f,d,h,p,m,g);h.transmission>0?r.unshift(v):h.transparent===!0?i.unshift(v):n.unshift(v)}function c(f,d){n.length>1&&n.sort(f||Izt),r.length>1&&r.sort(d||yJ),i.length>1&&i.sort(d||yJ)}function u(){for(let f=e,d=t.length;f<d;f++){const h=t[f];if(h.id===null)break;h.id=null,h.object=null,h.geometry=null,h.material=null,h.group=null}}return{opaque:n,transmissive:r,transparent:i,init:o,push:s,unshift:l,finish:u,sort:c}}function Dzt(){let t=new WeakMap;function e(r,i){const o=t.get(r);let a;return o===void 0?(a=new xJ,t.set(r,[a])):i>=o.length?(a=new xJ,o.push(a)):a=o[i],a}function n(){t=new WeakMap}return{get:e,dispose:n}}function Lzt(){const t={};return{get:function(e){if(t[e.id]!==void 0)return t[e.id];let n;switch(e.type){case"DirectionalLight":n={direction:new Se,color:new lr};break;case"SpotLight":n={position:new Se,direction:new Se,color:new lr,distance:0,coneCos:0,penumbraCos:0,decay:0};break;case"PointLight":n={position:new Se,color:new lr,distance:0,decay:0};break;case"HemisphereLight":n={direction:new Se,skyColor:new lr,groundColor:new lr};break;case"RectAreaLight":n={color:new lr,position:new Se,halfWidth:new Se,halfHeight:new Se};break}return t[e.id]=n,n}}}function Nzt(){const t={};return{get:function(e){if(t[e.id]!==void 0)return t[e.id];let n;switch(e.type){case"DirectionalLight":n={shadowBias:0,shadowNormalBias:0,shadowRadius:1,shadowMapSize:new qt};break;case"SpotLight":n={shadowBias:0,shadowNormalBias:0,shadowRadius:1,shadowMapSize:new qt};break;case"PointLight":n={shadowBias:0,shadowNormalBias:0,shadowRadius:1,shadowMapSize:new qt,shadowCameraNear:1,shadowCameraFar:1e3};break}return t[e.id]=n,n}}}let $zt=0;function Fzt(t,e){return(e.castShadow?2:0)-(t.castShadow?2:0)+(e.map?1:0)-(t.map?1:0)}function jzt(t,e){const n=new Lzt,r=Nzt(),i={version:0,hash:{directionalLength:-1,pointLength:-1,spotLength:-1,rectAreaLength:-1,hemiLength:-1,numDirectionalShadows:-1,numPointShadows:-1,numSpotShadows:-1,numSpotMaps:-1},ambient:[0,0,0],probe:[],directional:[],directionalShadow:[],directionalShadowMap:[],directionalShadowMatrix:[],spot:[],spotLightMap:[],spotShadow:[],spotShadowMap:[],spotLightMatrix:[],rectArea:[],rectAreaLTC1:null,rectAreaLTC2:null,point:[],pointShadow:[],pointShadowMap:[],pointShadowMatrix:[],hemi:[],numSpotLightShadowsWithMaps:0};for(let u=0;u<9;u++)i.probe.push(new Se);const o=new Se,a=new Hn,s=new Hn;function l(u,f){let d=0,h=0,p=0;for(let I=0;I<9;I++)i.probe[I].set(0,0,0);let m=0,g=0,v=0,y=0,x=0,b=0,_=0,S=0,O=0,C=0;u.sort(Fzt);const E=f!==!0?Math.PI:1;for(let I=0,P=u.length;I<P;I++){const R=u[I],T=R.color,L=R.intensity,z=R.distance,B=R.shadow&&R.shadow.map?R.shadow.map.texture:null;if(R.isAmbientLight)d+=T.r*L*E,h+=T.g*L*E,p+=T.b*L*E;else if(R.isLightProbe)for(let U=0;U<9;U++)i.probe[U].addScaledVector(R.sh.coefficients[U],L);else if(R.isDirectionalLight){const U=n.get(R);if(U.color.copy(R.color).multiplyScalar(R.intensity*E),R.castShadow){const W=R.shadow,$=r.get(R);$.shadowBias=W.bias,$.shadowNormalBias=W.normalBias,$.shadowRadius=W.radius,$.shadowMapSize=W.mapSize,i.directionalShadow[m]=$,i.directionalShadowMap[m]=B,i.directionalShadowMatrix[m]=R.shadow.matrix,b++}i.directional[m]=U,m++}else if(R.isSpotLight){const U=n.get(R);U.position.setFromMatrixPosition(R.matrixWorld),U.color.copy(T).multiplyScalar(L*E),U.distance=z,U.coneCos=Math.cos(R.angle),U.penumbraCos=Math.cos(R.angle*(1-R.penumbra)),U.decay=R.decay,i.spot[v]=U;const W=R.shadow;if(R.map&&(i.spotLightMap[O]=R.map,O++,W.updateMatrices(R),R.castShadow&&C++),i.spotLightMatrix[v]=W.matrix,R.castShadow){const $=r.get(R);$.shadowBias=W.bias,$.shadowNormalBias=W.normalBias,$.shadowRadius=W.radius,$.shadowMapSize=W.mapSize,i.spotShadow[v]=$,i.spotShadowMap[v]=B,S++}v++}else if(R.isRectAreaLight){const U=n.get(R);U.color.copy(T).multiplyScalar(L),U.halfWidth.set(R.width*.5,0,0),U.halfHeight.set(0,R.height*.5,0),i.rectArea[y]=U,y++}else if(R.isPointLight){const U=n.get(R);if(U.color.copy(R.color).multiplyScalar(R.intensity*E),U.distance=R.distance,U.decay=R.decay,R.castShadow){const W=R.shadow,$=r.get(R);$.shadowBias=W.bias,$.shadowNormalBias=W.normalBias,$.shadowRadius=W.radius,$.shadowMapSize=W.mapSize,$.shadowCameraNear=W.camera.near,$.shadowCameraFar=W.camera.far,i.pointShadow[g]=$,i.pointShadowMap[g]=B,i.pointShadowMatrix[g]=R.shadow.matrix,_++}i.point[g]=U,g++}else if(R.isHemisphereLight){const U=n.get(R);U.skyColor.copy(R.color).multiplyScalar(L*E),U.groundColor.copy(R.groundColor).multiplyScalar(L*E),i.hemi[x]=U,x++}}y>0&&(e.isWebGL2||t.has("OES_texture_float_linear")===!0?(i.rectAreaLTC1=Je.LTC_FLOAT_1,i.rectAreaLTC2=Je.LTC_FLOAT_2):t.has("OES_texture_half_float_linear")===!0?(i.rectAreaLTC1=Je.LTC_HALF_1,i.rectAreaLTC2=Je.LTC_HALF_2):console.error("THREE.WebGLRenderer: Unable to use RectAreaLight. Missing WebGL extensions.")),i.ambient[0]=d,i.ambient[1]=h,i.ambient[2]=p;const k=i.hash;(k.directionalLength!==m||k.pointLength!==g||k.spotLength!==v||k.rectAreaLength!==y||k.hemiLength!==x||k.numDirectionalShadows!==b||k.numPointShadows!==_||k.numSpotShadows!==S||k.numSpotMaps!==O)&&(i.directional.length=m,i.spot.length=v,i.rectArea.length=y,i.point.length=g,i.hemi.length=x,i.directionalShadow.length=b,i.directionalShadowMap.length=b,i.pointShadow.length=_,i.pointShadowMap.length=_,i.spotShadow.length=S,i.spotShadowMap.length=S,i.directionalShadowMatrix.length=b,i.pointShadowMatrix.length=_,i.spotLightMatrix.length=S+O-C,i.spotLightMap.length=O,i.numSpotLightShadowsWithMaps=C,k.directionalLength=m,k.pointLength=g,k.spotLength=v,k.rectAreaLength=y,k.hemiLength=x,k.numDirectionalShadows=b,k.numPointShadows=_,k.numSpotShadows=S,k.numSpotMaps=O,i.version=$zt++)}function c(u,f){let d=0,h=0,p=0,m=0,g=0;const v=f.matrixWorldInverse;for(let y=0,x=u.length;y<x;y++){const b=u[y];if(b.isDirectionalLight){const _=i.directional[d];_.direction.setFromMatrixPosition(b.matrixWorld),o.setFromMatrixPosition(b.target.matrixWorld),_.direction.sub(o),_.direction.transformDirection(v),d++}else if(b.isSpotLight){const _=i.spot[p];_.position.setFromMatrixPosition(b.matrixWorld),_.position.applyMatrix4(v),_.direction.setFromMatrixPosition(b.matrixWorld),o.setFromMatrixPosition(b.target.matrixWorld),_.direction.sub(o),_.direction.transformDirection(v),p++}else if(b.isRectAreaLight){const _=i.rectArea[m];_.position.setFromMatrixPosition(b.matrixWorld),_.position.applyMatrix4(v),s.identity(),a.copy(b.matrixWorld),a.premultiply(v),s.extractRotation(a),_.halfWidth.set(b.width*.5,0,0),_.halfHeight.set(0,b.height*.5,0),_.halfWidth.applyMatrix4(s),_.halfHeight.applyMatrix4(s),m++}else if(b.isPointLight){const _=i.point[h];_.position.setFromMatrixPosition(b.matrixWorld),_.position.applyMatrix4(v),h++}else if(b.isHemisphereLight){const _=i.hemi[g];_.direction.setFromMatrixPosition(b.matrixWorld),_.direction.transformDirection(v),g++}}}return{setup:l,setupView:c,state:i}}function bJ(t,e){const n=new jzt(t,e),r=[],i=[];function o(){r.length=0,i.length=0}function a(f){r.push(f)}function s(f){i.push(f)}function l(f){n.setup(r,f)}function c(f){n.setupView(r,f)}return{init:o,state:{lightsArray:r,shadowsArray:i,lights:n},setupLights:l,setupLightsView:c,pushLight:a,pushShadow:s}}function Bzt(t,e){let n=new WeakMap;function r(o,a=0){const s=n.get(o);let l;return s===void 0?(l=new bJ(t,e),n.set(o,[l])):a>=s.length?(l=new bJ(t,e),s.push(l)):l=s[a],l}function i(){n=new WeakMap}return{get:r,dispose:i}}class zzt extends $w{constructor(e){super(),this.isMeshDepthMaterial=!0,this.type="MeshDepthMaterial",this.depthPacking=nFt,this.map=null,this.alphaMap=null,this.displacementMap=null,this.displacementScale=1,this.displacementBias=0,this.wireframe=!1,this.wireframeLinewidth=1,this.setValues(e)}copy(e){return super.copy(e),this.depthPacking=e.depthPacking,this.map=e.map,this.alphaMap=e.alphaMap,this.displacementMap=e.displacementMap,this.displacementScale=e.displacementScale,this.displacementBias=e.displacementBias,this.wireframe=e.wireframe,this.wireframeLinewidth=e.wireframeLinewidth,this}}class Uzt extends $w{constructor(e){super(),this.isMeshDistanceMaterial=!0,this.type="MeshDistanceMaterial",this.referencePosition=new Se,this.nearDistance=1,this.farDistance=1e3,this.map=null,this.alphaMap=null,this.displacementMap=null,this.displacementScale=1,this.displacementBias=0,this.setValues(e)}copy(e){return super.copy(e),this.referencePosition.copy(e.referencePosition),this.nearDistance=e.nearDistance,this.farDistance=e.farDistance,this.map=e.map,this.alphaMap=e.alphaMap,this.displacementMap=e.displacementMap,this.displacementScale=e.displacementScale,this.displacementBias=e.displacementBias,this}}const Wzt=`void main() {
	gl_Position = vec4( position, 1.0 );
}`,Vzt=`uniform sampler2D shadow_pass;
uniform vec2 resolution;
uniform float radius;
#include <packing>
void main() {
	const float samples = float( VSM_SAMPLES );
	float mean = 0.0;
	float squared_mean = 0.0;
	float uvStride = samples <= 1.0 ? 0.0 : 2.0 / ( samples - 1.0 );
	float uvStart = samples <= 1.0 ? 0.0 : - 1.0;
	for ( float i = 0.0; i < samples; i ++ ) {
		float uvOffset = uvStart + i * uvStride;
		#ifdef HORIZONTAL_PASS
			vec2 distribution = unpackRGBATo2Half( texture2D( shadow_pass, ( gl_FragCoord.xy + vec2( uvOffset, 0.0 ) * radius ) / resolution ) );
			mean += distribution.x;
			squared_mean += distribution.y * distribution.y + distribution.x * distribution.x;
		#else
			float depth = unpackRGBAToDepth( texture2D( shadow_pass, ( gl_FragCoord.xy + vec2( 0.0, uvOffset ) * radius ) / resolution ) );
			mean += depth;
			squared_mean += depth * depth;
		#endif
	}
	mean = mean / samples;
	squared_mean = squared_mean / samples;
	float std_dev = sqrt( squared_mean - mean * mean );
	gl_FragColor = pack2HalfToRGBA( vec2( mean, std_dev ) );
}`;function Gzt(t,e,n){let r=new Iye;const i=new qt,o=new qt,a=new Ri,s=new zzt({depthPacking:rFt}),l=new Uzt,c={},u=n.maxTextureSize,f={0:_a,1:Lv,2:Yc},d=new ud({defines:{VSM_SAMPLES:8},uniforms:{shadow_pass:{value:null},resolution:{value:new qt},radius:{value:4}},vertexShader:Wzt,fragmentShader:Vzt}),h=d.clone();h.defines.HORIZONTAL_PASS=1;const p=new Eu;p.setAttribute("position",new as(new Float32Array([-1,-1,.5,3,-1,.5,-1,3,.5]),3));const m=new Bl(p,d),g=this;this.enabled=!1,this.autoUpdate=!0,this.needsUpdate=!1,this.type=hye,this.render=function(b,_,S){if(g.enabled===!1||g.autoUpdate===!1&&g.needsUpdate===!1||b.length===0)return;const O=t.getRenderTarget(),C=t.getActiveCubeFace(),E=t.getActiveMipmapLevel(),k=t.state;k.setBlending(Hf),k.buffers.color.setClear(1,1,1,1),k.buffers.depth.setTest(!0),k.setScissorTest(!1);for(let I=0,P=b.length;I<P;I++){const R=b[I],T=R.shadow;if(T===void 0){console.warn("THREE.WebGLShadowMap:",R,"has no shadow.");continue}if(T.autoUpdate===!1&&T.needsUpdate===!1)continue;i.copy(T.mapSize);const L=T.getFrameExtents();if(i.multiply(L),o.copy(T.mapSize),(i.x>u||i.y>u)&&(i.x>u&&(o.x=Math.floor(u/L.x),i.x=o.x*L.x,T.mapSize.x=o.x),i.y>u&&(o.y=Math.floor(u/L.y),i.y=o.y*L.y,T.mapSize.y=o.y)),T.map===null){const B=this.type!==wx?{minFilter:Eo,magFilter:Eo}:{};T.map=new bp(i.x,i.y,B),T.map.texture.name=R.name+".shadowMap",T.camera.updateProjectionMatrix()}t.setRenderTarget(T.map),t.clear();const z=T.getViewportCount();for(let B=0;B<z;B++){const U=T.getViewport(B);a.set(o.x*U.x,o.y*U.y,o.x*U.z,o.y*U.w),k.viewport(a),T.updateMatrices(R,B),r=T.getFrustum(),x(_,S,T.camera,R,this.type)}T.isPointLightShadow!==!0&&this.type===wx&&v(T,S),T.needsUpdate=!1}g.needsUpdate=!1,t.setRenderTarget(O,C,E)};function v(b,_){const S=e.update(m);d.defines.VSM_SAMPLES!==b.blurSamples&&(d.defines.VSM_SAMPLES=b.blurSamples,h.defines.VSM_SAMPLES=b.blurSamples,d.needsUpdate=!0,h.needsUpdate=!0),b.mapPass===null&&(b.mapPass=new bp(i.x,i.y)),d.uniforms.shadow_pass.value=b.map.texture,d.uniforms.resolution.value=b.mapSize,d.uniforms.radius.value=b.radius,t.setRenderTarget(b.mapPass),t.clear(),t.renderBufferDirect(_,null,S,d,m,null),h.uniforms.shadow_pass.value=b.mapPass.texture,h.uniforms.resolution.value=b.mapSize,h.uniforms.radius.value=b.radius,t.setRenderTarget(b.map),t.clear(),t.renderBufferDirect(_,null,S,h,m,null)}function y(b,_,S,O,C,E){let k=null;const I=S.isPointLight===!0?b.customDistanceMaterial:b.customDepthMaterial;if(I!==void 0?k=I:k=S.isPointLight===!0?l:s,t.localClippingEnabled&&_.clipShadows===!0&&Array.isArray(_.clippingPlanes)&&_.clippingPlanes.length!==0||_.displacementMap&&_.displacementScale!==0||_.alphaMap&&_.alphaTest>0){const P=k.uuid,R=_.uuid;let T=c[P];T===void 0&&(T={},c[P]=T);let L=T[R];L===void 0&&(L=k.clone(),T[R]=L),k=L}return k.visible=_.visible,k.wireframe=_.wireframe,E===wx?k.side=_.shadowSide!==null?_.shadowSide:_.side:k.side=_.shadowSide!==null?_.shadowSide:f[_.side],k.alphaMap=_.alphaMap,k.alphaTest=_.alphaTest,k.clipShadows=_.clipShadows,k.clippingPlanes=_.clippingPlanes,k.clipIntersection=_.clipIntersection,k.displacementMap=_.displacementMap,k.displacementScale=_.displacementScale,k.displacementBias=_.displacementBias,k.wireframeLinewidth=_.wireframeLinewidth,k.linewidth=_.linewidth,S.isPointLight===!0&&k.isMeshDistanceMaterial===!0&&(k.referencePosition.setFromMatrixPosition(S.matrixWorld),k.nearDistance=O,k.farDistance=C),k}function x(b,_,S,O,C){if(b.visible===!1)return;if(b.layers.test(_.layers)&&(b.isMesh||b.isLine||b.isPoints)&&(b.castShadow||b.receiveShadow&&C===wx)&&(!b.frustumCulled||r.intersectsObject(b))){b.modelViewMatrix.multiplyMatrices(S.matrixWorldInverse,b.matrixWorld);const I=e.update(b),P=b.material;if(Array.isArray(P)){const R=I.groups;for(let T=0,L=R.length;T<L;T++){const z=R[T],B=P[z.materialIndex];if(B&&B.visible){const U=y(b,B,O,S.near,S.far,C);t.renderBufferDirect(S,null,I,U,b,z)}}}else if(P.visible){const R=y(b,P,O,S.near,S.far,C);t.renderBufferDirect(S,null,I,R,b,null)}}const k=b.children;for(let I=0,P=k.length;I<P;I++)x(k[I],_,S,O,C)}}function Hzt(t,e,n){const r=n.isWebGL2;function i(){let ae=!1;const Le=new Ri;let Ee=null;const ze=new Ri(0,0,0,0);return{setMask:function(He){Ee!==He&&!ae&&(t.colorMask(He,He,He,He),Ee=He)},setLocked:function(He){ae=He},setClear:function(He,xt,Dt,nn,Xr){Xr===!0&&(He*=nn,xt*=nn,Dt*=nn),Le.set(He,xt,Dt,nn),ze.equals(Le)===!1&&(t.clearColor(He,xt,Dt,nn),ze.copy(Le))},reset:function(){ae=!1,Ee=null,ze.set(-1,0,0,0)}}}function o(){let ae=!1,Le=null,Ee=null,ze=null;return{setTest:function(He){He?se(2929):te(2929)},setMask:function(He){Le!==He&&!ae&&(t.depthMask(He),Le=He)},setFunc:function(He){if(Ee!==He){if(He)switch(He){case E$t:t.depthFunc(512);break;case P$t:t.depthFunc(519);break;case M$t:t.depthFunc(513);break;case wF:t.depthFunc(515);break;case k$t:t.depthFunc(514);break;case A$t:t.depthFunc(518);break;case R$t:t.depthFunc(516);break;case I$t:t.depthFunc(517);break;default:t.depthFunc(515)}else t.depthFunc(515);Ee=He}},setLocked:function(He){ae=He},setClear:function(He){ze!==He&&(t.clearDepth(He),ze=He)},reset:function(){ae=!1,Le=null,Ee=null,ze=null}}}function a(){let ae=!1,Le=null,Ee=null,ze=null,He=null,xt=null,Dt=null,nn=null,Xr=null;return{setTest:function(Cn){ae||(Cn?se(2960):te(2960))},setMask:function(Cn){Le!==Cn&&!ae&&(t.stencilMask(Cn),Le=Cn)},setFunc:function(Cn,Qr,ir){(Ee!==Cn||ze!==Qr||He!==ir)&&(t.stencilFunc(Cn,Qr,ir),Ee=Cn,ze=Qr,He=ir)},setOp:function(Cn,Qr,ir){(xt!==Cn||Dt!==Qr||nn!==ir)&&(t.stencilOp(Cn,Qr,ir),xt=Cn,Dt=Qr,nn=ir)},setLocked:function(Cn){ae=Cn},setClear:function(Cn){Xr!==Cn&&(t.clearStencil(Cn),Xr=Cn)},reset:function(){ae=!1,Le=null,Ee=null,ze=null,He=null,xt=null,Dt=null,nn=null,Xr=null}}}const s=new i,l=new o,c=new a,u=new WeakMap,f=new WeakMap;let d={},h={},p=new WeakMap,m=[],g=null,v=!1,y=null,x=null,b=null,_=null,S=null,O=null,C=null,E=!1,k=null,I=null,P=null,R=null,T=null;const L=t.getParameter(35661);let z=!1,B=0;const U=t.getParameter(7938);U.indexOf("WebGL")!==-1?(B=parseFloat(/^WebGL (\d)/.exec(U)[1]),z=B>=1):U.indexOf("OpenGL ES")!==-1&&(B=parseFloat(/^OpenGL ES (\d)/.exec(U)[1]),z=B>=2);let W=null,$={};const N=t.getParameter(3088),D=t.getParameter(2978),A=new Ri().fromArray(N),q=new Ri().fromArray(D);function Y(ae,Le,Ee){const ze=new Uint8Array(4),He=t.createTexture();t.bindTexture(ae,He),t.texParameteri(ae,10241,9728),t.texParameteri(ae,10240,9728);for(let xt=0;xt<Ee;xt++)t.texImage2D(Le+xt,0,6408,1,1,0,6408,5121,ze);return He}const K={};K[3553]=Y(3553,3553,1),K[34067]=Y(34067,34069,6),s.setClear(0,0,0,1),l.setClear(1),c.setClear(0),se(2929),l.setFunc(wF),le(!1),Q(cZ),se(2884),F(Hf);function se(ae){d[ae]!==!0&&(t.enable(ae),d[ae]=!0)}function te(ae){d[ae]!==!1&&(t.disable(ae),d[ae]=!1)}function J(ae,Le){return h[ae]!==Le?(t.bindFramebuffer(ae,Le),h[ae]=Le,r&&(ae===36009&&(h[36160]=Le),ae===36160&&(h[36009]=Le)),!0):!1}function pe(ae,Le){let Ee=m,ze=!1;if(ae)if(Ee=p.get(Le),Ee===void 0&&(Ee=[],p.set(Le,Ee)),ae.isWebGLMultipleRenderTargets){const He=ae.texture;if(Ee.length!==He.length||Ee[0]!==36064){for(let xt=0,Dt=He.length;xt<Dt;xt++)Ee[xt]=36064+xt;Ee.length=He.length,ze=!0}}else Ee[0]!==36064&&(Ee[0]=36064,ze=!0);else Ee[0]!==1029&&(Ee[0]=1029,ze=!0);ze&&(n.isWebGL2?t.drawBuffers(Ee):e.get("WEBGL_draw_buffers").drawBuffersWEBGL(Ee))}function be(ae){return g!==ae?(t.useProgram(ae),g=ae,!0):!1}const re={[Vm]:32774,[g$t]:32778,[v$t]:32779};if(r)re[hZ]=32775,re[pZ]=32776;else{const ae=e.get("EXT_blend_minmax");ae!==null&&(re[hZ]=ae.MIN_EXT,re[pZ]=ae.MAX_EXT)}const ve={[y$t]:0,[x$t]:1,[b$t]:768,[pye]:770,[T$t]:776,[O$t]:774,[w$t]:772,[_$t]:769,[mye]:771,[C$t]:775,[S$t]:773};function F(ae,Le,Ee,ze,He,xt,Dt,nn){if(ae===Hf){v===!0&&(te(3042),v=!1);return}if(v===!1&&(se(3042),v=!0),ae!==m$t){if(ae!==y||nn!==E){if((x!==Vm||S!==Vm)&&(t.blendEquation(32774),x=Vm,S=Vm),nn)switch(ae){case Bg:t.blendFuncSeparate(1,771,1,771);break;case uZ:t.blendFunc(1,1);break;case fZ:t.blendFuncSeparate(0,769,0,1);break;case dZ:t.blendFuncSeparate(0,768,0,770);break;default:console.error("THREE.WebGLState: Invalid blending: ",ae);break}else switch(ae){case Bg:t.blendFuncSeparate(770,771,1,771);break;case uZ:t.blendFunc(770,1);break;case fZ:t.blendFuncSeparate(0,769,0,1);break;case dZ:t.blendFunc(0,768);break;default:console.error("THREE.WebGLState: Invalid blending: ",ae);break}b=null,_=null,O=null,C=null,y=ae,E=nn}return}He=He||Le,xt=xt||Ee,Dt=Dt||ze,(Le!==x||He!==S)&&(t.blendEquationSeparate(re[Le],re[He]),x=Le,S=He),(Ee!==b||ze!==_||xt!==O||Dt!==C)&&(t.blendFuncSeparate(ve[Ee],ve[ze],ve[xt],ve[Dt]),b=Ee,_=ze,O=xt,C=Dt),y=ae,E=null}function ce(ae,Le){ae.side===Yc?te(2884):se(2884);let Ee=ae.side===_a;Le&&(Ee=!Ee),le(Ee),ae.blending===Bg&&ae.transparent===!1?F(Hf):F(ae.blending,ae.blendEquation,ae.blendSrc,ae.blendDst,ae.blendEquationAlpha,ae.blendSrcAlpha,ae.blendDstAlpha,ae.premultipliedAlpha),l.setFunc(ae.depthFunc),l.setTest(ae.depthTest),l.setMask(ae.depthWrite),s.setMask(ae.colorWrite);const ze=ae.stencilWrite;c.setTest(ze),ze&&(c.setMask(ae.stencilWriteMask),c.setFunc(ae.stencilFunc,ae.stencilRef,ae.stencilFuncMask),c.setOp(ae.stencilFail,ae.stencilZFail,ae.stencilZPass)),ee(ae.polygonOffset,ae.polygonOffsetFactor,ae.polygonOffsetUnits),ae.alphaToCoverage===!0?se(32926):te(32926)}function le(ae){k!==ae&&(ae?t.frontFace(2304):t.frontFace(2305),k=ae)}function Q(ae){ae!==d$t?(se(2884),ae!==I&&(ae===cZ?t.cullFace(1029):ae===h$t?t.cullFace(1028):t.cullFace(1032))):te(2884),I=ae}function X(ae){ae!==P&&(z&&t.lineWidth(ae),P=ae)}function ee(ae,Le,Ee){ae?(se(32823),(R!==Le||T!==Ee)&&(t.polygonOffset(Le,Ee),R=Le,T=Ee)):te(32823)}function ge(ae){ae?se(3089):te(3089)}function ye(ae){ae===void 0&&(ae=33984+L-1),W!==ae&&(t.activeTexture(ae),W=ae)}function H(ae,Le){W===null&&ye();let Ee=$[W];Ee===void 0&&(Ee={type:void 0,texture:void 0},$[W]=Ee),(Ee.type!==ae||Ee.texture!==Le)&&(t.bindTexture(ae,Le||K[ae]),Ee.type=ae,Ee.texture=Le)}function G(){const ae=$[W];ae!==void 0&&ae.type!==void 0&&(t.bindTexture(ae.type,null),ae.type=void 0,ae.texture=void 0)}function ie(){try{t.compressedTexImage2D.apply(t,arguments)}catch(ae){console.error("THREE.WebGLState:",ae)}}function he(){try{t.texSubImage2D.apply(t,arguments)}catch(ae){console.error("THREE.WebGLState:",ae)}}function _e(){try{t.texSubImage3D.apply(t,arguments)}catch(ae){console.error("THREE.WebGLState:",ae)}}function oe(){try{t.compressedTexSubImage2D.apply(t,arguments)}catch(ae){console.error("THREE.WebGLState:",ae)}}function Z(){try{t.texStorage2D.apply(t,arguments)}catch(ae){console.error("THREE.WebGLState:",ae)}}function V(){try{t.texStorage3D.apply(t,arguments)}catch(ae){console.error("THREE.WebGLState:",ae)}}function de(){try{t.texImage2D.apply(t,arguments)}catch(ae){console.error("THREE.WebGLState:",ae)}}function xe(){try{t.texImage3D.apply(t,arguments)}catch(ae){console.error("THREE.WebGLState:",ae)}}function Me(ae){A.equals(ae)===!1&&(t.scissor(ae.x,ae.y,ae.z,ae.w),A.copy(ae))}function me(ae){q.equals(ae)===!1&&(t.viewport(ae.x,ae.y,ae.z,ae.w),q.copy(ae))}function $e(ae,Le){let Ee=f.get(Le);Ee===void 0&&(Ee=new WeakMap,f.set(Le,Ee));let ze=Ee.get(ae);ze===void 0&&(ze=t.getUniformBlockIndex(Le,ae.name),Ee.set(ae,ze))}function Te(ae,Le){const ze=f.get(Le).get(ae);u.get(ae)!==ze&&(t.uniformBlockBinding(Le,ze,ae.__bindingPointIndex),u.set(ae,ze))}function Re(){t.disable(3042),t.disable(2884),t.disable(2929),t.disable(32823),t.disable(3089),t.disable(2960),t.disable(32926),t.blendEquation(32774),t.blendFunc(1,0),t.blendFuncSeparate(1,0,1,0),t.colorMask(!0,!0,!0,!0),t.clearColor(0,0,0,0),t.depthMask(!0),t.depthFunc(513),t.clearDepth(1),t.stencilMask(4294967295),t.stencilFunc(519,0,4294967295),t.stencilOp(7680,7680,7680),t.clearStencil(0),t.cullFace(1029),t.frontFace(2305),t.polygonOffset(0,0),t.activeTexture(33984),t.bindFramebuffer(36160,null),r===!0&&(t.bindFramebuffer(36009,null),t.bindFramebuffer(36008,null)),t.useProgram(null),t.lineWidth(1),t.scissor(0,0,t.canvas.width,t.canvas.height),t.viewport(0,0,t.canvas.width,t.canvas.height),d={},W=null,$={},h={},p=new WeakMap,m=[],g=null,v=!1,y=null,x=null,b=null,_=null,S=null,O=null,C=null,E=!1,k=null,I=null,P=null,R=null,T=null,A.set(0,0,t.canvas.width,t.canvas.height),q.set(0,0,t.canvas.width,t.canvas.height),s.reset(),l.reset(),c.reset()}return{buffers:{color:s,depth:l,stencil:c},enable:se,disable:te,bindFramebuffer:J,drawBuffers:pe,useProgram:be,setBlending:F,setMaterial:ce,setFlipSided:le,setCullFace:Q,setLineWidth:X,setPolygonOffset:ee,setScissorTest:ge,activeTexture:ye,bindTexture:H,unbindTexture:G,compressedTexImage2D:ie,texImage2D:de,texImage3D:xe,updateUBOMapping:$e,uniformBlockBinding:Te,texStorage2D:Z,texStorage3D:V,texSubImage2D:he,texSubImage3D:_e,compressedTexSubImage2D:oe,scissor:Me,viewport:me,reset:Re}}function qzt(t,e,n,r,i,o,a){const s=i.isWebGL2,l=i.maxTextures,c=i.maxCubemapSize,u=i.maxTextureSize,f=i.maxSamples,d=e.has("WEBGL_multisampled_render_to_texture")?e.get("WEBGL_multisampled_render_to_texture"):null,h=/OculusBrowser/g.test(navigator.userAgent),p=new WeakMap;let m;const g=new WeakMap;let v=!1;try{v=typeof OffscreenCanvas<"u"&&new OffscreenCanvas(1,1).getContext("2d")!==null}catch{}function y(H,G){return v?new OffscreenCanvas(H,G):a1("canvas")}function x(H,G,ie,he){let _e=1;if((H.width>he||H.height>he)&&(_e=he/Math.max(H.width,H.height)),_e<1||G===!0)if(typeof HTMLImageElement<"u"&&H instanceof HTMLImageElement||typeof HTMLCanvasElement<"u"&&H instanceof HTMLCanvasElement||typeof ImageBitmap<"u"&&H instanceof ImageBitmap){const oe=G?PF:Math.floor,Z=oe(_e*H.width),V=oe(_e*H.height);m===void 0&&(m=y(Z,V));const de=ie?y(Z,V):m;return de.width=Z,de.height=V,de.getContext("2d").drawImage(H,0,0,Z,V),console.warn("THREE.WebGLRenderer: Texture has been resized from ("+H.width+"x"+H.height+") to ("+Z+"x"+V+")."),de}else return"data"in H&&console.warn("THREE.WebGLRenderer: Image in DataTexture is too big ("+H.width+"x"+H.height+")."),H;return H}function b(H){return zZ(H.width)&&zZ(H.height)}function _(H){return s?!1:H.wrapS!==qa||H.wrapT!==qa||H.minFilter!==Eo&&H.minFilter!==Po}function S(H,G){return H.generateMipmaps&&G&&H.minFilter!==Eo&&H.minFilter!==Po}function O(H){t.generateMipmap(H)}function C(H,G,ie,he,_e=!1){if(s===!1)return G;if(H!==null){if(t[H]!==void 0)return t[H];console.warn("THREE.WebGLRenderer: Attempt to use non-existing WebGL internal format '"+H+"'")}let oe=G;return G===6403&&(ie===5126&&(oe=33326),ie===5131&&(oe=33325),ie===5121&&(oe=33321)),G===33319&&(ie===5126&&(oe=33328),ie===5131&&(oe=33327),ie===5121&&(oe=33323)),G===6408&&(ie===5126&&(oe=34836),ie===5131&&(oe=34842),ie===5121&&(oe=he===yr&&_e===!1?35907:32856),ie===32819&&(oe=32854),ie===32820&&(oe=32855)),(oe===33325||oe===33326||oe===33327||oe===33328||oe===34842||oe===34836)&&e.get("EXT_color_buffer_float"),oe}function E(H,G,ie){return S(H,ie)===!0||H.isFramebufferTexture&&H.minFilter!==Eo&&H.minFilter!==Po?Math.log2(Math.max(G.width,G.height))+1:H.mipmaps!==void 0&&H.mipmaps.length>0?H.mipmaps.length:H.isCompressedTexture&&Array.isArray(H.image)?G.mipmaps.length:1}function k(H){return H===Eo||H===mZ||H===gZ?9728:9729}function I(H){const G=H.target;G.removeEventListener("dispose",I),R(G),G.isVideoTexture&&p.delete(G)}function P(H){const G=H.target;G.removeEventListener("dispose",P),L(G)}function R(H){const G=r.get(H);if(G.__webglInit===void 0)return;const ie=H.source,he=g.get(ie);if(he){const _e=he[G.__cacheKey];_e.usedTimes--,_e.usedTimes===0&&T(H),Object.keys(he).length===0&&g.delete(ie)}r.remove(H)}function T(H){const G=r.get(H);t.deleteTexture(G.__webglTexture);const ie=H.source,he=g.get(ie);delete he[G.__cacheKey],a.memory.textures--}function L(H){const G=H.texture,ie=r.get(H),he=r.get(G);if(he.__webglTexture!==void 0&&(t.deleteTexture(he.__webglTexture),a.memory.textures--),H.depthTexture&&H.depthTexture.dispose(),H.isWebGLCubeRenderTarget)for(let _e=0;_e<6;_e++)t.deleteFramebuffer(ie.__webglFramebuffer[_e]),ie.__webglDepthbuffer&&t.deleteRenderbuffer(ie.__webglDepthbuffer[_e]);else{if(t.deleteFramebuffer(ie.__webglFramebuffer),ie.__webglDepthbuffer&&t.deleteRenderbuffer(ie.__webglDepthbuffer),ie.__webglMultisampledFramebuffer&&t.deleteFramebuffer(ie.__webglMultisampledFramebuffer),ie.__webglColorRenderbuffer)for(let _e=0;_e<ie.__webglColorRenderbuffer.length;_e++)ie.__webglColorRenderbuffer[_e]&&t.deleteRenderbuffer(ie.__webglColorRenderbuffer[_e]);ie.__webglDepthRenderbuffer&&t.deleteRenderbuffer(ie.__webglDepthRenderbuffer)}if(H.isWebGLMultipleRenderTargets)for(let _e=0,oe=G.length;_e<oe;_e++){const Z=r.get(G[_e]);Z.__webglTexture&&(t.deleteTexture(Z.__webglTexture),a.memory.textures--),r.remove(G[_e])}r.remove(G),r.remove(H)}let z=0;function B(){z=0}function U(){const H=z;return H>=l&&console.warn("THREE.WebGLTextures: Trying to use "+H+" texture units while this GPU supports only "+l),z+=1,H}function W(H){const G=[];return G.push(H.wrapS),G.push(H.wrapT),G.push(H.magFilter),G.push(H.minFilter),G.push(H.anisotropy),G.push(H.internalFormat),G.push(H.format),G.push(H.type),G.push(H.generateMipmaps),G.push(H.premultiplyAlpha),G.push(H.flipY),G.push(H.unpackAlignment),G.push(H.encoding),G.join()}function $(H,G){const ie=r.get(H);if(H.isVideoTexture&&ge(H),H.isRenderTargetTexture===!1&&H.version>0&&ie.__version!==H.version){const he=H.image;if(he===null)console.warn("THREE.WebGLRenderer: Texture marked for update but no image data found.");else if(he.complete===!1)console.warn("THREE.WebGLRenderer: Texture marked for update but image is incomplete");else{te(ie,H,G);return}}n.activeTexture(33984+G),n.bindTexture(3553,ie.__webglTexture)}function N(H,G){const ie=r.get(H);if(H.version>0&&ie.__version!==H.version){te(ie,H,G);return}n.activeTexture(33984+G),n.bindTexture(35866,ie.__webglTexture)}function D(H,G){const ie=r.get(H);if(H.version>0&&ie.__version!==H.version){te(ie,H,G);return}n.activeTexture(33984+G),n.bindTexture(32879,ie.__webglTexture)}function A(H,G){const ie=r.get(H);if(H.version>0&&ie.__version!==H.version){J(ie,H,G);return}n.activeTexture(33984+G),n.bindTexture(34067,ie.__webglTexture)}const q={[CF]:10497,[qa]:33071,[TF]:33648},Y={[Eo]:9728,[mZ]:9984,[gZ]:9986,[Po]:9729,[z$t]:9985,[Lk]:9987};function K(H,G,ie){if(ie?(t.texParameteri(H,10242,q[G.wrapS]),t.texParameteri(H,10243,q[G.wrapT]),(H===32879||H===35866)&&t.texParameteri(H,32882,q[G.wrapR]),t.texParameteri(H,10240,Y[G.magFilter]),t.texParameteri(H,10241,Y[G.minFilter])):(t.texParameteri(H,10242,33071),t.texParameteri(H,10243,33071),(H===32879||H===35866)&&t.texParameteri(H,32882,33071),(G.wrapS!==qa||G.wrapT!==qa)&&console.warn("THREE.WebGLRenderer: Texture is not power of two. Texture.wrapS and Texture.wrapT should be set to THREE.ClampToEdgeWrapping."),t.texParameteri(H,10240,k(G.magFilter)),t.texParameteri(H,10241,k(G.minFilter)),G.minFilter!==Eo&&G.minFilter!==Po&&console.warn("THREE.WebGLRenderer: Texture is not power of two. Texture.minFilter should be set to THREE.NearestFilter or THREE.LinearFilter.")),e.has("EXT_texture_filter_anisotropic")===!0){const he=e.get("EXT_texture_filter_anisotropic");if(G.type===Mf&&e.has("OES_texture_float_linear")===!1||s===!1&&G.type===o1&&e.has("OES_texture_half_float_linear")===!1)return;(G.anisotropy>1||r.get(G).__currentAnisotropy)&&(t.texParameterf(H,he.TEXTURE_MAX_ANISOTROPY_EXT,Math.min(G.anisotropy,i.getMaxAnisotropy())),r.get(G).__currentAnisotropy=G.anisotropy)}}function se(H,G){let ie=!1;H.__webglInit===void 0&&(H.__webglInit=!0,G.addEventListener("dispose",I));const he=G.source;let _e=g.get(he);_e===void 0&&(_e={},g.set(he,_e));const oe=W(G);if(oe!==H.__cacheKey){_e[oe]===void 0&&(_e[oe]={texture:t.createTexture(),usedTimes:0},a.memory.textures++,ie=!0),_e[oe].usedTimes++;const Z=_e[H.__cacheKey];Z!==void 0&&(_e[H.__cacheKey].usedTimes--,Z.usedTimes===0&&T(G)),H.__cacheKey=oe,H.__webglTexture=_e[oe].texture}return ie}function te(H,G,ie){let he=3553;G.isDataArrayTexture&&(he=35866),G.isData3DTexture&&(he=32879);const _e=se(H,G),oe=G.source;if(n.activeTexture(33984+ie),n.bindTexture(he,H.__webglTexture),oe.version!==oe.__currentVersion||_e===!0){t.pixelStorei(37440,G.flipY),t.pixelStorei(37441,G.premultiplyAlpha),t.pixelStorei(3317,G.unpackAlignment),t.pixelStorei(37443,0);const Z=_(G)&&b(G.image)===!1;let V=x(G.image,Z,!1,u);V=ye(G,V);const de=b(V)||s,xe=o.convert(G.format,G.encoding);let Me=o.convert(G.type),me=C(G.internalFormat,xe,Me,G.encoding,G.isVideoTexture);K(he,G,de);let $e;const Te=G.mipmaps,Re=s&&G.isVideoTexture!==!0,ae=oe.__currentVersion===void 0||_e===!0,Le=E(G,V,de);if(G.isDepthTexture)me=6402,s?G.type===Mf?me=36012:G.type===kh?me=33190:G.type===zg?me=35056:me=33189:G.type===Mf&&console.error("WebGLRenderer: Floating point depth texture requires WebGL2."),G.format===Hh&&me===6402&&G.type!==yye&&G.type!==kh&&(console.warn("THREE.WebGLRenderer: Use UnsignedShortType or UnsignedIntType for DepthFormat DepthTexture."),G.type=kh,Me=o.convert(G.type)),G.format===Fv&&me===6402&&(me=34041,G.type!==zg&&(console.warn("THREE.WebGLRenderer: Use UnsignedInt248Type for DepthStencilFormat DepthTexture."),G.type=zg,Me=o.convert(G.type))),ae&&(Re?n.texStorage2D(3553,1,me,V.width,V.height):n.texImage2D(3553,0,me,V.width,V.height,0,xe,Me,null));else if(G.isDataTexture)if(Te.length>0&&de){Re&&ae&&n.texStorage2D(3553,Le,me,Te[0].width,Te[0].height);for(let Ee=0,ze=Te.length;Ee<ze;Ee++)$e=Te[Ee],Re?n.texSubImage2D(3553,Ee,0,0,$e.width,$e.height,xe,Me,$e.data):n.texImage2D(3553,Ee,me,$e.width,$e.height,0,xe,Me,$e.data);G.generateMipmaps=!1}else Re?(ae&&n.texStorage2D(3553,Le,me,V.width,V.height),n.texSubImage2D(3553,0,0,0,V.width,V.height,xe,Me,V.data)):n.texImage2D(3553,0,me,V.width,V.height,0,xe,Me,V.data);else if(G.isCompressedTexture){Re&&ae&&n.texStorage2D(3553,Le,me,Te[0].width,Te[0].height);for(let Ee=0,ze=Te.length;Ee<ze;Ee++)$e=Te[Ee],G.format!==jl?xe!==null?Re?n.compressedTexSubImage2D(3553,Ee,0,0,$e.width,$e.height,xe,$e.data):n.compressedTexImage2D(3553,Ee,me,$e.width,$e.height,0,$e.data):console.warn("THREE.WebGLRenderer: Attempt to load unsupported compressed texture format in .uploadTexture()"):Re?n.texSubImage2D(3553,Ee,0,0,$e.width,$e.height,xe,Me,$e.data):n.texImage2D(3553,Ee,me,$e.width,$e.height,0,xe,Me,$e.data)}else if(G.isDataArrayTexture)Re?(ae&&n.texStorage3D(35866,Le,me,V.width,V.height,V.depth),n.texSubImage3D(35866,0,0,0,0,V.width,V.height,V.depth,xe,Me,V.data)):n.texImage3D(35866,0,me,V.width,V.height,V.depth,0,xe,Me,V.data);else if(G.isData3DTexture)Re?(ae&&n.texStorage3D(32879,Le,me,V.width,V.height,V.depth),n.texSubImage3D(32879,0,0,0,0,V.width,V.height,V.depth,xe,Me,V.data)):n.texImage3D(32879,0,me,V.width,V.height,V.depth,0,xe,Me,V.data);else if(G.isFramebufferTexture){if(ae)if(Re)n.texStorage2D(3553,Le,me,V.width,V.height);else{let Ee=V.width,ze=V.height;for(let He=0;He<Le;He++)n.texImage2D(3553,He,me,Ee,ze,0,xe,Me,null),Ee>>=1,ze>>=1}}else if(Te.length>0&&de){Re&&ae&&n.texStorage2D(3553,Le,me,Te[0].width,Te[0].height);for(let Ee=0,ze=Te.length;Ee<ze;Ee++)$e=Te[Ee],Re?n.texSubImage2D(3553,Ee,0,0,xe,Me,$e):n.texImage2D(3553,Ee,me,xe,Me,$e);G.generateMipmaps=!1}else Re?(ae&&n.texStorage2D(3553,Le,me,V.width,V.height),n.texSubImage2D(3553,0,0,0,xe,Me,V)):n.texImage2D(3553,0,me,xe,Me,V);S(G,de)&&O(he),oe.__currentVersion=oe.version,G.onUpdate&&G.onUpdate(G)}H.__version=G.version}function J(H,G,ie){if(G.image.length!==6)return;const he=se(H,G),_e=G.source;if(n.activeTexture(33984+ie),n.bindTexture(34067,H.__webglTexture),_e.version!==_e.__currentVersion||he===!0){t.pixelStorei(37440,G.flipY),t.pixelStorei(37441,G.premultiplyAlpha),t.pixelStorei(3317,G.unpackAlignment),t.pixelStorei(37443,0);const oe=G.isCompressedTexture||G.image[0].isCompressedTexture,Z=G.image[0]&&G.image[0].isDataTexture,V=[];for(let Ee=0;Ee<6;Ee++)!oe&&!Z?V[Ee]=x(G.image[Ee],!1,!0,c):V[Ee]=Z?G.image[Ee].image:G.image[Ee],V[Ee]=ye(G,V[Ee]);const de=V[0],xe=b(de)||s,Me=o.convert(G.format,G.encoding),me=o.convert(G.type),$e=C(G.internalFormat,Me,me,G.encoding),Te=s&&G.isVideoTexture!==!0,Re=_e.__currentVersion===void 0||he===!0;let ae=E(G,de,xe);K(34067,G,xe);let Le;if(oe){Te&&Re&&n.texStorage2D(34067,ae,$e,de.width,de.height);for(let Ee=0;Ee<6;Ee++){Le=V[Ee].mipmaps;for(let ze=0;ze<Le.length;ze++){const He=Le[ze];G.format!==jl?Me!==null?Te?n.compressedTexSubImage2D(34069+Ee,ze,0,0,He.width,He.height,Me,He.data):n.compressedTexImage2D(34069+Ee,ze,$e,He.width,He.height,0,He.data):console.warn("THREE.WebGLRenderer: Attempt to load unsupported compressed texture format in .setTextureCube()"):Te?n.texSubImage2D(34069+Ee,ze,0,0,He.width,He.height,Me,me,He.data):n.texImage2D(34069+Ee,ze,$e,He.width,He.height,0,Me,me,He.data)}}}else{Le=G.mipmaps,Te&&Re&&(Le.length>0&&ae++,n.texStorage2D(34067,ae,$e,V[0].width,V[0].height));for(let Ee=0;Ee<6;Ee++)if(Z){Te?n.texSubImage2D(34069+Ee,0,0,0,V[Ee].width,V[Ee].height,Me,me,V[Ee].data):n.texImage2D(34069+Ee,0,$e,V[Ee].width,V[Ee].height,0,Me,me,V[Ee].data);for(let ze=0;ze<Le.length;ze++){const xt=Le[ze].image[Ee].image;Te?n.texSubImage2D(34069+Ee,ze+1,0,0,xt.width,xt.height,Me,me,xt.data):n.texImage2D(34069+Ee,ze+1,$e,xt.width,xt.height,0,Me,me,xt.data)}}else{Te?n.texSubImage2D(34069+Ee,0,0,0,Me,me,V[Ee]):n.texImage2D(34069+Ee,0,$e,Me,me,V[Ee]);for(let ze=0;ze<Le.length;ze++){const He=Le[ze];Te?n.texSubImage2D(34069+Ee,ze+1,0,0,Me,me,He.image[Ee]):n.texImage2D(34069+Ee,ze+1,$e,Me,me,He.image[Ee])}}}S(G,xe)&&O(34067),_e.__currentVersion=_e.version,G.onUpdate&&G.onUpdate(G)}H.__version=G.version}function pe(H,G,ie,he,_e){const oe=o.convert(ie.format,ie.encoding),Z=o.convert(ie.type),V=C(ie.internalFormat,oe,Z,ie.encoding);r.get(G).__hasExternalTextures||(_e===32879||_e===35866?n.texImage3D(_e,0,V,G.width,G.height,G.depth,0,oe,Z,null):n.texImage2D(_e,0,V,G.width,G.height,0,oe,Z,null)),n.bindFramebuffer(36160,H),ee(G)?d.framebufferTexture2DMultisampleEXT(36160,he,_e,r.get(ie).__webglTexture,0,X(G)):t.framebufferTexture2D(36160,he,_e,r.get(ie).__webglTexture,0),n.bindFramebuffer(36160,null)}function be(H,G,ie){if(t.bindRenderbuffer(36161,H),G.depthBuffer&&!G.stencilBuffer){let he=33189;if(ie||ee(G)){const _e=G.depthTexture;_e&&_e.isDepthTexture&&(_e.type===Mf?he=36012:_e.type===kh&&(he=33190));const oe=X(G);ee(G)?d.renderbufferStorageMultisampleEXT(36161,oe,he,G.width,G.height):t.renderbufferStorageMultisample(36161,oe,he,G.width,G.height)}else t.renderbufferStorage(36161,he,G.width,G.height);t.framebufferRenderbuffer(36160,36096,36161,H)}else if(G.depthBuffer&&G.stencilBuffer){const he=X(G);ie&&ee(G)===!1?t.renderbufferStorageMultisample(36161,he,35056,G.width,G.height):ee(G)?d.renderbufferStorageMultisampleEXT(36161,he,35056,G.width,G.height):t.renderbufferStorage(36161,34041,G.width,G.height),t.framebufferRenderbuffer(36160,33306,36161,H)}else{const he=G.isWebGLMultipleRenderTargets===!0?G.texture:[G.texture];for(let _e=0;_e<he.length;_e++){const oe=he[_e],Z=o.convert(oe.format,oe.encoding),V=o.convert(oe.type),de=C(oe.internalFormat,Z,V,oe.encoding),xe=X(G);ie&&ee(G)===!1?t.renderbufferStorageMultisample(36161,xe,de,G.width,G.height):ee(G)?d.renderbufferStorageMultisampleEXT(36161,xe,de,G.width,G.height):t.renderbufferStorage(36161,de,G.width,G.height)}}t.bindRenderbuffer(36161,null)}function re(H,G){if(G&&G.isWebGLCubeRenderTarget)throw new Error("Depth Texture with cube render targets is not supported");if(n.bindFramebuffer(36160,H),!(G.depthTexture&&G.depthTexture.isDepthTexture))throw new Error("renderTarget.depthTexture must be an instance of THREE.DepthTexture");(!r.get(G.depthTexture).__webglTexture||G.depthTexture.image.width!==G.width||G.depthTexture.image.height!==G.height)&&(G.depthTexture.image.width=G.width,G.depthTexture.image.height=G.height,G.depthTexture.needsUpdate=!0),$(G.depthTexture,0);const he=r.get(G.depthTexture).__webglTexture,_e=X(G);if(G.depthTexture.format===Hh)ee(G)?d.framebufferTexture2DMultisampleEXT(36160,36096,3553,he,0,_e):t.framebufferTexture2D(36160,36096,3553,he,0);else if(G.depthTexture.format===Fv)ee(G)?d.framebufferTexture2DMultisampleEXT(36160,33306,3553,he,0,_e):t.framebufferTexture2D(36160,33306,3553,he,0);else throw new Error("Unknown depthTexture format")}function ve(H){const G=r.get(H),ie=H.isWebGLCubeRenderTarget===!0;if(H.depthTexture&&!G.__autoAllocateDepthBuffer){if(ie)throw new Error("target.depthTexture not supported in Cube render targets");re(G.__webglFramebuffer,H)}else if(ie){G.__webglDepthbuffer=[];for(let he=0;he<6;he++)n.bindFramebuffer(36160,G.__webglFramebuffer[he]),G.__webglDepthbuffer[he]=t.createRenderbuffer(),be(G.__webglDepthbuffer[he],H,!1)}else n.bindFramebuffer(36160,G.__webglFramebuffer),G.__webglDepthbuffer=t.createRenderbuffer(),be(G.__webglDepthbuffer,H,!1);n.bindFramebuffer(36160,null)}function F(H,G,ie){const he=r.get(H);G!==void 0&&pe(he.__webglFramebuffer,H,H.texture,36064,3553),ie!==void 0&&ve(H)}function ce(H){const G=H.texture,ie=r.get(H),he=r.get(G);H.addEventListener("dispose",P),H.isWebGLMultipleRenderTargets!==!0&&(he.__webglTexture===void 0&&(he.__webglTexture=t.createTexture()),he.__version=G.version,a.memory.textures++);const _e=H.isWebGLCubeRenderTarget===!0,oe=H.isWebGLMultipleRenderTargets===!0,Z=b(H)||s;if(_e){ie.__webglFramebuffer=[];for(let V=0;V<6;V++)ie.__webglFramebuffer[V]=t.createFramebuffer()}else{if(ie.__webglFramebuffer=t.createFramebuffer(),oe)if(i.drawBuffers){const V=H.texture;for(let de=0,xe=V.length;de<xe;de++){const Me=r.get(V[de]);Me.__webglTexture===void 0&&(Me.__webglTexture=t.createTexture(),a.memory.textures++)}}else console.warn("THREE.WebGLRenderer: WebGLMultipleRenderTargets can only be used with WebGL2 or WEBGL_draw_buffers extension.");if(s&&H.samples>0&&ee(H)===!1){const V=oe?G:[G];ie.__webglMultisampledFramebuffer=t.createFramebuffer(),ie.__webglColorRenderbuffer=[],n.bindFramebuffer(36160,ie.__webglMultisampledFramebuffer);for(let de=0;de<V.length;de++){const xe=V[de];ie.__webglColorRenderbuffer[de]=t.createRenderbuffer(),t.bindRenderbuffer(36161,ie.__webglColorRenderbuffer[de]);const Me=o.convert(xe.format,xe.encoding),me=o.convert(xe.type),$e=C(xe.internalFormat,Me,me,xe.encoding),Te=X(H);t.renderbufferStorageMultisample(36161,Te,$e,H.width,H.height),t.framebufferRenderbuffer(36160,36064+de,36161,ie.__webglColorRenderbuffer[de])}t.bindRenderbuffer(36161,null),H.depthBuffer&&(ie.__webglDepthRenderbuffer=t.createRenderbuffer(),be(ie.__webglDepthRenderbuffer,H,!0)),n.bindFramebuffer(36160,null)}}if(_e){n.bindTexture(34067,he.__webglTexture),K(34067,G,Z);for(let V=0;V<6;V++)pe(ie.__webglFramebuffer[V],H,G,36064,34069+V);S(G,Z)&&O(34067),n.unbindTexture()}else if(oe){const V=H.texture;for(let de=0,xe=V.length;de<xe;de++){const Me=V[de],me=r.get(Me);n.bindTexture(3553,me.__webglTexture),K(3553,Me,Z),pe(ie.__webglFramebuffer,H,Me,36064+de,3553),S(Me,Z)&&O(3553)}n.unbindTexture()}else{let V=3553;(H.isWebGL3DRenderTarget||H.isWebGLArrayRenderTarget)&&(s?V=H.isWebGL3DRenderTarget?32879:35866:console.error("THREE.WebGLTextures: THREE.Data3DTexture and THREE.DataArrayTexture only supported with WebGL2.")),n.bindTexture(V,he.__webglTexture),K(V,G,Z),pe(ie.__webglFramebuffer,H,G,36064,V),S(G,Z)&&O(V),n.unbindTexture()}H.depthBuffer&&ve(H)}function le(H){const G=b(H)||s,ie=H.isWebGLMultipleRenderTargets===!0?H.texture:[H.texture];for(let he=0,_e=ie.length;he<_e;he++){const oe=ie[he];if(S(oe,G)){const Z=H.isWebGLCubeRenderTarget?34067:3553,V=r.get(oe).__webglTexture;n.bindTexture(Z,V),O(Z),n.unbindTexture()}}}function Q(H){if(s&&H.samples>0&&ee(H)===!1){const G=H.isWebGLMultipleRenderTargets?H.texture:[H.texture],ie=H.width,he=H.height;let _e=16384;const oe=[],Z=H.stencilBuffer?33306:36096,V=r.get(H),de=H.isWebGLMultipleRenderTargets===!0;if(de)for(let xe=0;xe<G.length;xe++)n.bindFramebuffer(36160,V.__webglMultisampledFramebuffer),t.framebufferRenderbuffer(36160,36064+xe,36161,null),n.bindFramebuffer(36160,V.__webglFramebuffer),t.framebufferTexture2D(36009,36064+xe,3553,null,0);n.bindFramebuffer(36008,V.__webglMultisampledFramebuffer),n.bindFramebuffer(36009,V.__webglFramebuffer);for(let xe=0;xe<G.length;xe++){oe.push(36064+xe),H.depthBuffer&&oe.push(Z);const Me=V.__ignoreDepthValues!==void 0?V.__ignoreDepthValues:!1;if(Me===!1&&(H.depthBuffer&&(_e|=256),H.stencilBuffer&&(_e|=1024)),de&&t.framebufferRenderbuffer(36008,36064,36161,V.__webglColorRenderbuffer[xe]),Me===!0&&(t.invalidateFramebuffer(36008,[Z]),t.invalidateFramebuffer(36009,[Z])),de){const me=r.get(G[xe]).__webglTexture;t.framebufferTexture2D(36009,36064,3553,me,0)}t.blitFramebuffer(0,0,ie,he,0,0,ie,he,_e,9728),h&&t.invalidateFramebuffer(36008,oe)}if(n.bindFramebuffer(36008,null),n.bindFramebuffer(36009,null),de)for(let xe=0;xe<G.length;xe++){n.bindFramebuffer(36160,V.__webglMultisampledFramebuffer),t.framebufferRenderbuffer(36160,36064+xe,36161,V.__webglColorRenderbuffer[xe]);const Me=r.get(G[xe]).__webglTexture;n.bindFramebuffer(36160,V.__webglFramebuffer),t.framebufferTexture2D(36009,36064+xe,3553,Me,0)}n.bindFramebuffer(36009,V.__webglMultisampledFramebuffer)}}function X(H){return Math.min(f,H.samples)}function ee(H){const G=r.get(H);return s&&H.samples>0&&e.has("WEBGL_multisampled_render_to_texture")===!0&&G.__useRenderToTexture!==!1}function ge(H){const G=a.render.frame;p.get(H)!==G&&(p.set(H,G),H.update())}function ye(H,G){const ie=H.encoding,he=H.format,_e=H.type;return H.isCompressedTexture===!0||H.isVideoTexture===!0||H.format===EF||ie!==xp&&(ie===yr?s===!1?e.has("EXT_sRGB")===!0&&he===jl?(H.format=EF,H.minFilter=Po,H.generateMipmaps=!1):G=wye.sRGBToLinear(G):(he!==jl||_e!==yp)&&console.warn("THREE.WebGLTextures: sRGB encoded textures have to use RGBAFormat and UnsignedByteType."):console.error("THREE.WebGLTextures: Unsupported texture encoding:",ie)),G}this.allocateTextureUnit=U,this.resetTextureUnits=B,this.setTexture2D=$,this.setTexture2DArray=N,this.setTexture3D=D,this.setTextureCube=A,this.rebindTextures=F,this.setupRenderTarget=ce,this.updateRenderTargetMipmap=le,this.updateMultisampleRenderTarget=Q,this.setupDepthRenderbuffer=ve,this.setupFrameBufferTexture=pe,this.useMultisampledRTT=ee}function Xzt(t,e,n){const r=n.isWebGL2;function i(o,a=null){let s;if(o===yp)return 5121;if(o===G$t)return 32819;if(o===H$t)return 32820;if(o===U$t)return 5120;if(o===W$t)return 5122;if(o===yye)return 5123;if(o===V$t)return 5124;if(o===kh)return 5125;if(o===Mf)return 5126;if(o===o1)return r?5131:(s=e.get("OES_texture_half_float"),s!==null?s.HALF_FLOAT_OES:null);if(o===q$t)return 6406;if(o===jl)return 6408;if(o===Q$t)return 6409;if(o===Y$t)return 6410;if(o===Hh)return 6402;if(o===Fv)return 34041;if(o===xye)return 6403;if(o===X$t)return console.warn("THREE.WebGLRenderer: THREE.RGBFormat has been removed. Use THREE.RGBAFormat instead. https://github.com/mrdoob/three.js/pull/23228"),6408;if(o===EF)return s=e.get("EXT_sRGB"),s!==null?s.SRGB_ALPHA_EXT:null;if(o===K$t)return 36244;if(o===Z$t)return 33319;if(o===J$t)return 33320;if(o===eFt)return 36249;if(o===GI||o===HI||o===qI||o===XI)if(a===yr)if(s=e.get("WEBGL_compressed_texture_s3tc_srgb"),s!==null){if(o===GI)return s.COMPRESSED_SRGB_S3TC_DXT1_EXT;if(o===HI)return s.COMPRESSED_SRGB_ALPHA_S3TC_DXT1_EXT;if(o===qI)return s.COMPRESSED_SRGB_ALPHA_S3TC_DXT3_EXT;if(o===XI)return s.COMPRESSED_SRGB_ALPHA_S3TC_DXT5_EXT}else return null;else if(s=e.get("WEBGL_compressed_texture_s3tc"),s!==null){if(o===GI)return s.COMPRESSED_RGB_S3TC_DXT1_EXT;if(o===HI)return s.COMPRESSED_RGBA_S3TC_DXT1_EXT;if(o===qI)return s.COMPRESSED_RGBA_S3TC_DXT3_EXT;if(o===XI)return s.COMPRESSED_RGBA_S3TC_DXT5_EXT}else return null;if(o===vZ||o===yZ||o===xZ||o===bZ)if(s=e.get("WEBGL_compressed_texture_pvrtc"),s!==null){if(o===vZ)return s.COMPRESSED_RGB_PVRTC_4BPPV1_IMG;if(o===yZ)return s.COMPRESSED_RGB_PVRTC_2BPPV1_IMG;if(o===xZ)return s.COMPRESSED_RGBA_PVRTC_4BPPV1_IMG;if(o===bZ)return s.COMPRESSED_RGBA_PVRTC_2BPPV1_IMG}else return null;if(o===tFt)return s=e.get("WEBGL_compressed_texture_etc1"),s!==null?s.COMPRESSED_RGB_ETC1_WEBGL:null;if(o===_Z||o===wZ)if(s=e.get("WEBGL_compressed_texture_etc"),s!==null){if(o===_Z)return a===yr?s.COMPRESSED_SRGB8_ETC2:s.COMPRESSED_RGB8_ETC2;if(o===wZ)return a===yr?s.COMPRESSED_SRGB8_ALPHA8_ETC2_EAC:s.COMPRESSED_RGBA8_ETC2_EAC}else return null;if(o===SZ||o===OZ||o===CZ||o===TZ||o===EZ||o===PZ||o===MZ||o===kZ||o===AZ||o===RZ||o===IZ||o===DZ||o===LZ||o===NZ)if(s=e.get("WEBGL_compressed_texture_astc"),s!==null){if(o===SZ)return a===yr?s.COMPRESSED_SRGB8_ALPHA8_ASTC_4x4_KHR:s.COMPRESSED_RGBA_ASTC_4x4_KHR;if(o===OZ)return a===yr?s.COMPRESSED_SRGB8_ALPHA8_ASTC_5x4_KHR:s.COMPRESSED_RGBA_ASTC_5x4_KHR;if(o===CZ)return a===yr?s.COMPRESSED_SRGB8_ALPHA8_ASTC_5x5_KHR:s.COMPRESSED_RGBA_ASTC_5x5_KHR;if(o===TZ)return a===yr?s.COMPRESSED_SRGB8_ALPHA8_ASTC_6x5_KHR:s.COMPRESSED_RGBA_ASTC_6x5_KHR;if(o===EZ)return a===yr?s.COMPRESSED_SRGB8_ALPHA8_ASTC_6x6_KHR:s.COMPRESSED_RGBA_ASTC_6x6_KHR;if(o===PZ)return a===yr?s.COMPRESSED_SRGB8_ALPHA8_ASTC_8x5_KHR:s.COMPRESSED_RGBA_ASTC_8x5_KHR;if(o===MZ)return a===yr?s.COMPRESSED_SRGB8_ALPHA8_ASTC_8x6_KHR:s.COMPRESSED_RGBA_ASTC_8x6_KHR;if(o===kZ)return a===yr?s.COMPRESSED_SRGB8_ALPHA8_ASTC_8x8_KHR:s.COMPRESSED_RGBA_ASTC_8x8_KHR;if(o===AZ)return a===yr?s.COMPRESSED_SRGB8_ALPHA8_ASTC_10x5_KHR:s.COMPRESSED_RGBA_ASTC_10x5_KHR;if(o===RZ)return a===yr?s.COMPRESSED_SRGB8_ALPHA8_ASTC_10x6_KHR:s.COMPRESSED_RGBA_ASTC_10x6_KHR;if(o===IZ)return a===yr?s.COMPRESSED_SRGB8_ALPHA8_ASTC_10x8_KHR:s.COMPRESSED_RGBA_ASTC_10x8_KHR;if(o===DZ)return a===yr?s.COMPRESSED_SRGB8_ALPHA8_ASTC_10x10_KHR:s.COMPRESSED_RGBA_ASTC_10x10_KHR;if(o===LZ)return a===yr?s.COMPRESSED_SRGB8_ALPHA8_ASTC_12x10_KHR:s.COMPRESSED_RGBA_ASTC_12x10_KHR;if(o===NZ)return a===yr?s.COMPRESSED_SRGB8_ALPHA8_ASTC_12x12_KHR:s.COMPRESSED_RGBA_ASTC_12x12_KHR}else return null;if(o===$Z)if(s=e.get("EXT_texture_compression_bptc"),s!==null){if(o===$Z)return a===yr?s.COMPRESSED_SRGB_ALPHA_BPTC_UNORM_EXT:s.COMPRESSED_RGBA_BPTC_UNORM_EXT}else return null;return o===zg?r?34042:(s=e.get("WEBGL_depth_texture"),s!==null?s.UNSIGNED_INT_24_8_WEBGL:null):t[o]!==void 0?t[o]:null}return{convert:i}}class Qzt extends Us{constructor(e=[]){super(),this.isArrayCamera=!0,this.cameras=e}}class tC extends zo{constructor(){super(),this.isGroup=!0,this.type="Group"}}const Yzt={type:"move"};class wD{constructor(){this._targetRay=null,this._grip=null,this._hand=null}getHandSpace(){return this._hand===null&&(this._hand=new tC,this._hand.matrixAutoUpdate=!1,this._hand.visible=!1,this._hand.joints={},this._hand.inputState={pinching:!1}),this._hand}getTargetRaySpace(){return this._targetRay===null&&(this._targetRay=new tC,this._targetRay.matrixAutoUpdate=!1,this._targetRay.visible=!1,this._targetRay.hasLinearVelocity=!1,this._targetRay.linearVelocity=new Se,this._targetRay.hasAngularVelocity=!1,this._targetRay.angularVelocity=new Se),this._targetRay}getGripSpace(){return this._grip===null&&(this._grip=new tC,this._grip.matrixAutoUpdate=!1,this._grip.visible=!1,this._grip.hasLinearVelocity=!1,this._grip.linearVelocity=new Se,this._grip.hasAngularVelocity=!1,this._grip.angularVelocity=new Se),this._grip}dispatchEvent(e){return this._targetRay!==null&&this._targetRay.dispatchEvent(e),this._grip!==null&&this._grip.dispatchEvent(e),this._hand!==null&&this._hand.dispatchEvent(e),this}disconnect(e){return this.dispatchEvent({type:"disconnected",data:e}),this._targetRay!==null&&(this._targetRay.visible=!1),this._grip!==null&&(this._grip.visible=!1),this._hand!==null&&(this._hand.visible=!1),this}update(e,n,r){let i=null,o=null,a=null;const s=this._targetRay,l=this._grip,c=this._hand;if(e&&n.session.visibilityState!=="visible-blurred"){if(c&&e.hand){a=!0;for(const m of e.hand.values()){const g=n.getJointPose(m,r);if(c.joints[m.jointName]===void 0){const y=new tC;y.matrixAutoUpdate=!1,y.visible=!1,c.joints[m.jointName]=y,c.add(y)}const v=c.joints[m.jointName];g!==null&&(v.matrix.fromArray(g.transform.matrix),v.matrix.decompose(v.position,v.rotation,v.scale),v.jointRadius=g.radius),v.visible=g!==null}const u=c.joints["index-finger-tip"],f=c.joints["thumb-tip"],d=u.position.distanceTo(f.position),h=.02,p=.005;c.inputState.pinching&&d>h+p?(c.inputState.pinching=!1,this.dispatchEvent({type:"pinchend",handedness:e.handedness,target:this})):!c.inputState.pinching&&d<=h-p&&(c.inputState.pinching=!0,this.dispatchEvent({type:"pinchstart",handedness:e.handedness,target:this}))}else l!==null&&e.gripSpace&&(o=n.getPose(e.gripSpace,r),o!==null&&(l.matrix.fromArray(o.transform.matrix),l.matrix.decompose(l.position,l.rotation,l.scale),o.linearVelocity?(l.hasLinearVelocity=!0,l.linearVelocity.copy(o.linearVelocity)):l.hasLinearVelocity=!1,o.angularVelocity?(l.hasAngularVelocity=!0,l.angularVelocity.copy(o.angularVelocity)):l.hasAngularVelocity=!1));s!==null&&(i=n.getPose(e.targetRaySpace,r),i===null&&o!==null&&(i=o),i!==null&&(s.matrix.fromArray(i.transform.matrix),s.matrix.decompose(s.position,s.rotation,s.scale),i.linearVelocity?(s.hasLinearVelocity=!0,s.linearVelocity.copy(i.linearVelocity)):s.hasLinearVelocity=!1,i.angularVelocity?(s.hasAngularVelocity=!0,s.angularVelocity.copy(i.angularVelocity)):s.hasAngularVelocity=!1,this.dispatchEvent(Yzt)))}return s!==null&&(s.visible=i!==null),l!==null&&(l.visible=o!==null),c!==null&&(c.visible=a!==null),this}}class Kzt extends Ta{constructor(e,n,r,i,o,a,s,l,c,u){if(u=u!==void 0?u:Hh,u!==Hh&&u!==Fv)throw new Error("DepthTexture format must be either THREE.DepthFormat or THREE.DepthStencilFormat");r===void 0&&u===Hh&&(r=kh),r===void 0&&u===Fv&&(r=zg),super(null,i,o,a,s,l,u,r,c),this.isDepthTexture=!0,this.image={width:e,height:n},this.magFilter=s!==void 0?s:Eo,this.minFilter=l!==void 0?l:Eo,this.flipY=!1,this.generateMipmaps=!1}}class Zzt extends Hp{constructor(e,n){super();const r=this;let i=null,o=1,a=null,s="local-floor",l=null,c=null,u=null,f=null,d=null,h=null;const p=n.getContextAttributes();let m=null,g=null;const v=[],y=[],x=new Us;x.layers.enable(1),x.viewport=new Ri;const b=new Us;b.layers.enable(2),b.viewport=new Ri;const _=[x,b],S=new Qzt;S.layers.enable(1),S.layers.enable(2);let O=null,C=null;this.cameraAutoUpdate=!0,this.enabled=!1,this.isPresenting=!1,this.getController=function(W){let $=v[W];return $===void 0&&($=new wD,v[W]=$),$.getTargetRaySpace()},this.getControllerGrip=function(W){let $=v[W];return $===void 0&&($=new wD,v[W]=$),$.getGripSpace()},this.getHand=function(W){let $=v[W];return $===void 0&&($=new wD,v[W]=$),$.getHandSpace()};function E(W){const $=y.indexOf(W.inputSource);if($===-1)return;const N=v[$];N!==void 0&&N.dispatchEvent({type:W.type,data:W.inputSource})}function k(){i.removeEventListener("select",E),i.removeEventListener("selectstart",E),i.removeEventListener("selectend",E),i.removeEventListener("squeeze",E),i.removeEventListener("squeezestart",E),i.removeEventListener("squeezeend",E),i.removeEventListener("end",k),i.removeEventListener("inputsourceschange",I);for(let W=0;W<v.length;W++){const $=y[W];$!==null&&(y[W]=null,v[W].disconnect($))}O=null,C=null,e.setRenderTarget(m),d=null,f=null,u=null,i=null,g=null,U.stop(),r.isPresenting=!1,r.dispatchEvent({type:"sessionend"})}this.setFramebufferScaleFactor=function(W){o=W,r.isPresenting===!0&&console.warn("THREE.WebXRManager: Cannot change framebuffer scale while presenting.")},this.setReferenceSpaceType=function(W){s=W,r.isPresenting===!0&&console.warn("THREE.WebXRManager: Cannot change reference space type while presenting.")},this.getReferenceSpace=function(){return l||a},this.setReferenceSpace=function(W){l=W},this.getBaseLayer=function(){return f!==null?f:d},this.getBinding=function(){return u},this.getFrame=function(){return h},this.getSession=function(){return i},this.setSession=async function(W){if(i=W,i!==null){if(m=e.getRenderTarget(),i.addEventListener("select",E),i.addEventListener("selectstart",E),i.addEventListener("selectend",E),i.addEventListener("squeeze",E),i.addEventListener("squeezestart",E),i.addEventListener("squeezeend",E),i.addEventListener("end",k),i.addEventListener("inputsourceschange",I),p.xrCompatible!==!0&&await n.makeXRCompatible(),i.renderState.layers===void 0||e.capabilities.isWebGL2===!1){const $={antialias:i.renderState.layers===void 0?p.antialias:!0,alpha:p.alpha,depth:p.depth,stencil:p.stencil,framebufferScaleFactor:o};d=new XRWebGLLayer(i,n,$),i.updateRenderState({baseLayer:d}),g=new bp(d.framebufferWidth,d.framebufferHeight,{format:jl,type:yp,encoding:e.outputEncoding,stencilBuffer:p.stencil})}else{let $=null,N=null,D=null;p.depth&&(D=p.stencil?35056:33190,$=p.stencil?Fv:Hh,N=p.stencil?zg:kh);const A={colorFormat:32856,depthFormat:D,scaleFactor:o};u=new XRWebGLBinding(i,n),f=u.createProjectionLayer(A),i.updateRenderState({layers:[f]}),g=new bp(f.textureWidth,f.textureHeight,{format:jl,type:yp,depthTexture:new Kzt(f.textureWidth,f.textureHeight,N,void 0,void 0,void 0,void 0,void 0,void 0,$),stencilBuffer:p.stencil,encoding:e.outputEncoding,samples:p.antialias?4:0});const q=e.properties.get(g);q.__ignoreDepthValues=f.ignoreDepthValues}g.isXRRenderTarget=!0,this.setFoveation(1),l=null,a=await i.requestReferenceSpace(s),U.setContext(i),U.start(),r.isPresenting=!0,r.dispatchEvent({type:"sessionstart"})}};function I(W){for(let $=0;$<W.removed.length;$++){const N=W.removed[$],D=y.indexOf(N);D>=0&&(y[D]=null,v[D].dispatchEvent({type:"disconnected",data:N}))}for(let $=0;$<W.added.length;$++){const N=W.added[$];let D=y.indexOf(N);if(D===-1){for(let q=0;q<v.length;q++)if(q>=y.length){y.push(N),D=q;break}else if(y[q]===null){y[q]=N,D=q;break}if(D===-1)break}const A=v[D];A&&A.dispatchEvent({type:"connected",data:N})}}const P=new Se,R=new Se;function T(W,$,N){P.setFromMatrixPosition($.matrixWorld),R.setFromMatrixPosition(N.matrixWorld);const D=P.distanceTo(R),A=$.projectionMatrix.elements,q=N.projectionMatrix.elements,Y=A[14]/(A[10]-1),K=A[14]/(A[10]+1),se=(A[9]+1)/A[5],te=(A[9]-1)/A[5],J=(A[8]-1)/A[0],pe=(q[8]+1)/q[0],be=Y*J,re=Y*pe,ve=D/(-J+pe),F=ve*-J;$.matrixWorld.decompose(W.position,W.quaternion,W.scale),W.translateX(F),W.translateZ(ve),W.matrixWorld.compose(W.position,W.quaternion,W.scale),W.matrixWorldInverse.copy(W.matrixWorld).invert();const ce=Y+ve,le=K+ve,Q=be-F,X=re+(D-F),ee=se*K/le*ce,ge=te*K/le*ce;W.projectionMatrix.makePerspective(Q,X,ee,ge,ce,le)}function L(W,$){$===null?W.matrixWorld.copy(W.matrix):W.matrixWorld.multiplyMatrices($.matrixWorld,W.matrix),W.matrixWorldInverse.copy(W.matrixWorld).invert()}this.updateCamera=function(W){if(i===null)return;S.near=b.near=x.near=W.near,S.far=b.far=x.far=W.far,(O!==S.near||C!==S.far)&&(i.updateRenderState({depthNear:S.near,depthFar:S.far}),O=S.near,C=S.far);const $=W.parent,N=S.cameras;L(S,$);for(let A=0;A<N.length;A++)L(N[A],$);S.matrixWorld.decompose(S.position,S.quaternion,S.scale),W.matrix.copy(S.matrix),W.matrix.decompose(W.position,W.quaternion,W.scale);const D=W.children;for(let A=0,q=D.length;A<q;A++)D[A].updateMatrixWorld(!0);N.length===2?T(S,x,b):S.projectionMatrix.copy(x.projectionMatrix)},this.getCamera=function(){return S},this.getFoveation=function(){if(f!==null)return f.fixedFoveation;if(d!==null)return d.fixedFoveation},this.setFoveation=function(W){f!==null&&(f.fixedFoveation=W),d!==null&&d.fixedFoveation!==void 0&&(d.fixedFoveation=W)};let z=null;function B(W,$){if(c=$.getViewerPose(l||a),h=$,c!==null){const N=c.views;d!==null&&(e.setRenderTargetFramebuffer(g,d.framebuffer),e.setRenderTarget(g));let D=!1;N.length!==S.cameras.length&&(S.cameras.length=0,D=!0);for(let A=0;A<N.length;A++){const q=N[A];let Y=null;if(d!==null)Y=d.getViewport(q);else{const se=u.getViewSubImage(f,q);Y=se.viewport,A===0&&(e.setRenderTargetTextures(g,se.colorTexture,f.ignoreDepthValues?void 0:se.depthStencilTexture),e.setRenderTarget(g))}let K=_[A];K===void 0&&(K=new Us,K.layers.enable(A),K.viewport=new Ri,_[A]=K),K.matrix.fromArray(q.transform.matrix),K.projectionMatrix.fromArray(q.projectionMatrix),K.viewport.set(Y.x,Y.y,Y.width,Y.height),A===0&&S.matrix.copy(K.matrix),D===!0&&S.cameras.push(K)}}for(let N=0;N<v.length;N++){const D=y[N],A=v[N];D!==null&&A!==void 0&&A.update(D,$,l||a)}z&&z(W,$),h=null}const U=new Dye;U.setAnimationLoop(B),this.setAnimationLoop=function(W){z=W},this.dispose=function(){}}}function Jzt(t,e){function n(m,g){m.fogColor.value.copy(g.color),g.isFog?(m.fogNear.value=g.near,m.fogFar.value=g.far):g.isFogExp2&&(m.fogDensity.value=g.density)}function r(m,g,v,y,x){g.isMeshBasicMaterial||g.isMeshLambertMaterial?i(m,g):g.isMeshToonMaterial?(i(m,g),u(m,g)):g.isMeshPhongMaterial?(i(m,g),c(m,g)):g.isMeshStandardMaterial?(i(m,g),f(m,g),g.isMeshPhysicalMaterial&&d(m,g,x)):g.isMeshMatcapMaterial?(i(m,g),h(m,g)):g.isMeshDepthMaterial?i(m,g):g.isMeshDistanceMaterial?(i(m,g),p(m,g)):g.isMeshNormalMaterial?i(m,g):g.isLineBasicMaterial?(o(m,g),g.isLineDashedMaterial&&a(m,g)):g.isPointsMaterial?s(m,g,v,y):g.isSpriteMaterial?l(m,g):g.isShadowMaterial?(m.color.value.copy(g.color),m.opacity.value=g.opacity):g.isShaderMaterial&&(g.uniformsNeedUpdate=!1)}function i(m,g){m.opacity.value=g.opacity,g.color&&m.diffuse.value.copy(g.color),g.emissive&&m.emissive.value.copy(g.emissive).multiplyScalar(g.emissiveIntensity),g.map&&(m.map.value=g.map),g.alphaMap&&(m.alphaMap.value=g.alphaMap),g.bumpMap&&(m.bumpMap.value=g.bumpMap,m.bumpScale.value=g.bumpScale,g.side===_a&&(m.bumpScale.value*=-1)),g.displacementMap&&(m.displacementMap.value=g.displacementMap,m.displacementScale.value=g.displacementScale,m.displacementBias.value=g.displacementBias),g.emissiveMap&&(m.emissiveMap.value=g.emissiveMap),g.normalMap&&(m.normalMap.value=g.normalMap,m.normalScale.value.copy(g.normalScale),g.side===_a&&m.normalScale.value.negate()),g.specularMap&&(m.specularMap.value=g.specularMap),g.alphaTest>0&&(m.alphaTest.value=g.alphaTest);const v=e.get(g).envMap;if(v&&(m.envMap.value=v,m.flipEnvMap.value=v.isCubeTexture&&v.isRenderTargetTexture===!1?-1:1,m.reflectivity.value=g.reflectivity,m.ior.value=g.ior,m.refractionRatio.value=g.refractionRatio),g.lightMap){m.lightMap.value=g.lightMap;const b=t.physicallyCorrectLights!==!0?Math.PI:1;m.lightMapIntensity.value=g.lightMapIntensity*b}g.aoMap&&(m.aoMap.value=g.aoMap,m.aoMapIntensity.value=g.aoMapIntensity);let y;g.map?y=g.map:g.specularMap?y=g.specularMap:g.displacementMap?y=g.displacementMap:g.normalMap?y=g.normalMap:g.bumpMap?y=g.bumpMap:g.roughnessMap?y=g.roughnessMap:g.metalnessMap?y=g.metalnessMap:g.alphaMap?y=g.alphaMap:g.emissiveMap?y=g.emissiveMap:g.clearcoatMap?y=g.clearcoatMap:g.clearcoatNormalMap?y=g.clearcoatNormalMap:g.clearcoatRoughnessMap?y=g.clearcoatRoughnessMap:g.iridescenceMap?y=g.iridescenceMap:g.iridescenceThicknessMap?y=g.iridescenceThicknessMap:g.specularIntensityMap?y=g.specularIntensityMap:g.specularColorMap?y=g.specularColorMap:g.transmissionMap?y=g.transmissionMap:g.thicknessMap?y=g.thicknessMap:g.sheenColorMap?y=g.sheenColorMap:g.sheenRoughnessMap&&(y=g.sheenRoughnessMap),y!==void 0&&(y.isWebGLRenderTarget&&(y=y.texture),y.matrixAutoUpdate===!0&&y.updateMatrix(),m.uvTransform.value.copy(y.matrix));let x;g.aoMap?x=g.aoMap:g.lightMap&&(x=g.lightMap),x!==void 0&&(x.isWebGLRenderTarget&&(x=x.texture),x.matrixAutoUpdate===!0&&x.updateMatrix(),m.uv2Transform.value.copy(x.matrix))}function o(m,g){m.diffuse.value.copy(g.color),m.opacity.value=g.opacity}function a(m,g){m.dashSize.value=g.dashSize,m.totalSize.value=g.dashSize+g.gapSize,m.scale.value=g.scale}function s(m,g,v,y){m.diffuse.value.copy(g.color),m.opacity.value=g.opacity,m.size.value=g.size*v,m.scale.value=y*.5,g.map&&(m.map.value=g.map),g.alphaMap&&(m.alphaMap.value=g.alphaMap),g.alphaTest>0&&(m.alphaTest.value=g.alphaTest);let x;g.map?x=g.map:g.alphaMap&&(x=g.alphaMap),x!==void 0&&(x.matrixAutoUpdate===!0&&x.updateMatrix(),m.uvTransform.value.copy(x.matrix))}function l(m,g){m.diffuse.value.copy(g.color),m.opacity.value=g.opacity,m.rotation.value=g.rotation,g.map&&(m.map.value=g.map),g.alphaMap&&(m.alphaMap.value=g.alphaMap),g.alphaTest>0&&(m.alphaTest.value=g.alphaTest);let v;g.map?v=g.map:g.alphaMap&&(v=g.alphaMap),v!==void 0&&(v.matrixAutoUpdate===!0&&v.updateMatrix(),m.uvTransform.value.copy(v.matrix))}function c(m,g){m.specular.value.copy(g.specular),m.shininess.value=Math.max(g.shininess,1e-4)}function u(m,g){g.gradientMap&&(m.gradientMap.value=g.gradientMap)}function f(m,g){m.roughness.value=g.roughness,m.metalness.value=g.metalness,g.roughnessMap&&(m.roughnessMap.value=g.roughnessMap),g.metalnessMap&&(m.metalnessMap.value=g.metalnessMap),e.get(g).envMap&&(m.envMapIntensity.value=g.envMapIntensity)}function d(m,g,v){m.ior.value=g.ior,g.sheen>0&&(m.sheenColor.value.copy(g.sheenColor).multiplyScalar(g.sheen),m.sheenRoughness.value=g.sheenRoughness,g.sheenColorMap&&(m.sheenColorMap.value=g.sheenColorMap),g.sheenRoughnessMap&&(m.sheenRoughnessMap.value=g.sheenRoughnessMap)),g.clearcoat>0&&(m.clearcoat.value=g.clearcoat,m.clearcoatRoughness.value=g.clearcoatRoughness,g.clearcoatMap&&(m.clearcoatMap.value=g.clearcoatMap),g.clearcoatRoughnessMap&&(m.clearcoatRoughnessMap.value=g.clearcoatRoughnessMap),g.clearcoatNormalMap&&(m.clearcoatNormalScale.value.copy(g.clearcoatNormalScale),m.clearcoatNormalMap.value=g.clearcoatNormalMap,g.side===_a&&m.clearcoatNormalScale.value.negate())),g.iridescence>0&&(m.iridescence.value=g.iridescence,m.iridescenceIOR.value=g.iridescenceIOR,m.iridescenceThicknessMinimum.value=g.iridescenceThicknessRange[0],m.iridescenceThicknessMaximum.value=g.iridescenceThicknessRange[1],g.iridescenceMap&&(m.iridescenceMap.value=g.iridescenceMap),g.iridescenceThicknessMap&&(m.iridescenceThicknessMap.value=g.iridescenceThicknessMap)),g.transmission>0&&(m.transmission.value=g.transmission,m.transmissionSamplerMap.value=v.texture,m.transmissionSamplerSize.value.set(v.width,v.height),g.transmissionMap&&(m.transmissionMap.value=g.transmissionMap),m.thickness.value=g.thickness,g.thicknessMap&&(m.thicknessMap.value=g.thicknessMap),m.attenuationDistance.value=g.attenuationDistance,m.attenuationColor.value.copy(g.attenuationColor)),m.specularIntensity.value=g.specularIntensity,m.specularColor.value.copy(g.specularColor),g.specularIntensityMap&&(m.specularIntensityMap.value=g.specularIntensityMap),g.specularColorMap&&(m.specularColorMap.value=g.specularColorMap)}function h(m,g){g.matcap&&(m.matcap.value=g.matcap)}function p(m,g){m.referencePosition.value.copy(g.referencePosition),m.nearDistance.value=g.nearDistance,m.farDistance.value=g.farDistance}return{refreshFogUniforms:n,refreshMaterialUniforms:r}}function e4t(t,e,n,r){let i={},o={},a=[];const s=n.isWebGL2?t.getParameter(35375):0;function l(y,x){const b=x.program;r.uniformBlockBinding(y,b)}function c(y,x){let b=i[y.id];b===void 0&&(p(y),b=u(y),i[y.id]=b,y.addEventListener("dispose",g));const _=x.program;r.updateUBOMapping(y,_);const S=e.render.frame;o[y.id]!==S&&(d(y),o[y.id]=S)}function u(y){const x=f();y.__bindingPointIndex=x;const b=t.createBuffer(),_=y.__size,S=y.usage;return t.bindBuffer(35345,b),t.bufferData(35345,_,S),t.bindBuffer(35345,null),t.bindBufferBase(35345,x,b),b}function f(){for(let y=0;y<s;y++)if(a.indexOf(y)===-1)return a.push(y),y;return console.error("THREE.WebGLRenderer: Maximum number of simultaneously usable uniforms groups reached."),0}function d(y){const x=i[y.id],b=y.uniforms,_=y.__cache;t.bindBuffer(35345,x);for(let S=0,O=b.length;S<O;S++){const C=b[S];if(h(C,S,_)===!0){const E=C.value,k=C.__offset;typeof E=="number"?(C.__data[0]=E,t.bufferSubData(35345,k,C.__data)):(C.value.isMatrix3?(C.__data[0]=C.value.elements[0],C.__data[1]=C.value.elements[1],C.__data[2]=C.value.elements[2],C.__data[3]=C.value.elements[0],C.__data[4]=C.value.elements[3],C.__data[5]=C.value.elements[4],C.__data[6]=C.value.elements[5],C.__data[7]=C.value.elements[0],C.__data[8]=C.value.elements[6],C.__data[9]=C.value.elements[7],C.__data[10]=C.value.elements[8],C.__data[11]=C.value.elements[0]):E.toArray(C.__data),t.bufferSubData(35345,k,C.__data))}}t.bindBuffer(35345,null)}function h(y,x,b){const _=y.value;if(b[x]===void 0)return typeof _=="number"?b[x]=_:b[x]=_.clone(),!0;if(typeof _=="number"){if(b[x]!==_)return b[x]=_,!0}else{const S=b[x];if(S.equals(_)===!1)return S.copy(_),!0}return!1}function p(y){const x=y.uniforms;let b=0;const _=16;let S=0;for(let O=0,C=x.length;O<C;O++){const E=x[O],k=m(E);if(E.__data=new Float32Array(k.storage/Float32Array.BYTES_PER_ELEMENT),E.__offset=b,O>0){S=b%_;const I=_-S;S!==0&&I-k.boundary<0&&(b+=_-S,E.__offset=b)}b+=k.storage}return S=b%_,S>0&&(b+=_-S),y.__size=b,y.__cache={},this}function m(y){const x=y.value,b={boundary:0,storage:0};return typeof x=="number"?(b.boundary=4,b.storage=4):x.isVector2?(b.boundary=8,b.storage=8):x.isVector3||x.isColor?(b.boundary=16,b.storage=12):x.isVector4?(b.boundary=16,b.storage=16):x.isMatrix3?(b.boundary=48,b.storage=48):x.isMatrix4?(b.boundary=64,b.storage=64):x.isTexture?console.warn("THREE.WebGLRenderer: Texture samplers can not be part of an uniforms group."):console.warn("THREE.WebGLRenderer: Unsupported uniform value type.",x),b}function g(y){const x=y.target;x.removeEventListener("dispose",g);const b=a.indexOf(x.__bindingPointIndex);a.splice(b,1),t.deleteBuffer(i[x.id]),delete i[x.id],delete o[x.id]}function v(){for(const y in i)t.deleteBuffer(i[y]);a=[],i={},o={}}return{bind:l,update:c,dispose:v}}function t4t(){const t=a1("canvas");return t.style.display="block",t}function Bye(t={}){this.isWebGLRenderer=!0;const e=t.canvas!==void 0?t.canvas:t4t(),n=t.context!==void 0?t.context:null,r=t.depth!==void 0?t.depth:!0,i=t.stencil!==void 0?t.stencil:!0,o=t.antialias!==void 0?t.antialias:!1,a=t.premultipliedAlpha!==void 0?t.premultipliedAlpha:!0,s=t.preserveDrawingBuffer!==void 0?t.preserveDrawingBuffer:!1,l=t.powerPreference!==void 0?t.powerPreference:"default",c=t.failIfMajorPerformanceCaveat!==void 0?t.failIfMajorPerformanceCaveat:!1;let u;n!==null?u=n.getContextAttributes().alpha:u=t.alpha!==void 0?t.alpha:!1;let f=null,d=null;const h=[],p=[];this.domElement=e,this.debug={checkShaderErrors:!0},this.autoClear=!0,this.autoClearColor=!0,this.autoClearDepth=!0,this.autoClearStencil=!0,this.sortObjects=!0,this.clippingPlanes=[],this.localClippingEnabled=!1,this.outputEncoding=xp,this.physicallyCorrectLights=!1,this.toneMapping=su,this.toneMappingExposure=1,Object.defineProperties(this,{gammaFactor:{get:function(){return console.warn("THREE.WebGLRenderer: .gammaFactor has been removed."),2},set:function(){console.warn("THREE.WebGLRenderer: .gammaFactor has been removed.")}}});const m=this;let g=!1,v=0,y=0,x=null,b=-1,_=null;const S=new Ri,O=new Ri;let C=null,E=e.width,k=e.height,I=1,P=null,R=null;const T=new Ri(0,0,E,k),L=new Ri(0,0,E,k);let z=!1;const B=new Iye;let U=!1,W=!1,$=null;const N=new Hn,D=new qt,A=new Se,q={background:null,fog:null,environment:null,overrideMaterial:null,isScene:!0};function Y(){return x===null?I:1}let K=n;function se(ne,Pe){for(let Ie=0;Ie<ne.length;Ie++){const Oe=ne[Ie],Ne=e.getContext(Oe,Pe);if(Ne!==null)return Ne}return null}try{const ne={alpha:!0,depth:r,stencil:i,antialias:o,premultipliedAlpha:a,preserveDrawingBuffer:s,powerPreference:l,failIfMajorPerformanceCaveat:c};if("setAttribute"in e&&e.setAttribute("data-engine",`three.js r${S6}`),e.addEventListener("webglcontextlost",$e,!1),e.addEventListener("webglcontextrestored",Te,!1),e.addEventListener("webglcontextcreationerror",Re,!1),K===null){const Pe=["webgl2","webgl","experimental-webgl"];if(m.isWebGL1Renderer===!0&&Pe.shift(),K=se(Pe,ne),K===null)throw se(Pe)?new Error("Error creating WebGL context with your selected attributes."):new Error("Error creating WebGL context.")}K.getShaderPrecisionFormat===void 0&&(K.getShaderPrecisionFormat=function(){return{rangeMin:1,rangeMax:1,precision:1}})}catch(ne){throw console.error("THREE.WebGLRenderer: "+ne.message),ne}let te,J,pe,be,re,ve,F,ce,le,Q,X,ee,ge,ye,H,G,ie,he,_e,oe,Z,V,de,xe;function Me(){te=new dBt(K),J=new aBt(K,te,t),te.init(J),V=new Xzt(K,te,J),pe=new Hzt(K,te,J),be=new mBt,re=new Rzt,ve=new qzt(K,te,pe,re,J,V,be),F=new lBt(m),ce=new fBt(m),le=new TFt(K,J),de=new iBt(K,te,le,J),Q=new hBt(K,le,be,de),X=new xBt(K,Q,le,be),_e=new yBt(K,J,ve),G=new sBt(re),ee=new Azt(m,F,ce,te,J,de,G),ge=new Jzt(m,re),ye=new Dzt,H=new Bzt(te,J),he=new rBt(m,F,pe,X,u,a),ie=new Gzt(m,X,J),xe=new e4t(K,be,J,pe),oe=new oBt(K,te,be,J),Z=new pBt(K,te,be,J),be.programs=ee.programs,m.capabilities=J,m.extensions=te,m.properties=re,m.renderLists=ye,m.shadowMap=ie,m.state=pe,m.info=be}Me();const me=new Zzt(m,K);this.xr=me,this.getContext=function(){return K},this.getContextAttributes=function(){return K.getContextAttributes()},this.forceContextLoss=function(){const ne=te.get("WEBGL_lose_context");ne&&ne.loseContext()},this.forceContextRestore=function(){const ne=te.get("WEBGL_lose_context");ne&&ne.restoreContext()},this.getPixelRatio=function(){return I},this.setPixelRatio=function(ne){ne!==void 0&&(I=ne,this.setSize(E,k,!1))},this.getSize=function(ne){return ne.set(E,k)},this.setSize=function(ne,Pe,Ie){if(me.isPresenting){console.warn("THREE.WebGLRenderer: Can't change size while VR device is presenting.");return}E=ne,k=Pe,e.width=Math.floor(ne*I),e.height=Math.floor(Pe*I),Ie!==!1&&(e.style.width=ne+"px",e.style.height=Pe+"px"),this.setViewport(0,0,ne,Pe)},this.getDrawingBufferSize=function(ne){return ne.set(E*I,k*I).floor()},this.setDrawingBufferSize=function(ne,Pe,Ie){E=ne,k=Pe,I=Ie,e.width=Math.floor(ne*Ie),e.height=Math.floor(Pe*Ie),this.setViewport(0,0,ne,Pe)},this.getCurrentViewport=function(ne){return ne.copy(S)},this.getViewport=function(ne){return ne.copy(T)},this.setViewport=function(ne,Pe,Ie,Oe){ne.isVector4?T.set(ne.x,ne.y,ne.z,ne.w):T.set(ne,Pe,Ie,Oe),pe.viewport(S.copy(T).multiplyScalar(I).floor())},this.getScissor=function(ne){return ne.copy(L)},this.setScissor=function(ne,Pe,Ie,Oe){ne.isVector4?L.set(ne.x,ne.y,ne.z,ne.w):L.set(ne,Pe,Ie,Oe),pe.scissor(O.copy(L).multiplyScalar(I).floor())},this.getScissorTest=function(){return z},this.setScissorTest=function(ne){pe.setScissorTest(z=ne)},this.setOpaqueSort=function(ne){P=ne},this.setTransparentSort=function(ne){R=ne},this.getClearColor=function(ne){return ne.copy(he.getClearColor())},this.setClearColor=function(){he.setClearColor.apply(he,arguments)},this.getClearAlpha=function(){return he.getClearAlpha()},this.setClearAlpha=function(){he.setClearAlpha.apply(he,arguments)},this.clear=function(ne=!0,Pe=!0,Ie=!0){let Oe=0;ne&&(Oe|=16384),Pe&&(Oe|=256),Ie&&(Oe|=1024),K.clear(Oe)},this.clearColor=function(){this.clear(!0,!1,!1)},this.clearDepth=function(){this.clear(!1,!0,!1)},this.clearStencil=function(){this.clear(!1,!1,!0)},this.dispose=function(){e.removeEventListener("webglcontextlost",$e,!1),e.removeEventListener("webglcontextrestored",Te,!1),e.removeEventListener("webglcontextcreationerror",Re,!1),ye.dispose(),H.dispose(),re.dispose(),F.dispose(),ce.dispose(),X.dispose(),de.dispose(),xe.dispose(),ee.dispose(),me.dispose(),me.removeEventListener("sessionstart",xt),me.removeEventListener("sessionend",Dt),$&&($.dispose(),$=null),nn.stop()};function $e(ne){ne.preventDefault(),console.log("THREE.WebGLRenderer: Context Lost."),g=!0}function Te(){console.log("THREE.WebGLRenderer: Context Restored."),g=!1;const ne=be.autoReset,Pe=ie.enabled,Ie=ie.autoUpdate,Oe=ie.needsUpdate,Ne=ie.type;Me(),be.autoReset=ne,ie.enabled=Pe,ie.autoUpdate=Ie,ie.needsUpdate=Oe,ie.type=Ne}function Re(ne){console.error("THREE.WebGLRenderer: A WebGL context could not be created. Reason: ",ne.statusMessage)}function ae(ne){const Pe=ne.target;Pe.removeEventListener("dispose",ae),Le(Pe)}function Le(ne){Ee(ne),re.remove(ne)}function Ee(ne){const Pe=re.get(ne).programs;Pe!==void 0&&(Pe.forEach(function(Ie){ee.releaseProgram(Ie)}),ne.isShaderMaterial&&ee.releaseShaderCache(ne))}this.renderBufferDirect=function(ne,Pe,Ie,Oe,Ne,ot){Pe===null&&(Pe=q);const Ze=Ne.isMesh&&Ne.matrixWorld.determinant()<0,mt=al(ne,Pe,Ie,Oe,Ne);pe.setMaterial(Oe,Ze);let wt=Ie.index;const zt=Ie.attributes.position;if(wt===null){if(zt===void 0||zt.count===0)return}else if(wt.count===0)return;let Pt=1;Oe.wireframe===!0&&(wt=Q.getWireframeAttribute(Ie),Pt=2),de.setup(Ne,Oe,mt,Ie,wt);let st,Qt=oe;wt!==null&&(st=le.get(wt),Qt=Z,Qt.setIndex(st));const Ld=wt!==null?wt.count:zt.count,Xp=Ie.drawRange.start*Pt,Qp=Ie.drawRange.count*Pt,sl=ot!==null?ot.start*Pt:0,wn=ot!==null?ot.count*Pt:1/0,Yp=Math.max(Xp,sl),Ir=Math.min(Ld,Xp+Qp,sl+wn)-1,Aa=Math.max(0,Ir-Yp+1);if(Aa!==0){if(Ne.isMesh)Oe.wireframe===!0?(pe.setLineWidth(Oe.wireframeLinewidth*Y()),Qt.setMode(1)):Qt.setMode(4);else if(Ne.isLine){let Pu=Oe.linewidth;Pu===void 0&&(Pu=1),pe.setLineWidth(Pu*Y()),Ne.isLineSegments?Qt.setMode(1):Ne.isLineLoop?Qt.setMode(2):Qt.setMode(3)}else Ne.isPoints?Qt.setMode(0):Ne.isSprite&&Qt.setMode(4);if(Ne.isInstancedMesh)Qt.renderInstances(Yp,Aa,Ne.count);else if(Ie.isInstancedBufferGeometry){const Pu=Math.min(Ie.instanceCount,Ie._maxInstanceCount);Qt.renderInstances(Yp,Aa,Pu)}else Qt.render(Yp,Aa)}},this.compile=function(ne,Pe){function Ie(Oe,Ne,ot){Oe.transparent===!0&&Oe.side===Yc?(Oe.side=_a,Oe.needsUpdate=!0,yo(Oe,Ne,ot),Oe.side=Lv,Oe.needsUpdate=!0,yo(Oe,Ne,ot),Oe.side=Yc):yo(Oe,Ne,ot)}d=H.get(ne),d.init(),p.push(d),ne.traverseVisible(function(Oe){Oe.isLight&&Oe.layers.test(Pe.layers)&&(d.pushLight(Oe),Oe.castShadow&&d.pushShadow(Oe))}),d.setupLights(m.physicallyCorrectLights),ne.traverse(function(Oe){const Ne=Oe.material;if(Ne)if(Array.isArray(Ne))for(let ot=0;ot<Ne.length;ot++){const Ze=Ne[ot];Ie(Ze,ne,Oe)}else Ie(Ne,ne,Oe)}),p.pop(),d=null};let ze=null;function He(ne){ze&&ze(ne)}function xt(){nn.stop()}function Dt(){nn.start()}const nn=new Dye;nn.setAnimationLoop(He),typeof self<"u"&&nn.setContext(self),this.setAnimationLoop=function(ne){ze=ne,me.setAnimationLoop(ne),ne===null?nn.stop():nn.start()},me.addEventListener("sessionstart",xt),me.addEventListener("sessionend",Dt),this.render=function(ne,Pe){if(Pe!==void 0&&Pe.isCamera!==!0){console.error("THREE.WebGLRenderer.render: camera is not an instance of THREE.Camera.");return}if(g===!0)return;ne.matrixWorldAutoUpdate===!0&&ne.updateMatrixWorld(),Pe.parent===null&&Pe.matrixWorldAutoUpdate===!0&&Pe.updateMatrixWorld(),me.enabled===!0&&me.isPresenting===!0&&(me.cameraAutoUpdate===!0&&me.updateCamera(Pe),Pe=me.getCamera()),ne.isScene===!0&&ne.onBeforeRender(m,ne,Pe,x),d=H.get(ne,p.length),d.init(),p.push(d),N.multiplyMatrices(Pe.projectionMatrix,Pe.matrixWorldInverse),B.setFromProjectionMatrix(N),W=this.localClippingEnabled,U=G.init(this.clippingPlanes,W,Pe),f=ye.get(ne,h.length),f.init(),h.push(f),Xr(ne,Pe,0,m.sortObjects),f.finish(),m.sortObjects===!0&&f.sort(P,R),U===!0&&G.beginShadows();const Ie=d.state.shadowsArray;if(ie.render(Ie,ne,Pe),U===!0&&G.endShadows(),this.info.autoReset===!0&&this.info.reset(),he.render(f,ne),d.setupLights(m.physicallyCorrectLights),Pe.isArrayCamera){const Oe=Pe.cameras;for(let Ne=0,ot=Oe.length;Ne<ot;Ne++){const Ze=Oe[Ne];Cn(f,ne,Ze,Ze.viewport)}}else Cn(f,ne,Pe);x!==null&&(ve.updateMultisampleRenderTarget(x),ve.updateRenderTargetMipmap(x)),ne.isScene===!0&&ne.onAfterRender(m,ne,Pe),de.resetDefaultState(),b=-1,_=null,p.pop(),p.length>0?d=p[p.length-1]:d=null,h.pop(),h.length>0?f=h[h.length-1]:f=null};function Xr(ne,Pe,Ie,Oe){if(ne.visible===!1)return;if(ne.layers.test(Pe.layers)){if(ne.isGroup)Ie=ne.renderOrder;else if(ne.isLOD)ne.autoUpdate===!0&&ne.update(Pe);else if(ne.isLight)d.pushLight(ne),ne.castShadow&&d.pushShadow(ne);else if(ne.isSprite){if(!ne.frustumCulled||B.intersectsSprite(ne)){Oe&&A.setFromMatrixPosition(ne.matrixWorld).applyMatrix4(N);const Ze=X.update(ne),mt=ne.material;mt.visible&&f.push(ne,Ze,mt,Ie,A.z,null)}}else if((ne.isMesh||ne.isLine||ne.isPoints)&&(ne.isSkinnedMesh&&ne.skeleton.frame!==be.render.frame&&(ne.skeleton.update(),ne.skeleton.frame=be.render.frame),!ne.frustumCulled||B.intersectsObject(ne))){Oe&&A.setFromMatrixPosition(ne.matrixWorld).applyMatrix4(N);const Ze=X.update(ne),mt=ne.material;if(Array.isArray(mt)){const wt=Ze.groups;for(let zt=0,Pt=wt.length;zt<Pt;zt++){const st=wt[zt],Qt=mt[st.materialIndex];Qt&&Qt.visible&&f.push(ne,Ze,Qt,Ie,A.z,st)}}else mt.visible&&f.push(ne,Ze,mt,Ie,A.z,null)}}const ot=ne.children;for(let Ze=0,mt=ot.length;Ze<mt;Ze++)Xr(ot[Ze],Pe,Ie,Oe)}function Cn(ne,Pe,Ie,Oe){const Ne=ne.opaque,ot=ne.transmissive,Ze=ne.transparent;d.setupLightsView(Ie),ot.length>0&&Qr(Ne,Pe,Ie),Oe&&pe.viewport(S.copy(Oe)),Ne.length>0&&ir(Ne,Pe,Ie),ot.length>0&&ir(ot,Pe,Ie),Ze.length>0&&ir(Ze,Pe,Ie),pe.buffers.depth.setTest(!0),pe.buffers.depth.setMask(!0),pe.buffers.color.setMask(!0),pe.setPolygonOffset(!1)}function Qr(ne,Pe,Ie){const Oe=J.isWebGL2;$===null&&($=new bp(1,1,{generateMipmaps:!0,type:te.has("EXT_color_buffer_half_float")?o1:yp,minFilter:Lk,samples:Oe&&o===!0?4:0})),m.getDrawingBufferSize(D),Oe?$.setSize(D.x,D.y):$.setSize(PF(D.x),PF(D.y));const Ne=m.getRenderTarget();m.setRenderTarget($),m.clear();const ot=m.toneMapping;m.toneMapping=su,ir(ne,Pe,Ie),m.toneMapping=ot,ve.updateMultisampleRenderTarget($),ve.updateRenderTargetMipmap($),m.setRenderTarget(Ne)}function ir(ne,Pe,Ie){const Oe=Pe.isScene===!0?Pe.overrideMaterial:null;for(let Ne=0,ot=ne.length;Ne<ot;Ne++){const Ze=ne[Ne],mt=Ze.object,wt=Ze.geometry,zt=Oe===null?Ze.material:Oe,Pt=Ze.group;mt.layers.test(Ie.layers)&&to(mt,Pe,Ie,wt,zt,Pt)}}function to(ne,Pe,Ie,Oe,Ne,ot){ne.onBeforeRender(m,Pe,Ie,Oe,Ne,ot),ne.modelViewMatrix.multiplyMatrices(Ie.matrixWorldInverse,ne.matrixWorld),ne.normalMatrix.getNormalMatrix(ne.modelViewMatrix),Ne.onBeforeRender(m,Pe,Ie,Oe,ne,ot),Ne.transparent===!0&&Ne.side===Yc?(Ne.side=_a,Ne.needsUpdate=!0,m.renderBufferDirect(Ie,Pe,Oe,Ne,ne,ot),Ne.side=Lv,Ne.needsUpdate=!0,m.renderBufferDirect(Ie,Pe,Oe,Ne,ne,ot),Ne.side=Yc):m.renderBufferDirect(Ie,Pe,Oe,Ne,ne,ot),ne.onAfterRender(m,Pe,Ie,Oe,Ne,ot)}function yo(ne,Pe,Ie){Pe.isScene!==!0&&(Pe=q);const Oe=re.get(ne),Ne=d.state.lights,ot=d.state.shadowsArray,Ze=Ne.state.version,mt=ee.getParameters(ne,Ne.state,ot,Pe,Ie),wt=ee.getProgramCacheKey(mt);let zt=Oe.programs;Oe.environment=ne.isMeshStandardMaterial?Pe.environment:null,Oe.fog=Pe.fog,Oe.envMap=(ne.isMeshStandardMaterial?ce:F).get(ne.envMap||Oe.environment),zt===void 0&&(ne.addEventListener("dispose",ae),zt=new Map,Oe.programs=zt);let Pt=zt.get(wt);if(Pt!==void 0){if(Oe.currentProgram===Pt&&Oe.lightsStateVersion===Ze)return Xo(ne,mt),Pt}else mt.uniforms=ee.getUniforms(ne),ne.onBuild(Ie,mt,m),ne.onBeforeCompile(mt,m),Pt=ee.acquireProgram(mt,wt),zt.set(wt,Pt),Oe.uniforms=mt.uniforms;const st=Oe.uniforms;(!ne.isShaderMaterial&&!ne.isRawShaderMaterial||ne.clipping===!0)&&(st.clippingPlanes=G.uniform),Xo(ne,mt),Oe.needsLights=Ts(ne),Oe.lightsStateVersion=Ze,Oe.needsLights&&(st.ambientLightColor.value=Ne.state.ambient,st.lightProbe.value=Ne.state.probe,st.directionalLights.value=Ne.state.directional,st.directionalLightShadows.value=Ne.state.directionalShadow,st.spotLights.value=Ne.state.spot,st.spotLightShadows.value=Ne.state.spotShadow,st.rectAreaLights.value=Ne.state.rectArea,st.ltc_1.value=Ne.state.rectAreaLTC1,st.ltc_2.value=Ne.state.rectAreaLTC2,st.pointLights.value=Ne.state.point,st.pointLightShadows.value=Ne.state.pointShadow,st.hemisphereLights.value=Ne.state.hemi,st.directionalShadowMap.value=Ne.state.directionalShadowMap,st.directionalShadowMatrix.value=Ne.state.directionalShadowMatrix,st.spotShadowMap.value=Ne.state.spotShadowMap,st.spotLightMatrix.value=Ne.state.spotLightMatrix,st.spotLightMap.value=Ne.state.spotLightMap,st.pointShadowMap.value=Ne.state.pointShadowMap,st.pointShadowMatrix.value=Ne.state.pointShadowMatrix);const Qt=Pt.getUniforms(),Ld=KC.seqWithValue(Qt.seq,st);return Oe.currentProgram=Pt,Oe.uniformsList=Ld,Pt}function Xo(ne,Pe){const Ie=re.get(ne);Ie.outputEncoding=Pe.outputEncoding,Ie.instancing=Pe.instancing,Ie.skinning=Pe.skinning,Ie.morphTargets=Pe.morphTargets,Ie.morphNormals=Pe.morphNormals,Ie.morphColors=Pe.morphColors,Ie.morphTargetsCount=Pe.morphTargetsCount,Ie.numClippingPlanes=Pe.numClippingPlanes,Ie.numIntersection=Pe.numClipIntersection,Ie.vertexAlphas=Pe.vertexAlphas,Ie.vertexTangents=Pe.vertexTangents,Ie.toneMapping=Pe.toneMapping}function al(ne,Pe,Ie,Oe,Ne){Pe.isScene!==!0&&(Pe=q),ve.resetTextureUnits();const ot=Pe.fog,Ze=Oe.isMeshStandardMaterial?Pe.environment:null,mt=x===null?m.outputEncoding:x.isXRRenderTarget===!0?x.texture.encoding:xp,wt=(Oe.isMeshStandardMaterial?ce:F).get(Oe.envMap||Ze),zt=Oe.vertexColors===!0&&!!Ie.attributes.color&&Ie.attributes.color.itemSize===4,Pt=!!Oe.normalMap&&!!Ie.attributes.tangent,st=!!Ie.morphAttributes.position,Qt=!!Ie.morphAttributes.normal,Ld=!!Ie.morphAttributes.color,Xp=Oe.toneMapped?m.toneMapping:su,Qp=Ie.morphAttributes.position||Ie.morphAttributes.normal||Ie.morphAttributes.color,sl=Qp!==void 0?Qp.length:0,wn=re.get(Oe),Yp=d.state.lights;if(U===!0&&(W===!0||ne!==_)){const Qo=ne===_&&Oe.id===b;G.setState(Oe,ne,Qo)}let Ir=!1;Oe.version===wn.__version?(wn.needsLights&&wn.lightsStateVersion!==Yp.state.version||wn.outputEncoding!==mt||Ne.isInstancedMesh&&wn.instancing===!1||!Ne.isInstancedMesh&&wn.instancing===!0||Ne.isSkinnedMesh&&wn.skinning===!1||!Ne.isSkinnedMesh&&wn.skinning===!0||wn.envMap!==wt||Oe.fog===!0&&wn.fog!==ot||wn.numClippingPlanes!==void 0&&(wn.numClippingPlanes!==G.numPlanes||wn.numIntersection!==G.numIntersection)||wn.vertexAlphas!==zt||wn.vertexTangents!==Pt||wn.morphTargets!==st||wn.morphNormals!==Qt||wn.morphColors!==Ld||wn.toneMapping!==Xp||J.isWebGL2===!0&&wn.morphTargetsCount!==sl)&&(Ir=!0):(Ir=!0,wn.__version=Oe.version);let Aa=wn.currentProgram;Ir===!0&&(Aa=yo(Oe,Pe,Ne));let Pu=!1,Zy=!1,Gk=!1;const no=Aa.getUniforms(),Nd=wn.uniforms;if(pe.useProgram(Aa.program)&&(Pu=!0,Zy=!0,Gk=!0),Oe.id!==b&&(b=Oe.id,Zy=!0),Pu||_!==ne){if(no.setValue(K,"projectionMatrix",ne.projectionMatrix),J.logarithmicDepthBuffer&&no.setValue(K,"logDepthBufFC",2/(Math.log(ne.far+1)/Math.LN2)),_!==ne&&(_=ne,Zy=!0,Gk=!0),Oe.isShaderMaterial||Oe.isMeshPhongMaterial||Oe.isMeshToonMaterial||Oe.isMeshStandardMaterial||Oe.envMap){const Qo=no.map.cameraPosition;Qo!==void 0&&Qo.setValue(K,A.setFromMatrixPosition(ne.matrixWorld))}(Oe.isMeshPhongMaterial||Oe.isMeshToonMaterial||Oe.isMeshLambertMaterial||Oe.isMeshBasicMaterial||Oe.isMeshStandardMaterial||Oe.isShaderMaterial)&&no.setValue(K,"isOrthographic",ne.isOrthographicCamera===!0),(Oe.isMeshPhongMaterial||Oe.isMeshToonMaterial||Oe.isMeshLambertMaterial||Oe.isMeshBasicMaterial||Oe.isMeshStandardMaterial||Oe.isShaderMaterial||Oe.isShadowMaterial||Ne.isSkinnedMesh)&&no.setValue(K,"viewMatrix",ne.matrixWorldInverse)}if(Ne.isSkinnedMesh){no.setOptional(K,Ne,"bindMatrix"),no.setOptional(K,Ne,"bindMatrixInverse");const Qo=Ne.skeleton;Qo&&(J.floatVertexTextures?(Qo.boneTexture===null&&Qo.computeBoneTexture(),no.setValue(K,"boneTexture",Qo.boneTexture,ve),no.setValue(K,"boneTextureSize",Qo.boneTextureSize)):console.warn("THREE.WebGLRenderer: SkinnedMesh can only be used with WebGL 2. With WebGL 1 OES_texture_float and vertex textures support is required."))}const Hk=Ie.morphAttributes;if((Hk.position!==void 0||Hk.normal!==void 0||Hk.color!==void 0&&J.isWebGL2===!0)&&_e.update(Ne,Ie,Oe,Aa),(Zy||wn.receiveShadow!==Ne.receiveShadow)&&(wn.receiveShadow=Ne.receiveShadow,no.setValue(K,"receiveShadow",Ne.receiveShadow)),Oe.isMeshGouraudMaterial&&Oe.envMap!==null&&(Nd.envMap.value=wt,Nd.flipEnvMap.value=wt.isCubeTexture&&wt.isRenderTargetTexture===!1?-1:1),Zy&&(no.setValue(K,"toneMappingExposure",m.toneMappingExposure),wn.needsLights&&yi(Nd,Gk),ot&&Oe.fog===!0&&ge.refreshFogUniforms(Nd,ot),ge.refreshMaterialUniforms(Nd,Oe,I,k,$),KC.upload(K,wn.uniformsList,Nd,ve)),Oe.isShaderMaterial&&Oe.uniformsNeedUpdate===!0&&(KC.upload(K,wn.uniformsList,Nd,ve),Oe.uniformsNeedUpdate=!1),Oe.isSpriteMaterial&&no.setValue(K,"center",Ne.center),no.setValue(K,"modelViewMatrix",Ne.modelViewMatrix),no.setValue(K,"normalMatrix",Ne.normalMatrix),no.setValue(K,"modelMatrix",Ne.matrixWorld),Oe.isShaderMaterial||Oe.isRawShaderMaterial){const Qo=Oe.uniformsGroups;for(let qk=0,O0e=Qo.length;qk<O0e;qk++)if(J.isWebGL2){const X6=Qo[qk];xe.update(X6,Aa),xe.bind(X6,Aa)}else console.warn("THREE.WebGLRenderer: Uniform Buffer Objects can only be used with WebGL 2.")}return Aa}function yi(ne,Pe){ne.ambientLightColor.needsUpdate=Pe,ne.lightProbe.needsUpdate=Pe,ne.directionalLights.needsUpdate=Pe,ne.directionalLightShadows.needsUpdate=Pe,ne.pointLights.needsUpdate=Pe,ne.pointLightShadows.needsUpdate=Pe,ne.spotLights.needsUpdate=Pe,ne.spotLightShadows.needsUpdate=Pe,ne.rectAreaLights.needsUpdate=Pe,ne.hemisphereLights.needsUpdate=Pe}function Ts(ne){return ne.isMeshLambertMaterial||ne.isMeshToonMaterial||ne.isMeshPhongMaterial||ne.isMeshStandardMaterial||ne.isShadowMaterial||ne.isShaderMaterial&&ne.lights===!0}this.getActiveCubeFace=function(){return v},this.getActiveMipmapLevel=function(){return y},this.getRenderTarget=function(){return x},this.setRenderTargetTextures=function(ne,Pe,Ie){re.get(ne.texture).__webglTexture=Pe,re.get(ne.depthTexture).__webglTexture=Ie;const Oe=re.get(ne);Oe.__hasExternalTextures=!0,Oe.__hasExternalTextures&&(Oe.__autoAllocateDepthBuffer=Ie===void 0,Oe.__autoAllocateDepthBuffer||te.has("WEBGL_multisampled_render_to_texture")===!0&&(console.warn("THREE.WebGLRenderer: Render-to-texture extension was disabled because an external texture was provided"),Oe.__useRenderToTexture=!1))},this.setRenderTargetFramebuffer=function(ne,Pe){const Ie=re.get(ne);Ie.__webglFramebuffer=Pe,Ie.__useDefaultFramebuffer=Pe===void 0},this.setRenderTarget=function(ne,Pe=0,Ie=0){x=ne,v=Pe,y=Ie;let Oe=!0;if(ne){const wt=re.get(ne);wt.__useDefaultFramebuffer!==void 0?(pe.bindFramebuffer(36160,null),Oe=!1):wt.__webglFramebuffer===void 0?ve.setupRenderTarget(ne):wt.__hasExternalTextures&&ve.rebindTextures(ne,re.get(ne.texture).__webglTexture,re.get(ne.depthTexture).__webglTexture)}let Ne=null,ot=!1,Ze=!1;if(ne){const wt=ne.texture;(wt.isData3DTexture||wt.isDataArrayTexture)&&(Ze=!0);const zt=re.get(ne).__webglFramebuffer;ne.isWebGLCubeRenderTarget?(Ne=zt[Pe],ot=!0):J.isWebGL2&&ne.samples>0&&ve.useMultisampledRTT(ne)===!1?Ne=re.get(ne).__webglMultisampledFramebuffer:Ne=zt,S.copy(ne.viewport),O.copy(ne.scissor),C=ne.scissorTest}else S.copy(T).multiplyScalar(I).floor(),O.copy(L).multiplyScalar(I).floor(),C=z;if(pe.bindFramebuffer(36160,Ne)&&J.drawBuffers&&Oe&&pe.drawBuffers(ne,Ne),pe.viewport(S),pe.scissor(O),pe.setScissorTest(C),ot){const wt=re.get(ne.texture);K.framebufferTexture2D(36160,36064,34069+Pe,wt.__webglTexture,Ie)}else if(Ze){const wt=re.get(ne.texture),zt=Pe||0;K.framebufferTextureLayer(36160,36064,wt.__webglTexture,Ie||0,zt)}b=-1},this.readRenderTargetPixels=function(ne,Pe,Ie,Oe,Ne,ot,Ze){if(!(ne&&ne.isWebGLRenderTarget)){console.error("THREE.WebGLRenderer.readRenderTargetPixels: renderTarget is not THREE.WebGLRenderTarget.");return}let mt=re.get(ne).__webglFramebuffer;if(ne.isWebGLCubeRenderTarget&&Ze!==void 0&&(mt=mt[Ze]),mt){pe.bindFramebuffer(36160,mt);try{const wt=ne.texture,zt=wt.format,Pt=wt.type;if(zt!==jl&&V.convert(zt)!==K.getParameter(35739)){console.error("THREE.WebGLRenderer.readRenderTargetPixels: renderTarget is not in RGBA or implementation defined format.");return}const st=Pt===o1&&(te.has("EXT_color_buffer_half_float")||J.isWebGL2&&te.has("EXT_color_buffer_float"));if(Pt!==yp&&V.convert(Pt)!==K.getParameter(35738)&&!(Pt===Mf&&(J.isWebGL2||te.has("OES_texture_float")||te.has("WEBGL_color_buffer_float")))&&!st){console.error("THREE.WebGLRenderer.readRenderTargetPixels: renderTarget is not in UnsignedByteType or implementation defined type.");return}Pe>=0&&Pe<=ne.width-Oe&&Ie>=0&&Ie<=ne.height-Ne&&K.readPixels(Pe,Ie,Oe,Ne,V.convert(zt),V.convert(Pt),ot)}finally{const wt=x!==null?re.get(x).__webglFramebuffer:null;pe.bindFramebuffer(36160,wt)}}},this.copyFramebufferToTexture=function(ne,Pe,Ie=0){const Oe=Math.pow(2,-Ie),Ne=Math.floor(Pe.image.width*Oe),ot=Math.floor(Pe.image.height*Oe);ve.setTexture2D(Pe,0),K.copyTexSubImage2D(3553,Ie,0,0,ne.x,ne.y,Ne,ot),pe.unbindTexture()},this.copyTextureToTexture=function(ne,Pe,Ie,Oe=0){const Ne=Pe.image.width,ot=Pe.image.height,Ze=V.convert(Ie.format),mt=V.convert(Ie.type);ve.setTexture2D(Ie,0),K.pixelStorei(37440,Ie.flipY),K.pixelStorei(37441,Ie.premultiplyAlpha),K.pixelStorei(3317,Ie.unpackAlignment),Pe.isDataTexture?K.texSubImage2D(3553,Oe,ne.x,ne.y,Ne,ot,Ze,mt,Pe.image.data):Pe.isCompressedTexture?K.compressedTexSubImage2D(3553,Oe,ne.x,ne.y,Pe.mipmaps[0].width,Pe.mipmaps[0].height,Ze,Pe.mipmaps[0].data):K.texSubImage2D(3553,Oe,ne.x,ne.y,Ze,mt,Pe.image),Oe===0&&Ie.generateMipmaps&&K.generateMipmap(3553),pe.unbindTexture()},this.copyTextureToTexture3D=function(ne,Pe,Ie,Oe,Ne=0){if(m.isWebGL1Renderer){console.warn("THREE.WebGLRenderer.copyTextureToTexture3D: can only be used with WebGL2.");return}const ot=ne.max.x-ne.min.x+1,Ze=ne.max.y-ne.min.y+1,mt=ne.max.z-ne.min.z+1,wt=V.convert(Oe.format),zt=V.convert(Oe.type);let Pt;if(Oe.isData3DTexture)ve.setTexture3D(Oe,0),Pt=32879;else if(Oe.isDataArrayTexture)ve.setTexture2DArray(Oe,0),Pt=35866;else{console.warn("THREE.WebGLRenderer.copyTextureToTexture3D: only supports THREE.DataTexture3D and THREE.DataTexture2DArray.");return}K.pixelStorei(37440,Oe.flipY),K.pixelStorei(37441,Oe.premultiplyAlpha),K.pixelStorei(3317,Oe.unpackAlignment);const st=K.getParameter(3314),Qt=K.getParameter(32878),Ld=K.getParameter(3316),Xp=K.getParameter(3315),Qp=K.getParameter(32877),sl=Ie.isCompressedTexture?Ie.mipmaps[0]:Ie.image;K.pixelStorei(3314,sl.width),K.pixelStorei(32878,sl.height),K.pixelStorei(3316,ne.min.x),K.pixelStorei(3315,ne.min.y),K.pixelStorei(32877,ne.min.z),Ie.isDataTexture||Ie.isData3DTexture?K.texSubImage3D(Pt,Ne,Pe.x,Pe.y,Pe.z,ot,Ze,mt,wt,zt,sl.data):Ie.isCompressedTexture?(console.warn("THREE.WebGLRenderer.copyTextureToTexture3D: untested support for compressed srcTexture."),K.compressedTexSubImage3D(Pt,Ne,Pe.x,Pe.y,Pe.z,ot,Ze,mt,wt,sl.data)):K.texSubImage3D(Pt,Ne,Pe.x,Pe.y,Pe.z,ot,Ze,mt,wt,zt,sl),K.pixelStorei(3314,st),K.pixelStorei(32878,Qt),K.pixelStorei(3316,Ld),K.pixelStorei(3315,Xp),K.pixelStorei(32877,Qp),Ne===0&&Oe.generateMipmaps&&K.generateMipmap(Pt),pe.unbindTexture()},this.initTexture=function(ne){ne.isCubeTexture?ve.setTextureCube(ne,0):ne.isData3DTexture?ve.setTexture3D(ne,0):ne.isDataArrayTexture?ve.setTexture2DArray(ne,0):ve.setTexture2D(ne,0),pe.unbindTexture()},this.resetState=function(){v=0,y=0,x=null,pe.reset(),de.reset()},typeof __THREE_DEVTOOLS__<"u"&&__THREE_DEVTOOLS__.dispatchEvent(new CustomEvent("observe",{detail:this}))}class n4t extends Bye{}n4t.prototype.isWebGL1Renderer=!0;class r4t extends zo{constructor(){super(),this.isScene=!0,this.type="Scene",this.background=null,this.environment=null,this.fog=null,this.overrideMaterial=null,typeof __THREE_DEVTOOLS__<"u"&&__THREE_DEVTOOLS__.dispatchEvent(new CustomEvent("observe",{detail:this}))}copy(e,n){return super.copy(e,n),e.background!==null&&(this.background=e.background.clone()),e.environment!==null&&(this.environment=e.environment.clone()),e.fog!==null&&(this.fog=e.fog.clone()),e.overrideMaterial!==null&&(this.overrideMaterial=e.overrideMaterial.clone()),this.matrixAutoUpdate=e.matrixAutoUpdate,this}toJSON(e){const n=super.toJSON(e);return this.fog!==null&&(n.object.fog=this.fog.toJSON()),n}get autoUpdate(){return console.warn("THREE.Scene: autoUpdate was renamed to matrixWorldAutoUpdate in r144."),this.matrixWorldAutoUpdate}set autoUpdate(e){console.warn("THREE.Scene: autoUpdate was renamed to matrixWorldAutoUpdate in r144."),this.matrixWorldAutoUpdate=e}}class zye extends $w{constructor(e){super(),this.isLineBasicMaterial=!0,this.type="LineBasicMaterial",this.color=new lr(16777215),this.linewidth=1,this.linecap="round",this.linejoin="round",this.fog=!0,this.setValues(e)}copy(e){return super.copy(e),this.color.copy(e.color),this.linewidth=e.linewidth,this.linecap=e.linecap,this.linejoin=e.linejoin,this.fog=e.fog,this}}const _J=new Se,wJ=new Se,SJ=new Hn,SD=new Tye,nC=new Nk;class i4t extends zo{constructor(e=new Eu,n=new zye){super(),this.isLine=!0,this.type="Line",this.geometry=e,this.material=n,this.updateMorphTargets()}copy(e,n){return super.copy(e,n),this.material=e.material,this.geometry=e.geometry,this}computeLineDistances(){const e=this.geometry;if(e.index===null){const n=e.attributes.position,r=[0];for(let i=1,o=n.count;i<o;i++)_J.fromBufferAttribute(n,i-1),wJ.fromBufferAttribute(n,i),r[i]=r[i-1],r[i]+=_J.distanceTo(wJ);e.setAttribute("lineDistance",new lu(r,1))}else console.warn("THREE.Line.computeLineDistances(): Computation only possible with non-indexed BufferGeometry.");return this}raycast(e,n){const r=this.geometry,i=this.matrixWorld,o=e.params.Line.threshold,a=r.drawRange;if(r.boundingSphere===null&&r.computeBoundingSphere(),nC.copy(r.boundingSphere),nC.applyMatrix4(i),nC.radius+=o,e.ray.intersectsSphere(nC)===!1)return;SJ.copy(i).invert(),SD.copy(e.ray).applyMatrix4(SJ);const s=o/((this.scale.x+this.scale.y+this.scale.z)/3),l=s*s,c=new Se,u=new Se,f=new Se,d=new Se,h=this.isLineSegments?2:1,p=r.index,g=r.attributes.position;if(p!==null){const v=Math.max(0,a.start),y=Math.min(p.count,a.start+a.count);for(let x=v,b=y-1;x<b;x+=h){const _=p.getX(x),S=p.getX(x+1);if(c.fromBufferAttribute(g,_),u.fromBufferAttribute(g,S),SD.distanceSqToSegment(c,u,d,f)>l)continue;d.applyMatrix4(this.matrixWorld);const C=e.ray.origin.distanceTo(d);C<e.near||C>e.far||n.push({distance:C,point:f.clone().applyMatrix4(this.matrixWorld),index:x,face:null,faceIndex:null,object:this})}}else{const v=Math.max(0,a.start),y=Math.min(g.count,a.start+a.count);for(let x=v,b=y-1;x<b;x+=h){if(c.fromBufferAttribute(g,x),u.fromBufferAttribute(g,x+1),SD.distanceSqToSegment(c,u,d,f)>l)continue;d.applyMatrix4(this.matrixWorld);const S=e.ray.origin.distanceTo(d);S<e.near||S>e.far||n.push({distance:S,point:f.clone().applyMatrix4(this.matrixWorld),index:x,face:null,faceIndex:null,object:this})}}}updateMorphTargets(){const n=this.geometry.morphAttributes,r=Object.keys(n);if(r.length>0){const i=n[r[0]];if(i!==void 0){this.morphTargetInfluences=[],this.morphTargetDictionary={};for(let o=0,a=i.length;o<a;o++){const s=i[o].name||String(o);this.morphTargetInfluences.push(0),this.morphTargetDictionary[s]=o}}}}}const OJ=new Se,CJ=new Se;class o4t extends i4t{constructor(e,n){super(e,n),this.isLineSegments=!0,this.type="LineSegments"}computeLineDistances(){const e=this.geometry;if(e.index===null){const n=e.attributes.position,r=[];for(let i=0,o=n.count;i<o;i+=2)OJ.fromBufferAttribute(n,i),CJ.fromBufferAttribute(n,i+1),r[i]=i===0?0:r[i-1],r[i+1]=r[i]+OJ.distanceTo(CJ);e.setAttribute("lineDistance",new lu(r,1))}else console.warn("THREE.LineSegments.computeLineDistances(): Computation only possible with non-indexed BufferGeometry.");return this}}const IP={enabled:!1,files:{},add:function(t,e){this.enabled!==!1&&(this.files[t]=e)},get:function(t){if(this.enabled!==!1)return this.files[t]},remove:function(t){delete this.files[t]},clear:function(){this.files={}}};class a4t{constructor(e,n,r){const i=this;let o=!1,a=0,s=0,l;const c=[];this.onStart=void 0,this.onLoad=e,this.onProgress=n,this.onError=r,this.itemStart=function(u){s++,o===!1&&i.onStart!==void 0&&i.onStart(u,a,s),o=!0},this.itemEnd=function(u){a++,i.onProgress!==void 0&&i.onProgress(u,a,s),a===s&&(o=!1,i.onLoad!==void 0&&i.onLoad())},this.itemError=function(u){i.onError!==void 0&&i.onError(u)},this.resolveURL=function(u){return l?l(u):u},this.setURLModifier=function(u){return l=u,this},this.addHandler=function(u,f){return c.push(u,f),this},this.removeHandler=function(u){const f=c.indexOf(u);return f!==-1&&c.splice(f,2),this},this.getHandler=function(u){for(let f=0,d=c.length;f<d;f+=2){const h=c[f],p=c[f+1];if(h.global&&(h.lastIndex=0),h.test(u))return p}return null}}}const s4t=new a4t;class jk{constructor(e){this.manager=e!==void 0?e:s4t,this.crossOrigin="anonymous",this.withCredentials=!1,this.path="",this.resourcePath="",this.requestHeader={}}load(){}loadAsync(e,n){const r=this;return new Promise(function(i,o){r.load(e,i,n,o)})}parse(){}setCrossOrigin(e){return this.crossOrigin=e,this}setWithCredentials(e){return this.withCredentials=e,this}setPath(e){return this.path=e,this}setResourcePath(e){return this.resourcePath=e,this}setRequestHeader(e){return this.requestHeader=e,this}}const Oc={};class l4t extends Error{constructor(e,n){super(e),this.response=n}}class c4t extends jk{constructor(e){super(e)}load(e,n,r,i){e===void 0&&(e=""),this.path!==void 0&&(e=this.path+e),e=this.manager.resolveURL(e);const o=IP.get(e);if(o!==void 0)return this.manager.itemStart(e),setTimeout(()=>{n&&n(o),this.manager.itemEnd(e)},0),o;if(Oc[e]!==void 0){Oc[e].push({onLoad:n,onProgress:r,onError:i});return}Oc[e]=[],Oc[e].push({onLoad:n,onProgress:r,onError:i});const a=new Request(e,{headers:new Headers(this.requestHeader),credentials:this.withCredentials?"include":"same-origin"}),s=this.mimeType,l=this.responseType;fetch(a).then(c=>{if(c.status===200||c.status===0){if(c.status===0&&console.warn("THREE.FileLoader: HTTP Status 0 received."),typeof ReadableStream>"u"||c.body===void 0||c.body.getReader===void 0)return c;const u=Oc[e],f=c.body.getReader(),d=c.headers.get("Content-Length"),h=d?parseInt(d):0,p=h!==0;let m=0;const g=new ReadableStream({start(v){y();function y(){f.read().then(({done:x,value:b})=>{if(x)v.close();else{m+=b.byteLength;const _=new ProgressEvent("progress",{lengthComputable:p,loaded:m,total:h});for(let S=0,O=u.length;S<O;S++){const C=u[S];C.onProgress&&C.onProgress(_)}v.enqueue(b),y()}})}}});return new Response(g)}else throw new l4t(`fetch for "${c.url}" responded with ${c.status}: ${c.statusText}`,c)}).then(c=>{switch(l){case"arraybuffer":return c.arrayBuffer();case"blob":return c.blob();case"document":return c.text().then(u=>new DOMParser().parseFromString(u,s));case"json":return c.json();default:if(s===void 0)return c.text();{const f=/charset="?([^;"\s]*)"?/i.exec(s),d=f&&f[1]?f[1].toLowerCase():void 0,h=new TextDecoder(d);return c.arrayBuffer().then(p=>h.decode(p))}}}).then(c=>{IP.add(e,c);const u=Oc[e];delete Oc[e];for(let f=0,d=u.length;f<d;f++){const h=u[f];h.onLoad&&h.onLoad(c)}}).catch(c=>{const u=Oc[e];if(u===void 0)throw this.manager.itemError(e),c;delete Oc[e];for(let f=0,d=u.length;f<d;f++){const h=u[f];h.onError&&h.onError(c)}this.manager.itemError(e)}).finally(()=>{this.manager.itemEnd(e)}),this.manager.itemStart(e)}setResponseType(e){return this.responseType=e,this}setMimeType(e){return this.mimeType=e,this}}class u4t extends jk{constructor(e){super(e)}load(e,n,r,i){this.path!==void 0&&(e=this.path+e),e=this.manager.resolveURL(e);const o=this,a=IP.get(e);if(a!==void 0)return o.manager.itemStart(e),setTimeout(function(){n&&n(a),o.manager.itemEnd(e)},0),a;const s=a1("img");function l(){u(),IP.add(e,this),n&&n(this),o.manager.itemEnd(e)}function c(f){u(),i&&i(f),o.manager.itemError(e),o.manager.itemEnd(e)}function u(){s.removeEventListener("load",l,!1),s.removeEventListener("error",c,!1)}return s.addEventListener("load",l,!1),s.addEventListener("error",c,!1),e.slice(0,5)!=="data:"&&this.crossOrigin!==void 0&&(s.crossOrigin=this.crossOrigin),o.manager.itemStart(e),s.src=e,s}}class f4t extends jk{constructor(e){super(e)}load(e,n,r,i){const o=new Ta,a=new u4t(this.manager);return a.setCrossOrigin(this.crossOrigin),a.setPath(this.path),a.load(e,function(s){o.image=s,o.needsUpdate=!0,n!==void 0&&n(o)},r,i),o}}class TJ{constructor(e=1,n=0,r=0){return this.radius=e,this.phi=n,this.theta=r,this}set(e,n,r){return this.radius=e,this.phi=n,this.theta=r,this}copy(e){return this.radius=e.radius,this.phi=e.phi,this.theta=e.theta,this}makeSafe(){return this.phi=Math.max(1e-6,Math.min(Math.PI-1e-6,this.phi)),this}setFromVector3(e){return this.setFromCartesianCoords(e.x,e.y,e.z)}setFromCartesianCoords(e,n,r){return this.radius=Math.sqrt(e*e+n*n+r*r),this.radius===0?(this.theta=0,this.phi=0):(this.theta=Math.atan2(e,r),this.phi=Math.acos(Mo(n/this.radius,-1,1))),this}clone(){return new this.constructor().copy(this)}}const rC=new Qy;class d4t extends o4t{constructor(e,n=16776960){const r=new Uint16Array([0,1,1,2,2,3,3,0,4,5,5,6,6,7,7,4,0,4,1,5,2,6,3,7]),i=new Float32Array(8*3),o=new Eu;o.setIndex(new as(r,1)),o.setAttribute("position",new as(i,3)),super(o,new zye({color:n,toneMapped:!1})),this.object=e,this.type="BoxHelper",this.matrixAutoUpdate=!1,this.update()}update(e){if(e!==void 0&&console.warn("THREE.BoxHelper: .update() has no longer arguments."),this.object!==void 0&&rC.setFromObject(this.object),rC.isEmpty())return;const n=rC.min,r=rC.max,i=this.geometry.attributes.position,o=i.array;o[0]=r.x,o[1]=r.y,o[2]=r.z,o[3]=n.x,o[4]=r.y,o[5]=r.z,o[6]=n.x,o[7]=n.y,o[8]=r.z,o[9]=r.x,o[10]=n.y,o[11]=r.z,o[12]=r.x,o[13]=r.y,o[14]=n.z,o[15]=n.x,o[16]=r.y,o[17]=n.z,o[18]=n.x,o[19]=n.y,o[20]=n.z,o[21]=r.x,o[22]=n.y,o[23]=n.z,i.needsUpdate=!0,this.geometry.computeBoundingSphere()}setFromObject(e){return this.object=e,this.update(),this}copy(e,n){return super.copy(e,n),this.object=e.object,this}}typeof __THREE_DEVTOOLS__<"u"&&__THREE_DEVTOOLS__.dispatchEvent(new CustomEvent("register",{detail:{revision:S6}}));typeof window<"u"&&(window.__THREE__?console.warn("WARNING: Multiple instances of Three.js being imported."):window.__THREE__=S6);const EJ={type:"change"},OD={type:"start"},PJ={type:"end"};class h4t extends Hp{constructor(e,n){super(),this.object=e,this.domElement=n,this.domElement.style.touchAction="none",this.enabled=!0,this.target=new Se,this.minDistance=0,this.maxDistance=1/0,this.minZoom=0,this.maxZoom=1/0,this.minPolarAngle=0,this.maxPolarAngle=Math.PI,this.minAzimuthAngle=-1/0,this.maxAzimuthAngle=1/0,this.enableDamping=!1,this.dampingFactor=.05,this.enableZoom=!0,this.zoomSpeed=1,this.enableRotate=!0,this.rotateSpeed=1,this.enablePan=!0,this.panSpeed=1,this.screenSpacePanning=!0,this.keyPanSpeed=7,this.autoRotate=!1,this.autoRotateSpeed=2,this.keys={LEFT:"ArrowLeft",UP:"ArrowUp",RIGHT:"ArrowRight",BOTTOM:"ArrowDown"},this.mouseButtons={LEFT:gm.ROTATE,MIDDLE:gm.DOLLY,RIGHT:gm.PAN},this.touches={ONE:vm.ROTATE,TWO:vm.DOLLY_PAN},this.target0=this.target.clone(),this.position0=this.object.position.clone(),this.zoom0=this.object.zoom,this._domElementKeyEvents=null,this.getPolarAngle=function(){return s.phi},this.getAzimuthalAngle=function(){return s.theta},this.getDistance=function(){return this.object.position.distanceTo(this.target)},this.listenToKeyEvents=function(V){V.addEventListener("keydown",ye),this._domElementKeyEvents=V},this.saveState=function(){r.target0.copy(r.target),r.position0.copy(r.object.position),r.zoom0=r.object.zoom},this.reset=function(){r.target.copy(r.target0),r.object.position.copy(r.position0),r.object.zoom=r.zoom0,r.object.updateProjectionMatrix(),r.dispatchEvent(EJ),r.update(),o=i.NONE},this.update=function(){const V=new Se,de=new _p().setFromUnitVectors(e.up,new Se(0,1,0)),xe=de.clone().invert(),Me=new Se,me=new _p,$e=2*Math.PI;return function(){const Re=r.object.position;V.copy(Re).sub(r.target),V.applyQuaternion(de),s.setFromVector3(V),r.autoRotate&&o===i.NONE&&E(O()),r.enableDamping?(s.theta+=l.theta*r.dampingFactor,s.phi+=l.phi*r.dampingFactor):(s.theta+=l.theta,s.phi+=l.phi);let ae=r.minAzimuthAngle,Le=r.maxAzimuthAngle;return isFinite(ae)&&isFinite(Le)&&(ae<-Math.PI?ae+=$e:ae>Math.PI&&(ae-=$e),Le<-Math.PI?Le+=$e:Le>Math.PI&&(Le-=$e),ae<=Le?s.theta=Math.max(ae,Math.min(Le,s.theta)):s.theta=s.theta>(ae+Le)/2?Math.max(ae,s.theta):Math.min(Le,s.theta)),s.phi=Math.max(r.minPolarAngle,Math.min(r.maxPolarAngle,s.phi)),s.makeSafe(),s.radius*=c,s.radius=Math.max(r.minDistance,Math.min(r.maxDistance,s.radius)),r.enableDamping===!0?r.target.addScaledVector(u,r.dampingFactor):r.target.add(u),V.setFromSpherical(s),V.applyQuaternion(xe),Re.copy(r.target).add(V),r.object.lookAt(r.target),r.enableDamping===!0?(l.theta*=1-r.dampingFactor,l.phi*=1-r.dampingFactor,u.multiplyScalar(1-r.dampingFactor)):(l.set(0,0,0),u.set(0,0,0)),c=1,f||Me.distanceToSquared(r.object.position)>a||8*(1-me.dot(r.object.quaternion))>a?(r.dispatchEvent(EJ),Me.copy(r.object.position),me.copy(r.object.quaternion),f=!1,!0):!1}}(),this.dispose=function(){r.domElement.removeEventListener("contextmenu",ie),r.domElement.removeEventListener("pointerdown",F),r.domElement.removeEventListener("pointercancel",Q),r.domElement.removeEventListener("wheel",ge),r.domElement.removeEventListener("pointermove",ce),r.domElement.removeEventListener("pointerup",le),r._domElementKeyEvents!==null&&r._domElementKeyEvents.removeEventListener("keydown",ye)};const r=this,i={NONE:-1,ROTATE:0,DOLLY:1,PAN:2,TOUCH_ROTATE:3,TOUCH_PAN:4,TOUCH_DOLLY_PAN:5,TOUCH_DOLLY_ROTATE:6};let o=i.NONE;const a=1e-6,s=new TJ,l=new TJ;let c=1;const u=new Se;let f=!1;const d=new qt,h=new qt,p=new qt,m=new qt,g=new qt,v=new qt,y=new qt,x=new qt,b=new qt,_=[],S={};function O(){return 2*Math.PI/60/60*r.autoRotateSpeed}function C(){return Math.pow(.95,r.zoomSpeed)}function E(V){l.theta-=V}function k(V){l.phi-=V}const I=function(){const V=new Se;return function(xe,Me){V.setFromMatrixColumn(Me,0),V.multiplyScalar(-xe),u.add(V)}}(),P=function(){const V=new Se;return function(xe,Me){r.screenSpacePanning===!0?V.setFromMatrixColumn(Me,1):(V.setFromMatrixColumn(Me,0),V.crossVectors(r.object.up,V)),V.multiplyScalar(xe),u.add(V)}}(),R=function(){const V=new Se;return function(xe,Me){const me=r.domElement;if(r.object.isPerspectiveCamera){const $e=r.object.position;V.copy($e).sub(r.target);let Te=V.length();Te*=Math.tan(r.object.fov/2*Math.PI/180),I(2*xe*Te/me.clientHeight,r.object.matrix),P(2*Me*Te/me.clientHeight,r.object.matrix)}else r.object.isOrthographicCamera?(I(xe*(r.object.right-r.object.left)/r.object.zoom/me.clientWidth,r.object.matrix),P(Me*(r.object.top-r.object.bottom)/r.object.zoom/me.clientHeight,r.object.matrix)):(console.warn("WARNING: OrbitControls.js encountered an unknown camera type - pan disabled."),r.enablePan=!1)}}();function T(V){r.object.isPerspectiveCamera?c/=V:r.object.isOrthographicCamera?(r.object.zoom=Math.max(r.minZoom,Math.min(r.maxZoom,r.object.zoom*V)),r.object.updateProjectionMatrix(),f=!0):(console.warn("WARNING: OrbitControls.js encountered an unknown camera type - dolly/zoom disabled."),r.enableZoom=!1)}function L(V){r.object.isPerspectiveCamera?c*=V:r.object.isOrthographicCamera?(r.object.zoom=Math.max(r.minZoom,Math.min(r.maxZoom,r.object.zoom/V)),r.object.updateProjectionMatrix(),f=!0):(console.warn("WARNING: OrbitControls.js encountered an unknown camera type - dolly/zoom disabled."),r.enableZoom=!1)}function z(V){d.set(V.clientX,V.clientY)}function B(V){y.set(V.clientX,V.clientY)}function U(V){m.set(V.clientX,V.clientY)}function W(V){h.set(V.clientX,V.clientY),p.subVectors(h,d).multiplyScalar(r.rotateSpeed);const de=r.domElement;E(2*Math.PI*p.x/de.clientHeight),k(2*Math.PI*p.y/de.clientHeight),d.copy(h),r.update()}function $(V){x.set(V.clientX,V.clientY),b.subVectors(x,y),b.y>0?T(C()):b.y<0&&L(C()),y.copy(x),r.update()}function N(V){g.set(V.clientX,V.clientY),v.subVectors(g,m).multiplyScalar(r.panSpeed),R(v.x,v.y),m.copy(g),r.update()}function D(V){V.deltaY<0?L(C()):V.deltaY>0&&T(C()),r.update()}function A(V){let de=!1;switch(V.code){case r.keys.UP:R(0,r.keyPanSpeed),de=!0;break;case r.keys.BOTTOM:R(0,-r.keyPanSpeed),de=!0;break;case r.keys.LEFT:R(r.keyPanSpeed,0),de=!0;break;case r.keys.RIGHT:R(-r.keyPanSpeed,0),de=!0;break}de&&(V.preventDefault(),r.update())}function q(){if(_.length===1)d.set(_[0].pageX,_[0].pageY);else{const V=.5*(_[0].pageX+_[1].pageX),de=.5*(_[0].pageY+_[1].pageY);d.set(V,de)}}function Y(){if(_.length===1)m.set(_[0].pageX,_[0].pageY);else{const V=.5*(_[0].pageX+_[1].pageX),de=.5*(_[0].pageY+_[1].pageY);m.set(V,de)}}function K(){const V=_[0].pageX-_[1].pageX,de=_[0].pageY-_[1].pageY,xe=Math.sqrt(V*V+de*de);y.set(0,xe)}function se(){r.enableZoom&&K(),r.enablePan&&Y()}function te(){r.enableZoom&&K(),r.enableRotate&&q()}function J(V){if(_.length===1)h.set(V.pageX,V.pageY);else{const xe=Z(V),Me=.5*(V.pageX+xe.x),me=.5*(V.pageY+xe.y);h.set(Me,me)}p.subVectors(h,d).multiplyScalar(r.rotateSpeed);const de=r.domElement;E(2*Math.PI*p.x/de.clientHeight),k(2*Math.PI*p.y/de.clientHeight),d.copy(h)}function pe(V){if(_.length===1)g.set(V.pageX,V.pageY);else{const de=Z(V),xe=.5*(V.pageX+de.x),Me=.5*(V.pageY+de.y);g.set(xe,Me)}v.subVectors(g,m).multiplyScalar(r.panSpeed),R(v.x,v.y),m.copy(g)}function be(V){const de=Z(V),xe=V.pageX-de.x,Me=V.pageY-de.y,me=Math.sqrt(xe*xe+Me*Me);x.set(0,me),b.set(0,Math.pow(x.y/y.y,r.zoomSpeed)),T(b.y),y.copy(x)}function re(V){r.enableZoom&&be(V),r.enablePan&&pe(V)}function ve(V){r.enableZoom&&be(V),r.enableRotate&&J(V)}function F(V){r.enabled!==!1&&(_.length===0&&(r.domElement.setPointerCapture(V.pointerId),r.domElement.addEventListener("pointermove",ce),r.domElement.addEventListener("pointerup",le)),he(V),V.pointerType==="touch"?H(V):X(V))}function ce(V){r.enabled!==!1&&(V.pointerType==="touch"?G(V):ee(V))}function le(V){_e(V),_.length===0&&(r.domElement.releasePointerCapture(V.pointerId),r.domElement.removeEventListener("pointermove",ce),r.domElement.removeEventListener("pointerup",le)),r.dispatchEvent(PJ),o=i.NONE}function Q(V){_e(V)}function X(V){let de;switch(V.button){case 0:de=r.mouseButtons.LEFT;break;case 1:de=r.mouseButtons.MIDDLE;break;case 2:de=r.mouseButtons.RIGHT;break;default:de=-1}switch(de){case gm.DOLLY:if(r.enableZoom===!1)return;B(V),o=i.DOLLY;break;case gm.ROTATE:if(V.ctrlKey||V.metaKey||V.shiftKey){if(r.enablePan===!1)return;U(V),o=i.PAN}else{if(r.enableRotate===!1)return;z(V),o=i.ROTATE}break;case gm.PAN:if(V.ctrlKey||V.metaKey||V.shiftKey){if(r.enableRotate===!1)return;z(V),o=i.ROTATE}else{if(r.enablePan===!1)return;U(V),o=i.PAN}break;default:o=i.NONE}o!==i.NONE&&r.dispatchEvent(OD)}function ee(V){switch(o){case i.ROTATE:if(r.enableRotate===!1)return;W(V);break;case i.DOLLY:if(r.enableZoom===!1)return;$(V);break;case i.PAN:if(r.enablePan===!1)return;N(V);break}}function ge(V){r.enabled===!1||r.enableZoom===!1||o!==i.NONE||(V.preventDefault(),r.dispatchEvent(OD),D(V),r.dispatchEvent(PJ))}function ye(V){r.enabled===!1||r.enablePan===!1||A(V)}function H(V){switch(oe(V),_.length){case 1:switch(r.touches.ONE){case vm.ROTATE:if(r.enableRotate===!1)return;q(),o=i.TOUCH_ROTATE;break;case vm.PAN:if(r.enablePan===!1)return;Y(),o=i.TOUCH_PAN;break;default:o=i.NONE}break;case 2:switch(r.touches.TWO){case vm.DOLLY_PAN:if(r.enableZoom===!1&&r.enablePan===!1)return;se(),o=i.TOUCH_DOLLY_PAN;break;case vm.DOLLY_ROTATE:if(r.enableZoom===!1&&r.enableRotate===!1)return;te(),o=i.TOUCH_DOLLY_ROTATE;break;default:o=i.NONE}break;default:o=i.NONE}o!==i.NONE&&r.dispatchEvent(OD)}function G(V){switch(oe(V),o){case i.TOUCH_ROTATE:if(r.enableRotate===!1)return;J(V),r.update();break;case i.TOUCH_PAN:if(r.enablePan===!1)return;pe(V),r.update();break;case i.TOUCH_DOLLY_PAN:if(r.enableZoom===!1&&r.enablePan===!1)return;re(V),r.update();break;case i.TOUCH_DOLLY_ROTATE:if(r.enableZoom===!1&&r.enableRotate===!1)return;ve(V),r.update();break;default:o=i.NONE}}function ie(V){r.enabled!==!1&&V.preventDefault()}function he(V){_.push(V)}function _e(V){delete S[V.pointerId];for(let de=0;de<_.length;de++)if(_[de].pointerId===V.pointerId){_.splice(de,1);return}}function oe(V){let de=S[V.pointerId];de===void 0&&(de=new qt,S[V.pointerId]=de),de.set(V.pageX,V.pageY)}function Z(V){const de=V.pointerId===_[0].pointerId?_[1]:_[0];return S[de.pointerId]}r.domElement.addEventListener("contextmenu",ie),r.domElement.addEventListener("pointerdown",F),r.domElement.addEventListener("pointercancel",Q),r.domElement.addEventListener("wheel",ge,{passive:!1}),this.update()}}const p4t={uniforms:{u_size:{value:new Se(1,1,1)},u_renderstyle:{value:0},u_renderthreshold:{value:.5},u_clim:{value:new qt(0,1)},u_data:{value:null},u_cmdata:{value:null}},vertexShader:`

        varying vec4 v_nearpos;
        varying vec4 v_farpos;
        varying vec3 v_position;

        void main() {
            // Prepare transforms to map to "camera view". See also:
            // https://threejs.org/docs/#api/renderers/webgl/WebGLProgram
            mat4 viewModelMatrix = inverse(modelViewMatrix);

            // Project local vertex coordinate to camera position. Then do a step
            // backward (in cam coords) to the near clipping plane, and project back. Do
            // the same for the far clipping plane. This gives us all the information we
            // need to calculate the ray and truncate it to the viewing cone.
            vec4 position4 = vec4(position, 1.0);
            vec4 pos_in_cam = modelViewMatrix * position4;

            // Intersection of ray and near clipping plane (z = -1 in clip coords)
            pos_in_cam.z = -pos_in_cam.w;
            // pos_in_cam.w = 1.0;
            // pos_in_cam.z = -1.0;
            v_nearpos = viewModelMatrix * pos_in_cam;

            // Intersection of ray and far clipping plane (z = +1 in clip coords)
            pos_in_cam.z = pos_in_cam.w;
            // pos_in_cam.z = 1.0;
            v_farpos = viewModelMatrix * pos_in_cam;

            // Set varyings and output pos
            v_position = position;
            gl_Position = projectionMatrix * viewMatrix * modelMatrix * position4;
        }`,fragmentShader:`

        precision highp float;
        precision mediump sampler3D;

        uniform vec3 u_size;
        uniform int u_renderstyle;
        uniform float u_renderthreshold;
        uniform vec2 u_clim;

        uniform sampler3D u_data;
        uniform sampler2D u_cmdata;

        varying vec3 v_position;
        varying vec4 v_nearpos;
        varying vec4 v_farpos;

        // The maximum distance through our rendering volume is sqrt(3).
        const int MAX_STEPS = 2000; // 887; // 887 for 512^3, 1774 for 1024^3
        const int REFINEMENT_STEPS = 8; // 4;
        const float relative_step_size = 1.0;
        const vec4 ambient_color = vec4(0.2, 0.4, 0.2, 1.0);
        const vec4 diffuse_color = vec4(0.8, 0.2, 0.2, 1.0);
        const vec4 specular_color = vec4(1.0, 1.0, 1.0, 1.0);
        const float shininess = 40.0;

        void cast_mip(vec3 start_loc, vec3 step, int nsteps, vec3 view_ray);
        void cast_aip(vec3 start_loc, vec3 step, int nsteps, vec3 view_ray);
        void cast_iso(vec3 start_loc, vec3 step, int nsteps, vec3 view_ray);

        float sample1(vec3 texcoords);
        vec4 apply_colormap(float val);
        vec4 add_lighting(float val, vec3 loc, vec3 step, vec3 view_ray);

        void main() {
            // Normalize clipping plane info
            vec3 farpos = v_farpos.xyz / v_farpos.w;
            vec3 nearpos = v_nearpos.xyz / v_nearpos.w;

            // Calculate unit vector pointing in the view direction through this fragment.
            vec3 view_ray = normalize(nearpos.xyz - farpos.xyz);

            // Compute the (negative) distance to the front surface or near clipping plane.
            // v_position is the back face of the cuboid, so the initial distance calculated in the dot
            // product below is the distance from near clip plane to the back of the cuboid
            float distance = dot(nearpos - v_position, view_ray);
            distance = max(distance, min((-0.5 - v_position.x) / view_ray.x,
                                         (u_size.x - 0.5 - v_position.x) / view_ray.x));
            distance = max(distance, min((-0.5 - v_position.y) / view_ray.y,
                                         (u_size.y - 0.5 - v_position.y) / view_ray.y));
            distance = max(distance, min((-0.5 - v_position.z) / view_ray.z,
                                         (u_size.z - 0.5 - v_position.z) / view_ray.z));

            // Now we have the starting position on the front surface
            vec3 front = v_position + view_ray * distance;

            // Decide how many steps to take
            int nsteps = int(-distance / relative_step_size + 0.5);
            if ( nsteps < 1 )
                discard;

            // Get starting location and step vector in texture coordinates
            vec3 step = ((v_position - front) / u_size) / float(nsteps);
            vec3 start_loc = front / u_size;

            // For testing: show the number of steps. This helps to establish
            // whether the rays are correctly oriented
            //'gl_FragColor = vec4(0.0, float(nsteps) / 1.0 / u_size.x, 1.0, 1.0);
            //'return;

            if (u_renderstyle == 0)
                cast_mip(start_loc, step, nsteps, view_ray);
            else if (u_renderstyle == 1)
                cast_aip(start_loc, step, nsteps, view_ray);
            else if (u_renderstyle == 2)
                cast_iso(start_loc, step, nsteps, view_ray);

            if (gl_FragColor.a < 0.05)
                discard;
        }

        float sample1(vec3 texcoords) {
            /* Sample float value from a 3D texture. Assumes intensity data. */
            return texture(u_data, texcoords.xyz).r;
        }

        vec4 apply_colormap(float val) {
            val = (val - u_clim[0]) / (u_clim[1] - u_clim[0]);
            return texture2D(u_cmdata, vec2(val, 0.5));
        }

        void cast_mip(vec3 start_loc, vec3 step, int nsteps, vec3 view_ray) {

            float max_val = -1e6;
            vec3 loc = start_loc;

            // Enter the raycasting loop. In WebGL 1 the loop index cannot be compared with
            // non-constant expression. So we use a hard-coded max, and an additional condition
            // inside the loop.
            for (int iter = 0; iter < MAX_STEPS; iter++) {
                if (iter >= nsteps) {
                    break;
                }
                // Sample from the 3D texture
                float val = sample1(loc);
                // Apply MIP operation
                if (val > max_val) {
                    max_val = val;
                }
                // Advance location deeper into the volume
                loc += step;
            }

            // Resolve final color
            gl_FragColor = apply_colormap(max_val);
        }

        void cast_aip(vec3 start_loc, vec3 step, int nsteps, vec3 view_ray) {

            float avg_val = 0.0;
            int count = 0;
            vec3 loc = start_loc;
            float eps = 0.02;

            // Enter the raycasting loop. In WebGL 1 the loop index cannot be compared with
            // non-constant expression. So we use a hard-coded max, and an additional condition
            // inside the loop.
            for (int iter = 0; iter < MAX_STEPS; iter++) {
                if (iter >= nsteps) {
                    break;
                }
                // Sample from the 3D texture
                float val = sample1(loc);
                // Apply SUM operation   
                if (abs(loc.x - 0.5) < eps 
                    || abs(loc.y - 0.5) < eps 
                    || abs(loc.z - 0.5) < eps) {
                    avg_val += val;
                    count += 1;
                }          
                // Advance location deeper into the volume
                loc += step;
            }

            // Resolve final color
            if (count > 0) {
                gl_FragColor = apply_colormap(avg_val / float(count));
            } else {
                gl_FragColor = vec4(0.0);
            }
        }

        void cast_iso(vec3 start_loc, vec3 step, int nsteps, vec3 view_ray) {

            gl_FragColor = vec4(0.0);    // init transparent
            vec4 color3 = vec4(0.0);    // final color
            vec3 dstep = 1.5 / u_size;    // step to sample derivative
            vec3 loc = start_loc;

            float low_threshold = u_renderthreshold - 0.02 * (u_clim[1] - u_clim[0]);

            // Enter the raycasting loop. In WebGL 1 the loop index cannot be compared with
            // non-constant expression. So we use a hard-coded max, and an additional condition
            // inside the loop.
            for (int iter=0; iter<MAX_STEPS; iter++) {
                if (iter >= nsteps)
                    break;

                // Sample from the 3D texture
                float val = sample1(loc);

                if (val > low_threshold) {
                    // Take the last interval in smaller steps
                    vec3 iloc = loc - 0.5 * step;
                    vec3 istep = step / float(REFINEMENT_STEPS);
                    for (int i=0; i<REFINEMENT_STEPS; i++) {
                        val = sample1(iloc);
                        if (val > u_renderthreshold) {
                            gl_FragColor = add_lighting(val, iloc, dstep, view_ray);
                            return;
                        }
                        iloc += istep;
                    }
                }

                // Advance location deeper into the volume
                loc += step;
            }
        }

        vec4 add_lighting(float val, vec3 loc, vec3 step, vec3 view_ray) {
            // Calculate color by incorporating lighting

            // View direction
            vec3 V = normalize(view_ray);

            // calculate normal vector from gradient
            vec3 N;
            float val1, val2;
            val1 = sample1(loc + vec3(-step[0], 0.0, 0.0));
            val2 = sample1(loc + vec3(+step[0], 0.0, 0.0));
            N[0] = val1 - val2;
            val = max(max(val1, val2), val);
            val1 = sample1(loc + vec3(0.0, -step[1], 0.0));
            val2 = sample1(loc + vec3(0.0, +step[1], 0.0));
            N[1] = val1 - val2;
            val = max(max(val1, val2), val);
            val1 = sample1(loc + vec3(0.0, 0.0, -step[2]));
            val2 = sample1(loc + vec3(0.0, 0.0, +step[2]));
            N[2] = val1 - val2;
            val = max(max(val1, val2), val);

            float gm = length(N); // gradient magnitude
            N = normalize(N);

            // Flip normal so it points towards viewer
            float Nselect = float(dot(N, V) > 0.0);
            N = (2.0 * Nselect - 1.0) * N;    // ==    Nselect * N - (1.0-Nselect)*N;

            // Init colors
            vec4 ambient_color = vec4(0.0, 0.0, 0.0, 0.0);
            vec4 diffuse_color = vec4(0.0, 0.0, 0.0, 0.0);
            vec4 specular_color = vec4(0.0, 0.0, 0.0, 0.0);

            // note: could allow multiple lights
            for (int i=0; i<1; i++) {
                 // Get light direction (make sure to prevent zero devision)
                vec3 L = normalize(view_ray);    //lightDirs[i];
                float lightEnabled = float( length(L) > 0.0 );
                L = normalize(L + (1.0 - lightEnabled));

                // Calculate lighting properties
                float lambertTerm = clamp(dot(N, L), 0.0, 1.0);
                vec3 H = normalize(L+V); // Halfway vector
                float specularTerm = pow(max(dot(H, N), 0.0), shininess);

                // Calculate mask
                float mask1 = lightEnabled;

                // Calculate colors
                ambient_color +=    mask1 * ambient_color;    // * gl_LightSource[i].ambient;
                diffuse_color +=    mask1 * lambertTerm;
                specular_color += mask1 * specularTerm * specular_color;
            }

            // Calculate final color by componing different components
            vec4 final_color;
            vec4 color = apply_colormap(val);
            final_color = color * (ambient_color + diffuse_color) + specular_color;
            final_color.a = color.a;
            return final_color;
        }`};function m4t(){try{const t=document.createElement("canvas");return!!(window.WebGL2RenderingContext&&t.getContext("webgl2"))}catch{return!1}}class g4t{constructor(){Yt(this,"textures");this.textures={}}get(e,n){const r=rE(e);let i=this.textures[r];return i||(i=new f4t().load(`data:image/png;base64,${e.imageData}`,n),this.textures[r]=i),i}}const v4t=new g4t;class y4t{constructor(e){Yt(this,"canvas");Yt(this,"camera");Yt(this,"renderer");Yt(this,"scene");Yt(this,"material");if(!m4t())throw new Error("Missing WebGL2");this.render=this.render.bind(this);const n=new Bye({canvas:e});n.setPixelRatio(window.devicePixelRatio),n.setSize(e.clientWidth,e.clientHeight);const r=100,i=e.clientWidth/e.clientHeight,o=new Lye(-r*i,r*i,r,-r,-1e3,1e3);o.position.set(0,0,100),o.up.set(0,1,0);const a=new h4t(o,n.domElement);a.target.set(100,50,0),a.minZoom=.1,a.maxZoom=500,a.enablePan=!0,a.update(),this.canvas=e,this.renderer=n,this.camera=o,this.scene=null,this.material=null,a.addEventListener("change",this.render),e.addEventListener("resize",this.onCanvasResize)}setVolume(e,n){const r=new Cye(e.data,e.xLength,e.yLength,e.zLength);r.format=xye,r.type=Mf,r.minFilter=r.magFilter=Po,r.unpackAlignment=1,r.needsUpdate=!0;const i=p4t,o=kye.clone(i.uniforms),[a,s,l]=e.spacing,c=Math.floor(a*e.xLength),u=Math.floor(s*e.yLength),f=Math.floor(l*e.zLength);o.u_data.value=r,o.u_size.value.set(c,u,f);const d=new ud({uniforms:o,vertexShader:i.vertexShader,fragmentShader:i.fragmentShader,side:_a}),h=new Yy(c,u,f);h.translate(c/2,u/2,f/2);const p=new Bl(h,d),m=new r4t;m.add(p),m.add(new d4t(p)),this.scene=m,this.material=d,this.setVolumeOptions(n)}setVolumeOptions(e){const n=this.material;if(n!==null){const{value1:r,value2:i,isoThreshold:o,renderMode:a,colorBar:s}=e,l=n.uniforms;l.u_clim.value.set(r,i),l.u_renderthreshold.value=o,l.u_renderstyle.value=a==="mip"?0:a==="aip"?1:2,l.u_cmdata.value=v4t.get(s,this.render),this.render()}}getMaterial(){if(this.material===null)throw new Error("Volume not set!");return this.material}onCanvasResize(){console.warn("Alarm: Canvas resize!");const e=this.renderer.domElement;this.renderer.setSize(e.clientWidth,e.clientHeight);const n=e.clientWidth/e.clientHeight,r=this.camera.top-this.camera.bottom;this.camera.left=-r*n/2,this.camera.right=r*n/2,this.camera.updateProjectionMatrix(),this.render()}render(){this.scene!==null&&this.renderer.render(this.scene,this.camera)}}var pa=Uint8Array,Rh=Uint16Array,Uye=Uint32Array,Wye=new pa([0,0,0,0,0,0,0,0,1,1,1,1,2,2,2,2,3,3,3,3,4,4,4,4,5,5,5,5,0,0,0,0]),Vye=new pa([0,0,0,0,1,1,2,2,3,3,4,4,5,5,6,6,7,7,8,8,9,9,10,10,11,11,12,12,13,13,0,0]),x4t=new pa([16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15]),Gye=function(t,e){for(var n=new Rh(31),r=0;r<31;++r)n[r]=e+=1<<t[r-1];for(var i=new Uye(n[30]),r=1;r<30;++r)for(var o=n[r];o<n[r+1];++o)i[o]=o-n[r]<<5|r;return[n,i]},Hye=Gye(Wye,2),qye=Hye[0],b4t=Hye[1];qye[28]=258,b4t[258]=28;var _4t=Gye(Vye,0),w4t=_4t[0],kF=new Rh(32768);for(var Jn=0;Jn<32768;++Jn){var qu=(Jn&43690)>>>1|(Jn&21845)<<1;qu=(qu&52428)>>>2|(qu&13107)<<2,qu=(qu&61680)>>>4|(qu&3855)<<4,kF[Jn]=((qu&65280)>>>8|(qu&255)<<8)>>>1}var fb=function(t,e,n){for(var r=t.length,i=0,o=new Rh(e);i<r;++i)t[i]&&++o[t[i]-1];var a=new Rh(e);for(i=0;i<e;++i)a[i]=a[i-1]+o[i-1]<<1;var s;if(n){s=new Rh(1<<e);var l=15-e;for(i=0;i<r;++i)if(t[i])for(var c=i<<4|t[i],u=e-t[i],f=a[t[i]-1]++<<u,d=f|(1<<u)-1;f<=d;++f)s[kF[f]>>>l]=c}else for(s=new Rh(r),i=0;i<r;++i)t[i]&&(s[i]=kF[a[t[i]-1]++]>>>15-t[i]);return s},Fw=new pa(288);for(var Jn=0;Jn<144;++Jn)Fw[Jn]=8;for(var Jn=144;Jn<256;++Jn)Fw[Jn]=9;for(var Jn=256;Jn<280;++Jn)Fw[Jn]=7;for(var Jn=280;Jn<288;++Jn)Fw[Jn]=8;var Xye=new pa(32);for(var Jn=0;Jn<32;++Jn)Xye[Jn]=5;var S4t=fb(Fw,9,1),O4t=fb(Xye,5,1),CD=function(t){for(var e=t[0],n=1;n<t.length;++n)t[n]>e&&(e=t[n]);return e},Ls=function(t,e,n){var r=e/8|0;return(t[r]|t[r+1]<<8)>>(e&7)&n},TD=function(t,e){var n=e/8|0;return(t[n]|t[n+1]<<8|t[n+2]<<16)>>(e&7)},C4t=function(t){return(t+7)/8|0},T4t=function(t,e,n){(n==null||n>t.length)&&(n=t.length);var r=new(t.BYTES_PER_ELEMENT==2?Rh:t.BYTES_PER_ELEMENT==4?Uye:pa)(n-e);return r.set(t.subarray(e,n)),r},E4t=["unexpected EOF","invalid block type","invalid length/literal","invalid distance","stream finished","no stream handler",,"no callback","invalid UTF-8 data","extra field too long","date not in range 1980-2099","filename too long","stream finishing","invalid zip data"],Ic=function(t,e,n){var r=new Error(e||E4t[t]);if(r.code=t,Error.captureStackTrace&&Error.captureStackTrace(r,Ic),!n)throw r;return r},P4t=function(t,e,n){var r=t.length;if(!r||n&&n.f&&!n.l)return e||new pa(0);var i=!e||n,o=!n||n.i;n||(n={}),e||(e=new pa(r*3));var a=function(K){var se=e.length;if(K>se){var te=new pa(Math.max(se*2,K));te.set(e),e=te}},s=n.f||0,l=n.p||0,c=n.b||0,u=n.l,f=n.d,d=n.m,h=n.n,p=r*8;do{if(!u){s=Ls(t,l,1);var m=Ls(t,l+1,3);if(l+=3,m)if(m==1)u=S4t,f=O4t,d=9,h=5;else if(m==2){var x=Ls(t,l,31)+257,b=Ls(t,l+10,15)+4,_=x+Ls(t,l+5,31)+1;l+=14;for(var S=new pa(_),O=new pa(19),C=0;C<b;++C)O[x4t[C]]=Ls(t,l+C*3,7);l+=b*3;for(var E=CD(O),k=(1<<E)-1,I=fb(O,E,1),C=0;C<_;){var P=I[Ls(t,l,k)];l+=P&15;var g=P>>>4;if(g<16)S[C++]=g;else{var R=0,T=0;for(g==16?(T=3+Ls(t,l,3),l+=2,R=S[C-1]):g==17?(T=3+Ls(t,l,7),l+=3):g==18&&(T=11+Ls(t,l,127),l+=7);T--;)S[C++]=R}}var L=S.subarray(0,x),z=S.subarray(x);d=CD(L),h=CD(z),u=fb(L,d,1),f=fb(z,h,1)}else Ic(1);else{var g=C4t(l)+4,v=t[g-4]|t[g-3]<<8,y=g+v;if(y>r){o&&Ic(0);break}i&&a(c+v),e.set(t.subarray(g,y),c),n.b=c+=v,n.p=l=y*8,n.f=s;continue}if(l>p){o&&Ic(0);break}}i&&a(c+131072);for(var B=(1<<d)-1,U=(1<<h)-1,W=l;;W=l){var R=u[TD(t,l)&B],$=R>>>4;if(l+=R&15,l>p){o&&Ic(0);break}if(R||Ic(2),$<256)e[c++]=$;else if($==256){W=l,u=null;break}else{var N=$-254;if($>264){var C=$-257,D=Wye[C];N=Ls(t,l,(1<<D)-1)+qye[C],l+=D}var A=f[TD(t,l)&U],q=A>>>4;A||Ic(3),l+=A&15;var z=w4t[q];if(q>3){var D=Vye[q];z+=TD(t,l)&(1<<D)-1,l+=D}if(l>p){o&&Ic(0);break}i&&a(c+131072);for(var Y=c+N;c<Y;c+=4)e[c]=e[c-z],e[c+1]=e[c+1-z],e[c+2]=e[c+2-z],e[c+3]=e[c+3-z];c=Y}}n.l=u,n.p=W,n.b=c,n.f=s,u&&(s=1,n.m=d,n.d=f,n.n=h)}while(!s);return c==e.length?e:T4t(e,0,c)},M4t=new pa(0),k4t=function(t){(t[0]!=31||t[1]!=139||t[2]!=8)&&Ic(6,"invalid gzip data");var e=t[3],n=10;e&4&&(n+=t[10]|(t[11]<<8)+2);for(var r=(e>>3&1)+(e>>4&1);r>0;r-=!t[n++]);return n+(e&2)},A4t=function(t){var e=t.length;return(t[e-4]|t[e-3]<<8|t[e-2]<<16|t[e-1]<<24)>>>0};function R4t(t,e){return P4t(t.subarray(k4t(t),-8),new pa(A4t(t)))}var I4t=typeof TextDecoder<"u"&&new TextDecoder,D4t=0;try{I4t.decode(M4t,{stream:!0}),D4t=1}catch{}class L4t{constructor(e,n,r){const i=this;this.volume=e,n=n||0,Object.defineProperty(this,"index",{get:function(){return n},set:function(s){return n=s,i.geometryNeedsUpdate=!0,n}}),this.axis=r||"z",this.canvas=document.createElement("canvas"),this.canvasBuffer=document.createElement("canvas"),this.updateGeometry();const o=new Ta(this.canvas);o.minFilter=Po,o.wrapS=o.wrapT=qa;const a=new O6({map:o,side:Yc,transparent:!0});this.mesh=new Bl(this.geometry,a),this.mesh.matrixAutoUpdate=!1,this.geometryNeedsUpdate=!0,this.repaint()}repaint(){this.geometryNeedsUpdate&&this.updateGeometry();const e=this.iLength,n=this.jLength,r=this.sliceAccess,i=this.volume,o=this.canvasBuffer,a=this.ctxBuffer,s=a.getImageData(0,0,e,n),l=s.data,c=i.data,u=i.upperThreshold,f=i.lowerThreshold,d=i.windowLow,h=i.windowHigh;let p=0;if(i.dataType==="label")for(let m=0;m<n;m++)for(let g=0;g<e;g++){let v=c[r(g,m)];v=v>=this.colorMap.length?v%this.colorMap.length+1:v;const y=this.colorMap[v];l[4*p]=y>>24&255,l[4*p+1]=y>>16&255,l[4*p+2]=y>>8&255,l[4*p+3]=y&255,p++}else for(let m=0;m<n;m++)for(let g=0;g<e;g++){let v=c[r(g,m)],y=255;y=u>=v&&f<=v?y:0,v=Math.floor(255*(v-d)/(h-d)),v=v>255?255:v<0?0:v|0,l[4*p]=v,l[4*p+1]=v,l[4*p+2]=v,l[4*p+3]=y,p++}a.putImageData(s,0,0),this.ctx.drawImage(o,0,0,e,n,0,0,this.canvas.width,this.canvas.height),this.mesh.material.map.needsUpdate=!0}updateGeometry(){const e=this.volume.extractPerpendicularPlane(this.axis,this.index);this.sliceAccess=e.sliceAccess,this.jLength=e.jLength,this.iLength=e.iLength,this.matrix=e.matrix,this.canvas.width=e.planeWidth,this.canvas.height=e.planeHeight,this.canvasBuffer.width=this.iLength,this.canvasBuffer.height=this.jLength,this.ctx=this.canvas.getContext("2d"),this.ctxBuffer=this.canvasBuffer.getContext("2d"),this.geometry&&this.geometry.dispose(),this.geometry=new $k(e.planeWidth,e.planeHeight),this.mesh&&(this.mesh.geometry=this.geometry,this.mesh.matrix.identity(),this.mesh.applyMatrix4(this.matrix)),this.geometryNeedsUpdate=!1}}class N4t{constructor(e,n,r,i,o){if(e!==void 0){switch(this.xLength=Number(e)||1,this.yLength=Number(n)||1,this.zLength=Number(r)||1,this.axisOrder=["x","y","z"],i){case"Uint8":case"uint8":case"uchar":case"unsigned char":case"uint8_t":this.data=new Uint8Array(o);break;case"Int8":case"int8":case"signed char":case"int8_t":this.data=new Int8Array(o);break;case"Int16":case"int16":case"short":case"short int":case"signed short":case"signed short int":case"int16_t":this.data=new Int16Array(o);break;case"Uint16":case"uint16":case"ushort":case"unsigned short":case"unsigned short int":case"uint16_t":this.data=new Uint16Array(o);break;case"Int32":case"int32":case"int":case"signed int":case"int32_t":this.data=new Int32Array(o);break;case"Uint32":case"uint32":case"uint":case"unsigned int":case"uint32_t":this.data=new Uint32Array(o);break;case"longlong":case"long long":case"long long int":case"signed long long":case"signed long long int":case"int64":case"int64_t":case"ulonglong":case"unsigned long long":case"unsigned long long int":case"uint64":case"uint64_t":throw new Error("Error in Volume constructor : this type is not supported in JavaScript");case"Float32":case"float32":case"float":this.data=new Float32Array(o);break;case"Float64":case"float64":case"double":this.data=new Float64Array(o);break;default:this.data=new Uint8Array(o)}if(this.data.length!==this.xLength*this.yLength*this.zLength)throw new Error("Error in Volume constructor, lengths are not matching arrayBuffer size")}this.spacing=[1,1,1],this.offset=[0,0,0],this.matrix=new va,this.matrix.identity();let a=-1/0;Object.defineProperty(this,"lowerThreshold",{get:function(){return a},set:function(l){a=l,this.sliceList.forEach(function(c){c.geometryNeedsUpdate=!0})}});let s=1/0;Object.defineProperty(this,"upperThreshold",{get:function(){return s},set:function(l){s=l,this.sliceList.forEach(function(c){c.geometryNeedsUpdate=!0})}}),this.sliceList=[]}getData(e,n,r){return this.data[r*this.xLength*this.yLength+n*this.xLength+e]}access(e,n,r){return r*this.xLength*this.yLength+n*this.xLength+e}reverseAccess(e){const n=Math.floor(e/(this.yLength*this.xLength)),r=Math.floor((e-n*this.yLength*this.xLength)/this.xLength);return[e-n*this.yLength*this.xLength-r*this.xLength,r,n]}map(e,n){const r=this.data.length;n=n||this;for(let i=0;i<r;i++)this.data[i]=e.call(n,this.data[i],i,this.data);return this}extractPerpendicularPlane(e,n){let r,i,o,a;const s=new Se,l=new Se,c=new Se,u=new Hn().identity(),f=this,d=new Se(this.xLength,this.yLength,this.zLength);switch(e){case"x":s.set(1,0,0),l.set(0,0,-1),c.set(0,-1,0),r=this.spacing[this.axisOrder.indexOf("z")],i=this.spacing[this.axisOrder.indexOf("y")],a=new Se(n,0,0),u.multiply(new Hn().makeRotationY(Math.PI/2)),o=(f.RASDimensions[0]-1)/2,u.setPosition(new Se(n-o,0,0));break;case"y":s.set(0,1,0),l.set(1,0,0),c.set(0,0,1),r=this.spacing[this.axisOrder.indexOf("x")],i=this.spacing[this.axisOrder.indexOf("z")],a=new Se(0,n,0),u.multiply(new Hn().makeRotationX(-Math.PI/2)),o=(f.RASDimensions[1]-1)/2,u.setPosition(new Se(0,n-o,0));break;case"z":default:s.set(0,0,1),l.set(1,0,0),c.set(0,-1,0),r=this.spacing[this.axisOrder.indexOf("x")],i=this.spacing[this.axisOrder.indexOf("y")],a=new Se(0,0,n),o=(f.RASDimensions[2]-1)/2,u.setPosition(new Se(0,0,n-o));break}l.applyMatrix4(f.inverseMatrix).normalize(),l.arglet="i",c.applyMatrix4(f.inverseMatrix).normalize(),c.arglet="j",s.applyMatrix4(f.inverseMatrix).normalize();const h=Math.floor(Math.abs(l.dot(d))),p=Math.floor(Math.abs(c.dot(d))),m=Math.abs(h*r),g=Math.abs(p*i);a=Math.abs(Math.round(a.applyMatrix4(f.inverseMatrix).dot(s)));const v=[new Se(1,0,0),new Se(0,1,0),new Se(0,0,1)],y=[l,c,s].find(function(S){return Math.abs(S.dot(v[0]))>.9}),x=[l,c,s].find(function(S){return Math.abs(S.dot(v[1]))>.9}),b=[l,c,s].find(function(S){return Math.abs(S.dot(v[2]))>.9});function _(S,O){const C=y===s?a:y.arglet==="i"?S:O,E=x===s?a:x.arglet==="i"?S:O,k=b===s?a:b.arglet==="i"?S:O,I=y.dot(v[0])>0?C:f.xLength-1-C,P=x.dot(v[1])>0?E:f.yLength-1-E,R=b.dot(v[2])>0?k:f.zLength-1-k;return f.access(I,P,R)}return{iLength:h,jLength:p,sliceAccess:_,matrix:u,planeWidth:m,planeHeight:g}}extractSlice(e,n){const r=new L4t(this,n,e);return this.sliceList.push(r),r}repaintAllSlices(){return this.sliceList.forEach(function(e){e.repaint()}),this}computeMinMax(){let e=1/0,n=-1/0;const r=this.data.length;let i=0;for(i=0;i<r;i++)if(!isNaN(this.data[i])){const o=this.data[i];e=Math.min(e,o),n=Math.max(n,o)}return this.min=e,this.max=n,[e,n]}}class $4t extends jk{constructor(e){super(e)}load(e,n,r,i){const o=this,a=new c4t(o.manager);a.setPath(o.path),a.setResponseType("arraybuffer"),a.setRequestHeader(o.requestHeader),a.setWithCredentials(o.withCredentials),a.load(e,function(s){try{n(o.parse(s))}catch(l){i?i(l):console.error(l),o.manager.itemError(e)}},r,i)}parse(e){let n=e,r=0;const i=new Int8Array(new Int16Array([1]).buffer)[0]>0,o=!0,a={};function s(C,E){E==null&&(E=1);let k=1,I=Uint8Array;switch(C){case"uchar":break;case"schar":I=Int8Array;break;case"ushort":I=Uint16Array,k=2;break;case"sshort":I=Int16Array,k=2;break;case"uint":I=Uint32Array,k=4;break;case"sint":I=Int32Array,k=4;break;case"float":I=Float32Array,k=4;break;case"complex":I=Float64Array,k=8;break;case"double":I=Float64Array,k=8;break}let P=new I(n.slice(r,r+=E*k));return i!==o&&(P=l(P,k)),E===1?P[0]:P}function l(C,E){const k=new Uint8Array(C.buffer,C.byteOffset,C.byteLength);for(let I=0;I<C.byteLength;I+=E)for(let P=I+E-1,R=I;P>R;P--,R++){const T=k[R];k[R]=k[P],k[P]=T}return C}function c(C){let E,k,I,P,R,T,L,z;const B=C.split(/\r?\n/);for(L=0,z=B.length;L<z;L++)R=B[L],R.match(/NRRD\d+/)?a.isNrrd=!0:!R.match(/^#/)&&(T=R.match(/(.*):(.*)/))&&(k=T[1].trim(),E=T[2].trim(),I=F4t[k],I?I.call(a,E):a[k]=E);if(!a.isNrrd)throw new Error("Not an NRRD file");if(a.encoding==="bz2"||a.encoding==="bzip2")throw new Error("Bzip is not supported");if(!a.vectors&&(a.vectors=[],a.vectors.push([1,0,0]),a.vectors.push([0,1,0]),a.vectors.push([0,0,1]),a.spacings)){for(P=0;P<=2;P++)if(!isNaN(a.spacings[P]))for(let U=0;U<=2;U++)a.vectors[P][U]*=a.spacings[P]}}function u(C,E,k){let I="";E=E||0,k=k||C.length;let P;const R=a.sizes.reduce(function(U,W){return U*W},1);let T=10;a.encoding==="hex"&&(T=16);const L=new a.__array(R);let z=0,B=parseInt;(a.__array===Float32Array||a.__array===Float64Array)&&(B=parseFloat);for(let U=E;U<k;U++)P=C[U],(P<9||P>13)&&P!==32?I+=String.fromCharCode(P):(I!==""&&(L[z]=B(I,T),z++),I="");return I!==""&&(L[z]=B(I,T),z++),L}const f=s("uchar",e.byteLength),d=f.length;let h=null,p=0,m;for(m=1;m<d;m++)if(f[m-1]===10&&f[m]===10){h=this.parseChars(f,0,m-2),p=m+1;break}if(c(h),n=f.subarray(p),a.encoding.substring(0,2)==="gz")n=R4t(new Uint8Array(n));else if(a.encoding==="ascii"||a.encoding==="text"||a.encoding==="txt"||a.encoding==="hex")n=u(n);else if(a.encoding==="raw"){const C=new Uint8Array(n.length);for(let E=0;E<n.length;E++)C[E]=n[E];n=C}n=n.buffer;const g=new N4t;g.header=a,g.data=new a.__array(n);const v=g.computeMinMax(),y=v[0],x=v[1];if(g.windowLow=y,g.windowHigh=x,g.dimensions=[a.sizes[0],a.sizes[1],a.sizes[2]],g.xLength=g.dimensions[0],g.yLength=g.dimensions[1],g.zLength=g.dimensions[2],a.vectors){const C=a.vectors.findIndex(P=>P[0]!==0),E=a.vectors.findIndex(P=>P[1]!==0),k=a.vectors.findIndex(P=>P[2]!==0),I=[];I[C]="x",I[E]="y",I[k]="z",g.axisOrder=I}else g.axisOrder=["x","y","z"];const b=new Se().fromArray(a.vectors[0]).length(),_=new Se().fromArray(a.vectors[1]).length(),S=new Se().fromArray(a.vectors[2]).length();g.spacing=[b,_,S],g.matrix=new Hn;const O=new Hn;if(a.space==="left-posterior-superior"?O.set(-1,0,0,0,0,-1,0,0,0,0,1,0,0,0,0,1):a.space==="left-anterior-superior"&&O.set(1,0,0,0,0,1,0,0,0,0,-1,0,0,0,0,1),!a.vectors)g.matrix.set(1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1);else{const C=a.vectors,E=new Hn().set(C[0][0],C[1][0],C[2][0],0,C[0][1],C[1][1],C[2][1],0,C[0][2],C[1][2],C[2][2],0,0,0,0,1);g.matrix=new Hn().multiplyMatrices(E,O)}return g.inverseMatrix=new Hn,g.inverseMatrix.copy(g.matrix).invert(),g.RASDimensions=new Se(g.xLength,g.yLength,g.zLength).applyMatrix4(g.matrix).round().toArray().map(Math.abs),g.lowerThreshold===-1/0&&(g.lowerThreshold=y),g.upperThreshold===1/0&&(g.upperThreshold=x),g}parseChars(e,n,r){n===void 0&&(n=0),r===void 0&&(r=e.length);let i="",o;for(o=n;o<r;++o)i+=String.fromCharCode(e[o]);return i}}const F4t={type:function(t){switch(t){case"uchar":case"unsigned char":case"uint8":case"uint8_t":this.__array=Uint8Array;break;case"signed char":case"int8":case"int8_t":this.__array=Int8Array;break;case"short":case"short int":case"signed short":case"signed short int":case"int16":case"int16_t":this.__array=Int16Array;break;case"ushort":case"unsigned short":case"unsigned short int":case"uint16":case"uint16_t":this.__array=Uint16Array;break;case"int":case"signed int":case"int32":case"int32_t":this.__array=Int32Array;break;case"uint":case"unsigned int":case"uint32":case"uint32_t":this.__array=Uint32Array;break;case"float":this.__array=Float32Array;break;case"double":this.__array=Float64Array;break;default:throw new Error("Unsupported NRRD data type: "+t)}return this.type=t},endian:function(t){return this.endian=t},encoding:function(t){return this.encoding=t},dimension:function(t){return this.dim=parseInt(t,10)},sizes:function(t){let e;return this.sizes=function(){const n=t.split(/\s+/),r=[];for(let i=0,o=n.length;i<o;i++)e=n[i],r.push(parseInt(e,10));return r}()},space:function(t){return this.space=t},"space origin":function(t){return this.space_origin=t.split("(")[1].split(")")[0].split(",")},"space directions":function(t){let e,n;const r=t.match(/\(.*?\)/g);return this.vectors=function(){const i=[];for(let o=0,a=r.length;o<a;o++)n=r[o],i.push(function(){const s=n.slice(1,-1).split(/,/),l=[];for(let c=0,u=s.length;c<u;c++)e=s[c],l.push(parseFloat(e));return l}());return i}()},spacings:function(t){let e;const n=t.split(/\s+/);return this.spacings=function(){const r=[];for(let i=0,o=n.length;i<o;i++)e=n[i],r.push(parseFloat(e));return r}()}},j4t={width:"100%",height:"680px"},MJ={width:"100%",display:"flex",justifyContent:"center",margin:"1em",flexDirection:"column",alignItems:"center"},B4t={color:"orange",position:"absolute",bottom:8,right:8,zIndex:10},z4t=w.jsx(At,{variant:"body2",style:B4t,className:"hint_wrap",children:"Press LMB to rotate, plus CTRL-key to shift."}),U4t={position:"relative"},ED={};class db extends ue.PureComponent{constructor(n){super(n);Yt(this,"volumeScene");Yt(this,"canvasRef");this.canvasRef=ue.createRef(),this.volumeScene=null,this.handleLoadVolume=this.handleLoadVolume.bind(this)}static getVolumeOptions(n){const{selectedVariable:r,variableColorBar:i,volumeIsoThreshold:o,volumeRenderMode:a}=n;return{value1:r?r.colorBarMin:0,value2:r?r.colorBarMax:1,renderMode:a,isoThreshold:o,colorBar:i}}componentDidMount(){this.updateVolumeScene()}componentDidUpdate(n){this.updateVolumeScene()}componentWillUnmount(){this.volumeScene=null}handleLoadVolume(){const n=this.volumeScene;if(n!==null){const{selectedDataset:r,selectedVariable:i,selectedPlaceInfo:o,volumeId:a,updateVolumeState:s}=this.props;if(r&&i&&a){s(a,{status:"loading"});let l="";if(o){let f=null;if(o.place.geometry.type==="Polygon")f=kJ(o.place.geometry.coordinates[0]);else if(o.place.geometry.type==="MultiPolygon"){const d=[];for(let h=0;h<o.place.geometry.coordinates.length;h++)d.push(kJ(o.place.geometry.coordinates[h][0]));f=W4t(d)}f!==null&&(l=`&bbox=${f[0]},${f[1]},${f[2]},${f[3]}`)}const c=`dummy=${new Date().toLocaleTimeString()}`,u=`${this.props.serverUrl}/volumes/${ly(r)}/${G1(i)}?${c}${l}`;new $4t().load(u,f=>{n.setVolume(f,db.getVolumeOptions(this.props)),ED[a]=f,s(a,{status:"ok"})},()=>{},f=>{f.response instanceof Response?f.response.json().then(d=>{const h=d.error,p=!!h&&h.message;h&&h.exception&&console.debug("exception:",h.exception),s(a,{status:"error",message:p||`${f}`})}):s(a,{status:"error",message:`${f}`})})}}}render(){const{volumeId:n}=this.props;let r,i;if(!n)r=[w.jsx(At,{variant:"subtitle2",children:"Cannot display 3D volume"},"subtitle2"),w.jsx(At,{variant:"body2",children:"To display a volume, a variable and a place that represents an area must be selected. Please note that the 3D volume rendering is still an experimental feature."},"body2")];else{const o=this.props.volumeStates[n];(!o||o.status==="error"||!ED[n])&&(i=[w.jsx(tr,{onClick:this.handleLoadVolume,disabled:!!o&&o.status==="loading",children:fe.get("Load Volume Data")},"load"),w.jsx(At,{variant:"body2",children:fe.get("Please note that the 3D volume rendering is still an experimental feature.")},"note")]),o&&(o.status==="loading"?r=w.jsx(ey,{style:{margin:10}}):o.status==="error"&&(r=w.jsx(At,{variant:"body2",color:"red",children:`Failed loading volume: ${o.message}`})))}return r&&(r=w.jsx("div",{style:MJ,children:r})),i&&(i=w.jsx("div",{style:MJ,children:i})),w.jsxs("div",{style:U4t,children:[i,r,w.jsx("canvas",{id:"VolumeCanvas-canvas",ref:this.canvasRef,style:j4t}),!r&&!i&&z4t]})}updateVolumeScene(){const n=this.canvasRef.current;if(n===null){this.volumeScene=null;return}let r;this.props.volumeId&&(r=ED[this.props.volumeId]);let i=!1;(this.volumeScene===null||this.volumeScene.canvas!==n)&&(this.volumeScene=new y4t(n),i=!0),i&&r?this.volumeScene.setVolume(r,db.getVolumeOptions(this.props)):this.volumeScene.setVolumeOptions(db.getVolumeOptions(this.props))}}function kJ(t){let e=Number.POSITIVE_INFINITY,n=Number.POSITIVE_INFINITY,r=Number.NEGATIVE_INFINITY,i=Number.NEGATIVE_INFINITY;for(const o of t){const a=o[0],s=o[1];e=Math.min(e,a),n=Math.min(n,s),r=Math.max(r,a),i=Math.max(i,s)}return[e,n,r,i]}function W4t(t){let[e,n,r,i]=t[0];for(const o of t.slice(1))e=Math.min(e,o[0]),n=Math.min(n,o[1]),r=Math.max(r,o[2]),i=Math.max(i,o[3]);return[e,n,r,i]}const DP={card:t=>({maxWidth:"100%",marginBottom:t.spacing(1),marginRight:t.spacing(1)}),info:t=>({marginRight:t.spacing(1)}),close:{marginLeft:"auto"},cardContent:{padding:8},isoEditor:{display:"flex",flexDirection:"row"},isoTextField:{minWidth:"16em",marginLeft:"1em"},isoSlider:{minWidth:200}},V4t=({selectedDataset:t,selectedVariable:e,selectedPlaceInfo:n,variableColorBar:r,volumeId:i,volumeRenderMode:o,setVolumeRenderMode:a,volumeStates:s,updateVolumeState:l,updateVariableVolume:c,serverUrl:u})=>{let f=.5;e&&(typeof e.volumeIsoThreshold=="number"?f=e.volumeIsoThreshold:f=.5*(e.colorBarMin+e.colorBarMax),typeof e.volumeRenderMode=="string"&&(o=e.volumeRenderMode));const d=p=>{c(t.id,e.name,r,o,p)},h=(p,m)=>{m!==null&&(a(m),e&&c(t.id,e.name,r,m,f))};return w.jsxs(Ure,{sx:DP.card,children:[w.jsx(Wre,{disableSpacing:!0,children:e&&w.jsxs(w.Fragment,{children:[w.jsxs(iy,{size:"small",exclusive:!0,value:o,onChange:h,children:[w.jsx(Pn,{value:"mip",size:"small",children:w.jsx(_t,{arrow:!0,title:"Maximum intensity projection",children:w.jsx("span",{children:"MIP"})})},"mip"),w.jsx(Pn,{value:"aip",size:"small",children:w.jsx(_t,{arrow:!0,title:"Average intensity projection",children:w.jsx("span",{children:"AIP"})})},"aip"),w.jsx(Pn,{value:"iso",size:"small",children:w.jsx(_t,{arrow:!0,title:"Iso-surface extraction",children:w.jsx("span",{children:"ISO"})})},"iso")]},0),o==="iso"&&w.jsx(G4t,{minValue:e.colorBarMin,maxValue:e.colorBarMax,value:f,setValue:d})]})}),w.jsx(Vre,{sx:DP.cardContent,children:w.jsx(db,{selectedDataset:t,selectedVariable:e,selectedPlaceInfo:n,variableColorBar:r,volumeRenderMode:o,volumeIsoThreshold:f,volumeId:i,volumeStates:s,updateVolumeState:l,serverUrl:u})})]})},G4t=({value:t,minValue:e,maxValue:n,setValue:r,disabled:i})=>{const[o,a]=ue.useState(t),[s,l]=ue.useState(""+t),[c,u]=ue.useState(null);function f(m){const g=m.target.value||"";l(g);const v=parseFloat(g);Number.isNaN(v)?u("Not a number"):v<e||v>n?u("Out of range"):u(null)}function d(m){if(m.key==="Enter"&&!c){const g=parseFloat(s);a(g),r(g)}}function h(m,g){a(g),l(g.toFixed(2))}function p(m,g){r(g)}return w.jsx(cr,{sx:DP.isoTextField,disabled:i,label:"Iso-Threshold",variant:"filled",size:"small",value:s,error:c!==null,onChange:f,onKeyPress:d,InputProps:{endAdornment:w.jsx(ry,{size:"small",sx:DP.isoSlider,min:e,max:n,value:o,step:(n-e)/20,onChange:h,onChangeCommitted:p})}})},H4t=t=>({locale:t.controlState.locale,selectedDataset:qr(t),selectedVariable:vo(t),selectedPlaceInfo:iw(t),variableColorBar:HB(t),volumeRenderMode:t.controlState.volumeRenderMode,volumeId:KWe(t),volumeStates:t.controlState.volumeStates,serverUrl:pi(t).url}),q4t={setVolumeRenderMode:$8e,updateVolumeState:F8e,updateVariableVolume:m8e},X4t=Jt(H4t,q4t)(V4t),Q4t={info:w.jsx(f4,{fontSize:"inherit"}),timeSeries:w.jsx(hfe,{fontSize:"inherit"}),stats:w.jsx(Ez,{fontSize:"inherit"}),volume:w.jsx(pfe,{fontSize:"inherit"})},Y4t={info:"Info",timeSeries:"Time-Series",stats:"Statistics",volume:"Volume"},PD={tabs:{minHeight:"34px"},tab:{padding:"5px 10px",textTransform:"none",fontWeight:"regular",minHeight:"32px"},tabBoxHeader:{borderBottom:1,borderColor:"divider",position:"sticky",top:0,zIndex:1100,backgroundColor:"background.paper"}},K4t=t=>({sidebarPanelId:t.controlState.sidebarPanelId}),Z4t={setSidebarPanelId:sz};function J4t({sidebarPanelId:t,setSidebarPanelId:e}){return w.jsxs(Ke,{sx:{width:"100%"},children:[w.jsx(Ke,{sx:PD.tabBoxHeader,children:w.jsx(A5,{value:t,onChange:(n,r)=>{e(r)},variant:"scrollable",sx:PD.tabs,children:nWe.map(n=>w.jsx($b,{icon:Q4t[n],iconPosition:"start",sx:PD.tab,disableRipple:!0,value:n,label:fe.get(Y4t[n])},n))})}),t==="info"&&w.jsx(Cdt,{}),t==="stats"&&w.jsx(f$t,{}),t==="timeSeries"&&w.jsx(QNt,{}),t==="volume"&&w.jsx(X4t,{})]})}const eUt=Jt(K4t,Z4t)(J4t),iC={containerHor:{flexGrow:1,overflow:"hidden"},containerVer:{flexGrow:1,overflowX:"hidden",overflowY:"auto"},viewerHor:{height:"100%",overflow:"hidden",padding:0},viewerVer:{width:"100%",overflow:"hidden",padding:0},sidebarHor:{flex:"auto",overflowX:"hidden",overflowY:"auto"},sidebarVer:{width:"100%",overflow:"hidden"},viewer:{overflow:"hidden",width:"100%",height:"100%"}},tUt=t=>({sidebarOpen:t.controlState.sidebarOpen,sidebarPosition:t.controlState.sidebarPosition}),nUt={setSidebarPosition:N8e},AJ=()=>window.innerWidth/window.innerHeight>=1?"hor":"ver";function rUt({sidebarOpen:t,sidebarPosition:e,setSidebarPosition:n}){const[r,i]=M.useState(null),[o,a]=M.useState(AJ()),s=M.useRef(null),l=Go();M.useEffect(()=>(c(),s.current=new ResizeObserver(c),s.current.observe(document.documentElement),()=>{s.current&&s.current.disconnect()}),[]),M.useEffect(()=>{r&&r.updateSize()},[r,e]);const c=()=>{a(AJ())},u=o==="hor"?"Hor":"Ver";return t?w.jsxs(htt,{dir:o,splitPosition:e,setSplitPosition:n,style:iC["container"+u],child1Style:iC["viewer"+u],child2Style:iC["sidebar"+u],children:[w.jsx(t7,{onMapRef:i,theme:l}),w.jsx(eUt,{})]}):w.jsx("div",{style:iC.viewer,children:w.jsx(t7,{onMapRef:i,theme:l})})}const iUt=Jt(tUt,nUt)(rUt);var Bk={exports:{}},Qye={};function Yye(t){var e,n,r="";if(typeof t=="string"||typeof t=="number")r+=t;else if(typeof t=="object")if(Array.isArray(t))for(e=0;e<t.length;e++)t[e]&&(n=Yye(t[e]))&&(r&&(r+=" "),r+=n);else for(e in t)t[e]&&(r&&(r+=" "),r+=e);return r}function RJ(){for(var t,e,n=0,r="";n<arguments.length;)(t=arguments[n++])&&(e=Yye(t))&&(r&&(r+=" "),r+=e);return r}const oUt=Object.freeze(Object.defineProperty({__proto__:null,clsx:RJ,default:RJ},Symbol.toStringTag,{value:"Module"})),aUt=Ea(oUt);var Or={},hc={};Object.defineProperty(hc,"__esModule",{value:!0});hc.dontSetMe=fUt;hc.findInArray=sUt;hc.int=uUt;hc.isFunction=lUt;hc.isNum=cUt;function sUt(t,e){for(let n=0,r=t.length;n<r;n++)if(e.apply(e,[t[n],n,t]))return t[n]}function lUt(t){return typeof t=="function"||Object.prototype.toString.call(t)==="[object Function]"}function cUt(t){return typeof t=="number"&&!isNaN(t)}function uUt(t){return parseInt(t,10)}function fUt(t,e,n){if(t[e])return new Error("Invalid prop ".concat(e," passed to ").concat(n," - do not set this, set it on the child."))}var qp={};Object.defineProperty(qp,"__esModule",{value:!0});qp.browserPrefixToKey=Zye;qp.browserPrefixToStyle=dUt;qp.default=void 0;qp.getPrefix=Kye;const MD=["Moz","Webkit","O","ms"];function Kye(){var t;let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:"transform";if(typeof window>"u")return"";const n=(t=window.document)===null||t===void 0||(t=t.documentElement)===null||t===void 0?void 0:t.style;if(!n||e in n)return"";for(let r=0;r<MD.length;r++)if(Zye(e,MD[r])in n)return MD[r];return""}function Zye(t,e){return e?"".concat(e).concat(hUt(t)):t}function dUt(t,e){return e?"-".concat(e.toLowerCase(),"-").concat(t):t}function hUt(t){let e="",n=!0;for(let r=0;r<t.length;r++)n?(e+=t[r].toUpperCase(),n=!1):t[r]==="-"?n=!0:e+=t[r];return e}qp.default=Kye();Object.defineProperty(Or,"__esModule",{value:!0});Or.addClassName=t0e;Or.addEvent=gUt;Or.addUserSelectStyles=EUt;Or.createCSSTransform=SUt;Or.createSVGTransform=OUt;Or.getTouch=CUt;Or.getTouchIdentifier=TUt;Or.getTranslation=T6;Or.innerHeight=bUt;Or.innerWidth=_Ut;Or.matchesSelector=e0e;Or.matchesSelectorAndParentsTo=mUt;Or.offsetXYFromParent=wUt;Or.outerHeight=yUt;Or.outerWidth=xUt;Or.removeClassName=n0e;Or.removeEvent=vUt;Or.removeUserSelectStyles=PUt;var wa=hc,IJ=pUt(qp);function Jye(t){if(typeof WeakMap!="function")return null;var e=new WeakMap,n=new WeakMap;return(Jye=function(r){return r?n:e})(t)}function pUt(t,e){if(t&&t.__esModule)return t;if(t===null||typeof t!="object"&&typeof t!="function")return{default:t};var n=Jye(e);if(n&&n.has(t))return n.get(t);var r={},i=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var o in t)if(o!=="default"&&Object.prototype.hasOwnProperty.call(t,o)){var a=i?Object.getOwnPropertyDescriptor(t,o):null;a&&(a.get||a.set)?Object.defineProperty(r,o,a):r[o]=t[o]}return r.default=t,n&&n.set(t,r),r}let oC="";function e0e(t,e){return oC||(oC=(0,wa.findInArray)(["matches","webkitMatchesSelector","mozMatchesSelector","msMatchesSelector","oMatchesSelector"],function(n){return(0,wa.isFunction)(t[n])})),(0,wa.isFunction)(t[oC])?t[oC](e):!1}function mUt(t,e,n){let r=t;do{if(e0e(r,e))return!0;if(r===n)return!1;r=r.parentNode}while(r);return!1}function gUt(t,e,n,r){if(!t)return;const i={capture:!0,...r};t.addEventListener?t.addEventListener(e,n,i):t.attachEvent?t.attachEvent("on"+e,n):t["on"+e]=n}function vUt(t,e,n,r){if(!t)return;const i={capture:!0,...r};t.removeEventListener?t.removeEventListener(e,n,i):t.detachEvent?t.detachEvent("on"+e,n):t["on"+e]=null}function yUt(t){let e=t.clientHeight;const n=t.ownerDocument.defaultView.getComputedStyle(t);return e+=(0,wa.int)(n.borderTopWidth),e+=(0,wa.int)(n.borderBottomWidth),e}function xUt(t){let e=t.clientWidth;const n=t.ownerDocument.defaultView.getComputedStyle(t);return e+=(0,wa.int)(n.borderLeftWidth),e+=(0,wa.int)(n.borderRightWidth),e}function bUt(t){let e=t.clientHeight;const n=t.ownerDocument.defaultView.getComputedStyle(t);return e-=(0,wa.int)(n.paddingTop),e-=(0,wa.int)(n.paddingBottom),e}function _Ut(t){let e=t.clientWidth;const n=t.ownerDocument.defaultView.getComputedStyle(t);return e-=(0,wa.int)(n.paddingLeft),e-=(0,wa.int)(n.paddingRight),e}function wUt(t,e,n){const i=e===e.ownerDocument.body?{left:0,top:0}:e.getBoundingClientRect(),o=(t.clientX+e.scrollLeft-i.left)/n,a=(t.clientY+e.scrollTop-i.top)/n;return{x:o,y:a}}function SUt(t,e){const n=T6(t,e,"px");return{[(0,IJ.browserPrefixToKey)("transform",IJ.default)]:n}}function OUt(t,e){return T6(t,e,"")}function T6(t,e,n){let{x:r,y:i}=t,o="translate(".concat(r).concat(n,",").concat(i).concat(n,")");if(e){const a="".concat(typeof e.x=="string"?e.x:e.x+n),s="".concat(typeof e.y=="string"?e.y:e.y+n);o="translate(".concat(a,", ").concat(s,")")+o}return o}function CUt(t,e){return t.targetTouches&&(0,wa.findInArray)(t.targetTouches,n=>e===n.identifier)||t.changedTouches&&(0,wa.findInArray)(t.changedTouches,n=>e===n.identifier)}function TUt(t){if(t.targetTouches&&t.targetTouches[0])return t.targetTouches[0].identifier;if(t.changedTouches&&t.changedTouches[0])return t.changedTouches[0].identifier}function EUt(t){if(!t)return;let e=t.getElementById("react-draggable-style-el");e||(e=t.createElement("style"),e.type="text/css",e.id="react-draggable-style-el",e.innerHTML=`.react-draggable-transparent-selection *::-moz-selection {all: inherit;}
`,e.innerHTML+=`.react-draggable-transparent-selection *::selection {all: inherit;}
`,t.getElementsByTagName("head")[0].appendChild(e)),t.body&&t0e(t.body,"react-draggable-transparent-selection")}function PUt(t){if(t)try{if(t.body&&n0e(t.body,"react-draggable-transparent-selection"),t.selection)t.selection.empty();else{const e=(t.defaultView||window).getSelection();e&&e.type!=="Caret"&&e.removeAllRanges()}}catch{}}function t0e(t,e){t.classList?t.classList.add(e):t.className.match(new RegExp("(?:^|\\s)".concat(e,"(?!\\S)")))||(t.className+=" ".concat(e))}function n0e(t,e){t.classList?t.classList.remove(e):t.className=t.className.replace(new RegExp("(?:^|\\s)".concat(e,"(?!\\S)"),"g"),"")}var pc={};Object.defineProperty(pc,"__esModule",{value:!0});pc.canDragX=AUt;pc.canDragY=RUt;pc.createCoreData=DUt;pc.createDraggableData=LUt;pc.getBoundPosition=MUt;pc.getControlPosition=IUt;pc.snapToGrid=kUt;var oa=hc,ug=Or;function MUt(t,e,n){if(!t.props.bounds)return[e,n];let{bounds:r}=t.props;r=typeof r=="string"?r:NUt(r);const i=E6(t);if(typeof r=="string"){const{ownerDocument:o}=i,a=o.defaultView;let s;if(r==="parent"?s=i.parentNode:s=o.querySelector(r),!(s instanceof a.HTMLElement))throw new Error('Bounds selector "'+r+'" could not find an element.');const l=s,c=a.getComputedStyle(i),u=a.getComputedStyle(l);r={left:-i.offsetLeft+(0,oa.int)(u.paddingLeft)+(0,oa.int)(c.marginLeft),top:-i.offsetTop+(0,oa.int)(u.paddingTop)+(0,oa.int)(c.marginTop),right:(0,ug.innerWidth)(l)-(0,ug.outerWidth)(i)-i.offsetLeft+(0,oa.int)(u.paddingRight)-(0,oa.int)(c.marginRight),bottom:(0,ug.innerHeight)(l)-(0,ug.outerHeight)(i)-i.offsetTop+(0,oa.int)(u.paddingBottom)-(0,oa.int)(c.marginBottom)}}return(0,oa.isNum)(r.right)&&(e=Math.min(e,r.right)),(0,oa.isNum)(r.bottom)&&(n=Math.min(n,r.bottom)),(0,oa.isNum)(r.left)&&(e=Math.max(e,r.left)),(0,oa.isNum)(r.top)&&(n=Math.max(n,r.top)),[e,n]}function kUt(t,e,n){const r=Math.round(e/t[0])*t[0],i=Math.round(n/t[1])*t[1];return[r,i]}function AUt(t){return t.props.axis==="both"||t.props.axis==="x"}function RUt(t){return t.props.axis==="both"||t.props.axis==="y"}function IUt(t,e,n){const r=typeof e=="number"?(0,ug.getTouch)(t,e):null;if(typeof e=="number"&&!r)return null;const i=E6(n),o=n.props.offsetParent||i.offsetParent||i.ownerDocument.body;return(0,ug.offsetXYFromParent)(r||t,o,n.props.scale)}function DUt(t,e,n){const r=!(0,oa.isNum)(t.lastX),i=E6(t);return r?{node:i,deltaX:0,deltaY:0,lastX:e,lastY:n,x:e,y:n}:{node:i,deltaX:e-t.lastX,deltaY:n-t.lastY,lastX:t.lastX,lastY:t.lastY,x:e,y:n}}function LUt(t,e){const n=t.props.scale;return{node:e.node,x:t.state.x+e.deltaX/n,y:t.state.y+e.deltaY/n,deltaX:e.deltaX/n,deltaY:e.deltaY/n,lastX:t.state.x,lastY:t.state.y}}function NUt(t){return{left:t.left,top:t.top,right:t.right,bottom:t.bottom}}function E6(t){const e=t.findDOMNode();if(!e)throw new Error("<DraggableCore>: Unmounted during event!");return e}var zk={},Uk={};Object.defineProperty(Uk,"__esModule",{value:!0});Uk.default=$Ut;function $Ut(){}Object.defineProperty(zk,"__esModule",{value:!0});zk.default=void 0;var kD=jUt(M),bo=P6(p1),FUt=P6(qv),ji=Or,Xu=pc,AD=hc,K0=P6(Uk);function P6(t){return t&&t.__esModule?t:{default:t}}function r0e(t){if(typeof WeakMap!="function")return null;var e=new WeakMap,n=new WeakMap;return(r0e=function(r){return r?n:e})(t)}function jUt(t,e){if(t&&t.__esModule)return t;if(t===null||typeof t!="object"&&typeof t!="function")return{default:t};var n=r0e(e);if(n&&n.has(t))return n.get(t);var r={},i=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var o in t)if(o!=="default"&&Object.prototype.hasOwnProperty.call(t,o)){var a=i?Object.getOwnPropertyDescriptor(t,o):null;a&&(a.get||a.set)?Object.defineProperty(r,o,a):r[o]=t[o]}return r.default=t,n&&n.set(t,r),r}function ao(t,e,n){return e=BUt(e),e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function BUt(t){var e=zUt(t,"string");return typeof e=="symbol"?e:String(e)}function zUt(t,e){if(typeof t!="object"||t===null)return t;var n=t[Symbol.toPrimitive];if(n!==void 0){var r=n.call(t,e||"default");if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}const Ns={touch:{start:"touchstart",move:"touchmove",stop:"touchend"},mouse:{start:"mousedown",move:"mousemove",stop:"mouseup"}};let Qu=Ns.mouse,Wk=class extends kD.Component{constructor(){super(...arguments),ao(this,"dragging",!1),ao(this,"lastX",NaN),ao(this,"lastY",NaN),ao(this,"touchIdentifier",null),ao(this,"mounted",!1),ao(this,"handleDragStart",e=>{if(this.props.onMouseDown(e),!this.props.allowAnyClick&&typeof e.button=="number"&&e.button!==0)return!1;const n=this.findDOMNode();if(!n||!n.ownerDocument||!n.ownerDocument.body)throw new Error("<DraggableCore> not mounted on DragStart!");const{ownerDocument:r}=n;if(this.props.disabled||!(e.target instanceof r.defaultView.Node)||this.props.handle&&!(0,ji.matchesSelectorAndParentsTo)(e.target,this.props.handle,n)||this.props.cancel&&(0,ji.matchesSelectorAndParentsTo)(e.target,this.props.cancel,n))return;e.type==="touchstart"&&e.preventDefault();const i=(0,ji.getTouchIdentifier)(e);this.touchIdentifier=i;const o=(0,Xu.getControlPosition)(e,i,this);if(o==null)return;const{x:a,y:s}=o,l=(0,Xu.createCoreData)(this,a,s);(0,K0.default)("DraggableCore: handleDragStart: %j",l),(0,K0.default)("calling",this.props.onStart),!(this.props.onStart(e,l)===!1||this.mounted===!1)&&(this.props.enableUserSelectHack&&(0,ji.addUserSelectStyles)(r),this.dragging=!0,this.lastX=a,this.lastY=s,(0,ji.addEvent)(r,Qu.move,this.handleDrag),(0,ji.addEvent)(r,Qu.stop,this.handleDragStop))}),ao(this,"handleDrag",e=>{const n=(0,Xu.getControlPosition)(e,this.touchIdentifier,this);if(n==null)return;let{x:r,y:i}=n;if(Array.isArray(this.props.grid)){let s=r-this.lastX,l=i-this.lastY;if([s,l]=(0,Xu.snapToGrid)(this.props.grid,s,l),!s&&!l)return;r=this.lastX+s,i=this.lastY+l}const o=(0,Xu.createCoreData)(this,r,i);if((0,K0.default)("DraggableCore: handleDrag: %j",o),this.props.onDrag(e,o)===!1||this.mounted===!1){try{this.handleDragStop(new MouseEvent("mouseup"))}catch{const l=document.createEvent("MouseEvents");l.initMouseEvent("mouseup",!0,!0,window,0,0,0,0,0,!1,!1,!1,!1,0,null),this.handleDragStop(l)}return}this.lastX=r,this.lastY=i}),ao(this,"handleDragStop",e=>{if(!this.dragging)return;const n=(0,Xu.getControlPosition)(e,this.touchIdentifier,this);if(n==null)return;let{x:r,y:i}=n;if(Array.isArray(this.props.grid)){let l=r-this.lastX||0,c=i-this.lastY||0;[l,c]=(0,Xu.snapToGrid)(this.props.grid,l,c),r=this.lastX+l,i=this.lastY+c}const o=(0,Xu.createCoreData)(this,r,i);if(this.props.onStop(e,o)===!1||this.mounted===!1)return!1;const s=this.findDOMNode();s&&this.props.enableUserSelectHack&&(0,ji.removeUserSelectStyles)(s.ownerDocument),(0,K0.default)("DraggableCore: handleDragStop: %j",o),this.dragging=!1,this.lastX=NaN,this.lastY=NaN,s&&((0,K0.default)("DraggableCore: Removing handlers"),(0,ji.removeEvent)(s.ownerDocument,Qu.move,this.handleDrag),(0,ji.removeEvent)(s.ownerDocument,Qu.stop,this.handleDragStop))}),ao(this,"onMouseDown",e=>(Qu=Ns.mouse,this.handleDragStart(e))),ao(this,"onMouseUp",e=>(Qu=Ns.mouse,this.handleDragStop(e))),ao(this,"onTouchStart",e=>(Qu=Ns.touch,this.handleDragStart(e))),ao(this,"onTouchEnd",e=>(Qu=Ns.touch,this.handleDragStop(e)))}componentDidMount(){this.mounted=!0;const e=this.findDOMNode();e&&(0,ji.addEvent)(e,Ns.touch.start,this.onTouchStart,{passive:!1})}componentWillUnmount(){this.mounted=!1;const e=this.findDOMNode();if(e){const{ownerDocument:n}=e;(0,ji.removeEvent)(n,Ns.mouse.move,this.handleDrag),(0,ji.removeEvent)(n,Ns.touch.move,this.handleDrag),(0,ji.removeEvent)(n,Ns.mouse.stop,this.handleDragStop),(0,ji.removeEvent)(n,Ns.touch.stop,this.handleDragStop),(0,ji.removeEvent)(e,Ns.touch.start,this.onTouchStart,{passive:!1}),this.props.enableUserSelectHack&&(0,ji.removeUserSelectStyles)(n)}}findDOMNode(){var e,n;return(e=this.props)!==null&&e!==void 0&&e.nodeRef?(n=this.props)===null||n===void 0||(n=n.nodeRef)===null||n===void 0?void 0:n.current:FUt.default.findDOMNode(this)}render(){return kD.cloneElement(kD.Children.only(this.props.children),{onMouseDown:this.onMouseDown,onMouseUp:this.onMouseUp,onTouchEnd:this.onTouchEnd})}};zk.default=Wk;ao(Wk,"displayName","DraggableCore");ao(Wk,"propTypes",{allowAnyClick:bo.default.bool,children:bo.default.node.isRequired,disabled:bo.default.bool,enableUserSelectHack:bo.default.bool,offsetParent:function(t,e){if(t[e]&&t[e].nodeType!==1)throw new Error("Draggable's offsetParent must be a DOM Node.")},grid:bo.default.arrayOf(bo.default.number),handle:bo.default.string,cancel:bo.default.string,nodeRef:bo.default.object,onStart:bo.default.func,onDrag:bo.default.func,onStop:bo.default.func,onMouseDown:bo.default.func,scale:bo.default.number,className:AD.dontSetMe,style:AD.dontSetMe,transform:AD.dontSetMe});ao(Wk,"defaultProps",{allowAnyClick:!1,disabled:!1,enableUserSelectHack:!0,onStart:function(){},onDrag:function(){},onStop:function(){},onMouseDown:function(){},scale:1});(function(t){Object.defineProperty(t,"__esModule",{value:!0}),Object.defineProperty(t,"DraggableCore",{enumerable:!0,get:function(){return l.default}}),t.default=void 0;var e=d(M),n=u(p1),r=u(qv),i=u(aUt),o=Or,a=pc,s=hc,l=u(zk),c=u(Uk);function u(y){return y&&y.__esModule?y:{default:y}}function f(y){if(typeof WeakMap!="function")return null;var x=new WeakMap,b=new WeakMap;return(f=function(_){return _?b:x})(y)}function d(y,x){if(y&&y.__esModule)return y;if(y===null||typeof y!="object"&&typeof y!="function")return{default:y};var b=f(x);if(b&&b.has(y))return b.get(y);var _={},S=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var O in y)if(O!=="default"&&Object.prototype.hasOwnProperty.call(y,O)){var C=S?Object.getOwnPropertyDescriptor(y,O):null;C&&(C.get||C.set)?Object.defineProperty(_,O,C):_[O]=y[O]}return _.default=y,b&&b.set(y,_),_}function h(){return h=Object.assign?Object.assign.bind():function(y){for(var x=1;x<arguments.length;x++){var b=arguments[x];for(var _ in b)Object.prototype.hasOwnProperty.call(b,_)&&(y[_]=b[_])}return y},h.apply(this,arguments)}function p(y,x,b){return x=m(x),x in y?Object.defineProperty(y,x,{value:b,enumerable:!0,configurable:!0,writable:!0}):y[x]=b,y}function m(y){var x=g(y,"string");return typeof x=="symbol"?x:String(x)}function g(y,x){if(typeof y!="object"||y===null)return y;var b=y[Symbol.toPrimitive];if(b!==void 0){var _=b.call(y,x||"default");if(typeof _!="object")return _;throw new TypeError("@@toPrimitive must return a primitive value.")}return(x==="string"?String:Number)(y)}class v extends e.Component{static getDerivedStateFromProps(x,b){let{position:_}=x,{prevPropsPosition:S}=b;return _&&(!S||_.x!==S.x||_.y!==S.y)?((0,c.default)("Draggable: getDerivedStateFromProps %j",{position:_,prevPropsPosition:S}),{x:_.x,y:_.y,prevPropsPosition:{..._}}):null}constructor(x){super(x),p(this,"onDragStart",(b,_)=>{if((0,c.default)("Draggable: onDragStart: %j",_),this.props.onStart(b,(0,a.createDraggableData)(this,_))===!1)return!1;this.setState({dragging:!0,dragged:!0})}),p(this,"onDrag",(b,_)=>{if(!this.state.dragging)return!1;(0,c.default)("Draggable: onDrag: %j",_);const S=(0,a.createDraggableData)(this,_),O={x:S.x,y:S.y,slackX:0,slackY:0};if(this.props.bounds){const{x:E,y:k}=O;O.x+=this.state.slackX,O.y+=this.state.slackY;const[I,P]=(0,a.getBoundPosition)(this,O.x,O.y);O.x=I,O.y=P,O.slackX=this.state.slackX+(E-O.x),O.slackY=this.state.slackY+(k-O.y),S.x=O.x,S.y=O.y,S.deltaX=O.x-this.state.x,S.deltaY=O.y-this.state.y}if(this.props.onDrag(b,S)===!1)return!1;this.setState(O)}),p(this,"onDragStop",(b,_)=>{if(!this.state.dragging||this.props.onStop(b,(0,a.createDraggableData)(this,_))===!1)return!1;(0,c.default)("Draggable: onDragStop: %j",_);const O={dragging:!1,slackX:0,slackY:0};if(!!this.props.position){const{x:E,y:k}=this.props.position;O.x=E,O.y=k}this.setState(O)}),this.state={dragging:!1,dragged:!1,x:x.position?x.position.x:x.defaultPosition.x,y:x.position?x.position.y:x.defaultPosition.y,prevPropsPosition:{...x.position},slackX:0,slackY:0,isElementSVG:!1},x.position&&!(x.onDrag||x.onStop)&&console.warn("A `position` was applied to this <Draggable>, without drag handlers. This will make this component effectively undraggable. Please attach `onDrag` or `onStop` handlers so you can adjust the `position` of this element.")}componentDidMount(){typeof window.SVGElement<"u"&&this.findDOMNode()instanceof window.SVGElement&&this.setState({isElementSVG:!0})}componentWillUnmount(){this.setState({dragging:!1})}findDOMNode(){var x,b;return(x=(b=this.props)===null||b===void 0||(b=b.nodeRef)===null||b===void 0?void 0:b.current)!==null&&x!==void 0?x:r.default.findDOMNode(this)}render(){const{axis:x,bounds:b,children:_,defaultPosition:S,defaultClassName:O,defaultClassNameDragging:C,defaultClassNameDragged:E,position:k,positionOffset:I,scale:P,...R}=this.props;let T={},L=null;const B=!!!k||this.state.dragging,U=k||S,W={x:(0,a.canDragX)(this)&&B?this.state.x:U.x,y:(0,a.canDragY)(this)&&B?this.state.y:U.y};this.state.isElementSVG?L=(0,o.createSVGTransform)(W,I):T=(0,o.createCSSTransform)(W,I);const $=(0,i.default)(_.props.className||"",O,{[C]:this.state.dragging,[E]:this.state.dragged});return e.createElement(l.default,h({},R,{onStart:this.onDragStart,onDrag:this.onDrag,onStop:this.onDragStop}),e.cloneElement(e.Children.only(_),{className:$,style:{..._.props.style,...T},transform:L}))}}t.default=v,p(v,"displayName","Draggable"),p(v,"propTypes",{...l.default.propTypes,axis:n.default.oneOf(["both","x","y","none"]),bounds:n.default.oneOfType([n.default.shape({left:n.default.number,right:n.default.number,top:n.default.number,bottom:n.default.number}),n.default.string,n.default.oneOf([!1])]),defaultClassName:n.default.string,defaultClassNameDragging:n.default.string,defaultClassNameDragged:n.default.string,defaultPosition:n.default.shape({x:n.default.number,y:n.default.number}),positionOffset:n.default.shape({x:n.default.oneOfType([n.default.number,n.default.string]),y:n.default.oneOfType([n.default.number,n.default.string])}),position:n.default.shape({x:n.default.number,y:n.default.number}),className:s.dontSetMe,style:s.dontSetMe,transform:s.dontSetMe}),p(v,"defaultProps",{...l.default.defaultProps,axis:"both",bounds:!1,defaultClassName:"react-draggable",defaultClassNameDragging:"react-draggable-dragging",defaultClassNameDragged:"react-draggable-dragged",defaultPosition:{x:0,y:0},scale:1})})(Qye);const{default:i0e,DraggableCore:UUt}=Qye;Bk.exports=i0e;Bk.exports.default=i0e;Bk.exports.DraggableCore=UUt;var o0e=Bk.exports;const WUt=$t(o0e);var M6={exports:{}},jw={},k6={};k6.__esModule=!0;k6.cloneElement=QUt;var VUt=GUt(M);function GUt(t){return t&&t.__esModule?t:{default:t}}function DJ(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(t,i).enumerable})),n.push.apply(n,r)}return n}function LJ(t){for(var e=1;e<arguments.length;e++){var n=arguments[e]!=null?arguments[e]:{};e%2?DJ(Object(n),!0).forEach(function(r){HUt(t,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):DJ(Object(n)).forEach(function(r){Object.defineProperty(t,r,Object.getOwnPropertyDescriptor(n,r))})}return t}function HUt(t,e,n){return e=qUt(e),e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function qUt(t){var e=XUt(t,"string");return typeof e=="symbol"?e:String(e)}function XUt(t,e){if(typeof t!="object"||t===null)return t;var n=t[Symbol.toPrimitive];if(n!==void 0){var r=n.call(t,e||"default");if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}function QUt(t,e){return e.style&&t.props.style&&(e.style=LJ(LJ({},t.props.style),e.style)),e.className&&t.props.className&&(e.className=t.props.className+" "+e.className),VUt.default.cloneElement(t,e)}var Bw={};Bw.__esModule=!0;Bw.resizableProps=void 0;var Ft=YUt(p1);function YUt(t){return t&&t.__esModule?t:{default:t}}var KUt={axis:Ft.default.oneOf(["both","x","y","none"]),className:Ft.default.string,children:Ft.default.element.isRequired,draggableOpts:Ft.default.shape({allowAnyClick:Ft.default.bool,cancel:Ft.default.string,children:Ft.default.node,disabled:Ft.default.bool,enableUserSelectHack:Ft.default.bool,offsetParent:Ft.default.node,grid:Ft.default.arrayOf(Ft.default.number),handle:Ft.default.string,nodeRef:Ft.default.object,onStart:Ft.default.func,onDrag:Ft.default.func,onStop:Ft.default.func,onMouseDown:Ft.default.func,scale:Ft.default.number}),height:function(){for(var e=arguments.length,n=new Array(e),r=0;r<e;r++)n[r]=arguments[r];var i=n[0];if(i.axis==="both"||i.axis==="y"){var o;return(o=Ft.default.number).isRequired.apply(o,n)}return Ft.default.number.apply(Ft.default,n)},handle:Ft.default.oneOfType([Ft.default.node,Ft.default.func]),handleSize:Ft.default.arrayOf(Ft.default.number),lockAspectRatio:Ft.default.bool,maxConstraints:Ft.default.arrayOf(Ft.default.number),minConstraints:Ft.default.arrayOf(Ft.default.number),onResizeStop:Ft.default.func,onResizeStart:Ft.default.func,onResize:Ft.default.func,resizeHandles:Ft.default.arrayOf(Ft.default.oneOf(["s","w","e","n","sw","nw","se","ne"])),transformScale:Ft.default.number,width:function(){for(var e=arguments.length,n=new Array(e),r=0;r<e;r++)n[r]=arguments[r];var i=n[0];if(i.axis==="both"||i.axis==="x"){var o;return(o=Ft.default.number).isRequired.apply(o,n)}return Ft.default.number.apply(Ft.default,n)}};Bw.resizableProps=KUt;jw.__esModule=!0;jw.default=void 0;var Z0=n6t(M),ZUt=o0e,JUt=k6,e6t=Bw,t6t=["children","className","draggableOpts","width","height","handle","handleSize","lockAspectRatio","axis","minConstraints","maxConstraints","onResize","onResizeStop","onResizeStart","resizeHandles","transformScale"];function a0e(t){if(typeof WeakMap!="function")return null;var e=new WeakMap,n=new WeakMap;return(a0e=function(i){return i?n:e})(t)}function n6t(t,e){if(t&&t.__esModule)return t;if(t===null||typeof t!="object"&&typeof t!="function")return{default:t};var n=a0e(e);if(n&&n.has(t))return n.get(t);var r={},i=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var o in t)if(o!=="default"&&Object.prototype.hasOwnProperty.call(t,o)){var a=i?Object.getOwnPropertyDescriptor(t,o):null;a&&(a.get||a.set)?Object.defineProperty(r,o,a):r[o]=t[o]}return r.default=t,n&&n.set(t,r),r}function AF(){return AF=Object.assign?Object.assign.bind():function(t){for(var e=1;e<arguments.length;e++){var n=arguments[e];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(t[r]=n[r])}return t},AF.apply(this,arguments)}function r6t(t,e){if(t==null)return{};var n={},r=Object.keys(t),i,o;for(o=0;o<r.length;o++)i=r[o],!(e.indexOf(i)>=0)&&(n[i]=t[i]);return n}function NJ(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(t,i).enumerable})),n.push.apply(n,r)}return n}function RD(t){for(var e=1;e<arguments.length;e++){var n=arguments[e]!=null?arguments[e]:{};e%2?NJ(Object(n),!0).forEach(function(r){i6t(t,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):NJ(Object(n)).forEach(function(r){Object.defineProperty(t,r,Object.getOwnPropertyDescriptor(n,r))})}return t}function i6t(t,e,n){return e=o6t(e),e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function o6t(t){var e=a6t(t,"string");return typeof e=="symbol"?e:String(e)}function a6t(t,e){if(typeof t!="object"||t===null)return t;var n=t[Symbol.toPrimitive];if(n!==void 0){var r=n.call(t,e||"default");if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}function s6t(t,e){t.prototype=Object.create(e.prototype),t.prototype.constructor=t,RF(t,e)}function RF(t,e){return RF=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(r,i){return r.__proto__=i,r},RF(t,e)}var A6=function(t){s6t(e,t);function e(){for(var r,i=arguments.length,o=new Array(i),a=0;a<i;a++)o[a]=arguments[a];return r=t.call.apply(t,[this].concat(o))||this,r.handleRefs={},r.lastHandleRect=null,r.slack=null,r}var n=e.prototype;return n.componentWillUnmount=function(){this.resetData()},n.resetData=function(){this.lastHandleRect=this.slack=null},n.runConstraints=function(i,o){var a=this.props,s=a.minConstraints,l=a.maxConstraints,c=a.lockAspectRatio;if(!s&&!l&&!c)return[i,o];if(c){var u=this.props.width/this.props.height,f=i-this.props.width,d=o-this.props.height;Math.abs(f)>Math.abs(d*u)?o=i/u:i=o*u}var h=i,p=o,m=this.slack||[0,0],g=m[0],v=m[1];return i+=g,o+=v,s&&(i=Math.max(s[0],i),o=Math.max(s[1],o)),l&&(i=Math.min(l[0],i),o=Math.min(l[1],o)),this.slack=[g+(h-i),v+(p-o)],[i,o]},n.resizeHandler=function(i,o){var a=this;return function(s,l){var c=l.node,u=l.deltaX,f=l.deltaY;i==="onResizeStart"&&a.resetData();var d=(a.props.axis==="both"||a.props.axis==="x")&&o!=="n"&&o!=="s",h=(a.props.axis==="both"||a.props.axis==="y")&&o!=="e"&&o!=="w";if(!(!d&&!h)){var p=o[0],m=o[o.length-1],g=c.getBoundingClientRect();if(a.lastHandleRect!=null){if(m==="w"){var v=g.left-a.lastHandleRect.left;u+=v}if(p==="n"){var y=g.top-a.lastHandleRect.top;f+=y}}a.lastHandleRect=g,m==="w"&&(u=-u),p==="n"&&(f=-f);var x=a.props.width+(d?u/a.props.transformScale:0),b=a.props.height+(h?f/a.props.transformScale:0),_=a.runConstraints(x,b);x=_[0],b=_[1];var S=x!==a.props.width||b!==a.props.height,O=typeof a.props[i]=="function"?a.props[i]:null,C=i==="onResize"&&!S;O&&!C&&(s.persist==null||s.persist(),O(s,{node:c,size:{width:x,height:b},handle:o})),i==="onResizeStop"&&a.resetData()}}},n.renderResizeHandle=function(i,o){var a=this.props.handle;if(!a)return Z0.createElement("span",{className:"react-resizable-handle react-resizable-handle-"+i,ref:o});if(typeof a=="function")return a(i,o);var s=typeof a.type=="string",l=RD({ref:o},s?{}:{handleAxis:i});return Z0.cloneElement(a,l)},n.render=function(){var i=this,o=this.props,a=o.children,s=o.className,l=o.draggableOpts;o.width,o.height,o.handle,o.handleSize,o.lockAspectRatio,o.axis,o.minConstraints,o.maxConstraints,o.onResize,o.onResizeStop,o.onResizeStart;var c=o.resizeHandles;o.transformScale;var u=r6t(o,t6t);return(0,JUt.cloneElement)(a,RD(RD({},u),{},{className:(s?s+" ":"")+"react-resizable",children:[].concat(a.props.children,c.map(function(f){var d,h=(d=i.handleRefs[f])!=null?d:i.handleRefs[f]=Z0.createRef();return Z0.createElement(ZUt.DraggableCore,AF({},l,{nodeRef:h,key:"resizableHandle-"+f,onStop:i.resizeHandler("onResizeStop",f),onStart:i.resizeHandler("onResizeStart",f),onDrag:i.resizeHandler("onResize",f)}),i.renderResizeHandle(f,h))}))}))},e}(Z0.Component);jw.default=A6;A6.propTypes=e6t.resizableProps;A6.defaultProps={axis:"both",handleSize:[20,20],lockAspectRatio:!1,minConstraints:[20,20],maxConstraints:[1/0,1/0],resizeHandles:["se"],transformScale:1};var Vk={};Vk.__esModule=!0;Vk.default=void 0;var ID=d6t(M),l6t=s0e(p1),c6t=s0e(jw),u6t=Bw,f6t=["handle","handleSize","onResize","onResizeStart","onResizeStop","draggableOpts","minConstraints","maxConstraints","lockAspectRatio","axis","width","height","resizeHandles","style","transformScale"];function s0e(t){return t&&t.__esModule?t:{default:t}}function l0e(t){if(typeof WeakMap!="function")return null;var e=new WeakMap,n=new WeakMap;return(l0e=function(i){return i?n:e})(t)}function d6t(t,e){if(t&&t.__esModule)return t;if(t===null||typeof t!="object"&&typeof t!="function")return{default:t};var n=l0e(e);if(n&&n.has(t))return n.get(t);var r={},i=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var o in t)if(o!=="default"&&Object.prototype.hasOwnProperty.call(t,o)){var a=i?Object.getOwnPropertyDescriptor(t,o):null;a&&(a.get||a.set)?Object.defineProperty(r,o,a):r[o]=t[o]}return r.default=t,n&&n.set(t,r),r}function IF(){return IF=Object.assign?Object.assign.bind():function(t){for(var e=1;e<arguments.length;e++){var n=arguments[e];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(t[r]=n[r])}return t},IF.apply(this,arguments)}function $J(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(t,i).enumerable})),n.push.apply(n,r)}return n}function LP(t){for(var e=1;e<arguments.length;e++){var n=arguments[e]!=null?arguments[e]:{};e%2?$J(Object(n),!0).forEach(function(r){h6t(t,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):$J(Object(n)).forEach(function(r){Object.defineProperty(t,r,Object.getOwnPropertyDescriptor(n,r))})}return t}function h6t(t,e,n){return e=p6t(e),e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function p6t(t){var e=m6t(t,"string");return typeof e=="symbol"?e:String(e)}function m6t(t,e){if(typeof t!="object"||t===null)return t;var n=t[Symbol.toPrimitive];if(n!==void 0){var r=n.call(t,e||"default");if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}function g6t(t,e){if(t==null)return{};var n={},r=Object.keys(t),i,o;for(o=0;o<r.length;o++)i=r[o],!(e.indexOf(i)>=0)&&(n[i]=t[i]);return n}function v6t(t,e){t.prototype=Object.create(e.prototype),t.prototype.constructor=t,DF(t,e)}function DF(t,e){return DF=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(r,i){return r.__proto__=i,r},DF(t,e)}var c0e=function(t){v6t(e,t);function e(){for(var r,i=arguments.length,o=new Array(i),a=0;a<i;a++)o[a]=arguments[a];return r=t.call.apply(t,[this].concat(o))||this,r.state={width:r.props.width,height:r.props.height,propsWidth:r.props.width,propsHeight:r.props.height},r.onResize=function(s,l){var c=l.size;r.props.onResize?(s.persist==null||s.persist(),r.setState(c,function(){return r.props.onResize&&r.props.onResize(s,l)})):r.setState(c)},r}e.getDerivedStateFromProps=function(i,o){return o.propsWidth!==i.width||o.propsHeight!==i.height?{width:i.width,height:i.height,propsWidth:i.width,propsHeight:i.height}:null};var n=e.prototype;return n.render=function(){var i=this.props,o=i.handle,a=i.handleSize;i.onResize;var s=i.onResizeStart,l=i.onResizeStop,c=i.draggableOpts,u=i.minConstraints,f=i.maxConstraints,d=i.lockAspectRatio,h=i.axis;i.width,i.height;var p=i.resizeHandles,m=i.style,g=i.transformScale,v=g6t(i,f6t);return ID.createElement(c6t.default,{axis:h,draggableOpts:c,handle:o,handleSize:a,height:this.state.height,lockAspectRatio:d,maxConstraints:f,minConstraints:u,onResizeStart:s,onResize:this.onResize,onResizeStop:l,resizeHandles:p,transformScale:g,width:this.state.width},ID.createElement("div",IF({},v,{style:LP(LP({},m),{},{width:this.state.width+"px",height:this.state.height+"px"})})))},e}(ID.Component);Vk.default=c0e;c0e.propTypes=LP(LP({},u6t.resizableProps),{},{children:l6t.default.element});M6.exports=function(){throw new Error("Don't instantiate Resizable directly! Use require('react-resizable').Resizable")};M6.exports.Resizable=jw.default;var y6t=M6.exports.ResizableBox=Vk.default,R6={},x6t=ft;Object.defineProperty(R6,"__esModule",{value:!0});var I6=R6.default=void 0,b6t=x6t(pt()),_6t=w;I6=R6.default=(0,b6t.default)((0,_6t.jsx)("path",{d:"M9 16.17 4.83 12l-1.42 1.41L9 19 21 7l-1.41-1.41z"}),"Check");function u0e({title:t,subtitle:e,disabled:n,dense:r,selected:i,secondaryIcon:o,onClick:a}){return i?w.jsxs(jr,{onClick:a,disabled:n,dense:r,children:[w.jsx(Kre,{children:w.jsx(I6,{})}),w.jsx(ts,{primary:t,secondary:e}),o]}):w.jsxs(jr,{onClick:a,disabled:n,dense:r,children:[w.jsx(ts,{inset:!0,primary:t,secondary:e}),o]})}function Cc({layerId:t,layerStates:e,setLayerVisibility:n,last:r}){const i=e[t];return i.disabled?null:w.jsxs(w.Fragment,{children:[w.jsx(u0e,{title:fe.get(i.title),subtitle:i.subTitle,selected:!!i.visible,secondaryIcon:i.pinned&&w.jsx(sE,{fontSize:"small",color:"disabled"}),onClick:()=>n(t,!i.visible)}),r?w.jsx(ep,{}):w.jsx(ep,{variant:"inset",component:"li",style:{margin:"0 0 0 52px"}})]})}const w6t={x:48,y:128},S6t={width:320,height:520},aC={resizeBox:{position:"absolute",zIndex:1e3},windowPaper:{width:"100%",height:"100%",display:"flex",flexDirection:"column"},windowHeader:t=>({display:"flex",justifyContent:"space-between",alignItems:"center",cursor:"move",padding:1,marginBottom:"2px",borderBottom:`1px solid ${t.palette.mode==="dark"?"#FFFFFF3F":"#0000003F"}`}),windowTitle:{fontWeight:"bolder"}};function O6t(t){const[e,n]=M.useState(w6t),[r,i]=M.useState(S6t),{layerMenuOpen:o,setLayerMenuOpen:a,openDialog:s,...l}=t;if(!o)return null;console.log("layerProps",l);const c=()=>{s("userOverlays")},u=()=>{s("userBaseMaps")},f=()=>{a(!1)},d=(p,m)=>{n({...m})},h=(p,m)=>{i({...m.size})};return w.jsx(WUt,{handle:"#layer-select-header",position:e,onStop:d,children:w.jsx(y6t,{width:r.width,height:r.height,style:aC.resizeBox,onResize:h,children:w.jsxs(Ho,{elevation:10,sx:aC.windowPaper,component:"div",children:[w.jsxs(Ke,{id:"layer-select-header",sx:aC.windowHeader,children:[w.jsx(Ke,{component:"span",sx:aC.windowTitle,children:fe.get("Layers")}),w.jsx(Ot,{size:"small",onClick:f,children:w.jsx($p,{fontSize:"inherit"})})]}),w.jsx(Ke,{sx:{width:"100%",overflow:"auto",flexGrow:1},children:w.jsxs(Jre,{dense:!0,children:[w.jsx(Cc,{layerId:"overlay",...l}),w.jsx(Cc,{layerId:"userPlaces",...l}),w.jsx(Cc,{layerId:"datasetPlaces",...l}),w.jsx(Cc,{layerId:"datasetBoundary",...l}),w.jsx(Cc,{layerId:"datasetVariable",...l}),w.jsx(Cc,{layerId:"datasetVariable2",...l}),w.jsx(Cc,{layerId:"datasetRgb",...l}),w.jsx(Cc,{layerId:"datasetRgb2",...l}),w.jsx(Cc,{layerId:"baseMap",...l,last:!0}),w.jsx(jr,{onClick:u,children:fe.get("User Base Maps")+"..."}),w.jsx(jr,{onClick:c,children:fe.get("User Overlays")+"..."})]})})]})})})}const C6t=t=>({locale:t.controlState.locale,layerMenuOpen:t.controlState.layerMenuOpen,layerStates:PVe(t)}),T6t={openDialog:Lp,setLayerMenuOpen:Ple,setLayerVisibility:P8e},E6t=Jt(C6t,T6t)(O6t),P6t=t=>({locale:t.controlState.locale,hasConsent:t.controlState.privacyNoticeAccepted,compact:Kt.instance.branding.compact}),M6t={},k6t=we("main")(({theme:t})=>({padding:0,width:"100vw",height:"100vh",overflow:"hidden",display:"flex",flexDirection:"column",alignItems:"stretch",[t.breakpoints.up("md")]:{overflow:"hidden"}})),A6t=({hasConsent:t,compact:e})=>w.jsxs(k6t,{children:[!e&&w.jsx(n2,{variant:"dense"}),t&&w.jsxs(w.Fragment,{children:[w.jsx(ftt,{}),w.jsx(iUt,{}),w.jsx(E6t,{})]})]}),R6t=Jt(P6t,M6t)(A6t),I6t={icon:t=>({marginRight:t.spacing(2)})};function D6t({open:t,settings:e,updateSettings:n,syncWithServer:r}){const[i,o]=M.useState(null);if(M.useEffect(()=>{const l=fe.get("docs/privacy-note.en.md");fetch(l).then(c=>c.text()).then(c=>o(c))}),!t)return null;function a(){n({...e,privacyNoticeAccepted:!0}),r()}function s(){try{window.history.length>0?window.history.back():typeof window.home=="function"?window.home():window.location.href="about:home"}catch(l){console.error(l)}}return w.jsxs(rl,{open:t,disableEscapeKeyDown:!0,keepMounted:!0,scroll:"body",children:[w.jsx(vd,{children:fe.get("Privacy Notice")}),w.jsx(Ys,{children:w.jsx(R2e,{children:i===null?w.jsx(ey,{}):w.jsx(G2,{children:i,linkTarget:"_blank"})})}),w.jsxs(Tp,{children:[w.jsxs(tr,{onClick:a,children:[w.jsx(I6,{sx:I6t.icon}),fe.get("Accept and continue")]}),w.jsx(tr,{onClick:s,children:fe.get("Leave")})]})]})}const L6t=t=>({open:!t.controlState.privacyNoticeAccepted,settings:t.controlState}),N6t={updateSettings:ow,syncWithServer:rz},$6t=Jt(L6t,N6t)(D6t),F6t=Li(ey)(({theme:t})=>({margin:t.spacing(2)})),j6t=Li(At)(({theme:t})=>({margin:t.spacing(1)})),B6t=Li("div")(({theme:t})=>({margin:t.spacing(1),textAlign:"center",display:"flex",alignItems:"center",flexDirection:"column"}));function z6t({messages:t}){return t.length===0?null:w.jsxs(rl,{open:!0,"aria-labelledby":"loading",children:[w.jsx(vd,{id:"loading",children:fe.get("Please wait...")}),w.jsxs(B6t,{children:[w.jsx(F6t,{}),t.map((e,n)=>w.jsx(j6t,{children:e},n))]})]})}const U6t=t=>({locale:t.controlState.locale,messages:SVe(t)}),W6t={},V6t=Jt(U6t,W6t)(z6t);var D6={},G6t=ft;Object.defineProperty(D6,"__esModule",{value:!0});var f0e=D6.default=void 0,H6t=G6t(pt()),q6t=w;f0e=D6.default=(0,H6t.default)((0,q6t.jsx)("path",{d:"M12 2C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2m1 15h-2v-2h2zm0-4h-2V7h2z"}),"Error");var L6={},X6t=ft;Object.defineProperty(L6,"__esModule",{value:!0});var d0e=L6.default=void 0,Q6t=X6t(pt()),Y6t=w;d0e=L6.default=(0,Q6t.default)((0,Y6t.jsx)("path",{d:"M1 21h22L12 2zm12-3h-2v-2h2zm0-4h-2v-4h2z"}),"Warning");var N6={},K6t=ft;Object.defineProperty(N6,"__esModule",{value:!0});var h0e=N6.default=void 0,Z6t=K6t(pt()),J6t=w;h0e=N6.default=(0,Z6t.default)((0,J6t.jsx)("path",{d:"M12 2C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2m-2 15-5-5 1.41-1.41L10 14.17l7.59-7.59L19 8z"}),"CheckCircle");const eWt={success:h0e,warning:d0e,error:f0e,info:f4},tWt=Li("span")(()=>({display:"flex",alignItems:"center"})),sC={close:{p:.5},success:t=>({color:t.palette.error.contrastText,backgroundColor:Lc[600]}),error:t=>({color:t.palette.error.contrastText,backgroundColor:t.palette.error.dark}),info:t=>({color:t.palette.error.contrastText,backgroundColor:t.palette.primary.dark}),warning:t=>({color:t.palette.error.contrastText,backgroundColor:vne[700]}),icon:{fontSize:20},iconVariant:t=>({opacity:.9,marginRight:t.spacing(1),fontSize:20}),message:{display:"flex",alignItems:"center"}},nWt={vertical:"bottom",horizontal:"center"};function rWt({className:t,message:e,hideMessage:n}){const r=()=>{n(e.id)};if(!e)return null;const i=eWt[e.type];return w.jsx(dIe,{open:!0,anchorOrigin:nWt,autoHideDuration:5e3,onClose:r,children:w.jsx(oie,{sx:sC[e.type],className:t,"aria-describedby":"client-snackbar",message:w.jsxs(tWt,{id:"client-snackbar",children:[w.jsx(i,{sx:sC.iconVariant}),e.text]}),action:[w.jsx(Ot,{"aria-label":"Close",color:"inherit",sx:sC.close,onClick:r,size:"large",children:w.jsx($p,{sx:sC.icon})},"close")]})},e.type+":"+e.text)}const iWt=t=>{const e=t.messageLogState.newEntries;return{locale:t.controlState.locale,message:e.length>0?e[0]:null}},oWt={hideMessage:AVe},aWt=Jt(iWt,oWt)(rWt);var $6={},sWt=ft;Object.defineProperty($6,"__esModule",{value:!0});var NP=$6.default=void 0,lWt=sWt(pt()),cWt=w;NP=$6.default=(0,lWt.default)((0,cWt.jsx)("path",{d:"M19 13h-6v6h-2v-6H5v-2h6V5h2v6h6z"}),"Add");var F6={},uWt=ft;Object.defineProperty(F6,"__esModule",{value:!0});var j6=F6.default=void 0,fWt=uWt(pt()),dWt=w;j6=F6.default=(0,fWt.default)((0,dWt.jsx)("path",{d:"M6 19c0 1.1.9 2 2 2h8c1.1 0 2-.9 2-2V7H6zM19 4h-3.5l-1-1h-5l-1 1H5v2h14z"}),"Delete");const Rm={formControl:t=>({marginLeft:t.spacing(1),marginRight:t.spacing(1),width:200}),textField:t=>({marginLeft:t.spacing(1),marginRight:t.spacing(1),width:200}),textField2:t=>({marginLeft:t.spacing(1),marginRight:t.spacing(1),width:400}),button:t=>({margin:t.spacing(.1)})};function hWt({open:t,servers:e,selectedServer:n,closeDialog:r,configureServers:i}){const o=M.useRef(!1),[a,s]=M.useState(e),[l,c]=M.useState(n),[u,f]=M.useState("select");M.useEffect(()=>{o.current&&(s(e),c(n)),o.current=!0},[e,n]);const d=()=>{u==="select"?(r("server"),i(a,l.id)):u==="add"?E():u==="edit"&&k()},h=()=>{u==="select"?_():I()},p=()=>{_()},m=B=>{const U=B.target.value,W=a.find($=>$.id===U);c(W)},g=B=>{const U=B.target.value,W={...l,name:U};c(W)},v=B=>{const U=B.target.value,W={...l,url:U};c(W)},y=()=>{f("add")},x=()=>{f("edit")},b=()=>{P()},_=()=>{r("server")},S=()=>{const B=l.id;return a.findIndex(U=>U.id===B)},O=(B,U)=>{const W=[...a];W[B]=U,s(W),c(U),f("select")},C=(B,U)=>{s(B),c(U),f("select")},E=()=>{const B={...l,id:Js("server-")},U=[...a,B];C(U,B)},k=()=>{O(S(),{...l})},I=()=>{const B=S();O(S(),a[B])},P=()=>{const B=[...a];if(B.length<2)throw new Error("internal error: server list cannot be emptied");const U=S(),W=B[U+(U>0?-1:1)];B.splice(U,1),C(B,W)},R=a.map((B,U)=>w.jsx(jr,{value:B.id,children:B.name},U));let T;u==="add"?T=fe.get("Add"):u==="edit"?T=fe.get("Save"):T=fe.get("OK");let L;u==="add"?L=fe.get("Add Server"):u==="edit"?L=fe.get("Edit Server"):L=fe.get("Select Server");let z;return u==="add"||u==="edit"?z=w.jsxs(Ys,{dividers:!0,children:[w.jsx(cr,{variant:"standard",required:!0,id:"server-name",label:"Name",sx:Rm.textField,margin:"normal",value:l.name,onChange:g}),w.jsx("br",{}),w.jsx(cr,{variant:"standard",required:!0,id:"server-url",label:"URL",sx:Rm.textField2,margin:"normal",value:l.url,onChange:v})]}):z=w.jsx(Ys,{dividers:!0,children:w.jsxs("div",{children:[w.jsxs(ty,{variant:"standard",sx:Rm.formControl,children:[w.jsx(ny,{htmlFor:"server-name",children:"Name"}),w.jsx(xd,{variant:"standard",value:l.id,onChange:m,inputProps:{name:"server-name",id:"server-name"},children:R}),w.jsx(qre,{children:l.url})]}),w.jsx(Ot,{sx:Rm.button,"aria-label":"Add",color:"primary",onClick:y,size:"large",children:w.jsx(NP,{fontSize:"small"})}),w.jsx(Ot,{sx:Rm.button,"aria-label":"Edit",onClick:x,size:"large",children:w.jsx(Fp,{fontSize:"small"})}),w.jsx(Ot,{sx:Rm.button,"aria-label":"Delete",disabled:a.length<2,onClick:b,size:"large",children:w.jsx(j6,{fontSize:"small"})})]})}),w.jsxs(rl,{open:t,onClose:p,"aria-labelledby":"server-dialog-title",children:[w.jsx(vd,{id:"server-dialog-title",children:L}),z,w.jsxs(Tp,{children:[w.jsx(tr,{onClick:h,children:fe.get("Cancel")}),w.jsx(tr,{onClick:d,autoFocus:!0,children:T})]})]})}const pWt=t=>({open:!!t.controlState.dialogOpen.server,servers:Dae(t),selectedServer:pi(t)}),mWt={closeDialog:Oy,configureServers:l8e},gWt=Jt(pWt,mWt)(hWt),FJ=({anchorElement:t,layers:e,selectedLayerId:n,setSelectedLayerId:r,onClose:i})=>w.jsx(Pp,{anchorEl:t,keepMounted:!0,open:!!t,onClose:i,children:t&&e.map(o=>w.jsx(jr,{selected:o.id===n,onClick:()=>r(o.id===n?null:o.id),dense:!0,children:w.jsx(ts,{primary:tE(o)})},o.id))}),DD={settingsPanelTitle:t=>({marginBottom:t.spacing(1)}),settingsPanelPaper:t=>({backgroundColor:(t.palette.mode==="dark"?tre:ere)(t.palette.background.paper,.1),marginBottom:t.spacing(2)}),settingsPanelList:{margin:0}},Gm=({title:t,children:e})=>{const n=ue.Children.count(e),r=[];return ue.Children.forEach(e,(i,o)=>{r.push(i),o<n-1&&r.push(w.jsx(ep,{variant:"fullWidth",component:"li"},n+o))}),w.jsxs(Ke,{children:[t&&t!==""&&w.jsx(At,{variant:"body1",sx:DD.settingsPanelTitle,children:t}),w.jsx(Ho,{elevation:4,sx:DD.settingsPanelPaper,children:w.jsx(e2,{component:"nav",dense:!0,sx:DD.settingsPanelList,children:r})})]})},pr=({label:t,value:e,onClick:n,children:r})=>{let i;e||(i={marginBottom:10});const o=w.jsx(ts,{primary:t,secondary:e});let a;return r&&(a=w.jsx(Nb,{children:r})),n?w.jsxs(Yre,{style:i,onClick:n,children:[o,a]}):w.jsxs(Wx,{style:i,children:[o,a]})},kf=({propertyName:t,settings:e,updateSettings:n,disabled:r})=>w.jsx(aie,{checked:!!e[t],onChange:()=>n({...e,[t]:!e[t]}),disabled:r}),vWt=({propertyName:t,settings:e,updateSettings:n,options:r,disabled:i})=>{const o=(a,s)=>{n({...e,[t]:s})};return w.jsx(E5,{row:!0,value:e[t],onChange:o,children:r.map(([a,s])=>w.jsx(Og,{control:w.jsx(Vx,{}),value:s,label:a,disabled:i},a))})},J0={textField:t=>({marginLeft:t.spacing(1),marginRight:t.spacing(1),fontSize:t.typography.fontSize/2}),intTextField:t=>({marginLeft:t.spacing(1),marginRight:t.spacing(1),fontSize:t.typography.fontSize/2,width:t.spacing(6)}),localeAvatar:{margin:10}},jJ=[["doNothing","Do nothing"],["pan","Pan"],["panAndZoom","Pan and zoom"]],yWt=[["point","Points"],["line","Lines"],["bar","Bars"]],xWt=({open:t,closeDialog:e,settings:n,selectedServer:r,baseMapLayers:i,overlayLayers:o,updateSettings:a,changeLocale:s,openDialog:l,viewerVersion:c,serverInfo:u})=>{const[f,d]=ue.useState(null),[h,p]=ue.useState(null),[m,g]=ue.useState(null),[v,y]=ue.useState(n.timeChunkSize+"");if(ue.useEffect(()=>{const A=parseInt(v);!Number.isNaN(A)&&A!==n.timeChunkSize&&a({timeChunkSize:A})},[v,n,a]),!t)return null;function x(){e("settings")}function b(){l("server")}function _(A){a({timeAnimationInterval:parseInt(A.target.value)})}function S(A){a({timeSeriesChartTypeDefault:A.target.value})}function O(A){a({datasetLocateMode:A.target.value})}function C(A){a({placeLocateMode:A.target.value})}function E(A){y(A.target.value)}let k=null;f&&(k=Object.getOwnPropertyNames(fe.languages).map(A=>{const q=fe.languages[A];return w.jsx(jr,{selected:A===n.locale,onClick:()=>s(A),children:w.jsx(ts,{primary:q})},A)}));function I(A){d(A.currentTarget)}function P(){d(null)}function R(A){p(A.currentTarget)}function T(){p(null)}const L=A=>{A.stopPropagation(),l("userBaseMaps")},z=nE(i,n.selectedBaseMapId),B=tE(z);function U(A){g(A.currentTarget)}function W(){g(null)}const $=A=>{A.stopPropagation(),l("userOverlays")},N=nE(o,n.selectedOverlayId),D=tE(N);return w.jsxs("div",{children:[w.jsxs(rl,{open:t,fullWidth:!0,maxWidth:"sm",onClose:x,scroll:"body",children:[w.jsx(vd,{children:fe.get("Settings")}),w.jsxs(Ys,{children:[w.jsxs(Gm,{title:fe.get("General"),children:[w.jsx(pr,{label:fe.get("Server"),value:r.name,onClick:b}),w.jsx(pr,{label:fe.get("Language"),value:fe.languages[n.locale],onClick:I}),w.jsx(pr,{label:fe.get("Time interval of the player"),children:w.jsx(cr,{variant:"standard",select:!0,sx:J0.textField,value:n.timeAnimationInterval,onChange:_,margin:"normal",children:tWe.map((A,q)=>w.jsx(jr,{value:A,children:A+" ms"},q))})})]}),w.jsxs(Gm,{title:fe.get("Time-Series"),children:[w.jsx(pr,{label:fe.get("Show chart after adding a place"),value:lC(n.autoShowTimeSeries),children:w.jsx(kf,{propertyName:"autoShowTimeSeries",settings:n,updateSettings:a})}),w.jsx(pr,{label:fe.get("Default chart type"),children:w.jsx(cr,{variant:"standard",select:!0,sx:J0.textField,value:n.timeSeriesChartTypeDefault,onChange:S,margin:"normal",children:yWt.map(([A,q])=>w.jsx(jr,{value:A,children:fe.get(q)},A))})}),w.jsx(pr,{label:fe.get("Calculate standard deviation"),value:lC(n.timeSeriesIncludeStdev),children:w.jsx(kf,{propertyName:"timeSeriesIncludeStdev",settings:n,updateSettings:a})}),w.jsx(pr,{label:fe.get("Calculate median instead of mean (disables standard deviation)"),value:lC(n.timeSeriesUseMedian),children:w.jsx(kf,{propertyName:"timeSeriesUseMedian",settings:n,updateSettings:a})}),w.jsx(pr,{label:fe.get("Minimal number of data points in a time series update"),children:w.jsx(cr,{variant:"standard",sx:J0.intTextField,value:v,onChange:E,margin:"normal",size:"small"})})]}),w.jsxs(Gm,{title:fe.get("Map"),children:[w.jsx(pr,{label:fe.get("Base map"),value:B,onClick:R,children:w.jsx(tr,{onClick:L,children:fe.get("User Base Maps")+"..."})}),w.jsx(pr,{label:fe.get("Overlay"),value:D,onClick:U,children:w.jsx(tr,{onClick:$,children:fe.get("User Overlays")+"..."})}),w.jsx(pr,{label:fe.get("Projection"),children:w.jsx(vWt,{propertyName:"mapProjection",settings:n,updateSettings:a,options:[[fe.get("Geographic"),py],[fe.get("Mercator"),$B]]})}),w.jsx(pr,{label:fe.get("Image smoothing"),value:lC(n.imageSmoothingEnabled),children:w.jsx(kf,{propertyName:"imageSmoothingEnabled",settings:n,updateSettings:a})}),w.jsx(pr,{label:fe.get("On dataset selection"),children:w.jsx(cr,{variant:"standard",select:!0,sx:J0.textField,value:n.datasetLocateMode,onChange:O,margin:"normal",children:jJ.map(([A,q])=>w.jsx(jr,{value:A,children:fe.get(q)},A))})}),w.jsx(pr,{label:fe.get("On place selection"),children:w.jsx(cr,{variant:"standard",select:!0,sx:J0.textField,value:n.placeLocateMode,onChange:C,margin:"normal",children:jJ.map(([A,q])=>w.jsx(jr,{value:A,children:fe.get(q)},A))})})]}),w.jsx(Gm,{title:fe.get("Legal Agreement"),children:w.jsx(pr,{label:fe.get("Privacy notice"),value:n.privacyNoticeAccepted?fe.get("Accepted"):"",children:w.jsx(tr,{disabled:!n.privacyNoticeAccepted,onClick:()=>{a({privacyNoticeAccepted:!1}),window.location.reload()},children:fe.get("Revoke consent")})})}),w.jsxs(Gm,{title:fe.get("System Information"),children:[w.jsx(pr,{label:`xcube Viewer ${fe.get("version")}`,value:c}),w.jsx(pr,{label:`xcube Server ${fe.get("version")}`,value:u?u.version:fe.get("Cannot reach server")})]})]})]}),w.jsx(Pp,{anchorEl:f,keepMounted:!0,open:!!f,onClose:P,children:k}),w.jsx(FJ,{anchorElement:h,layers:i,selectedLayerId:n.selectedBaseMapId,setSelectedLayerId:A=>a({selectedBaseMapId:A}),onClose:T}),w.jsx(FJ,{anchorElement:m,layers:o,selectedLayerId:n.selectedOverlayId,setSelectedLayerId:A=>a({selectedOverlayId:A}),onClose:W})]})},lC=t=>t?fe.get("On"):fe.get("Off"),bWt="1.3.0",_Wt=t=>({locale:t.controlState.locale,open:t.controlState.dialogOpen.settings,settings:t.controlState,baseMapLayers:XB(t),overlayLayers:QB(t),selectedServer:pi(t),viewerVersion:bWt,serverInfo:t.dataState.serverInfo}),wWt={closeDialog:Oy,updateSettings:ow,changeLocale:jle,openDialog:Lp},SWt=Jt(_Wt,wWt)(xWt),BJ={separatorTextField:t=>({marginLeft:t.spacing(1),marginRight:t.spacing(1),fontSize:t.typography.fontSize/2,maxWidth:"6em"}),fileNameTextField:t=>({marginLeft:t.spacing(1),marginRight:t.spacing(1),fontSize:t.typography.fontSize/2})},OWt=({open:t,closeDialog:e,settings:n,updateSettings:r,downloadTimeSeries:i})=>{const o=()=>{e("export")};function a(c){r({exportFileName:c.target.value})}function s(c){r({exportTimeSeriesSeparator:c.target.value})}const l=()=>{o(),i()};return w.jsx("div",{children:w.jsxs(rl,{open:t,fullWidth:!0,maxWidth:"xs",onClose:o,scroll:"body",children:[w.jsx(Ys,{children:w.jsxs(Gm,{title:fe.get("Export Settings"),children:[w.jsx(pr,{label:fe.get("Include time-series data")+" (*.txt)",value:cC(n.exportTimeSeries),children:w.jsx(kf,{propertyName:"exportTimeSeries",settings:n,updateSettings:r})}),w.jsx(pr,{label:fe.get("Separator for time-series data"),children:w.jsx(cr,{variant:"standard",sx:BJ.separatorTextField,value:n.exportTimeSeriesSeparator,onChange:s,disabled:!n.exportTimeSeries,margin:"normal",size:"small"})}),w.jsx(pr,{label:fe.get("Include places data")+" (*.geojson)",value:cC(n.exportPlaces),children:w.jsx(kf,{propertyName:"exportPlaces",settings:n,updateSettings:r})}),w.jsx(pr,{label:fe.get("Combine place data in one file"),value:cC(n.exportPlacesAsCollection),children:w.jsx(kf,{propertyName:"exportPlacesAsCollection",settings:n,updateSettings:r,disabled:!n.exportPlaces})}),w.jsx(pr,{label:fe.get("As ZIP archive"),value:cC(n.exportZipArchive),children:w.jsx(kf,{propertyName:"exportZipArchive",settings:n,updateSettings:r})}),w.jsx(pr,{label:fe.get("File name"),children:w.jsx(cr,{variant:"standard",sx:BJ.fileNameTextField,value:n.exportFileName,onChange:a,margin:"normal",size:"small"})})]})}),w.jsx(Tp,{children:w.jsx(tr,{onClick:l,disabled:!EWt(n),children:fe.get("Download")})})]})})},cC=t=>t?fe.get("On"):fe.get("Off"),CWt=t=>/^[0-9a-zA-Z_-]+$/.test(t),TWt=t=>t.toUpperCase()==="TAB"||t.length===1,EWt=t=>(t.exportTimeSeries||t.exportPlaces)&&CWt(t.exportFileName)&&(!t.exportTimeSeries||TWt(t.exportTimeSeriesSeparator)),PWt=t=>({locale:t.controlState.locale,open:!!t.controlState.dialogOpen.export,settings:t.controlState}),MWt={closeDialog:Oy,updateSettings:ow,downloadTimeSeries:g8e},kWt=Jt(PWt,MWt)(OWt);var B6={},AWt=ft;Object.defineProperty(B6,"__esModule",{value:!0});var p0e=B6.default=void 0,RWt=AWt(pt()),IWt=w;p0e=B6.default=(0,RWt.default)((0,IWt.jsx)("path",{d:"M16.59 8.59 12 13.17 7.41 8.59 6 10l6 6 6-6z"}),"ExpandMore");var z6={},DWt=ft;Object.defineProperty(z6,"__esModule",{value:!0});var m0e=z6.default=void 0,LWt=DWt(pt()),NWt=w;m0e=z6.default=(0,LWt.default)((0,NWt.jsx)("path",{d:"m12 8-6 6 1.41 1.41L12 10.83l4.59 4.58L18 14z"}),"ExpandLess");const $Wt=({title:t,accept:e,multiple:n,disabled:r,onSelect:i,className:o})=>{const a=M.useRef(null),s=c=>{if(c.target.files!==null&&c.target.files.length){const u=[];for(let f=0;f<c.target.files.length;f++)u.push(c.target.files[f]);i(u)}},l=()=>{a.current!==null&&a.current.click()};return w.jsxs(w.Fragment,{children:[w.jsx("input",{type:"file",accept:e,multiple:n,ref:a,hidden:!0,onChange:s,disabled:r}),w.jsx(tr,{onClick:l,disabled:r,className:o,variant:"outlined",size:"small",children:t})]})},LD={parse:t=>t,format:t=>typeof t=="string"?t:`${t}`,validate:t=>!0};function U6(){return t=>{const{options:e,updateOptions:n,optionKey:r,label:i,style:o,className:a,disabled:s,parse:l,format:c,validate:u}=t,f=e[r],d=h=>{const p=h.target.value,m=(l||LD.parse)(p);n({[r]:m})};return w.jsx(cr,{label:fe.get(i),value:(c||LD.format)(f),error:!(u||LD.validate)(f),onChange:d,style:o,className:a,disabled:s,size:"small",variant:"standard"})}}const ex=U6(),FWt=Li("div")(({theme:t})=>({paddingTop:t.spacing(2)})),jWt=({options:t,updateOptions:e})=>w.jsx(FWt,{children:w.jsxs("div",{style:{display:"grid",gap:12,paddingTop:12,gridTemplateColumns:"auto auto"},children:[w.jsx(ex,{optionKey:"timeNames",label:"Time property names",options:t,updateOptions:e}),w.jsx("div",{id:"spareField"}),w.jsx(ex,{label:"Group property names",optionKey:"groupNames",options:t,updateOptions:e}),w.jsx(ex,{label:"Group prefix (used as fallback)",optionKey:"groupPrefix",options:t,updateOptions:e}),w.jsx(ex,{label:"Label property names",optionKey:"labelNames",options:t,updateOptions:e}),w.jsx(ex,{label:"Label prefix (used as fallback)",optionKey:"labelPrefix",options:t,updateOptions:e})]})}),io=U6(),BWt=Li("div")(({theme:t})=>({paddingTop:t.spacing(2)})),zWt=({options:t,updateOptions:e})=>{const n=t.forceGeometry;return w.jsxs(BWt,{children:[w.jsxs("div",{style:{display:"grid",gap:12,paddingTop:12,gridTemplateColumns:"auto auto"},children:[w.jsx(io,{optionKey:"xNames",label:"X/longitude column names",options:t,updateOptions:e,disabled:n}),w.jsx(io,{optionKey:"yNames",label:"Y/latitude column names",options:t,updateOptions:e,disabled:n}),w.jsxs("span",{children:[w.jsx(UL,{checked:t.forceGeometry,onChange:r=>e({forceGeometry:r.target.checked}),size:"small"}),w.jsx("span",{children:"Use geometry column"})]}),w.jsx(io,{optionKey:"geometryNames",label:"Geometry column names",options:t,updateOptions:e,disabled:!n}),w.jsx(io,{optionKey:"timeNames",label:"Time column names",options:t,updateOptions:e}),w.jsx("div",{id:"spareField"}),w.jsx(io,{optionKey:"groupNames",label:"Group column names",options:t,updateOptions:e}),w.jsx(io,{optionKey:"groupPrefix",label:"Group prefix (used as fallback)",options:t,updateOptions:e}),w.jsx(io,{optionKey:"labelNames",label:"Label column names",options:t,updateOptions:e}),w.jsx(io,{optionKey:"labelPrefix",label:"Label prefix (used as fallback)",options:t,updateOptions:e})]}),w.jsxs("div",{style:{display:"grid",gap:12,paddingTop:12,gridTemplateColumns:"auto auto auto"},children:[w.jsx(io,{optionKey:"separator",label:"Separator character",options:t,updateOptions:e}),w.jsx(io,{optionKey:"comment",label:"Comment character",options:t,updateOptions:e}),w.jsx(io,{optionKey:"quote",label:"Quote character",options:t,updateOptions:e}),w.jsx(io,{optionKey:"escape",label:"Escape character",options:t,updateOptions:e}),w.jsx("div",{}),w.jsxs("span",{children:[w.jsx(UL,{checked:t.trim,onChange:r=>e({trim:r.target.checked}),size:"small"}),w.jsx("span",{children:"Remove whitespaces"})]}),w.jsx(io,{optionKey:"nanToken",label:"Not-a-number token",options:t,updateOptions:e}),w.jsx(io,{optionKey:"trueToken",label:"True token",options:t,updateOptions:e}),w.jsx(io,{optionKey:"falseToken",label:"False token",options:t,updateOptions:e})]})]})},tx=U6(),UWt=Li("div")(({theme:t})=>({paddingTop:t.spacing(2)})),WWt=({options:t,updateOptions:e})=>w.jsx(UWt,{children:w.jsxs("div",{style:{display:"grid",gap:12,paddingTop:12,gridTemplateColumns:"auto auto"},children:[w.jsx(tx,{optionKey:"time",label:"Time (UTC, ISO-format)",options:t,updateOptions:e}),w.jsx("div",{id:"spareField"}),w.jsx(tx,{label:"Group",options:t,optionKey:"group",updateOptions:e}),w.jsx(tx,{label:"Group prefix (used as fallback)",optionKey:"groupPrefix",options:t,updateOptions:e,disabled:t.group.trim()!==""}),w.jsx(tx,{label:"Label",optionKey:"label",options:t,updateOptions:e}),w.jsx(tx,{label:"Label prefix (used as fallback)",optionKey:"labelPrefix",options:t,updateOptions:e,disabled:t.label.trim()!==""})]})}),ND={csv:{...qae,codeExt:[]},geojson:{...Xae,codeExt:[Spe()]},wkt:{...Qae,codeExt:[]}},$D={spacer:{flexGrow:1},actionButton:t=>({marginRight:t.spacing(1)}),error:{fontSize:"small"}},VWt=Li("div")(({theme:t})=>({paddingTop:t.spacing(.5),display:"flex",flexDirection:"row",alignItems:"center"})),GWt=Li($Wt)(({theme:t})=>({marginRight:t.spacing(1)})),HWt=({open:t,closeDialog:e,userPlacesFormatName:n,userPlacesFormatOptions:r,updateSettings:i,addUserPlacesFromText:o,nextMapInteraction:a,setMapInteraction:s})=>{const[l,c]=M.useState(""),[u,f]=M.useState(null),[d,h]=M.useState(!1),[p,m]=M.useState(!1),[g,v]=M.useState(n),[y,x]=M.useState(r);if(M.useEffect(()=>{v(n)},[n]),M.useEffect(()=>{x(r)},[r]),!t)return null;const b=()=>{s("Select"),e("addUserPlacesFromText"),i({userPlacesFormatName:g,userPlacesFormatOptions:y}),o(l)},_=()=>{s(a),e("addUserPlacesFromText")},S=()=>{c("")},O=z=>{const B=z[0];h(!0);const U=new FileReader;U.onloadend=()=>{const W=U.result;v(gH(W)),c(W),h(!1)},U.onabort=U.onerror=()=>{h(!1)},U.readAsText(B,"UTF-8")},C=()=>{c("")},E=()=>{console.info("PASTE!",l)},k=z=>{let B=g;l===""&&z.length>10&&(B=gH(z),v(B)),c(z),f(ND[B].checkError(z))};function I(z){v(z.target.value)}function P(z){x({...y,csv:{...y.csv,...z}})}function R(z){x({...y,geojson:{...y.geojson,...z}})}function T(z){x({...y,wkt:{...y.wkt,...z}})}let L;return g==="csv"?L=w.jsx(zWt,{options:y.csv,updateOptions:P}):g==="geojson"?L=w.jsx(jWt,{options:y.geojson,updateOptions:R}):L=w.jsx(WWt,{options:y.wkt,updateOptions:T}),w.jsxs(rl,{fullWidth:!0,open:t,onClose:_,"aria-labelledby":"server-dialog-title",children:[w.jsx(vd,{id:"server-dialog-title",children:fe.get("Import places")}),w.jsxs(Ys,{dividers:!0,children:[w.jsxs(E5,{row:!0,value:g,onChange:z=>I(z),children:[w.jsx(Og,{value:"csv",label:fe.get(qae.name),control:w.jsx(Vx,{})},"csv"),w.jsx(Og,{value:"geojson",label:fe.get(Xae.name),control:w.jsx(Vx,{})},"geojson"),w.jsx(Og,{value:"wkt",label:fe.get(Qae.name),control:w.jsx(Vx,{})},"wkt")]}),w.jsx(ik,{theme:Kt.instance.branding.themeName||"light",placeholder:fe.get("Enter text or drag & drop a text file."),autoFocus:!0,height:"400px",extensions:ND[g].codeExt,value:l,onChange:k,onDrop:C,onPaste:E,onPasteCapture:E}),u&&w.jsx(At,{color:"error",sx:$D.error,children:u}),w.jsxs(VWt,{children:[w.jsx(GWt,{title:fe.get("From File")+"...",accept:ND[g].fileExt,multiple:!1,onSelect:O,disabled:d}),w.jsx(tr,{onClick:S,disabled:l.trim()===""||d,sx:$D.actionButton,variant:"outlined",size:"small",children:fe.get("Clear")}),w.jsx(Ke,{sx:$D.spacer}),w.jsx(tr,{onClick:()=>m(!p),endIcon:p?w.jsx(m0e,{}):w.jsx(p0e,{}),variant:"outlined",size:"small",children:fe.get("Options")})]}),w.jsx(d5,{in:p,timeout:"auto",unmountOnExit:!0,children:L})]}),w.jsxs(Tp,{children:[w.jsx(tr,{onClick:_,variant:"text",children:fe.get("Cancel")}),w.jsx(tr,{onClick:b,disabled:l.trim()===""||u!==null||d,variant:"text",children:fe.get("OK")})]})]})},qWt=t=>({open:t.controlState.dialogOpen.addUserPlacesFromText,userPlacesFormatName:t.controlState.userPlacesFormatName,userPlacesFormatOptions:t.controlState.userPlacesFormatOptions,nextMapInteraction:t.controlState.lastMapInteraction}),XWt={closeDialog:Oy,updateSettings:ow,setMapInteraction:Tle,addUserPlacesFromText:Vse},QWt=Jt(qWt,XWt)(HWt);var W6={},YWt=ft;Object.defineProperty(W6,"__esModule",{value:!0});var V6=W6.default=void 0,KWt=YWt(pt()),ZWt=w;V6=W6.default=(0,KWt.default)((0,ZWt.jsx)("path",{d:"M16 1H4c-1.1 0-2 .9-2 2v14h2V3h12zm3 4H8c-1.1 0-2 .9-2 2v14c0 1.1.9 2 2 2h11c1.1 0 2-.9 2-2V7c0-1.1-.9-2-2-2m0 16H8V7h11z"}),"ContentCopy");function G6(t,e){return g0e(t,e,[]).join("")}function g0e(t,e,n){if(t.nodeType==Node.CDATA_SECTION_NODE||t.nodeType==Node.TEXT_NODE)n.push(t.nodeValue);else{var r=void 0;for(r=t.firstChild;r;r=r.nextSibling)g0e(r,e,n)}return n}function JWt(t){return"documentElement"in t}function eVt(t){return new DOMParser().parseFromString(t,"application/xml")}function v0e(t,e){return function(n,r){var i=t.call(this,n,r);if(i!==void 0){var o=r[r.length-1];o.push(i)}}}function sa(t,e,n){return function(r,i){var o=t.call(this,r,i);if(o!==void 0){var a=i[i.length-1],s=r.localName,l=void 0;s in a?l=a[s]:(l=[],a[s]=l),l.push(o)}}}function vt(t,e,n){return function(r,i){var o=t.call(this,r,i);if(o!==void 0){var a=i[i.length-1],s=r.localName;a[s]=o}}}function Ni(t,e,n){var r={},i,o;for(i=0,o=t.length;i<o;++i)r[t[i]]=e;return r}function tVt(t,e,n,r){var i;for(i=e.firstElementChild;i;i=i.nextElementSibling){var o=t[i.namespaceURI];if(o!==void 0){var a=o[i.localName];a!==void 0&&a.call(r,i,n)}}}function vi(t,e,n,r,i){return r.push(t),tVt(e,n,r,i),r.pop()}var nVt=function(){function t(){}return t.prototype.read=function(e){if(e)if(typeof e=="string"){var n=eVt(e);return this.readFromDocument(n)}else return JWt(e)?this.readFromDocument(e):this.readFromNode(e);else return null},t.prototype.readFromDocument=function(e){for(var n=e.firstChild;n;n=n.nextSibling)if(n.nodeType==Node.ELEMENT_NODE)return this.readFromNode(n);return null},t.prototype.readFromNode=function(e){},t}();function Ug(t){var e=/^\s*(true|1)|(false|0)\s*$/.exec(t);if(e)return e[1]!==void 0||!1}function fg(t){var e=G6(t,!1);return Fc(e)}function Fc(t){var e=/^\s*([+\-]?\d*\.?\d+(?:e[+\-]?\d+)?)\s*$/i.exec(t);if(e)return parseFloat(e[1])}function FD(t){var e=G6(t,!1);return $P(e)}function $P(t){var e=/^\s*(\d+)\s*$/.exec(t);if(e)return parseInt(e[1],10)}function bn(t){return G6(t,!1).trim()}var rVt="http://www.w3.org/1999/xlink";function H6(t){return t.getAttributeNS(rVt,"href")}var iVt=function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,i){r.__proto__=i}||function(r,i){for(var o in i)Object.prototype.hasOwnProperty.call(i,o)&&(r[o]=i[o])},t(e,n)};return function(e,n){if(typeof n!="function"&&n!==null)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");t(e,n);function r(){this.constructor=e}e.prototype=n===null?Object.create(n):(r.prototype=n.prototype,new r)}}(),$i=[null,"http://www.opengis.net/wms"],oVt=Ni($i,{Service:vt(TVt),Capability:vt(CVt)}),aVt=Ni($i,{Request:vt(IVt),Exception:vt(kVt),Layer:vt(AVt)}),sVt=function(t){iVt(e,t);function e(){var n=t.call(this)||this;return n.version=void 0,n}return e.prototype.readFromNode=function(n){this.version=n.getAttribute("version").trim();var r=vi({version:this.version},oVt,n,[]);return r||null},e}(nVt),lVt=Ni($i,{Name:vt(bn),Title:vt(bn),Abstract:vt(bn),KeywordList:vt(_0e),OnlineResource:vt(H6),ContactInformation:vt(EVt),Fees:vt(bn),AccessConstraints:vt(bn),LayerLimit:vt(FD),MaxWidth:vt(FD),MaxHeight:vt(FD)}),cVt=Ni($i,{ContactPersonPrimary:vt(PVt),ContactPosition:vt(bn),ContactAddress:vt(MVt),ContactVoiceTelephone:vt(bn),ContactFacsimileTelephone:vt(bn),ContactElectronicMailAddress:vt(bn)}),uVt=Ni($i,{ContactPerson:vt(bn),ContactOrganization:vt(bn)}),fVt=Ni($i,{AddressType:vt(bn),Address:vt(bn),City:vt(bn),StateOrProvince:vt(bn),PostCode:vt(bn),Country:vt(bn)}),dVt=Ni($i,{Format:v0e(bn)}),y0e=Ni($i,{Name:vt(bn),Title:vt(bn),Abstract:vt(bn),KeywordList:vt(_0e),CRS:sa(bn),EX_GeographicBoundingBox:vt(OVt),BoundingBox:sa(SVt),Dimension:sa(RVt),Attribution:vt(wVt),AuthorityURL:sa(NVt),Identifier:sa(bn),MetadataURL:sa($Vt),DataURL:sa(bu),FeatureListURL:sa(bu),Style:sa(FVt),MinScaleDenominator:vt(fg),MaxScaleDenominator:vt(fg),Layer:sa(x0e)}),hVt=Ni($i,{Title:vt(bn),OnlineResource:vt(H6),LogoURL:vt(b0e)}),pVt=Ni($i,{westBoundLongitude:vt(fg),eastBoundLongitude:vt(fg),southBoundLatitude:vt(fg),northBoundLatitude:vt(fg)}),mVt=Ni($i,{GetCapabilities:vt(jD),GetMap:vt(jD),GetFeatureInfo:vt(jD)}),gVt=Ni($i,{Format:sa(bn),DCPType:sa(DVt)}),vVt=Ni($i,{HTTP:vt(LVt)}),yVt=Ni($i,{Get:vt(bu),Post:vt(bu)}),xVt=Ni($i,{Name:vt(bn),Title:vt(bn),Abstract:vt(bn),LegendURL:sa(b0e),StyleSheetURL:vt(bu),StyleURL:vt(bu)}),bVt=Ni($i,{Format:vt(bn),OnlineResource:vt(H6)}),_Vt=Ni($i,{Keyword:v0e(bn)});function wVt(t,e){return vi({},hVt,t,e)}function SVt(t,e){var n=[Fc(t.getAttribute("minx")),Fc(t.getAttribute("miny")),Fc(t.getAttribute("maxx")),Fc(t.getAttribute("maxy"))],r=[Fc(t.getAttribute("resx")),Fc(t.getAttribute("resy"))];return{crs:t.getAttribute("CRS"),extent:n,res:r}}function OVt(t,e){var n=vi({},pVt,t,e);if(n){var r=n.westBoundLongitude,i=n.southBoundLatitude,o=n.eastBoundLongitude,a=n.northBoundLatitude;if(!(r===void 0||i===void 0||o===void 0||a===void 0))return[r,i,o,a]}}function CVt(t,e){return vi({},aVt,t,e)}function TVt(t,e){return vi({},lVt,t,e)}function EVt(t,e){return vi({},cVt,t,e)}function PVt(t,e){return vi({},uVt,t,e)}function MVt(t,e){return vi({},fVt,t,e)}function kVt(t,e){return vi([],dVt,t,e)}function AVt(t,e){var n=vi({},y0e,t,e);return n.Layer===void 0?Object.assign(n,x0e(t,e)):n}function x0e(t,e){var n=e[e.length-1],r=vi({},y0e,t,e);if(r){var i=Ug(t.getAttribute("queryable"));i===void 0&&(i=n.queryable),r.queryable=i!==void 0?i:!1;var o=$P(t.getAttribute("cascaded"));o===void 0&&(o=n.cascaded),r.cascaded=o;var a=Ug(t.getAttribute("opaque"));a===void 0&&(a=n.opaque),r.opaque=a!==void 0?a:!1;var s=Ug(t.getAttribute("noSubsets"));s===void 0&&(s=n.noSubsets),r.noSubsets=s!==void 0?s:!1;var l=Fc(t.getAttribute("fixedWidth"));l||(l=n.fixedWidth),r.fixedWidth=l;var c=Fc(t.getAttribute("fixedHeight"));c||(c=n.fixedHeight),r.fixedHeight=c;var u=["Style","CRS","AuthorityURL"];u.forEach(function(d){if(d in n){var h=r[d]||[];r[d]=h.concat(n[d])}});var f=["EX_GeographicBoundingBox","BoundingBox","Dimension","Attribution","MinScaleDenominator","MaxScaleDenominator"];return f.forEach(function(d){if(!(d in r)){var h=n[d];r[d]=h}}),r}}function RVt(t,e){var n={name:t.getAttribute("name"),units:t.getAttribute("units"),unitSymbol:t.getAttribute("unitSymbol"),default:t.getAttribute("default"),multipleValues:Ug(t.getAttribute("multipleValues")),nearestValue:Ug(t.getAttribute("nearestValue")),current:Ug(t.getAttribute("current")),values:bn(t)};return n}function bu(t,e){return vi({},bVt,t,e)}function IVt(t,e){return vi({},mVt,t,e)}function DVt(t,e){return vi({},vVt,t,e)}function LVt(t,e){return vi({},yVt,t,e)}function jD(t,e){return vi({},gVt,t,e)}function b0e(t,e){var n=bu(t,e);if(n){var r=[$P(t.getAttribute("width")),$P(t.getAttribute("height"))];return n.size=r,n}}function NVt(t,e){var n=bu(t,e);if(n)return n.name=t.getAttribute("name"),n}function $Vt(t,e){var n=bu(t,e);if(n)return n.type=t.getAttribute("type"),n}function FVt(t,e){return vi({},xVt,t,e)}function _0e(t,e){return vi([],_Vt,t,e)}const jVt=new sVt;async function BVt(t,e){try{return zVt(t,e)}catch(n){return console.warn(`getWmsCapabilities() for URL ${t} failed:`,n),null}}async function zVt(t,e){(t.startsWith("http:")||t.startsWith("https:"))&&!t.includes("?")&&(t+="?SERVICE=WMS&REQUEST=GetCapabilities");const n=await fetch(t,e);if(!n.ok)throw new ioe(n.status,n.statusText);const r=await n.text();return UVt(r)}function UVt(t){return WVt(t).map(e=>{const n=e.Name,r=e.Title||n;let i;const o=e.Attribution;if(FP(o)){const a=o.Title,s=o.OnlineResource;a&&s?i=`&copy; <a href=&quot;${s}&quot;>${a}</a>`:s?i=`${s}`:a&&(i=`${a}`)}return{name:n,title:r,attribution:i}})}function WVt(t){const e=jVt.read(t);if(FP(e)){const n=e.Capability;if(FP(n))return LF(n,!0)}throw new Error("invalid WMSCapabilities object")}function LF(t,e){let n,r;if(e)n=t.Layer;else{const{Layer:o,...a}=t;n=o,r=a}let i;return Array.isArray(n)?i=n.flatMap(o=>LF(o)):FP(n)?i=LF(n):i=[{}],i.map(o=>VVt(r,o))}function VVt(t,e){if(!t)return e;if(typeof(t.Name||e.Name)!="string")throw new Error("invalid WMSCapabilities: missing Layer/Name");const r=t.Title,i=e.Title,o=r&&i?`${r} / ${i}`:i||r;return{...t,...e,Title:o}}function FP(t){return t!==null&&typeof t=="object"&&!Array.isArray(t)}const GVt=({userLayer:t,onChange:e,onCancel:n})=>{const[r,i]=M.useState(t.url),[o,a]=M.useState(null),[s,l]=M.useState(-1);M.useEffect(()=>{BVt(r).then(f=>{a(f)})},[r]),M.useEffect(()=>{if(o&&t.wms){const{layerName:f}=t.wms;l(o.findIndex(d=>d.name===f))}else l(-1)},[o,t.wms]);const c=()=>o&&o.length&&s!=-1,u=()=>{o&&s!==-1&&e({...t,group:zB,title:o[s].title,url:r.trim(),attribution:o[s].attribution,wms:{layerName:o[s].name}})};return w.jsxs(Ke,{sx:{display:"flex",gap:2,flexDirection:"column",padding:"5px 15px"},children:[w.jsx(cr,{required:!0,label:fe.get("WMS URL"),variant:"standard",size:"small",value:r,fullWidth:!0,onChange:f=>i(f.currentTarget.value)}),w.jsx(xd,{disabled:!o||!o.length,variant:"standard",onChange:f=>l(f.target.value),value:s,size:"small",renderValue:()=>o&&o.length&&s>=0?o[s].title:fe.get("WMS Layer"),children:(o||[]).map((f,d)=>w.jsx(jr,{value:d,selected:s===d,children:w.jsx(ts,{primary:f.title})},f.name))}),w.jsx(hw,{onDone:u,onCancel:n,doneDisabled:!c(),helpUrl:fe.get("docs/add-layer-wms.en.md")})]})},HVt=({userLayer:t,onChange:e,onCancel:n})=>{const[r,i]=ue.useState(t.title),[o,a]=ue.useState(t.url),[s,l]=ue.useState(t.attribution||""),c=(d,h)=>{const p=d!=="",m=h!==""&&(h.startsWith("http://")||h.trim().startsWith("https://"));return p&&m},u=()=>c(r.trim(),o.trim()),f=()=>e({...t,group:zB,title:r.trim(),url:o.trim(),attribution:s.trim()});return w.jsxs(Ke,{sx:{display:"flex",gap:1,flexDirection:"column",padding:"5px 15px"},children:[w.jsx(cr,{required:!0,label:fe.get("XYZ Layer URL"),variant:"standard",size:"small",value:o,fullWidth:!0,onChange:d=>a(d.currentTarget.value)}),w.jsxs(Ke,{sx:{display:"flex",gap:1},children:[w.jsx(cr,{required:!0,label:fe.get("Layer Title"),variant:"standard",size:"small",sx:{flexGrow:.3},value:r,onChange:d=>i(d.currentTarget.value)}),w.jsx(cr,{label:fe.get("Layer Attribution"),variant:"standard",size:"small",sx:{flexGrow:.7},value:s,onChange:d=>l(d.currentTarget.value)})]}),w.jsx(hw,{onDone:f,onCancel:n,doneDisabled:!u(),helpUrl:fe.get("docs/add-layer-xyz.en.md")})]})},qVt={paper:t=>({backgroundColor:(t.palette.mode==="dark"?tre:ere)(t.palette.background.paper,.1),marginBottom:t.spacing(2)})},zJ=({userLayers:t,setUserLayers:e,selectedId:n,setSelectedId:r})=>{const[i,o]=ue.useState(n),[a,s]=ue.useState(null),[l,c]=ife();if(!open)return null;const u=x=>{c(()=>e(t)),s({editId:x.id,editMode:"edit"})},f=x=>{c(void 0);const b=t.findIndex(_=>_.id===x.id);e([...t.slice(0,b+1),{...x,id:Js("user-layer"),title:x.title+" Copy"},...t.slice(b+1)])},d=x=>{c(void 0);const b=t.findIndex(_=>_.id===x.id);x.id===n&&r(i),x.id===i&&o(null),e([...t.slice(0,b),...t.slice(b+1)])},h=x=>{c(()=>e(t));const b=Js("user-layer-");e([...t,{id:b,group:zB,title:"",url:"",attribution:"",wms:x==="wms"?{layerName:""}:void 0}]),s({editId:b,editMode:"add"})},p=()=>{h("wms")},m=()=>{h("xyz")},g=x=>{c(void 0);const b=t.findIndex(_=>_.id===x.id);n===x.id&&r(i),e([...t.slice(0,b),x,...t.slice(b+1)]),s(null)},v=()=>{if(l(),a&&a.editMode==="add"){const x=t.findIndex(b=>b.id===a.editId);e([...t.slice(0,x),...t.slice(x+1)])}s(null)},y=a!==null;return w.jsx(Ho,{sx:qVt.paper,children:w.jsxs(e2,{component:"nav",dense:!0,children:[t.map(x=>{const b=n===x.id;return a&&a.editId===x.id?x.wms?w.jsx(GVt,{userLayer:x,onChange:g,onCancel:v},x.id):w.jsx(HVt,{userLayer:x,onChange:g,onCancel:v},x.id):w.jsxs(Yre,{selected:b,onClick:()=>r(b?null:x.id),children:[w.jsx(ts,{primary:x.title,secondary:x.url}),w.jsxs(Nb,{children:[w.jsx(Ot,{onClick:()=>u(x),size:"small",disabled:y,children:w.jsx(Fp,{})}),w.jsx(Ot,{onClick:()=>f(x),size:"small",disabled:y,children:w.jsx(V6,{})}),w.jsx(Ot,{onClick:()=>d(x),size:"small",disabled:y,children:w.jsx($p,{})})]})]},x.id)}),!y&&w.jsx(Wx,{sx:{minHeight:"3em"},children:w.jsx(Nb,{children:w.jsxs(Ke,{sx:{display:"flex",gap:2,paddingTop:2},children:[w.jsx(_t,{title:fe.get("Add layer from a Web Map Service"),children:w.jsx(tr,{onClick:p,startIcon:w.jsx(NP,{}),children:"WMS"})}),w.jsx(_t,{title:fe.get("Add layer from a Tiled Web Map"),children:w.jsx(tr,{onClick:m,startIcon:w.jsx(NP,{}),children:"XYZ"})})]})})})]})})},XVt=({dialogId:t,open:e,closeDialog:n,settings:r,updateSettings:i})=>{const[o,a]=ue.useState(t==="userBaseMaps"?0:1);if(!e)return null;const s=r.userBaseMaps,l=g=>{i({userBaseMaps:g})},c=r.userOverlays,u=g=>{i({userOverlays:g})},f=r.selectedBaseMapId,d=g=>{i({selectedBaseMapId:g})},h=r.selectedOverlayId,p=g=>{i({selectedOverlayId:g})};function m(){n(t)}return w.jsxs(rl,{open:e,fullWidth:!0,maxWidth:"sm",onClose:m,scroll:"body",children:[w.jsx(vd,{children:fe.get("User Layers")}),w.jsxs(Ys,{children:[w.jsx(Ke,{sx:{borderBottom:1,borderColor:"divider"},children:w.jsxs(A5,{value:o,onChange:(g,v)=>a(v),children:[w.jsx($b,{label:"Base Maps"}),w.jsx($b,{label:"Overlays"})]})}),o===0&&w.jsx(zJ,{userLayers:s,setUserLayers:l,selectedId:f,setSelectedId:d},"baseMaps"),o===1&&w.jsx(zJ,{userLayers:c,setUserLayers:u,selectedId:h,setSelectedId:p},"overlays")]})]})},QVt=(t,e)=>({open:t.controlState.dialogOpen[e.dialogId],settings:t.controlState,dialogId:e.dialogId}),YVt={closeDialog:Oy,updateSettings:ow},UJ=Jt(QVt,YVt)(XVt);function w0e({selected:t,title:e,actions:n}){return w.jsxs(n2,{sx:{pl:{sm:2},pr:{xs:1,sm:1},...t&&{background:r=>Hc(r.palette.primary.main,r.palette.action.activatedOpacity)}},children:[w.jsx(aE,{}),w.jsx(At,{sx:{flex:"1 1 100%",paddingLeft:1},children:e}),n]})}const KVt={container:{display:"flex",flexDirection:"column",height:"100%"},tableContainer:{overflowY:"auto",flexGrow:1}};function ZVt({userVariables:t,setUserVariables:e,selectedIndex:n,setSelectedIndex:r,setEditedVariable:i}){const o=n>=0?t[n]:null,a=n>=0,s=d=>{r(n!==d?d:-1)},l=()=>{i({editMode:"add",variable:Wqe()})},c=()=>{const d=t[n];e([...t.slice(0,n+1),Vqe(d),...t.slice(n+1)]),r(n+1)},u=()=>{i({editMode:"edit",variable:o})},f=()=>{e([...t.slice(0,n),...t.slice(n+1)]),n>=t.length-1&&r(t.length-2)};return w.jsxs(w.Fragment,{children:[w.jsx(w0e,{selected:n!==null,title:fe.get("Manage user variables"),actions:w.jsxs(w.Fragment,{children:[w.jsx(_t,{title:fe.get("Add user variable"),children:w.jsx(Ot,{color:"primary",onClick:l,children:w.jsx(dw,{})})}),a&&w.jsx(_t,{title:fe.get("Duplicate user variable"),children:w.jsx(Ot,{onClick:c,children:w.jsx(V6,{})})}),a&&w.jsx(_t,{title:fe.get("Edit user variable"),children:w.jsx(Ot,{onClick:u,children:w.jsx(Fp,{})})}),a&&w.jsx(_t,{title:fe.get("Remove user variable"),children:w.jsx(Ot,{onClick:f,children:w.jsx(j6,{})})})]})}),w.jsx(lie,{sx:KVt.tableContainer,children:w.jsxs(M5,{size:"small",children:[w.jsx(tDe,{children:w.jsxs(vl,{children:[w.jsx(sr,{sx:{width:"15%"},children:fe.get("Name")}),w.jsx(sr,{sx:{width:"15%"},children:fe.get("Title")}),w.jsx(sr,{sx:{width:"10%"},children:fe.get("Units")}),w.jsx(sr,{children:fe.get("Expression")})]})}),w.jsx(k5,{children:t.map((d,h)=>w.jsxs(vl,{hover:!0,selected:h===n,onClick:()=>s(h),children:[w.jsx(sr,{component:"th",scope:"row",children:d.name}),w.jsx(sr,{children:d.title}),w.jsx(sr,{children:d.units}),w.jsx(sr,{children:d.expression||""})]},d.id))})]})})]})}var q6={},JVt=ft;Object.defineProperty(q6,"__esModule",{value:!0});var S0e=q6.default=void 0,e8t=JVt(pt()),t8t=w;S0e=q6.default=(0,e8t.default)((0,t8t.jsx)("path",{d:"M10 18h4v-2h-4zM3 6v2h18V6zm3 7h12v-2H6z"}),"FilterList");const n8t=/^[a-zA-Z_$][a-zA-Z0-9_$]*$/;function r8t(t){return n8t.test(t)}const WJ={expressionPart:{padding:.2},expressionPartChip:{fontFamily:"monospace"}};function VJ({part:t,partType:e,onPartClicked:n}){return w.jsx(Ke,{component:"span",sx:WJ.expressionPart,children:w.jsx(OPe,{label:t,sx:WJ.expressionPartChip,size:"small",variant:"outlined",color:e==="variables"||e==="constants"?"default":e.includes("Functions")?"primary":"secondary",onClick:()=>n(t)})})}function i8t({anchorEl:t,exprPartTypes:e,setExprPartTypes:n,onClose:r}){const i=o=>{n({...e,[o]:!e[o]})};return w.jsx(Pp,{open:!!t,anchorEl:t,onClose:r,children:Fce.map(o=>w.jsx(u0e,{selected:e[o],title:fe.get(Hqe[o]),onClick:()=>i(o),dense:!0},o))})}function o8t({expression:t,onExpressionChange:e,variableNames:n,expressionCapabilities:r,handleInsertPartRef:i}){const o=hd(),a=M.useRef(null),s=M.useCallback(c=>{var f;const u=(f=a.current)==null?void 0:f.view;if(u){const d=u.state.selection.main,h=u.state.sliceDoc(d.from,d.to).trim();h!==""&&c.includes("X")&&(c=c.replace("X",h));const p=u.state.replaceSelection(c);p&&u.dispatch(p)}},[]);M.useEffect(()=>{i.current=s},[i,s]);const l=M.useCallback(c=>{const u=c.matchBefore(/\w*/);return u===null||u.from==u.to&&!c.explicit?null:{from:u.from,options:[...n.map(f=>({label:f,type:"variable"})),...r.namespace.constants.map(f=>({label:f,type:"variable"})),...r.namespace.arrayFunctions.map(f=>({label:f,type:"function"})),...r.namespace.otherFunctions.map(f=>({label:f,type:"function"}))]}},[n,r.namespace]);return w.jsx(ik,{theme:o.palette.mode||"none",width:"100%",height:"100px",placeholder:fe.get("Use keys CTRL+SPACE to show autocompletions"),extensions:[vpe({override:[l]})],value:t,onChange:e,ref:a})}async function a8t(t,e,n){if(n.trim()==="")return fe.get("Must not be empty");const r=`${t}/expressions/validate/${ly(e)}/${encodeURIComponent(n)}`;try{return await ooe(r),null}catch(i){const o=i.message;if(o){const a=o.indexOf("("),s=o.lastIndexOf(")");return o.slice(a>=0?a+1:0,s>=0?s:o.length)}return fe.get("Invalid expression")}}const uC={container:{display:"flex",flexDirection:"column",height:"100%"},content:{flexGrow:1,display:"flex",flexDirection:"column",gap:2,padding:1},propertiesRow:{display:"flex",gap:1},expressionRow:{flexGrow:1},expressionParts:{paddingTop:1,overflowY:"auto"},expressionPart:{padding:.2},expressionPartChip:{fontFamily:"monospace"}};function s8t({userVariables:t,setUserVariables:e,editedVariable:n,setEditedVariable:r,contextDataset:i,expressionCapabilities:o,serverUrl:a}){const[s,l]=M.useState(Gqe),[c,u]=M.useState(null),f=[...t,...i.variables],d=i.variables.filter(D=>!V1(D)).map(D=>D.name),{id:h,name:p,title:m,units:g,expression:v}=n.variable,y=f.findIndex(D=>D.id!==h&&D.name===p)>=0,x=!r8t(p),b=y?fe.get("Already in use"):x?fe.get("Not a valid identifier"):null,_=!b,[S,O]=M.useState(null),E=_&&!S,k=M.useRef(null);M.useEffect(()=>{const D=setTimeout(()=>{a8t(a,i.id,n.variable.expression).then(O)},500);return()=>{clearTimeout(D)}},[a,i.id,n.variable.expression]);const I=(D,A)=>{r({...n,variable:{...n.variable,[D]:A}})},P=()=>{if(n.editMode==="add")e([n.variable,...t]);else{const D=t.findIndex(A=>A.id===n.variable.id);if(D>=0){const A=[...t];A[D]=n.variable,e(A)}}r(null)},R=()=>{r(null)},T=D=>{I("name",D.target.value)},L=D=>{I("title",D.target.value)},z=D=>{I("units",D.target.value)},B=D=>{I("expression",D)},U=D=>{k.current(D)},W=D=>{u(D.currentTarget)},$=()=>{u(null)},N=[w.jsx(Ot,{size:"small",onClick:W,children:w.jsx(_t,{arrow:!0,title:fe.get("Display further elements to be used in expressions"),children:w.jsx(S0e,{})})},"filter")];return Fce.forEach(D=>{s[D]&&(D==="variables"?d.forEach(A=>{N.push(w.jsx(VJ,{part:A,partType:D,onPartClicked:U},`${D}-${A}`))}):o.namespace[D].forEach(A=>{N.push(w.jsx(VJ,{part:A,partType:D,onPartClicked:U},`${D}-${A}`))}))}),w.jsxs(w.Fragment,{children:[w.jsx(i8t,{anchorEl:c,exprPartTypes:s,setExprPartTypes:l,onClose:$}),w.jsx(w0e,{selected:!0,title:n.editMode==="add"?fe.get("Add user variable"):fe.get("Edit user variable"),actions:w.jsx(hw,{size:"medium",onDone:P,doneDisabled:!E,onCancel:R})}),w.jsxs(Ke,{sx:uC.content,children:[w.jsxs(Ke,{sx:uC.propertiesRow,children:[w.jsx(cr,{sx:{flexGrow:.3},error:!_,helperText:b,size:"small",variant:"standard",label:fe.get("Name"),value:p,onChange:T}),w.jsx(cr,{sx:{flexGrow:.6},size:"small",variant:"standard",label:fe.get("Title"),value:m,onChange:L}),w.jsx(cr,{sx:{flexGrow:.1},size:"small",variant:"standard",label:fe.get("Units"),value:g,onChange:z})]}),w.jsxs(Ke,{sx:uC.expressionRow,children:[w.jsx(At,{sx:D=>({paddingBottom:1,color:D.palette.text.secondary}),children:fe.get("Expression")}),w.jsx(o8t,{expression:v,onExpressionChange:B,variableNames:d,expressionCapabilities:o,handleInsertPartRef:k}),S&&w.jsx(At,{sx:{paddingBottom:1},color:"error",fontSize:"small",children:S}),w.jsx(Ke,{sx:uC.expressionParts,children:N})]})]})]})}const GJ={dialogContent:{height:420},dialogActions:{display:"flex",justifyContent:"space-between",gap:.2}};function l8t({open:t,closeDialog:e,selectedDataset:n,selectedVariableName:r,selectVariable:i,userVariables:o,updateDatasetUserVariables:a,expressionCapabilities:s,serverUrl:l}){const[c,u]=M.useState(o),[f,d]=M.useState(c.findIndex(v=>v.name===r)),[h,p]=M.useState(null);if(M.useEffect(()=>{u(o)},[o]),!t||!n||!s)return null;function m(){a(n.id,c),e(lE),f>=0&&i(c[f].name)}function g(){u(o),e(lE)}return w.jsxs(rl,{open:t,fullWidth:!0,maxWidth:"md",onClose:g,scroll:"body",children:[w.jsx(vd,{children:fe.get("User Variables")}),w.jsx(Ys,{dividers:!0,sx:GJ.dialogContent,children:h===null?w.jsx(ZVt,{userVariables:c,setUserVariables:u,selectedIndex:f,setSelectedIndex:d,setEditedVariable:p}):w.jsx(s8t,{userVariables:c,setUserVariables:u,editedVariable:h,setEditedVariable:p,contextDataset:n,expressionCapabilities:s,serverUrl:l})}),w.jsxs(Tp,{sx:GJ.dialogActions,children:[w.jsx(Ke,{children:w.jsx(sfe,{size:"medium",helpUrl:fe.get("docs/user-variables.en.md")})}),w.jsxs(Ke,{children:[w.jsx(tr,{onClick:g,children:fe.get("Cancel")}),w.jsx(tr,{onClick:m,disabled:h!==null||!c8t(c),children:fe.get("OK")})]})]})]})}function c8t(t){const e=new Set;return t.forEach(n=>e.add(n.name)),e.size===t.length}const u8t=t=>({open:t.controlState.dialogOpen[lE],selectedDataset:qr(t),selectedVariableName:yy(t),userVariables:jWe(t),expressionCapabilities:a6e(t),serverUrl:pi(t).url}),f8t={closeDialog:Oy,selectVariable:xle,updateDatasetUserVariables:WVe},d8t=Jt(u8t,f8t)(l8t),h8t=t=>({compact:Kt.instance.branding.compact}),p8t={},m8t=()=>o5({typography:{fontSize:12,htmlFontSize:14},palette:{mode:Kt.instance.branding.themeName,primary:Kt.instance.branding.primaryColor,secondary:Kt.instance.branding.secondaryColor}}),g8t=({compact:t})=>w.jsx(f3e,{children:w.jsx(Lne,{injectFirst:!0,children:w.jsxs(oCe,{theme:m8t(),children:[w.jsx(o2e,{}),!t&&w.jsx(bqe,{}),w.jsx(R6t,{}),w.jsxs(w.Fragment,{children:[w.jsx(V6t,{}),w.jsx(gWt,{}),w.jsx(SWt,{}),w.jsx(UJ,{dialogId:"userOverlays"},"userOverlays"),w.jsx(UJ,{dialogId:"userBaseMaps"},"userBaseMaps"),w.jsx(d8t,{}),w.jsx(QWt,{}),w.jsx(kWt,{}),w.jsx($6t,{}),w.jsx(aWt,{})]})]})})}),v8t=Jt(h8t,p8t)(g8t);function y8t(t,e,n){switch(t===void 0&&(t=rWe()),e.type){case lz:{const r={...t,...e.settings};return ll(r),r}case Ule:return ll(t),t;case Yb:{let r=t.selectedDatasetId||hf.get("dataset"),i=t.selectedVariableName||hf.get("variable"),o=t.mapInteraction,a=Ub(e.datasets,r);const s=a&&s3(a,i)||null;return a?s||(i=a.variables.length?a.variables[0].name:null):(r=null,i=null,a=e.datasets.length?e.datasets[0]:null,a&&(r=a.id,a.variables.length>0&&(i=a.variables[0].name))),r||(o="Select"),{...t,selectedDatasetId:r,selectedVariableName:i,mapInteraction:o}}case lle:{let r=t.selectedVariableName;const i=Ub(e.datasets,e.selectedDatasetId);!s3(i,r)&&i.variables.length>0&&(r=i.variables[0].name);const a=e.selectedDatasetId,s=coe(i),l=s?s[1]:null;return{...t,selectedDatasetId:a,selectedVariableName:r,selectedTimeRange:s,selectedTime:l}}case dle:{const{location:r}=e;return t.flyTo!==r?{...t,flyTo:r}:t}case hle:{const r=e.selectedPlaceGroupIds;return{...t,selectedPlaceGroupIds:r,selectedPlaceId:null}}case ple:{const{placeId:r}=e;return{...t,selectedPlaceId:r}}case yle:return{...t,selectedVariableName:e.selectedVariableName};case mle:return{...t,layerVisibilities:{...t.layerVisibilities,[e.layerId]:e.visible}};case gle:{const{mapPointInfoBoxEnabled:r}=e;return{...t,mapPointInfoBoxEnabled:r}}case vle:{const{variableCompareMode:r}=e;return{...t,variableCompareMode:r,variableSplitPos:void 0}}case iz:{const{variableSplitPos:r}=e;return{...t,variableSplitPos:r}}case _le:{let{selectedTime:r}=e;if(r!==null&&n){const i=M3(n),o=i?uae(i,r):-1;o>=0&&(r=i[o])}return t.selectedTime!==r?{...t,selectedTime:r}:t}case wle:{if(n){let r=Tse(n);if(r>=0){const i=M3(n);r+=e.increment,r<0&&(r=i.length-1),r>i.length-1&&(r=0);let o=i[r];const a=t.selectedTimeRange;if(a!==null&&(o<a[0]&&(o=a[0]),o>a[1]&&(o=a[1])),t.selectedTime!==o)return{...t,selectedTime:o}}}return t}case oz:return{...t,selectedTimeRange:e.selectedTimeRange};case D8e:return{...t,timeSeriesUpdateMode:e.timeSeriesUpdateMode};case Ole:return{...t,timeAnimationActive:e.timeAnimationActive,timeAnimationInterval:e.timeAnimationInterval};case ZB:{const{id:r,selected:i}=e;return i?x8t(t,Ws,r):t}case JB:{const{placeGroups:r}=e;return r.length>0?{...t,selectedPlaceGroupIds:[...t.selectedPlaceGroupIds||[],r[0].id]}:t}case ez:{const{placeGroupId:r,newName:i}=e;return r===Ws?{...t,userDrawnPlaceGroupName:i}:t}case tz:{const{placeId:r,places:i}=e;if(r===t.selectedPlaceId){let o=null;const a=i.findIndex(s=>s.id===r);return a>=0&&(a<i.length-1?o=i[a+1].id:a>0&&(o=i[a-1].id)),{...t,selectedPlaceId:o}}return t}case Gle:{const r=e.colorBarId;return{...t,userColorBars:[{id:r,type:"continuous",code:hoe},...t.userColorBars]}}case Hle:{const r=e.colorBarId,i=t.userColorBars.findIndex(o=>o.id===r);if(i>=0){const o={...t,userColorBars:[...t.userColorBars.slice(0,i),...t.userColorBars.slice(i+1)]};return ll(o),o}return t}case Qle:{const r=e.userColorBar,i=t.userColorBars.findIndex(o=>o.id===r.id);return i>=0?{...t,userColorBars:[...t.userColorBars.slice(0,i),{...r},...t.userColorBars.slice(i+1)]}:t}case Cle:{let r={...t,mapInteraction:e.mapInteraction,lastMapInteraction:t.mapInteraction};return e.mapInteraction==="Geometry"&&(r={...r,dialogOpen:{...t.dialogOpen,addUserPlacesFromText:!0}}),r}case Ele:{const{layerMenuOpen:r}=e;return t={...t,layerMenuOpen:r},ll(t),t}case Mle:{const{sidebarPosition:r}=e;return t={...t,sidebarPosition:r},t}case kle:{const{sidebarOpen:r}=e;return t={...t,sidebarOpen:r},ll(t),t}case Ale:{const{sidebarPanelId:r}=e;return t={...t,sidebarPanelId:r},ll(t),t}case Rle:return t={...t,volumeRenderMode:e.volumeRenderMode},ll(t),t;case Ile:{const{volumeId:r,volumeState:i}=e;return t={...t,volumeStates:{...t.volumeStates,[r]:i}},t}case Dle:{const r={...t.infoCardElementStates};return Object.getOwnPropertyNames(r).forEach(i=>{r[i]={...r[i],visible:e.visibleElements.includes(i)}}),t={...t,infoCardElementStates:r},ll(t),t}case Lle:{const{elementType:r,viewMode:i}=e,o={...t,infoCardElementStates:{...t.infoCardElementStates,[r]:{...t.infoCardElementStates[r],viewMode:i}}};return ll(o),o}case Nle:return{...t,activities:{...t.activities,[e.id]:e.message}};case $le:{const r={...t.activities};return delete r[e.id],{...t,activities:r}}case Fle:{const r=e.locale;return fe.locale=r,r!==t.locale&&(t={...t,locale:r},ll(t)),t}case Ble:{const r=e.dialogId;return{...t,dialogOpen:{...t.dialogOpen,[r]:!0}}}case zle:{const r=e.dialogId;return{...t,dialogOpen:{...t.dialogOpen,[r]:!1}}}case ble:{const{selectedDataset2Id:r,selectedVariable2Name:i}=e;return r===t.selectedDataset2Id&&i===t.selectedVariable2Name?{...t,selectedDataset2Id:null,selectedVariable2Name:null,variableCompareMode:!1,variableSplitPos:void 0}:{...t,selectedDataset2Id:r,selectedVariable2Name:i,variableCompareMode:!0}}case nz:if(t.selectedServerId!==e.selectedServerId)return{...t,selectedServerId:e.selectedServerId}}return t}function x8t(t,e,n){let r=t.selectedPlaceGroupIds;return!t.selectedPlaceGroupIds||t.selectedPlaceGroupIds.length===0?r=[e]:t.selectedPlaceGroupIds.find(i=>i===e)||(r=[...t.selectedPlaceGroupIds,e]),{...t,selectedPlaceGroupIds:r,selectedPlaceId:n}}function b8t(){const t=Q6e(),e=[{...Kt.instance.server}];return t.forEach(n=>{e.find(r=>r.id===n.id)||e.push(n)}),{serverInfo:null,expressionCapabilities:null,datasets:[],colorBars:null,statistics:{loading:!1,records:[]},timeSeriesGroups:[],userPlaceGroups:[],userServers:e}}function _8t(t,e){switch(t===void 0&&(t=b8t()),e.type){case iE:return{...t,serverInfo:e.serverInfo};case nle:return{...t,expressionCapabilities:e.expressionCapabilities};case Yb:return{...t,datasets:e.datasets};case Wse:{const{datasetId:n,userVariables:r}=e,i=t.datasets.findIndex(l=>l.id===n),o=t.datasets[i],[a,s]=gB(o);return{...t,datasets:[...t.datasets.slice(0,i),{...o,variables:[...a,...r]},...t.datasets.slice(i+1)]}}case ile:{const{datasetId:n,variableName:r,colorBarName:i,colorBarMinMax:o,colorBarNorm:a,opacity:s}=e,l={colorBarName:i,colorBarMin:o[0],colorBarMax:o[1],colorBarNorm:a,opacity:s};return HJ(t,n,r,l)}case ale:{const{datasetId:n,variableName:r,volumeRenderMode:i,volumeIsoThreshold:o}=e;return HJ(t,n,r,{volumeRenderMode:i,volumeIsoThreshold:o})}case KB:{const n=e.placeGroup,r=t.datasets.map(i=>{if(i.placeGroups){const o=i.placeGroups.findIndex(a=>a.id===n.id);if(o>=0){const a=[...i.placeGroups];return a[o]=n,{...i,placeGroups:a}}}return i});return{...t,datasets:r}}case ZB:{const{placeGroupTitle:n,id:r,properties:i,geometry:o}=e,a={type:"Feature",id:r,properties:i,geometry:o},s=t.userPlaceGroups,l=s.findIndex(c=>c.id===Ws);if(l>=0){const c=s[l];return{...t,userPlaceGroups:[...s.slice(0,l),{...c,features:[...c.features,a]},...s.slice(l+1)]}}else{const c=n&&n!==""?n:fe.get("My places");return{...t,userPlaceGroups:[{type:"FeatureCollection",id:Ws,title:c,features:[a]},...s]}}}case JB:{const{placeGroups:n}=e;return{...t,userPlaceGroups:[...t.userPlaceGroups,...n]}}case ez:{const{placeGroupId:n,newName:r}=e,i=t.userPlaceGroups,o=i.findIndex(a=>a.id===n);if(o>=0){const a=i[o];return{...t,userPlaceGroups:[...i.slice(0,o),{...a,title:r},...i.slice(o+1)]}}return t}case Gse:{const{placeGroupId:n,placeId:r,newName:i}=e,o=t.userPlaceGroups,a=XJ(o,n,r,{label:i});return a?{...t,userPlaceGroups:a}:t}case Hse:{const{placeGroupId:n,placeId:r,placeStyle:i}=e,o=t.userPlaceGroups,a=XJ(o,n,r,i);return a?{...t,userPlaceGroups:a}:t}case tz:{const{placeGroupId:n,placeId:r}=e,i=t.userPlaceGroups,o=i.findIndex(a=>a.id===n);if(o>=0){const a=i[o],s=a.features.findIndex(l=>l.id===r);if(s>=0){const l=qJ(t.timeSeriesGroups,[r]);let c=t.timeSeriesGroups;return l.forEach(u=>{c=BD(c,u,"remove","append")}),{...t,userPlaceGroups:[...i.slice(0,o),{...a,features:[...a.features.slice(0,s),...a.features.slice(s+1)]},...i.slice(o+1)],timeSeriesGroups:c}}}return t}case qse:{const{placeGroupId:n}=e,r=t.userPlaceGroups,i=r.findIndex(o=>o.id===n);if(i>=0){const a=r[i].features.map(c=>c.id),s=qJ(t.timeSeriesGroups,a);let l=t.timeSeriesGroups;return s.forEach(c=>{l=BD(l,c,"remove","append")}),{...t,userPlaceGroups:[...r.slice(0,i),...r.slice(i+1)],timeSeriesGroups:l}}return t}case rle:return{...t,colorBars:e.colorBars};case Zse:{const{timeSeriesGroupId:n,timeSeries:r}=e,i=t.timeSeriesGroups,o=i.findIndex(l=>l.id===n),a=i[o],s=[...i];return s[o]={...a,timeSeriesArray:[...a.timeSeriesArray,r]},{...t,timeSeriesGroups:s}}case Qse:{const n=t.statistics;if(e.statistics===null)return{...t,statistics:{...n,loading:!0}};const r=n.records;return{...t,statistics:{...n,loading:!1,records:[e.statistics,...r]}}}case Yse:{const{index:n}=e,r=t.statistics,i=r.records;return{...t,statistics:{...r,records:[...i.slice(0,n),...i.slice(n+1)]}}}case Kse:{const{timeSeries:n,updateMode:r,dataMode:i}=e,o=BD(t.timeSeriesGroups,n,r,i);return o!==t.timeSeriesGroups?{...t,timeSeriesGroups:o}:t}case Jse:{const n=t.timeSeriesGroups.findIndex(r=>r.id===e.groupId);if(n>=0){const r=[...t.timeSeriesGroups],i={...r[n]},o=[...i.timeSeriesArray];return o.splice(e.index,1),i.timeSeriesArray=o,r[n]=i,{...t,timeSeriesGroups:r}}return t}case ele:{const n=t.timeSeriesGroups.findIndex(r=>r.id===e.id);if(n>=0){const r=[...t.timeSeriesGroups];return r.splice(n,1),{...t,timeSeriesGroups:r}}return t}case tle:return{...t,timeSeriesGroups:[]};case oz:{const{selectedGroupId:n,selectedValueRange:r}=e;if(!n)return t;const i=t.timeSeriesGroups.findIndex(a=>a.id===n),o=r||void 0;return{...t,timeSeriesGroups:[...t.timeSeriesGroups.slice(0,i),{...t.timeSeriesGroups[i],variableRange:o},...t.timeSeriesGroups.slice(i+1)]}}case nz:return t.userServers!==e.servers?(X6e(e.servers),{...t,userServers:e.servers}):t;default:return t}}function HJ(t,e,n,r){const i=t.datasets.findIndex(o=>o.id===e);if(i>=0){const o=t.datasets[i],a=o.variables.findIndex(s=>s.name===n);if(a>=0){const s=o.variables[a],l=t.datasets.slice(),c=o.variables.slice();return c[a]={...s,...r},l[i]={...o,variables:c},{...t,datasets:l}}}return t}function BD(t,e,n,r){let i=e,o;const a=t.findIndex(s=>s.variableUnits===i.source.variableUnits);if(a>=0){const s=t[a],l=s.timeSeriesArray,c=l.findIndex(f=>f.source.datasetId===i.source.datasetId&&f.source.variableName===i.source.variableName&&f.source.placeId===i.source.placeId);let u;if(c>=0){const f=l[c];r==="append"&&(i={...i,data:[...i.data,...f.data]}),n==="replace"?u=[i]:n==="add"?(u=l.slice(),u[c]=i):(u=l.slice(),u.splice(c,1))}else n==="replace"?u=[i]:n==="add"?u=[i,...l]:u=l;n==="replace"?o=[{...s,timeSeriesArray:u}]:n==="add"?(o=t.slice(),o[a]={...s,timeSeriesArray:u}):u.length>=0?(o=t.slice(),o[a]={...s,timeSeriesArray:u}):(o=t.slice(),o.splice(a,1))}else n==="replace"?o=[{id:Js("ts-"),variableUnits:i.source.variableUnits,timeSeriesArray:[i]}]:n==="add"?o=[{id:Js("ts-"),variableUnits:i.source.variableUnits,timeSeriesArray:[i]},...t]:o=t;return o}function qJ(t,e){const n=[];return t.forEach(r=>{r.timeSeriesArray.forEach(i=>{e.forEach(o=>{i.source.placeId===o&&n.push(i)})})}),n}function XJ(t,e,n,r){const i=t.findIndex(o=>o.id===e);if(i>=0){const o=t[i],a=o.features,s=a.findIndex(l=>l.id===n);if(s>=0){const l=a[s];return[...t.slice(0,i),{...o,features:[...a.slice(0,s),{...l,properties:{...l.properties,...r}},...a.slice(s+1)]},...t.slice(i+1)]}}}function w8t(){return{newEntries:[],oldEntries:[]}}let S8t=0;function O8t(t,e){t===void 0&&(t=w8t());const n=t.newEntries;switch(e.type){case jse:{const r=e.messageType,i=e.messageText;let o=n.length?n[0]:null;return o&&r===o.type&&i===o.text?t:(o={id:++S8t,type:r,text:i},{...t,newEntries:[o,...n]})}case Bse:{const r=n.findIndex(i=>i.id===e.messageId);if(r>=0){const i=n[r],o=[...n];o.splice(r,1);const a=[i,...t.oldEntries];return{...t,newEntries:o,oldEntries:a}}}}return t}function C8t(){return{accessToken:null}}function T8t(t,e){switch(t===void 0&&(t=C8t()),e.type){case Nce:return{...t,accessToken:e.accessToken}}return t}function E8t(t,e){return{dataState:_8t(t&&t.dataState,e),controlState:y8t(t&&t.controlState,e,t),messageLogState:O8t(t&&t.messageLogState,e),userAuthState:T8t(t&&t.userAuthState,e)}}Kt.load().then(()=>{const t=(o,a)=>a.type!==iz,e=K_e.createLogger({collapsed:!0,diff:!1,predicate:t}),n=Y_e(une,e),r=lne(E8t,n),i=r.dispatch;i(jle(r.getState().controlState.locale)),i(W8e()),r.getState().controlState.privacyNoticeAccepted&&i(rz()),qv.render(w.jsx(Gbe,{store:r,children:w.jsx(v8t,{})}),document.getElementById("root"))});
